diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ + diff --git a/Condiment-Regular.ttf b/Condiment-Regular.ttf new file mode 100644 index 0000000..2768bab Binary files /dev/null and b/Condiment-Regular.ttf differ diff --git a/Fondamento-Italic.ttf b/Fondamento-Italic.ttf new file mode 100644 index 0000000..491be72 Binary files /dev/null and b/Fondamento-Italic.ttf differ diff --git a/Fondamento-Regular.ttf b/Fondamento-Regular.ttf new file mode 100644 index 0000000..9aa7394 Binary files /dev/null and b/Fondamento-Regular.ttf differ diff --git a/GothicLeaf.ttf b/GothicLeaf.ttf new file mode 100644 index 0000000..9dee5bc Binary files /dev/null and b/GothicLeaf.ttf differ diff --git a/JimNightshade-Regular.ttf b/JimNightshade-Regular.ttf new file mode 100644 index 0000000..69d6148 Binary files /dev/null and b/JimNightshade-Regular.ttf differ diff --git a/Kings-Regular.ttf b/Kings-Regular.ttf new file mode 100644 index 0000000..28e7eda Binary files /dev/null and b/Kings-Regular.ttf differ diff --git a/UnifrakturMaguntia-Regular.ttf b/UnifrakturMaguntia-Regular.ttf new file mode 100644 index 0000000..3ae4d69 Binary files /dev/null and b/UnifrakturMaguntia-Regular.ttf differ diff --git a/_app/env.js b/_app/env.js new file mode 100644 index 0000000..0944fd3 --- /dev/null +++ b/_app/env.js @@ -0,0 +1 @@ +export const env={"PUBLIC_REGISTRAR_URL":"https://us-central1-nottingham-420415.cloudfunctions.net/registrar","PUBLIC_CONTEST_DEPLOYED_BLOCK":"2691018","PUBLIC_MAINTENANCE_MODE":"","PUBLIC_RPC_URL":"https://sepolia.era.zksync.dev","PUBLIC_INVITE_ONLY":"","PUBLIC_GH_CLIENT_ID":"Ov23limY2NSRpoMnVolm","PUBLIC_CONTEST_ADDRESS":"0xE8582331D79948887B52A8092a5983288275F60E","PUBLIC_PROJECT_ID":"4bd7b24c55f8dc771ec3120f569f3e9c","PUBLIC_SEASON_DURATION_SECONDS":"432000","PUBLIC_DATA_URL":"https://us-central1-nottingham-420415.cloudfunctions.net/data","PUBLIC_CHAIN_ID":"300","PUBLIC_ANNOUNCEMENT":""} \ No newline at end of file diff --git a/_app/immutable/assets/2.B_eOxCME.css b/_app/immutable/assets/2.B_eOxCME.css new file mode 100644 index 0000000..8db0f67 --- /dev/null +++ b/_app/immutable/assets/2.B_eOxCME.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}button.svelte-fbt74d:not(.custom){cursor:pointer;border-image:url(../../../button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00;transition:transform .05s ease-out}button.svelte-fbt74d:not(.custom):hover{transform:translate(.25em)}button.svelte-fbt74d{--size:4em;--sheet-url:none;--row:0;--col:0;--rows:1;--cols:1;--bg-size:calc(var(--cols) * var(--size)) calc(var(--rows) * var(--size));--bg-pos:calc(-1 * var(--col) * var(--size)) calc(-1 * var(--row) * var(--size));--sheet-url-hover:var(--sheet-url);--row-hover:var(--row);--col-hover:var(--col);--rows-hover:var(--rows);--cols-hover:var(--cols);--bg-size-hover:calc(var(--cols-hover) * var(--size)) calc(var(--rows-hover) * var(--size));--bg-pos-hover:calc(-1 * var(--col-hover) * var(--size)) calc(-1 * var(--row-hover) * var(--size));background:none;border:none;cursor:pointer;background-repeat:no-repeat;width:var(--size);height:var(--size);background-image:var(--sheet-url);background-size:var(--bg-size);background-position:var(--bg-pos)}button.svelte-fbt74d:hover{background-image:var(--sheet-url-hover);background-size:var(--bg-size-hover);background-position:var(--bg-pos-hover);transform:scale(1.05) rotate(10deg)}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}.tome.svelte-eo5hzb>.content.svelte-eo5hzb.svelte-eo5hzb{font-family:Fondamento;font-weight:bolder}header.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{font-family:Nightshade;font-weight:700;font-size:1.2em;letter-spacing:.1ex}a[href].svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{text-decoration:none;color:#892d38}a[href].svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb:hover{text-decoration:underline}a[href].svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb:visited{color:#892d38}header.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{margin:0 2ex 1rem 2ex;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}@media (max-width: 768px){header.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{flex-direction:column;gap:1em}}header.svelte-eo5hzb>.left.svelte-eo5hzb.svelte-eo5hzb{display:flex;align-self:start;justify-content:right;flex-wrap:wrap}@media (max-width: 768px){header.svelte-eo5hzb>.left.svelte-eo5hzb.svelte-eo5hzb{flex-direction:row;align-self:center}}header.svelte-eo5hzb>.left.svelte-eo5hzb>.svelte-eo5hzb:not(:last-child):after{content:"|";margin:0 .5ex}header.svelte-eo5hzb>.right.svelte-eo5hzb.svelte-eo5hzb{align-self:end;display:flex;justify-content:right;flex-wrap:wrap}@media (max-width: 768px){header.svelte-eo5hzb>.right.svelte-eo5hzb.svelte-eo5hzb{align-self:center}}header.svelte-eo5hzb>.right.svelte-eo5hzb>.svelte-eo5hzb:not(:last-child):after{content:"|";margin:0 .5ex}header.svelte-eo5hzb .wallet-status.svelte-eo5hzb.svelte-eo5hzb{vertical-align:top;display:flex;flex-direction:row;align-items:center;gap:2ex}header.svelte-eo5hzb .wallet-status .wallet-address.svelte-eo5hzb.svelte-eo5hzb{display:inline-block;overflow:hidden;max-width:128px;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}header.svelte-eo5hzb .wallet-status .player-name.svelte-eo5hzb.svelte-eo5hzb{text-decoration:underline}.tome.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{--border-width:4rem;--border-padding:1.5rem;position:relative;min-height:calc(100vh - 2 * (var(--border-width) + var(--border-padding)));padding:calc(var(--border-width) + var(--border-padding));border-image:url(../../../page-border.png) 15.5% 16%/var(--border-width) round;font-size:1.25rem}@media (max-width: 768px){.tome.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{font-size:1.1rem;padding:calc(var(--border-width) + var(--border-padding)) 0;border-image:url(../../../page-border.png) 15.5% 15%/var(--border-width) 0 round}}.tome.svelte-eo5hzb>.bg.svelte-eo5hzb.svelte-eo5hzb{pointer-events:none;position:absolute;z-index:-100;top:0;right:0;bottom:0;left:0;background:url(../../../aged-paper.png);background-size:100% auto;background-repeat:cover repeat;background-color:#8c5834;background-blend-mode:hard-light;mix-blend-mode:multiply}.tome.svelte-eo5hzb>.ghost.svelte-eo5hzb.svelte-eo5hzb{overflow-y:hidden;position:absolute;z-index:-100;bottom:10vh;left:-10ex;mix-blend-mode:color-burn;opacity:.75;width:90%}@media (max-width: 768px){.tome.svelte-eo5hzb>.ghost.svelte-eo5hzb.svelte-eo5hzb{width:100%;left:0}}.tome.svelte-eo5hzb>.music-toggle.svelte-eo5hzb.svelte-eo5hzb{cursor:pointer;position:fixed;right:0;top:0;width:var(--border-width);height:var(--border-width)}.tome.svelte-eo5hzb>.content.svelte-eo5hzb.svelte-eo5hzb{max-width:1024px;margin:0 auto;overflow:visible} diff --git a/_app/immutable/assets/3.CRFnXZ6I.css b/_app/immutable/assets/3.CRFnXZ6I.css new file mode 100644 index 0000000..697b6a1 --- /dev/null +++ b/_app/immutable/assets/3.CRFnXZ6I.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}h3.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{text-indent:1ex}a[href].svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{text-decoration:none;color:#892d38}a[href].svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19:hover{text-decoration:underline}a[href].svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19:visited{color:#892d38}.smaller.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{font-size:.66em}.season.svelte-1a5wz19>h3.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{margin-bottom:.25em}.season.svelte-1a5wz19>h3 .leaf.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{height:1.25em;margin-bottom:-.25em}.season.svelte-1a5wz19>.tournaments.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{margin-left:5ex}.season.svelte-1a5wz19>.tournaments.svelte-1a5wz19>.entry.svelte-1a5wz19.svelte-1a5wz19{display:flex;flex-wrap:wrap;gap:0 2ex;margin-bottom:.25em}.season.svelte-1a5wz19>.tournaments.svelte-1a5wz19>.entry.svelte-1a5wz19>h3.svelte-1a5wz19{margin:0}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:not(:first-of-type){margin-top:2em}h1.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:first-of-type,h2.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:first-of-type{margin-top:0}h1.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8,h2.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{margin-bottom:.5em;color:#b08a28}h1.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8,h2.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8,h3.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{text-indent:1ex}h2.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{color:#b06e28}h1.svelte-1hkdvg8+p.svelte-1hkdvg8.svelte-1hkdvg8,h2.svelte-1hkdvg8+p.svelte-1hkdvg8.svelte-1hkdvg8{margin-top:.25em}a[href].svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{text-decoration:none;color:#892d38}a[href].svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:hover{text-decoration:underline}a[href].svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:visited{color:#892d38}.illustration.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{float:right;height:8em}@media (max-width: 768px){.illustration.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{float:none;margin:0 auto;width:fit-content}}.illustration.svelte-1hkdvg8>img.svelte-1hkdvg8.svelte-1hkdvg8{height:100%}.illustration.svelte-1hkdvg8>img.svelte-1hkdvg8.svelte-1hkdvg8:nth-child(1){transform:scaleX(-1)}section.svelte-1hkdvg8>ul.svelte-1hkdvg8>li.svelte-1hkdvg8{margin-bottom:.5em} diff --git a/_app/immutable/assets/4.GU4_W7vQ.css b/_app/immutable/assets/4.GU4_W7vQ.css new file mode 100644 index 0000000..f3126fe --- /dev/null +++ b/_app/immutable/assets/4.GU4_W7vQ.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-1n3ogzk.svelte-1n3ogzk:not(:first-of-type){margin-top:2em}h1.svelte-1n3ogzk.svelte-1n3ogzk:first-of-type,h2.svelte-1n3ogzk.svelte-1n3ogzk:first-of-type{margin-top:0}h1.svelte-1n3ogzk.svelte-1n3ogzk,h2.svelte-1n3ogzk.svelte-1n3ogzk{margin-bottom:.5em;color:#b08a28}h1.svelte-1n3ogzk.svelte-1n3ogzk,h2.svelte-1n3ogzk.svelte-1n3ogzk,h3.svelte-1n3ogzk.svelte-1n3ogzk{text-indent:1ex}h2.svelte-1n3ogzk.svelte-1n3ogzk{color:#b06e28}h1.svelte-1n3ogzk+p.svelte-1n3ogzk{margin-top:.25em}a[href].svelte-1n3ogzk.svelte-1n3ogzk{text-decoration:none;color:#892d38}a[href].svelte-1n3ogzk.svelte-1n3ogzk:hover{text-decoration:underline}a[href].svelte-1n3ogzk.svelte-1n3ogzk:visited{color:#892d38}.matches.svelte-1n3ogzk .matches-grid.svelte-1n3ogzk{display:flex;flex-wrap:wrap;gap:0 4ex}.matches.svelte-1n3ogzk .matches-grid .match.svelte-1n3ogzk{width:fit-content}.matches.svelte-1n3ogzk .matches-grid .match h3.svelte-1n3ogzk{margin-bottom:.25em;border-bottom:1px solid #777}.matches.svelte-1n3ogzk .matches-grid .match ol.svelte-1n3ogzk{margin-top:0}.smaller.svelte-1n3ogzk.svelte-1n3ogzk{font-size:.8em} diff --git a/_app/immutable/assets/5.BBC0mU7b.css b/_app/immutable/assets/5.BBC0mU7b.css new file mode 100644 index 0000000..f5cbdba --- /dev/null +++ b/_app/immutable/assets/5.BBC0mU7b.css @@ -0,0 +1 @@ +@charset "UTF-8";:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(:first-of-type){margin-top:2em}h1.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:first-of-type,h2.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:first-of-type{margin-top:0}h1.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4,h2.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{margin-bottom:.5em;color:#b08a28}h1.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4,h2.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{text-indent:1ex}h2.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{color:#b06e28}a[href].svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{text-decoration:none;color:#892d38}a[href].svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:hover{text-decoration:underline}a[href].svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:visited{color:#892d38}button.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(.custom){cursor:pointer;border-image:url(../../../button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00;transition:transform .05s ease-out}button.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(.custom):hover{transform:translate(.25em)}.round-header.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{display:flex;flex-direction:row;width:100%;align-items:baseline;gap:1ex}.round-header.svelte-1a9vzk4>.left.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4,.round-header.svelte-1a9vzk4>.right.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{background:url(../../../charcoal-hl.png) repeat-x;background-size:18ex 120%;height:1em}.round-header.svelte-1a9vzk4>.left.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{flex:0 1 2ex}.round-header.svelte-1a9vzk4>.right.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{flex:1 1 1ex}.round-header.svelte-1a9vzk4>.title.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{flex:0 0 fit-content;margin:0;text-indent:0}.builder.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:before{content:"🤠 ";font-size:.75em}.summary.svelte-1a9vzk4>.player.svelte-1a9vzk4>.balance.svelte-1a9vzk4.svelte-1a9vzk4{margin-left:2ex}.summary.svelte-1a9vzk4>.player.svelte-1a9vzk4>.balance.svelte-1a9vzk4>.delta.svelte-1a9vzk4{font-size:.9em;margin-left:1ex;color:#570}.summary.svelte-1a9vzk4>.player.svelte-1a9vzk4>.balance.svelte-1a9vzk4>.delta.decreased.svelte-1a9vzk4{color:#c30}.round.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{margin-bottom:1em}.round.svelte-1a9vzk4>.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(:last-child){margin-bottom:1em}.player.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(:last-child){margin-bottom:.5em}.block.svelte-1a9vzk4>.steps.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{display:none;margin-left:2ex;counter-reset:block-activity}.block.svelte-1a9vzk4>.steps.svelte-1a9vzk4>.step.svelte-1a9vzk4.svelte-1a9vzk4{counter-increment:block-activity}.block.svelte-1a9vzk4>.steps.svelte-1a9vzk4>.step.svelte-1a9vzk4.svelte-1a9vzk4:not(:last-child){margin-bottom:.5em}.block.svelte-1a9vzk4>.steps.svelte-1a9vzk4>.step.svelte-1a9vzk4.svelte-1a9vzk4:before{content:counter(block-activity) ")";font-style:italic;margin-right:1.5ex;font-size:.9em;opacity:.9;vertical-align:super}.block.svelte-1a9vzk4>.steps .swaps.svelte-1a9vzk4>.swap.svelte-1a9vzk4.svelte-1a9vzk4{margin-left:6ex}.block.svelte-1a9vzk4>.expand button.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{margin:0 0 .5em;padding:0;background:none;border:none;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit}.block.svelte-1a9vzk4>.expand.svelte-1a9vzk4>button.svelte-1a9vzk4.svelte-1a9vzk4{cursor:pointer}.block.svelte-1a9vzk4>.expand.svelte-1a9vzk4>button.svelte-1a9vzk4>.prefix.svelte-1a9vzk4:after{content:"[+] Show"}.block.expanded.svelte-1a9vzk4>.steps.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{display:block}.block.expanded.svelte-1a9vzk4>.expand.svelte-1a9vzk4>button.svelte-1a9vzk4>.prefix.svelte-1a9vzk4:after{content:"[-] Hide"} diff --git a/_app/immutable/assets/6.DKcY9bj4.css b/_app/immutable/assets/6.DKcY9bj4.css new file mode 100644 index 0000000..eaebcfd --- /dev/null +++ b/_app/immutable/assets/6.DKcY9bj4.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-65gwcy.svelte-65gwcy:not(:first-of-type){margin-top:2em}h1.svelte-65gwcy.svelte-65gwcy:first-of-type,h2.svelte-65gwcy.svelte-65gwcy:first-of-type{margin-top:0}h1.svelte-65gwcy.svelte-65gwcy,h2.svelte-65gwcy.svelte-65gwcy{margin-bottom:.5em;color:#b08a28}h1.svelte-65gwcy.svelte-65gwcy,h2.svelte-65gwcy.svelte-65gwcy,h3.svelte-65gwcy.svelte-65gwcy{text-indent:1ex}h2.svelte-65gwcy.svelte-65gwcy{color:#b06e28}h2.svelte-65gwcy+p.svelte-65gwcy{margin-top:.25em}a[href].svelte-65gwcy.svelte-65gwcy{text-decoration:none;color:#892d38}a[href].svelte-65gwcy.svelte-65gwcy:hover{text-decoration:underline}a[href].svelte-65gwcy.svelte-65gwcy:visited{color:#892d38}button.svelte-65gwcy.svelte-65gwcy:not(.custom){cursor:pointer;border-image:url(../../../button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00;transition:transform .05s ease-out}button.svelte-65gwcy.svelte-65gwcy:not(.custom):hover{transform:translate(.25em)}button:not(.custom)[disabled].svelte-65gwcy.svelte-65gwcy{opacity:.5;pointer-events:none}textarea.svelte-65gwcy.svelte-65gwcy{background:none;border:none;border-image:url(../../../text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}textarea.svelte-65gwcy.svelte-65gwcy:focus{outline:none}.alert.svelte-65gwcy.svelte-65gwcy{border-image:url(../../../attention-border.png) 50% 12%/.75em 2ex round;padding:.2em 2ex;margin:1em auto;text-align:center;width:fit-content}.tournament-result.svelte-65gwcy.svelte-65gwcy{display:grid;grid:auto/repeat(5,1fr);flex-direction:row;gap:1ex}.tournament-result.header.svelte-65gwcy.svelte-65gwcy{text-decoration:underline;margin-bottom:.5em}.submit-bytecode.svelte-65gwcy.svelte-65gwcy{display:flex;flex-direction:column}.submit-bytecode.svelte-65gwcy .bytecode.svelte-65gwcy{font-family:monospace;font-size:1.1em;letter-spacing:-.33ex;display:block;width:0 auto}.submit-bytecode.svelte-65gwcy button.svelte-65gwcy{flex:0 1 fit-content;justify-self:end;align-self:flex-end;width:20ex}.name.svelte-65gwcy.svelte-65gwcy{font-size:1.25em;color:#2549b5!important}.error.svelte-65gwcy.svelte-65gwcy{color:red}.address.svelte-65gwcy.svelte-65gwcy{text-overflow:ellipsis;overflow:hidden} diff --git a/_app/immutable/assets/7.DTmGcCGK.css b/_app/immutable/assets/7.DTmGcCGK.css new file mode 100644 index 0000000..ed6e8c2 --- /dev/null +++ b/_app/immutable/assets/7.DTmGcCGK.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-u14j1h.svelte-u14j1h:not(:first-of-type){margin-top:2em}h1.svelte-u14j1h.svelte-u14j1h:first-of-type{margin-top:0}h1.svelte-u14j1h.svelte-u14j1h{margin-bottom:.5em;color:#b08a28}h1.svelte-u14j1h.svelte-u14j1h{text-indent:1ex}a[href].svelte-u14j1h.svelte-u14j1h{text-decoration:none;color:#892d38}a[href].svelte-u14j1h.svelte-u14j1h:hover{text-decoration:underline}a[href].svelte-u14j1h.svelte-u14j1h:visited{color:#892d38}ol.svelte-u14j1h.svelte-u14j1h{max-width:min-content;padding-inline-start:0}li.svelte-u14j1h.svelte-u14j1h{display:flex;gap:4ex;justify-content:space-between}.sort-options.svelte-u14j1h.svelte-u14j1h{display:flex;gap:1ex}.sort-options.svelte-u14j1h>.opt.svelte-u14j1h:not(:last-child):after{content:", "}.sort-options.svelte-u14j1h>.opt.svelte-u14j1h:last-child:after{content:"."} diff --git a/_app/immutable/assets/8.CrOac76a.css b/_app/immutable/assets/8.CrOac76a.css new file mode 100644 index 0000000..4a8e404 --- /dev/null +++ b/_app/immutable/assets/8.CrOac76a.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-b1tb46.svelte-b1tb46:not(:first-of-type){margin-top:2em}h1.svelte-b1tb46.svelte-b1tb46:first-of-type{margin-top:0}h1.svelte-b1tb46.svelte-b1tb46{margin-bottom:.5em;color:#b08a28}h1.svelte-b1tb46.svelte-b1tb46{text-indent:1ex}h1.svelte-b1tb46+p.svelte-b1tb46{margin-top:.25em}a[href].svelte-b1tb46.svelte-b1tb46{text-decoration:none;color:#892d38}a[href].svelte-b1tb46.svelte-b1tb46:hover{text-decoration:underline}a[href].svelte-b1tb46.svelte-b1tb46:visited{color:#892d38}button.svelte-b1tb46.svelte-b1tb46:not(.custom){cursor:pointer;border-image:url(../../../button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00;transition:transform .05s ease-out}button.svelte-b1tb46.svelte-b1tb46:not(.custom):hover{transform:translate(.25em)}button:not(.custom)[disabled].svelte-b1tb46.svelte-b1tb46{opacity:.5;pointer-events:none}input.svelte-b1tb46.svelte-b1tb46:not([type]){background:none;border:none;border-image:url(../../../text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}input.svelte-b1tb46.svelte-b1tb46:not([type]):focus{outline:none}.error.svelte-b1tb46.svelte-b1tb46{margin:1em auto;color:red}.auth-form.svelte-b1tb46.svelte-b1tb46{display:flex;flex-direction:column;align-items:center}.auth-form.svelte-b1tb46 iframe.svelte-b1tb46{display:block;width:90%;height:16em;margin:0 auto;background-color:transparent}.auth-form.svelte-b1tb46 .checkboxes.svelte-b1tb46{margin-top:1em}.register-form.svelte-b1tb46.svelte-b1tb46{margin:0 auto;width:fit-content;display:flex;flex-direction:column;flex-wrap:wrap;align-items:center}.register-form.svelte-b1tb46 .inputs.svelte-b1tb46{display:flex;align-items:center;flex-wrap:wrap;gap:2ex}@media (max-width: 768px){.register-form.svelte-b1tb46 .inputs.svelte-b1tb46{flex-direction:column}}.register-form.svelte-b1tb46>div.svelte-b1tb46:last-child{align-self:end} diff --git a/_app/immutable/assets/9.DhJdzZU7.css b/_app/immutable/assets/9.DhJdzZU7.css new file mode 100644 index 0000000..274ab1b --- /dev/null +++ b/_app/immutable/assets/9.DhJdzZU7.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}h1.svelte-iqqi0o:first-of-type,h2.svelte-iqqi0o:first-of-type{margin-top:0}h1.svelte-iqqi0o,h2.svelte-iqqi0o{margin-bottom:.5em;color:#b08a28}h1.svelte-iqqi0o,h2.svelte-iqqi0o,h3.svelte-iqqi0o{text-indent:1ex}h2.svelte-iqqi0o{color:#b06e28}a[href].svelte-iqqi0o{text-decoration:none;color:#892d38}a[href].svelte-iqqi0o:hover{text-decoration:underline}a[href].svelte-iqqi0o:visited{color:#892d38} diff --git a/_app/immutable/assets/_layout.Bjtd2Xte.css b/_app/immutable/assets/_layout.Bjtd2Xte.css new file mode 100644 index 0000000..aa70eee --- /dev/null +++ b/_app/immutable/assets/_layout.Bjtd2Xte.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}button.svelte-fbt74d:not(.custom){cursor:pointer;border-image:url(/nottingham-frontend/button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00;transition:transform .05s ease-out}button.svelte-fbt74d:not(.custom):hover{transform:translate(.25em)}button.svelte-fbt74d{--size:4em;--sheet-url:none;--row:0;--col:0;--rows:1;--cols:1;--bg-size:calc(var(--cols) * var(--size)) calc(var(--rows) * var(--size));--bg-pos:calc(-1 * var(--col) * var(--size)) calc(-1 * var(--row) * var(--size));--sheet-url-hover:var(--sheet-url);--row-hover:var(--row);--col-hover:var(--col);--rows-hover:var(--rows);--cols-hover:var(--cols);--bg-size-hover:calc(var(--cols-hover) * var(--size)) calc(var(--rows-hover) * var(--size));--bg-pos-hover:calc(-1 * var(--col-hover) * var(--size)) calc(-1 * var(--row-hover) * var(--size));background:none;border:none;cursor:pointer;background-repeat:no-repeat;width:var(--size);height:var(--size);background-image:var(--sheet-url);background-size:var(--bg-size);background-position:var(--bg-pos)}button.svelte-fbt74d:hover{background-image:var(--sheet-url-hover);background-size:var(--bg-size-hover);background-position:var(--bg-pos-hover);transform:scale(1.05) rotate(10deg)}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}.tome.svelte-eo5hzb>.content.svelte-eo5hzb.svelte-eo5hzb{font-family:Fondamento;font-weight:bolder}header.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{font-family:Nightshade;font-weight:700;font-size:1.2em;letter-spacing:.1ex}a[href].svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{text-decoration:none;color:#892d38}a[href].svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb:hover{text-decoration:underline}a[href].svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb:visited{color:#892d38}header.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{margin:0 2ex 1rem 2ex;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}@media (max-width: 768px){header.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{flex-direction:column;gap:1em}}header.svelte-eo5hzb>.left.svelte-eo5hzb.svelte-eo5hzb{display:flex;align-self:start;justify-content:right;flex-wrap:wrap}@media (max-width: 768px){header.svelte-eo5hzb>.left.svelte-eo5hzb.svelte-eo5hzb{flex-direction:row;align-self:center}}header.svelte-eo5hzb>.left.svelte-eo5hzb>.svelte-eo5hzb:not(:last-child):after{content:"|";margin:0 .5ex}header.svelte-eo5hzb>.right.svelte-eo5hzb.svelte-eo5hzb{align-self:end;display:flex;justify-content:right;flex-wrap:wrap}@media (max-width: 768px){header.svelte-eo5hzb>.right.svelte-eo5hzb.svelte-eo5hzb{align-self:center}}header.svelte-eo5hzb>.right.svelte-eo5hzb>.svelte-eo5hzb:not(:last-child):after{content:"|";margin:0 .5ex}header.svelte-eo5hzb .wallet-status.svelte-eo5hzb.svelte-eo5hzb{vertical-align:top;display:flex;flex-direction:row;align-items:center;gap:2ex}header.svelte-eo5hzb .wallet-status .wallet-address.svelte-eo5hzb.svelte-eo5hzb{display:inline-block;overflow:hidden;max-width:128px;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}header.svelte-eo5hzb .wallet-status .player-name.svelte-eo5hzb.svelte-eo5hzb{text-decoration:underline}.tome.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{--border-width:4rem;--border-padding:1.5rem;position:relative;min-height:calc(100vh - 2 * (var(--border-width) + var(--border-padding)));padding:calc(var(--border-width) + var(--border-padding));border-image:url(/nottingham-frontend/page-border.png) 15.5% 16%/var(--border-width) round;font-size:1.25rem}@media (max-width: 768px){.tome.svelte-eo5hzb.svelte-eo5hzb.svelte-eo5hzb{font-size:1.1rem;padding:calc(var(--border-width) + var(--border-padding)) 0;border-image:url(/nottingham-frontend/page-border.png) 15.5% 15%/var(--border-width) 0 round}}.tome.svelte-eo5hzb>.bg.svelte-eo5hzb.svelte-eo5hzb{pointer-events:none;position:absolute;z-index:-100;inset:0;background:url(/nottingham-frontend/aged-paper.png);background-size:100% auto;background-repeat:cover repeat;background-color:#8c5834;background-blend-mode:hard-light;mix-blend-mode:multiply}.tome.svelte-eo5hzb>.ghost.svelte-eo5hzb.svelte-eo5hzb{overflow-y:hidden;position:absolute;z-index:-100;bottom:10vh;left:-10ex;mix-blend-mode:color-burn;opacity:.75;width:90%}@media (max-width: 768px){.tome.svelte-eo5hzb>.ghost.svelte-eo5hzb.svelte-eo5hzb{width:100%;left:0}}.tome.svelte-eo5hzb>.music-toggle.svelte-eo5hzb.svelte-eo5hzb{cursor:pointer;position:fixed;right:0;top:0;width:var(--border-width);height:var(--border-width)}.tome.svelte-eo5hzb>.content.svelte-eo5hzb.svelte-eo5hzb{max-width:1024px;margin:0 auto;overflow:visible} diff --git a/_app/immutable/assets/_page.B7MWzsHp.css b/_app/immutable/assets/_page.B7MWzsHp.css new file mode 100644 index 0000000..367b324 --- /dev/null +++ b/_app/immutable/assets/_page.B7MWzsHp.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-65gwcy.svelte-65gwcy:not(:first-of-type){margin-top:2em}h1.svelte-65gwcy.svelte-65gwcy:first-of-type,h2.svelte-65gwcy.svelte-65gwcy:first-of-type{margin-top:0}h1.svelte-65gwcy.svelte-65gwcy,h2.svelte-65gwcy.svelte-65gwcy{margin-bottom:.5em;color:#b08a28}h1.svelte-65gwcy.svelte-65gwcy,h2.svelte-65gwcy.svelte-65gwcy,h3.svelte-65gwcy.svelte-65gwcy{text-indent:1ex}h2.svelte-65gwcy.svelte-65gwcy{color:#b06e28}h2.svelte-65gwcy+p.svelte-65gwcy{margin-top:.25em}a[href].svelte-65gwcy.svelte-65gwcy{text-decoration:none;color:#892d38}a[href].svelte-65gwcy.svelte-65gwcy:hover{text-decoration:underline}a[href].svelte-65gwcy.svelte-65gwcy:visited{color:#892d38}button.svelte-65gwcy.svelte-65gwcy:not(.custom){cursor:pointer;border-image:url(/nottingham-frontend/button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00;transition:transform .05s ease-out}button.svelte-65gwcy.svelte-65gwcy:not(.custom):hover{transform:translate(.25em)}button:not(.custom)[disabled].svelte-65gwcy.svelte-65gwcy{opacity:.5;pointer-events:none}textarea.svelte-65gwcy.svelte-65gwcy{background:none;border:none;border-image:url(/nottingham-frontend/text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}textarea.svelte-65gwcy.svelte-65gwcy:focus{outline:none}.alert.svelte-65gwcy.svelte-65gwcy{border-image:url(/nottingham-frontend/attention-border.png) 50% 12%/.75em 2ex round;padding:.2em 2ex;margin:1em auto;text-align:center;width:fit-content}.tournament-result.svelte-65gwcy.svelte-65gwcy{display:grid;grid:auto/repeat(5,1fr);flex-direction:row;gap:1ex}.tournament-result.header.svelte-65gwcy.svelte-65gwcy{text-decoration:underline;margin-bottom:.5em}.submit-bytecode.svelte-65gwcy.svelte-65gwcy{display:flex;flex-direction:column}.submit-bytecode.svelte-65gwcy .bytecode.svelte-65gwcy{font-family:monospace;font-size:1.1em;letter-spacing:-.33ex;display:block;width:0 auto}.submit-bytecode.svelte-65gwcy button.svelte-65gwcy{flex:0 1 fit-content;justify-self:end;align-self:flex-end;width:20ex}.name.svelte-65gwcy.svelte-65gwcy{font-size:1.25em;color:#2549b5!important}.error.svelte-65gwcy.svelte-65gwcy{color:red}.address.svelte-65gwcy.svelte-65gwcy{text-overflow:ellipsis;overflow:hidden} diff --git a/_app/immutable/assets/_page.Bs9Tclqz.css b/_app/immutable/assets/_page.Bs9Tclqz.css new file mode 100644 index 0000000..a54a723 --- /dev/null +++ b/_app/immutable/assets/_page.Bs9Tclqz.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}h1.svelte-iqqi0o:first-of-type,h2.svelte-iqqi0o:first-of-type{margin-top:0}h1.svelte-iqqi0o,h2.svelte-iqqi0o{margin-bottom:.5em;color:#b08a28}h1.svelte-iqqi0o,h2.svelte-iqqi0o,h3.svelte-iqqi0o{text-indent:1ex}h2.svelte-iqqi0o{color:#b06e28}a[href].svelte-iqqi0o{text-decoration:none;color:#892d38}a[href].svelte-iqqi0o:hover{text-decoration:underline}a[href].svelte-iqqi0o:visited{color:#892d38} diff --git a/_app/immutable/assets/_page.DepZxh6h.css b/_app/immutable/assets/_page.DepZxh6h.css new file mode 100644 index 0000000..9b8d2d8 --- /dev/null +++ b/_app/immutable/assets/_page.DepZxh6h.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-u14j1h.svelte-u14j1h:not(:first-of-type){margin-top:2em}h1.svelte-u14j1h.svelte-u14j1h:first-of-type{margin-top:0}h1.svelte-u14j1h.svelte-u14j1h{margin-bottom:.5em;color:#b08a28}h1.svelte-u14j1h.svelte-u14j1h{text-indent:1ex}a[href].svelte-u14j1h.svelte-u14j1h{text-decoration:none;color:#892d38}a[href].svelte-u14j1h.svelte-u14j1h:hover{text-decoration:underline}a[href].svelte-u14j1h.svelte-u14j1h:visited{color:#892d38}ol.svelte-u14j1h.svelte-u14j1h{max-width:min-content;padding-inline-start:0}li.svelte-u14j1h.svelte-u14j1h{display:flex;gap:4ex;justify-content:space-between}.sort-options.svelte-u14j1h.svelte-u14j1h{display:flex;gap:1ex}.sort-options.svelte-u14j1h>.opt.svelte-u14j1h:not(:last-child):after{content:", "}.sort-options.svelte-u14j1h>.opt.svelte-u14j1h:last-child:after{content:"."} diff --git a/_app/immutable/assets/_page.DpsmCbaY.css b/_app/immutable/assets/_page.DpsmCbaY.css new file mode 100644 index 0000000..916fe9e --- /dev/null +++ b/_app/immutable/assets/_page.DpsmCbaY.css @@ -0,0 +1 @@ +@charset "UTF-8";:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(:first-of-type){margin-top:2em}h1.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:first-of-type,h2.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:first-of-type{margin-top:0}h1.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4,h2.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{margin-bottom:.5em;color:#b08a28}h1.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4,h2.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{text-indent:1ex}h2.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{color:#b06e28}a[href].svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{text-decoration:none;color:#892d38}a[href].svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:hover{text-decoration:underline}a[href].svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:visited{color:#892d38}button.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(.custom){cursor:pointer;border-image:url(/nottingham-frontend/button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00;transition:transform .05s ease-out}button.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(.custom):hover{transform:translate(.25em)}.round-header.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{display:flex;flex-direction:row;width:100%;align-items:baseline;gap:1ex}.round-header.svelte-1a9vzk4>.left.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4,.round-header.svelte-1a9vzk4>.right.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{background:url(/nottingham-frontend/charcoal-hl.png) repeat-x;background-size:18ex 120%;height:1em}.round-header.svelte-1a9vzk4>.left.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{flex:0 1 2ex}.round-header.svelte-1a9vzk4>.right.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{flex:1 1 1ex}.round-header.svelte-1a9vzk4>.title.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{flex:0 0 fit-content;margin:0;text-indent:0}.builder.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:before{content:"🤠 ";font-size:.75em}.summary.svelte-1a9vzk4>.player.svelte-1a9vzk4>.balance.svelte-1a9vzk4.svelte-1a9vzk4{margin-left:2ex}.summary.svelte-1a9vzk4>.player.svelte-1a9vzk4>.balance.svelte-1a9vzk4>.delta.svelte-1a9vzk4{font-size:.9em;margin-left:1ex;color:#570}.summary.svelte-1a9vzk4>.player.svelte-1a9vzk4>.balance.svelte-1a9vzk4>.delta.decreased.svelte-1a9vzk4{color:#c30}.round.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{margin-bottom:1em}.round.svelte-1a9vzk4>.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(:last-child){margin-bottom:1em}.player.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4:not(:last-child){margin-bottom:.5em}.block.svelte-1a9vzk4>.steps.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{display:none;margin-left:2ex;counter-reset:block-activity}.block.svelte-1a9vzk4>.steps.svelte-1a9vzk4>.step.svelte-1a9vzk4.svelte-1a9vzk4{counter-increment:block-activity}.block.svelte-1a9vzk4>.steps.svelte-1a9vzk4>.step.svelte-1a9vzk4.svelte-1a9vzk4:not(:last-child){margin-bottom:.5em}.block.svelte-1a9vzk4>.steps.svelte-1a9vzk4>.step.svelte-1a9vzk4.svelte-1a9vzk4:before{content:counter(block-activity) ")";font-style:italic;margin-right:1.5ex;font-size:.9em;opacity:.9;vertical-align:super}.block.svelte-1a9vzk4>.steps .swaps.svelte-1a9vzk4>.swap.svelte-1a9vzk4.svelte-1a9vzk4{margin-left:6ex}.block.svelte-1a9vzk4>.expand button.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{margin:0 0 .5em;padding:0;background:none;border:none;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit}.block.svelte-1a9vzk4>.expand.svelte-1a9vzk4>button.svelte-1a9vzk4.svelte-1a9vzk4{cursor:pointer}.block.svelte-1a9vzk4>.expand.svelte-1a9vzk4>button.svelte-1a9vzk4>.prefix.svelte-1a9vzk4:after{content:"[+] Show"}.block.expanded.svelte-1a9vzk4>.steps.svelte-1a9vzk4.svelte-1a9vzk4.svelte-1a9vzk4{display:block}.block.expanded.svelte-1a9vzk4>.expand.svelte-1a9vzk4>button.svelte-1a9vzk4>.prefix.svelte-1a9vzk4:after{content:"[-] Hide"} diff --git a/_app/immutable/assets/_page.Dzgfl61b.css b/_app/immutable/assets/_page.Dzgfl61b.css new file mode 100644 index 0000000..cde0aac --- /dev/null +++ b/_app/immutable/assets/_page.Dzgfl61b.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-b1tb46.svelte-b1tb46:not(:first-of-type){margin-top:2em}h1.svelte-b1tb46.svelte-b1tb46:first-of-type{margin-top:0}h1.svelte-b1tb46.svelte-b1tb46{margin-bottom:.5em;color:#b08a28}h1.svelte-b1tb46.svelte-b1tb46{text-indent:1ex}h1.svelte-b1tb46+p.svelte-b1tb46{margin-top:.25em}a[href].svelte-b1tb46.svelte-b1tb46{text-decoration:none;color:#892d38}a[href].svelte-b1tb46.svelte-b1tb46:hover{text-decoration:underline}a[href].svelte-b1tb46.svelte-b1tb46:visited{color:#892d38}button.svelte-b1tb46.svelte-b1tb46:not(.custom){cursor:pointer;border-image:url(/nottingham-frontend/button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00;transition:transform .05s ease-out}button.svelte-b1tb46.svelte-b1tb46:not(.custom):hover{transform:translate(.25em)}button:not(.custom)[disabled].svelte-b1tb46.svelte-b1tb46{opacity:.5;pointer-events:none}input.svelte-b1tb46.svelte-b1tb46:not([type]){background:none;border:none;border-image:url(/nottingham-frontend/text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}input.svelte-b1tb46.svelte-b1tb46:not([type]):focus{outline:none}.error.svelte-b1tb46.svelte-b1tb46{margin:1em auto;color:red}.auth-form.svelte-b1tb46.svelte-b1tb46{display:flex;flex-direction:column;align-items:center}.auth-form.svelte-b1tb46 iframe.svelte-b1tb46{display:block;width:90%;height:16em;margin:0 auto;background-color:transparent}.auth-form.svelte-b1tb46 .checkboxes.svelte-b1tb46{margin-top:1em}.register-form.svelte-b1tb46.svelte-b1tb46{margin:0 auto;width:fit-content;display:flex;flex-direction:column;flex-wrap:wrap;align-items:center}.register-form.svelte-b1tb46 .inputs.svelte-b1tb46{display:flex;align-items:center;flex-wrap:wrap;gap:2ex}@media (max-width: 768px){.register-form.svelte-b1tb46 .inputs.svelte-b1tb46{flex-direction:column}}.register-form.svelte-b1tb46>div.svelte-b1tb46:last-child{align-self:end} diff --git a/_app/immutable/assets/_page.QU33gFTM.css b/_app/immutable/assets/_page.QU33gFTM.css new file mode 100644 index 0000000..fac481e --- /dev/null +++ b/_app/immutable/assets/_page.QU33gFTM.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-1n3ogzk.svelte-1n3ogzk:not(:first-of-type){margin-top:2em}h1.svelte-1n3ogzk.svelte-1n3ogzk:first-of-type,h2.svelte-1n3ogzk.svelte-1n3ogzk:first-of-type{margin-top:0}h1.svelte-1n3ogzk.svelte-1n3ogzk,h2.svelte-1n3ogzk.svelte-1n3ogzk{margin-bottom:.5em;color:#b08a28}h1.svelte-1n3ogzk.svelte-1n3ogzk,h2.svelte-1n3ogzk.svelte-1n3ogzk,h3.svelte-1n3ogzk.svelte-1n3ogzk{text-indent:1ex}h2.svelte-1n3ogzk.svelte-1n3ogzk{color:#b06e28}h1.svelte-1n3ogzk+p.svelte-1n3ogzk{margin-top:.25em}a[href].svelte-1n3ogzk.svelte-1n3ogzk{text-decoration:none;color:#892d38}a[href].svelte-1n3ogzk.svelte-1n3ogzk:hover{text-decoration:underline}a[href].svelte-1n3ogzk.svelte-1n3ogzk:visited{color:#892d38}.matches.svelte-1n3ogzk .matches-grid.svelte-1n3ogzk{display:flex;flex-wrap:wrap;gap:0 4ex}.matches.svelte-1n3ogzk .matches-grid .match.svelte-1n3ogzk{width:fit-content}.matches.svelte-1n3ogzk .matches-grid .match h3.svelte-1n3ogzk{margin-bottom:.25em;border-bottom:1px solid #777}.matches.svelte-1n3ogzk .matches-grid .match ol.svelte-1n3ogzk{margin-top:0}.smaller.svelte-1n3ogzk.svelte-1n3ogzk{font-size:.8em} diff --git a/_app/immutable/assets/_page.o7tPK3S6.css b/_app/immutable/assets/_page.o7tPK3S6.css new file mode 100644 index 0000000..710c418 --- /dev/null +++ b/_app/immutable/assets/_page.o7tPK3S6.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}h3.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{text-indent:1ex}a[href].svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{text-decoration:none;color:#892d38}a[href].svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19:hover{text-decoration:underline}a[href].svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19:visited{color:#892d38}.smaller.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{font-size:.66em}.season.svelte-1a5wz19>h3.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{margin-bottom:.25em}.season.svelte-1a5wz19>h3 .leaf.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{height:1.25em;margin-bottom:-.25em}.season.svelte-1a5wz19>.tournaments.svelte-1a5wz19.svelte-1a5wz19.svelte-1a5wz19{margin-left:5ex}.season.svelte-1a5wz19>.tournaments.svelte-1a5wz19>.entry.svelte-1a5wz19.svelte-1a5wz19{display:flex;flex-wrap:wrap;gap:0 2ex;margin-bottom:.25em}.season.svelte-1a5wz19>.tournaments.svelte-1a5wz19>.entry.svelte-1a5wz19>h3.svelte-1a5wz19{margin:0}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:not(:first-of-type){margin-top:2em}h1.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:first-of-type,h2.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:first-of-type{margin-top:0}h1.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8,h2.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{margin-bottom:.5em;color:#b08a28}h1.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8,h2.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8,h3.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{text-indent:1ex}h2.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{color:#b06e28}h1.svelte-1hkdvg8+p.svelte-1hkdvg8.svelte-1hkdvg8,h2.svelte-1hkdvg8+p.svelte-1hkdvg8.svelte-1hkdvg8{margin-top:.25em}a[href].svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{text-decoration:none;color:#892d38}a[href].svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:hover{text-decoration:underline}a[href].svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8:visited{color:#892d38}.illustration.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{float:right;height:8em}@media (max-width: 768px){.illustration.svelte-1hkdvg8.svelte-1hkdvg8.svelte-1hkdvg8{float:none;margin:0 auto;width:fit-content}}.illustration.svelte-1hkdvg8>img.svelte-1hkdvg8.svelte-1hkdvg8{height:100%}.illustration.svelte-1hkdvg8>img.svelte-1hkdvg8.svelte-1hkdvg8:nth-child(1){transform:scaleX(-1)}section.svelte-1hkdvg8>ul.svelte-1hkdvg8>li.svelte-1hkdvg8{margin-bottom:.5em} diff --git a/_app/immutable/assets/page.B74nKIF7.css b/_app/immutable/assets/page.B74nKIF7.css new file mode 100644 index 0000000..53f3b83 --- /dev/null +++ b/_app/immutable/assets/page.B74nKIF7.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}:root{--size:5em}.spinner.svelte-h1u4hm{display:inline-block;background-image:url(../../../cat-spinner.png);width:var(--size);height:var(--size);background-repeat:no-repeat;background-size:calc(3 * var(--size));animation:svelte-h1u4hm-spin .33s steps(1,end) infinite;transform:scaleX(-1);filter:sepia(.5);display:flex;align-items:center}.spinner.failed.svelte-h1u4hm{animation:none;transform:scale(-1) rotate(12deg);background-position:calc(var(--size) * -2) 0}@keyframes svelte-h1u4hm-spin{0%{background-position:calc(var(--size) * -2) 0}33%{background-position:calc(var(--size) * -1) 0}66%{background-position:0 0}}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}.lede.svelte-cfvbhn>h1:first-letter{font-family:"Initial"}.lede.svelte-cfvbhn>h1:first-letter{font-style:normal;font-weight:100;font-size:3em;float:left;text-transform:capitalize;line-height:.95em;letter-spacing:.05ex;background:url(../../../gold-leaf-texture.jpg);background-size:100%;-webkit-background-clip:text;background-clip:text;color:#0000;padding-bottom:.05em}.lede.svelte-cfvbhn.svelte-cfvbhn{margin-bottom:1em}.lede.svelte-cfvbhn>h1{margin:0!important;color:#b08a28;text-indent:0!important}.lede.svelte-cfvbhn>p{margin-top:0}.lede.svelte-cfvbhn>p:nth-last-child(2){margin-bottom:0}.lede.svelte-cfvbhn>.svelte-cfvbhn:last-child{clear:both}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}.page.svelte-1uqupo.svelte-1uqupo{font-family:Fondamento;font-weight:bolder}.page.svelte-1uqupo.svelte-1uqupo{padding:1em 1ex;position:relative}.page.svelte-1uqupo .content.svelte-1uqupo{overflow:hidden} diff --git a/_app/immutable/assets/page.Cz4Ph5Ce.css b/_app/immutable/assets/page.Cz4Ph5Ce.css new file mode 100644 index 0000000..13235b6 --- /dev/null +++ b/_app/immutable/assets/page.Cz4Ph5Ce.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}:root{--size:5em}.spinner.svelte-h1u4hm{display:inline-block;background-image:url(/nottingham-frontend/cat-spinner.png);width:var(--size);height:var(--size);background-repeat:no-repeat;background-size:calc(3 * var(--size));animation:svelte-h1u4hm-spin .33s steps(1,end) infinite;transform:scaleX(-1);filter:sepia(.5);display:flex;align-items:center}.spinner.failed.svelte-h1u4hm{animation:none;transform:scale(-1) rotate(12deg);background-position:calc(var(--size) * -2) 0}@keyframes svelte-h1u4hm-spin{0%{background-position:calc(var(--size) * -2) 0}33%{background-position:calc(var(--size) * -1) 0}66%{background-position:0 0}}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}.lede.svelte-cfvbhn>h1:first-letter{font-family:"Initial"}.lede.svelte-cfvbhn>h1:first-letter{font-style:normal;font-weight:100;font-size:3em;float:left;text-transform:capitalize;line-height:.95em;letter-spacing:.05ex;background:url(/nottingham-frontend/gold-leaf-texture.jpg);background-size:100%;background-clip:text;color:#0000;padding-bottom:.05em}.lede.svelte-cfvbhn.svelte-cfvbhn{margin-bottom:1em}.lede.svelte-cfvbhn>h1{margin:0!important;color:#b08a28;text-indent:0!important}.lede.svelte-cfvbhn>p{margin-top:0}.lede.svelte-cfvbhn>p:nth-last-child(2){margin-bottom:0}.lede.svelte-cfvbhn>.svelte-cfvbhn:last-child{clear:both}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}.page.svelte-1uqupo.svelte-1uqupo{font-family:Fondamento;font-weight:bolder}.page.svelte-1uqupo.svelte-1uqupo{padding:1em 1ex;position:relative}.page.svelte-1uqupo .content.svelte-1uqupo{overflow:hidden} diff --git a/_app/immutable/assets/player.Cl2zdAgR.css b/_app/immutable/assets/player.Cl2zdAgR.css new file mode 100644 index 0000000..621a01e --- /dev/null +++ b/_app/immutable/assets/player.Cl2zdAgR.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}a[href].svelte-iqqi0o{text-decoration:none;color:#892d38}a[href].svelte-iqqi0o:hover{text-decoration:underline}a[href].svelte-iqqi0o:visited{color:#892d38} diff --git a/_app/immutable/assets/player.D3caVdN6.css b/_app/immutable/assets/player.D3caVdN6.css new file mode 100644 index 0000000..ab06e87 --- /dev/null +++ b/_app/immutable/assets/player.D3caVdN6.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}a[href].svelte-iqqi0o{text-decoration:none;color:#892d38}a[href].svelte-iqqi0o:hover{text-decoration:underline}a[href].svelte-iqqi0o:visited{color:#892d38} diff --git a/_app/immutable/chunks/2.DEesTFv4.js b/_app/immutable/chunks/2.DEesTFv4.js new file mode 100644 index 0000000..d1a94df --- /dev/null +++ b/_app/immutable/chunks/2.DEesTFv4.js @@ -0,0 +1,9250 @@ +const __vite__fileDeps=["./index.BW38xcfQ.js","./___vite-browser-external_commonjs-proxy.CXzVU9cb.js","./index.es.BbAz7DCx.js","./preload-helper.D6kgxu3v.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{s as Ul,c as l0,e as Ye,d as Ke,f as mt,i as Me,k as St,u as u0,g as d0,a as h0,o as Xo,Z as ch,z as p0,_ as f0,v as Ue,x as jl,n as Rn,$ as lh,b as xi,j as Ci,q as In,C as uh,l as qe,A as g0,a0 as dh,G as hh,t as ao,h as co,m as w0}from"./scheduler.gEqqeaCZ.js";import{S as Wl,i as zl,t as Ln,a as Bn,c as Fl,b as Hl,m as Vl,d as Zl,g as ph,e as fh}from"./index.BtSuiA6z.js";import{A as gh,B as wh,D as mh,E as Kt,v as nc,m as vh,n as bh,o as m0,t as yh,F as xh,G as Ch,a as _h,p as v0,r as Eh,J as Gl,K as Vt,R as Bc,L as Th,M as Ah,S as Un,N as b0,O as Sh,P as kh,x as $h,Q as y0,V as ql,W as Rh,X as Ih,Y as Oh,z as Ph,Z as Nh,c as Dh,_ as Vu,$ as x0,a0 as Mh,a1 as Lh,a2 as Bh,a3 as Uh,a4 as jh,a5 as Wh}from"./site.BlgjxTUG.js";import{p as ln,v as zh,k as Fh,i as Hh,G as C0,z as Vh,H as Zu,J as Uc,P as Zh}from"./kit.D0HsIFJD.js";import{_ as On}from"./preload-helper.D6kgxu3v.js";import{s as Yl,A as Kl,c as Gh,d as qh,e as Yh,f as Kh,m as Jh}from"./contest.DdHcFc7E.js";import{p as Xh}from"./stores.CoMZMUm9.js";import{b as pi}from"./paths.DTSw6QKH.js";async function Qh(i,{chain:e}){const{id:t,name:r,nativeCurrency:o,rpcUrls:n,blockExplorers:s}=e;await i.request({method:"wallet_addEthereumChain",params:[{chainId:ln(t),chainName:r,nativeCurrency:o,rpcUrls:n.default.http,blockExplorerUrls:s?Object.values(s).map(({url:a})=>a):void 0}]},{retryCount:0})}function _0(i,e={}){const{key:t="custom",name:r="Custom Provider",retryDelay:o}=e;return({retryCount:n})=>gh({key:t,name:r,request:i.request.bind(i),retryCount:e.retryCount??n,retryDelay:o,type:"custom"})}function ep(i,e){let[t,r="0"]=i.split(".");const o=t.startsWith("-");if(o&&(t=t.slice(1)),r=r.replace(/(0+)$/,""),e===0)Math.round(+`.${r}`)===1&&(t=`${BigInt(t)+1n}`),r="";else if(r.length>e){const[n,s,a]=[r.slice(0,e-1),r.slice(e-1,e),r.slice(e)],c=Math.round(+`${s}.${a}`);c>9?r=`${BigInt(n)+BigInt(1)}0`.padStart(n.length+1,"0"):r=`${n}${c}`,r.length>e&&(r=r.slice(1),t=`${BigInt(t)+1n}`),r=r.slice(0,e)}else r=r.padEnd(e,"0");return BigInt(`${o?"-":""}${t}${r}`)}function tp(i,e){const{abi:t,args:r,bytecode:o,...n}=e,s=wh({abi:t,args:r,bytecode:o});return Yl(i,{...n,data:s})}async function ip(i){var t;return((t=i.account)==null?void 0:t.type)==="local"?[i.account.address]:(await i.request({method:"eth_accounts"})).map(r=>mh(r))}async function np(i){return await i.request({method:"wallet_getPermissions"})}async function rp(i){return(await i.request({method:"eth_requestAccounts"},{retryCount:0})).map(t=>Kt(t))}async function op(i,e){return i.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function E0(i,{account:e=i.account,message:t}){if(!e)throw new Kl({docsPath:"/docs/actions/wallet/signMessage"});const r=nc(e);if(r.type==="local")return r.signMessage({message:t});const o=typeof t=="string"?zh(t):t.raw instanceof Uint8Array?Fh(t.raw):t.raw;return i.request({method:"personal_sign",params:[o,r.address]},{retryCount:0})}async function sp(i,e){var l,h,p,v;const{account:t=i.account,chain:r=i.chain,...o}=e;if(!t)throw new Kl({docsPath:"/docs/actions/wallet/signTransaction"});const n=nc(t);vh({account:n,...e});const s=await bh(i,m0,"getChainId")({});r!==null&&Gh({currentChainId:s,chain:r});const a=(r==null?void 0:r.formatters)||((l=i.chain)==null?void 0:l.formatters),c=((h=a==null?void 0:a.transactionRequest)==null?void 0:h.format)||yh;return n.type==="local"?n.signTransaction({...o,chainId:s},{serializer:(v=(p=i.chain)==null?void 0:p.serializers)==null?void 0:v.transaction}):await i.request({method:"eth_signTransaction",params:[{...c(o),chainId:ln(s),from:n.address}]},{retryCount:0})}async function ap(i,e){const{account:t=i.account,domain:r,message:o,primaryType:n}=e;if(!t)throw new Kl({docsPath:"/docs/actions/wallet/signTypedData"});const s=nc(t),a={EIP712Domain:xh({domain:r}),...e.types};if(Ch({domain:r,message:o,primaryType:n,types:a}),s.type==="local")return s.signTypedData({domain:r,message:o,primaryType:n,types:a});const c=_h({domain:r??{},message:o,primaryType:n,types:a},(l,h)=>Hh(h)?h.toLowerCase():h);return i.request({method:"eth_signTypedData_v4",params:[s.address,c]},{retryCount:0})}async function cp(i,{id:e}){await i.request({method:"wallet_switchEthereumChain",params:[{chainId:ln(e)}]},{retryCount:0})}async function lp(i,e){return await i.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function up(i){return{addChain:e=>Qh(i,e),deployContract:e=>tp(i,e),getAddresses:()=>ip(i),getChainId:()=>m0(i),getPermissions:()=>np(i),prepareTransactionRequest:e=>v0(i,e),requestAddresses:()=>rp(i),requestPermissions:e=>op(i,e),sendRawTransaction:e=>Eh(i,e),sendTransaction:e=>Yl(i,e),signMessage:e=>E0(i,e),signTransaction:e=>sp(i,e),signTypedData:e=>ap(i,e),switchChain:e=>cp(i,e),watchAsset:e=>lp(i,e),writeContract:e=>qh(i,e)}}function dp(i){const{key:e="wallet",name:t="Wallet Client",transport:r}=i;return Gl({...i,key:e,name:t,transport:r,type:"walletClient"}).extend(up)}var Jl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Gb(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var o=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return i[r]}})}),t}function hp(i){const e=t=>i(t.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function pp(){const i=new Set;let e=[];const t=()=>hp(o=>{e.some(({info:n})=>n.uuid===o.info.uuid)||(e=[...e,o],i.forEach(n=>n(e,{added:[o]})))});let r=t();return{_listeners(){return i},clear(){i.forEach(o=>o([],{removed:[...e]})),e=[]},destroy(){this.clear(),i.clear(),r()},findProvider({rdns:o}){return e.find(n=>n.info.rdns===o)},getProviders(){return e},reset(){this.clear(),r(),r=t()},subscribe(o,{emitImmediately:n}={}){return i.add(o),n&&o(e,{added:e}),()=>i.delete(o)}}}var fp={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const gp=i=>(e,t,r)=>{const o=r.subscribe;return r.subscribe=(s,a,c)=>{let l=s;if(a){const h=(c==null?void 0:c.equalityFn)||Object.is;let p=s(r.getState());l=v=>{const S=s(v);if(!h(p,S)){const O=p;a(p=S,O)}},c!=null&&c.fireImmediately&&a(p,p)}return o(l)},i(e,t,r)},wp=gp;function mp(i,e){let t;try{t=i()}catch{return}return{getItem:o=>{var n;const s=c=>c===null?null:JSON.parse(c,void 0),a=(n=t.getItem(o))!=null?n:null;return a instanceof Promise?a.then(s):s(a)},setItem:(o,n)=>t.setItem(o,JSON.stringify(n,void 0)),removeItem:o=>t.removeItem(o)}}const cs=i=>e=>{try{const t=i(e);return t instanceof Promise?t:{then(r){return cs(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return cs(r)(t)}}}},vp=(i,e)=>(t,r,o)=>{let n={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:R=>R,version:0,merge:(R,B)=>({...B,...R}),...e},s=!1;const a=new Set,c=new Set;let l;try{l=n.getStorage()}catch{}if(!l)return i((...R)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),t(...R)},r,o);const h=cs(n.serialize),p=()=>{const R=n.partialize({...r()});let B;const k=h({state:R,version:n.version}).then(W=>l.setItem(n.name,W)).catch(W=>{B=W});if(B)throw B;return k},v=o.setState;o.setState=(R,B)=>{v(R,B),p()};const S=i((...R)=>{t(...R),p()},r,o);let O;const D=()=>{var R;if(!l)return;s=!1,a.forEach(k=>k(r()));const B=((R=n.onRehydrateStorage)==null?void 0:R.call(n,r()))||void 0;return cs(l.getItem.bind(l))(n.name).then(k=>{if(k)return n.deserialize(k)}).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==n.version){if(n.migrate)return n.migrate(k.state,k.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return k.state}).then(k=>{var W;return O=n.merge(k,(W=r())!=null?W:S),t(O,!0),p()}).then(()=>{B==null||B(O,void 0),s=!0,c.forEach(k=>k(O))}).catch(k=>{B==null||B(void 0,k)})};return o.persist={setOptions:R=>{n={...n,...R},R.getStorage&&(l=R.getStorage())},clearStorage:()=>{l==null||l.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>D(),hasHydrated:()=>s,onHydrate:R=>(a.add(R),()=>{a.delete(R)}),onFinishHydration:R=>(c.add(R),()=>{c.delete(R)})},D(),O||S},bp=(i,e)=>(t,r,o)=>{let n={storage:mp(()=>localStorage),partialize:D=>D,version:0,merge:(D,R)=>({...R,...D}),...e},s=!1;const a=new Set,c=new Set;let l=n.storage;if(!l)return i((...D)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),t(...D)},r,o);const h=()=>{const D=n.partialize({...r()});return l.setItem(n.name,{state:D,version:n.version})},p=o.setState;o.setState=(D,R)=>{p(D,R),h()};const v=i((...D)=>{t(...D),h()},r,o);let S;const O=()=>{var D,R;if(!l)return;s=!1,a.forEach(k=>{var W;return k((W=r())!=null?W:v)});const B=((R=n.onRehydrateStorage)==null?void 0:R.call(n,(D=r())!=null?D:v))||void 0;return cs(l.getItem.bind(l))(n.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==n.version){if(n.migrate)return n.migrate(k.state,k.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return k.state}).then(k=>{var W;return S=n.merge(k,(W=r())!=null?W:v),t(S,!0),h()}).then(()=>{B==null||B(S,void 0),S=r(),s=!0,c.forEach(k=>k(S))}).catch(k=>{B==null||B(void 0,k)})};return o.persist={setOptions:D=>{n={...n,...D},D.storage&&(l=D.storage)},clearStorage:()=>{l==null||l.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>O(),hasHydrated:()=>s,onHydrate:D=>(a.add(D),()=>{a.delete(D)}),onFinishHydration:D=>(c.add(D),()=>{c.delete(D)})},n.skipHydration||O(),S||v},yp=(i,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((fp?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),vp(i,e)):bp(i,e),xp=yp;var Cp={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Gu=i=>{let e;const t=new Set,r=(c,l)=>{const h=typeof c=="function"?c(e):c;if(!Object.is(h,e)){const p=e;e=l??typeof h!="object"?h:Object.assign({},e,h),t.forEach(v=>v(e,p))}},o=()=>e,a={setState:r,getState:o,subscribe:c=>(t.add(c),()=>t.delete(c)),destroy:()=>{(Cp?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}};return e=i(r,o,a),a},jc=i=>i?Gu(i):Gu;var T0={exports:{}};(function(i){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function o(c,l,h){this.fn=c,this.context=l,this.once=h||!1}function n(c,l,h,p,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var S=new o(h,p||c,v),O=t?t+l:l;return c._events[O]?c._events[O].fn?c._events[O]=[c._events[O],S]:c._events[O].push(S):(c._events[O]=S,c._eventsCount++),c}function s(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],h,p;if(this._eventsCount===0)return l;for(p in h=this._events)e.call(h,p)&&l.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(h)):l},a.prototype.listeners=function(l){var h=t?t+l:l,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var v=0,S=p.length,O=new Array(S);v{let o=r;return(o==null?void 0:o.__type)==="bigint"&&(o=BigInt(o.value)),(o==null?void 0:o.__type)==="Map"&&(o=new Map(o.value)),(e==null?void 0:e(t,o))??o})}function qu(i,e){return i.slice(0,e).join(".")||"."}function Yu(i,e){const{length:t}=i;for(let r=0;r{let s=n;return typeof s=="bigint"&&(s={__type:"bigint",value:n.toString()}),s instanceof Map&&(s={__type:"Map",value:Array.from(n.entries())}),(e==null?void 0:e(o,s))??s},r),t??void 0)}function Rp(i){const{deserialize:e=Sp,key:t="wagmi",serialize:r=$p,storage:o=A0}=i;function n(s){return s instanceof Promise?s.then(a=>a).catch(()=>null):s}return{...o,key:t,async getItem(s,a){const c=o.getItem(`${t}.${s}`),l=await n(c);return l?e(l)??null:a??null},async setItem(s,a){const c=`${t}.${s}`;a===null?await n(o.removeItem(c)):await n(o.setItem(c,r(a)))},async removeItem(s){await n(o.removeItem(`${t}.${s}`))}}}const A0={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};const ga="2.9.1",Ip=()=>`@wagmi/core@${ga}`;var S0=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},ya,k0;class un extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Ip()}constructor(e,t={}){var n;super(),ya.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=t.cause instanceof un?t.cause.details:(n=t.cause)!=null&&n.message?t.cause.message:t.details,o=t.cause instanceof un&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${this.docsBaseUrl}${o}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` +`),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return S0(this,ya,"m",k0).call(this,this,e)}}ya=new WeakSet,k0=function i(e,t){return t!=null&&t(e)?e:e.cause?S0(this,ya,"m",i).call(this,e.cause,t):e};class lo extends un{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Op extends un{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Pp extends un{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Np extends un{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class ur extends un{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class Dp extends un{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}const Mp=/(rabby|trustwallet)/,Lp={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(i){return i!=null&&i.coinbaseWalletExtension?i.coinbaseWalletExtension:wa(i,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(i){return wa(i,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const r of t)if(e[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(i){var e,t;return(e=i==null?void 0:i.phantom)!=null&&e.ethereum?(t=i.phantom)==null?void 0:t.ethereum:wa(i,"isPhantom")}}};oc.type="injected";function oc(i={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=i;function r(){const c=i.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...Lp[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l==null?void 0:l.ethereum}}}let o,n,s,a;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return Mp.test(this.id.toLowerCase())},type:oc.type,async setup(){const l=await this.getProvider();l&&i.target&&(s||(s=this.onConnect.bind(this),l.on("connect",s)),o||(o=this.onAccountsChanged.bind(this),l.on("accountsChanged",o)))},async connect({chainId:l,isReconnecting:h}={}){var S,O,D,R,B,k;const p=await this.getProvider();if(!p)throw new ur;let v=[];if(h)v=await this.getAccounts().catch(()=>[]);else if(e)try{v=(R=(D=(O=(S=(await p.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:S.caveats)==null?void 0:O[0])==null?void 0:D.value)==null?void 0:R.map(M=>Kt(M))}catch(W){const M=W;if(M.code===Vt.code)throw new Vt(M);if(M.code===Bc.code)throw M}try{!(v!=null&&v.length)&&!h&&(v=(await p.request({method:"eth_requestAccounts"})).map(j=>Kt(j))),s&&(p.removeListener("connect",s),s=void 0),o||(o=this.onAccountsChanged.bind(this),p.on("accountsChanged",o)),n||(n=this.onChainChanged.bind(this),p.on("chainChanged",n)),a||(a=this.onDisconnect.bind(this),p.on("disconnect",a));let W=await this.getChainId();if(l&&W!==l){const M=await this.switchChain({chainId:l}).catch(j=>{if(j.code===Vt.code)throw j;return{id:W}});W=(M==null?void 0:M.id)??W}return e&&await((B=c.storage)==null?void 0:B.removeItem(`${this.id}.disconnected`)),i.target||await((k=c.storage)==null?void 0:k.setItem("injected.connected",!0)),{accounts:v,chainId:W}}catch(W){const M=W;throw M.code===Vt.code?new Vt(M):M.code===Bc.code?new Bc(M):M}},async disconnect(){var h,p;const l=await this.getProvider();if(!l)throw new ur;n&&(l.removeListener("chainChanged",n),n=void 0),a&&(l.removeListener("disconnect",a),a=void 0),s||(s=this.onConnect.bind(this),l.on("connect",s)),e&&await((h=c.storage)==null?void 0:h.setItem(`${this.id}.disconnected`,!0)),i.target||await((p=c.storage)==null?void 0:p.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new ur;return(await l.request({method:"eth_accounts"})).map(p=>Kt(p))},async getChainId(){const l=await this.getProvider();if(!l)throw new ur;const h=await l.request({method:"eth_chainId"});return Number(h)},async getProvider(){if(typeof window>"u")return;let l;const h=r();return typeof h.provider=="function"?l=h.provider(window):typeof h.provider=="string"?l=wa(window,h.provider):l=h.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){var l,h;try{if(e&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!i.target&&!await((h=c.storage)==null?void 0:h.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const O=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",O),!!await this.getProvider()),D=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(B=>window.addEventListener("ethereum#initialized",()=>B(O()),{once:!0}))]:[],new Promise(B=>setTimeout(()=>B(O()),D))]))return!0}throw new ur}return!!(await Th(()=>Ah(()=>this.getAccounts(),{timeout:100}))).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:h}){var S,O,D,R;const p=await this.getProvider();if(!p)throw new ur;const v=c.chains.find(B=>B.id===h);if(!v)throw new Un(new lo);try{return await Promise.all([p.request({method:"wallet_switchEthereumChain",params:[{chainId:ln(h)}]}).then(async()=>{await this.getChainId()===h&&c.emitter.emit("change",{chainId:h})}),new Promise(B=>c.emitter.once("change",({chainId:k})=>{k===h&&B()}))]),v}catch(B){const k=B;if(k.code===4902||((O=(S=k==null?void 0:k.data)==null?void 0:S.originalError)==null?void 0:O.code)===4902)try{const{default:W,...M}=v.blockExplorers??{};let j;l!=null&&l.blockExplorerUrls?j=l.blockExplorerUrls:W&&(j=[W.url,...Object.values(M).map(w=>w.url)]);let Z;(D=l==null?void 0:l.rpcUrls)!=null&&D.length?Z=l.rpcUrls:Z=[((R=v.rpcUrls.default)==null?void 0:R.http[0])??""];const ie={blockExplorerUrls:j,chainId:ln(h),chainName:(l==null?void 0:l.chainName)??v.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??v.nativeCurrency,rpcUrls:Z};if(await p.request({method:"wallet_addEthereumChain",params:[ie]}),await this.getChainId()!==h)throw new Vt(new Error("User rejected switch after adding network."));return v}catch(W){throw new Vt(W)}throw k.code===Vt.code?new Vt(k):new Un(k)}},async onAccountsChanged(l){var h;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const p=(await this.getChainId()).toString();this.onConnect({chainId:p}),e&&await((h=c.storage)==null?void 0:h.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(p=>Kt(p))})},onChainChanged(l){const h=Number(l);c.emitter.emit("change",{chainId:h})},async onConnect(l){const h=await this.getAccounts();if(h.length===0)return;const p=Number(l.chainId);c.emitter.emit("connect",{accounts:h,chainId:p});const v=await this.getProvider();v&&(s&&(v.removeListener("connect",s),s=void 0),o||(o=this.onAccountsChanged.bind(this),v.on("accountsChanged",o)),n||(n=this.onChainChanged.bind(this),v.on("chainChanged",n)),a||(a=this.onDisconnect.bind(this),v.on("disconnect",a)))},async onDisconnect(l){const h=await this.getProvider();l&&l.code===1013&&h&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),h&&(n&&(h.removeListener("chainChanged",n),n=void 0),a&&(h.removeListener("disconnect",a),a=void 0),s||(s=this.onConnect.bind(this),h.on("connect",s))))}})}function wa(i,e){function t(o){return typeof e=="function"?e(o):typeof e=="string"?o[e]:!0}const r=i.ethereum;if(r!=null&&r.providers)return r.providers.find(o=>t(o));if(r&&t(r))return r}const gl=256;let oa=gl,sa;function Bp(i=11){if(!sa||oa+i>gl*2){sa="",oa=0;for(let e=0;en.chains),c=jc(()=>[...n.connectors??[],...o?[]:(s==null?void 0:s.getProviders().map(h))??[]].map(l));function l(M){var ie;const j=Ap(Bp()),Z={...M({emitter:j,chains:a.getState(),storage:t}),emitter:j,uid:j.uid};return j.on("connect",k),(ie=Z.setup)==null||ie.call(Z),Z}function h(M){const{info:j}=M,Z=M.provider;return oc({target:{...j,id:j.rdns,provider:Z}})}const p=new Map;function v(M={}){const j=M.chainId??R.getState().chainId,Z=a.getState().find(f=>f.id===j);if(M.chainId&&!Z)throw new lo;{const f=p.get(R.getState().chainId);if(f&&!Z)return f;if(!Z)throw new lo}{const f=p.get(j);if(f)return f}let ie;if(n.client)ie=n.client({chain:Z});else{const f=Z.id,w=a.getState().map(_=>_.id),m={},A=Object.entries(n);for(const[_,N]of A)if(!(_==="chains"||_==="client"||_==="connectors"||_==="transports"))if(typeof N=="object")if(f in N)m[_]=N[f];else{if(w.some(y=>y in N))continue;m[_]=N}else m[_]=N;ie=Gl({...m,chain:Z,batch:m.batch??{multicall:!0},transport:_=>n.transports[f]({..._,connectors:c})})}return p.set(j,ie),ie}function S(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let O;const D="0.0.0-canary-";ga.startsWith(D)?O=parseInt(ga.replace(D,"")):O=parseInt(ga.split(".")[0]??"0");const R=jc(wp(t?xp(S,{migrate(M,j){if(j===O)return M;const Z=S(),ie=M&&typeof M=="object"&&"chainId"in M&&typeof M.chainId=="number"?M.chainId:Z.chainId;return{...Z,chainId:ie}},name:"store",partialize(M){return{connections:{__type:"Map",value:Array.from(M.connections.entries()).map(([j,Z])=>{const{id:ie,name:f,type:w,uid:m}=Z.connector;return[j,{...Z,connector:{id:ie,name:f,type:w,uid:m}}]})},chainId:M.chainId,current:M.current}},skipHydration:o,storage:t,version:O}):S));r&&R.subscribe(({connections:M,current:j})=>{var Z;return j?(Z=M.get(j))==null?void 0:Z.chainId:void 0},M=>{if(a.getState().some(Z=>Z.id===M))return R.setState(Z=>({...Z,chainId:M??Z.chainId}))}),s==null||s.subscribe(M=>{const j=new Map;for(const ie of c.getState())j.set(ie.id,!0);const Z=[];for(const ie of M){const f=l(h(ie));j.has(f.id)||Z.push(f)}t&&!R.persist.hasHydrated()||c.setState(ie=>[...ie,...Z],!0)});function B(M){R.setState(j=>{const Z=j.connections.get(M.uid);return Z?{...j,connections:new Map(j.connections).set(M.uid,{accounts:M.accounts??Z.accounts,chainId:M.chainId??Z.chainId,connector:Z.connector})}:j})}function k(M){R.getState().status==="connecting"||R.getState().status==="reconnecting"||R.setState(j=>{const Z=c.getState().find(ie=>ie.uid===M.uid);return Z?(Z.emitter.listenerCount("connect")&&Z.emitter.off("connect",B),Z.emitter.listenerCount("change")||Z.emitter.on("change",B),Z.emitter.listenerCount("disconnect")||Z.emitter.on("disconnect",W),{...j,connections:new Map(j.connections).set(M.uid,{accounts:M.accounts,chainId:M.chainId,connector:Z}),current:M.uid,status:"connected"}):j})}function W(M){R.setState(j=>{const Z=j.connections.get(M.uid);if(Z){const f=Z.connector;f.emitter.listenerCount("change")&&Z.connector.emitter.off("change",B),f.emitter.listenerCount("disconnect")&&Z.connector.emitter.off("disconnect",W),f.emitter.listenerCount("connect")||Z.connector.emitter.on("connect",k)}if(j.connections.delete(M.uid),j.connections.size===0)return{...j,connections:new Map,current:null,status:"disconnected"};const ie=j.connections.values().next().value;return{...j,connections:new Map(j.connections),current:ie.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:t,getClient:v,get state(){return R.getState()},setState(M){let j;typeof M=="function"?j=M(R.getState()):j=M;const Z=S();typeof j!="object"&&(j=Z),Object.keys(Z).some(f=>!(f in j))&&(j=Z),R.setState(j,!0)},subscribe(M,j,Z){return R.subscribe(M,j,Z?{...Z,fireImmediately:Z.emitImmediately}:void 0)},_internal:{mipd:s,store:R,ssr:!!o,syncConnectedChain:r,transports:n.transports,chains:{setState(M){const j=typeof M=="function"?M(a.getState()):M;if(j.length!==0)return a.setState(j,!0)},subscribe(M){return a.subscribe(M)}},connectors:{providerDetailToConnector:h,setup:l,setState(M){return c.setState(typeof M=="function"?M(c.getState()):M,!0)},subscribe(M){return c.subscribe(M)}},events:{change:B,connect:k,disconnect:W}}}}function Jt(i,e,t){const r=i[e.name];if(typeof r=="function")return r;const o=i[t];return typeof o=="function"?o:n=>e(i,n)}async function Ku(i,e){var r;let t;if(typeof e.connector=="function"?t=i._internal.connectors.setup(e.connector):t=e.connector,t.uid===i.state.current)throw new Op;try{i.setState(s=>({...s,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const o=await t.connect({chainId:e.chainId}),n=o.accounts;return t.emitter.off("connect",i._internal.events.connect),t.emitter.on("change",i._internal.events.change),t.emitter.on("disconnect",i._internal.events.disconnect),await((r=i.storage)==null?void 0:r.setItem("recentConnectorId",t.id)),i.setState(s=>({...s,connections:new Map(s.connections).set(t.uid,{accounts:n,chainId:o.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:n,chainId:o.chainId}}catch(o){throw i.setState(n=>({...n,status:n.current?"connected":"disconnected"})),o}}async function $0(i,e={}){var o,n;let t;if(e.connector)t=e.connector;else{const{connections:s,current:a}=i.state,c=s.get(a);t=c==null?void 0:c.connector}const r=i.state.connections;t&&(await t.disconnect(),t.emitter.off("change",i._internal.events.change),t.emitter.off("disconnect",i._internal.events.disconnect),t.emitter.on("connect",i._internal.events.connect),r.delete(t.uid)),i.setState(s=>{if(r.size===0)return{...s,connections:new Map,current:null,status:"disconnected"};const a=r.values().next().value;return{...s,connections:new Map(r),current:a.connector.uid}});{const s=i.state.current;if(!s)return;const a=(o=i.state.connections.get(s))==null?void 0:o.connector;if(!a)return;await((n=i.storage)==null?void 0:n.setItem("recentConnectorId",a.id))}}async function Xl(i,e={}){let t;if(e.connector){const{connector:c}=e,[l,h]=await Promise.all([c.getAccounts(),c.getChainId()]);t={accounts:l,chainId:h,connector:c}}else t=i.state.connections.get(i.state.current);if(!t)throw new Pp;const r=e.chainId??t.chainId,o=t.connector;if(o.getClient)return o.getClient({chainId:r});const n=nc(e.account??t.accounts[0]);n.address=Kt(n.address);const s=i.chains.find(c=>c.id===r),a=await t.connector.getProvider({chainId:r});if(e.account&&!t.accounts.includes(n.address))throw new Np({address:n.address,connector:o});return Gl({account:n,chain:s,name:"Connector Client",transport:c=>_0(a)({...c,retryCount:0})})}async function jp(i,e){const{chainId:t,connector:r,...o}=e;let n;e.account?n=e.account:n=(await Xl(i,{account:e.account,chainId:t,connector:r})).account;const s=i.getClient({chainId:t});return Jt(s,b0,"estimateGas")({...o,account:n})}function R0(i){return typeof i=="number"?i:i==="wei"?0:Math.abs(Sh[i])}function sc(i){const e=i.state.current,t=i.state.connections.get(e),r=t==null?void 0:t.accounts,o=r==null?void 0:r[0],n=i.chains.find(a=>a.id===(t==null?void 0:t.chainId)),s=i.state.status;switch(s){case"connected":return{address:o,addresses:r,chain:n,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:s};case"reconnecting":return{address:o,addresses:r,chain:n,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!o,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:s};case"connecting":return{address:o,addresses:r,chain:n,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:s};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:s}}}async function Wp(i,e){const{allowFailure:t=!0,chainId:r,contracts:o,...n}=e,s=i.getClient({chainId:r});return Jt(s,kh,"multicall")({allowFailure:t,contracts:o,...n})}function zp(i,e){const{chainId:t,...r}=e,o=i.getClient({chainId:t});return Jt(o,$h,"readContract")(r)}async function Fp(i,e){const{allowFailure:t=!0,blockNumber:r,blockTag:o,...n}=e,s=e.contracts;try{const a=s.reduce((p,v,S)=>{const O=v.chainId??i.state.chainId;return{...p,[O]:[...p[O]||[],{contract:v,index:S}]}},{}),c=()=>Object.entries(a).map(([p,v])=>Wp(i,{...n,allowFailure:t,blockNumber:r,blockTag:o,chainId:parseInt(p),contracts:v.map(({contract:S})=>S)})),l=(await Promise.all(c())).flat(),h=Object.values(a).flatMap(p=>p.map(({index:v})=>v));return l.reduce((p,v,S)=>(p&&(p[h[S]]=v),p),[])}catch(a){if(a instanceof y0)throw a;const c=()=>s.map(l=>zp(i,{...l,blockNumber:r,blockTag:o}));return t?(await Promise.allSettled(c())).map(l=>l.status==="fulfilled"?{result:l.value,status:"success"}:{error:l.reason,result:void 0,status:"failure"}):await Promise.all(c())}}async function Hp(i,e){const{address:t,blockNumber:r,blockTag:o,chainId:n,token:s,unit:a="ether"}=e;if(s)try{return Ju(i,{balanceAddress:t,chainId:n,symbolType:"string",tokenAddress:s})}catch(v){if(v instanceof y0){const S=await Ju(i,{balanceAddress:t,chainId:n,symbolType:"bytes32",tokenAddress:s}),O=C0(Vh(S.symbol,{dir:"right"}));return{...S,symbol:O}}throw v}const c=i.getClient({chainId:n}),h=await Jt(c,Rh,"getBalance")(r?{address:t,blockNumber:r}:{address:t,blockTag:o}),p=i.chains.find(v=>v.id===n)??c.chain;return{decimals:p.nativeCurrency.decimals,formatted:ql(h,R0(a)),symbol:p.nativeCurrency.symbol,value:h}}async function Ju(i,e){const{balanceAddress:t,chainId:r,symbolType:o,tokenAddress:n,unit:s}=e,a={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:o}]}],address:n},[c,l,h]=await Fp(i,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[t],chainId:r},{...a,functionName:"decimals",chainId:r},{...a,functionName:"symbol",chainId:r}]}),p=ql(c??"0",R0(s??l));return{decimals:l,formatted:p,symbol:h,value:c}}function wl(i,e){if(i===e)return!0;if(i&&e&&typeof i=="object"&&typeof e=="object"){if(i.constructor!==e.constructor)return!1;let t,r;if(Array.isArray(i)&&Array.isArray(e)){if(t=i.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!wl(i[r],e[r]))return!1;return!0}if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===e.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===e.toString();const o=Object.keys(i);if(t=o.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;for(r=t;r--!==0;){const n=o[r];if(n&&!wl(i[n],e[n]))return!1}return!0}return i!==i&&e!==e}function Vp(i,e){const{chainId:t,...r}=e,o=i.getClient({chainId:t});return Jt(o,Ih,"getEnsAvatar")(r)}function Zp(i,e){const{chainId:t,...r}=e,o=i.getClient({chainId:t});return Jt(o,Oh,"getEnsName")(r)}async function Gp(i,e){const{account:t,chainId:r,...o}=e,n=t??sc(i).address,s=i.getClient({chainId:r});return Jt(s,v0,"prepareTransactionRequest")({...o,...n?{account:n}:{}})}let Wc=!1;async function qp(i,e={}){var l,h;if(Wc)return[];Wc=!0,i.setState(p=>({...p,status:p.current?"reconnecting":"connecting"}));const t=[];if((l=e.connectors)!=null&&l.length)for(const p of e.connectors){let v;typeof p=="function"?v=i._internal.connectors.setup(p):v=p,t.push(v)}else t.push(...i.connectors);let r;try{r=await((h=i.storage)==null?void 0:h.getItem("recentConnectorId"))}catch{}const o={};for(const[,p]of i.state.connections)o[p.connector.id]=1;r&&(o[r]=0);const n=Object.keys(o).length>0?[...t].sort((p,v)=>(o[p.id]??10)-(o[v.id]??10)):t;let s=!1;const a=[],c=[];for(const p of n){const v=await p.getProvider();if(!v||c.some(D=>D===v)||!await p.isAuthorized())continue;const O=await p.connect({isReconnecting:!0}).catch(()=>null);O&&(p.emitter.off("connect",i._internal.events.connect),p.emitter.on("change",i._internal.events.change),p.emitter.on("disconnect",i._internal.events.disconnect),i.setState(D=>{const R=new Map(s?D.connections:new Map).set(p.uid,{accounts:O.accounts,chainId:O.chainId,connector:p});return{...D,current:s?D.current:p.uid,connections:R}}),a.push({accounts:O.accounts,chainId:O.chainId,connector:p}),c.push(v),s=!0)}return(i.state.status==="reconnecting"||i.state.status==="connecting")&&(s?i.setState(p=>({...p,status:"connected"})):i.setState(p=>({...p,connections:new Map,current:null,status:"disconnected"}))),Wc=!1,a}async function Yp(i,e){const{account:t,chainId:r,connector:o,gas:n,...s}=e;let a;typeof t=="object"&&t.type==="local"?a=i.getClient({chainId:r}):a=await Xl(i,{account:t,chainId:r,connector:o});const{connector:c}=sc(i),l=await(async()=>{var v;if(!(!("data"in e)||!e.data)&&!((v=o??c)!=null&&v.supportsSimulation)&&n!==null)return n===void 0?Jt(a,b0,"estimateGas")({...s,account:t,chain:r?{id:r}:null}):n})();return await Jt(a,Yl,"sendTransaction")({...s,...t?{account:t}:{},gas:l,chain:r?{id:r}:null})}async function Kp(i,e){const{account:t,connector:r,...o}=e;let n;return typeof t=="object"&&t.type==="local"?n=i.getClient():n=await Xl(i,{account:t,connector:r}),Jt(n,E0,"signMessage")({...o,...t?{account:t}:{}})}async function Jp(i,e){var s;const{addEthereumChainParameter:t,chainId:r}=e,o=i.state.connections.get(((s=e.connector)==null?void 0:s.uid)??i.state.current);if(o){const a=o.connector;if(!a.switchChain)throw new Dp({connector:a});return await a.switchChain({addEthereumChainParameter:t,chainId:r})}const n=i.chains.find(a=>a.id===r);if(!n)throw new lo;return i.setState(a=>({...a,chainId:r})),n}function Xp(i,e){const{onChange:t}=e;return i.subscribe(()=>sc(i),t,{equalityFn(r,o){const{connector:n,...s}=r,{connector:a,...c}=o;return wl(s,c)&&(n==null?void 0:n.id)===(a==null?void 0:a.id)&&(n==null?void 0:n.uid)===(a==null?void 0:a.uid)}})}function Qp(i,e){const{onChange:t}=e;return i._internal.connectors.subscribe((r,o)=>{t(Object.values(r),o)})}async function ef(i,e){const{chainId:t,timeout:r=0,...o}=e,n=i.getClient({chainId:t}),a=await Jt(n,Ph,"waitForTransactionReceipt")({...o,timeout:r});if(a.status==="reverted"){const l=await Jt(n,Nh,"getTransaction")({hash:a.transactionHash}),p=await Jt(n,Dh,"call")({...l,gasPrice:l.type!=="eip1559"?l.gasPrice:void 0,maxFeePerGas:l.type==="eip1559"?l.maxFeePerGas:void 0,maxPriorityFeePerGas:l.type==="eip1559"?l.maxPriorityFeePerGas:void 0}),v=p!=null&&p.data?C0(`0x${p.data.substring(138)}`):"unknown reason";throw new Error(v)}return{...a,chainId:n.chain.id}}function zc(i){if(typeof i=="string")return Number.parseInt(i,i.trim().substring(0,2)==="0x"?16:10);if(typeof i=="bigint")return Number(i);if(typeof i=="number")return i;throw new Error(`Cannot normalize chainId "${i}" of type "${typeof i}"`)}const tf=Symbol(),Xu=Object.getPrototypeOf,ml=new WeakMap,nf=i=>i&&(ml.has(i)?ml.get(i):Xu(i)===Object.prototype||Xu(i)===Array.prototype),rf=i=>nf(i)&&i[tf]||null,Qu=(i,e=!0)=>{ml.set(i,e)};var xa={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Fc=i=>typeof i=="object"&&i!==null,En=new WeakMap,Yo=new WeakSet,of=(i=Object.is,e=(l,h)=>new Proxy(l,h),t=l=>Fc(l)&&!Yo.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),r=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},o=new WeakMap,n=(l,h,p=r)=>{const v=o.get(l);if((v==null?void 0:v[0])===h)return v[1];const S=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Qu(S,!0),o.set(l,[h,S]),Reflect.ownKeys(l).forEach(O=>{if(Object.getOwnPropertyDescriptor(S,O))return;const D=Reflect.get(l,O),R={value:D,enumerable:!0,configurable:!0};if(Yo.has(D))Qu(D,!1);else if(D instanceof Promise)delete R.value,R.get=()=>p(D);else if(En.has(D)){const[B,k]=En.get(D);R.value=n(B,k(),p)}Object.defineProperty(S,O,R)}),Object.preventExtensions(S)},s=new WeakMap,a=[1,1],c=l=>{if(!Fc(l))throw new Error("object required");const h=s.get(l);if(h)return h;let p=a[0];const v=new Set,S=(w,m=++a[0])=>{p!==m&&(p=m,v.forEach(A=>A(w,m)))};let O=a[1];const D=(w=++a[1])=>(O!==w&&!v.size&&(O=w,B.forEach(([m])=>{const A=m[1](w);A>p&&(p=A)})),p),R=w=>(m,A)=>{const _=[...m];_[1]=[w,..._[1]],S(_,A)},B=new Map,k=(w,m)=>{if((xa?"production":void 0)!=="production"&&B.has(w))throw new Error("prop listener already exists");if(v.size){const A=m[3](R(w));B.set(w,[m,A])}else B.set(w,[m])},W=w=>{var m;const A=B.get(w);A&&(B.delete(w),(m=A[1])==null||m.call(A))},M=w=>(v.add(w),v.size===1&&B.forEach(([A,_],N)=>{if((xa?"production":void 0)!=="production"&&_)throw new Error("remove already exists");const P=A[3](R(N));B.set(N,[A,P])}),()=>{v.delete(w),v.size===0&&B.forEach(([A,_],N)=>{_&&(_(),B.set(N,[A]))})}),j=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),ie=e(j,{deleteProperty(w,m){const A=Reflect.get(w,m);W(m);const _=Reflect.deleteProperty(w,m);return _&&S(["delete",[m],A]),_},set(w,m,A,_){const N=Reflect.has(w,m),P=Reflect.get(w,m,_);if(N&&(i(P,A)||s.has(A)&&i(P,s.get(A))))return!0;W(m),Fc(A)&&(A=rf(A)||A);let y=A;if(A instanceof Promise)A.then(E=>{A.status="fulfilled",A.value=E,S(["resolve",[m],E])}).catch(E=>{A.status="rejected",A.reason=E,S(["reject",[m],E])});else{!En.has(A)&&t(A)&&(y=c(A));const E=!Yo.has(y)&&En.get(y);E&&k(m,E)}return Reflect.set(w,m,y,_),S(["set",[m],A,P]),!0}});s.set(l,ie);const f=[j,D,n,M];return En.set(ie,f),Reflect.ownKeys(l).forEach(w=>{const m=Object.getOwnPropertyDescriptor(l,w);"value"in m&&(ie[w]=l[w],delete m.value,delete m.writable),Object.defineProperty(j,w,m)}),ie})=>[c,En,Yo,i,e,t,r,o,n,s,a],[sf]=of();function kt(i={}){return sf(i)}function Xt(i,e,t){const r=En.get(i);(xa?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let o;const n=[],s=r[3];let a=!1;const l=s(h=>{n.push(h),o||(o=Promise.resolve().then(()=>{o=void 0,a&&e(n.splice(0))}))});return a=!0,()=>{a=!1,l()}}function I0(i,e){const t=En.get(i);(xa?"production":void 0)!=="production"&&!t&&console.warn("Please use proxy object");const[r,o,n]=t;return n(r,o(),e)}function uo(i){return Yo.add(i),i}function ri(i,e,t,r){let o=i[e];return Xt(i,()=>{const n=i[e];Object.is(o,n)||t(o=n)})}const Hc="https://secure.walletconnect.com",O0=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:""}],dt={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:Hc,SECURE_SITE_DASHBOARD:`${Hc}/dashboard`,SECURE_SITE_FAVICON:`${Hc}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],NATIVE_TOKEN_ADDRESS:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",CONVERT_SLIPPAGE_TOLERANCE:1},re={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(i,e=""){return i==null?void 0:i.id.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){const i=window.navigator.userAgent.toLowerCase();return re.isMobile()&&i.includes("android")},isIos(){const i=window.navigator.userAgent.toLowerCase();return re.isMobile()&&(i.includes("iphone")||i.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(i){return i?i-Date.now()<=dt.TEN_SEC_MS:!0},isAllowedRetry(i){return Date.now()-i>=dt.ONE_SEC_MS},copyToClopboard(i){navigator.clipboard.writeText(i)},getPairingExpiry(){return Date.now()+dt.FOUR_MINUTES_MS},getPlainAddress(i){return i.split(":")[2]},async wait(i){return new Promise(e=>{setTimeout(e,i)})},debounce(i,e=500){let t;return(...r)=>{function o(){i(...r)}t&&clearTimeout(t),t=setTimeout(o,e)}},isHttpUrl(i){return i.startsWith("http://")||i.startsWith("https://")},formatNativeUrl(i,e){if(re.isHttpUrl(i))return this.formatUniversalUrl(i,e);let t=i;t.includes("://")||(t=i.replaceAll("/","").replaceAll(":",""),t=`${t}://`),t.endsWith("/")||(t=`${t}/`);const r=encodeURIComponent(e);return{redirect:`${t}wc?uri=${r}`,href:t}},formatUniversalUrl(i,e){if(!re.isHttpUrl(i))return this.formatNativeUrl(i,e);let t=i;t.endsWith("/")||(t=`${t}/`);const r=encodeURIComponent(e);return{redirect:`${t}wc?uri=${r}`,href:t}},openHref(i,e,t){window.open(i,e,t||"noreferrer noopener")},async preloadImage(i){const e=new Promise((t,r)=>{const o=new Image;o.onload=t,o.onerror=r,o.crossOrigin="anonymous",o.src=i});return Promise.race([e,re.wait(2e3)])},formatBalance(i,e){var r;let t;if(i==="0")t="0.000";else if(typeof i=="string"){const o=Number(i);o&&(t=(r=o.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:r[0])}return t?`${t} ${e??""}`:`0.000 ${e??""}`},formatBalance2(i,e){var r;let t;if(i==="0")t="0";else if(typeof i=="string"){const o=Number(i);o&&(t=(r=o.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:r[0])}return{value:t??"0",rest:t==="0"?"000":"",symbol:e}},isRestrictedRegion(){try{const{timeZone:i}=new Intl.DateTimeFormat().resolvedOptions(),e=i.toUpperCase();return dt.RESTRICTED_TIMEZONES.includes(e)}catch{return!1}},getApiUrl(){return re.isRestrictedRegion()?"https://api.web3modal.org":"https://api.web3modal.com"},getBlockchainApiUrl(){return re.isRestrictedRegion()?"https://rpc.walletconnect.org":"https://rpc.walletconnect.com"},getAnalyticsUrl(){return re.isRestrictedRegion()?"https://pulse.walletconnect.org":"https://pulse.walletconnect.com"},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,i=>{const e=Math.random()*16|0;return(i==="x"?e:e&3|8).toString(16)})},parseError(i){var e,t;return typeof i=="string"?i:typeof((t=(e=i==null?void 0:i.issues)==null?void 0:e[0])==null?void 0:t.message)=="string"?i.issues[0].message:i instanceof Error?i.message:"Unknown error"},sortRequestedNetworks(i,e=[]){const t={};return e&&i&&(i.forEach((r,o)=>{t[r]=o}),e.sort((r,o)=>{const n=t[r.id],s=t[o.id];return n!==void 0&&s!==void 0?n-s:n!==void 0?-1:s!==void 0?1:0})),e},calculateBalance(i){let e=0;for(const t of i)e+=t.value??0;return e},formatTokenBalance(i){const e=i.toFixed(2),[t,r]=e.split(".");return{dollars:t,pennies:r}},isAddress(i){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(i)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(i)||/^(?:0x)?[0-9A-F]{40}$/iu.test(i))return!0}else return!1;return!1}};class Ql{constructor({baseUrl:e}){this.baseUrl=e}async get({headers:e,signal:t,...r}){const o=this.createUrl(r);return(await fetch(o,{method:"GET",headers:e,signal:t,cache:"no-cache"})).json()}async getBlob({headers:e,signal:t,...r}){const o=this.createUrl(r);return(await fetch(o,{method:"GET",headers:e,signal:t})).blob()}async post({body:e,headers:t,signal:r,...o}){const n=this.createUrl(o);return(await fetch(n,{method:"POST",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}async put({body:e,headers:t,signal:r,...o}){const n=this.createUrl(o);return(await fetch(n,{method:"PUT",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}async delete({body:e,headers:t,signal:r,...o}){const n=this.createUrl(o);return(await fetch(n,{method:"DELETE",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}createUrl({path:e,params:t}){const r=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([o,n])=>{n&&r.searchParams.append(o,n)}),r}}const _t=kt({projectId:"",sdkType:"w3m",sdkVersion:"html-wagmi-undefined"}),pe={state:_t,subscribeKey(i,e){return ri(_t,i,e)},setProjectId(i){_t.projectId=i},setAllWallets(i){_t.allWallets=i},setIncludeWalletIds(i){_t.includeWalletIds=i},setExcludeWalletIds(i){_t.excludeWalletIds=i},setFeaturedWalletIds(i){_t.featuredWalletIds=i},setTokens(i){_t.tokens=i},setTermsConditionsUrl(i){_t.termsConditionsUrl=i},setPrivacyPolicyUrl(i){_t.privacyPolicyUrl=i},setCustomWallets(i){_t.customWallets=i},setIsSiweEnabled(i){_t.isSiweEnabled=i},setEnableAnalytics(i){_t.enableAnalytics=i},setSdkVersion(i){_t.sdkVersion=i},setMetadata(i){_t.metadata=i},setOnrampEnabled(i){_t.enableOnramp=i},setWalletFeaturesEnabled(i){_t.enableWalletFeatures=i}},af={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},cf=re.getBlockchainApiUrl(),ci=new Ql({baseUrl:cf}),Lt={fetchIdentity({address:i}){return ci.get({path:`/v1/identity/${i}`,params:{projectId:pe.state.projectId}})},fetchTransactions({account:i,projectId:e,cursor:t,onramp:r,signal:o}){const n=t?{cursor:t}:{};return ci.get({path:`/v1/account/${i}/history?projectId=${e}${r?`&onramp=${r}`:""}`,params:n,signal:o})},fetchConvertTokens({projectId:i,chainId:e}){return ci.get({path:`/v1/convert/tokens?projectId=${i}&chainId=${e}`})},fetchTokenPrice({projectId:i,addresses:e}){return ci.post({path:"/v1/fungible/price",body:{projectId:i,currency:"usd",addresses:e},headers:{"Content-Type":"application/json"}})},fetchConvertAllowance({projectId:i,tokenAddress:e,userAddress:t}){const{sdkType:r,sdkVersion:o}=pe.state;return ci.get({path:`/v1/convert/allowance?projectId=${i}&tokenAddress=${e}&userAddress=${t}`,headers:{"Content-Type":"application/json","x-sdk-type":r,"x-sdk-version":o}})},fetchGasPrice({projectId:i,chainId:e}){const{sdkType:t,sdkVersion:r}=pe.state;return ci.get({path:`/v1/convert/gas-price?projectId=${i}&chainId=${e}`,headers:{"Content-Type":"application/json","x-sdk-type":t,"x-sdk-version":r}})},generateConvertCalldata({amount:i,from:e,projectId:t,to:r,userAddress:o}){return ci.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:i,eip155:{slippage:dt.CONVERT_SLIPPAGE_TOLERANCE},from:e,projectId:t,to:r,userAddress:o}})},generateApproveCalldata({from:i,projectId:e,to:t,userAddress:r}){const{sdkType:o,sdkVersion:n}=pe.state;return ci.get({path:`/v1/convert/build-approve?projectId=${e}&userAddress=${r}&from=${i}&to=${t}`,headers:{"Content-Type":"application/json","x-sdk-type":o,"x-sdk-version":n}})},async getBalance(i,e){const{sdkType:t,sdkVersion:r}=pe.state;return ci.get({path:`/v1/account/${i}/balance`,headers:{"x-sdk-type":t,"x-sdk-version":r},params:{currency:"usd",projectId:pe.state.projectId,chainId:e}})},async generateOnRampURL({destinationWallets:i,partnerUserId:e,defaultNetwork:t,purchaseAmount:r,paymentAmount:o}){return(await ci.post({path:`/v1/generators/onrampurl?projectId=${pe.state.projectId}`,body:{destinationWallets:i,defaultNetwork:t,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:r,presetFiatAmount:o}})).url},async getOnrampOptions(){try{return await ci.get({path:`/v1/onramp/options?projectId=${pe.state.projectId}`})}catch{return af}},async getOnrampQuote({purchaseCurrency:i,paymentCurrency:e,amount:t,network:r}){try{return await ci.post({path:`/v1/onramp/quote?projectId=${pe.state.projectId}`,body:{purchaseCurrency:i,paymentCurrency:e,amount:t,network:r}})}catch{return{coinbaseFee:{amount:t,currency:e.id},networkFee:{amount:t,currency:e.id},paymentSubtotal:{amount:t,currency:e.id},paymentTotal:{amount:t,currency:e.id},purchaseAmount:{amount:t,currency:e.id},quoteId:"mocked-quote-id"}}}},rn=kt({message:"",variant:"success",open:!1}),Le={state:rn,subscribeKey(i,e){return ri(rn,i,e)},showSuccess(i){rn.message=i,rn.variant="success",rn.open=!0},showError(i){const e=re.parseError(i);rn.message=e,rn.variant="error",rn.open=!0},hide(){rn.open=!1}},Vc="WALLETCONNECT_DEEPLINK_CHOICE",ed="@w3m/recent",td="@w3m/connected_wallet_image_url",id="@w3m/connected_connector",ht={setWalletConnectDeepLink({href:i,name:e}){try{localStorage.setItem(Vc,JSON.stringify({href:i,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const i=localStorage.getItem(Vc);if(i)return JSON.parse(i)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{localStorage.removeItem(Vc)}catch{console.info("Unable to delete WalletConnect deep link")}},setWeb3ModalRecent(i){try{const e=ht.getRecentWallets();e.find(r=>r.id===i.id)||(e.unshift(i),e.length>2&&e.pop(),localStorage.setItem(ed,JSON.stringify(e)))}catch{console.info("Unable to set Web3Modal recent")}},getRecentWallets(){try{const i=localStorage.getItem(ed);return i?JSON.parse(i):[]}catch{console.info("Unable to get Web3Modal recent")}return[]},setConnectedWalletImageUrl(i){try{localStorage.setItem(td,i)}catch{console.info("Unable to set Connected Wallet Image Url")}},getConnectedWalletImageUrl(){try{return localStorage.getItem(td)}catch{console.info("Unable to set Connected Wallet Image Url")}},setConnectedConnector(i){try{localStorage.setItem(id,i)}catch{console.info("Unable to set Connected Connector")}},getConnectedConnector(){try{return localStorage.getItem(id)}catch{console.info("Unable to get Connected Connector")}}},lf=re.getAnalyticsUrl(),uf=new Ql({baseUrl:lf}),df=["MODAL_CREATED"],Qr=kt({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),we={state:Qr,subscribe(i){return Xt(Qr,()=>i(Qr))},_getApiHeaders(){const{projectId:i,sdkType:e,sdkVersion:t}=pe.state;return{"x-project-id":i,"x-sdk-type":e,"x-sdk-version":t}},async _sendAnalyticsEvent(i){try{if(df.includes(i.data.event)||typeof window>"u")return;await uf.post({path:"/e",headers:we._getApiHeaders(),body:{eventId:re.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:i.timestamp,props:i.data}})}catch{}},sendEvent(i){Qr.timestamp=Date.now(),Qr.data=i,pe.state.enableAnalytics&&we._sendAnalyticsEvent(Qr)}},tt=kt({transactions:[],coinbaseTransactions:{},transactionsByYear:{},loading:!1,empty:!1,next:void 0}),$t={state:tt,subscribe(i){return Xt(tt,()=>i(tt))},async fetchTransactions(i,e){const{projectId:t}=pe.state;if(!t||!i)throw new Error("Transactions can't be fetched without a projectId and an accountAddress");tt.loading=!0;try{const r=await Lt.fetchTransactions({account:i,projectId:t,cursor:tt.next,onramp:e}),o=this.filterSpamTransactions(r.data),n=[...tt.transactions,...o];tt.loading=!1,e==="coinbase"?tt.coinbaseTransactions=this.groupTransactionsByYearAndMonth(tt.coinbaseTransactions,r.data):(tt.transactions=n,tt.transactionsByYear=this.groupTransactionsByYearAndMonth(tt.transactionsByYear,o)),tt.empty=n.length===0,tt.next=r.next?r.next:void 0}catch{we.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:i,projectId:t,cursor:tt.next}}),Le.showError("Failed to fetch transactions"),tt.loading=!1,tt.empty=!0,tt.next=void 0}},groupTransactionsByYearAndMonth(i={},e=[]){const t=i;return e.forEach(r=>{const o=new Date(r.metadata.minedAt).getFullYear(),n=new Date(r.metadata.minedAt).getMonth(),s=t[o]??{},c=(s[n]??[]).filter(l=>l.id!==r.id);t[o]={...s,[n]:[...c,r].sort((l,h)=>new Date(h.metadata.minedAt).getTime()-new Date(l.metadata.minedAt).getTime())}}),t},filterSpamTransactions(i){return i.filter(e=>!e.transfers.every(r=>{var o;return((o=r.nft_info)==null?void 0:o.flags.is_spam)===!0}))},clearCursor(){tt.next=void 0},resetTransactions(){tt.transactions=[],tt.transactionsByYear={},tt.loading=!1,tt.empty=!1,tt.next=void 0}},gt=kt({wcError:!1,buffering:!1}),ke={state:gt,subscribeKey(i,e){return ri(gt,i,e)},_getClient(){if(!gt._client)throw new Error("ConnectionController client not set");return gt._client},setClient(i){gt._client=uo(i)},connectWalletConnect(){gt.wcPromise=this._getClient().connectWalletConnect(i=>{gt.wcUri=i,gt.wcPairingExpiry=re.getPairingExpiry()}),ht.setConnectedConnector("WALLET_CONNECT")},async connectExternal(i){var e,t;await((t=(e=this._getClient()).connectExternal)==null?void 0:t.call(e,i)),ht.setConnectedConnector(i.type)},async signMessage(i){return this._getClient().signMessage(i)},parseUnits(i,e){return this._getClient().parseUnits(i,e)},formatUnits(i,e){return this._getClient().formatUnits(i,e)},async sendTransaction(i){return this._getClient().sendTransaction(i)},async estimateGas(i){return this._getClient().estimateGas(i)},checkInstalled(i){var e,t;return(t=(e=this._getClient()).checkInstalled)==null?void 0:t.call(e,i)},resetWcConnection(){gt.wcUri=void 0,gt.wcPairingExpiry=void 0,gt.wcPromise=void 0,gt.wcLinking=void 0,gt.recentWallet=void 0,$t.resetTransactions(),ht.deleteWalletConnectDeepLink()},setWcLinking(i){gt.wcLinking=i},setWcError(i){gt.wcError=i,gt.buffering=!1},setRecentWallet(i){gt.recentWallet=i},setBuffering(i){gt.buffering=i},async disconnect(){await this._getClient().disconnect(),this.resetWcConnection()}},Zo=kt({loading:!1,open:!1,selectedNetworkId:void 0}),fr={state:Zo,subscribe(i){return Xt(Zo,()=>i(Zo))},set(i){Object.assign(Zo,{...Zo,...i})}};var P0={exports:{}};(function(i,e){(function(t,r){i.exports=r()})(Jl,function(){var t=1e3,r=6e4,o=36e5,n="millisecond",s="second",a="minute",c="hour",l="day",h="week",p="month",v="quarter",S="year",O="date",D="Invalid Date",R=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,B=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var y=["th","st","nd","rd"],E=P%100;return"["+P+(y[(E-20)%10]||y[E]||y[0])+"]"}},W=function(P,y,E){var I=String(P);return!I||I.length>=y?P:""+Array(y+1-I.length).join(E)+P},M={s:W,z:function(P){var y=-P.utcOffset(),E=Math.abs(y),I=Math.floor(E/60),$=E%60;return(y<=0?"+":"-")+W(I,2,"0")+":"+W($,2,"0")},m:function P(y,E){if(y.date()1)return P(Y[0])}else{var K=y.name;Z[K]=y,$=K}return!I&&$&&(j=$),$||!I&&j},m=function(P,y){if(f(P))return P.clone();var E=typeof y=="object"?y:{};return E.date=P,E.args=arguments,new _(E)},A=M;A.l=w,A.i=f,A.w=function(P,y){return m(P,{locale:y.$L,utc:y.$u,x:y.$x,$offset:y.$offset})};var _=function(){function P(E){this.$L=w(E.locale,null,!0),this.parse(E),this.$x=this.$x||E.x||{},this[ie]=!0}var y=P.prototype;return y.parse=function(E){this.$d=function(I){var $=I.date,F=I.utc;if($===null)return new Date(NaN);if(A.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var Y=$.match(R);if(Y){var K=Y[2]-1||0,se=(Y[7]||"0").substring(0,3);return F?new Date(Date.UTC(Y[1],K,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,se)):new Date(Y[1],K,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,se)}}return new Date($)}(E),this.init()},y.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},y.$utils=function(){return A},y.isValid=function(){return this.$d.toString()!==D},y.isSame=function(E,I){var $=m(E);return this.startOf(I)<=$&&$<=this.endOf(I)},y.isAfter=function(E,I){return m(E)0,Z<=j.r||!j.r){Z<=1&&M>0&&(j=k[M-1]);var ie=B[j.l];S&&(Z=S(""+Z)),D=typeof ie=="string"?ie.replace("%d",Z):ie(Z,h,j.l,R);break}}if(h)return D;var f=R?B.future:B.past;return typeof f=="function"?f(D):f.replace("%s",D)},n.to=function(l,h){return a(l,h,this,!0)},n.from=function(l,h){return a(l,h,this)};var c=function(l){return l.$u?o.utc():o()};n.toNow=function(l){return this.to(c(this),l)},n.fromNow=function(l){return this.from(c(this),l)}}})})(D0);var gf=D0.exports;const wf=rc(gf);ro.extend(wf);ro.extend(ff);ro.updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"%s sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}});const eu={getYear(i=new Date().toISOString()){return ro(i).year()},getRelativeDateFromNow(i){return ro(i).fromNow(!0)},formatDate(i,e="DD MMM"){return ro(i).format(e)}},dr={caipNetworkIdToNumber(i){return i?Number(i.split(":")[1]):void 0}};var mf=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Zc=Math.ceil,ui=Math.floor,Ft="[BigNumber Error] ",nd=Ft+"Number primitive has more than 15 significant digits: ",bi=1e14,Se=14,Gc=9007199254740991,qc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Cn=1e7,wt=1e9;function M0(i){var e,t,r,o=k.prototype={constructor:k,toString:null,valueOf:null},n=new k(1),s=20,a=4,c=-7,l=21,h=-1e7,p=1e7,v=!1,S=1,O=0,D={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",B=!0;function k(f,w){var m,A,_,N,P,y,E,I,$=this;if(!($ instanceof k))return new k(f,w);if(w==null){if(f&&f._isBigNumber===!0){$.s=f.s,!f.c||f.e>p?$.c=$.e=null:f.e=10;P/=10,N++);N>p?$.c=$.e=null:($.e=N,$.c=[f]);return}I=String(f)}else{if(!mf.test(I=String(f)))return r($,I,y);$.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(N=I.indexOf("."))>-1&&(I=I.replace(".","")),(P=I.search(/e/i))>0?(N<0&&(N=P),N+=+I.slice(P+1),I=I.substring(0,P)):N<0&&(N=I.length)}else{if(it(w,2,R.length,"Base"),w==10&&B)return $=new k(f),Z($,s+$.e+1,a);if(I=String(f),y=typeof f=="number"){if(f*0!=0)return r($,I,y,w);if($.s=1/f<0?(I=I.slice(1),-1):1,k.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(nd+f)}else $.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(m=R.slice(0,w),N=P=0,E=I.length;PN){N=E;continue}}else if(!_&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){_=!0,P=-1,N=0;continue}return r($,String(f),y,w)}y=!1,I=t(I,w,10,$.s),(N=I.indexOf("."))>-1?I=I.replace(".",""):N=I.length}for(P=0;I.charCodeAt(P)===48;P++);for(E=I.length;I.charCodeAt(--E)===48;);if(I=I.slice(P,++E)){if(E-=P,y&&k.DEBUG&&E>15&&(f>Gc||f!==ui(f)))throw Error(nd+$.s*f);if((N=N-P-1)>p)$.c=$.e=null;else if(N=-wt&&_<=wt&&_===ui(_)){if(A[0]===0){if(_===0&&A.length===1)return!0;break e}if(w=(_+1)%Se,w<1&&(w+=Se),String(A[0]).length==w){for(w=0;w=bi||m!==ui(m))break e;if(m!==0)return!0}}}else if(A===null&&_===null&&(N===null||N===1||N===-1))return!0;throw Error(Ft+"Invalid BigNumber: "+f)},k.maximum=k.max=function(){return M(arguments,-1)},k.minimum=k.min=function(){return M(arguments,1)},k.random=function(){var f=9007199254740992,w=Math.random()*f&2097151?function(){return ui(Math.random()*f)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(m){var A,_,N,P,y,E=0,I=[],$=new k(n);if(m==null?m=s:it(m,0,wt),P=Zc(m/Se),v)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(P*=2));E>>11),y>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),A[E]=_[0],A[E+1]=_[1]):(I.push(y%1e14),E+=2);E=P/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(P*=7);E=9e15?crypto.randomBytes(7).copy(A,E):(I.push(y%1e14),E+=7);E=P/7}else throw v=!1,Error(Ft+"crypto unavailable");if(!v)for(;E=10;y/=10,E++);E_-1&&(y[P+1]==null&&(y[P+1]=0),y[P+1]+=y[P]/_|0,y[P]%=_)}return y.reverse()}return function(m,A,_,N,P){var y,E,I,$,F,Y,K,se,Te=m.indexOf("."),Pe=s,ye=a;for(Te>=0&&($=O,O=0,m=m.replace(".",""),se=new k(A),Y=se.pow(m.length-Te),O=$,se.c=w(on(li(Y.c),Y.e,"0"),10,_,f),se.e=se.c.length),K=w(m,A,_,P?(y=R,f):(y=f,R)),I=$=K.length;K[--$]==0;K.pop());if(!K[0])return y.charAt(0);if(Te<0?--I:(Y.c=K,Y.e=I,Y.s=N,Y=e(Y,se,Pe,ye,_),K=Y.c,F=Y.r,I=Y.e),E=I+Pe+1,Te=K[E],$=_/2,F=F||E<0||K[E+1]!=null,F=ye<4?(Te!=null||F)&&(ye==0||ye==(Y.s<0?3:2)):Te>$||Te==$&&(ye==4||F||ye==6&&K[E-1]&1||ye==(Y.s<0?8:7)),E<1||!K[0])m=F?on(y.charAt(1),-Pe,y.charAt(0)):y.charAt(0);else{if(K.length=E,F)for(--_;++K[--E]>_;)K[E]=0,E||(++I,K=[1].concat(K));for($=K.length;!K[--$];);for(Te=0,m="";Te<=$;m+=y.charAt(K[Te++]));m=on(m,I,y.charAt(0))}return m}}(),e=function(){function f(A,_,N){var P,y,E,I,$=0,F=A.length,Y=_%Cn,K=_/Cn|0;for(A=A.slice();F--;)E=A[F]%Cn,I=A[F]/Cn|0,P=K*E+I*Y,y=Y*E+P%Cn*Cn+$,$=(y/N|0)+(P/Cn|0)+K*I,A[F]=y%N;return $&&(A=[$].concat(A)),A}function w(A,_,N,P){var y,E;if(N!=P)E=N>P?1:-1;else for(y=E=0;y_[y]?1:-1;break}return E}function m(A,_,N,P){for(var y=0;N--;)A[N]-=y,y=A[N]<_[N]?1:0,A[N]=y*P+A[N]-_[N];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,_,N,P,y){var E,I,$,F,Y,K,se,Te,Pe,ye,Ne,Ze,Ct,Nt,st,at,Wt,Xe=A.s==_.s?1:-1,ct=A.c,Qe=_.c;if(!ct||!ct[0]||!Qe||!Qe[0])return new k(!A.s||!_.s||(ct?Qe&&ct[0]==Qe[0]:!Qe)?NaN:ct&&ct[0]==0||!Qe?Xe*0:Xe/0);for(Te=new k(Xe),Pe=Te.c=[],I=A.e-_.e,Xe=N+I+1,y||(y=bi,I=di(A.e/Se)-di(_.e/Se),Xe=Xe/Se|0),$=0;Qe[$]==(ct[$]||0);$++);if(Qe[$]>(ct[$]||0)&&I--,Xe<0)Pe.push(1),F=!0;else{for(Nt=ct.length,at=Qe.length,$=0,Xe+=2,Y=ui(y/(Qe[0]+1)),Y>1&&(Qe=f(Qe,Y,y),ct=f(ct,Y,y),at=Qe.length,Nt=ct.length),Ct=at,ye=ct.slice(0,at),Ne=ye.length;Ne=y/2&&st++;do{if(Y=0,E=w(Qe,ye,at,Ne),E<0){if(Ze=ye[0],at!=Ne&&(Ze=Ze*y+(ye[1]||0)),Y=ui(Ze/st),Y>1)for(Y>=y&&(Y=y-1),K=f(Qe,Y,y),se=K.length,Ne=ye.length;w(K,ye,se,Ne)==1;)Y--,m(K,at=10;Xe/=10,$++);Z(Te,N+(Te.e=$+I*Se-1)+1,P,F)}else Te.e=I,Te.r=+F;return Te}}();function W(f,w,m,A){var _,N,P,y,E;if(m==null?m=a:it(m,0,8),!f.c)return f.toString();if(_=f.c[0],P=f.e,w==null)E=li(f.c),E=A==1||A==2&&(P<=c||P>=l)?ca(E,P):on(E,P,"0");else if(f=Z(new k(f),w,m),N=f.e,E=li(f.c),y=E.length,A==1||A==2&&(w<=N||N<=c)){for(;yy){if(--w>0)for(E+=".";w--;E+="0");}else if(w+=N-y,w>0)for(N+1==y&&(E+=".");w--;E+="0");return f.s<0&&_?"-"+E:E}function M(f,w){for(var m,A,_=1,N=new k(f[0]);_=10;_/=10,A++);return(m=A+m*Se-1)>p?f.c=f.e=null:m=10;y/=10,_++);if(N=w-_,N<0)N+=Se,P=w,E=F[I=0],$=ui(E/Y[_-P-1]%10);else if(I=Zc((N+1)/Se),I>=F.length)if(A){for(;F.length<=I;F.push(0));E=$=0,_=1,N%=Se,P=N-Se+1}else break e;else{for(E=y=F[I],_=1;y>=10;y/=10,_++);N%=Se,P=N-Se+_,$=P<0?0:ui(E/Y[_-P-1]%10)}if(A=A||w<0||F[I+1]!=null||(P<0?E:E%Y[_-P-1]),A=m<4?($||A)&&(m==0||m==(f.s<0?3:2)):$>5||$==5&&(m==4||A||m==6&&(N>0?P>0?E/Y[_-P]:0:F[I-1])%10&1||m==(f.s<0?8:7)),w<1||!F[0])return F.length=0,A?(w-=f.e+1,F[0]=Y[(Se-w%Se)%Se],f.e=-w||0):F[0]=f.e=0,f;if(N==0?(F.length=I,y=1,I--):(F.length=I+1,y=Y[Se-N],F[I]=P>0?ui(E/Y[_-P]%Y[P])*y:0),A)for(;;)if(I==0){for(N=1,P=F[0];P>=10;P/=10,N++);for(P=F[0]+=y,y=1;P>=10;P/=10,y++);N!=y&&(f.e++,F[0]==bi&&(F[0]=1));break}else{if(F[I]+=y,F[I]!=bi)break;F[I--]=0,y=1}for(N=F.length;F[--N]===0;F.pop());}f.e>p?f.c=f.e=null:f.e=l?ca(w,m):on(w,m,"0"),f.s<0?"-"+w:w)}return o.absoluteValue=o.abs=function(){var f=new k(this);return f.s<0&&(f.s=1),f},o.comparedTo=function(f,w){return rr(this,new k(f,w))},o.decimalPlaces=o.dp=function(f,w){var m,A,_,N=this;if(f!=null)return it(f,0,wt),w==null?w=a:it(w,0,8),Z(new k(N),f+N.e+1,w);if(!(m=N.c))return null;if(A=((_=m.length-1)-di(this.e/Se))*Se,_=m[_])for(;_%10==0;_/=10,A--);return A<0&&(A=0),A},o.dividedBy=o.div=function(f,w){return e(this,new k(f,w),s,a)},o.dividedToIntegerBy=o.idiv=function(f,w){return e(this,new k(f,w),0,1)},o.exponentiatedBy=o.pow=function(f,w){var m,A,_,N,P,y,E,I,$,F=this;if(f=new k(f),f.c&&!f.isInteger())throw Error(Ft+"Exponent not an integer: "+ie(f));if(w!=null&&(w=new k(w)),y=f.e>14,!F.c||!F.c[0]||F.c[0]==1&&!F.e&&F.c.length==1||!f.c||!f.c[0])return $=new k(Math.pow(+ie(F),y?f.s*(2-aa(f)):+ie(f))),w?$.mod(w):$;if(E=f.s<0,w){if(w.c?!w.c[0]:!w.s)return new k(NaN);A=!E&&F.isInteger()&&w.isInteger(),A&&(F=F.mod(w))}else{if(f.e>9&&(F.e>0||F.e<-1||(F.e==0?F.c[0]>1||y&&F.c[1]>=24e7:F.c[0]<8e13||y&&F.c[0]<=9999975e7)))return N=F.s<0&&aa(f)?-0:0,F.e>-1&&(N=1/N),new k(E?1/N:N);O&&(N=Zc(O/Se+2))}for(y?(m=new k(.5),E&&(f.s=1),I=aa(f)):(_=Math.abs(+ie(f)),I=_%2),$=new k(n);;){if(I){if($=$.times(F),!$.c)break;N?$.c.length>N&&($.c.length=N):A&&($=$.mod(w))}if(_){if(_=ui(_/2),_===0)break;I=_%2}else if(f=f.times(m),Z(f,f.e+1,1),f.e>14)I=aa(f);else{if(_=+ie(f),_===0)break;I=_%2}F=F.times(F),N?F.c&&F.c.length>N&&(F.c.length=N):A&&(F=F.mod(w))}return A?$:(E&&($=n.div($)),w?$.mod(w):N?Z($,O,a,P):$)},o.integerValue=function(f){var w=new k(this);return f==null?f=a:it(f,0,8),Z(w,w.e+1,f)},o.isEqualTo=o.eq=function(f,w){return rr(this,new k(f,w))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(f,w){return rr(this,new k(f,w))>0},o.isGreaterThanOrEqualTo=o.gte=function(f,w){return(w=rr(this,new k(f,w)))===1||w===0},o.isInteger=function(){return!!this.c&&di(this.e/Se)>this.c.length-2},o.isLessThan=o.lt=function(f,w){return rr(this,new k(f,w))<0},o.isLessThanOrEqualTo=o.lte=function(f,w){return(w=rr(this,new k(f,w)))===-1||w===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(f,w){var m,A,_,N,P=this,y=P.s;if(f=new k(f,w),w=f.s,!y||!w)return new k(NaN);if(y!=w)return f.s=-w,P.plus(f);var E=P.e/Se,I=f.e/Se,$=P.c,F=f.c;if(!E||!I){if(!$||!F)return $?(f.s=-w,f):new k(F?P:NaN);if(!$[0]||!F[0])return F[0]?(f.s=-w,f):new k($[0]?P:a==3?-0:0)}if(E=di(E),I=di(I),$=$.slice(),y=E-I){for((N=y<0)?(y=-y,_=$):(I=E,_=F),_.reverse(),w=y;w--;_.push(0));_.reverse()}else for(A=(N=(y=$.length)<(w=F.length))?y:w,y=w=0;w0)for(;w--;$[m++]=0);for(w=bi-1;A>y;){if($[--A]=0;){for(m=0,Y=Ze[_]%Pe,K=Ze[_]/Pe|0,P=E,N=_+P;N>_;)I=Ne[--P]%Pe,$=Ne[P]/Pe|0,y=K*I+$*Y,I=Y*I+y%Pe*Pe+se[N]+m,m=(I/Te|0)+(y/Pe|0)+K*$,se[N--]=I%Te;se[N]=m}return m?++A:se.splice(0,1),j(f,se,A)},o.negated=function(){var f=new k(this);return f.s=-f.s||null,f},o.plus=function(f,w){var m,A=this,_=A.s;if(f=new k(f,w),w=f.s,!_||!w)return new k(NaN);if(_!=w)return f.s=-w,A.minus(f);var N=A.e/Se,P=f.e/Se,y=A.c,E=f.c;if(!N||!P){if(!y||!E)return new k(_/0);if(!y[0]||!E[0])return E[0]?f:new k(y[0]?A:_*0)}if(N=di(N),P=di(P),y=y.slice(),_=N-P){for(_>0?(P=N,m=E):(_=-_,m=y),m.reverse();_--;m.push(0));m.reverse()}for(_=y.length,w=E.length,_-w<0&&(m=E,E=y,y=m,w=_),_=0;w;)_=(y[--w]=y[w]+E[w]+_)/bi|0,y[w]=bi===y[w]?0:y[w]%bi;return _&&(y=[_].concat(y),++P),j(f,y,P)},o.precision=o.sd=function(f,w){var m,A,_,N=this;if(f!=null&&f!==!!f)return it(f,1,wt),w==null?w=a:it(w,0,8),Z(new k(N),f,w);if(!(m=N.c))return null;if(_=m.length-1,A=_*Se+1,_=m[_]){for(;_%10==0;_/=10,A--);for(_=m[0];_>=10;_/=10,A++);}return f&&N.e+1>A&&(A=N.e+1),A},o.shiftedBy=function(f){return it(f,-Gc,Gc),this.times("1e"+f)},o.squareRoot=o.sqrt=function(){var f,w,m,A,_,N=this,P=N.c,y=N.s,E=N.e,I=s+4,$=new k("0.5");if(y!==1||!P||!P[0])return new k(!y||y<0&&(!P||P[0])?NaN:P?N:1/0);if(y=Math.sqrt(+ie(N)),y==0||y==1/0?(w=li(P),(w.length+E)%2==0&&(w+="0"),y=Math.sqrt(+w),E=di((E+1)/2)-(E<0||E%2),y==1/0?w="5e"+E:(w=y.toExponential(),w=w.slice(0,w.indexOf("e")+1)+E),m=new k(w)):m=new k(y+""),m.c[0]){for(E=m.e,y=E+I,y<3&&(y=0);;)if(_=m,m=$.times(_.plus(e(N,_,I,1))),li(_.c).slice(0,y)===(w=li(m.c)).slice(0,y))if(m.e0&&se>0){for(N=se%y||y,$=K.substr(0,N);N0&&($+=I+K.slice(N)),Y&&($="-"+$)}A=F?$+(m.decimalSeparator||"")+((E=+m.fractionGroupSize)?F.replace(new RegExp("\\d{"+E+"}\\B","g"),"$&"+(m.fractionGroupSeparator||"")):F):$}return(m.prefix||"")+A+(m.suffix||"")},o.toFraction=function(f){var w,m,A,_,N,P,y,E,I,$,F,Y,K=this,se=K.c;if(f!=null&&(y=new k(f),!y.isInteger()&&(y.c||y.s!==1)||y.lt(n)))throw Error(Ft+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+ie(y));if(!se)return new k(K);for(w=new k(n),I=m=new k(n),A=E=new k(n),Y=li(se),N=w.e=Y.length-K.e-1,w.c[0]=qc[(P=N%Se)<0?Se+P:P],f=!f||y.comparedTo(w)>0?N>0?w:I:y,P=p,p=1/0,y=new k(Y),E.c[0]=0;$=e(y,w,0,1),_=m.plus($.times(A)),_.comparedTo(f)!=1;)m=A,A=_,I=E.plus($.times(_=I)),E=_,w=y.minus($.times(_=w)),y=_;return _=e(f.minus(m),A,0,1),E=E.plus(_.times(I)),m=m.plus(_.times(A)),E.s=I.s=K.s,N=N*2,F=e(I,A,N,a).minus(K).abs().comparedTo(e(E,m,N,a).minus(K).abs())<1?[I,A]:[E,m],p=P,F},o.toNumber=function(){return+ie(this)},o.toPrecision=function(f,w){return f!=null&&it(f,1,wt),W(this,f,w,2)},o.toString=function(f){var w,m=this,A=m.s,_=m.e;return _===null?A?(w="Infinity",A<0&&(w="-"+w)):w="NaN":(f==null?w=_<=c||_>=l?ca(li(m.c),_):on(li(m.c),_,"0"):f===10&&B?(m=Z(new k(m),s+_+1,a),w=on(li(m.c),m.e,"0")):(it(f,2,R.length,"Base"),w=t(on(li(m.c),_,"0"),10,f,A,!0)),A<0&&m.c[0]&&(w="-"+w)),w},o.valueOf=o.toJSON=function(){return ie(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,i!=null&&k.set(i),k}function di(i){var e=i|0;return i>0||i===e?e:e-1}function li(i){for(var e,t,r=1,o=i.length,n=i[0]+"";rl^t?1:-1;for(a=(c=o.length)<(l=n.length)?c:l,s=0;sn[s]^t?1:-1;return c==l?0:c>l^t?1:-1}function it(i,e,t,r){if(it||i!==ui(i))throw Error(Ft+(r||"Argument")+(typeof i=="number"?it?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function aa(i){var e=i.c.length-1;return di(i.e/Se)==e&&i.c[e]%2!=0}function ca(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function on(i,e,t){var r,o;if(e<0){for(o=t+".";++e;o+=t);i=o+i}else if(r=i.length,++e>r){for(o=t,e-=r;--e;o+=t);i+=o}else ei(Ve))},subscribeKey(i,e){return ri(Ve,i,e)},_getClient(){if(!Ve._client)throw new Error("NetworkController client not set");return Ve._client},setClient(i){Ve._client=uo(i)},setCaipNetwork(i){Ve.caipNetwork=i,fr.set({selectedNetworkId:i==null?void 0:i.id}),this.state.allowUnsupportedChain||this.checkIfSupportedNetwork()},setDefaultCaipNetwork(i){Ve.caipNetwork=i,fr.set({selectedNetworkId:i==null?void 0:i.id}),Ve.isDefaultCaipNetwork=!0},setRequestedCaipNetworks(i){Ve.requestedCaipNetworks=i},setAllowUnsupportedChain(i){Ve.allowUnsupportedChain=i},setSmartAccountEnabledNetworks(i){Ve.smartAccountEnabledNetworks=i},getRequestedCaipNetworks(){const{approvedCaipNetworkIds:i,requestedCaipNetworks:e}=Ve,t=i,r=e;return re.sortRequestedNetworks(t,r)},async getApprovedCaipNetworksData(){const i=await this._getClient().getApprovedCaipNetworksData();Ve.supportsAllNetworks=i.supportsAllNetworks,Ve.approvedCaipNetworkIds=i.approvedCaipNetworkIds},async switchActiveNetwork(i){await this._getClient().switchCaipNetwork(i),Ve.caipNetwork=i,i&&we.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:i.id}})},checkIfSupportedNetwork(){var i;Ve.isUnsupportedChain=!((i=Ve.requestedCaipNetworks)!=null&&i.some(e=>{var t;return e.id===((t=Ve.caipNetwork)==null?void 0:t.id)})),Ve.isUnsupportedChain&&this.showUnsupportedChainUI()},checkIfSmartAccountEnabled(){var e,t;const i=dr.caipNetworkIdToNumber((e=Ve.caipNetwork)==null?void 0:e.id);return i?!!((t=Ve.smartAccountEnabledNetworks)!=null&&t.includes(i)):!1},resetNetwork(){Ve.isDefaultCaipNetwork||(Ve.caipNetwork=void 0),Ve.approvedCaipNetworkIds=void 0,Ve.supportsAllNetworks=!0,Ve.smartAccountEnabledNetworks=[]},showUnsupportedChainUI(){setTimeout(()=>{Re.open({view:"UnsupportedChain"})},300)}},Ko={async getTokenList(){var t;return(await Lt.fetchConvertTokens({chainId:(t=de.state.caipNetwork)==null?void 0:t.id,projectId:pe.state.projectId})).tokens.map(r=>({...r,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0}))},async fetchGasPrice(){const i=pe.state.projectId,e=de.state.caipNetwork;return e?await Lt.fetchGasPrice({projectId:i,chainId:e.id}):null},async fetchConvertAllowance({tokenAddress:i,userAddress:e,sourceTokenAmount:t,sourceTokenDecimals:r}){const o=pe.state.projectId,n=await Lt.fetchConvertAllowance({projectId:o,tokenAddress:i,userAddress:e});if(n!=null&&n.allowance&&t&&r){const s=ke.parseUnits(t,r);return BigInt(n.allowance)>=s}return!1},async getMyTokensWithBalance(){const i=te.state.address,e=de.state.caipNetwork;if(!i||!e)return[];const r=(await Lt.getBalance(i,e.id)).balances;return this.mapBalancesToConvertTokens(r)},mapBalancesToConvertTokens(i){return i.map(e=>{var t;return{symbol:e.symbol,name:e.name,address:e!=null&&e.address?e.address:`${(t=de.state.caipNetwork)==null?void 0:t.id}:${dt.NATIVE_TOKEN_ADDRESS}`,decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1,quantity:e.quantity,price:e.price,value:e.value}})}},Je=kt({view:"Connect",history:["Connect"],transactionStack:[]}),G={state:Je,subscribeKey(i,e){return ri(Je,i,e)},pushTransactionStack(i){Je.transactionStack.push(i)},popTransactionStack(i){var t,r;const e=Je.transactionStack.pop();e&&(i?(this.goBack(),(t=e==null?void 0:e.onCancel)==null||t.call(e)):(e.goBack?this.goBack():e.view&&this.reset(e.view),(r=e==null?void 0:e.onSuccess)==null||r.call(e)))},push(i,e){i!==Je.view&&(Je.view=i,Je.history.push(i),Je.data=e)},reset(i){Je.view=i,Je.history=[i]},replace(i,e){Je.history.length>1&&Je.history.at(-1)!==i&&(Je.view=i,Je.history[Je.history.length-1]=i,Je.data=e)},goBack(){if(Je.history.length>1){Je.history.pop();const[i]=Je.history.slice(-1);i&&(Je.view=i)}},goBackToIndex(i){if(Je.history.length>1){Je.history=Je.history.slice(0,i+1);const[e]=Je.history.slice(-1);e&&(Je.view=e)}}},vf=15e4,X=kt({initialized:!1,loading:!1,loadingPrices:!1,approvalTransaction:void 0,convertTransaction:void 0,transactionError:void 0,transactionLoading:!1,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",inputError:void 0,slippage:dt.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:BigInt(0),gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0}),he={state:X,subscribe(i){return Xt(X,()=>i(X))},subscribeKey(i,e){return ri(X,i,e)},getParams(){var t,r,o,n,s;const{address:i}=te.state,e=`${(t=de.state.caipNetwork)==null?void 0:t.id}:${dt.NATIVE_TOKEN_ADDRESS}`;if(!i)throw new Error("No address found to swap the tokens from.");return{networkAddress:e,fromAddress:i,fromCaipAddress:te.state.caipAddress,sourceTokenAddress:(r=X.sourceToken)==null?void 0:r.address,toTokenAddress:(o=X.toToken)==null?void 0:o.address,toTokenAmount:X.toTokenAmount,toTokenDecimals:(n=X.toToken)==null?void 0:n.decimals,sourceTokenAmount:X.sourceTokenAmount,sourceTokenDecimals:(s=X.sourceToken)==null?void 0:s.decimals}},setLoading(i){X.loading=i},setSourceToken(i){i&&(X.sourceToken=i,this.setTokenValues(i.address,"sourceToken"))},setSourceTokenAmount(i){const{sourceTokenAddress:e}=this.getParams();X.sourceTokenAmount=i,e&&this.setTokenValues(e,"sourceToken")},setToToken(i){const{sourceTokenAddress:e,sourceTokenAmount:t}=this.getParams();if(!i){X.toTokenAmount="0",X.toTokenPriceInUSD=0;return}X.toToken=i,this.setTokenValues(i.address,"toToken"),e&&t&&this.makeChecks()},setToTokenAmount(i){const{toTokenAddress:e}=this.getParams();X.toTokenAmount=i,e&&this.setTokenValues(e,"toToken")},async setTokenValues(i,e){let t=X.tokensPriceMap[i]||0;t||(t=await this.getAddressPrice(i)),e==="sourceToken"?X.sourceTokenPriceInUSD=t:e==="toToken"&&(X.toTokenPriceInUSD=t)},switchTokens(){const i=X.toToken?{...X.toToken}:void 0,e=X.sourceToken?{...X.sourceToken}:void 0;this.setSourceToken(i),this.setToToken(e),this.setSourceTokenAmount(X.toTokenAmount||"0"),he.convertTokens()},resetTokens(){X.tokens=void 0,X.popularTokens=void 0,X.myTokensWithBalance=void 0,X.initialized=!1},resetValues(){var t;const{networkAddress:i}=this.getParams(),e=(t=X.tokens)==null?void 0:t.find(r=>r.address===i);this.setSourceToken(e),X.sourceTokenPriceInUSD=X.tokensPriceMap[i]||0,X.sourceTokenAmount="0",this.setToToken(void 0),X.gasPriceInUSD=0},clearError(){X.transactionError=void 0},async initializeState(){X.initialized||(await this.fetchTokens(),X.initialized=!0)},async fetchTokens(){var t;const{networkAddress:i}=this.getParams();await this.getTokenList(),await this.getNetworkTokenPrice(),await this.getMyTokensWithBalance();const e=(t=X.tokens)==null?void 0:t.find(r=>r.address===i);e&&this.setSourceToken(e)},async getTokenList(){const i=await Ko.getTokenList();X.tokens=i,X.popularTokens=i.sort((e,t)=>e.symbolt.symbol?1:0).filter(e=>!!dt.POPULAR_TOKENS.includes(e.symbol),{}),X.suggestedTokens=i.filter(e=>!!dt.SUGGESTED_TOKENS.includes(e.symbol),{})},async getAddressPrice(i){var c,l;const e=X.tokensPriceMap[i];if(e)return e;const r=(await Lt.fetchTokenPrice({projectId:pe.state.projectId,addresses:[i]})).fungibles||[],o=[...X.tokens||[],...X.myTokensWithBalance||[]],n=(c=o==null?void 0:o.find(h=>h.address===i))==null?void 0:c.symbol,s=((l=r.find(h=>h.symbol===n))==null?void 0:l.price)||"0",a=parseFloat(s);return X.tokensPriceMap[i]=a,a},async getNetworkTokenPrice(){var o;const{networkAddress:i}=this.getParams(),t=(o=(await Lt.fetchTokenPrice({projectId:pe.state.projectId,addresses:[i]})).fungibles)==null?void 0:o[0],r=(t==null?void 0:t.price)||"0";X.tokensPriceMap[i]=parseFloat(r),X.networkPrice=r},async getMyTokensWithBalance(){const i=await Ko.getMyTokensWithBalance();i&&(await this.getInitialGasPrice(),this.setBalances(i))},setBalances(i){const{networkAddress:e}=this.getParams(),t=i.find(r=>r.address===e);i.forEach(r=>{X.tokensPriceMap[r.address]=r.price||0}),X.myTokensWithBalance=i,X.networkBalanceInUSD=t?At.multiply(t.quantity.numeric,t.price).toString():"0"},async getInitialGasPrice(){const i=await Ko.fetchGasPrice();if(!i)return;const e=i.instant,t=BigInt(e),r=BigInt(vf),o=this.calculateGasPriceInUSD(r,t);X.gasPriceInUSD=o},async refreshConvertValues(){const{fromAddress:i,toTokenDecimals:e,toTokenAddress:t}=this.getParams();if(i&&t&&e&&!X.loading){const r=await this.getTransaction();this.setTransactionDetails(r)}},calculateGasPriceInEther(i,e){const t=e*i;return Number(t)/1e18},calculateGasPriceInUSD(i,e){const t=this.calculateGasPriceInEther(i,e);return At.bigNumber(X.networkPrice).multipliedBy(t).toNumber()},calculatePriceImpact(i,e){const t=X.sourceTokenAmount,r=X.sourceTokenPriceInUSD,o=X.toTokenPriceInUSD;return At.bigNumber(t).multipliedBy(r).plus(e).dividedBy(i).minus(o).dividedBy(o).multipliedBy(100).toNumber()},calculateMaxSlippage(){const i=At.bigNumber(X.slippage).dividedBy(100);return At.multiply(X.sourceTokenAmount,i).toNumber()},async convertTokens(){const{sourceTokenAddress:i,toTokenAddress:e}=this.getParams();!i||!e||await this.makeChecks()},async makeChecks(){const{toTokenDecimals:i,toTokenAddress:e}=this.getParams();if(!i||!e)return;X.loading=!0;const t=await this.getTransaction();this.setTransactionDetails(t),X.loading=!1},async getTransaction(){const{fromCaipAddress:i,sourceTokenAddress:e,sourceTokenAmount:t,sourceTokenDecimals:r}=this.getParams();if(!i||!e||!t||parseFloat(t)===0||!r)return;const o=await Ko.fetchConvertAllowance({userAddress:i,tokenAddress:e,sourceTokenAmount:t,sourceTokenDecimals:r});let n;return o?(X.approvalTransaction=void 0,n=await this.createConvert(),X.convertTransaction=n):(X.convertTransaction=void 0,n=await this.createTokenAllowance(),X.approvalTransaction=n),n},getToAmount(){const{sourceTokenDecimals:i}=this.getParams(),t=10**(i||18);return(X.sourceTokenPriceInUSD&&X.toTokenPriceInUSD&&X.sourceTokenAmount?At.bigNumber(X.sourceTokenAmount).multipliedBy(X.sourceTokenPriceInUSD).dividedBy(X.toTokenPriceInUSD):At.bigNumber(0)).multipliedBy(t).toString()},async createTokenAllowance(){const{fromCaipAddress:i,fromAddress:e,sourceTokenAddress:t,toTokenAddress:r}=this.getParams();if(!i||!r)return;if(!t)throw new Error(">>> createTokenAllowance - No source token address found.");const o=await Lt.generateApproveCalldata({projectId:pe.state.projectId,from:t,to:r,userAddress:i}),n=await ke.estimateGas({address:e,to:re.getPlainAddress(o.tx.to),data:o.tx.data}),s=this.getToAmount();return{data:o.tx.data,to:re.getPlainAddress(o.tx.from),gas:n,gasPrice:BigInt(o.tx.eip155.gasPrice),value:BigInt(o.tx.value),toAmount:s}},async sendTransactionForApproval(i){const{fromAddress:e}=this.getParams();X.transactionLoading=!0,G.pushTransactionStack({view:null,goBack:!0});try{await ke.sendTransaction({address:e,to:i.to,data:i.data,value:BigInt(i.value),gasPrice:BigInt(i.gasPrice)}),X.approvalTransaction=void 0,X.transactionLoading=!1,this.makeChecks()}catch(t){const r=t;X.transactionError=r==null?void 0:r.shortMessage,X.transactionLoading=!1}},async createConvert(){const{networkAddress:i,fromCaipAddress:e,sourceTokenAddress:t,sourceTokenDecimals:r,sourceTokenAmount:o,toTokenAddress:n}=this.getParams();if(!(!e||!o||!t||!n||!r))try{const s=ke.parseUnits(o,r).toString(),a=await Lt.generateConvertCalldata({projectId:pe.state.projectId,userAddress:e,from:t,to:n,amount:s}),c=t===i,l=this.getToAmount(),h=BigInt(a.tx.eip155.gas),p=BigInt(a.tx.eip155.gasPrice),v={data:a.tx.data,to:re.getPlainAddress(a.tx.to),gas:h,gasPrice:p,value:BigInt(c?s:"0"),toAmount:l};return X.gasPriceInUSD=this.calculateGasPriceInUSD(h,p),v}catch{return}},async sendTransactionForConvert(i){if(!i)return;const{fromAddress:e}=this.getParams();X.transactionLoading=!0,G.pushTransactionStack({view:"Account",goBack:!1,onSuccess(){he.resetValues()}});try{const t=await ke.sendTransaction({address:e,to:i.to,data:i.data,gas:i.gas,gasPrice:BigInt(i.gasPrice),value:i.value});return X.transactionLoading=!1,setTimeout(()=>{this.resetValues(),this.getMyTokensWithBalance()},1e3),t}catch(t){const r=t;X.transactionError=r==null?void 0:r.shortMessage,X.transactionLoading=!1,Le.showError((r==null?void 0:r.shortMessage)||"Transaction error");return}},getToTokenValues(i,e){const{toTokenAddress:t}=this.getParams();if(!t)return{toTokenAmount:"0",toTokenPriceInUSD:0};const r=At.bigNumber(i).dividedBy(10**e).toFixed(20),o=X.tokensPriceMap[t]||"0",n=At.bigNumber(o).toNumber();return{toTokenAmount:r,toTokenPriceInUSD:n}},isInsufficientNetworkTokenForGas(){return At.bigNumber(At.bigNumber(X.gasPriceInUSD||"0")).isGreaterThan(X.networkBalanceInUSD)},setTransactionDetails(i){const{toTokenAddress:e,toTokenDecimals:t}=this.getParams();if(!i||!e||!t)return;this.isInsufficientNetworkTokenForGas()?X.inputError="Insufficient balance":X.inputError=void 0;const{toTokenAmount:o,toTokenPriceInUSD:n}=this.getToTokenValues(i.toAmount,t);X.toTokenAmount=o,X.toTokenPriceInUSD=n,X.gasPriceInUSD=this.calculateGasPriceInUSD(i.gas,i.gasPrice),X.priceImpact=this.calculatePriceImpact(X.toTokenAmount,X.gasPriceInUSD),X.maxSlippage=this.calculateMaxSlippage()}},Be=kt({isConnected:!1,currentTab:0,tokenBalance:[],smartAccountDeployed:!1}),te={state:Be,subscribe(i){return Xt(Be,()=>i(Be))},subscribeKey(i,e){return ri(Be,i,e)},setIsConnected(i){Be.isConnected=i},setCaipAddress(i){Be.caipAddress=i,Be.address=i?re.getPlainAddress(i):void 0},setBalance(i,e){Be.balance=i,Be.balanceSymbol=e},setProfileName(i){Be.profileName=i},setProfileImage(i){Be.profileImage=i},setAddressExplorerUrl(i){Be.addressExplorerUrl=i},setSmartAccountDeployed(i){Be.smartAccountDeployed=i},setCurrentTab(i){Be.currentTab=i},setTokenBalance(i){i&&(Be.tokenBalance=uo(i))},setConnectedWalletInfo(i){Be.connectedWalletInfo=i},setPreferredAccountType(i){Be.preferredAccountType=i},async fetchTokenBalance(){try{if(Be.address){const i=await Lt.getBalance(Be.address);this.setTokenBalance(i.balances),he.setBalances(Ko.mapBalancesToConvertTokens(i.balances))}}catch{Le.showError("Failed to fetch token balance")}},resetAccount(){Be.isConnected=!1,Be.smartAccountDeployed=!1,Be.currentTab=0,Be.caipAddress=void 0,Be.address=void 0,Be.balance=void 0,Be.balanceSymbol=void 0,Be.profileName=void 0,Be.profileImage=void 0,Be.addressExplorerUrl=void 0,Be.tokenBalance=[],Be.connectedWalletInfo=void 0,Be.preferredAccountType=void 0}},yi=kt({walletImages:{},networkImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),bt={state:yi,subscribeNetworkImages(i){return Xt(yi.networkImages,()=>i(yi.networkImages))},subscribeKey(i,e){return ri(yi,i,e)},subscribe(i){return Xt(yi,()=>i(yi))},setWalletImage(i,e){yi.walletImages[i]=e},setNetworkImage(i,e){yi.networkImages[i]=e},setConnectorImage(i,e){yi.connectorImages[i]=e},setTokenImage(i,e){yi.tokenImages[i]=e},setCurrencyImage(i,e){yi.currencyImages[i]=e}},or=kt({themeMode:"dark",themeVariables:{}}),ft={state:or,subscribe(i){return Xt(or,()=>i(or))},setThemeMode(i){or.themeMode=i;try{const e=We.getEmailConnector();e&&e.provider.syncTheme({themeMode:ft.getSnapshot().themeMode})}catch{console.info("Unable to sync theme to email connector")}},setThemeVariables(i){or.themeVariables={...or.themeVariables,...i};try{const e=We.getEmailConnector();e&&e.provider.syncTheme({themeVariables:ft.getSnapshot().themeVariables})}catch{console.info("Unable to sync theme to email connector")}},getSnapshot(){return I0(or)}},_n=kt({connectors:[]}),We={state:_n,subscribeKey(i,e){return ri(_n,i,e)},setConnectors(i){_n.connectors=i.map(e=>uo(e))},addConnector(i){var e,t;if(_n.connectors.push(uo(i)),i.id==="w3mEmail"){const r=i,o=I0(pe.state);(t=(e=r==null?void 0:r.provider)==null?void 0:e.syncDappData)==null||t.call(e,{metadata:o.metadata,sdkVersion:o.sdkVersion,projectId:o.projectId}),r.provider.syncTheme({themeMode:ft.getSnapshot().themeMode,themeVariables:ft.getSnapshot().themeVariables})}},getEmailConnector(){return _n.connectors.find(i=>i.type==="EMAIL")},getAnnouncedConnectorRdns(){return _n.connectors.filter(i=>i.type==="ANNOUNCED").map(i=>{var e;return(e=i.info)==null?void 0:e.rdns})},getConnectors(){return _n.connectors},getConnector(i,e){return _n.connectors.find(t=>{var r;return t.explorerId===i||((r=t.info)==null?void 0:r.rdns)===e})}},bf=re.getApiUrl(),Dt=new Ql({baseUrl:bf}),yf="40",rd="4",Et=kt({page:1,count:0,featured:[],recommended:[],wallets:[],search:[],isAnalyticsEnabled:!1}),xe={state:Et,subscribeKey(i,e){return ri(Et,i,e)},_getApiHeaders(){const{projectId:i,sdkType:e,sdkVersion:t}=pe.state;return{"x-project-id":i,"x-sdk-type":e,"x-sdk-version":t}},async _fetchWalletImage(i){const e=`${Dt.baseUrl}/getWalletImage/${i}`,t=await Dt.getBlob({path:e,headers:xe._getApiHeaders()});bt.setWalletImage(i,URL.createObjectURL(t))},async _fetchNetworkImage(i){const e=`${Dt.baseUrl}/public/getAssetImage/${i}`,t=await Dt.getBlob({path:e,headers:xe._getApiHeaders()});bt.setNetworkImage(i,URL.createObjectURL(t))},async _fetchConnectorImage(i){const e=`${Dt.baseUrl}/public/getAssetImage/${i}`,t=await Dt.getBlob({path:e,headers:xe._getApiHeaders()});bt.setConnectorImage(i,URL.createObjectURL(t))},async _fetchCurrencyImage(i){const e=`${Dt.baseUrl}/public/getCurrencyImage/${i}`,t=await Dt.getBlob({path:e,headers:xe._getApiHeaders()});bt.setCurrencyImage(i,URL.createObjectURL(t))},async _fetchTokenImage(i){const e=`${Dt.baseUrl}/public/getTokenImage/${i}`,t=await Dt.getBlob({path:e,headers:xe._getApiHeaders()});bt.setTokenImage(i,URL.createObjectURL(t))},async fetchNetworkImages(){const{requestedCaipNetworks:i}=de.state,e=i==null?void 0:i.map(({imageId:t})=>t).filter(Boolean);e&&await Promise.allSettled(e.map(t=>xe._fetchNetworkImage(t)))},async fetchConnectorImages(){const{connectors:i}=We.state,e=i.map(({imageId:t})=>t).filter(Boolean);await Promise.allSettled(e.map(t=>xe._fetchConnectorImage(t)))},async fetchCurrencyImages(i=[]){await Promise.allSettled(i.map(e=>xe._fetchCurrencyImage(e)))},async fetchTokenImages(i=[]){await Promise.allSettled(i.map(e=>xe._fetchTokenImage(e)))},async fetchFeaturedWallets(){const{featuredWalletIds:i}=pe.state;if(i!=null&&i.length){const{data:e}=await Dt.get({path:"/getWallets",headers:xe._getApiHeaders(),params:{page:"1",entries:i!=null&&i.length?String(i.length):rd,include:i==null?void 0:i.join(",")}});e.sort((r,o)=>i.indexOf(r.id)-i.indexOf(o.id));const t=e.map(r=>r.image_id).filter(Boolean);await Promise.allSettled(t.map(r=>xe._fetchWalletImage(r))),Et.featured=e}},async fetchRecommendedWallets(){var l;const{includeWalletIds:i,excludeWalletIds:e,featuredWalletIds:t}=pe.state,r=[...e??[],...t??[]].filter(Boolean),{data:o,count:n}=await Dt.get({path:"/getWallets",headers:xe._getApiHeaders(),params:{page:"1",chains:(l=de.state.caipNetwork)==null?void 0:l.id,entries:rd,include:i==null?void 0:i.join(","),exclude:r==null?void 0:r.join(",")}}),s=ht.getRecentWallets(),a=o.map(h=>h.image_id).filter(Boolean),c=s.map(h=>h.image_id).filter(Boolean);await Promise.allSettled([...a,...c].map(h=>xe._fetchWalletImage(h))),Et.recommended=o,Et.count=n??0},async fetchWallets({page:i}){var c;const{includeWalletIds:e,excludeWalletIds:t,featuredWalletIds:r}=pe.state,o=[...Et.recommended.map(({id:l})=>l),...t??[],...r??[]].filter(Boolean),{data:n,count:s}=await Dt.get({path:"/getWallets",headers:xe._getApiHeaders(),params:{page:String(i),entries:yf,chains:(c=de.state.caipNetwork)==null?void 0:c.id,include:e==null?void 0:e.join(","),exclude:o.join(",")}}),a=n.map(l=>l.image_id).filter(Boolean);await Promise.allSettled([...a.map(l=>xe._fetchWalletImage(l)),re.wait(300)]),Et.wallets=[...Et.wallets,...n],Et.count=s>Et.count?s:Et.count,Et.page=i},async searchWallet({search:i}){var n;const{includeWalletIds:e,excludeWalletIds:t}=pe.state;Et.search=[];const{data:r}=await Dt.get({path:"/getWallets",headers:xe._getApiHeaders(),params:{page:"1",entries:"100",search:i,chains:(n=de.state.caipNetwork)==null?void 0:n.id,include:e==null?void 0:e.join(","),exclude:t==null?void 0:t.join(",")}}),o=r.map(s=>s.image_id).filter(Boolean);await Promise.allSettled([...o.map(s=>xe._fetchWalletImage(s)),re.wait(300)]),Et.search=r},async reFetchWallets(){Et.page=1,Et.wallets=[],await xe.fetchFeaturedWallets(),await xe.fetchRecommendedWallets()},prefetch(){const i=[xe.fetchFeaturedWallets(),xe.fetchRecommendedWallets(),xe.fetchNetworkImages(),xe.fetchConnectorImages()];pe.state.enableAnalytics===void 0&&i.push(xe.fetchAnalyticsConfig()),Et.prefetchPromise=Promise.race([Promise.allSettled(i),re.wait(3e3)])},async fetchAnalyticsConfig(){const{isAnalyticsEnabled:i}=await Dt.get({path:"/getAnalyticsConfig",headers:xe._getApiHeaders()});pe.setEnableAnalytics(i)}},sr=kt({loading:!1,open:!1}),Re={state:sr,subscribe(i){return Xt(sr,()=>i(sr))},subscribeKey(i,e){return ri(sr,i,e)},async open(i){await xe.state.prefetchPromise;const e=te.state.isConnected;i!=null&&i.view?G.reset(i.view):e?G.reset("Account"):G.reset("Connect"),sr.open=!0,fr.set({open:!0}),we.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:e}})},close(){const i=te.state.isConnected;sr.open=!1,fr.set({open:!1}),we.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:i}})},setLoading(i){sr.loading=i,fr.set({loading:i})}},Qo={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},vl={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},xf={providers:O0,selectedProvider:null,error:null,purchaseCurrency:Qo,paymentCurrency:vl,purchaseCurrencies:[Qo],paymentCurrencies:[],quotesLoading:!1},ze=kt(xf),Fe={state:ze,subscribe(i){return Xt(ze,()=>i(ze))},subscribeKey(i,e){return ri(ze,i,e)},setSelectedProvider(i){ze.selectedProvider=i},setPurchaseCurrency(i){ze.purchaseCurrency=i},setPaymentCurrency(i){ze.paymentCurrency=i},setPurchaseAmount(i){this.state.purchaseAmount=i},setPaymentAmount(i){this.state.paymentAmount=i},async getAvailableCurrencies(){const i=await Lt.getOnrampOptions();ze.purchaseCurrencies=i.purchaseCurrencies,ze.paymentCurrencies=i.paymentCurrencies,ze.paymentCurrency=i.paymentCurrencies[0]||vl,ze.purchaseCurrency=i.purchaseCurrencies[0]||Qo,await xe.fetchCurrencyImages(i.paymentCurrencies.map(e=>e.id)),await xe.fetchTokenImages(i.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var i,e;ze.quotesLoading=!0;try{const t=await Lt.getOnrampQuote({purchaseCurrency:ze.purchaseCurrency,paymentCurrency:ze.paymentCurrency,amount:((i=ze.paymentAmount)==null?void 0:i.toString())||"0",network:(e=ze.purchaseCurrency)==null?void 0:e.symbol});return ze.quotesLoading=!1,ze.purchaseAmount=Number(t.purchaseAmount.amount),t}catch(t){return ze.error=t.message,ze.quotesLoading=!1,null}finally{ze.quotesLoading=!1}},resetState(){ze.providers=O0,ze.selectedProvider=null,ze.error=null,ze.purchaseCurrency=Qo,ze.paymentCurrency=vl,ze.purchaseCurrencies=[Qo],ze.paymentCurrencies=[],ze.paymentAmount=void 0,ze.purchaseAmount=void 0,ze.quotesLoading=!1}},zt=kt({}),Mt={state:zt,subscribe(i){return Xt(zt,()=>i(zt))},subscribeKey(i,e){return ri(zt,i,e)},setToken(i){i&&(zt.token=uo(i))},setTokenAmount(i){zt.sendTokenAmount=i},setReceiverAddress(i){zt.receiverAddress=i},setReceiverProfileImageUrl(i){zt.receiverProfileImageUrl=i},setReceiverProfileName(i){zt.receiverProfileName=i},resetSend(){zt.token=void 0,zt.sendTokenAmount=void 0,zt.receiverAddress=void 0,zt.receiverProfileImageUrl=void 0,zt.receiverProfileName=void 0}},He={getWalletImage(i){if(i!=null&&i.image_url)return i==null?void 0:i.image_url;if(i!=null&&i.image_id)return bt.state.walletImages[i.image_id]},getNetworkImage(i){if(i!=null&&i.imageUrl)return i==null?void 0:i.imageUrl;if(i!=null&&i.imageId)return bt.state.networkImages[i.imageId]},getConnectorImage(i){if(i!=null&&i.imageUrl)return i.imageUrl;if(i!=null&&i.imageId)return bt.state.connectorImages[i.imageId]}},tu={goBackOrCloseModal(){G.state.history.length>1?G.goBack():Re.close()},navigateAfterNetworkSwitch(){const{history:i}=G.state,e=i.findIndex(t=>t==="Networks");e>=1?G.goBackToIndex(e-1):Re.close()}};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ma=globalThis,iu=ma.ShadowRoot&&(ma.ShadyCSS===void 0||ma.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,nu=Symbol(),od=new WeakMap;let L0=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==nu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(iu&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=od.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&od.set(t,e))}return e}toString(){return this.cssText}};const Ui=i=>new L0(typeof i=="string"?i:i+"",void 0,nu),ne=(i,...e)=>{const t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new L0(t,i,nu)},Cf=(i,e)=>{if(iu)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),o=ma.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},sd=iu?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return Ui(t)})(i):i;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:_f,defineProperty:Ef,getOwnPropertyDescriptor:Tf,getOwnPropertyNames:Af,getOwnPropertySymbols:Sf,getPrototypeOf:kf}=Object,Pn=globalThis,ad=Pn.trustedTypes,$f=ad?ad.emptyScript:"",Yc=Pn.reactiveElementPolyfillSupport,es=(i,e)=>i,Ca={toAttribute(i,e){switch(e){case Boolean:i=i?$f:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ru=(i,e)=>!_f(i,e),cd={attribute:!0,type:String,converter:Ca,reflect:!1,hasChanged:ru};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Pn.litPropertyMetadata??(Pn.litPropertyMetadata=new WeakMap);let to=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=cd){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&Ef(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){const{get:o,set:n}=Tf(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get(){return o==null?void 0:o.call(this)},set(s){const a=o==null?void 0:o.call(this);n.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??cd}static _$Ei(){if(this.hasOwnProperty(es("elementProperties")))return;const e=kf(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(es("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(es("properties"))){const t=this.properties,r=[...Af(t),...Sf(t)];for(const o of r)this.createProperty(o,t[o])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const o of r)t.unshift(sd(o))}else e!==void 0&&t.push(sd(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Cf(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){var n;const r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){const s=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Ca).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(e,t){var n;const r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const s=r.getPropertyOptions(o),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((n=s.converter)==null?void 0:n.fromAttribute)!==void 0?s.converter:Ca;this._$Em=o,this[o]=a.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??ru)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[n,s]of o)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],s)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}};to.elementStyles=[],to.shadowRootOptions={mode:"open"},to[es("elementProperties")]=new Map,to[es("finalized")]=new Map,Yc==null||Yc({ReactiveElement:to}),(Pn.reactiveElementVersions??(Pn.reactiveElementVersions=[])).push("2.0.4");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ts=globalThis,_a=ts.trustedTypes,ld=_a?_a.createPolicy("lit-html",{createHTML:i=>i}):void 0,B0="$lit$",Tn=`lit$${Math.random().toFixed(9).slice(2)}$`,U0="?"+Tn,Rf=`<${U0}>`,wr=document,ls=()=>wr.createComment(""),us=i=>i===null||typeof i!="object"&&typeof i!="function",j0=Array.isArray,If=i=>j0(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Kc=`[ +\f\r]`,Go=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ud=/-->/g,dd=/>/g,ar=RegExp(`>|${Kc}(?:([^\\s"'>=/]+)(${Kc}*=${Kc}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),hd=/'/g,pd=/"/g,W0=/^(?:script|style|textarea|title)$/i,z0=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),z=z0(1),J=z0(2),mr=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),fd=new WeakMap,hr=wr.createTreeWalker(wr,129);function F0(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ld!==void 0?ld.createHTML(e):e}const Of=(i,e)=>{const t=i.length-1,r=[];let o,n=e===2?"":"",s=Go;for(let a=0;a"?(s=o??Go,p=-1):h[1]===void 0?p=-2:(p=s.lastIndex-h[2].length,l=h[1],s=h[3]===void 0?ar:h[3]==='"'?pd:hd):s===pd||s===hd?s=ar:s===ud||s===dd?s=Go:(s=ar,o=void 0);const S=s===ar&&i[a+1].startsWith("/>")?" ":"";n+=s===Go?c+Rf:p>=0?(r.push(l),c.slice(0,p)+B0+c.slice(p)+Tn+S):c+Tn+(p===-2?a:S)}return[F0(i,n+(i[t]||"")+(e===2?"":"")),r]};let bl=class H0{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,s=0;const a=e.length-1,c=this.parts,[l,h]=Of(e,t);if(this.el=H0.createElement(l,r),hr.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=hr.nextNode())!==null&&c.length0){o.textContent=_a?_a.emptyScript:"";for(let S=0;S2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=lt}_$AI(e,t=this,r,o){const n=this.strings;let s=!1;if(n===void 0)e=ho(this,e,t,0),s=!us(e)||e!==this._$AH&&e!==mr,s&&(this._$AH=e);else{const a=e;let c,l;for(e=n[0],c=0;c{const r=(t==null?void 0:t.renderBefore)??e;let o=r._$litPart$;if(o===void 0){const n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new ou(e.insertBefore(ls(),n),n,void 0,t??{})}return o._$AI(i),o};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let oe=class extends to{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Bf(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return mr}};var s0;oe._$litElement$=!0,oe.finalized=!0,(s0=globalThis.litElementHydrateSupport)==null||s0.call(globalThis,{LitElement:oe});const Xc=globalThis.litElementPolyfillSupport;Xc==null||Xc({LitElement:oe});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");const Z0=J` + + + + + +`,G0=J` + + + + + +`;let is,Nn,Dn;function q0(i,e){is=document.createElement("style"),Nn=document.createElement("style"),Dn=document.createElement("style"),is.textContent=oo(i).core.cssText,Nn.textContent=oo(i).dark.cssText,Dn.textContent=oo(i).light.cssText,document.head.appendChild(is),document.head.appendChild(Nn),document.head.appendChild(Dn),su(e)}function su(i){Nn&&Dn&&(i==="light"?(Nn.removeAttribute("media"),Dn.media="enabled"):(Dn.removeAttribute("media"),Nn.media="enabled"))}function Y0(i){is&&Nn&&Dn&&(is.textContent=oo(i).core.cssText,Nn.textContent=oo(i).dark.cssText,Dn.textContent=oo(i).light.cssText)}function oo(i){return{core:ne` + @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); + :root { + --w3m-color-mix-strength: ${Ui(i!=null&&i["--w3m-color-mix-strength"]?`${i["--w3m-color-mix-strength"]}%`:"0%")}; + --w3m-font-family: ${Ui((i==null?void 0:i["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; + --w3m-font-size-master: ${Ui((i==null?void 0:i["--w3m-font-size-master"])||"10px")}; + --w3m-border-radius-master: ${Ui((i==null?void 0:i["--w3m-border-radius-master"])||"4px")}; + --w3m-z-index: ${Ui((i==null?void 0:i["--w3m-z-index"])||999)}; + + --wui-font-family: var(--w3m-font-family); + + --wui-font-size-mini: calc(var(--w3m-font-size-master) * 0.8); + --wui-font-size-micro: var(--w3m-font-size-master); + --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2); + --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4); + --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6); + --wui-font-size-medium: calc(var(--w3m-font-size-master) * 1.8); + --wui-font-size-large: calc(var(--w3m-font-size-master) * 2); + --wui-font-size-medium-title: calc(var(--w3m-font-size-master) * 2.4); + --wui-font-size-2xl: calc(var(--w3m-font-size-master) * 4); + + --wui-border-radius-5xs: var(--w3m-border-radius-master); + --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5); + --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2); + --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3); + --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4); + --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5); + --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7); + --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9); + --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20); + + --wui-font-weight-light: 400; + --wui-font-weight-regular: 500; + --wui-font-weight-medium: 600; + --wui-font-weight-bold: 700; + + --wui-letter-spacing-2xl: -1.6px; + --wui-letter-spacing-medium-title: -0.96px; + --wui-letter-spacing-large: -0.8px; + --wui-letter-spacing-medium: -0.72px; + --wui-letter-spacing-paragraph: -0.64px; + --wui-letter-spacing-small: -0.56px; + --wui-letter-spacing-tiny: -0.48px; + --wui-letter-spacing-micro: -0.2px; + --wui-letter-spacing-mini: -0.16px; + + --wui-spacing-0: 0px; + --wui-spacing-4xs: 2px; + --wui-spacing-3xs: 4px; + --wui-spacing-xxs: 6px; + --wui-spacing-2xs: 7px; + --wui-spacing-xs: 8px; + --wui-spacing-1xs: 10px; + --wui-spacing-s: 12px; + --wui-spacing-m: 14px; + --wui-spacing-l: 16px; + --wui-spacing-2l: 18px; + --wui-spacing-xl: 20px; + --wui-spacing-xxl: 24px; + --wui-spacing-2xl: 32px; + --wui-spacing-3xl: 40px; + --wui-spacing-4xl: 90px; + + --wui-icon-box-size-xxs: 14px; + --wui-icon-box-size-xs: 20px; + --wui-icon-box-size-sm: 24px; + --wui-icon-box-size-md: 32px; + --wui-icon-box-size-lg: 40px; + --wui-icon-box-size-xl: 64px; + + --wui-icon-size-inherit: inherit; + --wui-icon-size-xxs: 10px; + --wui-icon-size-xs: 12px; + --wui-icon-size-sm: 14px; + --wui-icon-size-md: 16px; + --wui-icon-size-mdl: 18px; + --wui-icon-size-lg: 20px; + --wui-icon-size-xl: 24px; + + --wui-wallet-image-size-inherit: inherit; + --wui-wallet-image-size-sm: 40px; + --wui-wallet-image-size-md: 56px; + --wui-wallet-image-size-lg: 80px; + + --wui-visual-size-size-inherit: inherit; + --wui-visual-size-sm: 40px; + --wui-visual-size-md: 55px; + --wui-visual-size-lg: 80px; + + --wui-box-size-md: 100px; + --wui-box-size-lg: 120px; + + --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1); + --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1); + + --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1); + --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1); + --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1); + + --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1); + + --wui-duration-lg: 200ms; + --wui-duration-md: 125ms; + --wui-duration-sm: 75ms; + + --wui-path-network-sm: path( + 'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z' + ); + + --wui-path-network-md: path( + 'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z' + ); + + --wui-path-network-lg: path( + 'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z' + ); + + --wui-width-network-sm: 36px; + --wui-width-network-md: 48px; + --wui-width-network-lg: 86px; + + --wui-height-network-sm: 40px; + --wui-height-network-md: 54px; + --wui-height-network-lg: 96px; + + --wui-icon-size-network-xs: 12px; + --wui-icon-size-network-sm: 16px; + --wui-icon-size-network-md: 24px; + --wui-icon-size-network-lg: 42px; + + --wui-color-inherit: inherit; + + --wui-color-inverse-100: #fff; + --wui-color-inverse-000: #000; + + --wui-cover: rgba(20, 20, 20, 0.8); + + --wui-color-modal-bg: var(--wui-color-modal-bg-base); + + --wui-color-blue-100: var(--wui-color-blue-base-100); + + --wui-color-accent-100: var(--wui-color-accent-base-100); + --wui-color-accent-090: var(--wui-color-accent-base-090); + --wui-color-accent-080: var(--wui-color-accent-base-080); + + --wui-accent-glass-090: var(--wui-accent-glass-base-090); + --wui-accent-glass-080: var(--wui-accent-glass-base-080); + --wui-accent-glass-020: var(--wui-accent-glass-base-020); + --wui-accent-glass-015: var(--wui-accent-glass-base-015); + --wui-accent-glass-010: var(--wui-accent-glass-base-010); + --wui-accent-glass-005: var(--wui-accent-glass-base-005); + --wui-accent-glass-002: var(--wui-accent-glass-base-002); + + --wui-color-fg-100: var(--wui-color-fg-base-100); + --wui-color-fg-125: var(--wui-color-fg-base-125); + --wui-color-fg-150: var(--wui-color-fg-base-150); + --wui-color-fg-175: var(--wui-color-fg-base-175); + --wui-color-fg-200: var(--wui-color-fg-base-200); + --wui-color-fg-225: var(--wui-color-fg-base-225); + --wui-color-fg-250: var(--wui-color-fg-base-250); + --wui-color-fg-275: var(--wui-color-fg-base-275); + --wui-color-fg-300: var(--wui-color-fg-base-300); + + --wui-color-bg-100: var(--wui-color-bg-base-100); + --wui-color-bg-125: var(--wui-color-bg-base-125); + --wui-color-bg-150: var(--wui-color-bg-base-150); + --wui-color-bg-175: var(--wui-color-bg-base-175); + --wui-color-bg-200: var(--wui-color-bg-base-200); + --wui-color-bg-225: var(--wui-color-bg-base-225); + --wui-color-bg-250: var(--wui-color-bg-base-250); + --wui-color-bg-275: var(--wui-color-bg-base-275); + --wui-color-bg-300: var(--wui-color-bg-base-300); + + --wui-color-success-100: var(--wui-color-success-base-100); + --wui-color-error-100: var(--wui-color-error-base-100); + + --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100); + --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100); + --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100); + --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100); + + --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-base-100); + + --wui-avatar-border: var(--wui-avatar-border-base); + + --wui-thumbnail-border: var(--wui-thumbnail-border-base); + + --wui-box-shadow-blue: rgba(71, 161, 255, 0.16); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :root { + --wui-color-modal-bg: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-modal-bg-base) + ); + + --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 16%, transparent); + + --wui-color-accent-090: color-mix( + in srgb, + var(--wui-color-accent-base-100) 90%, + var(--w3m-default) + ); + --wui-color-accent-080: color-mix( + in srgb, + var(--wui-color-accent-base-100) 80%, + var(--w3m-default) + ); + + --wui-color-accent-090: color-mix( + in srgb, + var(--wui-color-accent-base-100) 90%, + transparent + ); + --wui-color-accent-080: color-mix( + in srgb, + var(--wui-color-accent-base-100) 80%, + transparent + ); + + --wui-accent-glass-090: color-mix( + in srgb, + var(--wui-color-accent-base-100) 90%, + transparent + ); + --wui-accent-glass-080: color-mix( + in srgb, + var(--wui-color-accent-base-100) 80%, + transparent + ); + --wui-accent-glass-020: color-mix( + in srgb, + var(--wui-color-accent-base-100) 20%, + transparent + ); + --wui-accent-glass-015: color-mix( + in srgb, + var(--wui-color-accent-base-100) 15%, + transparent + ); + --wui-accent-glass-010: color-mix( + in srgb, + var(--wui-color-accent-base-100) 10%, + transparent + ); + --wui-accent-glass-005: color-mix( + in srgb, + var(--wui-color-accent-base-100) 5%, + transparent + ); + --wui-color-accent-002: color-mix( + in srgb, + var(--wui-color-accent-base-100) 2%, + transparent + ); + + --wui-color-fg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-100) + ); + --wui-color-fg-125: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-125) + ); + --wui-color-fg-150: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-150) + ); + --wui-color-fg-175: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-175) + ); + --wui-color-fg-200: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-200) + ); + --wui-color-fg-225: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-225) + ); + --wui-color-fg-250: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-250) + ); + --wui-color-fg-275: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-275) + ); + --wui-color-fg-300: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-300) + ); + + --wui-color-bg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-100) + ); + --wui-color-bg-125: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-125) + ); + --wui-color-bg-150: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-150) + ); + --wui-color-bg-175: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-175) + ); + --wui-color-bg-200: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-200) + ); + --wui-color-bg-225: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-225) + ); + --wui-color-bg-250: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-250) + ); + --wui-color-bg-275: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-275) + ); + --wui-color-bg-300: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-300) + ); + + --wui-color-success-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-success-base-100) + ); + --wui-color-error-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-error-base-100) + ); + + --wui-icon-box-bg-error-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-error-base-100) + ); + --wui-icon-box-bg-accent-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-blue-base-100) + ); + --wui-icon-box-bg-success-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-success-base-100) + ); + --wui-icon-box-bg-inverse-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-inverse-base-100) + ); + + --wui-all-wallets-bg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-all-wallets-bg-base-100) + ); + + --wui-avatar-border: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-avatar-border-base) + ); + + --wui-thumbnail-border: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-thumbnail-border-base) + ); + } + } + `,light:ne` + :root { + --w3m-color-mix: ${Ui((i==null?void 0:i["--w3m-color-mix"])||"#fff")}; + --w3m-accent: ${Ui((i==null?void 0:i["--w3m-accent"])||"#47a1ff")}; + --w3m-default: #fff; + + --wui-color-modal-bg-base: #191a1a; + + --wui-color-blue-base-100: #47a1ff; + + --wui-color-accent-base-100: var(--w3m-accent); + --wui-color-accent-base-090: #59aaff; + --wui-color-accent-base-080: #6cb4ff; + + --wui-accent-glass-base-090: rgba(71, 161, 255, 0.9); + --wui-accent-glass-base-080: rgba(71, 161, 255, 0.8); + --wui-accent-glass-base-020: rgba(71, 161, 255, 0.2); + --wui-accent-glass-base-015: rgba(71, 161, 255, 0.15); + --wui-accent-glass-base-010: rgba(71, 161, 255, 0.1); + --wui-accent-glass-base-005: rgba(71, 161, 255, 0.05); + --wui-accent-glass-base-002: rgba(71, 161, 255, 0.02); + + --wui-color-fg-base-100: #e4e7e7; + --wui-color-fg-base-125: #d0d5d5; + --wui-color-fg-base-150: #a8b1b1; + --wui-color-fg-base-175: #a8b0b0; + --wui-color-fg-base-200: #949e9e; + --wui-color-fg-base-225: #868f8f; + --wui-color-fg-base-250: #788080; + --wui-color-fg-base-275: #788181; + --wui-color-fg-base-300: #6e7777; + + --wui-color-bg-base-100: #141414; + --wui-color-bg-base-125: #191a1a; + --wui-color-bg-base-150: #1e1f1f; + --wui-color-bg-base-175: #222525; + --wui-color-bg-base-200: #272a2a; + --wui-color-bg-base-225: #2c3030; + --wui-color-bg-base-250: #313535; + --wui-color-bg-base-275: #363b3b; + --wui-color-bg-base-300: #3b4040; + + --wui-color-success-base-100: #26d962; + --wui-color-error-base-100: #f25a67; + + --wui-success-glass-001: rgba(38, 217, 98, 0.01); + --wui-success-glass-002: rgba(38, 217, 98, 0.02); + --wui-success-glass-005: rgba(38, 217, 98, 0.05); + --wui-success-glass-010: rgba(38, 217, 98, 0.1); + --wui-success-glass-015: rgba(38, 217, 98, 0.15); + --wui-success-glass-020: rgba(38, 217, 98, 0.2); + --wui-success-glass-025: rgba(38, 217, 98, 0.25); + --wui-success-glass-030: rgba(38, 217, 98, 0.3); + --wui-success-glass-060: rgba(38, 217, 98, 0.6); + --wui-success-glass-080: rgba(38, 217, 98, 0.8); + + --wui-error-glass-001: rgba(242, 90, 103, 0.01); + --wui-error-glass-002: rgba(242, 90, 103, 0.02); + --wui-error-glass-005: rgba(242, 90, 103, 0.05); + --wui-error-glass-010: rgba(242, 90, 103, 0.1); + --wui-error-glass-015: rgba(242, 90, 103, 0.15); + --wui-error-glass-020: rgba(242, 90, 103, 0.2); + --wui-error-glass-025: rgba(242, 90, 103, 0.25); + --wui-error-glass-030: rgba(242, 90, 103, 0.3); + --wui-error-glass-060: rgba(242, 90, 103, 0.6); + --wui-error-glass-080: rgba(242, 90, 103, 0.8); + + --wui-icon-box-bg-error-base-100: #3c2426; + --wui-icon-box-bg-blue-base-100: #20303f; + --wui-icon-box-bg-success-base-100: #1f3a28; + --wui-icon-box-bg-inverse-base-100: #243240; + + --wui-all-wallets-bg-base-100: #222b35; + + --wui-avatar-border-base: #252525; + + --wui-thumbnail-border-base: #252525; + + --wui-gray-glass-001: rgba(255, 255, 255, 0.01); + --wui-gray-glass-002: rgba(255, 255, 255, 0.02); + --wui-gray-glass-005: rgba(255, 255, 255, 0.05); + --wui-gray-glass-010: rgba(255, 255, 255, 0.1); + --wui-gray-glass-015: rgba(255, 255, 255, 0.15); + --wui-gray-glass-020: rgba(255, 255, 255, 0.2); + --wui-gray-glass-025: rgba(255, 255, 255, 0.25); + --wui-gray-glass-030: rgba(255, 255, 255, 0.3); + --wui-gray-glass-060: rgba(255, 255, 255, 0.6); + --wui-gray-glass-080: rgba(255, 255, 255, 0.8); + --wui-gray-glass-090: rgba(255, 255, 255, 0.9); + } + `,dark:ne` + :root { + --w3m-color-mix: ${Ui((i==null?void 0:i["--w3m-color-mix"])||"#000")}; + --w3m-accent: ${Ui((i==null?void 0:i["--w3m-accent"])||"#3396ff")}; + --w3m-default: #000; + + --wui-color-modal-bg-base: #fff; + + --wui-color-blue-base-100: #3396ff; + + --wui-color-accent-base-100: var(--w3m-accent); + --wui-color-accent-base-090: #2d7dd2; + --wui-color-accent-base-080: #2978cc; + + --wui-accent-glass-base-090: rgba(51, 150, 255, 0.9); + --wui-accent-glass-base-080: rgba(51, 150, 255, 0.8); + --wui-accent-glass-base-020: rgba(51, 150, 255, 0.2); + --wui-accent-glass-base-015: rgba(51, 150, 255, 0.15); + --wui-accent-glass-base-010: rgba(51, 150, 255, 0.1); + --wui-accent-glass-base-005: rgba(51, 150, 255, 0.05); + --wui-accent-glass-base-002: rgba(51, 150, 255, 0.02); + + --wui-color-fg-base-100: #141414; + --wui-color-fg-base-125: #2d3131; + --wui-color-fg-base-150: #474d4d; + --wui-color-fg-base-175: #636d6d; + --wui-color-fg-base-200: #798686; + --wui-color-fg-base-225: #828f8f; + --wui-color-fg-base-250: #8b9797; + --wui-color-fg-base-275: #95a0a0; + --wui-color-fg-base-300: #9ea9a9; + + --wui-color-bg-base-100: #ffffff; + --wui-color-bg-base-125: #f5fafa; + --wui-color-bg-base-150: #f3f8f8; + --wui-color-bg-base-175: #eef4f4; + --wui-color-bg-base-200: #eaf1f1; + --wui-color-bg-base-225: #e5eded; + --wui-color-bg-base-250: #e1e9e9; + --wui-color-bg-base-275: #dce7e7; + --wui-color-bg-base-300: #d8e3e3; + + --wui-color-success-base-100: #26b562; + --wui-color-error-base-100: #f05142; + + --wui-success-glass-001: rgba(38, 181, 98, 0.01); + --wui-success-glass-002: rgba(38, 181, 98, 0.02); + --wui-success-glass-005: rgba(38, 181, 98, 0.05); + --wui-success-glass-010: rgba(38, 181, 98, 0.1); + --wui-success-glass-015: rgba(38, 181, 98, 0.15); + --wui-success-glass-020: rgba(38, 181, 98, 0.2); + --wui-success-glass-025: rgba(38, 181, 98, 0.25); + --wui-success-glass-030: rgba(38, 181, 98, 0.3); + --wui-success-glass-060: rgba(38, 181, 98, 0.6); + --wui-success-glass-080: rgba(38, 181, 98, 0.8); + + --wui-error-glass-001: rgba(240, 81, 66, 0.01); + --wui-error-glass-002: rgba(240, 81, 66, 0.02); + --wui-error-glass-005: rgba(240, 81, 66, 0.05); + --wui-error-glass-010: rgba(240, 81, 66, 0.1); + --wui-error-glass-015: rgba(240, 81, 66, 0.15); + --wui-error-glass-020: rgba(240, 81, 66, 0.2); + --wui-error-glass-025: rgba(240, 81, 66, 0.25); + --wui-error-glass-030: rgba(240, 81, 66, 0.3); + --wui-error-glass-060: rgba(240, 81, 66, 0.6); + --wui-error-glass-080: rgba(240, 81, 66, 0.8); + + --wui-icon-box-bg-error-base-100: #f4dfdd; + --wui-icon-box-bg-blue-base-100: #d9ecfb; + --wui-icon-box-bg-success-base-100: #daf0e4; + --wui-icon-box-bg-inverse-base-100: #dcecfc; + + --wui-all-wallets-bg-base-100: #e8f1fa; + + --wui-avatar-border-base: #f3f4f4; + + --wui-thumbnail-border-base: #eaefef; + + --wui-gray-glass-001: rgba(0, 0, 0, 0.01); + --wui-gray-glass-002: rgba(0, 0, 0, 0.02); + --wui-gray-glass-005: rgba(0, 0, 0, 0.05); + --wui-gray-glass-010: rgba(0, 0, 0, 0.1); + --wui-gray-glass-015: rgba(0, 0, 0, 0.15); + --wui-gray-glass-020: rgba(0, 0, 0, 0.2); + --wui-gray-glass-025: rgba(0, 0, 0, 0.25); + --wui-gray-glass-030: rgba(0, 0, 0, 0.3); + --wui-gray-glass-060: rgba(0, 0, 0, 0.6); + --wui-gray-glass-080: rgba(0, 0, 0, 0.8); + --wui-gray-glass-090: rgba(0, 0, 0, 0.9); + } + `}}const ue=ne` + *, + *::after, + *::before, + :host { + margin: 0; + padding: 0; + box-sizing: border-box; + font-style: normal; + text-rendering: optimizeSpeed; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-tap-highlight-color: transparent; + font-family: var(--wui-font-family); + backface-visibility: hidden; + } +`,Oe=ne` + button, + a { + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + position: relative; + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, color; + outline: none; + border: 1px solid transparent; + column-gap: var(--wui-spacing-3xs); + background-color: transparent; + text-decoration: none; + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-gray-glass-005); + } + + button:active:enabled { + background-color: var(--wui-gray-glass-010); + } + + button[data-variant='fill']:hover:enabled { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='accentBg']:hover:enabled { + background: var(--wui-accent-glass-015); + } + + button[data-variant='accentBg']:active:enabled { + background: var(--wui-accent-glass-020); + } + } + + button:disabled { + cursor: not-allowed; + background-color: var(--wui-gray-glass-005); + } + + button[data-variant='shade']:disabled, + button[data-variant='accent']:disabled, + button[data-variant='accentBg']:disabled { + background-color: var(--wui-gray-glass-010); + color: var(--wui-gray-glass-015); + filter: grayscale(1); + } + + button:disabled > wui-wallet-image, + button:disabled > wui-all-wallets-image, + button:disabled > wui-network-image, + button:disabled > wui-image, + button:disabled > wui-icon-box, + button:disabled > wui-transaction-visual, + button:disabled > wui-logo { + filter: grayscale(1); + } + + button:focus-visible, + a:focus-visible { + border: 1px solid var(--wui-color-accent-100); + background-color: var(--wui-gray-glass-005); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + button[data-variant='fill']:focus-visible { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='fill'] { + color: var(--wui-color-inverse-100); + background-color: var(--wui-color-accent-100); + } + + button[data-variant='fill']:disabled { + color: var(--wui-gray-glass-015); + background-color: var(--wui-gray-glass-015); + } + + button[data-variant='fill']:disabled > wui-icon { + color: var(--wui-gray-glass-015); + } + + button[data-variant='shade'] { + color: var(--wui-color-fg-200); + } + + button[data-variant='accent'], + button[data-variant='accentBg'] { + color: var(--wui-color-accent-100); + } + + button[data-variant='accentBg'] { + background: var(--wui-accent-glass-010); + border: 1px solid var(--wui-accent-glass-010); + } + + button[data-variant='fullWidth'] { + width: 100%; + border-radius: var(--wui-border-radius-xs); + height: 56px; + border: none; + background-color: var(--wui-gray-glass-002); + color: var(--wui-color-fg-200); + gap: var(--wui-spacing-xs); + } + + button:active:enabled { + background-color: var(--wui-gray-glass-010); + } + + button[data-variant='fill']:active:enabled { + background-color: var(--wui-color-accent-080); + border: 1px solid var(--wui-gray-glass-010); + } + + input { + border: none; + outline: none; + appearance: none; + } +`,au=ne` + .wui-color-inherit { + color: var(--wui-color-inherit); + } + + .wui-color-accent-100 { + color: var(--wui-color-accent-100); + } + + .wui-color-error-100 { + color: var(--wui-color-error-100); + } + + .wui-color-success-100 { + color: var(--wui-color-success-100); + } + + .wui-color-inverse-100 { + color: var(--wui-color-inverse-100); + } + + .wui-color-inverse-000 { + color: var(--wui-color-inverse-000); + } + + .wui-color-fg-100 { + color: var(--wui-color-fg-100); + } + + .wui-color-fg-200 { + color: var(--wui-color-fg-200); + } + + .wui-color-fg-300 { + color: var(--wui-color-fg-300); + } + + .wui-bg-color-inherit { + background-color: var(--wui-color-inherit); + } + + .wui-bg-color-blue-100 { + background-color: var(--wui-color-accent-100); + } + + .wui-bg-color-error-100 { + background-color: var(--wui-color-error-100); + } + + .wui-bg-color-success-100 { + background-color: var(--wui-color-success-100); + } + + .wui-bg-color-inverse-100 { + background-color: var(--wui-color-inverse-100); + } + + .wui-bg-color-inverse-000 { + background-color: var(--wui-color-inverse-000); + } + + .wui-bg-color-fg-100 { + background-color: var(--wui-color-fg-100); + } + + .wui-bg-color-fg-200 { + background-color: var(--wui-color-fg-200); + } + + .wui-bg-color-fg-300 { + background-color: var(--wui-color-fg-300); + } +`;function Uf(i,e){const{kind:t,elements:r}=e;return{kind:t,elements:r,finisher(o){customElements.get(i)||customElements.define(i,o)}}}function jf(i,e){return customElements.get(i)||customElements.define(i,e),e}function V(i){return function(t){return typeof t=="function"?jf(i,t):Uf(i,t)}}const Wf=ne` + :host { + display: block; + border-radius: clamp(0px, var(--wui-border-radius-l), 44px); + box-shadow: 0 0 0 1px var(--wui-gray-glass-005); + background-color: var(--wui-color-modal-bg); + overflow: hidden; + } +`;var zf=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ea=class extends oe{render(){return z``}};Ea.styles=[ue,Wf];Ea=zf([V("wui-card")],Ea);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ff={attribute:!0,type:String,converter:Ca,reflect:!1,hasChanged:ru},Hf=(i=Ff,e,t)=>{const{kind:r,metadata:o}=t;let n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),n.set(t.name,i),r==="accessor"){const{name:s}=t;return{set(a){const c=e.get.call(this);e.set.call(this,a),this.requestUpdate(s,c,i)},init(a){return a!==void 0&&this.P(s,void 0,i),a}}}if(r==="setter"){const{name:s}=t;return function(a){const c=this[s];e.call(this,a),this.requestUpdate(s,c,i)}}throw Error("Unsupported decorator location: "+r)};function C(i){return(e,t)=>typeof t=="object"?Hf(i,e,t):((r,o,n)=>{const s=o.hasOwnProperty(n);return o.constructor.createProperty(n,s?{...r,wrapped:!0}:r),s?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function cu(i){return C({...i,state:!0,attribute:!1})}const Vf=ne` + :host { + display: flex; + aspect-ratio: 1 / 1; + color: var(--local-color); + width: var(--local-width); + } + + svg { + width: inherit; + height: inherit; + object-fit: contain; + object-position: center; + } +`,Zf=J` + +`,Gf=J` + `,qf=J` + + + + + + + + + +`,Yf=J` + + + + + + + + + + + + + +`,Kf=J` + +`,Jf=J` + +`,Xf=J` + +`,Qf=J` + +`,eg=J` + + +`,tg=J` + `,ig=J` + +`,ng=J` + +`,rg=J` + +`,og=J` + +`,sg=J` + + + + + + + + + + + + + + + + + + + + + +`,ag=J` + +`,cg=J` + +`,lg=J` + +`,ug=J` + +`,dg=J` + `,hg=J` + `,pg=J` + +`,fg=J` + + +`,gg=J` + +`,wg=J` + + + + + + + + + + +`,mg=J` + +`,vg=J` + +`,bg=J` + +`,yg=J` + + + + + + + + + + + + + + + +`,xg=J` + +`,Cg=J` + + + + + + + + + + + + + +`,_g=J` + + + + + + + + + + + + + + + + +`,Eg=J` + + +`,Tg=J` + + +`,Ag=J` + +`,Sg=J` + + +`,kg=J` + + +`,$g=J` + +`,Rg=J` + +`,Ig=J` + + + + + + +`,Og=J` + +`,Pg=J` + +`,Ng=J` + +`,Dg=J` + + `,Mg=J` + +`,Lg=J` + +`,Bg=J` + + + +`,Ug=J` + +`,jg=J` + +`,Wg=J` + + + + + + + + + + + `,zg=J` + + + + + + + + + + + + + +`,Fg=J` + + + + + + + + + + +`,Hg=J` + +`,Vg=J` + +`,Zg=J` + +`,Gg=J` + + + + +`,qg=J` + +`,Yg=J` + + +`,Kg=J` + + +`,Jg=J` + `,Xg=J` + `,Qg=J` + `,ew=J` + `,tw=J` + + + + `,iw=J` + +`;var cc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const nw={add:hg,allWallets:Zf,arrowBottomCircle:Gf,appStore:qf,apple:Yf,arrowBottom:Kf,arrowLeft:Jf,arrowRight:Xf,arrowTop:Qf,bank:Xg,browser:eg,card:Qg,checkmark:tg,checkmarkBold:iw,chevronBottom:ig,chevronLeft:ng,chevronRight:rg,chevronTop:og,chromeStore:sg,clock:ag,close:cg,compass:ug,coinPlaceholder:lg,copy:dg,cursor:pg,cursorTransparent:tw,desktop:fg,disconnect:gg,discord:wg,etherscan:mg,extension:vg,externalLink:bg,facebook:yg,filters:xg,github:Cg,google:_g,helpCircle:Eg,infoCircle:Tg,mail:Ag,mobile:Sg,networkPlaceholder:kg,nftPlaceholder:$g,off:Rg,playStore:Ig,plus:ew,qrCode:Og,recycleHorizontal:Jg,refresh:Pg,search:Ng,send:Dg,swapHorizontal:Mg,swapHorizontalMedium:Bg,swapHorizontalBold:Lg,swapHorizontalRoundedBold:Ug,swapVertical:jg,telegram:Wg,twitch:zg,twitter:Fg,twitterIcon:Hg,verify:Vg,verifyFilled:Zg,wallet:qg,walletConnect:Yg,walletPlaceholder:Gg,warningCircle:Kg};let vr=class extends oe{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300"}render(){return this.style.cssText=` + --local-color: ${`var(--wui-color-${this.color});`} + --local-width: ${`var(--wui-icon-size-${this.size});`} + `,z`${nw[this.name]}`}};vr.styles=[ue,au,Vf];cc([C()],vr.prototype,"size",void 0);cc([C()],vr.prototype,"name",void 0);cc([C()],vr.prototype,"color",void 0);vr=cc([V("wui-icon")],vr);const rw=ne` + :host { + display: block; + width: var(--local-width); + height: var(--local-height); + } + + img { + display: block; + width: 100%; + height: 100%; + object-fit: cover; + object-position: center center; + border-radius: inherit; + } +`;var lc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let br=class extends oe{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=` + --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; + --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; + `,z`${this.alt}`}};br.styles=[ue,au,rw];lc([C()],br.prototype,"src",void 0);lc([C()],br.prototype,"alt",void 0);lc([C()],br.prototype,"size",void 0);br=lc([V("wui-image")],br);const ow=ne` + :host { + display: block; + width: var(--wui-box-size-lg); + height: var(--wui-box-size-lg); + } + + svg { + width: var(--wui-box-size-lg); + height: var(--wui-box-size-lg); + fill: none; + stroke: transparent; + stroke-linecap: round; + } + + use { + stroke: var(--wui-color-accent-100); + stroke-width: 2px; + stroke-dasharray: 54, 118; + stroke-dashoffset: 172; + animation: dash 1s linear infinite; + } + + @keyframes dash { + to { + stroke-dashoffset: 0px; + } + } +`;var sw=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ta=class extends oe{render(){return z` + + + + + `}};Ta.styles=[ue,ow];Ta=sw([V("wui-loading-hexagon")],Ta);const aw=ne` + :host { + display: flex; + } + + :host([data-size='sm']) > svg { + width: 12px; + height: 12px; + } + + :host([data-size='md']) > svg { + width: 16px; + height: 16px; + } + + :host([data-size='lg']) > svg { + width: 24px; + height: 24px; + } + + :host([data-size='xl']) > svg { + width: 32px; + height: 32px; + } + + svg { + animation: rotate 2s linear infinite; + } + + circle { + fill: none; + stroke: var(--local-color); + stroke-width: 4px; + stroke-dasharray: 1, 124; + stroke-dashoffset: 0; + stroke-linecap: round; + animation: dash 1.5s ease-in-out infinite; + } + + :host([data-size='md']) > svg > circle { + stroke-width: 6px; + } + + :host([data-size='sm']) > svg > circle { + stroke-width: 8px; + } + + @keyframes rotate { + 100% { + transform: rotate(360deg); + } + } + + @keyframes dash { + 0% { + stroke-dasharray: 1, 124; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 90, 124; + stroke-dashoffset: -35; + } + + 100% { + stroke-dashoffset: -125; + } + } +`;var lu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let po=class extends oe{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: var(--wui-color-${this.color});`,this.dataset.size=this.size,z` + + `}};po.styles=[ue,aw];lu([C()],po.prototype,"color",void 0);lu([C()],po.prototype,"size",void 0);po=lu([V("wui-loading-spinner")],po);const cw=ne` + :host { + display: block; + width: var(--wui-box-size-md); + height: var(--wui-box-size-md); + } + + svg { + width: var(--wui-box-size-md); + height: var(--wui-box-size-md); + } + + rect { + fill: none; + stroke: var(--wui-color-accent-100); + stroke-width: 4px; + stroke-linecap: round; + animation: dash 1s linear infinite; + } + + @keyframes dash { + to { + stroke-dashoffset: 0px; + } + } +`;var K0=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ds=class extends oe{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,r=36-e,o=116+r,n=245+r,s=360+r*1.75;return z` + + + + `}};ds.styles=[ue,cw];K0([C({type:Number})],ds.prototype,"radius",void 0);ds=K0([V("wui-loading-thumbnail")],ds);const lw=ne` + :host { + display: block; + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + background: linear-gradient( + 120deg, + var(--wui-color-bg-200) 5%, + var(--wui-color-bg-200) 48%, + var(--wui-color-bg-300) 55%, + var(--wui-color-bg-300) 60%, + var(--wui-color-bg-300) calc(60% + 10px), + var(--wui-color-bg-200) calc(60% + 12px), + var(--wui-color-bg-200) 100% + ); + background-size: 250%; + animation: shimmer 3s linear infinite reverse; + } + + @keyframes shimmer { + from { + background-position: -250% 0; + } + to { + background-position: 250% 0; + } + } +`;var uc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let yr=class extends oe{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m"}render(){return this.style.cssText=` + width: ${this.width}; + height: ${this.height}; + border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`}; + `,z``}};yr.styles=[lw];uc([C()],yr.prototype,"width",void 0);uc([C()],yr.prototype,"height",void 0);uc([C()],yr.prototype,"borderRadius",void 0);yr=uc([V("wui-shimmer")],yr);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const J0={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},X0=i=>(...e)=>({_$litDirective$:i,values:e});let Q0=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const uw=X0(class extends Q0{constructor(i){var e;if(super(i),i.type!==J0.ATTRIBUTE||i.name!=="class"||((e=i.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(e=>i[e]).join(" ")+" "}update(i,[e]){var r,o;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in e)e[n]&&!((r=this.nt)!=null&&r.has(n))&&this.st.add(n);return this.render(e)}const t=i.element.classList;for(const n of this.st)n in e||(t.remove(n),this.st.delete(n));for(const n in e){const s=!!e[n];s===this.st.has(n)||(o=this.nt)!=null&&o.has(n)||(s?(t.add(n),this.st.add(n)):(t.remove(n),this.st.delete(n)))}return mr}}),dw=ne` + :host { + display: inline-flex !important; + } + + slot { + width: 100%; + display: inline-block; + font-style: normal; + font-family: var(--wui-font-family); + font-feature-settings: + 'tnum' on, + 'lnum' on, + 'case' on; + line-height: 130%; + font-weight: var(--wui-font-weight-regular); + overflow: inherit; + text-overflow: inherit; + text-align: var(--local-align); + color: var(--local-color); + } + + .wui-font-medium-400 { + font-size: var(--wui-font-size-medium); + font-weight: var(--wui-font-weight-light); + letter-spacing: var(--wui-letter-spacing-medium); + } + + .wui-font-medium-600 { + font-size: var(--wui-font-size-medium); + letter-spacing: var(--wui-letter-spacing-medium); + } + + .wui-font-medium-title-600 { + font-size: var(--wui-font-size-medium-title); + letter-spacing: var(--wui-letter-spacing-medium-title); + } + + .wui-font-mini-700 { + font-size: var(--wui-font-size-mini); + letter-spacing: var(--wui-letter-spacing-mini); + text-transform: uppercase; + } + + .wui-font-large-500, + .wui-font-large-600, + .wui-font-large-700 { + font-size: var(--wui-font-size-large); + letter-spacing: var(--wui-letter-spacing-large); + } + + .wui-font-2xl-500, + .wui-font-2xl-600, + .wui-font-2xl-700 { + font-size: var(--wui-font-size-2xl); + letter-spacing: var(--wui-letter-spacing-2xl); + } + + .wui-font-paragraph-400, + .wui-font-paragraph-500, + .wui-font-paragraph-600, + .wui-font-paragraph-700 { + font-size: var(--wui-font-size-paragraph); + letter-spacing: var(--wui-letter-spacing-paragraph); + } + + .wui-font-small-400, + .wui-font-small-500, + .wui-font-small-600 { + font-size: var(--wui-font-size-small); + letter-spacing: var(--wui-letter-spacing-small); + } + + .wui-font-tiny-400, + .wui-font-tiny-500, + .wui-font-tiny-600 { + font-size: var(--wui-font-size-tiny); + letter-spacing: var(--wui-letter-spacing-tiny); + } + + .wui-font-micro-700, + .wui-font-micro-600 { + font-size: var(--wui-font-size-micro); + letter-spacing: var(--wui-letter-spacing-micro); + text-transform: uppercase; + } + + .wui-font-tiny-400, + .wui-font-small-400, + .wui-font-paragraph-400 { + font-weight: var(--wui-font-weight-light); + } + + .wui-font-large-700, + .wui-font-paragraph-700, + .wui-font-micro-700, + .wui-font-mini-700 { + font-weight: var(--wui-font-weight-bold); + } + + .wui-font-medium-600, + .wui-font-medium-title-600, + .wui-font-large-600, + .wui-font-paragraph-600, + .wui-font-small-600, + .wui-font-tiny-600, + .wui-font-micro-600 { + font-weight: var(--wui-font-weight-medium); + } +`;var dc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let xr=class extends oe{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left"}render(){const e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0};return this.style.cssText=` + --local-align: ${this.align}; + --local-color: var(--wui-color-${this.color}); + `,z``}};xr.styles=[ue,dw];dc([C()],xr.prototype,"variant",void 0);dc([C()],xr.prototype,"color",void 0);dc([C()],xr.prototype,"align",void 0);xr=dc([V("wui-text")],xr);const hw=J` + + + + + + + + `,pw=J` + + + + + + + + + + + + + + + + `,fw=J` + + + + + + + + + + + + +`,gw=J` + + + + + + + + + + + + + `,ww=J` + + + + + + + + + + + + + + + `,mw=J` + + + + + +`,vw=J` + + + + + +`,bw=J` + + + + + + + + + + `,yw=J` + + + + + + + + + + + + + + + +`,xw=J` + + + + + + + + + + `,Cw=J` + + + + + + + + +`,_w=J` + + + + + + + + + + + + + + + `,Ew=J` + + + + + + + + + + + + + + `,Tw=J` + + + + + + + + + +`,Aw=J` + + + + + + + + + + +`,Sw=J` + + + + + + + + + + +`,kw=J` + + + + + + + + + + + + +`,$w=J` + + + + + + + + + + + + +`,Rw=J` + + + + + + + + + +`,Iw=J` + + + + + + + + + + + + + + + + + + +`,Ow=J` + + + + + + + + + + + + + + + + +`,Pw=ne` + :host { + display: block; + width: var(--local-size); + height: var(--local-size); + } + + :host svg { + width: 100%; + height: 100%; + } +`;var uu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const Nw={browser:hw,dao:pw,defi:fw,defiAlt:gw,eth:ww,layers:mw,lock:vw,login:bw,network:yw,nft:xw,noun:Cw,profile:_w,system:Ew,coinbase:Tw,onrampCard:$w,moonpay:Aw,stripe:Sw,paypal:kw,google:Rw,pencil:Iw,lightbulb:Ow};let fo=class extends oe{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=` + --local-size: var(--wui-visual-size-${this.size}); + `,z`${Nw[this.name]}`}};fo.styles=[ue,Pw];uu([C()],fo.prototype,"name",void 0);uu([C()],fo.prototype,"size",void 0);fo=uu([V("wui-visual")],fo);/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ei=i=>i??lt,ve={getSpacingStyles(i,e){if(Array.isArray(i))return i[e]?`var(--wui-spacing-${i[e]})`:void 0;if(typeof i=="string")return`var(--wui-spacing-${i})`},getFormattedDate(i){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(i)},getHostName(i){return new URL(i).hostname},getTruncateString({string:i,charsStart:e,charsEnd:t,truncate:r}){return i.length<=e+t?i:r==="end"?`${i.substring(0,e)}...`:r==="start"?`...${i.substring(i.length-t)}`:`${i.substring(0,Math.floor(e))}...${i.substring(i.length-Math.floor(t))}`},generateAvatarColors(i){const t=i.toLowerCase().replace(/^0x/iu,"").substring(0,6),r=this.hexToRgb(t),o=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),s=100-3*Number(o==null?void 0:o.replace("px","")),a=`${s}% ${s}% at 65% 40%`,c=[];for(let l=0;l<5;l+=1){const h=this.tintColor(r,.15*l);c.push(`rgb(${h[0]}, ${h[1]}, ${h[2]})`)}return` + --local-color-1: ${c[0]}; + --local-color-2: ${c[1]}; + --local-color-3: ${c[2]}; + --local-color-4: ${c[3]}; + --local-color-5: ${c[4]}; + --local-radial-circle: ${a} + `},hexToRgb(i){const e=parseInt(i,16),t=e>>16&255,r=e>>8&255,o=e&255;return[t,r,o]},tintColor(i,e){const[t,r,o]=i,n=Math.round(t+(255-t)*e),s=Math.round(r+(255-r)*e),a=Math.round(o+(255-o)*e);return[n,s,a]},isNumber(i){return{number:/^[0-9]+$/u}.number.test(i)},getColorTheme(i){return i||(typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark")},splitBalance(i){const e=i.split(".");return e.length===2?[e[0],e[1]]:["0","00"]},roundNumber(i,e,t){return Math.abs(i)>=e?Number(i.toFixed(t)):i},formatNumberToLocalString(i,e=2){return i===void 0?"0.00":typeof i=="number"?i.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(i).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})}},Dw=ne` + :host { + display: flex; + width: inherit; + height: inherit; + } +`;var oi=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Rt=class extends oe{render(){return this.style.cssText=` + flex-direction: ${this.flexDirection}; + flex-wrap: ${this.flexWrap}; + flex-basis: ${this.flexBasis}; + flex-grow: ${this.flexGrow}; + flex-shrink: ${this.flexShrink}; + align-items: ${this.alignItems}; + justify-content: ${this.justifyContent}; + column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; + row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; + gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; + padding-top: ${this.padding&&ve.getSpacingStyles(this.padding,0)}; + padding-right: ${this.padding&&ve.getSpacingStyles(this.padding,1)}; + padding-bottom: ${this.padding&&ve.getSpacingStyles(this.padding,2)}; + padding-left: ${this.padding&&ve.getSpacingStyles(this.padding,3)}; + margin-top: ${this.margin&&ve.getSpacingStyles(this.margin,0)}; + margin-right: ${this.margin&&ve.getSpacingStyles(this.margin,1)}; + margin-bottom: ${this.margin&&ve.getSpacingStyles(this.margin,2)}; + margin-left: ${this.margin&&ve.getSpacingStyles(this.margin,3)}; + `,z``}};Rt.styles=[ue,Dw];oi([C()],Rt.prototype,"flexDirection",void 0);oi([C()],Rt.prototype,"flexWrap",void 0);oi([C()],Rt.prototype,"flexBasis",void 0);oi([C()],Rt.prototype,"flexGrow",void 0);oi([C()],Rt.prototype,"flexShrink",void 0);oi([C()],Rt.prototype,"alignItems",void 0);oi([C()],Rt.prototype,"justifyContent",void 0);oi([C()],Rt.prototype,"columnGap",void 0);oi([C()],Rt.prototype,"rowGap",void 0);oi([C()],Rt.prototype,"gap",void 0);oi([C()],Rt.prototype,"padding",void 0);oi([C()],Rt.prototype,"margin",void 0);Rt=oi([V("wui-flex")],Rt);const Mw=ne` + :host { + display: block; + width: var(--wui-icon-box-size-xl); + height: var(--wui-icon-box-size-xl); + border-radius: var(--wui-border-radius-3xl); + box-shadow: 0 0 0 8px var(--wui-gray-glass-005); + overflow: hidden; + position: relative; + } + + :host([data-variant='generated']) { + --mixed-local-color-1: var(--local-color-1); + --mixed-local-color-2: var(--local-color-2); + --mixed-local-color-3: var(--local-color-3); + --mixed-local-color-4: var(--local-color-4); + --mixed-local-color-5: var(--local-color-5); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :host([data-variant='generated']) { + --mixed-local-color-1: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-1) + ); + --mixed-local-color-2: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-2) + ); + --mixed-local-color-3: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-3) + ); + --mixed-local-color-4: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-4) + ); + --mixed-local-color-5: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-5) + ); + } + } + + :host([data-variant='generated']) { + box-shadow: 0 0 0 8px var(--wui-gray-glass-005); + background: radial-gradient( + var(--local-radial-circle), + #fff 0.52%, + var(--mixed-local-color-5) 31.25%, + var(--mixed-local-color-3) 51.56%, + var(--mixed-local-color-2) 65.63%, + var(--mixed-local-color-1) 82.29%, + var(--mixed-local-color-4) 100% + ); + } + + :host([data-variant='default']) { + box-shadow: 0 0 0 8px var(--wui-gray-glass-005); + background: radial-gradient( + 75.29% 75.29% at 64.96% 24.36%, + #fff 0.52%, + #f5ccfc 31.25%, + #dba4f5 51.56%, + #9a8ee8 65.63%, + #6493da 82.29%, + #6ebdea 100% + ); + } +`;var hc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Cr=class extends oe{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0}render(){return z`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",z``;if(this.address){this.dataset.variant="generated";const e=ve.generateAvatarColors(this.address);return this.style.cssText=e,null}return this.dataset.variant="default",null}};Cr.styles=[ue,Mw];hc([C()],Cr.prototype,"imageSrc",void 0);hc([C()],Cr.prototype,"alt",void 0);hc([C()],Cr.prototype,"address",void 0);Cr=hc([V("wui-avatar")],Cr);const Lw=ne` + :host { + display: inline-flex; + justify-content: center; + align-items: center; + position: relative; + overflow: hidden; + background-color: var(--wui-gray-glass-020); + border-radius: var(--local-border-radius); + border: var(--local-border); + box-sizing: content-box; + width: var(--local-size); + height: var(--local-size); + min-height: var(--local-size); + min-width: var(--local-size); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :host { + background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent); + } + } +`;var bn=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let fi=class extends oe{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const e=this.iconSize||this.size,t=this.size==="lg",r=this.size==="xl",o=t?"12%":"16%",n=t?"xxs":r?"s":"3xl",s=this.background==="gray",a=this.background==="opaque",c=this.backgroundColor==="accent-100"&&a||this.backgroundColor==="success-100"&&a||this.backgroundColor==="error-100"&&a||this.backgroundColor==="inverse-100"&&a;let l=`var(--wui-color-${this.backgroundColor})`;return c?l=`var(--wui-icon-box-bg-${this.backgroundColor})`:s&&(l=`var(--wui-gray-${this.backgroundColor})`),this.style.cssText=` + --local-bg-value: ${l}; + --local-bg-mix: ${c||s?"100%":o}; + --local-border-radius: var(--wui-border-radius-${n}); + --local-size: var(--wui-icon-box-size-${this.size}); + --local-border: ${this.borderColor==="wui-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"} + `,z` `}};fi.styles=[ue,Oe,Lw];bn([C()],fi.prototype,"size",void 0);bn([C()],fi.prototype,"backgroundColor",void 0);bn([C()],fi.prototype,"iconColor",void 0);bn([C()],fi.prototype,"iconSize",void 0);bn([C()],fi.prototype,"background",void 0);bn([C({type:Boolean})],fi.prototype,"border",void 0);bn([C()],fi.prototype,"borderColor",void 0);bn([C()],fi.prototype,"icon",void 0);fi=bn([V("wui-icon-box")],fi);const Bw=ne` + :host { + display: block; + } + + button { + border-radius: var(--wui-border-radius-3xl); + background: var(--wui-gray-glass-002); + display: flex; + gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs) + var(--wui-spacing-xs); + border: 1px solid var(--wui-gray-glass-005); + } + + button:disabled { + background: var(--wui-gray-glass-015); + } + + button:disabled > wui-text { + color: var(--wui-gray-glass-015); + } + + button:disabled > wui-flex > wui-text { + color: var(--wui-gray-glass-015); + } + + button:disabled > wui-image, + button:disabled > wui-icon-box, + button:disabled > wui-flex > wui-avatar { + filter: grayscale(1); + } + + button:has(wui-image) { + padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs) + var(--wui-spacing-xs); + } + + wui-text { + color: var(--wui-color-fg-100); + } + + wui-flex > wui-text { + color: var(--wui-color-fg-200); + } + + wui-image, + wui-icon-box { + border-radius: var(--wui-border-radius-3xl); + width: 24px; + height: 24px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } + + wui-flex { + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-005); + background: var(--wui-gray-glass-005); + padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs); + } + + button.local-no-balance { + border-radius: 0px; + border: none; + background: transparent; + } + + wui-avatar { + width: 20px; + height: 20px; + box-shadow: 0 0 0 2px var(--wui-accent-glass-010); + } + + @media (max-width: 500px) { + button { + gap: 0px; + padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important; + height: 32px; + } + wui-image, + wui-icon-box, + button > wui-text { + visibility: hidden; + width: 0px; + height: 0px; + } + button { + border-radius: 0px; + border: none; + background: transparent; + padding: 0px; + } + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled > wui-flex > wui-text { + color: var(--wui-color-fg-175); + } + + button:active:enabled > wui-flex > wui-text { + color: var(--wui-color-fg-175); + } + } +`;var Pi=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Zt=class extends oe{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.isProfileName=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return z` + + `}balanceTemplate(){if(this.isUnsupportedChain)return z` + Switch Network`;if(this.balance){const e=this.networkSrc?z``:z` + + `;return z` + ${e} + ${this.balance} + `}return null}};Zt.styles=[ue,Oe,Bw];Pi([C()],Zt.prototype,"networkSrc",void 0);Pi([C()],Zt.prototype,"avatarSrc",void 0);Pi([C()],Zt.prototype,"balance",void 0);Pi([C({type:Boolean})],Zt.prototype,"isUnsupportedChain",void 0);Pi([C({type:Boolean})],Zt.prototype,"disabled",void 0);Pi([C({type:Boolean})],Zt.prototype,"isProfileName",void 0);Pi([C()],Zt.prototype,"address",void 0);Pi([C()],Zt.prototype,"profileName",void 0);Pi([C()],Zt.prototype,"charsStart",void 0);Pi([C()],Zt.prototype,"charsEnd",void 0);Zt=Pi([V("wui-account-button")],Zt);const Uw=ne` + :host { + position: relative; + background-color: var(--wui-gray-glass-002); + display: flex; + justify-content: center; + align-items: center; + width: var(--local-size); + height: var(--local-size); + border-radius: inherit; + border-radius: var(--local-border-radius); + } + + :host > wui-flex { + overflow: hidden; + border-radius: inherit; + border-radius: var(--local-border-radius); + } + + :host::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-gray-glass-010); + pointer-events: none; + } + + :host([name='Extension'])::after { + border: 1px solid var(--wui-accent-glass-010); + } + + :host([data-wallet-icon='allWallets']) { + background-color: var(--wui-all-wallets-bg-100); + } + + :host([data-wallet-icon='allWallets'])::after { + border: 1px solid var(--wui-accent-glass-010); + } + + wui-icon[data-parent-size='inherit'] { + width: 75%; + height: 75%; + align-items: center; + } + + wui-icon[data-parent-size='sm'] { + width: 18px; + height: 18px; + } + + wui-icon[data-parent-size='md'] { + width: 24px; + height: 24px; + } + + wui-icon[data-parent-size='lg'] { + width: 42px; + height: 42px; + } + + wui-icon[data-parent-size='full'] { + width: 100%; + height: 100%; + } + + :host > wui-icon-box { + position: absolute; + overflow: hidden; + right: -1px; + bottom: -2px; + z-index: 1; + border: 2px solid var(--wui-color-bg-base-150, #1e1f1f); + padding: 1px; + } +`;var Hr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Wi=class extends oe{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=` + --local-border-radius: var(--wui-border-radius-${e}); + --local-size: var(--wui-wallet-image-size-${this.size}); + `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),z` + ${this.templateVisual()} + `}templateVisual(){return this.imageSrc?z``:this.walletIcon?z``:z``}};Wi.styles=[ue,Uw];Hr([C()],Wi.prototype,"size",void 0);Hr([C()],Wi.prototype,"name",void 0);Hr([C()],Wi.prototype,"imageSrc",void 0);Hr([C()],Wi.prototype,"walletIcon",void 0);Hr([C({type:Boolean})],Wi.prototype,"installed",void 0);Hr([C()],Wi.prototype,"badgeSize",void 0);Wi=Hr([V("wui-wallet-image")],Wi);const jw=ne` + :host { + position: relative; + border-radius: var(--wui-border-radius-xxs); + width: 40px; + height: 40px; + overflow: hidden; + background: var(--wui-gray-glass-002); + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; + gap: var(--wui-spacing-4xs); + padding: 3.75px !important; + } + + :host::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-gray-glass-010); + pointer-events: none; + } + + :host > wui-wallet-image { + width: 14px; + height: 14px; + border-radius: var(--wui-border-radius-5xs); + } + + :host > wui-flex { + padding: 2px; + position: fixed; + overflow: hidden; + left: 34px; + bottom: 8px; + background: var(--dark-background-150, #1e1f1f); + border-radius: 50%; + z-index: 2; + display: flex; + } +`;var e1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const Qc=4;let hs=class extends oe{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.lengthz` + + `)} + ${e?[...Array(Qc-this.walletImages.length)].map(()=>z` `):null} + + + `}};hs.styles=[ue,jw];e1([C({type:Array})],hs.prototype,"walletImages",void 0);hs=e1([V("wui-all-wallets-image")],hs);const Ww=ne` + :host { + width: var(--local-width); + position: relative; + } + + button { + border: 1px solid var(--wui-gray-glass-010); + border-radius: var(--local-border-radius); + width: var(--local-width); + white-space: nowrap; + } + + button:disabled { + border: 1px solid var(--wui-gray-glass-010); + } + + /* xs settings */ + button[data-size='xs'] { + padding: var(--wui-spacing-xs) var(--wui-spacing-1xs); + } + + button[data-size='xs'][data-icon-left='true'][data-icon-right='false'] { + padding-left: var(--wui-spacing-xxs); + } + + button[data-size='xs'][data-icon-right='true'][data-icon-left='false'] { + padding-right: var(--wui-spacing-xxs); + } + + /* sm settings */ + button[data-size='sm'] { + padding: var(--wui-spacing-xxs) var(--wui-spacing-s); + } + + button[data-size='sm'][data-icon-left='true'][data-icon-right='false'] { + padding: var(--wui-spacing-xxs) var(--wui-spacing-s) var(--wui-spacing-xxs) + var(--wui-spacing-xs); + } + + button[data-size='sm'][data-icon-right='true'][data-icon-left='false'] { + padding: var(--wui-spacing-xxs) var(--wui-spacing-xs) var(--wui-spacing-xxs) + var(--wui-spacing-s); + } + + /* md settings */ + button[data-size='md'] { + padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l); + } + + button[data-size='md'][data-icon-left='true'][data-icon-right='false'] { + padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s); + } + + button[data-size='md'][data-icon-right='true'][data-icon-left='false'] { + padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l); + } + + /* lg settings */ + button[data-size='lg'] { + padding: var(--wui-spacing-m) var(--wui-spacing-2l); + } + + button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] { + padding-left: var(--wui-spacing-m); + } + + button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] { + padding-right: var(--wui-spacing-m); + } + + button > wui-text { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + ::slotted(*) { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + wui-loading-spinner { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + opacity: var(--local-opacity-000); + } +`;var Xi=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const zw={xs:"small-600",sm:"paragraph-600",md:"small-600",mdl:"small-600",lg:"paragraph-600"};let Qt=class extends oe{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="fill",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=` + --local-width: ${this.fullWidth?"100%":"auto"}; + --local-opacity-100: ${this.loading?0:1}; + --local-opacity-000: ${this.loading?1:0}; + --local-border-radius: var(--wui-border-radius-${this.borderRadius}); + `;const e=this.textVariant??zw[this.size];return z` + + `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){return this.loading?z``:z``}};Qt.styles=[ue,Oe,Ww];Xi([C()],Qt.prototype,"size",void 0);Xi([C({type:Boolean})],Qt.prototype,"disabled",void 0);Xi([C({type:Boolean})],Qt.prototype,"fullWidth",void 0);Xi([C({type:Boolean})],Qt.prototype,"loading",void 0);Xi([C()],Qt.prototype,"variant",void 0);Xi([C({type:Boolean})],Qt.prototype,"hasIconLeft",void 0);Xi([C({type:Boolean})],Qt.prototype,"hasIconRight",void 0);Xi([C()],Qt.prototype,"borderRadius",void 0);Xi([C()],Qt.prototype,"textVariant",void 0);Qt=Xi([V("wui-button")],Qt);const t1=J` + +`,Fw=ne` + :host { + display: flex; + flex-direction: column; + align-items: center; + width: 76px; + row-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xs) 10px; + background-color: var(--wui-gray-glass-002); + border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); + position: relative; + } + + wui-shimmer[data-type='network'] { + border: none; + -webkit-clip-path: var(--wui-path-network); + clip-path: var(--wui-path-network); + } + + svg { + position: absolute; + width: 48px; + height: 54px; + z-index: 1; + } + + svg > path { + stroke: var(--wui-gray-glass-010); + stroke-width: 1px; + } +`;var i1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ps=class extends oe{constructor(){super(...arguments),this.type="wallet"}render(){return z` + ${this.shimmerTemplate()} + + `}shimmerTemplate(){return this.type==="network"?z` + ${t1}`:z``}};ps.styles=[ue,Oe,Fw];i1([C()],ps.prototype,"type",void 0);ps=i1([V("wui-card-select-loader")],ps);const Hw=J` + + + +`,Vw=J` + +`,Zw=ne` + :host { + position: relative; + border-radius: inherit; + display: flex; + justify-content: center; + align-items: center; + width: var(--local-width); + height: var(--local-height); + } + + svg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; + fill: var(--wui-gray-glass-002); + } + + svg > path { + stroke: var(--local-stroke); + } + + wui-image { + width: 100%; + height: 100%; + -webkit-clip-path: var(--local-path); + clip-path: var(--local-path); + background: var(--wui-gray-glass-002); + } + + wui-icon { + transform: translateY(-5%); + width: var(--local-icon-size); + height: var(--local-icon-size); + } +`;var Fs=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let jn=class extends oe{constructor(){super(...arguments),this.size="md",this.name="uknown",this.selected=!1}render(){const e={sm:Hw,md:t1,lg:Vw};return this.style.cssText=` + --local-stroke: ${this.selected?"var(--wui-color-accent-100)":"var(--wui-gray-glass-010)"}; + --local-path: var(--wui-path-network-${this.size}); + --local-width: var(--wui-width-network-${this.size}); + --local-height: var(--wui-height-network-${this.size}); + --local-icon-size: var(--wui-icon-size-network-${this.size}); + `,z`${this.templateVisual()} ${e[this.size]}`}templateVisual(){return this.imageSrc?z``:z``}};jn.styles=[ue,Zw];Fs([C()],jn.prototype,"size",void 0);Fs([C()],jn.prototype,"name",void 0);Fs([C()],jn.prototype,"imageSrc",void 0);Fs([C({type:Boolean})],jn.prototype,"selected",void 0);jn=Fs([V("wui-network-image")],jn);const Gw=ne` + button { + flex-direction: column; + width: 76px; + row-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xs) var(--wui-spacing-0); + background-color: var(--wui-gray-glass-002); + border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); + } + + button > wui-text { + color: var(--wui-color-fg-100); + max-width: var(--wui-icon-box-size-xl); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + justify-content: center; + } + + button:disabled > wui-text { + color: var(--wui-gray-glass-015); + } + + [data-selected='true'] { + background-color: var(--wui-accent-glass-020); + } + + @media (hover: hover) and (pointer: fine) { + [data-selected='true']:hover:enabled { + background-color: var(--wui-accent-glass-015); + } + } + + [data-selected='true']:active:enabled { + background-color: var(--wui-accent-glass-010); + } +`;var Vr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let zi=class extends oe{constructor(){super(...arguments),this.name="Unknown",this.type="wallet",this.imageSrc=void 0,this.disabled=!1,this.selected=!1,this.installed=!1}render(){return z` + + `}imageTemplate(){return this.type==="network"?z` + + + `:z` + + + `}};zi.styles=[ue,Oe,Gw];Vr([C()],zi.prototype,"name",void 0);Vr([C()],zi.prototype,"type",void 0);Vr([C()],zi.prototype,"imageSrc",void 0);Vr([C({type:Boolean})],zi.prototype,"disabled",void 0);Vr([C({type:Boolean})],zi.prototype,"selected",void 0);Vr([C({type:Boolean})],zi.prototype,"installed",void 0);zi=Vr([V("wui-card-select")],zi);const qw=ne` + a { + border: 1px solid var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-3xl); + } + + wui-image { + border-radius: var(--wui-border-radius-3xl); + overflow: hidden; + } + + a.disabled > wui-icon, + a.disabled > wui-image { + filter: grayscale(1); + } + + a[data-variant='fill'] { + color: var(--wui-color-inverse-100); + background-color: var(--wui-color-accent-100); + } + + a[data-variant='shade'], + a[data-variant='shadeSmall'] { + background-color: transparent; + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-200); + } + + a[data-variant='success'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-success-glass-010); + background-color: var(--wui-success-glass-010); + color: var(--wui-color-success-100); + } + + a[data-variant='error'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-error-glass-010); + background-color: var(--wui-error-glass-010); + color: var(--wui-color-error-100); + } + + a[data-variant='transparent'] { + column-gap: var(--wui-spacing-xxs); + background-color: transparent; + color: var(--wui-color-fg-150); + } + + a[data-variant='transparent'], + a[data-variant='success'], + a[data-variant='shadeSmall'], + a[data-variant='error'] { + padding: 7px var(--wui-spacing-s) 7px 10px; + } + + a[data-variant='transparent']:has(wui-text:first-child), + a[data-variant='success']:has(wui-text:first-child), + a[data-variant='shadeSmall']:has(wui-text:first-child), + a[data-variant='error']:has(wui-text:first-child) { + padding: 7px var(--wui-spacing-s); + } + + a[data-variant='fill'], + a[data-variant='shade'] { + column-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) + var(--wui-spacing-xs); + } + + a[data-variant='fill']:has(wui-text:first-child), + a[data-variant='shade']:has(wui-text:first-child) { + padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); + } + + a[data-variant='fill'] > wui-image, + a[data-variant='shade'] > wui-image { + width: 24px; + height: 24px; + } + + a[data-variant='fill'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); + } + + a[data-variant='shade'] > wui-image, + a[data-variant='shadeSmall'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } + + a[data-variant='fill'] > wui-icon, + a[data-variant='shade'] > wui-icon { + width: 14px; + height: 14px; + } + + a[data-variant='transparent'] > wui-image, + a[data-variant='success'] > wui-image, + a[data-variant='shadeSmall'] > wui-image, + a[data-variant='error'] > wui-image { + width: 14px; + height: 14px; + } + + a[data-variant='transparent'] > wui-icon, + a[data-variant='success'] > wui-icon, + a[data-variant='shadeSmall'] > wui-icon, + a[data-variant='error'] > wui-icon { + width: 12px; + height: 12px; + } + + a[data-variant='fill']:focus-visible { + background-color: var(--wui-color-accent-090); + } + + a[data-variant='shade']:focus-visible, + a[data-variant='shadeSmall']:focus-visible { + background-color: var(--wui-gray-glass-015); + } + + a[data-variant='transparent']:focus-visible { + background-color: var(--wui-gray-glass-005); + } + + a[data-variant='success']:focus-visible { + background-color: var(--wui-success-glass-015); + } + + a[data-variant='error']:focus-visible { + background-color: var(--wui-error-glass-015); + } + + a.disabled { + color: var(--wui-gray-glass-015); + background-color: var(--wui-gray-glass-015); + pointer-events: none; + } + + @media (hover: hover) and (pointer: fine) { + a[data-variant='fill']:hover { + background-color: var(--wui-color-accent-090); + } + + a[data-variant='shade']:hover, + a[data-variant='shadeSmall']:hover { + background-color: var(--wui-gray-glass-015); + } + + a[data-variant='transparent']:hover { + background-color: var(--wui-gray-glass-005); + } + + a[data-variant='success']:hover { + background-color: var(--wui-success-glass-015); + } + + a[data-variant='error']:hover { + background-color: var(--wui-error-glass-015); + } + } + + a[data-variant='fill']:active { + background-color: var(--wui-color-accent-080); + } + + a[data-variant='shade']:active, + a[data-variant='shadeSmall']:active { + background-color: var(--wui-gray-glass-020); + } + + a[data-variant='transparent']:active { + background-color: var(--wui-gray-glass-010); + } + + a[data-variant='success']:active { + background-color: var(--wui-success-glass-020); + } + + a[data-variant='error']:active { + background-color: var(--wui-error-glass-020); + } +`;var Zr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Fi=class extends oe{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){const t=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return z` + + ${this.imageTemplate()} + + ${this.title?this.title:ve.getHostName(this.href)} + + + + `}imageTemplate(){return this.imageSrc?z``:null}};Fi.styles=[ue,Oe,qw];Zr([C()],Fi.prototype,"variant",void 0);Zr([C()],Fi.prototype,"imageSrc",void 0);Zr([C({type:Boolean})],Fi.prototype,"disabled",void 0);Zr([C()],Fi.prototype,"icon",void 0);Zr([C()],Fi.prototype,"href",void 0);Zr([C()],Fi.prototype,"text",void 0);Fi=Zr([V("wui-chip")],Fi);const Yw=ne` + :host { + position: relative; + display: block; + } + + button { + background: var(--wui-color-accent-100); + border: 1px solid var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-m); + gap: var(--wui-spacing-xs); + } + + button.loading { + background: var(--wui-gray-glass-010); + border: 1px solid var(--wui-gray-glass-010); + pointer-events: none; + } + + button:disabled { + background-color: var(--wui-gray-glass-015); + border: 1px solid var(--wui-gray-glass-010); + } + + button:disabled > wui-text { + color: var(--wui-gray-glass-015); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-accent-090); + } + + button:active:enabled { + background-color: var(--wui-color-accent-080); + } + } + + button:focus-visible { + border: 1px solid var(--wui-gray-glass-010); + background-color: var(--wui-color-accent-090); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + button[data-size='sm'] { + padding: 6.75px 10px 7.25px; + } + + ::slotted(*) { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + button > wui-text { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + color: var(--wui-color-inverse-100); + } + + button[data-size='md'] { + padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l); + } + + button[data-size='md'] + wui-text { + padding-left: var(--wui-spacing-3xs); + } + + @media (max-width: 500px) { + button[data-size='md'] { + height: 32px; + padding: 5px 12px; + } + + button[data-size='md'] > wui-text > slot { + font-size: 14px !important; + } + } + + wui-loading-spinner { + width: 14px; + height: 14px; + } + + wui-loading-spinner::slotted(svg) { + width: 10px !important; + height: 10px !important; + } + + button[data-size='sm'] > wui-loading-spinner { + width: 12px; + height: 12px; + } +`;var du=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let go=class extends oe{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){const e=this.size==="md"?"paragraph-600":"small-600";return z` + + `}loadingTemplate(){return this.loading?z``:null}};go.styles=[ue,Oe,Yw];du([C()],go.prototype,"size",void 0);du([C({type:Boolean})],go.prototype,"loading",void 0);go=du([V("wui-connect-button")],go);const Kw=ne` + wui-flex { + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } +`;var pc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let _r=class extends oe{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return z` + + ${this.label} + + ${this.buttonLabel} + + + + `}};_r.styles=[ue,Oe,Kw];pc([C({type:Boolean})],_r.prototype,"disabled",void 0);pc([C()],_r.prototype,"label",void 0);pc([C()],_r.prototype,"buttonLabel",void 0);_r=pc([V("wui-cta-button")],_r);const Jw=ne` + :host { + display: block; + padding: var(--wui-spacing-l) var(--wui-spacing-m); + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + width: 100%; + } +`;var Xw=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Aa=class extends oe{render(){return z` + + + + `}};Aa.styles=[ue,Oe,Jw];Aa=Xw([V("wui-details-group")],Aa);const Qw=ne` + :host { + display: flex; + flex-direction: row; + gap: var(--wui-spacing-l); + width: 100%; + border-radius: var(--wui-border-radius-xs); + } +`;var n1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let fs=class extends oe{constructor(){super(...arguments),this.name=""}render(){return z` + + ${this.name} + + + + + `}};fs.styles=[ue,Oe,Qw];n1([C()],fs.prototype,"name",void 0);fs=n1([V("wui-details-group-item")],fs);/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const em=i=>i.strings===void 0;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ns=(i,e)=>{var r;const t=i._$AN;if(t===void 0)return!1;for(const o of t)(r=o._$AO)==null||r.call(o,e,!1),ns(o,e);return!0},Sa=i=>{let e,t;do{if((e=i._$AM)===void 0)break;t=e._$AN,t.delete(i),i=e}while((t==null?void 0:t.size)===0)},r1=i=>{for(let e;e=i._$AM;i=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(i))break;t.add(i),nm(e)}};function tm(i){this._$AN!==void 0?(Sa(this),this._$AM=i,r1(this)):this._$AM=i}function im(i,e=!1,t=0){const r=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(r))for(let n=t;n{i.type==J0.CHILD&&(i._$AP??(i._$AP=im),i._$AQ??(i._$AQ=tm))};let rm=class extends Q0{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),r1(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,o;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(o=this.disconnected)==null||o.call(this)),t&&(ns(this,e),Sa(this))}setValue(e){if(em(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const hu=()=>new om;let om=class{};const el=new WeakMap,pu=X0(class extends rm{render(i){return lt}update(i,[e]){var r;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(r=i.options)==null?void 0:r.host,this.rt(this.ct=i.element)),lt}rt(i){if(typeof this.Y=="function"){const e=this.ht??globalThis;let t=el.get(e);t===void 0&&(t=new WeakMap,el.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,e;return typeof this.Y=="function"?(i=el.get(this.ht??globalThis))==null?void 0:i.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),sm=ne` + :host { + position: relative; + width: 100%; + display: inline-block; + color: var(--wui-color-fg-275); + } + + input { + width: 100%; + border-radius: var(--wui-border-radius-xs); + border: 1px solid var(--wui-gray-glass-005); + background: var(--wui-gray-glass-005); + font-size: var(--wui-font-size-paragraph); + font-weight: var(--wui-font-weight-light); + letter-spacing: var(--wui-letter-spacing-paragraph); + color: var(--wui-color-fg-100); + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, border-color, box-shadow; + caret-color: var(--wui-color-accent-100); + } + + input:disabled { + cursor: not-allowed; + border: 1px solid var(--wui-gray-glass-010); + } + + input:disabled::placeholder, + input:disabled + wui-icon { + color: var(--wui-color-fg-300); + } + + input::placeholder { + color: var(--wui-color-fg-275); + } + + input:focus:enabled { + background-color: var(--wui-gray-glass-010); + border: 1px solid var(--wui-color-accent-100); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + input:hover:enabled { + background-color: var(--wui-gray-glass-010); + } + + wui-icon { + position: absolute; + top: 50%; + transform: translateY(-50%); + pointer-events: none; + } + + .wui-size-sm { + padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s); + } + + wui-icon + .wui-size-sm { + padding: 9px var(--wui-spacing-m) 10px 36px; + } + + wui-icon[data-input='sm'] { + left: var(--wui-spacing-s); + } + + .wui-size-md { + padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m); + } + + wui-icon + .wui-size-md, + wui-loading-spinner + .wui-size-md { + padding: 10.5px var(--wui-spacing-3xl) 10.5px 40px; + } + + wui-icon[data-input='md'] { + left: var(--wui-spacing-l); + } + + .wui-size-lg { + padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l); + letter-spacing: var(--wui-letter-spacing-medium-title); + font-size: var(--wui-font-size-medium-title); + font-weight: var(--wui-font-weight-light); + line-height: 130%; + color: var(--wui-color-fg-100); + height: 64px; + } + + wui-icon + .wui-size-lg, + wui-loading-spinner + .wui-size-lg { + padding-left: 50px; + } + + wui-icon[data-input='lg'] { + left: var(--wui-spacing-l); + } + + input:placeholder-shown ~ ::slotted(wui-input-element), + input:placeholder-shown ~ ::slotted(wui-icon) { + opacity: 0; + pointer-events: none; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input[type='number'] { + -moz-appearance: textfield; + } + + ::slotted(wui-input-element), + ::slotted(wui-icon) { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + + ::slotted(wui-input-element) { + right: var(--wui-spacing-m); + } + + ::slotted(wui-icon) { + right: 0px; + } +`;var Kn=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Si=class extends oe{constructor(){super(...arguments),this.inputElementRef=hu(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){const e=`wui-size-${this.size}`;return z` ${this.templateIcon()} + + `}templateIcon(){return this.icon?z``:null}dispatchInputChangeEvent(){var e;this.dispatchEvent(new CustomEvent("inputChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.value,bubbles:!0,composed:!0}))}};Si.styles=[ue,Oe,sm];Kn([C()],Si.prototype,"size",void 0);Kn([C()],Si.prototype,"icon",void 0);Kn([C({type:Boolean})],Si.prototype,"disabled",void 0);Kn([C()],Si.prototype,"placeholder",void 0);Kn([C()],Si.prototype,"type",void 0);Kn([C()],Si.prototype,"keyHint",void 0);Kn([C()],Si.prototype,"value",void 0);Si=Kn([V("wui-input-text")],Si);const am=ne` + :host { + position: relative; + display: inline-block; + } + + wui-text { + margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); + } +`;var fc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Er=class extends oe{constructor(){super(...arguments),this.disabled=!1}render(){return z` + + ${this.templateError()} + `}templateError(){return this.errorMessage?z`${this.errorMessage}`:null}};Er.styles=[ue,am];fc([C()],Er.prototype,"errorMessage",void 0);fc([C({type:Boolean})],Er.prototype,"disabled",void 0);fc([C()],Er.prototype,"value",void 0);Er=fc([V("wui-email-input")],Er);const cm=ne` + button { + border-radius: var(--local-border-radius); + color: var(--wui-color-fg-100); + padding: var(--local-padding); + } + + @media (max-width: 700px) { + button { + padding: var(--wui-spacing-s); + } + } + + button > wui-icon { + pointer-events: none; + } + + button:disabled > wui-icon { + color: var(--wui-color-bg-300) !important; + } + + button:disabled { + background-color: transparent; + } +`;var Hs=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Wn=class extends oe{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){const e=this.size==="lg"?"--wui-border-radius-xs":"--wui-border-radius-xxs",t=this.size==="lg"?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=` + --local-border-radius: var(${e}); + --local-padding: var(${t}); +`,z` + + `}};Wn.styles=[ue,Oe,au,cm];Hs([C()],Wn.prototype,"size",void 0);Hs([C({type:Boolean})],Wn.prototype,"disabled",void 0);Hs([C()],Wn.prototype,"icon",void 0);Hs([C()],Wn.prototype,"iconColor",void 0);Wn=Hs([V("wui-icon-link")],Wn);const lm=ne` + button { + background-color: var(--wui-color-fg-300); + border-radius: var(--wui-border-radius-4xs); + width: 16px; + height: 16px; + } + + button:disabled { + background-color: var(--wui-color-bg-300); + } + + wui-icon { + color: var(--wui-color-bg-200) !important; + } + + button:focus-visible { + background-color: var(--wui-color-fg-250); + border: 1px solid var(--wui-color-accent-100); + } + + button:active:enabled { + background-color: var(--wui-color-fg-225); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-fg-250); + } + } +`;var o1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let gs=class extends oe{constructor(){super(...arguments),this.icon="copy"}render(){return z` + + `}};gs.styles=[ue,Oe,lm];o1([C()],gs.prototype,"icon",void 0);gs=o1([V("wui-input-element")],gs);const um=ne` + :host { + position: relative; + display: inline-block; + } + + input { + width: 50px; + height: 50px; + background: var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-xs); + border: 1px solid var(--wui-gray-glass-005); + font-family: var(--wui-font-family); + font-size: var(--wui-font-size-large); + font-weight: var(--wui-font-weight-regular); + letter-spacing: var(--wui-letter-spacing-large); + text-align: center; + color: var(--wui-color-fg-100); + caret-color: var(--wui-color-accent-100); + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, border-color, box-shadow; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input[type='number'] { + -moz-appearance: textfield; + } + + input:disabled { + cursor: not-allowed; + border: 1px solid var(--wui-gray-glass-010); + background: var(--wui-gray-glass-005); + } + + input:focus:enabled { + background-color: var(--wui-gray-glass-015); + border: 1px solid var(--wui-color-accent-100); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + @media (hover: hover) and (pointer: fine) { + input:hover:enabled { + background-color: var(--wui-gray-glass-015); + } + } +`;var fu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let wo=class extends oe{constructor(){super(...arguments),this.disabled=!1,this.value=""}render(){return z` `}};wo.styles=[ue,Oe,um];fu([C({type:Boolean})],wo.prototype,"disabled",void 0);fu([C({type:String})],wo.prototype,"value",void 0);wo=fu([V("wui-input-numeric")],wo);const dm=ne` + button { + padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); + border-radius: var(--wui-border-radius-3xs); + background-color: transparent; + color: var(--wui-color-accent-100); + } + + button:disabled { + background-color: transparent; + color: var(--wui-gray-glass-015); + } +`;var gu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let mo=class extends oe{constructor(){super(...arguments),this.disabled=!1,this.color="inherit"}render(){return z` + + `}};mo.styles=[ue,Oe,dm];gu([C({type:Boolean})],mo.prototype,"disabled",void 0);gu([C()],mo.prototype,"color",void 0);mo=gu([V("wui-link")],mo);const hm=ne` + button { + column-gap: var(--wui-spacing-s); + padding: 11px 18px 11px var(--wui-spacing-s); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + transition: + color var(--wui-ease-out-power-1) var(--wui-duration-md), + background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: color, background-color; + } + + button[data-iconvariant='square'], + button[data-iconvariant='square-blue'] { + padding: 6px 18px 6px 9px; + } + + button > wui-flex { + flex: 1; + } + + button > wui-image { + width: 32px; + height: 32px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + border-radius: var(--wui-border-radius-3xl); + } + + button > wui-icon { + width: 36px; + height: 36px; + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + } + + button > wui-icon-box[data-variant='blue'] { + box-shadow: 0 0 0 2px var(--wui-accent-glass-005); + } + + button > wui-icon-box[data-variant='overlay'] { + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } + + button > wui-icon-box[data-variant='square-blue'] { + border-radius: var(--wui-border-radius-3xs); + position: relative; + border: none; + width: 36px; + height: 36px; + } + + button > wui-icon-box[data-variant='square-blue']::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-accent-glass-010); + pointer-events: none; + } + + button > wui-icon:last-child { + width: 14px; + height: 14px; + } + + button:disabled { + background-color: var(--wui-gray-glass-015); + color: var(--wui-gray-glass-015); + } + + button[data-loading='true'] > wui-icon { + opacity: 0; + } + + wui-loading-spinner { + position: absolute; + right: 18px; + top: 50%; + transform: translateY(-50%); + } +`;var Qi=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ei=class extends oe{constructor(){super(...arguments),this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return z` + + `}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return z``;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return z``;if(this.variant==="icon"&&this.icon&&this.iconVariant){const e=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",t=this.iconVariant==="square-blue"?"mdl":"md",r=this.iconSize?this.iconSize:t;return z` + + `}return null}loadingTemplate(){return this.loading?z``:z``}chevronTemplate(){return this.chevron?z``:null}};ei.styles=[ue,Oe,hm];Qi([C()],ei.prototype,"icon",void 0);Qi([C()],ei.prototype,"iconSize",void 0);Qi([C()],ei.prototype,"variant",void 0);Qi([C()],ei.prototype,"iconVariant",void 0);Qi([C({type:Boolean})],ei.prototype,"disabled",void 0);Qi([C()],ei.prototype,"imageSrc",void 0);Qi([C()],ei.prototype,"alt",void 0);Qi([C({type:Boolean})],ei.prototype,"chevron",void 0);Qi([C({type:Boolean})],ei.prototype,"loading",void 0);ei=Qi([V("wui-list-item")],ei);var yl;(function(i){i.approve="approved",i.bought="bought",i.borrow="borrowed",i.burn="burnt",i.cancel="canceled",i.claim="claimed",i.deploy="deployed",i.deposit="deposited",i.execute="executed",i.mint="minted",i.receive="received",i.repay="repaid",i.send="sent",i.sell="sold",i.stake="staked",i.trade="swapped",i.unstake="unstaked",i.withdraw="withdrawn"})(yl||(yl={}));const pm=ne` + :host > wui-flex { + display: flex; + justify-content: center; + align-items: center; + position: relative; + width: 40px; + height: 40px; + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + background-color: var(--wui-gray-glass-005); + } + + :host > wui-flex wui-image { + display: block; + } + + :host > wui-flex, + :host > wui-flex wui-image, + .swap-images-container, + .swap-images-container.nft, + wui-image.nft { + border-top-left-radius: var(--local-left-border-radius); + border-top-right-radius: var(--local-right-border-radius); + border-bottom-left-radius: var(--local-left-border-radius); + border-bottom-right-radius: var(--local-right-border-radius); + } + + wui-icon { + width: 20px; + height: 20px; + } + + wui-icon-box { + position: absolute; + right: 0; + bottom: 0; + transform: translate(20%, 20%); + } + + .swap-images-container { + position: relative; + width: 40px; + height: 40px; + overflow: hidden; + } + + .swap-images-container wui-image:first-child { + position: absolute; + width: 40px; + height: 40px; + top: 0; + left: 0%; + clip-path: inset(0px calc(50% + 2px) 0px 0%); + } + + .swap-images-container wui-image:last-child { + clip-path: inset(0px 0px 0px calc(50% + 2px)); + } +`;var Gr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Hi=class extends oe{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){const[e,t]=this.images,r=(e==null?void 0:e.type)==="NFT",o=t!=null&&t.url?t.type==="NFT":r,n=r?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)",s=o?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)";return this.style.cssText=` + --local-left-border-radius: ${n}; + --local-right-border-radius: ${s}; + `,z` ${this.templateVisual()} ${this.templateIcon()} `}templateVisual(){const[e,t]=this.images,r=e==null?void 0:e.type;return this.images.length===2&&(e!=null&&e.url||t!=null&&t.url)?z`
+ ${e!=null&&e.url?z``:null} + ${t!=null&&t.url?z``:null} +
`:e!=null&&e.url?z``:r==="NFT"?z``:z``}templateIcon(){let e="accent-100",t;return t=this.getIcon(),this.status&&(e=this.getStatusColor()),t?z` + + `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};Hi.styles=[pm];Gr([C()],Hi.prototype,"type",void 0);Gr([C()],Hi.prototype,"status",void 0);Gr([C()],Hi.prototype,"direction",void 0);Gr([C({type:Boolean})],Hi.prototype,"onlyDirectionIcon",void 0);Gr([C({type:Array})],Hi.prototype,"images",void 0);Gr([C({type:Object})],Hi.prototype,"secondImage",void 0);Hi=Gr([V("wui-transaction-visual")],Hi);const fm=ne` + :host > wui-flex:first-child { + align-items: center; + column-gap: var(--wui-spacing-s); + padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs); + width: 100%; + } + + :host > wui-flex:first-child wui-text:nth-child(1) { + text-transform: capitalize; + } + + wui-transaction-visual { + width: 40px; + height: 40px; + } + + wui-flex { + flex: 1; + } + + :host wui-flex wui-flex { + overflow: hidden; + } + + :host .description-container wui-text span { + word-break: break-all; + } + + :host .description-container wui-text { + overflow: hidden; + } + + :host .description-separator-icon { + margin: 0px 6px; + } + + :host wui-text > span { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + } +`;var Ni=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Gt=class extends oe{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return z` + + + + + ${yl[this.type]||this.type} + + + ${this.templateDescription()} ${this.templateSecondDescription()} + + + ${this.date} + + `}templateDescription(){var t;const e=(t=this.descriptions)==null?void 0:t[0];return e?z` + + ${e} + + `:null}templateSecondDescription(){var t;const e=(t=this.descriptions)==null?void 0:t[1];return e?z` + + + ${e} + + `:null}};Gt.styles=[ue,fm];Ni([C()],Gt.prototype,"type",void 0);Ni([C({type:Array})],Gt.prototype,"descriptions",void 0);Ni([C()],Gt.prototype,"date",void 0);Ni([C({type:Boolean})],Gt.prototype,"onlyDirectionIcon",void 0);Ni([C()],Gt.prototype,"status",void 0);Ni([C()],Gt.prototype,"direction",void 0);Ni([C({type:Array})],Gt.prototype,"images",void 0);Ni([C({type:Array})],Gt.prototype,"price",void 0);Ni([C({type:Array})],Gt.prototype,"amount",void 0);Ni([C({type:Array})],Gt.prototype,"symbol",void 0);Gt=Ni([V("wui-transaction-list-item")],Gt);const gm=ne` + :host > wui-flex:first-child { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + } + + wui-flex { + display: flex; + flex: 1; + } +`;var wm=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ka=class extends oe{render(){return z` + + + + + + + + + `}};ka.styles=[ue,gm];ka=wm([V("wui-transaction-list-item-loader")],ka);const mm=ne` + :host { + display: flex; + justify-content: center; + align-items: center; + height: var(--wui-spacing-m); + padding: 0 var(--wui-spacing-3xs) !important; + border-radius: var(--wui-border-radius-5xs); + } + + :host > wui-text { + transform: translateY(5%); + } + + :host([data-variant='main']) { + background-color: var(--wui-accent-glass-015); + color: var(--wui-color-accent-100); + } + + :host([data-variant='shade']) { + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-200); + } + + :host([data-variant='success']) { + background-color: var(--wui-icon-box-bg-success-100); + color: var(--wui-color-success-100); + } + + :host([data-variant='error']) { + background-color: var(--wui-icon-box-bg-error-100); + color: var(--wui-color-error-100); + } + + :host([data-size='lg']) { + padding: 9px 5px !important; + } + + :host([data-size='lg']) > wui-text { + transform: translateY(2%); + } +`;var wu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let vo=class extends oe{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const e=this.size==="md"?"mini-700":"micro-700";return z` + + + + `}};vo.styles=[ue,mm];wu([C()],vo.prototype,"variant",void 0);wu([C()],vo.prototype,"size",void 0);vo=wu([V("wui-tag")],vo);const vm=ne` + button { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-100); + } + + button > wui-text:nth-child(2) { + display: flex; + flex: 1; + } + + wui-icon { + color: var(--wui-color-fg-200) !important; + } + + button:disabled { + background-color: var(--wui-gray-glass-015); + color: var(--wui-gray-glass-015); + } + + button:disabled > wui-tag { + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-300); + } +`;var Di=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let qt=class extends oe{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.installed=!1,this.disabled=!1,this.showAllWallets=!1}render(){return z` + + `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?z` `:this.showAllWallets&&this.walletIcon?z` `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?z``:!this.showAllWallets&&!this.imageSrc?z``:null}templateStatus(){return this.tagLabel&&this.tagVariant?z`${this.tagLabel}`:this.icon?z``:null}};qt.styles=[ue,Oe,vm];Di([C({type:Array})],qt.prototype,"walletImages",void 0);Di([C()],qt.prototype,"imageSrc",void 0);Di([C()],qt.prototype,"name",void 0);Di([C()],qt.prototype,"tagLabel",void 0);Di([C()],qt.prototype,"tagVariant",void 0);Di([C()],qt.prototype,"icon",void 0);Di([C()],qt.prototype,"walletIcon",void 0);Di([C({type:Boolean})],qt.prototype,"installed",void 0);Di([C({type:Boolean})],qt.prototype,"disabled",void 0);Di([C({type:Boolean})],qt.prototype,"showAllWallets",void 0);qt=Di([V("wui-list-wallet")],qt);const bm=ne` + :host { + display: block; + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-010); + overflow: hidden; + } + + wui-icon { + width: 100%; + height: 100%; + } +`;var s1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ws=class extends oe{constructor(){super(...arguments),this.logo="google"}render(){return z` `}};ws.styles=[ue,bm];s1([C()],ws.prototype,"logo",void 0);ws=s1([V("wui-logo")],ws);const ym=ne` + :host { + display: block; + } + + button { + width: 50px; + height: 50px; + background: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } +`;var mu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let bo=class extends oe{constructor(){super(...arguments),this.logo="google",this.disabled=!1}render(){return z` + + `}};bo.styles=[ue,Oe,ym];mu([C()],bo.prototype,"logo",void 0);mu([C({type:Boolean})],bo.prototype,"disabled",void 0);bo=mu([V("wui-logo-select")],bo);const xm=ne` + :host { + display: block; + } + + button { + border-radius: var(--wui-border-radius-3xl); + display: flex; + gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs) + var(--wui-spacing-xs); + border: 1px solid var(--wui-gray-glass-010); + background-color: var(--wui-gray-glass-005); + color: var(--wui-color-fg-100); + } + + button:disabled { + border: 1px solid var(--wui-gray-glass-005); + background-color: var(--wui-gray-glass-015); + color: var(--wui-gray-glass-015); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-gray-glass-010); + } + + button:active:enabled { + background-color: var(--wui-gray-glass-015); + } + } + + wui-image, + wui-icon-box { + border-radius: var(--wui-border-radius-3xl); + width: 24px; + height: 24px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } +`;var gc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Tr=class extends oe{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return z` + + `}visualTemplate(){return this.isUnsupportedChain?z` + + `:this.imageSrc?z``:z` + + `}};Tr.styles=[ue,Oe,xm];gc([C()],Tr.prototype,"imageSrc",void 0);gc([C({type:Boolean})],Tr.prototype,"isUnsupportedChain",void 0);gc([C({type:Boolean})],Tr.prototype,"disabled",void 0);Tr=gc([V("wui-network-button")],Tr);const Cm=ne` + :host { + position: relative; + display: block; + } +`;var wc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ar=class extends oe{constructor(){super(...arguments),this.length=6,this.otp="",this.values=Array.from({length:this.length}).map(()=>""),this.numerics=[],this.shouldInputBeEnabled=e=>this.values.slice(0,e).every(r=>r!==""),this.handleKeyDown=(e,t)=>{const r=e.target,o=this.getInputElement(r),n=["ArrowLeft","ArrowRight","Shift","Delete"];if(!o)return;n.includes(e.key)&&e.preventDefault();const s=o.selectionStart;switch(e.key){case"ArrowLeft":s&&o.setSelectionRange(s+1,s+1),this.focusInputField("prev",t);break;case"ArrowRight":this.focusInputField("next",t);break;case"Shift":this.focusInputField("next",t);break;case"Delete":o.value===""?this.focusInputField("prev",t):this.updateInput(o,t,"");break;case"Backspace":o.value===""?this.focusInputField("prev",t):this.updateInput(o,t,"");break}},this.focusInputField=(e,t)=>{if(e==="next"){const r=t+1;if(!this.shouldInputBeEnabled(r))return;const o=this.numerics[r-1?r:t],n=o?this.getInputElement(o):void 0;n&&n.focus()}}}firstUpdated(){var t,r;this.otp&&(this.values=this.otp.split(""));const e=(t=this.shadowRoot)==null?void 0:t.querySelectorAll("wui-input-numeric");e&&(this.numerics=Array.from(e)),(r=this.numerics[0])==null||r.focus()}render(){return z` + + ${Array.from({length:this.length}).map((e,t)=>z` + this.handleInput(r,t)} + @click=${r=>this.selectInput(r)} + @keydown=${r=>this.handleKeyDown(r,t)} + .disabled=${!this.shouldInputBeEnabled(t)} + .value=${this.values[t]||""} + > + + `)} + + `}updateInput(e,t,r){const o=this.numerics[t],n=e||(o?this.getInputElement(o):void 0);n&&(n.value=r,this.values=this.values.map((s,a)=>a===t?r:s))}selectInput(e){const t=e.target;if(t){const r=this.getInputElement(t);r==null||r.select()}}handleInput(e,t){const r=e.target,o=this.getInputElement(r);if(o){const n=o.value;e.inputType==="insertFromPaste"?this.handlePaste(o,n,t):ve.isNumber(n)&&e.data?(this.updateInput(o,t,e.data),this.focusInputField("next",t)):this.updateInput(o,t,"")}this.dispatchInputChangeEvent()}handlePaste(e,t,r){const o=t[0];if(o&&ve.isNumber(o)){this.updateInput(e,r,o);const s=t.substring(1);if(r+140)throw new Error('"version" should be in range from 1 to 40');return e*4+17};si.getSymbolTotalCodewords=function(e){return Em[e]};si.getBCHDigit=function(i){let e=0;for(;i!==0;)e++,i>>>=1;return e};si.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');vu=e};si.isKanjiModeEnabled=function(){return typeof vu<"u"};si.toSJIS=function(e){return vu(e)};var mc={};(function(i){i.L={bit:1},i.M={bit:0},i.Q={bit:3},i.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return i.L;case"m":case"medium":return i.M;case"q":case"quartile":return i.Q;case"h":case"high":return i.H;default:throw new Error("Unknown EC Level: "+t)}}i.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},i.from=function(r,o){if(i.isValid(r))return r;try{return e(r)}catch{return o}}})(mc);function c1(){this.buffer=[],this.length=0}c1.prototype={get:function(i){const e=Math.floor(i/8);return(this.buffer[e]>>>7-i%8&1)===1},put:function(i,e){for(let t=0;t>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),i&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Tm=c1;function Zs(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}Zs.prototype.set=function(i,e,t,r){const o=i*this.size+e;this.data[o]=t,r&&(this.reservedBit[o]=!0)};Zs.prototype.get=function(i,e){return this.data[i*this.size+e]};Zs.prototype.xor=function(i,e,t){this.data[i*this.size+e]^=t};Zs.prototype.isReserved=function(i,e){return this.reservedBit[i*this.size+e]};var Am=Zs,l1={};(function(i){const e=si.getSymbolSize;i.getRowColCoords=function(r){if(r===1)return[];const o=Math.floor(r/7)+2,n=e(r),s=n===145?26:Math.ceil((n-13)/(2*o-2))*2,a=[n-7];for(let c=1;c=0&&o<=7},i.from=function(o){return i.isValid(o)?parseInt(o,10):void 0},i.getPenaltyN1=function(o){const n=o.size;let s=0,a=0,c=0,l=null,h=null;for(let p=0;p=5&&(s+=e.N1+(a-5)),l=S,a=1),S=o.get(v,p),S===h?c++:(c>=5&&(s+=e.N1+(c-5)),h=S,c=1)}a>=5&&(s+=e.N1+(a-5)),c>=5&&(s+=e.N1+(c-5))}return s},i.getPenaltyN2=function(o){const n=o.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,c=c<<1&2047|o.get(h,l),h>=10&&(c===1488||c===93)&&s++}return s*e.N3},i.getPenaltyN4=function(o){let n=0;const s=o.data.length;for(let c=0;c=0;){const s=n[0];for(let c=0;c0){const n=new Uint8Array(this.degree);return n.set(r,o),n}return r};var km=bu,f1={},Jn={},yu={};yu.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var en={};const g1="[0-9]+",$m="[A-Z $%*+\\-./:]+";let ms="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ms=ms.replace(/u/g,"\\u");const Rm="(?:(?![A-Z0-9 $%*+\\-./:]|"+ms+`)(?:.|[\r +]))+`;en.KANJI=new RegExp(ms,"g");en.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");en.BYTE=new RegExp(Rm,"g");en.NUMERIC=new RegExp(g1,"g");en.ALPHANUMERIC=new RegExp($m,"g");const Im=new RegExp("^"+ms+"$"),Om=new RegExp("^"+g1+"$"),Pm=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");en.testKanji=function(e){return Im.test(e)};en.testNumeric=function(e){return Om.test(e)};en.testAlphanumeric=function(e){return Pm.test(e)};(function(i){const e=yu,t=en;i.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},i.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},i.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},i.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},i.MIXED={bit:-1},i.getCharCountIndicator=function(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},i.getBestModeForData=function(n){return t.testNumeric(n)?i.NUMERIC:t.testAlphanumeric(n)?i.ALPHANUMERIC:t.testKanji(n)?i.KANJI:i.BYTE},i.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},i.isValid=function(n){return n&&n.bit&&n.ccBits};function r(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return i.NUMERIC;case"alphanumeric":return i.ALPHANUMERIC;case"kanji":return i.KANJI;case"byte":return i.BYTE;default:throw new Error("Unknown mode: "+o)}}i.from=function(n,s){if(i.isValid(n))return n;try{return r(n)}catch{return s}}})(Jn);(function(i){const e=si,t=vc,r=mc,o=Jn,n=yu,s=7973,a=e.getBCHDigit(s);function c(v,S,O){for(let D=1;D<=40;D++)if(S<=i.getCapacity(D,O,v))return D}function l(v,S){return o.getCharCountIndicator(v,S)+4}function h(v,S){let O=0;return v.forEach(function(D){const R=l(D.mode,S);O+=R+D.getBitsLength()}),O}function p(v,S){for(let O=1;O<=40;O++)if(h(v,O)<=i.getCapacity(O,S,o.MIXED))return O}i.from=function(S,O){return n.isValid(S)?parseInt(S,10):O},i.getCapacity=function(S,O,D){if(!n.isValid(S))throw new Error("Invalid QR Code version");typeof D>"u"&&(D=o.BYTE);const R=e.getSymbolTotalCodewords(S),B=t.getTotalCodewordsCount(S,O),k=(R-B)*8;if(D===o.MIXED)return k;const W=k-l(D,S);switch(D){case o.NUMERIC:return Math.floor(W/10*3);case o.ALPHANUMERIC:return Math.floor(W/11*2);case o.KANJI:return Math.floor(W/13);case o.BYTE:default:return Math.floor(W/8)}},i.getBestVersionForData=function(S,O){let D;const R=r.from(O,r.M);if(Array.isArray(S)){if(S.length>1)return p(S,R);if(S.length===0)return 1;D=S[0]}else D=S;return c(D.mode,D.getLength(),R)},i.getEncodedBits=function(S){if(!n.isValid(S)||S<7)throw new Error("Invalid QR Code version");let O=S<<12;for(;e.getBCHDigit(O)-a>=0;)O^=s<=0;)o^=m1<0&&(r=this.data.substr(t),o=parseInt(r,10),e.put(o,n*3+1))};var Mm=yo;const Lm=Jn,tl=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function xo(i){this.mode=Lm.ALPHANUMERIC,this.data=i}xo.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};xo.prototype.getLength=function(){return this.data.length};xo.prototype.getBitsLength=function(){return xo.getBitsLength(this.data.length)};xo.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=tl.indexOf(this.data[t])*45;r+=tl.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(tl.indexOf(this.data[t]),6)};var Bm=xo,Um=function(e){for(var t=[],r=e.length,o=0;o=55296&&n<=56319&&r>o+1){var s=e.charCodeAt(o+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,o+=1)}if(n<128){t.push(n);continue}if(n<2048){t.push(n>>6|192),t.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){t.push(n>>12|224),t.push(n>>6&63|128),t.push(n&63|128);continue}if(n>=65536&&n<=1114111){t.push(n>>18|240),t.push(n>>12&63|128),t.push(n>>6&63|128),t.push(n&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const jm=Um,Wm=Jn;function Co(i){this.mode=Wm.BYTE,typeof i=="string"&&(i=jm(i)),this.data=new Uint8Array(i)}Co.getBitsLength=function(e){return e*8};Co.prototype.getLength=function(){return this.data.length};Co.prototype.getBitsLength=function(){return Co.getBitsLength(this.data.length)};Co.prototype.write=function(i){for(let e=0,t=this.data.length;e=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` +Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),i.put(t,13)}};var Vm=_o,b1={exports:{}};(function(i){var e={single_source_shortest_paths:function(t,r,o){var n={},s={};s[r]=0;var a=e.PriorityQueue.make();a.push(r,0);for(var c,l,h,p,v,S,O,D,R;!a.empty();){c=a.pop(),l=c.value,p=c.cost,v=t[l]||{};for(h in v)v.hasOwnProperty(h)&&(S=v[h],O=p+S,D=s[h],R=typeof s[h]>"u",(R||D>O)&&(s[h]=O,a.push(h,O),n[h]=l))}if(typeof o<"u"&&typeof s[o]>"u"){var B=["Could not find a path from ",r," to ",o,"."].join("");throw new Error(B)}return n},extract_shortest_path_from_predecessor_list:function(t,r){for(var o=[],n=r;n;)o.push(n),t[n],n=t[n];return o.reverse(),o},find_path:function(t,r,o){var n=e.single_source_shortest_paths(t,r,o);return e.extract_shortest_path_from_predecessor_list(n,o)},PriorityQueue:{make:function(t){var r=e.PriorityQueue,o={},n;t=t||{};for(n in r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=t.sorter||r.default_sorter,o},default_sorter:function(t,r){return t.cost-r.cost},push:function(t,r){var o={value:t,cost:r};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};i.exports=e})(b1);var Zm=b1.exports;(function(i){const e=Jn,t=Mm,r=Bm,o=zm,n=Vm,s=en,a=si,c=Zm;function l(B){return unescape(encodeURIComponent(B)).length}function h(B,k,W){const M=[];let j;for(;(j=B.exec(W))!==null;)M.push({data:j[0],index:j.index,mode:k,length:j[0].length});return M}function p(B){const k=h(s.NUMERIC,e.NUMERIC,B),W=h(s.ALPHANUMERIC,e.ALPHANUMERIC,B);let M,j;return a.isKanjiModeEnabled()?(M=h(s.BYTE,e.BYTE,B),j=h(s.KANJI,e.KANJI,B)):(M=h(s.BYTE_KANJI,e.BYTE,B),j=[]),k.concat(W,M,j).sort(function(ie,f){return ie.index-f.index}).map(function(ie){return{data:ie.data,mode:ie.mode,length:ie.length}})}function v(B,k){switch(k){case e.NUMERIC:return t.getBitsLength(B);case e.ALPHANUMERIC:return r.getBitsLength(B);case e.KANJI:return n.getBitsLength(B);case e.BYTE:return o.getBitsLength(B)}}function S(B){return B.reduce(function(k,W){const M=k.length-1>=0?k[k.length-1]:null;return M&&M.mode===W.mode?(k[k.length-1].data+=W.data,k):(k.push(W),k)},[])}function O(B){const k=[];for(let W=0;W=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?i.set(n+a,s+c,!0,!0):i.set(n+a,s+c,!1,!0))}}function t2(i){const e=i.size;for(let t=8;t>a&1)===1,i.set(o,n,s,!0),i.set(n,o,s,!0)}function rl(i,e,t){const r=i.size,o=Xm.getEncodedBits(e,t);let n,s;for(n=0;n<15;n++)s=(o>>n&1)===1,n<6?i.set(n,8,s,!0):n<8?i.set(n+1,8,s,!0):i.set(r-15+n,8,s,!0),n<8?i.set(8,r-n-1,s,!0):n<9?i.set(8,15-n-1+1,s,!0):i.set(8,15-n-1,s,!0);i.set(r-8,8,1,!0)}function r2(i,e){const t=i.size;let r=-1,o=t-1,n=7,s=0;for(let a=t-1;a>0;a-=2)for(a===6&&a--;;){for(let c=0;c<2;c++)if(!i.isReserved(o,a-c)){let l=!1;s>>n&1)===1),i.set(o,a-c,l),n--,n===-1&&(s++,n=7)}if(o+=r,o<0||t<=o){o-=r,r=-r;break}}}function o2(i,e,t){const r=new Gm;t.forEach(function(c){r.put(c.mode.bit,4),r.put(c.getLength(),Qm.getCharCountIndicator(c.mode,i)),c.write(r)});const o=yc.getSymbolTotalCodewords(i),n=_l.getTotalCodewordsCount(i,e),s=(o-n)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(s-r.getLengthInBits())/8;for(let c=0;c=7&&n2(c,e),r2(c,s),isNaN(r)&&(r=Cl.getBestMask(c,rl.bind(null,c,t))),Cl.applyMask(r,c),rl(c,t,r),{modules:c,version:e,errorCorrectionLevel:t,maskPattern:r,segments:o}}a1.create=function(e,t){if(typeof e>"u"||e==="")throw new Error("No input text");let r=il.M,o,n;return typeof t<"u"&&(r=il.from(t.errorCorrectionLevel,il.M),o=Ra.from(t.version),n=Cl.from(t.maskPattern),t.toSJISFunc&&yc.setToSJISFunction(t.toSJISFunc)),a2(e,o,r,n)};var y1={},xu={};(function(i){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let r=t.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+t);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(n){return[n,n]}))),r.length===6&&r.push("F","F");const o=parseInt(r.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+r.slice(0,6).join("")}}i.getOptions=function(r){r||(r={}),r.color||(r.color={});const o=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,n=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:n,scale:n?4:s,margin:o,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},i.getScale=function(r,o){return o.width&&o.width>=r+o.margin*2?o.width/(r+o.margin*2):o.scale},i.getImageWidth=function(r,o){const n=i.getScale(r,o);return Math.floor((r+o.margin*2)*n)},i.qrToImageData=function(r,o,n){const s=o.modules.size,a=o.modules.data,c=i.getScale(s,n),l=Math.floor((s+n.margin*2)*c),h=n.margin*c,p=[n.color.light,n.color.dark];for(let v=0;v=h&&S>=h&&v"u"&&(!s||!s.getContext)&&(c=s,s=void 0),s||(l=r()),c=e.getOptions(c);const h=e.getImageWidth(n.modules.size,c),p=l.getContext("2d"),v=p.createImageData(h,h);return e.qrToImageData(v.data,n,c),t(p,l,h),p.putImageData(v,0,0),l},i.renderToDataURL=function(n,s,a){let c=a;typeof c>"u"&&(!s||!s.getContext)&&(c=s,s=void 0),c||(c={});const l=i.render(n,s,c),h=c.type||"image/png",p=c.rendererOpts||{};return l.toDataURL(h,p.quality)}})(y1);var x1={};const c2=xu;function md(i,e){const t=i.a/255,r=e+'="'+i.hex+'"';return t<1?r+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':r}function ol(i,e,t){let r=i+e;return typeof t<"u"&&(r+=" "+t),r}function l2(i,e,t){let r="",o=0,n=!1,s=0;for(let a=0;a0&&c>0&&i[a-1]||(r+=n?ol("M",c+t,.5+l+t):ol("m",o,0),o=0,n=!1),c+1':"",l="',h='viewBox="0 0 '+a+" "+a+'"',v=''+c+l+` +`;return typeof r=="function"&&r(null,v),v};const u2=_m,El=a1,C1=y1,d2=x1;function Cu(i,e,t,r,o){const n=[].slice.call(arguments,1),s=n.length,a=typeof n[s-1]=="function";if(!a&&!u2())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(o=t,t=e,e=r=void 0):s===3&&(e.getContext&&typeof o>"u"?(o=r,r=void 0):(o=r,r=t,t=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(t=e,e=r=void 0):s===2&&!e.getContext&&(r=t,t=e,e=void 0),new Promise(function(c,l){try{const h=El.create(t,r);c(i(h,e,r))}catch(h){l(h)}})}try{const c=El.create(t,r);o(null,i(c,e,r))}catch(c){o(c)}}Vs.create=El.create;Vs.toCanvas=Cu.bind(null,C1.render);Vs.toDataURL=Cu.bind(null,C1.renderToDataURL);Vs.toString=Cu.bind(null,function(i,e,t){return d2.render(i,t)});const h2=.1,vd=2.5,sn=7;function sl(i,e,t){return i===e?!1:(i-e<0?e-i:i-e)<=t+h2}function p2(i,e){const t=Array.prototype.slice.call(Vs.create(i,{errorCorrectionLevel:e}).modules.data,0),r=Math.sqrt(t.length);return t.reduce((o,n,s)=>(s%r===0?o.push([n]):o[o.length-1].push(n))&&o,[])}const f2={generate(i,e,t){const r="#141414",o="transparent",s=[],a=p2(i,"Q"),c=e/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:D,y:R})=>{const B=(a.length-sn)*c*D,k=(a.length-sn)*c*R,W=.45;for(let M=0;M + `)}});const h=Math.floor((t+25)/c),p=a.length/2-h/2,v=a.length/2+h/2-1,S=[];a.forEach((D,R)=>{D.forEach((B,k)=>{if(a[R][k]&&!(Ra.length-(sn+1)&&ka.length-(sn+1))&&!(R>p&&Rp&&k{var B;O[D]?(B=O[D])==null||B.push(R):O[D]=[R]}),Object.entries(O).map(([D,R])=>{const B=R.filter(k=>R.every(W=>!sl(k,W,c)));return[Number(D),B]}).forEach(([D,R])=>{R.forEach(B=>{s.push(J``)})}),Object.entries(O).filter(([D,R])=>R.length>1).map(([D,R])=>{const B=R.filter(k=>R.some(W=>sl(k,W,c)));return[Number(D),B]}).map(([D,R])=>{R.sort((k,W)=>kM.some(j=>sl(k,j,c)));W?W.push(k):B.push([k])}return[D,B.map(k=>[k[0],k[k.length-1]])]}).forEach(([D,R])=>{R.forEach(([B,k])=>{s.push(J` + + `)})}),s}},g2=ne` + :host { + position: relative; + user-select: none; + display: block; + overflow: hidden; + aspect-ratio: 1 / 1; + width: var(--local-size); + } + + :host([data-theme='dark']) { + border-radius: clamp(0px, var(--wui-border-radius-l), 40px); + background-color: var(--wui-color-inverse-100); + padding: var(--wui-spacing-l); + } + + :host([data-theme='light']) { + box-shadow: 0 0 0 1px var(--wui-color-bg-125); + background-color: var(--wui-color-bg-125); + } + + :host([data-clear='true']) > wui-icon { + display: none; + } + + svg:first-child, + wui-image, + wui-icon { + position: absolute; + top: 50%; + left: 50%; + transform: translateY(-50%) translateX(-50%); + } + + wui-image { + width: 25%; + height: 25%; + border-radius: var(--wui-border-radius-xs); + } + + wui-icon { + width: 100%; + height: 100%; + color: #3396ff !important; + transform: translateY(-50%) translateX(-50%) scale(0.25); + } +`;var qr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Vi=class extends oe{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`--local-size: ${this.size}px`,z`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const e=this.theme==="light"?this.size:this.size-32;return J` + + ${f2.generate(this.uri,e,this.arenaClear?0:e/4)} + + `}templateVisual(){return this.imageSrc?z``:z``}};Vi.styles=[ue,g2];qr([C()],Vi.prototype,"uri",void 0);qr([C({type:Number})],Vi.prototype,"size",void 0);qr([C()],Vi.prototype,"theme",void 0);qr([C()],Vi.prototype,"imageSrc",void 0);qr([C()],Vi.prototype,"alt",void 0);qr([C({type:Boolean})],Vi.prototype,"arenaClear",void 0);Vi=qr([V("wui-qr-code")],Vi);const w2=ne` + :host { + position: relative; + display: inline-block; + width: 100%; + } +`;var m2=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ia=class extends oe{constructor(){super(...arguments),this.inputComponentRef=hu()}render(){return z` + + + + `}clearValue(){const e=this.inputComponentRef.value,t=e==null?void 0:e.inputElementRef.value;t&&(t.value="",t.focus(),t.dispatchEvent(new Event("input")))}};Ia.styles=[ue,w2];Ia=m2([V("wui-search-bar")],Ia);const v2=ne` + :host { + display: flex; + column-gap: var(--wui-spacing-xs); + align-items: center; + padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-005); + box-sizing: border-box; + max-height: 40px; + background-color: var(--wui-color-bg-175); + box-shadow: + 0px 14px 64px -4px rgba(0, 0, 0, 0.15), + 0px 8px 22px -6px rgba(0, 0, 0, 0.15); + } +`;var Gs=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let zn=class extends oe{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message=""}render(){return z` + + ${this.message} + `}};zn.styles=[ue,v2];Gs([C()],zn.prototype,"backgroundColor",void 0);Gs([C()],zn.prototype,"iconColor",void 0);Gs([C()],zn.prototype,"icon",void 0);Gs([C()],zn.prototype,"message",void 0);zn=Gs([V("wui-snackbar")],zn);const b2=ne` + :host { + display: inline-flex; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + padding: var(--wui-spacing-3xs); + position: relative; + height: 36px; + overflow: hidden; + } + + :host::before { + content: ''; + position: absolute; + pointer-events: none; + top: 4px; + left: 4px; + display: block; + width: var(--local-tab-width); + height: 28px; + border-radius: var(--wui-border-radius-3xl); + background-color: var(--wui-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + transform: translateX(calc(var(--local-tab) * var(--local-tab-width))); + transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color, opacity; + } + + :host([data-type='flex'])::before { + left: 3px; + transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px))); + } + + :host([data-type='flex']) { + display: flex; + padding: 0px 0px 0px 12px; + gap: 4px; + } + + :host([data-type='flex']) > button > wui-text { + position: absolute; + left: 18px; + opacity: 0; + } + + button[data-active='true'] > wui-icon, + button[data-active='true'] > wui-text { + color: var(--wui-color-fg-100); + } + + button[data-active='false'] > wui-icon, + button[data-active='false'] > wui-text { + color: var(--wui-color-fg-200); + } + + button[data-active='true']:disabled, + button[data-active='false']:disabled { + background-color: transparent; + opacity: 0.5; + cursor: not-allowed; + } + + button[data-active='true']:disabled > wui-text { + color: var(--wui-color-fg-200); + } + + button[data-active='false']:disabled > wui-text { + color: var(--wui-color-fg-300); + } + + button > wui-icon, + button > wui-text { + pointer-events: none; + transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md); + will-change: color; + } + + button { + width: var(--local-tab-width); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + :host([data-type='flex']) > button { + width: 34px; + position: relative; + display: flex; + justify-content: flex-start; + } + + button:hover:enabled, + button:active:enabled { + background-color: transparent !important; + } + + button:hover:enabled > wui-icon, + button:active:enabled > wui-icon { + color: var(--wui-color-fg-125); + } + + button:hover:enabled > wui-text, + button:active:enabled > wui-text { + color: var(--wui-color-fg-125); + } + + button { + border-radius: var(--wui-border-radius-3xl); + } +`;var Xn=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ki=class extends oe{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=` + --local-tab: ${this.activeTab}; + --local-tab-width: ${this.localTabWidth}; + `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,t)=>{var o;const r=t===this.activeTab;return z` + + `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?z``:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,t){const r=this.buttons[this.activeTab],o=this.buttons[e],n=r==null?void 0:r.querySelector("wui-text"),s=o==null?void 0:o.querySelector("wui-text"),a=o==null?void 0:o.getBoundingClientRect(),c=s==null?void 0:s.getBoundingClientRect();r&&n&&!t&&e!==this.activeTab&&(n.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),r.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),o&&a&&c&&s&&(e!==this.activeTab||t)&&(this.localTabWidth=`${Math.round(a.width+c.width)+6}px`,o.animate([{width:`${a.width+c.width}px`}],{duration:t?0:500,fill:"forwards",easing:"ease"}),s.animate([{opacity:1}],{duration:t?0:125,delay:t?0:200,fill:"forwards",easing:"ease"}))}};ki.styles=[ue,Oe,b2];Xn([C({type:Array})],ki.prototype,"tabs",void 0);Xn([C()],ki.prototype,"onTabChange",void 0);Xn([C({type:Array})],ki.prototype,"buttons",void 0);Xn([C({type:Boolean})],ki.prototype,"disabled",void 0);Xn([C()],ki.prototype,"localTabWidth",void 0);Xn([cu()],ki.prototype,"activeTab",void 0);Xn([cu()],ki.prototype,"isDense",void 0);ki=Xn([V("wui-tabs")],ki);const y2=ne` + :host { + display: block; + } + + :host > button { + gap: var(--wui-spacing-xxs); + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-1xs); + height: 40px; + border-radius: var(--wui-border-radius-3xl); + background: var(--wui-gray-glass-002); + border-width: 0px; + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + } + + :host > button wui-image { + width: 24px; + height: 24px; + border-radius: var(--wui-border-radius-s); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } +`;var _u=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Eo=class extends oe{constructor(){super(...arguments),this.text=""}render(){return z` + + `}tokenTemplate(){return this.imageSrc?z``:z` + + `}};Eo.styles=[ue,Oe,y2];_u([C()],Eo.prototype,"imageSrc",void 0);_u([C()],Eo.prototype,"text",void 0);Eo=_u([V("wui-token-button")],Eo);const x2=ne` + :host { + display: block; + padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + + color: var(--wui-color-bg-100); + position: relative; + } + + :host([data-variant='shade']) { + background-color: var(--wui-color-bg-150); + border: 1px solid var(--wui-gray-glass-005); + } + + :host([data-variant='shade']) > wui-text { + color: var(--wui-color-fg-150); + } + + :host([data-variant='fill']) { + background-color: var(--wui-color-fg-100); + border: none; + } + + wui-icon { + position: absolute; + width: 12px !important; + height: 4px !important; + } + + wui-icon[data-placement='top'] { + bottom: 0px; + left: 50%; + transform: translate(-50%, 95%); + } + + wui-icon[data-placement='bottom'] { + top: 0; + left: 50%; + transform: translate(-50%, -95%) rotate(180deg); + } + + wui-icon[data-placement='right'] { + top: 50%; + left: 0; + transform: translate(-65%, -50%) rotate(90deg); + } + + wui-icon[data-placement='left'] { + top: 50%; + right: 0%; + transform: translate(65%, -50%) rotate(270deg); + } +`;var xc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Sr=class extends oe{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,z` + ${this.message}`}};Sr.styles=[ue,Oe,x2];xc([C()],Sr.prototype,"placement",void 0);xc([C()],Sr.prototype,"variant",void 0);xc([C()],Sr.prototype,"message",void 0);Sr=xc([V("wui-tooltip")],Sr);const C2=ne` + :host { + position: relative; + } + + button { + display: flex; + justify-content: center; + align-items: center; + height: 48px; + width: 100%; + background-color: var(--wui-accent-glass-010); + border-radius: var(--wui-border-radius-xs); + border: 1px solid var(--wui-accent-glass-010); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + wui-tooltip { + padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s); + position: absolute; + top: -8px; + left: 50%; + transform: translate(-50%, -100%); + opacity: 0; + display: none; + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-accent-glass-015); + } + + button:active:enabled { + background-color: var(--wui-accent-glass-020); + } + } +`;var Eu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let To=class extends oe{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return z` + `}onMouseEnter(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-tooltip");e&&(e.style.display="flex",e==null||e.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease",duration:250}))}onMouseLeave(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-tooltip");e&&(e.style.display="none",e==null||e.animate([{opacity:1},{opacity:0}],{fill:"forwards",easing:"ease",duration:200}))}};To.styles=[ue,Oe,C2];Eu([C()],To.prototype,"text",void 0);Eu([C()],To.prototype,"icon",void 0);To=Eu([V("wui-tooltip-select")],To);const _2=ne` + :host > wui-flex { + cursor: pointer; + display: flex; + column-gap: var(--wui-spacing-s); + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-l); + width: 100%; + background-color: transparent; + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + transition: background-color 0.2s linear; + } + + :host > wui-flex:hover { + background-color: var(--wui-gray-glass-002); + } + + :host([disabled]) > wui-flex { + opacity: 0.6; + } + + :host([disabled]) > wui-flex:hover { + background-color: transparent; + } + + :host > wui-flex > wui-flex { + flex: 1; + } + + :host > wui-flex > wui-image { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-3xl); + position: relative; + } + + :host > wui-flex > wui-image::after { + position: absolute; + content: ''; + inset: 0; + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-l); + } + + button > wui-icon-box[data-variant='square-blue'] { + border-radius: var(--wui-border-radius-3xs); + position: relative; + border: none; + width: 36px; + height: 36px; + } +`;var Bo=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let dn=class extends oe{constructor(){super(...arguments),this.imageSrc=void 0,this.name=void 0,this.symbol=void 0,this.price=void 0,this.amount=void 0}render(){var t;const e=(t=At.multiply(this.price,this.amount))==null?void 0:t.toFixed(3);return z` + + ${this.visualTemplate()} + + + ${this.name} + ${e?z` + + $${ve.formatNumberToLocalString(e,3)} + + `:null} + + + ${this.symbol} + ${this.amount&&z`${ve.formatNumberToLocalString(this.amount,4)}`} + + + + `}visualTemplate(){return this.imageSrc?z``:null}};dn.styles=[ue,Oe,_2];Bo([C()],dn.prototype,"imageSrc",void 0);Bo([C()],dn.prototype,"name",void 0);Bo([C()],dn.prototype,"symbol",void 0);Bo([C()],dn.prototype,"price",void 0);Bo([C()],dn.prototype,"amount",void 0);dn=Bo([V("wui-token-list-item")],dn);const E2=ne` + :host { + display: flex; + justify-content: center; + align-items: center; + width: var(--wui-icon-box-size-xl); + height: var(--wui-icon-box-size-xl); + box-shadow: 0 0 0 8px var(--wui-thumbnail-border); + border-radius: var(--local-border-radius); + overflow: hidden; + } + + wui-icon { + width: 32px; + height: 32px; + } +`;var Cc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let kr=class extends oe{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"};`,z`${this.templateVisual()}`}templateVisual(){return this.imageSrc?z``:z``}};kr.styles=[ue,E2];Cc([C()],kr.prototype,"imageSrc",void 0);Cc([C()],kr.prototype,"alt",void 0);Cc([C({type:Boolean})],kr.prototype,"borderRadiusFull",void 0);kr=Cc([V("wui-visual-thumbnail")],kr);const T2=ne` + :host { + display: block; + } + + button { + width: 100%; + display: block; + padding-top: var(--wui-spacing-l); + padding-bottom: var(--wui-spacing-l); + padding-left: var(--wui-spacing-s); + padding-right: var(--wui-spacing-2l); + border-radius: var(--wui-border-radius-s); + background-color: var(--wui-accent-glass-015); + } + + button:hover { + background-color: var(--wui-accent-glass-010) !important; + } + + button:active { + background-color: var(--wui-accent-glass-020) !important; + } +`;var _c=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let $r=class extends oe{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return z` + + `}};$r.styles=[ue,Oe,T2];_c([C()],$r.prototype,"label",void 0);_c([C()],$r.prototype,"description",void 0);_c([C()],$r.prototype,"icon",void 0);$r=_c([V("wui-notice-card")],$r);const A2=ne` + button { + height: auto; + position: relative; + flex-direction: column; + gap: var(--wui-spacing-s); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + .overflowedContent { + width: 100%; + overflow: hidden; + } + + .overflowedContent[data-active='false']:after { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + bottom: 0; + background: linear-gradient(to top, var(--wui-color-bg-200), transparent); + border-bottom-left-radius: var(--wui-border-radius-xs); + border-bottom-right-radius: var(--wui-border-radius-xs); + } + + .heightContent { + max-height: 100px; + } + + pre { + text-align: left; + white-space: pre-wrap; + height: auto; + overflow-x: auto; + overflow-wrap: anywhere; + } +`;var Tu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const al=100;let Ao=class extends oe{constructor(){super(...arguments),this.textTitle="",this.overflowedContent="",this.toggled=!1,this.enableAccordion=!1,this.scrollElement=void 0,this.scrollHeightElement=0}updated(e){super.updated(e),(e.has("textTitle")||e.has("overflowedContent"))&&setTimeout(()=>{this.checkHeight()},1)}checkHeight(){this.updateComplete.then(()=>{var r,o;const e=(r=this.shadowRoot)==null?void 0:r.querySelector(".heightContent"),t=(o=this.shadowRoot)==null?void 0:o.querySelector(".textContent");if(e&&t){this.scrollElement=e;const n=t==null?void 0:t.scrollHeight;n&&n>al&&(this.enableAccordion=!0,this.scrollHeightElement=n,this.requestUpdate())}})}render(){return z` + + `}onClick(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-icon");this.enableAccordion&&(this.toggled=!this.toggled,this.requestUpdate(),this.scrollElement&&this.scrollElement.animate([{maxHeight:this.toggled?`${al}px`:`${this.scrollHeightElement}px`},{maxHeight:this.toggled?`${this.scrollHeightElement}px`:`${al}px`}],{duration:300,fill:"forwards",easing:"ease"}),e&&e.animate([{transform:this.toggled?"rotate(0deg)":"rotate(180deg)"},{transform:this.toggled?"rotate(180deg)":"rotate(0deg)"}],{duration:300,fill:"forwards",easing:"ease"}))}chevronTemplate(){return this.enableAccordion?z` `:null}};Ao.styles=[ue,Oe,A2];Tu([C()],Ao.prototype,"textTitle",void 0);Tu([C()],Ao.prototype,"overflowedContent",void 0);Ao=Tu([V("wui-list-accordion")],Ao);const S2=ne` + :host { + display: flex; + column-gap: var(--wui-spacing-s); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + wui-image { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + border-radius: var(--wui-border-radius-3xl); + } + + wui-icon { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + } +`;var Ec=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Rr=class extends oe{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return z` + + + ${this.textTitle} + + ${this.templateContent()} + + `}templateContent(){return this.imageSrc?z``:this.textValue?z` ${this.textValue} `:z``}};Rr.styles=[ue,Oe,S2];Ec([C()],Rr.prototype,"imageSrc",void 0);Ec([C()],Rr.prototype,"textTitle",void 0);Ec([C()],Rr.prototype,"textValue",void 0);Rr=Ec([V("wui-list-content")],Rr);const k2=ne` + button { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-100); + } + + button > wui-text:nth-child(2) { + display: flex; + flex: 1; + } + + button[data-transparent='true'] { + pointer-events: none; + background-color: transparent; + } + + wui-icon { + color: var(--wui-color-fg-200) !important; + } + + button:disabled { + background-color: var(--wui-gray-glass-015); + color: var(--wui-gray-glass-015); + } + + button:disabled > wui-tag { + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-300); + } +`;var qs=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Fn=class extends oe{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.transparent=!1}render(){return z` + + `}templateNetworkImage(){return this.imageSrc?z``:this.imageSrc?null:z``}};Fn.styles=[ue,Oe,k2];qs([C()],Fn.prototype,"imageSrc",void 0);qs([C()],Fn.prototype,"name",void 0);qs([C({type:Boolean})],Fn.prototype,"disabled",void 0);qs([C({type:Boolean})],Fn.prototype,"transparent",void 0);Fn=qs([V("wui-list-network")],Fn);const $2=ne` + :host { + display: flex; + flex-direction: column; + gap: var(--wui-spacing-l); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + wui-image { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + border-radius: var(--wui-border-radius-3xl); + } + + wui-icon { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + } +`;var Uo=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let hn=class extends oe{constructor(){super(...arguments),this.amount="",this.networkCurreny="",this.networkImageUrl="",this.receiverAddress="",this.addressExplorerUrl=""}render(){return z` + + Sending + + + ${this.amount} ${this.networkCurreny} + + ${this.templateNetworkVisual()} + + + + To + + + `}templateNetworkVisual(){return this.networkImageUrl?z``:z``}};hn.styles=[ue,Oe,$2];Uo([C()],hn.prototype,"amount",void 0);Uo([C()],hn.prototype,"networkCurreny",void 0);Uo([C()],hn.prototype,"networkImageUrl",void 0);Uo([C()],hn.prototype,"receiverAddress",void 0);Uo([C()],hn.prototype,"addressExplorerUrl",void 0);hn=Uo([V("wui-list-wallet-transaction")],hn);const R2=ne` + :host { + width: 100%; + } + + :host > wui-flex { + width: 100%; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xs); + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + gap: var(--wui-spacing-s); + } + + :host > wui-flex:hover { + background-color: var(--wui-gray-glass-002); + } + + .purchase-image-container { + display: flex; + justify-content: center; + align-items: center; + position: relative; + width: var(--wui-icon-box-size-lg); + height: var(--wui-icon-box-size-lg); + } + + .purchase-image-container wui-image { + width: 100%; + height: 100%; + position: relative; + border-radius: calc(var(--wui-icon-box-size-lg) / 2); + } + + .purchase-image-container wui-image::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-icon-box-size-lg) / 2); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + } + + .purchase-image-container wui-icon-box { + position: absolute; + right: 0; + bottom: 0; + transform: translate(20%, 20%); + } +`;var ai=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let It=class extends oe{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return z` + + ${this.imageTemplate()} + + + ${this.statusIconTemplate()} + ${this.label} + + + + ${this.purchaseValue} ${this.purchaseCurrency} + + + ${this.inProgress?z``:z`${this.date}`} + + `}async fetchTokenImage(){await xe._fetchTokenImage(this.purchaseCurrency)}statusIconTemplate(){return this.inProgress?null:this.completed?this.boughtIconTemplate():this.errorIconTemplate()}errorIconTemplate(){return z``}imageTemplate(){const e=this.icon||`https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;return z` + + `}boughtIconTemplate(){return z``}};It.styles=[ue,Oe,R2];ai([C({type:Boolean})],It.prototype,"disabled",void 0);ai([C()],It.prototype,"color",void 0);ai([C()],It.prototype,"label",void 0);ai([C()],It.prototype,"purchaseValue",void 0);ai([C()],It.prototype,"purchaseCurrency",void 0);ai([C()],It.prototype,"date",void 0);ai([C({type:Boolean})],It.prototype,"completed",void 0);ai([C({type:Boolean})],It.prototype,"inProgress",void 0);ai([C({type:Boolean})],It.prototype,"failed",void 0);ai([C()],It.prototype,"onClick",void 0);ai([C()],It.prototype,"symbol",void 0);ai([C()],It.prototype,"icon",void 0);It=ai([V("wui-onramp-activity-item")],It);const I2=ne` + button { + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xs); + background-color: var(--wui-gray-glass-002); + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + gap: var(--wui-spacing-s); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + button:hover { + background-color: var(--wui-gray-glass-005); + } + + .provider-image { + width: var(--wui-spacing-3xl); + min-width: var(--wui-spacing-3xl); + height: var(--wui-spacing-3xl); + border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); + position: relative; + overflow: hidden; + } + + .provider-image::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + } + + .network-icon { + width: var(--wui-spacing-m); + height: var(--wui-spacing-m); + border-radius: calc(var(--wui-spacing-m) / 2); + overflow: hidden; + box-shadow: + 0 0 0 3px var(--wui-gray-glass-002), + 0 0 0 3px var(--wui-color-modal-bg); + transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: box-shadow; + } + + button:hover .network-icon { + box-shadow: + 0 0 0 3px var(--wui-gray-glass-005), + 0 0 0 3px var(--wui-color-modal-bg); + } +`;var Qn=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let $i=class extends oe{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return z` + + `}networksTemplate(){var r;const e=de.getRequestedCaipNetworks(),t=(r=e==null?void 0:e.filter(o=>o==null?void 0:o.imageId))==null?void 0:r.slice(0,5);return z` + + ${t==null?void 0:t.map(o=>z` + + + + `)} + + `}};$i.styles=[ue,Oe,I2];Qn([C({type:Boolean})],$i.prototype,"disabled",void 0);Qn([C()],$i.prototype,"color",void 0);Qn([C()],$i.prototype,"name",void 0);Qn([C()],$i.prototype,"label",void 0);Qn([C()],$i.prototype,"feeRange",void 0);Qn([C({type:Boolean})],$i.prototype,"loading",void 0);Qn([C()],$i.prototype,"onClick",void 0);$i=Qn([V("wui-onramp-provider-item")],$i);const O2=ne` + button { + display: flex; + gap: var(--wui-spacing-3xs); + align-items: center; + padding: 6.25px var(--wui-spacing-xs) 7.25px var(--wui-spacing-s); + background-color: var(--wui-gray-glass-090); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-060); + transition: background-color var(--wui-duration-md) var(--wui-ease-inout-power-1); + will-change: background-color; + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-gray-glass-080); + } + + button:active:enabled { + background-color: var(--wui-gray-glass-060); + } + } +`;var _1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let vs=class extends oe{constructor(){super(...arguments),this.text=""}render(){return z``}};vs.styles=[ue,Oe,O2];_1([C()],vs.prototype,"text",void 0);vs=_1([V("wui-promo")],vs);const P2=ne` + span { + font-weight: 500; + font-size: 40px; + color: var(--wui-color-fg-100); + line-height: 130%; /* 52px */ + letter-spacing: -1.6px; + text-align: center; + } + + .pennies { + color: var(--wui-color-fg-200); + } +`;var Au=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let So=class extends oe{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return z`$${this.dollars}.${this.pennies}`}};So.styles=[ue,P2];Au([C()],So.prototype,"dollars",void 0);Au([C()],So.prototype,"pennies",void 0);So=Au([V("wui-balance")],So);const N2=ne` + button { + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-002); + padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); + position: relative; + } + + wui-avatar { + width: 32px; + height: 32px; + box-shadow: 0 0 0 0; + outline: 3px solid var(--wui-gray-glass-005); + } + + wui-icon-box, + wui-image { + width: 16px; + height: 16px; + border-radius: var(--wui-border-radius-3xl); + position: absolute; + left: 26px; + top: 24px; + } + + wui-image { + outline: 2px solid var(--wui-color-bg-125); + } + + wui-icon-box { + outline: 2px solid var(--wui-color-bg-200); + background-color: var(--wui-color-bg-250); + } +`;var jo=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let pn=class extends oe{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.isProfileName=!1,this.address="",this.icon="chevronBottom"}render(){return z``}networkImageTemplate(){return this.networkSrc?z``:z` + + `}};pn.styles=[ue,Oe,N2];jo([C()],pn.prototype,"networkSrc",void 0);jo([C()],pn.prototype,"avatarSrc",void 0);jo([C({type:Boolean})],pn.prototype,"isProfileName",void 0);jo([C()],pn.prototype,"address",void 0);jo([C()],pn.prototype,"icon",void 0);pn=jo([V("wui-profile-button")],pn);const D2=ne` + button { + border: 1px solid var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-3xl); + } + + wui-image { + border-radius: var(--wui-border-radius-3xl); + overflow: hidden; + } + + button.disabled > wui-icon, + button.disabled > wui-image { + filter: grayscale(1); + } + + button[data-variant='fill'] { + color: var(--wui-color-inverse-100); + background-color: var(--wui-color-accent-100); + } + + button[data-variant='shade'], + button[data-variant='shadeSmall'] { + background-color: transparent; + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-200); + } + + button[data-variant='success'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-success-glass-010); + background-color: var(--wui-success-glass-010); + color: var(--wui-color-success-100); + } + + button[data-variant='error'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-error-glass-010); + background-color: var(--wui-error-glass-010); + color: var(--wui-color-error-100); + } + + button[data-variant='transparent'] { + column-gap: var(--wui-spacing-xxs); + background-color: transparent; + color: var(--wui-color-fg-150); + } + + button[data-variant='transparent'], + button[data-variant='success'], + button[data-variant='shadeSmall'], + button[data-variant='error'] { + padding: 7px var(--wui-spacing-s) 7px 8px; + } + + button[data-variant='transparent']:has(wui-text:first-child), + button[data-variant='success']:has(wui-text:first-child), + button[data-variant='shadeSmall']:has(wui-text:first-child), + button[data-variant='error']:has(wui-text:first-child) { + padding: 7px var(--wui-spacing-s); + } + + button[data-variant='fill'], + button[data-variant='shade'] { + column-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) + var(--wui-spacing-xs); + } + + button[data-variant='fill']:has(wui-text:first-child), + button[data-variant='shade']:has(wui-text:first-child) { + padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); + } + + button[data-variant='fill'] > wui-image, + button[data-variant='shade'] > wui-image { + width: 24px; + height: 24px; + } + + button[data-variant='fill'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); + } + + button[data-variant='shade'] > wui-image, + button[data-variant='shadeSmall'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } + + button[data-variant='fill'] > wui-icon, + button[data-variant='shade'] > wui-icon { + width: 14px; + height: 14px; + } + + button[data-variant='transparent'] > wui-image, + button[data-variant='success'] > wui-image, + button[data-variant='shadeSmall'] > wui-image, + button[data-variant='error'] > wui-image { + width: 14px; + height: 14px; + } + + button[data-variant='transparent'] > wui-icon, + button[data-variant='success'] > wui-icon, + button[data-variant='shadeSmall'] > wui-icon, + button[data-variant='error'] > wui-icon { + width: 12px; + height: 12px; + } + + button[data-variant='fill']:focus-visible { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='shade']:focus-visible, + button[data-variant='shadeSmall']:focus-visible { + background-color: var(--wui-gray-glass-015); + } + + button[data-variant='transparent']:focus-visible { + background-color: var(--wui-gray-glass-005); + } + + button[data-variant='success']:focus-visible { + background-color: var(--wui-success-glass-015); + } + + button[data-variant='error']:focus-visible { + background-color: var(--wui-error-glass-015); + } + + button.disabled { + color: var(--wui-gray-glass-015); + background-color: var(--wui-gray-glass-015); + pointer-events: none; + } + + @media (hover: hover) and (pointer: fine) { + button[data-variant='fill']:hover { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='shade']:hover, + button[data-variant='shadeSmall']:hover { + background-color: var(--wui-gray-glass-015); + } + + button[data-variant='transparent']:hover { + background-color: var(--wui-gray-glass-005); + } + + button[data-variant='success']:hover { + background-color: var(--wui-success-glass-015); + } + + button[data-variant='error']:hover { + background-color: var(--wui-error-glass-015); + } + } + + button[data-variant='fill']:active { + background-color: var(--wui-color-accent-080); + } + + button[data-variant='shade']:active, + button[data-variant='shadeSmall']:active { + background-color: var(--wui-gray-glass-020); + } + + button[data-variant='transparent']:active { + background-color: var(--wui-gray-glass-010); + } + + button[data-variant='success']:active { + background-color: var(--wui-success-glass-020); + } + + button[data-variant='error']:active { + background-color: var(--wui-error-glass-020); + } +`;var Wo=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let fn=class extends oe{constructor(){super(...arguments),this.variant="fill",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.text=""}render(){const t=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return z` + + `}};fn.styles=[ue,Oe,D2];Wo([C()],fn.prototype,"variant",void 0);Wo([C()],fn.prototype,"imageSrc",void 0);Wo([C({type:Boolean})],fn.prototype,"disabled",void 0);Wo([C()],fn.prototype,"icon",void 0);Wo([C()],fn.prototype,"text",void 0);fn=Wo([V("wui-chip-button")],fn);const M2=ne` + button { + display: flex; + gap: var(--wui-spacing-xl); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + padding: var(--wui-spacing-m) var(--wui-spacing-s); + } + + wui-text { + width: 100%; + } + + wui-flex { + width: auto; + } + + .network-icon { + width: var(--wui-spacing-2l); + height: var(--wui-spacing-2l); + border-radius: calc(var(--wui-spacing-2l) / 2); + overflow: hidden; + box-shadow: + 0 0 0 3px var(--wui-gray-glass-002), + 0 0 0 3px var(--wui-color-modal-bg); + } +`;var Su=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ko=class extends oe{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return z` + + `}networksTemplate(){const e=this.networkImages.slice(0,5);return z` + ${e==null?void 0:e.map(t=>z` `)} + `}};ko.styles=[ue,Oe,M2];Su([C({type:Array})],ko.prototype,"networkImages",void 0);Su([C()],ko.prototype,"text",void 0);ko=Su([V("wui-compatible-network")],ko);const L2=ne` + wui-flex { + width: 100%; + background-color: var(--wui-gray-glass-005); + border-radius: var(--wui-border-radius-s); + padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) + var(--wui-spacing-1xs); + } +`;var ku=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let $o=class extends oe{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return z` + + + ${this.text} + + `}};$o.styles=[ue,Oe,L2];ku([C()],$o.prototype,"icon",void 0);ku([C()],$o.prototype,"text",void 0);$o=ku([V("wui-banner")],$o);const B2=ne` + button { + padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); + display: flex; + justify-content: space-between; + width: 100%; + border-radius: var(--wui-border-radius-xs); + background-color: var(--wui-gray-glass-002); + } + + button[data-clickable='false'] { + pointer-events: none; + background-color: transparent; + } + + wui-image { + width: var(--wui-spacing-3xl); + height: var(--wui-spacing-3xl); + border-radius: var(--wui-border-radius-3xl); + } +`;var Yr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Zi=class extends oe{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return z` + + `}};Zi.styles=[ue,Oe,B2];Yr([C()],Zi.prototype,"tokenName",void 0);Yr([C()],Zi.prototype,"tokenImageUrl",void 0);Yr([C({type:Number})],Zi.prototype,"tokenValue",void 0);Yr([C()],Zi.prototype,"tokenAmount",void 0);Yr([C()],Zi.prototype,"tokenCurrency",void 0);Yr([C({type:Boolean})],Zi.prototype,"clickable",void 0);Zi=Yr([V("wui-list-token")],Zi);const U2=ne` + button { + width: 100%; + display: flex; + gap: var(--wui-spacing-s); + align-items: center; + justify-content: flex-start; + padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s); + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } + + wui-icon-box { + width: var(--wui-spacing-2xl); + height: var(--wui-spacing-2xl); + } + + wui-flex { + width: auto; + } +`;var er=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ri=class extends oe{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return z` + + `}titleTemplate(){return this.tag?z` ${this.text}${this.tag} + `:z`${this.text}`}};Ri.styles=[ue,Oe,U2];er([C()],Ri.prototype,"icon",void 0);er([C()],Ri.prototype,"text",void 0);er([C()],Ri.prototype,"description",void 0);er([C()],Ri.prototype,"tag",void 0);er([C()],Ri.prototype,"iconBackgroundColor",void 0);er([C()],Ri.prototype,"iconColor",void 0);er([C({type:Boolean})],Ri.prototype,"disabled",void 0);Ri=er([V("wui-list-description")],Ri);const j2=ne` + :host { + position: relative; + display: inline-block; + } + + input { + background: transparent; + width: 100%; + height: auto; + font-family: var(--wui-font-family); + color: var(--wui-color-fg-100); + + font-feature-settings: 'case' on; + font-size: 32px; + font-weight: var(--wui-font-weight-light); + caret-color: var(--wui-color-accent-100); + line-height: 130%; + letter-spacing: -1.28px; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input::placeholder { + color: var(--wui-color-fg-275); + } +`,W2=/[.*+?^${}()|[\]\\]/gu,z2=/[0-9,.]/u;var Tc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ir=class extends oe{constructor(){super(...arguments),this.inputElementRef=hu(),this.disabled=!1,this.value="",this.placeholder="0"}render(){var e;return(e=this.inputElementRef)!=null&&e.value&&this.value&&(this.inputElementRef.value.value=this.value),z` `}dispatchInputChangeEvent(e){var r,o;const t=e.data;t&&!z2.test(t)&&(r=this.inputElementRef)!=null&&r.value&&(this.inputElementRef.value.value=this.value.replace(new RegExp(t.replace(W2,"\\$&"),"gu"),"")),this.dispatchEvent(new CustomEvent("inputChange",{detail:(o=this.inputElementRef.value)==null?void 0:o.value,bubbles:!0,composed:!0}))}};Ir.styles=[ue,Oe,j2];Tc([C({type:Boolean})],Ir.prototype,"disabled",void 0);Tc([C({type:String})],Ir.prototype,"value",void 0);Tc([C({type:String})],Ir.prototype,"placeholder",void 0);Ir=Tc([V("wui-input-amount")],Ir);const F2=ne` + :host { + display: flex; + gap: var(--wui-spacing-xs); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-002); + background: var(--wui-gray-glass-002); + padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs) + var(--wui-spacing-s); + align-items: center; + } + + wui-avatar, + wui-icon, + wui-image { + width: 32px; + height: 32px; + border: 1px solid var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + box-shadow: 0 0 0 2px var(--wui-gray-glass-002); + } +`;var Ys=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Hn=class extends oe{constructor(){super(...arguments),this.text="",this.address="",this.isAddress=!1}render(){return z`${this.text} + ${this.imageTemplate()}`}imageTemplate(){return this.isAddress?z``:this.imageSrc?z``:z``}};Hn.styles=[ue,Oe,F2];Ys([C()],Hn.prototype,"text",void 0);Ys([C()],Hn.prototype,"address",void 0);Ys([C()],Hn.prototype,"imageSrc",void 0);Ys([C({type:Boolean})],Hn.prototype,"isAddress",void 0);Hn=Ys([V("wui-preview-item")],Hn);const H2=ne` + :host { + display: grid; + width: inherit; + height: inherit; + } +`;var mi=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ut=class extends oe{render(){return this.style.cssText=` + grid-template-rows: ${this.gridTemplateRows}; + grid-template-columns: ${this.gridTemplateColumns}; + justify-items: ${this.justifyItems}; + align-items: ${this.alignItems}; + justify-content: ${this.justifyContent}; + align-content: ${this.alignContent}; + column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; + row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; + gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; + padding-top: ${this.padding&&ve.getSpacingStyles(this.padding,0)}; + padding-right: ${this.padding&&ve.getSpacingStyles(this.padding,1)}; + padding-bottom: ${this.padding&&ve.getSpacingStyles(this.padding,2)}; + padding-left: ${this.padding&&ve.getSpacingStyles(this.padding,3)}; + margin-top: ${this.margin&&ve.getSpacingStyles(this.margin,0)}; + margin-right: ${this.margin&&ve.getSpacingStyles(this.margin,1)}; + margin-bottom: ${this.margin&&ve.getSpacingStyles(this.margin,2)}; + margin-left: ${this.margin&&ve.getSpacingStyles(this.margin,3)}; + `,z``}};Ut.styles=[ue,H2];mi([C()],Ut.prototype,"gridTemplateRows",void 0);mi([C()],Ut.prototype,"gridTemplateColumns",void 0);mi([C()],Ut.prototype,"justifyItems",void 0);mi([C()],Ut.prototype,"alignItems",void 0);mi([C()],Ut.prototype,"justifyContent",void 0);mi([C()],Ut.prototype,"alignContent",void 0);mi([C()],Ut.prototype,"columnGap",void 0);mi([C()],Ut.prototype,"rowGap",void 0);mi([C()],Ut.prototype,"gap",void 0);mi([C()],Ut.prototype,"padding",void 0);mi([C()],Ut.prototype,"margin",void 0);Ut=mi([V("wui-grid")],Ut);const V2=ne` + :host { + position: relative; + display: flex; + width: 100%; + height: 1px; + background-color: var(--wui-gray-glass-005); + justify-content: center; + align-items: center; + } + + :host > wui-text { + position: absolute; + padding: 0px 10px; + background-color: var(--wui-color-modal-bg); + } +`;var E1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let bs=class extends oe{constructor(){super(...arguments),this.text=""}render(){return z`${this.template()}`}template(){return this.text?z`${this.text}`:null}};bs.styles=[ue,V2];E1([C()],bs.prototype,"text",void 0);bs=E1([V("wui-separator")],bs);const Jo={interpolate(i,e,t){if(i.length!==2||e.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");const r=i[0]||0,o=i[1]||0,n=e[0]||0,s=e[1]||0;return to?s:(s-n)/(o-r)*(t-r)+n}},Z2=3,G2=["receive","deposit","borrow","claim"],q2=["withdraw","repay","burn"],$n={getMonthName(i){const e=new Date;return e.setMonth(i),e.toLocaleString("en-US",{month:"long"})},getTransactionGroupTitle(i,e){const t=eu.getYear(),r=this.getMonthName(e);return i===t?r:`${r} ${i}`},getTransactionImages(i){const[e,t]=i,r=!!e&&(i==null?void 0:i.every(s=>!!s.nft_info)),o=(i==null?void 0:i.length)>1;return(i==null?void 0:i.length)===2&&!r?[this.getTransactionImage(e),this.getTransactionImage(t)]:o?i.map(s=>this.getTransactionImage(s)):[this.getTransactionImage(e)]},getTransactionImage(i){return{type:$n.getTransactionTransferTokenType(i),url:$n.getTransactionImageURL(i)}},getTransactionImageURL(i){var o,n,s,a,c;let e;const t=!!(i!=null&&i.nft_info),r=!!(i!=null&&i.fungible_info);return i&&t?e=(s=(n=(o=i==null?void 0:i.nft_info)==null?void 0:o.content)==null?void 0:n.preview)==null?void 0:s.url:i&&r&&(e=(c=(a=i==null?void 0:i.fungible_info)==null?void 0:a.icon)==null?void 0:c.url),e},getTransactionTransferTokenType(i){if(i!=null&&i.fungible_info)return"FUNGIBLE";if(i!=null&&i.nft_info)return"NFT"},getTransactionDescriptions(i){var p,v,S;const e=(p=i==null?void 0:i.metadata)==null?void 0:p.operationType,t=i==null?void 0:i.transfers,r=((v=i==null?void 0:i.transfers)==null?void 0:v.length)>0,o=((S=i==null?void 0:i.transfers)==null?void 0:S.length)>1,n=r&&(t==null?void 0:t.every(O=>!!(O!=null&&O.fungible_info))),[s,a]=t;let c=this.getTransferDescription(s),l=this.getTransferDescription(a);if(!r)return(e==="send"||e==="receive")&&n?(c=ve.getTruncateString({string:i==null?void 0:i.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),l=ve.getTruncateString({string:i==null?void 0:i.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[c,l]):[i.metadata.status];if(o)return t.map(O=>this.getTransferDescription(O));let h="";return G2.includes(e)?h="+":q2.includes(e)&&(h="-"),c=h.concat(c),[c]},getTransferDescription(i){var t;let e="";return i&&(i!=null&&i.nft_info?e=((t=i==null?void 0:i.nft_info)==null?void 0:t.name)||"-":i!=null&&i.fungible_info&&(e=this.getFungibleTransferDescription(i)||"-")),e},getFungibleTransferDescription(i){var r;return i?[this.getQuantityFixedValue(i==null?void 0:i.quantity.numeric),(r=i==null?void 0:i.fungible_info)==null?void 0:r.symbol].join(" ").trim():null},getQuantityFixedValue(i){return i?parseFloat(i).toFixed(Z2):null}},Y2=Object.freeze(Object.defineProperty({__proto__:null,MathUtil:Jo,TransactionUtil:$n,UiHelperUtil:ve,get WuiAccountButton(){return Zt},get WuiAllWalletsImage(){return hs},get WuiAvatar(){return Cr},get WuiBalance(){return So},get WuiBanner(){return $o},get WuiButton(){return Qt},get WuiCard(){return Ea},get WuiCardSelect(){return zi},get WuiCardSelectLoader(){return ps},get WuiChip(){return Fi},get WuiChipButton(){return fn},get WuiCompatibleNetwork(){return ko},get WuiConnectButton(){return go},get WuiCtaButton(){return _r},get WuiDetailsGroup(){return Aa},get WuiDetailsGroupItem(){return fs},get WuiEmailInput(){return Er},get WuiFlex(){return Rt},get WuiGrid(){return Ut},get WuiIcon(){return vr},get WuiIconBox(){return fi},get WuiIconLink(){return Wn},get WuiImage(){return br},get WuiInputAmount(){return Ir},get WuiInputElement(){return gs},get WuiInputNumeric(){return wo},get WuiInputText(){return Si},get WuiLink(){return mo},get WuiListAccordion(){return Ao},get WuiListContent(){return Rr},get WuiListDescription(){return Ri},get WuiListItem(){return ei},get WuiListNetwork(){return Fn},get WuiListToken(){return Zi},get WuiListWallet(){return qt},get WuiListWalletTransaction(){return hn},get WuiLoadingHexagon(){return Ta},get WuiLoadingSpinner(){return po},get WuiLoadingThumbnail(){return ds},get WuiLogo(){return ws},get WuiLogoSelect(){return bo},get WuiNetworkButton(){return Tr},get WuiNetworkImage(){return jn},get WuiNoticeCard(){return $r},get WuiOnRampActivityItem(){return It},get WuiOnRampProviderItem(){return $i},get WuiOtp(){return Ar},get WuiPreviewItem(){return Hn},get WuiProfileButton(){return pn},get WuiPromo(){return vs},get WuiQrCode(){return Vi},get WuiSearchBar(){return Ia},get WuiSeparator(){return bs},get WuiShimmer(){return yr},get WuiSnackbar(){return zn},get WuiTabs(){return ki},get WuiTag(){return vo},get WuiText(){return xr},get WuiTokenButton(){return Eo},get WuiTokenListItem(){return dn},get WuiTooltip(){return Sr},get WuiTooltipSelect(){return To},get WuiTransactionListItem(){return Gt},get WuiTransactionListItemLoader(){return ka},get WuiTransactionVisual(){return Hi},get WuiVisual(){return fo},get WuiVisualThumbnail(){return kr},get WuiWalletImage(){return Wi},convertInputMaskBottomSvg:Z0,convertInputMaskTopSvg:G0,customElement:V,initializeTheming:q0,setColorTheme:su,setThemeVariables:Y0},Symbol.toStringTag,{value:"Module"}));/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const va=globalThis,$u=va.ShadowRoot&&(va.ShadyCSS===void 0||va.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ru=Symbol(),bd=new WeakMap;let T1=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Ru)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if($u&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=bd.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&bd.set(t,e))}return e}toString(){return this.cssText}};const K2=i=>new T1(typeof i=="string"?i:i+"",void 0,Ru),_e=(i,...e)=>{const t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new T1(t,i,Ru)},J2=(i,e)=>{if($u)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),o=va.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},yd=$u?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return K2(t)})(i):i;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:X2,defineProperty:Q2,getOwnPropertyDescriptor:e3,getOwnPropertyNames:t3,getOwnPropertySymbols:i3,getPrototypeOf:n3}=Object,Mn=globalThis,xd=Mn.trustedTypes,r3=xd?xd.emptyScript:"",cl=Mn.reactiveElementPolyfillSupport,os=(i,e)=>i,Oa={toAttribute(i,e){switch(e){case Boolean:i=i?r3:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Iu=(i,e)=>!X2(i,e),Cd={attribute:!0,type:String,converter:Oa,reflect:!1,hasChanged:Iu};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Mn.litPropertyMetadata??(Mn.litPropertyMetadata=new WeakMap);class io extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Cd){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&Q2(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){const{get:o,set:n}=e3(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get(){return o==null?void 0:o.call(this)},set(s){const a=o==null?void 0:o.call(this);n.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Cd}static _$Ei(){if(this.hasOwnProperty(os("elementProperties")))return;const e=n3(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(os("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(os("properties"))){const t=this.properties,r=[...t3(t),...i3(t)];for(const o of r)this.createProperty(o,t[o])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const o of r)t.unshift(yd(o))}else e!==void 0&&t.push(yd(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J2(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){var n;const r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){const s=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Oa).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(e,t){var n;const r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const s=r.getPropertyOptions(o),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((n=s.converter)==null?void 0:n.fromAttribute)!==void 0?s.converter:Oa;this._$Em=o,this[o]=a.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??Iu)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[n,s]of o)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],s)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}io.elementStyles=[],io.shadowRootOptions={mode:"open"},io[os("elementProperties")]=new Map,io[os("finalized")]=new Map,cl==null||cl({ReactiveElement:io}),(Mn.reactiveElementVersions??(Mn.reactiveElementVersions=[])).push("2.0.4");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ss=globalThis,Pa=ss.trustedTypes,_d=Pa?Pa.createPolicy("lit-html",{createHTML:i=>i}):void 0,A1="$lit$",An=`lit$${Math.random().toFixed(9).slice(2)}$`,S1="?"+An,o3=`<${S1}>`,Or=document,ys=()=>Or.createComment(""),xs=i=>i===null||typeof i!="object"&&typeof i!="function",k1=Array.isArray,s3=i=>k1(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",ll=`[ +\f\r]`,qo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ed=/-->/g,Td=/>/g,cr=RegExp(`>|${ll}(?:([^\\s"'>=/]+)(${ll}*=${ll}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Ad=/'/g,Sd=/"/g,$1=/^(?:script|style|textarea|title)$/i,a3=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),T=a3(1),Ro=Symbol.for("lit-noChange"),ut=Symbol.for("lit-nothing"),kd=new WeakMap,pr=Or.createTreeWalker(Or,129);function R1(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return _d!==void 0?_d.createHTML(e):e}const c3=(i,e)=>{const t=i.length-1,r=[];let o,n=e===2?"":"",s=qo;for(let a=0;a"?(s=o??qo,p=-1):h[1]===void 0?p=-2:(p=s.lastIndex-h[2].length,l=h[1],s=h[3]===void 0?cr:h[3]==='"'?Sd:Ad):s===Sd||s===Ad?s=cr:s===Ed||s===Td?s=qo:(s=cr,o=void 0);const S=s===cr&&i[a+1].startsWith("/>")?" ":"";n+=s===qo?c+o3:p>=0?(r.push(l),c.slice(0,p)+A1+c.slice(p)+An+S):c+An+(p===-2?a:S)}return[R1(i,n+(i[t]||"")+(e===2?"":"")),r]};class Cs{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,s=0;const a=e.length-1,c=this.parts,[l,h]=c3(e,t);if(this.el=Cs.createElement(l,r),pr.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=pr.nextNode())!==null&&c.length0){o.textContent=Pa?Pa.emptyScript:"";for(let S=0;S2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ut}_$AI(e,t=this,r,o){const n=this.strings;let s=!1;if(n===void 0)e=Io(this,e,t,0),s=!xs(e)||e!==this._$AH&&e!==Ro,s&&(this._$AH=e);else{const a=e;let c,l;for(e=n[0],c=0;c{const r=(t==null?void 0:t.renderBefore)??e;let o=r._$litPart$;if(o===void 0){const n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new Ks(e.insertBefore(ys(),n),n,void 0,t??{})}return o._$AI(i),o};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let ce=class extends io{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=f3(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Ro}};var a0;ce._$litElement$=!0,ce.finalized=!0,(a0=globalThis.litElementHydrateSupport)==null||a0.call(globalThis,{LitElement:ce});const dl=globalThis.litElementPolyfillSupport;dl==null||dl({LitElement:ce});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const g3={attribute:!0,type:String,converter:Oa,reflect:!1,hasChanged:Iu},w3=(i=g3,e,t)=>{const{kind:r,metadata:o}=t;let n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),n.set(t.name,i),r==="accessor"){const{name:s}=t;return{set(a){const c=e.get.call(this);e.set.call(this,a),this.requestUpdate(s,c,i)},init(a){return a!==void 0&&this.P(s,void 0,i),a}}}if(r==="setter"){const{name:s}=t;return function(a){const c=this[s];e.call(this,a),this.requestUpdate(s,c,i)}}throw Error("Unsupported decorator location: "+r)};function ge(i){return(e,t)=>typeof t=="object"?w3(i,e,t):((r,o,n)=>{const s=o.hasOwnProperty(n);return o.constructor.createProperty(n,s?{...r,wrapped:!0}:r),s?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function U(i){return ge({...i,state:!0,attribute:!1})}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const be=i=>i??ut;var vi=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ti=class extends ce{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.address=te.state.address,this.balanceVal=te.state.balance,this.balanceSymbol=te.state.balanceSymbol,this.profileName=te.state.profileName,this.profileImage=te.state.profileImage,this.network=de.state.caipNetwork,this.isUnsupportedChain=de.state.isUnsupportedChain,this.unsubscribe.push(te.subscribe(e=>{e.isConnected?(this.address=e.address,this.balanceVal=e.balance,this.profileName=e.profileName,this.profileImage=e.profileImage,this.balanceSymbol=e.balanceSymbol):(this.address="",this.balanceVal="",this.profileName="",this.profileImage="",this.balanceSymbol="")}),de.subscribeKey("caipNetwork",e=>this.network=e),de.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=He.getNetworkImage(this.network),t=this.balance==="show";return T` + + + `}onClick(){this.isUnsupportedChain?Re.open({view:"UnsupportedChain"}):Re.open()}};vi([ge({type:Boolean})],ti.prototype,"disabled",void 0);vi([ge()],ti.prototype,"balance",void 0);vi([ge()],ti.prototype,"charsStart",void 0);vi([ge()],ti.prototype,"charsEnd",void 0);vi([U()],ti.prototype,"address",void 0);vi([U()],ti.prototype,"balanceVal",void 0);vi([U()],ti.prototype,"balanceSymbol",void 0);vi([U()],ti.prototype,"profileName",void 0);vi([U()],ti.prototype,"profileImage",void 0);vi([U()],ti.prototype,"network",void 0);vi([U()],ti.prototype,"isUnsupportedChain",void 0);ti=vi([V("w3m-account-button")],ti);const m3=_e` + :host { + display: block; + width: max-content; + } +`;var yn=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ii=class extends ce{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.isAccount=te.state.isConnected,this.unsubscribe.push(te.subscribeKey("isConnected",e=>{this.isAccount=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.isAccount?T` + + + `:T` + + `}};Ii.styles=m3;yn([ge({type:Boolean})],Ii.prototype,"disabled",void 0);yn([ge()],Ii.prototype,"balance",void 0);yn([ge()],Ii.prototype,"size",void 0);yn([ge()],Ii.prototype,"label",void 0);yn([ge()],Ii.prototype,"loadingLabel",void 0);yn([ge()],Ii.prototype,"charsStart",void 0);yn([ge()],Ii.prototype,"charsEnd",void 0);yn([U()],Ii.prototype,"isAccount",void 0);Ii=yn([V("w3m-button")],Ii);var zo=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Pr=class extends ce{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=Re.state.open,this.loading=Re.state.loading,this.unsubscribe.push(Re.subscribe(e=>{this.open=e.open,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.loading||this.open;return T` + + ${e?this.loadingLabel:this.label} + + `}onClick(){this.open?Re.close():this.loading||Re.open()}};zo([ge()],Pr.prototype,"size",void 0);zo([ge()],Pr.prototype,"label",void 0);zo([ge()],Pr.prototype,"loadingLabel",void 0);zo([U()],Pr.prototype,"open",void 0);zo([U()],Pr.prototype,"loading",void 0);Pr=zo([V("w3m-connect-button")],Pr);const v3=_e` + :host { + z-index: var(--w3m-z-index); + display: block; + backface-visibility: hidden; + will-change: opacity; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + pointer-events: none; + opacity: 0; + background-color: var(--wui-cover); + } + + @keyframes zoom-in { + 0% { + transform: scale(0.95) translateY(0); + } + 100% { + transform: scale(1) translateY(0); + } + } + + @keyframes slide-in { + 0% { + transform: scale(1) translateY(50px); + } + 100% { + transform: scale(1) translateY(0); + } + } + + wui-card { + max-width: 360px; + width: 100%; + position: relative; + animation-duration: 0.2s; + animation-name: zoom-in; + animation-fill-mode: backwards; + animation-timing-function: var(--wui-ease-out-power-2); + outline: none; + } + + wui-flex { + overflow-x: hidden; + overflow-y: auto; + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + } + + @media (max-height: 700px) and (min-width: 431px) { + wui-flex { + align-items: flex-start; + } + + wui-card { + margin: var(--wui-spacing-xxl) 0px; + } + } + + @media (max-width: 430px) { + wui-flex { + align-items: flex-end; + } + + wui-card { + max-width: 100%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom: none; + animation-name: slide-in; + } + } +`;var Sc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const $d="scroll-lock";let Nr=class extends ce{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.open=Re.state.open,this.caipAddress=te.state.caipAddress,this.isSiweEnabled=pe.state.isSiweEnabled,this.initializeTheming(),xe.prefetch(),this.unsubscribe.push(Re.subscribeKey("open",e=>e?this.onOpen():this.onClose()),te.subscribe(e=>this.onNewAccountState(e))),we.sendEvent({type:"track",event:"MODAL_LOADED"})}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.open?T` + + + + + + + + `:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){if(this.isSiweEnabled){const{SIWEController:e}=await On(()=>import("./index.gqgjn4wa.js"),[],import.meta.url);e.state.status!=="success"&&await ke.disconnect()}Re.close()}initializeTheming(){const{themeVariables:e,themeMode:t}=ft.state,r=ve.getColorTheme(t);q0(e,r)}async onClose(){this.onScrollUnlock(),await this.animate([{opacity:1},{opacity:0}],{duration:200,easing:"ease",fill:"forwards"}).finished,Le.hide(),this.open=!1,this.onRemoveKeyboardListener()}async onOpen(){this.onScrollLock(),this.open=!0,await this.animate([{opacity:0},{opacity:1}],{duration:200,easing:"ease",fill:"forwards"}).finished,this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=$d,e.textContent=` + html, body { + touch-action: none; + overflow: hidden; + overscroll-behavior: contain; + } + w3m-modal { + pointer-events: auto; + } + `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${$d}"]`);e&&e.remove()}onAddKeyboardListener(){var t;this.abortController=new AbortController;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",r=>{if(r.key==="Escape")this.handleClose();else if(r.key==="Tab"){const{tagName:o}=r.target;o&&!o.includes("W3M-")&&!o.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}async onNewAccountState(e){const{isConnected:t,caipAddress:r}=e;if(this.isSiweEnabled){const{SIWEController:o}=await On(()=>import("./index.gqgjn4wa.js"),[],import.meta.url);t&&!this.caipAddress&&(this.caipAddress=r),t&&r&&this.caipAddress!==r&&(await o.signOut(),this.onSiweNavigation(),this.caipAddress=r);try{const n=await o.getSession();n&&!t?await o.signOut():t&&!n&&this.onSiweNavigation()}catch{t&&this.onSiweNavigation()}}}onSiweNavigation(){this.open?G.push("ConnectingSiwe"):Re.open({view:"ConnectingSiwe"})}};Nr.styles=v3;Sc([U()],Nr.prototype,"open",void 0);Sc([U()],Nr.prototype,"caipAddress",void 0);Sc([U()],Nr.prototype,"isSiweEnabled",void 0);Nr=Sc([V("w3m-modal")],Nr);const b3=Object.freeze(Object.defineProperty({__proto__:null,get W3mModal(){return Nr}},Symbol.toStringTag,{value:"Module"})),y3=_e` + :host { + display: block; + width: max-content; + } +`;var Fo=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Vn=class extends ce{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=de.state.caipNetwork,this.connected=te.state.isConnected,this.loading=Re.state.loading,this.isUnsupportedChain=de.state.isUnsupportedChain,this.unsubscribe.push(de.subscribeKey("caipNetwork",e=>this.network=e),te.subscribeKey("isConnected",e=>this.connected=e),Re.subscribeKey("loading",e=>this.loading=e),de.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return T` + + ${this.isUnsupportedChain?"Switch Network":((e=this.network)==null?void 0:e.name)??(this.connected?"Unknown Network":"Select Network")} + + `}onClick(){this.loading||(we.sendEvent({type:"track",event:"CLICK_NETWORKS"}),Re.open({view:"Networks"}))}};Vn.styles=y3;Fo([ge({type:Boolean})],Vn.prototype,"disabled",void 0);Fo([U()],Vn.prototype,"network",void 0);Fo([U()],Vn.prototype,"connected",void 0);Fo([U()],Vn.prototype,"loading",void 0);Fo([U()],Vn.prototype,"isUnsupportedChain",void 0);Vn=Fo([V("w3m-network-button")],Vn);const x3=_e` + :host { + display: block; + will-change: transform, opacity; + } +`;var I1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Na=class extends ce{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=G.state.view,this.unsubscribe.push(G.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(async([e])=>{const t=`${e==null?void 0:e.contentRect.height}px`;this.prevHeight!=="0px"&&(await this.animate([{height:this.prevHeight},{height:t}],{duration:150,easing:"ease",fill:"forwards"}).finished,this.style.height="auto"),this.prevHeight=t}),this.resizeObserver.observe(this.getWrapper())}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.unobserve(this.getWrapper()),this.unsubscribe.forEach(t=>t())}render(){return T`
${this.viewTemplate()}
`}viewTemplate(){switch(this.view){case"Connect":return T``;case"ConnectingWalletConnect":return T``;case"ConnectingExternal":return T``;case"ConnectingSiwe":return T``;case"AllWallets":return T``;case"Networks":return T``;case"SwitchNetwork":return T``;case"Account":return T``;case"AccountSettings":return T``;case"WhatIsAWallet":return T``;case"WhatIsANetwork":return T``;case"GetWallet":return T``;case"Downloads":return T``;case"EmailVerifyOtp":return T``;case"EmailVerifyDevice":return T``;case"ApproveTransaction":return T``;case"Transactions":return T``;case"UpgradeEmailWallet":return T``;case"UpgradeToSmartAccount":return T``;case"UpdateEmailWallet":return T``;case"UpdateEmailPrimaryOtp":return T``;case"UpdateEmailSecondaryOtp":return T``;case"UnsupportedChain":return T``;case"OnRampProviders":return T``;case"OnRampActivity":return T``;case"OnRampTokenSelect":return T``;case"OnRampFiatSelect":return T``;case"WhatIsABuy":return T``;case"BuyInProgress":return T``;case"WalletReceive":return T``;case"WalletCompatibleNetworks":return T``;case"Convert":return T``;case"ConvertSelectToken":return T``;case"ConvertPreview":return T``;case"WalletSend":return T``;case"WalletSendSelectToken":return T``;case"WalletSendPreview":return T``;default:return T``}}async onViewChange(e){const{history:t}=G.state;let r=-10,o=10;t.length wui-flex { + width: 100%; + max-width: 360px; + } + + :host > wui-flex > wui-flex { + border-radius: var(--wui-border-radius-l); + width: 100%; + } + + .amounts-container { + width: 100%; + } +`;var tr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const _3={USD:"$",EUR:"€",GBP:"£"},E3=[100,250,500,1e3];let Gi=class extends ce{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.connected=te.state.isConnected,this.loading=Re.state.loading,this.paymentCurrency=Fe.state.paymentCurrency,this.paymentAmount=Fe.state.paymentAmount,this.purchaseAmount=Fe.state.purchaseAmount,this.quoteLoading=Fe.state.quotesLoading,this.unsubscribe.push(te.subscribeKey("isConnected",e=>{this.connected=e}),Re.subscribeKey("loading",e=>{this.loading=e}),Fe.subscribe(e=>{this.paymentCurrency=e.paymentCurrency,this.paymentAmount=e.paymentAmount,this.purchaseAmount=e.purchaseAmount,this.quoteLoading=e.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` + + + + + + ${E3.map(e=>{var t;return T`this.selectPresetAmount(e)} + >${`${_3[((t=this.paymentCurrency)==null?void 0:t.id)||"USD"]} ${e}`}`})} + + ${this.templateButton()} + + + `}templateButton(){return this.connected?T` + Get quotes + `:T` + Connect wallet + `}getQuotes(){this.loading||Re.open({view:"OnRampProviders"})}openModal(){Re.open({view:"Connect"})}async onPaymentAmountChange(e){Fe.setPaymentAmount(Number(e.detail)),await Fe.getQuote()}async selectPresetAmount(e){Fe.setPaymentAmount(e),await Fe.getQuote()}};Gi.styles=C3;tr([ge({type:Boolean})],Gi.prototype,"disabled",void 0);tr([U()],Gi.prototype,"connected",void 0);tr([U()],Gi.prototype,"loading",void 0);tr([U()],Gi.prototype,"paymentCurrency",void 0);tr([U()],Gi.prototype,"paymentAmount",void 0);tr([U()],Gi.prototype,"purchaseAmount",void 0);tr([U()],Gi.prototype,"quoteLoading",void 0);Gi=tr([V("w3m-onramp-widget")],Gi);const T3=_e` + wui-flex { + width: 100%; + } + + wui-icon-link { + margin-right: calc(var(--wui-icon-box-size-md) * -1); + } + + .account-links { + display: flex; + justify-content: space-between; + align-items: center; + } + + .account-links wui-flex { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + flex: 1; + background: red; + align-items: center; + justify-content: center; + height: 48px; + padding: 10px; + flex: 1 0 0; + + border-radius: var(--XS, 16px); + border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + .account-links wui-flex:hover { + background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); + } + + .account-links wui-flex wui-icon { + width: var(--S, 20px); + height: var(--S, 20px); + } + + .account-links wui-flex wui-icon svg path { + stroke: #47a1ff; + } +`;var O1={},kc={};kc.byteLength=k3;kc.toByteArray=R3;kc.fromByteArray=P3;var ji=[],hi=[],A3=typeof Uint8Array<"u"?Uint8Array:Array,hl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var eo=0,S3=hl.length;eo0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function k3(i){var e=P1(i),t=e[0],r=e[1];return(t+r)*3/4-r}function $3(i,e,t){return(e+t)*3/4-t}function R3(i){var e,t=P1(i),r=t[0],o=t[1],n=new A3($3(i,r,o)),s=0,a=o>0?r-4:r,c;for(c=0;c>16&255,n[s++]=e>>8&255,n[s++]=e&255;return o===2&&(e=hi[i.charCodeAt(c)]<<2|hi[i.charCodeAt(c+1)]>>4,n[s++]=e&255),o===1&&(e=hi[i.charCodeAt(c)]<<10|hi[i.charCodeAt(c+1)]<<4|hi[i.charCodeAt(c+2)]>>2,n[s++]=e>>8&255,n[s++]=e&255),n}function I3(i){return ji[i>>18&63]+ji[i>>12&63]+ji[i>>6&63]+ji[i&63]}function O3(i,e,t){for(var r,o=[],n=e;na?a:s+n));return r===1?(e=i[t-1],o.push(ji[e>>2]+ji[e<<4&63]+"==")):r===2&&(e=(i[t-2]<<8)+i[t-1],o.push(ji[e>>10]+ji[e>>4&63]+ji[e<<2&63]+"=")),o.join("")}var Ou={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Ou.read=function(i,e,t,r,o){var n,s,a=o*8-r-1,c=(1<>1,h=-7,p=t?o-1:0,v=t?-1:1,S=i[e+p];for(p+=v,n=S&(1<<-h)-1,S>>=-h,h+=a;h>0;n=n*256+i[e+p],p+=v,h-=8);for(s=n&(1<<-h)-1,n>>=-h,h+=r;h>0;s=s*256+i[e+p],p+=v,h-=8);if(n===0)n=1-l;else{if(n===c)return s?NaN:(S?-1:1)*(1/0);s=s+Math.pow(2,r),n=n-l}return(S?-1:1)*s*Math.pow(2,n-r)};Ou.write=function(i,e,t,r,o,n){var s,a,c,l=n*8-o-1,h=(1<>1,v=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=r?0:n-1,O=r?1:-1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+p>=1?e+=v/c:e+=v*Math.pow(2,1-p),e*c>=2&&(s++,c/=2),s+p>=h?(a=0,s=h):s+p>=1?(a=(e*c-1)*Math.pow(2,o),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;i[t+S]=a&255,S+=O,a/=256,o-=8);for(s=s<0;i[t+S]=s&255,S+=O,s/=256,l-=8);i[t+S-O]|=D*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(i){const e=kc,t=Ou,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=a,i.SlowBuffer=k,i.INSPECT_MAX_BYTES=50;const o=2147483647;i.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=n(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function n(){try{const g=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(g,u),g.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(g){if(g>o)throw new RangeError('The value "'+g+'" is invalid for option "size"');const u=new Uint8Array(g);return Object.setPrototypeOf(u,a.prototype),u}function a(g,u,d){if(typeof g=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(g)}return c(g,u,d)}a.poolSize=8192;function c(g,u,d){if(typeof g=="string")return v(g,u);if(ArrayBuffer.isView(g))return O(g);if(g==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g);if(Bi(g,ArrayBuffer)||g&&Bi(g.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Bi(g,SharedArrayBuffer)||g&&Bi(g.buffer,SharedArrayBuffer)))return D(g,u,d);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const x=g.valueOf&&g.valueOf();if(x!=null&&x!==g)return a.from(x,u,d);const L=R(g);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof g[Symbol.toPrimitive]=="function")return a.from(g[Symbol.toPrimitive]("string"),u,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g)}a.from=function(g,u,d){return c(g,u,d)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(g){if(typeof g!="number")throw new TypeError('"size" argument must be of type number');if(g<0)throw new RangeError('The value "'+g+'" is invalid for option "size"')}function h(g,u,d){return l(g),g<=0?s(g):u!==void 0?typeof d=="string"?s(g).fill(u,d):s(g).fill(u):s(g)}a.alloc=function(g,u,d){return h(g,u,d)};function p(g){return l(g),s(g<0?0:B(g)|0)}a.allocUnsafe=function(g){return p(g)},a.allocUnsafeSlow=function(g){return p(g)};function v(g,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const d=W(g,u)|0;let x=s(d);const L=x.write(g,u);return L!==d&&(x=x.slice(0,L)),x}function S(g){const u=g.length<0?0:B(g.length)|0,d=s(u);for(let x=0;x=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return g|0}function k(g){return+g!=g&&(g=0),a.alloc(+g)}a.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==a.prototype},a.compare=function(u,d){if(Bi(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),Bi(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(u)||!a.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===d)return 0;let x=u.length,L=d.length;for(let H=0,q=Math.min(x,L);HL.length?(a.isBuffer(q)||(q=a.from(q)),q.copy(L,H)):Uint8Array.prototype.set.call(L,q,H);else if(a.isBuffer(q))q.copy(L,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=q.length}return L};function W(g,u){if(a.isBuffer(g))return g.length;if(ArrayBuffer.isView(g)||Bi(g,ArrayBuffer))return g.byteLength;if(typeof g!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof g);const d=g.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&d===0)return 0;let L=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return Mc(g).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return Hu(g).length;default:if(L)return x?-1:Mc(g).length;u=(""+u).toLowerCase(),L=!0}}a.byteLength=W;function M(g,u,d){let x=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,u>>>=0,d<=u))return"";for(g||(g="utf8");;)switch(g){case"hex":return F(this,u,d);case"utf8":case"utf-8":return P(this,u,d);case"ascii":return I(this,u,d);case"latin1":case"binary":return $(this,u,d);case"base64":return N(this,u,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,u,d);default:if(x)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),x=!0}}a.prototype._isBuffer=!0;function j(g,u,d){const x=g[u];g[u]=g[d],g[d]=x}a.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;dd&&(u+=" ... "),""},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(u,d,x,L,H){if(Bi(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(d===void 0&&(d=0),x===void 0&&(x=u?u.length:0),L===void 0&&(L=0),H===void 0&&(H=this.length),d<0||x>u.length||L<0||H>this.length)throw new RangeError("out of range index");if(L>=H&&d>=x)return 0;if(L>=H)return-1;if(d>=x)return 1;if(d>>>=0,x>>>=0,L>>>=0,H>>>=0,this===u)return 0;let q=H-L,De=x-d;const rt=Math.min(q,De),et=this.slice(L,H),ot=u.slice(d,x);for(let Ge=0;Ge2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,Lc(d)&&(d=L?0:g.length-1),d<0&&(d=g.length+d),d>=g.length){if(L)return-1;d=g.length-1}else if(d<0)if(L)d=0;else return-1;if(typeof u=="string"&&(u=a.from(u,x)),a.isBuffer(u))return u.length===0?-1:ie(g,u,d,x,L);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(g,u,d):Uint8Array.prototype.lastIndexOf.call(g,u,d):ie(g,[u],d,x,L);throw new TypeError("val must be string, number or Buffer")}function ie(g,u,d,x,L){let H=1,q=g.length,De=u.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(g.length<2||u.length<2)return-1;H=2,q/=2,De/=2,d/=2}function rt(ot,Ge){return H===1?ot[Ge]:ot.readUInt16BE(Ge*H)}let et;if(L){let ot=-1;for(et=d;etq&&(d=q-De),et=d;et>=0;et--){let ot=!0;for(let Ge=0;GeL&&(x=L)):x=L;const H=u.length;x>H/2&&(x=H/2);let q;for(q=0;q>>0,isFinite(x)?(x=x>>>0,L===void 0&&(L="utf8")):(L=x,x=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const H=this.length-d;if((x===void 0||x>H)&&(x=H),u.length>0&&(x<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");L||(L="utf8");let q=!1;for(;;)switch(L){case"hex":return f(this,u,d,x);case"utf8":case"utf-8":return w(this,u,d,x);case"ascii":case"latin1":case"binary":return m(this,u,d,x);case"base64":return A(this,u,d,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,u,d,x);default:if(q)throw new TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),q=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(g,u,d){return u===0&&d===g.length?e.fromByteArray(g):e.fromByteArray(g.slice(u,d))}function P(g,u,d){d=Math.min(g.length,d);const x=[];let L=u;for(;L239?4:H>223?3:H>191?2:1;if(L+De<=d){let rt,et,ot,Ge;switch(De){case 1:H<128&&(q=H);break;case 2:rt=g[L+1],(rt&192)===128&&(Ge=(H&31)<<6|rt&63,Ge>127&&(q=Ge));break;case 3:rt=g[L+1],et=g[L+2],(rt&192)===128&&(et&192)===128&&(Ge=(H&15)<<12|(rt&63)<<6|et&63,Ge>2047&&(Ge<55296||Ge>57343)&&(q=Ge));break;case 4:rt=g[L+1],et=g[L+2],ot=g[L+3],(rt&192)===128&&(et&192)===128&&(ot&192)===128&&(Ge=(H&15)<<18|(rt&63)<<12|(et&63)<<6|ot&63,Ge>65535&&Ge<1114112&&(q=Ge))}}q===null?(q=65533,De=1):q>65535&&(q-=65536,x.push(q>>>10&1023|55296),q=56320|q&1023),x.push(q),L+=De}return E(x)}const y=4096;function E(g){const u=g.length;if(u<=y)return String.fromCharCode.apply(String,g);let d="",x=0;for(;xx)&&(d=x);let L="";for(let H=u;Hx&&(u=x),d<0?(d+=x,d<0&&(d=0)):d>x&&(d=x),dd)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(u,d,x){u=u>>>0,d=d>>>0,x||K(u,d,this.length);let L=this[u],H=1,q=0;for(;++q>>0,d=d>>>0,x||K(u,d,this.length);let L=this[u+--d],H=1;for(;d>0&&(H*=256);)L+=this[u+--d]*H;return L},a.prototype.readUint8=a.prototype.readUInt8=function(u,d){return u=u>>>0,d||K(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,d){return u=u>>>0,d||K(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,d){return u=u>>>0,d||K(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,d){return u=u>>>0,d||K(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(u,d){return u=u>>>0,d||K(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},a.prototype.readBigUInt64LE=xn(function(u){u=u>>>0,Xe(u,"offset");const d=this[u],x=this[u+7];(d===void 0||x===void 0)&&ct(u,this.length-8);const L=d+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,H=this[++u]+this[++u]*2**8+this[++u]*2**16+x*2**24;return BigInt(L)+(BigInt(H)<>>0,Xe(u,"offset");const d=this[u],x=this[u+7];(d===void 0||x===void 0)&&ct(u,this.length-8);const L=d*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],H=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+x;return(BigInt(L)<>>0,d=d>>>0,x||K(u,d,this.length);let L=this[u],H=1,q=0;for(;++q=H&&(L-=Math.pow(2,8*d)),L},a.prototype.readIntBE=function(u,d,x){u=u>>>0,d=d>>>0,x||K(u,d,this.length);let L=d,H=1,q=this[u+--L];for(;L>0&&(H*=256);)q+=this[u+--L]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*d)),q},a.prototype.readInt8=function(u,d){return u=u>>>0,d||K(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,d){u=u>>>0,d||K(u,2,this.length);const x=this[u]|this[u+1]<<8;return x&32768?x|4294901760:x},a.prototype.readInt16BE=function(u,d){u=u>>>0,d||K(u,2,this.length);const x=this[u+1]|this[u]<<8;return x&32768?x|4294901760:x},a.prototype.readInt32LE=function(u,d){return u=u>>>0,d||K(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},a.prototype.readInt32BE=function(u,d){return u=u>>>0,d||K(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},a.prototype.readBigInt64LE=xn(function(u){u=u>>>0,Xe(u,"offset");const d=this[u],x=this[u+7];(d===void 0||x===void 0)&&ct(u,this.length-8);const L=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(x<<24);return(BigInt(L)<>>0,Xe(u,"offset");const d=this[u],x=this[u+7];(d===void 0||x===void 0)&&ct(u,this.length-8);const L=(d<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(L)<>>0,d||K(u,4,this.length),t.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,d){return u=u>>>0,d||K(u,4,this.length),t.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,d){return u=u>>>0,d||K(u,8,this.length),t.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,d){return u=u>>>0,d||K(u,8,this.length),t.read(this,u,!1,52,8)};function se(g,u,d,x,L,H){if(!a.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>L||ug.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,d,x,L){if(u=+u,d=d>>>0,x=x>>>0,!L){const De=Math.pow(2,8*x)-1;se(this,u,d,x,De,0)}let H=1,q=0;for(this[d]=u&255;++q>>0,x=x>>>0,!L){const De=Math.pow(2,8*x)-1;se(this,u,d,x,De,0)}let H=x-1,q=1;for(this[d+H]=u&255;--H>=0&&(q*=256);)this[d+H]=u/q&255;return d+x},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,1,255,0),this[d]=u&255,d+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,2,65535,0),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,2,65535,0),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,4,4294967295,0),this[d+3]=u>>>24,this[d+2]=u>>>16,this[d+1]=u>>>8,this[d]=u&255,d+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,4,4294967295,0),this[d]=u>>>24,this[d+1]=u>>>16,this[d+2]=u>>>8,this[d+3]=u&255,d+4};function Te(g,u,d,x,L){Wt(u,x,L,g,d,7);let H=Number(u&BigInt(4294967295));g[d++]=H,H=H>>8,g[d++]=H,H=H>>8,g[d++]=H,H=H>>8,g[d++]=H;let q=Number(u>>BigInt(32)&BigInt(4294967295));return g[d++]=q,q=q>>8,g[d++]=q,q=q>>8,g[d++]=q,q=q>>8,g[d++]=q,d}function Pe(g,u,d,x,L){Wt(u,x,L,g,d,7);let H=Number(u&BigInt(4294967295));g[d+7]=H,H=H>>8,g[d+6]=H,H=H>>8,g[d+5]=H,H=H>>8,g[d+4]=H;let q=Number(u>>BigInt(32)&BigInt(4294967295));return g[d+3]=q,q=q>>8,g[d+2]=q,q=q>>8,g[d+1]=q,q=q>>8,g[d]=q,d+8}a.prototype.writeBigUInt64LE=xn(function(u,d=0){return Te(this,u,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=xn(function(u,d=0){return Pe(this,u,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(u,d,x,L){if(u=+u,d=d>>>0,!L){const rt=Math.pow(2,8*x-1);se(this,u,d,x,rt-1,-rt)}let H=0,q=1,De=0;for(this[d]=u&255;++H>0)-De&255;return d+x},a.prototype.writeIntBE=function(u,d,x,L){if(u=+u,d=d>>>0,!L){const rt=Math.pow(2,8*x-1);se(this,u,d,x,rt-1,-rt)}let H=x-1,q=1,De=0;for(this[d+H]=u&255;--H>=0&&(q*=256);)u<0&&De===0&&this[d+H+1]!==0&&(De=1),this[d+H]=(u/q>>0)-De&255;return d+x},a.prototype.writeInt8=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,1,127,-128),u<0&&(u=255+u+1),this[d]=u&255,d+1},a.prototype.writeInt16LE=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,2,32767,-32768),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeInt16BE=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,2,32767,-32768),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeInt32LE=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,4,2147483647,-2147483648),this[d]=u&255,this[d+1]=u>>>8,this[d+2]=u>>>16,this[d+3]=u>>>24,d+4},a.prototype.writeInt32BE=function(u,d,x){return u=+u,d=d>>>0,x||se(this,u,d,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[d]=u>>>24,this[d+1]=u>>>16,this[d+2]=u>>>8,this[d+3]=u&255,d+4},a.prototype.writeBigInt64LE=xn(function(u,d=0){return Te(this,u,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=xn(function(u,d=0){return Pe(this,u,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(g,u,d,x,L,H){if(d+x>g.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Ne(g,u,d,x,L){return u=+u,d=d>>>0,L||ye(g,u,d,4),t.write(g,u,d,x,23,4),d+4}a.prototype.writeFloatLE=function(u,d,x){return Ne(this,u,d,!0,x)},a.prototype.writeFloatBE=function(u,d,x){return Ne(this,u,d,!1,x)};function Ze(g,u,d,x,L){return u=+u,d=d>>>0,L||ye(g,u,d,8),t.write(g,u,d,x,52,8),d+8}a.prototype.writeDoubleLE=function(u,d,x){return Ze(this,u,d,!0,x)},a.prototype.writeDoubleBE=function(u,d,x){return Ze(this,u,d,!1,x)},a.prototype.copy=function(u,d,x,L){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(x||(x=0),!L&&L!==0&&(L=this.length),d>=u.length&&(d=u.length),d||(d=0),L>0&&L=this.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("sourceEnd out of bounds");L>this.length&&(L=this.length),u.length-d>>0,x=x===void 0?this.length:x>>>0,u||(u=0);let H;if(typeof u=="number")for(H=d;H2**32?L=st(String(d)):typeof d=="bigint"&&(L=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(L=st(L)),L+="n"),x+=` It must be ${u}. Received ${L}`,x},RangeError);function st(g){let u="",d=g.length;const x=g[0]==="-"?1:0;for(;d>=x+4;d-=3)u=`_${g.slice(d-3,d)}${u}`;return`${g.slice(0,d)}${u}`}function at(g,u,d){Xe(u,"offset"),(g[u]===void 0||g[u+d]===void 0)&&ct(u,g.length-(d+1))}function Wt(g,u,d,x,L,H){if(g>d||g= 0${q} and < 2${q} ** ${(H+1)*8}${q}`:De=`>= -(2${q} ** ${(H+1)*8-1}${q}) and < 2 ** ${(H+1)*8-1}${q}`,new Ct.ERR_OUT_OF_RANGE("value",De,g)}at(x,L,H)}function Xe(g,u){if(typeof g!="number")throw new Ct.ERR_INVALID_ARG_TYPE(u,"number",g)}function ct(g,u,d){throw Math.floor(g)!==g?(Xe(g,d),new Ct.ERR_OUT_OF_RANGE("offset","an integer",g)):u<0?new Ct.ERR_BUFFER_OUT_OF_BOUNDS:new Ct.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,g)}const Qe=/[^+/0-9A-Za-z-_]/g;function nh(g){if(g=g.split("=")[0],g=g.trim().replace(Qe,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function Mc(g,u){u=u||1/0;let d;const x=g.length;let L=null;const H=[];for(let q=0;q55295&&d<57344){if(!L){if(d>56319){(u-=3)>-1&&H.push(239,191,189);continue}else if(q+1===x){(u-=3)>-1&&H.push(239,191,189);continue}L=d;continue}if(d<56320){(u-=3)>-1&&H.push(239,191,189),L=d;continue}d=(L-55296<<10|d-56320)+65536}else L&&(u-=3)>-1&&H.push(239,191,189);if(L=null,d<128){if((u-=1)<0)break;H.push(d)}else if(d<2048){if((u-=2)<0)break;H.push(d>>6|192,d&63|128)}else if(d<65536){if((u-=3)<0)break;H.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((u-=4)<0)break;H.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return H}function rh(g){const u=[];for(let d=0;d>8,L=d%256,H.push(L),H.push(x);return H}function Hu(g){return e.toByteArray(nh(g))}function ra(g,u,d,x){let L;for(L=0;L=u.length||L>=g.length);++L)u[L+d]=g[L];return L}function Bi(g,u){return g instanceof u||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===u.name}function Lc(g){return g!==g}const sh=function(){const g="0123456789abcdef",u=new Array(256);for(let d=0;d<16;++d){const x=d*16;for(let L=0;L<16;++L)u[x+L]=g[d]+g[L]}return u}();function xn(g){return typeof BigInt>"u"?ah:g}function ah(){throw new Error("BigInt not supported")}})(O1);var c0;typeof window<"u"&&(window.Buffer||(window.Buffer=O1.Buffer),window.global||(window.global=window),window.process||(window.process={}),(c0=window.process)!=null&&c0.env||(window.process={env:{}}));var N3={};const D3=N3.NEXT_PUBLIC_SECURE_SITE_SDK_URL||"https://secure.walletconnect.com/sdk",ee={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@w3m-storage/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},Bt={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}};var je;(function(i){i.assertEqual=o=>o;function e(o){}i.assertIs=e;function t(o){throw new Error}i.assertNever=t,i.arrayToEnum=o=>{const n={};for(const s of o)n[s]=s;return n},i.getValidEnumValues=o=>{const n=i.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of n)s[a]=o[a];return i.objectValues(s)},i.objectValues=o=>i.objectKeys(o).map(function(n){return o[n]}),i.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const n=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&n.push(s);return n},i.find=(o,n)=>{for(const s of o)if(n(s))return s},i.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,n=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(n)}i.joinValues=r,i.jsonStringifyReplacer=(o,n)=>typeof n=="bigint"?n.toString():n})(je||(je={}));var Tl;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(Tl||(Tl={}));const ae=je.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sn=i=>{switch(typeof i){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(i)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(i)?ae.array:i===null?ae.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ae.promise:typeof Map<"u"&&i instanceof Map?ae.map:typeof Set<"u"&&i instanceof Set?ae.set:typeof Date<"u"&&i instanceof Date?ae.date:ae.object;default:return ae.unknown}},Q=je.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),M3=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class Ti extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(n){return n.message},r={_errors:[]},o=n=>{for(const s of n.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(t(s));else{let a=r,c=0;for(;ct.message){const t={},r=[];for(const o of this.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(e(o))):r.push(e(o));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}Ti.create=i=>new Ti(i);const _s=(i,e)=>{let t;switch(i.code){case Q.invalid_type:i.received===ae.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case Q.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,je.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:t=`Unrecognized key(s) in object: ${je.joinValues(i.keys,", ")}`;break;case Q.invalid_union:t="Invalid input";break;case Q.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${je.joinValues(i.options)}`;break;case Q.invalid_enum_value:t=`Invalid enum value. Expected ${je.joinValues(i.options)}, received '${i.received}'`;break;case Q.invalid_arguments:t="Invalid function arguments";break;case Q.invalid_return_type:t="Invalid function return type";break;case Q.invalid_date:t="Invalid date";break;case Q.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:je.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case Q.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case Q.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case Q.custom:t="Invalid input";break;case Q.invalid_intersection_types:t="Intersection results could not be merged";break;case Q.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case Q.not_finite:t="Number must be finite";break;default:t=e.defaultError,je.assertNever(i)}return{message:t}};let N1=_s;function L3(i){N1=i}function Da(){return N1}const Ma=i=>{const{data:e,path:t,errorMaps:r,issueData:o}=i,n=[...t,...o.path||[]],s={...o,path:n};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(s,{data:e,defaultError:a}).message;return{...o,path:n,message:o.message||a}},B3=[];function le(i,e){const t=Ma({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Da(),_s].filter(r=>!!r)});i.common.issues.push(t)}class Ot{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const o of t){if(o.status==="aborted")return Ae;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const o of t)r.push({key:await o.key,value:await o.value});return Ot.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const o of t){const{key:n,value:s}=o;if(n.status==="aborted"||s.status==="aborted")return Ae;n.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[n.value]=s.value)}return{status:e.value,value:r}}}const Ae=Object.freeze({status:"aborted"}),D1=i=>({status:"dirty",value:i}),jt=i=>({status:"valid",value:i}),Al=i=>i.status==="aborted",Sl=i=>i.status==="dirty",Es=i=>i.status==="valid",La=i=>typeof Promise<"u"&&i instanceof Promise;var fe;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));class qi{constructor(e,t,r,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Rd=(i,e)=>{if(Es(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Ti(i.common.issues);return this._error=t,this._error}}};function $e(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:o}=i;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:t??a.defaultError},description:o}}class Ie{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Sn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ot,ctx:{common:e.parent.common,data:e.data,parsedType:Sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(La(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const o={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sn(e)},n=this._parseSync({data:e,path:o.path,parent:o});return Rd(o,n)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sn(e)},o=this._parse({data:e,path:r.path,parent:r}),n=await(La(o)?o:Promise.resolve(o));return Rd(r,n)}refine(e,t){const r=o=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(o):t;return this._refinement((o,n)=>{const s=e(o),a=()=>n.addIssue({code:Q.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof t=="function"?t(r,o):t),!1))}_refinement(e){return new Oi({schema:this,typeName:Ce.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return cn.create(this,this._def)}nullable(){return Lr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ai.create(this,this._def)}promise(){return Po.create(this,this._def)}or(e){return ks.create([this,e],this._def)}and(e){return $s.create(this,e,this._def)}transform(e){return new Oi({...$e(this._def),schema:this,typeName:Ce.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ns({...$e(this._def),innerType:this,defaultValue:t,typeName:Ce.ZodDefault})}brand(){return new L1({typeName:Ce.ZodBranded,type:this,...$e(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Wa({...$e(this._def),innerType:this,catchValue:t,typeName:Ce.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Js.create(this,e)}readonly(){return Fa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const U3=/^c[^\s-]{8,}$/i,j3=/^[a-z][a-z0-9]*$/,W3=/^[0-9A-HJKMNP-TV-Z]{26}$/,z3=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,F3=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,H3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let pl;const V3=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Z3=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,G3=i=>i.precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):i.precision===0?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function q3(i,e){return!!((e==="v4"||!e)&&V3.test(i)||(e==="v6"||!e)&&Z3.test(i))}class _i extends Ie{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const n=this._getOrReturnCtx(e);return le(n,{code:Q.invalid_type,expected:ae.string,received:n.parsedType}),Ae}const r=new Ot;let o;for(const n of this._def.checks)if(n.kind==="min")e.data.lengthn.value&&(o=this._getOrReturnCtx(e,o),le(o,{code:Q.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const s=e.data.length>n.value,a=e.data.lengthe.test(o),{validation:t,code:Q.invalid_string,...fe.errToObj(r)})}_addCheck(e){return new _i({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...fe.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...fe.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...fe.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...fe.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...fe.errToObj(t)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new _i({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _i({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _i({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new _i({checks:[],typeName:Ce.ZodString,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...$e(i)})};function Y3(i,e){const t=(i.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=t>r?t:r,n=parseInt(i.toFixed(o).replace(".","")),s=parseInt(e.toFixed(o).replace(".",""));return n%s/Math.pow(10,o)}class Zn extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const n=this._getOrReturnCtx(e);return le(n,{code:Q.invalid_type,expected:ae.number,received:n.parsedType}),Ae}let r;const o=new Ot;for(const n of this._def.checks)n.kind==="int"?je.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),le(r,{code:Q.invalid_type,expected:"integer",received:"float",message:n.message}),o.dirty()):n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),le(r,{code:Q.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),o.dirty()):n.kind==="multipleOf"?Y3(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),le(r,{code:Q.not_multiple_of,multipleOf:n.value,message:n.message}),o.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),le(r,{code:Q.not_finite,message:n.message}),o.dirty()):je.assertNever(n);return{status:o.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,fe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,fe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,fe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,fe.toString(t))}setLimit(e,t,r,o){return new Zn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:fe.toString(o)}]})}_addCheck(e){return new Zn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&je.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew Zn({checks:[],typeName:Ce.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...$e(i)});class Gn extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const n=this._getOrReturnCtx(e);return le(n,{code:Q.invalid_type,expected:ae.bigint,received:n.parsedType}),Ae}let r;const o=new Ot;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),le(r,{code:Q.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),o.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),le(r,{code:Q.not_multiple_of,multipleOf:n.value,message:n.message}),o.dirty()):je.assertNever(n);return{status:o.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,fe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,fe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,fe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,fe.toString(t))}setLimit(e,t,r,o){return new Gn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:fe.toString(o)}]})}_addCheck(e){return new Gn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new Gn({checks:[],typeName:Ce.ZodBigInt,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...$e(i)})};class Ts extends Ie{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const r=this._getOrReturnCtx(e);return le(r,{code:Q.invalid_type,expected:ae.boolean,received:r.parsedType}),Ae}return jt(e.data)}}Ts.create=i=>new Ts({typeName:Ce.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...$e(i)});class Dr extends Ie{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const n=this._getOrReturnCtx(e);return le(n,{code:Q.invalid_type,expected:ae.date,received:n.parsedType}),Ae}if(isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return le(n,{code:Q.invalid_date}),Ae}const r=new Ot;let o;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()n.value&&(o=this._getOrReturnCtx(e,o),le(o,{code:Q.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):je.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Dr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Dr({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:Ce.ZodDate,...$e(i)});class Ba extends Ie{_parse(e){if(this._getType(e)!==ae.symbol){const r=this._getOrReturnCtx(e);return le(r,{code:Q.invalid_type,expected:ae.symbol,received:r.parsedType}),Ae}return jt(e.data)}}Ba.create=i=>new Ba({typeName:Ce.ZodSymbol,...$e(i)});class As extends Ie{_parse(e){if(this._getType(e)!==ae.undefined){const r=this._getOrReturnCtx(e);return le(r,{code:Q.invalid_type,expected:ae.undefined,received:r.parsedType}),Ae}return jt(e.data)}}As.create=i=>new As({typeName:Ce.ZodUndefined,...$e(i)});class Ss extends Ie{_parse(e){if(this._getType(e)!==ae.null){const r=this._getOrReturnCtx(e);return le(r,{code:Q.invalid_type,expected:ae.null,received:r.parsedType}),Ae}return jt(e.data)}}Ss.create=i=>new Ss({typeName:Ce.ZodNull,...$e(i)});class Oo extends Ie{constructor(){super(...arguments),this._any=!0}_parse(e){return jt(e.data)}}Oo.create=i=>new Oo({typeName:Ce.ZodAny,...$e(i)});class gr extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jt(e.data)}}gr.create=i=>new gr({typeName:Ce.ZodUnknown,...$e(i)});class gn extends Ie{_parse(e){const t=this._getOrReturnCtx(e);return le(t,{code:Q.invalid_type,expected:ae.never,received:t.parsedType}),Ae}}gn.create=i=>new gn({typeName:Ce.ZodNever,...$e(i)});class Ua extends Ie{_parse(e){if(this._getType(e)!==ae.undefined){const r=this._getOrReturnCtx(e);return le(r,{code:Q.invalid_type,expected:ae.void,received:r.parsedType}),Ae}return jt(e.data)}}Ua.create=i=>new Ua({typeName:Ce.ZodVoid,...$e(i)});class Ai extends Ie{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),o=this._def;if(t.parsedType!==ae.array)return le(t,{code:Q.invalid_type,expected:ae.array,received:t.parsedType}),Ae;if(o.exactLength!==null){const s=t.data.length>o.exactLength.value,a=t.data.lengtho.maxLength.value&&(le(t,{code:Q.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((s,a)=>o.type._parseAsync(new qi(t,s,t.path,a)))).then(s=>Ot.mergeArray(r,s));const n=[...t.data].map((s,a)=>o.type._parseSync(new qi(t,s,t.path,a)));return Ot.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new Ai({...this._def,minLength:{value:e,message:fe.toString(t)}})}max(e,t){return new Ai({...this._def,maxLength:{value:e,message:fe.toString(t)}})}length(e,t){return new Ai({...this._def,exactLength:{value:e,message:fe.toString(t)}})}nonempty(e){return this.min(1,e)}}Ai.create=(i,e)=>new Ai({type:i,minLength:null,maxLength:null,exactLength:null,typeName:Ce.ZodArray,...$e(e)});function no(i){if(i instanceof nt){const e={};for(const t in i.shape){const r=i.shape[t];e[t]=cn.create(no(r))}return new nt({...i._def,shape:()=>e})}else return i instanceof Ai?new Ai({...i._def,type:no(i.element)}):i instanceof cn?cn.create(no(i.unwrap())):i instanceof Lr?Lr.create(no(i.unwrap())):i instanceof Yi?Yi.create(i.items.map(e=>no(e))):i}class nt extends Ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=je.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ae.object){const l=this._getOrReturnCtx(e);return le(l,{code:Q.invalid_type,expected:ae.object,received:l.parsedType}),Ae}const{status:r,ctx:o}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof gn&&this._def.unknownKeys==="strip"))for(const l in o.data)s.includes(l)||a.push(l);const c=[];for(const l of s){const h=n[l],p=o.data[l];c.push({key:{status:"valid",value:l},value:h._parse(new qi(o,p,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof gn){const l=this._def.unknownKeys;if(l==="passthrough")for(const h of a)c.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(l==="strict")a.length>0&&(le(o,{code:Q.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const h of a){const p=o.data[h];c.push({key:{status:"valid",value:h},value:l._parse(new qi(o,p,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const l=[];for(const h of c){const p=await h.key;l.push({key:p,value:await h.value,alwaysSet:h.alwaysSet})}return l}).then(l=>Ot.mergeObjectSync(r,l)):Ot.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var o,n,s,a;const c=(s=(n=(o=this._def).errorMap)===null||n===void 0?void 0:n.call(o,t,r).message)!==null&&s!==void 0?s:r.defaultError;return t.code==="unrecognized_keys"?{message:(a=fe.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ce.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new nt({...this._def,catchall:e})}pick(e){const t={};return je.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new nt({...this._def,shape:()=>t})}omit(e){const t={};return je.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new nt({...this._def,shape:()=>t})}deepPartial(){return no(this)}partial(e){const t={};return je.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];e&&!e[r]?t[r]=o:t[r]=o.optional()}),new nt({...this._def,shape:()=>t})}required(e){const t={};return je.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof cn;)n=n._def.innerType;t[r]=n}}),new nt({...this._def,shape:()=>t})}keyof(){return M1(je.objectKeys(this.shape))}}nt.create=(i,e)=>new nt({shape:()=>i,unknownKeys:"strip",catchall:gn.create(),typeName:Ce.ZodObject,...$e(e)});nt.strictCreate=(i,e)=>new nt({shape:()=>i,unknownKeys:"strict",catchall:gn.create(),typeName:Ce.ZodObject,...$e(e)});nt.lazycreate=(i,e)=>new nt({shape:i,unknownKeys:"strip",catchall:gn.create(),typeName:Ce.ZodObject,...$e(e)});class ks extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function o(n){for(const a of n)if(a.result.status==="valid")return a.result;for(const a of n)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const s=n.map(a=>new Ti(a.ctx.common.issues));return le(t,{code:Q.invalid_union,unionErrors:s}),Ae}if(t.common.async)return Promise.all(r.map(async n=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(o);{let n;const s=[];for(const c of r){const l={...t,common:{...t.common,issues:[]},parent:null},h=c._parseSync({data:t.data,path:t.path,parent:l});if(h.status==="valid")return h;h.status==="dirty"&&!n&&(n={result:h,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const a=s.map(c=>new Ti(c));return le(t,{code:Q.invalid_union,unionErrors:a}),Ae}}get options(){return this._def.options}}ks.create=(i,e)=>new ks({options:i,typeName:Ce.ZodUnion,...$e(e)});const ba=i=>i instanceof Is?ba(i.schema):i instanceof Oi?ba(i.innerType()):i instanceof Os?[i.value]:i instanceof qn?i.options:i instanceof Ps?Object.keys(i.enum):i instanceof Ns?ba(i._def.innerType):i instanceof As?[void 0]:i instanceof Ss?[null]:null;class $c extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ae.object)return le(t,{code:Q.invalid_type,expected:ae.object,received:t.parsedType}),Ae;const r=this.discriminator,o=t.data[r],n=this.optionsMap.get(o);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(le(t,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const o=new Map;for(const n of t){const s=ba(n.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,n)}}return new $c({typeName:Ce.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:o,...$e(r)})}}function kl(i,e){const t=Sn(i),r=Sn(e);if(i===e)return{valid:!0,data:i};if(t===ae.object&&r===ae.object){const o=je.objectKeys(e),n=je.objectKeys(i).filter(a=>o.indexOf(a)!==-1),s={...i,...e};for(const a of n){const c=kl(i[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(t===ae.array&&r===ae.array){if(i.length!==e.length)return{valid:!1};const o=[];for(let n=0;n{if(Al(n)||Al(s))return Ae;const a=kl(n.value,s.value);return a.valid?((Sl(n)||Sl(s))&&t.dirty(),{status:t.value,value:a.data}):(le(r,{code:Q.invalid_intersection_types}),Ae)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,s])=>o(n,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}$s.create=(i,e,t)=>new $s({left:i,right:e,typeName:Ce.ZodIntersection,...$e(t)});class Yi extends Ie{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.array)return le(r,{code:Q.invalid_type,expected:ae.array,received:r.parsedType}),Ae;if(r.data.lengththis._def.items.length&&(le(r,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((s,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new qi(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(n).then(s=>Ot.mergeArray(t,s)):Ot.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Yi({...this._def,rest:e})}}Yi.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yi({items:i,typeName:Ce.ZodTuple,rest:null,...$e(e)})};class Rs extends Ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return le(r,{code:Q.invalid_type,expected:ae.object,received:r.parsedType}),Ae;const o=[],n=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:n._parse(new qi(r,a,r.path,a)),value:s._parse(new qi(r,r.data[a],r.path,a))});return r.common.async?Ot.mergeObjectAsync(t,o):Ot.mergeObjectSync(t,o)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof Ie?new Rs({keyType:e,valueType:t,typeName:Ce.ZodRecord,...$e(r)}):new Rs({keyType:_i.create(),valueType:e,typeName:Ce.ZodRecord,...$e(t)})}}class ja extends Ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.map)return le(r,{code:Q.invalid_type,expected:ae.map,received:r.parsedType}),Ae;const o=this._def.keyType,n=this._def.valueType,s=[...r.data.entries()].map(([a,c],l)=>({key:o._parse(new qi(r,a,r.path,[l,"key"])),value:n._parse(new qi(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,h=await c.value;if(l.status==="aborted"||h.status==="aborted")return Ae;(l.status==="dirty"||h.status==="dirty")&&t.dirty(),a.set(l.value,h.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const c of s){const l=c.key,h=c.value;if(l.status==="aborted"||h.status==="aborted")return Ae;(l.status==="dirty"||h.status==="dirty")&&t.dirty(),a.set(l.value,h.value)}return{status:t.value,value:a}}}}ja.create=(i,e,t)=>new ja({valueType:e,keyType:i,typeName:Ce.ZodMap,...$e(t)});class Mr extends Ie{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.set)return le(r,{code:Q.invalid_type,expected:ae.set,received:r.parsedType}),Ae;const o=this._def;o.minSize!==null&&r.data.sizeo.maxSize.value&&(le(r,{code:Q.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty());const n=this._def.valueType;function s(c){const l=new Set;for(const h of c){if(h.status==="aborted")return Ae;h.status==="dirty"&&t.dirty(),l.add(h.value)}return{status:t.value,value:l}}const a=[...r.data.values()].map((c,l)=>n._parse(new qi(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,t){return new Mr({...this._def,minSize:{value:e,message:fe.toString(t)}})}max(e,t){return new Mr({...this._def,maxSize:{value:e,message:fe.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Mr.create=(i,e)=>new Mr({valueType:i,minSize:null,maxSize:null,typeName:Ce.ZodSet,...$e(e)});class so extends Ie{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ae.function)return le(t,{code:Q.invalid_type,expected:ae.function,received:t.parsedType}),Ae;function r(a,c){return Ma({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Da(),_s].filter(l=>!!l),issueData:{code:Q.invalid_arguments,argumentsError:c}})}function o(a,c){return Ma({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Da(),_s].filter(l=>!!l),issueData:{code:Q.invalid_return_type,returnTypeError:c}})}const n={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Po){const a=this;return jt(async function(...c){const l=new Ti([]),h=await a._def.args.parseAsync(c,n).catch(S=>{throw l.addIssue(r(c,S)),l}),p=await Reflect.apply(s,this,h);return await a._def.returns._def.type.parseAsync(p,n).catch(S=>{throw l.addIssue(o(p,S)),l})})}else{const a=this;return jt(function(...c){const l=a._def.args.safeParse(c,n);if(!l.success)throw new Ti([r(c,l.error)]);const h=Reflect.apply(s,this,l.data),p=a._def.returns.safeParse(h,n);if(!p.success)throw new Ti([o(h,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new so({...this._def,args:Yi.create(e).rest(gr.create())})}returns(e){return new so({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new so({args:e||Yi.create([]).rest(gr.create()),returns:t||gr.create(),typeName:Ce.ZodFunction,...$e(r)})}}class Is extends Ie{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Is.create=(i,e)=>new Is({getter:i,typeName:Ce.ZodLazy,...$e(e)});class Os extends Ie{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return le(t,{received:t.data,code:Q.invalid_literal,expected:this._def.value}),Ae}return{status:"valid",value:e.data}}get value(){return this._def.value}}Os.create=(i,e)=>new Os({value:i,typeName:Ce.ZodLiteral,...$e(e)});function M1(i,e){return new qn({values:i,typeName:Ce.ZodEnum,...$e(e)})}class qn extends Ie{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return le(t,{expected:je.joinValues(r),received:t.parsedType,code:Q.invalid_type}),Ae}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),r=this._def.values;return le(t,{received:t.data,code:Q.invalid_enum_value,options:r}),Ae}return jt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return qn.create(e)}exclude(e){return qn.create(this.options.filter(t=>!e.includes(t)))}}qn.create=M1;class Ps extends Ie{_parse(e){const t=je.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ae.string&&r.parsedType!==ae.number){const o=je.objectValues(t);return le(r,{expected:je.joinValues(o),received:r.parsedType,code:Q.invalid_type}),Ae}if(t.indexOf(e.data)===-1){const o=je.objectValues(t);return le(r,{received:r.data,code:Q.invalid_enum_value,options:o}),Ae}return jt(e.data)}get enum(){return this._def.values}}Ps.create=(i,e)=>new Ps({values:i,typeName:Ce.ZodNativeEnum,...$e(e)});class Po extends Ie{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ae.promise&&t.common.async===!1)return le(t,{code:Q.invalid_type,expected:ae.promise,received:t.parsedType}),Ae;const r=t.parsedType===ae.promise?t.data:Promise.resolve(t.data);return jt(r.then(o=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Po.create=(i,e)=>new Po({type:i,typeName:Ce.ZodPromise,...$e(e)});class Oi extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),o=this._def.effect||null,n={addIssue:s=>{le(r,s),s.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),o.type==="preprocess"){const s=o.transform(r.data,n);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=a=>{const c=o.refinement(a,n);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ae:(a.status==="dirty"&&t.dirty(),s(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ae:(a.status==="dirty"&&t.dirty(),s(a.value).then(()=>({status:t.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Es(s))return s;const a=o.transform(s.value,n);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Es(s)?Promise.resolve(o.transform(s.value,n)).then(a=>({status:t.value,value:a})):s);je.assertNever(o)}}Oi.create=(i,e,t)=>new Oi({schema:i,typeName:Ce.ZodEffects,effect:e,...$e(t)});Oi.createWithPreprocess=(i,e,t)=>new Oi({schema:e,effect:{type:"preprocess",transform:i},typeName:Ce.ZodEffects,...$e(t)});class cn extends Ie{_parse(e){return this._getType(e)===ae.undefined?jt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}cn.create=(i,e)=>new cn({innerType:i,typeName:Ce.ZodOptional,...$e(e)});class Lr extends Ie{_parse(e){return this._getType(e)===ae.null?jt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Lr.create=(i,e)=>new Lr({innerType:i,typeName:Ce.ZodNullable,...$e(e)});class Ns extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===ae.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ns.create=(i,e)=>new Ns({innerType:i,typeName:Ce.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...$e(e)});class Wa extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return La(o)?o.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ti(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ti(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Wa.create=(i,e)=>new Wa({innerType:i,typeName:Ce.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...$e(e)});class za extends Ie{_parse(e){if(this._getType(e)!==ae.nan){const r=this._getOrReturnCtx(e);return le(r,{code:Q.invalid_type,expected:ae.nan,received:r.parsedType}),Ae}return{status:"valid",value:e.data}}}za.create=i=>new za({typeName:Ce.ZodNaN,...$e(i)});const K3=Symbol("zod_brand");class L1 extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Js extends Ie{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?Ae:n.status==="dirty"?(t.dirty(),D1(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ae:o.status==="dirty"?(t.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,t){return new Js({in:e,out:t,typeName:Ce.ZodPipeline})}}class Fa extends Ie{_parse(e){const t=this._def.innerType._parse(e);return Es(t)&&(t.value=Object.freeze(t.value)),t}}Fa.create=(i,e)=>new Fa({innerType:i,typeName:Ce.ZodReadonly,...$e(e)});const B1=(i,e={},t)=>i?Oo.create().superRefine((r,o)=>{var n,s;if(!i(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(s=(n=a.fatal)!==null&&n!==void 0?n:t)!==null&&s!==void 0?s:!0,l=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...l,fatal:c})}}):Oo.create(),J3={object:nt.lazycreate};var Ce;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(Ce||(Ce={}));const X3=(i,e={message:`Input not instance of ${i.name}`})=>B1(t=>t instanceof i,e),U1=_i.create,j1=Zn.create,Q3=za.create,e5=Gn.create,W1=Ts.create,t5=Dr.create,i5=Ba.create,n5=As.create,r5=Ss.create,o5=Oo.create,s5=gr.create,a5=gn.create,c5=Ua.create,l5=Ai.create,u5=nt.create,d5=nt.strictCreate,h5=ks.create,p5=$c.create,f5=$s.create,g5=Yi.create,w5=Rs.create,m5=ja.create,v5=Mr.create,b5=so.create,y5=Is.create,x5=Os.create,C5=qn.create,_5=Ps.create,E5=Po.create,Id=Oi.create,T5=cn.create,A5=Lr.create,S5=Oi.createWithPreprocess,k5=Js.create,$5=()=>U1().optional(),R5=()=>j1().optional(),I5=()=>W1().optional(),O5={string:i=>_i.create({...i,coerce:!0}),number:i=>Zn.create({...i,coerce:!0}),boolean:i=>Ts.create({...i,coerce:!0}),bigint:i=>Gn.create({...i,coerce:!0}),date:i=>Dr.create({...i,coerce:!0})},P5=Ae;var b=Object.freeze({__proto__:null,defaultErrorMap:_s,setErrorMap:L3,getErrorMap:Da,makeIssue:Ma,EMPTY_PATH:B3,addIssueToContext:le,ParseStatus:Ot,INVALID:Ae,DIRTY:D1,OK:jt,isAborted:Al,isDirty:Sl,isValid:Es,isAsync:La,get util(){return je},get objectUtil(){return Tl},ZodParsedType:ae,getParsedType:Sn,ZodType:Ie,ZodString:_i,ZodNumber:Zn,ZodBigInt:Gn,ZodBoolean:Ts,ZodDate:Dr,ZodSymbol:Ba,ZodUndefined:As,ZodNull:Ss,ZodAny:Oo,ZodUnknown:gr,ZodNever:gn,ZodVoid:Ua,ZodArray:Ai,ZodObject:nt,ZodUnion:ks,ZodDiscriminatedUnion:$c,ZodIntersection:$s,ZodTuple:Yi,ZodRecord:Rs,ZodMap:ja,ZodSet:Mr,ZodFunction:so,ZodLazy:Is,ZodLiteral:Os,ZodEnum:qn,ZodNativeEnum:Ps,ZodPromise:Po,ZodEffects:Oi,ZodTransformer:Oi,ZodOptional:cn,ZodNullable:Lr,ZodDefault:Ns,ZodCatch:Wa,ZodNaN:za,BRAND:K3,ZodBranded:L1,ZodPipeline:Js,ZodReadonly:Fa,custom:B1,Schema:Ie,ZodSchema:Ie,late:J3,get ZodFirstPartyTypeKind(){return Ce},coerce:O5,any:o5,array:l5,bigint:e5,boolean:W1,date:t5,discriminatedUnion:p5,effect:Id,enum:C5,function:b5,instanceof:X3,intersection:f5,lazy:y5,literal:x5,map:m5,nan:Q3,nativeEnum:_5,never:a5,null:r5,nullable:A5,number:j1,object:u5,oboolean:I5,onumber:R5,optional:T5,ostring:$5,pipeline:k5,preprocess:S5,promise:E5,record:w5,set:v5,strictObject:d5,string:U1,symbol:i5,transformer:Id,tuple:g5,undefined:n5,union:h5,unknown:s5,void:c5,NEVER:P5,ZodIssueCode:Q,quotelessJson:M3,ZodError:Ti});const Tt=b.object({message:b.string()});function me(i){return b.literal(ee[i])}b.object({accessList:b.array(b.string()),blockHash:b.string().nullable(),blockNumber:b.string().nullable(),chainId:b.string(),from:b.string(),gas:b.string(),hash:b.string(),input:b.string().nullable(),maxFeePerGas:b.string(),maxPriorityFeePerGas:b.string(),nonce:b.string(),r:b.string(),s:b.string(),to:b.string(),transactionIndex:b.string().nullable(),type:b.string(),v:b.string(),value:b.string()});const N5=b.object({chainId:b.number()}),D5=b.object({email:b.string().email()}),M5=b.object({otp:b.string()}),L5=b.object({chainId:b.optional(b.number()),preferredAccountType:b.optional(b.string())}),B5=b.object({email:b.string().email()}),U5=b.object({otp:b.string()}),j5=b.object({otp:b.string()}),W5=b.object({themeMode:b.optional(b.enum(["light","dark"])),themeVariables:b.optional(b.record(b.string(),b.string().or(b.number())))}),z5=b.object({metadata:b.object({name:b.string(),description:b.string(),url:b.string(),icons:b.array(b.string())}).optional(),sdkVersion:b.string(),projectId:b.string()}),F5=b.object({type:b.string()}),H5=b.object({action:b.enum(["VERIFY_DEVICE","VERIFY_OTP"])}),V5=b.object({action:b.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),Z5=b.object({email:b.string().email(),address:b.string(),chainId:b.number(),smartAccountDeployed:b.optional(b.boolean()),preferredAccountType:b.optional(b.string())}),G5=b.object({isConnected:b.boolean()}),q5=b.object({chainId:b.number()}),Y5=b.object({chainId:b.number()}),K5=b.object({newEmail:b.string().email()}),J5=b.object({smartAccountEnabledNetworks:b.array(b.number())});b.object({address:b.string(),isDeployed:b.boolean()});const X5=b.object({type:b.string(),address:b.string()}),Q5=b.any(),e4=b.object({method:b.literal("eth_accounts")}),t4=b.object({method:b.literal("eth_blockNumber")}),i4=b.object({method:b.literal("eth_call"),params:b.array(b.any())}),n4=b.object({method:b.literal("eth_chainId")}),r4=b.object({method:b.literal("eth_estimateGas"),params:b.array(b.any())}),o4=b.object({method:b.literal("eth_feeHistory"),params:b.array(b.any())}),s4=b.object({method:b.literal("eth_gasPrice")}),a4=b.object({method:b.literal("eth_getAccount"),params:b.array(b.any())}),c4=b.object({method:b.literal("eth_getBalance"),params:b.array(b.any())}),l4=b.object({method:b.literal("eth_getBlockByHash"),params:b.array(b.any())}),u4=b.object({method:b.literal("eth_getBlockByNumber"),params:b.array(b.any())}),d4=b.object({method:b.literal("eth_getBlockReceipts"),params:b.array(b.any())}),h4=b.object({method:b.literal("eth_getBlockTransactionCountByHash"),params:b.array(b.any())}),p4=b.object({method:b.literal("eth_getBlockTransactionCountByNumber"),params:b.array(b.any())}),f4=b.object({method:b.literal("eth_getCode"),params:b.array(b.any())}),g4=b.object({method:b.literal("eth_getFilterChanges"),params:b.array(b.any())}),w4=b.object({method:b.literal("eth_getFilterLogs"),params:b.array(b.any())}),m4=b.object({method:b.literal("eth_getLogs"),params:b.array(b.any())}),v4=b.object({method:b.literal("eth_getProof"),params:b.array(b.any())}),b4=b.object({method:b.literal("eth_getStorageAt"),params:b.array(b.any())}),y4=b.object({method:b.literal("eth_getTransactionByBlockHashAndIndex"),params:b.array(b.any())}),x4=b.object({method:b.literal("eth_getTransactionByBlockNumberAndIndex"),params:b.array(b.any())}),C4=b.object({method:b.literal("eth_getTransactionByHash"),params:b.array(b.any())}),_4=b.object({method:b.literal("eth_getTransactionCount"),params:b.array(b.any())}),E4=b.object({method:b.literal("eth_getTransactionReceipt"),params:b.array(b.any())}),T4=b.object({method:b.literal("eth_getUncleCountByBlockHash"),params:b.array(b.any())}),A4=b.object({method:b.literal("eth_getUncleCountByBlockNumber"),params:b.array(b.any())}),S4=b.object({method:b.literal("eth_maxPriorityFeePerGas")}),k4=b.object({method:b.literal("eth_newBlockFilter")}),$4=b.object({method:b.literal("eth_newFilter"),params:b.array(b.any())}),R4=b.object({method:b.literal("eth_newPendingTransactionFilter")}),I4=b.object({method:b.literal("eth_sendRawTransaction"),params:b.array(b.any())}),O4=b.object({method:b.literal("eth_syncing"),params:b.array(b.any())}),P4=b.object({method:b.literal("eth_uninstallFilter"),params:b.array(b.any())}),Od=b.object({method:b.literal("personal_sign"),params:b.array(b.any())}),N4=b.object({method:b.literal("eth_signTypedData_v4"),params:b.array(b.any())}),Pd=b.object({method:b.literal("eth_sendTransaction"),params:b.array(b.any())}),Nd=b.object({token:b.string()}),ha={appEvent:b.object({type:me("APP_SWITCH_NETWORK"),payload:N5}).or(b.object({type:me("APP_CONNECT_EMAIL"),payload:D5})).or(b.object({type:me("APP_CONNECT_DEVICE")})).or(b.object({type:me("APP_CONNECT_OTP"),payload:M5})).or(b.object({type:me("APP_GET_USER"),payload:b.optional(L5)})).or(b.object({type:me("APP_SIGN_OUT")})).or(b.object({type:me("APP_IS_CONNECTED"),payload:b.optional(Nd)})).or(b.object({type:me("APP_GET_CHAIN_ID")})).or(b.object({type:me("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(b.object({type:me("APP_INIT_SMART_ACCOUNT")})).or(b.object({type:me("APP_SET_PREFERRED_ACCOUNT"),payload:F5})).or(b.object({type:me("APP_RPC_REQUEST"),payload:Od.or(Pd).or(e4).or(t4).or(i4).or(n4).or(r4).or(o4).or(s4).or(a4).or(c4).or(l4).or(u4).or(d4).or(h4).or(p4).or(f4).or(g4).or(w4).or(m4).or(v4).or(b4).or(y4).or(x4).or(C4).or(_4).or(E4).or(T4).or(A4).or(S4).or(k4).or($4).or(R4).or(I4).or(O4).or(P4).or(Od).or(N4).or(Pd)})).or(b.object({type:me("APP_UPDATE_EMAIL"),payload:B5})).or(b.object({type:me("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:U5})).or(b.object({type:me("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:j5})).or(b.object({type:me("APP_SYNC_THEME"),payload:W5})).or(b.object({type:me("APP_SYNC_DAPP_DATA"),payload:z5})),frameEvent:b.object({type:me("FRAME_SWITCH_NETWORK_ERROR"),payload:Tt}).or(b.object({type:me("FRAME_SWITCH_NETWORK_SUCCESS"),payload:Y5})).or(b.object({type:me("FRAME_CONNECT_EMAIL_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_CONNECT_EMAIL_SUCCESS"),payload:H5})).or(b.object({type:me("FRAME_CONNECT_OTP_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_CONNECT_OTP_SUCCESS")})).or(b.object({type:me("FRAME_CONNECT_DEVICE_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_CONNECT_DEVICE_SUCCESS")})).or(b.object({type:me("FRAME_GET_USER_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_GET_USER_SUCCESS"),payload:Z5})).or(b.object({type:me("FRAME_SIGN_OUT_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_SIGN_OUT_SUCCESS")})).or(b.object({type:me("FRAME_IS_CONNECTED_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_IS_CONNECTED_SUCCESS"),payload:G5})).or(b.object({type:me("FRAME_GET_CHAIN_ID_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_GET_CHAIN_ID_SUCCESS"),payload:q5})).or(b.object({type:me("FRAME_RPC_REQUEST_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_RPC_REQUEST_SUCCESS"),payload:Q5})).or(b.object({type:me("FRAME_SESSION_UPDATE"),payload:Nd})).or(b.object({type:me("FRAME_UPDATE_EMAIL_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_UPDATE_EMAIL_SUCCESS"),payload:V5})).or(b.object({type:me("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(b.object({type:me("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:K5})).or(b.object({type:me("FRAME_SYNC_THEME_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_SYNC_THEME_SUCCESS")})).or(b.object({type:me("FRAME_SYNC_DAPP_DATA_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(b.object({type:me("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:J5})).or(b.object({type:me("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:Tt})).or(b.object({type:me("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:X5})).or(b.object({type:me("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:Tt}))},Ht={set(i,e){vt.isClient&&localStorage.setItem(`${ee.STORAGE_KEY}${i}`,e)},get(i){return vt.isClient?localStorage.getItem(`${ee.STORAGE_KEY}${i}`):null},delete(i){vt.isClient&&localStorage.removeItem(`${ee.STORAGE_KEY}${i}`)}},Dd={address:/^0x(?:[A-Fa-f0-9]{40})$/u,transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[A-Fa-f0-9]{130})$/u},D4=["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],pa=30*1e3,vt={getBlockchainApiUrl(){try{const{timeZone:i}=new Intl.DateTimeFormat().resolvedOptions(),e=i.toUpperCase();return D4.includes(e)?"https://rpc.walletconnect.org":"https://rpc.walletconnect.com"}catch{return!1}},checkIfAllowedToTriggerEmail(){const i=Ht.get(ee.LAST_EMAIL_LOGIN_TIME);if(i){const e=Date.now()-Number(i);if(e{vt.isClient&&window.addEventListener("message",({data:o})=>{var s;if(!((s=o.type)!=null&&s.includes(ee.FRAME_EVENT_KEY)))return;const n=ha.frameEvent.parse(o);r(n)})},onAppEvent:r=>{vt.isClient&&window.addEventListener("message",({data:o})=>{var s;if(!((s=o.type)!=null&&s.includes(ee.APP_EVENT_KEY)))return;const n=ha.appEvent.parse(o);r(n)})},postAppEvent:r=>{var o;if(vt.isClient){if(!((o=this.iframe)!=null&&o.contentWindow))throw new Error("W3mFrame: iframe is not set");ha.appEvent.parse(r),window.postMessage(r),this.iframe.contentWindow.postMessage(r,"*")}},postFrameEvent:r=>{if(vt.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");ha.frameEvent.parse(r),parent.postMessage(r,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((r,o)=>{this.frameLoadPromiseResolver={resolve:r,reject:o}}),t&&(this.frameLoadPromise=new Promise((r,o)=>{this.frameLoadPromiseResolver={resolve:r,reject:o}}),vt.isClient)){const r=document.createElement("iframe");r.id="w3m-iframe",r.src=`${D3}?projectId=${e}`,r.style.position="fixed",r.style.zIndex="999999",r.style.display="none",r.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",r.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",r.style.opacity="0",r.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",r.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",document.body.appendChild(r),this.iframe=r,this.iframe.onload=()=>{var o;(o=this.frameLoadPromiseResolver)==null||o.resolve(void 0)},this.iframe.onerror=()=>{var o;(o=this.frameLoadPromiseResolver)==null||o.reject("Unable to load email login dependency")}}}get networks(){const e=[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,324,280,100,8453,84531,7777777,999].map(t=>({[t]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=eip155:${t}&projectId=${this.projectId}`,chainId:t}}));return Object.assign({},...e)}}class L4{constructor(e){this.connectEmailResolver=void 0,this.connectDeviceResolver=void 0,this.connectOtpResolver=void 0,this.connectResolver=void 0,this.disconnectResolver=void 0,this.isConnectedResolver=void 0,this.getChainIdResolver=void 0,this.switchChainResolver=void 0,this.rpcRequestResolver=void 0,this.updateEmailResolver=void 0,this.updateEmailPrimaryOtpResolver=void 0,this.updateEmailSecondaryOtpResolver=void 0,this.syncThemeResolver=void 0,this.syncDappDataResolver=void 0,this.smartAccountEnabledNetworksResolver=void 0,this.setPreferredAccountResolver=void 0,this.w3mFrame=new M4(e,!0),this.w3mFrame.events.onFrameEvent(t=>{switch(console.log("💻 received",t),t.type){case ee.FRAME_CONNECT_EMAIL_SUCCESS:return this.onConnectEmailSuccess(t);case ee.FRAME_CONNECT_EMAIL_ERROR:return this.onConnectEmailError(t);case ee.FRAME_CONNECT_DEVICE_SUCCESS:return this.onConnectDeviceSuccess();case ee.FRAME_CONNECT_DEVICE_ERROR:return this.onConnectDeviceError(t);case ee.FRAME_CONNECT_OTP_SUCCESS:return this.onConnectOtpSuccess();case ee.FRAME_CONNECT_OTP_ERROR:return this.onConnectOtpError(t);case ee.FRAME_GET_USER_SUCCESS:return this.onConnectSuccess(t);case ee.FRAME_GET_USER_ERROR:return this.onConnectError(t);case ee.FRAME_IS_CONNECTED_SUCCESS:return this.onIsConnectedSuccess(t);case ee.FRAME_IS_CONNECTED_ERROR:return this.onIsConnectedError(t);case ee.FRAME_GET_CHAIN_ID_SUCCESS:return this.onGetChainIdSuccess(t);case ee.FRAME_GET_CHAIN_ID_ERROR:return this.onGetChainIdError(t);case ee.FRAME_SIGN_OUT_SUCCESS:return this.onSignOutSuccess();case ee.FRAME_SIGN_OUT_ERROR:return this.onSignOutError(t);case ee.FRAME_SWITCH_NETWORK_SUCCESS:return this.onSwitchChainSuccess(t);case ee.FRAME_SWITCH_NETWORK_ERROR:return this.onSwitchChainError(t);case ee.FRAME_RPC_REQUEST_SUCCESS:return this.onRpcRequestSuccess(t);case ee.FRAME_RPC_REQUEST_ERROR:return this.onRpcRequestError(t);case ee.FRAME_SESSION_UPDATE:return this.onSessionUpdate(t);case ee.FRAME_UPDATE_EMAIL_SUCCESS:return this.onUpdateEmailSuccess(t);case ee.FRAME_UPDATE_EMAIL_ERROR:return this.onUpdateEmailError(t);case ee.FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:return this.onUpdateEmailPrimaryOtpSuccess();case ee.FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:return this.onUpdateEmailPrimaryOtpError(t);case ee.FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:return this.onUpdateEmailSecondaryOtpSuccess(t);case ee.FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:return this.onUpdateEmailSecondaryOtpError(t);case ee.FRAME_SYNC_THEME_SUCCESS:return this.onSyncThemeSuccess();case ee.FRAME_SYNC_THEME_ERROR:return this.onSyncThemeError(t);case ee.FRAME_SYNC_DAPP_DATA_SUCCESS:return this.onSyncDappDataSuccess();case ee.FRAME_SYNC_DAPP_DATA_ERROR:return this.onSyncDappDataError(t);case ee.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:return this.onSmartAccountEnabledNetworksSuccess(t);case ee.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:return this.onSmartAccountEnabledNetworksError(t);case ee.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:return this.onSetPreferredAccountSuccess();case ee.FRAME_SET_PREFERRED_ACCOUNT_ERROR:return this.onSetPreferredAccountError();default:return null}})}getLoginEmailUsed(){return!!Ht.get(ee.EMAIL_LOGIN_USED_KEY)}getEmail(){return Ht.get(ee.EMAIL)}rejectRpcRequest(){var e;(e=this.rpcRequestResolver)==null||e.reject()}async connectEmail(e){return await this.w3mFrame.frameLoadPromise,vt.checkIfAllowedToTriggerEmail(),this.w3mFrame.events.postAppEvent({type:ee.APP_CONNECT_EMAIL,payload:e}),new Promise((t,r)=>{this.connectEmailResolver={resolve:t,reject:r}})}async connectDevice(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_CONNECT_DEVICE}),new Promise((e,t)=>{this.connectDeviceResolver={resolve:e,reject:t}})}async connectOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_CONNECT_OTP,payload:e}),new Promise((t,r)=>{this.connectOtpResolver={resolve:t,reject:r}})}async isConnected(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_IS_CONNECTED,payload:void 0}),new Promise((e,t)=>{this.isConnectedResolver={resolve:e,reject:t}})}async getChainId(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_GET_CHAIN_ID}),new Promise((e,t)=>{this.getChainIdResolver={resolve:e,reject:t}})}async updateEmail(e){return await this.w3mFrame.frameLoadPromise,vt.checkIfAllowedToTriggerEmail(),this.w3mFrame.events.postAppEvent({type:ee.APP_UPDATE_EMAIL,payload:e}),new Promise((t,r)=>{this.updateEmailResolver={resolve:t,reject:r}})}async updateEmailPrimaryOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e}),new Promise((t,r)=>{this.updateEmailPrimaryOtpResolver={resolve:t,reject:r}})}async updateEmailSecondaryOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e}),new Promise((t,r)=>{this.updateEmailSecondaryOtpResolver={resolve:t,reject:r}})}async syncTheme(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_SYNC_THEME,payload:e}),new Promise((t,r)=>{this.syncThemeResolver={resolve:t,reject:r}})}async syncDappData(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_SYNC_DAPP_DATA,payload:e}),new Promise((t,r)=>{this.syncDappDataResolver={resolve:t,reject:r}})}async getSmartAccountEnabledNetworks(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS}),new Promise((e,t)=>{this.smartAccountEnabledNetworksResolver={resolve:e,reject:t}})}async setPreferredAccount(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}}),new Promise((t,r)=>{this.setPreferredAccountResolver={resolve:t,reject:r}})}async connect(e){const t=(e==null?void 0:e.chainId)??this.getLastUsedChainId()??1;return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_GET_USER,payload:{chainId:t}}),new Promise((r,o)=>{this.connectResolver={resolve:r,reject:o}})}async switchNetwork(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_SWITCH_NETWORK,payload:{chainId:e}}),new Promise((t,r)=>{this.switchChainResolver={resolve:t,reject:r}})}async disconnect(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:ee.APP_SIGN_OUT}),new Promise((e,t)=>{this.disconnectResolver={resolve:e,reject:t}})}async request(e){return await this.w3mFrame.frameLoadPromise,Bt.GET_CHAIN_ID===e.method?this.getLastUsedChainId():(this.w3mFrame.events.postAppEvent({type:ee.APP_RPC_REQUEST,payload:e}),new Promise((t,r)=>{this.rpcRequestResolver={resolve:t,reject:r}}))}onRpcRequest(e){this.w3mFrame.events.onAppEvent(t=>{t.type.includes(ee.RPC_METHOD_KEY)&&e(t)})}onRpcResponse(e){this.w3mFrame.events.onFrameEvent(t=>{t.type.includes(ee.RPC_METHOD_KEY)&&e(t)})}onIsConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===ee.FRAME_GET_USER_SUCCESS&&e(t.payload)})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===ee.FRAME_IS_CONNECTED_ERROR&&e(),t.type===ee.FRAME_IS_CONNECTED_SUCCESS&&!t.payload.isConnected&&e()})}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===ee.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(t.payload):t.type===ee.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:Bt.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===ee.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?e(t.payload.smartAccountEnabledNetworks):t.type===ee.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&e([])})}onConnectEmailSuccess(e){var t;(t=this.connectEmailResolver)==null||t.resolve(e.payload),this.setNewLastEmailLoginTime()}onConnectEmailError(e){var t;(t=this.connectEmailResolver)==null||t.reject(e.payload.message)}onConnectDeviceSuccess(){var e;(e=this.connectDeviceResolver)==null||e.resolve(void 0)}onConnectDeviceError(e){var t;(t=this.connectDeviceResolver)==null||t.reject(e.payload.message)}onConnectOtpSuccess(){var e;(e=this.connectOtpResolver)==null||e.resolve(void 0)}onConnectOtpError(e){var t;(t=this.connectOtpResolver)==null||t.reject(e.payload.message)}onConnectSuccess(e){var t;this.setEmailLoginSuccess(e.payload.email),this.setLastUsedChainId(e.payload.chainId),(t=this.connectResolver)==null||t.resolve(e.payload)}onConnectError(e){var t;(t=this.connectResolver)==null||t.reject(e.payload.message)}onIsConnectedSuccess(e){var t;e.payload.isConnected||this.deleteEmailLoginCache(),(t=this.isConnectedResolver)==null||t.resolve(e.payload)}onIsConnectedError(e){var t;(t=this.isConnectedResolver)==null||t.reject(e.payload.message)}onGetChainIdSuccess(e){var t;this.setLastUsedChainId(e.payload.chainId),(t=this.getChainIdResolver)==null||t.resolve(e.payload)}onGetChainIdError(e){var t;(t=this.getChainIdResolver)==null||t.reject(e.payload.message)}onSignOutSuccess(){var e;(e=this.disconnectResolver)==null||e.resolve(void 0),this.deleteEmailLoginCache()}onSignOutError(e){var t;(t=this.disconnectResolver)==null||t.reject(e.payload.message)}onSwitchChainSuccess(e){var t;this.setLastUsedChainId(e.payload.chainId),(t=this.switchChainResolver)==null||t.resolve(e.payload)}onSwitchChainError(e){var t;(t=this.switchChainResolver)==null||t.reject(e.payload.message)}onRpcRequestSuccess(e){var t;(t=this.rpcRequestResolver)==null||t.resolve(e.payload)}onRpcRequestError(e){var t;(t=this.rpcRequestResolver)==null||t.reject(e.payload.message)}onSessionUpdate(e){}onUpdateEmailSuccess(e){var t;(t=this.updateEmailResolver)==null||t.resolve(e.payload),this.setNewLastEmailLoginTime()}onUpdateEmailError(e){var t;(t=this.updateEmailResolver)==null||t.reject(e.payload.message)}onUpdateEmailPrimaryOtpSuccess(){var e;(e=this.updateEmailPrimaryOtpResolver)==null||e.resolve(void 0)}onUpdateEmailPrimaryOtpError(e){var t;(t=this.updateEmailPrimaryOtpResolver)==null||t.reject(e.payload.message)}onUpdateEmailSecondaryOtpSuccess(e){var r;const{newEmail:t}=e.payload;this.setEmailLoginSuccess(t),(r=this.updateEmailSecondaryOtpResolver)==null||r.resolve({newEmail:t})}onUpdateEmailSecondaryOtpError(e){var t;(t=this.updateEmailSecondaryOtpResolver)==null||t.reject(e.payload.message)}onSyncThemeSuccess(){var e;(e=this.syncThemeResolver)==null||e.resolve(void 0)}onSyncThemeError(e){var t;(t=this.syncThemeResolver)==null||t.reject(e.payload.message)}onSyncDappDataSuccess(){var e;(e=this.syncDappDataResolver)==null||e.resolve(void 0)}onSyncDappDataError(e){var t;(t=this.syncDappDataResolver)==null||t.reject(e.payload.message)}onSmartAccountEnabledNetworksSuccess(e){var t;this.persistSmartAccountEnabledNetworks(e.payload.smartAccountEnabledNetworks),(t=this.smartAccountEnabledNetworksResolver)==null||t.resolve(e.payload)}onSmartAccountEnabledNetworksError(e){var t;this.persistSmartAccountEnabledNetworks([]),(t=this.smartAccountEnabledNetworksResolver)==null||t.reject(e.payload.message)}onSetPreferredAccountSuccess(){var e;(e=this.setPreferredAccountResolver)==null||e.resolve(void 0)}onSetPreferredAccountError(){var e;(e=this.setPreferredAccountResolver)==null||e.reject()}setNewLastEmailLoginTime(){Ht.set(ee.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setEmailLoginSuccess(e){Ht.set(ee.EMAIL,e),Ht.set(ee.EMAIL_LOGIN_USED_KEY,"true"),Ht.delete(ee.LAST_EMAIL_LOGIN_TIME)}deleteEmailLoginCache(){Ht.delete(ee.EMAIL_LOGIN_USED_KEY),Ht.delete(ee.EMAIL),Ht.delete(ee.LAST_USED_CHAIN_KEY)}setLastUsedChainId(e){Ht.set(ee.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){return Number(Ht.get(ee.LAST_USED_CHAIN_KEY))}persistSmartAccountEnabledNetworks(e){Ht.set(ee.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}}var ir=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ki=class extends ce{constructor(){super(),this.usubscribe=[],this.networkImages=bt.state.networkImages,this.address=te.state.address,this.profileImage=te.state.profileImage,this.profileName=te.state.profileName,this.network=de.state.caipNetwork,this.preferredAccountType=te.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.usubscribe.push(te.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):Re.close()}),de.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var t,r;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((t=this.network)==null?void 0:t.imageId)??""];return T` + + + + + + ${this.profileName?ve.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):ve.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} + + + + + + + + + ${this.emailBtnTemplate()} + + + ${((r=this.network)==null?void 0:r.name)??"Unknown"} + + + ${this.togglePreferredAccountBtnTemplate()} + + Disconnect + + + + `}isAllowedNetworkSwitch(){const{requestedCaipNetworks:e}=de.state,t=e?e.length>1:!1,r=e==null?void 0:e.find(({id:o})=>{var n;return o===((n=this.network)==null?void 0:n.id)});return t||!r}onCopyAddress(){try{this.address&&(re.copyToClopboard(this.address),Le.showSuccess("Address copied"))}catch{Le.showError("Failed to copy")}}emailBtnTemplate(){const e=ht.getConnectedConnector(),t=We.getEmailConnector();if(!t||e!=="EMAIL")return null;const r=t.provider.getEmail()??"";return T` + this.onGoToUpdateEmail(r)} + > + ${r} + + `}togglePreferredAccountBtnTemplate(){const e=de.checkIfSmartAccountEnabled(),t=ht.getConnectedConnector();if(!We.getEmailConnector()||t!=="EMAIL"||!e)return null;const o=this.preferredAccountType===Bt.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account";return T` + + ${o} + + `}async changePreferredAccountType(){const e=de.checkIfSmartAccountEnabled(),t=this.preferredAccountType===Bt.ACCOUNT_TYPES.SMART_ACCOUNT||!e?Bt.ACCOUNT_TYPES.EOA:Bt.ACCOUNT_TYPES.SMART_ACCOUNT,r=We.getEmailConnector();r&&(this.loading=!0,await(r==null?void 0:r.provider.setPreferredAccount(t)),this.loading=!1,this.requestUpdate())}onGoToUpdateEmail(e){G.push("UpdateEmailWallet",{email:e})}onNetworks(){this.isAllowedNetworkSwitch()&&G.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await ke.disconnect(),we.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),Re.close()}catch{we.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Le.showError("Failed to disconnect")}finally{this.disconnecting=!1}}};Ki.styles=T3;ir([U()],Ki.prototype,"address",void 0);ir([U()],Ki.prototype,"profileImage",void 0);ir([U()],Ki.prototype,"profileName",void 0);ir([U()],Ki.prototype,"network",void 0);ir([U()],Ki.prototype,"preferredAccountType",void 0);ir([U()],Ki.prototype,"disconnecting",void 0);ir([U()],Ki.prototype,"loading",void 0);Ki=ir([V("w3m-account-settings-view")],Ki);var B4=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Md=class extends ce{render(){const e=ht.getConnectedConnector();return T` + ${pe.state.enableWalletFeatures&&e==="EMAIL"?this.walletFeaturesTemplate():this.defaultTemplate()} + `}walletFeaturesTemplate(){return T``}defaultTemplate(){return T``}};Md=B4([V("w3m-account-view")],Md);var z1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let $l=class extends ce{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=re.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return T` + + + ${this.qrButtonTemplate()} + + ${e?T``:T``} + `}onInputChange(e){this.onDebouncedSearch(e.detail)}qrButtonTemplate(){return re.isMobile()?T` + + `:null}onWalletConnectQr(){G.push("ConnectingWalletConnect")}};z1([U()],$l.prototype,"search",void 0);$l=z1([V("w3m-all-wallets-view")],$l);const U4=_e` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-thumbnail { + position: absolute; + } + + wui-visual { + width: var(--wui-wallet-image-size-lg); + height: var(--wui-wallet-image-size-lg); + border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); + position: relative; + overflow: hidden; + } + + wui-visual::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + } + + wui-icon-box { + position: absolute; + right: calc(var(--wui-spacing-3xs) * -1); + bottom: calc(var(--wui-spacing-3xs) * -1); + opacity: 0; + transform: scale(0.5); + transition: + opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), + transform var(--wui-ease-out-power-2) var(--wui-duration-lg); + will-change: opacity, transform; + } + + wui-text[align='center'] { + width: 100%; + padding: 0px var(--wui-spacing-l); + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + [data-retry='false'] wui-link { + display: none; + } + + [data-retry='true'] wui-link { + display: block; + opacity: 1; + } + + wui-link { + padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); + } +`;var Mi=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ii=class extends ce{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=Fe.state.selectedProvider,this.uri=ke.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(Fe.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){var r,o;let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${(r=this.selectedOnRampProvider)==null?void 0:r.label}`);const t=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return T` + + + + + + ${this.error?null:this.loaderTemplate()} + + + + + + + ${e} + + ${t} + + + ${this.error?this.tryAgainTemplate():null} + + + + + + Copy link + + + `}watchTransactions(){if(this.selectedOnRampProvider)switch(this.selectedOnRampProvider.name){case"coinbase":this.startTime=Date.now(),this.initializeCoinbaseTransactions();break}}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{const e=te.state.address,t=pe.state.projectId;if(!e)throw new Error("No address found");(await Lt.fetchTransactions({account:e,onramp:"coinbase",projectId:t})).data.filter(n=>new Date(n.metadata.minedAt)>new Date(this.startTime)||n.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length?(clearInterval(this.intervalId),G.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){Le.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,re.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){var e;return(e=this.selectedOnRampProvider)!=null&&e.url?T` + + Try again + `:null}loaderTemplate(){const e=ft.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return T``}onCopyUri(){var e;if(!((e=this.selectedOnRampProvider)!=null&&e.url)){Le.showError("No link found"),G.goBack();return}try{re.copyToClopboard(this.selectedOnRampProvider.url),Le.showSuccess("Link copied")}catch{Le.showError("Failed to copy")}}};ii.styles=U4;Mi([U()],ii.prototype,"selectedOnRampProvider",void 0);Mi([U()],ii.prototype,"uri",void 0);Mi([U()],ii.prototype,"ready",void 0);Mi([U()],ii.prototype,"showRetry",void 0);Mi([U()],ii.prototype,"buffering",void 0);Mi([U()],ii.prototype,"error",void 0);Mi([U()],ii.prototype,"intervalId",void 0);Mi([U()],ii.prototype,"startTime",void 0);Mi([ge({type:Boolean})],ii.prototype,"isMobile",void 0);Mi([ge()],ii.prototype,"onRetry",void 0);ii=Mi([V("w3m-buy-in-progress-view")],ii);const j4=_e` + wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + + wui-flex::-webkit-scrollbar { + display: none; + } +`,Ee={WALLET_CONNECT_CONNECTOR_ID:"walletConnect",INJECTED_CONNECTOR_ID:"injected",COINBASE_CONNECTOR_ID:"coinbaseWallet",COINBASE_SDK_CONNECTOR_ID:"coinbaseWalletSDK",SAFE_CONNECTOR_ID:"safe",LEDGER_CONNECTOR_ID:"ledger",EIP6963_CONNECTOR_ID:"eip6963",EMAIL_CONNECTOR_ID:"w3mEmail",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet"},VERSION:"4.1.11"},an={ConnectorExplorerIds:{[Ee.COINBASE_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[Ee.SAFE_CONNECTOR_ID]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[Ee.LEDGER_CONNECTOR_ID]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"},EIP155NetworkImageIds:{1:"692ed6ba-e569-459a-556a-776476829e00",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700"},ConnectorImageIds:{[Ee.COINBASE_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[Ee.COINBASE_SDK_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[Ee.SAFE_CONNECTOR_ID]:"461db637-8616-43ce-035a-d89b8a1d5800",[Ee.LEDGER_CONNECTOR_ID]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[Ee.WALLET_CONNECT_CONNECTOR_ID]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[Ee.INJECTED_CONNECTOR_ID]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[Ee.INJECTED_CONNECTOR_ID]:"Browser Wallet",[Ee.WALLET_CONNECT_CONNECTOR_ID]:"WalletConnect",[Ee.COINBASE_CONNECTOR_ID]:"Coinbase",[Ee.COINBASE_SDK_CONNECTOR_ID]:"Coinbase",[Ee.LEDGER_CONNECTOR_ID]:"Ledger",[Ee.SAFE_CONNECTOR_ID]:"Safe"},ConnectorTypesMap:{[Ee.INJECTED_CONNECTOR_ID]:"INJECTED",[Ee.WALLET_CONNECT_CONNECTOR_ID]:"WALLET_CONNECT",[Ee.EIP6963_CONNECTOR_ID]:"ANNOUNCED",[Ee.EMAIL_CONNECTOR_ID]:"EMAIL"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},W4={getCaipTokens(i){if(!i)return;const e={};return Object.entries(i).forEach(([t,r])=>{e[`${Ee.EIP155}:${t}`]=r}),e}};var Pu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ds=class extends ce{constructor(){super(),this.unsubscribe=[],this.connectors=We.state.connectors,this.count=xe.state.count,this.unsubscribe.push(We.subscribeKey("connectors",e=>this.connectors=e),xe.subscribeKey("count",e=>this.count=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` + + + + ${this.walletConnectConnectorTemplate()} ${this.recentTemplate()} + ${this.announcedTemplate()} ${this.injectedTemplate()} ${this.featuredTemplate()} + ${this.customTemplate()} ${this.recommendedTemplate()} ${this.externalTemplate()} + ${this.allWalletsTemplate()} + + + `}walletConnectConnectorTemplate(){if(re.isMobile())return null;const e=this.connectors.find(t=>t.type==="WALLET_CONNECT");return e?T` + this.onConnector(e)} + tagLabel="qr code" + tagVariant="main" + data-testid="wallet-selector-walletconnect" + > + + `:null}customTemplate(){const{customWallets:e}=pe.state;return e!=null&&e.length?this.filterOutDuplicateWallets(e).map(r=>T` + this.onConnectWallet(r)} + data-testid=${`wallet-selector-${r.id}`} + > + + `):null}featuredTemplate(){if(!this.connectors.find(o=>o.type==="WALLET_CONNECT"))return null;const{featured:t}=xe.state;return t.length?this.filterOutDuplicateWallets(t).map(o=>T` + this.onConnectWallet(o)} + > + + `):null}recentTemplate(){return ht.getRecentWallets().map(t=>T` + this.onConnectWallet(t)} + tagLabel="recent" + tagVariant="shade" + > + + `)}announcedTemplate(){return this.connectors.map(e=>e.type!=="ANNOUNCED"?null:T` + this.onConnector(e)} + tagVariant="success" + .installed=${!0} + > + + `)}injectedTemplate(){return this.connectors.map(e=>e.type!=="INJECTED"||!ke.checkInstalled()?null:T` + this.onConnector(e)} + > + + `)}externalTemplate(){const e=We.getAnnouncedConnectorRdns();return this.connectors.map(t=>["WALLET_CONNECT","INJECTED","ANNOUNCED","EMAIL"].includes(t.type)||e.includes(Ee.CONNECTOR_RDNS_MAP[t.id])?null:T` + this.onConnector(t)} + > + + `)}allWalletsTemplate(){const e=this.connectors.find(a=>a.type==="WALLET_CONNECT"),{allWallets:t}=pe.state;if(!e||t==="HIDE"||t==="ONLY_MOBILE"&&!re.isMobile())return null;const r=xe.state.featured.length,o=this.count+r,n=o<10?o:Math.floor(o/10)*10,s=n + `}recommendedTemplate(){if(!this.connectors.find(v=>v.type==="WALLET_CONNECT"))return null;const{recommended:t}=xe.state,{customWallets:r,featuredWalletIds:o}=pe.state,{connectors:n}=We.state,s=ht.getRecentWallets(),c=n.filter(v=>v.type==="INJECTED").filter(v=>v.name!=="Browser Wallet");if(o||r||!t.length)return null;const l=c.length+s.length,h=Math.max(0,2-l);return this.filterOutDuplicateWallets(t).slice(0,h).map(v=>T` + this.onConnectWallet(v)} + > + + `)}onConnector(e){e.type==="WALLET_CONNECT"?re.isMobile()?G.push("AllWallets"):G.push("ConnectingWalletConnect"):G.push("ConnectingExternal",{connector:e})}filterOutDuplicateWallets(e){const t=ht.getRecentWallets(),r=this.connectors.map(a=>{var c;return(c=a.info)==null?void 0:c.rdns}).filter(Boolean),o=t.map(a=>a.rdns).filter(Boolean),n=r.concat(o);return e.filter(a=>!n.includes(String(a==null?void 0:a.rdns)))}onAllWallets(){we.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),G.push("AllWallets")}onConnectWallet(e){G.push("ConnectingWalletConnect",{wallet:e})}};Ds.styles=j4;Pu([U()],Ds.prototype,"connectors",void 0);Pu([U()],Ds.prototype,"count",void 0);Ds=Pu([V("w3m-connect-view")],Ds);const z4=_e` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-thumbnail { + position: absolute; + } + + wui-icon-box { + position: absolute; + right: calc(var(--wui-spacing-3xs) * -1); + bottom: calc(var(--wui-spacing-3xs) * -1); + opacity: 0; + transform: scale(0.5); + transition-property: opacity, transform; + transition-duration: var(--wui-duration-lg); + transition-timing-function: var(--wui-ease-out-power-2); + will-change: opacity, transform; + } + + wui-text[align='center'] { + width: 100%; + padding: 0px var(--wui-spacing-l); + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + [data-retry='false'] wui-link { + display: none; + } + + [data-retry='true'] wui-link { + display: block; + opacity: 1; + } +`;var Kr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};class Yt extends ce{constructor(){var e,t,r,o;super(),this.wallet=(e=G.state.data)==null?void 0:e.wallet,this.connector=(t=G.state.data)==null?void 0:t.connector,this.timeout=void 0,this.secondaryBtnLabel="Try again",this.secondaryBtnIcon="refresh",this.secondaryLabel="Accept connection request in the wallet",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=He.getWalletImage(this.wallet)??He.getConnectorImage(this.connector),this.name=((r=this.wallet)==null?void 0:r.name)??((o=this.connector)==null?void 0:o.name)??"Wallet",this.isRetrying=!1,this.uri=ke.state.wcUri,this.error=ke.state.wcError,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(ke.subscribeKey("wcUri",n=>{var s;this.uri=n,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(s=this.onConnect)==null||s.call(this))}),ke.subscribeKey("wcError",n=>this.error=n),ke.subscribeKey("buffering",n=>this.buffering=n))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearTimeout(this.timeout)}render(){var r;(r=this.onRender)==null||r.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let t=`Continue in ${this.name}`;return this.buffering&&(t="Connecting..."),this.error&&(t="Connection declined"),T` + + + + + ${this.error?null:this.loaderTemplate()} + + + + + + + ${t} + + ${e} + + + + + ${this.secondaryBtnLabel} + + + + ${this.isWalletConnect?T` + + + + Copy link + + + `:null} + + + `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");t==null||t.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,t;this.buffering||(ke.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(t=this.onConnect)==null||t.call(this))}loaderTemplate(){const e=ft.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return T``}onCopyUri(){try{this.uri&&(re.copyToClopboard(this.uri),Le.showSuccess("Link copied"))}catch{Le.showError("Failed to copy")}}}Yt.styles=z4;Kr([U()],Yt.prototype,"uri",void 0);Kr([U()],Yt.prototype,"error",void 0);Kr([U()],Yt.prototype,"ready",void 0);Kr([U()],Yt.prototype,"showRetry",void 0);Kr([U()],Yt.prototype,"buffering",void 0);Kr([ge({type:Boolean})],Yt.prototype,"isMobile",void 0);Kr([ge()],Yt.prototype,"onRetry",void 0);var F4=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ld=class extends Yt{constructor(){if(super(),!this.connector)throw new Error("w3m-connecting-view: No connector provided");we.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.imageUrl&&ht.setConnectedWalletImageUrl(this.connector.imageUrl),await ke.connectExternal(this.connector),pe.state.isSiweEnabled?G.push("ConnectingSiwe"):Re.close(),we.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){we.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};Ld=F4([V("w3m-connecting-external-view")],Ld);var Nu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ha=class extends ce{constructor(){var e;super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=(e=G.state.data)==null?void 0:e.wallet,this.platform=void 0,this.platforms=[],this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),dt.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return this.wallet?(this.determinePlatforms(),T` + ${this.headerTemplate()} +
${this.platformTemplate()}
+ `):T``}async initializeConnection(e=!1){try{const{wcPairingExpiry:t}=ke.state;if(e||re.isPairingExpired(t)){if(ke.connectWalletConnect(),this.wallet){const r=He.getWalletImage(this.wallet);r&&ht.setConnectedWalletImageUrl(r)}else{const o=We.state.connectors.find(s=>s.type==="WALLET_CONNECT"),n=He.getConnectorImage(o);n&&ht.setConnectedWalletImageUrl(n)}await ke.state.wcPromise,this.finalizeConnection(),pe.state.isSiweEnabled?G.push("ConnectingSiwe"):Re.close()}}catch(t){we.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(t==null?void 0:t.message)??"Unknown"}}),ke.setWcError(!0),re.isAllowedRetry(this.lastRetry)&&(Le.showError("Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0))}}finalizeConnection(){var r;const{wcLinking:e,recentWallet:t}=ke.state;e&&ht.setWalletConnectDeepLink(e),t&&ht.setWeb3ModalRecent(t),we.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:e?"mobile":"qrcode",name:((r=this.wallet)==null?void 0:r.name)||"Unknown"}})}determinePlatforms(){if(!this.wallet)throw new Error("w3m-connecting-wc-view:determinePlatforms No wallet");if(this.platform)return;const{mobile_link:e,desktop_link:t,webapp_link:r,injected:o,rdns:n}=this.wallet,s=o==null?void 0:o.map(({injected_id:O})=>O).filter(Boolean),a=n?[n]:s??[],c=a.length,l=e,h=r,p=ke.checkInstalled(a),v=c&&p,S=t&&!re.isMobile();v&&this.platforms.push("browser"),l&&this.platforms.push(re.isMobile()?"mobile":"qrcode"),h&&this.platforms.push("web"),S&&this.platforms.push("desktop"),!v&&c&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return T``;case"desktop":return T` + this.initializeConnection(!0)}> + + `;case"web":return T` + this.initializeConnection(!0)}> + + `;case"mobile":return T` + this.initializeConnection(!0)}> + + `;case"qrcode":return T``;default:return T``}}headerTemplate(){return this.platforms.length>1?T` + + + `:null}async onSelectPlatform(e){var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};Nu([U()],Ha.prototype,"platform",void 0);Nu([U()],Ha.prototype,"platforms",void 0);Ha=Nu([V("w3m-connecting-wc-view")],Ha);var H4=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Bd=class extends ce{constructor(){var e;super(...arguments),this.wallet=(e=G.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return T` + + ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} + ${this.homepageTemplate()} + + `}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?T` + Chrome Extension + `:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?T` + iOS App + `:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?T` + Android App + `:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?T` + + Website + + `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&re.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&re.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&re.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&re.openHref(this.wallet.homepage,"_blank")}};Bd=H4([V("w3m-downloads-view")],Bd);var V4=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const Z4="https://walletconnect.com/explorer";let Ud=class extends ce{render(){return T` + + ${this.recommendedWalletsTemplate()} + {re.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} + > + + `}recommendedWalletsTemplate(){const{recommended:e,featured:t}=xe.state,{customWallets:r}=pe.state;return[...t,...r??[],...e].slice(0,4).map(n=>T` + {re.openHref(n.homepage??Z4,"_blank")}} + > + `)}};Ud=V4([V("w3m-get-wallet-view")],Ud);const G4=_e` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-hexagon { + position: absolute; + } + + wui-icon-box { + position: absolute; + right: 4px; + bottom: 0; + opacity: 0; + transform: scale(0.5); + z-index: 1; + } + + wui-button { + display: none; + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + wui-button[data-retry='true'] { + display: block; + opacity: 1; + } +`;var Du=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ms=class extends ce{constructor(){var e;super(),this.network=(e=G.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),t=this.getSubLabel();return T` + + + + + ${this.error?null:T``} + + + + + + ${e} + ${t} + + + + + Try again + + + `}getSubLabel(){const e=ht.getConnectedConnector();return We.getEmailConnector()&&e==="EMAIL"?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var r;const e=ht.getConnectedConnector();return We.getEmailConnector()&&e==="EMAIL"?`Switching to ${((r=this.network)==null?void 0:r.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");t==null||t.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&(await de.switchActiveNetwork(this.network),pe.state.isSiweEnabled||tu.navigateAfterNetworkSwitch())}catch{this.error=!0}}};Ms.styles=G4;Du([U()],Ms.prototype,"showRetry",void 0);Du([U()],Ms.prototype,"error",void 0);Ms=Du([V("w3m-network-switch-view")],Ms);const q4=_e` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var F1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Va=class extends ce{constructor(){super(),this.unsubscribe=[],this.caipNetwork=de.state.caipNetwork,this.unsubscribe.push(de.subscribeKey("caipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` + + ${this.networksTemplate()} + + + + + + + Your connected wallet may not support some of the networks available for this dApp + + + + What is a network + + + `}onNetworkHelp(){we.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),G.push("WhatIsANetwork")}networksTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:t,supportsAllNetworks:r}=de.state,o=re.sortRequestedNetworks(e,t);return o==null?void 0:o.map(n=>{var s;return T` + this.onSwitchNetwork(n)} + .disabled=${!r&&!(e!=null&&e.includes(n.id))} + data-testid=${`w3m-network-switch-${n.name??n.id}`} + > + `})}async onSwitchNetwork(e){const{isConnected:t}=te.state,{approvedCaipNetworkIds:r,supportsAllNetworks:o,caipNetwork:n}=de.state,{data:s}=G.state;t&&(n==null?void 0:n.id)!==e.id?r!=null&&r.includes(e.id)?(await de.switchActiveNetwork(e),tu.navigateAfterNetworkSwitch()):o&&G.push("SwitchNetwork",{...s,network:e}):t||(de.setCaipNetwork(e),G.push("Connect"))}};Va.styles=q4;F1([U()],Va.prototype,"caipNetwork",void 0);Va=F1([V("w3m-networks-view")],Va);const Y4=_e` + :host > wui-flex { + height: 500px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + padding: var(--wui-spacing-m); + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: flex-start; + } + + :host > wui-flex > wui-flex { + width: 100%; + } + + wui-transaction-list-item-loader { + width: 100%; + } +`;var Xs=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const K4=7;let Br=class extends ce{constructor(){super(),this.unsubscribe=[],this.refetchTimeout=void 0,this.selectedOnRampProvider=Fe.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=$t.state.coinbaseTransactions,this.tokenImages=bt.state.tokenImages,this.unsubscribe.push(Fe.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e}),bt.subscribeKey("tokenImages",e=>this.tokenImages=e),()=>{clearTimeout(this.refetchTimeout)},$t.subscribe(e=>{this.coinbaseTransactions={...e.coinbaseTransactions}})),$t.clearCursor(),this.fetchTransactions()}render(){return T` + + ${this.loading?this.templateLoading():this.templateTransactionsByYear()} + + `}templateTransactions(e){return e==null?void 0:e.map(t=>{var a,c,l;const r=eu.formatDate((a=t==null?void 0:t.metadata)==null?void 0:a.minedAt),o=t.transfers[0],n=o==null?void 0:o.fungible_info;if(!n)return null;const s=((c=n==null?void 0:n.icon)==null?void 0:c.url)||((l=this.tokenImages)==null?void 0:l[n.symbol||""]);return T` + + `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(t=>{const r=parseInt(t,10);return new Array(12).fill(null).map((n,s)=>s).reverse().map(n=>{var c;const s=$n.getTransactionGroupTitle(r,n),a=(c=this.coinbaseTransactions[r])==null?void 0:c[n];return a?T` + + + ${s} + + + ${this.templateTransactions(a)} + + + `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const e=te.state.address,t=pe.state.projectId;if(!e)throw new Error("No address found");if(!t)throw new Error("No projectId found");this.loading=!0,await $t.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){var o;const e=new Date;if((((o=this.coinbaseTransactions[e.getFullYear()])==null?void 0:o[e.getMonth()])||[]).filter(n=>n.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length===0){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{const n=te.state.address;await $t.fetchTransactions(n,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(K4).fill(T` `).map(e=>e)}};Br.styles=Y4;Xs([U()],Br.prototype,"selectedOnRampProvider",void 0);Xs([U()],Br.prototype,"loading",void 0);Xs([U()],Br.prototype,"coinbaseTransactions",void 0);Xs([U()],Br.prototype,"tokenImages",void 0);Br=Xs([V("w3m-onramp-activity-view")],Br);const J4=_e` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var Rc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let No=class extends ce{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=Fe.state.paymentCurrency,this.currencies=Fe.state.paymentCurrencies,this.currencyImages=bt.state.currencyImages,this.unsubscribe.push(Fe.subscribe(e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies}),bt.subscribeKey("currencyImages",e=>this.currencyImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` + + ${this.currenciesTemplate()} + + + `}currenciesTemplate(){return this.currencies.map(e=>{var t;return T` + this.selectCurrency(e)} + variant="image" + > + ${e.id} + + `})}selectCurrency(e){e&&(Fe.setPaymentCurrency(e),Re.close())}};No.styles=J4;Rc([U()],No.prototype,"selectedCurrency",void 0);Rc([U()],No.prototype,"currencies",void 0);Rc([U()],No.prototype,"currencyImages",void 0);No=Rc([V("w3m-onramp-fiat-select-view")],No);var H1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Rl=class extends ce{constructor(){super(),this.unsubscribe=[],this.providers=Fe.state.providers,this.unsubscribe.push(Fe.subscribeKey("providers",e=>{this.providers=e}))}firstUpdated(){const e=this.providers.map(async t=>t.name==="coinbase"?await this.getCoinbaseOnRampURL():Promise.resolve(t==null?void 0:t.url));Promise.all(e).then(t=>{this.providers=this.providers.map((r,o)=>({...r,url:t[o]||""}))})}render(){return T` + + ${this.onRampProvidersTemplate()} + + + `}onRampProvidersTemplate(){return this.providers.map(e=>T` + {this.onClickProvider(e)}} + ?disabled=${!e.url} + > + `)}onClickProvider(e){Fe.setSelectedProvider(e),G.push("BuyInProgress"),re.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes")}async getCoinbaseOnRampURL(){const e=te.state.address,t=de.state.caipNetwork;if(!e)throw new Error("No address found");if(!(t!=null&&t.name))throw new Error("No network found");const r=dt.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[t.name]??dt.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,o=Fe.state.purchaseCurrency,n=o?[o.symbol]:Fe.state.purchaseCurrencies.map(s=>s.symbol);return await Lt.generateOnRampURL({defaultNetwork:r,destinationWallets:[{address:e,blockchains:dt.WC_COINBASE_PAY_SDK_CHAINS,assets:n}],partnerUserId:e,purchaseAmount:Fe.state.purchaseAmount})}};H1([U()],Rl.prototype,"providers",void 0);Rl=H1([V("w3m-onramp-providers-view")],Rl);const X4=_e` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var Ic=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Do=class extends ce{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=Fe.state.purchaseCurrencies,this.tokens=Fe.state.purchaseCurrencies,this.tokenImages=bt.state.tokenImages,this.unsubscribe.push(Fe.subscribe(e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies}),bt.subscribeKey("tokenImages",e=>this.tokenImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` + + ${this.currenciesTemplate()} + + + `}currenciesTemplate(){return this.tokens.map(e=>{var t;return T` + this.selectToken(e)} + variant="image" + > + + ${e.name} + ${e.symbol} + + + `})}selectToken(e){e&&(Fe.setPurchaseCurrency(e),Re.close())}};Do.styles=X4;Ic([U()],Do.prototype,"selectedCurrency",void 0);Ic([U()],Do.prototype,"tokens",void 0);Ic([U()],Do.prototype,"tokenImages",void 0);Do=Ic([V("w3m-onramp-token-select-view")],Do);const Q4=_e` + :host > wui-flex:first-child { + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + } + + wui-loading-hexagon { + position: absolute; + } + + .action-button { + width: 100%; + border-radius: var(--wui-border-radius-xs); + } + + .action-button:disabled { + border-color: 1px solid var(--wui-gray-glass-005); + } + + .convert-inputs-container { + position: relative; + } + + .replace-tokens-button { + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + gap: var(--wui-spacing-1xs); + height: 40px; + width: 40px; + padding: var(--wui-spacing-xs); + border: none; + border-radius: var(--wui-border-radius-xxs); + background: var(--wui-gray-glass-005); + transition: background-color var(--wui-duration-md) var(--wui-ease-out-power-1); + will-change: background-color; + z-index: 20; + } + + .replace-tokens-button:hover { + background: var(--wui-gray-glass-010); + } + + .details-container > wui-flex { + background: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + width: 100%; + } + + .details-container > wui-flex > button { + border: none; + background: none; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + transition: background 0.2s linear; + } + + .details-container > wui-flex > button:hover { + background: var(--wui-gray-glass-002); + } + + .details-content-container { + padding: var(--wui-spacing-1xs); + display: flex; + align-items: center; + justify-content: center; + } + + .details-content-container > wui-flex { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s) var(--wui-spacing-xl); + border-radius: var(--wui-border-radius-xxs); + background: var(--wui-gray-glass-002); + } + + .free-badge { + background: rgba(38, 217, 98, 0.15); + border-radius: var(--wui-border-radius-4xs); + padding: 4.5px 6px; + } +`;var xt=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let pt=class extends ce{constructor(){var e;super(),this.unsubscribe=[],this.detailsOpen=!1,this.caipNetworkId=(e=de.state.caipNetwork)==null?void 0:e.id,this.initialized=he.state.initialized,this.loading=he.state.loading,this.loadingPrices=he.state.loadingPrices,this.sourceToken=he.state.sourceToken,this.sourceTokenAmount=he.state.sourceTokenAmount,this.sourceTokenPriceInUSD=he.state.sourceTokenPriceInUSD,this.toToken=he.state.toToken,this.toTokenAmount=he.state.toTokenAmount,this.toTokenPriceInUSD=he.state.toTokenPriceInUSD,this.inputError=he.state.inputError,this.gasPriceInUSD=he.state.gasPriceInUSD,this.priceImpact=he.state.priceImpact,this.maxSlippage=he.state.maxSlippage,this.transactionLoading=he.state.transactionLoading,this.onDebouncedGetSwapCalldata=re.debounce(async()=>{await he.convertTokens()},500),de.subscribeKey("caipNetwork",t=>{this.caipNetworkId!==(t==null?void 0:t.id)&&(this.caipNetworkId=t==null?void 0:t.id,he.resetTokens(),he.resetValues(),he.initializeState())}),this.unsubscribe.push(Re.subscribeKey("open",t=>{t||he.resetValues()}),G.subscribeKey("view",t=>{t.includes("Convert")||he.resetValues()}),he.subscribe(t=>{this.initialized=t.initialized,this.loading=t.loading,this.loadingPrices=t.loadingPrices,this.transactionLoading=t.transactionLoading,this.sourceToken=t.sourceToken,this.sourceTokenAmount=t.sourceTokenAmount,this.sourceTokenPriceInUSD=t.sourceTokenPriceInUSD,this.toToken=t.toToken,this.toTokenAmount=t.toTokenAmount,this.toTokenPriceInUSD=t.toTokenPriceInUSD,this.inputError=t.inputError,this.gasPriceInUSD=t.gasPriceInUSD,this.priceImpact=t.priceImpact,this.maxSlippage=t.maxSlippage})),this.watchTokensAndValues()}firstUpdated(){this.initialized||he.initializeState()}disconnectedCallback(){he.setLoading(!1),this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return T` + + ${this.initialized?this.templateSwap():this.templateLoading()} + + `}watchTokensAndValues(){this.interval=setInterval(()=>{he.getNetworkTokenPrice(),he.getMyTokensWithBalance(),he.refreshConvertValues()},2e4)}templateSwap(){return T` + + + ${this.templateTokenInput("sourceToken",this.sourceToken)} + ${this.templateTokenInput("toToken",this.toToken)} ${this.templateReplaceTokensButton()} + + ${this.templateDetails()} ${this.templateActionButton()} + + `}actionButtonLabel(){return this.inputError?this.inputError:"Review convert"}templateReplaceTokensButton(){return T` + + `}templateLoading(){return T` + + + + `}templateTokenInput(e,t){var a,c;const r=(a=he.state.myTokensWithBalance)==null?void 0:a.find(l=>(l==null?void 0:l.address)===(t==null?void 0:t.address)),o=e==="toToken"?this.toTokenAmount:this.sourceTokenAmount,n=e==="toToken"?this.toTokenPriceInUSD:this.sourceTokenPriceInUSD;let s=parseFloat(o)*n;return e==="toToken"&&(s-=this.gasPriceInUSD||0),T``}onSetMaxValue(e,t){const r=e==="sourceToken"?this.sourceToken:this.toToken,o=(r==null?void 0:r.address)===dt.NATIVE_TOKEN_ADDRESS;let n="0";if(!t){n="0",this.handleChangeAmount(e,n);return}if(!this.gasPriceInUSD){n=t,this.handleChangeAmount(e,n);return}const s=At.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.sourceTokenPriceInUSD),a=o?At.bigNumber(t).minus(s):At.bigNumber(t);this.handleChangeAmount(e,a.isGreaterThan(0)?a.toFixed(20):"0")}templateDetails(){var t,r;if(this.loading||this.inputError||!this.sourceToken||!this.toToken||!this.sourceTokenAmount||!this.toTokenAmount)return null;const e=this.sourceTokenPriceInUSD&&this.toTokenPriceInUSD?1/this.toTokenPriceInUSD*this.sourceTokenPriceInUSD:0;return T` + + `}handleChangeAmount(e,t){he.clearError(),e==="sourceToken"?he.setSourceTokenAmount(t):he.setToTokenAmount(t),this.onDebouncedGetSwapCalldata()}templateActionButton(){const e=!this.toToken||!this.sourceToken,t=this.loading||this.loadingPrices||this.transactionLoading;return T` + + ${this.actionButtonLabel()} + + `}onSwitchTokens(){he.switchTokens()}onConvertPreview(){G.push("ConvertPreview")}};pt.styles=Q4;xt([U()],pt.prototype,"interval",void 0);xt([U()],pt.prototype,"detailsOpen",void 0);xt([U()],pt.prototype,"caipNetworkId",void 0);xt([U()],pt.prototype,"initialized",void 0);xt([U()],pt.prototype,"loading",void 0);xt([U()],pt.prototype,"loadingPrices",void 0);xt([U()],pt.prototype,"sourceToken",void 0);xt([U()],pt.prototype,"sourceTokenAmount",void 0);xt([U()],pt.prototype,"sourceTokenPriceInUSD",void 0);xt([U()],pt.prototype,"toToken",void 0);xt([U()],pt.prototype,"toTokenAmount",void 0);xt([U()],pt.prototype,"toTokenPriceInUSD",void 0);xt([U()],pt.prototype,"inputError",void 0);xt([U()],pt.prototype,"gasPriceInUSD",void 0);xt([U()],pt.prototype,"priceImpact",void 0);xt([U()],pt.prototype,"maxSlippage",void 0);xt([U()],pt.prototype,"transactionLoading",void 0);pt=xt([V("w3m-convert-view")],pt);const ev=_e` + :host > wui-flex:first-child { + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + } + + .preview-container, + .details-container { + width: 100%; + } + + .token-image { + width: 24px; + height: 24px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + border-radius: 12px; + } + + wui-loading-hexagon { + position: absolute; + } + + .token-item { + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-xxs); + padding: var(--wui-spacing-xs); + height: 40px; + border: none; + border-radius: 80px; + background: var(--wui-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + cursor: pointer; + transition: background 0.2s linear; + } + + .token-item:hover { + background: var(--wui-gray-glass-005); + } + + .preview-token-details-container { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s) var(--wui-spacing-xl); + border-radius: var(--wui-border-radius-xxs); + background: var(--wui-gray-glass-002); + } + + .action-buttons-container { + width: 100%; + gap: var(--wui-spacing-xs); + } + + .action-buttons-container > button { + display: flex; + align-items: center; + justify-content: center; + background: transparent; + height: 48px; + border-radius: var(--wui-border-radius-xs); + border: none; + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } + + .action-buttons-container > button:disabled { + opacity: 0.8; + cursor: not-allowed; + } + + .cancel-button:hover, + .convert-button:hover { + cursor: pointer; + } + + .action-buttons-container > button.cancel-button { + flex: 2; + } + + .action-buttons-container > button.convert-button { + flex: 4; + background-color: var(--wui-color-accent-090); + } + + .action-buttons-container > button.convert-button > wui-text { + color: white; + } + + .details-container > wui-flex { + background: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + width: 100%; + } + + .details-container > wui-flex > button { + border: none; + background: none; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + transition: background 0.2s linear; + } + + .details-container > wui-flex > button:hover { + background: var(--wui-gray-glass-002); + } + + .details-content-container { + padding: var(--wui-spacing-1xs); + display: flex; + align-items: center; + justify-content: center; + } + + .details-content-container > wui-flex { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s) var(--wui-spacing-xl); + border-radius: var(--wui-border-radius-xxs); + background: var(--wui-gray-glass-002); + } + + .free-badge { + background: rgba(38, 217, 98, 0.15); + border-radius: var(--wui-border-radius-4xs); + padding: 4.5px 6px; + } +`;var Pt=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let yt=class extends ce{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!0,this.approvalTransaction=he.state.approvalTransaction,this.convertTransaction=he.state.convertTransaction,this.sourceToken=he.state.sourceToken,this.sourceTokenAmount=he.state.sourceTokenAmount??"",this.sourceTokenPriceInUSD=he.state.sourceTokenPriceInUSD,this.toToken=he.state.toToken,this.toTokenAmount=he.state.toTokenAmount??"",this.toTokenPriceInUSD=he.state.toTokenPriceInUSD,this.caipNetwork=de.state.caipNetwork,this.transactionLoading=he.state.transactionLoading,this.balanceSymbol=te.state.balanceSymbol,this.gasPriceInUSD=he.state.gasPriceInUSD,this.priceImpact=he.state.priceImpact,this.maxSlippage=he.state.maxSlippage,this.unsubscribe.push(te.subscribeKey("balanceSymbol",e=>{this.balanceSymbol!==e&&G.goBack()}),de.subscribeKey("caipNetwork",e=>{this.caipNetwork!==e&&(this.caipNetwork=e)}),he.subscribe(e=>{this.approvalTransaction=e.approvalTransaction,this.convertTransaction=e.convertTransaction,this.sourceToken=e.sourceToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toToken=e.toToken,this.transactionLoading=e.transactionLoading,this.gasPriceInUSD=e.gasPriceInUSD,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.sourceTokenAmount=e.sourceTokenAmount??"",this.toTokenAmount=e.toTokenAmount??"",this.priceImpact=e.priceImpact,this.maxSlippage=e.maxSlippage}))}render(){return T` + ${this.templateSwap()} + `}templateSwap(){var a,c,l,h;const e=`${ve.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${(a=this.sourceToken)==null?void 0:a.symbol}`,t=`${ve.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${(c=this.toToken)==null?void 0:c.symbol}`,r=parseFloat(this.sourceTokenAmount)*this.sourceTokenPriceInUSD,o=parseFloat(this.toTokenAmount)*this.toTokenPriceInUSD-(this.gasPriceInUSD||0),n=ve.formatNumberToLocalString(r),s=ve.formatNumberToLocalString(o);return T` + + + + + Send + $${n} + + + + + + + + Receive + $${s} + + + + + + + ${this.templateDetails()} + + + + Review transaction carefully + + + + + + + + `}templateDetails(){var t,r;const e=this.sourceTokenPriceInUSD&&this.toTokenPriceInUSD?1/this.toTokenPriceInUSD*this.sourceTokenPriceInUSD:0;return T` + + `}actionButtonLabel(){return this.approvalTransaction?"Approve":"Convert"}onCancelTransaction(){G.goBack()}onSendTransaction(){this.approvalTransaction?he.sendTransactionForApproval(this.approvalTransaction):he.sendTransactionForConvert(this.convertTransaction)}};yt.styles=ev;Pt([U()],yt.prototype,"detailsOpen",void 0);Pt([U()],yt.prototype,"approvalTransaction",void 0);Pt([U()],yt.prototype,"convertTransaction",void 0);Pt([U()],yt.prototype,"sourceToken",void 0);Pt([U()],yt.prototype,"sourceTokenAmount",void 0);Pt([U()],yt.prototype,"sourceTokenPriceInUSD",void 0);Pt([U()],yt.prototype,"toToken",void 0);Pt([U()],yt.prototype,"toTokenAmount",void 0);Pt([U()],yt.prototype,"toTokenPriceInUSD",void 0);Pt([U()],yt.prototype,"caipNetwork",void 0);Pt([U()],yt.prototype,"transactionLoading",void 0);Pt([U()],yt.prototype,"balanceSymbol",void 0);Pt([U()],yt.prototype,"gasPriceInUSD",void 0);Pt([U()],yt.prototype,"priceImpact",void 0);Pt([U()],yt.prototype,"maxSlippage",void 0);yt=Pt([V("w3m-convert-preview-view")],yt);const tv=_e` + :host { + --tokens-scroll--top-opacity: 0; + --tokens-scroll--bottom-opacity: 1; + --suggested-tokens-scroll--left-opacity: 0; + --suggested-tokens-scroll--right-opacity: 1; + } + + :host > wui-flex:first-child { + overflow-y: hidden; + overflow-x: hidden; + scrollbar-width: none; + scrollbar-height: none; + } + + wui-loading-hexagon { + position: absolute; + } + + .search-input-container, + .suggested-tokens-container { + padding-left: var(--wui-spacing-s); + padding-right: var(--wui-spacing-s); + } + + .tokens-container .tokens { + padding: 0px var(--wui-spacing-s); + padding-bottom: var(--wui-spacing-s); + } + + .search-input-container { + padding-top: var(--wui-spacing-s); + } + + .suggested-tokens-container { + overflow-x: auto; + mask-image: linear-gradient( + to right, + rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 0px, + rgba(200, 200, 200, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 1px, + black 50px, + black 90px, + black calc(100% - 90px), + black calc(100% - 50px), + rgba(155, 155, 155, calc(1 - var(--suggested-tokens-scroll--right-opacity))) calc(100% - 1px), + rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--right-opacity))) 100% + ); + } + + .suggested-tokens-container::-webkit-scrollbar { + display: none; + } + + .tokens-container { + border-top: 1px solid var(--wui-gray-glass-005); + height: 100%; + max-height: 390px; + } + + .tokens { + width: 100%; + overflow-y: auto; + mask-image: linear-gradient( + to bottom, + rgba(0, 0, 0, calc(1 - var(--tokens-scroll--top-opacity))) 0px, + rgba(200, 200, 200, calc(1 - var(--tokens-scroll--top-opacity))) 1px, + black 50px, + black 90px, + black calc(100% - 90px), + black calc(100% - 50px), + rgba(155, 155, 155, calc(1 - var(--tokens-scroll--bottom-opacity))) calc(100% - 1px), + rgba(0, 0, 0, calc(1 - var(--tokens-scroll--bottom-opacity))) 100% + ); + } + + .network-search-input, + .select-network-button { + height: 40px; + } + + .select-network-button { + border: none; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-xs); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + background-color: transparent; + border-radius: var(--wui-border-radius-xxs); + padding: var(--wui-spacing-xs); + align-items: center; + transition: background-color 0.2s linear; + } + + .select-network-button:hover { + background-color: var(--wui-gray-glass-002); + } + + .select-network-button > wui-image { + width: 26px; + height: 26px; + border-radius: var(--wui-border-radius-xs); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } +`;var Ho=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Yn=class extends ce{constructor(){var e;super(),this.unsubscribe=[],this.targetToken=(e=G.state.data)==null?void 0:e.target,this.sourceToken=he.state.sourceToken,this.toToken=he.state.toToken,this.searchValue="",this.unsubscribe.push(he.subscribe(t=>{this.sourceToken=t.sourceToken,this.toToken=t.toToken})),this.watchTokens()}updated(){var r,o;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".suggested-tokens-container");e==null||e.addEventListener("scroll",this.handleSuggestedTokensScroll.bind(this));const t=(o=this.renderRoot)==null?void 0:o.querySelector(".tokens");t==null||t.addEventListener("scroll",this.handleTokenListScroll.bind(this))}disconnectedCallback(){var r,o;super.disconnectedCallback();const e=(r=this.renderRoot)==null?void 0:r.querySelector(".suggested-tokens-container"),t=(o=this.renderRoot)==null?void 0:o.querySelector(".tokens");e==null||e.removeEventListener("scroll",this.handleSuggestedTokensScroll.bind(this)),t==null||t.removeEventListener("scroll",this.handleTokenListScroll.bind(this)),clearInterval(this.interval)}render(){return T` + + ${this.templateSearchInput()} ${this.templateSuggestedTokens()} ${this.templateTokens()} + + `}watchTokens(){this.interval=setInterval(()=>{he.getNetworkTokenPrice(),he.getMyTokensWithBalance()},5e3)}onSelectToken(e){this.targetToken==="sourceToken"?he.setSourceToken(e):he.setToToken(e),G.goBack()}templateSearchInput(){return T` + + + + `}templateTokens(){const e=he.state.myTokensWithBalance?Object.values(he.state.myTokensWithBalance):[],t=he.state.popularTokens?he.state.popularTokens:[],r=this.filterTokensWithText(e,this.searchValue),o=this.filterTokensWithText(t,this.searchValue);return T` + + + ${(r==null?void 0:r.length)>0?T` + + Your tokens + + ${r.map(n=>{var a,c,l;const s=n.symbol===((a=this.sourceToken)==null?void 0:a.symbol)||n.symbol===((c=this.toToken)==null?void 0:c.symbol);return T` + {s||this.onSelectToken(n)}} + > + + `})} + `:null} + + + Popular tokens + + + ${(o==null?void 0:o.length)>0?o.map(n=>T` + this.onSelectToken(n)} + > + + `):null} + + + `}templateSuggestedTokens(){const e=he.state.suggestedTokens?he.state.suggestedTokens.slice(0,8):null;return e?T` + + ${e.map(t=>T` + this.onSelectToken(t)} + > + + `)} + + `:null}onSearchInputChange(e){this.searchValue=e.detail}handleSuggestedTokensScroll(){var t;const e=(t=this.renderRoot)==null?void 0:t.querySelector(".suggested-tokens-container");e&&(e.style.setProperty("--suggested-tokens-scroll--left-opacity",Jo.interpolate([0,100],[0,1],e.scrollLeft).toString()),e.style.setProperty("--suggested-tokens-scroll--right-opacity",Jo.interpolate([0,100],[0,1],e.scrollWidth-e.scrollLeft-e.offsetWidth).toString()))}handleTokenListScroll(){var t;const e=(t=this.renderRoot)==null?void 0:t.querySelector(".tokens");e&&(e.style.setProperty("--tokens-scroll--top-opacity",Jo.interpolate([0,100],[0,1],e.scrollTop).toString()),e.style.setProperty("--tokens-scroll--bottom-opacity",Jo.interpolate([0,100],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString()))}filterTokensWithText(e,t){return e.filter(r=>`${r.symbol} ${r.name} ${r.address}`.toLowerCase().includes(t.toLowerCase()))}};Yn.styles=tv;Ho([U()],Yn.prototype,"interval",void 0);Ho([U()],Yn.prototype,"targetToken",void 0);Ho([U()],Yn.prototype,"sourceToken",void 0);Ho([U()],Yn.prototype,"toToken",void 0);Ho([U()],Yn.prototype,"searchValue",void 0);Yn=Ho([V("w3m-convert-select-token-view")],Yn);const iv=_e` + :host > wui-flex:first-child { + height: 500px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + padding: var(--wui-spacing-m); + } + + :host > wui-flex:first-child::-webkit-scrollbar { + display: none; + } +`;var nv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Il=class extends ce{render(){return T` + + + + `}};Il.styles=iv;Il=nv([V("w3m-transactions-view")],Il);var rv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const ov=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let jd=class extends ce{render(){return T` + + + {re.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} + > + Learn more + + + + `}};jd=rv([V("w3m-what-is-a-network-view")],jd);var sv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const av=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let Wd=class extends ce{render(){return T` + + + + + Get a wallet + + + `}onGetWallet(){we.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),G.push("GetWallet")}};Wd=sv([V("w3m-what-is-a-wallet-view")],Wd);var cv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let zd=class extends ce{render(){return T` + + + + + Quickly and easily buy digital assets! + + + Simply select your preferred onramp provider and add digital assets to your account + using your credit card or bank transfer + + + + + Buy + + + `}};zd=cv([V("w3m-what-is-a-buy-view")],zd);const lv=_e` + wui-loading-spinner { + margin: 9px auto; + } +`;var Oc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const uv=6;let wn=class extends ce{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var e;super(),this.loading=!1,this.timeoutTimeLeft=vt.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(e=G.state.data)==null?void 0:e.email,this.emailConnector=We.getEmailConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const e=!!this.timeoutTimeLeft,t=this.getFooterLabels(e);return T` + + + Enter the code we sent to + ${this.email} + + + The code expires in 20 minutes + + ${this.loading?T``:T` + + ${this.error?T` + + ${this.error}. Try Again + + `:null} + `} + + + ${t.title} + + ${t.action} + + + + `}startOTPTimeout(){this.timeoutTimeLeft=vt.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=vt.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(e){var t;try{this.loading||(this.otp=e.detail,this.emailConnector&&this.otp.length===uv&&(this.loading=!0,await((t=this.onOtpSubmit)==null?void 0:t.call(this,this.otp))))}catch(r){this.error=re.parseError(r),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!We.getEmailConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),Le.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(e){Le.showError(e)}finally{this.loading=!1}}getFooterLabels(e){return this.onStartOver?{title:"Something wrong?",action:`Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};wn.styles=lv;Oc([U()],wn.prototype,"loading",void 0);Oc([U()],wn.prototype,"timeoutTimeLeft",void 0);Oc([U()],wn.prototype,"error",void 0);wn=Oc([V("w3m-email-otp-widget")],wn);var V1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ol=class extends wn{constructor(){super(),this.unsubscribe=[],this.smartAccountDeployed=te.state.smartAccountDeployed,this.onOtpSubmit=async e=>{try{if(this.emailConnector){const t=de.checkIfSmartAccountEnabled();await this.emailConnector.provider.connectOtp({otp:e}),we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),await ke.connectExternal(this.emailConnector),we.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.emailConnector.name||"Unknown"}}),t&&!this.smartAccountDeployed?G.push("UpgradeToSmartAccount"):Re.close()}}catch(t){throw we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),t}},this.onOtpResend=async e=>{this.emailConnector&&(await this.emailConnector.provider.connectEmail({email:e}),we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))},this.unsubscribe.push(te.subscribeKey("smartAccountDeployed",e=>{this.smartAccountDeployed=e}))}};V1([U()],Ol.prototype,"smartAccountDeployed",void 0);Ol=V1([V("w3m-email-verify-otp-view")],Ol);const dv=_e` + wui-icon-box { + height: var(--wui-icon-box-size-xl); + width: var(--wui-icon-box-size-xl); + } +`;var Z1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Za=class extends ce{constructor(){var e;super(),this.email=(e=G.state.data)==null?void 0:e.email,this.emailConnector=We.getEmailConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.emailConnector)throw new Error("w3m-email-verify-device-view: No email connector provided");return T` + + + + + + + Approve the login link we sent to + + ${this.email} + + + + The code expires in 20 minutes + + + + + Didn't receive it? + + + Resend email + + + + + `}async listenForDeviceApproval(){if(this.emailConnector)try{await this.emailConnector.provider.connectDevice(),we.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),G.replace("EmailVerifyOtp",{email:this.email})}catch{G.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.emailConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.emailConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),Le.showSuccess("Code email resent")}}catch(e){Le.showError(e)}finally{this.loading=!1}}};Za.styles=dv;Z1([U()],Za.prototype,"loading",void 0);Za=Z1([V("w3m-email-verify-device-view")],Za);const hv=_e` + div { + width: 100%; + height: 400px; + } + + [data-ready='false'] { + transform: scale(1.05); + } + + @media (max-width: 430px) { + [data-ready='false'] { + transform: translateY(-50px); + } + } +`;var G1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const Fd=400,Hd=360,pv=64;let Ga=class extends ce{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(Re.subscribeKey("open",e=>{e||(this.onHideIframe(),G.popTransactionStack())}))}disconnectedCallback(){var e;this.onHideIframe(),this.unsubscribe.forEach(t=>t()),(e=this.bodyObserver)==null||e.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block",this.bodyObserver=new ResizeObserver(()=>{this.iframe.style.width=`${Hd}px`,this.iframe.style.height=`${Fd}px`,this.iframe.style.left=`calc(50% - ${Hd/2}px)`,this.iframe.style.top=`calc(50% - ${Fd/2}px + ${pv/2}px)`,this.ready=!0}),this.bodyObserver.observe(window.document.body)}render(){return this.ready&&this.onShowIframe(),T`
`}onShowIframe(){const e=window.innerWidth<=430;this.iframe.animate([{opacity:0,transform:e?"translateY(50px)":"scale(.95)"},{opacity:1,transform:e?"translateY(0)":"scale(1)"}],{duration:200,easing:"ease",fill:"forwards"})}async onHideIframe(){this.iframe.style.display="none",await this.iframe.animate([{opacity:1},{opacity:0}],{duration:200,easing:"ease",fill:"forwards"}).finished}async syncTheme(){const e=We.getEmailConnector();e&&await e.provider.syncTheme({themeVariables:ft.getSnapshot().themeVariables})}};Ga.styles=hv;G1([U()],Ga.prototype,"ready",void 0);Ga=G1([V("w3m-approve-transaction-view")],Ga);var fv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Vd=class extends ce{render(){return T` + + Follow the instructions on + + + + You will have to reconnect for security reasons + + + `}};Vd=fv([V("w3m-upgrade-wallet-view")],Vd);var Mu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let qa=class extends ce{constructor(){super(...arguments),this.emailConnector=We.getEmailConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.emailConnector)try{this.loading=!0,await this.emailConnector.provider.setPreferredAccount(Bt.ACCOUNT_TYPES.SMART_ACCOUNT),await this.emailConnector.provider.connect(),this.loading=!1,G.push("Account")}catch{Le.showError("Error upgrading to smart account")}}}render(){return T` + + ${this.onboardingTemplate()} ${this.buttonsTemplate()} + + Learn more + + + + `}onboardingTemplate(){return T` + + + + + + + + Discover Smart Accounts + + + Access advanced features such as username, social login, improved security and a smoother + user experience! + + + `}buttonsTemplate(){return T` + + Do it later + + Continue + + `}redirectToAccount(){G.push("Account")}};Mu([U()],qa.prototype,"emailConnector",void 0);Mu([U()],qa.prototype,"loading",void 0);qa=Mu([V("w3m-upgrade-to-smart-account-view")],qa);/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const gv=i=>i.strings===void 0;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const wv={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},mv=i=>(...e)=>({_$litDirective$:i,values:e});class vv{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const as=(i,e)=>{var r;const t=i._$AN;if(t===void 0)return!1;for(const o of t)(r=o._$AO)==null||r.call(o,e,!1),as(o,e);return!0},Ya=i=>{let e,t;do{if((e=i._$AM)===void 0)break;t=e._$AN,t.delete(i),i=e}while((t==null?void 0:t.size)===0)},q1=i=>{for(let e;e=i._$AM;i=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(i))break;t.add(i),xv(e)}};function bv(i){this._$AN!==void 0?(Ya(this),this._$AM=i,q1(this)):this._$AM=i}function yv(i,e=!1,t=0){const r=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(r))for(let n=t;n{i.type==wv.CHILD&&(i._$AP??(i._$AP=yv),i._$AQ??(i._$AQ=bv))};class Cv extends vv{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),q1(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,o;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(o=this.disconnected)==null||o.call(this)),t&&(as(this,e),Ya(this))}setValue(e){if(gv(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ka=()=>new _v;class _v{}const fl=new WeakMap,Ja=mv(class extends Cv{render(i){return ut}update(i,[e]){var r;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(r=i.options)==null?void 0:r.host,this.rt(this.ct=i.element)),ut}rt(i){if(typeof this.Y=="function"){const e=this.ht??globalThis;let t=fl.get(e);t===void 0&&(t=new WeakMap,fl.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,e;return typeof this.Y=="function"?(i=fl.get(this.ht??globalThis))==null?void 0:i.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Ev=_e` + wui-email-input { + width: 100%; + } + + form { + width: 100%; + display: block; + position: relative; + } +`;var Lu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ls=class extends ce{constructor(){var e;super(...arguments),this.formRef=Ka(),this.initialEmail=((e=G.state.data)==null?void 0:e.email)??"",this.email="",this.loading=!1}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",t=>{t.key==="Enter"&&this.onSubmitEmail(t)})}render(){const e=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return T` + +
+ + + +
+ + + + Cancel + + + + Save + + +
+ `}onEmailInputChange(e){this.email=e.detail}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const t=We.getEmailConnector();if(!t)throw new Error("w3m-update-email-wallet: Email connector not found");const r=await t.provider.updateEmail({email:this.email});we.sendEvent({type:"track",event:"EMAIL_EDIT"}),r.action==="VERIFY_SECONDARY_OTP"?G.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email}):G.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(t){Le.showError(t),this.loading=!1}}};Ls.styles=Ev;Lu([U()],Ls.prototype,"email",void 0);Lu([U()],Ls.prototype,"loading",void 0);Ls=Lu([V("w3m-update-email-wallet-view")],Ls);var Tv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Zd=class extends wn{constructor(){var e;super(),this.email=(e=G.state.data)==null?void 0:e.email,this.onOtpSubmit=async t=>{try{this.emailConnector&&(await this.emailConnector.provider.updateEmailPrimaryOtp({otp:t}),we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),G.replace("UpdateEmailSecondaryOtp",G.state.data))}catch(r){throw we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),r}},this.onStartOver=()=>{G.replace("UpdateEmailWallet",G.state.data)}}};Zd=Tv([V("w3m-update-email-primary-otp-view")],Zd);var Av=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Gd=class extends wn{constructor(){var e;super(),this.email=(e=G.state.data)==null?void 0:e.newEmail,this.onOtpSubmit=async t=>{try{this.emailConnector&&(await this.emailConnector.provider.updateEmailSecondaryOtp({otp:t}),we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),G.reset("Account"))}catch(r){throw we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),r}},this.onStartOver=()=>{G.replace("UpdateEmailWallet",G.state.data)}}};Gd=Av([V("w3m-update-email-secondary-otp-view")],Gd);const Sv=_e` + :host > wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + + :host > wui-flex::-webkit-scrollbar { + display: none; + } +`;var Y1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Xa=class extends ce{constructor(){super(...arguments),this.disconecting=!1}render(){return T` + + + + This app doesn’t support your current network. Switch to an available option following + to continue. + + + + + ${this.networksTemplate()} + + + + + + Disconnect + + + + `}networksTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:t}=de.state;return re.sortRequestedNetworks(e,t).map(o=>T` + this.onSwitchNetwork(o)} + > + + `)}async onDisconnect(){try{this.disconecting=!0,await ke.disconnect(),we.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),Re.close()}catch{we.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Le.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){const{isConnected:t}=te.state,{approvedCaipNetworkIds:r,supportsAllNetworks:o,caipNetwork:n}=de.state,{data:s}=G.state;t&&(n==null?void 0:n.id)!==e.id?r!=null&&r.includes(e.id)?(await de.switchActiveNetwork(e),tu.navigateAfterNetworkSwitch()):o&&G.push("SwitchNetwork",{...s,network:e}):t||(de.setCaipNetwork(e),G.push("Connect"))}};Xa.styles=Sv;Y1([U()],Xa.prototype,"disconecting",void 0);Xa=Y1([V("w3m-unsupported-chain-view")],Xa);const kv=_e` + wui-compatible-network { + margin-top: var(--wui-spacing-l); + } +`;var Qs=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ur=class extends ce{constructor(){super(),this.unsubscribe=[],this.address=te.state.address,this.profileName=te.state.profileName,this.network=de.state.caipNetwork,this.preferredAccountType=te.state.preferredAccountType,this.unsubscribe.push(te.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):Le.showError("Account not found")}),de.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const e=He.getNetworkImage(this.network);return T` + + + + + Copy your address or scan this QR code + + + ${this.networkTemplate()} + `}networkTemplate(){var s;const e=de.getRequestedCaipNetworks(),t=de.checkIfSmartAccountEnabled(),r=de.state.caipNetwork;if(this.preferredAccountType===Bt.ACCOUNT_TYPES.SMART_ACCOUNT&&t)return r?T``:null;const n=((s=e==null?void 0:e.filter(a=>a==null?void 0:a.imageId))==null?void 0:s.slice(0,5)).map(He.getNetworkImage).filter(Boolean);return T``}onReceiveClick(){G.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(re.copyToClopboard(this.address),Le.showSuccess("Address copied"))}catch{Le.showError("Failed to copy")}}};Ur.styles=kv;Qs([U()],Ur.prototype,"address",void 0);Qs([U()],Ur.prototype,"profileName",void 0);Qs([U()],Ur.prototype,"network",void 0);Qs([U()],Ur.prototype,"preferredAccountType",void 0);Ur=Qs([V("w3m-wallet-receive-view")],Ur);const $v=_e` + :host > wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + + :host > wui-flex::-webkit-scrollbar { + display: none; + } +`;var K1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Qa=class extends ce{constructor(){super(),this.unsubscribe=[],this.preferredAccountType=te.state.preferredAccountType,this.unsubscribe.push(te.subscribeKey("preferredAccountType",e=>{this.preferredAccountType=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` + + ${this.networkTemplate()} + `}networkTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:t,caipNetwork:r}=de.state,o=de.checkIfSmartAccountEnabled();let n=re.sortRequestedNetworks(e,t);if(o&&this.preferredAccountType===Bt.ACCOUNT_TYPES.SMART_ACCOUNT){if(!r)return null;n=[r]}return n.map(s=>T` + + + `)}};Qa.styles=$v;K1([U()],Qa.prototype,"preferredAccountType",void 0);Qa=K1([V("w3m-wallet-compatible-networks-view")],Qa);const Rv=_e` + :host { + display: block; + } + + wui-flex { + position: relative; + } + + wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xs) !important; + border: 5px solid var(--wui-color-bg-125); + background: var(--wui-color-bg-175); + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 1; + } + + wui-button { + --local-border-radius: var(--wui-border-radius-xs) !important; + } + + .inputContainer { + height: fit-content; + } +`;var ea=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let jr=class extends ce{constructor(){super(),this.unsubscribe=[],this.token=Mt.state.token,this.sendTokenAmount=Mt.state.sendTokenAmount,this.receiverAddress=Mt.state.receiverAddress,this.message="Preview Send",this.unsubscribe.push(Mt.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),T` + + + + + + + + ${this.message} + + + `}onButtonClick(){G.push("WalletSendPreview")}getMessage(){this.message="Preview Send",this.receiverAddress&&!re.isAddress(this.receiverAddress)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.token||(this.message="Select Token")}};jr.styles=Rv;ea([U()],jr.prototype,"token",void 0);ea([U()],jr.prototype,"sendTokenAmount",void 0);ea([U()],jr.prototype,"receiverAddress",void 0);ea([U()],jr.prototype,"message",void 0);jr=ea([V("w3m-wallet-send-view")],jr);const Iv=_e` + .contentContainer { + height: 440px; + overflow: scroll; + scrollbar-width: none; + } + + wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } +`;var Pc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Mo=class extends ce{constructor(){super(),this.unsubscribe=[],this.tokenBalance=te.state.tokenBalance,this.search="",this.onDebouncedSearch=re.debounce(e=>{this.search=e}),this.unsubscribe.push(te.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` + + ${this.templateSearchInput()} ${this.templateTokens()} + + `}templateSearchInput(){return T` + + + + `}templateTokens(){var e;return this.search?this.tokens=(e=this.tokenBalance)==null?void 0:e.filter(t=>t.name.toLowerCase().includes(this.search.toLowerCase())):this.tokens=this.tokenBalance,T` + + + Your tokens + + + ${this.tokens&&this.tokens.length>0?this.tokens.map(t=>T``):T` + + + No tokens found + Your tokens will appear here + + Buy + `} + + + `}onBuyClick(){G.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){Mt.setToken(e),Mt.setTokenAmount(void 0),G.goBack()}};Mo.styles=Iv;Pc([U()],Mo.prototype,"tokenBalance",void 0);Pc([U()],Mo.prototype,"tokens",void 0);Pc([U()],Mo.prototype,"search",void 0);Mo=Pc([V("w3m-wallet-send-select-token-view")],Mo);const Ov=_e` + wui-avatar, + wui-image { + display: ruby; + width: 32px; + height: 32px; + border-radius: var(--wui-border-radius-3xl); + } + + .sendButton { + width: 70%; + --local-width: 100% !important; + --local-border-radius: var(--wui-border-radius-xs) !important; + } + + .cancelButton { + width: 30%; + --local-width: 100% !important; + --local-border-radius: var(--wui-border-radius-xs) !important; + } +`;var ta=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Wr=class extends ce{constructor(){super(),this.unsubscribe=[],this.token=Mt.state.token,this.sendTokenAmount=Mt.state.sendTokenAmount,this.receiverAddress=Mt.state.receiverAddress,this.caipNetwork=de.state.caipNetwork,this.unsubscribe.push(Mt.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress}),de.subscribeKey("caipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e,t,r;return T` + + + + Send + ${this.sendValueTemplate()} + + + + + + + + To + + + + + + + + Review transaction carefully + + + + Cancel + + + Send + + + `}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const t=this.token.price*this.sendTokenAmount;return T`$${t.toFixed(2)}`}return null}onSendClick(){G.reset("Account"),setTimeout(()=>{Mt.resetSend()},200)}onCancelClick(){G.goBack()}};Wr.styles=Ov;ta([U()],Wr.prototype,"token",void 0);ta([U()],Wr.prototype,"sendTokenAmount",void 0);ta([U()],Wr.prototype,"receiverAddress",void 0);ta([U()],Wr.prototype,"caipNetwork",void 0);Wr=ta([V("w3m-wallet-send-preview-view")],Wr);const Pv=_e` + wui-grid { + max-height: clamp(360px, 400px, 80vh); + overflow: scroll; + scrollbar-width: none; + grid-auto-rows: min-content; + grid-template-columns: repeat(auto-fill, 76px); + } + + @media (max-width: 435px) { + wui-grid { + grid-template-columns: repeat(auto-fill, 77px); + } + } + + wui-grid[data-scroll='false'] { + overflow: hidden; + } + + wui-grid::-webkit-scrollbar { + display: none; + } + + wui-loading-spinner { + padding-top: var(--wui-spacing-l); + padding-bottom: var(--wui-spacing-l); + justify-content: center; + grid-column: 1 / span 4; + } +`;function J1(i){const{connectors:e}=We.state,t=e.filter(n=>n.type==="ANNOUNCED").reduce((n,s)=>{var a;return(a=s.info)!=null&&a.rdns&&(n[s.info.rdns]=!0),n},{});return i.map(n=>({...n,installed:!!n.rdns&&!!t[n.rdns??""]})).sort((n,s)=>Number(s.installed)-Number(n.installed))}var ia=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const qd="local-paginator";let zr=class extends ce{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!xe.state.wallets.length,this.wallets=xe.state.wallets,this.recommended=xe.state.recommended,this.featured=xe.state.featured,this.unsubscribe.push(xe.subscribeKey("wallets",e=>this.wallets=e),xe.subscribeKey("recommended",e=>this.recommended=e),xe.subscribeKey("featured",e=>this.featured=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(t=>t()),(e=this.paginationObserver)==null||e.disconnect()}render(){return T` + + ${this.initial?this.shimmerTemplate(16):this.walletsTemplate()} + ${this.paginationLoaderTemplate()} + + `}async initialFetch(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-grid");this.initial&&e&&(await xe.fetchWallets({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.initial=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,t){return[...Array(e)].map(()=>T` + + `)}walletsTemplate(){const e=[...this.featured,...this.recommended,...this.wallets];return J1(e).map(r=>T` + this.onConnectWallet(r)} + .installed=${r.installed} + > + `)}paginationLoaderTemplate(){const{wallets:e,recommended:t,featured:r,count:o}=xe.state,n=window.innerWidth<352?3:4,s=e.length+t.length;let c=Math.ceil(s/n)*n-s+n;return c-=e.length?r.length%n:0,o===0&&r.length>0?null:o===0||[...r,...e,...t].length{if(r!=null&&r.isIntersecting&&!this.initial){const{page:o,count:n,wallets:s}=xe.state;s.length=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Bs=class extends ce{constructor(){super(...arguments),this.prevQuery="",this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?T``:this.walletsTemplate()}async onSearch(){this.query!==this.prevQuery&&(this.prevQuery=this.query,this.loading=!0,await xe.searchWallet({search:this.query}),this.loading=!1)}walletsTemplate(){const{search:e}=xe.state,t=J1(e);return e.length?T` + + ${t.map(r=>T` + this.onConnectWallet(r)} + .installed=${r.installed} + > + `)} + + `:T` + + + No Wallet found + + `}onConnectWallet(e){const t=We.getConnector(e.id,e.rdns);t?G.push("ConnectingExternal",{connector:t}):G.push("ConnectingWalletConnect",{wallet:e})}};Bs.styles=Nv;Bu([U()],Bs.prototype,"loading",void 0);Bu([ge()],Bs.prototype,"query",void 0);Bs=Bu([V("w3m-all-wallets-search")],Bs);var Nc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Us=class extends ce{constructor(){super(),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0,this.buffering=!1,this.unsubscribe.push(ke.subscribeKey("buffering",e=>this.buffering=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return T` + + + + `}generateTabs(){const e=this.platforms.map(t=>t==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:t==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:t==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:t==="web"?{label:"Webapp",icon:"browser",platform:"web"}:t==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:t})=>t),e}onTabChange(e){var r;const t=this.platformTabs[e];t&&((r=this.onSelectPlatfrom)==null||r.call(this,t))}};Nc([ge({type:Array})],Us.prototype,"platforms",void 0);Nc([ge()],Us.prototype,"onSelectPlatfrom",void 0);Nc([U()],Us.prototype,"buffering",void 0);Us=Nc([V("w3m-connecting-header")],Us);var Dv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Yd=class extends Yt{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),we.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){var e;try{this.error=!1;const{connectors:t}=We.state,r=t.find(n=>{var s,a;return n.type==="ANNOUNCED"&&((s=n.info)==null?void 0:s.rdns)===((a=this.wallet)==null?void 0:a.rdns)}),o=t.find(n=>n.type==="INJECTED");r?await ke.connectExternal(r):o&&await ke.connectExternal(o),Re.close(),we.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown"}})}catch(t){we.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(t==null?void 0:t.message)??"Unknown"}}),this.error=!0}}};Yd=Dv([V("w3m-connecting-wc-browser")],Yd);var Mv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Kd=class extends Yt{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),we.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.timeout=setTimeout(()=>{var e;(e=this.onConnect)==null||e.call(this)},200))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:t,name:r}=this.wallet,{redirect:o,href:n}=re.formatNativeUrl(t,this.uri);ke.setWcLinking({name:r,href:n}),ke.setRecentWallet(this.wallet),re.openHref(o,"_blank")}catch{this.error=!0}}};Kd=Mv([V("w3m-connecting-wc-desktop")],Kd);var Lv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Jd=class extends Yt{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),document.addEventListener("visibilitychange",this.onBuffering.bind(this)),we.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("visibilitychange",this.onBuffering.bind(this))}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:t,name:r}=this.wallet,{redirect:o,href:n}=re.formatNativeUrl(t,this.uri);ke.setWcLinking({name:r,href:n}),ke.setRecentWallet(this.wallet),re.openHref(o,"_self")}catch{this.error=!0}}onBuffering(){const e=re.isIos();(document==null?void 0:document.visibilityState)==="visible"&&!this.error&&e&&(ke.setBuffering(!0),setTimeout(()=>{ke.setBuffering(!1)},5e3))}};Jd=Lv([V("w3m-connecting-wc-mobile")],Jd);const Bv=_e` + @keyframes fadein { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + wui-shimmer { + width: 100%; + aspect-ratio: 1 / 1; + border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; + } + + wui-qr-code { + opacity: 0; + animation-duration: 200ms; + animation-timing-function: ease; + animation-name: fadein; + animation-fill-mode: forwards; + } +`;var Uv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Pl=class extends Yt{constructor(){var e;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),we.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),T` + + ${this.qrCodeTemplate()} + + + Scan this QR Code with your phone + + ${this.copyTemplate()} + + + + `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,t=this.wallet?this.wallet.name:void 0;return ke.setWcLinking(void 0),ke.setRecentWallet(this.wallet),T` `}copyTemplate(){const e=!this.uri||!this.ready;return T` + + Copy link + `}};Pl.styles=Bv;Pl=Uv([V("w3m-connecting-wc-qrcode")],Pl);var jv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Xd=class extends ce{constructor(){var e;if(super(),this.wallet=(e=G.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");we.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return T` + + + + Not Detected + + + + `}};Xd=jv([V("w3m-connecting-wc-unsupported")],Xd);var Wv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Qd=class extends Yt{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel="Open and continue in a new browser tab",this.secondaryBtnIcon="externalLink",we.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:t,name:r}=this.wallet,{redirect:o,href:n}=re.formatUniversalUrl(t,this.uri);ke.setWcLinking({name:r,href:n}),ke.setRecentWallet(this.wallet),re.openHref(o,"_blank")}catch{this.error=!0}}};Qd=Wv([V("w3m-connecting-wc-web")],Qd);const zv=_e` + :host { + width: 100%; + } + + .details-container > wui-flex { + background: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + width: 100%; + } + + .details-container > wui-flex > button { + border: none; + background: none; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + cursor: pointer; + } + + .details-content-container { + padding: var(--wui-spacing-1xs); + padding-top: 0px; + display: flex; + align-items: center; + justify-content: center; + } + + .details-content-container > wui-flex { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s); + padding-left: var(--wui-spacing-s); + padding-right: var(--wui-spacing-1xs); + border-radius: calc(var(--wui-border-radius-5xs) + var(--wui-border-radius-4xs)); + background: var(--wui-gray-glass-002); + } + + .details-row.provider-free-row { + padding-right: var(--wui-spacing-xs); + } + + .free-badge { + background: rgba(38, 217, 98, 0.15); + border-radius: var(--wui-border-radius-4xs); + padding: 4.5px 6px; + } +`;var tn=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let gi=class extends ce{constructor(){super(...arguments),this.detailsOpen=!1,this.slippageRate=1}render(){return T` + + + + ${this.detailsOpen?T` + + + + Network cost + + $${ve.formatNumberToLocalString(this.gasPriceInUSD,3)} + + + + ${this.priceImpact?T` + + Price impact + + + ${ve.formatNumberToLocalString(this.priceImpact,3)}% + + + + `:null} + ${this.maxSlippage&&this.sourceTokenSymbol?T` + + Max. slippage + + + ${ve.formatNumberToLocalString(this.maxSlippage,6)} + ${this.sourceTokenSymbol} ${this.slippageRate}% + + + + `:null} + + + Provider fee + + Free + + + + + `:null} + + + `}toggleDetails(){this.detailsOpen=!this.detailsOpen}};gi.styles=[zv];tn([ge()],gi.prototype,"detailsOpen",void 0);tn([ge()],gi.prototype,"sourceTokenSymbol",void 0);tn([ge()],gi.prototype,"sourceTokenPrice",void 0);tn([ge()],gi.prototype,"toTokenSymbol",void 0);tn([ge()],gi.prototype,"toTokenConvertedAmount",void 0);tn([ge()],gi.prototype,"gasPriceInUSD",void 0);tn([ge()],gi.prototype,"priceImpact",void 0);tn([ge()],gi.prototype,"slippageRate",void 0);tn([ge()],gi.prototype,"maxSlippage",void 0);gi=tn([V("w3m-convert-details")],gi);const Fv=_e` + :host > wui-flex { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + border-radius: var(--wui-border-radius-s); + padding: var(--wui-spacing-xl); + padding-right: var(--wui-spacing-s); + width: 100%; + height: 100px; + box-sizing: border-box; + position: relative; + } + + :host > wui-flex > svg.input_mask { + position: absolute; + inset: 0; + z-index: 5; + } + + :host wui-flex .input_mask__border, + :host wui-flex .input_mask__background { + transition: fill var(--wui-duration-md) var(--wui-ease-out-power-1); + will-change: fill; + } + + :host wui-flex .input_mask__border { + fill: var(--wui-gray-glass-005); + } + + :host wui-flex .input_mask__background { + fill: var(--wui-gray-glass-002); + } + + :host wui-flex.focus .input_mask__border { + fill: var(--wui-gray-glass-020); + } + + :host > wui-flex .swap-input, + :host > wui-flex .swap-token-button { + z-index: 10; + } + + :host > wui-flex .swap-input { + -webkit-mask-image: linear-gradient( + 270deg, + transparent 0px, + transparent 8px, + black 24px, + black 25px, + black 32px, + black 100% + ); + mask-image: linear-gradient( + 270deg, + transparent 0px, + transparent 8px, + black 24px, + black 25px, + black 32px, + black 100% + ); + } + + :host > wui-flex .swap-input input { + background: none; + border: none; + height: 42px; + width: 100%; + font-size: 32px; + font-style: normal; + font-weight: 400; + line-height: 130%; + letter-spacing: -1.28px; + outline: none; + caret-color: var(--wui-color-accent-100); + color: var(--wui-color-fg-100); + } + + :host > wui-flex .swap-input input:focus-visible { + outline: none; + } + + :host > wui-flex .swap-input input::-webkit-outer-spin-button, + :host > wui-flex .swap-input input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + .token-select-button { + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-xxs); + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-1xs); + height: 40px; + border: none; + border-radius: 80px; + background: var(--wui-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + cursor: pointer; + transition: background 0.2s linear; + } + + .token-select-button:hover { + background: var(--wui-gray-glass-005); + } + + .token-select-button wui-image { + width: 24px; + height: 24px; + border-radius: var(--wui-border-radius-s); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } + + .max-value-button { + background-color: transparent; + border: none; + cursor: pointer; + color: var(--wui-gray-glass-020); + padding-left: 0px; + } + + .market-value { + min-height: 18px; + } +`;var Li=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const Hv=5e-5;let ni=class extends ce{constructor(){super(...arguments),this.focused=!1,this.price=0,this.marketValue="$1.0345,00",this.target="sourceToken",this.onSetAmount=null,this.onSetMaxValue=null}render(){const e=this.marketValue||"0",t=At.bigNumber(e).isGreaterThan(0);return T` + + ${this.target==="sourceToken"?G0:Z0} + + this.onFocusChange(!0)} + @focusout=${()=>this.onFocusChange(!1)} + ?disabled=${this.disabled} + .value=${this.value} + @input=${this.dispatchInputChangeEvent} + @keydown=${this.handleKeydown} + placeholder="0" + /> + + ${t?`$${this.marketValue}`:null} + + + ${this.templateTokenSelectButton()} + + `}handleKeydown(e){const t=["Backspace","Meta","Ctrl","a","c","v","ArrowLeft","ArrowRight","Tab"],r=e.key===",",o=e.key===".",n=e.key>="0"&&e.key<="9",s=this.value;!n&&!t.includes(e.key)&&!o&&!r&&e.preventDefault(),(r||o)&&(s!=null&&s.includes(".")||s!=null&&s.includes(","))&&e.preventDefault()}dispatchInputChangeEvent(e){if(!this.onSetAmount)return;const t=e.target.value;t===","||t==="."?this.onSetAmount(this.target,"0."):t.endsWith(",")?this.onSetAmount(this.target,t.replace(",",".")):this.onSetAmount(this.target,t)}setMaxValueToInput(){var e;(e=this.onSetMaxValue)==null||e.call(this,this.target,this.balance)}templateTokenSelectButton(){if(!this.token)return T` + Select token + `;const e=this.token.logoUri?T``:T` + + `;return T` + + + ${this.tokenBalanceTemplate()} + + `}tokenBalanceTemplate(){const e=At.multiply(this.balance,this.price),t=e?e==null?void 0:e.isGreaterThan(Hv):!1;return T` + ${t?T` + ${ve.formatNumberToLocalString(this.balance,3)} + `:null} + ${this.target==="sourceToken"?this.tokenActionButtonTemplate(t):null} + `}tokenActionButtonTemplate(e){return e?T` `:T` `}onFocusChange(e){this.focused=e}onSelectToken(){we.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),G.push("ConvertSelectToken",{target:this.target})}onBuyToken(){G.push("OnRampProviders")}};ni.styles=[Fv];Li([ge()],ni.prototype,"focused",void 0);Li([ge()],ni.prototype,"balance",void 0);Li([ge()],ni.prototype,"value",void 0);Li([ge()],ni.prototype,"price",void 0);Li([ge()],ni.prototype,"marketValue",void 0);Li([ge()],ni.prototype,"disabled",void 0);Li([ge()],ni.prototype,"target",void 0);Li([ge()],ni.prototype,"token",void 0);Li([ge()],ni.prototype,"onSetAmount",void 0);Li([ge()],ni.prototype,"onSetMaxValue",void 0);ni=Li([V("w3m-convert-input")],ni);const Vv=_e` + wui-icon-link[data-hidden='true'] { + opacity: 0 !important; + pointer-events: none; + } +`;var Dc=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};function e0(){var s,a,c,l,h,p,v;const i=(a=(s=G.state.data)==null?void 0:s.connector)==null?void 0:a.name,e=(l=(c=G.state.data)==null?void 0:c.wallet)==null?void 0:l.name,t=(p=(h=G.state.data)==null?void 0:h.network)==null?void 0:p.name,r=e??i,o=We.getConnectors();return{Connect:`Connect ${o.length===1&&((v=o[0])==null?void 0:v.id)==="w3m-email"?"Email":""} Wallet`,Account:void 0,AccountSettings:void 0,ConnectingExternal:r??"Connect Wallet",ConnectingWalletConnect:r??"WalletConnect",ConnectingSiwe:"Sign In",Networks:"Choose Network",SwitchNetwork:t??"Switch Network",AllWallets:"All Wallets",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",GetWallet:"Get a wallet",Downloads:r?`Get ${r}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",ApproveTransaction:"Approve Transaction",Transactions:"Activity",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",UnsupportedChain:"Switch Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",WhatIsABuy:"What is Buy?",BuyInProgress:"Buy",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token"}}let Lo=class extends ce{constructor(){super(),this.unsubscribe=[],this.heading=e0()[G.state.view],this.buffering=!1,this.showBack=!1,this.unsubscribe.push(G.subscribeKey("view",e=>{this.onViewChange(e),this.onHistoryChange()}),ke.subscribeKey("buffering",e=>this.buffering=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` + + ${this.dynamicButtonTemplate()} ${this.titleTemplate()} + + + ${this.separatorTemplate()} + `}onWalletHelp(){we.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),G.push("WhatIsAWallet")}async onClose(){if(pe.state.isSiweEnabled){const{SIWEController:e}=await On(()=>import("./index.gqgjn4wa.js"),[],import.meta.url);e.state.status!=="success"&&await ke.disconnect()}Re.close()}titleTemplate(){return T`${this.heading}`}dynamicButtonTemplate(){const{view:e}=G.state,t=e==="Connect",n=e==="ApproveTransaction"||e==="UpgradeToSmartAccount";return this.showBack&&!n?T``:T``}separatorTemplate(){return this.heading?T``:null}getPadding(){return this.heading?["l","2l","l","2l"]:["l","2l","0","2l"]}async onViewChange(e){var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-text");if(t){const o=e0()[e];await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.heading=o,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})}}async onHistoryChange(){var r;const{history:e}=G.state,t=(r=this.shadowRoot)==null?void 0:r.querySelector("#dynamic");e.length>1&&!this.showBack&&t?(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){G.state.view==="ConnectingSiwe"?G.push("Connect"):G.goBack()}};Lo.styles=[Vv];Dc([U()],Lo.prototype,"heading",void 0);Dc([U()],Lo.prototype,"buffering",void 0);Dc([U()],Lo.prototype,"showBack",void 0);Lo=Dc([V("w3m-header")],Lo);var X1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Nl=class extends ce{constructor(){super(...arguments),this.data=[]}render(){return T` + + ${this.data.map(e=>T` + + + ${e.images.map(t=>T``)} + + + + + ${e.title} + + ${e.text} + + `)} + + `}};X1([ge({type:Array})],Nl.prototype,"data",void 0);Nl=X1([V("w3m-help-widget")],Nl);const Zv=_e` + :host { + width: 100%; + } + + wui-loading-spinner { + position: absolute; + top: 50%; + right: 20px; + transform: translateY(-50%); + } + + .currency-container { + position: absolute; + top: 50%; + transform: translateY(-50%); + right: var(--wui-spacing-1xs); + height: 40px; + padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs) + var(--wui-spacing-xs); + min-width: 95px; + border-radius: var(--FULL, 1000px); + border: 1px solid var(--wui-gray-glass-002); + background: var(--wui-gray-glass-002); + cursor: pointer; + } + + .currency-container > wui-image { + height: 24px; + width: 24px; + border-radius: 50%; + } +`;var Jr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let mn=class extends ce{constructor(){var e;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(e=this.currencies)==null?void 0:e[0],this.currencyImages=bt.state.currencyImages,this.tokenImages=bt.state.tokenImages,this.unsubscribe.push(Fe.subscribeKey("purchaseCurrency",t=>{!t||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(t))}),Fe.subscribeKey("paymentCurrency",t=>{!t||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(t))}),Fe.subscribe(t=>{this.type==="Fiat"?this.currencies=t.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=t.paymentCurrencies.map(this.formatPaymentCurrency)}),bt.subscribe(t=>{this.currencyImages={...t.currencyImages},this.tokenImages={...t.tokenImages}}))}firstUpdated(){Fe.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var r;const e=((r=this.selectedCurrency)==null?void 0:r.symbol)||"",t=this.currencyImages[e]||this.tokenImages[e];return T` + ${this.selectedCurrency?T` Re.open({view:`OnRamp${this.type}Select`})} + > + + ${this.selectedCurrency.symbol} + `:T``} + `}formatPaymentCurrency(e){return{name:e.id,symbol:e.id}}formatPurchaseCurrency(e){return{name:e.name,symbol:e.symbol}}};mn.styles=Zv;Jr([ge({type:String})],mn.prototype,"type",void 0);Jr([ge({type:Number})],mn.prototype,"value",void 0);Jr([U()],mn.prototype,"currencies",void 0);Jr([U()],mn.prototype,"selectedCurrency",void 0);Jr([U()],mn.prototype,"currencyImages",void 0);Jr([U()],mn.prototype,"tokenImages",void 0);mn=Jr([V("w3m-swap-input")],mn);const Gv=_e` + wui-flex { + background-color: var(--wui-gray-glass-005); + } + + a { + text-decoration: none; + color: var(--wui-color-fg-175); + font-weight: 500; + } +`;var qv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Dl=class extends ce{render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=pe.state;return!e&&!t?null:T` + + + By connecting your wallet, you agree to our
+ ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} +
+
+ `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=pe.state;return e&&t?"and":""}termsTemplate(){const{termsConditionsUrl:e}=pe.state;return e?T`Terms of Service`:null}privacyTemplate(){const{privacyPolicyUrl:e}=pe.state;return e?T`Privacy Policy`:null}};Dl.styles=[Gv];Dl=qv([V("w3m-legal-footer")],Dl);const Yv=_e` + :host { + display: block; + padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl); + } +`;var Q1=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ec=class extends ce{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:t,play_store:r,chrome_store:o,homepage:n}=this.wallet,s=re.isMobile(),a=re.isIos(),c=re.isAndroid(),l=[t,r,n,o].filter(Boolean).length>1,h=ve.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return l&&!s?T` + G.push("Downloads",{wallet:this.wallet})} + > + `:!l&&n?T` + + `:t&&a?T` + + `:r&&c?T` + + `:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&re.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&re.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&re.openHref(this.wallet.homepage,"_blank")}};ec.styles=[Yv];Q1([ge({type:Object})],ec.prototype,"wallet",void 0);ec=Q1([V("w3m-mobile-download-links")],ec);const Kv=_e` + wui-flex { + border-top: 1px solid var(--wui-gray-glass-005); + } + + a { + text-decoration: none; + color: var(--wui-color-fg-175); + font-weight: 500; + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-3xs); + } +`;var Jv=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ml=class extends ce{render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=pe.state;return!e&&!t?null:T` + + + We work with the best providers to give you the lowest fees and best support. More options + coming soon! + + + ${this.howDoesItWorkTemplate()} + + `}howDoesItWorkTemplate(){return T` + + How does it work? + `}onWhatIsBuy(){G.push("WhatIsABuy")}};Ml.styles=[Kv];Ml=Jv([V("w3m-onramp-providers-footer")],Ml);const Xv=_e` + :host { + display: block; + position: absolute; + opacity: 0; + pointer-events: none; + top: 11px; + left: 50%; + width: max-content; + } +`;var eh=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const Qv={success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let tc=class extends ce{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=Le.state.open,this.unsubscribe.push(Le.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:t}=Le.state,r=Qv[t];return T` + + `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout=setTimeout(()=>Le.hide(),2500)):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};tc.styles=Xv;eh([U()],tc.prototype,"open",void 0);tc=eh([V("w3m-snackbar")],tc);const eb=_e` + wui-separator { + margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); + width: calc(100% + var(--wui-spacing-s) * 2); + } + + wui-email-input { + width: 100%; + } + + form { + width: 100%; + display: block; + position: relative; + } + + wui-icon-link, + wui-loading-spinner { + position: absolute; + top: 21px; + transform: translateY(-50%); + } + + wui-icon-link { + right: var(--wui-spacing-xs); + } + + wui-loading-spinner { + right: var(--wui-spacing-m); + } +`;var na=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Fr=class extends ce{constructor(){super(),this.unsubscribe=[],this.formRef=Ka(),this.connectors=We.state.connectors,this.email="",this.loading=!1,this.error="",this.unsubscribe.push(We.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",t=>{t.key==="Enter"&&this.onSubmitEmail(t)})}render(){const e=this.connectors.length>1;return this.connectors.find(r=>r.type==="EMAIL")?T` +
+ + + + ${this.submitButtonTemplate()}${this.loadingTemplate()} + +
+ + ${e?T``:null} + `:null}submitButtonTemplate(){return!this.loading&&this.email.length>3?T` + + + `:null}loadingTemplate(){return this.loading?T``:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const t=We.getEmailConnector();if(!t)throw new Error("w3m-email-login-widget: Email connector not found");const{action:r}=await t.provider.connectEmail({email:this.email});we.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),r==="VERIFY_OTP"?(we.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),G.push("EmailVerifyOtp",{email:this.email})):r==="VERIFY_DEVICE"&&G.push("EmailVerifyDevice",{email:this.email})}catch(t){const r=re.parseError(t);r!=null&&r.includes("Invalid email")?this.error="Invalid email. Try again.":Le.showError(t)}finally{this.loading=!1}}onFocusEvent(){we.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};Fr.styles=eb;na([U()],Fr.prototype,"connectors",void 0);na([U()],Fr.prototype,"email",void 0);na([U()],Fr.prototype,"loading",void 0);na([U()],Fr.prototype,"error",void 0);Fr=na([V("w3m-email-login-widget")],Fr);const tb=_e` + wui-flex { + width: 100%; + } + + :host > wui-flex:first-child { + transform: translateY(calc(var(--wui-spacing-xxs) * -1)); + } + + wui-icon-link { + margin-right: calc(var(--wui-icon-box-size-md) * -1); + } + + wui-notice-card { + margin-bottom: var(--wui-spacing-3xs); + } + + w3m-transactions-view { + max-height: 200px; + } + + .tab-content-container { + height: 300px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + } + + .account-button { + width: auto; + border: none; + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-s); + height: 48px; + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-s); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + background-color: var(--wui-gray-glass-002); + border-radius: 24px; + transaction: background-color 0.2s linear; + } + + .account-button:hover { + background-color: var(--wui-gray-glass-005); + } + + .avatar-container { + position: relative; + } + + wui-avatar.avatar { + width: 32px; + height: 32px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } + + wui-avatar.network-avatar { + width: 16px; + height: 16px; + position: absolute; + left: 100%; + top: 100%; + transform: translate(-75%, -75%); + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } + + .account-links { + display: flex; + justify-content: space-between; + align-items: center; + } + + .account-links wui-flex { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + flex: 1; + background: red; + align-items: center; + justify-content: center; + height: 48px; + padding: 10px; + flex: 1 0 0; + border-radius: var(--XS, 16px); + border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + .account-links wui-flex:hover { + background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); + } + + .account-links wui-flex wui-icon { + width: var(--S, 20px); + height: var(--S, 20px); + } + + .account-links wui-flex wui-icon svg path { + stroke: #47a1ff; + } +`;var nr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ji=class extends ce{constructor(){super(),this.unsubscribe=[],this.address=te.state.address,this.profileImage=te.state.profileImage,this.profileName=te.state.profileName,this.network=de.state.caipNetwork,this.disconnecting=!1,this.balance=te.state.balance,this.balanceSymbol=te.state.balanceSymbol,this.unsubscribe.push(te.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.balance=e.balance,this.balanceSymbol=e.balanceSymbol):this.disconnecting||Le.showError("Account not found")}),de.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var t;if(!this.address)throw new Error("w3m-account-view: No account provided");const e=He.getNetworkImage(this.network);return T` + + + + + ${this.profileName?ve.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):ve.getTruncateString({string:this.address?this.address:"",charsStart:4,charsEnd:4,truncate:"middle"})} + + + + ${re.formatBalance(this.balance,this.balanceSymbol)} + + ${this.explorerBtnTemplate()} + + + + ${this.emailCardTemplate()} ${this.emailBtnTemplate()} + + + + ${((t=this.network)==null?void 0:t.name)??"Unknown"} + + + ${this.onrampTemplate()} + + Activity + + + Disconnect + + `}onrampTemplate(){const{enableOnramp:e}=pe.state;return e?T` + + Buy crypto + + `:null}emailCardTemplate(){const e=ht.getConnectedConnector(),t=We.getEmailConnector(),{origin:r}=location;return!t||e!=="EMAIL"||r.includes(dt.SECURE_SITE)?null:T` + + `}handleClickPay(){G.push("OnRampProviders")}explorerBtnTemplate(){const{addressExplorerUrl:e}=te.state;return e?T` + + + Block Explorer + + + `:null}emailBtnTemplate(){const e=ht.getConnectedConnector(),t=We.getEmailConnector();if(!t||e!=="EMAIL")return null;const r=t.provider.getEmail()??"";return T` + this.onGoToUpdateEmail(r)} + > + ${r} + + `}isAllowedNetworkSwitch(){const{requestedCaipNetworks:e}=de.state,t=e?e.length>1:!1,r=e==null?void 0:e.find(({id:o})=>{var n;return o===((n=this.network)==null?void 0:n.id)});return t||!r}onCopyAddress(){try{this.address&&(re.copyToClopboard(this.address),Le.showSuccess("Address copied"))}catch{Le.showError("Failed to copy")}}onNetworks(){this.isAllowedNetworkSwitch()&&(we.sendEvent({type:"track",event:"CLICK_NETWORKS"}),G.push("Networks"))}onTransactions(){we.sendEvent({type:"track",event:"CLICK_TRANSACTIONS"}),G.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await ke.disconnect(),we.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),Re.close()}catch{we.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Le.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const{addressExplorerUrl:e}=te.state;e&&re.openHref(e,"_blank")}onGoToUpgradeView(){we.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),G.push("UpgradeEmailWallet")}onGoToUpdateEmail(e){G.push("UpdateEmailWallet",{email:e})}};Ji.styles=tb;nr([U()],Ji.prototype,"address",void 0);nr([U()],Ji.prototype,"profileImage",void 0);nr([U()],Ji.prototype,"profileName",void 0);nr([U()],Ji.prototype,"network",void 0);nr([U()],Ji.prototype,"disconnecting",void 0);nr([U()],Ji.prototype,"balance",void 0);nr([U()],Ji.prototype,"balanceSymbol",void 0);Ji=nr([V("w3m-account-default-widget")],Ji);const ib=_e` + wui-flex { + width: 100%; + } + + wui-promo { + position: absolute; + top: -32px; + } + + wui-profile-button { + margin-top: calc(-1 * var(--wui-spacing-2l)); + } + + wui-promo + wui-profile-button { + margin-top: var(--wui-spacing-2l); + } + + wui-tooltip-select { + width: 100%; + } + + wui-tabs { + width: 100%; + } + + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } +`,nb={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}]};var nn=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let wi=class extends ce{constructor(){super(),this.unsubscribe=[],this.address=te.state.address,this.profileImage=te.state.profileImage,this.profileName=te.state.profileName,this.smartAccountDeployed=te.state.smartAccountDeployed,this.network=de.state.caipNetwork,this.currentTab=te.state.currentTab,this.tokenBalance=te.state.tokenBalance,this.preferredAccountType=te.state.preferredAccountType,this.unsubscribe.push(te.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance,this.smartAccountDeployed=e.smartAccountDeployed,this.preferredAccountType=e.preferredAccountType):Re.close()}),de.subscribe(e=>{this.network=e.caipNetwork})),this.watchConvertValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){te.fetchTokenBalance()}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");const e=He.getNetworkImage(this.network);return T` + ${this.activateAccountTemplate()} + + ${this.tokenBalanceTemplate()} + + + + + + + + + ${this.listContentTemplate()} + `}watchConvertValues(){this.watchTokenBalance=setInterval(()=>te.fetchTokenBalance(),1e4)}listContentTemplate(){return this.currentTab===0?T``:this.currentTab===1?T``:this.currentTab===2?T``:T``}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const t=re.calculateBalance(this.tokenBalance),{dollars:r="0",pennies:o="00"}=re.formatTokenBalance(t);return T``}return T``}activateAccountTemplate(){return!de.checkIfSmartAccountEnabled()||this.preferredAccountType!==Bt.ACCOUNT_TYPES.EOA||this.smartAccountDeployed?null:T` `}onTabChange(e){te.setCurrentTab(e)}onProfileButtonClick(){G.push("AccountSettings")}onBuyClick(){G.push("OnRampProviders")}onConvertClick(){G.push("Convert")}onReceiveClick(){G.push("WalletReceive")}onSendClick(){G.push("WalletSend")}onUpdateToSmartAccount(){G.push("UpgradeToSmartAccount")}};wi.styles=ib;nn([U()],wi.prototype,"watchTokenBalance",void 0);nn([U()],wi.prototype,"address",void 0);nn([U()],wi.prototype,"profileImage",void 0);nn([U()],wi.prototype,"profileName",void 0);nn([U()],wi.prototype,"smartAccountDeployed",void 0);nn([U()],wi.prototype,"network",void 0);nn([U()],wi.prototype,"currentTab",void 0);nn([U()],wi.prototype,"tokenBalance",void 0);nn([U()],wi.prototype,"preferredAccountType",void 0);wi=nn([V("w3m-account-wallet-features-widget")],wi);const rb=_e` + :host { + width: 100%; + max-height: 280px; + overflow: scroll; + scrollbar-width: none; + } +`;var ob=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ll=class extends ce{render(){return T``}};Ll.styles=rb;Ll=ob([V("w3m-account-activity-widget")],Ll);const sb=_e` + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } +`;var ab=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Bl=class extends ce{render(){return T`${this.nftTemplate()}`}nftTemplate(){return T` + + + No NFTs yet + Transfer from another wallets to get started + + Receive NFTs + `}onReceiveClick(){G.push("WalletReceive")}};Bl.styles=sb;Bl=ab([V("w3m-account-nfts-widget")],Bl);const cb=_e` + :host { + width: 100%; + } + + wui-flex { + width: 100%; + } + + .contentContainer { + max-height: 280px; + overflow: scroll; + scrollbar-width: none; + } +`;var th=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let ic=class extends ce{constructor(){super(),this.unsubscribe=[],this.tokenBalance=te.state.tokenBalance,this.unsubscribe.push(te.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?T` + ${this.tokenItemTemplate()} + `:T` `}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(t=>T``)}onReceiveClick(){G.push("WalletReceive")}onBuyClick(){G.push("OnRampProviders")}};ic.styles=cb;th([U()],ic.prototype,"tokenBalance",void 0);ic=th([V("w3m-account-tokens-widget")],ic);const lb=_e` + :host { + min-height: 100%; + } + + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } + + .emptyContainer { + height: 100%; + } +`;var Xr=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const fa="last-transaction",ub=7;let vn=class extends ce{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.address=te.state.address,this.transactionsByYear=$t.state.transactionsByYear,this.loading=$t.state.loading,this.empty=$t.state.empty,this.next=$t.state.next,$t.clearCursor(),this.unsubscribe.push(te.subscribe(e=>{e.isConnected&&this.address!==e.address&&(this.address=e.address,$t.resetTransactions(),$t.fetchTransactions(e.address))}),$t.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){$t.fetchTransactions(this.address),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return T` ${this.empty?null:this.templateTransactionsByYear()} + ${this.loading?this.templateLoading():null} + ${!this.loading&&this.empty?this.templateEmpty():null}`}templateTransactionsByYear(){const e=Object.keys(this.transactionsByYear).sort().reverse();return e.map((t,r)=>{const o=r===e.length-1,n=parseInt(t,10);return new Array(12).fill(null).map((a,c)=>c).reverse().map(a=>{var h;const c=$n.getTransactionGroupTitle(n,a),l=(h=this.transactionsByYear[n])==null?void 0:h[a];return l?T` + + + ${c} + + + ${this.templateTransactions(l,o)} + + + `:null})})}templateRenderTransaction(e,t){const{date:r,descriptions:o,direction:n,isAllNFT:s,images:a,status:c,transfers:l,type:h}=this.getTransactionListItemProps(e),p=(l==null?void 0:l.length)>1;return(l==null?void 0:l.length)===2&&!s?T` + + `:p?l.map((S,O)=>{const D=$n.getTransferDescription(S),R=t&&O===l.length-1;return T` `}):T` + + `}templateTransactions(e,t){return e.map((r,o)=>{const n=t&&o===e.length-1;return T`${this.templateRenderTransaction(r,n)}`})}emptyStateActivity(){return T` + + + No Transactions yet + Start trading on dApps
+ to grow your wallet!
+
+
`}emptyStateAccount(){return T` + + + No activity yet + Your next transactions will appear here + + Trade + `}templateEmpty(){return this.page==="account"?T`${this.emptyStateAccount()}`:T`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?Array(ub).fill(T` `).map(e=>e):null}onReceiveClick(){G.push("WalletReceive")}createPaginationObserver(){const{projectId:e}=pe.state;this.paginationObserver=new IntersectionObserver(([t])=>{t!=null&&t.isIntersecting&&!this.loading&&($t.fetchTransactions(this.address),we.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:this.address,projectId:e,cursor:this.next}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var t,r,o;(t=this.paginationObserver)==null||t.disconnect();const e=(r=this.shadowRoot)==null?void 0:r.querySelector(`#${fa}`);e&&((o=this.paginationObserver)==null||o.observe(e))}getTransactionListItemProps(e){var c,l,h,p,v;const t=eu.formatDate((c=e==null?void 0:e.metadata)==null?void 0:c.minedAt),r=$n.getTransactionDescriptions(e),o=e==null?void 0:e.transfers,n=(l=e==null?void 0:e.transfers)==null?void 0:l[0],s=!!n&&((h=e==null?void 0:e.transfers)==null?void 0:h.every(S=>!!S.nft_info)),a=$n.getTransactionImages(o);return{date:t,direction:n==null?void 0:n.direction,descriptions:r,isAllNFT:s,images:a,status:(p=e.metadata)==null?void 0:p.status,transfers:o,type:(v=e.metadata)==null?void 0:v.operationType}}};vn.styles=lb;Xr([ge()],vn.prototype,"page",void 0);Xr([U()],vn.prototype,"address",void 0);Xr([U()],vn.prototype,"transactionsByYear",void 0);Xr([U()],vn.prototype,"loading",void 0);Xr([U()],vn.prototype,"empty",void 0);Xr([U()],vn.prototype,"next",void 0);vn=Xr([V("w3m-activity-list")],vn);const db=_e` + :host { + width: 100%; + height: 100px; + border-radius: var(--wui-border-radius-s); + border: 1px solid var(--wui-gray-glass-002); + background-color: var(--wui-gray-glass-002); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + } + + :host(:hover) { + background-color: var(--wui-gray-glass-005); + } + + wui-flex { + width: 100%; + height: fit-content; + } + + wui-button { + width: 100%; + display: flex; + justify-content: flex-end; + } +`;var Uu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let js=class extends ce{render(){return T` + + + ${this.buttonTemplate()} + + + ${this.sendValueTemplate()} + + ${this.maxAmountTemplate()} ${this.actionTemplate()} + + + `}buttonTemplate(){return this.token?T`Select token`:T`Select token`}handleSelectButtonClick(){G.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const t=this.token.price*this.sendTokenAmount;return T`$${t.toFixed(2)}`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?T` + ${ve.roundNumber(Number(this.token.quantity.numeric),6,5)} + `:T` + ${ve.roundNumber(Number(this.token.quantity.numeric),6,5)} + `:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?T`Buy`:T`Max`:null}onInputChange(e){Mt.setTokenAmount(e.detail)}onMaxClick(){var e;this.token&&Mt.setTokenAmount(Number((e=this.token)==null?void 0:e.quantity.numeric))}onBuyClick(){G.push("OnRampProviders")}};js.styles=db;Uu([ge({type:Object})],js.prototype,"token",void 0);Uu([ge({type:Number})],js.prototype,"sendTokenAmount",void 0);js=Uu([V("w3m-input-token")],js);const hb=_e` + :host { + width: 100%; + height: 100px; + border-radius: var(--wui-border-radius-s); + border: 1px solid var(--wui-gray-glass-002); + background-color: var(--wui-gray-glass-002); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + position: relative; + } + + :host(:hover) { + background-color: var(--wui-gray-glass-005); + } + + wui-flex { + width: 100%; + height: fit-content; + } + + wui-button { + display: ruby; + color: var(--wui-color-fg-100); + margin: 0 var(--wui-spacing-xs); + } + + .instruction { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + + textarea { + background: transparent; + width: 100%; + font-family: var(--w3m-font-family); + font-size: var(--wui-font-size-medium); + font-style: normal; + font-weight: var(--wui-font-weight-light); + line-height: 130%; + letter-spacing: var(--wui-letter-spacing-medium); + color: var(--wui-color-fg-100); + caret-color: var(--wui-color-accent-100); + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + border: none; + outline: none; + appearance: none; + resize: none; + overflow: hidden; + } +`;var ju=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let Ws=class extends ce{constructor(){super(...arguments),this.inputElementRef=Ka(),this.instructionElementRef=Ka(),this.instructionHidden=!!this.receiverAddress}firstUpdated(){this.receiverAddress&&(this.instructionHidden=!0),this.checkHidden()}render(){return T` + + Type or + + + Paste + + address + + + `}async focusInput(){var e;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(e=this.inputElementRef.value)==null||e.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var e;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(e=this.inputElementRef.value)==null||e.blur())}async toggleInstructionFocus(e){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:e?0:1},{opacity:e?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.receiverAddress&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.receiverAddress&&this.instructionHidden&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){const e=await navigator.clipboard.readText();Mt.setReceiverAddress(e)}onInputChange(e){const t=e.target;t.value&&!this.instructionHidden&&this.focusInput(),Mt.setReceiverAddress(t.value)}};Ws.styles=hb;ju([ge()],Ws.prototype,"receiverAddress",void 0);ju([U()],Ws.prototype,"instructionHidden",void 0);Ws=ju([V("w3m-input-address")],Ws);const pb=_e` + :host { + display: flex; + width: 100%; + flex-direction: column; + gap: var(--wui-border-radius-1xs); + border-radius: var(--wui-border-radius-s); + background: var(--wui-gray-glass-002); + padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs) + var(--wui-spacing-1xs); + } + + wui-text { + padding: 0 var(--wui-spacing-1xs); + } + + wui-flex { + margin-top: var(--wui-spacing-1xs); + } + + .network { + cursor: pointer; + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + } + + .network:focus-visible { + border: 1px solid var(--wui-color-accent-100); + background-color: var(--wui-gray-glass-005); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + .network:hover { + background-color: var(--wui-gray-glass-005); + } + + .network:active { + background-color: var(--wui-gray-glass-010); + } +`;var Wu=function(i,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let zs=class extends ce{render(){return T` Details + + + + + ${this.networkTemplate()} + `}networkTemplate(){var e;return(e=this.caipNetwork)!=null&&e.name?T` this.onNetworkClick(this.caipNetwork)} + class="network" + textTitle="Network" + imageSrc=${be(He.getNetworkImage(this.caipNetwork))} + >`:null}onNetworkClick(e){e&&G.push("Networks",{network:e})}};zs.styles=pb;Wu([ge()],zs.prototype,"receiverAddress",void 0);Wu([ge({type:Object})],zs.prototype,"caipNetwork",void 0);zs=Wu([V("w3m-wallet-send-details")],zs);let t0=!1;class fb{constructor(e){this.initPromise=void 0,this.setIsConnected=t=>{te.setIsConnected(t)},this.getIsConnectedState=()=>te.state.isConnected,this.setCaipAddress=t=>{te.setCaipAddress(t)},this.setBalance=(t,r)=>{te.setBalance(t,r)},this.setProfileName=t=>{te.setProfileName(t)},this.setProfileImage=t=>{te.setProfileImage(t)},this.resetAccount=()=>{te.resetAccount()},this.setCaipNetwork=t=>{de.setCaipNetwork(t)},this.getCaipNetwork=()=>de.state.caipNetwork,this.setRequestedCaipNetworks=t=>{de.setRequestedCaipNetworks(t)},this.getApprovedCaipNetworksData=()=>de.getApprovedCaipNetworksData(),this.resetNetwork=()=>{de.resetNetwork()},this.setConnectors=t=>{We.setConnectors(t)},this.addConnector=t=>{We.addConnector(t)},this.getConnectors=()=>We.getConnectors(),this.resetWcConnection=()=>{ke.resetWcConnection()},this.fetchIdentity=t=>Lt.fetchIdentity(t),this.setAddressExplorerUrl=t=>{te.setAddressExplorerUrl(t)},this.setSmartAccountDeployed=t=>{te.setSmartAccountDeployed(t)},this.setConnectedWalletInfo=t=>{te.setConnectedWalletInfo(t)},this.setSmartAccountEnabledNetworks=t=>{de.setSmartAccountEnabledNetworks(t)},this.setPreferredAccountType=t=>{te.setPreferredAccountType(t)},this.initControllers(e),this.initOrContinue()}async open(e){await this.initOrContinue(),Re.open(e)}async close(){await this.initOrContinue(),Re.close()}setLoading(e){Re.setLoading(e)}getThemeMode(){return ft.state.themeMode}getThemeVariables(){return ft.state.themeVariables}setThemeMode(e){ft.setThemeMode(e),su(ft.state.themeMode)}setThemeVariables(e){ft.setThemeVariables(e),Y0(ft.state.themeVariables)}subscribeTheme(e){return ft.subscribe(e)}getWalletInfo(){return te.state.connectedWalletInfo}subscribeWalletInfo(e){return te.subscribeKey("connectedWalletInfo",e)}getState(){return fr.state}subscribeState(e){return fr.subscribe(e)}showErrorMessage(e){Le.showError(e)}showSuccessMessage(e){Le.showSuccess(e)}getEvent(){return{...we.state}}subscribeEvents(e){return we.subscribe(e)}redirect(e){G.push(e)}popTransactionStack(e){G.popTransactionStack(e)}isOpen(){return Re.state.open}isTransactionStackEmpty(){return G.state.transactionStack.length===0}async initControllers(e){if(de.setClient(e.networkControllerClient),de.setDefaultCaipNetwork(e.defaultChain),pe.setProjectId(e.projectId),pe.setAllWallets(e.allWallets),pe.setIncludeWalletIds(e.includeWalletIds),pe.setExcludeWalletIds(e.excludeWalletIds),pe.setFeaturedWalletIds(e.featuredWalletIds),pe.setTokens(e.tokens),pe.setTermsConditionsUrl(e.termsConditionsUrl),pe.setPrivacyPolicyUrl(e.privacyPolicyUrl),pe.setCustomWallets(e.customWallets),pe.setEnableAnalytics(e.enableAnalytics),pe.setSdkVersion(e._sdkVersion),ke.setClient(e.connectionControllerClient),e.siweControllerClient){const{SIWEController:t}=await On(()=>import("./index.gqgjn4wa.js"),[],import.meta.url);t.setSIWEClient(e.siweControllerClient)}e.metadata&&pe.setMetadata(e.metadata),e.themeMode&&ft.setThemeMode(e.themeMode),e.themeVariables&&ft.setThemeVariables(e.themeVariables),e.enableOnramp&&pe.setOnrampEnabled(!!e.enableOnramp),e.enableWalletFeatures&&pe.setWalletFeaturesEnabled(!!e.enableWalletFeatures),e.allowUnsupportedChain&&de.setAllowUnsupportedChain(e.allowUnsupportedChain)}async initOrContinue(){return!this.initPromise&&!t0&&re.isClient()&&(t0=!0,this.initPromise=new Promise(async e=>{await Promise.all([On(()=>Promise.resolve().then(()=>Y2),void 0,import.meta.url),On(()=>Promise.resolve().then(()=>b3),void 0,import.meta.url)]);const t=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",t),e()})),this.initPromise}}function gb(i){if(i)return{id:`${Ee.EIP155}:${i.id}`,name:i.name,imageId:an.EIP155NetworkImageIds[i.id]}}async function wb(i){var n,s,a,c;if(!i)throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");const e=await(i==null?void 0:i.getProvider()),t=(s=(n=e==null?void 0:e.signer)==null?void 0:n.session)==null?void 0:s.namespaces,r=(a=t==null?void 0:t[Ee.EIP155])==null?void 0:a.methods,o=(c=t==null?void 0:t[Ee.EIP155])==null?void 0:c.chains;return{supportsAllNetworks:!!(r!=null&&r.includes(Ee.ADD_CHAIN_METHOD)),approvedCaipNetworkIds:o}}function mb(){return{supportsAllNetworks:!1,approvedCaipNetworkIds:an.WalletConnectRpcChainIds.map(i=>`${Ee.EIP155}:${i}`)}}function vb({chainId:i,projectId:e}){const t=re.getBlockchainApiUrl();return an.WalletConnectRpcChainIds.includes(i)?Vu(`${t}/v1/?chainId=${Ee.EIP155}:${i}&projectId=${e}`):Vu()}class bb extends fb{constructor(e){const{wagmiConfig:t,siweConfig:r,defaultChain:o,tokens:n,_sdkVersion:s,...a}=e;if(!t)throw new Error("web3modal:constructor - wagmiConfig is undefined");if(!a.projectId)throw new Error("web3modal:constructor - projectId is undefined");const c={switchCaipNetwork:async h=>{const p=dr.caipNetworkIdToNumber(h==null?void 0:h.id);p&&await Jp(this.wagmiConfig,{chainId:p})},getApprovedCaipNetworksData:async()=>new Promise(h=>{var S,O;const v=new Map(t.state.connections).get(t.state.current||"");if(((S=v==null?void 0:v.connector)==null?void 0:S.id)===Ee.EMAIL_CONNECTOR_ID)h(mb());else if(((O=v==null?void 0:v.connector)==null?void 0:O.id)===Ee.WALLET_CONNECT_CONNECTOR_ID){const D=t.connectors.find(R=>R.id===Ee.WALLET_CONNECT_CONNECTOR_ID);h(wb(D))}h({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})},l={connectWalletConnect:async h=>{var O;const p=t.connectors.find(D=>D.id===Ee.WALLET_CONNECT_CONNECTOR_ID);if(!p)throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");(await p.getProvider()).on("display_uri",D=>{h(D)});const S=dr.caipNetworkIdToNumber((O=this.getCaipNetwork())==null?void 0:O.id);await Ku(this.wagmiConfig,{connector:p,chainId:S})},connectExternal:async({id:h,provider:p,info:v})=>{var D,R;const S=t.connectors.find(B=>B.id===h);if(!S)throw new Error("connectionControllerClient:connectExternal - connector is undefined");p&&v&&S.id===Ee.EIP6963_CONNECTOR_ID&&((D=S.setEip6963Wallet)==null||D.call(S,{provider:p,info:v}));const O=dr.caipNetworkIdToNumber((R=this.getCaipNetwork())==null?void 0:R.id);await Ku(this.wagmiConfig,{connector:S,chainId:O})},checkInstalled:h=>{const p=this.getConnectors().find(v=>v.type==="INJECTED");return h?p&&window!=null&&window.ethereum?h.some(v=>{var S;return!!((S=window.ethereum)!=null&&S[String(v)])}):!1:!!window.ethereum},disconnect:async()=>{await $0(this.wagmiConfig)},signMessage:async h=>Kp(this.wagmiConfig,{message:h}),estimateGas:async h=>{try{return await jp(this.wagmiConfig,{account:h.address,to:h.to,data:h.data,type:"legacy"})}catch{return 0n}},sendTransaction:async h=>{const{chainId:p}=sc(this.wagmiConfig),v={account:h.address,to:h.to,value:h.value,gas:h.gas,gasPrice:h.gasPrice,data:h.data,chainId:p,type:"legacy"};await Gp(this.wagmiConfig,v);const S=await Yp(this.wagmiConfig,v);return await ef(this.wagmiConfig,{hash:S,timeout:25e3}),S},parseUnits:ep,formatUnits:ql};super({networkControllerClient:c,connectionControllerClient:l,siweControllerClient:r,defaultChain:gb(o),tokens:W4.getCaipTokens(n),_sdkVersion:s??`html-wagmi-${Ee.VERSION}`,...a}),this.hasSyncedConnectedAccount=!1,this.options=void 0,this.options=e,this.wagmiConfig=t,this.syncRequestedNetworks([...t.chains]),this.syncConnectors([...t.connectors]),this.initEmailConnectorListeners([...t.connectors]),Qp(this.wagmiConfig,{onChange:h=>this.syncConnectors(h)}),Xp(this.wagmiConfig,{onChange:h=>this.syncAccount({...h})})}getState(){const e=super.getState();return{...e,selectedNetworkId:dr.caipNetworkIdToNumber(e.selectedNetworkId)}}subscribeState(e){return super.subscribeState(t=>e({...t,selectedNetworkId:dr.caipNetworkIdToNumber(t.selectedNetworkId)}))}syncRequestedNetworks(e){const t=e==null?void 0:e.map(r=>{var o,n;return{id:`${Ee.EIP155}:${r.id}`,name:r.name,imageId:an.EIP155NetworkImageIds[r.id],imageUrl:(n=(o=this.options)==null?void 0:o.chainImages)==null?void 0:n[r.id]}});this.setRequestedCaipNetworks(t??[])}async syncAccount({address:e,isConnected:t,chainId:r,connector:o}){if(this.resetAccount(),this.syncNetwork(e,r,t),t&&e&&r){const n=`${Ee.EIP155}:${r}:${e}`;this.setIsConnected(t),this.setCaipAddress(n),await Promise.all([this.syncProfile(e,r),this.syncBalance(e,r),this.syncConnectedWalletInfo(o),this.getApprovedCaipNetworksData()]),this.hasSyncedConnectedAccount=!0}else!t&&this.hasSyncedConnectedAccount&&(this.resetWcConnection(),this.resetNetwork())}async syncNetwork(e,t,r){var n,s,a,c;const o=this.wagmiConfig.chains.find(l=>l.id===t);if(o||t){const l=(o==null?void 0:o.name)??(t==null?void 0:t.toString()),h=Number((o==null?void 0:o.id)??t),p=`${Ee.EIP155}:${h}`;if(this.setCaipNetwork({id:p,name:l,imageId:an.EIP155NetworkImageIds[h],imageUrl:(s=(n=this.options)==null?void 0:n.chainImages)==null?void 0:s[h]}),r&&e&&t){const v=`${Ee.EIP155}:${h}:${e}`;if(this.setCaipAddress(v),(c=(a=o==null?void 0:o.blockExplorers)==null?void 0:a.default)!=null&&c.url){const S=`${o.blockExplorers.default.url}/address/${e}`;this.setAddressExplorerUrl(S)}else this.setAddressExplorerUrl(void 0);this.hasSyncedConnectedAccount&&(await this.syncProfile(e,t),await this.syncBalance(e,t))}}}async syncProfile(e,t){try{const{name:r,avatar:o}=await this.fetchIdentity({address:e});this.setProfileName(r),this.setProfileImage(o)}catch{if(t===x0.id){const r=await Zp(this.wagmiConfig,{address:e,chainId:t});if(r){this.setProfileName(r);const o=await Vp(this.wagmiConfig,{name:r,chainId:t});o&&this.setProfileImage(o)}}else this.setProfileName(null),this.setProfileImage(null)}}async syncBalance(e,t){var o,n,s;const r=this.wagmiConfig.chains.find(a=>a.id===t);if(r){const a=await Hp(this.wagmiConfig,{address:e,chainId:r.id,token:(s=(n=(o=this.options)==null?void 0:o.tokens)==null?void 0:n[r.id])==null?void 0:s.address});this.setBalance(a.formatted,a.symbol);return}this.setBalance(void 0,void 0)}async syncConnectedWalletInfo(e){var t;if(!e)throw Error("syncConnectedWalletInfo - connector is undefined");if(e.id===Ee.WALLET_CONNECT_CONNECTOR_ID&&e.getProvider){const r=await e.getProvider();r.session&&this.setConnectedWalletInfo({...r.session.peer.metadata,name:r.session.peer.metadata.name,icon:(t=r.session.peer.metadata.icons)==null?void 0:t[0]})}else this.setConnectedWalletInfo({name:e.name,icon:e.icon})}syncConnectors(e){const t=new Set,r=e.filter(a=>!t.has(a.id)&&t.add(a.id)),o=[],n=Ee.COINBASE_SDK_CONNECTOR_ID,s=r.find(a=>a.id===Ee.CONNECTOR_RDNS_MAP[Ee.COINBASE_CONNECTOR_ID]);r.forEach(({id:a,name:c,type:l,icon:h})=>{var S,O;s&&a===n||Ee.EMAIL_CONNECTOR_ID===a||o.push({id:a,explorerId:an.ConnectorExplorerIds[a],imageUrl:((O=(S=this.options)==null?void 0:S.connectorImages)==null?void 0:O[a])??h,name:an.ConnectorNamesMap[a]??c,imageId:an.ConnectorImageIds[a],type:an.ConnectorTypesMap[l]??"EXTERNAL",info:{rdns:a}})}),this.setConnectors(o),this.syncEmailConnector(r)}async syncEmailConnector(e){const t=e.find(({id:r})=>r===Ee.EMAIL_CONNECTOR_ID);if(t){const r=await t.getProvider();this.addConnector({id:Ee.EMAIL_CONNECTOR_ID,type:"EMAIL",name:"Email",provider:r})}}async initEmailConnectorListeners(e){const t=e.find(({id:r})=>r===Ee.EMAIL_CONNECTOR_ID);t&&(await this.listenEmailConnector(t),await this.listenModal(t))}async listenEmailConnector(e){if(typeof window<"u"&&e){super.setLoading(!0);const t=await e.getProvider(),r=t.getLoginEmailUsed();super.setLoading(r),r&&this.setIsConnected(!1),t.onRpcRequest(o=>{if(vt.checkIfRequestExists(o))vt.checkIfRequestIsAllowed(o)||(super.isOpen()?super.isTransactionStackEmpty()||super.redirect("ApproveTransaction"):super.open({view:"ApproveTransaction"}));else{super.open();const n=vt.getRequestMethod(o);console.error(Bt.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:n}),setTimeout(()=>{this.showErrorMessage(Bt.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),t.rejectRpcRequest()}}),t.onRpcResponse(o=>{switch(vt.getResponseType(o)){case ee.RPC_RESPONSE_TYPE_ERROR:{super.isOpen()&&(super.isTransactionStackEmpty()?super.close():super.popTransactionStack(!0));break}case ee.RPC_RESPONSE_TYPE_TX:{super.isTransactionStackEmpty()?super.close():super.popTransactionStack();break}}}),t.onNotConnected(()=>{this.getIsConnectedState()||(this.setIsConnected(!1),super.setLoading(!1))}),t.onIsConnected(o=>{this.setIsConnected(!0),this.setSmartAccountDeployed(!!o.smartAccountDeployed),this.setPreferredAccountType(o.preferredAccountType),super.setLoading(!1)}),t.onGetSmartAccountEnabledNetworks(o=>{this.setSmartAccountEnabledNetworks(o)}),t.onSetPreferredAccount(({address:o,type:n})=>{var a;if(!o)return;const s=dr.caipNetworkIdToNumber((a=this.getCaipNetwork())==null?void 0:a.id);this.syncAccount({address:o,chainId:s,isConnected:!0,connector:e}).then(()=>this.setPreferredAccountType(n))})}}async listenModal(e){const t=await e.getProvider();this.subscribeState(r=>{r.open||t.rejectRpcRequest()})}}zu.type="coinbaseWallet";function zu(i){let t,r,o,n,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:zu.type,async connect({chainId:c}={}){try{const l=await this.getProvider(),h=(await l.request({method:"eth_requestAccounts"})).map(v=>Kt(v));o||(o=this.onAccountsChanged.bind(this),l.on("accountsChanged",o)),n||(n=this.onChainChanged.bind(this),l.on("chainChanged",n)),s||(s=this.onDisconnect.bind(this),l.on("disconnect",s));let p=await this.getChainId();if(c&&p!==c){const v=await this.switchChain({chainId:c}).catch(S=>{if(S.code===Vt.code)throw S;return{id:p}});p=(v==null?void 0:v.id)??p}return{accounts:h,chainId:p}}catch(l){throw/(user closed modal|accounts received is empty|user denied account)/i.test(l.message)?new Vt(l):l}},async disconnect(){const c=await this.getProvider();o&&(c.removeListener("accountsChanged",o),o=void 0),n&&(c.removeListener("chainChanged",n),n=void 0),s&&(c.removeListener("disconnect",s),s=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>Kt(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){var c;if(!r){const{default:l}=await On(()=>import("./index.BW38xcfQ.js").then(D=>D.i),__vite__mapDeps([0,1]),import.meta.url);let h;typeof l!="function"&&typeof l.default=="function"?h=l.default:h=l,t=new h({reloadOnDisconnect:!1,...i});const p=(c=t.walletExtension)==null?void 0:c.getChainId(),v=a.chains.find(D=>i.chainId?D.id===i.chainId:D.id===p)||a.chains[0],S=i.chainId||(v==null?void 0:v.id),O=i.jsonRpcUrl||(v==null?void 0:v.rpcUrls.default.http[0]);r=t.makeWeb3Provider(O,S)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:l}){var v,S,O,D;const h=a.chains.find(R=>R.id===l);if(!h)throw new Un(new lo);const p=await this.getProvider();try{return await p.request({method:"wallet_switchEthereumChain",params:[{chainId:ln(h.id)}]}),h}catch(R){if(R.code===4902)try{let B;c!=null&&c.blockExplorerUrls?B=c.blockExplorerUrls:B=(v=h.blockExplorers)!=null&&v.default.url?[(S=h.blockExplorers)==null?void 0:S.default.url]:[];let k;(O=c==null?void 0:c.rpcUrls)!=null&&O.length?k=c.rpcUrls:k=[((D=h.rpcUrls.default)==null?void 0:D.http[0])??""];const W={blockExplorerUrls:B,chainId:ln(l),chainName:(c==null?void 0:c.chainName)??h.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??h.nativeCurrency,rpcUrls:k};return await p.request({method:"wallet_addEthereumChain",params:[W]}),h}catch(B){throw new Vt(B)}throw new Un(R)}},onAccountsChanged(c){c.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:c.map(l=>Kt(l))})},onChainChanged(c){const l=Number(c);a.emitter.emit("change",{chainId:l})},async onDisconnect(c){a.emitter.emit("disconnect");const l=await this.getProvider();o&&(l.removeListener("accountsChanged",o),o=void 0),n&&(l.removeListener("chainChanged",n),n=void 0),s&&(l.removeListener("disconnect",s),s=void 0)}})}Fu.type="walletConnect";function Fu(i){const e=i.isNewChainsStale??!0;let t,r;const o="eip155";return n=>({id:"walletConnect",name:"WalletConnect",type:Fu.type,async setup(){const s=await this.getProvider().catch(()=>null);s&&(s.on("connect",this.onConnect.bind(this)),s.on("session_delete",this.onSessionDelete.bind(this)))},async connect({chainId:s,...a}={}){var c,l;try{const h=await this.getProvider();if(!h)throw new ur;h.on("display_uri",this.onDisplayUri);let p=s;if(!p){const D=await((c=n.storage)==null?void 0:c.getItem("state"))??{};n.chains.some(B=>B.id===D.chainId)?p=D.chainId:p=(l=n.chains[0])==null?void 0:l.id}if(!p)throw new Error("No chains found on connector.");const v=await this.isChainsStale();if(h.session&&v&&await h.disconnect(),!h.session||v){const D=n.chains.filter(R=>R.id!==p).map(R=>R.id);await h.connect({optionalChains:[p,...D],..."pairingTopic"in a?{pairingTopic:a.pairingTopic}:{}}),this.setRequestedChainsIds(n.chains.map(R=>R.id))}const S=(await h.enable()).map(D=>Kt(D)),O=await this.getChainId();return h.removeListener("display_uri",this.onDisplayUri),h.removeListener("connect",this.onConnect.bind(this)),h.on("accountsChanged",this.onAccountsChanged.bind(this)),h.on("chainChanged",this.onChainChanged),h.on("disconnect",this.onDisconnect.bind(this)),h.on("session_delete",this.onSessionDelete.bind(this)),{accounts:S,chainId:O}}catch(h){throw/(user rejected|connection request reset)/i.test(h==null?void 0:h.message)?new Vt(h):h}},async disconnect(){const s=await this.getProvider();try{await(s==null?void 0:s.disconnect())}catch(a){if(!/No matching key/i.test(a.message))throw a}finally{s==null||s.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),s==null||s.removeListener("chainChanged",this.onChainChanged),s==null||s.removeListener("disconnect",this.onDisconnect.bind(this)),s==null||s.removeListener("session_delete",this.onSessionDelete.bind(this)),s==null||s.on("connect",this.onConnect.bind(this)),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(a=>Kt(a))},async getProvider({chainId:s}={}){var c;async function a(){const l=n.chains.map(p=>p.id);if(!l.length)return;const{EthereumProvider:h}=await On(()=>import("./index.es.BbAz7DCx.js"),__vite__mapDeps([2,3,1]),import.meta.url);return await h.init({...i,disableProviderPing:!0,optionalChains:l,projectId:i.projectId,rpcMap:Object.fromEntries(n.chains.map(p=>[p.id,p.rpcUrls.default.http[0]])),showQrModal:i.showQrModal??!0})}return t||(r||(r=a()),t=await r,t==null||t.events.setMaxListeners(1/0)),s&&await((c=this.switchChain)==null?void 0:c.call(this,{chainId:s})),t},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[s,a]=await Promise.all([this.getAccounts(),this.getProvider()]);return s.length?await this.isChainsStale()&&a.session?(await a.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:s,chainId:a}){var l,h,p;const c=n.chains.find(v=>v.id===a);if(!c)throw new Un(new lo);try{const v=await this.getProvider(),S=this.getNamespaceChainsIds(),O=this.getNamespaceMethods();if(!S.includes(a)&&O.includes("wallet_addEthereumChain")){let R;s!=null&&s.blockExplorerUrls?R=s.blockExplorerUrls:R=(l=c.blockExplorers)!=null&&l.default.url?[(h=c.blockExplorers)==null?void 0:h.default.url]:[];let B;(p=s==null?void 0:s.rpcUrls)!=null&&p.length?B=s.rpcUrls:B=[...c.rpcUrls.default.http];const k={blockExplorerUrls:R,chainId:ln(a),chainName:(s==null?void 0:s.chainName)??c.name,iconUrls:s==null?void 0:s.iconUrls,nativeCurrency:(s==null?void 0:s.nativeCurrency)??c.nativeCurrency,rpcUrls:B};await v.request({method:"wallet_addEthereumChain",params:[k]});const W=await this.getRequestedChainsIds();this.setRequestedChainsIds([...W,a])}return await v.request({method:"wallet_switchEthereumChain",params:[{chainId:ln(a)}]}),c}catch(v){const S=typeof v=="string"?v:v==null?void 0:v.message;throw/user rejected request/i.test(S)?new Vt(v):new Un(v)}},onAccountsChanged(s){s.length===0?this.onDisconnect():n.emitter.emit("change",{accounts:s.map(a=>Kt(a))})},onChainChanged(s){const a=Number(s);n.emitter.emit("change",{chainId:a})},async onConnect(s){const a=Number(s.chainId),c=await this.getAccounts();n.emitter.emit("connect",{accounts:c,chainId:a})},async onDisconnect(s){this.setRequestedChainsIds([]),n.emitter.emit("disconnect");const a=await this.getProvider();a.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),a.removeListener("chainChanged",this.onChainChanged),a.removeListener("disconnect",this.onDisconnect.bind(this)),a.removeListener("session_delete",this.onSessionDelete.bind(this)),a.on("connect",this.onConnect.bind(this))},onDisplayUri(s){n.emitter.emit("message",{type:"display_uri",data:s})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var a,c,l;return t?((l=(c=(a=t.session)==null?void 0:a.namespaces[o])==null?void 0:c.chains)==null?void 0:l.map(h=>parseInt(h.split(":")[1]||"")))??[]:[]},getNamespaceMethods(){var a,c;return t?((c=(a=t.session)==null?void 0:a.namespaces[o])==null?void 0:c.methods)??[]:[]},async getRequestedChainsIds(){var s;return await((s=n.storage)==null?void 0:s.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(this.getNamespaceMethods().includes("wallet_addEthereumChain")||!e)return!1;const a=n.chains.map(h=>h.id),c=this.getNamespaceChainsIds();if(c.length&&!c.some(h=>a.includes(h)))return!1;const l=await this.getRequestedChainsIds();return!a.every(h=>l.includes(h))},async setRequestedChainsIds(s){var a;await((a=n.storage)==null?void 0:a.setItem(this.requestedChainsStorageKey,s))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}function yb(i){return e=>({id:Ee.EMAIL_CONNECTOR_ID,name:"Web3Modal Email",type:"w3mEmail",async connect(t={}){const r=await this.getProvider(),{address:o,chainId:n}=await r.connect({chainId:t.chainId});return await r.getSmartAccountEnabledNetworks(),{accounts:[o],account:o,chainId:n,chain:{id:n,unsuported:!1}}},async disconnect(){await(await this.getProvider()).disconnect()},async getAccounts(){const t=await this.getProvider(),{address:r}=await t.connect();return e.emitter.emit("change",{accounts:[r]}),[r]},async getProvider(){return this.provider||(this.provider=new L4(i.options.projectId)),Promise.resolve(this.provider)},async getChainId(){const t=await this.getProvider(),{chainId:r}=await t.getChainId();return r},async isAuthorized(){const t=await this.getProvider(),{isConnected:r}=await t.isConnected();return r},async switchChain({chainId:t}){try{const r=e.chains.find(n=>n.id===t);if(!r)throw new Un(new Error("chain not found on connector."));return await(await this.getProvider()).switchNetwork(t),e.emitter.emit("change",{chainId:zc(t)}),r}catch(r){throw r instanceof Error?new Un(r):r}},onAccountsChanged(t){t.length===0?this.onDisconnect():e.emitter.emit("change",{accounts:t.map(Kt)})},onChainChanged(t){const r=zc(t);e.emitter.emit("change",{chainId:r})},async onConnect(t){const r=zc(t.chainId),o=await this.getAccounts();e.emitter.emit("connect",{accounts:o,chainId:r})},async onDisconnect(t){await(await this.getProvider()).disconnect()}})}function xb({projectId:i,chains:e,metadata:t,enableInjected:r,enableCoinbase:o,enableEmail:n,enableWalletConnect:s,enableEIP6963:a,...c}){const l=[],h=e.map(v=>[v.id,vb({chainId:v.id,projectId:i})]),p=Object.fromEntries(h);return s!==!1&&l.push(Fu({projectId:i,metadata:t,showQrModal:!1})),r!==!1&&l.push(oc({shimDisconnect:!0})),o!==!1&&l.push(zu({appName:(t==null?void 0:t.name)??"Unknown",appLogoUrl:(t==null?void 0:t.icons[0])??"Unknown",enableMobileWalletLink:!0})),n===!0&&l.push(yb({chains:[...e],options:{projectId:i}})),Up({chains:e,multiInjectedProviderDiscovery:a!==!1,transports:p,...c,connectors:l})}function Cb(i){return new bb({...i,_sdkVersion:`html-wagmi-${Ee.VERSION}`})}const _b=i=>({}),i0=i=>({connectWallet:i[1],disconnectWallet:i[2]});function Eb(i){let e,t;const r=i[6].default,o=l0(r,i,i[5],i0);return{c(){e=Ye("div"),o&&o.c()},l(n){e=Ke(n,"DIV",{});var s=mt(e);o&&o.l(s),s.forEach(Me)},m(n,s){St(n,e,s),o&&o.m(e,null),t=!0},p(n,[s]){o&&o.p&&(!t||s&32)&&u0(o,r,n,n[5],t?h0(r,n[5],s,_b):d0(n[5]),i0)},i(n){t||(Ln(o,n),t=!0)},o(n){Bn(o,n),t=!1},d(n){n&&Me(e),o&&o.d(n)}}}function Tb(i,e,t){let r,o;Xo(i,Xh,O=>t(8,o=O));let{$$slots:n={},$$scope:s}=e;const a={300:Mh,324:Lh,11155111:Bh,31337:Uh},c={name:"Nottingham",description:"",url:o.url.origin,icons:[]},l=ch();let h=xb({chains:[a[Yh]],projectId:Zu,metadata:c});Xo(i,h,O=>t(4,r=O));let p;p0(async()=>{["connected","reconnecting"].includes(r==null?void 0:r.status)||qp(h),p=Cb({wagmiConfig:h,projectId:Zu})}),f0(async()=>{p&&(p.close(),p=void 0)});function v(){p&&p.open()}function S(){$0(h)}return i.$$set=O=>{"$$scope"in O&&t(5,s=O.$$scope)},i.$$.update=()=>{if(i.$$.dirty&16){const O=r==null?void 0:r.status;if(O==="connected"){const{connector:D,accounts:R}=r.connections.get(r.current);(async()=>{const[B,k]=await Promise.all([D.getProvider(),D.getChainId()]),W=_0(B),M=a[k]??x0;l("connected",{address:R[0],client:dp({transport:W,account:R[0],chain:M}),chain:M})})()}else O==="disconnected"?l("disconnected",{}):O==="connecting"&&l("connecting")}},[h,v,S,a,r,s,n]}class Ab extends Wl{constructor(e){super(),zl(this,e,Tb,Eb,Ul,{CHAIN_BY_ID:3})}get CHAIN_BY_ID(){return this.$$.ctx[3]}}function Sb(i){let e,t,r,o;return{c(){e=Ye("button"),this.h()},l(n){e=Ke(n,"BUTTON",{style:!0,title:!0,class:!0}),mt(e).forEach(Me),this.h()},h(){Ue(e,"style",t=n0(i[1])),Ue(e,"title",i[0]),Ue(e,"class","custom svelte-fbt74d")},m(n,s){St(n,e,s),r||(o=jl(e,"click",i[4]),r=!0)},p(n,[s]){s&2&&t!==(t=n0(n[1]))&&Ue(e,"style",t),s&1&&Ue(e,"title",n[0])},i:Rn,o:Rn,d(n){n&&Me(e),r=!1,o()}}}function n0(i){return Object.entries(i).filter(([e,t])=>t!==null).map(([e,t])=>`${e}: ${t};`).join(" ")}function kb(i,e,t){let{icon:r}=e,{hoverIcon:o=null}=e,{title:n=null}=e;const s={"purse-closed":{sheet:`${pi}/sprites.png`,row:0,col:1,rows:1,cols:4},"purse-open":{sheet:`${pi}/sprites.png`,row:0,col:0,rows:1,cols:4}};let a={};function c(h,p){if(t(1,a={}),h)if(h in s){const{sheet:v,row:S,col:O,rows:D,cols:R}=s[h];Object.assign(a,{"--sheet-url":`url('${v}')`,"--row":S,"--col":O,"--rows":D,"--cols":R})}else Object.assign(a,{"--sheet-url":`url(${h})`});if(p)if(p in s){const{sheet:v,row:S,col:O,rows:D,cols:R}=s[p];Object.assign(a,{"--sheet-url-hover":`url('${v}')`,"--row-hover":S,"--col-hover":O,"--rows-hover":D,"--cols-hover":R})}else Object.assign(a,{"--sheet-url-hover":`url(${p})`})}function l(h){lh.call(this,i,h)}return i.$$set=h=>{"icon"in h&&t(2,r=h.icon),"hoverIcon"in h&&t(3,o=h.hoverIcon),"title"in h&&t(0,n=h.title)},i.$$.update=()=>{i.$$.dirty&12&&c(r,o)},[n,a,r,o,l]}class ih extends Wl{constructor(e){super(),zl(this,e,kb,Sb,Ul,{icon:2,hoverIcon:3,title:0})}}function $b(i){let e,t,r,o,n=`Home`,s,a,c=`Progress`,l,h,p,v,S=`Merchants`,O,D,R,B,k,W,M,j=!i[3]&&r0(),Z=i[3]&&o0(i);B=new Ab({props:{$$slots:{default:[Mb,({disconnectWallet:w,connectWallet:m})=>({25:w,26:m}),({disconnectWallet:w,connectWallet:m})=>(w?33554432:0)|(m?67108864:0)]},$$scope:{ctx:i}}}),B.$on("connected",i[7]),B.$on("disconnected",i[8]),B.$on("connecting",i[9]);const ie=i[11].default,f=l0(ie,i,i[17],null);return{c(){e=Ye("div"),t=Ye("header"),r=Ye("div"),o=Ye("div"),o.innerHTML=n,s=xi(),a=Ye("div"),a.innerHTML=c,l=xi(),j&&j.c(),h=xi(),Z&&Z.c(),p=xi(),v=Ye("div"),v.innerHTML=S,O=xi(),D=Ye("div"),R=Ye("div"),Fl(B.$$.fragment),k=xi(),W=Ye("main"),f&&f.c(),this.h()},l(w){e=Ke(w,"DIV",{class:!0});var m=mt(e);t=Ke(m,"HEADER",{class:!0});var A=mt(t);r=Ke(A,"DIV",{class:!0});var _=mt(r);o=Ke(_,"DIV",{class:!0,"data-svelte-h":!0}),In(o)!=="svelte-oyc8sw"&&(o.innerHTML=n),s=Ci(_),a=Ke(_,"DIV",{class:!0,"data-svelte-h":!0}),In(a)!=="svelte-1j3m74o"&&(a.innerHTML=c),l=Ci(_),j&&j.l(_),h=Ci(_),Z&&Z.l(_),p=Ci(_),v=Ke(_,"DIV",{class:!0,"data-svelte-h":!0}),In(v)!=="svelte-1kdca1y"&&(v.innerHTML=S),_.forEach(Me),O=Ci(A),D=Ke(A,"DIV",{class:!0});var N=mt(D);R=Ke(N,"DIV",{class:!0});var P=mt(R);Hl(B.$$.fragment,P),P.forEach(Me),N.forEach(Me),A.forEach(Me),k=Ci(m),W=Ke(m,"MAIN",{});var y=mt(W);f&&f.l(y),y.forEach(Me),m.forEach(Me),this.h()},h(){Ue(o,"class","svelte-eo5hzb"),Ue(a,"class","svelte-eo5hzb"),Ue(v,"class","svelte-eo5hzb"),Ue(r,"class","left svelte-eo5hzb"),Ue(R,"class","svelte-eo5hzb"),Ue(D,"class","right svelte-eo5hzb"),Ue(t,"class","svelte-eo5hzb"),Ue(e,"class","content svelte-eo5hzb")},m(w,m){St(w,e,m),qe(e,t),qe(t,r),qe(r,o),qe(r,s),qe(r,a),qe(r,l),j&&j.m(r,null),qe(r,h),Z&&Z.m(r,null),qe(r,p),qe(r,v),qe(t,O),qe(t,D),qe(D,R),Vl(B,R,null),qe(e,k),qe(e,W),f&&f.m(W,null),M=!0},p(w,m){w[3]?j&&(j.d(1),j=null):j||(j=r0(),j.c(),j.m(r,h)),w[3]?Z?Z.p(w,m):(Z=o0(w),Z.c(),Z.m(r,p)):Z&&(Z.d(1),Z=null);const A={};m&100794379&&(A.$$scope={dirty:m,ctx:w}),B.$set(A),f&&f.p&&(!M||m&131072)&&u0(f,ie,w,w[17],M?h0(ie,w[17],m,null):d0(w[17]),null)},i(w){M||(Ln(B.$$.fragment,w),Ln(f,w),M=!0)},o(w){Bn(B.$$.fragment,w),Bn(f,w),M=!1},d(w){w&&Me(e),j&&j.d(),Z&&Z.d(),Zl(B),f&&f.d(w)}}}function Rb(i){let e,t='
Woe is us! We are beset by fleas!
';return{c(){e=Ye("div"),e.innerHTML=t,this.h()},l(r){e=Ke(r,"DIV",{class:!0,"data-svelte-h":!0}),In(e)!=="svelte-1210s9v"&&(e.innerHTML=t),this.h()},h(){Ue(e,"class","content svelte-eo5hzb")},m(r,o){St(r,e,o)},p:Rn,i:Rn,o:Rn,d(r){r&&Me(e)}}}function r0(i){let e,t=`Register`;return{c(){e=Ye("div"),e.innerHTML=t,this.h()},l(r){e=Ke(r,"DIV",{class:!0,"data-svelte-h":!0}),In(e)!=="svelte-oc795z"&&(e.innerHTML=t),this.h()},h(){Ue(e,"class","svelte-eo5hzb")},m(r,o){St(r,e,o)},d(r){r&&Me(e)}}}function o0(i){let e,t,r,o;return{c(){e=Ye("div"),t=Ye("a"),r=ao("Dashboard"),this.h()},l(n){e=Ke(n,"DIV",{class:!0});var s=mt(e);t=Ke(s,"A",{href:!0,class:!0});var a=mt(t);r=co(a,"Dashboard"),a.forEach(Me),s.forEach(Me),this.h()},h(){Ue(t,"href",o=`${pi}/player?name=${i[3]}`),Ue(t,"class","svelte-eo5hzb"),Ue(e,"class","svelte-eo5hzb")},m(n,s){St(n,e,s),qe(e,t),qe(t,r)},p(n,s){s&8&&o!==(o=`${pi}/player?name=${n[3]}`)&&Ue(t,"href",o)},d(n){n&&Me(e)}}}function Ib(i){let e,t,r,o,n;function s(h,p){return h[3]?Db:Nb}let a=s(i),c=a(i);function l(){return i[16](i[25])}return o=new ih({props:{icon:"purse-open",hoverIcon:"purse-closed",title:"Disconnect wallet"}}),o.$on("click",l),{c(){e=Ye("span"),t=ao(`Hail, + `),c.c(),r=xi(),Fl(o.$$.fragment)},l(h){e=Ke(h,"SPAN",{});var p=mt(e);t=co(p,`Hail, + `),c.l(p),p.forEach(Me),r=Ci(h),Hl(o.$$.fragment,h)},m(h,p){St(h,e,p),qe(e,t),c.m(e,null),St(h,r,p),Vl(o,h,p),n=!0},p(h,p){i=h,a===(a=s(i))&&c?c.p(i,p):(c.d(1),c=a(i),c&&(c.c(),c.m(e,null)))},i(h){n||(Ln(o.$$.fragment,h),n=!0)},o(h){Bn(o.$$.fragment,h),n=!1},d(h){h&&(Me(e),Me(r)),c.d(),Zl(o,h)}}}function Ob(i){let e,t="Unlace thy purse",r,o,n,s,a;function c(){return i[14](i[26])}function l(){return i[15](i[26])}return o=new ih({props:{icon:"purse-closed",hoverIcon:"purse-open",title:"Connect wallet"}}),o.$on("click",l),{c(){e=Ye("a"),e.textContent=t,r=xi(),Fl(o.$$.fragment),this.h()},l(h){e=Ke(h,"A",{href:!0,class:!0,"data-svelte-h":!0}),In(e)!=="svelte-mhrk26"&&(e.textContent=t),r=Ci(h),Hl(o.$$.fragment,h),this.h()},h(){Ue(e,"href","#"),Ue(e,"class","svelte-eo5hzb")},m(h,p){St(h,e,p),St(h,r,p),Vl(o,h,p),n=!0,s||(a=jl(e,"click",g0(c)),s=!0)},p(h,p){i=h},i(h){n||(Ln(o.$$.fragment,h),n=!0)},o(h){Bn(o.$$.fragment,h),n=!1},d(h){h&&(Me(e),Me(r)),Zl(o,h),s=!1,a()}}}function Pb(i){let e,t="Unlacing...";return{c(){e=Ye("span"),e.textContent=t},l(r){e=Ke(r,"SPAN",{"data-svelte-h":!0}),In(e)!=="svelte-fdx1qb"&&(e.textContent=t)},m(r,o){St(r,e,o)},p:Rn,i:Rn,o:Rn,d(r){r&&Me(e)}}}function Nb(i){let e,t=i[0].address+"",r,o;return{c(){e=Ye("span"),r=ao(t),o=ao("!"),this.h()},l(n){e=Ke(n,"SPAN",{class:!0});var s=mt(e);r=co(s,t),s.forEach(Me),o=co(n,"!"),this.h()},h(){Ue(e,"class","wallet-address svelte-eo5hzb")},m(n,s){St(n,e,s),qe(e,r),St(n,o,s)},p(n,s){s&1&&t!==(t=n[0].address+"")&&w0(r,t)},d(n){n&&(Me(e),Me(o))}}}function Db(i){let e,t,r,o;return{c(){e=Ye("a"),t=ao(i[3]),o=ao("!"),this.h()},l(n){e=Ke(n,"A",{href:!0,class:!0});var s=mt(e);t=co(s,i[3]),s.forEach(Me),o=co(n,"!"),this.h()},h(){Ue(e,"href",r=`${pi}/player?name=${i[3]}`),Ue(e,"class","player-name svelte-eo5hzb")},m(n,s){St(n,e,s),qe(e,t),St(n,o,s)},p(n,s){s&8&&w0(t,n[3]),s&8&&r!==(r=`${pi}/player?name=${n[3]}`)&&Ue(e,"href",r)},d(n){n&&(Me(e),Me(o))}}}function Mb(i){let e,t,r,o,n;const s=[Pb,Ob,Ib],a=[];function c(l,h){return l[1]?0:l[0]?2:1}return r=c(i),o=a[r]=s[r](i),{c(){e=Ye("div"),t=Ye("div"),o.c(),this.h()},l(l){e=Ke(l,"DIV",{slot:!0});var h=mt(e);t=Ke(h,"DIV",{class:!0});var p=mt(t);o.l(p),p.forEach(Me),h.forEach(Me),this.h()},h(){Ue(t,"class","wallet-status svelte-eo5hzb"),Ue(e,"slot","default")},m(l,h){St(l,e,h),qe(e,t),a[r].m(t,null),n=!0},p(l,h){let p=r;r=c(l),r===p?a[r].p(l,h):(ph(),Bn(a[p],1,1,()=>{a[p]=null}),fh(),o=a[r],o?o.p(l,h):(o=a[r]=s[r](l),o.c()),Ln(o,1),o.m(t,null))},i(l){n||(Ln(o),n=!0)},o(l){Bn(o),n=!1},d(l){l&&Me(e),a[r].d()}}}function Lb(i){let e,t,r,o,n,s,a=``,c,l,h,p,v,S,O,D;const R=[Rb,$b],B=[];function k(W,M){return 1}return p=k(),v=B[p]=R[p](i),{c(){e=Ye("div"),t=Ye("img"),o=xi(),n=Ye("div"),s=Ye("audio"),s.innerHTML=a,c=xi(),l=Ye("a"),h=xi(),v.c(),this.h()},l(W){e=Ke(W,"DIV",{class:!0});var M=mt(e);t=Ke(M,"IMG",{class:!0,src:!0}),o=Ci(M),n=Ke(M,"DIV",{class:!0});var j=mt(n);s=Ke(j,"AUDIO",{"data-svelte-h":!0}),In(s)!=="svelte-14wm9iw"&&(s.innerHTML=a),j.forEach(Me),c=Ci(M),l=Ke(M,"A",{class:!0}),mt(l).forEach(Me),h=Ci(M),v.l(M),M.forEach(Me),this.h()},h(){Ue(t,"class","ghost svelte-eo5hzb"),uh(t.src,r=`${pi}/fair.png`)||Ue(t,"src",r),Ue(n,"class","bg svelte-eo5hzb"),Ue(l,"class","music-toggle svelte-eo5hzb"),Ue(e,"class","tome svelte-eo5hzb")},m(W,M){St(W,e,M),qe(e,t),qe(e,o),qe(e,n),qe(n,s),i[12](s),qe(e,c),qe(e,l),qe(e,h),B[p].m(e,null),S=!0,O||(D=jl(l,"click",g0(i[13])),O=!0)},p(W,[M]){v.p(W,M)},i(W){S||(Ln(v),S=!0)},o(W){Bn(v),S=!1},d(W){W&&Me(e),i[12](null),B[p].d(),O=!1,D()}}}function Bb(i,e,t){let r,o,n,{$$slots:s={},$$scope:a}=e;const c=jh(),[l,h]=Uc(null);Xo(i,l,_=>t(0,o=_));const[p,v]=Uc(null);Xo(i,p,_=>t(3,n=_));const[S,O]=Uc([]);Xo(i,S,_=>t(19,r=_));let D=!1,R,B=null;dh(Wh,{wallet:l,playerName:p,publicClient:c,seasons:S}),p0(()=>{j(),B=setInterval(j,12e4)}),f0(()=>{B&&(clearInterval(B),B=null)});function k(_){console.debug("wallet connected"),t(1,D=!1),h({address:_.detail.address,client:_.detail.client,chain:_.detail.chain})}function W(){console.debug("wallet disconnected"),t(1,D=!1),h(null),v(null)}function M(){console.debug("wallet connecting"),t(1,D=!0)}async function j(){const _=r[r.length-1],N=await Kh(c,_?_.startBlock:void 0),P=r;for(const y of N){if(y.idx>=P.length){P.push(y);continue}Object.assign(P[y.idx],y)}{const y=P.filter(I=>I.unclaimedPrize!==0n).map(I=>I.idx),E=await Jh({client:c,calls:y.map(I=>({fn:"winner",args:[I]}))});for(const[I,$]of y.entries())P[$].winner=E[I][0],P[$].unclaimedPrize=E[I][1]}O(P)}function Z(){R.paused?R.play():R.pause()}function ie(_){hh[_?"unshift":"push"](()=>{R=_,t(2,R)})}const f=()=>Z(),w=_=>_(),m=_=>_(),A=_=>_();return i.$$set=_=>{"$$scope"in _&&t(17,a=_.$$scope)},i.$$.update=()=>{i.$$.dirty&1&&o&&(async()=>{v(null);const _=await fetch(`${Zh}/whois?${new URLSearchParams({address:o.address})}`,{headers:{"content-type":"application/json"}});if(!_.ok){if(_.status!==404){const{error:N}=await _.json();throw new Error(`Failed to fetch players: ${N}`)}return}v((await _.json()).name)})()},[o,D,R,n,l,p,S,k,W,M,Z,s,ie,f,w,m,A,a]}class Wy extends Wl{constructor(e){super(),zl(this,e,Bb,Lb,Ul,{})}}export{te as A,ke as C,we as E,Wy as L,Re as M,dr as N,pe as O,tu as R,ht as S,I0 as a,Gb as b,de as c,ri as d,V as e,Le as f,rc as g,G as h,Vs as i,Jl as j,Ep as k,O1 as l,kt as p,uo as r,Xt as s}; diff --git a/_app/immutable/chunks/___vite-browser-external_commonjs-proxy.CXzVU9cb.js b/_app/immutable/chunks/___vite-browser-external_commonjs-proxy.CXzVU9cb.js new file mode 100644 index 0000000..812f3a6 --- /dev/null +++ b/_app/immutable/chunks/___vite-browser-external_commonjs-proxy.CXzVU9cb.js @@ -0,0 +1 @@ +import{g as j,b as C}from"./2.DEesTFv4.js";var p={exports:{}},a=typeof Reflect=="object"?Reflect:null,h=a&&typeof a.apply=="function"?a.apply:function(e,n,r){return Function.prototype.apply.call(e,n,r)},l;a&&typeof a.ownKeys=="function"?l=a.ownKeys:Object.getOwnPropertySymbols?l=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:l=function(e){return Object.getOwnPropertyNames(e)};function N(t){console&&console.warn&&console.warn(t)}var L=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}p.exports=o;p.exports.once=P;o.EventEmitter=o;o.prototype._events=void 0;o.prototype._eventsCount=0;o.prototype._maxListeners=void 0;var m=10;function v(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(t){if(typeof t!="number"||t<0||L(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");m=t}});o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};o.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||L(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function y(t){return t._maxListeners===void 0?o.defaultMaxListeners:t._maxListeners}o.prototype.getMaxListeners=function(){return y(this)};o.prototype.emit=function(e){for(var n=[],r=1;r0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")h(c,this,n);else for(var d=c.length,O=E(c,d),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,N(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():M(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function b(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?A(i):E(i,i.length)}o.prototype.listeners=function(e){return b(this,e,!0)};o.prototype.rawListeners=function(e){return b(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):w.call(t,e)};o.prototype.listenerCount=w;function w(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r` ${b(d)}`)],` Sender: ${u}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class $ extends p{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${b(t)}`,`Response: ${w(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class S extends p{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function A(a,e){if(!h(a,{strict:!1}))throw new m({address:a});if(!h(e,{strict:!1}))throw new m({address:e});return a.toLowerCase()===e.toLowerCase()}const j="0x556f1830",q={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function D(a,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:u}=O({data:n,abi:[q]}),[r,i,d,s,o]=u,{ccipRead:f}=a,g=f&&typeof(f==null?void 0:f.request)=="function"?f.request:v;try{if(!A(c,r))throw new S({sender:r,to:c});const l=await g({data:d,sender:r,urls:i}),{data:k}=await L(a,{blockNumber:e,blockTag:t,data:E([s,x([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return k}catch(l){throw new R({callbackSelector:s,cause:l,data:n,extraData:o,sender:r,urls:i})}}async function v({data:a,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let u=0;u{const o=F(e,s);return o instanceof L?e:o})();return new j(r,{docsPath:a,...s})}async function te(e,a){var x,h,E,N;const{account:s=e.account,chain:r=e.chain,accessList:o,blobs:t,data:u,gas:c,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:n,maxPriorityFeePerGas:i,nonce:b,to:y,value:p,...g}=a;if(!s)throw new X({docsPath:"/docs/actions/wallet/sendTransaction"});const f=J(s);try{H(a);let T;if(r!==null&&(T=await v(e,W,"getChainId")({}),Z({currentChainId:T,chain:r})),f.type==="local"){const B=await v(e,U,"prepareTransactionRequest")({account:f,accessList:o,blobs:t,chain:r,chainId:T,data:u,gas:c,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:n,maxPriorityFeePerGas:i,nonce:b,parameters:[...$,"sidecars"],to:y,value:p,...g}),z=(x=r==null?void 0:r.serializers)==null?void 0:x.transaction,k=await f.signTransaction(B,{serializer:z});return await v(e,G,"sendRawTransaction")({serializedTransaction:k})}const S=(N=(E=(h=e.chain)==null?void 0:h.formatters)==null?void 0:E.transactionRequest)==null?void 0:N.format,R=(S||V)({...Y(g,{format:S}),accessList:o,blobs:t,data:u,from:f.address,gas:c,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:n,maxPriorityFeePerGas:i,nonce:b,to:y,value:p});return await e.request({method:"eth_sendTransaction",params:[R]},{retryCount:0})}catch(T){throw ee(T,{...a,account:f,chain:a.chain||void 0})}}async function M(e,a){const{abi:s,address:r,args:o,dataSuffix:t,functionName:u,...c}=a,d=C({abi:s,args:o,functionName:u});return v(e,te,"sendTransaction")({data:`${d}${t?t.replace("0x",""):""}`,to:r,...c})}const ne=[{type:"constructor",inputs:[{name:"host_",type:"address",internalType:"address"},{name:"retirer_",type:"address",internalType:"address"},{name:"registrar_",type:"address",internalType:"address"}],stateMutability:"nonpayable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"claim",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"recipient",type:"address",internalType:"address payable"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"closeSeason",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"confirmationConsumedBlock",inputs:[{name:"confirmationNonce",type:"uint256",internalType:"uint256"}],outputs:[{name:"block",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"currentSeasonIdx",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"currentSeasonPrize",inputs:[],outputs:[{name:"prize",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"host",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"isValidPlayer",inputs:[{name:"player",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"multicall",inputs:[{name:"data",type:"bytes[]",internalType:"bytes[]"}],outputs:[{name:"results",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"operators",inputs:[{name:"player",type:"address",internalType:"address"},{name:"operator",type:"address",internalType:"address"}],outputs:[{name:"isPermitted",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"playerCodeCount",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[{name:"playerCount_",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"playerCodeHash",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"player",type:"address",internalType:"address"}],outputs:[{name:"codeHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"playerCount",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"playerRegisteredBlock",inputs:[{name:"player",type:"address",internalType:"address"}],outputs:[{name:"block",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"register",inputs:[{name:"player",type:"address",internalType:"address"},{name:"confirmation",type:"tuple",internalType:"struct Confirmation",components:[{name:"expiry",type:"uint256",internalType:"uint256"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"metadata",type:"bytes",internalType:"bytes"},{name:"r",type:"bytes32",internalType:"bytes32"},{name:"s",type:"bytes32",internalType:"bytes32"},{name:"v",type:"uint8",internalType:"uint8"}]}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"registrar",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"replaceRegistrar",inputs:[{name:"newRegistrar",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"retire",inputs:[{name:"player",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"retirer",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"revealSeasonKey",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"seasonPrivKey",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"seasonState",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[{name:"",type:"uint8",internalType:"enum SeasonState"}],stateMutability:"view"},{type:"function",name:"setOperator",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"permitted",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"startSeason",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"seasonPubKey",type:"bytes",internalType:"bytes"},{name:"prevWinner",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"staticMulticall",inputs:[{name:"data",type:"bytes[]",internalType:"bytes[]"}],outputs:[{name:"results",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"view"},{type:"function",name:"submitCode",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"player",type:"address",internalType:"address"},{name:"codeHash",type:"bytes32",internalType:"bytes32"},{name:"submission",type:"tuple",internalType:"struct EncryptedCodeSubmission",components:[{name:"encryptedAesKey",type:"bytes",internalType:"bytes"},{name:"encryptedCode",type:"bytes",internalType:"bytes"},{name:"iv",type:"bytes12",internalType:"bytes12"}]}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"unclaimedPrize",inputs:[],outputs:[{name:"",type:"uint96",internalType:"uint96"}],stateMutability:"view"},{type:"function",name:"winner",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[{name:"winner_",type:"address",internalType:"address"},{name:"unclaimedPrize_",type:"uint96",internalType:"uint96"}],stateMutability:"view"},{type:"event",name:"CodeCommitted",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"player",type:"address",indexed:!0,internalType:"address"},{name:"codeHash",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"submission",type:"tuple",indexed:!1,internalType:"struct EncryptedCodeSubmission",components:[{name:"encryptedAesKey",type:"bytes",internalType:"bytes"},{name:"encryptedCode",type:"bytes",internalType:"bytes"},{name:"iv",type:"bytes12",internalType:"bytes12"}]}],anonymous:!1},{type:"event",name:"OperatorSet",inputs:[{name:"player",type:"address",indexed:!0,internalType:"address"},{name:"operator",type:"address",indexed:!0,internalType:"address"},{name:"permitted",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"PrizeClaimed",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"winner",type:"address",indexed:!0,internalType:"address"},{name:"prize",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Registered",inputs:[{name:"player",type:"address",indexed:!0,internalType:"address"},{name:"metadata",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"RegistrarReplaced",inputs:[{name:"oldRegistrar",type:"address",indexed:!0,internalType:"address"},{name:"newRegistrar",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"Retired",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"player",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"SeasonClosed",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"}],anonymous:!1},{type:"event",name:"SeasonRevealed",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"privateKey",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"SeasonStarted",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"publicKey",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"WinnerDeclared",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"winner",type:"address",indexed:!0,internalType:"address"},{name:"prize",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AccessError",inputs:[]},{type:"error",name:"AlreadyClaimedError",inputs:[]},{type:"error",name:"AlreadyRegisteredError",inputs:[]},{type:"error",name:"ConfirmationConsumedError",inputs:[]},{type:"error",name:"InvalidCodeHashError",inputs:[]},{type:"error",name:"InvalidConfirmationError",inputs:[]},{type:"error",name:"InvalidKeyError",inputs:[]},{type:"error",name:"InvalidPlayerError",inputs:[]},{type:"error",name:"NotRegisteredError",inputs:[]},{type:"error",name:"NotSeasonError",inputs:[]},{type:"error",name:"NotWinnerError",inputs:[]},{type:"error",name:"PlayerSubmissionError",inputs:[]},{type:"error",name:"PreviousSeasonNotRevealedError",inputs:[]},{type:"error",name:"SeasonNotActiveError",inputs:[]},{type:"error",name:"SeasonNotClosedError",inputs:[]}],le=Number(D),w=_,l=ne,ae=l.filter(e=>e.type==="event");async function de(e){return I(e.client,{address:w,abi:l,functionName:e.fn,account:e.from,args:e.args})}async function ce(e){return M(e.client,{account:e.client.account,chain:e.client.chain,address:w,abi:l,functionName:e.fn,args:e.args})}async function se(e){const a=await I(e.client,{address:w,abi:l,functionName:"multicall",args:[e.calls.map(s=>C({abi:l,functionName:s.fn,args:s.args}))]});return[...e.calls.entries()].map(([s,{fn:r}])=>{const o=l.find(u=>u.type==="function"&&u.name===r),t=Q(o.outputs,a[s]);return o.outputs.length===1?t[0]:t})}async function me(e){const a=await M(e.client,{account:e.client.account,chain:e.client.chain,address:w,abi:l,functionName:"multicall",args:[e.calls.map(r=>C({abi:l,functionName:r.fn,args:r.args}))]});if((await P(e.client,{hash:a})).status!=="success")throw new Error("Transaction reverted")}async function re(e,a,s){const r=BigInt(s||O),o=a.map(t=>typeof t=="string"?{name:t}:t);return(await Promise.all(o.map(t=>e.getLogs({address:w,event:ae.find(u=>u.name===t.name),args:t.args??void 0,fromBlock:r})))).flat(1)}async function be(e,a){const s=await P(e,{hash:a});if(s.status!=="success")throw new Error("Transaction failed");return s}var ie=(e=>(e[e.Inactive=0]="Inactive",e[e.Started=1]="Started",e[e.Closed=2]="Closed",e[e.Revealed=3]="Revealed",e))(ie||{});async function fe(e,a){const[s,[r,o]]=await Promise.all([re(e,["SeasonStarted","SeasonClosed","SeasonRevealed","WinnerDeclared","PrizeClaimed"],a),se({client:e,calls:[{fn:"currentSeasonPrize"},{fn:"currentSeasonIdx"}]})]),t={};for(const n of s){const{args:i}=n,b=Number(n.blockNumber);if(n.eventName==="SeasonStarted"){t[i.season]={idx:i.season,winner:null,closedBlock:null,startBlock:b,closedTime:null,startTime:new Date(0),prize:0n,state:1,unclaimedPrize:0n,privateKey:"0x",publicKey:i.publicKey};continue}const y=t[i.season];if(y||console.warn(`Found event for missing season idx: ${i.season}`),n.eventName==="SeasonClosed")y.state=2,y.closedBlock=b;else if(n.eventName==="SeasonRevealed")y.privateKey=i.privateKey,y.state=3;else if(n.eventName==="WinnerDeclared"){if(i.season in t){const p=t[i.season];p.winner=i.winner,p.prize=i.prize,p.unclaimedPrize=i.prize}}else if(i.season in t){const p=t[i.season];p.prize=i.prize,p.unclaimedPrize=0n}}t[o]&&(t[o].prize=r);const u=Object.values(Object.assign({},...Object.values(t).map(n=>[n.startBlock,n.closedBlock]).flat(1).filter(n=>typeof n=="number").map(n=>({[n]:n})))),c=await oe(e,u),d=Object.assign({},...u.map((n,i)=>({[n]:c[i]}))),m=Object.values(t).sort((n,i)=>n.idx-i.idx);for(const n of m)n.startTime=d[n.startBlock],n.closedBlock&&(n.closedTime=d[n.closedBlock]);return m}async function oe(e,a){return Promise.all(a.map(async s=>{const r=`${e.chain.id}/blockTime/${s}`,o=await localStorage.getItem(r);if(o)return new Date(Number(o));const t=await e.getBlock({blockNumber:BigInt(s)}),u=Number(t.timestamp)*1e3;return await localStorage.setItem(r,u.toString()),new Date(u)}))}export{X as A,w as C,ie as S,be as a,me as b,Z as c,M as d,le as e,fe as f,se as m,de as r,te as s,ce as w}; diff --git a/_app/immutable/chunks/each.kVXWp4N9.js b/_app/immutable/chunks/each.kVXWp4N9.js new file mode 100644 index 0000000..9a71464 --- /dev/null +++ b/_app/immutable/chunks/each.kVXWp4N9.js @@ -0,0 +1 @@ +import{a as q,t as z}from"./index.BtSuiA6z.js";import{r as B}from"./scheduler.gEqqeaCZ.js";function F(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function G(n,f){n.d(1),f.delete(n.key)}function H(n,f){q(n,1,1,()=>{f.delete(n.key)})}function I(n,f,k,C,x,g,h,A,p,_,w,j){let i=n.length,d=g.length,c=i;const a={};for(;c--;)a[n[c].key]=c;const l=[],u=new Map,m=new Map,M=[];for(c=d;c--;){const e=j(x,g,c),s=k(e);let t=h.get(s);t?M.push(()=>t.p(e,f)):(t=_(s,e),t.c()),u.set(s,l[c]=t),s in a&&m.set(s,Math.abs(c-a[s]))}const v=new Set,S=new Set;function y(e){z(e,1),e.m(A,w),h.set(e.key,e),w=e.first,d--}for(;i&&d;){const e=l[d-1],s=n[i-1],t=e.key,o=s.key;e===s?(w=e.first,i--,d--):u.has(o)?!h.has(t)||v.has(t)?y(e):S.has(o)?i--:m.get(t)>m.get(o)?(S.add(t),y(e)):(v.add(o),i--):(p(s,h),i--)}for(;i--;){const e=n[i];u.has(e.key)||p(e,h)}for(;d;)y(l[d-1]);return B(M),l}export{G as d,F as e,H as o,I as u}; diff --git a/_app/immutable/chunks/entry.B5WQGdlh.js b/_app/immutable/chunks/entry.B5WQGdlh.js new file mode 100644 index 0000000..af23532 --- /dev/null +++ b/_app/immutable/chunks/entry.B5WQGdlh.js @@ -0,0 +1,3 @@ +import{J as oe}from"./scheduler.gEqqeaCZ.js";import{w as pt,a as se,b as P}from"./paths.DTSw6QKH.js";new URL("sveltekit-internal://");function ie(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function ce(t){return t.split("%25").map(decodeURI).join("%25")}function le(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function ct({href:t}){return t.split("#")[0]}const fe=["href","pathname","search","toString","toJSON"];function ue(t,n,e){const a=new URL(t);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(r,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),r[o](s));n();const i=Reflect.get(r,o);return typeof i=="function"?i.bind(r):i}}),enumerable:!0,configurable:!0});for(const r of fe)Object.defineProperty(a,r,{get(){return n(),t[r]},enumerable:!0,configurable:!0});return a}const de="/__data.json",he=".html__data.json";function pe(t){return t.endsWith(".html")?t.replace(/\.html$/,he):t.replace(/\/$/,"")+de}function ge(...t){let n=5381;for(const e of t)if(typeof e=="string"){let a=e.length;for(;a;)n=n*33^e.charCodeAt(--a)}else if(ArrayBuffer.isView(e)){const a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let r=a.length;for(;r;)n=n*33^a[--r]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function me(t){const n=atob(t),e=new Uint8Array(n.length);for(let a=0;a((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&G.delete(gt(t)),jt(t,n));const G=new Map;function _e(t,n){const e=gt(t,n),a=document.querySelector(e);if(a!=null&&a.textContent){let{body:r,...o}=JSON.parse(a.textContent);const i=a.getAttribute("data-ttl");return i&&G.set(e,{body:r,init:o,ttl:1e3*Number(i)}),a.getAttribute("data-b64")!==null&&(r=me(r)),Promise.resolve(new Response(r,o))}return window.fetch(t,n)}function ye(t,n,e){if(G.size>0){const a=gt(t,e),r=G.get(a);if(r){if(performance.now(){const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(a);if(r)return n.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(a);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!a)return;const i=a.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return lt(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return lt(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=we.exec(c),[,h,g,d,_]=u;return n.push({name:d,matcher:_,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return lt(c)}).join("")}).join("")}/?$`),params:n}}function be(t){return!/^\([^)]+\)$/.test(t)}function Ee(t){return t.slice(1).split("/").filter(be)}function ke(t,n,e){const a={},r=t.slice(1),o=r.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(a[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){a[c.name]=f;const u=n[s+1],h=r[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(a).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return a}function lt(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Se({nodes:t,server_loads:n,dictionary:e,matchers:a}){const r=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ve(s),d={id:s,exec:_=>{const l=h.exec(_);if(l)return ke(l,g,a)},errors:[1,...u||[]].map(_=>t[_]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[r.has(s),t[s]]}}function Dt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function It(t,n,e=JSON.stringify){const a=e(n);try{sessionStorage[t]=a}catch{}}const Ae="1718035516809",$t="sveltekit:snapshot",Ct="sveltekit:scroll",Vt="sveltekit:states",Re="sveltekit:pageurl",D="sveltekit:history",q="sveltekit:navigation",Y={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},K=location.origin;function Ft(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function mt(){return{x:pageXOffset,y:pageYOffset}}function O(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Lt={...Y,"":Y.hover};function Gt(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Mt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Gt(t)}}function ut(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,r=!e||!!a||nt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===K&&t.hasAttribute("download");return{url:e,external:r,target:a,download:o}}function W(t){let n=null,e=null,a=null,r=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)a===null&&(a=O(s,"preload-code")),r===null&&(r=O(s,"preload-data")),n===null&&(n=O(s,"keepfocus")),e===null&&(e=O(s,"noscroll")),o===null&&(o=O(s,"reload")),i===null&&(i=O(s,"replacestate")),s=Gt(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Lt[a??"off"],preload_data:Lt[r??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function Pt(t){const n=pt(t);let e=!0;function a(){e=!0,n.update(i=>i)}function r(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:a,set:r,subscribe:o}}function Ie(){const{set:t,subscribe:n}=pt(!1);let e;async function a(){clearTimeout(e);try{const r=await fetch(`${se}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const i=(await r.json()).version!==Ae;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:a}}function nt(t,n){return t.origin!==K||!t.pathname.startsWith(n)}const Le=-1,Pe=-2,Ue=-3,xe=-4,Te=-5,Ne=-6;function Oe(t,n){if(typeof t=="number")return r(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,a=Array(e.length);function r(o,i=!1){if(o===Le)return;if(o===Ue)return NaN;if(o===xe)return 1/0;if(o===Te)return-1/0;if(o===Ne)return-0;if(i)throw new Error("Invalid input");if(o in a)return a[o];const s=e[o];if(!s||typeof s!="object")a[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return a[o]=f(r(s[1]));switch(c){case"Date":a[o]=new Date(s[1]);break;case"Set":const u=new Set;a[o]=u;for(let d=1;dn!=null)}class at{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class Ht{constructor(n,e){this.status=n,this.location=e}}class _t extends Error{constructor(n,e,a){super(a),this.status=n,this.text=e}}const $e="x-sveltekit-invalidated",Ce="x-sveltekit-trailing-slash";function z(t){return t instanceof at||t instanceof _t?t.status:500}function Ve(t){return t instanceof _t?t.text:"Internal Error"}const N=Dt(Ct)??{},H=Dt($t)??{},x={url:Pt({}),page:Pt({}),navigating:pt(null),updated:Ie()};function yt(t){N[t]=mt()}function Fe(t,n){let e=t+1;for(;N[e];)delete N[e],e+=1;for(e=n+1;H[e];)delete H[e],e+=1}function C(t){return location.href=t.href,new Promise(()=>{})}function Ut(){}let rt,dt,X,U,ht,V;const Bt=[],Z=[];let R=null;const Kt=[],Ge=[];let j=[],y={branch:[],error:null,url:null},wt=!1,Q=!1,xt=!0,B=!1,F=!1,Jt=!1,vt=!1,bt,S,L,I,tt;const M=new Set;async function Qe(t,n,e){var r,o;document.URL!==location.href&&(location.href=location.href),V=t,rt=Se(t),U=document.documentElement,ht=n,dt=t.nodes[0],X=t.nodes[1],dt(),X(),S=(r=history.state)==null?void 0:r[D],L=(o=history.state)==null?void 0:o[q],S||(S=L=Date.now(),history.replaceState({...history.state,[D]:S,[q]:L},""));const a=N[S];a&&(history.scrollRestoration="manual",scrollTo(a.x,a.y)),e?await We(ht,e):Je(location.href,{replaceState:!0}),Ye()}function Me(){Bt.length=0,vt=!1}function Yt(t){Z.some(n=>n==null?void 0:n.snapshot)&&(H[t]=Z.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function Wt(t){var n;(n=H[t])==null||n.forEach((e,a)=>{var r,o;(o=(r=Z[a])==null?void 0:r.snapshot)==null||o.restore(e)})}function Tt(){yt(S),It(Ct,N),Yt(L),It($t,H)}async function zt(t,n,e,a){return J({type:"goto",url:Ft(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:a,accept:()=>{n.invalidateAll&&(vt=!0)}})}async function qe(t){if(t.id!==(R==null?void 0:R.id)){const n={};M.add(n),R={id:t.id,token:n,promise:Zt({...t,preload:n}).then(e=>(M.delete(n),e.type==="loaded"&&e.state.error&&(R=null),e))}}return R.promise}async function ft(t){const n=rt.find(e=>e.exec(Qt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function Xt(t,n,e){var o;y=t.state;const a=document.querySelector("style[data-sveltekit]");a&&a.remove(),I=t.props.page,bt=new V.root({target:n,props:{...t.props,stores:x,components:Z},hydrate:e}),Wt(L);const r={from:null,to:{params:y.params,route:{id:((o=y.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};j.forEach(i=>i(r)),Q=!0}async function et({url:t,params:n,branch:e,status:a,error:r,route:o,form:i}){let s="never";if(P&&(t.pathname===P||t.pathname===P+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=ie(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:r,route:o},props:{constructors:De(e).map(d=>d.node.component),page:I}};i!==void 0&&(c.props.form=i);let f={},u=!I,h=0;for(let d=0;d(s&&(c.route=!0),l[m])}),params:new Proxy(a,{get:(l,m)=>(s&&c.params.add(m),l[m])}),data:(o==null?void 0:o.data)??null,url:ue(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,m){let b;l instanceof Request?(b=l.url,m={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,...m}):b=l;const A=new URL(b,e);return s&&d(A.href),A.origin===e.origin&&(b=A.href.slice(e.origin.length)),Q?ye(b,A.href,m):_e(b,m)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,_)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Nt(t,n,e,a,r,o){if(vt)return!0;if(!r)return!1;if(r.parent&&t||r.route&&n||r.url&&e)return!0;for(const i of r.search_params)if(a.has(i))return!0;for(const i of r.params)if(o[i]!==y.params[i])return!0;for(const i of r.dependencies)if(Bt.some(s=>s(new URL(i))))return!0;return!1}function kt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function He(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const a of e){const r=t.searchParams.getAll(a),o=n.searchParams.getAll(a);r.every(i=>o.includes(i))&&o.every(i=>r.includes(i))&&e.delete(a)}return e}function Ot({error:t,url:n,route:e,params:a}){return{type:"loaded",state:{error:t,url:n,route:e,params:a,branch:[]},props:{page:I,constructors:[]}}}async function Zt({id:t,invalidating:n,url:e,params:a,route:r,preload:o}){if((R==null?void 0:R.id)===t)return M.delete(R.token),R.promise;const{errors:i,layouts:s,leaf:c}=r,f=[...s,c];i.forEach(p=>p==null?void 0:p().catch(()=>{})),f.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let u=null;const h=y.url?t!==y.url.pathname+y.url.search:!1,g=y.route?r.id!==y.route.id:!1,d=He(y.url,e);let _=!1;const l=f.map((p,v)=>{var T;const E=y.branch[v],k=!!(p!=null&&p[0])&&((E==null?void 0:E.loader)!==p[1]||Nt(_,g,h,d,(T=E.server)==null?void 0:T.uses,a));return k&&(_=!0),k});if(l.some(Boolean)){try{u=await ne(e,l)}catch(p){const v=await $(p,{url:e,params:a,route:{id:t}});return M.has(o)?Ot({error:v,url:e,params:a,route:r}):ot({status:z(p),error:v,url:e,route:r})}if(u.type==="redirect")return u}const m=u==null?void 0:u.nodes;let b=!1;const A=f.map(async(p,v)=>{var st;if(!p)return;const E=y.branch[v],k=m==null?void 0:m[v];if((!k||k.type==="skip")&&p[1]===(E==null?void 0:E.loader)&&!Nt(b,g,h,d,(st=E.universal)==null?void 0:st.uses,a))return E;if(b=!0,(k==null?void 0:k.type)==="error")throw k;return Et({loader:p[1],url:e,params:a,route:r,parent:async()=>{var Rt;const At={};for(let it=0;it{});const w=[];for(let p=0;pPromise.resolve({}),server_data_node:kt(o)}),c={node:await X(),loader:X,universal:null,server:null,data:null};return await et({url:e,params:r,branch:[s,c],status:t,error:n,route:null})}function St(t,n){if(!t||nt(t,P))return;let e;try{e=V.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const a=Qt(e);for(const r of rt){const o=r.exec(a);if(o)return{id:t.pathname+t.search,invalidating:n,route:r,params:le(o),url:t}}}function Qt(t){return ce(t.slice(P.length)||"/")}function te({url:t,type:n,intent:e,delta:a}){let r=!1;const o=re(y,e,t,n);a!==void 0&&(o.navigation.delta=a);const i={...o.navigation,cancel:()=>{r=!0,o.reject(new Error("navigation cancelled"))}};return B||Kt.forEach(s=>s(i)),r?null:o}async function J({type:t,url:n,popped:e,keepfocus:a,noscroll:r,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Ut,block:u=Ut}){const h=St(n,!1),g=te({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=S,_=L;f(),B=!0,Q&&x.navigating.set(g.navigation),tt=c;let l=h&&await Zt(h);if(!l){if(nt(n,P))return await C(n);l=await ee(n,{id:null},await $(new _t(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,tt!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await ot({status:500,error:await $(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return zt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await x.updated.check()&&await C(n);if(Me(),yt(d),Yt(_),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const w=o?0:1,p={[D]:S+=w,[q]:L+=w,[Vt]:i};(o?history.replaceState:history.pushState).call(history,p,"",n),o||Fe(S,L)}if(R=null,l.props.page.state=i,Q){y=l.state,l.props.page&&(l.props.page.url=n);const w=(await Promise.all(Ge.map(p=>p(g.navigation)))).filter(p=>typeof p=="function");if(w.length>0){let p=function(){j=j.filter(v=>!w.includes(v))};w.push(p),j.push(...w)}bt.$set(l.props),Jt=!0}else Xt(l,ht,!1);const{activeElement:m}=document;await oe();const b=e?e.scroll:r?mt():null;if(xt){const w=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));b?scrollTo(b.x,b.y):w?w.scrollIntoView():scrollTo(0,0)}const A=document.activeElement!==m&&document.activeElement!==document.body;!a&&!A&&ze(),xt=!0,l.props.page&&(I=l.props.page),B=!1,t==="popstate"&&Wt(L),g.fulfil(void 0),j.forEach(w=>w(g.navigation)),x.navigating.set(null)}async function ee(t,n,e,a){return t.origin===K&&t.pathname===location.pathname&&!wt?await ot({status:a,error:e,url:t,route:n}):await C(t)}function Ke(){let t;U.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{a(i,2)},20)});function n(o){a(o.composedPath()[0],1)}U.addEventListener("mousedown",n),U.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ft(i.target.href),e.unobserve(i.target))},{threshold:0});function a(o,i){const s=Mt(o,U);if(!s)return;const{url:c,external:f,download:u}=ut(s,P);if(f||u)return;const h=W(s);if(!h.reload)if(i<=h.preload_data){const g=St(c,!1);g&&qe(g)}else i<=h.preload_code&&ft(c.pathname)}function r(){e.disconnect();for(const o of U.querySelectorAll("a")){const{url:i,external:s,download:c}=ut(o,P);if(s||c)continue;const f=W(o);f.reload||(f.preload_code===Y.viewport&&e.observe(o),f.preload_code===Y.eager&&ft(i.pathname))}}j.push(r),r()}function $(t,n){if(t instanceof at)return t.body;const e=z(t),a=Ve(t);return V.hooks.handleError({error:t,event:n,status:e,message:a})??{message:a}}function Je(t,n={}){return t=Ft(t),t.origin!==K?Promise.reject(new Error("goto: invalid URL")):zt(t,n,0)}function Ye(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let a=!1;if(Tt(),!B){const r=re(y,void 0,null,"leave"),o={...r.navigation,cancel:()=>{a=!0,r.reject(new Error("navigation cancelled"))}};Kt.forEach(i=>i(o))}a?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Tt()}),(n=navigator.connection)!=null&&n.saveData||Ke(),U.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const a=Mt(e.composedPath()[0],U);if(!a)return;const{url:r,external:o,target:i,download:s}=ut(a,P);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=W(a);if(!(a instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;if(o||c.reload){te({url:r,type:"link"})?B=!0:e.preventDefault();return}const[u,h]=r.href.split("#");if(h!==void 0&&u===ct(location)){const[,d]=y.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&a.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=a.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(F=!0,yt(S),t(r),!c.replace_state)return;F=!1}e.preventDefault(),J({type:"link",url:r,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??r.href===location.href})}),U.addEventListener("submit",e=>{if(e.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(e.target),r=e.submitter;if(((r==null?void 0:r.formMethod)||a.method)!=="get")return;const i=new URL((r==null?void 0:r.hasAttribute("formaction"))&&(r==null?void 0:r.formAction)||a.action);if(nt(i,P))return;const s=e.target,c=W(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=r==null?void 0:r.getAttribute("name");u&&f.append(u,(r==null?void 0:r.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),J({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var a;if((a=e.state)!=null&&a[D]){const r=e.state[D];if(tt={},r===S)return;const o=N[r],i=e.state[Vt]??{},s=new URL(e.state[Re]??location.href),c=e.state[q],f=ct(location)===ct(y.url);if(c===L&&(Jt||f)){t(s),N[S]=mt(),o&&scrollTo(o.x,o.y),i!==I.state&&(I={...I,state:i},bt.$set({page:I})),S=r;return}const h=r-S;await J({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{S=r,L=c},block:()=>{history.go(-h)},nav_token:tt})}else if(!F){const r=new URL(location.href);t(r)}}),addEventListener("hashchange",()=>{F&&(F=!1,history.replaceState({...history.state,[D]:++S,[q]:L},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&x.navigating.set(null)});function t(e){y.url=e,x.page.set({...I,url:e}),x.page.notify()}}async function We(t,{status:n=200,error:e,node_ids:a,params:r,route:o,data:i,form:s}){wt=!0;const c=new URL(location.href);({params:r={},route:o={id:null}}=St(c,!1)||{});let f;try{const u=a.map(async(d,_)=>{const l=i[_];return l!=null&&l.uses&&(l.uses=ae(l.uses)),Et({loader:V.nodes[d],url:c,params:r,route:o,parent:async()=>{const m={};for(let b=0;b<_;b+=1)Object.assign(m,(await u[b]).data);return m},server_data_node:kt(l)})}),h=await Promise.all(u),g=rt.find(({id:d})=>d===o.id);if(g){const d=g.layouts;for(let _=0;_o?"1":"0").join(""));const a=await jt(e.href);if(!a.ok){let o;throw(r=a.headers.get("content-type"))!=null&&r.includes("application/json")?o=await a.json():a.status===404?o="Not Found":a.status===500&&(o="Internal Error"),new at(a.status,o)}return new Promise(async o=>{var h;const i=new Map,s=a.body.getReader(),c=new TextDecoder;function f(g){return Oe(g,{Promise:d=>new Promise((_,l)=>{i.set(d,{fulfil:_,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` +`:c.decode(d,{stream:!0});;){const _=u.indexOf(` +`);if(_===-1)break;const l=JSON.parse(u.slice(0,_));if(u=u.slice(_+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(m=>{(m==null?void 0:m.type)==="data"&&(m.uses=ae(m.uses),m.data=f(m.data))}),o(l);else if(l.type==="chunk"){const{id:m,data:b,error:A}=l,w=i.get(m);i.delete(m),A?w.reject(f(A)):w.fulfil(f(b))}}}})}function ae(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function ze(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const a=getSelection();if(a&&a.type!=="None"){const r=[];for(let o=0;o{if(a.rangeCount===r.length){for(let o=0;o{r=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:a,complete:i},fulfil:r,reject:o}}export{Qe as a,Je as g,x as s}; diff --git a/_app/immutable/chunks/index.BA8N6X1u.js b/_app/immutable/chunks/index.BA8N6X1u.js new file mode 100644 index 0000000..21ea53c --- /dev/null +++ b/_app/immutable/chunks/index.BA8N6X1u.js @@ -0,0 +1,47 @@ +import{n as fe,s as Ke,T as k,t as P,a as g,o as Y,R as Ur,p as H,y as ae}from"./index.WvR92-IP.js";import{i as jr}from"./2.DEesTFv4.js";/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Qe=window,jt=Qe.ShadowRoot&&(Qe.ShadyCSS===void 0||Qe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ht=Symbol(),Vt=new WeakMap;let yr=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(jt&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=Vt.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Vt.set(r,e))}return e}toString(){return this.cssText}};const Hr=t=>new yr(typeof t=="string"?t:t+"",void 0,Ht),C=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,o,n)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+t[n+1],t[0]);return new yr(r,t,Ht)},Br=(t,e)=>{jt?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),o=Qe.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=r.cssText,t.appendChild(i)})},Ft=jt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return Hr(r)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var rt;const Ye=window,qt=Ye.trustedTypes,Zr=qt?qt.emptyScript:"",Kt=Ye.reactiveElementPolyfillSupport,Lt={toAttribute(t,e){switch(e){case Boolean:t=t?Zr:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},xr=(t,e)=>e!==t&&(e==e||t==t),ot={attribute:!0,type:String,converter:Lt,reflect:!1,hasChanged:xr},Pt="finalized";let ue=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const o=this._$Ep(i,r);o!==void 0&&(this._$Ev.set(o,i),e.push(o))}),e}static createProperty(e,r=ot){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,i,r);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(o){const n=this[e];this[r]=o,this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ot}static finalize(){if(this.hasOwnProperty(Pt))return!1;this[Pt]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const o of i)this.createProperty(o,r[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)r.unshift(Ft(o))}else e!==void 0&&r.push(Ft(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Br(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=ot){var o;const n=this.constructor._$Ep(e,i);if(n!==void 0&&i.reflect===!0){const a=(((o=i.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?i.converter:Lt).toAttribute(r,i.type);this._$El=e,a==null?this.removeAttribute(n):this.setAttribute(n,a),this._$El=null}}_$AK(e,r){var i;const o=this.constructor,n=o._$Ev.get(e);if(n!==void 0&&this._$El!==n){const a=o.getPropertyOptions(n),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:Lt;this._$El=n,this[n]=l.fromAttribute(r,a.type),this._$El=null}}requestUpdate(e,r,i){let o=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||xr)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((o,n)=>this[n]=o),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(o=>{var n;return(n=o.hostUpdate)===null||n===void 0?void 0:n.call(o)}),this.update(i)):this._$Ek()}catch(o){throw r=!1,this._$Ek(),o}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var o;return(o=i.hostUpdated)===null||o===void 0?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};ue[Pt]=!0,ue.elementProperties=new Map,ue.elementStyles=[],ue.shadowRootOptions={mode:"open"},Kt==null||Kt({ReactiveElement:ue}),((rt=Ye.reactiveElementVersions)!==null&&rt!==void 0?rt:Ye.reactiveElementVersions=[]).push("1.6.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var it;const Ge=window,be=Ge.trustedTypes,Qt=be?be.createPolicy("lit-html",{createHTML:t=>t}):void 0,Wt="$lit$",Q=`lit$${(Math.random()+"").slice(9)}$`,$r="?"+Q,zr=`<${$r}>`,le=document,Se=()=>le.createComment(""),Le=t=>t===null||typeof t!="object"&&typeof t!="function",Cr=Array.isArray,Vr=t=>Cr(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",nt=`[ +\f\r]`,Ce=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yt=/-->/g,Gt=/>/g,ee=RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Xt=/'/g,Jt=/"/g,Ar=/^(?:script|style|textarea|title)$/i,_r=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),s=_r(1),E=_r(2),se=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),er=new WeakMap,ie=le.createTreeWalker(le,129,null,!1);function Er(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Qt!==void 0?Qt.createHTML(e):e}const Fr=(t,e)=>{const r=t.length-1,i=[];let o,n=e===2?"":"",a=Ce;for(let l=0;l"?(a=o??Ce,$=-1):x[1]===void 0?$=-2:($=a.lastIndex-x[2].length,d=x[1],a=x[3]===void 0?ee:x[3]==='"'?Jt:Xt):a===Jt||a===Xt?a=ee:a===Yt||a===Gt?a=Ce:(a=ee,o=void 0);const _=a===ee&&t[l+1].startsWith("/>")?" ":"";n+=a===Ce?c+zr:$>=0?(i.push(d),c.slice(0,$)+Wt+c.slice($)+Q+_):c+Q+($===-2?(i.push(void 0),l):_)}return[Er(t,n+(t[r]||"")+(e===2?"":"")),i]};class Pe{constructor({strings:e,_$litType$:r},i){let o;this.parts=[];let n=0,a=0;const l=e.length-1,c=this.parts,[d,x]=Fr(e,r);if(this.el=Pe.createElement(d,i),ie.currentNode=this.el.content,r===2){const $=this.el.content,m=$.firstChild;m.remove(),$.append(...m.childNodes)}for(;(o=ie.nextNode())!==null&&c.length0){o.textContent=be?be.emptyScript:"";for(let _=0;_2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=M}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,o){const n=this.strings;let a=!1;if(n===void 0)e=ye(this,e,r,0),a=!Le(e)||e!==this._$AH&&e!==se,a&&(this._$AH=e);else{const l=e;let c,d;for(e=n[0],c=0;c{var i,o;const n=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:e;let a=n._$litPart$;if(a===void 0){const l=(o=r==null?void 0:r.renderBefore)!==null&&o!==void 0?o:null;n._$litPart$=a=new Ne(e.insertBefore(Se(),l),l,void 0,r??{})}return a._$AI(t),a};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var at,lt;class w extends ue{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Jr(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return se}}w.finalized=!0,w._$litElement$=!0,(at=globalThis.litElementHydrateSupport)===null||at===void 0||at.call(globalThis,{LitElement:w});const rr=globalThis.litElementPolyfillSupport;rr==null||rr({LitElement:w});((lt=globalThis.litElementVersions)!==null&<!==void 0?lt:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const y=t=>e=>typeof e=="function"?((r,i)=>(customElements.define(r,i),i))(t,e):((r,i)=>{const{kind:o,elements:n}=i;return{kind:o,elements:n,finisher(a){customElements.define(r,a)}}})(t,e);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const eo=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},to=(t,e,r)=>{e.constructor.createProperty(r,t)};function p(t){return(e,r)=>r!==void 0?to(t,e,r):eo(t,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function W(t){return p({...t,state:!0})}/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var st;((st=window.HTMLSlotElement)===null||st===void 0?void 0:st.prototype.assignedElements)!=null;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ro={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},oo=t=>(...e)=>({_$litDirective$:t,values:e});class io{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Z=oo(class extends io{constructor(t){var e;if(super(t),t.type!==ro.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,i;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in e)e[n]&&!(!((r=this.nt)===null||r===void 0)&&r.has(n))&&this.it.add(n);return this.render(e)}const o=t.element.classList;this.it.forEach(n=>{n in e||(o.remove(n),this.it.delete(n))});for(const n in e){const a=!!e[n];a===this.it.has(n)||!((i=this.nt)===null||i===void 0)&&i.has(n)||(a?(o.add(n),this.it.add(n)):(o.remove(n),this.it.delete(n)))}return se}});function no(t,e){t.indexOf(e)===-1&&t.push(e)}const kr=(t,e,r)=>Math.min(Math.max(r,t),e),D={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Xe=t=>typeof t=="number",we=t=>Array.isArray(t)&&!Xe(t[0]),ao=(t,e,r)=>{const i=e-t;return((r-t)%i+i)%i+t};function lo(t,e){return we(t)?t[ao(0,t.length,e)]:t}const Or=(t,e,r)=>-r*t+r*e+t,Ir=()=>{},G=t=>t,Bt=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function Tr(t,e){const r=t[t.length-1];for(let i=1;i<=e;i++){const o=Bt(0,e,i);t.push(Or(r,1,o))}}function so(t){const e=[0];return Tr(e,t-1),e}function co(t,e=so(t.length),r=G){const i=t.length,o=i-e.length;return o>0&&Tr(e,o),n=>{let a=0;for(;aArray.isArray(t)&&Xe(t[0]),Nt=t=>typeof t=="object"&&!!t.createAnimation,xe=t=>typeof t=="function",ho=t=>typeof t=="string",Re={ms:t=>t*1e3,s:t=>t/1e3},Rr=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,mo=1e-7,po=12;function uo(t,e,r,i,o){let n,a,l=0;do a=e+(r-e)/2,n=Rr(a,i,o)-t,n>0?r=a:e=a;while(Math.abs(n)>mo&&++luo(n,0,1,t,r);return n=>n===0||n===1?n:Rr(o(n),e,i)}const go=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const i=r*t,o=e==="end"?Math.floor(i):Math.ceil(i);return kr(0,1,o/t)},or={ease:Me(.25,.1,.25,1),"ease-in":Me(.42,0,1,1),"ease-in-out":Me(.42,0,.58,1),"ease-out":Me(0,0,.58,1)},wo=/\((.*?)\)/;function ir(t){if(xe(t))return t;if(Mr(t))return Me(...t);if(or[t])return or[t];if(t.startsWith("steps")){const e=wo.exec(t);if(e){const r=e[1].split(",");return go(parseFloat(r[0]),r[1].trim())}}return G}class Sr{constructor(e,r=[0,1],{easing:i,duration:o=D.duration,delay:n=D.delay,endDelay:a=D.endDelay,repeat:l=D.repeat,offset:c,direction:d="normal",autoplay:x=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=G,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((m,_)=>{this.resolve=m,this.reject=_}),i=i||D.easing,Nt(i)){const m=i.createAnimation(r);i=m.easing,r=m.keyframes||r,o=m.duration||o}this.repeat=l,this.easing=we(i)?G:ir(i),this.updateDuration(o);const $=co(r,c,we(i)?i.map(ir):G);this.tick=m=>{var _;n=n;let f=0;this.pauseTime!==void 0?f=this.pauseTime:f=(m-this.startTime)*this.rate,this.t=f,f/=1e3,f=Math.max(f-n,0),this.playState==="finished"&&this.pauseTime===void 0&&(f=this.totalDuration);const u=f/this.duration;let I=Math.floor(u),b=u%1;!b&&u>=1&&(b=1),b===1&&I--;const R=I%2;(d==="reverse"||d==="alternate"&&R||d==="alternate-reverse"&&!R)&&(b=1-b);const S=f>=this.totalDuration?1:Math.min(b,1),N=$(this.easing(S));e(N),this.pauseTime===void 0&&(this.playState==="finished"||f>=this.totalDuration+a)?(this.playState="finished",(_=this.resolve)===null||_===void 0||_.call(this,N)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},x&&this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}class vo{setAnimation(e){this.animation=e,e==null||e.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const ct=new WeakMap;function Lr(t){return ct.has(t)||ct.set(t,{transforms:[],values:new Map}),ct.get(t)}function fo(t,e){return t.has(e)||t.set(e,new vo),t.get(e)}const bo=["","X","Y","Z"],yo=["translate","scale","rotate","skew"],Je={x:"translateX",y:"translateY",z:"translateZ"},nr={syntax:"",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},xo={translate:{syntax:"",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:nr,scale:{syntax:"",initialValue:1,toDefaultUnit:G},skew:nr},We=new Map,Zt=t=>`--motion-${t}`,et=["x","y","z"];yo.forEach(t=>{bo.forEach(e=>{et.push(t+e),We.set(Zt(t+e),xo[t])})});const $o=(t,e)=>et.indexOf(t)-et.indexOf(e),Co=new Set(et),Pr=t=>Co.has(t),Ao=(t,e)=>{Je[e]&&(e=Je[e]);const{transforms:r}=Lr(t);no(r,e),t.style.transform=_o(r)},_o=t=>t.sort($o).reduce(Eo,"").trim(),Eo=(t,e)=>`${t} ${e}(var(${Zt(e)}))`,Dt=t=>t.startsWith("--"),ar=new Set;function ko(t){if(!ar.has(t)){ar.add(t);try{const{syntax:e,initialValue:r}=We.has(t)?We.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const dt=(t,e)=>document.createElement("div").animate(t,e),lr={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{dt({opacity:[1]})}catch{return!1}return!0},finished:()=>!!dt({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{dt({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},ht={},ge={};for(const t in lr)ge[t]=()=>(ht[t]===void 0&&(ht[t]=lr[t]()),ht[t]);const Oo=.015,Io=(t,e)=>{let r="";const i=Math.round(e/Oo);for(let o=0;oxe(t)?ge.linearEasing()?`linear(${Io(t,e)})`:D.easing:Mr(t)?To(t):t,To=([t,e,r,i])=>`cubic-bezier(${t}, ${e}, ${r}, ${i})`;function Mo(t,e){for(let r=0;rArray.isArray(t)?t:[t];function Ut(t){return Je[t]&&(t=Je[t]),Pr(t)?Zt(t):t}const je={get:(t,e)=>{e=Ut(e);let r=Dt(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const i=We.get(e);i&&(r=i.initialValue)}return r},set:(t,e,r)=>{e=Ut(e),Dt(e)?t.style.setProperty(e,r):t.style[e]=r}};function Wr(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function So(t,e){var r;let i=(e==null?void 0:e.toDefaultUnit)||G;const o=t[t.length-1];if(ho(o)){const n=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";n&&(i=a=>a+n)}return i}function Lo(){return window.__MOTION_DEV_TOOLS_RECORD}function Po(t,e,r,i={},o){const n=Lo(),a=i.record!==!1&&n;let l,{duration:c=D.duration,delay:d=D.delay,endDelay:x=D.endDelay,repeat:$=D.repeat,easing:m=D.easing,persist:_=!1,direction:f,offset:u,allowWebkitAcceleration:I=!1,autoplay:b=!0}=i;const R=Lr(t),S=Pr(e);let N=ge.waapi();S&&Ao(t,e);const U=Ut(e),De=fo(R.values,U),z=We.get(U);return Wr(De.animation,!(Nt(m)&&De.generator)&&i.record!==!1),()=>{const Ue=()=>{var O,$e;return($e=(O=je.get(t,U))!==null&&O!==void 0?O:z==null?void 0:z.initialValue)!==null&&$e!==void 0?$e:0};let T=Mo(Ro(r),Ue);const zt=So(T,z);if(Nt(m)){const O=m.createAnimation(T,e!=="opacity",Ue,U,De);m=O.easing,T=O.keyframes||T,c=O.duration||c}if(Dt(U)&&(ge.cssRegisterProperty()?ko(U):N=!1),S&&!ge.linearEasing()&&(xe(m)||we(m)&&m.some(xe))&&(N=!1),N){z&&(T=T.map(J=>Xe(J)?z.toDefaultUnit(J):J)),T.length===1&&(!ge.partialKeyframes()||a)&&T.unshift(Ue());const O={delay:Re.ms(d),duration:Re.ms(c),endDelay:Re.ms(x),easing:we(m)?void 0:sr(m,c),direction:f,iterations:$+1,fill:"both"};l=t.animate({[U]:T,offset:u,easing:we(m)?m.map(J=>sr(J,c)):void 0},O),l.finished||(l.finished=new Promise((J,Dr)=>{l.onfinish=J,l.oncancel=Dr}));const $e=T[T.length-1];l.finished.then(()=>{_||(je.set(t,U,$e),l.cancel())}).catch(Ir),I||(l.playbackRate=1.000001)}else if(o&&S)T=T.map(O=>typeof O=="string"?parseFloat(O):O),T.length===1&&T.unshift(parseFloat(Ue())),l=new o(O=>{je.set(t,U,zt?zt(O):O)},T,Object.assign(Object.assign({},i),{duration:c,easing:m}));else{const O=T[T.length-1];je.set(t,U,z&&Xe(O)?z.toDefaultUnit(O):O)}return a&&n(t,e,T,{duration:c,delay:d,easing:m,repeat:$,offset:u},"motion-one"),De.setAnimation(l),l&&!b&&l.pause(),l}}const Wo=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function No(t,e){return typeof t=="string"?t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Do=t=>t(),Nr=(t,e,r=D.duration)=>new Proxy({animations:t.map(Do).filter(Boolean),duration:r,options:e},jo),Uo=t=>t.animations[0],jo={get:(t,e)=>{const r=Uo(t);switch(e){case"duration":return t.duration;case"currentTime":return Re.s((r==null?void 0:r[e])||0);case"playbackRate":case"playState":return r==null?void 0:r[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Ho)).catch(Ir)),t.finished;case"stop":return()=>{t.animations.forEach(i=>Wr(i))};case"forEachNative":return i=>{t.animations.forEach(o=>i(o,t))};default:return typeof(r==null?void 0:r[e])>"u"?void 0:()=>t.animations.forEach(i=>i[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=Re.ms(r);case"playbackRate":for(let i=0;it.finished;function Bo(t,e,r){return xe(t)?t(e,r):t}function Zo(t){return function(r,i,o={}){r=No(r);const n=r.length,a=[];for(let l=0;l{const r=new Sr(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ne(t,e,r){return(xe(t)?Vo:zo)(t,e,r)}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const L=t=>t??M;var Fo=Object.defineProperty,cr=Object.getOwnPropertySymbols,qo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,dr=(t,e,r)=>e in t?Fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mt=(t,e)=>{for(var r in e||(e={}))qo.call(e,r)&&dr(t,r,e[r]);if(cr)for(var r of cr(e))Ko.call(e,r)&&dr(t,r,e[r]);return t};function Qo(){var t;const e=(t=fe.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function hr(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const v={getPreset(t){return hr()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=fe.state;if(t){const r=mt(mt(mt({},Qo()),hr()),e);Object.entries(r).forEach(([i,o])=>t.style.setProperty(i,o))}},globalCss:C`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},Yo=C`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var Go=Object.defineProperty,Xo=Object.getOwnPropertyDescriptor,ce=(t,e,r,i)=>{for(var o=i>1?void 0:i?Xo(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Go(e,r,o),o};let V=class extends w{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),s``}};V.styles=[v.globalCss,Yo],ce([p({type:Boolean})],V.prototype,"disabled",2),ce([p()],V.prototype,"iconLeft",2),ce([p()],V.prototype,"iconRight",2),ce([p()],V.prototype,"onClick",2),ce([p()],V.prototype,"variant",2),V=ce([y("wcm-button")],V);const Jo=C`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var ei=Object.defineProperty,ti=Object.getOwnPropertyDescriptor,pt=(t,e,r,i)=>{for(var o=i>1?void 0:i?ti(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ei(e,r,o),o};let Ae=class extends w{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"wcm-secondary":this.variant==="secondary"};return s``}};Ae.styles=[v.globalCss,Jo],pt([p({type:Boolean})],Ae.prototype,"disabled",2),pt([p()],Ae.prototype,"variant",2),Ae=pt([y("wcm-button-big")],Ae);const ri=C`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var oi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let ut=class extends w{render(){return s`
`}};ut.styles=[v.globalCss,ri],ut=oi([y("wcm-info-footer")],ut);const A={CROSS_ICON:E``,WALLET_CONNECT_LOGO:E``,WALLET_CONNECT_ICON:E``,WALLET_CONNECT_ICON_COLORED:E``,BACK_ICON:E``,COPY_ICON:E``,RETRY_ICON:E``,DESKTOP_ICON:E``,MOBILE_ICON:E``,ARROW_DOWN_ICON:E``,ARROW_UP_RIGHT_ICON:E``,ARROW_RIGHT_ICON:E``,QRCODE_ICON:E``,SCAN_ICON:E``,CHECKMARK_ICON:E``,SEARCH_ICON:E``,WALLET_PLACEHOLDER:E``,GLOBE_ICON:E``},ii=C`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var ni=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let gt=class extends w{render(){return s`
${A.WALLET_CONNECT_LOGO}
`}};gt.styles=[v.globalCss,ii],gt=ni([y("wcm-modal-backcard")],gt);const ai=C`main{padding:20px;padding-top:0;width:100%}`;var li=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let wt=class extends w{render(){return s`
`}};wt.styles=[v.globalCss,ai],wt=li([y("wcm-modal-content")],wt);const si=C`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var ci=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let vt=class extends w{render(){return s`
`}};vt.styles=[v.globalCss,si],vt=ci([y("wcm-modal-footer")],vt);const di=C`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var hi=Object.defineProperty,mi=Object.getOwnPropertyDescriptor,_e=(t,e,r,i)=>{for(var o=i>1?void 0:i?mi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&hi(e,r,o),o};let te=class extends w{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return s``}actionBtnTemplate(){return s``}render(){const t={"wcm-border":this.border},e=k.state.history.length>1,r=this.title?s`${this.title}`:s``;return s`
${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};te.styles=[v.globalCss,di],_e([p()],te.prototype,"title",2),_e([p()],te.prototype,"onAction",2),_e([p()],te.prototype,"actionIcon",2),_e([p({type:Boolean})],te.prototype,"border",2),te=_e([y("wcm-modal-header")],te);const h={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=ae.state;return r!=null&&r[t]?r[t]:e?P.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},isMobileAnimation(){return window.innerWidth<=h.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,i)=>{const o=new Image;o.onload=r,o.onerror=i,o.crossOrigin="anonymous",o.src=t});return Promise.race([e,g.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...i)=>{function o(){t(...i)}r&&clearTimeout(r),r=setTimeout(o,e)}},handleMobileLinking(t){const{walletConnectUri:e}=H.state,{mobile:r,name:i}=t,o=r==null?void 0:r.native,n=r==null?void 0:r.universal;h.setRecentWallet(t);function a(l){let c="";o?c=g.formatUniversalUrl(o,l,i):n&&(c=g.formatNativeUrl(n,l,i)),g.openHref(c,"_self")}e&&a(e)},handleAndroidLinking(){const{walletConnectUri:t}=H.state;t&&(g.setWalletConnectAndroidDeepLink(t),g.openHref(t,"_self"))},async handleUriCopy(){const{walletConnectUri:t}=H.state;if(t)try{await navigator.clipboard.writeText(t),Y.openToast("Link copied","success")}catch{Y.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:t}=ae.state,e=Object.values(t??{});return Object.values(e)},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},setRecentWallet(t){try{localStorage.setItem(h.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(h.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){g.openHref(h.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:t,mobile:e}=g.getWalletRouterData(),r=!!(t!=null&&t.native),i=!!(t!=null&&t.universal),o=!!(e!=null&&e.native)||!!(e!=null&&e.universal);return{isDesktop:r,isMobile:o,isWeb:i}},goToConnectingView(t){k.setData({Wallet:t});const e=g.isMobile(),{isDesktop:r,isWeb:i,isMobile:o}=h.getCachedRouterWalletPlatforms();e?o?k.push("MobileConnecting"):i?k.push("WebConnecting"):k.push("InstallWallet"):r?k.push("DesktopConnecting"):i?k.push("WebConnecting"):o?k.push("MobileQrcodeConnecting"):k.push("InstallWallet")}},pi=C`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var ui=Object.defineProperty,gi=Object.getOwnPropertyDescriptor,ft=(t,e,r,i)=>{for(var o=i>1?void 0:i?gi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ui(e,r,o),o};let Ee=class extends w{constructor(){super(),this.view=k.state.view,this.prevView=k.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=k.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&ne(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return h.getShadowRootElement(this,".wcm-router")}get contentEl(){return h.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return s``;case"DesktopConnecting":return s``;case"MobileConnecting":return s``;case"WebConnecting":return s``;case"MobileQrcodeConnecting":return s``;case"WalletExplorer":return s``;case"Qrcode":return s``;case"InstallWallet":return s``;default:return s`
Not Found
`}}async onChangeRoute(){await ne(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=k.state.view,ne(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return s`
${this.viewTemplate()}
`}};Ee.styles=[v.globalCss,pi],ft([W()],Ee.prototype,"view",2),ft([W()],Ee.prototype,"prevView",2),Ee=ft([y("wcm-modal-router")],Ee);const wi=C`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var vi=Object.defineProperty,fi=Object.getOwnPropertyDescriptor,mr=(t,e,r,i)=>{for(var o=i>1?void 0:i?fi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&vi(e,r,o),o};let He=class extends w{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Y.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Y.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Y.closeToast()}render(){const{message:t,variant:e}=Y.state,r={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?s`
${e==="success"?A.CHECKMARK_ICON:null} ${e==="error"?A.CROSS_ICON:null}${t}
`:null}};He.styles=[v.globalCss,wi],mr([W()],He.prototype,"open",2),He=mr([y("wcm-modal-toast")],He);const bi=.1,pr=2.5,B=7;function bt(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+bi}function yi(t,e){const r=Array.prototype.slice.call(jr.create(t,{errorCorrectionLevel:e}).modules.data,0),i=Math.sqrt(r.length);return r.reduce((o,n,a)=>(a%i===0?o.push([n]):o[o.length-1].push(n))&&o,[])}const xi={generate(t,e,r){const i="#141414",o="#ffffff",n=[],a=yi(t,"Q"),l=e/a.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:f,y:u})=>{const I=(a.length-B)*l*f,b=(a.length-B)*l*u,R=.45;for(let S=0;S`)}});const d=Math.floor((r+25)/l),x=a.length/2-d/2,$=a.length/2+d/2-1,m=[];a.forEach((f,u)=>{f.forEach((I,b)=>{if(a[u][b]&&!(ua.length-(B+1)&&ba.length-(B+1))&&!(u>x&&u<$&&b>x&&b<$)){const R=u*l+l/2,S=b*l+l/2;m.push([R,S])}})});const _={};return m.forEach(([f,u])=>{_[f]?_[f].push(u):_[f]=[u]}),Object.entries(_).map(([f,u])=>{const I=u.filter(b=>u.every(R=>!bt(b,R,l)));return[Number(f),I]}).forEach(([f,u])=>{u.forEach(I=>{n.push(E``)})}),Object.entries(_).filter(([f,u])=>u.length>1).map(([f,u])=>{const I=u.filter(b=>u.some(R=>bt(b,R,l)));return[Number(f),I]}).map(([f,u])=>{u.sort((b,R)=>bS.some(N=>bt(b,N,l)));R?R.push(b):I.push([b])}return[f,I.map(b=>[b[0],b[b.length-1]])]}).forEach(([f,u])=>{u.forEach(([I,b])=>{n.push(E``)})}),n}},$i=C`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var Ci=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,de=(t,e,r,i)=>{for(var o=i>1?void 0:i?Ai(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ci(e,r,o),o};let F=class extends w{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=fe.state.themeMode==="light"?this.size:this.size-36;return E`${xi.generate(this.uri,t,t/4)}`}render(){const t={"wcm-dark":fe.state.themeMode==="dark"};return s`
${this.walletId||this.imageUrl?s``:A.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};F.styles=[v.globalCss,$i],de([p()],F.prototype,"uri",2),de([p({type:Number})],F.prototype,"size",2),de([p()],F.prototype,"imageId",2),de([p()],F.prototype,"walletId",2),de([p()],F.prototype,"imageUrl",2),F=de([y("wcm-qrcode")],F);const _i=C`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var Ei=Object.defineProperty,ki=Object.getOwnPropertyDescriptor,ur=(t,e,r,i)=>{for(var o=i>1?void 0:i?ki(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ei(e,r,o),o};let Be=class extends w{constructor(){super(...arguments),this.onChange=()=>null}render(){return s` ${A.SEARCH_ICON}`}};Be.styles=[v.globalCss,_i],ur([p()],Be.prototype,"onChange",2),Be=ur([y("wcm-search-input")],Be);const Oi=C`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var Ii=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let yt=class extends w{render(){return s``}};yt.styles=[v.globalCss,Oi],yt=Ii([y("wcm-spinner")],yt);const Ti=C`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var Mi=Object.defineProperty,Ri=Object.getOwnPropertyDescriptor,xt=(t,e,r,i)=>{for(var o=i>1?void 0:i?Ri(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Mi(e,r,o),o};let ke=class extends w{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return s``}};ke.styles=[v.globalCss,Ti],xt([p()],ke.prototype,"variant",2),xt([p()],ke.prototype,"color",2),ke=xt([y("wcm-text")],ke);const Si=C`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var Li=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,q=(t,e,r,i)=>{for(var o=i>1?void 0:i?Pi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Li(e,r,o),o};let j=class extends w{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?s`RECENT`:this.installed?s`INSTALLED`:null}handleClick(){Ur.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return s``}};j.styles=[v.globalCss,Si],q([p()],j.prototype,"onClick",2),q([p()],j.prototype,"name",2),q([p()],j.prototype,"walletId",2),q([p()],j.prototype,"label",2),q([p()],j.prototype,"imageId",2),q([p({type:Boolean})],j.prototype,"installed",2),q([p({type:Boolean})],j.prototype,"recent",2),j=q([y("wcm-wallet-button")],j);const Wi=C`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Ni=Object.defineProperty,Di=Object.getOwnPropertyDescriptor,Ze=(t,e,r,i)=>{for(var o=i>1?void 0:i?Di(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ni(e,r,o),o};let he=class extends w{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:h.getWalletIcon({id:this.walletId,image_id:this.imageId});return s`${e.length?s`
${this.id}
`:A.WALLET_PLACEHOLDER}`}};he.styles=[v.globalCss,Wi],Ze([p()],he.prototype,"walletId",2),Ze([p()],he.prototype,"imageId",2),Ze([p()],he.prototype,"imageUrl",2),he=Ze([y("wcm-wallet-image")],he);var Ui=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,gr=(t,e,r,i)=>{for(var o=i>1?void 0:i?ji(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ui(e,r,o),o};let $t=class extends w{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>h.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(ae.state.enableExplorer){await P.getRecomendedWallets(),H.setIsDataLoaded(!0);const{recomendedWallets:t}=P.state,e=t.map(r=>h.getWalletIcon(r));await this.loadImages(e)}else H.setIsDataLoaded(!0)}async preloadCustomImages(){const t=h.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),Y.openToast("Failed preloading","error")}}};gr([W()],$t.prototype,"preload",2),$t=gr([y("wcm-explorer-context")],$t);var Hi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let wr=class extends w{constructor(){super(),this.unsubscribeTheme=void 0,v.setTheme(),this.unsubscribeTheme=fe.subscribe(v.setTheme)}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}};wr=Hi([y("wcm-theme-context")],wr);const Bi=C`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Zi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Ct=class extends w{onGoToQrcode(){k.push("Qrcode")}render(){const{recomendedWallets:t}=P.state,e=[...t,...t],r=g.RECOMMENDED_WALLET_AMOUNT*2;return s`
${A.MOBILE_ICON}WalletConnect
${[...Array(r)].map((i,o)=>{const n=e[o%e.length];return n?s``:A.WALLET_PLACEHOLDER})}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};Ct.styles=[v.globalCss,Bi],Ct=Zi([y("wcm-android-wallet-selection")],Ct);const zi=C`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var Vi=Object.defineProperty,Fi=Object.getOwnPropertyDescriptor,me=(t,e,r,i)=>{for(var o=i>1?void 0:i?Fi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Vi(e,r,o),o};let K=class extends w{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=fe.state.themeVariables)==null?void 0:t["--wcm-wallet-icon-large-border-radius"])!=null?e:v.getPreset("--wcm-wallet-icon-large-border-radius");let i=0;r.includes("%")?i=88/100*parseInt(r,10):i=parseInt(r,10),i*=1.17;const o=317-i*1.57,n=425-i*1.8;return s``}render(){const t={"wcm-error":this.isError,"wcm-stale":this.isStale};return s`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};K.styles=[v.globalCss,zi],me([p()],K.prototype,"walletId",2),me([p()],K.prototype,"imageId",2),me([p({type:Boolean})],K.prototype,"isError",2),me([p({type:Boolean})],K.prototype,"isStale",2),me([p()],K.prototype,"label",2),K=me([y("wcm-connector-waiting")],K);const ve={manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:i}=ae.state,o=(t=ve.recentWallet())==null?void 0:t.id,n=g.isMobile()?r:i,a=n==null?void 0:n.filter(l=>o!==l.id);return(e=g.isMobile()?a==null?void 0:a.map(({id:l,name:c,links:d})=>({id:l,name:c,mobile:d,links:d})):a==null?void 0:a.map(({id:l,name:c,links:d})=>({id:l,name:c,desktop:d,links:d})))!=null?e:[]},recentWallet(){return h.getRecentWallet()},recomendedWallets(t=!1){var e;const r=t||(e=ve.recentWallet())==null?void 0:e.id,{recomendedWallets:i}=P.state;return i.filter(o=>r!==o.id)}},X={onConnecting(t){h.goToConnectingView(t)},manualWalletsTemplate(){return ve.manualWallets().map(t=>s``)},recomendedWalletsTemplate(t=!1){return ve.recomendedWallets(t).map(e=>s``)},recentWalletTemplate(){const t=ve.recentWallet();if(t)return s``}},qi=C`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var Ki=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let At=class extends w{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=ae.state,r=t!=="ALL"&&e,i=X.manualWalletsTemplate(),o=X.recomendedWalletsTemplate();let n=[X.recentWalletTemplate(),...i,...o];n=n.filter(Boolean);const a=n.length>4||r;let l=[];a?l=n.slice(0,3):l=n;const c=!!l.length;return s`
${A.MOBILE_ICON}Mobile
${A.SCAN_ICON}Scan with your wallet
${c?s`
${A.DESKTOP_ICON}Desktop
${l} ${a?s``:null}
`:null}`}};At.styles=[v.globalCss,qi],At=Ki([y("wcm-desktop-wallet-selection")],At);const Qi=C`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var Yi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let _t=class extends w{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=ae.state;return t??e?s`
By connecting your wallet to this app, you agree to the app's ${t?s`Terms of Service`:null} ${t&&e?"and":null} ${e?s`Privacy Policy`:null}
`:null}};_t.styles=[v.globalCss,Qi],_t=Yi([y("wcm-legal-notice")],_t);const Gi=C`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var Xi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Et=class extends w{onQrcode(){k.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=ae.state,r=t!=="ALL"&&e,i=X.manualWalletsTemplate(),o=X.recomendedWalletsTemplate();let n=[X.recentWalletTemplate(),...i,...o];n=n.filter(Boolean);const a=n.length>8||r;let l=[];a?l=n.slice(0,7):l=n;const c=!!l.length;return s`${c?s`
${l} ${a?s``:null}
`:null}`}};Et.styles=[v.globalCss,Gi],Et=Xi([y("wcm-mobile-wallet-selection")],Et);const Ji=C`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,kt=(t,e,r,i)=>{for(var o=i>1?void 0:i?tn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&en(e,r,o),o};let Oe=class extends w{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Ke.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return h.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return h.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){if(document.querySelector("body"))if(t){const e=document.getElementById("wcm-styles");e==null||e.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(t){t.target===t.currentTarget&&Ke.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=h.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([ne(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,ne(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=h.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([ne(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,ne(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Ke.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"wcm-overlay":!0,"wcm-active":this.active};return s`
${this.open?s`
`:null}
`}};Oe.styles=[v.globalCss,Ji],kt([W()],Oe.prototype,"open",2),kt([W()],Oe.prototype,"active",2),Oe=kt([y("wcm-modal")],Oe);const rn=C`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var on=Object.defineProperty,nn=Object.getOwnPropertyDescriptor,Ie=(t,e,r,i)=>{for(var o=i>1?void 0:i?nn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&on(e,r,o),o};let re=class extends w{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){g.isMobile()?k.replace("MobileConnecting"):k.replace("MobileQrcodeConnecting")}onDesktop(){k.replace("DesktopConnecting")}onWeb(){k.replace("WebConnecting")}render(){return s`
${this.isRetry?s``:null} ${this.isMobile?s`Mobile`:null} ${this.isDesktop?s`Desktop`:null} ${this.isWeb?s`Web`:null}
`}};re.styles=[v.globalCss,rn],Ie([p({type:Boolean})],re.prototype,"isMobile",2),Ie([p({type:Boolean})],re.prototype,"isDesktop",2),Ie([p({type:Boolean})],re.prototype,"isWeb",2),Ie([p({type:Boolean})],re.prototype,"isRetry",2),re=Ie([y("wcm-platform-selection")],re);const an=C`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var ln=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Ot=class extends w{onClick(){k.push("WalletExplorer")}render(){const{recomendedWallets:t}=P.state,e=ve.manualWallets(),r=[...t,...e].reverse().slice(0,4);return s``}};Ot.styles=[v.globalCss,an],Ot=ln([y("wcm-view-all-wallets-button")],Ot);const sn=C`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var cn=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,ze=(t,e,r,i)=>{for(var o=i>1?void 0:i?dn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&cn(e,r,o),o};let pe=class extends w{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:t}=H.state;this.uri=t},0)}get overlayEl(){return h.getShadowRootElement(this,".wcm-qr-container")}render(){return s`
${this.uri?s``:s``}
`}};pe.styles=[v.globalCss,sn],ze([p()],pe.prototype,"walletId",2),ze([p()],pe.prototype,"imageId",2),ze([W()],pe.prototype,"uri",2),pe=ze([y("wcm-walletconnect-qr")],pe);var hn=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let It=class extends w{viewTemplate(){return g.isAndroid()?s``:g.isMobile()?s``:s``}render(){return s`${this.viewTemplate()}`}};It.styles=[v.globalCss],It=hn([y("wcm-connect-wallet-view")],It);const mn=C`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var pn=Object.defineProperty,un=Object.getOwnPropertyDescriptor,vr=(t,e,r,i)=>{for(var o=i>1?void 0:i?un(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&pn(e,r,o),o};let Ve=class extends w{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){const{desktop:e,name:r}=g.getWalletRouterData(),i=e==null?void 0:e.native;if(i){const o=g.formatNativeUrl(i,t,r);g.openHref(o,"_self")}}openDesktopApp(){const{walletConnectUri:t}=H.state,e=g.getWalletRouterData();h.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=g.getWalletRouterData(),{isMobile:i,isWeb:o}=h.getCachedRouterWalletPlatforms();return s`${`Connection can continue loading if ${t} is not installed on your device`}Retry`}};Ve.styles=[v.globalCss,mn],vr([W()],Ve.prototype,"isError",2),Ve=vr([y("wcm-desktop-connecting-view")],Ve);const gn=C`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var wn=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Tt=class extends w{onInstall(t){t&&g.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:i}=g.getWalletRouterData();return s`${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}Download`}};Tt.styles=[v.globalCss,gn],Tt=wn([y("wcm-install-wallet-view")],Tt);const vn=C`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var fn=Object.defineProperty,bn=Object.getOwnPropertyDescriptor,fr=(t,e,r,i)=>{for(var o=i>1?void 0:i?bn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&fn(e,r,o),o};let Fe=class extends w{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){const{mobile:r,name:i}=g.getWalletRouterData(),o=r==null?void 0:r.native,n=r==null?void 0:r.universal;if(o&&!e){const a=g.formatNativeUrl(o,t,i);g.openHref(a,"_self")}else if(n){const a=g.formatUniversalUrl(n,t,i);g.openHref(a,"_self")}}openMobileApp(t=!1){const{walletConnectUri:e}=H.state,r=g.getWalletRouterData();h.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&g.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:i,mobile:o}=g.getWalletRouterData(),{isWeb:n}=h.getCachedRouterWalletPlatforms(),a=i==null?void 0:i.ios,l=o==null?void 0:o.universal;return s`Retry${l?s`Still doesn't work? Try this alternate link`:null}
${`Get ${t}`}
App Store
`}};Fe.styles=[v.globalCss,vn],fr([W()],Fe.prototype,"isError",2),Fe=fr([y("wcm-mobile-connecting-view")],Fe);const yn=C`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var xn=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Mt=class extends w{render(){const{name:t,id:e,image_id:r}=g.getWalletRouterData(),{isDesktop:i,isWeb:o}=h.getCachedRouterWalletPlatforms();return s`${`Scan this QR Code with your phone's camera or inside ${t} app`}`}};Mt.styles=[v.globalCss,yn],Mt=xn([y("wcm-mobile-qr-connecting-view")],Mt);var $n=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Rt=class extends w{render(){return s``}};Rt.styles=[v.globalCss],Rt=$n([y("wcm-qrcode-view")],Rt);const Cn=C`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var An=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,Te=(t,e,r,i)=>{for(var o=i>1?void 0:i?_n(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&An(e,r,o),o};const St=40;let oe=class extends w{constructor(){super(...arguments),this.loading=!P.state.wallets.listings.length,this.firstFetch=!P.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=h.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,P.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),P.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return h.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=P.state,{listings:r,total:i}=this.search?e:t;return i<=St||r.length>=i}async fetchWallets(){var t;const{wallets:e,search:r}=P.state,{listings:i,total:o,page:n}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>St&&i.lengthh.getWalletIcon(d));await Promise.all([...c.map(async d=>h.preloadImage(d)),g.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),Y.openToast(h.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){g.isAndroid()?h.handleMobileLinking(t):h.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=P.state,{listings:r}=this.search?e:t,i=this.loading&&!r.length,o=this.search.length>=3;let n=X.manualWalletsTemplate(),a=X.recomendedWalletsTemplate(!0);o&&(n=n.filter(({values:d})=>h.caseSafeIncludes(d[0],this.search)),a=a.filter(({values:d})=>h.caseSafeIncludes(d[0],this.search)));const l=!this.loading&&!r.length&&!a.length,c={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":l};return s`
${i?null:n} ${i?null:a} ${i?null:r.map(d=>s`${d?s``:null}`)}
${l?s`No results found`:null} ${!l&&this.loading?s``:null}
`}};oe.styles=[v.globalCss,Cn],Te([W()],oe.prototype,"loading",2),Te([W()],oe.prototype,"firstFetch",2),Te([W()],oe.prototype,"search",2),Te([W()],oe.prototype,"endReached",2),oe=Te([y("wcm-wallet-explorer-view")],oe);const En=C`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var kn=Object.defineProperty,On=Object.getOwnPropertyDescriptor,br=(t,e,r,i)=>{for(var o=i>1?void 0:i?On(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&kn(e,r,o),o};let qe=class extends w{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){const{desktop:e,name:r}=g.getWalletRouterData(),i=e==null?void 0:e.universal;if(i){const o=g.formatUniversalUrl(i,t,r);g.openHref(o,"_blank")}}openWebWallet(){const{walletConnectUri:t}=H.state,e=g.getWalletRouterData();h.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=g.getWalletRouterData(),{isMobile:i,isDesktop:o}=h.getCachedRouterWalletPlatforms(),n=g.isMobile();return s`${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};qe.styles=[v.globalCss,En],br([W()],qe.prototype,"isError",2),qe=br([y("wcm-web-connecting-view")],qe);export{Oe as WcmModal,F as WcmQrCode}; diff --git a/_app/immutable/chunks/index.BW38xcfQ.js b/_app/immutable/chunks/index.BW38xcfQ.js new file mode 100644 index 0000000..50b1d78 --- /dev/null +++ b/_app/immutable/chunks/index.BW38xcfQ.js @@ -0,0 +1,7 @@ +import{k as La,j as J,b as gn,l as Fn,g as dd}from"./2.DEesTFv4.js";import{r as Ho,e as Fi}from"./___vite-browser-external_commonjs-proxy.CXzVU9cb.js";function fd(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const pd=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:La,default:La},Symbol.toStringTag,{value:"Module"}));var Uo={},On={},ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.walletLogo=void 0;const gd=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};ji.walletLogo=gd;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.LINK_API_URL=void 0;Hi.LINK_API_URL="https://www.walletlink.org";var z={},Wo={exports:{}};Wo.exports;(function(e){(function(t,r){function n(v,a){if(!v)throw new Error(a||"Assertion failed")}function i(v,a){v.super_=a;var d=function(){};d.prototype=a.prototype,v.prototype=new d,v.prototype.constructor=v}function s(v,a,d){if(s.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((a==="le"||a==="be")&&(d=a,a=10),this._init(v||0,a||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ho.Buffer}catch{}s.isBN=function(a){return a instanceof s?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,d){return a.cmp(d)>0?a:d},s.min=function(a,d){return a.cmp(d)<0?a:d},s.prototype._init=function(a,d,g){if(typeof a=="number")return this._initNumber(a,d,g);if(typeof a=="object")return this._initArray(a,d,g);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),a=a.toString().replace(/\s+/g,"");var m=0;a[0]==="-"&&(m++,this.negative=1),m=0;m-=3)M=a[m]|a[m-1]<<8|a[m-2]<<16,this.words[y]|=M<>>26-A&67108863,A+=24,A>=26&&(A-=26,y++);else if(g==="le")for(m=0,y=0;m>>26-A&67108863,A+=24,A>=26&&(A-=26,y++);return this._strip()};function c(v,a){var d=v.charCodeAt(a);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+v)}function u(v,a,d){var g=c(v,d);return d-1>=a&&(g|=c(v,d-1)<<4),g}s.prototype._parseHex=function(a,d,g){this.length=Math.ceil((a.length-d)/6),this.words=new Array(this.length);for(var m=0;m=d;m-=2)A=u(a,d,m)<=18?(y-=18,M+=1,this.words[M]|=A>>>26):y+=8;else{var b=a.length-d;for(m=b%2===0?d+1:d;m=18?(y-=18,M+=1,this.words[M]|=A>>>26):y+=8}this._strip()};function l(v,a,d,g){for(var m=0,y=0,M=Math.min(v.length,d),A=a;A=49?y=b-49+10:b>=17?y=b-17+10:y=b,n(b>=0&&y1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],R=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(a,d){a=a||10,d=d|0||1;var g;if(a===16||a==="hex"){g="";for(var m=0,y=0,M=0;M>>24-m&16777215,m+=2,m>=26&&(m-=26,M--),y!==0||M!==this.length-1?g=_[6-b.length]+b+g:g=b+g}for(y!==0&&(g=y.toString(16)+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(a===(a|0)&&a>=2&&a<=36){var h=R[a],S=x[a];g="";var W=this.clone();for(W.negative=0;!W.isZero();){var q=W.modrn(S).toString(a);W=W.idivn(S),W.isZero()?g=q+g:g=_[h-q.length]+q+g}for(this.isZero()&&(g="0"+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(a,d){return this.toArrayLike(o,a,d)}),s.prototype.toArray=function(a,d){return this.toArrayLike(Array,a,d)};var P=function(a,d){return a.allocUnsafe?a.allocUnsafe(d):new a(d)};s.prototype.toArrayLike=function(a,d,g){this._strip();var m=this.byteLength(),y=g||Math.max(1,m);n(m<=y,"byte array longer than desired length"),n(y>0,"Requested array length <= 0");var M=P(a,y),A=d==="le"?"LE":"BE";return this["_toArrayLike"+A](M,m),M},s.prototype._toArrayLikeLE=function(a,d){for(var g=0,m=0,y=0,M=0;y>8&255),g>16&255),M===6?(g>24&255),m=0,M=0):(m=A>>>24,M+=2)}if(g=0&&(a[g--]=A>>8&255),g>=0&&(a[g--]=A>>16&255),M===6?(g>=0&&(a[g--]=A>>24&255),m=0,M=0):(m=A>>>24,M+=2)}if(g>=0)for(a[g--]=m;g>=0;)a[g--]=0},Math.clz32?s.prototype._countBits=function(a){return 32-Math.clz32(a)}:s.prototype._countBits=function(a){var d=a,g=0;return d>=4096&&(g+=13,d>>>=13),d>=64&&(g+=7,d>>>=7),d>=8&&(g+=4,d>>>=4),d>=2&&(g+=2,d>>>=2),g+d},s.prototype._zeroBits=function(a){if(a===0)return 26;var d=a,g=0;return d&8191||(g+=13,d>>>=13),d&127||(g+=7,d>>>=7),d&15||(g+=4,d>>>=4),d&3||(g+=2,d>>>=2),d&1||g++,g},s.prototype.bitLength=function(){var a=this.words[this.length-1],d=this._countBits(a);return(this.length-1)*26+d};function L(v){for(var a=new Array(v.bitLength()),d=0;d>>m&1}return a}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,d=0;da.length?this.clone().ior(a):a.clone().ior(this)},s.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},s.prototype.iuand=function(a){var d;this.length>a.length?d=a:d=this;for(var g=0;ga.length?this.clone().iand(a):a.clone().iand(this)},s.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},s.prototype.iuxor=function(a){var d,g;this.length>a.length?(d=this,g=a):(d=a,g=this);for(var m=0;ma.length?this.clone().ixor(a):a.clone().ixor(this)},s.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a=="number"&&a>=0);var d=Math.ceil(a/26)|0,g=a%26;this._expand(d),g>0&&d--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-g),this._strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,d){n(typeof a=="number"&&a>=0);var g=a/26|0,m=a%26;return this._expand(g+1),d?this.words[g]=this.words[g]|1<a.length?(g=this,m=a):(g=a,m=this);for(var y=0,M=0;M>>26;for(;y!==0&&M>>26;if(this.length=g.length,y!==0)this.words[this.length]=y,this.length++;else if(g!==this)for(;Ma.length?this.clone().iadd(a):a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var d=this.iadd(a);return a.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var g=this.cmp(a);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;g>0?(m=this,y=a):(m=a,y=this);for(var M=0,A=0;A>26,this.words[A]=d&67108863;for(;M!==0&&A>26,this.words[A]=d&67108863;if(M===0&&A>>26,W=b&67108863,q=Math.min(h,a.length-1),I=Math.max(0,h-v.length+1);I<=q;I++){var T=h-I|0;m=v.words[T]|0,y=a.words[I]|0,M=m*y+W,S+=M/67108864|0,W=M&67108863}d.words[h]=W|0,b=S|0}return b!==0?d.words[h]=b|0:d.length--,d._strip()}var k=function(a,d,g){var m=a.words,y=d.words,M=g.words,A=0,b,h,S,W=m[0]|0,q=W&8191,I=W>>>13,T=m[1]|0,B=T&8191,U=T>>>13,te=m[2]|0,w=te&8191,E=te>>>13,F=m[3]|0,j=F&8191,K=F>>>13,ee=m[4]|0,Z=ee&8191,le=ee>>>13,Ct=m[5]|0,ge=Ct&8191,_e=Ct>>>13,Vt=m[6]|0,de=Vt&8191,fe=Vt>>>13,Pt=m[7]|0,he=Pt&8191,ue=Pt>>>13,ct=m[8]|0,me=ct&8191,ve=ct>>>13,Or=m[9]|0,be=Or&8191,ye=Or>>>13,Pr=y[0]|0,we=Pr&8191,Ee=Pr>>>13,$r=y[1]|0,Se=$r&8191,Re=$r>>>13,Br=y[2]|0,Ce=Br&8191,Me=Br>>>13,Dr=y[3]|0,ke=Dr&8191,Ie=Dr>>>13,Fr=y[4]|0,xe=Fr&8191,Ae=Fr>>>13,jr=y[5]|0,Te=jr&8191,Ne=jr>>>13,Hr=y[6]|0,Le=Hr&8191,Oe=Hr>>>13,Ur=y[7]|0,Pe=Ur&8191,$e=Ur>>>13,Wr=y[8]|0,Be=Wr&8191,De=Wr>>>13,Vr=y[9]|0,Fe=Vr&8191,je=Vr>>>13;g.negative=a.negative^d.negative,g.length=19,b=Math.imul(q,we),h=Math.imul(q,Ee),h=h+Math.imul(I,we)|0,S=Math.imul(I,Ee);var Qt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul(B,we),h=Math.imul(B,Ee),h=h+Math.imul(U,we)|0,S=Math.imul(U,Ee),b=b+Math.imul(q,Se)|0,h=h+Math.imul(q,Re)|0,h=h+Math.imul(I,Se)|0,S=S+Math.imul(I,Re)|0;var Yt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b=Math.imul(w,we),h=Math.imul(w,Ee),h=h+Math.imul(E,we)|0,S=Math.imul(E,Ee),b=b+Math.imul(B,Se)|0,h=h+Math.imul(B,Re)|0,h=h+Math.imul(U,Se)|0,S=S+Math.imul(U,Re)|0,b=b+Math.imul(q,Ce)|0,h=h+Math.imul(q,Me)|0,h=h+Math.imul(I,Ce)|0,S=S+Math.imul(I,Me)|0;var Xt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,b=Math.imul(j,we),h=Math.imul(j,Ee),h=h+Math.imul(K,we)|0,S=Math.imul(K,Ee),b=b+Math.imul(w,Se)|0,h=h+Math.imul(w,Re)|0,h=h+Math.imul(E,Se)|0,S=S+Math.imul(E,Re)|0,b=b+Math.imul(B,Ce)|0,h=h+Math.imul(B,Me)|0,h=h+Math.imul(U,Ce)|0,S=S+Math.imul(U,Me)|0,b=b+Math.imul(q,ke)|0,h=h+Math.imul(q,Ie)|0,h=h+Math.imul(I,ke)|0,S=S+Math.imul(I,Ie)|0;var er=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(er>>>26)|0,er&=67108863,b=Math.imul(Z,we),h=Math.imul(Z,Ee),h=h+Math.imul(le,we)|0,S=Math.imul(le,Ee),b=b+Math.imul(j,Se)|0,h=h+Math.imul(j,Re)|0,h=h+Math.imul(K,Se)|0,S=S+Math.imul(K,Re)|0,b=b+Math.imul(w,Ce)|0,h=h+Math.imul(w,Me)|0,h=h+Math.imul(E,Ce)|0,S=S+Math.imul(E,Me)|0,b=b+Math.imul(B,ke)|0,h=h+Math.imul(B,Ie)|0,h=h+Math.imul(U,ke)|0,S=S+Math.imul(U,Ie)|0,b=b+Math.imul(q,xe)|0,h=h+Math.imul(q,Ae)|0,h=h+Math.imul(I,xe)|0,S=S+Math.imul(I,Ae)|0;var tr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(ge,we),h=Math.imul(ge,Ee),h=h+Math.imul(_e,we)|0,S=Math.imul(_e,Ee),b=b+Math.imul(Z,Se)|0,h=h+Math.imul(Z,Re)|0,h=h+Math.imul(le,Se)|0,S=S+Math.imul(le,Re)|0,b=b+Math.imul(j,Ce)|0,h=h+Math.imul(j,Me)|0,h=h+Math.imul(K,Ce)|0,S=S+Math.imul(K,Me)|0,b=b+Math.imul(w,ke)|0,h=h+Math.imul(w,Ie)|0,h=h+Math.imul(E,ke)|0,S=S+Math.imul(E,Ie)|0,b=b+Math.imul(B,xe)|0,h=h+Math.imul(B,Ae)|0,h=h+Math.imul(U,xe)|0,S=S+Math.imul(U,Ae)|0,b=b+Math.imul(q,Te)|0,h=h+Math.imul(q,Ne)|0,h=h+Math.imul(I,Te)|0,S=S+Math.imul(I,Ne)|0;var rr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(rr>>>26)|0,rr&=67108863,b=Math.imul(de,we),h=Math.imul(de,Ee),h=h+Math.imul(fe,we)|0,S=Math.imul(fe,Ee),b=b+Math.imul(ge,Se)|0,h=h+Math.imul(ge,Re)|0,h=h+Math.imul(_e,Se)|0,S=S+Math.imul(_e,Re)|0,b=b+Math.imul(Z,Ce)|0,h=h+Math.imul(Z,Me)|0,h=h+Math.imul(le,Ce)|0,S=S+Math.imul(le,Me)|0,b=b+Math.imul(j,ke)|0,h=h+Math.imul(j,Ie)|0,h=h+Math.imul(K,ke)|0,S=S+Math.imul(K,Ie)|0,b=b+Math.imul(w,xe)|0,h=h+Math.imul(w,Ae)|0,h=h+Math.imul(E,xe)|0,S=S+Math.imul(E,Ae)|0,b=b+Math.imul(B,Te)|0,h=h+Math.imul(B,Ne)|0,h=h+Math.imul(U,Te)|0,S=S+Math.imul(U,Ne)|0,b=b+Math.imul(q,Le)|0,h=h+Math.imul(q,Oe)|0,h=h+Math.imul(I,Le)|0,S=S+Math.imul(I,Oe)|0;var nr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(nr>>>26)|0,nr&=67108863,b=Math.imul(he,we),h=Math.imul(he,Ee),h=h+Math.imul(ue,we)|0,S=Math.imul(ue,Ee),b=b+Math.imul(de,Se)|0,h=h+Math.imul(de,Re)|0,h=h+Math.imul(fe,Se)|0,S=S+Math.imul(fe,Re)|0,b=b+Math.imul(ge,Ce)|0,h=h+Math.imul(ge,Me)|0,h=h+Math.imul(_e,Ce)|0,S=S+Math.imul(_e,Me)|0,b=b+Math.imul(Z,ke)|0,h=h+Math.imul(Z,Ie)|0,h=h+Math.imul(le,ke)|0,S=S+Math.imul(le,Ie)|0,b=b+Math.imul(j,xe)|0,h=h+Math.imul(j,Ae)|0,h=h+Math.imul(K,xe)|0,S=S+Math.imul(K,Ae)|0,b=b+Math.imul(w,Te)|0,h=h+Math.imul(w,Ne)|0,h=h+Math.imul(E,Te)|0,S=S+Math.imul(E,Ne)|0,b=b+Math.imul(B,Le)|0,h=h+Math.imul(B,Oe)|0,h=h+Math.imul(U,Le)|0,S=S+Math.imul(U,Oe)|0,b=b+Math.imul(q,Pe)|0,h=h+Math.imul(q,$e)|0,h=h+Math.imul(I,Pe)|0,S=S+Math.imul(I,$e)|0;var ir=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ir>>>26)|0,ir&=67108863,b=Math.imul(me,we),h=Math.imul(me,Ee),h=h+Math.imul(ve,we)|0,S=Math.imul(ve,Ee),b=b+Math.imul(he,Se)|0,h=h+Math.imul(he,Re)|0,h=h+Math.imul(ue,Se)|0,S=S+Math.imul(ue,Re)|0,b=b+Math.imul(de,Ce)|0,h=h+Math.imul(de,Me)|0,h=h+Math.imul(fe,Ce)|0,S=S+Math.imul(fe,Me)|0,b=b+Math.imul(ge,ke)|0,h=h+Math.imul(ge,Ie)|0,h=h+Math.imul(_e,ke)|0,S=S+Math.imul(_e,Ie)|0,b=b+Math.imul(Z,xe)|0,h=h+Math.imul(Z,Ae)|0,h=h+Math.imul(le,xe)|0,S=S+Math.imul(le,Ae)|0,b=b+Math.imul(j,Te)|0,h=h+Math.imul(j,Ne)|0,h=h+Math.imul(K,Te)|0,S=S+Math.imul(K,Ne)|0,b=b+Math.imul(w,Le)|0,h=h+Math.imul(w,Oe)|0,h=h+Math.imul(E,Le)|0,S=S+Math.imul(E,Oe)|0,b=b+Math.imul(B,Pe)|0,h=h+Math.imul(B,$e)|0,h=h+Math.imul(U,Pe)|0,S=S+Math.imul(U,$e)|0,b=b+Math.imul(q,Be)|0,h=h+Math.imul(q,De)|0,h=h+Math.imul(I,Be)|0,S=S+Math.imul(I,De)|0;var sr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul(be,we),h=Math.imul(be,Ee),h=h+Math.imul(ye,we)|0,S=Math.imul(ye,Ee),b=b+Math.imul(me,Se)|0,h=h+Math.imul(me,Re)|0,h=h+Math.imul(ve,Se)|0,S=S+Math.imul(ve,Re)|0,b=b+Math.imul(he,Ce)|0,h=h+Math.imul(he,Me)|0,h=h+Math.imul(ue,Ce)|0,S=S+Math.imul(ue,Me)|0,b=b+Math.imul(de,ke)|0,h=h+Math.imul(de,Ie)|0,h=h+Math.imul(fe,ke)|0,S=S+Math.imul(fe,Ie)|0,b=b+Math.imul(ge,xe)|0,h=h+Math.imul(ge,Ae)|0,h=h+Math.imul(_e,xe)|0,S=S+Math.imul(_e,Ae)|0,b=b+Math.imul(Z,Te)|0,h=h+Math.imul(Z,Ne)|0,h=h+Math.imul(le,Te)|0,S=S+Math.imul(le,Ne)|0,b=b+Math.imul(j,Le)|0,h=h+Math.imul(j,Oe)|0,h=h+Math.imul(K,Le)|0,S=S+Math.imul(K,Oe)|0,b=b+Math.imul(w,Pe)|0,h=h+Math.imul(w,$e)|0,h=h+Math.imul(E,Pe)|0,S=S+Math.imul(E,$e)|0,b=b+Math.imul(B,Be)|0,h=h+Math.imul(B,De)|0,h=h+Math.imul(U,Be)|0,S=S+Math.imul(U,De)|0,b=b+Math.imul(q,Fe)|0,h=h+Math.imul(q,je)|0,h=h+Math.imul(I,Fe)|0,S=S+Math.imul(I,je)|0;var or=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(or>>>26)|0,or&=67108863,b=Math.imul(be,Se),h=Math.imul(be,Re),h=h+Math.imul(ye,Se)|0,S=Math.imul(ye,Re),b=b+Math.imul(me,Ce)|0,h=h+Math.imul(me,Me)|0,h=h+Math.imul(ve,Ce)|0,S=S+Math.imul(ve,Me)|0,b=b+Math.imul(he,ke)|0,h=h+Math.imul(he,Ie)|0,h=h+Math.imul(ue,ke)|0,S=S+Math.imul(ue,Ie)|0,b=b+Math.imul(de,xe)|0,h=h+Math.imul(de,Ae)|0,h=h+Math.imul(fe,xe)|0,S=S+Math.imul(fe,Ae)|0,b=b+Math.imul(ge,Te)|0,h=h+Math.imul(ge,Ne)|0,h=h+Math.imul(_e,Te)|0,S=S+Math.imul(_e,Ne)|0,b=b+Math.imul(Z,Le)|0,h=h+Math.imul(Z,Oe)|0,h=h+Math.imul(le,Le)|0,S=S+Math.imul(le,Oe)|0,b=b+Math.imul(j,Pe)|0,h=h+Math.imul(j,$e)|0,h=h+Math.imul(K,Pe)|0,S=S+Math.imul(K,$e)|0,b=b+Math.imul(w,Be)|0,h=h+Math.imul(w,De)|0,h=h+Math.imul(E,Be)|0,S=S+Math.imul(E,De)|0,b=b+Math.imul(B,Fe)|0,h=h+Math.imul(B,je)|0,h=h+Math.imul(U,Fe)|0,S=S+Math.imul(U,je)|0;var ar=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ar>>>26)|0,ar&=67108863,b=Math.imul(be,Ce),h=Math.imul(be,Me),h=h+Math.imul(ye,Ce)|0,S=Math.imul(ye,Me),b=b+Math.imul(me,ke)|0,h=h+Math.imul(me,Ie)|0,h=h+Math.imul(ve,ke)|0,S=S+Math.imul(ve,Ie)|0,b=b+Math.imul(he,xe)|0,h=h+Math.imul(he,Ae)|0,h=h+Math.imul(ue,xe)|0,S=S+Math.imul(ue,Ae)|0,b=b+Math.imul(de,Te)|0,h=h+Math.imul(de,Ne)|0,h=h+Math.imul(fe,Te)|0,S=S+Math.imul(fe,Ne)|0,b=b+Math.imul(ge,Le)|0,h=h+Math.imul(ge,Oe)|0,h=h+Math.imul(_e,Le)|0,S=S+Math.imul(_e,Oe)|0,b=b+Math.imul(Z,Pe)|0,h=h+Math.imul(Z,$e)|0,h=h+Math.imul(le,Pe)|0,S=S+Math.imul(le,$e)|0,b=b+Math.imul(j,Be)|0,h=h+Math.imul(j,De)|0,h=h+Math.imul(K,Be)|0,S=S+Math.imul(K,De)|0,b=b+Math.imul(w,Fe)|0,h=h+Math.imul(w,je)|0,h=h+Math.imul(E,Fe)|0,S=S+Math.imul(E,je)|0;var cr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(cr>>>26)|0,cr&=67108863,b=Math.imul(be,ke),h=Math.imul(be,Ie),h=h+Math.imul(ye,ke)|0,S=Math.imul(ye,Ie),b=b+Math.imul(me,xe)|0,h=h+Math.imul(me,Ae)|0,h=h+Math.imul(ve,xe)|0,S=S+Math.imul(ve,Ae)|0,b=b+Math.imul(he,Te)|0,h=h+Math.imul(he,Ne)|0,h=h+Math.imul(ue,Te)|0,S=S+Math.imul(ue,Ne)|0,b=b+Math.imul(de,Le)|0,h=h+Math.imul(de,Oe)|0,h=h+Math.imul(fe,Le)|0,S=S+Math.imul(fe,Oe)|0,b=b+Math.imul(ge,Pe)|0,h=h+Math.imul(ge,$e)|0,h=h+Math.imul(_e,Pe)|0,S=S+Math.imul(_e,$e)|0,b=b+Math.imul(Z,Be)|0,h=h+Math.imul(Z,De)|0,h=h+Math.imul(le,Be)|0,S=S+Math.imul(le,De)|0,b=b+Math.imul(j,Fe)|0,h=h+Math.imul(j,je)|0,h=h+Math.imul(K,Fe)|0,S=S+Math.imul(K,je)|0;var lr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(lr>>>26)|0,lr&=67108863,b=Math.imul(be,xe),h=Math.imul(be,Ae),h=h+Math.imul(ye,xe)|0,S=Math.imul(ye,Ae),b=b+Math.imul(me,Te)|0,h=h+Math.imul(me,Ne)|0,h=h+Math.imul(ve,Te)|0,S=S+Math.imul(ve,Ne)|0,b=b+Math.imul(he,Le)|0,h=h+Math.imul(he,Oe)|0,h=h+Math.imul(ue,Le)|0,S=S+Math.imul(ue,Oe)|0,b=b+Math.imul(de,Pe)|0,h=h+Math.imul(de,$e)|0,h=h+Math.imul(fe,Pe)|0,S=S+Math.imul(fe,$e)|0,b=b+Math.imul(ge,Be)|0,h=h+Math.imul(ge,De)|0,h=h+Math.imul(_e,Be)|0,S=S+Math.imul(_e,De)|0,b=b+Math.imul(Z,Fe)|0,h=h+Math.imul(Z,je)|0,h=h+Math.imul(le,Fe)|0,S=S+Math.imul(le,je)|0;var ur=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ur>>>26)|0,ur&=67108863,b=Math.imul(be,Te),h=Math.imul(be,Ne),h=h+Math.imul(ye,Te)|0,S=Math.imul(ye,Ne),b=b+Math.imul(me,Le)|0,h=h+Math.imul(me,Oe)|0,h=h+Math.imul(ve,Le)|0,S=S+Math.imul(ve,Oe)|0,b=b+Math.imul(he,Pe)|0,h=h+Math.imul(he,$e)|0,h=h+Math.imul(ue,Pe)|0,S=S+Math.imul(ue,$e)|0,b=b+Math.imul(de,Be)|0,h=h+Math.imul(de,De)|0,h=h+Math.imul(fe,Be)|0,S=S+Math.imul(fe,De)|0,b=b+Math.imul(ge,Fe)|0,h=h+Math.imul(ge,je)|0,h=h+Math.imul(_e,Fe)|0,S=S+Math.imul(_e,je)|0;var Ds=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Ds>>>26)|0,Ds&=67108863,b=Math.imul(be,Le),h=Math.imul(be,Oe),h=h+Math.imul(ye,Le)|0,S=Math.imul(ye,Oe),b=b+Math.imul(me,Pe)|0,h=h+Math.imul(me,$e)|0,h=h+Math.imul(ve,Pe)|0,S=S+Math.imul(ve,$e)|0,b=b+Math.imul(he,Be)|0,h=h+Math.imul(he,De)|0,h=h+Math.imul(ue,Be)|0,S=S+Math.imul(ue,De)|0,b=b+Math.imul(de,Fe)|0,h=h+Math.imul(de,je)|0,h=h+Math.imul(fe,Fe)|0,S=S+Math.imul(fe,je)|0;var Fs=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Fs>>>26)|0,Fs&=67108863,b=Math.imul(be,Pe),h=Math.imul(be,$e),h=h+Math.imul(ye,Pe)|0,S=Math.imul(ye,$e),b=b+Math.imul(me,Be)|0,h=h+Math.imul(me,De)|0,h=h+Math.imul(ve,Be)|0,S=S+Math.imul(ve,De)|0,b=b+Math.imul(he,Fe)|0,h=h+Math.imul(he,je)|0,h=h+Math.imul(ue,Fe)|0,S=S+Math.imul(ue,je)|0;var js=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(js>>>26)|0,js&=67108863,b=Math.imul(be,Be),h=Math.imul(be,De),h=h+Math.imul(ye,Be)|0,S=Math.imul(ye,De),b=b+Math.imul(me,Fe)|0,h=h+Math.imul(me,je)|0,h=h+Math.imul(ve,Fe)|0,S=S+Math.imul(ve,je)|0;var Hs=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Hs>>>26)|0,Hs&=67108863,b=Math.imul(be,Fe),h=Math.imul(be,je),h=h+Math.imul(ye,Fe)|0,S=Math.imul(ye,je);var Us=(A+b|0)+((h&8191)<<13)|0;return A=(S+(h>>>13)|0)+(Us>>>26)|0,Us&=67108863,M[0]=Qt,M[1]=Yt,M[2]=Xt,M[3]=er,M[4]=tr,M[5]=rr,M[6]=nr,M[7]=ir,M[8]=sr,M[9]=or,M[10]=ar,M[11]=cr,M[12]=lr,M[13]=ur,M[14]=Ds,M[15]=Fs,M[16]=js,M[17]=Hs,M[18]=Us,A!==0&&(M[19]=A,g.length++),g};Math.imul||(k=C);function N(v,a,d){d.negative=a.negative^v.negative,d.length=v.length+a.length;for(var g=0,m=0,y=0;y>>26)|0,m+=M>>>26,M&=67108863}d.words[y]=A,g=M,M=m}return g!==0?d.words[y]=g:d.length--,d._strip()}function $(v,a,d){return N(v,a,d)}s.prototype.mulTo=function(a,d){var g,m=this.length+a.length;return this.length===10&&a.length===10?g=k(this,a,d):m<63?g=C(this,a,d):m<1024?g=N(this,a,d):g=$(this,a,d),g},s.prototype.mul=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),this.mulTo(a,d)},s.prototype.mulf=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),$(this,a,d)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){var d=a<0;d&&(a=-a),n(typeof a=="number"),n(a<67108864);for(var g=0,m=0;m>=26,g+=y/67108864|0,g+=M>>>26,this.words[m]=M&67108863}return g!==0&&(this.words[m]=g,this.length++),d?this.ineg():this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var d=L(a);if(d.length===0)return new s(1);for(var g=this,m=0;m=0);var d=a%26,g=(a-d)/26,m=67108863>>>26-d<<26-d,y;if(d!==0){var M=0;for(y=0;y>>26-d}M&&(this.words[y]=M,this.length++)}if(g!==0){for(y=this.length-1;y>=0;y--)this.words[y+g]=this.words[y];for(y=0;y=0);var m;d?m=(d-d%26)/26:m=0;var y=a%26,M=Math.min((a-y)/26,this.length),A=67108863^67108863>>>y<M)for(this.length-=M,h=0;h=0&&(S!==0||h>=m);h--){var W=this.words[h]|0;this.words[h]=S<<26-y|W>>>y,S=W&A}return b&&S!==0&&(b.words[b.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(a,d,g){return n(this.negative===0),this.iushrn(a,d,g)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a=="number"&&a>=0);var d=a%26,g=(a-d)/26,m=1<=0);var d=a%26,g=(a-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(d!==0&&g++,this.length=Math.min(g,this.length),d!==0){var m=67108863^67108863>>>d<=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(a){if(n(typeof a=="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d>26)-(b/67108864|0),this.words[y+g]=M&67108863}for(;y>26,this.words[y+g]=M&67108863;if(A===0)return this._strip();for(n(A===-1),A=0,y=0;y>26,this.words[y]=M&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(a,d){var g=this.length-a.length,m=this.clone(),y=a,M=y.words[y.length-1]|0,A=this._countBits(M);g=26-A,g!==0&&(y=y.ushln(g),m.iushln(g),M=y.words[y.length-1]|0);var b=m.length-y.length,h;if(d!=="mod"){h=new s(null),h.length=b+1,h.words=new Array(h.length);for(var S=0;S=0;q--){var I=(m.words[y.length+q]|0)*67108864+(m.words[y.length+q-1]|0);for(I=Math.min(I/M|0,67108863),m._ishlnsubmul(y,I,q);m.negative!==0;)I--,m.negative=0,m._ishlnsubmul(y,1,q),m.isZero()||(m.negative^=1);h&&(h.words[q]=I)}return h&&h._strip(),m._strip(),d!=="div"&&g!==0&&m.iushrn(g),{div:h||null,mod:m}},s.prototype.divmod=function(a,d,g){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,y,M;return this.negative!==0&&a.negative===0?(M=this.neg().divmod(a,d),d!=="mod"&&(m=M.div.neg()),d!=="div"&&(y=M.mod.neg(),g&&y.negative!==0&&y.iadd(a)),{div:m,mod:y}):this.negative===0&&a.negative!==0?(M=this.divmod(a.neg(),d),d!=="mod"&&(m=M.div.neg()),{div:m,mod:M.mod}):this.negative&a.negative?(M=this.neg().divmod(a.neg(),d),d!=="div"&&(y=M.mod.neg(),g&&y.negative!==0&&y.isub(a)),{div:M.div,mod:y}):a.length>this.length||this.cmp(a)<0?{div:new s(0),mod:this}:a.length===1?d==="div"?{div:this.divn(a.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new s(this.modrn(a.words[0]))}:this._wordDiv(a,d)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var d=this.divmod(a);if(d.mod.isZero())return d.div;var g=d.div.negative!==0?d.mod.isub(a):d.mod,m=a.ushrn(1),y=a.andln(1),M=g.cmp(m);return M<0||y===1&&M===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var g=(1<<26)%a,m=0,y=this.length-1;y>=0;y--)m=(g*m+(this.words[y]|0))%a;return d?-m:m},s.prototype.modn=function(a){return this.modrn(a)},s.prototype.idivn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var g=0,m=this.length-1;m>=0;m--){var y=(this.words[m]|0)+g*67108864;this.words[m]=y/a|0,g=y%a}return this._strip(),d?this.ineg():this},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var d=this,g=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var m=new s(1),y=new s(0),M=new s(0),A=new s(1),b=0;d.isEven()&&g.isEven();)d.iushrn(1),g.iushrn(1),++b;for(var h=g.clone(),S=d.clone();!d.isZero();){for(var W=0,q=1;!(d.words[0]&q)&&W<26;++W,q<<=1);if(W>0)for(d.iushrn(W);W-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(h),y.isub(S)),m.iushrn(1),y.iushrn(1);for(var I=0,T=1;!(g.words[0]&T)&&I<26;++I,T<<=1);if(I>0)for(g.iushrn(I);I-- >0;)(M.isOdd()||A.isOdd())&&(M.iadd(h),A.isub(S)),M.iushrn(1),A.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(M),y.isub(A)):(g.isub(d),M.isub(m),A.isub(y))}return{a:M,b:A,gcd:g.iushln(b)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var d=this,g=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var m=new s(1),y=new s(0),M=g.clone();d.cmpn(1)>0&&g.cmpn(1)>0;){for(var A=0,b=1;!(d.words[0]&b)&&A<26;++A,b<<=1);if(A>0)for(d.iushrn(A);A-- >0;)m.isOdd()&&m.iadd(M),m.iushrn(1);for(var h=0,S=1;!(g.words[0]&S)&&h<26;++h,S<<=1);if(h>0)for(g.iushrn(h);h-- >0;)y.isOdd()&&y.iadd(M),y.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(y)):(g.isub(d),y.isub(m))}var W;return d.cmpn(1)===0?W=m:W=y,W.cmpn(0)<0&&W.iadd(a),W},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var d=this.clone(),g=a.clone();d.negative=0,g.negative=0;for(var m=0;d.isEven()&&g.isEven();m++)d.iushrn(1),g.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;g.isEven();)g.iushrn(1);var y=d.cmp(g);if(y<0){var M=d;d=g,g=M}else if(y===0||g.cmpn(1)===0)break;d.isub(g)}while(!0);return g.iushln(m)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a=="number");var d=a%26,g=(a-d)/26,m=1<>>26,A&=67108863,this.words[M]=A}return y!==0&&(this.words[M]=y,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var d=a<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var g;if(this.length>1)g=1;else{d&&(a=-a),n(a<=67108863,"Number is too big");var m=this.words[0]|0;g=m===a?0:ma.length)return 1;if(this.length=0;g--){var m=this.words[g]|0,y=a.words[g]|0;if(m!==y){my&&(d=1);break}}return d},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new Q(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var O={k256:null,p224:null,p192:null,p25519:null};function D(v,a){this.name=v,this.p=new s(a,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var a=new s(null);return a.words=new Array(Math.ceil(this.n/13)),a},D.prototype.ireduce=function(a){var d=a,g;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),g=d.bitLength();while(g>this.n);var m=g0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},D.prototype.split=function(a,d){a.iushrn(this.n,0,d)},D.prototype.imulK=function(a){return a.imul(this.k)};function G(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(G,D),G.prototype.split=function(a,d){for(var g=4194303,m=Math.min(a.length,9),y=0;y>>22,M=A}M>>>=22,a.words[y-10]=M,M===0&&a.length>10?a.length-=10:a.length-=9},G.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var d=0,g=0;g>>=26,a.words[g]=y,d=m}return d!==0&&(a.words[a.length++]=d),a},s._prime=function(a){if(O[a])return O[a];var d;if(a==="k256")d=new G;else if(a==="p224")d=new V;else if(a==="p192")d=new H;else if(a==="p25519")d=new X;else throw new Error("Unknown prime "+a);return O[a]=d,d};function Q(v){if(typeof v=="string"){var a=s._prime(v);this.m=a.p,this.prime=a}else n(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}Q.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},Q.prototype._verify2=function(a,d){n((a.negative|d.negative)===0,"red works only with positives"),n(a.red&&a.red===d.red,"red works only with red numbers")},Q.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):(p(a,a.umod(this.m)._forceRed(this)),a)},Q.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Q.prototype.add=function(a,d){this._verify2(a,d);var g=a.add(d);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},Q.prototype.iadd=function(a,d){this._verify2(a,d);var g=a.iadd(d);return g.cmp(this.m)>=0&&g.isub(this.m),g},Q.prototype.sub=function(a,d){this._verify2(a,d);var g=a.sub(d);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},Q.prototype.isub=function(a,d){this._verify2(a,d);var g=a.isub(d);return g.cmpn(0)<0&&g.iadd(this.m),g},Q.prototype.shl=function(a,d){return this._verify1(a),this.imod(a.ushln(d))},Q.prototype.imul=function(a,d){return this._verify2(a,d),this.imod(a.imul(d))},Q.prototype.mul=function(a,d){return this._verify2(a,d),this.imod(a.mul(d))},Q.prototype.isqr=function(a){return this.imul(a,a.clone())},Q.prototype.sqr=function(a){return this.mul(a,a)},Q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var g=this.m.add(new s(1)).iushrn(2);return this.pow(a,g)}for(var m=this.m.subn(1),y=0;!m.isZero()&&m.andln(1)===0;)y++,m.iushrn(1);n(!m.isZero());var M=new s(1).toRed(this),A=M.redNeg(),b=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new s(2*h*h).toRed(this);this.pow(h,b).cmp(A)!==0;)h.redIAdd(A);for(var S=this.pow(h,m),W=this.pow(a,m.addn(1).iushrn(1)),q=this.pow(a,m),I=y;q.cmp(M)!==0;){for(var T=q,B=0;T.cmp(M)!==0;B++)T=T.redSqr();n(B=0;y--){for(var S=d.words[y],W=h-1;W>=0;W--){var q=S>>W&1;if(M!==m[0]&&(M=this.sqr(M)),q===0&&A===0){b=0;continue}A<<=1,A|=q,b++,!(b!==g&&(y!==0||W!==0))&&(M=this.mul(M,m[A]),b=0,A=0)}h=26}return M},Q.prototype.convertTo=function(a){var d=a.umod(this.m);return d===a?d.clone():d},Q.prototype.convertFrom=function(a){var d=a.clone();return d.red=null,d},s.mont=function(a){return new ie(a)};function ie(v){Q.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ie,Q),ie.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ie.prototype.convertFrom=function(a){var d=this.imod(a.mul(this.rinv));return d.red=null,d},ie.prototype.imul=function(a,d){if(a.isZero()||d.isZero())return a.words[0]=0,a.length=1,a;var g=a.imul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=g.isub(m).iushrn(this.shift),M=y;return y.cmp(this.m)>=0?M=y.isub(this.m):y.cmpn(0)<0&&(M=y.iadd(this.m)),M._forceRed(this)},ie.prototype.mul=function(a,d){if(a.isZero()||d.isZero())return new s(0)._forceRed(this);var g=a.mul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=g.isub(m).iushrn(this.shift),M=y;return y.cmp(this.m)>=0?M=y.isub(this.m):y.cmpn(0)<0&&(M=y.iadd(this.m)),M._forceRed(this)},ie.prototype.invm=function(a){var d=this.imod(a._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,J)})(Wo);var Ui=Wo.exports,jn={},Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.errorValues=Ht.standardErrorCodes=void 0;Ht.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Ht.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Wi={},Vi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ht,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,R=r){if(_&&Number.isInteger(_)){const x=_.toString();if(p(t.errorValues,x))return t.errorValues[x].message;if(u(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return R}e.getMessageFromCode=n;function i(_){if(!Number.isInteger(_))return!1;const R=_.toString();return!!(t.errorValues[R]||u(_))}e.isValidCode=i;function s(_){var R;if(typeof _=="number")return _;if(o(_))return(R=_.code)!==null&&R!==void 0?R:_.errorCode}e.getErrorCode=s;function o(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function c(_,{shouldIncludeStack:R=!1}={}){const x={};if(_&&typeof _=="object"&&!Array.isArray(_)&&p(_,"code")&&i(_.code)){const P=_;x.code=P.code,P.message&&typeof P.message=="string"?(x.message=P.message,p(P,"data")&&(x.data=P.data)):(x.message=n(x.code),x.data={originalError:l(_)})}else x.code=t.standardErrorCodes.rpc.internal,x.message=f(_,"message")?_.message:r,x.data={originalError:l(_)};return R&&(x.stack=f(_,"stack")?_.stack:void 0),x}e.serialize=c;function u(_){return _>=-32099&&_<=-32e3}function l(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function p(_,R){return Object.prototype.hasOwnProperty.call(_,R)}function f(_,R){return typeof _=="object"&&_!==null&&R in _&&typeof _[R]=="string"}})(Vi);Object.defineProperty(Wi,"__esModule",{value:!0});Wi.standardErrors=void 0;const Xe=Ht,Il=Vi;Wi.standardErrors={rpc:{parse:e=>dt(Xe.standardErrorCodes.rpc.parse,e),invalidRequest:e=>dt(Xe.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>dt(Xe.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>dt(Xe.standardErrorCodes.rpc.methodNotFound,e),internal:e=>dt(Xe.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return dt(t,e)},invalidInput:e=>dt(Xe.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>dt(Xe.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>dt(Xe.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>dt(Xe.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>dt(Xe.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>dt(Xe.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>qr(Xe.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>qr(Xe.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>qr(Xe.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>qr(Xe.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>qr(Xe.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>qr(Xe.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Tl(t,r,n)}}};function dt(e,t){const[r,n]=xl(t);return new Al(e,r||(0,Il.getMessageFromCode)(e),n)}function qr(e,t){const[r,n]=xl(t);return new Tl(e,r||(0,Il.getMessageFromCode)(e),n)}function xl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let Al=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},Tl=class extends Al{constructor(t,r,n){if(!_d(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function _d(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var qi={},_n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.isErrorResponse=void 0;function md(e){return e.errorMessage!==void 0}_n.isErrorResponse=md;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.LIB_VERSION=void 0;mn.LIB_VERSION="3.9.1";Object.defineProperty(qi,"__esModule",{value:!0});qi.serializeError=void 0;const vd=_n,bd=mn,yd=Ht,wd=Vi;function Ed(e,t){const r=(0,wd.serialize)(Sd(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",bd.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Rd(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}qi.serializeError=Ed;function Sd(e){return typeof e=="string"?{message:e,code:yd.standardErrorCodes.rpc.internal}:(0,vd.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Rd(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Ht;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Wi;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=qi;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Vi;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(jn);var Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.ProviderType=Je.RegExpString=Je.IntNumber=Je.BigIntString=Je.AddressString=Je.HexString=Je.OpaqueType=void 0;function Hn(){return e=>e}Je.OpaqueType=Hn;Je.HexString=Hn();Je.AddressString=Hn();Je.BigIntString=Hn();function Cd(e){return Math.floor(e)}Je.IntNumber=Cd;Je.RegExpString=Hn();var Oa;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Oa||(Je.ProviderType=Oa={}));var Md=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(z,"__esModule",{value:!0});z.isMobileWeb=z.getLocation=z.isInIFrame=z.createQrUrl=z.getFavicon=z.range=z.isBigNumber=z.ensureParsedJSONObject=z.ensureBN=z.ensureRegExpString=z.ensureIntNumber=z.ensureBuffer=z.ensureAddressString=z.ensureEvenLengthHexString=z.ensureHexString=z.isHexString=z.prepend0x=z.strip0x=z.has0xPrefix=z.hexStringFromIntNumber=z.intNumberFromHexString=z.bigIntStringFromBN=z.hexStringFromBuffer=z.hexStringToUint8Array=z.uint8ArrayToHex=z.randomBytesHex=void 0;const Gt=Md(Ui),kr=jn,_t=Je,Nl=/^[0-9]*$/,Ll=/^[a-f0-9]*$/;function kd(e){return Ol(crypto.getRandomValues(new Uint8Array(e)))}z.randomBytesHex=kd;function Ol(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}z.uint8ArrayToHex=Ol;function Id(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}z.hexStringToUint8Array=Id;function xd(e,t=!1){const r=e.toString("hex");return(0,_t.HexString)(t?`0x${r}`:r)}z.hexStringFromBuffer=xd;function Ad(e){return(0,_t.BigIntString)(e.toString(10))}z.bigIntStringFromBN=Ad;function Td(e){return(0,_t.IntNumber)(new Gt.default(Wn(e,!1),16).toNumber())}z.intNumberFromHexString=Td;function Nd(e){return(0,_t.HexString)(`0x${new Gt.default(e).toString(16)}`)}z.hexStringFromIntNumber=Nd;function Vo(e){return e.startsWith("0x")||e.startsWith("0X")}z.has0xPrefix=Vo;function zi(e){return Vo(e)?e.slice(2):e}z.strip0x=zi;function Pl(e){return Vo(e)?`0x${e.slice(2)}`:`0x${e}`}z.prepend0x=Pl;function Un(e){if(typeof e!="string")return!1;const t=zi(e).toLowerCase();return Ll.test(t)}z.isHexString=Un;function $l(e,t=!1){if(typeof e=="string"){const r=zi(e).toLowerCase();if(Ll.test(r))return(0,_t.HexString)(t?`0x${r}`:r)}throw kr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}z.ensureHexString=$l;function Wn(e,t=!1){let r=$l(e,!1);return r.length%2===1&&(r=(0,_t.HexString)(`0${r}`)),t?(0,_t.HexString)(`0x${r}`):r}z.ensureEvenLengthHexString=Wn;function Ld(e){if(typeof e=="string"){const t=zi(e).toLowerCase();if(Un(t)&&t.length===40)return(0,_t.AddressString)(Pl(t))}throw kr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}z.ensureAddressString=Ld;function Od(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(Un(e)){const t=Wn(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw kr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}z.ensureBuffer=Od;function Bl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,_t.IntNumber)(e);if(typeof e=="string"){if(Nl.test(e))return(0,_t.IntNumber)(Number(e));if(Un(e))return(0,_t.IntNumber)(new Gt.default(Wn(e,!1),16).toNumber())}throw kr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}z.ensureIntNumber=Bl;function Pd(e){if(e instanceof RegExp)return(0,_t.RegExpString)(e.toString());throw kr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}z.ensureRegExpString=Pd;function $d(e){if(e!==null&&(Gt.default.isBN(e)||Dl(e)))return new Gt.default(e.toString(10),10);if(typeof e=="number")return new Gt.default(Bl(e));if(typeof e=="string"){if(Nl.test(e))return new Gt.default(e,10);if(Un(e))return new Gt.default(Wn(e,!1),16)}throw kr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}z.ensureBN=$d;function Bd(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw kr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}z.ensureParsedJSONObject=Bd;function Dl(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}z.isBigNumber=Dl;function Dd(e,t){return Array.from({length:t-e},(r,n)=>e+n)}z.range=Dd;function Fd(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}z.getFavicon=Fd;function jd(e,t,r,n,i,s){const o=n?"parent-id":"id",c=new URLSearchParams({[o]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${c}`}z.createQrUrl=jd;function Fl(){try{return window.frameElement!==null}catch{return!1}}z.isInIFrame=Fl;function Hd(){try{return Fl()&&window.top?window.top.location:window.location}catch{return window.location}}z.getLocation=Hd;function Ud(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}z.isMobileWeb=Ud;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.ScopedLocalStorage=void 0;class Wd{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Gi.ScopedLocalStorage=Wd;var on={};const Vd=gn(pd);var Vn={},qn={},vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.EVENTS=void 0;vn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.RelayAbstract=gt.APP_VERSION_KEY=gt.LOCAL_STORAGE_ADDRESSES_KEY=gt.WALLET_USER_NAME_KEY=void 0;const Pa=jn;gt.WALLET_USER_NAME_KEY="walletUsername";gt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";gt.APP_VERSION_KEY="AppVersion";class qd{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Pa.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Pa.serializeError)(s,t.method);return i})}}gt.RelayAbstract=qd;var bn={},jl={exports:{}},So={exports:{}};typeof Object.create=="function"?So.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:So.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var Et=So.exports,Ro={exports:{}};(function(e,t){var r=Fn,n=r.Buffer;function i(o,c){for(var u in o)c[u]=o[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(o,c,u){return n(o,c,u)}i(n,s),s.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,c,u)},s.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return c!==void 0?typeof u=="string"?l.fill(c,u):l.fill(c):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(Ro,Ro.exports);var Ir=Ro.exports,Hl=Ir.Buffer;function Ji(e,t){this._block=Hl.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Ji.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Hl.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};Ji.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var yn=Ji,zd=Et,Ul=yn,Gd=Ir.Buffer,Jd=[1518500249,1859775393,-1894007588,-899497514],Zd=new Array(80);function zn(){this.init(),this._w=Zd,Ul.call(this,64,56)}zd(zn,Ul);zn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Kd(e){return e<<5|e>>>27}function Qd(e){return e<<30|e>>>2}function Yd(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}zn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var u=0;u<80;++u){var l=~~(u/20),p=Kd(r)+Yd(l,n,i,s)+o+t[u]+Jd[l]|0;o=s,s=i,i=Qd(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};zn.prototype._hash=function(){var e=Gd.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Xd=zn,ef=Et,Wl=yn,tf=Ir.Buffer,rf=[1518500249,1859775393,-1894007588,-899497514],nf=new Array(80);function Gn(){this.init(),this._w=nf,Wl.call(this,64,56)}ef(Gn,Wl);Gn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function sf(e){return e<<1|e>>>31}function of(e){return e<<5|e>>>27}function af(e){return e<<30|e>>>2}function cf(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Gn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=sf(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var u=0;u<80;++u){var l=~~(u/20),p=of(r)+cf(l,n,i,s)+o+t[u]+rf[l]|0;o=s,s=i,i=af(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Gn.prototype._hash=function(){var e=tf.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var lf=Gn,uf=Et,Vl=yn,hf=Ir.Buffer,df=[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],ff=new Array(64);function Jn(){this.init(),this._w=ff,Vl.call(this,64,56)}uf(Jn,Vl);Jn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function pf(e,t,r){return r^e&(t^r)}function gf(e,t,r){return e&t|r&(e|t)}function _f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function mf(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function vf(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function bf(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Jn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=this._f|0,u=this._g|0,l=this._h|0,p=0;p<16;++p)t[p]=e.readInt32BE(p*4);for(;p<64;++p)t[p]=bf(t[p-2])+t[p-7]+vf(t[p-15])+t[p-16]|0;for(var f=0;f<64;++f){var _=l+mf(o)+pf(o,c,u)+df[f]+t[f]|0,R=_f(r)+gf(r,n,i)|0;l=u,u=c,c=o,o=s+_|0,s=i,i=n,n=r,r=_+R|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=c+this._f|0,this._g=u+this._g|0,this._h=l+this._h|0};Jn.prototype._hash=function(){var e=hf.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var ql=Jn,yf=Et,wf=ql,Ef=yn,Sf=Ir.Buffer,Rf=new Array(64);function Zi(){this.init(),this._w=Rf,Ef.call(this,64,56)}yf(Zi,wf);Zi.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Zi.prototype._hash=function(){var e=Sf.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Cf=Zi,Mf=Et,zl=yn,kf=Ir.Buffer,$a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],If=new Array(160);function Zn(){this.init(),this._w=If,zl.call(this,128,112)}Mf(Zn,zl);Zn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ba(e,t,r){return r^e&(t^r)}function Da(e,t,r){return e&t|r&(e|t)}function Fa(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ja(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function xf(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Af(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Tf(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Nf(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ke(e,t){return e>>>0>>0?1:0}Zn.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,c=this._fh|0,u=this._gh|0,l=this._hh|0,p=this._al|0,f=this._bl|0,_=this._cl|0,R=this._dl|0,x=this._el|0,P=this._fl|0,L=this._gl|0,C=this._hl|0,k=0;k<32;k+=2)t[k]=e.readInt32BE(k*4),t[k+1]=e.readInt32BE(k*4+4);for(;k<160;k+=2){var N=t[k-30],$=t[k-15*2+1],O=xf(N,$),D=Af($,N);N=t[k-2*2],$=t[k-2*2+1];var G=Tf(N,$),V=Nf($,N),H=t[k-7*2],X=t[k-7*2+1],Q=t[k-16*2],ie=t[k-16*2+1],v=D+X|0,a=O+H+Ke(v,D)|0;v=v+V|0,a=a+G+Ke(v,V)|0,v=v+ie|0,a=a+Q+Ke(v,ie)|0,t[k]=a,t[k+1]=v}for(var d=0;d<160;d+=2){a=t[d],v=t[d+1];var g=Da(r,n,i),m=Da(p,f,_),y=Fa(r,p),M=Fa(p,r),A=ja(o,x),b=ja(x,o),h=$a[d],S=$a[d+1],W=Ba(o,c,u),q=Ba(x,P,L),I=C+b|0,T=l+A+Ke(I,C)|0;I=I+q|0,T=T+W+Ke(I,q)|0,I=I+S|0,T=T+h+Ke(I,S)|0,I=I+v|0,T=T+a+Ke(I,v)|0;var B=M+m|0,U=y+g+Ke(B,M)|0;l=u,C=L,u=c,L=P,c=o,P=x,x=R+I|0,o=s+T+Ke(x,R)|0,s=i,R=_,i=n,_=f,n=r,f=p,p=I+B|0,r=T+U+Ke(p,I)|0}this._al=this._al+p|0,this._bl=this._bl+f|0,this._cl=this._cl+_|0,this._dl=this._dl+R|0,this._el=this._el+x|0,this._fl=this._fl+P|0,this._gl=this._gl+L|0,this._hl=this._hl+C|0,this._ah=this._ah+r+Ke(this._al,p)|0,this._bh=this._bh+n+Ke(this._bl,f)|0,this._ch=this._ch+i+Ke(this._cl,_)|0,this._dh=this._dh+s+Ke(this._dl,R)|0,this._eh=this._eh+o+Ke(this._el,x)|0,this._fh=this._fh+c+Ke(this._fl,P)|0,this._gh=this._gh+u+Ke(this._gl,L)|0,this._hh=this._hh+l+Ke(this._hl,C)|0};Zn.prototype._hash=function(){var e=kf.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Gl=Zn,Lf=Et,Of=Gl,Pf=yn,$f=Ir.Buffer,Bf=new Array(160);function Ki(){this.init(),this._w=Bf,Pf.call(this,128,112)}Lf(Ki,Of);Ki.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ki.prototype._hash=function(){var e=$f.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Df=Ki,xr=jl.exports=function(t){t=t.toLowerCase();var r=xr[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};xr.sha=Xd;xr.sha1=lf;xr.sha224=Cf;xr.sha256=ql;xr.sha384=Df;xr.sha512=Gl;var Ff=jl.exports;Object.defineProperty(bn,"__esModule",{value:!0});bn.Session=void 0;const Ha=Ff,Ua=z,Wa="session:id",Va="session:secret",qa="session:linked";class qo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Ua.randomBytesHex)(16),this._secret=n||(0,Ua.randomBytesHex)(32),this._key=new Ha.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Wa),n=t.getItem(qa),i=t.getItem(Va);return r&&i?new qo(t,r,i,n==="1"):null}static hash(t){return new Ha.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Wa,this._id),this._storage.setItem(Va,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(qa,this._linked?"1":"0")}}bn.Session=qo;var Qi={},Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.Cipher=void 0;const fi=z;class jf{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,fi.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),c=16,u=o.slice(o.byteLength-c),l=o.slice(0,o.byteLength-c),p=new Uint8Array(u),f=new Uint8Array(l),_=new Uint8Array([...n,...p,...f]);return(0,fi.uint8ArrayToHex)(_)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,fi.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,fi.hexStringToUint8Array)(t),c=o.slice(0,12),u=o.slice(12,28),l=o.slice(28),p=new Uint8Array([...l,...u]),f={name:"AES-GCM",iv:new Uint8Array(c)};try{const _=await window.crypto.subtle.decrypt(f,s,p),R=new TextDecoder;n(R.decode(_))}catch(_){i(_)}})()})}}Yi.Cipher=jf;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.WalletLinkHTTP=void 0;class Hf{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Xi.WalletLinkHTTP=Hf;var an={};Object.defineProperty(an,"__esModule",{value:!0});an.WalletLinkWebSocket=an.ConnectionState=void 0;var Xr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Xr||(an.ConnectionState=Xr={}));class Uf{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Xr.CONNECTING),i.onclose=s=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Xr.DISCONNECTED)},i.onopen=s=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Xr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(u=>this.sendData(u)),this.pendingData=[])},i.onmessage=s=>{var o,c;if(s.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const u=JSON.parse(s.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,u)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Xr.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}an.WalletLinkWebSocket=Uf;Object.defineProperty(Qi,"__esModule",{value:!0});Qi.WalletLinkConnection=void 0;const zr=Je,Wf=Yi,Mt=vn,za=gt,Gr=bn,Vf=Xi,pi=an,Ga=1e4,qf=6e4;class zf{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,zr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>c.JsonRpcUrl&&this.handleChainUpdated(l,c.JsonRpcUrl)]]).forEach((l,p)=>{const f=c[p];f!==void 0&&l(f)})},this.handleDestroyed=c=>{var u,l;c==="1"&&((u=this.listener)===null||u===void 0||u.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(Mt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Gr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var u,l;try{const p=await this.cipher.decrypt(c);(u=this.listener)===null||u===void 0||u.accountUpdated(p)}catch{(l=this.diagnostic)===null||l===void 0||l.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,u)=>{var l,p;try{const f=await this.cipher.decrypt(u);(l=this.listener)===null||l===void 0||l.metadataUpdated(c,f)}catch{(p=this.diagnostic)===null||p===void 0||p.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(za.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(za.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,u)=>{var l,p;try{const f=await this.cipher.decrypt(c),_=await this.cipher.decrypt(u);(l=this.listener)===null||l===void 0||l.chainUpdated(f,_)}catch{(p=this.diagnostic)===null||p===void 0||p.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Wf.Cipher(t.secret),this.diagnostic=i,this.listener=n;const o=new pi.WalletLinkWebSocket(`${r}/rpc`,s);o.setConnectionStateListener(async c=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(Mt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:Gr.Session.hash(t.id)});let l=!1;switch(c){case pi.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(f=>setTimeout(f,5e3)),this.destroyed||o.connect().catch(()=>{p()})};p()}break;case pi.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ga),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case pi.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(c=>{var u,l,p;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const f=c.type==="IsLinkedOK"?c.linked:void 0;(u=this.diagnostic)===null||u===void 0||u.log(Mt.EVENTS.LINKED,{sessionIdHash:Gr.Session.hash(t.id),linked:f,type:c.type,onlineGuests:c.onlineGuests}),this.linked=f||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(Mt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Gr.Session.hash(t.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((p=this.requestResolutions.get(c.id))===null||p===void 0||p(c))}),this.ws=o,this.http=new Vf.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Mt.EVENTS.STARTED_CONNECTING,{sessionIdHash:Gr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Mt.EVENTS.DISCONNECTED,{sessionIdHash:Gr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ga*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=qf){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,o)=>{i=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,o=>{clearTimeout(i),s(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Qi.WalletLinkConnection=zf;var Kn={},Qn={},zo={};Object.defineProperty(zo,"__esModule",{value:!0});zo.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Gf=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.injectCssReset=void 0;const Jf=Gf(zo);function Zf(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Jf.default)),document.documentElement.appendChild(e)}Qn.injectCssReset=Zf;var es={},Yn,He,Jl,Zl,gr,Ja,Kl,Co,Go,Mo,ko,Ql,Pn={},Yl=[],Kf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ts=Array.isArray;function jt(e,t){for(var r in t)e[r]=t[r];return e}function Xl(e){var t=e.parentNode;t&&t.removeChild(e)}function Io(e,t,r){var n,i,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Yn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return An(e,o,n,i,null)}function An(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Jl,__i:-1,__u:0};return i==null&&He.vnode!=null&&He.vnode(s),s}function Qf(){return{current:null}}function Xn(e){return e.children}function Tn(e,t){this.props=e,this.context=t}function Sr(e,t){if(t==null)return e.__?Sr(e.__,e.__i+1):null;for(var r;tt&&gr.sort(Co));Ni.__r=0}function tu(e,t,r,n,i,s,o,c,u,l,p){var f,_,R,x,P,L=n&&n.__k||Yl,C=t.length;for(r.__d=u,Yf(r,t,L),u=r.__d,f=0;f0?An(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,c=Xf(i,r,o,p),i.__i=c,s=null,c!==-1&&(p--,(s=r[c])&&(s.__u|=131072)),s==null||s.__v===null?(c==-1&&f--,typeof i.type!="function"&&(i.__u|=65536)):c!==o&&(c===o+1?f++:c>o?p>u-o?f+=c-o:f--:c(u!=null&&!(131072&u.__u)?1:0))for(;o>=0||c=0){if((u=t[o])&&!(131072&u.__u)&&i==u.key&&s===u.type)return o;o--}if(c2&&(c.children=arguments.length>3?Yn.call(arguments,2):r),An(e.type,c,n||e.key,i||e.ref,null)}function n0(e,t){var r={__c:t="__cC"+Ql++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(c){c.__e=!0,xo(c)})},this.sub=function(o){i.push(o);var c=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),c&&c.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Yn=Yl.slice,He={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(c){e=c}throw e}},Jl=0,Zl=function(e){return e!=null&&e.constructor==null},Tn.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=jt({},this.state),typeof e=="function"&&(e=e(jt({},r),this.props)),e&&jt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),xo(this))},Tn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),xo(this))},Tn.prototype.render=Xn,gr=[],Kl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Co=function(e,t){return e.__v.__b-t.__v.__b},Ni.__r=0,Go=0,Mo=Ka(!1),ko=Ka(!0),Ql=0;const i0=Object.freeze(Object.defineProperty({__proto__:null,Component:Tn,Fragment:Xn,cloneElement:r0,createContext:n0,createElement:Io,createRef:Qf,h:Io,hydrate:ou,get isValidElement(){return Zl},get options(){return He},render:su,toChildArray:nu},Symbol.toStringTag,{value:"Module"})),ot=gn(i0);var rs={};function au(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t=r.__.length&&r.__.push({__V:Ii}),r.__[e]}function lu(e){return cn=1,uu(du,e)}function uu(e,t,r){var n=Ar(Ut++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):du(void 0,t),function(c){var u=n.__N?n.__N[0]:n.__[0],l=n.t(u,c);u!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=pe,!pe.u)){var i=function(c,u,l){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(_){return!!_.__c});if(p.every(function(_){return!_.__N}))return!s||s.call(this,c,u,l);var f=!1;return p.forEach(function(_){if(_.__N){var R=_.__[0];_.__=_.__N,_.__N=void 0,R!==_.__[0]&&(f=!0)}}),!(!f&&n.__c.props===c)&&(!s||s.call(this,c,u,l))};pe.u=!0;var s=pe.shouldComponentUpdate,o=pe.componentWillUpdate;pe.componentWillUpdate=function(c,u,l){if(this.__e){var p=s;s=void 0,i(c,u,l),s=p}o&&o.call(this,c,u,l)},pe.shouldComponentUpdate=i}return n.__N||n.__}function o0(e,t){var r=Ar(Ut++,3);!Ve.__s&&Qo(r.__H,t)&&(r.__=e,r.i=t,pe.__H.__h.push(r))}function hu(e,t){var r=Ar(Ut++,4);!Ve.__s&&Qo(r.__H,t)&&(r.__=e,r.i=t,pe.__h.push(r))}function a0(e){return cn=5,Ko(function(){return{current:e}},[])}function c0(e,t,r){cn=6,hu(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Ko(e,t){var r=Ar(Ut++,7);return Qo(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function l0(e,t){return cn=8,Ko(function(){return e},t)}function u0(e){var t=pe.context[e.__c],r=Ar(Ut++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(pe)),t.props.value):e.__}function h0(e,t){Ve.useDebugValue&&Ve.useDebugValue(t?t(e):e)}function d0(e){var t=Ar(Ut++,10),r=lu();return t.__=e,pe.componentDidCatch||(pe.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function f0(){var e=Ar(Ut++,11);if(!e.__){for(var t=pe.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function p0(){for(var e;e=cu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xi),e.__H.__h.forEach(To),e.__H.__h=[]}catch(t){e.__H.__h=[],Ve.__e(t,e.__v)}}Ve.__b=function(e){pe=null,Xa&&Xa(e)},Ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ic&&ic(e,t)},Ve.__r=function(e){ec&&ec(e),Ut=0;var t=(pe=e.__c).__H;t&&(Ws===pe?(t.__h=[],pe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Ii,r.__N=r.i=void 0})):(t.__h.forEach(xi),t.__h.forEach(To),t.__h=[],Ut=0)),Ws=pe},Ve.diffed=function(e){tc&&tc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(cu.push(t)!==1&&Ya===Ve.requestAnimationFrame||((Ya=Ve.requestAnimationFrame)||g0)(p0)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Ii&&(r.__=r.__V),r.i=void 0,r.__V=Ii})),Ws=pe=null},Ve.__c=function(e,t){t.some(function(r){try{r.__h.forEach(xi),r.__h=r.__h.filter(function(n){return!n.__||To(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ve.__e(n,r.__v)}}),rc&&rc(e,t)},Ve.unmount=function(e){nc&&nc(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{xi(n)}catch(i){t=i}}),r.__H=void 0,t&&Ve.__e(t,r.__v))};var sc=typeof requestAnimationFrame=="function";function g0(e){var t,r=function(){clearTimeout(n),sc&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);sc&&(t=requestAnimationFrame(r))}function xi(e){var t=pe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),pe=t}function To(e){var t=pe;e.__c=e.__(),pe=t}function Qo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function du(e,t){return typeof t=="function"?t(e):t}const _0=Object.freeze(Object.defineProperty({__proto__:null,useCallback:l0,useContext:u0,useDebugValue:h0,useEffect:o0,useErrorBoundary:d0,useId:f0,useImperativeHandle:c0,useLayoutEffect:hu,useMemo:Ko,useReducer:uu,useRef:a0,useState:lu},Symbol.toStringTag,{value:"Module"})),ns=gn(_0);var ln={},is={};Object.defineProperty(is,"__esModule",{value:!0});is.CloseIcon=void 0;const oc=ot;function m0(e){return(0,oc.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,oc.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}is.CloseIcon=m0;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.CoinbaseWalletRound=void 0;const _i=ot;function v0(e){return(0,_i.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,_i.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,_i.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,_i.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}ss.CoinbaseWalletRound=v0;var os={};Object.defineProperty(os,"__esModule",{value:!0});os.QRCodeIcon=void 0;const Cn=ot;function b0(e){return(0,Cn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Cn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Cn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Cn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Cn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}os.QRCodeIcon=b0;var as={};function fu(e){this.mode=ut.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}fu.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Nt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=We.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=We.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var c=0;c<2;c++)if(this.modules[n][o-c]==null){var u=!1;s>>i&1)==1);var l=We.getMask(t,n,o-c);l&&(u=!u),this.modules[n][o-c]=u,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Nt.PAD0=236;Nt.PAD1=17;Nt.createData=function(e,t,r){for(var n=Tt.getRSBlocks(e,t),i=new pu,s=0;sc*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(Nt.PAD0,8),i.getLengthInBits()>=c*8));)i.put(Nt.PAD1,8);return Nt.createBytes(i,n)};Nt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),o=new Array(t.length),c=0;c=0?R.get(x):0}}for(var P=0,p=0;p=0;)t^=We.G15<=0;)t^=We.G18<>>=1;return t},getPatternPosition:function(e){return We.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case qt.PATTERN000:return(t+r)%2==0;case qt.PATTERN001:return t%2==0;case qt.PATTERN010:return r%3==0;case qt.PATTERN011:return(t+r)%3==0;case qt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case qt.PATTERN101:return t*r%2+t*r%3==0;case qt.PATTERN110:return(t*r%2+t*r%3)%2==0;case qt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new en([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)e-=255;return Ye.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var et=0;et<8;et++)Ye.EXP_TABLE[et]=1<>>7-e%8&1)==1},put:function(e,t){for(var r=0;r>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Vs=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function gu(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(u){switch(u){case"L":return Jt.L;case"M":return Jt.M;case"Q":return Jt.Q;case"H":return Jt.H;default:throw new Error("Unknwon error correction level: "+u)}}function n(u,l){for(var p=i(u),f=1,_=0,R=0,x=Vs.length;R<=x;R++){var P=Vs[R];if(!P)throw new Error("Content too long: expected "+_+" but got "+p);switch(l){case"L":_=P[0];break;case"M":_=P[1];break;case"Q":_=P[2];break;case"H":_=P[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(p<=_)break;f++}if(f>Vs.length)throw new Error("Content too long");return f}function i(u){var l=encodeURI(u).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=u?3:0)}var s=this.options.content,o=n(s,this.options.ecl),c=r(this.options.ecl);this.qrcode=new Nt(o,c),this.qrcode.addData(s),this.qrcode.make()}gu.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r +`:"",o=t.width,c=t.height,u=r.length,l=o/(u+2*t.padding),p=c/(u+2*t.padding),f=typeof t.join<"u"?!!t.join:!1,_=typeof t.swap<"u"?!!t.swap:!1,R=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,x=typeof t.predefined<"u"?!!t.predefined:!1,P=x?i+''+s:"",L=i+''+s,C="",k="",N=0;N'+s:C+=i+''+s}}f&&(C=i+'');let Q="";if(this.options.image!==void 0&&this.options.image.svg){const v=o*this.options.image.width/100,a=c*this.options.image.height/100,d=o/2-v/2,g=c/2-a/2;Q+=``,Q+=this.options.image.svg+s,Q+=""}var ie="";switch(e.container){case"svg":R&&(ie+=''+s),ie+=''+s,ie+=P+L+C,ie+=Q,ie+="";break;case"svg-viewbox":R&&(ie+=''+s),ie+=''+s,ie+=P+L+C,ie+=Q,ie+="";break;case"g":ie+=''+s,ie+=P+L+C,ie+=Q,ie+="";break;default:ie+=(P+L+C+Q).replace(/^\s+/,"");break}return ie};var y0=gu,w0=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(as,"__esModule",{value:!0});as.QRCode=void 0;const E0=ot,ac=ns,S0=w0(y0),R0=e=>{const[t,r]=(0,ac.useState)("");return(0,ac.useEffect)(()=>{var n,i;const s=new S0.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,E0.h)("img",{src:t,alt:"QR Code"}):null};as.QRCode=R0;var cs={},Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var C0=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.Spinner=void 0;const mi=ot,M0=C0(Yo),k0=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,mi.h)("div",{class:"-cbwsdk-spinner"},(0,mi.h)("style",null,M0.default),(0,mi.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,mi.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};cs.Spinner=k0;var Xo={};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var _u=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ln,"__esModule",{value:!0});ln.CoinbaseWalletSteps=ln.ConnectContent=void 0;const Er=_u(ei),oe=ot,I0=z,x0=mn,A0=is,T0=ss,N0=os,L0=as,O0=cs,P0=_u(Xo),qs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:mu},$0=e=>e==="light"?"#FFFFFF":"#0A0B0D";function B0(e){const{theme:t}=e,r=(0,I0.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=qs.steps;return(0,oe.h)("div",{"data-testid":"connect-content",className:(0,Er.default)("-cbwsdk-connect-content",t)},(0,oe.h)("style",null,P0.default),(0,oe.h)("div",{className:"-cbwsdk-connect-content-header"},(0,oe.h)("h2",{className:(0,Er.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,oe.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,oe.h)(A0.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,oe.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,oe.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,oe.h)(D0,{title:qs.title,description:qs.description,theme:t})),(0,oe.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,oe.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,oe.h)(L0.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,oe.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:x0.LIB_VERSION}),(0,oe.h)("input",{type:"hidden",value:r})),(0,oe.h)(n,{theme:t}),!e.isConnected&&(0,oe.h)("div",{"data-testid":"connecting-spinner",className:(0,Er.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,oe.h)(O0.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,oe.h)("p",null,"Connecting...")))))}ln.ConnectContent=B0;function D0({title:e,description:t,theme:r}){return(0,oe.h)("div",{className:(0,Er.default)("-cbwsdk-connect-item",r)},(0,oe.h)("div",null,(0,oe.h)(T0.CoinbaseWalletRound,null)),(0,oe.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,oe.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,oe.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function mu({theme:e}){return(0,oe.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,oe.h)("li",{className:(0,Er.default)("-cbwsdk-wallet-steps-item",e)},(0,oe.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,oe.h)("li",{className:(0,Er.default)("-cbwsdk-wallet-steps-item",e)},(0,oe.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,oe.h)("span",null,"Tap ",(0,oe.h)("strong",null,"Scan")," "),(0,oe.h)("span",{className:(0,Er.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,oe.h)(N0.QRCodeIcon,{fill:$0(e)})))))}ln.CoinbaseWalletSteps=mu;var ls={},us={};Object.defineProperty(us,"__esModule",{value:!0});us.ArrowLeftIcon=void 0;const cc=ot;function F0(e){return(0,cc.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,cc.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}us.ArrowLeftIcon=F0;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.LaptopIcon=void 0;const zs=ot;function j0(e){return(0,zs.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,zs.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,zs.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}hs.LaptopIcon=j0;var ds={};Object.defineProperty(ds,"__esModule",{value:!0});ds.SafeIcon=void 0;const lc=ot;function H0(e){return(0,lc.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,lc.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}ds.SafeIcon=H0;var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var vu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ls,"__esModule",{value:!0});ls.TryExtensionContent=void 0;const hr=vu(ei),Ge=ot,Gs=ns,U0=us,W0=hs,V0=ds,q0=vu(ea);function z0({theme:e}){const[t,r]=(0,Gs.useState)(!1),n=(0,Gs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Gs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension",e)},(0,Ge.h)("style",null,q0.default),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("h3",{class:(0,hr.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ge.h)("button",{class:(0,hr.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Ge.h)("div",null,!t&&(0,Ge.h)(U0.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(W0.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(V0.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ls.TryExtensionContent=z0;var ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var bu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rs,"__esModule",{value:!0});rs.ConnectDialog=void 0;const Js=bu(ei),dr=ot,Zs=ns,G0=ln,J0=ls,Z0=bu(ta),K0=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,Zs.useState)(!t),[s,o]=(0,Zs.useState)(!t);(0,Zs.useEffect)(()=>{const u=[window.setTimeout(()=>{o(!t)},10)];return t?i(!1):u.push(window.setTimeout(()=>{i(!0)},360)),()=>{u.forEach(window.clearTimeout)}},[t]);const c=r?"dark":"light";return(0,dr.h)("div",{class:(0,Js.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,dr.h)("style",null,Z0.default),(0,dr.h)("div",{class:(0,Js.default)("-cbwsdk-connect-dialog-backdrop",c,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,dr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,dr.h)("div",{class:(0,Js.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,dr.h)(G0.ConnectContent,{theme:c,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,dr.h)(J0.TryExtensionContent,{theme:c}))))};rs.ConnectDialog=K0;Object.defineProperty(es,"__esModule",{value:!0});es.LinkFlow=void 0;const Ks=ot,Q0=rs;class Y0{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Ks.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Ks.render)((0,Ks.h)(Q0.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}es.LinkFlow=Y0;var ra={},na={};Object.defineProperty(na,"__esModule",{value:!0});na.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=J&&J.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(ei),n=ot,i=ns,s=t(na),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class u{constructor(_){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=_.darkMode}attach(_){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",_.appendChild(this.root),this.render()}presentItem(_){const R=this.nextItemKey++;return this.items.set(R,_),this.render(),()=>{this.items.delete(R),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([_,R])=>(0,n.h)(e.SnackbarInstance,Object.assign({},R,{key:_}))))),this.root)}}e.Snackbar=u;const l=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));e.SnackbarContainer=l;const p=({autoExpand:f,message:_,menuItems:R})=>{const[x,P]=(0,i.useState)(!0),[L,C]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const N=[window.setTimeout(()=>{P(!1)},1),window.setTimeout(()=>{C(!0)},1e4)];return()=>{N.forEach(window.clearTimeout)}});const k=()=>{C(!L)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",x&&"-cbwsdk-snackbar-instance-hidden",L&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:k},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},_),(0,n.h)("div",{class:"-gear-container"},!L&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),R&&R.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},R.map((N,$)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",N.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:N.onClick,key:$},(0,n.h)("svg",{width:N.svgWidth,height:N.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":N.defaultFillRule,"clip-rule":N.defaultClipRule,d:N.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",N.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},N.info)))))};e.SnackbarInstance=p})(ra);Object.defineProperty(Kn,"__esModule",{value:!0});Kn.WalletLinkRelayUI=void 0;const X0=Qn,ep=es,tp=ra;class rp{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new tp.Snackbar({darkMode:t.darkMode}),this.linkFlow=new ep.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,X0.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Kn.WalletLinkRelayUI=rp;Object.defineProperty(qn,"__esModule",{value:!0});qn.WalletLinkRelay=void 0;const Jr=jn,np=Je,Ue=z,fr=vn,uc=gt,zt=bn,ip=Qi,pr=_n,sp=Kn;class Dt extends uc.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var c;this.isLinked=o;const u=this.storage.getItem(uc.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,u){const l=u.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(l[0]!==""&&!o&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const f=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(fr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:f})}}},this.metadataUpdated=(o,c)=>{this.storage.setItem(o,c)},this.chainUpdated=(o,c)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:o,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(o,c))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),Dt.accountRequestCallbackIds.size>0&&(Array.from(Dt.accountRequestCallbackIds.values()).forEach(c=>{const u={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},u),{id:c}))}),Dt.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=zt.Session.load(this.storage)||new zt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new ip.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:o}=this.options,c=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:o,session:t});return i.connect(),{session:t,ui:c,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(fr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=zt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:zt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:o,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Ue.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Ue.hexStringFromBuffer)(t,!0),signature:(0,Ue.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ue.bigIntStringFromBN)(t.weiValue),data:(0,Ue.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Ue.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ue.bigIntStringFromBN)(t.weiValue),data:(0,Ue.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Ue.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Ue.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Ue.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Ue.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Ue.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Ue.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,u=>{if(r==null||r(),(0,pr.isErrorResponse)(u))return c(new Error(u.errorMessage));o(u)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof sp.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=zt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(fr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?zt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(o=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(fr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?zt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Dt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Dt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Jr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Ue.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,o)=>{if(this.relayEventManager.callbacks.set(r,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,pr.isErrorResponse)(c))return o(new Error(c.errorMessage));s(c)}),this.ui.inlineAccountsResponse()){const c=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:u}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:c})}else{const c=Jr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(c)})}Dt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Ue.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,c)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,pr.isErrorResponse)(p))return c(new Error(p.errorMessage));o(p)});const u=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:np.ProviderType.Unselected}})},l=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:u,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,o){const c={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let u=null;const l=(0,Ue.randomBytesHex)(8),p=_=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,c.method,_),u==null||u()};this.ui.inlineWatchAsset()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const f=new Promise((_,R)=>{this.relayEventManager.callbacks.set(l,L=>{if(u==null||u(),(0,pr.isErrorResponse)(L))return R(new Error(L.errorMessage));_(L)});const x=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},P=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:P,onCancel:x,type:t,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,c)});return{cancel:p,promise:f}}addEthereumChain(t,r,n,i,s,o){const c={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let u=null;const l=(0,Ue.randomBytesHex)(8),p=_=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,c.method,_),u==null||u()};return this.ui.inlineAddEthereumChain(t)||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((_,R)=>{this.relayEventManager.callbacks.set(l,L=>{if(u==null||u(),(0,pr.isErrorResponse)(L))return R(new Error(L.errorMessage));_(L)});const x=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},P=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:L}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:x,onApprove:P,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,c)}),cancel:p}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,Ue.randomBytesHex)(8),s=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,u)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,pr.isErrorResponse)(f)&&f.errorCode)return u(Jr.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,pr.isErrorResponse)(f))return u(new Error(f.errorMessage));c(f)});const l=f=>{var _;if(f){const R=(_=(0,Jr.getErrorCode)(f))!==null&&_!==void 0?_:Jr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",f instanceof Error?f:Jr.standardErrors.provider.unsupportedChain(t),R)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:f}}})};this.ui.switchEthereumChain({onCancel:l,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return zt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}qn.WalletLinkRelay=Dt;Dt.accountRequestCallbackIds=new Set;var ti={},fs={},yu={};(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,c)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(ra,e)})(yu);var ia={};Object.defineProperty(ia,"__esModule",{value:!0});ia.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var wu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fs,"__esModule",{value:!0});fs.RedirectDialog=void 0;const op=wu(ei),At=ot,ap=Qn,cp=yu,lp=wu(ia);class up{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,ap.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,At.render)(null,this.root),t&&(0,At.render)((0,At.h)(hp,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}fs.RedirectDialog=up;const hp=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,At.h)(cp.SnackbarContainer,{darkMode:r},(0,At.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,At.h)("style",null,lp.default),(0,At.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,At.h)("div",{class:(0,op.default)("-cbwsdk-redirect-dialog-box",s)},(0,At.h)("p",null,e),(0,At.h)("button",{onClick:n},t))))};Object.defineProperty(ti,"__esModule",{value:!0});ti.MobileRelayUI=void 0;const dp=fs;class fp{constructor(t){this.attached=!1,this.darkMode=!1,this.openedWindow=null,this.redirectDialog=new dp.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}closeOpenedWindow(){var t;(t=this.openedWindow)===null||t===void 0||t.close(),this.openedWindow=null}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t),this.openedWindow=window.open(r.href,"cbw-opener"),this.openedWindow&&setTimeout(()=>this.closeOpenedWindow(),5e3)}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.closeOpenedWindow(),this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.closeOpenedWindow(),this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}ti.MobileRelayUI=fp;Object.defineProperty(Vn,"__esModule",{value:!0});Vn.MobileRelay=void 0;const pp=z,gp=qn,hc=ti;class _p extends gp.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,pp.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof hc.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t),this._enableMobileWalletLink&&this.ui instanceof hc.MobileRelayUI&&this.ui.closeOpenedWindow()}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}Vn.MobileRelay=_p;var No={exports:{}},Eu=Fi.EventEmitter,Qs,dc;function mp(){if(dc)return Qs;dc=1;function e(x,P){var L=Object.keys(x);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(x);P&&(C=C.filter(function(k){return Object.getOwnPropertyDescriptor(x,k).enumerable})),L.push.apply(L,C)}return L}function t(x){for(var P=1;P0?this.tail.next=C:this.head=C,this.tail=C,++this.length}},{key:"unshift",value:function(L){var C={data:L,next:this.head};this.length===0&&(this.tail=C),this.head=C,++this.length}},{key:"shift",value:function(){if(this.length!==0){var L=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,L}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(L){if(this.length===0)return"";for(var C=this.head,k=""+C.data;C=C.next;)k+=L+C.data;return k}},{key:"concat",value:function(L){if(this.length===0)return l.alloc(0);for(var C=l.allocUnsafe(L>>>0),k=this.head,N=0;k;)R(k.data,C,N),N+=k.data.length,k=k.next;return C}},{key:"consume",value:function(L,C){var k;return L$.length?$.length:L;if(O===$.length?N+=$:N+=$.slice(0,L),L-=O,L===0){O===$.length?(++k,C.next?this.head=C.next:this.head=this.tail=null):(this.head=C,C.data=$.slice(O));break}++k}return this.length-=k,N}},{key:"_getBuffer",value:function(L){var C=l.allocUnsafe(L),k=this.head,N=1;for(k.data.copy(C),L-=k.data.length;k=k.next;){var $=k.data,O=L>$.length?$.length:L;if($.copy(C,C.length-L,0,O),L-=O,L===0){O===$.length?(++N,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=$.slice(O));break}++N}return this.length-=N,C}},{key:_,value:function(L,C){return f(this,t(t({},C),{},{depth:0,customInspect:!1}))}}]),x}(),Qs}function vp(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Lo,this,e)):process.nextTick(Lo,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Ai,r):(r._writableState.errorEmitted=!0,process.nextTick(fc,r,s)):process.nextTick(fc,r,s):t?(process.nextTick(Ai,r),t(s)):process.nextTick(Ai,r)}),this)}function fc(e,t){Lo(e,t),Ai(e)}function Ai(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function bp(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Lo(e,t){e.emit("error",t)}function yp(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Su={destroy:vp,undestroy:bp,errorOrDestroy:yp},Tr={};function wp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Ru={};function vt(e,t,r){r||(r=Error);function n(s,o,c){return typeof t=="string"?t:t(s,o,c)}var i=function(s){wp(o,s);function o(c,u,l){return s.call(this,n(c,u,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=e,Ru[e]=i}function pc(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Ep(e,t,r){return e.substr(0,t.length)===t}function Sp(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Rp(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}vt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);vt("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&Ep(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Sp(e," argument"))i="The ".concat(e," ").concat(n," ").concat(pc(t,"type"));else{var s=Rp(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(pc(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);vt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");vt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});vt("ERR_STREAM_PREMATURE_CLOSE","Premature close");vt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});vt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");vt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");vt("ERR_STREAM_WRITE_AFTER_END","write after end");vt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);vt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);vt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Tr.codes=Ru;var Cp=Tr.codes.ERR_INVALID_OPT_VALUE;function Mp(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function kp(e,t,r,n){var i=Mp(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Cp(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Cu={getHighWaterMark:kp},Ip=xp;function xp(e,t){if(Ys("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Ys("throwDeprecation"))throw new Error(t);Ys("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Ys(e){try{if(!J.localStorage)return!1}catch{return!1}var t=J.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Xs,gc;function Mu(){if(gc)return Xs;gc=1,Xs=V;function e(I){var T=this;this.next=null,this.entry=null,this.finish=function(){q(T,I)}}var t;V.WritableState=D;var r={deprecate:Ip},n=Eu,i=Fn.Buffer,s=(typeof J<"u"?J:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(I){return i.from(I)}function c(I){return i.isBuffer(I)||I instanceof s}var u=Su,l=Cu,p=l.getHighWaterMark,f=Tr.codes,_=f.ERR_INVALID_ARG_TYPE,R=f.ERR_METHOD_NOT_IMPLEMENTED,x=f.ERR_MULTIPLE_CALLBACK,P=f.ERR_STREAM_CANNOT_PIPE,L=f.ERR_STREAM_DESTROYED,C=f.ERR_STREAM_NULL_VALUES,k=f.ERR_STREAM_WRITE_AFTER_END,N=f.ERR_UNKNOWN_ENCODING,$=u.errorOrDestroy;Et(V,n);function O(){}function D(I,T,B){t=t||un(),I=I||{},typeof B!="boolean"&&(B=T instanceof t),this.objectMode=!!I.objectMode,B&&(this.objectMode=this.objectMode||!!I.writableObjectMode),this.highWaterMark=p(this,I,"writableHighWaterMark",B),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=I.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(te){g(T,te)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=I.emitClose!==!1,this.autoDestroy=!!I.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}D.prototype.getBuffer=function(){for(var T=this.bufferedRequest,B=[];T;)B.push(T),T=T.next;return B},function(){try{Object.defineProperty(D.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var G;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(G=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(T){return G.call(this,T)?!0:this!==V?!1:T&&T._writableState instanceof D}})):G=function(T){return T instanceof this};function V(I){t=t||un();var T=this instanceof t;if(!T&&!G.call(V,this))return new V(I);this._writableState=new D(I,this,T),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),n.call(this)}V.prototype.pipe=function(){$(this,new P)};function H(I,T){var B=new k;$(I,B),process.nextTick(T,B)}function X(I,T,B,U){var te;return B===null?te=new C:typeof B!="string"&&!T.objectMode&&(te=new _("chunk",["string","Buffer"],B)),te?($(I,te),process.nextTick(U,te),!1):!0}V.prototype.write=function(I,T,B){var U=this._writableState,te=!1,w=!U.objectMode&&c(I);return w&&!i.isBuffer(I)&&(I=o(I)),typeof T=="function"&&(B=T,T=null),w?T="buffer":T||(T=U.defaultEncoding),typeof B!="function"&&(B=O),U.ending?H(this,B):(w||X(this,U,I,B))&&(U.pendingcb++,te=ie(this,U,w,I,T,B)),te},V.prototype.cork=function(){this._writableState.corked++},V.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&M(this,I))},V.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new N(T);return this._writableState.defaultEncoding=T,this},Object.defineProperty(V.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(I,T,B){return!I.objectMode&&I.decodeStrings!==!1&&typeof T=="string"&&(T=i.from(T,B)),T}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ie(I,T,B,U,te,w){if(!B){var E=Q(T,U,te);U!==E&&(B=!0,te="buffer",U=E)}var F=T.objectMode?1:U.length;T.length+=F;var j=T.length */var mc;function Ap(){return mc||(mc=1,function(e,t){var r=Fn,n=r.Buffer;function i(o,c){for(var u in o)c[u]=o[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(o,c,u){return n(o,c,u)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,c,u)},s.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return c!==void 0?typeof u=="string"?l.fill(c,u):l.fill(c):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}}(vi,vi.exports)),vi.exports}var vc;function bc(){if(vc)return to;vc=1;var e=Ap().Buffer,t=e.isEncoding||function(C){switch(C=""+C,C&&C.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(C){if(!C)return"utf8";for(var k;;)switch(C){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return C;default:if(k)return;C=(""+C).toLowerCase(),k=!0}}function n(C){var k=r(C);if(typeof k!="string"&&(e.isEncoding===t||!t(C)))throw new Error("Unknown encoding: "+C);return k||C}to.StringDecoder=i;function i(C){this.encoding=n(C);var k;switch(this.encoding){case"utf16le":this.text=f,this.end=_,k=4;break;case"utf8":this.fillLast=u,k=4;break;case"base64":this.text=R,this.end=x,k=3;break;default:this.write=P,this.end=L;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(k)}i.prototype.write=function(C){if(C.length===0)return"";var k,N;if(this.lastNeed){if(k=this.fillLast(C),k===void 0)return"";N=this.lastNeed,this.lastNeed=0}else N=0;return N>5===6?2:C>>4===14?3:C>>3===30?4:C>>6===2?-1:-2}function o(C,k,N){var $=k.length-1;if($=0?(O>0&&(C.lastNeed=O-1),O):--$=0?(O>0&&(C.lastNeed=O-2),O):--$=0?(O>0&&(O===2?O=0:C.lastNeed=O-3),O):0))}function c(C,k,N){if((k[0]&192)!==128)return C.lastNeed=0,"�";if(C.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return C.lastNeed=1,"�";if(C.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return C.lastNeed=2,"�"}}function u(C){var k=this.lastTotal-this.lastNeed,N=c(this,C);if(N!==void 0)return N;if(this.lastNeed<=C.length)return C.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);C.copy(this.lastChar,k,0,C.length),this.lastNeed-=C.length}function l(C,k){var N=o(this,C,k);if(!this.lastNeed)return C.toString("utf8",k);this.lastTotal=N;var $=C.length-(N-this.lastNeed);return C.copy(this.lastChar,0,$),C.toString("utf8",k,$)}function p(C){var k=C&&C.length?this.write(C):"";return this.lastNeed?k+"�":k}function f(C,k){if((C.length-k)%2===0){var N=C.toString("utf16le",k);if(N){var $=N.charCodeAt(N.length-1);if($>=55296&&$<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=C[C.length-2],this.lastChar[1]=C[C.length-1],N.slice(0,-1)}return N}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=C[C.length-1],C.toString("utf16le",k,C.length-1)}function _(C){var k=C&&C.length?this.write(C):"";if(this.lastNeed){var N=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,N)}return k}function R(C,k){var N=(C.length-k)%3;return N===0?C.toString("base64",k):(this.lastNeed=3-N,this.lastTotal=3,N===1?this.lastChar[0]=C[C.length-1]:(this.lastChar[0]=C[C.length-2],this.lastChar[1]=C[C.length-1]),C.toString("base64",k,C.length-N))}function x(C){var k=C&&C.length?this.write(C):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function P(C){return C.toString(this.encoding)}function L(C){return C&&C.length?this.write(C):""}return to}var yc=Tr.codes.ERR_STREAM_PREMATURE_CLOSE;function Tp(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof E!="string"&&!ee.objectMode&&Object.getPrototypeOf(E)!==n.prototype&&(E=s(E)),j)ee.endEmitted?O(w,new C):Q(w,ee,E,!0);else if(ee.ended)O(w,new P);else{if(ee.destroyed)return!1;ee.reading=!1,ee.decoder&&!F?(E=ee.decoder.write(E),ee.objectMode||E.length!==0?Q(w,ee,E,!1):M(w,ee)):Q(w,ee,E,!1)}else j||(ee.reading=!1,M(w,ee))}return!ee.ended&&(ee.length=v?w=v:(w--,w|=w>>>1,w|=w>>>2,w|=w>>>4,w|=w>>>8,w|=w>>>16,w++),w}function d(w,E){return w<=0||E.length===0&&E.ended?0:E.objectMode?1:w!==w?E.flowing&&E.length?E.buffer.head.data.length:E.length:(w>E.highWaterMark&&(E.highWaterMark=a(w)),w<=E.length?w:E.ended?E.length:(E.needReadable=!0,0))}H.prototype.read=function(w){u("read",w),w=parseInt(w,10);var E=this._readableState,F=w;if(w!==0&&(E.emittedReadable=!1),w===0&&E.needReadable&&((E.highWaterMark!==0?E.length>=E.highWaterMark:E.length>0)||E.ended))return u("read: emitReadable",E.length,E.ended),E.length===0&&E.ended?B(this):m(this),null;if(w=d(w,E),w===0&&E.ended)return E.length===0&&B(this),null;var j=E.needReadable;u("need readable",j),(E.length===0||E.length-w0?K=T(w,E):K=null,K===null?(E.needReadable=E.length<=E.highWaterMark,w=0):(E.length-=w,E.awaitDrain=0),E.length===0&&(E.ended||(E.needReadable=!0),F!==w&&E.ended&&B(this)),K!==null&&this.emit("data",K),K};function g(w,E){if(u("onEofChunk"),!E.ended){if(E.decoder){var F=E.decoder.end();F&&F.length&&(E.buffer.push(F),E.length+=E.objectMode?1:F.length)}E.ended=!0,E.sync?m(w):(E.needReadable=!1,E.emittedReadable||(E.emittedReadable=!0,y(w)))}}function m(w){var E=w._readableState;u("emitReadable",E.needReadable,E.emittedReadable),E.needReadable=!1,E.emittedReadable||(u("emitReadable",E.flowing),E.emittedReadable=!0,process.nextTick(y,w))}function y(w){var E=w._readableState;u("emitReadable_",E.destroyed,E.length,E.ended),!E.destroyed&&(E.length||E.ended)&&(w.emit("readable"),E.emittedReadable=!1),E.needReadable=!E.flowing&&!E.ended&&E.length<=E.highWaterMark,I(w)}function M(w,E){E.readingMore||(E.readingMore=!0,process.nextTick(A,w,E))}function A(w,E){for(;!E.reading&&!E.ended&&(E.length1&&te(j.pipes,w)!==-1)&&!ge&&(u("false write response, pause",j.awaitDrain),j.awaitDrain++),F.pause())}function de(ue){u("onerror",ue),he(),w.removeListener("error",de),t(w,"error")===0&&O(w,ue)}G(w,"error",de);function fe(){w.removeListener("finish",Pt),he()}w.once("close",fe);function Pt(){u("onfinish"),w.removeListener("close",fe),he()}w.once("finish",Pt);function he(){u("unpipe"),F.unpipe(w)}return w.emit("pipe",F),j.flowing||(u("pipe resume"),F.resume()),w};function b(w){return function(){var F=w._readableState;u("pipeOnDrain",F.awaitDrain),F.awaitDrain&&F.awaitDrain--,F.awaitDrain===0&&t(w,"data")&&(F.flowing=!0,I(w))}}H.prototype.unpipe=function(w){var E=this._readableState,F={hasUnpiped:!1};if(E.pipesCount===0)return this;if(E.pipesCount===1)return w&&w!==E.pipes?this:(w||(w=E.pipes),E.pipes=null,E.pipesCount=0,E.flowing=!1,w&&w.emit("unpipe",this,F),this);if(!w){var j=E.pipes,K=E.pipesCount;E.pipes=null,E.pipesCount=0,E.flowing=!1;for(var ee=0;ee0,j.flowing!==!1&&this.resume()):w==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,u("on readable",j.length,j.reading),j.length?m(this):j.reading||process.nextTick(S,this)),F},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(w,E){var F=r.prototype.removeListener.call(this,w,E);return w==="readable"&&process.nextTick(h,this),F},H.prototype.removeAllListeners=function(w){var E=r.prototype.removeAllListeners.apply(this,arguments);return(w==="readable"||w===void 0)&&process.nextTick(h,this),E};function h(w){var E=w._readableState;E.readableListening=w.listenerCount("readable")>0,E.resumeScheduled&&!E.paused?E.flowing=!0:w.listenerCount("data")>0&&w.resume()}function S(w){u("readable nexttick read 0"),w.read(0)}H.prototype.resume=function(){var w=this._readableState;return w.flowing||(u("resume"),w.flowing=!w.readableListening,W(this,w)),w.paused=!1,this};function W(w,E){E.resumeScheduled||(E.resumeScheduled=!0,process.nextTick(q,w,E))}function q(w,E){u("resume",E.reading),E.reading||w.read(0),E.resumeScheduled=!1,w.emit("resume"),I(w),E.flowing&&!E.reading&&w.read(0)}H.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function I(w){var E=w._readableState;for(u("flow",E.flowing);E.flowing&&w.read()!==null;);}H.prototype.wrap=function(w){var E=this,F=this._readableState,j=!1;w.on("end",function(){if(u("wrapped end"),F.decoder&&!F.ended){var Z=F.decoder.end();Z&&Z.length&&E.push(Z)}E.push(null)}),w.on("data",function(Z){if(u("wrapped data"),F.decoder&&(Z=F.decoder.write(Z)),!(F.objectMode&&Z==null)&&!(!F.objectMode&&(!Z||!Z.length))){var le=E.push(Z);le||(j=!0,w.pause())}});for(var K in w)this[K]===void 0&&typeof w[K]=="function"&&(this[K]=function(le){return function(){return w[le].apply(w,arguments)}}(K));for(var ee=0;ee=E.length?(E.decoder?F=E.buffer.join(""):E.buffer.length===1?F=E.buffer.first():F=E.buffer.concat(E.length),E.buffer.clear()):F=E.buffer.consume(w,E.decoder),F}function B(w){var E=w._readableState;u("endReadable",E.endEmitted),E.endEmitted||(E.ended=!0,process.nextTick(U,E,w))}function U(w,E){if(u("endReadableNT",w.endEmitted,w.length),!w.endEmitted&&w.length===0&&(w.endEmitted=!0,E.readable=!1,E.emit("end"),w.autoDestroy)){var F=E._writableState;(!F||F.autoDestroy&&F.finished)&&E.destroy()}}typeof Symbol=="function"&&(H.from=function(w,E){return $===void 0&&($=Pp()),$(H,w,E)});function te(w,E){for(var F=0,j=w.length;F0;return Gp(o,u,l,function(p){i||(i=p),p&&s.forEach(Mc),!u&&(s.forEach(Mc),n(i))})});return t.reduce(Jp)}var Qp=Kp;(function(e,t){t=e.exports=Iu(),t.Stream=t,t.Readable=t,t.Writable=Mu(),t.Duplex=un(),t.Transform=xu,t.PassThrough=Up,t.finished=sa,t.pipeline=Qp})(No,No.exports);var Nu=No.exports;const{Transform:Yp}=Nu;var Xp=e=>class Lu extends Yp{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Lu(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:e1}=Nu;var t1=e=>class Ou extends e1{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Ou(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const r1=Xp,n1=t1;var i1=function(e){const t=r1(e),r=n1(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Pu={};const kc=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Pu.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],p=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49];let _=p^(i<<1|s>>>31),R=f^(s<<1|i>>>31);const x=e[0]^_,P=e[1]^R,L=e[10]^_,C=e[11]^R,k=e[20]^_,N=e[21]^R,$=e[30]^_,O=e[31]^R,D=e[40]^_,G=e[41]^R;_=r^(o<<1|c>>>31),R=n^(c<<1|o>>>31);const V=e[2]^_,H=e[3]^R,X=e[12]^_,Q=e[13]^R,ie=e[22]^_,v=e[23]^R,a=e[32]^_,d=e[33]^R,g=e[42]^_,m=e[43]^R;_=i^(u<<1|l>>>31),R=s^(l<<1|u>>>31);const y=e[4]^_,M=e[5]^R,A=e[14]^_,b=e[15]^R,h=e[24]^_,S=e[25]^R,W=e[34]^_,q=e[35]^R,I=e[44]^_,T=e[45]^R;_=o^(p<<1|f>>>31),R=c^(f<<1|p>>>31);const B=e[6]^_,U=e[7]^R,te=e[16]^_,w=e[17]^R,E=e[26]^_,F=e[27]^R,j=e[36]^_,K=e[37]^R,ee=e[46]^_,Z=e[47]^R;_=u^(r<<1|n>>>31),R=l^(n<<1|r>>>31);const le=e[8]^_,Ct=e[9]^R,ge=e[18]^_,_e=e[19]^R,Vt=e[28]^_,de=e[29]^R,fe=e[38]^_,Pt=e[39]^R,he=e[48]^_,ue=e[49]^R,ct=x,me=P,ve=C<<4|L>>>28,Or=L<<4|C>>>28,be=k<<3|N>>>29,ye=N<<3|k>>>29,Pr=O<<9|$>>>23,we=$<<9|O>>>23,Ee=D<<18|G>>>14,$r=G<<18|D>>>14,Se=V<<1|H>>>31,Re=H<<1|V>>>31,Br=Q<<12|X>>>20,Ce=X<<12|Q>>>20,Me=ie<<10|v>>>22,Dr=v<<10|ie>>>22,ke=d<<13|a>>>19,Ie=a<<13|d>>>19,Fr=g<<2|m>>>30,xe=m<<2|g>>>30,Ae=M<<30|y>>>2,jr=y<<30|M>>>2,Te=A<<6|b>>>26,Ne=b<<6|A>>>26,Hr=S<<11|h>>>21,Le=h<<11|S>>>21,Oe=W<<15|q>>>17,Ur=q<<15|W>>>17,Pe=T<<29|I>>>3,$e=I<<29|T>>>3,Wr=B<<28|U>>>4,Be=U<<28|B>>>4,De=w<<23|te>>>9,Vr=te<<23|w>>>9,Fe=E<<25|F>>>7,je=F<<25|E>>>7,Qt=j<<21|K>>>11,Yt=K<<21|j>>>11,Xt=Z<<24|ee>>>8,er=ee<<24|Z>>>8,tr=le<<27|Ct>>>5,rr=Ct<<27|le>>>5,nr=ge<<20|_e>>>12,ir=_e<<20|ge>>>12,sr=de<<7|Vt>>>25,or=Vt<<7|de>>>25,ar=fe<<8|Pt>>>24,cr=Pt<<8|fe>>>24,lr=he<<14|ue>>>18,ur=ue<<14|he>>>18;e[0]=ct^~Br&Hr,e[1]=me^~Ce&Le,e[10]=Wr^~nr&be,e[11]=Be^~ir&ye,e[20]=Se^~Te&Fe,e[21]=Re^~Ne&je,e[30]=tr^~ve&Me,e[31]=rr^~Or&Dr,e[40]=Ae^~De&sr,e[41]=jr^~Vr&or,e[2]=Br^~Hr&Qt,e[3]=Ce^~Le&Yt,e[12]=nr^~be&ke,e[13]=ir^~ye&Ie,e[22]=Te^~Fe&ar,e[23]=Ne^~je&cr,e[32]=ve^~Me&Oe,e[33]=Or^~Dr&Ur,e[42]=De^~sr&Pr,e[43]=Vr^~or&we,e[4]=Hr^~Qt&lr,e[5]=Le^~Yt&ur,e[14]=be^~ke&Pe,e[15]=ye^~Ie&$e,e[24]=Fe^~ar&Ee,e[25]=je^~cr&$r,e[34]=Me^~Oe&Xt,e[35]=Dr^~Ur&er,e[44]=sr^~Pr&Fr,e[45]=or^~we&xe,e[6]=Qt^~lr&ct,e[7]=Yt^~ur&me,e[16]=ke^~Pe&Wr,e[17]=Ie^~$e&Be,e[26]=ar^~Ee&Se,e[27]=cr^~$r&Re,e[36]=Oe^~Xt&tr,e[37]=Ur^~er&rr,e[46]=Pr^~Fr&Ae,e[47]=we^~xe&jr,e[8]=lr^~ct&Br,e[9]=ur^~me&Ce,e[18]=Pe^~Wr&nr,e[19]=$e^~Be&ir,e[28]=Ee^~Se&Te,e[29]=$r^~Re&Ne,e[38]=Xt^~tr&ve,e[39]=er^~rr&Or,e[48]=Fr^~Ae&De,e[49]=xe^~jr&Vr,e[0]^=kc[t*2],e[1]^=kc[t*2+1]}};const Li=Pu;function wn(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}wn.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};wn.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Li.p1600(this.state),this.count=0);return t};wn.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var s1=wn,o1=i1(s1);const a1=o1,c1=Ui;function $u(e){return Buffer.allocUnsafe(e).fill(0)}function Bu(e,t,r){const n=$u(t);return e=_s(e),r?e.length"u")throw new Error("Not an array?");if(r=Uu(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(xt(e,t[s]));if(r==="dynamic"){var o=xt("uint256",t.length);i.unshift(o)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([xt("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,Rr.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=tn(e),r<1||r>32)throw new Error("Invalid bytes width: "+r);return Rr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=tn(e),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=_r(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=tn(e),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=_r(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=Ic(e),n=_r(t),n<0)throw new Error("Supplied ufixed is negative");return xt("uint256",n.mul(new br(2).pow(new br(r[1]))))}else if(e.startsWith("fixed"))return r=Ic(e),xt("int256",_r(t).mul(new br(2).pow(new br(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function f1(e){return e==="string"||e==="bytes"||Uu(e)==="dynamic"}function p1(e){return e.lastIndexOf("]")===e.length-1}function g1(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var o=Hu(e[s]),c=t[s],u=xt(o,c);f1(o)?(r.push(xt("uint256",i)),n.push(u),i+=u.length):r.push(u)}return Buffer.concat(r.concat(n))}function Wu(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(Rr.setLengthRight(c,r))}else if(o.startsWith("uint")){if(r=tn(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=_r(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=tn(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=_r(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function _1(e,t){return Rr.keccak(Wu(e,t))}var m1={rawEncode:g1,solidityPack:Wu,soliditySHA3:_1};const yt=ju,Nn=m1,Vu={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},oo={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const o=(c,u,l)=>{if(r[u]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":yt.keccak(this.encodeData(u,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${c} of type ${u}`);if(u==="bytes")return["bytes32",yt.keccak(l)];if(u==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",yt.keccak(l)];if(u.lastIndexOf("]")===u.length-1){const p=u.slice(0,u.lastIndexOf("[")),f=l.map(_=>o(c,p,_));return["bytes32",yt.keccak(Nn.rawEncode(f.map(([_])=>_),f.map(([,_])=>_)))]}return[u,l]};for(const c of r[e]){const[u,l]=o(c.name,c.type,t[c.name]);i.push(u),s.push(l)}}else for(const o of r[e]){let c=t[o.name];if(c!==void 0)if(o.type==="bytes")i.push("bytes32"),c=yt.keccak(c),s.push(c);else if(o.type==="string")i.push("bytes32"),typeof c=="string"&&(c=Buffer.from(c,"utf8")),c=yt.keccak(c),s.push(c);else if(r[o.type]!==void 0)i.push("bytes32"),c=yt.keccak(this.encodeData(o.type,c,r,n)),s.push(c);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(c)}}return Nn.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:o,type:c})=>c+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return yt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return yt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Vu.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),yt.keccak(Buffer.concat(n))}};var v1={TYPED_MESSAGE_SCHEMA:Vu,TypedDataUtils:oo,hashForSignTypedDataLegacy:function(e){return b1(e.data)},hashForSignTypedData_v3:function(e){return oo.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return oo.hash(e.data)}};function b1(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?yt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return Nn.soliditySHA3(["bytes32","bytes32"],[Nn.soliditySHA3(new Array(e.length).fill("string"),i),Nn.soliditySHA3(n,r)])}var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.filterFromParam=hn.FilterPolyfill=void 0;const Yr=Je,nt=z,y1=5*60*1e3,mr={jsonrpc:"2.0",id:0};class w1{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Yr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=qu(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,nt.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,nt.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,nt.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,nt.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,nt.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(bi())}async getFilterLogs(t){const r=(0,nt.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getLogs",params:[xc(n)]})):bi()}makeFilterId(){return(0,Yr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return bi();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return yi();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getLogs",params:[xc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const c=o.result.map(l=>(0,nt.intNumberFromHexString)(l.blockNumber||"0x0")),u=Math.max(...c);if(u&&u>n){const l=(0,Yr.IntNumber)(u+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${l}`),this.cursors.set(t,l)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return bi();const n=await this.getCurrentBlockHeight();if(r>n)return yi();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,nt.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Yr.IntNumber)(o))))).filter(o=>!!o),s=(0,Yr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},mr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(yi())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},y1);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_blockNumber",params:[]}));return(0,nt.intNumberFromHexString)((0,nt.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getBlockByNumber",params:[(0,nt.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,nt.ensureHexString)(r.result.hash):null}}hn.FilterPolyfill=w1;function qu(e){return{fromBlock:Ac(e.fromBlock),toBlock:Ac(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}hn.filterFromParam=qu;function xc(e){const t={fromBlock:Tc(e.fromBlock),toBlock:Tc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Ac(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Yr.IntNumber)(0);if((0,nt.isHexString)(e))return(0,nt.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Tc(e){return e==="latest"?e:(0,nt.hexStringFromIntNumber)(e)}function bi(){return Object.assign(Object.assign({},mr),{error:{code:-32e3,message:"filter not found"}})}function yi(){return Object.assign(Object.assign({},mr),{result:[]})}var ms={},zu={},vs={},oa=E1;function E1(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const Nc=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i{t.errorFirst?n.push(function(o,c){if(t.multiArgs){const u=new Array(arguments.length-1);for(let l=1;l{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):Nc(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?Nc(s,t):s}return n},ri={},ni={};Object.defineProperty(ni,"__esModule",{value:!0});const R1=Fi;function Lc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function C1(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const c=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw c.context=o,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Lc(s,this,r);else{const o=s.length,c=C1(s);for(let u=0;ue+t,Oc=["sync","latest"];class T1 extends I1.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*x1,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){Oc.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Oc.map(t=>this.listenerCount(t)).reduce(A1)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Pc(t),i=Pc(r);return this._usePastBlocks&&ni}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}ri.BaseBlockTracker=T1;function Pc(e){return Number.parseInt(e,16)}var Gu={},Ju={},tt={};class Zu extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:c}=t,u=c.length===0?i:`At path: ${c.join(".")} -- ${i}`;super(s??u),s!=null&&(this.cause=u),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function N1(e){return mt(e)&&typeof e[Symbol.iterator]=="function"}function mt(e){return typeof e=="object"&&e!=null}function $c(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ze(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function L1(e){const{done:t,value:r}=e.next();return t?void 0:r}function O1(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:c,message:u=`Expected a value of type \`${o}\`${c?` with refinement \`${c}\``:""}, but received: \`${Ze(n)}\``}=e;return{value:n,type:o,refinement:c,key:i[i.length-1],path:i,branch:s,...e,message:u}}function*Oo(e,t,r,n){N1(e)||(e=[e]);for(const i of e){const s=O1(i,t,r,n);s&&(yield s)}}function*aa(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,c={path:n,branch:i};if(s&&(e=t.coercer(e,c),o&&t.type!=="type"&&mt(t.schema)&&mt(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let u="valid";for(const l of t.validator(e,c))l.explanation=r.message,u="not_valid",yield[l,void 0];for(let[l,p,f]of t.entries(e,c)){const _=aa(p,f,{path:l===void 0?n:[...n,l],branch:l===void 0?i:[...i,p],coerce:s,mask:o,message:r.message});for(const R of _)R[0]?(u=R[0].refinement!=null?"not_refined":"not_valid",yield[R[0],void 0]):s&&(p=R[1],l===void 0?e=p:e instanceof Map?e.set(l,p):e instanceof Set?e.add(p):mt(e)&&(p!==void 0||l in e)&&(e[l]=p))}if(u!=="not_valid")for(const l of t.refiner(e,c))l.explanation=r.message,u="not_refined",yield[l,void 0];u==="valid"&&(yield[void 0,e])}class ze{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=u=>u,entries:c=function*(){}}=t;this.type=r,this.schema=n,this.entries=c,this.coercer=o,i?this.validator=(u,l)=>{const p=i(u,l);return Oo(p,l,this,u)}:this.validator=()=>[],s?this.refiner=(u,l)=>{const p=s(u,l);return Oo(p,l,this,u)}:this.refiner=()=>[]}assert(t,r){return Ku(t,this,r)}create(t,r){return Qu(t,this,r)}is(t){return ca(t,this)}mask(t,r){return Yu(t,this,r)}validate(t,r={}){return En(t,this,r)}}function Ku(e,t,r){const n=En(e,t,{message:r});if(n[0])throw n[0]}function Qu(e,t,r){const n=En(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Yu(e,t,r){const n=En(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ca(e,t){return!En(e,t)[0]}function En(e,t,r={}){const n=aa(e,t,r),i=L1(n);return i[0]?[new Zu(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function P1(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?si(n):ii(n)}function at(e,t){return new ze({type:e,schema:null,validator:t})}function $1(e,t){return new ze({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function B1(e){return new ze({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function D1(e){let t;return new ze({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function F1(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return si(n);default:return ii(n)}}function j1(e){const t=e instanceof ze,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Xu(r[n]);return t&&e.type==="type"?si(r):ii(r)}function H1(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return si(n);default:return ii(n)}}function U1(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),at(e,t)}function W1(){return at("any",()=>!0)}function V1(e){return new ze({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Ze(t)}`}})}function q1(){return at("bigint",e=>typeof e=="bigint")}function z1(){return at("boolean",e=>typeof e=="boolean")}function G1(){return at("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ze(e)}`)}function J1(e){const t={},r=e.map(n=>Ze(n)).join();for(const n of e)t[n]=n;return new ze({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ze(n)}`}})}function Z1(){return at("func",e=>typeof e=="function"||`Expected a function, but received: ${Ze(e)}`)}function K1(e){return at("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ze(t)}`)}function Q1(){return at("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ze(e)}`)}function Y1(e){return new ze({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function X1(e){const t=Ze(e),r=typeof e;return new ze({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ze(n)}`}})}function eg(e,t){return new ze({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Ze(r)}`}})}function la(){return at("never",()=>!1)}function tg(e){return new ze({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function rg(){return at("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ze(e)}`)}function ii(e){const t=e?Object.keys(e):[],r=la();return new ze({type:"object",schema:e||null,*entries(n){if(e&&mt(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return mt(n)||`Expected an object, but received: ${Ze(n)}`},coercer(n){return mt(n)?{...n}:n}})}function Xu(e){return new ze({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function ng(e,t){return new ze({type:"record",schema:null,*entries(r){if(mt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return mt(r)||`Expected an object, but received: ${Ze(r)}`}})}function ig(){return at("regexp",e=>e instanceof RegExp)}function sg(e){return new ze({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Ze(t)}`}})}function eh(){return at("string",e=>typeof e=="string"||`Expected a string, but received: ${Ze(e)}`)}function og(e){const t=la();return new ze({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;ir.type).join(" | ");return new ze({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...o]=aa(r,s,n),[c]=o;if(c[0])for(const[u]of o)u&&i.push(u);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ze(r)}`,...i]}})}function th(){return at("unknown",()=>!0)}function ua(e,t,r){return new ze({...e,coercer:(n,i)=>ca(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function cg(e,t,r={}){return ua(e,th(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&$c(n)&&$c(i)){const s={...n};let o=!1;for(const c in i)s[c]===void 0&&(s[c]=i[c],o=!0);if(o)return s}return n})}function lg(e){return ua(e,eh(),t=>t.trim())}function ug(e){return Nr(e,"empty",t=>{const r=rh(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function rh(e){return e instanceof Map||e instanceof Set?e.size:e.length}function hg(e,t,r={}){const{exclusive:n}=r;return Nr(e,"max",i=>n?in?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function fg(e){return Nr(e,"nonempty",t=>rh(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function pg(e,t){return Nr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function gg(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Nr(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function Nr(e,t,r){return new ze({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),o=Oo(s,i,e,n);for(const c of o)yield{...c,refinement:t}}})}const _g=Object.freeze(Object.defineProperty({__proto__:null,Struct:ze,StructError:Zu,any:W1,array:V1,assert:Ku,assign:P1,bigint:q1,boolean:z1,coerce:ua,create:Qu,date:G1,defaulted:cg,define:at,deprecated:$1,dynamic:B1,empty:ug,enums:J1,func:Z1,instance:K1,integer:Q1,intersection:Y1,is:ca,lazy:D1,literal:X1,map:eg,mask:Yu,max:hg,min:dg,never:la,nonempty:fg,nullable:tg,number:rg,object:ii,omit:F1,optional:Xu,partial:j1,pattern:pg,pick:H1,record:ng,refine:Nr,regexp:ig,set:sg,size:gg,string:eh,struct:U1,trimmed:lg,tuple:og,type:si,union:ag,unknown:th,validate:En},Symbol.toStringTag,{value:"Module"})),Lr=gn(_g);Object.defineProperty(tt,"__esModule",{value:!0});tt.assertExhaustive=tt.assertStruct=tt.assert=tt.AssertionError=void 0;const mg=Lr;function vg(e){return typeof e=="object"&&e!==null&&"message"in e}function bg(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function yg(e){const t=vg(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function nh(e,t){return bg(e)?new e({message:t}):e({message:t})}class ha extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}tt.AssertionError=ha;function wg(e,t="Assertion failed.",r=ha){if(!e)throw t instanceof Error?t:nh(r,t)}tt.assert=wg;function Eg(e,t,r="Assertion failed",n=ha){try{(0,mg.assert)(e,t)}catch(i){throw nh(n,`${r}: ${yg(i)}.`)}}tt.assertStruct=Eg;function Sg(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}tt.assertExhaustive=Sg;var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.base64=void 0;const Rg=Lr,Cg=tt,Mg=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,Cg.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let c;return i?c=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):c=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,Rg.pattern)(e,c)};oi.base64=Mg;var ae={},ai={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Lr,r=tt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,t.is)(l,e.HexStruct)}e.isHexString=n;function i(l){return(0,t.is)(l,e.StrictHexStruct)}e.isStrictHexString=i;function s(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function o(l){(0,r.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function c(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}e.add0x=c;function u(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}e.remove0x=u})(ai);Object.defineProperty(ae,"__esModule",{value:!0});ae.createDataView=ae.concatBytes=ae.valueToBytes=ae.stringToBytes=ae.numberToBytes=ae.signedBigIntToBytes=ae.bigIntToBytes=ae.hexToBytes=ae.bytesToString=ae.bytesToNumber=ae.bytesToSignedBigInt=ae.bytesToBigInt=ae.bytesToHex=ae.assertIsBytes=ae.isBytes=void 0;const ht=tt,Po=ai,Bc=48,Dc=58,Fc=87;function kg(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const Ig=kg();function da(e){return e instanceof Uint8Array}ae.isBytes=da;function Sn(e){(0,ht.assert)(da(e),"Value must be a Uint8Array.")}ae.assertIsBytes=Sn;function ih(e){if(Sn(e),e.length===0)return"0x";const t=Ig(),r=new Array(e.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return bs(t)}ae.bigIntToBytes=oh;function Ng(e,t){(0,ht.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function Lg(e,t){(0,ht.assert)(typeof e=="bigint","Value must be a bigint."),(0,ht.assert)(typeof t=="number","Byte length must be a number."),(0,ht.assert)(t>0,"Byte length must be greater than 0."),(0,ht.assert)(Ng(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i>=BigInt(8);return n.reverse()}ae.signedBigIntToBytes=Lg;function ah(e){(0,ht.assert)(typeof e=="number","Value must be a number."),(0,ht.assert)(e>=0,"Value must be a non-negative number."),(0,ht.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return bs(t)}ae.numberToBytes=ah;function ch(e){return(0,ht.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ae.stringToBytes=ch;function lh(e){if(typeof e=="bigint")return oh(e);if(typeof e=="number")return ah(e);if(typeof e=="string")return e.startsWith("0x")?bs(e):ch(e);if(da(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ae.valueToBytes=lh;function Og(e){const t=new Array(e.length);let r=0;for(let i=0;it.call(r,n,i,this))}get(t){return it(this,bt,"f").get(t)}has(t){return it(this,bt,"f").has(t)}keys(){return it(this,bt,"f").keys()}values(){return it(this,bt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}dn.FrozenMap=fa;class pa{constructor(t){kt.set(this,void 0),dh(this,kt,new Set(t),"f"),Object.freeze(this)}get size(){return it(this,kt,"f").size}[(kt=new WeakMap,Symbol.iterator)](){return it(this,kt,"f")[Symbol.iterator]()}entries(){return it(this,kt,"f").entries()}forEach(t,r){return it(this,kt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return it(this,kt,"f").has(t)}keys(){return it(this,kt,"f").keys()}values(){return it(this,kt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}dn.FrozenSet=pa;Object.freeze(fa);Object.freeze(fa.prototype);Object.freeze(pa);Object.freeze(pa.prototype);var fh={};Object.defineProperty(fh,"__esModule",{value:!0});var ph={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Lr,r=tt,n=()=>(0,t.define)("finite number",O=>(0,t.is)(O,(0,t.number)())&&Number.isFinite(O));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(O,D)=>{function G(V,H){const Q=[...H.validator(V,D)];return Q.length>0?Q:!0}try{const V=G(O,e.UnsafeJsonStruct);return V!==!0?V:G(JSON.parse(JSON.stringify(O)),e.UnsafeJsonStruct)}catch(V){return V instanceof RangeError?"Circular reference detected":!1}});function i(O){return(0,t.is)(O,e.JsonStruct)}e.isValidJson=i;function s(O){(0,r.assertStruct)(O,e.JsonStruct,"Invalid JSON value");const D=JSON.stringify(O);return new TextEncoder().encode(D).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(O){return(0,t.is)(O,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function c(O,D){(0,r.assertStruct)(O,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",D)}e.assertIsJsonRpcNotification=c;function u(O){return(0,t.is)(O,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=u;function l(O,D){(0,r.assertStruct)(O,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",D)}e.assertIsJsonRpcRequest=l,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function p(O){return(0,t.is)(O,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=p;function f(O,D){(0,r.assertStruct)(O,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",D)}e.assertIsPendingJsonRpcResponse=f;function _(O){return(0,t.is)(O,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=_;function R(O,D){(0,r.assertStruct)(O,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",D)}e.assertIsJsonRpcResponse=R;function x(O){return(0,t.is)(O,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=x;function P(O,D){(0,r.assertStruct)(O,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",D)}e.assertIsJsonRpcSuccess=P;function L(O){return(0,t.is)(O,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=L;function C(O,D){(0,r.assertStruct)(O,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",D)}e.assertIsJsonRpcFailure=C;function k(O){return(0,t.is)(O,e.JsonRpcErrorStruct)}e.isJsonRpcError=k;function N(O,D){(0,r.assertStruct)(O,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",D)}e.assertIsJsonRpcError=N;function $(O){const{permitEmptyString:D,permitFractions:G,permitNull:V}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},O);return X=>!!(typeof X=="number"&&(G||Number.isInteger(X))||typeof X=="string"&&(D||X.length>0)||V&&X===null)}e.getJsonRpcIdValidator=$})(ph);var gh={};Object.defineProperty(gh,"__esModule",{value:!0});var fn={},$o={exports:{}},ao,Hc;function zg(){if(Hc)return ao;Hc=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;ao=function(p,f){f=f||{};var _=typeof p;if(_==="string"&&p.length>0)return o(p);if(_==="number"&&isFinite(p))return f.long?u(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function o(p){if(p=String(p),!(p.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(f){var _=parseFloat(f[1]),R=(f[2]||"ms").toLowerCase();switch(R){case"years":case"year":case"yrs":case"yr":case"y":return _*s;case"weeks":case"week":case"w":return _*i;case"days":case"day":case"d":return _*n;case"hours":case"hour":case"hrs":case"hr":case"h":return _*r;case"minutes":case"minute":case"mins":case"min":case"m":return _*t;case"seconds":case"second":case"secs":case"sec":case"s":return _*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return _;default:return}}}}function c(p){var f=Math.abs(p);return f>=n?Math.round(p/n)+"d":f>=r?Math.round(p/r)+"h":f>=t?Math.round(p/t)+"m":f>=e?Math.round(p/e)+"s":p+"ms"}function u(p){var f=Math.abs(p);return f>=n?l(p,f,n,"day"):f>=r?l(p,f,r,"hour"):f>=t?l(p,f,t,"minute"):f>=e?l(p,f,e,"second"):p+" ms"}function l(p,f,_,R){var x=f>=_*1.5;return Math.round(p/_)+" "+R+(x?"s":"")}return ao}function Gg(e){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=o,r.humanize=zg(),r.destroy=l,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let f=0;for(let _=0;_{if(D==="%%")return"%";$++;const V=r.formatters[G];if(typeof V=="function"){const H=L[$];D=V.call(C,H),L.splice($,1),$--}return D}),r.formatArgs.call(C,L),(C.log||r.log).apply(C,L)}return P.namespace=p,P.useColors=r.useColors(),P.color=r.selectColor(p),P.extend=n,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(R!==r.namespaces&&(R=r.namespaces,x=r.enabled(p)),x),set:L=>{_=L}}),typeof r.init=="function"&&r.init(P),P}function n(p,f){const _=r(this.namespace+(typeof f>"u"?":":f)+p);return _.log=this.log,_}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let f;const _=(typeof p=="string"?p:"").split(/[\s,]+/),R=_.length;for(f=0;f"-"+f)].join(",");return r.enable(""),p}function o(p){if(p[p.length-1]==="*")return!0;let f,_;for(f=0,_=r.skips.length;f<_;f++)if(r.skips[f].test(p))return!1;for(f=0,_=r.names.length;f<_;f++)if(r.names[f].test(p))return!0;return!1}function c(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function u(p){return p instanceof Error?p.stack||p.message:p}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Jg=Gg;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=o,t.useColors=n,t.storage=c(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;l.splice(1,0,p,"color: inherit");let f=0,_=0;l[0].replace(/%[a-zA-Z%]/g,R=>{R!=="%%"&&(f++,R==="%c"&&(_=f))}),l.splice(_,0,p)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=r.DEBUG),l}function c(){try{return localStorage}catch{}}e.exports=Jg(t);const{formatters:u}=e.exports;u.j=function(l){try{return JSON.stringify(l)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})($o,$o.exports);var Zg=$o.exports,Kg=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fn,"__esModule",{value:!0});fn.createModuleLogger=fn.createProjectLogger=void 0;const Qg=Kg(Zg),Yg=(0,Qg.default)("metamask");function Xg(e){return Yg.extend(e)}fn.createProjectLogger=Xg;function e_(e,t){return e.extend(t)}fn.createModuleLogger=e_;var _h={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(l){return Array.isArray(l)&&l.length>0}e.isNonEmptyArray=t;function r(l){return l==null}e.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}e.isObject=n;const i=(l,p)=>Object.hasOwnProperty.call(l,p);e.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let p=l;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(l)===p}catch{return!1}}e.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}e.isASCII=o;function c(l){var p;return l.split("").reduce((_,R)=>o(R)?_+1:_+2,0)+((p=l.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}e.calculateStringSize=c;function u(l){return l.toString().length}e.calculateNumberSize=u})(_h);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.hexToBigInt=Ot.hexToNumber=Ot.bigIntToHex=Ot.numberToHex=void 0;const rn=tt,Bn=ai,t_=e=>((0,rn.assert)(typeof e=="number","Value must be a number."),(0,rn.assert)(e>=0,"Value must be a non-negative number."),(0,rn.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Bn.add0x)(e.toString(16)));Ot.numberToHex=t_;const r_=e=>((0,rn.assert)(typeof e=="bigint","Value must be a bigint."),(0,rn.assert)(e>=0,"Value must be a non-negative bigint."),(0,Bn.add0x)(e.toString(16)));Ot.bigIntToHex=r_;const n_=e=>{(0,Bn.assertIsHexString)(e);const t=parseInt(e,16);return(0,rn.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ot.hexToNumber=n_;const i_=e=>((0,Bn.assertIsHexString)(e),BigInt((0,Bn.add0x)(e)));Ot.hexToBigInt=i_;var mh={};Object.defineProperty(mh,"__esModule",{value:!0});var vh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!t(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(vh);var bh={};Object.defineProperty(bh,"__esModule",{value:!0});var yh={},Bo={exports:{}};const s_="2.0.0",wh=256,o_=Number.MAX_SAFE_INTEGER||9007199254740991,a_=16,c_=wh-6,l_=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Es={MAX_LENGTH:wh,MAX_SAFE_COMPONENT_LENGTH:a_,MAX_SAFE_BUILD_LENGTH:c_,MAX_SAFE_INTEGER:o_,RELEASE_TYPES:l_,SEMVER_SPEC_VERSION:s_,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},co={};const u_=typeof process=="object"&&co&&co.NODE_DEBUG&&/\bsemver\b/i.test(co.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Ss=u_;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Es,s=Ss;t=e.exports={};const o=t.re=[],c=t.safeRe=[],u=t.src=[],l=t.t={};let p=0;const f="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",i],[f,n]],R=P=>{for(const[L,C]of _)P=P.split(`${L}*`).join(`${L}{0,${C}}`).split(`${L}+`).join(`${L}{1,${C}}`);return P},x=(P,L,C)=>{const k=R(L),N=p++;s(P,N,L),l[P]=N,u[N]=L,o[N]=new RegExp(L,C?"g":void 0),c[N]=new RegExp(k,C?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*"),x("NUMERICIDENTIFIERLOOSE","\\d+"),x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),x("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),x("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),x("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),x("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),x("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),x("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),x("BUILDIDENTIFIER",`${f}+`),x("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),x("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),x("FULL",`^${u[l.FULLPLAIN]}$`),x("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),x("LOOSE",`^${u[l.LOOSEPLAIN]}$`),x("GTLT","((?:<|>)?=?)"),x("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),x("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),x("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),x("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),x("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),x("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),x("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),x("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),x("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),x("COERCERTL",u[l.COERCE],!0),x("COERCERTLFULL",u[l.COERCEFULL],!0),x("LONETILDE","(?:~>?)"),x("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",x("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),x("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),x("LONECARET","(?:\\^)"),x("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",x("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),x("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),x("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),x("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),x("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",x("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),x("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),x("STAR","(<|>)?=?\\s*\\*"),x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Bo,Bo.exports);var ci=Bo.exports;const h_=Object.freeze({loose:!0}),d_=Object.freeze({}),f_=e=>e?typeof e!="object"?h_:e:d_;var ga=f_;const Uc=/^[0-9]+$/,Eh=(e,t)=>{const r=Uc.test(e),n=Uc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:eEh(t,e);var Sh={compareIdentifiers:Eh,rcompareIdentifiers:p_};const wi=Ss,{MAX_LENGTH:Wc,MAX_SAFE_INTEGER:Ei}=Es,{safeRe:Vc,t:qc}=ci,g_=ga,{compareIdentifiers:Zr}=Sh;let __=class It{constructor(t,r){if(r=g_(r),t instanceof It){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Wc)throw new TypeError(`version is longer than ${Wc} characters`);wi("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Vc[qc.LOOSE]:Vc[qc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ei||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ei||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ei||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Zr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var st=__;const zc=st,m_=(e,t,r=!1)=>{if(e instanceof zc)return e;try{return new zc(e,t)}catch(n){if(!r)return null;throw n}};var Rn=m_;const v_=Rn,b_=(e,t)=>{const r=v_(e,t);return r?r.version:null};var y_=b_;const w_=Rn,E_=(e,t)=>{const r=w_(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var S_=E_;const Gc=st,R_=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Gc(e instanceof Gc?e.version:e,r).inc(t,n,i).version}catch{return null}};var C_=R_;const Jc=Rn,M_=(e,t)=>{const r=Jc(e,null,!0),n=Jc(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,c=s?n:r,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u)return!c.patch&&!c.minor?"major":o.patch?"patch":o.minor?"minor":"major";const p=u?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var k_=M_;const I_=st,x_=(e,t)=>new I_(e,t).major;var A_=x_;const T_=st,N_=(e,t)=>new T_(e,t).minor;var L_=N_;const O_=st,P_=(e,t)=>new O_(e,t).patch;var $_=P_;const B_=Rn,D_=(e,t)=>{const r=B_(e,t);return r&&r.prerelease.length?r.prerelease:null};var F_=D_;const Zc=st,j_=(e,t,r)=>new Zc(e,r).compare(new Zc(t,r));var St=j_;const H_=St,U_=(e,t,r)=>H_(t,e,r);var W_=U_;const V_=St,q_=(e,t)=>V_(e,t,!0);var z_=q_;const Kc=st,G_=(e,t,r)=>{const n=new Kc(e,r),i=new Kc(t,r);return n.compare(i)||n.compareBuild(i)};var _a=G_;const J_=_a,Z_=(e,t)=>e.sort((r,n)=>J_(r,n,t));var K_=Z_;const Q_=_a,Y_=(e,t)=>e.sort((r,n)=>Q_(n,r,t));var X_=Y_;const em=St,tm=(e,t,r)=>em(e,t,r)>0;var Rs=tm;const rm=St,nm=(e,t,r)=>rm(e,t,r)<0;var ma=nm;const im=St,sm=(e,t,r)=>im(e,t,r)===0;var Rh=sm;const om=St,am=(e,t,r)=>om(e,t,r)!==0;var Ch=am;const cm=St,lm=(e,t,r)=>cm(e,t,r)>=0;var va=lm;const um=St,hm=(e,t,r)=>um(e,t,r)<=0;var ba=hm;const dm=Rh,fm=Ch,pm=Rs,gm=va,_m=ma,mm=ba,vm=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return dm(e,r,n);case"!=":return fm(e,r,n);case">":return pm(e,r,n);case">=":return gm(e,r,n);case"<":return _m(e,r,n);case"<=":return mm(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Mh=vm;const bm=st,ym=Rn,{safeRe:Si,t:Ri}=ci,wm=(e,t)=>{if(e instanceof bm)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Si[Ri.COERCEFULL]:Si[Ri.COERCE]);else{const u=t.includePrerelease?Si[Ri.COERCERTLFULL]:Si[Ri.COERCERTL];let l;for(;(l=u.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return ym(`${n}.${i}.${s}${o}${c}`,t)};var Em=wm,lo,Qc;function Sm(){return Qc||(Qc=1,lo=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),lo}var Rm=ce;ce.Node=Cr;ce.create=ce;function ce(e){var t=this;if(t instanceof ce||(t=new ce),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};ce.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};ce.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};ce.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};ce.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new ce;if(tthis.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&nthis.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};ce.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n1;class xm{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[vr]=t.max||1/0;const r=t.length||uo;if(this[Kr]=typeof r!="function"?uo:r,this[Ln]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[yr]=t.maxAge||0,this[$t]=t.dispose,this[Yc]=t.noDisposeOnSet||!1,this[kh]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[vr]=t||1/0,Mn(this)}get max(){return this[vr]}set allowStale(t){this[Ln]=!!t}get allowStale(){return this[Ln]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[yr]=t,Mn(this)}get maxAge(){return this[yr]}set lengthCalculator(t){typeof t!="function"&&(t=uo),t!==this[Kr]&&(this[Kr]=t,this[Ft]=0,this[Qe].forEach(r=>{r.length=this[Kr](r.value,r.key),this[Ft]+=r.length})),Mn(this)}get lengthCalculator(){return this[Kr]}get length(){return this[Ft]}get itemCount(){return this[Qe].length}rforEach(t,r){r=r||this;for(let n=this[Qe].tail;n!==null;){const i=n.prev;Xc(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[Qe].head;n!==null;){const i=n.next;Xc(this,t,n,r),n=i}}keys(){return this[Qe].toArray().map(t=>t.key)}values(){return this[Qe].toArray().map(t=>t.value)}reset(){this[$t]&&this[Qe]&&this[Qe].length&&this[Qe].forEach(t=>this[$t](t.key,t.value)),this[wt]=new Map,this[Qe]=new Im,this[Ft]=0}dump(){return this[Qe].map(t=>Oi(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Qe]}set(t,r,n){if(n=n||this[yr],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Kr](r,t);if(this[wt].has(t)){if(s>this[vr])return nn(this,this[wt].get(t)),!1;const u=this[wt].get(t).value;return this[$t]&&(this[Yc]||this[$t](t,u.value)),u.now=i,u.maxAge=n,u.value=r,this[Ft]+=s-u.length,u.length=s,this.get(t),Mn(this),!0}const o=new Am(t,r,s,i,n);return o.length>this[vr]?(this[$t]&&this[$t](t,r),!1):(this[Ft]+=o.length,this[Qe].unshift(o),this[wt].set(t,this[Qe].head),Mn(this),!0)}has(t){if(!this[wt].has(t))return!1;const r=this[wt].get(t).value;return!Oi(this,r)}get(t){return ho(this,t,!0)}peek(t){return ho(this,t,!1)}pop(){const t=this[Qe].tail;return t?(nn(this,t),t.value):null}del(t){nn(this,this[wt].get(t))}load(t){this.reset();const r=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[wt].forEach((t,r)=>ho(this,r,!1))}}const ho=(e,t,r)=>{const n=e[wt].get(t);if(n){const i=n.value;if(Oi(e,i)){if(nn(e,n),!e[Ln])return}else r&&(e[kh]&&(n.value.now=Date.now()),e[Qe].unshiftNode(n));return i.value}},Oi=(e,t)=>{if(!t||!t.maxAge&&!e[yr])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[yr]&&r>e[yr]},Mn=e=>{if(e[Ft]>e[vr])for(let t=e[Qe].tail;e[Ft]>e[vr]&&t!==null;){const r=t.prev;nn(e,t),t=r}},nn=(e,t)=>{if(t){const r=t.value;e[$t]&&e[$t](r.key,r.value),e[Ft]-=r.length,e[wt].delete(r.key),e[Qe].removeNode(t)}};class Am{constructor(t,r,n,i,s){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const Xc=(e,t,r,n)=>{let i=r.value;Oi(e,i)&&(nn(e,r),e[Ln]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};var Tm=xm,fo,el;function Rt(){if(el)return fo;el=1;class e{constructor(a,d){if(d=n(d),a instanceof e)return a.loose===!!d.loose&&a.includePrerelease===!!d.includePrerelease?a:new e(a.raw,d);if(a instanceof i)return this.raw=a.value,this.set=[[a]],this.format(),this;if(this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease,this.raw=a.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(m=>!x(m[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const m of this.set)if(m.length===1&&P(m[0])){this.set=[m];break}}}this.format()}format(){return this.range=this.set.map(a=>a.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(a){const g=((this.options.includePrerelease&&_)|(this.options.loose&&R))+":"+a,m=r.get(g);if(m)return m;const y=this.options.loose,M=y?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];a=a.replace(M,Q(this.options.includePrerelease)),s("hyphen replace",a),a=a.replace(c[u.COMPARATORTRIM],l),s("comparator trim",a),a=a.replace(c[u.TILDETRIM],p),s("tilde trim",a),a=a.replace(c[u.CARETTRIM],f),s("caret trim",a);let A=a.split(" ").map(W=>C(W,this.options)).join(" ").split(/\s+/).map(W=>X(W,this.options));y&&(A=A.filter(W=>(s("loose invalid filter",W,this.options),!!W.match(c[u.COMPARATORLOOSE])))),s("range list",A);const b=new Map,h=A.map(W=>new i(W,this.options));for(const W of h){if(x(W))return[W];b.set(W.value,W)}b.size>1&&b.has("")&&b.delete("");const S=[...b.values()];return r.set(g,S),S}intersects(a,d){if(!(a instanceof e))throw new TypeError("a Range is required");return this.set.some(g=>L(g,d)&&a.set.some(m=>L(m,d)&&g.every(y=>m.every(M=>y.intersects(M,d)))))}test(a){if(!a)return!1;if(typeof a=="string")try{a=new o(a,this.options)}catch{return!1}for(let d=0;dv.value==="<0.0.0-0",P=v=>v.value==="",L=(v,a)=>{let d=!0;const g=v.slice();let m=g.pop();for(;d&&g.length;)d=g.every(y=>m.intersects(y,a)),m=g.pop();return d},C=(v,a)=>(s("comp",v,a),v=O(v,a),s("caret",v),v=N(v,a),s("tildes",v),v=G(v,a),s("xrange",v),v=H(v,a),s("stars",v),v),k=v=>!v||v.toLowerCase()==="x"||v==="*",N=(v,a)=>v.trim().split(/\s+/).map(d=>$(d,a)).join(" "),$=(v,a)=>{const d=a.loose?c[u.TILDELOOSE]:c[u.TILDE];return v.replace(d,(g,m,y,M,A)=>{s("tilde",v,g,m,y,M,A);let b;return k(m)?b="":k(y)?b=`>=${m}.0.0 <${+m+1}.0.0-0`:k(M)?b=`>=${m}.${y}.0 <${m}.${+y+1}.0-0`:A?(s("replaceTilde pr",A),b=`>=${m}.${y}.${M}-${A} <${m}.${+y+1}.0-0`):b=`>=${m}.${y}.${M} <${m}.${+y+1}.0-0`,s("tilde return",b),b})},O=(v,a)=>v.trim().split(/\s+/).map(d=>D(d,a)).join(" "),D=(v,a)=>{s("caret",v,a);const d=a.loose?c[u.CARETLOOSE]:c[u.CARET],g=a.includePrerelease?"-0":"";return v.replace(d,(m,y,M,A,b)=>{s("caret",v,m,y,M,A,b);let h;return k(y)?h="":k(M)?h=`>=${y}.0.0${g} <${+y+1}.0.0-0`:k(A)?y==="0"?h=`>=${y}.${M}.0${g} <${y}.${+M+1}.0-0`:h=`>=${y}.${M}.0${g} <${+y+1}.0.0-0`:b?(s("replaceCaret pr",b),y==="0"?M==="0"?h=`>=${y}.${M}.${A}-${b} <${y}.${M}.${+A+1}-0`:h=`>=${y}.${M}.${A}-${b} <${y}.${+M+1}.0-0`:h=`>=${y}.${M}.${A}-${b} <${+y+1}.0.0-0`):(s("no pr"),y==="0"?M==="0"?h=`>=${y}.${M}.${A}${g} <${y}.${M}.${+A+1}-0`:h=`>=${y}.${M}.${A}${g} <${y}.${+M+1}.0-0`:h=`>=${y}.${M}.${A} <${+y+1}.0.0-0`),s("caret return",h),h})},G=(v,a)=>(s("replaceXRanges",v,a),v.split(/\s+/).map(d=>V(d,a)).join(" ")),V=(v,a)=>{v=v.trim();const d=a.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return v.replace(d,(g,m,y,M,A,b)=>{s("xRange",v,g,m,y,M,A,b);const h=k(y),S=h||k(M),W=S||k(A),q=W;return m==="="&&q&&(m=""),b=a.includePrerelease?"-0":"",h?m===">"||m==="<"?g="<0.0.0-0":g="*":m&&q?(S&&(M=0),A=0,m===">"?(m=">=",S?(y=+y+1,M=0,A=0):(M=+M+1,A=0)):m==="<="&&(m="<",S?y=+y+1:M=+M+1),m==="<"&&(b="-0"),g=`${m+y}.${M}.${A}${b}`):S?g=`>=${y}.0.0${b} <${+y+1}.0.0-0`:W&&(g=`>=${y}.${M}.0${b} <${y}.${+M+1}.0-0`),s("xRange return",g),g})},H=(v,a)=>(s("replaceStars",v,a),v.trim().replace(c[u.STAR],"")),X=(v,a)=>(s("replaceGTE0",v,a),v.trim().replace(c[a.includePrerelease?u.GTE0PRE:u.GTE0],"")),Q=v=>(a,d,g,m,y,M,A,b,h,S,W,q,I)=>(k(g)?d="":k(m)?d=`>=${g}.0.0${v?"-0":""}`:k(y)?d=`>=${g}.${m}.0${v?"-0":""}`:M?d=`>=${d}`:d=`>=${d}${v?"-0":""}`,k(h)?b="":k(S)?b=`<${+h+1}.0.0-0`:k(W)?b=`<${h}.${+S+1}.0-0`:q?b=`<=${h}.${S}.${W}-${q}`:v?b=`<${h}.${S}.${+W+1}-0`:b=`<=${b}`,`${d} ${b}`.trim()),ie=(v,a,d)=>{for(let g=0;g0){const m=v[g].semver;if(m.major===a.major&&m.minor===a.minor&&m.patch===a.patch)return!0}return!1}return!0};return fo}var po,tl;function Cs(){if(tl)return po;tl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(p,f){if(f=r(f),p instanceof t){if(p.loose===!!f.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),o("comparator",p,f),this.options=f,this.loose=!!f.loose,this.parse(p),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(p){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],_=p.match(f);if(!_)throw new TypeError(`Invalid comparator: ${p}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new c(_[2],this.options.loose):this.semver=e}toString(){return this.value}test(p){if(o("Comparator.test",p,this.options.loose),this.semver===e||p===e)return!0;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,f){if(!(p instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(p.value,f).test(this.value):p.operator===""?p.value===""?!0:new u(this.value,f).test(p.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,f)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,f)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}po=t;const r=ga,{safeRe:n,t:i}=ci,s=Mh,o=Ss,c=st,u=Rt();return po}const Nm=Rt(),Lm=(e,t,r)=>{try{t=new Nm(t,r)}catch{return!1}return t.test(e)};var Ms=Lm;const Om=Rt(),Pm=(e,t)=>new Om(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var $m=Pm;const Bm=st,Dm=Rt(),Fm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Dm(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Bm(n,r))}),n};var jm=Fm;const Hm=st,Um=Rt(),Wm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Um(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Hm(n,r))}),n};var Vm=Wm;const go=st,qm=Rt(),rl=Rs,zm=(e,t)=>{e=new qm(e,t);let r=new go("0.0.0");if(e.test(r)||(r=new go("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{const c=new go(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||rl(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||rl(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Gm=zm;const Jm=Rt(),Zm=(e,t)=>{try{return new Jm(e,t).range||"*"}catch{return null}};var Km=Zm;const Qm=st,Ih=Cs(),{ANY:Ym}=Ih,Xm=Rt(),ev=Ms,nl=Rs,il=ma,tv=ba,rv=va,nv=(e,t,r,n)=>{e=new Qm(e,n),t=new Xm(t,n);let i,s,o,c,u;switch(r){case">":i=nl,s=tv,o=il,c=">",u=">=";break;case"<":i=il,s=rv,o=nl,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ev(e,t,n))return!1;for(let l=0;l{R.semver===Ym&&(R=new Ih(">=0.0.0")),f=f||R,_=_||R,i(R.semver,f.semver,n)?f=R:o(R.semver,_.semver,n)&&(_=R)}),f.operator===c||f.operator===u||(!_.operator||_.operator===c)&&s(e,_.semver))return!1;if(_.operator===u&&o(e,_.semver))return!1}return!0};var ya=nv;const iv=ya,sv=(e,t,r)=>iv(e,t,">",r);var ov=sv;const av=ya,cv=(e,t,r)=>av(e,t,"<",r);var lv=cv;const sl=Rt(),uv=(e,t,r)=>(e=new sl(e,r),t=new sl(t,r),e.intersects(t,r));var hv=uv;const dv=Ms,fv=St;var pv=(e,t,r)=>{const n=[];let i=null,s=null;const o=e.sort((p,f)=>fv(p,f,r));for(const p of o)dv(p,t,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const c=[];for(const[p,f]of n)p===f?c.push(p):!f&&p===o[0]?c.push("*"):f?p===o[0]?c.push(`<=${f}`):c.push(`${p} - ${f}`):c.push(`>=${p}`);const u=c.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return u.length{if(e===t)return!0;e=new ol(e,r),t=new ol(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const o=mv(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},_v=[new wa(">=0.0.0-0")],al=[new wa(">=0.0.0")],mv=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===_o){if(t.length===1&&t[0].semver===_o)return!0;r.includePrerelease?e=_v:e=al}if(t.length===1&&t[0].semver===_o){if(r.includePrerelease)return!0;t=al}const n=new Set;let i,s;for(const R of e)R.operator===">"||R.operator===">="?i=cl(i,R,r):R.operator==="<"||R.operator==="<="?s=ll(s,R,r):n.add(R.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Ea(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const R of n){if(i&&!kn(R,String(i),r)||s&&!kn(R,String(s),r))return null;for(const x of t)if(!kn(R,String(x),r))return!1;return!0}let c,u,l,p,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const R of t){if(p=p||R.operator===">"||R.operator===">=",l=l||R.operator==="<"||R.operator==="<=",i){if(_&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===_.major&&R.semver.minor===_.minor&&R.semver.patch===_.patch&&(_=!1),R.operator===">"||R.operator===">="){if(c=cl(i,R,r),c===R&&c!==i)return!1}else if(i.operator===">="&&!kn(i.semver,String(R),r))return!1}if(s){if(f&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===f.major&&R.semver.minor===f.minor&&R.semver.patch===f.patch&&(f=!1),R.operator==="<"||R.operator==="<="){if(u=ll(s,R,r),u===R&&u!==s)return!1}else if(s.operator==="<="&&!kn(s.semver,String(R),r))return!1}if(!R.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&p&&!i&&o!==0||_||f)},cl=(e,t,r)=>{if(!e)return t;const n=Ea(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},ll=(e,t,r)=>{if(!e)return t;const n=Ea(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var vv=gv;const mo=ci,ul=Es,bv=st,hl=Sh,yv=Rn,wv=y_,Ev=S_,Sv=C_,Rv=k_,Cv=A_,Mv=L_,kv=$_,Iv=F_,xv=St,Av=W_,Tv=z_,Nv=_a,Lv=K_,Ov=X_,Pv=Rs,$v=ma,Bv=Rh,Dv=Ch,Fv=va,jv=ba,Hv=Mh,Uv=Em,Wv=Cs(),Vv=Rt(),qv=Ms,zv=$m,Gv=jm,Jv=Vm,Zv=Gm,Kv=Km,Qv=ya,Yv=ov,Xv=lv,eb=hv,tb=pv,rb=vv;var nb={parse:yv,valid:wv,clean:Ev,inc:Sv,diff:Rv,major:Cv,minor:Mv,patch:kv,prerelease:Iv,compare:xv,rcompare:Av,compareLoose:Tv,compareBuild:Nv,sort:Lv,rsort:Ov,gt:Pv,lt:$v,eq:Bv,neq:Dv,gte:Fv,lte:jv,cmp:Hv,coerce:Uv,Comparator:Wv,Range:Vv,satisfies:qv,toComparators:zv,maxSatisfying:Gv,minSatisfying:Jv,minVersion:Zv,validRange:Kv,outside:Qv,gtr:Yv,ltr:Xv,intersects:eb,simplifyRange:tb,subset:rb,SemVer:bv,re:mo.re,src:mo.src,tokens:mo.t,SEMVER_SPEC_VERSION:ul.SEMVER_SPEC_VERSION,RELEASE_TYPES:ul.RELEASE_TYPES,compareIdentifiers:hl.compareIdentifiers,rcompareIdentifiers:hl.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=nb,r=Lr,n=tt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,t.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,t.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,e.VersionStruct)}e.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,e.VersionRangeStruct)}e.isValidSemVerRange=s;function o(f){(0,n.assertStruct)(f,e.VersionStruct)}e.assertIsSemVerVersion=o;function c(f){(0,n.assertStruct)(f,e.VersionRangeStruct)}e.assertIsSemVerRange=c;function u(f,_){return(0,t.gt)(f,_)}e.gtVersion=u;function l(f,_){return(0,t.gtr)(f,_)}e.gtRange=l;function p(f,_){return(0,t.satisfies)(f,_,{includePrerelease:!0})}e.satisfiesVersionRange=p})(yh);(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,c)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(tt,e),r(oi,e),r(ae,e),r(ys,e),r(Lt,e),r(dn,e),r(fh,e),r(ai,e),r(ph,e),r(gh,e),r(fn,e),r(_h,e),r(Ot,e),r(mh,e),r(vh,e),r(bh,e),r(yh,e)})(Ju);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Ju;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Gu);var xh=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vs,"__esModule",{value:!0});vs.PollingBlockTracker=void 0;const ib=xh(oa),sb=xh(S1),ob=ri,dl=Gu,fl=(0,dl.createModuleLogger)(dl.projectLogger,"polling-block-tracker"),ab=(0,ib.default)(),cb=1e3;class lb extends ob.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*cb,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=pl(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: +${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=pl(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:ab(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),fl("Making request",t);const r=await(0,sb.default)(n=>this._provider.sendAsync(t,n))();if(fl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: +${r.error.message}`);return r.result}}vs.PollingBlockTracker=lb;function pl(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var ks={},ub=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ks,"__esModule",{value:!0});ks.SubscribeBlockTracker=void 0;const hb=ub(oa),db=ri,fb=(0,hb.default)();class pb extends db.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:fb(),method:t,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}ks.SubscribeBlockTracker=pb;(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(vs,e),r(ks,e)})(zu);var Sa={},Is={},li={};Object.defineProperty(li,"__esModule",{value:!0});li.getUniqueId=void 0;const Ah=4294967295;let vo=Math.floor(Math.random()*Ah);function gb(){return vo=(vo+1)%Ah,vo}li.getUniqueId=gb;Object.defineProperty(Is,"__esModule",{value:!0});Is.createIdRemapMiddleware=void 0;const _b=li;function mb(){return(e,t,r,n)=>{const i=e.id,s=_b.getUniqueId();e.id=s,t.id=s,r(o=>{e.id=i,t.id=i,o()})}}Is.createIdRemapMiddleware=mb;var xs={};Object.defineProperty(xs,"__esModule",{value:!0});xs.createAsyncMiddleware=void 0;function vb(e){return async(t,r,n,i)=>{let s;const o=new Promise(p=>{s=p});let c=null,u=!1;const l=async()=>{u=!0,n(p=>{c=p,s()}),await o};try{await e(t,r,l),u?(await o,c(null)):i(null)}catch(p){c?c(p):i(p)}}}xs.createAsyncMiddleware=vb;var As={};Object.defineProperty(As,"__esModule",{value:!0});As.createScaffoldMiddleware=void 0;function bb(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}As.createScaffoldMiddleware=bb;var ui={},Ra={};Object.defineProperty(Ra,"__esModule",{value:!0});const yb=Fi;function gl(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function wb(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const c=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw c.context=o,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")gl(s,this,r);else{const o=s.length,c=wb(s);for(let u=0;u"u"&&(n=Lh()),Do(e,"",0,[],void 0,0,n);var i;try{wr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Ph(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Mr.length!==0;){var s=Mr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function sn(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Mr.push([n,r,t,i])):wr.push([t,r,e]):(n[r]=e,Mr.push([n,r,t]))}function Do(e,t,r,n,i,s,o){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;co.depthLimit){sn(Pi,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){sn(Pi,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;ct?1:0}function Oh(e,t,r,n){typeof n>"u"&&(n=Lh());var i=Fo(e,"",0,[],void 0,0,n)||e,s;try{wr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,Ph(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Mr.length!==0;){var o=Mr.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Fo(e,t,r,n,i,s,o){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;co.depthLimit){sn(Pi,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){sn(Pi,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c0)for(var n=0;n=1e3&&e<=4999}function Ib(e,t){if(t!=="[Circular]")return t}var Ca={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.errorValues=Kt.errorCodes=void 0;Kt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Kt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Kt,r=Zt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(_,R=i){if(Number.isInteger(_)){const x=_.toString();if(f(t.errorValues,x))return t.errorValues[x].message;if(l(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return R}e.getMessageFromCode=o;function c(_){if(!Number.isInteger(_))return!1;const R=_.toString();return!!(t.errorValues[R]||l(_))}e.isValidCode=c;function u(_,{fallbackError:R=s,shouldIncludeStack:x=!1}={}){var P,L;if(!R||!Number.isInteger(R.code)||typeof R.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(_ instanceof r.EthereumRpcError)return _.serialize();const C={};if(_&&typeof _=="object"&&!Array.isArray(_)&&f(_,"code")&&c(_.code)){const N=_;C.code=N.code,N.message&&typeof N.message=="string"?(C.message=N.message,f(N,"data")&&(C.data=N.data)):(C.message=o(C.code),C.data={originalError:p(_)})}else{C.code=R.code;const N=(P=_)===null||P===void 0?void 0:P.message;C.message=N&&typeof N=="string"?N:R.message,C.data={originalError:p(_)}}const k=(L=_)===null||L===void 0?void 0:L.stack;return x&&_&&k&&typeof k=="string"&&(C.stack=k),C}e.serializeError=u;function l(_){return _>=-32099&&_<=-32e3}function p(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function f(_,R){return Object.prototype.hasOwnProperty.call(_,R)}})(Ca);var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.ethErrors=void 0;const Ma=Zt,Bh=Ca,rt=Kt;Ts.ethErrors={rpc:{parse:e=>ft(rt.errorCodes.rpc.parse,e),invalidRequest:e=>ft(rt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>ft(rt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>ft(rt.errorCodes.rpc.methodNotFound,e),internal:e=>ft(rt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ft(t,e)},invalidInput:e=>ft(rt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>ft(rt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ft(rt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ft(rt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ft(rt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ft(rt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>In(rt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>In(rt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>In(rt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>In(rt.errorCodes.provider.disconnected,e),chainDisconnected:e=>In(rt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Ma.EthereumProviderError(t,r,n)}}};function ft(e,t){const[r,n]=Dh(t);return new Ma.EthereumRpcError(e,r||Bh.getMessageFromCode(e),n)}function In(e,t){const[r,n]=Dh(t);return new Ma.EthereumProviderError(e,r||Bh.getMessageFromCode(e),n)}function Dh(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Zt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Ca;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ts;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Kt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Th);var xb=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ui,"__esModule",{value:!0});ui.JsonRpcEngine=void 0;const Ab=xb(Ra),pt=Th;class Bt extends Ab.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,o,c]=await Bt._runAllMiddleware(t,r,this._middleware);return o?(await Bt._runReturnHandlers(c),i(s)):n(async u=>{try{await Bt._runReturnHandlers(c)}catch(l){return u(l)}return u()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new pt.EthereumRpcError(pt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new pt.EthereumRpcError(pt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=pt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await Bt._runAllMiddleware(t,r,this._middleware);if(Bt._checkForCompletion(t,r,i),await Bt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,o=!1;for(const c of n)if([s,o]=await Bt._runMiddleware(t,r,c,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const o=u=>{const l=u||r.error;l&&(r.error=pt.serializeError(l)),s([l,!0])},c=u=>{r.error?o(r.error):(u&&(typeof u!="function"&&o(new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof u}" for request: +${bo(t)}`,{request:t})),i.push(u)),s([null,!1]))};try{n(t,r,c,o)}catch(u){o(u)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: +${bo(t)}`,{request:t});if(!n)throw new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: +${bo(t)}`,{request:t})}}ui.JsonRpcEngine=Bt;function bo(e){return JSON.stringify(e,null,2)}var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.mergeMiddleware=void 0;const Tb=ui;function Nb(e){const t=new Tb.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Ns.mergeMiddleware=Nb;(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Is,e),r(xs,e),r(As,e),r(li,e),r(ui,e),r(Ns,e)})(Sa);var Fh={},ka={},jo=function(e,t){return jo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},jo(e,t)};function jh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");jo(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var $i=function(){return $i=Object.assign||function(t){for(var r,n=1,i=arguments.length;n=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function Wh(e,t){return function(r,n){t(r,n,e)}}function Lb(e,t,r,n,i,s){function o(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var c=n.kind,u=c==="getter"?"get":c==="setter"?"set":"value",l=!t&&e?n.static?e:e.prototype:null,p=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,_=!1,R=r.length-1;R>=0;R--){var x={};for(var P in n)x[P]=P==="access"?{}:n[P];for(var P in n.access)x.access[P]=n.access[P];x.addInitializer=function(C){if(_)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(C||null))};var L=(0,r[R])(c==="accessor"?{get:p.get,set:p.set}:p[u],x);if(c==="accessor"){if(L===void 0)continue;if(L===null||typeof L!="object")throw new TypeError("Object expected");(f=o(L.get))&&(p.get=f),(f=o(L.set))&&(p.set=f),(f=o(L.init))&&i.unshift(f)}else(f=o(L))&&(c==="field"?i.unshift(f):p[u]=f)}l&&Object.defineProperty(l,n.name,p),_=!0}function Ob(e,t,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ia(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Jh(){for(var e=[],t=0;t1||c(_,R)})})}function c(_,R){try{u(n[_](R))}catch(x){f(s[0][3],x)}}function u(_){_.value instanceof pn?Promise.resolve(_.value.v).then(l,p):f(s[0][2],_)}function l(_){c("next",_)}function p(_){c("throw",_)}function f(_,R){_(R),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Yh(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=e[i]?function(o){return(r=!r)?{value:pn(e[i](o)),done:!1}:s?s(o):o}:s}}function Xh(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Bi=="function"?Bi(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(c,u){o=e[s](o),i(c,u,o.done,o.value)})}}function i(s,o,c,u){Promise.resolve(u).then(function(l){s({value:l,done:c})},o)}}function ed(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Bb=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function td(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ls(t,e,r);return Bb(t,e),t}function rd(e){return e&&e.__esModule?e:{default:e}}function nd(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function id(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function sd(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function od(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var Db=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function ad(e){function t(n){e.error=e.hasError?new Db(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}function r(){for(;e.stack.length;){var n=e.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return t(s),r()})}catch(s){t(s)}}if(e.hasError)throw e.error}return r()}const Fb={__extends:jh,__assign:$i,__rest:Hh,__decorate:Uh,__param:Wh,__metadata:Vh,__awaiter:qh,__generator:zh,__createBinding:Ls,__exportStar:Gh,__values:Bi,__read:Ia,__spread:Jh,__spreadArrays:Zh,__spreadArray:Kh,__await:pn,__asyncGenerator:Qh,__asyncDelegator:Yh,__asyncValues:Xh,__makeTemplateObject:ed,__importStar:td,__importDefault:rd,__classPrivateFieldGet:nd,__classPrivateFieldSet:id,__classPrivateFieldIn:sd,__addDisposableResource:od,__disposeResources:ad},jb=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:od,get __assign(){return $i},__asyncDelegator:Yh,__asyncGenerator:Qh,__asyncValues:Xh,__await:pn,__awaiter:qh,__classPrivateFieldGet:nd,__classPrivateFieldIn:sd,__classPrivateFieldSet:id,__createBinding:Ls,__decorate:Uh,__disposeResources:ad,__esDecorate:Lb,__exportStar:Gh,__extends:jh,__generator:zh,__importDefault:rd,__importStar:td,__makeTemplateObject:ed,__metadata:Vh,__param:Wh,__propKey:Pb,__read:Ia,__rest:Hh,__runInitializers:Ob,__setFunctionName:$b,__spread:Jh,__spreadArray:Kh,__spreadArrays:Zh,__values:Bi,default:Fb},Symbol.toStringTag,{value:"Module"})),xa=gn(jb);var Os={};Object.defineProperty(Os,"__esModule",{value:!0});var _l=xa,Hb=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return _l.__awaiter(this,void 0,void 0,function(){var r,n,i;return _l.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Os.default=Hb;Object.defineProperty(ka,"__esModule",{value:!0});var ml=xa,Ub=Os,Wb=function(){function e(){this._semaphore=new Ub.default(1)}return e.prototype.acquire=function(){return ml.__awaiter(this,void 0,void 0,function(){var t,r;return ml.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();ka.default=Wb;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.withTimeout=void 0;var Ci=xa;function Vb(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Ci.__awaiter(n,void 0,void 0,function(){var o,c,u;return Ci.__generator(this,function(l){switch(l.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},t),[4,e.acquire()];case 1:return c=l.sent(),o?(u=Array.isArray(c)?c[1]:c,u()):i(c),[2]}})})})},runExclusive:function(i){return Ci.__awaiter(this,void 0,void 0,function(){var s,o;return Ci.__generator(this,function(c){switch(c.label){case 0:s=function(){},c.label=1;case 1:return c.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=c.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,c.sent()];case 4:return s=o,[4,i()];case 5:return[2,c.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Ps.withTimeout=Vb;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=ka;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Os;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Ps;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Fh);var qb=Gb,zb=Object.prototype.hasOwnProperty;function Gb(){for(var e={},t=0;tfunction(...i){const s=t.promiseModule;return new s((o,c)=>{t.multiArgs?i.push((...l)=>{t.errorFirst?l[0]?c(l):(l.shift(),o(l)):o(l)}):t.errorFirst?i.push((l,p)=>{l?c(l):o(p)}):i.push(o),Reflect.apply(e,this===r?n:this,i)})},bl=new WeakMap;var Yb=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(o,c)=>{let u=bl.get(o);if(u||(u={},bl.set(o,u)),c in u)return u[c];const l=x=>typeof x=="string"||typeof c=="symbol"?c===x:x.test(c),p=Reflect.getOwnPropertyDescriptor(o,c),f=p===void 0||p.writable||p.configurable,R=(t.include?t.include.some(l):!t.exclude.some(l))&&f;return u[c]=R,R},i=new WeakMap,s=new Proxy(e,{apply(o,c,u){const l=i.get(o);if(l)return Reflect.apply(l,c,u);const p=t.excludeMain?o:vl(o,t,s,o);return i.set(o,p),Reflect.apply(p,c,u)},get(o,c){const u=o[c];if(!n(o,c)||u===Function.prototype[c])return u;const l=i.get(u);if(l)return l;if(typeof u=="function"){const p=vl(u,t,s,o);return i.set(u,p),p}return u}});return s};const Xb=ni.default;let ey=class extends Xb{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var Aa=ey;const ty=Aa;let ry=class extends ty{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var ny=ry,di={minBlockRef:iy,maxBlockRef:sy,sortBlockRefs:Ta,bnToHex:oy,blockRefIsNumber:ay,hexToInt:Di,incrementHexInt:cy,intToHex:cd,unsafeRandomBytes:ly};function iy(...e){return Ta(e)[0]}function sy(...e){const t=Ta(e);return t[t.length-1]}function Ta(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Di(t)-Di(r))}function oy(e){return"0x"+e.toString(16)}function ay(e){return e&&!["earliest","latest","pending"].includes(e)}function Di(e){return e==null?e:Number.parseInt(e,16)}function cy(e){if(e==null)return e;const t=Di(e);return cd(t+1)}function cd(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function ly(e){let t="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=py(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=fy(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),c=(await this._fetchLogs(s)).filter(u=>this.matchLog(u));this.addResults(c)}async _fetchLogs(t){return await hy(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Mi(this.params.fromBlock)>=Mi(t.blockNumber)||gy(this.params.toBlock)&&Mi(this.params.toBlock)<=Mi(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=t.topics[s];if(!o)return!1;o=o.toLowerCase();let c=Array.isArray(i)?i:[i];return c.includes(null)?!0:(c=c.map(p=>p.toLowerCase()),c.includes(o))})}};var my=_y,Na=vy;async function vy({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=wl(t),s=wl(r)-n+1,o=Array(s).fill().map((u,l)=>n+l).map(by);let c=await Promise.all(o.map(u=>wy(e,"eth_getBlockByNumber",[u,!1])));return c=c.filter(u=>u!==null),c}function wl(e){return e==null?e:Number.parseInt(e,16)}function by(e){return e==null?e:"0x"+e.toString(16)}function yy(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function wy(e,t,r){for(let n=0;n<3;n++)try{return await yy(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const Ey=Aa,Sy=Na,{incrementHexInt:Ry}=di;let Cy=class extends Ey{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=Ry(t),o=(await Sy({provider:this.provider,fromBlock:i,toBlock:n})).map(c=>c.hash);this.addResults(o)}};var My=Cy;const ky=Aa,Iy=Na,{incrementHexInt:xy}=di;let Ay=class extends ky{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=xy(t),i=await Iy({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Ty=Ay;const Ny=Fh.Mutex,{createAsyncMiddleware:Ly,createScaffoldMiddleware:Oy}=Sa,Py=my,$y=My,By=Ty,{intToHex:ld,hexToInt:yo}=di;var Dy=Fy;function Fy({blockTracker:e,provider:t}){let r=0,n={};const i=new Ny,s=jy({mutex:i}),o=Oy({eth_newFilter:s(wo(u)),eth_newBlockFilter:s(wo(l)),eth_newPendingTransactionFilter:s(wo(p)),eth_uninstallFilter:s(Ti(R)),eth_getFilterChanges:s(Ti(f)),eth_getFilterLogs:s(Ti(_))}),c=async({oldBlock:k,newBlock:N})=>{if(n.length===0)return;const $=await i.acquire();try{await Promise.all(Qr(n).map(async O=>{try{await O.update({oldBlock:k,newBlock:N})}catch(D){console.error(D)}}))}catch(O){console.error(O)}$()};return o.newLogFilter=u,o.newBlockFilter=l,o.newPendingTransactionFilter=p,o.uninstallFilter=R,o.getFilterChanges=f,o.getFilterLogs=_,o.destroy=()=>{L()},o;async function u(k){const N=new Py({provider:t,params:k});return await x(N),N}async function l(){const k=new $y({provider:t});return await x(k),k}async function p(){const k=new By({provider:t});return await x(k),k}async function f(k){const N=yo(k),$=n[N];if(!$)throw new Error(`No filter for index "${N}"`);return $.getChangesAndClear()}async function _(k){const N=yo(k),$=n[N];if(!$)throw new Error(`No filter for index "${N}"`);let O=[];return $.type==="log"&&(O=$.getAllResults()),O}async function R(k){const N=yo(k),O=!!n[N];return O&&await P(N),O}async function x(k){const N=Qr(n).length,$=await e.getLatestBlock();await k.initialize({currentBlock:$}),r++,n[r]=k,k.id=r,k.idHex=ld(r);const O=Qr(n).length;return C({prevFilterCount:N,newFilterCount:O}),r}async function P(k){const N=Qr(n).length;delete n[k];const $=Qr(n).length;C({prevFilterCount:N,newFilterCount:$})}async function L(){const k=Qr(n).length;n={},C({prevFilterCount:k,newFilterCount:0})}function C({prevFilterCount:k,newFilterCount:N}){if(k===0&&N>0){e.on("sync",c);return}if(k>0&&N===0){e.removeListener("sync",c);return}}}function wo(e){return Ti(async(...t)=>{const r=await e(...t);return ld(r.id)})}function Ti(e){return Ly(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function jy({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Qr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const Hy=ni.default,{createAsyncMiddleware:El,createScaffoldMiddleware:Uy}=Sa,Wy=Dy,{unsafeRandomBytes:Vy,incrementHexInt:qy}=di,zy=Na;var Gy=Jy;function Jy({blockTracker:e,provider:t}){const r={},n=Wy({blockTracker:e,provider:t});let i=!1;const s=new Hy,o=Uy({eth_subscribe:El(c),eth_unsubscribe:El(u)});return o.destroy=p,{events:s,middleware:o};async function c(f,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const R=f.params[0],x=Vy(16);let P;switch(R){case"newHeads":P=L({subId:x});break;case"logs":const k=f.params[1],N=await n.newLogFilter(k);P=C({subId:x,filter:N});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${R}"`)}r[x]=P,_.result=x;return;function L({subId:k}){const N={type:R,destroy:async()=>{e.removeListener("sync",N.update)},update:async({oldBlock:$,newBlock:O})=>{const D=O,G=qy($);(await zy({provider:t,fromBlock:G,toBlock:D})).map(Zy).filter(X=>X!==null).forEach(X=>{l(k,X)})}};return e.on("sync",N.update),N}function C({subId:k,filter:N}){return N.on("update",O=>l(k,O)),{type:R,destroy:async()=>await n.uninstallFilter(N.idHex)}}}async function u(f,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const R=f.params[0],x=r[R];if(!x){_.result=!1;return}delete r[R],await x.destroy(),_.result=!0}function l(f,_){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:_}})}function p(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function Zy(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(ms,"__esModule",{value:!0});ms.SubscriptionManager=void 0;const Ky=zu,Qy=Gy,Sl=()=>{};class Yy{constructor(t){const r=new Ky.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Qy({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,Sl,Sl),r}destroy(){this.subscriptionMiddleware.destroy()}}ms.SubscriptionManager=Yy;var ud=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(on,"__esModule",{value:!0});on.CoinbaseWalletProvider=void 0;const Xy=ud(Ui),ew=Vd,se=jn,re=z,tw=Vn,Rl=gt,ki=bn,lt=_n,Eo=ud(v1),xn=vn,rw=hn,nw=ms,Cl="DefaultChainId",Ml="DefaultJsonRpcUrl";class iw extends ew.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new rw.FilterPolyfill(this),this._subscriptionManager=new nw.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,re.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(Rl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const c=o.split(" ");c[0]!==""&&(this._addresses=c.map(u=>(0,re.ensureAddressString)(u)),this.emit("accountsChanged",c))}this._subscriptionManager.events.on("notification",c=>{this.emit("message",{type:c.method,data:c.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",c=>{var u;if(!(c.origin!==location.origin||c.source!==window)&&c.data.type==="walletLinkMessage"&&c.data.data.action==="dappChainSwitched"){const l=c.data.data.chainId,p=(u=c.data.data.jsonRpcUrl)!==null&&u!==void 0?u:this.jsonRpcUrl;this.updateProviderInfo(p,Number(l))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,re.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(Ml))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Ml,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(Cl,r.toString(10)),((0,re.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,o){const u=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,o==null?void 0:o.toString()).promise;return(0,lt.isErrorResponse)(u)?!1:!!u.result}async addEthereumChain(t,r,n,i,s,o){var c,u;if((0,re.ensureIntNumber)(t)===this.getChainId())return!1;const l=await this.initializeRelay(),p=l.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!p&&await l.requestEthereumAccounts().promise;const f=await l.addEthereumChain(t.toString(),r,s,n,i,o).promise;return(0,lt.isErrorResponse)(f)?!1:(((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0&&this.updateProviderInfo(r[0],t),((u=f.result)===null||u===void 0?void 0:u.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,lt.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===se.standardErrorCodes.provider.unsupportedChain?se.standardErrors.provider.unsupportedChain():se.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?ki.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,se.serializeError)(i,t)})}catch(n){throw(0,se.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(c=>c.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,se.serializeError)(n,t)})}catch(n){return Promise.reject((0,se.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,se.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,se.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw se.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw se.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw se.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,re.ensureRegExpString)(t)).promise;if((0,lt.isErrorResponse)(n))throw(0,se.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,se.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,lt.isErrorResponse)(i))throw(0,se.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,se.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?ki.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof tw.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,lt.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,lt.isErrorResponse)(n))throw(0,se.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,se.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,re.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Rl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(c=>r(Object.assign(Object.assign({},c),{id:t.id}))).catch(c=>n(c));return}const o=this._handleSubscriptionMethods(t);if(o!==void 0){o.then(c=>r({jsonrpc:"2.0",id:t.id,result:c.result})).catch(c=>n(c));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var o;throw(s.code===se.standardErrorCodes.rpc.methodNotFound||s.code===se.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log(xn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?ki.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,re.ensureAddressString)(t);return this._addresses.map(i=>(0,re.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(xn.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,re.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,re.ensureAddressString)(t.to):null,i=t.value!=null?(0,re.ensureBN)(t.value):new Xy.default(0),s=t.data?(0,re.ensureBuffer)(t.data):Buffer.alloc(0),o=t.nonce!=null?(0,re.ensureIntNumber)(t.nonce):null,c=t.gasPrice!=null?(0,re.ensureBN)(t.gasPrice):null,u=t.maxFeePerGas!=null?(0,re.ensureBN)(t.maxFeePerGas):null,l=t.maxPriorityFeePerGas!=null?(0,re.ensureBN)(t.maxPriorityFeePerGas):null,p=t.gas!=null?(0,re.ensureBN)(t.gas):null,f=t.chainId?(0,re.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:c,maxFeePerGas:u,maxPriorityFeePerGas:l,gasLimit:p,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw se.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw se.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,lt.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,lt.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,re.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Cl);if(!t)return(0,re.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,re.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?ki.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,lt.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,re.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,re.ensureParsedJSONObject)(t[0]),n=(0,re.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=Eo.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Eo.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Eo.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const o=t[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw se.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw se.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const c=parseInt(o.chainId,16);return await this.addEthereumChain(c,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw se.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw se.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw se.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw se.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:c}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,c,o,n)}}_eth_uninstallFilter(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}on.CoinbaseWalletProvider=iw;var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.RelayEventManager=void 0;const sw=z;class ow{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,sw.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}$s.RelayEventManager=ow;Object.defineProperty(On,"__esModule",{value:!0});On.CoinbaseWalletSDK=void 0;const aw=ji,cw=Hi,kl=z,lw=Gi,uw=on,hw=Vn,dw=ti,fw=$s,pw=Kn,gw=qn,hd=mn;class Bs{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||cw.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const o=new URL(s),c=`${o.protocol}//${o.host}`;if(this._storage=new lw.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Bs.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new fw.RelayEventManager;const u=(0,kl.isMobileWeb)(),l=t.uiConstructor||(f=>u?new dw.MobileRelayUI(f):new pw.WalletLinkRelayUI(f)),p={linkAPIUrl:s,version:hd.LIB_VERSION,darkMode:!!t.darkMode,uiConstructor:l,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=u?new hw.MobileRelay(p):new gw.WalletLinkRelay(p),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new uw.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,kl.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,aw.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}On.CoinbaseWalletSDK=Bs;Bs.VERSION=hd.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=On,r=on;var n=On;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=on;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Uo);const _w=dd(Uo),xw=fd({__proto__:null,default:_w},[Uo]);export{xw as i}; diff --git a/_app/immutable/chunks/index.BtSuiA6z.js b/_app/immutable/chunks/index.BtSuiA6z.js new file mode 100644 index 0000000..96982ec --- /dev/null +++ b/_app/immutable/chunks/index.BtSuiA6z.js @@ -0,0 +1 @@ +var E=Object.defineProperty;var O=(t,e,n)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _=(t,e,n)=>(O(t,typeof e!="symbol"?e+"":e,n),n);import{r as $,n as c,K as p,f as b,i as C,L as I,M as v,N as L,O as x,P as M,Q as N,R as w,S as P,T as R,U,V,W as j}from"./scheduler.gEqqeaCZ.js";const u=new Set;let f;function D(){f={r:0,c:[],p:f}}function F(){f.r||$(f.c),f=f.p}function B(t,e){t&&t.i&&(u.delete(t),t.i(e))}function G(t,e,n,a){if(t&&t.o){if(u.has(t))return;u.add(t),f.c.push(()=>{u.delete(t),a&&(n&&t.d(1),a())}),t.o(e)}else a&&a()}function H(t){t&&t.c()}function J(t,e){t&&t.l(e)}function K(t,e,n){const{fragment:a,after_update:i}=t.$$;a&&a.m(e,n),x(()=>{const d=t.$$.on_mount.map(P).filter(v);t.$$.on_destroy?t.$$.on_destroy.push(...d):$(d),t.$$.on_mount=[]}),i.forEach(x)}function Q(t,e){const n=t.$$;n.fragment!==null&&(M(n.after_update),$(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function T(t,e){t.$$.dirty[0]===-1&&(R.push(t),U(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const y=m.length?m[0]:g;return s.ctx&&i(s.ctx[r],s.ctx[r]=y)&&(!s.skip_bound&&s.bound[r]&&s.bound[r](y),h&&T(t,r)),g}):[],s.update(),h=!0,$(s.before_update),s.fragment=a?a(s.ctx):!1,e.target){if(e.hydrate){V();const r=b(e.target);s.fragment&&s.fragment.l(r),r.forEach(C)}else s.fragment&&s.fragment.c();e.intro&&B(t.$$.fragment),K(t,e.target,e.anchor),j(),I()}w(o)}class Y{constructor(){_(this,"$$");_(this,"$$set")}$destroy(){Q(this,1),this.$destroy=c}$on(e,n){if(!v(n))return c;const a=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return a.push(n),()=>{const i=a.indexOf(n);i!==-1&&a.splice(i,1)}}$set(e){this.$$set&&!L(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const W="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(W);export{Y as S,G as a,J as b,H as c,Q as d,F as e,D as g,X as i,K as m,B as t}; diff --git a/_app/immutable/chunks/index.WvR92-IP.js b/_app/immutable/chunks/index.WvR92-IP.js new file mode 100644 index 0000000..3b3dcd1 --- /dev/null +++ b/_app/immutable/chunks/index.WvR92-IP.js @@ -0,0 +1,2 @@ +const __vite__fileDeps=["./index.BA8N6X1u.js","./2.DEesTFv4.js","./scheduler.gEqqeaCZ.js","./index.BtSuiA6z.js","./site.BlgjxTUG.js","./kit.D0HsIFJD.js","./paths.DTSw6QKH.js","./preload-helper.D6kgxu3v.js","./contest.DdHcFc7E.js","./stores.CoMZMUm9.js","./entry.B5WQGdlh.js","../assets/2.B_eOxCME.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{_ as R}from"./preload-helper.D6kgxu3v.js";import{p as u,s as h,a as V}from"./2.DEesTFv4.js";const n=u({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),x={state:n,subscribe(e){return h(n,()=>e(n))},push(e,t){e!==n.view&&(n.view=e,t&&(n.data=t),n.history.push(e))},reset(e){n.view=e,n.history=[e]},replace(e){n.history.length>1&&(n.history[n.history.length-1]=e,n.view=e)},goBack(){if(n.history.length>1){n.history.pop();const[e]=n.history.slice(-1);n.view=e}},setData(e){n.data=e}},r={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return r.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return r.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(r.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const i=encodeURIComponent(t);return`${o}wc?uri=${i}`},formatUniversalUrl(e,t,s){if(!r.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const i=encodeURIComponent(t);return`${o}wc?uri=${i}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(r.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(r.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(r.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(r.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=x.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},H=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),a=u({enabled:H,userSessionId:"",events:[],connectedWalletId:void 0}),B={state:a,subscribe(e){return h(a.events,()=>e(V(a.events[a.events.length-1])))},initialize(){a.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(a.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){a.connectedWalletId=e},click(e){if(a.enabled){const t={type:"CLICK",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}},track(e){if(a.enabled){const t={type:"TRACK",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}},view(e){if(a.enabled){const t={type:"VIEW",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}}},d=u({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),c={state:d,subscribe(e){return h(d,()=>e(d))},setChains(e){d.chains=e},setWalletConnectUri(e){d.walletConnectUri=e},setIsCustomDesktop(e){d.isCustomDesktop=e},setIsCustomMobile(e){d.isCustomMobile=e},setIsDataLoaded(e){d.isDataLoaded=e},setIsUiLoaded(e){d.isUiLoaded=e},setIsAuth(e){d.isAuth=e}},w=u({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),v={state:w,subscribe(e){return h(w,()=>e(w))},setConfig(e){var t,s;B.initialize(),c.setChains(e.chains),c.setIsAuth(!!e.enableAuthMode),c.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),c.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),r.setModalVersionInStorage(),Object.assign(w,e)}};var K=Object.defineProperty,j=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,D=(e,t,s)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,q=(e,t)=>{for(var s in t||(t={}))z.call(t,s)&&D(e,s,t[s]);if(j)for(var s of j(t))J.call(t,s)&&D(e,s,t[s]);return e};const E="https://explorer-api.walletconnect.com",O="wcm",A="js-2.6.2";async function W(e,t){const s=q({sdkType:O,sdkVersion:A},t),o=new URL(e,E);return o.searchParams.append("projectId",v.state.projectId),Object.entries(s).forEach(([i,l])=>{l&&o.searchParams.append(i,String(l))}),(await fetch(o)).json()}const m={async getDesktopListings(e){return W("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return W("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return W("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return W("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${E}/w3m/v1/getWalletImage/${e}?projectId=${v.state.projectId}&sdkType=${O}&sdkVersion=${A}`},getAssetImageUrl(e){return`${E}/w3m/v1/getAssetImage/${e}?projectId=${v.state.projectId}&sdkType=${O}&sdkVersion=${A}`}};var F=Object.defineProperty,k=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,_=(e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,X=(e,t)=>{for(var s in t||(t={}))G.call(t,s)&&_(e,s,t[s]);if(k)for(var s of k(t))Q.call(t,s)&&_(e,s,t[s]);return e};const S=r.isMobile(),p=u({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),re={state:p,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=v.state;if(e==="NONE"||t==="ALL"&&!e)return p.recomendedWallets;if(r.isArray(e)){const s={recommendedIds:e.join(",")},{listings:o}=await m.getAllListings(s),i=Object.values(o);i.sort((l,b)=>{const y=e.indexOf(l.id),C=e.indexOf(b.id);return y-C}),p.recomendedWallets=i}else{const{chains:s,isAuth:o}=c.state,i=s==null?void 0:s.join(","),l=r.isArray(t),b={page:1,sdks:o?"auth_v1":void 0,entries:r.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:l?t.join(","):void 0},{listings:y}=S?await m.getMobileListings(b):await m.getDesktopListings(b);p.recomendedWallets=Object.values(y)}return p.recomendedWallets},async getWallets(e){const t=X({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=v.state,{recomendedWallets:i}=p;if(o==="ALL")return p.wallets;i.length?t.excludedIds=i.map($=>$.id).join(","):r.isArray(s)&&(t.excludedIds=s.join(",")),r.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),c.state.isAuth&&(t.sdks="auth_v1");const{page:l,search:b}=e,{listings:y,total:C}=S?await m.getMobileListings(t):await m.getDesktopListings(t),U=Object.values(y),M=b?"search":"wallets";return p[M]={listings:[...p[M].listings,...U],total:C,page:l??1},{listings:U,total:C}},getWalletImageUrl(e){return m.getWalletImageUrl(e)},getAssetImageUrl(e){return m.getAssetImageUrl(e)},resetSearch(){p.search={listings:[],total:0,page:1}}},I=u({open:!1}),L={state:I,subscribe(e){return h(I,()=>e(I))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:o}=c.state;if(r.removeWalletConnectDeepLink(),c.setWalletConnectUri(e==null?void 0:e.uri),c.setChains(e==null?void 0:e.chains),x.reset("ConnectWallet"),s&&o)I.open=!0,t();else{const i=setInterval(()=>{const l=c.state;l.isUiLoaded&&l.isDataLoaded&&(clearInterval(i),I.open=!0,t())},200)}})},close(){I.open=!1}};var Y=Object.defineProperty,N=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,T=(e,t,s)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,te=(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&T(e,s,t[s]);if(N)for(var s of N(t))ee.call(t,s)&&T(e,s,t[s]);return e};function se(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const f=u({themeMode:se()?"dark":"light"}),P={state:f,subscribe(e){return h(f,()=>e(f))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(f.themeMode=t),s&&(f.themeVariables=te({},s))}},g=u({open:!1,message:"",variant:"success"}),ie={state:g,subscribe(e){return h(g,()=>e(g))},openToast(e,t){g.open=!0,g.message=e,g.variant=t},closeToast(){g.open=!1}};class oe{constructor(t){this.openModal=L.open,this.closeModal=L.close,this.subscribeModal=L.subscribe,this.setTheme=P.setThemeConfig,P.setThemeConfig(t),v.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await R(()=>import("./index.BA8N6X1u.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),c.setIsUiLoaded(!0)}}}const le=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:oe},Symbol.toStringTag,{value:"Module"}));export{B as R,x as T,r as a,le as i,P as n,ie as o,c as p,L as s,re as t,v as y}; diff --git a/_app/immutable/chunks/index.es.BbAz7DCx.js b/_app/immutable/chunks/index.es.BbAz7DCx.js new file mode 100644 index 0000000..6f0f7a1 --- /dev/null +++ b/_app/immutable/chunks/index.es.BbAz7DCx.js @@ -0,0 +1,73 @@ +const __vite__fileDeps=["./index.WvR92-IP.js","./preload-helper.D6kgxu3v.js","./2.DEesTFv4.js","./scheduler.gEqqeaCZ.js","./index.BtSuiA6z.js","./site.BlgjxTUG.js","./kit.D0HsIFJD.js","./paths.DTSw6QKH.js","./contest.DdHcFc7E.js","./stores.CoMZMUm9.js","./entry.B5WQGdlh.js","../assets/2.B_eOxCME.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{_ as Kw}from"./preload-helper.D6kgxu3v.js";import{r as kw,e as Fr,U as Vu}from"./___vite-browser-external_commonjs-proxy.CXzVU9cb.js";import{b as Ts,g as ca,j as Yr}from"./2.DEesTFv4.js";var Gu={},ua={},je={},Jd={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(f,g){var p=f>>>16&65535,v=f&65535,w=g>>>16&65535,E=g&65535;return v*E+(p*E+v*w<<16>>>0)|0}i.mul=Math.imul||e;function t(f,g){return f+g|0}i.add=t;function s(f,g){return f-g|0}i.sub=s;function o(f,g){return f<>>32-g}i.rotl=o;function c(f,g){return f<<32-g|f>>>g}i.rotr=c;function l(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}i.isInteger=Number.isInteger||l,i.MAX_SAFE_INTEGER=9007199254740991,i.isSafeInteger=function(f){return i.isInteger(f)&&f>=-i.MAX_SAFE_INTEGER&&f<=i.MAX_SAFE_INTEGER}})(Jd);Object.defineProperty(je,"__esModule",{value:!0});var Qd=Jd;function Vw(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])<<16>>16}je.readInt16BE=Vw;function Gw(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])>>>0}je.readUint16BE=Gw;function Ww(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])<<16>>16}je.readInt16LE=Ww;function Yw(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])>>>0}je.readUint16LE=Yw;function Xd(i,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=i>>>8,e[t+1]=i>>>0,e}je.writeUint16BE=Xd;je.writeInt16BE=Xd;function Zd(i,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=i>>>0,e[t+1]=i>>>8,e}je.writeUint16LE=Zd;je.writeInt16LE=Zd;function vu(i,e){return e===void 0&&(e=0),i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}je.readInt32BE=vu;function mu(i,e){return e===void 0&&(e=0),(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])>>>0}je.readUint32BE=mu;function _u(i,e){return e===void 0&&(e=0),i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e]}je.readInt32LE=_u;function wu(i,e){return e===void 0&&(e=0),(i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e])>>>0}je.readUint32LE=wu;function ta(i,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=i>>>24,e[t+1]=i>>>16,e[t+2]=i>>>8,e[t+3]=i>>>0,e}je.writeUint32BE=ta;je.writeInt32BE=ta;function ra(i,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=i>>>0,e[t+1]=i>>>8,e[t+2]=i>>>16,e[t+3]=i>>>24,e}je.writeUint32LE=ra;je.writeInt32LE=ra;function Jw(i,e){e===void 0&&(e=0);var t=vu(i,e),s=vu(i,e+4);return t*4294967296+s-(s>>31)*4294967296}je.readInt64BE=Jw;function Qw(i,e){e===void 0&&(e=0);var t=mu(i,e),s=mu(i,e+4);return t*4294967296+s}je.readUint64BE=Qw;function Xw(i,e){e===void 0&&(e=0);var t=_u(i,e),s=_u(i,e+4);return s*4294967296+t-(t>>31)*4294967296}je.readInt64LE=Xw;function Zw(i,e){e===void 0&&(e=0);var t=wu(i,e),s=wu(i,e+4);return s*4294967296+t}je.readUint64LE=Zw;function ep(i,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),ta(i/4294967296>>>0,e,t),ta(i>>>0,e,t+4),e}je.writeUint64BE=ep;je.writeInt64BE=ep;function tp(i,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),ra(i>>>0,e,t),ra(i/4294967296>>>0,e,t+4),e}je.writeUint64LE=tp;je.writeInt64LE=tp;function eb(i,e,t){if(t===void 0&&(t=0),i%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(i/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var s=0,o=1,c=i/8+t-1;c>=t;c--)s+=e[c]*o,o*=256;return s}je.readUintBE=eb;function tb(i,e,t){if(t===void 0&&(t=0),i%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(i/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var s=0,o=1,c=t;c=s;c--)t[c]=e/o&255,o*=256;return t}je.writeUintBE=rb;function ib(i,e,t,s){if(t===void 0&&(t=new Uint8Array(i/8)),s===void 0&&(s=0),i%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Qd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,c=s;c>>16|R<<16,ue=ue+R|0,h^=ue,h=h>>>20|h<<12,O=O+b|0,X^=O,X=X>>>16|X<<16,ge=ge+X|0,b^=ge,b=b>>>20|b<<12,A=A+ee|0,J^=A,J=J>>>16|J<<16,ye=ye+J|0,ee^=ye,ee=ee>>>20|ee<<12,C=C+ne|0,k^=C,k=k>>>16|k<<16,S=S+k|0,ne^=S,ne=ne>>>20|ne<<12,A=A+ee|0,J^=A,J=J>>>24|J<<8,ye=ye+J|0,ee^=ye,ee=ee>>>25|ee<<7,C=C+ne|0,k^=C,k=k>>>24|k<<8,S=S+k|0,ne^=S,ne=ne>>>25|ne<<7,O=O+b|0,X^=O,X=X>>>24|X<<8,ge=ge+X|0,b^=ge,b=b>>>25|b<<7,j=j+h|0,R^=j,R=R>>>24|R<<8,ue=ue+R|0,h^=ue,h=h>>>25|h<<7,j=j+b|0,k^=j,k=k>>>16|k<<16,ye=ye+k|0,b^=ye,b=b>>>20|b<<12,O=O+ee|0,R^=O,R=R>>>16|R<<16,S=S+R|0,ee^=S,ee=ee>>>20|ee<<12,A=A+ne|0,X^=A,X=X>>>16|X<<16,ue=ue+X|0,ne^=ue,ne=ne>>>20|ne<<12,C=C+h|0,J^=C,J=J>>>16|J<<16,ge=ge+J|0,h^=ge,h=h>>>20|h<<12,A=A+ne|0,X^=A,X=X>>>24|X<<8,ue=ue+X|0,ne^=ue,ne=ne>>>25|ne<<7,C=C+h|0,J^=C,J=J>>>24|J<<8,ge=ge+J|0,h^=ge,h=h>>>25|h<<7,O=O+ee|0,R^=O,R=R>>>24|R<<8,S=S+R|0,ee^=S,ee=ee>>>25|ee<<7,j=j+b|0,k^=j,k=k>>>24|k<<8,ye=ye+k|0,b^=ye,b=b>>>25|b<<7;Xt.writeUint32LE(j+s|0,i,0),Xt.writeUint32LE(O+o|0,i,4),Xt.writeUint32LE(A+c|0,i,8),Xt.writeUint32LE(C+l|0,i,12),Xt.writeUint32LE(h+f|0,i,16),Xt.writeUint32LE(b+g|0,i,20),Xt.writeUint32LE(ee+p|0,i,24),Xt.writeUint32LE(ne+v|0,i,28),Xt.writeUint32LE(ue+w|0,i,32),Xt.writeUint32LE(ge+E|0,i,36),Xt.writeUint32LE(ye+x|0,i,40),Xt.writeUint32LE(S+I|0,i,44),Xt.writeUint32LE(R+B|0,i,48),Xt.writeUint32LE(X+K|0,i,52),Xt.writeUint32LE(J+Z|0,i,56),Xt.writeUint32LE(k+$|0,i,60)}function rp(i,e,t,s,o){if(o===void 0&&(o=0),i.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(s.length>>=8,e++;if(s>0)throw new Error("ChaCha: counter overflow")}var ip={},Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});function vb(i,e,t){return~(i-1)&e|i-1&t}Fi.select=vb;function mb(i,e){return(i|0)-(e|0)-1>>>31&1}Fi.lessOrEqual=mb;function np(i,e){if(i.length!==e.length)return 0;for(var t=0,s=0;s>>8}Fi.compare=np;function _b(i,e){return i.length===0||e.length===0?!1:np(i,e)!==0}Fi.equal=_b;(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=Fi,t=Ar;i.DIGEST_LENGTH=16;var s=function(){function l(f){this.digestLength=i.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var g=f[0]|f[1]<<8;this._r[0]=g&8191;var p=f[2]|f[3]<<8;this._r[1]=(g>>>13|p<<3)&8191;var v=f[4]|f[5]<<8;this._r[2]=(p>>>10|v<<6)&7939;var w=f[6]|f[7]<<8;this._r[3]=(v>>>7|w<<9)&8191;var E=f[8]|f[9]<<8;this._r[4]=(w>>>4|E<<12)&255,this._r[5]=E>>>1&8190;var x=f[10]|f[11]<<8;this._r[6]=(E>>>14|x<<2)&8191;var I=f[12]|f[13]<<8;this._r[7]=(x>>>11|I<<5)&8065;var B=f[14]|f[15]<<8;this._r[8]=(I>>>8|B<<8)&8191,this._r[9]=B>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return l.prototype._blocks=function(f,g,p){for(var v=this._fin?0:2048,w=this._h[0],E=this._h[1],x=this._h[2],I=this._h[3],B=this._h[4],K=this._h[5],Z=this._h[6],$=this._h[7],j=this._h[8],O=this._h[9],A=this._r[0],C=this._r[1],h=this._r[2],b=this._r[3],ee=this._r[4],ne=this._r[5],ue=this._r[6],ge=this._r[7],ye=this._r[8],S=this._r[9];p>=16;){var R=f[g+0]|f[g+1]<<8;w+=R&8191;var X=f[g+2]|f[g+3]<<8;E+=(R>>>13|X<<3)&8191;var J=f[g+4]|f[g+5]<<8;x+=(X>>>10|J<<6)&8191;var k=f[g+6]|f[g+7]<<8;I+=(J>>>7|k<<9)&8191;var V=f[g+8]|f[g+9]<<8;B+=(k>>>4|V<<12)&8191,K+=V>>>1&8191;var te=f[g+10]|f[g+11]<<8;Z+=(V>>>14|te<<2)&8191;var ie=f[g+12]|f[g+13]<<8;$+=(te>>>11|ie<<5)&8191;var De=f[g+14]|f[g+15]<<8;j+=(ie>>>8|De<<8)&8191,O+=De>>>5|v;var oe=0,Se=oe;Se+=w*A,Se+=E*(5*S),Se+=x*(5*ye),Se+=I*(5*ge),Se+=B*(5*ue),oe=Se>>>13,Se&=8191,Se+=K*(5*ne),Se+=Z*(5*ee),Se+=$*(5*b),Se+=j*(5*h),Se+=O*(5*C),oe+=Se>>>13,Se&=8191;var le=oe;le+=w*C,le+=E*A,le+=x*(5*S),le+=I*(5*ye),le+=B*(5*ge),oe=le>>>13,le&=8191,le+=K*(5*ue),le+=Z*(5*ne),le+=$*(5*ee),le+=j*(5*b),le+=O*(5*h),oe+=le>>>13,le&=8191;var Ce=oe;Ce+=w*h,Ce+=E*C,Ce+=x*A,Ce+=I*(5*S),Ce+=B*(5*ye),oe=Ce>>>13,Ce&=8191,Ce+=K*(5*ge),Ce+=Z*(5*ue),Ce+=$*(5*ne),Ce+=j*(5*ee),Ce+=O*(5*b),oe+=Ce>>>13,Ce&=8191;var z=oe;z+=w*b,z+=E*h,z+=x*C,z+=I*A,z+=B*(5*S),oe=z>>>13,z&=8191,z+=K*(5*ye),z+=Z*(5*ge),z+=$*(5*ue),z+=j*(5*ne),z+=O*(5*ee),oe+=z>>>13,z&=8191;var F=oe;F+=w*ee,F+=E*b,F+=x*h,F+=I*C,F+=B*A,oe=F>>>13,F&=8191,F+=K*(5*S),F+=Z*(5*ye),F+=$*(5*ge),F+=j*(5*ue),F+=O*(5*ne),oe+=F>>>13,F&=8191;var U=oe;U+=w*ne,U+=E*ee,U+=x*b,U+=I*h,U+=B*C,oe=U>>>13,U&=8191,U+=K*A,U+=Z*(5*S),U+=$*(5*ye),U+=j*(5*ge),U+=O*(5*ue),oe+=U>>>13,U&=8191;var d=oe;d+=w*ue,d+=E*ne,d+=x*ee,d+=I*b,d+=B*h,oe=d>>>13,d&=8191,d+=K*C,d+=Z*A,d+=$*(5*S),d+=j*(5*ye),d+=O*(5*ge),oe+=d>>>13,d&=8191;var T=oe;T+=w*ge,T+=E*ue,T+=x*ne,T+=I*ee,T+=B*b,oe=T>>>13,T&=8191,T+=K*h,T+=Z*C,T+=$*A,T+=j*(5*S),T+=O*(5*ye),oe+=T>>>13,T&=8191;var se=oe;se+=w*ye,se+=E*ge,se+=x*ue,se+=I*ne,se+=B*ee,oe=se>>>13,se&=8191,se+=K*b,se+=Z*h,se+=$*C,se+=j*A,se+=O*(5*S),oe+=se>>>13,se&=8191;var he=oe;he+=w*S,he+=E*ye,he+=x*ge,he+=I*ue,he+=B*ne,oe=he>>>13,he&=8191,he+=K*ee,he+=Z*b,he+=$*h,he+=j*C,he+=O*A,oe+=he>>>13,he&=8191,oe=(oe<<2)+oe|0,oe=oe+Se|0,Se=oe&8191,oe=oe>>>13,le+=oe,w=Se,E=le,x=Ce,I=z,B=F,K=U,Z=d,$=T,j=se,O=he,g+=16,p-=16}this._h[0]=w,this._h[1]=E,this._h[2]=x,this._h[3]=I,this._h[4]=B,this._h[5]=K,this._h[6]=Z,this._h[7]=$,this._h[8]=j,this._h[9]=O},l.prototype.finish=function(f,g){g===void 0&&(g=0);var p=new Uint16Array(10),v,w,E,x;if(this._leftover){for(x=this._leftover,this._buffer[x++]=1;x<16;x++)this._buffer[x]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=v,v=this._h[x]>>>13,this._h[x]&=8191;for(this._h[0]+=v*5,v=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=v,v=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=v,p[0]=this._h[0]+5,v=p[0]>>>13,p[0]&=8191,x=1;x<10;x++)p[x]=this._h[x]+v,v=p[x]>>>13,p[x]&=8191;for(p[9]-=8192,w=(v^1)-1,x=0;x<10;x++)p[x]&=w;for(w=~w,x=0;x<10;x++)this._h[x]=this._h[x]&w|p[x];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,E=this._h[0]+this._pad[0],this._h[0]=E&65535,x=1;x<8;x++)E=(this._h[x]+this._pad[x]|0)+(E>>>16)|0,this._h[x]=E&65535;return f[g+0]=this._h[0]>>>0,f[g+1]=this._h[0]>>>8,f[g+2]=this._h[1]>>>0,f[g+3]=this._h[1]>>>8,f[g+4]=this._h[2]>>>0,f[g+5]=this._h[2]>>>8,f[g+6]=this._h[3]>>>0,f[g+7]=this._h[3]>>>8,f[g+8]=this._h[4]>>>0,f[g+9]=this._h[4]>>>8,f[g+10]=this._h[5]>>>0,f[g+11]=this._h[5]>>>8,f[g+12]=this._h[6]>>>0,f[g+13]=this._h[6]>>>8,f[g+14]=this._h[7]>>>0,f[g+15]=this._h[7]>>>8,this._finished=!0,this},l.prototype.update=function(f){var g=0,p=f.length,v;if(this._leftover){v=16-this._leftover,v>p&&(v=p);for(var w=0;w=16&&(v=p-p%16,this._blocks(f,g,v),g+=v,p-=v),p){for(var w=0;w16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(p,x.length-p.length);var I=new Uint8Array(32);e.stream(this._key,x,I,4);var B=v.length+this.tagLength,K;if(E){if(E.length!==B)throw new Error("ChaCha20Poly1305: incorrect destination length");K=E}else K=new Uint8Array(B);return e.streamXOR(this._key,x,v,K,4),this._authenticate(K.subarray(K.length-this.tagLength,K.length),I,K.subarray(0,K.length-this.tagLength),w),s.wipe(x),K},g.prototype.open=function(p,v,w,E){if(p.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length0&&x.update(l.subarray(E.length%16))),x.update(w),w.length%16>0&&x.update(l.subarray(w.length%16));var I=new Uint8Array(8);E&&o.writeUint64LE(E.length,I),x.update(I),o.writeUint64LE(w.length,I),x.update(I);for(var B=x.digest(),K=0;Kthis.blockSize?this._inner.update(t).finish(s).clean():s.set(t);for(var o=0;o1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},i.prototype.expand=function(e){for(var t=new Uint8Array(e),s=0;s256)throw new Error("randomString charset is too long");let E="";const x=v.length,I=256-256%x;for(;p>0;){const B=o(Math.ceil(p*256/I),w);for(let K=0;K0;K++){const Z=B[K];Z0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=g[v++],p--;this._bufferLength===this.blockSize&&(c(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(v=c(this._temp,this._state,g,v,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=g[v++],p--;return this},f.prototype.finish=function(g){if(!this._finished){var p=this._bytesHashed,v=this._bufferLength,w=p/536870912|0,E=p<<3,x=p%64<56?64:128;this._buffer[v]=128;for(var I=v+1;I0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(g){return this._state.set(g.state),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(g){t.wipe(g.state),g.buffer&&t.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},f}();i.SHA256=s;var o=new Int32Array([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]);function c(f,g,p,v,w){for(;w>=64;){for(var E=g[0],x=g[1],I=g[2],B=g[3],K=g[4],Z=g[5],$=g[6],j=g[7],O=0;O<16;O++){var A=v+O*4;f[O]=e.readUint32BE(p,A)}for(var O=16;O<64;O++){var C=f[O-2],h=(C>>>17|C<<15)^(C>>>19|C<<13)^C>>>10;C=f[O-15];var b=(C>>>7|C<<25)^(C>>>18|C<<14)^C>>>3;f[O]=(h+f[O-7]|0)+(b+f[O-16]|0)}for(var O=0;O<64;O++){var h=(((K>>>6|K<<26)^(K>>>11|K<<21)^(K>>>25|K<<7))+(K&Z^~K&$)|0)+(j+(o[O]+f[O]|0)|0)|0,b=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&x^E&I^x&I)|0;j=$,$=Z,Z=K,K=B+h|0,B=I,I=x,x=E,E=h+b|0}g[0]+=E,g[1]+=x,g[2]+=I,g[3]+=B,g[4]+=K,g[5]+=Z,g[6]+=$,g[7]+=j,v+=64,w-=64}return v}function l(f){var g=new s;g.update(f);var p=g.digest();return g.clean(),p}i.hash=l})(da);var Yu={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.sharedKey=i.generateKeyPair=i.generateKeyPairFromSeed=i.scalarMultBase=i.scalarMult=i.SHARED_KEY_LENGTH=i.SECRET_KEY_LENGTH=i.PUBLIC_KEY_LENGTH=void 0;const e=zn,t=Ar;i.PUBLIC_KEY_LENGTH=32,i.SECRET_KEY_LENGTH=32,i.SHARED_KEY_LENGTH=32;function s(O){const A=new Float64Array(16);if(O)for(let C=0;C>16&1),C[ne-1]&=65535;C[15]=h[15]-32767-(C[14]>>16&1);const ee=C[15]>>16&1;C[14]&=65535,f(h,C,1-ee)}for(let b=0;b<16;b++)O[2*b]=h[b]&255,O[2*b+1]=h[b]>>8}function p(O,A){for(let C=0;C<16;C++)O[C]=A[2*C]+(A[2*C+1]<<8);O[15]&=32767}function v(O,A,C){for(let h=0;h<16;h++)O[h]=A[h]+C[h]}function w(O,A,C){for(let h=0;h<16;h++)O[h]=A[h]-C[h]}function E(O,A,C){let h,b,ee=0,ne=0,ue=0,ge=0,ye=0,S=0,R=0,X=0,J=0,k=0,V=0,te=0,ie=0,De=0,oe=0,Se=0,le=0,Ce=0,z=0,F=0,U=0,d=0,T=0,se=0,he=0,Ee=0,He=0,ke=0,Me=0,dt=0,pt=0,qe=C[0],Ie=C[1],Ne=C[2],$e=C[3],Fe=C[4],Oe=C[5],Ue=C[6],be=C[7],Pe=C[8],Be=C[9],xe=C[10],Ve=C[11],We=C[12],Ze=C[13],et=C[14],Je=C[15];h=A[0],ee+=h*qe,ne+=h*Ie,ue+=h*Ne,ge+=h*$e,ye+=h*Fe,S+=h*Oe,R+=h*Ue,X+=h*be,J+=h*Pe,k+=h*Be,V+=h*xe,te+=h*Ve,ie+=h*We,De+=h*Ze,oe+=h*et,Se+=h*Je,h=A[1],ne+=h*qe,ue+=h*Ie,ge+=h*Ne,ye+=h*$e,S+=h*Fe,R+=h*Oe,X+=h*Ue,J+=h*be,k+=h*Pe,V+=h*Be,te+=h*xe,ie+=h*Ve,De+=h*We,oe+=h*Ze,Se+=h*et,le+=h*Je,h=A[2],ue+=h*qe,ge+=h*Ie,ye+=h*Ne,S+=h*$e,R+=h*Fe,X+=h*Oe,J+=h*Ue,k+=h*be,V+=h*Pe,te+=h*Be,ie+=h*xe,De+=h*Ve,oe+=h*We,Se+=h*Ze,le+=h*et,Ce+=h*Je,h=A[3],ge+=h*qe,ye+=h*Ie,S+=h*Ne,R+=h*$e,X+=h*Fe,J+=h*Oe,k+=h*Ue,V+=h*be,te+=h*Pe,ie+=h*Be,De+=h*xe,oe+=h*Ve,Se+=h*We,le+=h*Ze,Ce+=h*et,z+=h*Je,h=A[4],ye+=h*qe,S+=h*Ie,R+=h*Ne,X+=h*$e,J+=h*Fe,k+=h*Oe,V+=h*Ue,te+=h*be,ie+=h*Pe,De+=h*Be,oe+=h*xe,Se+=h*Ve,le+=h*We,Ce+=h*Ze,z+=h*et,F+=h*Je,h=A[5],S+=h*qe,R+=h*Ie,X+=h*Ne,J+=h*$e,k+=h*Fe,V+=h*Oe,te+=h*Ue,ie+=h*be,De+=h*Pe,oe+=h*Be,Se+=h*xe,le+=h*Ve,Ce+=h*We,z+=h*Ze,F+=h*et,U+=h*Je,h=A[6],R+=h*qe,X+=h*Ie,J+=h*Ne,k+=h*$e,V+=h*Fe,te+=h*Oe,ie+=h*Ue,De+=h*be,oe+=h*Pe,Se+=h*Be,le+=h*xe,Ce+=h*Ve,z+=h*We,F+=h*Ze,U+=h*et,d+=h*Je,h=A[7],X+=h*qe,J+=h*Ie,k+=h*Ne,V+=h*$e,te+=h*Fe,ie+=h*Oe,De+=h*Ue,oe+=h*be,Se+=h*Pe,le+=h*Be,Ce+=h*xe,z+=h*Ve,F+=h*We,U+=h*Ze,d+=h*et,T+=h*Je,h=A[8],J+=h*qe,k+=h*Ie,V+=h*Ne,te+=h*$e,ie+=h*Fe,De+=h*Oe,oe+=h*Ue,Se+=h*be,le+=h*Pe,Ce+=h*Be,z+=h*xe,F+=h*Ve,U+=h*We,d+=h*Ze,T+=h*et,se+=h*Je,h=A[9],k+=h*qe,V+=h*Ie,te+=h*Ne,ie+=h*$e,De+=h*Fe,oe+=h*Oe,Se+=h*Ue,le+=h*be,Ce+=h*Pe,z+=h*Be,F+=h*xe,U+=h*Ve,d+=h*We,T+=h*Ze,se+=h*et,he+=h*Je,h=A[10],V+=h*qe,te+=h*Ie,ie+=h*Ne,De+=h*$e,oe+=h*Fe,Se+=h*Oe,le+=h*Ue,Ce+=h*be,z+=h*Pe,F+=h*Be,U+=h*xe,d+=h*Ve,T+=h*We,se+=h*Ze,he+=h*et,Ee+=h*Je,h=A[11],te+=h*qe,ie+=h*Ie,De+=h*Ne,oe+=h*$e,Se+=h*Fe,le+=h*Oe,Ce+=h*Ue,z+=h*be,F+=h*Pe,U+=h*Be,d+=h*xe,T+=h*Ve,se+=h*We,he+=h*Ze,Ee+=h*et,He+=h*Je,h=A[12],ie+=h*qe,De+=h*Ie,oe+=h*Ne,Se+=h*$e,le+=h*Fe,Ce+=h*Oe,z+=h*Ue,F+=h*be,U+=h*Pe,d+=h*Be,T+=h*xe,se+=h*Ve,he+=h*We,Ee+=h*Ze,He+=h*et,ke+=h*Je,h=A[13],De+=h*qe,oe+=h*Ie,Se+=h*Ne,le+=h*$e,Ce+=h*Fe,z+=h*Oe,F+=h*Ue,U+=h*be,d+=h*Pe,T+=h*Be,se+=h*xe,he+=h*Ve,Ee+=h*We,He+=h*Ze,ke+=h*et,Me+=h*Je,h=A[14],oe+=h*qe,Se+=h*Ie,le+=h*Ne,Ce+=h*$e,z+=h*Fe,F+=h*Oe,U+=h*Ue,d+=h*be,T+=h*Pe,se+=h*Be,he+=h*xe,Ee+=h*Ve,He+=h*We,ke+=h*Ze,Me+=h*et,dt+=h*Je,h=A[15],Se+=h*qe,le+=h*Ie,Ce+=h*Ne,z+=h*$e,F+=h*Fe,U+=h*Oe,d+=h*Ue,T+=h*be,se+=h*Pe,he+=h*Be,Ee+=h*xe,He+=h*Ve,ke+=h*We,Me+=h*Ze,dt+=h*et,pt+=h*Je,ee+=38*le,ne+=38*Ce,ue+=38*z,ge+=38*F,ye+=38*U,S+=38*d,R+=38*T,X+=38*se,J+=38*he,k+=38*Ee,V+=38*He,te+=38*ke,ie+=38*Me,De+=38*dt,oe+=38*pt,b=1,h=ee+b+65535,b=Math.floor(h/65536),ee=h-b*65536,h=ne+b+65535,b=Math.floor(h/65536),ne=h-b*65536,h=ue+b+65535,b=Math.floor(h/65536),ue=h-b*65536,h=ge+b+65535,b=Math.floor(h/65536),ge=h-b*65536,h=ye+b+65535,b=Math.floor(h/65536),ye=h-b*65536,h=S+b+65535,b=Math.floor(h/65536),S=h-b*65536,h=R+b+65535,b=Math.floor(h/65536),R=h-b*65536,h=X+b+65535,b=Math.floor(h/65536),X=h-b*65536,h=J+b+65535,b=Math.floor(h/65536),J=h-b*65536,h=k+b+65535,b=Math.floor(h/65536),k=h-b*65536,h=V+b+65535,b=Math.floor(h/65536),V=h-b*65536,h=te+b+65535,b=Math.floor(h/65536),te=h-b*65536,h=ie+b+65535,b=Math.floor(h/65536),ie=h-b*65536,h=De+b+65535,b=Math.floor(h/65536),De=h-b*65536,h=oe+b+65535,b=Math.floor(h/65536),oe=h-b*65536,h=Se+b+65535,b=Math.floor(h/65536),Se=h-b*65536,ee+=b-1+37*(b-1),b=1,h=ee+b+65535,b=Math.floor(h/65536),ee=h-b*65536,h=ne+b+65535,b=Math.floor(h/65536),ne=h-b*65536,h=ue+b+65535,b=Math.floor(h/65536),ue=h-b*65536,h=ge+b+65535,b=Math.floor(h/65536),ge=h-b*65536,h=ye+b+65535,b=Math.floor(h/65536),ye=h-b*65536,h=S+b+65535,b=Math.floor(h/65536),S=h-b*65536,h=R+b+65535,b=Math.floor(h/65536),R=h-b*65536,h=X+b+65535,b=Math.floor(h/65536),X=h-b*65536,h=J+b+65535,b=Math.floor(h/65536),J=h-b*65536,h=k+b+65535,b=Math.floor(h/65536),k=h-b*65536,h=V+b+65535,b=Math.floor(h/65536),V=h-b*65536,h=te+b+65535,b=Math.floor(h/65536),te=h-b*65536,h=ie+b+65535,b=Math.floor(h/65536),ie=h-b*65536,h=De+b+65535,b=Math.floor(h/65536),De=h-b*65536,h=oe+b+65535,b=Math.floor(h/65536),oe=h-b*65536,h=Se+b+65535,b=Math.floor(h/65536),Se=h-b*65536,ee+=b-1+37*(b-1),O[0]=ee,O[1]=ne,O[2]=ue,O[3]=ge,O[4]=ye,O[5]=S,O[6]=R,O[7]=X,O[8]=J,O[9]=k,O[10]=V,O[11]=te,O[12]=ie,O[13]=De,O[14]=oe,O[15]=Se}function x(O,A){E(O,A,A)}function I(O,A){const C=s();for(let h=0;h<16;h++)C[h]=A[h];for(let h=253;h>=0;h--)x(C,C),h!==2&&h!==4&&E(C,C,A);for(let h=0;h<16;h++)O[h]=C[h]}function B(O,A){const C=new Uint8Array(32),h=new Float64Array(80),b=s(),ee=s(),ne=s(),ue=s(),ge=s(),ye=s();for(let J=0;J<31;J++)C[J]=O[J];C[31]=O[31]&127|64,C[0]&=248,p(h,A);for(let J=0;J<16;J++)ee[J]=h[J];b[0]=ue[0]=1;for(let J=254;J>=0;--J){const k=C[J>>>3]>>>(J&7)&1;f(b,ee,k),f(ne,ue,k),v(ge,b,ne),w(b,b,ne),v(ne,ee,ue),w(ee,ee,ue),x(ue,ge),x(ye,b),E(b,ne,b),E(ne,ee,ge),v(ge,b,ne),w(b,b,ne),x(ee,b),w(ne,ue,ye),E(b,ne,c),v(b,b,ue),E(ne,ne,b),E(b,ue,ye),E(ue,ee,h),x(ee,ge),f(b,ee,k),f(ne,ue,k)}for(let J=0;J<16;J++)h[J+16]=b[J],h[J+32]=ne[J],h[J+48]=ee[J],h[J+64]=ue[J];const S=h.subarray(32),R=h.subarray(16);I(S,S),E(R,R,S);const X=new Uint8Array(32);return g(X,R),X}i.scalarMult=B;function K(O){return B(O,o)}i.scalarMultBase=K;function Z(O){if(O.length!==i.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${i.SECRET_KEY_LENGTH} bytes`);const A=new Uint8Array(O);return{publicKey:K(A),secretKey:A}}i.generateKeyPairFromSeed=Z;function $(O){const A=(0,e.randomBytes)(32,O),C=Z(A);return(0,t.wipe)(A),C}i.generateKeyPair=$;function j(O,A,C=!1){if(O.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(A.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const h=B(O,A);if(C){let b=0;for(let ee=0;eeo+c.length,0));const t=ap(e);let s=0;for(const o of i)t.set(o,s),s+=o.length;return Ju(t)}function Nb(i,e){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),s=0;s>>0,O=new Uint8Array(j);Z!==$;){for(var A=I[Z],C=0,h=j-1;(A!==0||C>>0,O[h]=A%f>>>0,A=A/f>>>0;if(A!==0)throw new Error("Non-zero carry");K=C,Z++}for(var b=j-K;b!==j&&O[b]===0;)b++;for(var ee=g.repeat(B);b>>0,j=new Uint8Array($);I[B];){var O=t[I.charCodeAt(B)];if(O===255)return;for(var A=0,C=$-1;(O!==0||A>>0,j[C]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");Z=A,B++}if(I[B]!==" "){for(var h=$-Z;h!==$&&j[h]===0;)h++;for(var b=new Uint8Array(K+($-h)),ee=K;h!==$;)b[ee++]=j[h++];return b}}}function x(I){var B=E(I);if(B)return B;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:E,decode:x}}var $b=Nb,Ub=$b;const jb=i=>{if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")},Mb=i=>new TextEncoder().encode(i),Lb=i=>new TextDecoder().decode(i);class qb{constructor(e,t,s){this.name=e,this.prefix=t,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Fb{constructor(e,t,s){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=s}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return cp(this,e)}}class zb{constructor(e){this.decoders=e}or(e){return cp(this,e)}decode(e){const t=e[0],s=this.decoders[t];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const cp=(i,e)=>new zb({...i.decoders||{[i.prefix]:i},...e.decoders||{[e.prefix]:e}});class Hb{constructor(e,t,s,o){this.name=e,this.prefix=t,this.baseEncode=s,this.baseDecode=o,this.encoder=new qb(e,t,s),this.decoder=new Fb(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const pa=({name:i,prefix:e,encode:t,decode:s})=>new Hb(i,e,t,s),Ns=({prefix:i,name:e,alphabet:t})=>{const{encode:s,decode:o}=Ub(t,e);return pa({prefix:i,name:e,encode:s,decode:c=>jb(o(c))})},Bb=(i,e,t,s)=>{const o={};for(let v=0;v=8&&(f-=8,l[p++]=255&g>>f)}if(f>=t||255&g<<8-f)throw new SyntaxError("Unexpected end of data");return l},Kb=(i,e,t)=>{const s=e[e.length-1]==="=",o=(1<t;)l-=t,c+=e[o&f>>l];if(l&&(c+=e[o&f<pa({prefix:e,name:i,encode(o){return Kb(o,s,t)},decode(o){return Bb(o,s,t,i)}}),kb=pa({prefix:"\0",name:"identity",encode:i=>Lb(i),decode:i=>Mb(i)}),Vb=Object.freeze(Object.defineProperty({__proto__:null,identity:kb},Symbol.toStringTag,{value:"Module"})),Gb=Wt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Wb=Object.freeze(Object.defineProperty({__proto__:null,base2:Gb},Symbol.toStringTag,{value:"Module"})),Yb=Wt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Jb=Object.freeze(Object.defineProperty({__proto__:null,base8:Yb},Symbol.toStringTag,{value:"Module"})),Qb=Ns({prefix:"9",name:"base10",alphabet:"0123456789"}),Xb=Object.freeze(Object.defineProperty({__proto__:null,base10:Qb},Symbol.toStringTag,{value:"Module"})),Zb=Wt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),e1=Wt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),t1=Object.freeze(Object.defineProperty({__proto__:null,base16:Zb,base16upper:e1},Symbol.toStringTag,{value:"Module"})),r1=Wt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),i1=Wt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),n1=Wt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),s1=Wt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),o1=Wt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),a1=Wt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),c1=Wt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),u1=Wt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),h1=Wt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),l1=Object.freeze(Object.defineProperty({__proto__:null,base32:r1,base32hex:o1,base32hexpad:c1,base32hexpadupper:u1,base32hexupper:a1,base32pad:n1,base32padupper:s1,base32upper:i1,base32z:h1},Symbol.toStringTag,{value:"Module"})),f1=Ns({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),d1=Ns({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),p1=Object.freeze(Object.defineProperty({__proto__:null,base36:f1,base36upper:d1},Symbol.toStringTag,{value:"Module"})),g1=Ns({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),y1=Ns({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),v1=Object.freeze(Object.defineProperty({__proto__:null,base58btc:g1,base58flickr:y1},Symbol.toStringTag,{value:"Module"})),m1=Wt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_1=Wt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),w1=Wt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),b1=Wt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),E1=Object.freeze(Object.defineProperty({__proto__:null,base64:m1,base64pad:_1,base64url:w1,base64urlpad:b1},Symbol.toStringTag,{value:"Module"})),up=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),D1=up.reduce((i,e,t)=>(i[t]=e,i),[]),S1=up.reduce((i,e,t)=>(i[e.codePointAt(0)]=t,i),[]);function I1(i){return i.reduce((e,t)=>(e+=D1[t],e),"")}function x1(i){const e=[];for(const t of i){const s=S1[t.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(s)}return new Uint8Array(e)}const O1=pa({prefix:"🚀",name:"base256emoji",encode:I1,decode:x1}),P1=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:O1},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const vf={...Vb,...Wb,...Jb,...Xb,...t1,...l1,...p1,...v1,...E1,...P1};function hp(i,e,t,s){return{name:i,prefix:e,encoder:{name:i,prefix:e,encode:t},decoder:{decode:s}}}const mf=hp("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),Yc=hp("ascii","a",i=>{let e="a";for(let t=0;t{i=i.substring(1);const e=ap(i.length);for(let t=0;t"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new N1:typeof navigator<"u"?q1(navigator.userAgent):z1()}function L1(i){return i!==""&&j1.reduce(function(e,t){var s=t[0],o=t[1];if(e)return e;var c=o.exec(i);return!!c&&[s,c]},!1)}function q1(i){var e=L1(i);if(!e)return null;var t=e[0],s=e[1];if(t==="searchbot")return new R1;var o=s[1]&&s[1].split(".").join("_").split("_").slice(0,3);o?o.length=0;f--)(l=i[f])&&(c=(o<3?l(c):o>3?l(e,t,c):l(e,t))||c);return o>3&&c&&Object.defineProperty(e,t,c),c}function V1(i,e){return function(t,s){e(t,s,i)}}function G1(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}function W1(i,e,t,s){function o(c){return c instanceof t?c:new t(function(l){l(c)})}return new(t||(t=Promise))(function(c,l){function f(v){try{p(s.next(v))}catch(w){l(w)}}function g(v){try{p(s.throw(v))}catch(w){l(w)}}function p(v){v.done?c(v.value):o(v.value).then(f,g)}p((s=s.apply(i,e||[])).next())})}function Y1(i,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},s,o,c,l;return l={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function f(p){return function(v){return g([p,v])}}function g(p){if(s)throw new TypeError("Generator is already executing.");for(;t;)try{if(s=1,o&&(c=p[0]&2?o.return:p[0]?o.throw||((c=o.return)&&c.call(o),0):o.next)&&!(c=c.call(o,p[1])).done)return c;switch(o=0,c&&(p=[p[0]&2,c.value]),p[0]){case 0:case 1:c=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,o=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(c=t.trys,!(c=c.length>0&&c[c.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!c||p[1]>c[0]&&p[1]=i.length&&(i=void 0),{value:i&&i[s++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fp(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),o,c=[],l;try{for(;(e===void 0||e-- >0)&&!(o=s.next()).done;)c.push(o.value)}catch(f){l={error:f}}finally{try{o&&!o.done&&(t=s.return)&&t.call(s)}finally{if(l)throw l.error}}return c}function X1(){for(var i=[],e=0;e1||f(E,x)})})}function f(E,x){try{g(s[E](x))}catch(I){w(c[0][3],I)}}function g(E){E.value instanceof Ds?Promise.resolve(E.value.v).then(p,v):w(c[0][2],E)}function p(E){f("next",E)}function v(E){f("throw",E)}function w(E,x){E(x),c.shift(),c.length&&f(c[0][0],c[0][1])}}function tE(i){var e,t;return e={},s("next"),s("throw",function(o){throw o}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(o,c){e[o]=i[o]?function(l){return(t=!t)?{value:Ds(i[o](l)),done:o==="return"}:c?c(l):l}:c}}function rE(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof Iu=="function"?Iu(i):i[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(c){t[c]=i[c]&&function(l){return new Promise(function(f,g){l=i[c](l),o(f,g,l.done,l.value)})}}function o(c,l,f,g){Promise.resolve(g).then(function(p){c({value:p,done:f})},l)}}function iE(i,e){return Object.defineProperty?Object.defineProperty(i,"raw",{value:e}):i.raw=e,i}function nE(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)Object.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e.default=i,e}function sE(i){return i&&i.__esModule?i:{default:i}}function oE(i,e){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return e.get(i)}function aE(i,e,t){if(!e.has(i))throw new TypeError("attempted to set private field on non-instance");return e.set(i,t),t}const cE=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Su},__asyncDelegator:tE,__asyncGenerator:eE,__asyncValues:rE,__await:Ds,__awaiter:W1,__classPrivateFieldGet:oE,__classPrivateFieldSet:aE,__createBinding:J1,__decorate:k1,__exportStar:Q1,__extends:B1,__generator:Y1,__importDefault:sE,__importStar:nE,__makeTemplateObject:iE,__metadata:G1,__param:V1,__read:fp,__rest:K1,__spread:X1,__spreadArrays:Z1,__values:Iu},Symbol.toStringTag,{value:"Module"})),ga=Ts(cE);var Jc={},fs={},Ef;function uE(){if(Ef)return fs;Ef=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.delay=void 0;function i(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return fs.delay=i,fs}var rn={},Qc={},nn={},Df;function hE(){return Df||(Df=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.ONE_THOUSAND=nn.ONE_HUNDRED=void 0,nn.ONE_HUNDRED=100,nn.ONE_THOUSAND=1e3),nn}var Xc={},Sf;function lE(){return Sf||(Sf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.ONE_YEAR=i.FOUR_WEEKS=i.THREE_WEEKS=i.TWO_WEEKS=i.ONE_WEEK=i.THIRTY_DAYS=i.SEVEN_DAYS=i.FIVE_DAYS=i.THREE_DAYS=i.ONE_DAY=i.TWENTY_FOUR_HOURS=i.TWELVE_HOURS=i.SIX_HOURS=i.THREE_HOURS=i.ONE_HOUR=i.SIXTY_MINUTES=i.THIRTY_MINUTES=i.TEN_MINUTES=i.FIVE_MINUTES=i.ONE_MINUTE=i.SIXTY_SECONDS=i.THIRTY_SECONDS=i.TEN_SECONDS=i.FIVE_SECONDS=i.ONE_SECOND=void 0,i.ONE_SECOND=1,i.FIVE_SECONDS=5,i.TEN_SECONDS=10,i.THIRTY_SECONDS=30,i.SIXTY_SECONDS=60,i.ONE_MINUTE=i.SIXTY_SECONDS,i.FIVE_MINUTES=i.ONE_MINUTE*5,i.TEN_MINUTES=i.ONE_MINUTE*10,i.THIRTY_MINUTES=i.ONE_MINUTE*30,i.SIXTY_MINUTES=i.ONE_MINUTE*60,i.ONE_HOUR=i.SIXTY_MINUTES,i.THREE_HOURS=i.ONE_HOUR*3,i.SIX_HOURS=i.ONE_HOUR*6,i.TWELVE_HOURS=i.ONE_HOUR*12,i.TWENTY_FOUR_HOURS=i.ONE_HOUR*24,i.ONE_DAY=i.TWENTY_FOUR_HOURS,i.THREE_DAYS=i.ONE_DAY*3,i.FIVE_DAYS=i.ONE_DAY*5,i.SEVEN_DAYS=i.ONE_DAY*7,i.THIRTY_DAYS=i.ONE_DAY*30,i.ONE_WEEK=i.SEVEN_DAYS,i.TWO_WEEKS=i.ONE_WEEK*2,i.THREE_WEEKS=i.ONE_WEEK*3,i.FOUR_WEEKS=i.ONE_WEEK*4,i.ONE_YEAR=i.ONE_DAY*365}(Xc)),Xc}var If;function dp(){return If||(If=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=ga;e.__exportStar(hE(),i),e.__exportStar(lE(),i)}(Qc)),Qc}var xf;function fE(){if(xf)return rn;xf=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.fromMiliseconds=rn.toMiliseconds=void 0;const i=dp();function e(s){return s*i.ONE_THOUSAND}rn.toMiliseconds=e;function t(s){return Math.floor(s/i.ONE_THOUSAND)}return rn.fromMiliseconds=t,rn}var Of;function dE(){return Of||(Of=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=ga;e.__exportStar(uE(),i),e.__exportStar(fE(),i)}(Jc)),Jc}var Nn={},Pf;function pE(){if(Pf)return Nn;Pf=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.Watch=void 0;class i{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const s=this.get(t);if(typeof s.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const o=Date.now()-s.started;this.timestamps.set(t,{started:s.started,elapsed:o})}get(t){const s=this.timestamps.get(t);if(typeof s>"u")throw new Error(`No timestamp found for label: ${t}`);return s}elapsed(t){const s=this.get(t);return s.elapsed||Date.now()-s.started}}return Nn.Watch=i,Nn.default=i,Nn}var Zc={},ds={},Af;function gE(){if(Af)return ds;Af=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.IWatch=void 0;class i{}return ds.IWatch=i,ds}var Cf;function yE(){return Cf||(Cf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),ga.__exportStar(gE(),i)}(Zc)),Zc}(function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=ga;e.__exportStar(dE(),i),e.__exportStar(pE(),i),e.__exportStar(yE(),i),e.__exportStar(dp(),i)})(ve);var ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.getLocalStorage=ht.getLocalStorageOrThrow=ht.getCrypto=ht.getCryptoOrThrow=pp=ht.getLocation=ht.getLocationOrThrow=Xu=ht.getNavigator=ht.getNavigatorOrThrow=Qu=ht.getDocument=ht.getDocumentOrThrow=ht.getFromWindowOrThrow=ht.getFromWindow=void 0;function cn(i){let e;return typeof window<"u"&&typeof window[i]<"u"&&(e=window[i]),e}ht.getFromWindow=cn;function Hn(i){const e=cn(i);if(!e)throw new Error(`${i} is not defined in Window`);return e}ht.getFromWindowOrThrow=Hn;function vE(){return Hn("document")}ht.getDocumentOrThrow=vE;function mE(){return cn("document")}var Qu=ht.getDocument=mE;function _E(){return Hn("navigator")}ht.getNavigatorOrThrow=_E;function wE(){return cn("navigator")}var Xu=ht.getNavigator=wE;function bE(){return Hn("location")}ht.getLocationOrThrow=bE;function EE(){return cn("location")}var pp=ht.getLocation=EE;function DE(){return Hn("crypto")}ht.getCryptoOrThrow=DE;function SE(){return cn("crypto")}ht.getCrypto=SE;function IE(){return Hn("localStorage")}ht.getLocalStorageOrThrow=IE;function xE(){return cn("localStorage")}ht.getLocalStorage=xE;var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});var gp=Zu.getWindowMetadata=void 0;const Tf=ht;function OE(){let i,e;try{i=Tf.getDocumentOrThrow(),e=Tf.getLocationOrThrow()}catch{return null}function t(){const w=i.getElementsByTagName("link"),E=[];for(let x=0;x-1){const K=I.getAttribute("href");if(K)if(K.toLowerCase().indexOf("https:")===-1&&K.toLowerCase().indexOf("http:")===-1&&K.indexOf("//")!==0){let Z=e.protocol+"//"+e.host;if(K.indexOf("/")===0)Z+=K;else{const $=e.pathname.split("/");$.pop();const j=$.join("/");Z+=j+"/"+K}E.push(Z)}else if(K.indexOf("//")===0){const Z=e.protocol+K;E.push(Z)}else E.push(K)}}return E}function s(...w){const E=i.getElementsByTagName("meta");for(let x=0;xI.getAttribute(K)).filter(K=>K?w.includes(K):!1);if(B.length&&B){const K=I.getAttribute("content");if(K)return K}}return""}function o(){let w=s("name","og:site_name","og:title","twitter:title");return w||(w=i.title),w}function c(){return s("description","og:description","twitter:description","keywords")}const l=o(),f=c(),g=e.origin,p=t();return{description:f,url:g,icons:p,name:l}}gp=Zu.getWindowMetadata=OE;var Ss={},PE=i=>encodeURIComponent(i).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),yp="%[a-f0-9]{2}",Rf=new RegExp("("+yp+")|([^%]+?)","gi"),Nf=new RegExp("("+yp+")+","gi");function xu(i,e){try{return[decodeURIComponent(i.join(""))]}catch{}if(i.length===1)return i;e=e||1;var t=i.slice(0,e),s=i.slice(e);return Array.prototype.concat.call([],xu(t),xu(s))}function AE(i){try{return decodeURIComponent(i)}catch{for(var e=i.match(Rf)||[],t=1;t{if(!(typeof i=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[i];const t=i.indexOf(e);return t===-1?[i]:[i.slice(0,t),i.slice(t+e.length)]},NE=function(i,e){for(var t={},s=Object.keys(i),o=Array.isArray(e),c=0;c$==null,l=Symbol("encodeFragmentIdentifier");function f($){switch($.arrayFormat){case"index":return j=>(O,A)=>{const C=O.length;return A===void 0||$.skipNull&&A===null||$.skipEmptyString&&A===""?O:A===null?[...O,[v(j,$),"[",C,"]"].join("")]:[...O,[v(j,$),"[",v(C,$),"]=",v(A,$)].join("")]};case"bracket":return j=>(O,A)=>A===void 0||$.skipNull&&A===null||$.skipEmptyString&&A===""?O:A===null?[...O,[v(j,$),"[]"].join("")]:[...O,[v(j,$),"[]=",v(A,$)].join("")];case"colon-list-separator":return j=>(O,A)=>A===void 0||$.skipNull&&A===null||$.skipEmptyString&&A===""?O:A===null?[...O,[v(j,$),":list="].join("")]:[...O,[v(j,$),":list=",v(A,$)].join("")];case"comma":case"separator":case"bracket-separator":{const j=$.arrayFormat==="bracket-separator"?"[]=":"=";return O=>(A,C)=>C===void 0||$.skipNull&&C===null||$.skipEmptyString&&C===""?A:(C=C===null?"":C,A.length===0?[[v(O,$),j,v(C,$)].join("")]:[[A,v(C,$)].join($.arrayFormatSeparator)])}default:return j=>(O,A)=>A===void 0||$.skipNull&&A===null||$.skipEmptyString&&A===""?O:A===null?[...O,v(j,$)]:[...O,[v(j,$),"=",v(A,$)].join("")]}}function g($){let j;switch($.arrayFormat){case"index":return(O,A,C)=>{if(j=/\[(\d*)\]$/.exec(O),O=O.replace(/\[\d*\]$/,""),!j){C[O]=A;return}C[O]===void 0&&(C[O]={}),C[O][j[1]]=A};case"bracket":return(O,A,C)=>{if(j=/(\[\])$/.exec(O),O=O.replace(/\[\]$/,""),!j){C[O]=A;return}if(C[O]===void 0){C[O]=[A];return}C[O]=[].concat(C[O],A)};case"colon-list-separator":return(O,A,C)=>{if(j=/(:list)$/.exec(O),O=O.replace(/:list$/,""),!j){C[O]=A;return}if(C[O]===void 0){C[O]=[A];return}C[O]=[].concat(C[O],A)};case"comma":case"separator":return(O,A,C)=>{const h=typeof A=="string"&&A.includes($.arrayFormatSeparator),b=typeof A=="string"&&!h&&w(A,$).includes($.arrayFormatSeparator);A=b?w(A,$):A;const ee=h||b?A.split($.arrayFormatSeparator).map(ne=>w(ne,$)):A===null?A:w(A,$);C[O]=ee};case"bracket-separator":return(O,A,C)=>{const h=/(\[\])$/.test(O);if(O=O.replace(/\[\]$/,""),!h){C[O]=A&&w(A,$);return}const b=A===null?[]:A.split($.arrayFormatSeparator).map(ee=>w(ee,$));if(C[O]===void 0){C[O]=b;return}C[O]=[].concat(C[O],b)};default:return(O,A,C)=>{if(C[O]===void 0){C[O]=A;return}C[O]=[].concat(C[O],A)}}}function p($){if(typeof $!="string"||$.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function v($,j){return j.encode?j.strict?e($):encodeURIComponent($):$}function w($,j){return j.decode?t($):$}function E($){return Array.isArray($)?$.sort():typeof $=="object"?E(Object.keys($)).sort((j,O)=>Number(j)-Number(O)).map(j=>$[j]):$}function x($){const j=$.indexOf("#");return j!==-1&&($=$.slice(0,j)),$}function I($){let j="";const O=$.indexOf("#");return O!==-1&&(j=$.slice(O)),j}function B($){$=x($);const j=$.indexOf("?");return j===-1?"":$.slice(j+1)}function K($,j){return j.parseNumbers&&!Number.isNaN(Number($))&&typeof $=="string"&&$.trim()!==""?$=Number($):j.parseBooleans&&$!==null&&($.toLowerCase()==="true"||$.toLowerCase()==="false")&&($=$.toLowerCase()==="true"),$}function Z($,j){j=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},j),p(j.arrayFormatSeparator);const O=g(j),A=Object.create(null);if(typeof $!="string"||($=$.trim().replace(/^[?#&]/,""),!$))return A;for(const C of $.split("&")){if(C==="")continue;let[h,b]=s(j.decode?C.replace(/\+/g," "):C,"=");b=b===void 0?null:["comma","separator","bracket-separator"].includes(j.arrayFormat)?b:w(b,j),O(w(h,j),b,A)}for(const C of Object.keys(A)){const h=A[C];if(typeof h=="object"&&h!==null)for(const b of Object.keys(h))h[b]=K(h[b],j);else A[C]=K(h,j)}return j.sort===!1?A:(j.sort===!0?Object.keys(A).sort():Object.keys(A).sort(j.sort)).reduce((C,h)=>{const b=A[h];return b&&typeof b=="object"&&!Array.isArray(b)?C[h]=E(b):C[h]=b,C},Object.create(null))}i.extract=B,i.parse=Z,i.stringify=($,j)=>{if(!$)return"";j=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},j),p(j.arrayFormatSeparator);const O=b=>j.skipNull&&c($[b])||j.skipEmptyString&&$[b]==="",A=f(j),C={};for(const b of Object.keys($))O(b)||(C[b]=$[b]);const h=Object.keys(C);return j.sort!==!1&&h.sort(j.sort),h.map(b=>{const ee=$[b];return ee===void 0?"":ee===null?v(b,j):Array.isArray(ee)?ee.length===0&&j.arrayFormat==="bracket-separator"?v(b,j)+"[]":ee.reduce(A(b),[]).join("&"):v(b,j)+"="+v(ee,j)}).filter(b=>b.length>0).join("&")},i.parseUrl=($,j)=>{j=Object.assign({decode:!0},j);const[O,A]=s($,"#");return Object.assign({url:O.split("?")[0]||"",query:Z(B($),j)},j&&j.parseFragmentIdentifier&&A?{fragmentIdentifier:w(A,j)}:{})},i.stringifyUrl=($,j)=>{j=Object.assign({encode:!0,strict:!0,[l]:!0},j);const O=x($.url).split("?")[0]||"",A=i.extract($.url),C=i.parse(A,{sort:!1}),h=Object.assign(C,$.query);let b=i.stringify(h,j);b&&(b=`?${b}`);let ee=I($.url);return $.fragmentIdentifier&&(ee=`#${j[l]?v($.fragmentIdentifier,j):$.fragmentIdentifier}`),`${O}${b}${ee}`},i.pick=($,j,O)=>{O=Object.assign({parseFragmentIdentifier:!0,[l]:!1},O);const{url:A,query:C,fragmentIdentifier:h}=i.parseUrl($,O);return i.stringifyUrl({url:A,query:o(C,j),fragmentIdentifier:h},O)},i.exclude=($,j,O)=>{const A=Array.isArray(j)?C=>!j.includes(C):(C,h)=>!j(C,h);return i.pick($,A,O)}})(Ss);const $E={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},UE=":";function jE(i){const[e,t]=i.split(UE);return{namespace:e,reference:t}}function ME(i,e=[]){const t=[];return Object.keys(i).forEach(s=>{if(e.length&&!e.includes(s))return;const o=i[s];t.push(...o.accounts)}),t}function vp(i,e){return i.includes(":")?[i]:e.chains||[]}const mp="base10",ar="base16",Ou="base64pad",eh="utf8",_p=0,un=1,LE=0,$f=1,Pu=12,th=32;function qE(){const i=Yu.generateKeyPair();return{privateKey:cr(i.secretKey,ar),publicKey:cr(i.publicKey,ar)}}function Au(){const i=zn.randomBytes(th);return cr(i,ar)}function FE(i,e){const t=Yu.sharedKey(mr(i,ar),mr(e,ar),!0),s=new Ib(da.SHA256,t).expand(th);return cr(s,ar)}function zE(i){const e=da.hash(mr(i,ar));return cr(e,ar)}function qn(i){const e=da.hash(mr(i,eh));return cr(e,ar)}function HE(i){return mr(`${i}`,mp)}function $s(i){return Number(cr(i,mp))}function BE(i){const e=HE(typeof i.type<"u"?i.type:_p);if($s(e)===un&&typeof i.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof i.senderPublicKey<"u"?mr(i.senderPublicKey,ar):void 0,s=typeof i.iv<"u"?mr(i.iv,ar):zn.randomBytes(Pu),o=new Gu.ChaCha20Poly1305(mr(i.symKey,ar)).seal(s,mr(i.message,eh));return kE({type:e,sealed:o,iv:s,senderPublicKey:t})}function KE(i){const e=new Gu.ChaCha20Poly1305(mr(i.symKey,ar)),{sealed:t,iv:s}=ia(i.encoded),o=e.open(s,t);if(o===null)throw new Error("Failed to decrypt");return cr(o,eh)}function kE(i){if($s(i.type)===un){if(typeof i.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return cr(Eu([i.type,i.senderPublicKey,i.iv,i.sealed]),Ou)}return cr(Eu([i.type,i.iv,i.sealed]),Ou)}function ia(i){const e=mr(i,Ou),t=e.slice(LE,$f),s=$f;if($s(t)===un){const f=s+th,g=f+Pu,p=e.slice(s,f),v=e.slice(f,g),w=e.slice(g);return{type:t,sealed:w,iv:v,senderPublicKey:p}}const o=s+Pu,c=e.slice(s,o),l=e.slice(o);return{type:t,sealed:l,iv:c}}function VE(i,e){const t=ia(i);return wp({type:$s(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?cr(t.senderPublicKey,ar):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function wp(i){const e=(i==null?void 0:i.type)||_p;if(e===un){if(typeof(i==null?void 0:i.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(i==null?void 0:i.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:i==null?void 0:i.senderPublicKey,receiverPublicKey:i==null?void 0:i.receiverPublicKey}}function Uf(i){return i.type===un&&typeof i.senderPublicKey=="string"&&typeof i.receiverPublicKey=="string"}var GE=Object.defineProperty,jf=Object.getOwnPropertySymbols,WE=Object.prototype.hasOwnProperty,YE=Object.prototype.propertyIsEnumerable,Mf=(i,e,t)=>e in i?GE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Lf=(i,e)=>{for(var t in e||(e={}))WE.call(e,t)&&Mf(i,t,e[t]);if(jf)for(var t of jf(e))YE.call(e,t)&&Mf(i,t,e[t]);return i};const JE="ReactNative",Pr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},QE="js";function rh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Bn(){return!Qu()&&!!Xu()&&navigator.product===JE}function Kn(){return!rh()&&!!Xu()&&!!Qu()}function Us(){return Bn()?Pr.reactNative:rh()?Pr.node:Kn()?Pr.browser:Pr.unknown}function XE(){var i;try{return Bn()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(i=global.Application)==null?void 0:i.applicationId:void 0}catch{return}}function ZE(i,e){let t=Ss.parse(i);return t=Lf(Lf({},t),e),i=Ss.stringify(t),i}function e3(){return gp()||{name:"",description:"",url:"",icons:[""]}}function t3(){if(Us()===Pr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:s}=global.Platform;return[t,s].join("-")}const i=M1();if(i===null)return"unknown";const e=i.os?i.os.replace(" ","").toLowerCase():"unknown";return i.type==="browser"?[e,i.name,i.version].join("-"):[e,i.version].join("-")}function r3(){var i;const e=Us();return e===Pr.browser?[e,((i=pp())==null?void 0:i.host)||"unknown"].join(":"):e}function i3(i,e,t){const s=t3(),o=r3();return[[i,e].join("-"),[QE,t].join("-"),s,o].join("/")}function n3({protocol:i,version:e,relayUrl:t,sdkVersion:s,auth:o,projectId:c,useOnCloseEvent:l,bundleId:f}){const g=t.split("?"),p=i3(i,e,s),v={auth:o,ua:p,projectId:c,useOnCloseEvent:l||void 0,origin:f||void 0},w=ZE(g[1]||"",v);return g[0]+"?"+w}function on(i,e){return i.filter(t=>e.includes(t)).length===i.length}function bp(i){return Object.fromEntries(i.entries())}function Ep(i){return new Map(Object.entries(i))}function Mn(i=ve.FIVE_MINUTES,e){const t=ve.toMiliseconds(i||ve.FIVE_MINUTES);let s,o,c;return{resolve:l=>{c&&s&&(clearTimeout(c),s(l))},reject:l=>{c&&o&&(clearTimeout(c),o(l))},done:()=>new Promise((l,f)=>{c=setTimeout(()=>{f(new Error(e))},t),s=l,o=f})}}function Is(i,e,t){return new Promise(async(s,o)=>{const c=setTimeout(()=>o(new Error(t)),e);try{const l=await i;s(l)}catch(l){o(l)}clearTimeout(c)})}function Dp(i,e){if(typeof e=="string"&&e.startsWith(`${i}:`))return e;if(i.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(i.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${i}`)}function s3(i){return Dp("topic",i)}function o3(i){return Dp("id",i)}function Sp(i){const[e,t]=i.split(":"),s={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")s.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))s.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return s}function Or(i,e){return ve.fromMiliseconds(Date.now()+ve.toMiliseconds(i))}function Mi(i){return Date.now()>=ve.toMiliseconds(i)}function Nt(i,e){return`${i}${e?`:${e}`:""}`}function eu(i=[],e=[]){return[...new Set([...i,...e])]}async function a3({id:i,topic:e,wcDeepLink:t}){try{if(!t)return;const s=typeof t=="string"?JSON.parse(t):t;let o=s==null?void 0:s.href;if(typeof o!="string")return;o.endsWith("/")&&(o=o.slice(0,-1));const c=`${o}/wc?requestId=${i}&sessionTopic=${e}`,l=Us();l===Pr.browser?c.startsWith("https://")?window.open(c,"_blank","noreferrer noopener"):window.open(c,"_self","noreferrer noopener"):l===Pr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(c)}catch(s){console.error(s)}}async function c3(i,e){try{return await i.getItem(e)||(Kn()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}const u3="irn";function Cu(i){return(i==null?void 0:i.relay)||{protocol:u3}}function Xo(i){const e=$E[i];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${i}`);return e}var h3=Object.defineProperty,l3=Object.defineProperties,f3=Object.getOwnPropertyDescriptors,qf=Object.getOwnPropertySymbols,d3=Object.prototype.hasOwnProperty,p3=Object.prototype.propertyIsEnumerable,Ff=(i,e,t)=>e in i?h3(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,g3=(i,e)=>{for(var t in e||(e={}))d3.call(e,t)&&Ff(i,t,e[t]);if(qf)for(var t of qf(e))p3.call(e,t)&&Ff(i,t,e[t]);return i},y3=(i,e)=>l3(i,f3(e));function v3(i,e="-"){const t={},s="relay"+e;return Object.keys(i).forEach(o=>{if(o.startsWith(s)){const c=o.replace(s,""),l=i[o];t[c]=l}}),t}function zf(i){i=i.includes("wc://")?i.replace("wc://",""):i,i=i.includes("wc:")?i.replace("wc:",""):i;const e=i.indexOf(":"),t=i.indexOf("?")!==-1?i.indexOf("?"):void 0,s=i.substring(0,e),o=i.substring(e+1,t).split("@"),c=typeof t<"u"?i.substring(t):"",l=Ss.parse(c);return{protocol:s,topic:m3(o[0]),version:parseInt(o[1],10),symKey:l.symKey,relay:v3(l),expiryTimestamp:l.expiryTimestamp?parseInt(l.expiryTimestamp,10):void 0}}function m3(i){return i.startsWith("//")?i.substring(2):i}function _3(i,e="-"){const t="relay",s={};return Object.keys(i).forEach(o=>{const c=t+e+o;i[o]&&(s[c]=i[o])}),s}function w3(i){return`${i.protocol}:${i.topic}@${i.version}?`+Ss.stringify(y3(g3({symKey:i.symKey},_3(i.relay)),{expiryTimestamp:i.expiryTimestamp}))}function kn(i){const e=[];return i.forEach(t=>{const[s,o]=t.split(":");e.push(`${s}:${o}`)}),e}function b3(i){const e=[];return Object.values(i).forEach(t=>{e.push(...kn(t.accounts))}),e}function E3(i,e){const t=[];return Object.values(i).forEach(s=>{kn(s.accounts).includes(e)&&t.push(...s.methods)}),t}function D3(i,e){const t=[];return Object.values(i).forEach(s=>{kn(s.accounts).includes(e)&&t.push(...s.events)}),t}function ih(i){return i.includes(":")}function _s(i){return ih(i)?i.split(":")[0]:i}const S3={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},I3={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ae(i,e){const{message:t,code:s}=I3[i];return{message:e?`${t} ${e}`:t,code:s}}function mt(i,e){const{message:t,code:s}=S3[i];return{message:e?`${t} ${e}`:t,code:s}}function si(i,e){return!!Array.isArray(i)}function xs(i){return Object.getPrototypeOf(i)===Object.prototype&&Object.keys(i).length}function vr(i){return typeof i>"u"}function Vt(i,e){return e&&vr(i)?!0:typeof i=="string"&&!!i.trim().length}function nh(i,e){return typeof i=="number"&&!isNaN(i)}function x3(i,e){const{requiredNamespaces:t}=e,s=Object.keys(i.namespaces),o=Object.keys(t);let c=!0;return on(o,s)?(s.forEach(l=>{const{accounts:f,methods:g,events:p}=i.namespaces[l],v=kn(f),w=t[l];(!on(vp(l,w),v)||!on(w.methods,g)||!on(w.events,p))&&(c=!1)}),c):!1}function na(i){return Vt(i,!1)&&i.includes(":")?i.split(":").length===2:!1}function O3(i){if(Vt(i,!1)&&i.includes(":")){const e=i.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&na(t)}}return!1}function P3(i){if(Vt(i,!1))try{return typeof new URL(i)<"u"}catch{return!1}return!1}function A3(i){var e;return(e=i==null?void 0:i.proposer)==null?void 0:e.publicKey}function C3(i){return i==null?void 0:i.topic}function T3(i,e){let t=null;return Vt(i==null?void 0:i.publicKey,!1)||(t=ae("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function Hf(i){let e=!0;return si(i)?i.length&&(e=i.every(t=>Vt(t,!1))):e=!1,e}function R3(i,e,t){let s=null;return si(e)&&e.length?e.forEach(o=>{s||na(o)||(s=mt("UNSUPPORTED_CHAINS",`${t}, chain ${o} should be a string and conform to "namespace:chainId" format`))}):na(i)||(s=mt("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),s}function N3(i,e,t){let s=null;return Object.entries(i).forEach(([o,c])=>{if(s)return;const l=R3(o,vp(o,c),`${e} ${t}`);l&&(s=l)}),s}function $3(i,e){let t=null;return si(i)?i.forEach(s=>{t||O3(s)||(t=mt("UNSUPPORTED_ACCOUNTS",`${e}, account ${s} should be a string and conform to "namespace:chainId:address" format`))}):t=mt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function U3(i,e){let t=null;return Object.values(i).forEach(s=>{if(t)return;const o=$3(s==null?void 0:s.accounts,`${e} namespace`);o&&(t=o)}),t}function j3(i,e){let t=null;return Hf(i==null?void 0:i.methods)?Hf(i==null?void 0:i.events)||(t=mt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=mt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function Ip(i,e){let t=null;return Object.values(i).forEach(s=>{if(t)return;const o=j3(s,`${e}, namespace`);o&&(t=o)}),t}function M3(i,e,t){let s=null;if(i&&xs(i)){const o=Ip(i,e);o&&(s=o);const c=N3(i,e,t);c&&(s=c)}else s=ae("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return s}function tu(i,e){let t=null;if(i&&xs(i)){const s=Ip(i,e);s&&(t=s);const o=U3(i,e);o&&(t=o)}else t=ae("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function xp(i){return Vt(i.protocol,!0)}function L3(i,e){let t=!1;return i?i&&si(i)&&i.length&&i.forEach(s=>{t=xp(s)}):t=!0,t}function q3(i){return typeof i=="number"}function yr(i){return typeof i<"u"&&typeof i!==null}function F3(i){return!(!i||typeof i!="object"||!i.code||!nh(i.code)||!i.message||!Vt(i.message,!1))}function z3(i){return!(vr(i)||!Vt(i.method,!1))}function H3(i){return!(vr(i)||vr(i.result)&&vr(i.error)||!nh(i.id)||!Vt(i.jsonrpc,!1))}function B3(i){return!(vr(i)||!Vt(i.name,!1))}function Bf(i,e){return!(!na(e)||!b3(i).includes(e))}function K3(i,e,t){return Vt(t,!1)?E3(i,e).includes(t):!1}function k3(i,e,t){return Vt(t,!1)?D3(i,e).includes(t):!1}function Kf(i,e,t){let s=null;const o=V3(i),c=G3(e),l=Object.keys(o),f=Object.keys(c),g=kf(Object.keys(i)),p=kf(Object.keys(e)),v=g.filter(w=>!p.includes(w));return v.length&&(s=ae("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces. + Required: ${v.toString()} + Received: ${Object.keys(e).toString()}`)),on(l,f)||(s=ae("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces. + Required: ${l.toString()} + Approved: ${f.toString()}`)),Object.keys(e).forEach(w=>{if(!w.includes(":")||s)return;const E=kn(e[w].accounts);E.includes(w)||(s=ae("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${w} + Required: ${w} + Approved: ${E.toString()}`))}),l.forEach(w=>{s||(on(o[w].methods,c[w].methods)?on(o[w].events,c[w].events)||(s=ae("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${w}`)):s=ae("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${w}`))}),s}function V3(i){const e={};return Object.keys(i).forEach(t=>{var s;t.includes(":")?e[t]=i[t]:(s=i[t].chains)==null||s.forEach(o=>{e[o]={methods:i[t].methods,events:i[t].events}})}),e}function kf(i){return[...new Set(i.map(e=>e.includes(":")?e.split(":")[0]:e))]}function G3(i){const e={};return Object.keys(i).forEach(t=>{if(t.includes(":"))e[t]=i[t];else{const s=kn(i[t].accounts);s==null||s.forEach(o=>{e[o]={accounts:i[t].accounts.filter(c=>c.includes(`${o}:`)),methods:i[t].methods,events:i[t].events}})}}),e}function W3(i,e){return nh(i)&&i<=e.max&&i>=e.min}function Vf(){const i=Us();return new Promise(e=>{switch(i){case Pr.browser:e(Y3());break;case Pr.reactNative:e(J3());break;case Pr.node:e(Q3());break;default:e(!0)}})}function Y3(){return Kn()&&(navigator==null?void 0:navigator.onLine)}async function J3(){if(Bn()&&typeof global<"u"&&global!=null&&global.NetInfo){const i=await(global==null?void 0:global.NetInfo.fetch());return i==null?void 0:i.isConnected}return!0}function Q3(){return!0}function X3(i){switch(Us()){case Pr.browser:Z3(i);break;case Pr.reactNative:eD(i);break}}function Z3(i){!Bn()&&Kn()&&(window.addEventListener("online",()=>i(!0)),window.addEventListener("offline",()=>i(!1)))}function eD(i){Bn()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>i(e==null?void 0:e.isConnected)))}const ru={};let ko=class{static get(e){return ru[e]}static set(e,t){ru[e]=t}static delete(e){delete ru[e]}};const tD=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,rD=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,iD=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function nD(i,e){if(i==="__proto__"||i==="constructor"&&e&&typeof e=="object"&&"prototype"in e){sD(i);return}return e}function sD(i){console.warn(`[destr] Dropping "${i}" key to prevent prototype pollution.`)}function Vo(i,e={}){if(typeof i!="string")return i;const t=i.trim();if(i[0]==='"'&&i.endsWith('"')&&!i.includes("\\"))return t.slice(1,-1);if(t.length<=9){const s=t.toLowerCase();if(s==="true")return!0;if(s==="false")return!1;if(s==="undefined")return;if(s==="null")return null;if(s==="nan")return Number.NaN;if(s==="infinity")return Number.POSITIVE_INFINITY;if(s==="-infinity")return Number.NEGATIVE_INFINITY}if(!iD.test(i)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return i}try{if(tD.test(i)||rD.test(i)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(i,nD)}return JSON.parse(i)}catch(s){if(e.strict)throw s;return i}}function oD(i){return!i||typeof i.then!="function"?Promise.resolve(i):i}function kt(i,...e){try{return oD(i(...e))}catch(t){return Promise.reject(t)}}function aD(i){const e=typeof i;return i===null||e!=="object"&&e!=="function"}function cD(i){const e=Object.getPrototypeOf(i);return!e||e.isPrototypeOf(Object)}function Zo(i){if(aD(i))return String(i);if(cD(i)||Array.isArray(i))return JSON.stringify(i);if(typeof i.toJSON=="function")return Zo(i.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Op(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Tu="base64:";function uD(i){if(typeof i=="string")return i;Op();const e=Buffer.from(i).toString("base64");return Tu+e}function hD(i){return typeof i!="string"||!i.startsWith(Tu)?i:(Op(),Buffer.from(i.slice(Tu.length),"base64"))}function gr(i){return i?i.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function lD(...i){return gr(i.join(":"))}function Go(i){return i=gr(i),i?i+":":""}const fD="memory",dD=()=>{const i=new Map;return{name:fD,options:{},hasItem(e){return i.has(e)},getItem(e){return i.get(e)??null},getItemRaw(e){return i.get(e)??null},setItem(e,t){i.set(e,t)},setItemRaw(e,t){i.set(e,t)},removeItem(e){i.delete(e)},getKeys(){return Array.from(i.keys())},clear(){i.clear()},dispose(){i.clear()}}};function pD(i={}){const e={mounts:{"":i.driver||dD()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=p=>{for(const v of e.mountpoints)if(p.startsWith(v))return{base:v,relativeKey:p.slice(v.length),driver:e.mounts[v]};return{base:"",relativeKey:p,driver:e.mounts[""]}},s=(p,v)=>e.mountpoints.filter(w=>w.startsWith(p)||v&&p.startsWith(w)).map(w=>({relativeBase:p.length>w.length?p.slice(w.length):void 0,mountpoint:w,driver:e.mounts[w]})),o=(p,v)=>{if(e.watching){v=gr(v);for(const w of e.watchListeners)w(p,v)}},c=async()=>{if(!e.watching){e.watching=!0;for(const p in e.mounts)e.unwatch[p]=await Gf(e.mounts[p],o,p)}},l=async()=>{if(e.watching){for(const p in e.unwatch)await e.unwatch[p]();e.unwatch={},e.watching=!1}},f=(p,v,w)=>{const E=new Map,x=I=>{let B=E.get(I.base);return B||(B={driver:I.driver,base:I.base,items:[]},E.set(I.base,B)),B};for(const I of p){const B=typeof I=="string",K=gr(B?I:I.key),Z=B?void 0:I.value,$=B||!I.options?v:{...v,...I.options},j=t(K);x(j).items.push({key:K,value:Z,relativeKey:j.relativeKey,options:$})}return Promise.all([...E.values()].map(I=>w(I))).then(I=>I.flat())},g={hasItem(p,v={}){p=gr(p);const{relativeKey:w,driver:E}=t(p);return kt(E.hasItem,w,v)},getItem(p,v={}){p=gr(p);const{relativeKey:w,driver:E}=t(p);return kt(E.getItem,w,v).then(x=>Vo(x))},getItems(p,v){return f(p,v,w=>w.driver.getItems?kt(w.driver.getItems,w.items.map(E=>({key:E.relativeKey,options:E.options})),v).then(E=>E.map(x=>({key:lD(w.base,x.key),value:Vo(x.value)}))):Promise.all(w.items.map(E=>kt(w.driver.getItem,E.relativeKey,E.options).then(x=>({key:E.key,value:Vo(x)})))))},getItemRaw(p,v={}){p=gr(p);const{relativeKey:w,driver:E}=t(p);return E.getItemRaw?kt(E.getItemRaw,w,v):kt(E.getItem,w,v).then(x=>hD(x))},async setItem(p,v,w={}){if(v===void 0)return g.removeItem(p);p=gr(p);const{relativeKey:E,driver:x}=t(p);x.setItem&&(await kt(x.setItem,E,Zo(v),w),x.watch||o("update",p))},async setItems(p,v){await f(p,v,async w=>{if(w.driver.setItems)return kt(w.driver.setItems,w.items.map(E=>({key:E.relativeKey,value:Zo(E.value),options:E.options})),v);w.driver.setItem&&await Promise.all(w.items.map(E=>kt(w.driver.setItem,E.relativeKey,Zo(E.value),E.options)))})},async setItemRaw(p,v,w={}){if(v===void 0)return g.removeItem(p,w);p=gr(p);const{relativeKey:E,driver:x}=t(p);if(x.setItemRaw)await kt(x.setItemRaw,E,v,w);else if(x.setItem)await kt(x.setItem,E,uD(v),w);else return;x.watch||o("update",p)},async removeItem(p,v={}){typeof v=="boolean"&&(v={removeMeta:v}),p=gr(p);const{relativeKey:w,driver:E}=t(p);E.removeItem&&(await kt(E.removeItem,w,v),(v.removeMeta||v.removeMata)&&await kt(E.removeItem,w+"$",v),E.watch||o("remove",p))},async getMeta(p,v={}){typeof v=="boolean"&&(v={nativeOnly:v}),p=gr(p);const{relativeKey:w,driver:E}=t(p),x=Object.create(null);if(E.getMeta&&Object.assign(x,await kt(E.getMeta,w,v)),!v.nativeOnly){const I=await kt(E.getItem,w+"$",v).then(B=>Vo(B));I&&typeof I=="object"&&(typeof I.atime=="string"&&(I.atime=new Date(I.atime)),typeof I.mtime=="string"&&(I.mtime=new Date(I.mtime)),Object.assign(x,I))}return x},setMeta(p,v,w={}){return this.setItem(p+"$",v,w)},removeMeta(p,v={}){return this.removeItem(p+"$",v)},async getKeys(p,v={}){p=Go(p);const w=s(p,!0);let E=[];const x=[];for(const I of w){const K=(await kt(I.driver.getKeys,I.relativeBase,v)).map(Z=>I.mountpoint+gr(Z)).filter(Z=>!E.some($=>Z.startsWith($)));x.push(...K),E=[I.mountpoint,...E.filter(Z=>!Z.startsWith(I.mountpoint))]}return p?x.filter(I=>I.startsWith(p)&&!I.endsWith("$")):x.filter(I=>!I.endsWith("$"))},async clear(p,v={}){p=Go(p),await Promise.all(s(p,!1).map(async w=>{if(w.driver.clear)return kt(w.driver.clear,w.relativeBase,v);if(w.driver.removeItem){const E=await w.driver.getKeys(w.relativeBase||"",v);return Promise.all(E.map(x=>w.driver.removeItem(x,v)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(p=>Wf(p)))},async watch(p){return await c(),e.watchListeners.push(p),async()=>{e.watchListeners=e.watchListeners.filter(v=>v!==p),e.watchListeners.length===0&&await l()}},async unwatch(){e.watchListeners=[],await l()},mount(p,v){if(p=Go(p),p&&e.mounts[p])throw new Error(`already mounted at ${p}`);return p&&(e.mountpoints.push(p),e.mountpoints.sort((w,E)=>E.length-w.length)),e.mounts[p]=v,e.watching&&Promise.resolve(Gf(v,o,p)).then(w=>{e.unwatch[p]=w}).catch(console.error),g},async unmount(p,v=!0){p=Go(p),!(!p||!e.mounts[p])&&(e.watching&&p in e.unwatch&&(e.unwatch[p](),delete e.unwatch[p]),v&&await Wf(e.mounts[p]),e.mountpoints=e.mountpoints.filter(w=>w!==p),delete e.mounts[p])},getMount(p=""){p=gr(p)+":";const v=t(p);return{driver:v.driver,base:v.base}},getMounts(p="",v={}){return p=gr(p),s(p,v.parents).map(E=>({driver:E.driver,base:E.mountpoint}))}};return g}function Gf(i,e,t){return i.watch?i.watch((s,o)=>e(s,t+o)):()=>{}}async function Wf(i){typeof i.dispose=="function"&&await kt(i.dispose)}function hn(i){return new Promise((e,t)=>{i.oncomplete=i.onsuccess=()=>e(i.result),i.onabort=i.onerror=()=>t(i.error)})}function Pp(i,e){const t=indexedDB.open(i);t.onupgradeneeded=()=>t.result.createObjectStore(e);const s=hn(t);return(o,c)=>s.then(l=>c(l.transaction(e,o).objectStore(e)))}let iu;function js(){return iu||(iu=Pp("keyval-store","keyval")),iu}function Yf(i,e=js()){return e("readonly",t=>hn(t.get(i)))}function gD(i,e,t=js()){return t("readwrite",s=>(s.put(e,i),hn(s.transaction)))}function yD(i,e=js()){return e("readwrite",t=>(t.delete(i),hn(t.transaction)))}function vD(i=js()){return i("readwrite",e=>(e.clear(),hn(e.transaction)))}function mD(i,e){return i.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},hn(i.transaction)}function _D(i=js()){return i("readonly",e=>{if(e.getAllKeys)return hn(e.getAllKeys());const t=[];return mD(e,s=>t.push(s.key)).then(()=>t)})}const wD=i=>JSON.stringify(i,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),bD=i=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=i.replace(e,'$1"$2n"$3');return JSON.parse(t,(s,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function Ms(i){if(typeof i!="string")throw new Error(`Cannot safe json parse value of type ${typeof i}`);try{return bD(i)}catch{return i}}function an(i){return typeof i=="string"?i:wD(i)||""}const ED="idb-keyval";var DD=(i={})=>{const e=i.base&&i.base.length>0?`${i.base}:`:"",t=o=>e+o;let s;return i.dbName&&i.storeName&&(s=Pp(i.dbName,i.storeName)),{name:ED,options:i,async hasItem(o){return!(typeof await Yf(t(o),s)>"u")},async getItem(o){return await Yf(t(o),s)??null},setItem(o,c){return gD(t(o),c,s)},removeItem(o){return yD(t(o),s)},getKeys(){return _D(s)},clear(){return vD(s)}}};const SD="WALLET_CONNECT_V2_INDEXED_DB",ID="keyvaluestorage";let xD=class{constructor(){this.indexedDb=pD({driver:DD({dbName:SD,storeName:ID})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,an(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var nu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ea={exports:{}};(function(){let i;function e(){}i=e,i.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},i.prototype.setItem=function(t,s){this[t]=String(s)},i.prototype.removeItem=function(t){delete this[t]},i.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(s){t[s]=void 0,delete t[s]})},i.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},i.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof nu<"u"&&nu.localStorage?ea.exports=nu.localStorage:typeof window<"u"&&window.localStorage?ea.exports=window.localStorage:ea.exports=new e})();function OD(i){var e;return[i[0],Ms((e=i[1])!=null?e:"")]}class PD{constructor(){this.localStorage=ea.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(OD)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return Ms(t)}async setItem(e,t){this.localStorage.setItem(e,an(t))}async removeItem(e){this.localStorage.removeItem(e)}}const AD="wc_storage_version",Jf=1,CD=async(i,e,t)=>{const s=AD,o=await e.getItem(s);if(o&&o>=Jf){t(e);return}const c=await i.getKeys();if(!c.length){t(e);return}const l=[];for(;c.length;){const f=c.shift();if(!f)continue;const g=f.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const p=await i.getItem(f);await e.setItem(f,p),l.push(f)}}await e.setItem(s,Jf),t(e),TD(i,l)},TD=async(i,e)=>{e.length&&e.forEach(async t=>{await i.removeItem(t)})};let RD=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new PD;this.storage=e;try{const t=new xD;CD(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};var Vn={};/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Ru=function(i,e){return Ru=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])},Ru(i,e)};function ND(i,e){Ru(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Nu=function(){return Nu=Object.assign||function(e){for(var t,s=1,o=arguments.length;s=0;f--)(l=i[f])&&(c=(o<3?l(c):o>3?l(e,t,c):l(e,t))||c);return o>3&&c&&Object.defineProperty(e,t,c),c}function jD(i,e){return function(t,s){e(t,s,i)}}function MD(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}function LD(i,e,t,s){function o(c){return c instanceof t?c:new t(function(l){l(c)})}return new(t||(t=Promise))(function(c,l){function f(v){try{p(s.next(v))}catch(w){l(w)}}function g(v){try{p(s.throw(v))}catch(w){l(w)}}function p(v){v.done?c(v.value):o(v.value).then(f,g)}p((s=s.apply(i,e||[])).next())})}function qD(i,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},s,o,c,l;return l={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function f(p){return function(v){return g([p,v])}}function g(p){if(s)throw new TypeError("Generator is already executing.");for(;t;)try{if(s=1,o&&(c=p[0]&2?o.return:p[0]?o.throw||((c=o.return)&&c.call(o),0):o.next)&&!(c=c.call(o,p[1])).done)return c;switch(o=0,c&&(p=[p[0]&2,c.value]),p[0]){case 0:case 1:c=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,o=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(c=t.trys,!(c=c.length>0&&c[c.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!c||p[1]>c[0]&&p[1]=i.length&&(i=void 0),{value:i&&i[s++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ap(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),o,c=[],l;try{for(;(e===void 0||e-- >0)&&!(o=s.next()).done;)c.push(o.value)}catch(f){l={error:f}}finally{try{o&&!o.done&&(t=s.return)&&t.call(s)}finally{if(l)throw l.error}}return c}function HD(){for(var i=[],e=0;e1||f(E,x)})})}function f(E,x){try{g(s[E](x))}catch(I){w(c[0][3],I)}}function g(E){E.value instanceof Os?Promise.resolve(E.value.v).then(p,v):w(c[0][2],E)}function p(E){f("next",E)}function v(E){f("throw",E)}function w(E,x){E(x),c.shift(),c.length&&f(c[0][0],c[0][1])}}function kD(i){var e,t;return e={},s("next"),s("throw",function(o){throw o}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(o,c){e[o]=i[o]?function(l){return(t=!t)?{value:Os(i[o](l)),done:o==="return"}:c?c(l):l}:c}}function VD(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof $u=="function"?$u(i):i[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(c){t[c]=i[c]&&function(l){return new Promise(function(f,g){l=i[c](l),o(f,g,l.done,l.value)})}}function o(c,l,f,g){Promise.resolve(g).then(function(p){c({value:p,done:f})},l)}}function GD(i,e){return Object.defineProperty?Object.defineProperty(i,"raw",{value:e}):i.raw=e,i}function WD(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)Object.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e.default=i,e}function YD(i){return i&&i.__esModule?i:{default:i}}function JD(i,e){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return e.get(i)}function QD(i,e,t){if(!e.has(i))throw new TypeError("attempted to set private field on non-instance");return e.set(i,t),t}const XD=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Nu},__asyncDelegator:kD,__asyncGenerator:KD,__asyncValues:VD,__await:Os,__awaiter:LD,__classPrivateFieldGet:JD,__classPrivateFieldSet:QD,__createBinding:FD,__decorate:UD,__exportStar:zD,__extends:ND,__generator:qD,__importDefault:YD,__importStar:WD,__makeTemplateObject:GD,__metadata:MD,__param:jD,__read:Ap,__rest:$D,__spread:HD,__spreadArrays:BD,__values:$u},Symbol.toStringTag,{value:"Module"})),ya=Ts(XD);var ps={},su={},gs={};let ln=class{};const ZD=Object.freeze(Object.defineProperty({__proto__:null,IEvents:ln},Symbol.toStringTag,{value:"Module"})),eS=Ts(ZD);var Qf;function tS(){if(Qf)return gs;Qf=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.IHeartBeat=void 0;const i=eS;class e extends i.IEvents{constructor(s){super()}}return gs.IHeartBeat=e,gs}var Xf;function Cp(){return Xf||(Xf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),ya.__exportStar(tS(),i)}(su)),su}var ou={},sn={},Zf;function rS(){if(Zf)return sn;Zf=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.HEARTBEAT_EVENTS=sn.HEARTBEAT_INTERVAL=void 0;const i=ve;return sn.HEARTBEAT_INTERVAL=i.FIVE_SECONDS,sn.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},sn}var ed;function Tp(){return ed||(ed=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),ya.__exportStar(rS(),i)}(ou)),ou}var td;function iS(){if(td)return ps;td=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.HeartBeat=void 0;const i=ya,e=Fr,t=ve,s=Cp(),o=Tp();class c extends s.IHeartBeat{constructor(f){super(f),this.events=new e.EventEmitter,this.interval=o.HEARTBEAT_INTERVAL,this.interval=(f==null?void 0:f.interval)||o.HEARTBEAT_INTERVAL}static init(f){return i.__awaiter(this,void 0,void 0,function*(){const g=new c(f);return yield g.init(),g})}init(){return i.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(f,g){this.events.on(f,g)}once(f,g){this.events.once(f,g)}off(f,g){this.events.off(f,g)}removeListener(f,g){this.events.removeListener(f,g)}initialize(){return i.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),t.toMiliseconds(this.interval))})}pulse(){this.events.emit(o.HEARTBEAT_EVENTS.pulse)}}return ps.HeartBeat=c,ps}(function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=ya;e.__exportStar(iS(),i),e.__exportStar(Cp(),i),e.__exportStar(Tp(),i)})(Vn);function nS(i){try{return JSON.stringify(i)}catch{return'"[Circular]"'}}var sS=oS;function oS(i,e,t){var s=t&&t.stringify||nS,o=1;if(typeof i=="object"&&i!==null){var c=e.length+o;if(c===1)return i;var l=new Array(c);l[0]=s(i);for(var f=1;f-1?w:0,i.charCodeAt(x+1)){case 100:case 102:if(v>=g||e[v]==null)break;w=g||e[v]==null)break;w=g||e[v]===void 0)break;w",w=x+2,x++;break}p+=s(e[v]),w=x+2,x++;break;case 115:if(v>=g)break;w-1&&(c=!1);const l=["error","fatal","warn","info","debug","trace"];typeof t=="function"&&(t.error=t.fatal=t.warn=t.info=t.debug=t.trace=t),i.enabled===!1&&(i.level="silent");const f=i.level||"info",g=Object.create(t);g.log||(g.log=As),Object.defineProperty(g,"levelVal",{get:v}),Object.defineProperty(g,"level",{get:w,set:E});const p={transmit:e,serialize:o,asObject:i.browser.asObject,levels:l,timestamp:pS(i)};g.levels=ni.levels,g.level=f,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=As,g.serializers=s,g._serialize=o,g._stdErrSerialize=c,g.child=x,e&&(g._logEvent=Uu());function v(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function E(I){if(I!=="silent"&&!this.levels.values[I])throw Error("unknown level "+I);this._level=I,$n(p,g,"error","log"),$n(p,g,"fatal","error"),$n(p,g,"warn","error"),$n(p,g,"info","log"),$n(p,g,"debug","log"),$n(p,g,"trace","log")}function x(I,B){if(!I)throw new Error("missing bindings for child Pino");B=B||{},o&&I.serializers&&(B.serializers=I.serializers);const K=B.serializers;if(o&&K){var Z=Object.assign({},s,K),$=i.browser.serialize===!0?Object.keys(Z):o;delete I.serializers,va([I],$,Z,this._stdErrSerialize)}function j(O){this._childLevel=(O._childLevel|0)+1,this.error=Un(O,I,"error"),this.fatal=Un(O,I,"fatal"),this.warn=Un(O,I,"warn"),this.info=Un(O,I,"info"),this.debug=Un(O,I,"debug"),this.trace=Un(O,I,"trace"),Z&&(this.serializers=Z,this._serialize=$),e&&(this._logEvent=Uu([].concat(O._logEvent.bindings,I)))}return j.prototype=this,new j(this)}return g}ni.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};ni.stdSerializers=cS;ni.stdTimeFunctions=Object.assign({},{nullTime:Rp,epochTime:Np,unixTime:gS,isoTime:yS});function $n(i,e,t,s){const o=Object.getPrototypeOf(e);e[t]=e.levelVal>e.levels.values[t]?As:o[t]?o[t]:Ps[t]||Ps[s]||As,hS(i,e,t)}function hS(i,e,t){!i.transmit&&e[t]===As||(e[t]=function(s){return function(){const c=i.timestamp(),l=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ps?Ps:this;for(var g=0;g-1&&c in t&&(i[o][c]=t[c](i[o][c]))}function Un(i,e,t){return function(){const s=new Array(1+arguments.length);s[0]=e;for(var o=1;oe in i?_S(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,SS=(i,e)=>{for(var t in e||(e={}))ES.call(e,t)&&nd(i,t,e[t]);if(id)for(var t of id(e))DS.call(e,t)&&nd(i,t,e[t]);return i},IS=(i,e)=>wS(i,bS(e));function _a(i){return IS(SS({},i),{level:(i==null?void 0:i.level)||mS.level})}function xS(i,e=Ls){return i[e]||""}function OS(i,e,t=Ls){return i[t]=e,i}function _r(i,e=Ls){let t="";return typeof i.bindings>"u"?t=xS(i,e):t=i.bindings().context||"",t}function PS(i,e,t=Ls){const s=_r(i,t);return s.trim()?`${s}/${e}`:e}function wr(i,e,t=Ls){const s=PS(i,e,t),o=i.child({context:s});return OS(o,s,t)}class AS extends ln{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}let CS=class extends ln{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},TS=class{constructor(e,t){this.logger=e,this.core=t}},RS=class extends ln{constructor(e,t){super(),this.relayer=e,this.logger=t}},NS=class extends ln{constructor(e){super()}},$S=class{constructor(e,t,s,o){this.core=e,this.logger=t,this.name=s}};class US extends ln{constructor(e,t){super(),this.relayer=e,this.logger=t}}let jS=class extends ln{constructor(e,t){super(),this.core=e,this.logger=t}},MS=class{constructor(e,t){this.projectId=e,this.logger=t}},LS=class{constructor(e,t){this.projectId=e,this.logger=t}},qS=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},FS=class{constructor(e){this.client=e}};var sh={},$p={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=je,t=Ar;i.DIGEST_LENGTH=64,i.BLOCK_SIZE=128;var s=function(){function f(){this.digestLength=i.DIGEST_LENGTH,this.blockSize=i.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},f.prototype.update=function(g,p){if(p===void 0&&(p=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=p,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=g[v++],p--;this._bufferLength===this.blockSize&&(c(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(v=c(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,v,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=g[v++],p--;return this},f.prototype.finish=function(g){if(!this._finished){var p=this._bytesHashed,v=this._bufferLength,w=p/536870912|0,E=p<<3,x=p%128<112?128:256;this._buffer[v]=128;for(var I=v+1;I0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(g){t.wipe(g.stateHi),t.wipe(g.stateLo),g.buffer&&t.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},f}();i.SHA512=s;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function c(f,g,p,v,w,E,x){for(var I=p[0],B=p[1],K=p[2],Z=p[3],$=p[4],j=p[5],O=p[6],A=p[7],C=v[0],h=v[1],b=v[2],ee=v[3],ne=v[4],ue=v[5],ge=v[6],ye=v[7],S,R,X,J,k,V,te,ie;x>=128;){for(var De=0;De<16;De++){var oe=8*De+E;f[De]=e.readUint32BE(w,oe),g[De]=e.readUint32BE(w,oe+4)}for(var De=0;De<80;De++){var Se=I,le=B,Ce=K,z=Z,F=$,U=j,d=O,T=A,se=C,he=h,Ee=b,He=ee,ke=ne,Me=ue,dt=ge,pt=ye;if(S=A,R=ye,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=($>>>14|ne<<18)^($>>>18|ne<<14)^(ne>>>9|$<<23),R=(ne>>>14|$<<18)^(ne>>>18|$<<14)^($>>>9|ne<<23),k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,S=$&j^~$&O,R=ne&ue^~ne&ge,k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,S=o[De*2],R=o[De*2+1],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,S=f[De%16],R=g[De%16],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,X=te&65535|ie<<16,J=k&65535|V<<16,S=X,R=J,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=(I>>>28|C<<4)^(C>>>2|I<<30)^(C>>>7|I<<25),R=(C>>>28|I<<4)^(I>>>2|C<<30)^(I>>>7|C<<25),k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,S=I&B^I&K^B&K,R=C&h^C&b^h&b,k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,T=te&65535|ie<<16,pt=k&65535|V<<16,S=z,R=He,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=X,R=J,k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,z=te&65535|ie<<16,He=k&65535|V<<16,B=Se,K=le,Z=Ce,$=z,j=F,O=U,A=d,I=T,h=se,b=he,ee=Ee,ne=He,ue=ke,ge=Me,ye=dt,C=pt,De%16===15)for(var oe=0;oe<16;oe++)S=f[oe],R=g[oe],k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=f[(oe+9)%16],R=g[(oe+9)%16],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,X=f[(oe+1)%16],J=g[(oe+1)%16],S=(X>>>1|J<<31)^(X>>>8|J<<24)^X>>>7,R=(J>>>1|X<<31)^(J>>>8|X<<24)^(J>>>7|X<<25),k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,X=f[(oe+14)%16],J=g[(oe+14)%16],S=(X>>>19|J<<13)^(J>>>29|X<<3)^X>>>6,R=(J>>>19|X<<13)^(X>>>29|J<<3)^(J>>>6|X<<26),k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,f[oe]=te&65535|ie<<16,g[oe]=k&65535|V<<16}S=I,R=C,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=p[0],R=v[0],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,p[0]=I=te&65535|ie<<16,v[0]=C=k&65535|V<<16,S=B,R=h,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=p[1],R=v[1],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,p[1]=B=te&65535|ie<<16,v[1]=h=k&65535|V<<16,S=K,R=b,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=p[2],R=v[2],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,p[2]=K=te&65535|ie<<16,v[2]=b=k&65535|V<<16,S=Z,R=ee,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=p[3],R=v[3],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,p[3]=Z=te&65535|ie<<16,v[3]=ee=k&65535|V<<16,S=$,R=ne,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=p[4],R=v[4],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,p[4]=$=te&65535|ie<<16,v[4]=ne=k&65535|V<<16,S=j,R=ue,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=p[5],R=v[5],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,p[5]=j=te&65535|ie<<16,v[5]=ue=k&65535|V<<16,S=O,R=ge,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=p[6],R=v[6],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,p[6]=O=te&65535|ie<<16,v[6]=ge=k&65535|V<<16,S=A,R=ye,k=R&65535,V=R>>>16,te=S&65535,ie=S>>>16,S=p[7],R=v[7],k+=R&65535,V+=R>>>16,te+=S&65535,ie+=S>>>16,V+=k>>>16,te+=V>>>16,ie+=te>>>16,p[7]=A=te&65535|ie<<16,v[7]=ye=k&65535|V<<16,E+=128,x-=128}return E}function l(f){var g=new s;g.update(f);var p=g.digest();return g.clean(),p}i.hash=l})($p);(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.convertSecretKeyToX25519=i.convertPublicKeyToX25519=i.verify=i.sign=i.extractPublicKeyFromSecretKey=i.generateKeyPair=i.generateKeyPairFromSeed=i.SEED_LENGTH=i.SECRET_KEY_LENGTH=i.PUBLIC_KEY_LENGTH=i.SIGNATURE_LENGTH=void 0;const e=zn,t=$p,s=Ar;i.SIGNATURE_LENGTH=64,i.PUBLIC_KEY_LENGTH=32,i.SECRET_KEY_LENGTH=64,i.SEED_LENGTH=32;function o(z){const F=new Float64Array(16);if(z)for(let U=0;U>16&1),U[he-1]&=65535;U[15]=d[15]-32767-(U[14]>>16&1);const se=U[15]>>16&1;U[14]&=65535,B(d,U,1-se)}for(let T=0;T<16;T++)z[2*T]=d[T]&255,z[2*T+1]=d[T]>>8}function Z(z,F){let U=0;for(let d=0;d<32;d++)U|=z[d]^F[d];return(1&U-1>>>8)-1}function $(z,F){const U=new Uint8Array(32),d=new Uint8Array(32);return K(U,z),K(d,F),Z(U,d)}function j(z){const F=new Uint8Array(32);return K(F,z),F[0]&1}function O(z,F){for(let U=0;U<16;U++)z[U]=F[2*U]+(F[2*U+1]<<8);z[15]&=32767}function A(z,F,U){for(let d=0;d<16;d++)z[d]=F[d]+U[d]}function C(z,F,U){for(let d=0;d<16;d++)z[d]=F[d]-U[d]}function h(z,F,U){let d,T,se=0,he=0,Ee=0,He=0,ke=0,Me=0,dt=0,pt=0,qe=0,Ie=0,Ne=0,$e=0,Fe=0,Oe=0,Ue=0,be=0,Pe=0,Be=0,xe=0,Ve=0,We=0,Ze=0,et=0,Je=0,er=0,ur=0,Jr=0,tr=0,oi=0,xi=0,Hi=0,Et=U[0],gt=U[1],Dt=U[2],St=U[3],wt=U[4],yt=U[5],$t=U[6],Ut=U[7],It=U[8],jt=U[9],xt=U[10],At=U[11],Ot=U[12],ut=U[13],Mt=U[14],Lt=U[15];d=F[0],se+=d*Et,he+=d*gt,Ee+=d*Dt,He+=d*St,ke+=d*wt,Me+=d*yt,dt+=d*$t,pt+=d*Ut,qe+=d*It,Ie+=d*jt,Ne+=d*xt,$e+=d*At,Fe+=d*Ot,Oe+=d*ut,Ue+=d*Mt,be+=d*Lt,d=F[1],he+=d*Et,Ee+=d*gt,He+=d*Dt,ke+=d*St,Me+=d*wt,dt+=d*yt,pt+=d*$t,qe+=d*Ut,Ie+=d*It,Ne+=d*jt,$e+=d*xt,Fe+=d*At,Oe+=d*Ot,Ue+=d*ut,be+=d*Mt,Pe+=d*Lt,d=F[2],Ee+=d*Et,He+=d*gt,ke+=d*Dt,Me+=d*St,dt+=d*wt,pt+=d*yt,qe+=d*$t,Ie+=d*Ut,Ne+=d*It,$e+=d*jt,Fe+=d*xt,Oe+=d*At,Ue+=d*Ot,be+=d*ut,Pe+=d*Mt,Be+=d*Lt,d=F[3],He+=d*Et,ke+=d*gt,Me+=d*Dt,dt+=d*St,pt+=d*wt,qe+=d*yt,Ie+=d*$t,Ne+=d*Ut,$e+=d*It,Fe+=d*jt,Oe+=d*xt,Ue+=d*At,be+=d*Ot,Pe+=d*ut,Be+=d*Mt,xe+=d*Lt,d=F[4],ke+=d*Et,Me+=d*gt,dt+=d*Dt,pt+=d*St,qe+=d*wt,Ie+=d*yt,Ne+=d*$t,$e+=d*Ut,Fe+=d*It,Oe+=d*jt,Ue+=d*xt,be+=d*At,Pe+=d*Ot,Be+=d*ut,xe+=d*Mt,Ve+=d*Lt,d=F[5],Me+=d*Et,dt+=d*gt,pt+=d*Dt,qe+=d*St,Ie+=d*wt,Ne+=d*yt,$e+=d*$t,Fe+=d*Ut,Oe+=d*It,Ue+=d*jt,be+=d*xt,Pe+=d*At,Be+=d*Ot,xe+=d*ut,Ve+=d*Mt,We+=d*Lt,d=F[6],dt+=d*Et,pt+=d*gt,qe+=d*Dt,Ie+=d*St,Ne+=d*wt,$e+=d*yt,Fe+=d*$t,Oe+=d*Ut,Ue+=d*It,be+=d*jt,Pe+=d*xt,Be+=d*At,xe+=d*Ot,Ve+=d*ut,We+=d*Mt,Ze+=d*Lt,d=F[7],pt+=d*Et,qe+=d*gt,Ie+=d*Dt,Ne+=d*St,$e+=d*wt,Fe+=d*yt,Oe+=d*$t,Ue+=d*Ut,be+=d*It,Pe+=d*jt,Be+=d*xt,xe+=d*At,Ve+=d*Ot,We+=d*ut,Ze+=d*Mt,et+=d*Lt,d=F[8],qe+=d*Et,Ie+=d*gt,Ne+=d*Dt,$e+=d*St,Fe+=d*wt,Oe+=d*yt,Ue+=d*$t,be+=d*Ut,Pe+=d*It,Be+=d*jt,xe+=d*xt,Ve+=d*At,We+=d*Ot,Ze+=d*ut,et+=d*Mt,Je+=d*Lt,d=F[9],Ie+=d*Et,Ne+=d*gt,$e+=d*Dt,Fe+=d*St,Oe+=d*wt,Ue+=d*yt,be+=d*$t,Pe+=d*Ut,Be+=d*It,xe+=d*jt,Ve+=d*xt,We+=d*At,Ze+=d*Ot,et+=d*ut,Je+=d*Mt,er+=d*Lt,d=F[10],Ne+=d*Et,$e+=d*gt,Fe+=d*Dt,Oe+=d*St,Ue+=d*wt,be+=d*yt,Pe+=d*$t,Be+=d*Ut,xe+=d*It,Ve+=d*jt,We+=d*xt,Ze+=d*At,et+=d*Ot,Je+=d*ut,er+=d*Mt,ur+=d*Lt,d=F[11],$e+=d*Et,Fe+=d*gt,Oe+=d*Dt,Ue+=d*St,be+=d*wt,Pe+=d*yt,Be+=d*$t,xe+=d*Ut,Ve+=d*It,We+=d*jt,Ze+=d*xt,et+=d*At,Je+=d*Ot,er+=d*ut,ur+=d*Mt,Jr+=d*Lt,d=F[12],Fe+=d*Et,Oe+=d*gt,Ue+=d*Dt,be+=d*St,Pe+=d*wt,Be+=d*yt,xe+=d*$t,Ve+=d*Ut,We+=d*It,Ze+=d*jt,et+=d*xt,Je+=d*At,er+=d*Ot,ur+=d*ut,Jr+=d*Mt,tr+=d*Lt,d=F[13],Oe+=d*Et,Ue+=d*gt,be+=d*Dt,Pe+=d*St,Be+=d*wt,xe+=d*yt,Ve+=d*$t,We+=d*Ut,Ze+=d*It,et+=d*jt,Je+=d*xt,er+=d*At,ur+=d*Ot,Jr+=d*ut,tr+=d*Mt,oi+=d*Lt,d=F[14],Ue+=d*Et,be+=d*gt,Pe+=d*Dt,Be+=d*St,xe+=d*wt,Ve+=d*yt,We+=d*$t,Ze+=d*Ut,et+=d*It,Je+=d*jt,er+=d*xt,ur+=d*At,Jr+=d*Ot,tr+=d*ut,oi+=d*Mt,xi+=d*Lt,d=F[15],be+=d*Et,Pe+=d*gt,Be+=d*Dt,xe+=d*St,Ve+=d*wt,We+=d*yt,Ze+=d*$t,et+=d*Ut,Je+=d*It,er+=d*jt,ur+=d*xt,Jr+=d*At,tr+=d*Ot,oi+=d*ut,xi+=d*Mt,Hi+=d*Lt,se+=38*Pe,he+=38*Be,Ee+=38*xe,He+=38*Ve,ke+=38*We,Me+=38*Ze,dt+=38*et,pt+=38*Je,qe+=38*er,Ie+=38*ur,Ne+=38*Jr,$e+=38*tr,Fe+=38*oi,Oe+=38*xi,Ue+=38*Hi,T=1,d=se+T+65535,T=Math.floor(d/65536),se=d-T*65536,d=he+T+65535,T=Math.floor(d/65536),he=d-T*65536,d=Ee+T+65535,T=Math.floor(d/65536),Ee=d-T*65536,d=He+T+65535,T=Math.floor(d/65536),He=d-T*65536,d=ke+T+65535,T=Math.floor(d/65536),ke=d-T*65536,d=Me+T+65535,T=Math.floor(d/65536),Me=d-T*65536,d=dt+T+65535,T=Math.floor(d/65536),dt=d-T*65536,d=pt+T+65535,T=Math.floor(d/65536),pt=d-T*65536,d=qe+T+65535,T=Math.floor(d/65536),qe=d-T*65536,d=Ie+T+65535,T=Math.floor(d/65536),Ie=d-T*65536,d=Ne+T+65535,T=Math.floor(d/65536),Ne=d-T*65536,d=$e+T+65535,T=Math.floor(d/65536),$e=d-T*65536,d=Fe+T+65535,T=Math.floor(d/65536),Fe=d-T*65536,d=Oe+T+65535,T=Math.floor(d/65536),Oe=d-T*65536,d=Ue+T+65535,T=Math.floor(d/65536),Ue=d-T*65536,d=be+T+65535,T=Math.floor(d/65536),be=d-T*65536,se+=T-1+37*(T-1),T=1,d=se+T+65535,T=Math.floor(d/65536),se=d-T*65536,d=he+T+65535,T=Math.floor(d/65536),he=d-T*65536,d=Ee+T+65535,T=Math.floor(d/65536),Ee=d-T*65536,d=He+T+65535,T=Math.floor(d/65536),He=d-T*65536,d=ke+T+65535,T=Math.floor(d/65536),ke=d-T*65536,d=Me+T+65535,T=Math.floor(d/65536),Me=d-T*65536,d=dt+T+65535,T=Math.floor(d/65536),dt=d-T*65536,d=pt+T+65535,T=Math.floor(d/65536),pt=d-T*65536,d=qe+T+65535,T=Math.floor(d/65536),qe=d-T*65536,d=Ie+T+65535,T=Math.floor(d/65536),Ie=d-T*65536,d=Ne+T+65535,T=Math.floor(d/65536),Ne=d-T*65536,d=$e+T+65535,T=Math.floor(d/65536),$e=d-T*65536,d=Fe+T+65535,T=Math.floor(d/65536),Fe=d-T*65536,d=Oe+T+65535,T=Math.floor(d/65536),Oe=d-T*65536,d=Ue+T+65535,T=Math.floor(d/65536),Ue=d-T*65536,d=be+T+65535,T=Math.floor(d/65536),be=d-T*65536,se+=T-1+37*(T-1),z[0]=se,z[1]=he,z[2]=Ee,z[3]=He,z[4]=ke,z[5]=Me,z[6]=dt,z[7]=pt,z[8]=qe,z[9]=Ie,z[10]=Ne,z[11]=$e,z[12]=Fe,z[13]=Oe,z[14]=Ue,z[15]=be}function b(z,F){h(z,F,F)}function ee(z,F){const U=o();let d;for(d=0;d<16;d++)U[d]=F[d];for(d=253;d>=0;d--)b(U,U),d!==2&&d!==4&&h(U,U,F);for(d=0;d<16;d++)z[d]=U[d]}function ne(z,F){const U=o();let d;for(d=0;d<16;d++)U[d]=F[d];for(d=250;d>=0;d--)b(U,U),d!==1&&h(U,U,F);for(d=0;d<16;d++)z[d]=U[d]}function ue(z,F){const U=o(),d=o(),T=o(),se=o(),he=o(),Ee=o(),He=o(),ke=o(),Me=o();C(U,z[1],z[0]),C(Me,F[1],F[0]),h(U,U,Me),A(d,z[0],z[1]),A(Me,F[0],F[1]),h(d,d,Me),h(T,z[3],F[3]),h(T,T,p),h(se,z[2],F[2]),A(se,se,se),C(he,d,U),C(Ee,se,T),A(He,se,T),A(ke,d,U),h(z[0],he,Ee),h(z[1],ke,He),h(z[2],He,Ee),h(z[3],he,ke)}function ge(z,F,U){for(let d=0;d<4;d++)B(z[d],F[d],U)}function ye(z,F){const U=o(),d=o(),T=o();ee(T,F[2]),h(U,F[0],T),h(d,F[1],T),K(z,d),z[31]^=j(U)<<7}function S(z,F,U){x(z[0],l),x(z[1],f),x(z[2],f),x(z[3],l);for(let d=255;d>=0;--d){const T=U[d/8|0]>>(d&7)&1;ge(z,F,T),ue(F,z),ue(z,z),ge(z,F,T)}}function R(z,F){const U=[o(),o(),o(),o()];x(U[0],v),x(U[1],w),x(U[2],f),h(U[3],v,w),S(z,U,F)}function X(z){if(z.length!==i.SEED_LENGTH)throw new Error(`ed25519: seed must be ${i.SEED_LENGTH} bytes`);const F=(0,t.hash)(z);F[0]&=248,F[31]&=127,F[31]|=64;const U=new Uint8Array(32),d=[o(),o(),o(),o()];R(d,F),ye(U,d);const T=new Uint8Array(64);return T.set(z),T.set(U,32),{publicKey:U,secretKey:T}}i.generateKeyPairFromSeed=X;function J(z){const F=(0,e.randomBytes)(32,z),U=X(F);return(0,s.wipe)(F),U}i.generateKeyPair=J;function k(z){if(z.length!==i.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${i.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(z.subarray(32))}i.extractPublicKeyFromSecretKey=k;const V=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function te(z,F){let U,d,T,se;for(d=63;d>=32;--d){for(U=0,T=d-32,se=d-12;T>4)*V[T],U=F[T]>>8,F[T]&=255;for(T=0;T<32;T++)F[T]-=U*V[T];for(d=0;d<32;d++)F[d+1]+=F[d]>>8,z[d]=F[d]&255}function ie(z){const F=new Float64Array(64);for(let U=0;U<64;U++)F[U]=z[U];for(let U=0;U<64;U++)z[U]=0;te(z,F)}function De(z,F){const U=new Float64Array(64),d=[o(),o(),o(),o()],T=(0,t.hash)(z.subarray(0,32));T[0]&=248,T[31]&=127,T[31]|=64;const se=new Uint8Array(64);se.set(T.subarray(32),32);const he=new t.SHA512;he.update(se.subarray(32)),he.update(F);const Ee=he.digest();he.clean(),ie(Ee),R(d,Ee),ye(se,d),he.reset(),he.update(se.subarray(0,32)),he.update(z.subarray(32)),he.update(F);const He=he.digest();ie(He);for(let ke=0;ke<32;ke++)U[ke]=Ee[ke];for(let ke=0;ke<32;ke++)for(let Me=0;Me<32;Me++)U[ke+Me]+=He[ke]*T[Me];return te(se.subarray(32),U),se}i.sign=De;function oe(z,F){const U=o(),d=o(),T=o(),se=o(),he=o(),Ee=o(),He=o();return x(z[2],f),O(z[1],F),b(T,z[1]),h(se,T,g),C(T,T,z[2]),A(se,z[2],se),b(he,se),b(Ee,he),h(He,Ee,he),h(U,He,T),h(U,U,se),ne(U,U),h(U,U,T),h(U,U,se),h(U,U,se),h(z[0],U,se),b(d,z[0]),h(d,d,se),$(d,T)&&h(z[0],z[0],E),b(d,z[0]),h(d,d,se),$(d,T)?-1:(j(z[0])===F[31]>>7&&C(z[0],l,z[0]),h(z[3],z[0],z[1]),0)}function Se(z,F,U){const d=new Uint8Array(32),T=[o(),o(),o(),o()],se=[o(),o(),o(),o()];if(U.length!==i.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${i.SIGNATURE_LENGTH} bytes`);if(oe(se,z))return!1;const he=new t.SHA512;he.update(U.subarray(0,32)),he.update(z),he.update(F);const Ee=he.digest();return ie(Ee),S(T,se,Ee),R(se,U.subarray(32)),ue(T,se),ye(d,T),!Z(U,d)}i.verify=Se;function le(z){let F=[o(),o(),o(),o()];if(oe(F,z))throw new Error("Ed25519: invalid public key");let U=o(),d=o(),T=F[1];A(U,f,T),C(d,f,T),ee(d,d),h(U,U,d);let se=new Uint8Array(32);return K(se,U),se}i.convertPublicKeyToX25519=le;function Ce(z){const F=(0,t.hash)(z.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const U=new Uint8Array(F.subarray(0,32));return(0,s.wipe)(F),U}i.convertSecretKeyToX25519=Ce})(sh);const zS="EdDSA",HS="JWT",Up=".",jp="base64url",BS="utf8",KS="utf8",kS=":",VS="did",GS="key",sd="base58btc",WS="z",YS="K36",JS=32;function sa(i){return cr(mr(an(i),BS),jp)}function Mp(i){const e=mr(YS,sd),t=WS+cr(Eu([e,i]),sd);return[VS,GS,t].join(kS)}function QS(i){return cr(i,jp)}function XS(i){return mr([sa(i.header),sa(i.payload)].join(Up),KS)}function ZS(i){return[sa(i.header),sa(i.payload),QS(i.signature)].join(Up)}function od(i=zn.randomBytes(JS)){return sh.generateKeyPairFromSeed(i)}async function e2(i,e,t,s,o=ve.fromMiliseconds(Date.now())){const c={alg:zS,typ:HS},l=Mp(s.publicKey),f=o+t,g={iss:l,sub:i,aud:e,iat:o,exp:f},p=XS({header:c,payload:g}),v=sh.sign(s.secretKey,p);return ZS({header:c,payload:g,signature:v})}const t2="PARSE_ERROR",r2="INVALID_REQUEST",i2="METHOD_NOT_FOUND",n2="INVALID_PARAMS",Lp="INTERNAL_ERROR",oh="SERVER_ERROR",s2=[-32700,-32600,-32601,-32602,-32603],Es={[t2]:{code:-32700,message:"Parse error"},[r2]:{code:-32600,message:"Invalid Request"},[i2]:{code:-32601,message:"Method not found"},[n2]:{code:-32602,message:"Invalid params"},[Lp]:{code:-32603,message:"Internal error"},[oh]:{code:-32e3,message:"Server error"}},qp=oh;function o2(i){return s2.includes(i)}function ad(i){return Object.keys(Es).includes(i)?Es[i]:Es[qp]}function a2(i){const e=Object.values(Es).find(t=>t.code===i);return e||Es[qp]}function Fp(i,e,t){return i.message.includes("getaddrinfo ENOTFOUND")||i.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):i}var zp={};/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var ju=function(i,e){return ju=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])},ju(i,e)};function c2(i,e){ju(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Mu=function(){return Mu=Object.assign||function(e){for(var t,s=1,o=arguments.length;s=0;f--)(l=i[f])&&(c=(o<3?l(c):o>3?l(e,t,c):l(e,t))||c);return o>3&&c&&Object.defineProperty(e,t,c),c}function l2(i,e){return function(t,s){e(t,s,i)}}function f2(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}function d2(i,e,t,s){function o(c){return c instanceof t?c:new t(function(l){l(c)})}return new(t||(t=Promise))(function(c,l){function f(v){try{p(s.next(v))}catch(w){l(w)}}function g(v){try{p(s.throw(v))}catch(w){l(w)}}function p(v){v.done?c(v.value):o(v.value).then(f,g)}p((s=s.apply(i,e||[])).next())})}function p2(i,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},s,o,c,l;return l={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function f(p){return function(v){return g([p,v])}}function g(p){if(s)throw new TypeError("Generator is already executing.");for(;t;)try{if(s=1,o&&(c=p[0]&2?o.return:p[0]?o.throw||((c=o.return)&&c.call(o),0):o.next)&&!(c=c.call(o,p[1])).done)return c;switch(o=0,c&&(p=[p[0]&2,c.value]),p[0]){case 0:case 1:c=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,o=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(c=t.trys,!(c=c.length>0&&c[c.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!c||p[1]>c[0]&&p[1]=i.length&&(i=void 0),{value:i&&i[s++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hp(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),o,c=[],l;try{for(;(e===void 0||e-- >0)&&!(o=s.next()).done;)c.push(o.value)}catch(f){l={error:f}}finally{try{o&&!o.done&&(t=s.return)&&t.call(s)}finally{if(l)throw l.error}}return c}function v2(){for(var i=[],e=0;e1||f(E,x)})})}function f(E,x){try{g(s[E](x))}catch(I){w(c[0][3],I)}}function g(E){E.value instanceof Cs?Promise.resolve(E.value.v).then(p,v):w(c[0][2],E)}function p(E){f("next",E)}function v(E){f("throw",E)}function w(E,x){E(x),c.shift(),c.length&&f(c[0][0],c[0][1])}}function w2(i){var e,t;return e={},s("next"),s("throw",function(o){throw o}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(o,c){e[o]=i[o]?function(l){return(t=!t)?{value:Cs(i[o](l)),done:o==="return"}:c?c(l):l}:c}}function b2(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof Lu=="function"?Lu(i):i[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(c){t[c]=i[c]&&function(l){return new Promise(function(f,g){l=i[c](l),o(f,g,l.done,l.value)})}}function o(c,l,f,g){Promise.resolve(g).then(function(p){c({value:p,done:f})},l)}}function E2(i,e){return Object.defineProperty?Object.defineProperty(i,"raw",{value:e}):i.raw=e,i}function D2(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)Object.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e.default=i,e}function S2(i){return i&&i.__esModule?i:{default:i}}function I2(i,e){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return e.get(i)}function x2(i,e,t){if(!e.has(i))throw new TypeError("attempted to set private field on non-instance");return e.set(i,t),t}const O2=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Mu},__asyncDelegator:w2,__asyncGenerator:_2,__asyncValues:b2,__await:Cs,__awaiter:d2,__classPrivateFieldGet:I2,__classPrivateFieldSet:x2,__createBinding:g2,__decorate:h2,__exportStar:y2,__extends:c2,__generator:p2,__importDefault:S2,__importStar:D2,__makeTemplateObject:E2,__metadata:f2,__param:l2,__read:Hp,__rest:u2,__spread:v2,__spreadArrays:m2,__values:Lu},Symbol.toStringTag,{value:"Module"})),P2=Ts(O2);var mi={},cd;function A2(){if(cd)return mi;cd=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.isBrowserCryptoAvailable=mi.getSubtleCrypto=mi.getBrowerCrypto=void 0;function i(){return(Yr===null||Yr===void 0?void 0:Yr.crypto)||(Yr===null||Yr===void 0?void 0:Yr.msCrypto)||{}}mi.getBrowerCrypto=i;function e(){const s=i();return s.subtle||s.webkitSubtle}mi.getSubtleCrypto=e;function t(){return!!i()&&!!e()}return mi.isBrowserCryptoAvailable=t,mi}var _i={},ud;function C2(){if(ud)return _i;ud=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.isBrowser=_i.isNode=_i.isReactNative=void 0;function i(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}_i.isReactNative=i;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}_i.isNode=e;function t(){return!i()&&!e()}return _i.isBrowser=t,_i}(function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=P2;e.__exportStar(A2(),i),e.__exportStar(C2(),i)})(zp);function ah(i=3){const e=Date.now()*Math.pow(10,i),t=Math.floor(Math.random()*Math.pow(10,i));return e+t}function Bp(i=6){return BigInt(ah(i))}function Fn(i,e,t){return{id:t||ah(),jsonrpc:"2.0",method:i,params:e}}function wa(i,e){return{id:i,jsonrpc:"2.0",result:e}}function ba(i,e,t){return{id:i,jsonrpc:"2.0",error:T2(e)}}function T2(i,e){return typeof i>"u"?ad(Lp):(typeof i=="string"&&(i=Object.assign(Object.assign({},ad(oh)),{message:i})),o2(i.code)&&(i=a2(i.code)),i)}class R2{}class N2 extends R2{constructor(){super()}}class $2 extends N2{constructor(e){super()}}const U2="^https?:",j2="^wss?:";function M2(i){const e=i.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Kp(i,e){const t=M2(i);return typeof t>"u"?!1:new RegExp(e).test(t)}function hd(i){return Kp(i,U2)}function ld(i){return Kp(i,j2)}function L2(i){return new RegExp("wss?://localhost(:d{2,5})?").test(i)}function kp(i){return typeof i=="object"&&"id"in i&&"jsonrpc"in i&&i.jsonrpc==="2.0"}function ch(i){return kp(i)&&"method"in i}function Ea(i){return kp(i)&&(Di(i)||Wr(i))}function Di(i){return"result"in i}function Wr(i){return"error"in i}class Si extends $2{constructor(e){super(e),this.events=new Fr.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Fn(e.method,e.params||[],e.id||Bp().toString()),t)}async requestStrict(e,t){return new Promise(async(s,o)=>{if(!this.connection.connected)try{await this.open()}catch(c){o(c)}this.events.on(`${e.id}`,c=>{Wr(c)?o(c.error):s(c.result)});try{await this.connection.send(e,t)}catch(c){o(c)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Ea(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const q2=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),F2=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",fd=i=>i.split("?")[0],dd=10,z2=q2();let H2=class{constructor(e){if(this.url=e,this.events=new Fr.EventEmitter,this.registering=!1,!ld(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=s=>{this.onClose(s),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(an(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!ld(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((s,o)=>{this.events.once("register_error",c=>{this.resetMaxListeners(),o(c)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));s(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,s)=>{const o=new URLSearchParams(e).get("origin"),c=zp.isReactNative()?{headers:{origin:o}}:{rejectUnauthorized:!L2(e)},l=new z2(e,[],c);F2()?l.onerror=f=>{const g=f;s(this.emitError(g.error))}:l.on("error",f=>{s(this.emitError(f))}),l.onopen=()=>{this.onOpen(l),t(l)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?Ms(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const s=this.parseError(t),o=s.message||s.toString(),c=ba(e,o);this.events.emit("payload",c)}parseError(e,t=this.url){return Fp(e,fd(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>dd&&this.events.setMaxListeners(dd)}emitError(e){const t=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${fd(this.url)}`));return this.events.emit("register_error",t),t}};var oa={exports:{}};oa.exports;(function(i,e){var t=200,s="__lodash_hash_undefined__",o=1,c=2,l=9007199254740991,f="[object Arguments]",g="[object Array]",p="[object AsyncFunction]",v="[object Boolean]",w="[object Date]",E="[object Error]",x="[object Function]",I="[object GeneratorFunction]",B="[object Map]",K="[object Number]",Z="[object Null]",$="[object Object]",j="[object Promise]",O="[object Proxy]",A="[object RegExp]",C="[object Set]",h="[object String]",b="[object Symbol]",ee="[object Undefined]",ne="[object WeakMap]",ue="[object ArrayBuffer]",ge="[object DataView]",ye="[object Float32Array]",S="[object Float64Array]",R="[object Int8Array]",X="[object Int16Array]",J="[object Int32Array]",k="[object Uint8Array]",V="[object Uint8ClampedArray]",te="[object Uint16Array]",ie="[object Uint32Array]",De=/[\\^$.*+?()[\]{}|]/g,oe=/^\[object .+?Constructor\]$/,Se=/^(?:0|[1-9]\d*)$/,le={};le[ye]=le[S]=le[R]=le[X]=le[J]=le[k]=le[V]=le[te]=le[ie]=!0,le[f]=le[g]=le[ue]=le[v]=le[ge]=le[w]=le[E]=le[x]=le[B]=le[K]=le[$]=le[A]=le[C]=le[h]=le[ne]=!1;var Ce=typeof Yr=="object"&&Yr&&Yr.Object===Object&&Yr,z=typeof self=="object"&&self&&self.Object===Object&&self,F=Ce||z||Function("return this")(),U=e&&!e.nodeType&&e,d=U&&!0&&i&&!i.nodeType&&i,T=d&&d.exports===U,se=T&&Ce.process,he=function(){try{return se&&se.binding&&se.binding("util")}catch{}}(),Ee=he&&he.isTypedArray;function He(D,M){for(var Q=-1,fe=D==null?0:D.length,ot=0,Te=[];++Q-1}function Ra(D,M){var Q=this.__data__,fe=Bi(Q,D);return fe<0?(++this.size,Q.push([D,M])):Q[fe][1]=M,this}Cr.prototype.clear=Pa,Cr.prototype.delete=Aa,Cr.prototype.get=Ca,Cr.prototype.has=Ta,Cr.prototype.set=Ra;function ai(D){var M=-1,Q=D==null?0:D.length;for(this.clear();++Mqt))return!1;var at=Te.get(D);if(at&&Te.get(M))return at==M;var Ct=-1,hr=!0,Ft=Q&c?new gn:void 0;for(Te.set(D,M),Te.set(M,D);++Ct-1&&D%1==0&&D-1&&D%1==0&&D<=l}function io(D){var M=typeof D;return D!=null&&(M=="object"||M=="function")}function Vi(D){return D!=null&&typeof D=="object"}var no=Ee?pt(Ee):ks;function ka(D){return Ba(D)?Bs(D):Vs(D)}function st(){return[]}function nt(){return!1}i.exports=Ka})(oa,oa.exports);var B2=oa.exports;const K2=ca(B2);function k2(i,e){return e=e||{},new Promise(function(t,s){var o=new XMLHttpRequest,c=[],l=[],f={},g=function(){return{ok:(o.status/100|0)==2,statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:g,headers:{keys:function(){return c},entries:function(){return l},get:function(v){return f[v.toLowerCase()]},has:function(v){return v.toLowerCase()in f}}}};for(var p in o.open(e.method||"get",i,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(v,w,E){c.push(w=w.toLowerCase()),l.push([w,E]),f[w]=f[w]?f[w]+","+E:E}),t(g())},o.onerror=s,o.withCredentials=e.credentials=="include",e.headers)o.setRequestHeader(p,e.headers[p]);o.send(e.body||null)})}const V2=Object.freeze(Object.defineProperty({__proto__:null,default:k2},Symbol.toStringTag,{value:"Module"})),pd=Ts(V2);var G2=self.fetch||(self.fetch=pd.default||pd);const W2=ca(G2);var Y2={};function J2(i,e){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),s=0;s>>0,O=new Uint8Array(j);Z!==$;){for(var A=I[Z],C=0,h=j-1;(A!==0||C>>0,O[h]=A%f>>>0,A=A/f>>>0;if(A!==0)throw new Error("Non-zero carry");K=C,Z++}for(var b=j-K;b!==j&&O[b]===0;)b++;for(var ee=g.repeat(B);b>>0,j=new Uint8Array($);I[B];){var O=t[I.charCodeAt(B)];if(O===255)return;for(var A=0,C=$-1;(O!==0||A>>0,j[C]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");Z=A,B++}if(I[B]!==" "){for(var h=$-Z;h!==$&&j[h]===0;)h++;for(var b=new Uint8Array(K+($-h)),ee=K;h!==$;)b[ee++]=j[h++];return b}}}function x(I){var B=E(I);if(B)return B;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:E,decode:x}}var Q2=J2,X2=Q2;const Vp=i=>{if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")},Z2=i=>new TextEncoder().encode(i),e6=i=>new TextDecoder().decode(i);class t6{constructor(e,t,s){this.name=e,this.prefix=t,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class r6{constructor(e,t,s){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=s}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Gp(this,e)}}class i6{constructor(e){this.decoders=e}or(e){return Gp(this,e)}decode(e){const t=e[0],s=this.decoders[t];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Gp=(i,e)=>new i6({...i.decoders||{[i.prefix]:i},...e.decoders||{[e.prefix]:e}});class n6{constructor(e,t,s,o){this.name=e,this.prefix=t,this.baseEncode=s,this.baseDecode=o,this.encoder=new t6(e,t,s),this.decoder=new r6(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Da=({name:i,prefix:e,encode:t,decode:s})=>new n6(i,e,t,s),qs=({prefix:i,name:e,alphabet:t})=>{const{encode:s,decode:o}=X2(t,e);return Da({prefix:i,name:e,encode:s,decode:c=>Vp(o(c))})},s6=(i,e,t,s)=>{const o={};for(let v=0;v=8&&(f-=8,l[p++]=255&g>>f)}if(f>=t||255&g<<8-f)throw new SyntaxError("Unexpected end of data");return l},o6=(i,e,t)=>{const s=e[e.length-1]==="=",o=(1<t;)l-=t,c+=e[o&f>>l];if(l&&(c+=e[o&f<Da({prefix:e,name:i,encode(o){return o6(o,s,t)},decode(o){return s6(o,s,t,i)}}),a6=Da({prefix:"\0",name:"identity",encode:i=>e6(i),decode:i=>Z2(i)});var c6=Object.freeze({__proto__:null,identity:a6});const u6=Yt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var h6=Object.freeze({__proto__:null,base2:u6});const l6=Yt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var f6=Object.freeze({__proto__:null,base8:l6});const d6=qs({prefix:"9",name:"base10",alphabet:"0123456789"});var p6=Object.freeze({__proto__:null,base10:d6});const g6=Yt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),y6=Yt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var v6=Object.freeze({__proto__:null,base16:g6,base16upper:y6});const m6=Yt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),_6=Yt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),w6=Yt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),b6=Yt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),E6=Yt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),D6=Yt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),S6=Yt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),I6=Yt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),x6=Yt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var O6=Object.freeze({__proto__:null,base32:m6,base32upper:_6,base32pad:w6,base32padupper:b6,base32hex:E6,base32hexupper:D6,base32hexpad:S6,base32hexpadupper:I6,base32z:x6});const P6=qs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),A6=qs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var C6=Object.freeze({__proto__:null,base36:P6,base36upper:A6});const T6=qs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),R6=qs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var N6=Object.freeze({__proto__:null,base58btc:T6,base58flickr:R6});const $6=Yt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),U6=Yt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),j6=Yt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),M6=Yt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var L6=Object.freeze({__proto__:null,base64:$6,base64pad:U6,base64url:j6,base64urlpad:M6});const Wp=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),q6=Wp.reduce((i,e,t)=>(i[t]=e,i),[]),F6=Wp.reduce((i,e,t)=>(i[e.codePointAt(0)]=t,i),[]);function z6(i){return i.reduce((e,t)=>(e+=q6[t],e),"")}function H6(i){const e=[];for(const t of i){const s=F6[t.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(s)}return new Uint8Array(e)}const B6=Da({prefix:"🚀",name:"base256emoji",encode:z6,decode:H6});var K6=Object.freeze({__proto__:null,base256emoji:B6}),k6=Yp,gd=128,V6=127,G6=~V6,W6=Math.pow(2,31);function Yp(i,e,t){e=e||[],t=t||0;for(var s=t;i>=W6;)e[t++]=i&255|gd,i/=128;for(;i&G6;)e[t++]=i&255|gd,i>>>=7;return e[t]=i|0,Yp.bytes=t-s+1,e}var Y6=qu,J6=128,yd=127;function qu(i,s){var t=0,s=s||0,o=0,c=s,l,f=i.length;do{if(c>=f)throw qu.bytes=0,new RangeError("Could not decode varint");l=i[c++],t+=o<28?(l&yd)<=J6);return qu.bytes=c-s,t}var Q6=Math.pow(2,7),X6=Math.pow(2,14),Z6=Math.pow(2,21),eI=Math.pow(2,28),tI=Math.pow(2,35),rI=Math.pow(2,42),iI=Math.pow(2,49),nI=Math.pow(2,56),sI=Math.pow(2,63),oI=function(i){return i(Jp.encode(i,e,t),e),md=i=>Jp.encodingLength(i),Fu=(i,e)=>{const t=e.byteLength,s=md(i),o=s+md(t),c=new Uint8Array(o+t);return vd(i,c,0),vd(t,c,s),c.set(e,o),new cI(i,t,e,c)};class cI{constructor(e,t,s,o){this.code=e,this.size=t,this.digest=s,this.bytes=o}}const Qp=({name:i,code:e,encode:t})=>new uI(i,e,t);class uI{constructor(e,t,s){this.name=e,this.code=t,this.encode=s}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Fu(this.code,t):t.then(s=>Fu(this.code,s))}else throw Error("Unknown type, must be binary type")}}const Xp=i=>async e=>new Uint8Array(await crypto.subtle.digest(i,e)),hI=Qp({name:"sha2-256",code:18,encode:Xp("SHA-256")}),lI=Qp({name:"sha2-512",code:19,encode:Xp("SHA-512")});var fI=Object.freeze({__proto__:null,sha256:hI,sha512:lI});const Zp=0,dI="identity",eg=Vp,pI=i=>Fu(Zp,eg(i)),gI={code:Zp,name:dI,encode:eg,digest:pI};var yI=Object.freeze({__proto__:null,identity:gI});new TextEncoder,new TextDecoder;const _d={...c6,...h6,...f6,...p6,...v6,...O6,...C6,...N6,...L6,...K6};({...fI,...yI});function tg(i){return globalThis.Buffer!=null?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):i}function vI(i=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?tg(globalThis.Buffer.allocUnsafe(i)):new Uint8Array(i)}function rg(i,e,t,s){return{name:i,prefix:e,encoder:{name:i,prefix:e,encode:t},decoder:{decode:s}}}const wd=rg("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),cu=rg("ascii","a",i=>{let e="a";for(let t=0;t{i=i.substring(1);const e=vI(i.length);for(let t=0;t{if(!this.initialized){const s=await this.getKeyChain();typeof s<"u"&&(this.keychain=s),this.initialized=!0}},this.has=s=>(this.isInitialized(),this.keychain.has(s)),this.set=async(s,o)=>{this.isInitialized(),this.keychain.set(s,o),await this.persist()},this.get=s=>{this.isInitialized();const o=this.keychain.get(s);if(typeof o>"u"){const{message:c}=ae("NO_MATCHING_KEY",`${this.name}: ${s}`);throw new Error(c)}return o},this.del=async s=>{this.isInitialized(),this.keychain.delete(s),await this.persist()},this.core=e,this.logger=wr(t,this.name)}get context(){return _r(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,bp(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Ep(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class XI{constructor(e,t,s){this.core=e,this.logger=t,this.name=DI,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=o=>(this.isInitialized(),this.keychain.has(o)),this.getClientId=async()=>{this.isInitialized();const o=await this.getClientSeed(),c=od(o);return Mp(c.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const o=qE();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();const c=await this.getClientSeed(),l=od(c),f=Au();return await e2(f,o,SI,l)},this.generateSharedKey=(o,c,l)=>{this.isInitialized();const f=this.getPrivateKey(o),g=FE(f,c);return this.setSymKey(g,l)},this.setSymKey=async(o,c)=>{this.isInitialized();const l=c||zE(o);return await this.keychain.set(l,o),l},this.deleteKeyPair=async o=>{this.isInitialized(),await this.keychain.del(o)},this.deleteSymKey=async o=>{this.isInitialized(),await this.keychain.del(o)},this.encode=async(o,c,l)=>{this.isInitialized();const f=wp(l),g=an(c);if(Uf(f)){const E=f.senderPublicKey,x=f.receiverPublicKey;o=await this.generateSharedKey(E,x)}const p=this.getSymKey(o),{type:v,senderPublicKey:w}=f;return BE({type:v,symKey:p,message:g,senderPublicKey:w})},this.decode=async(o,c,l)=>{this.isInitialized();const f=VE(c,l);if(Uf(f)){const g=f.receiverPublicKey,p=f.senderPublicKey;o=await this.generateSharedKey(g,p)}try{const g=this.getSymKey(o),p=KE({symKey:g,encoded:c});return Ms(p)}catch(g){this.logger.error(`Failed to decode message from topic: '${o}', clientId: '${await this.getClientId()}'`),this.logger.error(g)}},this.getPayloadType=o=>{const c=ia(o);return $s(c.type)},this.getPayloadSenderPublicKey=o=>{const c=ia(o);return c.senderPublicKey?cr(c.senderPublicKey,ar):void 0},this.core=e,this.logger=wr(t,this.name),this.keychain=s||new QI(this.core,this.logger)}get context(){return _r(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(bd)}catch{e=Au(),await this.keychain.set(bd,e)}return _I(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ZI extends TS{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=OI,this.version=PI,this.initialized=!1,this.storagePrefix=Li,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const s=await this.getRelayerMessages();typeof s<"u"&&(this.messages=s),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(s){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(s)}finally{this.initialized=!0}}},this.set=async(s,o)=>{this.isInitialized();const c=qn(o);let l=this.messages.get(s);return typeof l>"u"&&(l={}),typeof l[c]<"u"||(l[c]=o,this.messages.set(s,l),await this.persist()),c},this.get=s=>{this.isInitialized();let o=this.messages.get(s);return typeof o>"u"&&(o={}),o},this.has=(s,o)=>{this.isInitialized();const c=this.get(s),l=qn(o);return typeof c[l]<"u"},this.del=async s=>{this.isInitialized(),this.messages.delete(s),await this.persist()},this.logger=wr(e,this.name),this.core=t}get context(){return _r(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,bp(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Ep(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class e5 extends RS{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new Fr.EventEmitter,this.name=CI,this.queue=new Map,this.publishTimeout=ve.toMiliseconds(ve.TEN_SECONDS*2),this.needsTransportRestart=!1,this.publish=async(s,o,c)=>{var l;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:s,message:o,opts:c}});try{const f=(c==null?void 0:c.ttl)||AI,g=Cu(c),p=(c==null?void 0:c.prompt)||!1,v=(c==null?void 0:c.tag)||0,w=(c==null?void 0:c.id)||Bp().toString(),E={topic:s,message:o,opts:{ttl:f,relay:g,prompt:p,tag:v,id:w}},x=setTimeout(()=>this.queue.set(w,E),this.publishTimeout);try{await await Is(this.rpcPublish(s,o,f,g,p,v,w),this.publishTimeout,`Failed to publish payload, please try again. id:${w} tag:${v}`),this.removeRequestFromQueue(w),this.relayer.events.emit(Zt.publish,E)}catch(I){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(l=c==null?void 0:c.internal)!=null&&l.throwOnFailedPublish)throw this.removeRequestFromQueue(w),I;return}finally{clearTimeout(x)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:s,message:o,opts:c}})}catch(f){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(f),f}},this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.relayer=e,this.logger=wr(t,this.name),this.registerEventListeners()}get context(){return _r(this.logger)}rpcPublish(e,t,s,o,c,l,f){var g,p,v,w;const E={method:Xo(o.protocol).publish,params:{topic:e,message:t,ttl:s,prompt:c,tag:l},id:f};return vr((g=E.params)==null?void 0:g.prompt)&&((p=E.params)==null||delete p.prompt),vr((v=E.params)==null?void 0:v.tag)&&((w=E.params)==null||delete w.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:E}),this.relayer.request(E)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:s,opts:o}=e;await this.publish(t,s,o)})}registerEventListeners(){this.relayer.core.heartbeat.on(Vn.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Zt.connection_stalled);return}this.checkQueue()}),this.relayer.on(Zt.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class t5{constructor(){this.map=new Map,this.set=(e,t)=>{const s=this.get(e);this.exists(e,t)||this.map.set(e,[...s,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const s=this.get(e);if(!this.exists(e,t))return;const o=s.filter(c=>c!==t);if(!o.length){this.map.delete(e);return}this.map.set(e,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var r5=Object.defineProperty,i5=Object.defineProperties,n5=Object.getOwnPropertyDescriptors,Dd=Object.getOwnPropertySymbols,s5=Object.prototype.hasOwnProperty,o5=Object.prototype.propertyIsEnumerable,Sd=(i,e,t)=>e in i?r5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,vs=(i,e)=>{for(var t in e||(e={}))s5.call(e,t)&&Sd(i,t,e[t]);if(Dd)for(var t of Dd(e))o5.call(e,t)&&Sd(i,t,e[t]);return i},hu=(i,e)=>i5(i,n5(e));class a5 extends US{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new t5,this.events=new Fr.EventEmitter,this.name=qI,this.version=FI,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Li,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(s,o)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:s,opts:o}});try{const c=Cu(o),l={topic:s,relay:c};this.pending.set(s,l);const f=await this.rpcSubscribe(s,c);return this.onSubscribe(f,l),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:s,opts:o}}),f}catch(c){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(c),c}},this.unsubscribe=async(s,o)=>{await this.restartToComplete(),this.isInitialized(),typeof(o==null?void 0:o.id)<"u"?await this.unsubscribeById(s,o.id,o):await this.unsubscribeByTopic(s,o)},this.isSubscribed=async s=>{if(this.topics.includes(s))return!0;const o=`${this.pendingSubscriptionWatchLabel}_${s}`;return await new Promise((c,l)=>{const f=new ve.Watch;f.start(o);const g=setInterval(()=>{!this.pending.has(s)&&this.topics.includes(s)&&(clearInterval(g),f.stop(o),c(!0)),f.elapsed(o)>=zI&&(clearInterval(g),f.stop(o),l(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=wr(t,this.name),this.clientId=""}get context(){return _r(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let s=!1;try{s=this.getSubscription(e).topic===t}catch{}return s}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const s=this.topicMap.get(e);await Promise.all(s.map(async o=>await this.unsubscribeById(e,o,t)))}async unsubscribeById(e,t,s){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:s}});try{const o=Cu(s);await this.rpcUnsubscribe(e,t,o);const c=mt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,c),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:s}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(e,t){const s={method:Xo(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});try{await await Is(this.relayer.request(s),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Zt.connection_stalled)}return qn(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,s={method:Xo(t.protocol).batchSubscribe,params:{topics:e.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});try{return await await Is(this.relayer.request(s),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Zt.connection_stalled)}}rpcUnsubscribe(e,t,s){const o={method:Xo(s.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(e,t){this.setSubscription(e,hu(vs({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,vs({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,s){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,s),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,vs({},t)),this.topicMap.set(t.topic,e),this.events.emit(Gr.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:s}=ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(s)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const s=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(s.topic,e),this.events.emit(Gr.deleted,hu(vs({},s),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Gr.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);si(t)&&this.onBatchSubscribe(t.map((s,o)=>hu(vs({},e[o]),{id:s})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Vn.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Zt.connect,async()=>{await this.onConnect()}),this.relayer.on(Zt.disconnect,()=>{this.onDisconnect()}),this.events.on(Gr.created,async e=>{const t=Gr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(Gr.deleted,async e=>{const t=Gr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var c5=Object.defineProperty,Id=Object.getOwnPropertySymbols,u5=Object.prototype.hasOwnProperty,h5=Object.prototype.propertyIsEnumerable,xd=(i,e,t)=>e in i?c5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,l5=(i,e)=>{for(var t in e||(e={}))u5.call(e,t)&&xd(i,t,e[t]);if(Id)for(var t of Id(e))h5.call(e,t)&&xd(i,t,e[t]);return i};class f5 extends NS{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Fr.EventEmitter,this.name=RI,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.request=async t=>{this.logger.debug("Publishing Request Payload");const s=t.id;try{await this.toEstablishConnection();const o=this.provider.request(t);return this.requestsInFlight.set(s,{promise:o,request:t}),await o}catch(o){throw this.logger.debug("Failed to Publish Request"),this.logger.error(o),o}finally{this.requestsInFlight.delete(s)}},this.onPayloadHandler=t=>{this.onProviderPayload(t)},this.onConnectHandler=()=>{this.events.emit(Zt.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(Zt.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(wi.payload,this.onPayloadHandler),this.provider.on(wi.connect,this.onConnectHandler),this.provider.on(wi.disconnect,this.onDisconnectHandler),this.provider.on(wi.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?wr(e.logger,this.name):ma(_a({level:e.logger||TI})),this.messages=new ZI(this.logger,e.core),this.subscriber=new a5(this,this.logger),this.publisher=new e5(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||sg,this.projectId=e.projectId,this.bundleId=XE(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${Ed}...`),await this.restartTransport(Ed)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},jI)}get context(){return _r(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,s){this.isInitialized(),await this.publisher.publish(e,t,s),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var s;this.isInitialized();let o=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"";if(o)return o;let c;const l=f=>{f.topic===e&&(this.subscriber.off(Gr.created,l),c())};return await Promise.all([new Promise(f=>{c=f,this.subscriber.on(Gr.created,l)}),new Promise(async f=>{o=await this.subscriber.subscribe(e,t),f()})]),o}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.requestsInFlight.size>0&&(this.logger.debug("Waiting for all in-flight requests to finish before closing transport..."),this.requestsInFlight.forEach(async e=>{await e.promise})),this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await Is(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(t=>{if(!this.initialized)return t();this.subscriber.once(Gr.resubscribed,()=>{t()})}),new Promise(async(t,s)=>{try{await Is(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(o){s(o);return}t()})])}catch(t){this.logger.error(t);const s=t;if(!this.isConnectionStalled(s.message))throw t;this.provider.events.emit(wi.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Vf())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Si(new H2(n3({sdkVersion:UI,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:s}=e;await this.messages.set(t,s)}async shouldIgnoreMessageEvent(e){const{topic:t,message:s}=e;if(!s||s.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${s}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const o=this.messages.has(t,s);return o&&this.logger.debug(`Ignoring duplicate message: ${s}`),o}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),ch(e)){if(!e.method.endsWith(NI))return;const t=e.params,{topic:s,message:o,publishedAt:c}=t.data,l={topic:s,message:o,publishedAt:c};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(l5({type:"event",event:t.id},l)),this.events.emit(t.id,l),await this.acknowledgePayload(e),await this.onMessageEvent(l)}else Ea(e)&&this.events.emit(Zt.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Zt.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=wa(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(wi.payload,this.onPayloadHandler),this.provider.off(wi.connect,this.onConnectHandler),this.provider.off(wi.disconnect,this.onDisconnectHandler),this.provider.off(wi.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Zt.connection_stalled,()=>{this.restartTransport().catch(t=>this.logger.error(t))});let e=await Vf();X3(async t=>{this.initialized&&e!==t&&(e=t,t?await this.restartTransport().catch(s=>this.logger.error(s)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(s=>this.logger.error(s))))})}onProviderDisconnect(){this.events.emit(Zt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},ve.toMiliseconds($I)))}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var d5=Object.defineProperty,Od=Object.getOwnPropertySymbols,p5=Object.prototype.hasOwnProperty,g5=Object.prototype.propertyIsEnumerable,Pd=(i,e,t)=>e in i?d5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ad=(i,e)=>{for(var t in e||(e={}))p5.call(e,t)&&Pd(i,t,e[t]);if(Od)for(var t of Od(e))g5.call(e,t)&&Pd(i,t,e[t]);return i};class Sa extends $S{constructor(e,t,s,o=Li,c=void 0){super(e,t,s,o),this.core=e,this.logger=t,this.name=s,this.map=new Map,this.version=MI,this.cached=[],this.initialized=!1,this.storagePrefix=Li,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(l=>{this.getKey&&l!==null&&!vr(l)?this.map.set(this.getKey(l),l):A3(l)?this.map.set(l.id,l):C3(l)&&this.map.set(l.topic,l)}),this.cached=[],this.initialized=!0)},this.set=async(l,f)=>{this.isInitialized(),this.map.has(l)?await this.update(l,f):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:l,value:f}),this.map.set(l,f),await this.persist())},this.get=l=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:l}),this.getData(l)),this.getAll=l=>(this.isInitialized(),l?this.values.filter(f=>Object.keys(l).every(g=>K2(f[g],l[g]))):this.values),this.update=async(l,f)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:l,update:f});const g=Ad(Ad({},this.getData(l)),f);this.map.set(l,g),await this.persist()},this.delete=async(l,f)=>{this.isInitialized(),this.map.has(l)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:l,reason:f}),this.map.delete(l),await this.persist())},this.logger=wr(t,this.name),this.storagePrefix=o,this.getKey=c}get context(){return _r(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){const{message:s}=ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(s),new Error(s)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class y5{constructor(e,t){this.core=e,this.logger=t,this.name=HI,this.version=BI,this.events=new Vu,this.initialized=!1,this.storagePrefix=Li,this.ignoredPayloadTypes=[un],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:s})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...s])]},this.create=async()=>{this.isInitialized();const s=Au(),o=await this.core.crypto.setSymKey(s),c=Or(ve.FIVE_MINUTES),l={protocol:ng},f={topic:o,expiry:c,relay:l,active:!1},g=w3({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:s,relay:l,expiryTimestamp:c});return await this.pairings.set(o,f),await this.core.relayer.subscribe(o),this.core.expirer.set(o,c),{topic:o,uri:g}},this.pair=async s=>{this.isInitialized(),this.isValidPair(s);const{topic:o,symKey:c,relay:l,expiryTimestamp:f}=zf(s.uri);let g;if(this.pairings.keys.includes(o)&&(g=this.pairings.get(o),g.active))throw new Error(`Pairing already exists: ${o}. Please try again with a new connection URI.`);const p=f||Or(ve.FIVE_MINUTES),v={topic:o,relay:l,expiry:p,active:!1};return await this.pairings.set(o,v),this.core.expirer.set(o,p),s.activatePairing&&await this.activate({topic:o}),this.events.emit(ws.create,v),this.core.crypto.keychain.has(o)||(await this.core.crypto.setSymKey(c,o),await this.core.relayer.subscribe(o,{relay:l})),v},this.activate=async({topic:s})=>{this.isInitialized();const o=Or(ve.THIRTY_DAYS);await this.pairings.update(s,{active:!0,expiry:o}),this.core.expirer.set(s,o)},this.ping=async s=>{this.isInitialized(),await this.isValidPing(s);const{topic:o}=s;if(this.pairings.keys.includes(o)){const c=await this.sendRequest(o,"wc_pairingPing",{}),{done:l,resolve:f,reject:g}=Mn();this.events.once(Nt("pairing_ping",c),({error:p})=>{p?g(p):f()}),await l()}},this.updateExpiry=async({topic:s,expiry:o})=>{this.isInitialized(),await this.pairings.update(s,{expiry:o})},this.updateMetadata=async({topic:s,metadata:o})=>{this.isInitialized(),await this.pairings.update(s,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async s=>{this.isInitialized(),await this.isValidDisconnect(s);const{topic:o}=s;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",mt("USER_DISCONNECTED")),await this.deletePairing(o))},this.sendRequest=async(s,o,c)=>{const l=Fn(o,c),f=await this.core.crypto.encode(s,l),g=ys[o].req;return this.core.history.set(s,l),this.core.relayer.publish(s,f,g),l.id},this.sendResult=async(s,o,c)=>{const l=wa(s,c),f=await this.core.crypto.encode(o,l),g=await this.core.history.get(o,s),p=ys[g.request.method].res;await this.core.relayer.publish(o,f,p),await this.core.history.resolve(l)},this.sendError=async(s,o,c)=>{const l=ba(s,c),f=await this.core.crypto.encode(o,l),g=await this.core.history.get(o,s),p=ys[g.request.method]?ys[g.request.method].res:ys.unregistered_method.res;await this.core.relayer.publish(o,f,p),await this.core.history.resolve(l)},this.deletePairing=async(s,o)=>{await this.core.relayer.unsubscribe(s),await Promise.all([this.pairings.delete(s,mt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(s),o?Promise.resolve():this.core.expirer.del(s)])},this.cleanup=async()=>{const s=this.pairings.getAll().filter(o=>Mi(o.expiry));await Promise.all(s.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=s=>{const{topic:o,payload:c}=s;switch(c.method){case"wc_pairingPing":return this.onPairingPingRequest(o,c);case"wc_pairingDelete":return this.onPairingDeleteRequest(o,c);default:return this.onUnknownRpcMethodRequest(o,c)}},this.onRelayEventResponse=async s=>{const{topic:o,payload:c}=s,l=(await this.core.history.get(o,c.id)).request.method;switch(l){case"wc_pairingPing":return this.onPairingPingResponse(o,c);default:return this.onUnknownRpcMethodResponse(l)}},this.onPairingPingRequest=async(s,o)=>{const{id:c}=o;try{this.isValidPing({topic:s}),await this.sendResult(c,s,!0),this.events.emit(ws.ping,{id:c,topic:s})}catch(l){await this.sendError(c,s,l),this.logger.error(l)}},this.onPairingPingResponse=(s,o)=>{const{id:c}=o;setTimeout(()=>{Di(o)?this.events.emit(Nt("pairing_ping",c),{}):Wr(o)&&this.events.emit(Nt("pairing_ping",c),{error:o.error})},500)},this.onPairingDeleteRequest=async(s,o)=>{const{id:c}=o;try{this.isValidDisconnect({topic:s}),await this.deletePairing(s),this.events.emit(ws.delete,{id:c,topic:s})}catch(l){await this.sendError(c,s,l),this.logger.error(l)}},this.onUnknownRpcMethodRequest=async(s,o)=>{const{id:c,method:l}=o;try{if(this.registeredMethods.includes(l))return;const f=mt("WC_METHOD_UNSUPPORTED",l);await this.sendError(c,s,f),this.logger.error(f)}catch(f){await this.sendError(c,s,f),this.logger.error(f)}},this.onUnknownRpcMethodResponse=s=>{this.registeredMethods.includes(s)||this.logger.error(mt("WC_METHOD_UNSUPPORTED",s))},this.isValidPair=s=>{var o;if(!yr(s)){const{message:l}=ae("MISSING_OR_INVALID",`pair() params: ${s}`);throw new Error(l)}if(!P3(s.uri)){const{message:l}=ae("MISSING_OR_INVALID",`pair() uri: ${s.uri}`);throw new Error(l)}const c=zf(s.uri);if(!((o=c==null?void 0:c.relay)!=null&&o.protocol)){const{message:l}=ae("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(l)}if(!(c!=null&&c.symKey)){const{message:l}=ae("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(l)}if(c!=null&&c.expiryTimestamp&&ve.toMiliseconds(c==null?void 0:c.expiryTimestamp){if(!yr(s)){const{message:c}=ae("MISSING_OR_INVALID",`ping() params: ${s}`);throw new Error(c)}const{topic:o}=s;await this.isValidPairingTopic(o)},this.isValidDisconnect=async s=>{if(!yr(s)){const{message:c}=ae("MISSING_OR_INVALID",`disconnect() params: ${s}`);throw new Error(c)}const{topic:o}=s;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async s=>{if(!Vt(s,!1)){const{message:o}=ae("MISSING_OR_INVALID",`pairing topic should be a string: ${s}`);throw new Error(o)}if(!this.pairings.keys.includes(s)){const{message:o}=ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${s}`);throw new Error(o)}if(Mi(this.pairings.get(s).expiry)){await this.deletePairing(s);const{message:o}=ae("EXPIRED",`pairing topic: ${s}`);throw new Error(o)}},this.core=e,this.logger=wr(t,this.name),this.pairings=new Sa(this.core,this.logger,this.name,this.storagePrefix)}get context(){return _r(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Zt.message,async e=>{const{topic:t,message:s}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(s)))return;const o=await this.core.crypto.decode(t,s);try{ch(o)?(this.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o})):Ea(o)&&(await this.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o}),this.core.history.delete(t,o.id))}catch(c){this.logger.error(c)}})}registerExpirerEvents(){this.core.expirer.on(qr.expired,async e=>{const{topic:t}=Sp(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(ws.expire,{topic:t}))})}}class v5 extends CS{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new Fr.EventEmitter,this.name=KI,this.version=kI,this.cached=[],this.initialized=!1,this.storagePrefix=Li,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>this.records.set(s.id,s)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(s,o,c)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:s,request:o,chainId:c}),this.records.has(o.id))return;const l={id:o.id,topic:s,request:{method:o.method,params:o.params||null},chainId:c,expiry:Or(ve.THIRTY_DAYS)};this.records.set(l.id,l),this.events.emit(ii.created,l)},this.resolve=async s=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:s}),!this.records.has(s.id))return;const o=await this.getRecord(s.id);typeof o.response>"u"&&(o.response=Wr(s)?{error:s.error}:{result:s.result},this.records.set(o.id,o),this.events.emit(ii.updated,o))},this.get=async(s,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:s,id:o}),await this.getRecord(o)),this.delete=(s,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(c=>{if(c.topic===s){if(typeof o<"u"&&c.id!==o)return;this.records.delete(c.id),this.events.emit(ii.deleted,c)}})},this.exists=async(s,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===s:!1),this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.logger=wr(t,this.name)}get context(){return _r(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const s={topic:t.topic,request:Fn(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(s)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:s}=ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(s)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ii.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(ii.created,e=>{const t=ii.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(ii.updated,e=>{const t=ii.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(ii.deleted,e=>{const t=ii.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.core.heartbeat.on(Vn.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{ve.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class m5 extends jS{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new Fr.EventEmitter,this.name=VI,this.version=GI,this.cached=[],this.initialized=!1,this.storagePrefix=Li,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>this.expirations.set(s.target,s)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=s=>{try{const o=this.formatTarget(s);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(s,o)=>{this.isInitialized();const c=this.formatTarget(s),l={target:c,expiry:o};this.expirations.set(c,l),this.checkExpiry(c,l),this.events.emit(qr.created,{target:c,expiration:l})},this.get=s=>{this.isInitialized();const o=this.formatTarget(s);return this.getExpiration(o)},this.del=s=>{if(this.isInitialized(),this.has(s)){const o=this.formatTarget(s),c=this.getExpiration(o);this.expirations.delete(o),this.events.emit(qr.deleted,{target:o,expiration:c})}},this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.logger=wr(t,this.name)}get context(){return _r(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return s3(e);if(typeof e=="number")return o3(e);const{message:t}=ae("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(qr.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:s}=ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(s),new Error(s)}return t}checkExpiry(e,t){const{expiry:s}=t;ve.toMiliseconds(s)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(qr.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(Vn.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(qr.created,e=>{const t=qr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(qr.expired,e=>{const t=qr.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(qr.deleted,e=>{const t=qr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class _5 extends MS{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=uu,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async s=>{if(this.verifyDisabled||Bn()||!Kn())return;const o=this.getVerifyUrl(s==null?void 0:s.verifyUrl);this.verifyUrl!==o&&this.removeIframe(),this.verifyUrl=o;try{await this.createIframe()}catch(c){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(c)}if(!this.initialized){this.removeIframe(),this.verifyUrl=zu;try{await this.createIframe()}catch(c){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(c),this.verifyDisabled=!0}}},this.register=async s=>{this.initialized?this.sendPost(s.attestationId):(this.addToQueue(s.attestationId),await this.init())},this.resolve=async s=>{if(this.isDevEnv)return"";const o=this.getVerifyUrl(s==null?void 0:s.verifyUrl);let c;try{c=await this.fetchAttestation(s.attestationId,o)}catch(l){this.logger.info(`failed to resolve attestation: ${s.attestationId} from url: ${o}`),this.logger.info(l),c=await this.fetchAttestation(s.attestationId,zu)}return c},this.fetchAttestation=async(s,o)=>{this.logger.info(`resolving attestation: ${s} from url: ${o}`);const c=this.startAbortTimer(ve.ONE_SECOND*2),l=await fetch(`${o}/attestation/${s}`,{signal:this.abortController.signal});return clearTimeout(c),l.status===200?await l.json():void 0},this.addToQueue=s=>{this.queue.push(s)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(s=>this.sendPost(s)),this.queue=[])},this.sendPost=s=>{var o;try{if(!this.iframe)return;(o=this.iframe.contentWindow)==null||o.postMessage(s,"*"),this.logger.info(`postMessage sent: ${s} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let s;const o=c=>{c.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",o),s())};await Promise.race([new Promise(c=>{if(document.getElementById(uu))return c();window.addEventListener("message",o);const l=document.createElement("iframe");l.id=uu,l.src=`${this.verifyUrl}/${this.projectId}`,l.style.display="none",document.body.append(l),this.iframe=l,s=c}),new Promise((c,l)=>setTimeout(()=>{window.removeEventListener("message",o),l("verify iframe load timeout")},ve.toMiliseconds(ve.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=s=>{let o=s||Ln;return WI.includes(o)||(this.logger.info(`verify url: ${o}, not included in trusted list, assigning default: ${Ln}`),o=Ln),o},this.logger=wr(t,this.name),this.verifyUrl=Ln,this.abortController=new AbortController,this.isDevEnv=rh()&&Y2.IS_VITEST}get context(){return _r(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ve.toMiliseconds(e))}}class w5 extends LS{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=YI,this.registerDeviceToken=async s=>{const{clientId:o,token:c,notificationType:l,enableEncrypted:f=!1}=s,g=`${JI}/${this.projectId}/clients`;await W2(g,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:o,type:l,token:c,always_raw:f})})},this.logger=wr(t,this.context)}}var b5=Object.defineProperty,Cd=Object.getOwnPropertySymbols,E5=Object.prototype.hasOwnProperty,D5=Object.prototype.propertyIsEnumerable,Td=(i,e,t)=>e in i?b5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Rd=(i,e)=>{for(var t in e||(e={}))E5.call(e,t)&&Td(i,t,e[t]);if(Cd)for(var t of Cd(e))D5.call(e,t)&&Td(i,t,e[t]);return i};class hh extends AS{constructor(e){super(e),this.protocol=ig,this.version=wI,this.name=uh,this.events=new Fr.EventEmitter,this.initialized=!1,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||sg,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:ma(_a({level:(e==null?void 0:e.logger)||bI.logger}));this.logger=wr(t,this.name),this.heartbeat=new Vn.HeartBeat,this.crypto=new XI(this,this.logger,e==null?void 0:e.keychain),this.history=new v5(this,this.logger),this.expirer=new m5(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new RD(Rd(Rd({},EI),e==null?void 0:e.storageOptions)),this.relayer=new f5({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new y5(this,this.logger),this.verify=new _5(this.projectId||"",this.logger),this.echoClient=new w5(this.projectId||"",this.logger)}static async init(e){const t=new hh(e);await t.initialize();const s=await t.crypto.getClientId();return await t.storage.setItem(LI,s),t}get context(){return _r(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const S5=hh,og="wc",ag=2,cg="client",lh=`${og}@${ag}:${cg}:`,lu={name:cg,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Nd="WALLETCONNECT_DEEPLINK_CHOICE",I5="proposal",ug="Proposal expired",x5="session",Yo=ve.SEVEN_DAYS,O5="engine",bi={wc_sessionPropose:{req:{ttl:ve.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ve.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ve.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ve.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ve.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ve.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ve.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ve.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ve.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ve.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ve.THIRTY_SECONDS,prompt:!1,tag:1115}}},fu={min:ve.FIVE_MINUTES,max:ve.SEVEN_DAYS},Ei={idle:"IDLE",active:"ACTIVE"},P5="request",A5=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var C5=Object.defineProperty,T5=Object.defineProperties,R5=Object.getOwnPropertyDescriptors,$d=Object.getOwnPropertySymbols,N5=Object.prototype.hasOwnProperty,$5=Object.prototype.propertyIsEnumerable,Ud=(i,e,t)=>e in i?C5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,or=(i,e)=>{for(var t in e||(e={}))N5.call(e,t)&&Ud(i,t,e[t]);if($d)for(var t of $d(e))$5.call(e,t)&&Ud(i,t,e[t]);return i},jn=(i,e)=>T5(i,R5(e));class U5 extends FS{constructor(e){super(e),this.name=O5,this.events=new Vu,this.initialized=!1,this.ignoredPayloadTypes=[un],this.requestQueue={state:Ei.idle,queue:[]},this.sessionRequestQueue={state:Ei.idle,queue:[]},this.requestQueueDelay=ve.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(bi)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ve.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const s=jn(or({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(s);const{pairingTopic:o,requiredNamespaces:c,optionalNamespaces:l,sessionProperties:f,relays:g}=s;let p=o,v,w=!1;if(p&&(w=this.client.core.pairing.pairings.get(p).active),!p||!w){const{topic:O,uri:A}=await this.client.core.pairing.create();p=O,v=A}const E=await this.client.core.crypto.generateKeyPair(),x=bi.wc_sessionPropose.req.ttl||ve.FIVE_MINUTES,I=Or(x),B=or({requiredNamespaces:c,optionalNamespaces:l,relays:g??[{protocol:ng}],proposer:{publicKey:E,metadata:this.client.metadata},expiryTimestamp:I},f&&{sessionProperties:f}),{reject:K,resolve:Z,done:$}=Mn(x,ug);if(this.events.once(Nt("session_connect"),async({error:O,session:A})=>{if(O)K(O);else if(A){A.self.publicKey=E;const C=jn(or({},A),{requiredNamespaces:B.requiredNamespaces,optionalNamespaces:B.optionalNamespaces});await this.client.session.set(A.topic,C),await this.setExpiry(A.topic,A.expiry),p&&await this.client.core.pairing.updateMetadata({topic:p,metadata:A.peer.metadata}),Z(C)}}),!p){const{message:O}=ae("NO_MATCHING_KEY",`connect() pairing topic: ${p}`);throw new Error(O)}const j=await this.sendRequest({topic:p,method:"wc_sessionPropose",params:B,throwOnFailedPublish:!0});return await this.setProposal(j,or({id:j},B)),{uri:v,approval:$}},this.pair=async t=>(await this.isInitialized(),await this.client.core.pairing.pair(t)),this.approve=async t=>{await this.isInitialized(),await this.isValidApprove(t);const{id:s,relayProtocol:o,namespaces:c,sessionProperties:l}=t,f=this.client.proposal.get(s);let{pairingTopic:g,proposer:p,requiredNamespaces:v,optionalNamespaces:w}=f;g=g||"";const E=await this.client.core.crypto.generateKeyPair(),x=p.publicKey,I=await this.client.core.crypto.generateSharedKey(E,x);g&&s&&(await this.client.core.pairing.updateMetadata({topic:g,metadata:p.metadata}),await this.sendResult({id:s,topic:g,result:{relay:{protocol:o??"irn"},responderPublicKey:E}}),await this.client.proposal.delete(s,mt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}));const B=or({relay:{protocol:o??"irn"},namespaces:c,pairingTopic:g,controller:{publicKey:E,metadata:this.client.metadata},expiry:Or(Yo)},l&&{sessionProperties:l});await this.client.core.relayer.subscribe(I);const K=jn(or({},B),{topic:I,requiredNamespaces:v,optionalNamespaces:w,pairingTopic:g,acknowledged:!1,self:B.controller,peer:{publicKey:p.publicKey,metadata:p.metadata},controller:E});await this.client.session.set(I,K);try{await this.sendRequest({topic:I,method:"wc_sessionSettle",params:B,throwOnFailedPublish:!0})}catch(Z){throw this.client.logger.error(Z),this.client.session.delete(I,mt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(I),Z}return await this.setExpiry(I,Or(Yo)),{topic:I,acknowledged:()=>new Promise(Z=>setTimeout(()=>Z(this.client.session.get(I)),500))}},this.reject=async t=>{await this.isInitialized(),await this.isValidReject(t);const{id:s,reason:o}=t,{pairingTopic:c}=this.client.proposal.get(s);c&&(await this.sendError(s,c,o),await this.client.proposal.delete(s,mt("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized(),await this.isValidUpdate(t);const{topic:s,namespaces:o}=t,c=await this.sendRequest({topic:s,method:"wc_sessionUpdate",params:{namespaces:o}}),{done:l,resolve:f,reject:g}=Mn();return this.events.once(Nt("session_update",c),({error:p})=>{p?g(p):f()}),await this.client.session.update(s,{namespaces:o}),{acknowledged:l}},this.extend=async t=>{await this.isInitialized(),await this.isValidExtend(t);const{topic:s}=t,o=await this.sendRequest({topic:s,method:"wc_sessionExtend",params:{}}),{done:c,resolve:l,reject:f}=Mn();return this.events.once(Nt("session_extend",o),({error:g})=>{g?f(g):l()}),await this.setExpiry(s,Or(Yo)),{acknowledged:c}},this.request=async t=>{await this.isInitialized(),await this.isValidRequest(t);const{chainId:s,request:o,topic:c,expiry:l=bi.wc_sessionRequest.req.ttl}=t,f=ah(),{done:g,resolve:p,reject:v}=Mn(l,"Request expired. Please try again.");return this.events.once(Nt("session_request",f),({error:w,result:E})=>{w?v(w):p(E)}),await Promise.all([new Promise(async w=>{await this.sendRequest({clientRpcId:f,topic:c,method:"wc_sessionRequest",params:{request:jn(or({},o),{expiryTimestamp:Or(l)}),chainId:s},expiry:l,throwOnFailedPublish:!0}).catch(E=>v(E)),this.client.events.emit("session_request_sent",{topic:c,request:o,chainId:s,id:f}),w()}),new Promise(async w=>{const E=await c3(this.client.core.storage,Nd);a3({id:f,topic:c,wcDeepLink:E}),w()}),g()]).then(w=>w[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:s,response:o}=t,{id:c}=o;Di(o)?await this.sendResult({id:c,topic:s,result:o.result,throwOnFailedPublish:!0}):Wr(o)&&await this.sendError(c,s,o.error),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized(),await this.isValidPing(t);const{topic:s}=t;if(this.client.session.keys.includes(s)){const o=await this.sendRequest({topic:s,method:"wc_sessionPing",params:{}}),{done:c,resolve:l,reject:f}=Mn();this.events.once(Nt("session_ping",o),({error:g})=>{g?f(g):l()}),await c()}else this.client.core.pairing.pairings.keys.includes(s)&&await this.client.core.pairing.ping({topic:s})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:s,event:o,chainId:c}=t;await this.sendRequest({topic:s,method:"wc_sessionEvent",params:{event:o,chainId:c}})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:s}=t;if(this.client.session.keys.includes(s))await this.sendRequest({topic:s,method:"wc_sessionDelete",params:mt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:s,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(s))await this.client.core.pairing.disconnect({topic:s});else{const{message:o}=ae("MISMATCHED_TOPIC",`Session or pairing topic not found: ${s}`);throw new Error(o)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(s=>x3(s,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const s=this.client.core.pairing.pairings.get(t.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(c=>{var l,f;return((l=c.peerMetadata)==null?void 0:l.url)&&((f=c.peerMetadata)==null?void 0:f.url)===t.peer.metadata.url&&c.topic&&c.topic!==s.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(c=>this.client.core.pairing.disconnect({topic:c.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(s){this.client.logger.error(s)}},this.deleteSession=async t=>{const{topic:s,expirerHasDeleted:o=!1,emitEvent:c=!0,id:l=0}=t,{self:f}=this.client.session.get(s);await this.client.core.relayer.unsubscribe(s),await this.client.session.delete(s,mt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(f.publicKey)&&await this.client.core.crypto.deleteKeyPair(f.publicKey),this.client.core.crypto.keychain.has(s)&&await this.client.core.crypto.deleteSymKey(s),o||this.client.core.expirer.del(s),this.client.core.storage.removeItem(Nd).catch(g=>this.client.logger.warn(g)),this.getPendingSessionRequests().forEach(g=>{g.topic===s&&this.deletePendingSessionRequest(g.id,mt("USER_DISCONNECTED"))}),c&&this.client.events.emit("session_delete",{id:l,topic:s})},this.deleteProposal=async(t,s)=>{await Promise.all([this.client.proposal.delete(t,mt("USER_DISCONNECTED")),s?Promise.resolve():this.client.core.expirer.del(t)])},this.deletePendingSessionRequest=async(t,s,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,s),o?Promise.resolve():this.client.core.expirer.del(t)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(c=>c.id!==t),o&&(this.sessionRequestQueue.state=Ei.idle,this.client.events.emit("session_request_expire",{id:t}))},this.setExpiry=async(t,s)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:s}),this.client.core.expirer.set(t,s)},this.setProposal=async(t,s)=>{await this.client.proposal.set(t,s),this.client.core.expirer.set(t,Or(bi.wc_sessionPropose.req.ttl))},this.setPendingSessionRequest=async t=>{const{id:s,topic:o,params:c,verifyContext:l}=t,f=c.request.expiryTimestamp||Or(bi.wc_sessionRequest.req.ttl);await this.client.pendingRequest.set(s,{id:s,topic:o,params:c,verifyContext:l}),f&&this.client.core.expirer.set(s,f)},this.sendRequest=async t=>{const{topic:s,method:o,params:c,expiry:l,relayRpcId:f,clientRpcId:g,throwOnFailedPublish:p}=t,v=Fn(o,c,g);if(Kn()&&A5.includes(o)){const x=qn(JSON.stringify(v));this.client.core.verify.register({attestationId:x})}const w=await this.client.core.crypto.encode(s,v),E=bi[o].req;return l&&(E.ttl=l),f&&(E.id=f),this.client.core.history.set(s,v),p?(E.internal=jn(or({},E.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,w,E)):this.client.core.relayer.publish(s,w,E).catch(x=>this.client.logger.error(x)),v.id},this.sendResult=async t=>{const{id:s,topic:o,result:c,throwOnFailedPublish:l}=t,f=wa(s,c),g=await this.client.core.crypto.encode(o,f),p=await this.client.core.history.get(o,s),v=bi[p.request.method].res;l?(v.internal=jn(or({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(o,g,v)):this.client.core.relayer.publish(o,g,v).catch(w=>this.client.logger.error(w)),await this.client.core.history.resolve(f)},this.sendError=async(t,s,o)=>{const c=ba(t,o),l=await this.client.core.crypto.encode(s,c),f=await this.client.core.history.get(s,t),g=bi[f.request.method].res;this.client.core.relayer.publish(s,l,g),await this.client.core.history.resolve(c)},this.cleanup=async()=>{const t=[],s=[];this.client.session.getAll().forEach(o=>{let c=!1;Mi(o.expiry)&&(c=!0),this.client.core.crypto.keychain.has(o.topic)||(c=!0),c&&t.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{Mi(o.expiryTimestamp)&&s.push(o.id)}),await Promise.all([...t.map(o=>this.deleteSession({topic:o})),...s.map(o=>this.deleteProposal(o))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Ei.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Ei.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(s=>setTimeout(s,300))}catch(s){this.client.logger.warn(s)}}this.requestQueue.state=Ei.idle},this.processRequest=t=>{const{topic:s,payload:o}=t,c=o.method;switch(c){case"wc_sessionPropose":return this.onSessionProposeRequest(s,o);case"wc_sessionSettle":return this.onSessionSettleRequest(s,o);case"wc_sessionUpdate":return this.onSessionUpdateRequest(s,o);case"wc_sessionExtend":return this.onSessionExtendRequest(s,o);case"wc_sessionPing":return this.onSessionPingRequest(s,o);case"wc_sessionDelete":return this.onSessionDeleteRequest(s,o);case"wc_sessionRequest":return this.onSessionRequest(s,o);case"wc_sessionEvent":return this.onSessionEventRequest(s,o);default:return this.client.logger.info(`Unsupported request method ${c}`)}},this.onRelayEventResponse=async t=>{const{topic:s,payload:o}=t,c=(await this.client.core.history.get(s,o.id)).request.method;switch(c){case"wc_sessionPropose":return this.onSessionProposeResponse(s,o);case"wc_sessionSettle":return this.onSessionSettleResponse(s,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(s,o);case"wc_sessionExtend":return this.onSessionExtendResponse(s,o);case"wc_sessionPing":return this.onSessionPingResponse(s,o);case"wc_sessionRequest":return this.onSessionRequestResponse(s,o);default:return this.client.logger.info(`Unsupported response method ${c}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:s}=t,{message:o}=ae("MISSING_OR_INVALID",`Decoded payload on topic ${s} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.onSessionProposeRequest=async(t,s)=>{const{params:o,id:c}=s;try{this.isValidConnect(or({},s.params));const l=o.expiryTimestamp||Or(bi.wc_sessionPropose.req.ttl),f=or({id:c,pairingTopic:t,expiryTimestamp:l},o);await this.setProposal(c,f);const g=qn(JSON.stringify(s)),p=await this.getVerifyContext(g,f.proposer.metadata);this.client.events.emit("session_proposal",{id:c,params:f,verifyContext:p})}catch(l){await this.sendError(c,t,l),this.client.logger.error(l)}},this.onSessionProposeResponse=async(t,s)=>{const{id:o}=s;if(Di(s)){const{result:c}=s;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:c});const l=this.client.proposal.get(o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:l});const f=l.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:f});const g=c.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:g});const p=await this.client.core.crypto.generateSharedKey(f,g);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:p});const v=await this.client.core.relayer.subscribe(p);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:t})}else Wr(s)&&(await this.client.proposal.delete(o,mt("USER_DISCONNECTED")),this.events.emit(Nt("session_connect"),{error:s.error}))},this.onSessionSettleRequest=async(t,s)=>{const{id:o,params:c}=s;try{this.isValidSessionSettleRequest(c);const{relay:l,controller:f,expiry:g,namespaces:p,sessionProperties:v,pairingTopic:w}=s.params,E=or({topic:t,relay:l,expiry:g,namespaces:p,acknowledged:!0,pairingTopic:w,requiredNamespaces:{},optionalNamespaces:{},controller:f.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:f.publicKey,metadata:f.metadata}},v&&{sessionProperties:v});await this.sendResult({id:s.id,topic:t,result:!0}),this.events.emit(Nt("session_connect"),{session:E}),this.cleanupDuplicatePairings(E)}catch(l){await this.sendError(o,t,l),this.client.logger.error(l)}},this.onSessionSettleResponse=async(t,s)=>{const{id:o}=s;Di(s)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(Nt("session_approve",o),{})):Wr(s)&&(await this.client.session.delete(t,mt("USER_DISCONNECTED")),this.events.emit(Nt("session_approve",o),{error:s.error}))},this.onSessionUpdateRequest=async(t,s)=>{const{params:o,id:c}=s;try{const l=`${t}_session_update`,f=ko.get(l);if(f&&this.isRequestOutOfSync(f,c)){this.client.logger.info(`Discarding out of sync request - ${c}`);return}this.isValidUpdate(or({topic:t},o)),await this.client.session.update(t,{namespaces:o.namespaces}),await this.sendResult({id:c,topic:t,result:!0}),this.client.events.emit("session_update",{id:c,topic:t,params:o}),ko.set(l,c)}catch(l){await this.sendError(c,t,l),this.client.logger.error(l)}},this.isRequestOutOfSync=(t,s)=>parseInt(s.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,s)=>{const{id:o}=s;Di(s)?this.events.emit(Nt("session_update",o),{}):Wr(s)&&this.events.emit(Nt("session_update",o),{error:s.error})},this.onSessionExtendRequest=async(t,s)=>{const{id:o}=s;try{this.isValidExtend({topic:t}),await this.setExpiry(t,Or(Yo)),await this.sendResult({id:o,topic:t,result:!0}),this.client.events.emit("session_extend",{id:o,topic:t})}catch(c){await this.sendError(o,t,c),this.client.logger.error(c)}},this.onSessionExtendResponse=(t,s)=>{const{id:o}=s;Di(s)?this.events.emit(Nt("session_extend",o),{}):Wr(s)&&this.events.emit(Nt("session_extend",o),{error:s.error})},this.onSessionPingRequest=async(t,s)=>{const{id:o}=s;try{this.isValidPing({topic:t}),await this.sendResult({id:o,topic:t,result:!0}),this.client.events.emit("session_ping",{id:o,topic:t})}catch(c){await this.sendError(o,t,c),this.client.logger.error(c)}},this.onSessionPingResponse=(t,s)=>{const{id:o}=s;setTimeout(()=>{Di(s)?this.events.emit(Nt("session_ping",o),{}):Wr(s)&&this.events.emit(Nt("session_ping",o),{error:s.error})},500)},this.onSessionDeleteRequest=async(t,s)=>{const{id:o}=s;try{this.isValidDisconnect({topic:t,reason:s.params}),await Promise.all([new Promise(c=>{this.client.core.relayer.once(Zt.publish,async()=>{c(await this.deleteSession({topic:t,id:o}))})}),this.sendResult({id:o,topic:t,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:mt("USER_DISCONNECTED")})])}catch(c){this.client.logger.error(c)}},this.onSessionRequest=async(t,s)=>{const{id:o,params:c}=s;try{this.isValidRequest(or({topic:t},c));const l=qn(JSON.stringify(Fn("wc_sessionRequest",c,o))),f=this.client.session.get(t),g=await this.getVerifyContext(l,f.peer.metadata),p={id:o,topic:t,params:c,verifyContext:g};await this.setPendingSessionRequest(p),this.addSessionRequestToSessionRequestQueue(p),this.processSessionRequestQueue()}catch(l){await this.sendError(o,t,l),this.client.logger.error(l)}},this.onSessionRequestResponse=(t,s)=>{const{id:o}=s;Di(s)?this.events.emit(Nt("session_request",o),{result:s.result}):Wr(s)&&this.events.emit(Nt("session_request",o),{error:s.error})},this.onSessionEventRequest=async(t,s)=>{const{id:o,params:c}=s;try{const l=`${t}_session_event_${c.event.name}`,f=ko.get(l);if(f&&this.isRequestOutOfSync(f,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidEmit(or({topic:t},c)),this.client.events.emit("session_event",{id:o,topic:t,params:c}),ko.set(l,o)}catch(l){await this.sendError(o,t,l),this.client.logger.error(l)}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Ei.idle,this.processSessionRequestQueue()},ve.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:s})=>{const o=this.client.core.history.pending;o.length>0&&o.filter(c=>c.topic===t&&c.request.method==="wc_sessionRequest").forEach(c=>{this.events.emit(Nt("session_request",c.request.id),{error:s})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Ei.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Ei.active,this.client.events.emit("session_request",t)}catch(s){this.client.logger.error(s)}},this.onPairingCreated=t=>{if(t.active)return;const s=this.client.proposal.getAll().find(o=>o.pairingTopic===t.topic);s&&this.onSessionProposeRequest(t.topic,Fn("wc_sessionPropose",{requiredNamespaces:s.requiredNamespaces,optionalNamespaces:s.optionalNamespaces,relays:s.relays,proposer:s.proposer,sessionProperties:s.sessionProperties},s.id))},this.isValidConnect=async t=>{if(!yr(t)){const{message:g}=ae("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(g)}const{pairingTopic:s,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:f}=t;if(vr(s)||await this.isValidPairingTopic(s),!L3(f)){const{message:g}=ae("MISSING_OR_INVALID",`connect() relays: ${f}`);throw new Error(g)}!vr(o)&&xs(o)!==0&&this.validateNamespaces(o,"requiredNamespaces"),!vr(c)&&xs(c)!==0&&this.validateNamespaces(c,"optionalNamespaces"),vr(l)||this.validateSessionProps(l,"sessionProperties")},this.validateNamespaces=(t,s)=>{const o=M3(t,"connect()",s);if(o)throw new Error(o.message)},this.isValidApprove=async t=>{if(!yr(t))throw new Error(ae("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:s,namespaces:o,relayProtocol:c,sessionProperties:l}=t;await this.isValidProposalId(s);const f=this.client.proposal.get(s),g=tu(o,"approve()");if(g)throw new Error(g.message);const p=Kf(f.requiredNamespaces,o,"approve()");if(p)throw new Error(p.message);if(!Vt(c,!0)){const{message:v}=ae("MISSING_OR_INVALID",`approve() relayProtocol: ${c}`);throw new Error(v)}vr(l)||this.validateSessionProps(l,"sessionProperties")},this.isValidReject=async t=>{if(!yr(t)){const{message:c}=ae("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(c)}const{id:s,reason:o}=t;if(await this.isValidProposalId(s),!F3(o)){const{message:c}=ae("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(c)}},this.isValidSessionSettleRequest=t=>{if(!yr(t)){const{message:p}=ae("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(p)}const{relay:s,controller:o,namespaces:c,expiry:l}=t;if(!xp(s)){const{message:p}=ae("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(p)}const f=T3(o,"onSessionSettleRequest()");if(f)throw new Error(f.message);const g=tu(c,"onSessionSettleRequest()");if(g)throw new Error(g.message);if(Mi(l)){const{message:p}=ae("EXPIRED","onSessionSettleRequest()");throw new Error(p)}},this.isValidUpdate=async t=>{if(!yr(t)){const{message:g}=ae("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(g)}const{topic:s,namespaces:o}=t;await this.isValidSessionTopic(s);const c=this.client.session.get(s),l=tu(o,"update()");if(l)throw new Error(l.message);const f=Kf(c.requiredNamespaces,o,"update()");if(f)throw new Error(f.message)},this.isValidExtend=async t=>{if(!yr(t)){const{message:o}=ae("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(o)}const{topic:s}=t;await this.isValidSessionTopic(s)},this.isValidRequest=async t=>{if(!yr(t)){const{message:g}=ae("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(g)}const{topic:s,request:o,chainId:c,expiry:l}=t;await this.isValidSessionTopic(s);const{namespaces:f}=this.client.session.get(s);if(!Bf(f,c)){const{message:g}=ae("MISSING_OR_INVALID",`request() chainId: ${c}`);throw new Error(g)}if(!z3(o)){const{message:g}=ae("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(g)}if(!K3(f,c,o.method)){const{message:g}=ae("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(g)}if(l&&!W3(l,fu)){const{message:g}=ae("MISSING_OR_INVALID",`request() expiry: ${l}. Expiry must be a number (in seconds) between ${fu.min} and ${fu.max}`);throw new Error(g)}},this.isValidRespond=async t=>{var s;if(!yr(t)){const{message:l}=ae("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(l)}const{topic:o,response:c}=t;try{await this.isValidSessionTopic(o)}catch(l){throw(s=t==null?void 0:t.response)!=null&&s.id&&this.cleanupAfterResponse(t),l}if(!H3(c)){const{message:l}=ae("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(c)}`);throw new Error(l)}},this.isValidPing=async t=>{if(!yr(t)){const{message:o}=ae("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(o)}const{topic:s}=t;await this.isValidSessionOrPairingTopic(s)},this.isValidEmit=async t=>{if(!yr(t)){const{message:f}=ae("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(f)}const{topic:s,event:o,chainId:c}=t;await this.isValidSessionTopic(s);const{namespaces:l}=this.client.session.get(s);if(!Bf(l,c)){const{message:f}=ae("MISSING_OR_INVALID",`emit() chainId: ${c}`);throw new Error(f)}if(!B3(o)){const{message:f}=ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(f)}if(!k3(l,c,o.name)){const{message:f}=ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(f)}},this.isValidDisconnect=async t=>{if(!yr(t)){const{message:o}=ae("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(o)}const{topic:s}=t;await this.isValidSessionOrPairingTopic(s)},this.getVerifyContext=async(t,s)=>{const o={verified:{verifyUrl:s.verifyUrl||Ln,validation:"UNKNOWN",origin:s.url||""}};try{const c=await this.client.core.verify.resolve({attestationId:t,verifyUrl:s.verifyUrl});c&&(o.verified.origin=c.origin,o.verified.isScam=c.isScam,o.verified.validation=c.origin===new URL(s.url).origin?"VALID":"INVALID")}catch(c){this.client.logger.info(c)}return this.client.logger.info(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(t,s)=>{Object.values(t).forEach(o=>{if(!Vt(o,!1)){const{message:c}=ae("MISSING_OR_INVALID",`${s} must be in Record format. Received: ${JSON.stringify(o)}`);throw new Error(c)}})}}async isInitialized(){if(!this.initialized){const{message:e}=ae("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Zt.message,async e=>{const{topic:t,message:s}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(s)))return;const o=await this.client.core.crypto.decode(t,s);try{ch(o)?(this.client.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o})):Ea(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o}),this.client.core.history.delete(t,o.id)):this.onRelayEventUnknownPayload({topic:t,payload:o})}catch(c){this.client.logger.error(c)}})}registerExpirerEvents(){this.client.core.expirer.on(qr.expired,async e=>{const{topic:t,id:s}=Sp(e.target);if(s&&this.client.pendingRequest.keys.includes(s))return await this.deletePendingSessionRequest(s,ae("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):s&&(await this.deleteProposal(s,!0),this.client.events.emit("proposal_expire",{id:s}))})}registerPairingEvents(){this.client.core.pairing.events.on(ws.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!Vt(e,!1)){const{message:t}=ae("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=ae("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!Vt(e,!1)){const{message:t}=ae("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=ae("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=ae("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=ae("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Vt(e,!1)){const{message:t}=ae("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=ae("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!q3(e)){const{message:t}=ae("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=ae("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=ae("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class j5 extends Sa{constructor(e,t){super(e,t,I5,lh),this.core=e,this.logger=t}}let M5=class extends Sa{constructor(e,t){super(e,t,x5,lh),this.core=e,this.logger=t}};class L5 extends Sa{constructor(e,t){super(e,t,P5,lh,s=>s.id),this.core=e,this.logger=t}}let q5=class hg extends qS{constructor(e){super(e),this.protocol=og,this.version=ag,this.name=lu.name,this.events=new Fr.EventEmitter,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.removeAllListeners=s=>this.events.removeAllListeners(s),this.connect=async s=>{try{return await this.engine.connect(s)}catch(o){throw this.logger.error(o.message),o}},this.pair=async s=>{try{return await this.engine.pair(s)}catch(o){throw this.logger.error(o.message),o}},this.approve=async s=>{try{return await this.engine.approve(s)}catch(o){throw this.logger.error(o.message),o}},this.reject=async s=>{try{return await this.engine.reject(s)}catch(o){throw this.logger.error(o.message),o}},this.update=async s=>{try{return await this.engine.update(s)}catch(o){throw this.logger.error(o.message),o}},this.extend=async s=>{try{return await this.engine.extend(s)}catch(o){throw this.logger.error(o.message),o}},this.request=async s=>{try{return await this.engine.request(s)}catch(o){throw this.logger.error(o.message),o}},this.respond=async s=>{try{return await this.engine.respond(s)}catch(o){throw this.logger.error(o.message),o}},this.ping=async s=>{try{return await this.engine.ping(s)}catch(o){throw this.logger.error(o.message),o}},this.emit=async s=>{try{return await this.engine.emit(s)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async s=>{try{return await this.engine.disconnect(s)}catch(o){throw this.logger.error(o.message),o}},this.find=s=>{try{return this.engine.find(s)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(s){throw this.logger.error(s.message),s}},this.name=(e==null?void 0:e.name)||lu.name,this.metadata=(e==null?void 0:e.metadata)||e3();const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:ma(_a({level:(e==null?void 0:e.logger)||lu.logger}));this.core=(e==null?void 0:e.core)||new S5(e),this.logger=wr(t,this.name),this.session=new M5(this.core,this.logger),this.proposal=new j5(this.core,this.logger),this.pendingRequest=new L5(this.core,this.logger),this.engine=new U5(this)}static async init(e){const t=new hg(e);return await t.initialize(),t}get context(){return _r(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var Hu={exports:{}};(function(i,e){var t=typeof self<"u"?self:Yr,s=function(){function c(){this.fetch=!1,this.DOMException=t.DOMException}return c.prototype=t,new c}();(function(c){(function(l){var f={searchParams:"URLSearchParams"in c,iterable:"Symbol"in c&&"iterator"in Symbol,blob:"FileReader"in c&&"Blob"in c&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in c,arrayBuffer:"ArrayBuffer"in c};function g(S){return S&&DataView.prototype.isPrototypeOf(S)}if(f.arrayBuffer)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=ArrayBuffer.isView||function(S){return S&&p.indexOf(Object.prototype.toString.call(S))>-1};function w(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(S))throw new TypeError("Invalid character in header field name");return S.toLowerCase()}function E(S){return typeof S!="string"&&(S=String(S)),S}function x(S){var R={next:function(){var X=S.shift();return{done:X===void 0,value:X}}};return f.iterable&&(R[Symbol.iterator]=function(){return R}),R}function I(S){this.map={},S instanceof I?S.forEach(function(R,X){this.append(X,R)},this):Array.isArray(S)?S.forEach(function(R){this.append(R[0],R[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(R){this.append(R,S[R])},this)}I.prototype.append=function(S,R){S=w(S),R=E(R);var X=this.map[S];this.map[S]=X?X+", "+R:R},I.prototype.delete=function(S){delete this.map[w(S)]},I.prototype.get=function(S){return S=w(S),this.has(S)?this.map[S]:null},I.prototype.has=function(S){return this.map.hasOwnProperty(w(S))},I.prototype.set=function(S,R){this.map[w(S)]=E(R)},I.prototype.forEach=function(S,R){for(var X in this.map)this.map.hasOwnProperty(X)&&S.call(R,this.map[X],X,this)},I.prototype.keys=function(){var S=[];return this.forEach(function(R,X){S.push(X)}),x(S)},I.prototype.values=function(){var S=[];return this.forEach(function(R){S.push(R)}),x(S)},I.prototype.entries=function(){var S=[];return this.forEach(function(R,X){S.push([X,R])}),x(S)},f.iterable&&(I.prototype[Symbol.iterator]=I.prototype.entries);function B(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function K(S){return new Promise(function(R,X){S.onload=function(){R(S.result)},S.onerror=function(){X(S.error)}})}function Z(S){var R=new FileReader,X=K(R);return R.readAsArrayBuffer(S),X}function $(S){var R=new FileReader,X=K(R);return R.readAsText(S),X}function j(S){for(var R=new Uint8Array(S),X=new Array(R.length),J=0;J-1?R:S}function b(S,R){R=R||{};var X=R.body;if(S instanceof b){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,R.headers||(this.headers=new I(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!X&&S._bodyInit!=null&&(X=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new I(R.headers)),this.method=h(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function ee(S){var R=new FormData;return S.trim().split("&").forEach(function(X){if(X){var J=X.split("="),k=J.shift().replace(/\+/g," "),V=J.join("=").replace(/\+/g," ");R.append(decodeURIComponent(k),decodeURIComponent(V))}}),R}function ne(S){var R=new I,X=S.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(J){var k=J.split(":"),V=k.shift().trim();if(V){var te=k.join(":").trim();R.append(V,te)}}),R}A.call(b.prototype);function ue(S,R){R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in R?R.statusText:"OK",this.headers=new I(R.headers),this.url=R.url||"",this._initBody(S)}A.call(ue.prototype),ue.prototype.clone=function(){return new ue(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new I(this.headers),url:this.url})},ue.error=function(){var S=new ue(null,{status:0,statusText:""});return S.type="error",S};var ge=[301,302,303,307,308];ue.redirect=function(S,R){if(ge.indexOf(R)===-1)throw new RangeError("Invalid status code");return new ue(null,{status:R,headers:{location:S}})},l.DOMException=c.DOMException;try{new l.DOMException}catch{l.DOMException=function(R,X){this.message=R,this.name=X;var J=Error(R);this.stack=J.stack},l.DOMException.prototype=Object.create(Error.prototype),l.DOMException.prototype.constructor=l.DOMException}function ye(S,R){return new Promise(function(X,J){var k=new b(S,R);if(k.signal&&k.signal.aborted)return J(new l.DOMException("Aborted","AbortError"));var V=new XMLHttpRequest;function te(){V.abort()}V.onload=function(){var ie={status:V.status,statusText:V.statusText,headers:ne(V.getAllResponseHeaders()||"")};ie.url="responseURL"in V?V.responseURL:ie.headers.get("X-Request-URL");var De="response"in V?V.response:V.responseText;X(new ue(De,ie))},V.onerror=function(){J(new TypeError("Network request failed"))},V.ontimeout=function(){J(new TypeError("Network request failed"))},V.onabort=function(){J(new l.DOMException("Aborted","AbortError"))},V.open(k.method,k.url,!0),k.credentials==="include"?V.withCredentials=!0:k.credentials==="omit"&&(V.withCredentials=!1),"responseType"in V&&f.blob&&(V.responseType="blob"),k.headers.forEach(function(ie,De){V.setRequestHeader(De,ie)}),k.signal&&(k.signal.addEventListener("abort",te),V.onreadystatechange=function(){V.readyState===4&&k.signal.removeEventListener("abort",te)}),V.send(typeof k._bodyInit>"u"?null:k._bodyInit)})}return ye.polyfill=!0,c.fetch||(c.fetch=ye,c.Headers=I,c.Request=b,c.Response=ue),l.Headers=I,l.Request=b,l.Response=ue,l.fetch=ye,Object.defineProperty(l,"__esModule",{value:!0}),l})({})})(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var o=s;e=o.fetch,e.default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,i.exports=e})(Hu,Hu.exports);var F5=Hu.exports;const jd=ca(F5),z5={Accept:"application/json","Content-Type":"application/json"},H5="POST",Md={headers:z5,method:H5},Ld=10;class zi{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new Fr.EventEmitter,this.isAvailable=!1,this.registering=!1,!hd(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const s=an(e),c=await(await jd(this.url,Object.assign(Object.assign({},Md),{body:s}))).json();this.onPayload({data:c})}catch(s){this.onError(e.id,s)}}async register(e=this.url){if(!hd(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((s,o)=>{this.events.once("register_error",c=>{this.resetMaxListeners(),o(c)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));s()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=an({id:1,jsonrpc:"2.0",method:"test",params:[]});await jd(e,Object.assign(Object.assign({},Md),{body:t}))}this.onOpen()}catch(t){const s=this.parseError(t);throw this.events.emit("register_error",s),this.onClose(),s}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?Ms(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const s=this.parseError(t),o=s.message||s.toString(),c=ba(e,o);this.events.emit("payload",c)}parseError(e,t=this.url){return Fp(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Ld&&this.events.setMaxListeners(Ld)}}const qd="error",B5="wss://relay.walletconnect.com",K5="wc",k5="universal_provider",Fd=`${K5}@2:${k5}:`,V5="https://rpc.walletconnect.com/v1/",Ii={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Bu={exports:{}};/** +* @license +* Lodash +* Copyright OpenJS Foundation and other contributors +* Released under MIT license +* Based on Underscore.js 1.8.3 +* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +*/(function(i,e){(function(){var t,s="4.17.21",o=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",f="Invalid `variable` option passed into `_.template`",g="__lodash_hash_undefined__",p=500,v="__lodash_placeholder__",w=1,E=2,x=4,I=1,B=2,K=1,Z=2,$=4,j=8,O=16,A=32,C=64,h=128,b=256,ee=512,ne=30,ue="...",ge=800,ye=16,S=1,R=2,X=3,J=1/0,k=9007199254740991,V=17976931348623157e292,te=NaN,ie=4294967295,De=ie-1,oe=ie>>>1,Se=[["ary",h],["bind",K],["bindKey",Z],["curry",j],["curryRight",O],["flip",ee],["partial",A],["partialRight",C],["rearg",b]],le="[object Arguments]",Ce="[object Array]",z="[object AsyncFunction]",F="[object Boolean]",U="[object Date]",d="[object DOMException]",T="[object Error]",se="[object Function]",he="[object GeneratorFunction]",Ee="[object Map]",He="[object Number]",ke="[object Null]",Me="[object Object]",dt="[object Promise]",pt="[object Proxy]",qe="[object RegExp]",Ie="[object Set]",Ne="[object String]",$e="[object Symbol]",Fe="[object Undefined]",Oe="[object WeakMap]",Ue="[object WeakSet]",be="[object ArrayBuffer]",Pe="[object DataView]",Be="[object Float32Array]",xe="[object Float64Array]",Ve="[object Int8Array]",We="[object Int16Array]",Ze="[object Int32Array]",et="[object Uint8Array]",Je="[object Uint8ClampedArray]",er="[object Uint16Array]",ur="[object Uint32Array]",Jr=/\b__p \+= '';/g,tr=/\b(__p \+=) '' \+/g,oi=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xi=/&(?:amp|lt|gt|quot|#39);/g,Hi=/[&<>"']/g,Et=RegExp(xi.source),gt=RegExp(Hi.source),Dt=/<%-([\s\S]+?)%>/g,St=/<%([\s\S]+?)%>/g,wt=/<%=([\s\S]+?)%>/g,yt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$t=/^\w*$/,Ut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,It=/[\\^$.*+?()[\]{}|]/g,jt=RegExp(It.source),xt=/^\s+/,At=/\s/,Ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,Mt=/,? & /,Lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ia=/[()=,{}\[\]\/\s]/,xa=/\\(\\)?/g,Oa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cr=/\w*$/,Pa=/^[-+]0x[0-9a-f]+$/i,Aa=/^0b[01]+$/i,Ca=/^\[object .+?Constructor\]$/,Ta=/^0o[0-7]+$/i,Ra=/^(?:0|[1-9]\d*)$/,ai=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dn=/($^)/,Na=/['\n\r\u2028\u2029\\]/g,pn="\\ud800-\\udfff",$a="\\u0300-\\u036f",Ua="\\ufe20-\\ufe2f",gn="\\u20d0-\\u20ff",Fs=$a+Ua+gn,zs="\\u2700-\\u27bf",zr="a-z\\xdf-\\xf6\\xf8-\\xff",ja="\\xac\\xb1\\xd7\\xf7",Ma="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",La="\\u2000-\\u206f",qa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Hs="A-Z\\xc0-\\xd6\\xd8-\\xde",Bs="\\ufe0e\\ufe0f",Bi=ja+Ma+La+qa,Gn="['’]",Ki="["+pn+"]",Wn="["+Bi+"]",ki="["+Fs+"]",Ks="\\d+",Fa="["+zs+"]",ks="["+zr+"]",Vs="[^"+pn+Bi+Ks+zs+zr+Hs+"]",yn="\\ud83c[\\udffb-\\udfff]",za="(?:"+ki+"|"+yn+")",Gs="[^"+pn+"]",vn="(?:\\ud83c[\\udde6-\\uddff]){2}",Oi="[\\ud800-\\udbff][\\udc00-\\udfff]",br="["+Hs+"]",Ws="\\u200d",Ys="(?:"+ks+"|"+Vs+")",Qr="(?:"+br+"|"+Vs+")",Js="(?:"+Gn+"(?:d|ll|m|re|s|t|ve))?",Qs="(?:"+Gn+"(?:D|LL|M|RE|S|T|VE))?",Xs=za+"?",Zs="["+Bs+"]?",Ha="(?:"+Ws+"(?:"+[Gs,vn,Oi].join("|")+")"+Zs+Xs+")*",ci="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",eo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",to=Zs+Xs+Ha,mn="(?:"+[Fa,vn,Oi].join("|")+")"+to,Ba="(?:"+[Gs+ki+"?",ki,vn,Oi,Ki].join("|")+")",Yn=RegExp(Gn,"g"),Ka=RegExp(ki,"g"),_n=RegExp(yn+"(?="+yn+")|"+Ba+to,"g"),ro=RegExp([br+"?"+ks+"+"+Js+"(?="+[Wn,br,"$"].join("|")+")",Qr+"+"+Qs+"(?="+[Wn,br+Ys,"$"].join("|")+")",br+"?"+Ys+"+"+Js,br+"+"+Qs,eo,ci,Ks,mn].join("|"),"g"),io=RegExp("["+Ws+pn+Fs+Bs+"]"),Vi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,no=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ka=-1,st={};st[Be]=st[xe]=st[Ve]=st[We]=st[Ze]=st[et]=st[Je]=st[er]=st[ur]=!0,st[le]=st[Ce]=st[be]=st[F]=st[Pe]=st[U]=st[T]=st[se]=st[Ee]=st[He]=st[Me]=st[qe]=st[Ie]=st[Ne]=st[Oe]=!1;var nt={};nt[le]=nt[Ce]=nt[be]=nt[Pe]=nt[F]=nt[U]=nt[Be]=nt[xe]=nt[Ve]=nt[We]=nt[Ze]=nt[Ee]=nt[He]=nt[Me]=nt[qe]=nt[Ie]=nt[Ne]=nt[$e]=nt[et]=nt[Je]=nt[er]=nt[ur]=!0,nt[T]=nt[se]=nt[Oe]=!1;var D={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},M={"&":"&","<":"<",">":">",'"':""","'":"'"},Q={"&":"&","<":"<",">":">",""":'"',"'":"'"},fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,Te=parseInt,lt=typeof ms=="object"&&ms&&ms.Object===Object&&ms,qt=typeof self=="object"&&self&&self.Object===Object&&self,Qe=lt||qt||Function("return this")(),at=e&&!e.nodeType&&e,Ct=at&&!0&&i&&!i.nodeType&&i,hr=Ct&&Ct.exports===at,Ft=hr&<.process,ft=function(){try{var L=Ct&&Ct.require&&Ct.require("util").types;return L||Ft&&Ft.binding&&Ft.binding("util")}catch{}}(),rr=ft&&ft.isArrayBuffer,Hr=ft&&ft.isDate,Tr=ft&&ft.isMap,Xr=ft&&ft.isRegExp,Jn=ft&&ft.isSet,Gi=ft&&ft.isTypedArray;function Bt(L,G,H){switch(H.length){case 0:return L.call(G);case 1:return L.call(G,H[0]);case 2:return L.call(G,H[0],H[1]);case 3:return L.call(G,H[0],H[1],H[2])}return L.apply(G,H)}function dg(L,G,H,de){for(var Ae=-1,tt=L==null?0:L.length;++Ae-1}function Va(L,G,H){for(var de=-1,Ae=L==null?0:L.length;++de-1;);return H}function bh(L,G){for(var H=L.length;H--&&wn(G,L[H],0)>-1;);return H}function Eg(L,G){for(var H=L.length,de=0;H--;)L[H]===G&&++de;return de}var Dg=Ja(D),Sg=Ja(M);function Ig(L){return"\\"+fe[L]}function xg(L,G){return L==null?t:L[G]}function bn(L){return io.test(L)}function Og(L){return Vi.test(L)}function Pg(L){for(var G,H=[];!(G=L.next()).done;)H.push(G.value);return H}function ec(L){var G=-1,H=Array(L.size);return L.forEach(function(de,Ae){H[++G]=[Ae,de]}),H}function Eh(L,G){return function(H){return L(G(H))}}function Ci(L,G){for(var H=-1,de=L.length,Ae=0,tt=[];++H-1}function g0(r,n){var a=this.__data__,u=Do(a,r);return u<0?(++this.size,a.push([r,n])):a[u][1]=n,this}ui.prototype.clear=l0,ui.prototype.delete=f0,ui.prototype.get=d0,ui.prototype.has=p0,ui.prototype.set=g0;function hi(r){var n=-1,a=r==null?0:r.length;for(this.clear();++n=n?r:n)),r}function Ur(r,n,a,u,y,_){var P,N=n&w,q=n&E,W=n&x;if(a&&(P=y?a(r,u,y,_):a(r)),P!==t)return P;if(!bt(r))return r;var Y=Re(r);if(Y){if(P=_y(r),!N)return lr(r,P)}else{var re=Qt(r),ce=re==se||re==he;if(ji(r))return nl(r,N);if(re==Me||re==le||ce&&!y){if(P=q||ce?{}:Dl(r),!N)return q?cy(r,T0(P,r)):ay(r,$h(P,r))}else{if(!nt[re])return y?r:{};P=wy(r,re,N)}}_||(_=new Kr);var pe=_.get(r);if(pe)return pe;_.set(r,P),Xl(r)?r.forEach(function(we){P.add(Ur(we,n,a,we,r,_))}):Jl(r)&&r.forEach(function(we,Ge){P.set(Ge,Ur(we,n,a,Ge,r,_))});var _e=W?q?xc:Ic:q?dr:Kt,ze=Y?t:_e(r);return Rr(ze||r,function(we,Ge){ze&&(Ge=we,we=r[Ge]),is(P,Ge,Ur(we,n,a,Ge,r,_))}),P}function R0(r){var n=Kt(r);return function(a){return Uh(a,r,n)}}function Uh(r,n,a){var u=a.length;if(r==null)return!u;for(r=ct(r);u--;){var y=a[u],_=n[y],P=r[y];if(P===t&&!(y in r)||!_(P))return!1}return!0}function jh(r,n,a){if(typeof r!="function")throw new Nr(l);return hs(function(){r.apply(t,a)},n)}function ns(r,n,a,u){var y=-1,_=so,P=!0,N=r.length,q=[],W=n.length;if(!N)return q;a&&(n=vt(n,Er(a))),u?(_=Va,P=!1):n.length>=o&&(_=Qn,P=!1,n=new Ji(n));e:for(;++yy?0:y+a),u=u===t||u>y?y:Le(u),u<0&&(u+=y),u=a>u?0:ef(u);a0&&a(N)?n>1?Gt(N,n-1,a,u,y):Ai(y,N):u||(y[y.length]=N)}return y}var ac=hl(),qh=hl(!0);function Zr(r,n){return r&&ac(r,n,Kt)}function cc(r,n){return r&&qh(r,n,Kt)}function Io(r,n){return Pi(n,function(a){return gi(r[a])})}function Xi(r,n){n=$i(n,r);for(var a=0,u=n.length;r!=null&&an}function U0(r,n){return r!=null&&it.call(r,n)}function j0(r,n){return r!=null&&n in ct(r)}function M0(r,n,a){return r>=Jt(n,a)&&r=120&&Y.length>=120)?new Ji(P&&Y):t}Y=r[0];var re=-1,ce=N[0];e:for(;++re-1;)N!==r&&yo.call(N,q,1),yo.call(r,q,1);return r}function Jh(r,n){for(var a=r?n.length:0,u=a-1;a--;){var y=n[a];if(a==u||y!==_){var _=y;pi(y)?yo.call(r,y,1):mc(r,y)}}return r}function gc(r,n){return r+_o(Ch()*(n-r+1))}function J0(r,n,a,u){for(var y=-1,_=Ht(mo((n-r)/(a||1)),0),P=H(_);_--;)P[u?_:++y]=r,r+=a;return P}function yc(r,n){var a="";if(!r||n<1||n>k)return a;do n%2&&(a+=r),n=_o(n/2),n&&(r+=r);while(n);return a}function Ke(r,n){return Nc(xl(r,n,pr),r+"")}function Q0(r){return Nh(Rn(r))}function X0(r,n){var a=Rn(r);return jo(a,Qi(n,0,a.length))}function as(r,n,a,u){if(!bt(r))return r;n=$i(n,r);for(var y=-1,_=n.length,P=_-1,N=r;N!=null&&++y<_;){var q=ti(n[y]),W=a;if(q==="__proto__"||q==="constructor"||q==="prototype")return r;if(y!=P){var Y=N[q];W=u?u(Y,q,N):t,W===t&&(W=bt(Y)?Y:pi(n[y+1])?[]:{})}is(N,q,W),N=N[q]}return r}var Qh=wo?function(r,n){return wo.set(r,n),r}:pr,Z0=vo?function(r,n){return vo(r,"toString",{configurable:!0,enumerable:!1,value:Bc(n),writable:!0})}:pr;function ey(r){return jo(Rn(r))}function jr(r,n,a){var u=-1,y=r.length;n<0&&(n=-n>y?0:y+n),a=a>y?y:a,a<0&&(a+=y),y=n>a?0:a-n>>>0,n>>>=0;for(var _=H(y);++u>>1,P=r[_];P!==null&&!Sr(P)&&(a?P<=n:P=o){var W=n?null:fy(r);if(W)return ao(W);P=!1,y=Qn,q=new Ji}else q=n?[]:N;e:for(;++u<_;){var Y=r[u],re=n?n(Y):Y;if(Y=a||Y!==0?Y:0,P&&re===re){for(var ce=q.length;ce--;)if(q[ce]===re)continue e;n&&q.push(re),N.push(Y)}else y(q,re,a)||(q!==N&&q.push(re),N.push(Y))}return N}function mc(r,n){return n=$i(n,r),r=Ol(r,n),r==null||delete r[ti(Mr(n))]}function el(r,n,a,u){return as(r,n,a(Xi(r,n)),u)}function Po(r,n,a,u){for(var y=r.length,_=u?y:-1;(u?_--:++_=u?r:jr(r,n,a)}var il=Bg||function(r){return Qe.clearTimeout(r)};function nl(r,n){if(n)return r.slice();var a=r.length,u=Ih?Ih(a):new r.constructor(a);return r.copy(u),u}function Ec(r){var n=new r.constructor(r.byteLength);return new po(n).set(new po(r)),n}function iy(r,n){var a=n?Ec(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}function ny(r){var n=new r.constructor(r.source,Cr.exec(r));return n.lastIndex=r.lastIndex,n}function sy(r){return rs?ct(rs.call(r)):{}}function sl(r,n){var a=n?Ec(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}function ol(r,n){if(r!==n){var a=r!==t,u=r===null,y=r===r,_=Sr(r),P=n!==t,N=n===null,q=n===n,W=Sr(n);if(!N&&!W&&!_&&r>n||_&&P&&q&&!N&&!W||u&&P&&q||!a&&q||!y)return 1;if(!u&&!_&&!W&&r=N)return q;var W=a[u];return q*(W=="desc"?-1:1)}}return r.index-n.index}function al(r,n,a,u){for(var y=-1,_=r.length,P=a.length,N=-1,q=n.length,W=Ht(_-P,0),Y=H(q+W),re=!u;++N1?a[y-1]:t,P=y>2?a[2]:t;for(_=r.length>3&&typeof _=="function"?(y--,_):t,P&&nr(a[0],a[1],P)&&(_=y<3?t:_,y=1),n=ct(n);++u-1?y[_?n[P]:P]:t}}function dl(r){return di(function(n){var a=n.length,u=a,y=$r.prototype.thru;for(r&&n.reverse();u--;){var _=n[u];if(typeof _!="function")throw new Nr(l);if(y&&!P&&$o(_)=="wrapper")var P=new $r([],!0)}for(u=P?u:a;++u1&&Xe.reverse(),Y&&qN))return!1;var W=_.get(r),Y=_.get(n);if(W&&Y)return W==n&&Y==r;var re=-1,ce=!0,pe=a&B?new Ji:t;for(_.set(r,n),_.set(n,r);++re1?"& ":"")+n[u],n=n.join(a>2?", ":" "),r.replace(Ot,`{ +/* [wrapped with `+n+`] */ +`)}function Ey(r){return Re(r)||tn(r)||!!(Ph&&r&&r[Ph])}function pi(r,n){var a=typeof r;return n=n??k,!!n&&(a=="number"||a!="symbol"&&Ra.test(r))&&r>-1&&r%1==0&&r0){if(++n>=ge)return arguments[0]}else n=0;return r.apply(t,arguments)}}function jo(r,n){var a=-1,u=r.length,y=u-1;for(n=n===t?u:n;++a1?r[n-1]:t;return a=typeof a=="function"?(r.pop(),a):t,Ll(r,a)});function ql(r){var n=m(r);return n.__chain__=!0,n}function Nv(r,n){return n(r),r}function Mo(r,n){return n(r)}var $v=di(function(r){var n=r.length,a=n?r[0]:0,u=this.__wrapped__,y=function(_){return oc(_,r)};return n>1||this.__actions__.length||!(u instanceof Ye)||!pi(a)?this.thru(y):(u=u.slice(a,+a+(n?1:0)),u.__actions__.push({func:Mo,args:[y],thisArg:t}),new $r(u,this.__chain__).thru(function(_){return n&&!_.length&&_.push(t),_}))});function Uv(){return ql(this)}function jv(){return new $r(this.value(),this.__chain__)}function Mv(){this.__values__===t&&(this.__values__=Zl(this.value()));var r=this.__index__>=this.__values__.length,n=r?t:this.__values__[this.__index__++];return{done:r,value:n}}function Lv(){return this}function qv(r){for(var n,a=this;a instanceof Eo;){var u=Rl(a);u.__index__=0,u.__values__=t,n?y.__wrapped__=u:n=u;var y=u;a=a.__wrapped__}return y.__wrapped__=r,n}function Fv(){var r=this.__wrapped__;if(r instanceof Ye){var n=r;return this.__actions__.length&&(n=new Ye(this)),n=n.reverse(),n.__actions__.push({func:Mo,args:[$c],thisArg:t}),new $r(n,this.__chain__)}return this.thru($c)}function zv(){return tl(this.__wrapped__,this.__actions__)}var Hv=Ao(function(r,n,a){it.call(r,a)?++r[a]:li(r,a,1)});function Bv(r,n,a){var u=Re(r)?ph:N0;return a&&nr(r,n,a)&&(n=t),u(r,me(n,3))}function Kv(r,n){var a=Re(r)?Pi:Lh;return a(r,me(n,3))}var kv=fl(Nl),Vv=fl($l);function Gv(r,n){return Gt(Lo(r,n),1)}function Wv(r,n){return Gt(Lo(r,n),J)}function Yv(r,n,a){return a=a===t?1:Le(a),Gt(Lo(r,n),a)}function Fl(r,n){var a=Re(r)?Rr:Ri;return a(r,me(n,3))}function zl(r,n){var a=Re(r)?pg:Mh;return a(r,me(n,3))}var Jv=Ao(function(r,n,a){it.call(r,a)?r[a].push(n):li(r,a,[n])});function Qv(r,n,a,u){r=fr(r)?r:Rn(r),a=a&&!u?Le(a):0;var y=r.length;return a<0&&(a=Ht(y+a,0)),Bo(r)?a<=y&&r.indexOf(n,a)>-1:!!y&&wn(r,n,a)>-1}var Xv=Ke(function(r,n,a){var u=-1,y=typeof n=="function",_=fr(r)?H(r.length):[];return Ri(r,function(P){_[++u]=y?Bt(n,P,a):ss(P,n,a)}),_}),Zv=Ao(function(r,n,a){li(r,a,n)});function Lo(r,n){var a=Re(r)?vt:Kh;return a(r,me(n,3))}function em(r,n,a,u){return r==null?[]:(Re(n)||(n=n==null?[]:[n]),a=u?t:a,Re(a)||(a=a==null?[]:[a]),Wh(r,n,a))}var tm=Ao(function(r,n,a){r[a?0:1].push(n)},function(){return[[],[]]});function rm(r,n,a){var u=Re(r)?Ga:mh,y=arguments.length<3;return u(r,me(n,4),a,y,Ri)}function im(r,n,a){var u=Re(r)?gg:mh,y=arguments.length<3;return u(r,me(n,4),a,y,Mh)}function nm(r,n){var a=Re(r)?Pi:Lh;return a(r,zo(me(n,3)))}function sm(r){var n=Re(r)?Nh:Q0;return n(r)}function om(r,n,a){(a?nr(r,n,a):n===t)?n=1:n=Le(n);var u=Re(r)?P0:X0;return u(r,n)}function am(r){var n=Re(r)?A0:ey;return n(r)}function cm(r){if(r==null)return 0;if(fr(r))return Bo(r)?En(r):r.length;var n=Qt(r);return n==Ee||n==Ie?r.size:fc(r).length}function um(r,n,a){var u=Re(r)?Wa:ty;return a&&nr(r,n,a)&&(n=t),u(r,me(n,3))}var hm=Ke(function(r,n){if(r==null)return[];var a=n.length;return a>1&&nr(r,n[0],n[1])?n=[]:a>2&&nr(n[0],n[1],n[2])&&(n=[n[0]]),Wh(r,Gt(n,1),[])}),qo=Kg||function(){return Qe.Date.now()};function lm(r,n){if(typeof n!="function")throw new Nr(l);return r=Le(r),function(){if(--r<1)return n.apply(this,arguments)}}function Hl(r,n,a){return n=a?t:n,n=r&&n==null?r.length:n,fi(r,h,t,t,t,t,n)}function Bl(r,n){var a;if(typeof n!="function")throw new Nr(l);return r=Le(r),function(){return--r>0&&(a=n.apply(this,arguments)),r<=1&&(n=t),a}}var jc=Ke(function(r,n,a){var u=K;if(a.length){var y=Ci(a,Cn(jc));u|=A}return fi(r,u,n,a,y)}),Kl=Ke(function(r,n,a){var u=K|Z;if(a.length){var y=Ci(a,Cn(Kl));u|=A}return fi(n,u,r,a,y)});function kl(r,n,a){n=a?t:n;var u=fi(r,j,t,t,t,t,t,n);return u.placeholder=kl.placeholder,u}function Vl(r,n,a){n=a?t:n;var u=fi(r,O,t,t,t,t,t,n);return u.placeholder=Vl.placeholder,u}function Gl(r,n,a){var u,y,_,P,N,q,W=0,Y=!1,re=!1,ce=!0;if(typeof r!="function")throw new Nr(l);n=Lr(n)||0,bt(a)&&(Y=!!a.leading,re="maxWait"in a,_=re?Ht(Lr(a.maxWait)||0,n):_,ce="trailing"in a?!!a.trailing:ce);function pe(Rt){var Vr=u,vi=y;return u=y=t,W=Rt,P=r.apply(vi,Vr),P}function _e(Rt){return W=Rt,N=hs(Ge,n),Y?pe(Rt):P}function ze(Rt){var Vr=Rt-q,vi=Rt-W,df=n-Vr;return re?Jt(df,_-vi):df}function we(Rt){var Vr=Rt-q,vi=Rt-W;return q===t||Vr>=n||Vr<0||re&&vi>=_}function Ge(){var Rt=qo();if(we(Rt))return Xe(Rt);N=hs(Ge,ze(Rt))}function Xe(Rt){return N=t,ce&&u?pe(Rt):(u=y=t,P)}function Ir(){N!==t&&il(N),W=0,u=q=y=N=t}function sr(){return N===t?P:Xe(qo())}function xr(){var Rt=qo(),Vr=we(Rt);if(u=arguments,y=this,q=Rt,Vr){if(N===t)return _e(q);if(re)return il(N),N=hs(Ge,n),pe(q)}return N===t&&(N=hs(Ge,n)),P}return xr.cancel=Ir,xr.flush=sr,xr}var fm=Ke(function(r,n){return jh(r,1,n)}),dm=Ke(function(r,n,a){return jh(r,Lr(n)||0,a)});function pm(r){return fi(r,ee)}function Fo(r,n){if(typeof r!="function"||n!=null&&typeof n!="function")throw new Nr(l);var a=function(){var u=arguments,y=n?n.apply(this,u):u[0],_=a.cache;if(_.has(y))return _.get(y);var P=r.apply(this,u);return a.cache=_.set(y,P)||_,P};return a.cache=new(Fo.Cache||hi),a}Fo.Cache=hi;function zo(r){if(typeof r!="function")throw new Nr(l);return function(){var n=arguments;switch(n.length){case 0:return!r.call(this);case 1:return!r.call(this,n[0]);case 2:return!r.call(this,n[0],n[1]);case 3:return!r.call(this,n[0],n[1],n[2])}return!r.apply(this,n)}}function gm(r){return Bl(2,r)}var ym=ry(function(r,n){n=n.length==1&&Re(n[0])?vt(n[0],Er(me())):vt(Gt(n,1),Er(me()));var a=n.length;return Ke(function(u){for(var y=-1,_=Jt(u.length,a);++y<_;)u[y]=n[y].call(this,u[y]);return Bt(r,this,u)})}),Mc=Ke(function(r,n){var a=Ci(n,Cn(Mc));return fi(r,A,t,n,a)}),Wl=Ke(function(r,n){var a=Ci(n,Cn(Wl));return fi(r,C,t,n,a)}),vm=di(function(r,n){return fi(r,b,t,t,t,n)});function mm(r,n){if(typeof r!="function")throw new Nr(l);return n=n===t?n:Le(n),Ke(r,n)}function _m(r,n){if(typeof r!="function")throw new Nr(l);return n=n==null?0:Ht(Le(n),0),Ke(function(a){var u=a[n],y=Ui(a,0,n);return u&&Ai(y,u),Bt(r,this,y)})}function wm(r,n,a){var u=!0,y=!0;if(typeof r!="function")throw new Nr(l);return bt(a)&&(u="leading"in a?!!a.leading:u,y="trailing"in a?!!a.trailing:y),Gl(r,n,{leading:u,maxWait:n,trailing:y})}function bm(r){return Hl(r,1)}function Em(r,n){return Mc(bc(n),r)}function Dm(){if(!arguments.length)return[];var r=arguments[0];return Re(r)?r:[r]}function Sm(r){return Ur(r,x)}function Im(r,n){return n=typeof n=="function"?n:t,Ur(r,x,n)}function xm(r){return Ur(r,w|x)}function Om(r,n){return n=typeof n=="function"?n:t,Ur(r,w|x,n)}function Pm(r,n){return n==null||Uh(r,n,Kt(n))}function kr(r,n){return r===n||r!==r&&n!==n}var Am=No(uc),Cm=No(function(r,n){return r>=n}),tn=zh(function(){return arguments}())?zh:function(r){return Pt(r)&&it.call(r,"callee")&&!Oh.call(r,"callee")},Re=H.isArray,Tm=rr?Er(rr):q0;function fr(r){return r!=null&&Ho(r.length)&&!gi(r)}function Tt(r){return Pt(r)&&fr(r)}function Rm(r){return r===!0||r===!1||Pt(r)&&ir(r)==F}var ji=Vg||Wc,Nm=Hr?Er(Hr):F0;function $m(r){return Pt(r)&&r.nodeType===1&&!ls(r)}function Um(r){if(r==null)return!0;if(fr(r)&&(Re(r)||typeof r=="string"||typeof r.splice=="function"||ji(r)||Tn(r)||tn(r)))return!r.length;var n=Qt(r);if(n==Ee||n==Ie)return!r.size;if(us(r))return!fc(r).length;for(var a in r)if(it.call(r,a))return!1;return!0}function jm(r,n){return os(r,n)}function Mm(r,n,a){a=typeof a=="function"?a:t;var u=a?a(r,n):t;return u===t?os(r,n,t,a):!!u}function Lc(r){if(!Pt(r))return!1;var n=ir(r);return n==T||n==d||typeof r.message=="string"&&typeof r.name=="string"&&!ls(r)}function Lm(r){return typeof r=="number"&&Ah(r)}function gi(r){if(!bt(r))return!1;var n=ir(r);return n==se||n==he||n==z||n==pt}function Yl(r){return typeof r=="number"&&r==Le(r)}function Ho(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=k}function bt(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}function Pt(r){return r!=null&&typeof r=="object"}var Jl=Tr?Er(Tr):H0;function qm(r,n){return r===n||lc(r,n,Pc(n))}function Fm(r,n,a){return a=typeof a=="function"?a:t,lc(r,n,Pc(n),a)}function zm(r){return Ql(r)&&r!=+r}function Hm(r){if(Iy(r))throw new Ae(c);return Hh(r)}function Bm(r){return r===null}function Km(r){return r==null}function Ql(r){return typeof r=="number"||Pt(r)&&ir(r)==He}function ls(r){if(!Pt(r)||ir(r)!=Me)return!1;var n=go(r);if(n===null)return!0;var a=it.call(n,"constructor")&&n.constructor;return typeof a=="function"&&a instanceof a&&ho.call(a)==Fg}var qc=Xr?Er(Xr):B0;function km(r){return Yl(r)&&r>=-k&&r<=k}var Xl=Jn?Er(Jn):K0;function Bo(r){return typeof r=="string"||!Re(r)&&Pt(r)&&ir(r)==Ne}function Sr(r){return typeof r=="symbol"||Pt(r)&&ir(r)==$e}var Tn=Gi?Er(Gi):k0;function Vm(r){return r===t}function Gm(r){return Pt(r)&&Qt(r)==Oe}function Wm(r){return Pt(r)&&ir(r)==Ue}var Ym=No(dc),Jm=No(function(r,n){return r<=n});function Zl(r){if(!r)return[];if(fr(r))return Bo(r)?Br(r):lr(r);if(Xn&&r[Xn])return Pg(r[Xn]());var n=Qt(r),a=n==Ee?ec:n==Ie?ao:Rn;return a(r)}function yi(r){if(!r)return r===0?r:0;if(r=Lr(r),r===J||r===-J){var n=r<0?-1:1;return n*V}return r===r?r:0}function Le(r){var n=yi(r),a=n%1;return n===n?a?n-a:n:0}function ef(r){return r?Qi(Le(r),0,ie):0}function Lr(r){if(typeof r=="number")return r;if(Sr(r))return te;if(bt(r)){var n=typeof r.valueOf=="function"?r.valueOf():r;r=bt(n)?n+"":n}if(typeof r!="string")return r===0?r:+r;r=_h(r);var a=Aa.test(r);return a||Ta.test(r)?Te(r.slice(2),a?2:8):Pa.test(r)?te:+r}function tf(r){return ei(r,dr(r))}function Qm(r){return r?Qi(Le(r),-k,k):r===0?r:0}function rt(r){return r==null?"":Dr(r)}var Xm=Pn(function(r,n){if(us(n)||fr(n)){ei(n,Kt(n),r);return}for(var a in n)it.call(n,a)&&is(r,a,n[a])}),rf=Pn(function(r,n){ei(n,dr(n),r)}),Ko=Pn(function(r,n,a,u){ei(n,dr(n),r,u)}),Zm=Pn(function(r,n,a,u){ei(n,Kt(n),r,u)}),e_=di(oc);function t_(r,n){var a=On(r);return n==null?a:$h(a,n)}var r_=Ke(function(r,n){r=ct(r);var a=-1,u=n.length,y=u>2?n[2]:t;for(y&&nr(n[0],n[1],y)&&(u=1);++a1),_}),ei(r,xc(r),a),u&&(a=Ur(a,w|E|x,dy));for(var y=n.length;y--;)mc(a,n[y]);return a});function w_(r,n){return sf(r,zo(me(n)))}var b_=di(function(r,n){return r==null?{}:W0(r,n)});function sf(r,n){if(r==null)return{};var a=vt(xc(r),function(u){return[u]});return n=me(n),Yh(r,a,function(u,y){return n(u,y[0])})}function E_(r,n,a){n=$i(n,r);var u=-1,y=n.length;for(y||(y=1,r=t);++un){var u=r;r=n,n=u}if(a||r%1||n%1){var y=Ch();return Jt(r+y*(n-r+ot("1e-"+((y+"").length-1))),n)}return gc(r,n)}var N_=An(function(r,n,a){return n=n.toLowerCase(),r+(a?cf(n):n)});function cf(r){return Hc(rt(r).toLowerCase())}function uf(r){return r=rt(r),r&&r.replace(ai,Dg).replace(Ka,"")}function $_(r,n,a){r=rt(r),n=Dr(n);var u=r.length;a=a===t?u:Qi(Le(a),0,u);var y=a;return a-=n.length,a>=0&&r.slice(a,y)==n}function U_(r){return r=rt(r),r&>.test(r)?r.replace(Hi,Sg):r}function j_(r){return r=rt(r),r&&jt.test(r)?r.replace(It,"\\$&"):r}var M_=An(function(r,n,a){return r+(a?"-":"")+n.toLowerCase()}),L_=An(function(r,n,a){return r+(a?" ":"")+n.toLowerCase()}),q_=ll("toLowerCase");function F_(r,n,a){r=rt(r),n=Le(n);var u=n?En(r):0;if(!n||u>=n)return r;var y=(n-u)/2;return Ro(_o(y),a)+r+Ro(mo(y),a)}function z_(r,n,a){r=rt(r),n=Le(n);var u=n?En(r):0;return n&&u>>0,a?(r=rt(r),r&&(typeof n=="string"||n!=null&&!qc(n))&&(n=Dr(n),!n&&bn(r))?Ui(Br(r),0,a):r.split(n,a)):[]}var W_=An(function(r,n,a){return r+(a?" ":"")+Hc(n)});function Y_(r,n,a){return r=rt(r),a=a==null?0:Qi(Le(a),0,r.length),n=Dr(n),r.slice(a,a+n.length)==n}function J_(r,n,a){var u=m.templateSettings;a&&nr(r,n,a)&&(n=t),r=rt(r),n=Ko({},n,u,ml);var y=Ko({},n.imports,u.imports,ml),_=Kt(y),P=Za(y,_),N,q,W=0,Y=n.interpolate||dn,re="__p += '",ce=tc((n.escape||dn).source+"|"+Y.source+"|"+(Y===wt?Oa:dn).source+"|"+(n.evaluate||dn).source+"|$","g"),pe="//# sourceURL="+(it.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ka+"]")+` +`;r.replace(ce,function(we,Ge,Xe,Ir,sr,xr){return Xe||(Xe=Ir),re+=r.slice(W,xr).replace(Na,Ig),Ge&&(N=!0,re+=`' + +__e(`+Ge+`) + +'`),sr&&(q=!0,re+=`'; +`+sr+`; +__p += '`),Xe&&(re+=`' + +((__t = (`+Xe+`)) == null ? '' : __t) + +'`),W=xr+we.length,we}),re+=`'; +`;var _e=it.call(n,"variable")&&n.variable;if(!_e)re=`with (obj) { +`+re+` +} +`;else if(Ia.test(_e))throw new Ae(f);re=(q?re.replace(Jr,""):re).replace(tr,"$1").replace(oi,"$1;"),re="function("+(_e||"obj")+`) { +`+(_e?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(N?", __e = _.escape":"")+(q?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+re+`return __p +}`;var ze=lf(function(){return tt(_,pe+"return "+re).apply(t,P)});if(ze.source=re,Lc(ze))throw ze;return ze}function Q_(r){return rt(r).toLowerCase()}function X_(r){return rt(r).toUpperCase()}function Z_(r,n,a){if(r=rt(r),r&&(a||n===t))return _h(r);if(!r||!(n=Dr(n)))return r;var u=Br(r),y=Br(n),_=wh(u,y),P=bh(u,y)+1;return Ui(u,_,P).join("")}function ew(r,n,a){if(r=rt(r),r&&(a||n===t))return r.slice(0,Dh(r)+1);if(!r||!(n=Dr(n)))return r;var u=Br(r),y=bh(u,Br(n))+1;return Ui(u,0,y).join("")}function tw(r,n,a){if(r=rt(r),r&&(a||n===t))return r.replace(xt,"");if(!r||!(n=Dr(n)))return r;var u=Br(r),y=wh(u,Br(n));return Ui(u,y).join("")}function rw(r,n){var a=ne,u=ue;if(bt(n)){var y="separator"in n?n.separator:y;a="length"in n?Le(n.length):a,u="omission"in n?Dr(n.omission):u}r=rt(r);var _=r.length;if(bn(r)){var P=Br(r);_=P.length}if(a>=_)return r;var N=a-En(u);if(N<1)return u;var q=P?Ui(P,0,N).join(""):r.slice(0,N);if(y===t)return q+u;if(P&&(N+=q.length-N),qc(y)){if(r.slice(N).search(y)){var W,Y=q;for(y.global||(y=tc(y.source,rt(Cr.exec(y))+"g")),y.lastIndex=0;W=y.exec(Y);)var re=W.index;q=q.slice(0,re===t?N:re)}}else if(r.indexOf(Dr(y),N)!=N){var ce=q.lastIndexOf(y);ce>-1&&(q=q.slice(0,ce))}return q+u}function iw(r){return r=rt(r),r&&Et.test(r)?r.replace(xi,Rg):r}var nw=An(function(r,n,a){return r+(a?" ":"")+n.toUpperCase()}),Hc=ll("toUpperCase");function hf(r,n,a){return r=rt(r),n=a?t:n,n===t?Og(r)?Ug(r):mg(r):r.match(n)||[]}var lf=Ke(function(r,n){try{return Bt(r,t,n)}catch(a){return Lc(a)?a:new Ae(a)}}),sw=di(function(r,n){return Rr(n,function(a){a=ti(a),li(r,a,jc(r[a],r))}),r});function ow(r){var n=r==null?0:r.length,a=me();return r=n?vt(r,function(u){if(typeof u[1]!="function")throw new Nr(l);return[a(u[0]),u[1]]}):[],Ke(function(u){for(var y=-1;++yk)return[];var a=ie,u=Jt(r,ie);n=me(n),r-=ie;for(var y=Xa(u,n);++a0||n<0)?new Ye(a):(r<0?a=a.takeRight(-r):r&&(a=a.drop(r)),n!==t&&(n=Le(n),a=n<0?a.dropRight(-n):a.take(n-r)),a)},Ye.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},Ye.prototype.toArray=function(){return this.take(ie)},Zr(Ye.prototype,function(r,n){var a=/^(?:filter|find|map|reject)|While$/.test(n),u=/^(?:head|last)$/.test(n),y=m[u?"take"+(n=="last"?"Right":""):n],_=u||/^find/.test(n);y&&(m.prototype[n]=function(){var P=this.__wrapped__,N=u?[1]:arguments,q=P instanceof Ye,W=N[0],Y=q||Re(P),re=function(Ge){var Xe=y.apply(m,Ai([Ge],N));return u&&ce?Xe[0]:Xe};Y&&a&&typeof W=="function"&&W.length!=1&&(q=Y=!1);var ce=this.__chain__,pe=!!this.__actions__.length,_e=_&&!ce,ze=q&&!pe;if(!_&&Y){P=ze?P:new Ye(this);var we=r.apply(P,N);return we.__actions__.push({func:Mo,args:[re],thisArg:t}),new $r(we,ce)}return _e&&ze?r.apply(this,N):(we=this.thru(re),_e?u?we.value()[0]:we.value():we)})}),Rr(["pop","push","shift","sort","splice","unshift"],function(r){var n=co[r],a=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",u=/^(?:pop|shift)$/.test(r);m.prototype[r]=function(){var y=arguments;if(u&&!this.__chain__){var _=this.value();return n.apply(Re(_)?_:[],y)}return this[a](function(P){return n.apply(Re(P)?P:[],y)})}}),Zr(Ye.prototype,function(r,n){var a=m[n];if(a){var u=a.name+"";it.call(xn,u)||(xn[u]=[]),xn[u].push({name:n,func:a})}}),xn[Co(t,Z).name]=[{name:"wrapper",func:t}],Ye.prototype.clone=i0,Ye.prototype.reverse=n0,Ye.prototype.value=s0,m.prototype.at=$v,m.prototype.chain=Uv,m.prototype.commit=jv,m.prototype.next=Mv,m.prototype.plant=qv,m.prototype.reverse=Fv,m.prototype.toJSON=m.prototype.valueOf=m.prototype.value=zv,m.prototype.first=m.prototype.head,Xn&&(m.prototype[Xn]=Lv),m},Dn=jg();Ct?((Ct.exports=Dn)._=Dn,at._=Dn):Qe._=Dn}).call(ms)})(Bu,Bu.exports);var G5=Object.defineProperty,W5=Object.defineProperties,Y5=Object.getOwnPropertyDescriptors,zd=Object.getOwnPropertySymbols,J5=Object.prototype.hasOwnProperty,Q5=Object.prototype.propertyIsEnumerable,Hd=(i,e,t)=>e in i?G5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Jo=(i,e)=>{for(var t in e||(e={}))J5.call(e,t)&&Hd(i,t,e[t]);if(zd)for(var t of zd(e))Q5.call(e,t)&&Hd(i,t,e[t]);return i},X5=(i,e)=>W5(i,Y5(e));function qi(i,e,t){var s;const o=jE(i);return((s=e.rpcMap)==null?void 0:s[o.reference])||`${V5}?chainId=${o.namespace}:${o.reference}&projectId=${t}`}function fn(i){return i.includes(":")?i.split(":")[1]:i}function lg(i){return i.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function Z5(i,e){const t=Object.keys(e.namespaces).filter(o=>o.includes(i));if(!t.length)return[];const s=[];return t.forEach(o=>{const c=e.namespaces[o].accounts;s.push(...c)}),s}function Bd(i={},e={}){const t=Kd(i),s=Kd(e);return Bu.exports.merge(t,s)}function Kd(i){var e,t,s,o;const c={};if(!xs(i))return c;for(const[l,f]of Object.entries(i)){const g=ih(l)?[l]:f.chains,p=f.methods||[],v=f.events||[],w=f.rpcMap||{},E=_s(l);c[E]=X5(Jo(Jo({},c[E]),f),{chains:eu(g,(e=c[E])==null?void 0:e.chains),methods:eu(p,(t=c[E])==null?void 0:t.methods),events:eu(v,(s=c[E])==null?void 0:s.events),rpcMap:Jo(Jo({},w),(o=c[E])==null?void 0:o.rpcMap)})}return c}function ex(i){return i.includes(":")?i.split(":")[2]:i}function tx(i){const e={};for(const[t,s]of Object.entries(i)){const o=s.methods||[],c=s.events||[],l=s.accounts||[],f=ih(t)?[t]:s.chains?s.chains:lg(s.accounts);e[t]={chains:f,methods:o,events:c,accounts:l}}return e}function du(i){return typeof i=="number"?i:i.includes("0x")?parseInt(i,16):(i=i.includes(":")?i.split(":")[1]:i,isNaN(Number(i))?i:Number(i))}const fg={},_t=i=>fg[i],pu=(i,e)=>{fg[i]=e};class rx{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=fn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class ix{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const s=t||qi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=parseInt(fn(t));e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,s;let o=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const c=parseInt(o,16);if(this.isChainApproved(c))this.setDefaultChain(`${c}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:o}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${c}`);else throw new Error(`Failed to switch to chain 'eip155:${c}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class nx{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=fn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class sx{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=fn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class ox{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const s=this.getCardanoRPCUrl(t),o=fn(t);e[o]=this.createHttpProvider(o,s)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||this.getCardanoRPCUrl(e);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class ax{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=fn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class cx{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=fn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class ux{constructor(e){this.name="near",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const s=t||qi(`${this.name}:${e}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,s)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;e[t]=this.createHttpProvider(t,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace);return typeof s>"u"?void 0:new Si(new zi(s,_t("disableProviderPing")))}}var hx=Object.defineProperty,lx=Object.defineProperties,fx=Object.getOwnPropertyDescriptors,kd=Object.getOwnPropertySymbols,dx=Object.prototype.hasOwnProperty,px=Object.prototype.propertyIsEnumerable,Vd=(i,e,t)=>e in i?hx(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Qo=(i,e)=>{for(var t in e||(e={}))dx.call(e,t)&&Vd(i,t,e[t]);if(kd)for(var t of kd(e))px.call(e,t)&&Vd(i,t,e[t]);return i},gu=(i,e)=>lx(i,fx(e));class fh{constructor(e){this.events=new Vu,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:ma(_a({level:(e==null?void 0:e.logger)||qd})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new fh(e);return await t.initialize(),t}async request(e,t,s){const[o,c]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(o).request({request:Qo({},e),chainId:`${o}:${c}`,topic:this.session.topic,expiry:s})}sendAsync(e,t,s,o){const c=new Date().getTime();this.request(e,s,o).then(l=>t(null,wa(c,l))).catch(l=>t(l,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:mt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:o}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await o().then(c=>{this.session=c;const l=tx(c.namespaces);this.namespaces=Bd(this.namespaces,l),this.persist("namespaces",this.namespaces)}).catch(c=>{if(c.message!==ug)throw c;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[s,o]=this.validateChain(e);this.getProvider(s).setDefaultChain(o,t)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(si(t)){for(const s of t)e.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await q5.init({logger:this.providerOpts.logger||qd,relayUrl:this.providerOpts.relayUrl||B5,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>_s(t)))];pu("client",this.client),pu("events",this.events),pu("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const s=Z5(t,this.session),o=lg(s),c=Bd(this.namespaces,this.optionalNamespaces),l=gu(Qo({},c[t]),{accounts:s,chains:o});switch(t){case"eip155":this.rpcProviders[t]=new ix({namespace:l});break;case"solana":this.rpcProviders[t]=new nx({namespace:l});break;case"cosmos":this.rpcProviders[t]=new sx({namespace:l});break;case"polkadot":this.rpcProviders[t]=new rx({namespace:l});break;case"cip34":this.rpcProviders[t]=new ox({namespace:l});break;case"elrond":this.rpcProviders[t]=new ax({namespace:l});break;case"multiversx":this.rpcProviders[t]=new cx({namespace:l});break;case"near":this.rpcProviders[t]=new ux({namespace:l});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:s}=t;if(s.name==="accountsChanged"){const o=s.data;o&&si(o)&&this.events.emit("accountsChanged",o.map(ex))}else if(s.name==="chainChanged"){const o=t.chainId,c=t.event.data,l=_s(o),f=du(o)!==du(c)?`${l}:${du(c)}`:o;this.onChainChanged(f)}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var s;const{namespaces:o}=t,c=(s=this.client)==null?void 0:s.session.get(e);this.session=gu(Qo({},c),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",gu(Qo({},mt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ii.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:s,sessionProperties:o}=e;t&&Object.keys(t).length&&(this.namespaces=t),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=o,this.persist("namespaces",t),this.persist("optionalNamespaces",s)}validateChain(e){const[t,s]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,s];if(t&&!Object.keys(this.namespaces||{}).map(l=>_s(l)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&s)return[t,s];const o=_s(Object.keys(this.namespaces)[0]),c=this.rpcProviders[o].getDefaultChain();return[o,c]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[s,o]=this.validateChain(e);o&&(t||this.getProvider(s).setDefaultChain(o),this.namespaces[s]?this.namespaces[s].defaultChain=o:this.namespaces[`${s}:${o}`]?this.namespaces[`${s}:${o}`].defaultChain=o:this.namespaces[`${s}:${o}`]={defaultChain:o},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Fd}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Fd}/${e}`)}}const gx=fh,yx="wc",vx="ethereum_provider",mx=`${yx}@2:${vx}:`,_x="https://rpc.walletconnect.com/v1/",Ku=["eth_sendTransaction","personal_sign"],wx=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],ku=["chainChanged","accountsChanged"],bx=["chainChanged","accountsChanged","message","disconnect","connect"];var Ex=Object.defineProperty,Dx=Object.defineProperties,Sx=Object.getOwnPropertyDescriptors,Gd=Object.getOwnPropertySymbols,Ix=Object.prototype.hasOwnProperty,xx=Object.prototype.propertyIsEnumerable,Wd=(i,e,t)=>e in i?Ex(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,bs=(i,e)=>{for(var t in e||(e={}))Ix.call(e,t)&&Wd(i,t,e[t]);if(Gd)for(var t of Gd(e))xx.call(e,t)&&Wd(i,t,e[t]);return i},Yd=(i,e)=>Dx(i,Sx(e));function aa(i){return Number(i[0].split(":")[1])}function yu(i){return`0x${i.toString(16)}`}function Ox(i){const{chains:e,optionalChains:t,methods:s,optionalMethods:o,events:c,optionalEvents:l,rpcMap:f}=i;if(!si(e))throw new Error("Invalid chains");const g={chains:e,methods:s||Ku,events:c||ku,rpcMap:bs({},e.length?{[aa(e)]:f[aa(e)]}:{})},p=c==null?void 0:c.filter(x=>!ku.includes(x)),v=s==null?void 0:s.filter(x=>!Ku.includes(x));if(!t&&!l&&!o&&!(p!=null&&p.length)&&!(v!=null&&v.length))return{required:e.length?g:void 0};const w=(p==null?void 0:p.length)&&(v==null?void 0:v.length)||!t,E={chains:[...new Set(w?g.chains.concat(t||[]):t)],methods:[...new Set(g.methods.concat(o!=null&&o.length?o:wx))],events:[...new Set(g.events.concat(l!=null&&l.length?l:bx))],rpcMap:f};return{required:e.length?g:void 0,optional:t.length?E:void 0}}class dh{constructor(){this.events=new Fr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=mx,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new dh;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,s){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),s)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:s}=Ox(this.rpc);try{const o=await new Promise(async(l,f)=>{var g;this.rpc.showQrModal&&((g=this.modal)==null||g.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Yd(bs({namespaces:bs({},t&&{[this.namespace]:t})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(p=>{l(p)}).catch(p=>{f(new Error(p.message))})});if(!o)return;const c=ME(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:c),this.setAccounts(c),this.events.emit("connect",{chainId:yu(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:s}=t;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",yu(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Yd(bs({},mt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,s;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(s=this.modal)==null||s.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",yu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,s,o]=e.split(":");return{chainId:`${t}:${s}`,address:o}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,s;const o=(t=e==null?void 0:e.chains)!=null?t:[],c=(s=e==null?void 0:e.optionalChains)!=null?s:[],l=o.concat(c);if(!l.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const f=o.length?(e==null?void 0:e.methods)||Ku:[],g=o.length?(e==null?void 0:e.events)||ku:[],p=(e==null?void 0:e.optionalMethods)||[],v=(e==null?void 0:e.optionalEvents)||[],w=(e==null?void 0:e.rpcMap)||this.buildRpcMap(l,e.projectId),E=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(x=>this.formatChainId(x)),optionalChains:c.map(x=>this.formatChainId(x)),methods:f,events:g,optionalMethods:p,optionalEvents:v,rpcMap:w,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:E,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const s={};return e.forEach(o=>{s[o]=this.getRpcUrl(o,t)}),s}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?aa(this.rpc.chains):aa(this.rpc.optionalChains),this.signer=await gx.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:s}=await Kw(()=>import("./index.WvR92-IP.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);t=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(bs({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:s,rpcMap:o}=e;t&&si(t)&&(this.rpc.chains=t.map(c=>this.formatChainId(c)),t.forEach(c=>{this.rpc.rpcMap[c]=(o==null?void 0:o[c])||this.getRpcUrl(c)})),s&&si(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(c=>this.formatChainId(c)),s.forEach(c=>{this.rpc.rpcMap[c]=(o==null?void 0:o[c])||this.getRpcUrl(c)}))}getRpcUrl(e,t){var s;return((s=this.rpc.rpcMap)==null?void 0:s[e])||`${_x}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const Gx=dh;export{Gx as EthereumProvider,bx as OPTIONAL_EVENTS,wx as OPTIONAL_METHODS,ku as REQUIRED_EVENTS,Ku as REQUIRED_METHODS,dh as default}; diff --git a/_app/immutable/chunks/index.gqgjn4wa.js b/_app/immutable/chunks/index.gqgjn4wa.js new file mode 100644 index 0000000..d244e01 --- /dev/null +++ b/_app/immutable/chunks/index.gqgjn4wa.js @@ -0,0 +1,87 @@ +import{A as at,N as mt,c as yt,C as ct,R as wt,p as St,d as At,s as vt,r as Et,O as q,S as bt,e as lt,E as O,f as Ct,M as xt,h as Ut}from"./2.DEesTFv4.js";const J={FIVE_MINUTES_IN_MS:3e5};class Pt{constructor(t){const{enabled:e=!0,nonceRefetchIntervalMs:s=J.FIVE_MINUTES_IN_MS,sessionRefetchIntervalMs:i=J.FIVE_MINUTES_IN_MS,signOutOnAccountChange:r=!0,signOutOnDisconnect:o=!0,signOutOnNetworkChange:c=!0,...a}=t;this.options={enabled:e,nonceRefetchIntervalMs:s,sessionRefetchIntervalMs:i,signOutOnDisconnect:o,signOutOnAccountChange:r,signOutOnNetworkChange:c},this.methods=a}async getNonce(t){const e=await this.methods.getNonce(t);if(!e)throw new Error("siweControllerClient:getNonce - nonce is undefined");return e}createMessage(t){const e=this.methods.createMessage(t);if(!e)throw new Error("siweControllerClient:createMessage - message is undefined");return e}async verifyMessage(t){return await this.methods.verifyMessage(t)}async getSession(){const t=await this.methods.getSession();if(!t)throw new Error("siweControllerClient:getSession - session is undefined");return t}async signIn(){var a;const{address:t}=at.state,e=await this.methods.getNonce(t);if(!t)throw new Error("An address is required to create a SIWE message.");const s=mt.caipNetworkIdToNumber((a=yt.state.caipNetwork)==null?void 0:a.id);if(!s)throw new Error("A chainId is required to create a SIWE message.");const i=this.methods.createMessage({address:t,nonce:e,chainId:s}),r=await ct.signMessage(i);if(!await this.methods.verifyMessage({message:i,signature:r}))throw new Error("Error verifying SIWE signature");const c=await this.methods.getSession();if(!c)throw new Error("Error verifying SIWE signature");return this.methods.onSignIn&&this.methods.onSignIn(c),wt.navigateAfterNetworkSwitch(),c}async signOut(){return this.methods.signOut()}}const p=St({status:"uninitialized"}),R={state:p,subscribeKey(n,t){return At(p,n,t)},subscribe(n){return vt(p,()=>n(p))},_getClient(){if(!p._client)throw new Error("SIWEController client not set");return p._client},async getNonce(n){const e=await this._getClient().getNonce(n);return this.setNonce(e),e},async getSession(){const t=await this._getClient().getSession();return t&&(this.setSession(t),this.setStatus("success")),t},createMessage(n){const e=this._getClient().createMessage(n);return this.setMessage(e),e},async verifyMessage(n){return await this._getClient().verifyMessage(n)},async signIn(){return await this._getClient().signIn()},async signOut(){var t;const n=this._getClient();await n.signOut(),this.setStatus("ready"),(t=n.onSignOut)==null||t.call(n)},onSignIn(n){var e;const t=this._getClient();(e=t.onSignIn)==null||e.call(t,n)},onSignOut(){var t;const n=this._getClient();(t=n.onSignOut)==null||t.call(n)},setSIWEClient(n){p._client=Et(n),p.status="ready",q.setIsSiweEnabled(n.options.enabled)},setNonce(n){p.nonce=n},setStatus(n){p.status=n},setMessage(n){p.message=n},setSession(n){p.session=n}};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const T=globalThis,K=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,F=Symbol(),X=new WeakMap;let ht=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==F)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(K&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=X.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&X.set(e,t))}return t}toString(){return this.cssText}};const Nt=n=>new ht(typeof n=="string"?n:n+"",void 0,F),It=(n,...t)=>{const e=n.length===1?n[0]:t.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[r+1],n[0]);return new ht(e,n,F)},Mt=(n,t)=>{if(K)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},Z=K?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Nt(e)})(n):n;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:Ot,defineProperty:Rt,getOwnPropertyDescriptor:Tt,getOwnPropertyNames:Ht,getOwnPropertySymbols:Wt,getPrototypeOf:jt}=Object,_=globalThis,Q=_.trustedTypes,kt=Q?Q.emptyScript:"",k=_.reactiveElementPolyfillSupport,C=(n,t)=>n,H={toAttribute(n,t){switch(t){case Boolean:n=n?kt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},G=(n,t)=>!Ot(n,t),Y={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:G};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Rt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=Tt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const c=i==null?void 0:i.call(this);r.call(this,o),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;const t=jt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){const e=this.properties,s=[...Ht(e),...Wt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(Z(i))}else t!==void 0&&e.push(Z(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Mt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var r;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:H).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const o=s.getPropertyOptions(i),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:H;this._$Em=i,this[i]=c.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??G)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[C("elementProperties")]=new Map,S[C("finalized")]=new Map,k==null||k({ReactiveElement:S}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.4");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const x=globalThis,W=x.trustedTypes,tt=W?W.createPolicy("lit-html",{createHTML:n=>n}):void 0,dt="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,ut="?"+$,zt=`<${ut}>`,w=document,U=()=>w.createComment(""),P=n=>n===null||typeof n!="object"&&typeof n!="function",pt=Array.isArray,Lt=n=>pt(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",z=`[ +\f\r]`,b=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,et=/-->/g,st=/>/g,m=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,nt=/"/g,gt=/^(?:script|style|textarea|title)$/i,Dt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),ft=Dt(1),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),rt=new WeakMap,y=w.createTreeWalker(w,129);function $t(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return tt!==void 0?tt.createHTML(t):t}const Vt=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"":"",o=b;for(let c=0;c"?(o=i??b,l=-1):u[1]===void 0?l=-2:(l=o.lastIndex-u[2].length,h=u[1],o=u[3]===void 0?m:u[3]==='"'?nt:it):o===nt||o===it?o=m:o===et||o===st?o=b:(o=m,i=void 0);const f=o===m&&n[c+1].startsWith("/>")?" ":"";r+=o===b?a+zt:l>=0?(s.push(h),a.slice(0,l)+dt+a.slice(l)+$+f):a+$+(l===-2?c:f)}return[$t(n,r+(n[e]||"")+(t===2?"":"")),s]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const c=t.length-1,a=this.parts,[h,u]=Vt(t,e);if(this.el=N.createElement(h,s),y.currentNode=this.el.content,e===2){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=y.nextNode())!==null&&a.length0){i.textContent=W?W.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=E(this,t,e,0),o=!P(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{const c=t;let a,h;for(t=r[0],a=0;a{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new I(t.insertBefore(U(),r),r,void 0,e??{})}return i._$AI(n),i};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class A extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Jt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return v}}var ot;A._$litElement$=!0,A.finalized=!0,(ot=globalThis.litElementHydrateSupport)==null||ot.call(globalThis,{LitElement:A});const D=globalThis.litElementPolyfillSupport;D==null||D({LitElement:A});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");const Xt=It` + :host { + display: flex; + justify-content: center; + gap: var(--wui-spacing-2xl); + } + + wui-visual-thumbnail:nth-child(1) { + z-index: 1; + } +`;var Zt=function(n,t,e,s){var i=arguments.length,r=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,t,e,s);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(r=(i<3?o(r):i>3?o(t,e,r):o(t,e))||r);return i>3&&r&&Object.defineProperty(t,e,r),r};let V=class extends A{constructor(){var t;super(...arguments),this.dappImageUrl=(t=q.state.metadata)==null?void 0:t.icons,this.walletImageUrl=bt.getConnectedWalletImageUrl()}firstUpdated(){var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelectorAll("wui-visual-thumbnail");t!=null&&t[0]&&this.createAnimation(t[0],"translate(18px)"),t!=null&&t[1]&&this.createAnimation(t[1],"translate(-18px)")}render(){var t;return ft` + + + `}createAnimation(t,e){t.animate([{transform:"translateX(0px)"},{transform:e}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};V.styles=Xt;V=Zt([lt("w3m-connecting-siwe")],V);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Qt={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:G},Yt=(n=Qt,t,e)=>{const{kind:s,metadata:i}=e;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),r.set(e.name,n),s==="accessor"){const{name:o}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(o,a,n)},init(c){return c!==void 0&&this.P(o,void 0,n),c}}}if(s==="setter"){const{name:o}=e;return function(c){const a=this[o];t.call(this,c),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+s)};function te(n){return(t,e)=>typeof e=="object"?Yt(n,t,e):((s,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(i,r):void 0})(n,t,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function ee(n){return te({...n,state:!0,attribute:!1})}var _t=function(n,t,e,s){var i=arguments.length,r=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,t,e,s);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(r=(i<3?o(r):i>3?o(t,e,r):o(t,e))||r);return i>3&&r&&Object.defineProperty(t,e,r),r};let B=class extends A{constructor(){var t;super(...arguments),this.dappName=(t=q.state.metadata)==null?void 0:t.name,this.isSigning=!1}render(){return ft` + + + + + ${this.dappName??"Dapp"} needs to connect to your wallet + + + Sign this message to prove you own this wallet and proceed. Canceling will disconnect + you. + + + + Cancel + + + ${this.isSigning?"Signing...":"Sign"} + + + `}async onSign(){this.isSigning=!0,O.sendEvent({event:"CLICK_SIGN_SIWE_MESSAGE",type:"track"});try{R.setStatus("loading");const t=await R.signIn();return R.setStatus("success"),O.sendEvent({event:"SIWE_AUTH_SUCCESS",type:"track"}),t}catch{return Ct.showError("Signature declined"),R.setStatus("error"),O.sendEvent({event:"SIWE_AUTH_ERROR",type:"track"})}finally{this.isSigning=!1}}async onCancel(){const{isConnected:t}=at.state;t?(await ct.disconnect(),xt.close()):Ut.push("Connect"),O.sendEvent({event:"CLICK_CANCEL_SIWE",type:"track"})}};_t([ee()],B.prototype,"isSigning",void 0);B=_t([lt("w3m-connecting-siwe-view")],B);function oe(n){return new Pt(n)}export{R as SIWEController,V as W3mConnectingSiwe,B as W3mConnectingSiweView,oe as createSIWEConfig}; diff --git a/_app/immutable/chunks/kit.D0HsIFJD.js b/_app/immutable/chunks/kit.D0HsIFJD.js new file mode 100644 index 0000000..6f42fe9 --- /dev/null +++ b/_app/immutable/chunks/kit.D0HsIFJD.js @@ -0,0 +1,2 @@ +import{r as p}from"./paths.DTSw6QKH.js";function y(e,{strict:n=!0}={}){return!e||typeof e!="string"?!1:n?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function h(e){return y(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const S="2.10.1",G=e=>e,Y=e=>e,w=()=>`viem@${S}`;class o extends Error{constructor(n,t={}){var s;super(),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:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:w()});const r=t.cause instanceof o?t.cause.details:(s=t.cause)!=null&&s.message?t.cause.message:t.details,i=t.cause instanceof o&&t.cause.docsPath||t.docsPath;this.message=[n||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` +`),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=i,this.metaMessages=t.metaMessages,this.shortMessage=n}walk(n){return $(this,n)}}function $(e,n){return n!=null&&n(e)?e:e&&typeof e=="object"&&"cause"in e?$(e.cause,n):n?null:e}class q extends o{constructor({offset:n,position:t,size:r}){super(`Slice ${t==="start"?"starting":"ending"} at offset "${n}" is out-of-bounds (size: ${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class z extends o{constructor({size:n,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${n}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class J extends o{constructor({size:n,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${t} ${r} long, but is ${n} ${r} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function d(e,{dir:n,size:t=32}={}){return typeof e=="string"?I(e,{dir:n,size:t}):O(e,{dir:n,size:t})}function I(e,{dir:n,size:t=32}={}){if(t===null)return e;const r=e.replace("0x","");if(r.length>t*2)throw new z({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function O(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new z({size:e.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let i=0;in)throw new B({givenSize:h(e),maxSize:n})}function C(e,n={}){const{signed:t}=n;n.size&&c(e,{size:n.size});const r=BigInt(e);if(!t)return r;const i=(e.length-2)/2,s=(1n<n.toString(16).padStart(2,"0"));function _(e,n={}){return typeof e=="number"||typeof e=="bigint"?x(e,n):typeof e=="string"?N(e,n):typeof e=="boolean"?U(e,n):E(e,n)}function U(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(c(t,{size:n.size}),d(t,{size:n.size})):t}function E(e,n={}){let t="";for(let i=0;is||i=u.zero&&e<=u.nine)return e-u.zero;if(e>=u.A&&e<=u.F)return e-(u.A-10);if(e>=u.a&&e<=u.f)return e-(u.a-10)}function g(e,n={}){let t=e;n.size&&(c(t,{size:n.size}),t=d(t,{dir:"right",size:n.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let f=0,a=0;f{};function ce(e=32){const n=new Uint8Array(e);return crypto.getRandomValues(n),_(n)}function fe(e,n){return e.getTime()-n.getTime()}class le extends Error{constructor(n,t){super(n),this._friendlyError=t}get friendlyError(){return this._friendlyError??this.message}}function de(e){return e.friendlyError??e.message}function ge(e){let n=V;return[p(e,r=>{n=r}),r=>n(r)]}function be(e){let n=0;return t=>(typeof t=="function"&&(t=t()),n++===0&&e(t),t.then(r=>(--n===0&&e(r),r)).catch(r=>{throw--n===0&&e(r),r}))}export{g as A,o as B,G as C,J as D,d as E,te as F,X as G,ie as H,K as I,ge as J,H as O,oe as P,q as S,le as U,ne as a,Z as b,be as c,Y as d,se as e,fe as f,de as g,W as h,y as i,ae as j,_ as k,re as l,ee as m,ue as n,h as o,x as p,I as q,ce as r,j as s,Q as t,U as u,N as v,c as w,E as x,C as y,T as z}; diff --git a/_app/immutable/chunks/page.DRg7gFN1.js b/_app/immutable/chunks/page.DRg7gFN1.js new file mode 100644 index 0000000..e26fe8d --- /dev/null +++ b/_app/immutable/chunks/page.DRg7gFN1.js @@ -0,0 +1 @@ +import{s as p,e as d,d as h,f as _,i as u,v as c,w as I,k as m,n as V,c as b,b as N,j as S,l as v,u as k,g as q,a as C,X as j}from"./scheduler.gEqqeaCZ.js";import{S as $,i as g,t as L,a as P}from"./index.BtSuiA6z.js";function w(o){let e;return{c(){e=d("div"),this.h()},l(a){e=h(a,"DIV",{class:!0,title:!0}),_(e).forEach(u),this.h()},h(){c(e,"class","spinner svelte-h1u4hm"),c(e,"title","loading..."),I(e,"failed",o[0]===!0)},m(a,l){m(a,e,l)},p(a,[l]){l&1&&I(e,"failed",a[0]===!0)},i:V,o:V,d(a){a&&u(e)}}}function X(o,e,a){let{failed:l=null}=e;return o.$$set=i=>{"failed"in i&&a(0,l=i.failed)},[l]}class H extends ${constructor(e){super(),g(this,e,X,w,p,{failed:0})}}function y(o){let e,a,l,i;const r=o[1].default,n=b(r,o,o[0],null);return{c(){e=d("div"),n&&n.c(),a=N(),l=d("div"),this.h()},l(t){e=h(t,"DIV",{class:!0});var s=_(e);n&&n.l(s),a=S(s),l=h(s,"DIV",{class:!0}),_(l).forEach(u),s.forEach(u),this.h()},h(){c(l,"class","svelte-cfvbhn"),c(e,"class","lede svelte-cfvbhn")},m(t,s){m(t,e,s),n&&n.m(e,null),v(e,a),v(e,l),i=!0},p(t,[s]){n&&n.p&&(!i||s&1)&&k(n,r,t,t[0],i?C(r,t[0],s,null):q(t[0]),null)},i(t){i||(L(n,t),i=!0)},o(t){P(n,t),i=!1},d(t){t&&u(e),n&&n.d(t)}}}function z(o,e,a){let{$$slots:l={},$$scope:i}=e;return o.$$set=r=>{"$$scope"in r&&a(0,i=r.$$scope)},[i,l]}class J extends ${constructor(e){super(),g(this,e,z,y,p,{})}}function A(o){let e,a,l,i,r;document.title=e=o[0]?`Nottingham: ${o[0]}`:"Searchers of Nottingham";const n=o[2].default,t=b(n,o,o[1],null);return{c(){a=N(),l=d("div"),i=d("div"),t&&t.c(),this.h()},l(s){j("svelte-3olkkt",document.head).forEach(u),a=S(s),l=h(s,"DIV",{class:!0});var E=_(l);i=h(E,"DIV",{class:!0});var D=_(i);t&&t.l(D),D.forEach(u),E.forEach(u),this.h()},h(){c(i,"class","content svelte-1uqupo"),c(l,"class","page svelte-1uqupo")},m(s,f){m(s,a,f),m(s,l,f),v(l,i),t&&t.m(i,null),r=!0},p(s,[f]){(!r||f&1)&&e!==(e=s[0]?`Nottingham: ${s[0]}`:"Searchers of Nottingham")&&(document.title=e),t&&t.p&&(!r||f&2)&&k(t,n,s,s[1],r?C(n,s[1],f,null):q(s[1]),null)},i(s){r||(L(t,s),r=!0)},o(s){P(t,s),r=!1},d(s){s&&(u(a),u(l)),t&&t.d(s)}}}function B(o,e,a){let{$$slots:l={},$$scope:i}=e,{title:r=""}=e;return o.$$set=n=>{"title"in n&&a(0,r=n.title),"$$scope"in n&&a(1,i=n.$$scope)},[r,i,l]}class K extends ${constructor(e){super(),g(this,e,B,A,p,{title:0})}}export{H as C,J as L,K as P}; diff --git a/_app/immutable/chunks/paths.DTSw6QKH.js b/_app/immutable/chunks/paths.DTSw6QKH.js new file mode 100644 index 0000000..57054ec --- /dev/null +++ b/_app/immutable/chunks/paths.DTSw6QKH.js @@ -0,0 +1 @@ +import{n as u,s as d}from"./scheduler.gEqqeaCZ.js";const n=[];function m(t,r){return{subscribe:h(t,r).subscribe}}function h(t,r=u){let i;const o=new Set;function b(e){if(d(t,e)&&(t=e,i)){const c=!n.length;for(const s of o)s[1](),n.push(s,t);if(c){for(let s=0;s{o.delete(s),o.size===0&&i&&(i(),i=null)}}return{set:b,update:a,subscribe:_}}var f;const g=((f=globalThis.__sveltekit_1dz0m2n)==null?void 0:f.base)??"/nottingham-frontend";var l;const z=((l=globalThis.__sveltekit_1dz0m2n)==null?void 0:l.assets)??g;export{z as a,g as b,m as r,h as w}; diff --git a/_app/immutable/chunks/player.PGhbgZJS.js b/_app/immutable/chunks/player.PGhbgZJS.js new file mode 100644 index 0000000..c504f80 --- /dev/null +++ b/_app/immutable/chunks/player.PGhbgZJS.js @@ -0,0 +1 @@ +import{s as f,e as h,t as c,d as _,f as p,h as u,i as l,v as i,k as d,l as v,m as y,n as o}from"./scheduler.gEqqeaCZ.js";import{S as $,i as q}from"./index.BtSuiA6z.js";import{b as m}from"./paths.DTSw6QKH.js";function b(n){let e,r,t;return{c(){e=h("a"),r=c(n[0]),this.h()},l(a){e=_(a,"A",{href:!0,class:!0});var s=p(e);r=u(s,n[0]),s.forEach(l),this.h()},h(){i(e,"href",t=`${m}/player?name=${n[0]}`),i(e,"class","svelte-iqqi0o")},m(a,s){d(a,e,s),v(e,r)},p(a,[s]){s&1&&y(r,a[0]),s&1&&t!==(t=`${m}/player?name=${a[0]}`)&&i(e,"href",t)},i:o,o,d(a){a&&l(e)}}}function P(n,e,r){let{name:t}=e;return n.$$set=a=>{"name"in a&&r(0,t=a.name)},[t]}class x extends ${constructor(e){super(),q(this,e,P,b,f,{name:0})}}export{x as P}; diff --git a/_app/immutable/chunks/preload-helper.D6kgxu3v.js b/_app/immutable/chunks/preload-helper.D6kgxu3v.js new file mode 100644 index 0000000..e9c4089 --- /dev/null +++ b/_app/immutable/chunks/preload-helper.D6kgxu3v.js @@ -0,0 +1 @@ +const v="modulepreload",y=function(a,l){return new URL(a,l).href},d={},w=function(l,c,u){let f=Promise.resolve();if(c&&c.length>0){const r=document.getElementsByTagName("link"),e=document.querySelector("meta[property=csp-nonce]"),h=(e==null?void 0:e.nonce)||(e==null?void 0:e.getAttribute("nonce"));f=Promise.all(c.map(t=>{if(t=y(t,u),t in d)return;d[t]=!0;const s=t.endsWith(".css"),m=s?'[rel="stylesheet"]':"";if(!!u)for(let o=r.length-1;o>=0;o--){const i=r[o];if(i.href===t&&(!s||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${m}`))return;const n=document.createElement("link");if(n.rel=s?"stylesheet":v,s||(n.as="script",n.crossOrigin=""),n.href=t,h&&n.setAttribute("nonce",h),document.head.appendChild(n),s)return new Promise((o,i)=>{n.addEventListener("load",o),n.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${t}`)))})}))}return f.then(()=>l()).catch(r=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=r,window.dispatchEvent(e),!e.defaultPrevented)throw r})};export{w as _}; diff --git a/_app/immutable/chunks/scheduler.gEqqeaCZ.js b/_app/immutable/chunks/scheduler.gEqqeaCZ.js new file mode 100644 index 0000000..9d0bcfc --- /dev/null +++ b/_app/immutable/chunks/scheduler.gEqqeaCZ.js @@ -0,0 +1 @@ +var P=Object.defineProperty;var q=(t,e,n)=>e in t?P(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var f=(t,e,n)=>(q(t,typeof e!="symbol"?e+"":e,n),n);function B(){}function O(t,e){for(const n in e)t[n]=e[n];return t}function G(t){return t()}function it(){return Object.create(null)}function R(t){t.forEach(G)}function lt(t){return typeof t=="function"}function ct(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let p;function rt(t,e){return t===e?!0:(p||(p=document.createElement("a")),p.href=e,t===p.href)}function st(t){return Object.keys(t).length===0}function z(t,...e){if(t==null){for(const i of e)i(void 0);return B}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function ot(t,e,n){t.$$.on_destroy.push(z(e,n))}function ut(t,e,n,i){if(t){const l=L(t,e,n,i);return t[0](l)}}function L(t,e,n,i){return t[1]&&i?O(n.ctx.slice(),t[1](i(e))):n.ctx}function at(t,e,n,i){if(t[2]&&i){const l=t[2](i(n));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],c=Math.max(e.dirty.length,l.length);for(let o=0;o32){const e=[],n=t.ctx.length/32;for(let i=0;i>1);n(l)<=i?t=l+1:e=l}return t}function I(t){if(t.hydrate_init)return;t.hydrate_init=!0;let e=t.childNodes;if(t.nodeName==="HEAD"){const r=[];for(let u=0;u0&&e[n[l]].claim_order<=u?l+1:F(1,l,j=>e[n[j]].claim_order,u))-1;i[r]=n[a]+1;const w=a+1;n[w]=r,l=Math.max(w,l)}const s=[],c=[];let o=e.length-1;for(let r=n[l]+1;r!=0;r=i[r-1]){for(s.push(e[r-1]);o>=r;o--)c.push(e[o]);o--}for(;o>=0;o--)c.push(e[o]);s.reverse(),c.sort((r,u)=>r.claim_order-u.claim_order);for(let r=0,u=0;r=s[u].claim_order;)u++;const a=ut.removeEventListener(e,n,i)}function gt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function xt(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Et(t){return t.dataset.svelteH}function Tt(t){return Array.from(t.childNodes)}function C(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function D(t,e,n,i,l=!1){C(t);const s=(()=>{for(let c=t.claim_info.last_index;c=0;c--){const o=t[c];if(e(o)){const r=n(o);return r===void 0?t.splice(c,1):t[c]=r,l?r===void 0&&t.claim_info.last_index--:t.claim_info.last_index=c,o}}return i()})();return s.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,s}function Q(t,e,n,i){return D(t,l=>l.nodeName===e,l=>{const s=[];for(let c=0;cl.removeAttribute(c))},()=>i(e))}function vt(t,e,n){return Q(t,e,n,M)}function V(t,e){return D(t,n=>n.nodeType===3,n=>{const i=""+e;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>N(e),!0)}function Nt(t){return V(t," ")}function A(t,e,n){for(let i=n;i0&&n.push(l);return n}class Y{constructor(e=!1){f(this,"is_svg",!1);f(this,"e");f(this,"n");f(this,"t");f(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=K(n.nodeName):this.e=M(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n{const l=t.$$.callbacks[e];if(l){const s=X(e,n,{cancelable:i});return l.slice().forEach(c=>{c.call(t,s)}),!s.defaultPrevented}return!0}}function qt(t,e){return d().$$.context.set(t,e),e}function Bt(t){return d().$$.context.get(t)}function Ot(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const m=[],k=[];let h=[];const H=[],S=Promise.resolve();let v=!1;function Z(){v||(v=!0,S.then(tt))}function Gt(){return Z(),S}function $(t){h.push(t)}const E=new Set;let _=0;function tt(){if(_!==0)return;const t=y;do{try{for(;_t.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),h=e}export{Ot as $,gt as A,kt as B,rt as C,wt as D,St as E,Ht as F,k as G,g as H,Ct as I,Gt as J,it as K,tt as L,lt as M,st as N,$ as O,Rt as P,y as Q,x as R,G as S,m as T,Z as U,ht as V,dt as W,Mt as X,Bt as Y,Pt as Z,jt as _,at as a,qt as a0,pt as b,ut as c,vt as d,M as e,Tt as f,_t as g,V as h,T as i,Nt as j,J as k,U as l,At as m,B as n,ot as o,yt as p,Et as q,R as r,ct as s,N as t,ft as u,xt as v,Lt as w,bt as x,mt as y,Dt as z}; diff --git a/_app/immutable/chunks/site.BlgjxTUG.js b/_app/immutable/chunks/site.BlgjxTUG.js new file mode 100644 index 0000000..2bd2fc4 --- /dev/null +++ b/_app/immutable/chunks/site.BlgjxTUG.js @@ -0,0 +1,38 @@ +const __vite__fileDeps=["./ccip.DOeQ8225.js","./kit.D0HsIFJD.js","./paths.DTSw6QKH.js","./scheduler.gEqqeaCZ.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{Y as xo}from"./scheduler.gEqqeaCZ.js";import{B as v,o as U,i as ve,t as oe,k,s as we,S as Kr,p as N,q as $e,u as Po,v as Eo,w as Lt,x as D,y as H,z as _e,I as Bo,h as ae,A as ue,C as Io,d as Fn,D as wr,E as Ao,n as vr,F as To}from"./kit.D0HsIFJD.js";import{_ as $o}from"./preload-helper.D6kgxu3v.js";function Oo(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const xr=/^tuple(?(\[(\d*)\])*)$/;function un(e){let t=e.type;if(xr.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s{var s,o;return((s=e[t.name])==null?void 0:s.call(e,r))??((o=e[n])==null?void 0:o.call(e,r))??t(e,r)}}function fe(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Ho(e.type);return`${e.name}(${zt(e.inputs,{includeName:t})})`}function zt(e,{includeName:t=!1}={}){return e?e.map(n=>Co(n,{includeName:t})).join(t?", ":","):""}function Co(e,{includeName:t}){return e.type.startsWith("tuple")?`(${zt(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class Fo extends v{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class Pr extends v{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class Jr extends v{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${zt(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class Mt extends v{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class So extends v{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class No extends v{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${U(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class jo extends v{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class Xr extends v{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Ro extends v{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class Qr extends v{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class Er extends v{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class jt extends v{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Lo extends v{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class zo extends v{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${fe(t.abiItem)}\`, and`,`\`${n.type}\` in \`${fe(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:"AbiItemAmbiguityError"})}}class Mo extends v{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class rt extends v{constructor({abiItem:t,data:n,params:r,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(` +`),{metaMessages:[`Params: (${zt(r,{includeName:!0})})`,`Data: ${n} (${s} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=s}}class Ut extends v{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${fe(t,{includeName:!0})}".`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Uo extends v{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class Go extends v{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class _o extends v{constructor(t){super([`Value "${t}" is not a valid array.`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Ho extends v{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class Do extends v{constructor(t){super(`Filter type "${t}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}function Rt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Sn(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function qo(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Rt(e.outputLen),Rt(e.blockLen)}function He(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function es(e,t){Sn(e);const n=t.outputLen;if(e.length>Br&Ct)}:{h:Number(e>>Br&Ct)|0,l:Number(e&Ct)|0}}function Zo(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;se<>>32-n,Yo=(e,t,n)=>t<>>32-n,Ko=(e,t,n)=>t<>>64-n,Jo=(e,t,n)=>e<>>64-n,Qt=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ts=e=>e instanceof Uint8Array,Xo=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),en=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ie=(e,t)=>e<<32-t|e>>>t,Qo=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Qo)throw new Error("Non little-endian hardware is not supported");function ei(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Gt(e){if(typeof e=="string"&&(e=ei(e)),!ts(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function ti(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!ts(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class Nn{clone(){return this._cloneInto()}}function ns(e){const t=r=>e().update(Gt(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ni(e=32){if(Qt&&typeof Qt.getRandomValues=="function")return Qt.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[rs,ss,os]=[[],[],[]],ri=BigInt(0),et=BigInt(1),si=BigInt(2),oi=BigInt(7),ii=BigInt(256),ai=BigInt(113);for(let e=0,t=et,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],rs.push(2*(5*r+n)),ss.push((e+1)*(e+2)/2%64);let s=ri;for(let o=0;o<7;o++)t=(t<>oi)*ai)%ii,t&si&&(s^=et<<(et<n>32?Ko(e,t,n):Wo(e,t,n),Ar=(e,t,n)=>n>32?Jo(e,t,n):Yo(e,t,n);function li(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,u=n[c],f=n[c+1],l=Ir(u,f,1)^n[a],d=Ar(u,f,1)^n[a+1];for(let y=0;y<50;y+=10)e[i+y]^=l,e[i+y+1]^=d}let s=e[2],o=e[3];for(let i=0;i<24;i++){const a=ss[i],c=Ir(s,o,a),u=Ar(s,o,a),f=rs[i];s=e[f],o=e[f+1],e[f]=c,e[f+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)n[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=ci[r],e[1]^=ui[r]}n.fill(0)}class jn extends Nn{constructor(t,n,r,s=!1,o=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Rt(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Xo(this.state)}keccak(){li(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){He(this);const{blockLen:n,state:r}=this;t=Gt(t);const s=t.length;for(let o=0;o=r&&this.keccak();const i=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Rt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(es(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:i}=this;return t||(t=new jn(n,r,s,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=i,t.destroyed=this.destroyed,t}}const fi=(e,t,n)=>ns(()=>new jn(t,e,n)),di=fi(1,136,256/8);function W(e,t){const n=t||"hex",r=di(ve(e,{strict:!1})?oe(e):e);return n==="bytes"?r:k(r)}const hi=e=>W(oe(e));function pi(e){return hi(e)}function bi(e){let t=!0,n="",r=0,s="",o=!1;for(let i=0;i{const t=typeof e=="string"?e:ko(e);return bi(t)};function is(e){return pi(yi(e))}const Rn=is;class ee extends v{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class mi extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}set(t,n){return super.set(t,n),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}function Ln(e,t){const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=W(we(n),"bytes"),s=(t?n.substring(`${t}0x`.length):n).split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(r[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());return`0x${s.join("")}`}function pl(e,t){if(!q(e,{strict:!1}))throw new ee({address:e});return Ln(e,t)}const gi=/^0x[a-fA-F0-9]{40}$/,tn=new mi(8192);function q(e,t){const{strict:n=!0}=t??{};if(tn.has(e))return tn.get(e);const r=gi.test(e)?e.toLowerCase()===e?!0:n?Ln(e)===e:!0:!1;return tn.set(e,r),r}function de(e){return typeof e[0]=="string"?Se(e):wi(e)}function wi(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Se(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function st(e,t,n,{strict:r}={}){return ve(e,{strict:!1})?vi(e,t,n,{strict:r}):us(e,t,n,{strict:r})}function as(e,t){if(typeof t=="number"&&t>0&&t>U(e)-1)throw new Kr({offset:t,position:"start",size:U(e)})}function cs(e,t,n){if(typeof t=="number"&&typeof n=="number"&&U(e)!==n-t)throw new Kr({offset:n,position:"end",size:U(e)})}function us(e,t,n,{strict:r}={}){as(e,t);const s=e.slice(t,n);return r&&cs(s,t,n),s}function vi(e,t,n,{strict:r}={}){as(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&cs(s,t,n),s}function Et(e,t){if(e.length!==t.length)throw new jo({expectedLength:e.length,givenLength:t.length});const n=xi({params:e,values:t}),r=Mn(n);return r.length===0?"0x":r}function xi({params:e,values:t}){const n=[];for(let r=0;r0?de([a,i]):a}}if(s)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:de(o.map(({encoded:i})=>i))}}function Bi(e,{param:t}){const[,n]=t.type.split("bytes"),r=U(e);if(!n){let s=e;return r%32!==0&&(s=$e(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:de([$e(N(r,{size:32})),s])}}if(r!==parseInt(n))throw new No({expectedSize:parseInt(n),value:e});return{dynamic:!1,encoded:$e(e,{dir:"right"})}}function Ii(e){if(typeof e!="boolean")throw new v(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:$e(Po(e))}}function Ai(e,{signed:t}){return{dynamic:!1,encoded:N(e,{size:32,signed:t})}}function Ti(e){const t=Eo(e),n=Math.ceil(U(t)/32),r=[];for(let s=0;ss))}}function Un(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Gn=e=>st(is(e),0,4);function Bt(e){const{abi:t,args:n=[],name:r}=e,s=ve(r,{strict:!1}),o=t.filter(a=>s?a.type==="function"?Gn(a)===r:a.type==="event"?Rn(a)===r:!1:"name"in a&&a.name===r);if(o.length===0)return;if(o.length===1)return o[0];let i;for(const a of o){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((u,f)=>{const l="inputs"in a&&a.inputs[f];return l?ln(u,l):!1})){if(i&&"inputs"in i&&i.inputs){const u=ls(a.inputs,i.inputs,n);if(u)throw new zo({abiItem:a,type:u[0]},{abiItem:i,type:u[1]})}i=a}}return i||o[0]}function ln(e,t){const n=typeof e,r=t.type;switch(r){case"address":return q(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>ln(Object.values(e)[o],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>ln(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ls(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return ls(s.components,o.components,n[r]);const i=[s.type,o.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?q(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?q(n[r],{strict:!1}):!1)return i}}const Tr="/docs/contract/encodeEventTopics";function It(e){var c;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=Bt({abi:t,name:n});if(!u)throw new Er(n,{docsPath:Tr});s=u}if(s.type!=="event")throw new Er(void 0,{docsPath:Tr});const o=fe(s),i=Rn(o);let a=[];if(r&&"inputs"in s){const u=(c=s.inputs)==null?void 0:c.filter(l=>"indexed"in l&&l.indexed),f=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(l=>r[l.name]))??[]:[];f.length>0&&(a=(u==null?void 0:u.map((l,d)=>Array.isArray(f[d])?f[d].map((y,p)=>$r({param:l,value:f[d][p]})):f[d]?$r({param:l,value:f[d]}):null))??[])}return[i,...a]}function $r({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return W(oe(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Do(e.type);return Et([e],[t])}function _t(e,{method:t}){var r,s;const n={};return e.transport.type==="fallback"&&((s=(r=e.transport).onResponse)==null||s.call(r,({method:o,response:i,status:a,transport:c})=>{a==="success"&&t===o&&(n[i]=c.request)})),o=>n[o]||e.request}async function fs(e,t){const{address:n,abi:r,args:s,eventName:o,fromBlock:i,strict:a,toBlock:c}=t,u=_t(e,{method:"eth_newFilter"}),f=o?It({abi:r,args:s,eventName:o}):void 0,l=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?N(i):i,toBlock:typeof c=="bigint"?N(c):c,topics:f}]});return{abi:r,args:s,eventName:o,id:l,request:u(l),strict:!!a,type:"event"}}function Be(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Or="/docs/contract/encodeFunctionData";function Oi(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const o=Bt({abi:t,args:n,name:r});if(!o)throw new jt(r,{docsPath:Or});s=o}if(s.type!=="function")throw new jt(void 0,{docsPath:Or});return{abi:[s],functionName:Gn(fe(s))}}function Ne(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var a;return e.abi.length===1&&((a=e.functionName)!=null&&a.startsWith("0x"))?e:Oi(e)})(),s=n[0],o=r,i="inputs"in s&&s.inputs?Et(s.inputs,t??[]):void 0;return Se([o,i??"0x"])}const ds={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},ki={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Ci={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class kr extends v{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class hs extends v{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:"PositionOutOfBoundsError"})}}class Fi extends v{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:"RecursiveReadLimitExceededError"})}}const Si={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Fi({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new hs({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new kr({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 kr({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===1/0)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function _n(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Si);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Ni(e,t={}){typeof t.size<"u"&&Lt(e,{size:t.size});const n=D(e,t);return H(n,t)}function ji(e,t={}){let n=e;if(typeof t.size<"u"&&(Lt(n,{size:t.size}),n=_e(n)),n.length>1||n[0]>1)throw new Bo(n);return!!n[0]}function le(e,t={}){typeof t.size<"u"&&Lt(e,{size:t.size});const n=D(e,t);return ae(n,t)}function Ri(e,t={}){let n=e;return typeof t.size<"u"&&(Lt(n,{size:t.size}),n=_e(n,{dir:"right"})),new TextDecoder().decode(n)}function Ht(e,t){const n=typeof t=="string"?ue(t):t,r=_n(n);if(U(n)===0&&e.length>0)throw new Mt;if(U(t)&&U(t)<32)throw new Jr({data:typeof t=="string"?t:D(t),params:e,size:U(t)});let s=0;const o=[];for(let i=0;i48?Ni(s,{signed:n}):le(s,{signed:n}),32]}function _i(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),s=r?[]:{};let o=0;if(ot(t)){const i=le(e.readBytes(fn)),a=n+i;for(let c=0;ci.type==="error"&&r===Gn(fe(i)));if(!o)throw new Xr(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Ht(o.inputs,st(n,4)):void 0,errorName:o.name}}const V=(e,t,n)=>JSON.stringify(e,(r,s)=>{const o=typeof s=="bigint"?s.toString():s;return typeof t=="function"?t(r,o):o},n);function ps({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,o)=>`${r&&s.name?`${s.name}: `:""}${typeof t[o]=="object"?V(t[o]):t[o]}`).join(", ")})`}const qi={gwei:9,wei:18},Vi={ether:-9,wei:9},bl={ether:-18,gwei:-9};function bs(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${o?`.${o}`:""}`}function Hn(e,t="wei"){return bs(e,qi[t])}function Y(e,t="wei"){return bs(e,Vi[t])}class Zi extends v{constructor({address:t}){super(`State for account "${t}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class Wi extends v{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function Fr(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r} +`,"")}function Yi(e){return e.reduce((t,{address:n,...r})=>{let s=`${t} ${n}: +`;return r.nonce&&(s+=` nonce: ${r.nonce} +`),r.balance&&(s+=` balance: ${r.balance} +`),r.code&&(s+=` code: ${r.code} +`),r.state&&(s+=` state: +`,s+=Fr(r.state)),r.stateDiff&&(s+=` stateDiff: +`,s+=Fr(r.stateDiff)),s},` State Override: +`).slice(0,-1)}function At(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(` +`)}class Ki extends v{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class Ji extends v{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class Xi extends v{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",At(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class Qi extends v{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class yl extends v{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d}){var p;const y=At({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:l,value:typeof d<"u"&&`${Hn(d)} ${((p=s==null?void 0:s.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${Y(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Y(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Y(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",y].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=t}}class ys extends v{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:s,index:o}){let i="Transaction";r&&o!==void 0&&(i=`Transaction at block time "${r}" at index "${o}"`),t&&o!==void 0&&(i=`Transaction at block hash "${t}" at index "${o}"`),n&&o!==void 0&&(i=`Transaction at block number "${n}" at index "${o}"`),s&&(i=`Transaction with hash "${s}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class ms extends v{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class ea extends v{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}class gs extends v{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d,stateOverride:y}){var b;const p=n?Be(n):void 0;let h=At({from:p==null?void 0:p.address,to:l,value:typeof d<"u"&&`${Hn(d)} ${((b=s==null?void 0:s.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${Y(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Y(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Y(u)} gwei`,nonce:f});y&&(h+=` +${Yi(y)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=t}}class ta extends v{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:o,functionName:i,sender:a}){const c=Bt({abi:n,args:r,name:i}),u=c?ps({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=c?fe(c,{includeName:!0}):void 0,l=At({address:s&&Io(s),function:f,args:u&&u!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:o,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=s,this.functionName=i,this.sender=a}}class dn extends v{constructor({abi:t,data:n,functionName:r,message:s}){let o,i,a,c;if(n&&n!=="0x")try{i=Di({abi:t,data:n});const{abiItem:f,errorName:l,args:d}=i;if(l==="Error")c=d[0];else if(l==="Panic"){const[y]=d;c=ds[y]}else{const y=f?fe(f,{includeName:!0}):void 0,p=f&&d?ps({abiItem:f,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[y?`Error: ${y}`:"",p&&p!=="()"?` ${[...Array((l==null?void 0:l.length)??0).keys()].map(()=>" ").join("")}${p}`:""]}}catch(f){o=f}else s&&(c=s);let u;o instanceof Xr&&(u=o.signature,a=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(` +`):`The contract function "${r}" reverted.`,{cause:o,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=c,this.signature=u}}class na extends v{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class Dn extends v{constructor({data:t,message:n}){super(n||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class nt extends v{constructor({body:t,details:n,headers:r,status:s,url:o}){super("HTTP request failed.",{details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${Fn(o)}`,t&&`Request body: ${V(t)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=r,this.status=s,this.url=o}}class ws extends v{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${Fn(r)}`,`Request body: ${V(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code}}class Sr extends v{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Fn(n)}`,`Request body: ${V(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const ra=-1;class K extends v{constructor(t,{code:n,docsPath:r,metaMessages:s,shortMessage:o}){super(o,{cause:t,docsPath:r,metaMessages:s||(t==null?void 0:t.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t.name,this.code=t instanceof ws?t.code:n??ra}}class Ye extends K{constructor(t,n){super(t,n),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class it extends K{constructor(t){super(t,{code:it.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(it,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class at extends K{constructor(t){super(t,{code:at.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(at,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class ct extends K{constructor(t){super(t,{code:ct.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(ct,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class ut extends K{constructor(t){super(t,{code:ut.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(ut,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class ke extends K{constructor(t){super(t,{code:ke.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(ke,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Ce extends K{constructor(t){super(t,{code:Ce.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(Ce,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class lt extends K{constructor(t){super(t,{code:lt.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(lt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ft extends K{constructor(t){super(t,{code:ft.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(ft,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class dt extends K{constructor(t){super(t,{code:dt.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(dt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class ht extends K{constructor(t){super(t,{code:ht.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(ht,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class De extends K{constructor(t){super(t,{code:De.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(De,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class pt extends K{constructor(t){super(t,{code:pt.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(pt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ge extends Ye{constructor(t){super(t,{code:Ge.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class bt extends Ye{constructor(t){super(t,{code:bt.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(bt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class yt extends Ye{constructor(t){super(t,{code:yt.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(yt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class mt extends Ye{constructor(t){super(t,{code:mt.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(mt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class gt extends Ye{constructor(t){super(t,{code:gt.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(gt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class wt extends Ye{constructor(t){super(t,{code:wt.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(wt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class sa extends K{constructor(t){super(t,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const oa=3;function vt(e,{abi:t,address:n,args:r,docsPath:s,functionName:o,sender:i}){const{code:a,data:c,message:u,shortMessage:f}=e instanceof Dn?e:e instanceof v?e.walk(d=>"data"in d)||e.walk():{},l=e instanceof Mt?new na({functionName:o}):[oa,ke.code].includes(a)&&(c||u||f)?new dn({abi:t,data:typeof c=="object"?c.data:c,functionName:o,message:f??u}):e;return new ta(l,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:o,sender:i})}class ia extends v{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:l,value:d}){var p;const y=At({from:n==null?void 0:n.address,to:l,value:typeof d<"u"&&`${Hn(d)} ${((p=s==null?void 0:s.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${Y(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Y(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Y(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",y].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=t}}class Me extends v{constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(Me,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Me,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Fe extends v{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Y(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(Fe,"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 hn extends v{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Y(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(hn,"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 pn extends v{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(pn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class bn extends v{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(` +`),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(bn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class yn extends v{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(yn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class mn extends v{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(mn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class gn extends v{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}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(gn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class wn extends v{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(wn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class vn extends v{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(vn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class xt extends v{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Y(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Y(r)} gwei`:""}).`].join(` +`),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(xt,"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 qn extends v{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function vs(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof v?e.walk(s=>s.code===Me.code):e;return r instanceof v?new Me({cause:e,message:r.details}):Me.nodeMessage.test(n)?new Me({cause:e,message:e.details}):Fe.nodeMessage.test(n)?new Fe({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):hn.nodeMessage.test(n)?new hn({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):pn.nodeMessage.test(n)?new pn({cause:e,nonce:t==null?void 0:t.nonce}):bn.nodeMessage.test(n)?new bn({cause:e,nonce:t==null?void 0:t.nonce}):yn.nodeMessage.test(n)?new yn({cause:e,nonce:t==null?void 0:t.nonce}):mn.nodeMessage.test(n)?new mn({cause:e}):gn.nodeMessage.test(n)?new gn({cause:e,gas:t==null?void 0:t.gas}):wn.nodeMessage.test(n)?new wn({cause:e,gas:t==null?void 0:t.gas}):vn.nodeMessage.test(n)?new vn({cause:e}):xt.nodeMessage.test(n)?new xt({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new qn({cause:e})}function aa(e,{docsPath:t,...n}){const r=(()=>{const s=vs(e,n);return s instanceof qn?e:s})();return new ia(r,{docsPath:t,...n})}function xs(e,{format:t}){if(!t)return{};const n={};function r(o){const i=Object.keys(o);for(const a of i)a in e&&(n[a]=e[a]),o[a]&&typeof o[a]=="object"&&!Array.isArray(o[a])&&r(o[a])}const s=t(e||{});return r(s),n}function Dt(e,t){return({exclude:n,format:r})=>({exclude:n,format:s=>{const o=t(s);if(n)for(const i of n)delete o[i];return{...o,...r(s)}},type:e})}const ca={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Vn(e){const t={};return typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>D(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=N(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=N(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=N(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=N(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=N(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=N(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=ca[e.type]),typeof e.value<"u"&&(t.value=N(e.value)),t}const ua=Dt("transactionRequest",Vn);function Zn(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:o}=e,i=t?Be(t):void 0;if(i&&!q(i.address))throw new ee({address:i.address});if(o&&!q(o))throw new ee({address:o});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new Ki;if(r&&r>2n**256n-1n)throw new Fe({maxFeePerGas:r});if(s&&r&&s>r)throw new xt({maxFeePerGas:r,maxPriorityFeePerGas:s})}class la extends v{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Wn extends v{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class fa extends v{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Y(t)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Ps extends v{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.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const Es={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function Yn(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?ae(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?ae(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Es[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 t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}const da=Dt("transaction",Yn);function Kn(e){var n;const t=(n=e.transactions)==null?void 0:n.map(r=>typeof r=="string"?r:Yn(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const ha=Dt("block",Kn);async function xe(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){var f,l,d;const o=r??"latest",i=s??!1,a=n!==void 0?N(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,i]}):c=await e.request({method:"eth_getBlockByNumber",params:[a||o,i]}),!c)throw new Ps({blockHash:t,blockNumber:n});return(((d=(l=(f=e.chain)==null?void 0:f.formatters)==null?void 0:l.block)==null?void 0:d.format)||Kn)(c)}async function Jn(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function pa(e,t){return Bs(e,t)}async function Bs(e,t){var o,i,a;const{block:n,chain:r=e.chain,request:s}=t||{};if(typeof((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee)=="function"){const c=n||await F(e,xe,"getBlock")({});return r.fees.defaultPriorityFee({block:c,client:e,request:s})}if(typeof((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee)<"u")return(a=r==null?void 0:r.fees)==null?void 0:a.defaultPriorityFee;try{const c=await e.request({method:"eth_maxPriorityFeePerGas"});return H(c)}catch{const[c,u]=await Promise.all([n?Promise.resolve(n):F(e,xe,"getBlock")({}),F(e,Jn,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new Wn;const f=u-c.baseFeePerGas;return f<0n?0n:f}}async function ba(e,t){return xn(e,t)}async function xn(e,t){var d,y;const{block:n,chain:r=e.chain,request:s,type:o="eip1559"}=t||{},i=await(async()=>{var p,h;return typeof((p=r==null?void 0:r.fees)==null?void 0:p.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)??1.2})();if(i<1)throw new la;const c=10**(((d=i.toString().split(".")[1])==null?void 0:d.length)??0),u=p=>p*BigInt(Math.ceil(i*c))/BigInt(c),f=n||await F(e,xe,"getBlock")({});if(typeof((y=r==null?void 0:r.fees)==null?void 0:y.estimateFeesPerGas)=="function"){const p=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:o});if(p!==null)return p}if(o==="eip1559"){if(typeof f.baseFeePerGas!="bigint")throw new Wn;const p=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await Bs(e,{block:f,chain:r,request:s}),h=u(f.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??h+p,maxPriorityFeePerGas:p}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await F(e,Jn,"getGasPrice")({}))}}async function Is(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,r?N(r):n]});return ae(s)}function Xn(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>ue(o)):e.blobs,s=[];for(const o of r)s.push(Uint8Array.from(t.blobToKzgCommitment(o)));return n==="bytes"?s:s.map(o=>D(o))}function Qn(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>ue(i)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(i=>ue(i)):e.commitments,o=[];for(let i=0;iD(i))}function ya(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),o=BigInt(4294967295),i=Number(n>>s&o),a=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+u,a,r)}class ma extends Nn{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=en(this.buffer)}update(t){He(this);const{view:n,buffer:r,blockLen:s}=this;t=Gt(t);const o=t.length;for(let i=0;is-i&&(this.process(r,0),i=0);for(let l=i;lf.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;le&t^~e&n,wa=(e,t,n)=>e&t^e&n^t&n,va=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),me=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ge=new Uint32Array(64);class xa extends ma{constructor(){super(64,32,8,!1),this.A=me[0]|0,this.B=me[1]|0,this.C=me[2]|0,this.D=me[3]|0,this.E=me[4]|0,this.F=me[5]|0,this.G=me[6]|0,this.H=me[7]|0}get(){const{A:t,B:n,C:r,D:s,E:o,F:i,G:a,H:c}=this;return[t,n,r,s,o,i,a,c]}set(t,n,r,s,o,i,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)ge[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const d=ge[l-15],y=ge[l-2],p=ie(d,7)^ie(d,18)^d>>>3,h=ie(y,17)^ie(y,19)^y>>>10;ge[l]=h+ge[l-7]+p+ge[l-16]|0}let{A:r,B:s,C:o,D:i,E:a,F:c,G:u,H:f}=this;for(let l=0;l<64;l++){const d=ie(a,6)^ie(a,11)^ie(a,25),y=f+d+ga(a,c,u)+va[l]+ge[l]|0,h=(ie(r,2)^ie(r,13)^ie(r,22))+wa(r,s,o)|0;f=u,u=c,c=a,a=i+y|0,i=o,o=s,s=r,r=y+h|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,s,o,i,a,c,u,f)}roundClean(){ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const As=ns(()=>new xa);function Ts(e,t){const n=t||"hex",r=As(ve(e,{strict:!1})?oe(e):e);return n==="bytes"?r:k(r)}function Pa(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Ts(t,"bytes");return s.set([n],0),r==="bytes"?s:D(s)}function $s(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const o of t)s.push(Pa({commitment:o,to:r,version:n}));return s}const Nr=6,Os=32,er=4096,ks=Os*er,jr=ks*Nr-1-1*er*Nr,Cs=1;class Ea extends v{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class Fs extends v{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class Ba extends v{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class Ia extends v{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Cs}`,`Received: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function Aa(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?ue(e.data):e.data,r=U(n);if(!r)throw new Fs;if(r>jr)throw new Ea({maxSize:jr,size:r});const s=[];let o=!0,i=0;for(;o;){const a=_n(new Uint8Array(ks));let c=0;for(;ca.bytes):s.map(a=>D(a.bytes))}function Ss(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Aa({data:t,to:r}),o=e.commitments??Xn({blobs:s,kzg:n,to:r}),i=e.proofs??Qn({blobs:s,commitments:o,kzg:n,to:r}),a=[];for(let c=0;c"u"&&l&&(d.nonce=await F(e,Is,"getTransactionCount")({address:l.address,blockTag:"pending"})),(u.includes("fees")||u.includes("type"))&&typeof f>"u")try{d.type=Ns(d)}catch{const h=await p();d.type=typeof(h==null?void 0:h.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(u.includes("fees"))if(d.type!=="legacy"&&d.type!=="eip2930"){if(typeof d.maxFeePerGas>"u"||typeof d.maxPriorityFeePerGas>"u"){const h=await p(),{maxFeePerGas:b,maxPriorityFeePerGas:m}=await xn(e,{block:h,chain:s,request:d});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas"u"&&(d.gas=await F(e,tr,"estimateGas")({...d,account:l?{address:l.address,type:"json-rpc"}:void 0})),Zn(d),delete d.parameters,d}async function tr(e,t){var s,o,i;const n=t.account??e.account,r=n?Be(n):void 0;try{const{accessList:a,blobs:c,blobVersionedHashes:u,blockNumber:f,blockTag:l,data:d,gas:y,gasPrice:p,maxFeePerBlobGas:h,maxFeePerGas:b,maxPriorityFeePerGas:m,nonce:g,to:w,value:P,...A}=await Rs(e,{...t,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),E=(f?N(f):void 0)||l;Zn(t);const I=(i=(o=(s=e.chain)==null?void 0:s.formatters)==null?void 0:o.transactionRequest)==null?void 0:i.format,C=(I||Vn)({...xs(A,{format:I}),from:r==null?void 0:r.address,accessList:a,blobs:c,blobVersionedHashes:u,data:d,gas:y,gasPrice:p,maxFeePerBlobGas:h,maxFeePerGas:b,maxPriorityFeePerGas:m,nonce:g,to:w,value:P}),O=await e.request({method:"eth_estimateGas",params:E?[C,E]:[C]});return BigInt(O)}catch(a){throw aa(a,{...t,account:r,chain:e.chain})}}async function $a(e,t){const{abi:n,address:r,args:s,functionName:o,...i}=t,a=Ne({abi:n,args:s,functionName:o});try{return await F(e,tr,"estimateGas")({data:a,to:r,...i})}catch(c){const u=i.account?Be(i.account):void 0;throw vt(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:u==null?void 0:u.address})}}const Rr="/docs/contract/decodeEventLog";function nr(e){const{abi:t,data:n,strict:r,topics:s}=e,o=r??!0,[i,...a]=s;if(!i)throw new Ro({docsPath:Rr});const c=t.find(h=>h.type==="event"&&i===Rn(fe(h)));if(!(c&&"name"in c)||c.type!=="event")throw new Qr(i,{docsPath:Rr});const{name:u,inputs:f}=c,l=f==null?void 0:f.some(h=>!("name"in h&&h.name));let d=l?[]:{};const y=f.filter(h=>"indexed"in h&&h.indexed);for(let h=0;h!("indexed"in h&&h.indexed));if(p.length>0){if(n&&n!=="0x")try{const h=Ht(p,n);if(h)if(l)d=[...d,...h];else for(let b=0;b0?d:void 0}}function Oa({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Ht([e],t)||[])[0]}function rr({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map(s=>{var o;try{const i=nr({...s,abi:e,strict:r});return t&&!t.includes(i.eventName)?null:{...i,...s}}catch(i){let a,c;if(i instanceof Qr)return null;if(i instanceof rt||i instanceof Ut){if(r)return null;a=i.abiItem.name,c=(o=i.abiItem.inputs)==null?void 0:o.some(u=>!("name"in u&&u.name))}return{...s,args:c?[]:{},eventName:a}}}).filter(Boolean)}function he(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function sr(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:o,events:i,args:a,strict:c}={}){const u=c??!1,f=i??(o?[o]:void 0);let l=[];f&&(l=[f.flatMap(p=>It({abi:[p],eventName:p.name,args:a}))],o&&(l=l[0]));let d;n?d=await e.request({method:"eth_getLogs",params:[{address:t,topics:l,blockHash:n}]}):d=await e.request({method:"eth_getLogs",params:[{address:t,topics:l,fromBlock:typeof r=="bigint"?N(r):r,toBlock:typeof s=="bigint"?N(s):s}]});const y=d.map(p=>he(p));return f?rr({abi:f,logs:y,strict:u}):y}async function Ls(e,t){const{abi:n,address:r,args:s,blockHash:o,eventName:i,fromBlock:a,toBlock:c,strict:u}=t,f=i?Bt({abi:n,name:i}):void 0,l=f?void 0:n.filter(d=>d.type==="event");return F(e,sr,"getLogs")({address:r,args:s,blockHash:o,event:f,events:l,fromBlock:a,toBlock:c,strict:u})}const nn="/docs/contract/decodeFunctionResult";function Ke(e){const{abi:t,args:n,functionName:r,data:s}=e;let o=t[0];if(r){const a=Bt({abi:t,args:n,name:r});if(!a)throw new jt(r,{docsPath:nn});o=a}if(o.type!=="function")throw new jt(void 0,{docsPath:nn});if(!o.outputs)throw new Lo(o.name,{docsPath:nn});const i=Ht(o.outputs,s);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const Pn=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],zs=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Ms=[...zs,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],ka=[...zs,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],Lr=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],zr=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Ca=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Fa="0x82ad56cb";class En extends v{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class ml extends v{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class gl extends v{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class Us extends v{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class qt extends v{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}function Je({blockNumber:e,chain:t,contract:n}){var s;const r=(s=t==null?void 0:t.contracts)==null?void 0:s[n];if(!r)throw new En({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new En({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function Sa(e,{docsPath:t,...n}){const r=(()=>{const s=vs(e,n);return s instanceof qn?e:s})();return new gs(r,{docsPath:t,...n})}const rn=new Map;function Gs({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const o=async()=>{const f=c();i();const l=f.map(({args:d})=>d);l.length!==0&&e(l).then(d=>{var y;s&&Array.isArray(d)&&d.sort(s);for(let p=0;p{var y;for(let p=0;prn.delete(t),a=()=>c().map(({args:f})=>f),c=()=>rn.get(t)||[],u=f=>rn.set(t,[...c(),f]);return{flush:i,async schedule(f){const l={},d=new Promise((h,b)=>{l.resolve=h,l.reject=b});return(n==null?void 0:n([...a(),f]))&&o(),c().length>0?(u({args:f,pendingPromise:l}),d):(u({args:f,pendingPromise:l}),setTimeout(o,r),d)}}}async function Vt(e,t){var P,A,x,E;const{account:n=e.account,batch:r=!!((P=e.batch)!=null&&P.multicall),blockNumber:s,blockTag:o="latest",accessList:i,blobs:a,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:l,maxFeePerGas:d,maxPriorityFeePerGas:y,nonce:p,to:h,value:b,stateOverride:m,...g}=t,w=n?Be(n):void 0;try{Zn(t);const T=(s?N(s):void 0)||o,C=za(m),O=(E=(x=(A=e.chain)==null?void 0:A.formatters)==null?void 0:x.transactionRequest)==null?void 0:E.format,j=(O||Vn)({...xs(g,{format:O}),from:w==null?void 0:w.address,accessList:i,blobs:a,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:l,maxFeePerGas:d,maxPriorityFeePerGas:y,nonce:p,to:h,value:b});if(r&&Na({request:j})&&!C)try{return await ja(e,{...j,blockNumber:s,blockTag:o})}catch(B){if(!(B instanceof Us)&&!(B instanceof En))throw B}const J=await e.request({method:"eth_call",params:C?[j,T,C]:[j,T]});return J==="0x"?{data:void 0}:{data:J}}catch(I){const T=Ra(I),{offchainLookup:C,offchainLookupSignature:O}=await $o(()=>import("./ccip.DOeQ8225.js"),__vite__mapDeps([0,1,2,3]),import.meta.url);if(e.ccipRead!==!1&&(T==null?void 0:T.slice(0,10))===O&&h)return{data:await C(e,{data:T,to:h})};throw Sa(I,{...t,account:w,chain:e.chain})}}function Na({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(Fa)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function ja(e,t){var h;const{batchSize:n=1024,wait:r=0}=typeof((h=e.batch)==null?void 0:h.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:o="latest",data:i,multicallAddress:a,to:c}=t;let u=a;if(!u){if(!e.chain)throw new Us;u=Je({blockNumber:s,chain:e.chain,contract:"multicall3"})}const l=(s?N(s):void 0)||o,{schedule:d}=Gs({id:`${e.uid}.${l}`,wait:r,shouldSplitBatch(b){return b.reduce((g,{data:w})=>g+(w.length-2),0)>n*2},fn:async b=>{const m=b.map(P=>({allowFailure:!0,callData:P.data,target:P.to})),g=Ne({abi:Pn,args:[m],functionName:"aggregate3"}),w=await e.request({method:"eth_call",params:[{data:g,to:u},l]});return Ke({abi:Pn,args:[m],functionName:"aggregate3",data:w||"0x"})}}),[{returnData:y,success:p}]=await d({data:i,to:c});if(!p)throw new Dn({data:y});return y==="0x"?{data:void 0}:{data:y}}function Ra(e){var n;if(!(e instanceof v))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}function Mr(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new wr({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new wr({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function La(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:o}=e,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=N(t)),n!==void 0&&(i.nonce=N(n)),r!==void 0&&(i.state=Mr(r)),s!==void 0){if(i.state)throw new Wi;i.stateDiff=Mr(s)}return i}function za(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!q(n,{strict:!1}))throw new ee({address:n});if(t[n])throw new Zi({address:n});t[n]=La(r)}return t}async function Pe(e,t){const{abi:n,address:r,args:s,functionName:o,...i}=t,a=Ne({abi:n,args:s,functionName:o});try{const{data:c}=await F(e,Vt,"call")({...i,data:a,to:r});return Ke({abi:n,args:s,functionName:o,data:c||"0x"})}catch(c){throw vt(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:o})}}async function Ma(e,t){const{abi:n,address:r,args:s,dataSuffix:o,functionName:i,...a}=t,c=a.account?Be(a.account):e.account,u=Ne({abi:n,args:s,functionName:i});try{const{data:f}=await F(e,Vt,"call")({batch:!1,data:`${u}${o?o.replace("0x",""):""}`,to:r,...a,account:c}),l=Ke({abi:n,args:s,functionName:i,data:f||"0x"}),d=n.filter(y=>"name"in y&&y.name===t.functionName);return{result:l,request:{abi:d,address:r,args:s,dataSuffix:o,functionName:i,...a,account:c}}}catch(f){throw vt(f,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c==null?void 0:c.address})}}const sn=new Map,Ur=new Map;let Ua=0;function Ee(e,t,n){const r=++Ua,s=()=>sn.get(e)||[],o=()=>{const f=s();sn.set(e,f.filter(l=>l.id!==r))},i=()=>{const f=Ur.get(e);s().length===1&&f&&f(),o()},a=s();if(sn.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const c={};for(const f in t)c[f]=(...l)=>{var y,p;const d=s();if(d.length!==0)for(const h of d)(p=(y=h.fns)[f])==null||p.call(y,...l)};const u=n(c);return typeof u=="function"&&Ur.set(e,u),i}async function Bn(e){return new Promise(t=>setTimeout(t,e))}function Tt(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const o=()=>s=!1;return(async()=>{let a;t&&(a=await e({unpoll:o}));const c=await(n==null?void 0:n(a))??r;await Bn(c);const u=async()=>{s&&(await e({unpoll:o}),await Bn(r),u())};u()})(),o}const Ga=new Map,_a=new Map;function Ha(e){const t=(s,o)=>({clear:()=>o.delete(s),get:()=>o.get(s),set:i=>o.set(s,i)}),n=t(e,Ga),r=t(e,_a);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function Da(e,{cacheKey:t,cacheTime:n=1/0}){const r=Ha(t),s=r.response.get();if(s&&n>0&&new Date().getTime()-s.created.getTime()`blockNumber.${e}`;async function $t(e,{cacheTime:t=e.cacheTime}={}){const n=await Da(()=>e.request({method:"eth_blockNumber"}),{cacheKey:qa(e.uid),cacheTime:t});return BigInt(n)}async function Zt(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 s=r.map(o=>he(o));return!("abi"in t)||!t.abi?s:rr({abi:t.abi,logs:s,strict:n})}async function Wt(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function Va(e,t){const{abi:n,address:r,args:s,batch:o=!0,eventName:i,fromBlock:a,onError:c,onLogs:u,poll:f,pollingInterval:l=e.pollingInterval,strict:d}=t;return(typeof f<"u"?f:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const b=d??!1,m=V(["watchContractEvent",r,s,o,e.uid,i,l,b,a]);return Ee(m,{onLogs:u,onError:c},g=>{let w;a!==void 0&&(w=a-1n);let P,A=!1;const x=Tt(async()=>{var E;if(!A){try{P=await F(e,fs,"createContractEventFilter")({abi:n,address:r,args:s,eventName:i,strict:b,fromBlock:a})}catch{}A=!0;return}try{let I;if(P)I=await F(e,Zt,"getFilterChanges")({filter:P});else{const T=await F(e,$t,"getBlockNumber")({});w&&w!==T?I=await F(e,Ls,"getContractEvents")({abi:n,address:r,args:s,eventName:i,fromBlock:w+1n,toBlock:T,strict:b}):I=[],w=T}if(I.length===0)return;if(o)g.onLogs(I);else for(const T of I)g.onLogs([T])}catch(I){P&&I instanceof Ce&&(A=!1),(E=g.onError)==null||E.call(g,I)}},{emitOnBegin:!0,interval:l});return async()=>{P&&await F(e,Wt,"uninstallFilter")({filter:P}),x()}})})():(()=>{const b=d??!1,m=V(["watchContractEvent",r,s,o,e.uid,i,l,b]);let g=!0,w=()=>g=!1;return Ee(m,{onLogs:u,onError:c},P=>((async()=>{try{const A=(()=>{if(e.transport.type==="fallback"){const I=e.transport.transports.find(T=>T.config.type==="webSocket");return I?I.value:e.transport}return e.transport})(),x=i?It({abi:n,eventName:i,args:s}):[],{unsubscribe:E}=await A.subscribe({params:["logs",{address:r,topics:x}],onData(I){var C;if(!g)return;const T=I.result;try{const{eventName:O,args:L}=nr({abi:n,data:T.data,topics:T.topics,strict:d}),j=he(T,{args:L,eventName:O});P.onLogs([j])}catch(O){let L,j;if(O instanceof rt||O instanceof Ut){if(d)return;L=O.abiItem.name,j=(C=O.abiItem.inputs)==null?void 0:C.some(B=>!("name"in B&&B.name))}const J=he(T,{args:j?[]:{},eventName:L});P.onLogs([J])}},onError(I){var T;(T=P.onError)==null||T.call(P,I)}});w=E,g||w()}catch(A){c==null||c(A)}})(),()=>w()))})()}async function Za(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const In=256;let Ft=In,St;function Wa(e=11){if(!St||Ft+e>In*2){St="",Ft=0;for(let t=0;t{const g=m(b);for(const P in p)delete g[P];const w={...b,...g};return Object.assign(w,{extend:h(w)})}}return Object.assign(p,{extend:h(p)})}function An(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,o)=>{const i=async({count:a=0}={})=>{const c=async({error:u})=>{const f=typeof t=="function"?t({count:a,error:u}):t;f&&await Bn(f),i({count:a+1})};try{const u=await e();s(u)}catch(u){if(a{const{retryDelay:s=150,retryCount:o=3}={...t,...r};return An(async()=>{try{return await e(n)}catch(i){const a=i;switch(a.code){case it.code:throw new it(a);case at.code:throw new at(a);case ct.code:throw new ct(a);case ut.code:throw new ut(a);case ke.code:throw new ke(a);case Ce.code:throw new Ce(a);case lt.code:throw new lt(a);case ft.code:throw new ft(a);case dt.code:throw new dt(a);case ht.code:throw new ht(a);case De.code:throw new De(a);case pt.code:throw new pt(a);case Ge.code:throw new Ge(a);case bt.code:throw new bt(a);case yt.code:throw new yt(a);case mt.code:throw new mt(a);case gt.code:throw new gt(a);case wt.code:throw new wt(a);case 5e3:throw new Ge(a);default:throw i instanceof v?i:new sa(a)}}},{delay:({count:i,error:a})=>{var c;if(a&&a instanceof nt){const u=(c=a==null?void 0:a.headers)==null?void 0:c.get("Retry-After");if(u!=null&&u.match(/\d/))return parseInt(u)*1e3}return~~(1<Ja(i)})}}function Ja(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===De.code||e.code===ke.code:e instanceof nt&&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 Xa({key:e,name:t,request:n,retryCount:r=3,retryDelay:s=150,timeout:o,type:i},a){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:s,timeout:o,type:i},request:Ka(n,{retryCount:r,retryDelay:s}),value:a}}class Qa extends v{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function ec(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,o)=>{(async()=>{let i;try{const a=new AbortController;n>0&&(i=setTimeout(()=>{r?a.abort():o(t)},n)),s(await e({signal:(a==null?void 0:a.signal)||null}))}catch(a){a.name==="AbortError"&&o(t),o(a)}finally{clearTimeout(i)}})()})}function tc(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Gr=tc();function nc(e,t={}){return{async request(n){var l;const{body:r,onRequest:s=t.onRequest,onResponse:o=t.onResponse,timeout:i=t.timeout??1e4}=n,a={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:u,signal:f}=a;try{const d=await ec(async({signal:p})=>{const h={...a,body:Array.isArray(r)?V(r.map(g=>({jsonrpc:"2.0",id:g.id??Gr.take(),...g}))):V({jsonrpc:"2.0",id:r.id??Gr.take(),...r}),headers:{...c,"Content-Type":"application/json"},method:u||"POST",signal:f||(i>0?p:null)},b=new Request(e,h);return s&&await s(b),await fetch(e,h)},{errorInstance:new Sr({body:r,url:e}),timeout:i,signal:!0});o&&await o(d);let y;if((l=d.headers.get("Content-Type"))!=null&&l.startsWith("application/json")?y=await d.json():(y=await d.text(),y=JSON.parse(y||"{}")),!d.ok)throw new nt({body:r,details:V(y.error)||d.statusText,headers:d.headers,status:d.status,url:e});return y}catch(d){throw d instanceof nt||d instanceof Sr?d:new nt({body:r,details:d.message,url:e})}}}}function rc(e,t={}){const{batch:n,fetchOptions:r,key:s="http",name:o="HTTP JSON-RPC",onFetchRequest:i,onFetchResponse:a,retryDelay:c}=t;return({chain:u,retryCount:f,timeout:l})=>{const{batchSize:d=1e3,wait:y=0}=typeof n=="object"?n:{},p=t.retryCount??f,h=l??t.timeout??1e4,b=e||(u==null?void 0:u.rpcUrls.default.http[0]);if(!b)throw new Qa;const m=nc(b,{fetchOptions:r,onRequest:i,onResponse:a,timeout:h});return Xa({key:s,name:o,async request({method:g,params:w}){const P={method:g,params:w},{schedule:A}=Gs({id:`${e}`,wait:y,shouldSplitBatch(T){return T.length>d},fn:T=>m.request({body:T}),sort:(T,C)=>T.id-C.id}),x=async T=>n?A(T):[await m.request({body:T})],[{error:E,result:I}]=await x(P);if(E)throw new ws({body:P,error:E,url:b});return I},retryCount:p,retryDelay:c,timeout:h,type:"http"},{fetchOptions:r,url:b})}}function or(e,t){var r,s,o,i,a,c;if(!(e instanceof v))return!1;const n=e.walk(u=>u instanceof dn);return n instanceof dn?!!(((r=n.data)==null?void 0:r.errorName)==="ResolverNotFound"||((s=n.data)==null?void 0:s.errorName)==="ResolverWildcardNotSupported"||((o=n.data)==null?void 0:o.errorName)==="ResolverNotContract"||((i=n.data)==null?void 0:i.errorName)==="ResolverError"||((a=n.data)==null?void 0:a.errorName)==="HttpError"||(c=n.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&n.reason===ds[50]):!1}function _s(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return ve(t)?t:null}function Nt(e){let t=new Uint8Array(32).fill(0);if(!e)return D(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=_s(n[r]),o=s?oe(s):W(we(n[r]),"bytes");t=W(de([t,o]),"bytes")}return D(t)}function sc(e){return`[${e.slice(2)}]`}function oc(e){const t=new Uint8Array(32).fill(0);return e?_s(e)||W(we(e)):D(t)}function Yt(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(we(t).byteLength+2);let r=0;const s=t.split(".");for(let o=0;o255&&(i=we(sc(oc(s[o])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function ic(e,{blockNumber:t,blockTag:n,coinType:r,name:s,gatewayUrls:o,strict:i,universalResolverAddress:a}){let c=a;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Je({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const u=Ne({abi:zr,functionName:"addr",...r!=null?{args:[Nt(s),BigInt(r)]}:{args:[Nt(s)]}}),f={address:c,abi:Ms,functionName:"resolve",args:[k(Yt(s)),u],blockNumber:t,blockTag:n},l=F(e,Pe,"readContract"),d=o?await l({...f,args:[...f.args,o]}):await l(f);if(d[0]==="0x")return null;const y=Ke({abi:zr,args:r!=null?[Nt(s),BigInt(r)]:void 0,functionName:"addr",data:d[0]});return y==="0x"||_e(y)==="0x00"?null:y}catch(u){if(i)throw u;if(or(u,"resolve"))return null;throw u}}class ac extends v{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)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class tt extends v{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class ir extends v{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.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class cc extends v{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const uc=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,lc=/^(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,})(\/(?[\w\-.]+))?(?\/.*)?$/,fc=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dc=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function hc(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"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function _r(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Hs({uri:e,gatewayUrls:t}){const n=fc.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=_r(t==null?void 0:t.ipfs,"https://ipfs.io"),s=_r(t==null?void 0:t.arweave,"https://arweave.net"),o=e.match(uc),{protocol:i,subpath:a,target:c,subtarget:u=""}=(o==null?void 0:o.groups)||{},f=i==="ipns:/"||a==="ipns/",l=i==="ipfs:/"||a==="ipfs/"||lc.test(e);if(e.startsWith("http")&&!f&&!l){let y=e;return t!=null&&t.arweave&&(y=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:y,isOnChain:!1,isEncoded:!1}}if((f||l)&&c)return{uri:`${r}/${f?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let d=e.replace(dc,"");if(d.startsWith("s.json());return await ar({gatewayUrls:e,uri:Ds(n)})}catch{throw new ir({uri:t})}}async function ar({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Hs({uri:t,gatewayUrls:e});if(r||await hc(n))return n;throw new ir({uri:t})}function bc(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[o,i]=n.split(":"),[a,c]=r.split(":");if(!o||o.toLowerCase()!=="eip155")throw new tt({reason:"Only EIP-155 supported"});if(!i)throw new tt({reason:"Chain ID not found"});if(!c)throw new tt({reason:"Contract address not found"});if(!s)throw new tt({reason:"Token ID not found"});if(!a)throw new tt({reason:"ERC namespace not found"});return{chainID:parseInt(i),namespace:a.toLowerCase(),contractAddress:c,tokenID:s}}async function yc(e,{nft:t}){if(t.namespace==="erc721")return Pe(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 Pe(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 cc({namespace:t.namespace})}async function mc(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?gc(e,{gatewayUrls:t,record:n}):ar({uri:n,gatewayUrls:t})}async function gc(e,{gatewayUrls:t,record:n}){const r=bc(n),s=await yc(e,{nft:r}),{uri:o,isOnChain:i,isEncoded:a}=Hs({uri:s,gatewayUrls:t});if(i&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const u=a?atob(o.replace("data:application/json;base64,","")):o,f=JSON.parse(u);return ar({uri:Ds(f),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),pc({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,c)})}async function qs(e,{blockNumber:t,blockTag:n,name:r,key:s,gatewayUrls:o,strict:i,universalResolverAddress:a}){let c=a;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Je({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const u={address:c,abi:Ms,functionName:"resolve",args:[k(Yt(r)),Ne({abi:Lr,functionName:"text",args:[Nt(r),s]})],blockNumber:t,blockTag:n},f=F(e,Pe,"readContract"),l=o?await f({...u,args:[...u.args,o]}):await f(u);if(l[0]==="0x")return null;const d=Ke({abi:Lr,functionName:"text",data:l[0]});return d===""?null:d}catch(u){if(i)throw u;if(or(u,"resolve"))return null;throw u}}async function wc(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:o,strict:i,universalResolverAddress:a}){const c=await F(e,qs,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:a,gatewayUrls:o,strict:i});if(!c)return null;try{return await mc(e,{record:c,gatewayUrls:r})}catch{return null}}async function vc(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:s,strict:o,universalResolverAddress:i}){let a=i;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Je({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const u={address:a,abi:ka,functionName:"reverse",args:[k(Yt(c))],blockNumber:n,blockTag:r},f=F(e,Pe,"readContract"),[l,d]=s?await f({...u,args:[...u.args,s]}):await f(u);return t.toLowerCase()!==d.toLowerCase()?null:l}catch(u){if(o)throw u;if(or(u,"reverse"))return null;throw u}}async function xc(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:s}){let o=s;if(!o){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=Je({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[i]=await F(e,Pe,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[k(Yt(r))],blockNumber:t,blockTag:n});return i}async function Pc(e){const t=_t(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function Vs(e,{address:t,args:n,event:r,events:s,fromBlock:o,strict:i,toBlock:a}={}){const c=s??(r?[r]:void 0),u=_t(e,{method:"eth_newFilter"});let f=[];c&&(f=[c.flatMap(d=>It({abi:[d],eventName:d.name,args:n}))],r&&(f=f[0]));const l=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof o=="bigint"?N(o):o,toBlock:typeof a=="bigint"?N(a):a,...f.length?{topics:f}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:o,id:l,request:u(l),strict:!!i,toBlock:a,type:"event"}}async function Zs(e){const t=_t(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Ec(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?N(n):void 0,o=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(o)}async function Bc(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Ic(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?N(n):void 0;let o;return t?o=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):o=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]}),ae(o)}async function Ac(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?N(n):void 0,o=await e.request({method:"eth_getCode",params:[t,s||r]});if(o!=="0x")return o}function Tc(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 $c(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const o=n?N(n):void 0,i=await e.request({method:"eth_feeHistory",params:[N(t),o||r,s]});return Tc(i)}async function Oc(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(o=>he(o));return t.abi?rr({abi:t.abi,logs:s,strict:n}):s}function Ot(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const kc=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Cc=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Fc(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:Lc({domain:t}),...e.types};Rc({domain:t,message:n,primaryType:r,types:s});const o=["0x1901"];return t&&o.push(Sc({domain:t,types:s})),r!=="EIP712Domain"&&o.push(Ws({data:n,primaryType:r,types:s})),W(de(o))}function Sc({domain:e,types:t}){return Ws({data:e,primaryType:"EIP712Domain",types:t})}function Ws({data:e,primaryType:t,types:n}){const r=Ys({data:e,primaryType:t,types:n});return W(r)}function Ys({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[Nc({primaryType:t,types:n})];for(const o of n[t]){const[i,a]=Js({types:n,name:o.name,type:o.type,value:e[o.name]});r.push(i),s.push(a)}return Et(r,s)}function Nc({primaryType:e,types:t}){const n=k(jc({primaryType:e,types:t}));return W(n)}function jc({primaryType:e,types:t}){let n="";const r=Ks({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const o of s)n+=`${o}(${t[o].map(({name:i,type:a})=>`${a} ${i}`).join(",")})`;return n}function Ks({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r==null?void 0:r[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const o of t[s])Ks({primaryType:o.type,types:t},n);return n}function Js({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},W(Ys({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},W(r)];if(n==="string")return[{type:"bytes32"},W(k(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),o=r.map(i=>Js({name:t,type:s,types:e,value:i}));return[{type:"bytes32"},W(Et(o.map(([i])=>i),o.map(([,i])=>i)))]}return[{type:n},r]}function Rc(e){const{domain:t,message:n,primaryType:r,types:s}=e,o=(i,a)=>{for(const c of i){const{name:u,type:f}=c,l=a[u],d=f.match(Cc);if(d&&(typeof l=="number"||typeof l=="bigint")){const[h,b,m]=d;N(l,{signed:b==="int",size:parseInt(m)/8})}if(f==="address"&&typeof l=="string"&&!q(l))throw new ee({address:l});const y=f.match(kc);if(y){const[h,b]=y;if(b&&U(l)!==parseInt(b))throw new Mo({expectedSize:parseInt(b),givenSize:U(l)})}const p=s[f];p&&o(p,l)}};if(s.EIP712Domain&&t&&o(s.EIP712Domain,t),r!=="EIP712Domain"){const i=s[r];o(i,n)}}function Lc({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},typeof(e==null?void 0:e.chainId)=="number"&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const on="/docs/contract/encodeDeployData";function zc(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(i=>"type"in i&&i.type==="constructor");if(!s)throw new Fo({docsPath:on});if(!("inputs"in s))throw new Pr({docsPath:on});if(!s.inputs||s.inputs.length===0)throw new Pr({docsPath:on});const o=Et(s.inputs,n);return Se([r,o])}function qe(e,t="hex"){const n=Xs(e),r=_n(new Uint8Array(n.length));return n.encode(r),t==="hex"?D(r.bytes):r.bytes}function Xs(e){return Array.isArray(e)?Mc(e.map(t=>Xs(t))):Uc(e)}function Mc(e){const t=e.reduce((s,o)=>s+o.length,0),n=Qs(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:o}of e)o(s)}}}function Uc(e){const t=typeof e=="string"?ue(e):e,n=Qs(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Qs(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 v("Length is too large.")}const Gc={"0x0":"reverted","0x1":"success"};function eo(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>he(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ae(e.transactionIndex):null,status:e.status?Gc[e.status]:null,type:e.type?Es[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const _c=Dt("transactionReceipt",eo),Hc=`Ethereum Signed Message: +`;function Dc(e,t){const n=typeof e=="string"?we(e):e.raw instanceof Uint8Array?e.raw:oe(e.raw),r=we(`${Hc}${n.length}`);return W(de([r,n]),t)}function qc(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Fs;for(const n of t){const r=U(n),s=ae(st(n,0,1));if(r!==32)throw new Ba({hash:n,size:r});if(s!==Cs)throw new Ia({hash:n,version:s})}}to(e)}function to(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new qt({chainId:t});if(s&&!q(s))throw new ee({address:s});if(r&&r>2n**256n-1n)throw new Fe({maxFeePerGas:r});if(n&&r&&n>r)throw new xt({maxFeePerGas:r,maxPriorityFeePerGas:n})}function Vc(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:o}=e;if(t<=0)throw new qt({chainId:t});if(o&&!q(o))throw new ee({address:o});if(n||s)throw new v("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new Fe({maxFeePerGas:r})}function Zc(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:o,accessList:i}=e;if(o&&!q(o))throw new ee({address:o});if(typeof t<"u"&&t<=0)throw new qt({chainId:t});if(n||s)throw new v("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new Fe({maxFeePerGas:r});if(i)throw new v("`accessList` is not a valid Legacy Transaction attribute.")}function cr(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n"u"||typeof y>"u")){const w=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(x=>D(x)),P=e.kzg,A=Xn({blobs:w,kzg:P});if(typeof d>"u"&&(d=$s({commitments:A})),typeof y>"u"){const x=Qn({blobs:w,commitments:A,kzg:P});y=Ss({blobs:w,commitments:A,proofs:x})}}const p=cr(f),h=[k(n),s?k(s):"0x",u?k(u):"0x",c?k(c):"0x",r?k(r):"0x",o??"0x",i?k(i):"0x",l??"0x",p,a?k(a):"0x",d??[],...ur(e,t)],b=[],m=[],g=[];if(y)for(let w=0;w{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 l=27n+(t.v===27n?0n:1n);if(t.v!==l)throw new Ji({v:t.v});return l})();u=[...u,k(f),t.r,t.s]}else n>0&&(u=[...u,k(n),"0x","0x"]);return qe(u)}function ur(e,t){const{r:n,s:r,v:s,yParity:o}=t??e;return typeof n>"u"?[]:typeof r>"u"?[]:typeof s>"u"&&typeof o>"u"?[]:[typeof o=="number"?o?k(1):"0x":s===0n?"0x":s===1n?k(1):s===27n?"0x":k(1),_e(n),_e(r)]}function Qc(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function eu(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?ae(e.nonce):void 0,storageProof:e.storageProof?Qc(e.storageProof):void 0}}async function tu(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const o=r??"latest",i=n!==void 0?N(n):void 0,a=await e.request({method:"eth_getProof",params:[t,s,i||o]});return eu(a)}async function nu(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const o=n!==void 0?N(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,o||r]})}async function lr(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:o}){var f,l,d;const i=r||"latest",a=n!==void 0?N(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,N(o)]}):(a||i)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||i,N(o)]})),!c)throw new ys({blockHash:t,blockNumber:n,blockTag:i,hash:s,index:o});return(((d=(l=(f=e.chain)==null?void 0:f.formatters)==null?void 0:l.transaction)==null?void 0:d.format)||Yn)(c)}async function ru(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([F(e,$t,"getBlockNumber")({}),t?F(e,lr,"getBlockNumber")({hash:t}):void 0]),o=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return o?r-o+1n:0n}async function Tn(e,{hash:t}){var s,o,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new ms({hash:t});return(((i=(o=(s=e.chain)==null?void 0:s.formatters)==null?void 0:o.transactionReceipt)==null?void 0:i.format)||eo)(n)}async function su(e,t){var b;const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:o,multicallAddress:i,stateOverride:a}=t,c=t.contracts,u=r??(typeof((b=e.batch)==null?void 0:b.multicall)=="object"&&e.batch.multicall.batchSize||1024);let f=i;if(!f){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");f=Je({blockNumber:s,chain:e.chain,contract:"multicall3"})}const l=[[]];let d=0,y=0;for(let m=0;m0&&y>u&&l[d].length>0&&(d++,y=(x.length-2)/2,l[d]=[]),l[d]=[...l[d],{allowFailure:!0,callData:x,target:w}]}catch(x){const E=vt(x,{abi:g,address:w,args:P,docsPath:"/docs/contract/multicall",functionName:A});if(!n)throw E;l[d]=[...l[d],{allowFailure:!0,callData:"0x",target:w}]}}const p=await Promise.allSettled(l.map(m=>F(e,Pe,"readContract")({abi:Pn,address:f,args:[m],blockNumber:s,blockTag:o,functionName:"aggregate3",stateOverride:a}))),h=[];for(let m=0;me instanceof Uint8Array,au=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ve(e){if(!Jt(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+s.length,0));let n=0;return e.forEach(r=>{if(!Jt(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function so(e,t){if(e.length!==t.length)return!1;for(let n=0;nno;e>>=Kt,t+=1);return t}function fu(e,t){return e>>BigInt(t)&Kt}const du=(e,t,n)=>e|(n?Kt:no)<(iu<new Uint8Array(e),Hr=e=>Uint8Array.from(e);function oo(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=an(e),s=an(e),o=0;const i=()=>{r.fill(1),s.fill(0),o=0},a=(...l)=>n(s,r,...l),c=(l=an())=>{s=a(Hr([0]),l),r=a(),l.length!==0&&(s=a(Hr([1]),l),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const d=[];for(;l{i(),c(l);let y;for(;!(y=d(u()));)c();return i(),y}}const hu={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function kt(e,t,n={}){const r=(s,o,i)=>{const a=hu[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);const c=e[s];if(!(i&&c===void 0)&&!a(c,e))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${o}`)};for(const[s,o]of Object.entries(t))r(s,o,!1);for(const[s,o]of Object.entries(n))r(s,o,!0);return e}const pu=Object.freeze(Object.defineProperty({__proto__:null,bitGet:fu,bitLen:lu,bitMask:pr,bitSet:du,bytesToHex:Ve,bytesToNumberBE:Oe,bytesToNumberLE:dr,concatBytes:Pt,createHmacDrbg:oo,ensureBytes:se,equalBytes:so,hexToBytes:Ze,hexToNumber:fr,numberToBytesBE:We,numberToBytesLE:hr,numberToHexUnpadded:ro,numberToVarBytesBE:cu,utf8ToBytes:uu,validateObject:kt},Symbol.toStringTag,{value:"Module"}));function bu(e,t){const n=ve(e)?oe(e):e,r=ve(t)?oe(t):t;return so(n,r)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _=BigInt(0),M=BigInt(1),Ae=BigInt(2),yu=BigInt(3),$n=BigInt(4),Dr=BigInt(5),qr=BigInt(8);BigInt(9);BigInt(16);function Z(e,t){const n=e%t;return n>=_?n:t+n}function mu(e,t,n){if(n<=_||t<_)throw new Error("Expected power/modulo > 0");if(n===M)return _;let r=M;for(;t>_;)t&M&&(r=r*e%n),e=e*e%n,t>>=M;return r}function te(e,t,n){let r=e;for(;t-- >_;)r*=r,r%=n;return r}function On(e,t){if(e===_||t<=_)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Z(e,t),r=t,s=_,o=M;for(;n!==_;){const a=r/n,c=r%n,u=s-o*a;r=n,n=c,s=o,o=u}if(r!==M)throw new Error("invert: does not exist");return Z(s,t)}function gu(e){const t=(e-M)/Ae;let n,r,s;for(n=e-M,r=0;n%Ae===_;n/=Ae,r++);for(s=Ae;s(r[s]="function",r),t);return kt(e,n)}function Pu(e,t,n){if(n<_)throw new Error("Expected power > 0");if(n===_)return e.ONE;if(n===M)return t;let r=e.ONE,s=t;for(;n>_;)n&M&&(r=e.mul(r,s)),s=e.sqr(s),n>>=M;return r}function Eu(e,t){const n=new Array(t.length),r=t.reduce((o,i,a)=>e.is0(i)?o:(n[a]=o,e.mul(o,i)),e.ONE),s=e.inv(r);return t.reduceRight((o,i,a)=>e.is0(i)?o:(n[a]=e.mul(o,n[a]),e.mul(o,i)),s),n}function io(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Bu(e,t,n=!1,r={}){if(e<=_)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=io(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const i=wu(e),a=Object.freeze({ORDER:e,BITS:s,BYTES:o,MASK:pr(s),ZERO:_,ONE:M,create:c=>Z(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return _<=c&&cc===_,isOdd:c=>(c&M)===M,neg:c=>Z(-c,e),eql:(c,u)=>c===u,sqr:c=>Z(c*c,e),add:(c,u)=>Z(c+u,e),sub:(c,u)=>Z(c-u,e),mul:(c,u)=>Z(c*u,e),pow:(c,u)=>Pu(a,c,u),div:(c,u)=>Z(c*On(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>On(c,e),sqrt:r.sqrt||(c=>i(a,c)),invertBatch:c=>Eu(a,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>n?hr(c,o):We(c,o),fromBytes:c=>{if(c.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);return n?dr(c):Oe(c)}});return Object.freeze(a)}function ao(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 co(e){const t=ao(e);return t+Math.ceil(t/2)}function Iu(e,t,n=!1){const r=e.length,s=ao(t),o=co(t);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const i=n?Oe(e):dr(e),a=Z(i,t-M)+M;return n?hr(a,s):We(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Au=BigInt(0),cn=BigInt(1);function Tu(e,t){const n=(s,o)=>{const i=o.negate();return s?i:o},r=s=>{const o=Math.ceil(t/s)+1,i=2**(s-1);return{windows:o,windowSize:i}};return{constTimeNegate:n,unsafeLadder(s,o){let i=e.ZERO,a=s;for(;o>Au;)o&cn&&(i=i.add(a)),a=a.double(),o>>=cn;return i},precomputeWindow(s,o){const{windows:i,windowSize:a}=r(o),c=[];let u=s,f=u;for(let l=0;l>=y,b>c&&(b-=d,i+=cn);const m=h,g=h+Math.abs(b)-1,w=p%2!==0,P=b<0;b===0?f=f.add(n(w,o[m])):u=u.add(n(P,o[g]))}return{p:u,f}},wNAFCached(s,o,i,a){const c=s._WINDOW_SIZE||1;let u=o.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&o.set(s,a(u))),this.wNAF(c,u,i)}}}function uo(e){return xu(e.Fp),kt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...io(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $u(e){const t=uo(e);kt(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:Ou,hexToBytes:ku}=pu,Te={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Te;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Ou(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Te,n=typeof e=="string"?ku(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:o}=Te._parseInt(n.subarray(2)),{d:i,l:a}=Te._parseInt(o);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:i}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const f=u.toString(16);return f.length&1?`0${f}`:f},r=t(n(e.s)),s=t(n(e.r)),o=r.length/2,i=s.length/2,a=n(o),c=n(i);return`30${n(i+o+4)}02${c}${s}02${a}${r}`}},ce=BigInt(0),ne=BigInt(1);BigInt(2);const Vr=BigInt(3);BigInt(4);function Cu(e){const t=$u(e),{Fp:n}=t,r=t.toBytes||((p,h,b)=>{const m=h.toAffine();return Pt(Uint8Array.from([4]),n.toBytes(m.x),n.toBytes(m.y))}),s=t.fromBytes||(p=>{const h=p.subarray(1),b=n.fromBytes(h.subarray(0,n.BYTES)),m=n.fromBytes(h.subarray(n.BYTES,2*n.BYTES));return{x:b,y:m}});function o(p){const{a:h,b}=t,m=n.sqr(p),g=n.mul(m,p);return n.add(n.add(g,n.mul(p,h)),b)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function i(p){return typeof p=="bigint"&&cen.eql(w,n.ZERO);return g(b)&&g(m)?l.ZERO:new l(b,m,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(h){const b=n.invertBatch(h.map(m=>m.pz));return h.map((m,g)=>m.toAffine(b[g])).map(l.fromAffine)}static fromHex(h){const b=l.fromAffine(s(se("pointHex",h)));return b.assertValidity(),b}static fromPrivateKey(h){return l.BASE.multiply(c(h))}_setWindowSize(h){this._WINDOW_SIZE=h,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:h,y:b}=this.toAffine();if(!n.isValid(h)||!n.isValid(b))throw new Error("bad point: x or y not FE");const m=n.sqr(b),g=o(h);if(!n.eql(m,g))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:h}=this.toAffine();if(n.isOdd)return!n.isOdd(h);throw new Error("Field doesn't support isOdd")}equals(h){f(h);const{px:b,py:m,pz:g}=this,{px:w,py:P,pz:A}=h,x=n.eql(n.mul(b,A),n.mul(w,g)),E=n.eql(n.mul(m,A),n.mul(P,g));return x&&E}negate(){return new l(this.px,n.neg(this.py),this.pz)}double(){const{a:h,b}=t,m=n.mul(b,Vr),{px:g,py:w,pz:P}=this;let A=n.ZERO,x=n.ZERO,E=n.ZERO,I=n.mul(g,g),T=n.mul(w,w),C=n.mul(P,P),O=n.mul(g,w);return O=n.add(O,O),E=n.mul(g,P),E=n.add(E,E),A=n.mul(h,E),x=n.mul(m,C),x=n.add(A,x),A=n.sub(T,x),x=n.add(T,x),x=n.mul(A,x),A=n.mul(O,A),E=n.mul(m,E),C=n.mul(h,C),O=n.sub(I,C),O=n.mul(h,O),O=n.add(O,E),E=n.add(I,I),I=n.add(E,I),I=n.add(I,C),I=n.mul(I,O),x=n.add(x,I),C=n.mul(w,P),C=n.add(C,C),I=n.mul(C,O),A=n.sub(A,I),E=n.mul(C,T),E=n.add(E,E),E=n.add(E,E),new l(A,x,E)}add(h){f(h);const{px:b,py:m,pz:g}=this,{px:w,py:P,pz:A}=h;let x=n.ZERO,E=n.ZERO,I=n.ZERO;const T=t.a,C=n.mul(t.b,Vr);let O=n.mul(b,w),L=n.mul(m,P),j=n.mul(g,A),J=n.add(b,m),B=n.add(w,P);J=n.mul(J,B),B=n.add(O,L),J=n.sub(J,B),B=n.add(b,g);let $=n.add(w,A);return B=n.mul(B,$),$=n.add(O,j),B=n.sub(B,$),$=n.add(m,g),x=n.add(P,A),$=n.mul($,x),x=n.add(L,j),$=n.sub($,x),I=n.mul(T,B),x=n.mul(C,j),I=n.add(x,I),x=n.sub(L,I),I=n.add(L,I),E=n.mul(x,I),L=n.add(O,O),L=n.add(L,O),j=n.mul(T,j),B=n.mul(C,B),L=n.add(L,j),j=n.sub(O,j),j=n.mul(T,j),B=n.add(B,j),O=n.mul(L,B),E=n.add(E,O),O=n.mul($,B),x=n.mul(J,x),x=n.sub(x,O),O=n.mul(J,L),I=n.mul($,I),I=n.add(I,O),new l(x,E,I)}subtract(h){return this.add(h.negate())}is0(){return this.equals(l.ZERO)}wNAF(h){return y.wNAFCached(this,u,h,b=>{const m=n.invertBatch(b.map(g=>g.pz));return b.map((g,w)=>g.toAffine(m[w])).map(l.fromAffine)})}multiplyUnsafe(h){const b=l.ZERO;if(h===ce)return b;if(a(h),h===ne)return this;const{endo:m}=t;if(!m)return y.unsafeLadder(this,h);let{k1neg:g,k1:w,k2neg:P,k2:A}=m.splitScalar(h),x=b,E=b,I=this;for(;w>ce||A>ce;)w&ne&&(x=x.add(I)),A&ne&&(E=E.add(I)),I=I.double(),w>>=ne,A>>=ne;return g&&(x=x.negate()),P&&(E=E.negate()),E=new l(n.mul(E.px,m.beta),E.py,E.pz),x.add(E)}multiply(h){a(h);let b=h,m,g;const{endo:w}=t;if(w){const{k1neg:P,k1:A,k2neg:x,k2:E}=w.splitScalar(b);let{p:I,f:T}=this.wNAF(A),{p:C,f:O}=this.wNAF(E);I=y.constTimeNegate(P,I),C=y.constTimeNegate(x,C),C=new l(n.mul(C.px,w.beta),C.py,C.pz),m=I.add(C),g=T.add(O)}else{const{p:P,f:A}=this.wNAF(b);m=P,g=A}return l.normalizeZ([m,g])[0]}multiplyAndAddUnsafe(h,b,m){const g=l.BASE,w=(A,x)=>x===ce||x===ne||!A.equals(g)?A.multiplyUnsafe(x):A.multiply(x),P=w(this,b).add(w(h,m));return P.is0()?void 0:P}toAffine(h){const{px:b,py:m,pz:g}=this,w=this.is0();h==null&&(h=w?n.ONE:n.inv(g));const P=n.mul(b,h),A=n.mul(m,h),x=n.mul(g,h);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(x,n.ONE))throw new Error("invZ was invalid");return{x:P,y:A}}isTorsionFree(){const{h,isTorsionFree:b}=t;if(h===ne)return!0;if(b)return b(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h,clearCofactor:b}=t;return h===ne?this:b?b(l,this):this.multiplyUnsafe(t.h)}toRawBytes(h=!0){return this.assertValidity(),r(l,this,h)}toHex(h=!0){return Ve(this.toRawBytes(h))}}l.BASE=new l(t.Gx,t.Gy,n.ONE),l.ZERO=new l(n.ZERO,n.ONE,n.ZERO);const d=t.nBitLength,y=Tu(l,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:i}}function Fu(e){const t=uo(e);return kt(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Su(e){const t=Fu(e),{Fp:n,n:r}=t,s=n.BYTES+1,o=2*n.BYTES+1;function i(B){return ceVe(We(B,t.nByteLength));function p(B){const $=r>>ne;return B>$}function h(B){return p(B)?a(-B):B}const b=(B,$,S)=>Oe(B.slice($,S));class m{constructor($,S,z){this.r=$,this.s=S,this.recovery=z,this.assertValidity()}static fromCompact($){const S=t.nByteLength;return $=se("compactSignature",$,S*2),new m(b($,0,S),b($,S,2*S))}static fromDER($){const{r:S,s:z}=Te.toSig(se("DER",$));return new m(S,z)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit($){return new m(this.r,this.s,$)}recoverPublicKey($){const{r:S,s:z,recovery:R}=this,G=E(se("msgHash",$));if(R==null||![0,1,2,3].includes(R))throw new Error("recovery id invalid");const X=R===2||R===3?S+t.n:S;if(X>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Q=R&1?"03":"02",pe=u.fromHex(Q+y(X)),be=c(X),je=a(-G*be),Xe=a(z*be),ye=u.BASE.multiplyAndAddUnsafe(pe,je,Xe);if(!ye)throw new Error("point at infinify");return ye.assertValidity(),ye}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Ze(this.toDERHex())}toDERHex(){return Te.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ze(this.toCompactHex())}toCompactHex(){return y(this.r)+y(this.s)}}const g={isValidPrivateKey(B){try{return f(B),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const B=co(t.n);return Iu(t.randomBytes(B),t.n)},precompute(B=8,$=u.BASE){return $._setWindowSize(B),$.multiply(BigInt(3)),$}};function w(B,$=!0){return u.fromPrivateKey(B).toRawBytes($)}function P(B){const $=B instanceof Uint8Array,S=typeof B=="string",z=($||S)&&B.length;return $?z===s||z===o:S?z===2*s||z===2*o:B instanceof u}function A(B,$,S=!0){if(P(B))throw new Error("first arg must be private key");if(!P($))throw new Error("second arg must be public key");return u.fromHex($).multiply(f(B)).toRawBytes(S)}const x=t.bits2int||function(B){const $=Oe(B),S=B.length*8-t.nBitLength;return S>0?$>>BigInt(S):$},E=t.bits2int_modN||function(B){return a(x(B))},I=pr(t.nBitLength);function T(B){if(typeof B!="bigint")throw new Error("bigint expected");if(!(ce<=B&&BIe in S))throw new Error("sign() legacy options not supported");const{hash:z,randomBytes:R}=t;let{lowS:G,prehash:X,extraEntropy:Q}=S;G==null&&(G=!0),B=se("msgHash",B),X&&(B=se("prehashed msgHash",z(B)));const pe=E(B),be=f($),je=[T(be),T(pe)];if(Q!=null){const Ie=Q===!0?R(n.BYTES):Q;je.push(se("extraEntropy",Ie))}const Xe=Pt(...je),ye=pe;function Xt(Ie){const Re=x(Ie);if(!d(Re))return;const yr=c(Re),Le=u.BASE.multiply(Re).toAffine(),re=a(Le.x);if(re===ce)return;const ze=a(yr*a(ye+re*be));if(ze===ce)return;let mr=(Le.x===re?0:2)|Number(Le.y&ne),gr=ze;return G&&p(ze)&&(gr=h(ze),mr^=1),new m(re,gr,mr)}return{seed:Xe,k2sig:Xt}}const O={lowS:t.lowS,prehash:!1},L={lowS:t.lowS,prehash:!1};function j(B,$,S=O){const{seed:z,k2sig:R}=C(B,$,S),G=t;return oo(G.hash.outputLen,G.nByteLength,G.hmac)(z,R)}u.BASE._setWindowSize(8);function J(B,$,S,z=L){var Le;const R=B;if($=se("msgHash",$),S=se("publicKey",S),"strict"in z)throw new Error("options.strict was renamed to lowS");const{lowS:G,prehash:X}=z;let Q,pe;try{if(typeof R=="string"||R instanceof Uint8Array)try{Q=m.fromDER(R)}catch(re){if(!(re instanceof Te.Err))throw re;Q=m.fromCompact(R)}else if(typeof R=="object"&&typeof R.r=="bigint"&&typeof R.s=="bigint"){const{r:re,s:ze}=R;Q=new m(re,ze)}else throw new Error("PARSE");pe=u.fromHex(S)}catch(re){if(re.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(G&&Q.hasHighS())return!1;X&&($=t.hash($));const{r:be,s:je}=Q,Xe=E($),ye=c(je),Xt=a(Xe*ye),Ie=a(be*ye),Re=(Le=u.BASE.multiplyAndAddUnsafe(pe,Xt,Ie))==null?void 0:Le.toAffine();return Re?a(Re.x)===be:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:A,sign:j,verify:J,ProjectivePoint:u,Signature:m,utils:g}}class lo extends Nn{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,qo(t);const r=Gt(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 s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?t.create().update(r).digest():r);for(let i=0;inew lo(e,t).update(n).digest();fo.create=(e,t)=>new lo(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Nu(e){return{hash:e,hmac:(t,...n)=>fo(e,t,ti(...n)),randomBytes:ni}}function ju(e,t){const n=r=>Su({...e,...Nu(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ho=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Zr=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ru=BigInt(1),kn=BigInt(2),Wr=(e,t)=>(e+t/kn)/t;function Lu(e){const t=ho,n=BigInt(3),r=BigInt(6),s=BigInt(11),o=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,f=u*u*e%t,l=te(f,n,t)*f%t,d=te(l,n,t)*f%t,y=te(d,kn,t)*u%t,p=te(y,s,t)*y%t,h=te(p,o,t)*p%t,b=te(h,a,t)*h%t,m=te(b,c,t)*b%t,g=te(m,a,t)*h%t,w=te(g,n,t)*f%t,P=te(w,i,t)*p%t,A=te(P,r,t)*u%t,x=te(A,kn,t);if(!Cn.eql(Cn.sqr(x),e))throw new Error("Cannot find square root");return x}const Cn=Bu(ho,void 0,void 0,{sqrt:Lu}),po=ju({a:BigInt(0),b:BigInt(7),Fp:Cn,n:Zr,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Zr,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ru*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,i=BigInt("0x100000000000000000000000000000000"),a=Wr(o*e,t),c=Wr(-r*e,t);let u=Z(e-a*n-c*s,t),f=Z(-a*r-c*o,t);const l=u>i,d=f>i;if(l&&(u=t-u),d&&(f=t-f),u>i||f>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:l,k1:u,k2neg:d,k2:f}}}},As);BigInt(0);po.ProjectivePoint;function zu({r:e,s:t,v:n,yParity:r}){const s=(()=>{if(r===0||r===1)return r;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new po.Signature(H(e),H(t)).toCompactHex()}${s===0?"1b":"1c"}`}async function bo(e,{address:t,hash:n,signature:r,...s}){const o=ve(r)?r:typeof r=="object"&&"r"in r&&"s"in r?zu(r):D(r);try{const{data:i}=await F(e,Vt,"call")({data:zc({abi:Ca,args:[t,n,o],bytecode:ou}),...s});return bu(i??"0x0","0x1")}catch(i){if(i instanceof gs)return!1;throw i}}async function Mu(e,{address:t,message:n,signature:r,...s}){const o=Dc(n);return bo(e,{address:t,hash:o,signature:r,...s})}async function Uu(e,t){const{address:n,signature:r,message:s,primaryType:o,types:i,domain:a,...c}=t,u=Fc({message:s,primaryType:o,types:i,domain:a});return bo(e,{address:n,hash:u,signature:r,...c})}function yo(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:o,pollingInterval:i=e.pollingInterval}){const a=typeof o<"u"?o:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket");let c;return a?(()=>{const l=V(["watchBlockNumber",e.uid,t,n,i]);return Ee(l,{onBlockNumber:r,onError:s},d=>Tt(async()=>{var y;try{const p=await F(e,$t,"getBlockNumber")({cacheTime:0});if(c){if(p===c)return;if(p-c>1&&n)for(let h=c+1n;hc)&&(d.onBlockNumber(p,c),c=p)}catch(p){(y=d.onError)==null||y.call(d,p)}},{emitOnBegin:t,interval:i}))})():(()=>{const l=V(["watchBlockNumber",e.uid,t,n]);return Ee(l,{onBlockNumber:r,onError:s},d=>{let y=!0,p=()=>y=!1;return(async()=>{try{const h=(()=>{if(e.transport.type==="fallback"){const m=e.transport.transports.find(g=>g.config.type==="webSocket");return m?m.value:e.transport}return e.transport})(),{unsubscribe:b}=await h.subscribe({params:["newHeads"],onData(m){var w;if(!y)return;const g=H((w=m.result)==null?void 0:w.number);d.onBlockNumber(g,c),c=g},onError(m){var g;(g=d.onError)==null||g.call(d,m)}});p=b,y||p()}catch(h){s==null||s(h)}})(),()=>p()})})()}async function Gu(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,retryCount:o=6,retryDelay:i=({count:c})=>~~(1<{a&&setTimeout(()=>p(new ea({hash:n})),a);const h=Ee(c,{onReplaced:r,resolve:y,reject:p},b=>{const m=F(e,yo,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(g){if(d)return;let w=g;const P=A=>{m(),A(),h()};try{if(l){if(t>1&&(!l.blockNumber||w-l.blockNumber+1nb.resolve(l));return}if(u||(d=!0,await An(async()=>{u=await F(e,lr,"getTransaction")({hash:n}),u.blockNumber&&(w=u.blockNumber)},{delay:i,retryCount:o}),d=!1),l=await F(e,Tn,"getTransactionReceipt")({hash:n}),t>1&&(!l.blockNumber||w-l.blockNumber+1nb.resolve(l))}catch(A){if(A instanceof ys||A instanceof ms){if(!u){d=!1;return}try{f=u,d=!0;const x=await An(()=>F(e,xe,"getBlock")({blockNumber:w,includeTransactions:!0}),{delay:i,retryCount:o,shouldRetry:({error:T})=>T instanceof Ps});d=!1;const E=x.transactions.find(({from:T,nonce:C})=>T===f.from&&C===f.nonce);if(!E||(l=await F(e,Tn,"getTransactionReceipt")({hash:E.hash}),t>1&&(!l.blockNumber||w-l.blockNumber+1n{var T;(T=b.onReplaced)==null||T.call(b,{reason:I,replacedTransaction:f,transaction:E,transactionReceipt:l}),b.resolve(l)})}catch(x){P(()=>b.reject(x))}}else P(()=>b.reject(A))}}})})})}function _u(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:o,includeTransactions:i,poll:a,pollingInterval:c=e.pollingInterval}){const u=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),f=i??!1;let l;return u?(()=>{const p=V(["watchBlocks",e.uid,t,n,r,f,c]);return Ee(p,{onBlock:s,onError:o},h=>Tt(async()=>{var b;try{const m=await F(e,xe,"getBlock")({blockTag:t,includeTransactions:f});if(m.number&&(l!=null&&l.number)){if(m.number===l.number)return;if(m.number-l.number>1&&n)for(let g=(l==null?void 0:l.number)+1n;gl.number)&&(h.onBlock(m,l),l=m)}catch(m){(b=h.onError)==null||b.call(h,m)}},{emitOnBegin:r,interval:c}))})():(()=>{let p=!0,h=()=>p=!1;return(async()=>{try{const b=(()=>{if(e.transport.type==="fallback"){const g=e.transport.transports.find(w=>w.config.type==="webSocket");return g?g.value:e.transport}return e.transport})(),{unsubscribe:m}=await b.subscribe({params:["newHeads"],onData(g){var A,x,E;if(!p)return;const P=(((E=(x=(A=e.chain)==null?void 0:A.formatters)==null?void 0:x.block)==null?void 0:E.format)||Kn)(g.result);s(P,l),l=P},onError(g){o==null||o(g)}});h=m,p||h()}catch(b){o==null||o(b)}})(),()=>h()})()}function Hu(e,{address:t,args:n,batch:r=!0,event:s,events:o,fromBlock:i,onError:a,onLogs:c,poll:u,pollingInterval:f=e.pollingInterval,strict:l}){const d=typeof u<"u"?u:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),y=l??!1;return d?(()=>{const b=V(["watchEvent",t,n,r,e.uid,s,f,i]);return Ee(b,{onLogs:c,onError:a},m=>{let g;i!==void 0&&(g=i-1n);let w,P=!1;const A=Tt(async()=>{var x;if(!P){try{w=await F(e,Vs,"createEventFilter")({address:t,args:n,event:s,events:o,strict:y,fromBlock:i})}catch{}P=!0;return}try{let E;if(w)E=await F(e,Zt,"getFilterChanges")({filter:w});else{const I=await F(e,$t,"getBlockNumber")({});g&&g!==I?E=await F(e,sr,"getLogs")({address:t,args:n,event:s,events:o,fromBlock:g+1n,toBlock:I}):E=[],g=I}if(E.length===0)return;if(r)m.onLogs(E);else for(const I of E)m.onLogs([I])}catch(E){w&&E instanceof Ce&&(P=!1),(x=m.onError)==null||x.call(m,E)}},{emitOnBegin:!0,interval:f});return async()=>{w&&await F(e,Wt,"uninstallFilter")({filter:w}),A()}})})():(()=>{let b=!0,m=()=>b=!1;return(async()=>{try{const g=(()=>{if(e.transport.type==="fallback"){const x=e.transport.transports.find(E=>E.config.type==="webSocket");return x?x.value:e.transport}return e.transport})(),w=o??(s?[s]:void 0);let P=[];w&&(P=[w.flatMap(x=>It({abi:[x],eventName:x.name,args:n}))],s&&(P=P[0]));const{unsubscribe:A}=await g.subscribe({params:["logs",{address:t,topics:P}],onData(x){var I;if(!b)return;const E=x.result;try{const{eventName:T,args:C}=nr({abi:w??[],data:E.data,topics:E.topics,strict:y}),O=he(E,{args:C,eventName:T});c([O])}catch(T){let C,O;if(T instanceof rt||T instanceof Ut){if(l)return;C=T.abiItem.name,O=(I=T.abiItem.inputs)==null?void 0:I.some(j=>!("name"in j&&j.name))}const L=he(E,{args:O?[]:{},eventName:C});c([L])}},onError(x){a==null||a(x)}});m=A,b||m()}catch(g){a==null||a(g)}})(),()=>m()})()}function Du(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:o=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket")?(()=>{const u=V(["watchPendingTransactions",e.uid,t,o]);return Ee(u,{onTransactions:r,onError:n},f=>{let l;const d=Tt(async()=>{var y;try{if(!l)try{l=await F(e,Zs,"createPendingTransactionFilter")({});return}catch(h){throw d(),h}const p=await F(e,Zt,"getFilterChanges")({filter:l});if(p.length===0)return;if(t)f.onTransactions(p);else for(const h of p)f.onTransactions([h])}catch(p){(y=f.onError)==null||y.call(f,p)}},{emitOnBegin:!0,interval:o});return async()=>{l&&await F(e,Wt,"uninstallFilter")({filter:l}),d()}})})():(()=>{let u=!0,f=()=>u=!1;return(async()=>{try{const{unsubscribe:l}=await e.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!u)return;const y=d.result;r([y])},onError(d){n==null||n(d)}});f=l,u||f()}catch(l){n==null||n(l)}})(),()=>f()})()}function qu(e){return{call:t=>Vt(e,t),createBlockFilter:()=>Pc(e),createContractEventFilter:t=>fs(e,t),createEventFilter:t=>Vs(e,t),createPendingTransactionFilter:()=>Zs(e),estimateContractGas:t=>$a(e,t),estimateGas:t=>tr(e,t),getBalance:t=>Ec(e,t),getBlobBaseFee:()=>Bc(e),getBlock:t=>xe(e,t),getBlockNumber:t=>$t(e,t),getBlockTransactionCount:t=>Ic(e,t),getBytecode:t=>Ac(e,t),getChainId:()=>js(e),getContractEvents:t=>Ls(e,t),getEnsAddress:t=>ic(e,t),getEnsAvatar:t=>wc(e,t),getEnsName:t=>vc(e,t),getEnsResolver:t=>xc(e,t),getEnsText:t=>qs(e,t),getFeeHistory:t=>$c(e,t),estimateFeesPerGas:t=>ba(e,t),getFilterChanges:t=>Zt(e,t),getFilterLogs:t=>Oc(e,t),getGasPrice:()=>Jn(e),getLogs:t=>sr(e,t),getProof:t=>tu(e,t),estimateMaxPriorityFeePerGas:t=>pa(e,t),getStorageAt:t=>nu(e,t),getTransaction:t=>lr(e,t),getTransactionConfirmations:t=>ru(e,t),getTransactionCount:t=>Is(e,t),getTransactionReceipt:t=>Tn(e,t),multicall:t=>su(e,t),prepareTransactionRequest:t=>Rs(e,t),readContract:t=>Pe(e,t),sendRawTransaction:t=>Za(e,t),simulateContract:t=>Ma(e,t),verifyMessage:t=>Mu(e,t),verifyTypedData:t=>Uu(e,t),uninstallFilter:t=>Wt(e,t),waitForTransactionReceipt:t=>Gu(e,t),watchBlocks:t=>_u(e,t),watchBlockNumber:t=>yo(e,t),watchContractEvent:t=>Va(e,t),watchEvent:t=>Hu(e,t),watchPendingTransactions:t=>Du(e,t)}}function Vu(e){const{key:t="public",name:n="Public Client"}=e;return Ya({...e,key:t,name:n,type:"publicClient"}).extend(qu)}const Zu=2n**16n-1n,Wu=Ot({id:31337,name:"Foundry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}}),Yu=Ot({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),br=50000n,Yr=Zu*32n,mo={block:ha({format(e){var n;const t=(n=e.transactions)==null?void 0:n.map(r=>{var o;if(typeof r=="string")return r;const s=(o=mo.transaction)==null?void 0:o.format(r);return s.typeHex==="0x71"?s.type="eip712":s.typeHex==="0xff"&&(s.type="priority"),s});return{l1BatchNumber:e.l1BatchNumber?H(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?H(e.l1BatchTimestamp):null,transactions:t}}}),transaction:da({format(e){const t={};return e.type==="0x71"?t.type="eip712":e.type==="0xff"&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?H(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?H(e.l1BatchTxIndex):null}}}),transactionReceipt:_c({format(e){return{l1BatchNumber:e.l1BatchNumber?H(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?H(e.l1BatchTxIndex):null,logs:e.logs.map(t=>({...he(t),l1BatchNumber:t.l1BatchNumber?H(t.l1BatchNumber):null,transactionLogIndex:ae(t.transactionLogIndex),logType:t.logType})),l2ToL1Logs:e.l2ToL1Logs.map(t=>({blockNumber:H(t.blockHash),blockHash:t.blockHash,l1BatchNumber:H(t.l1BatchNumber),transactionIndex:H(t.transactionIndex),shardId:H(t.shardId),isService:t.isService,sender:t.sender,key:t.key,value:t.value,transactionHash:t.transactionHash,logIndex:H(t.logIndex)}))}}}),transactionRequest:ua({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format(e){return e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:k(e.gasPerPubdata)}:{gasPerPubdata:k(br)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(ue(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(t=>Array.from(ue(t)))}:{},...e.customSignature?{customSignature:Array.from(ue(e.customSignature))}:{}},type:"0x71"}:{}}})};class Ku extends v{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidEip712TransactionError"})}}function go(e){return!!(e.type==="eip712"||"customSignature"in e&&e.customSignature||"paymaster"in e&&e.paymaster||"paymasterInput"in e&&e.paymasterInput||"gasPerPubdata"in e&&typeof e.gasPerPubdata=="bigint"||"factoryDeps"in e&&e.factoryDeps)}function wo(e){const{chainId:t,to:n,from:r,paymaster:s,paymasterInput:o}=e;if(!go(e))throw new Ku;if(!t||t<=0)throw new qt({chainId:t});if(n&&!q(n))throw new ee({address:n});if(r&&!q(r))throw new ee({address:r});if(s&&!q(s))throw new ee({address:s});if(s&&!o)throw new v("`paymasterInput` must be provided when `paymaster` is defined");if(!s&&o)throw new v("`paymaster` must be provided when `paymasterInput` is defined")}function Ju(e,t){return go(e)?Qu(e):Wc(e,t)}const Xu={transaction:Ju};function Qu(e){const{chainId:t,gas:n,nonce:r,to:s,from:o,value:i,maxFeePerGas:a,maxPriorityFeePerGas:c,customSignature:u,factoryDeps:f,paymaster:l,paymasterInput:d,gasPerPubdata:y,data:p}=e;wo(e);const h=[r?k(r):"0x",c?k(c):"0x",a?k(a):"0x",n?k(n):"0x",s??"0x",i?k(i):"0x",p??"0x0",k(t),k(""),k(""),k(t),o??"0x",y?k(y):k(br),f??[],u??"0x",l&&d?[l,d]:[]];return Se(["0x71",qe(h)])}class el extends v{constructor({givenLength:t,maxBytecodeSize:n}){super(`Bytecode cannot be longer than ${n} bytes. Given length: ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthExceedsMaxSizeError"})}}class tl extends v{constructor({givenLengthInWords:t}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthInWordsMustBeOddError"})}}class nl extends v{constructor({givenLength:t}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthMustBeDivisibleBy32Error"})}}function rl(e){const t=oe(e);if(t.length%32!==0)throw new nl({givenLength:t.length});if(t.length>Yr)throw new el({givenLength:t.length,maxBytecodeSize:Yr});const n=Ts(t),r=oe(n),s=t.length/32;if(s%2===0)throw new tl({givenLengthInWords:s});const o=oe(s),i=Ao(o,{size:2}),a=new Uint8Array([1,0]);return r.set(a,0),r.set(i,2),r}const sl=e=>{wo(e);const t=ol(e);return{domain:{name:"zkSync",version:"2",chainId:e.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:t}};function ol(e){const{gas:t,nonce:n,to:r,from:s,value:o,maxFeePerGas:i,maxPriorityFeePerGas:a,factoryDeps:c,paymaster:u,paymasterInput:f,gasPerPubdata:l,data:d}=e;return{txType:113n,from:BigInt(s),to:r?BigInt(r):0n,gasLimit:t??0n,gasPerPubdataByteLimit:l??br,maxFeePerGas:i??0n,maxPriorityFeePerGas:a??0n,paymaster:u?BigInt(u):0n,nonce:n?BigInt(n):0n,value:o??0n,data:d||"0x0",factoryDeps:(c==null?void 0:c.map(y=>k(rl(y))))??[],paymasterInput:f||"0x"}}const vo={formatters:mo,serializers:Xu,custom:{getEip712Domain:sl}},il=Ot({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0}),al=Ot({...vo,id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://era.zksync.network/",apiUrl:"https://api-era.zksync.network/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}}),cl=Ot({...vo,id:300,name:"zkSync Sepolia Testnet",network:"zksync-sepolia-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://sepolia.explorer.zksync.io/"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0}),ul={11155111:il,1:Yu,300:cl,324:al,31337:Wu};function vl(){const e=rc(To),t=ul[Number(vr)];if(!t)throw new Error(`Unsupported chain: ${vr}`);return Vu({transport:e,chain:t})}const ll="site";function xl(){return xo(ll)}function Pl(e){return(e*1e3+1e3).toFixed(0)}export{Yu as $,Xa as A,zc as B,gl as C,Ln as D,pl as E,Lc as F,Rc as G,nt as H,ee as I,Ya as J,Ge as K,An as L,ec as M,tr as N,bl as O,su as P,ta as Q,ft as R,wt as S,yl as T,qn as U,bs as V,Ec as W,wc as X,vc as Y,lr as Z,rc as _,V as a,cl as a0,al as a1,il as a2,Wu as a3,vl as a4,ll as a5,de as b,Vt as c,Di as d,Et as e,Pl as f,xl as g,Hn as h,q as i,ml as j,W as k,vs as l,Zn as m,F as n,js as o,Rs as p,Ta as q,Za as r,vi as s,Vn as t,xs as u,Be as v,Ne as w,Pe as x,Ht as y,Gu as z}; diff --git a/_app/immutable/chunks/stores.CoMZMUm9.js b/_app/immutable/chunks/stores.CoMZMUm9.js new file mode 100644 index 0000000..6cba480 --- /dev/null +++ b/_app/immutable/chunks/stores.CoMZMUm9.js @@ -0,0 +1 @@ +import{s as e}from"./entry.B5WQGdlh.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p}; diff --git a/_app/immutable/entry/app.KOoyLIm4.js b/_app/immutable/entry/app.KOoyLIm4.js new file mode 100644 index 0000000..ff0eb16 --- /dev/null +++ b/_app/immutable/entry/app.KOoyLIm4.js @@ -0,0 +1,2 @@ +const __vite__fileDeps=["../nodes/0.CvMpNSFT.js","../chunks/scheduler.gEqqeaCZ.js","../chunks/index.BtSuiA6z.js","../nodes/1.DnCJB6Qo.js","../chunks/stores.CoMZMUm9.js","../chunks/entry.B5WQGdlh.js","../chunks/paths.DTSw6QKH.js","../nodes/2.CbgfxZda.js","../chunks/2.DEesTFv4.js","../chunks/site.BlgjxTUG.js","../chunks/kit.D0HsIFJD.js","../chunks/preload-helper.D6kgxu3v.js","../chunks/contest.DdHcFc7E.js","../assets/2.B_eOxCME.css","../nodes/3.CLs8TFJa.js","../chunks/each.kVXWp4N9.js","../chunks/page.DRg7gFN1.js","../assets/page.B74nKIF7.css","../chunks/player.PGhbgZJS.js","../assets/player.Cl2zdAgR.css","../assets/3.CRFnXZ6I.css","../nodes/4.ChOve-pn.js","../assets/4.GU4_W7vQ.css","../nodes/5.CJb-rz7u.js","../assets/5.BBC0mU7b.css","../nodes/6.9KmTK4S5.js","../assets/6.DKcY9bj4.css","../nodes/7.ZcmHt9qV.js","../assets/7.DTmGcCGK.css","../nodes/8.NSEh19qL.js","../assets/8.CrOac76a.css","../nodes/9.Bj8yHWN3.js","../assets/9.DhJdzZU7.css","../nodes/10.CBRI7fwi.js","../nodes/11.CstqbN8c.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{_ as h}from"../chunks/preload-helper.D6kgxu3v.js";import{s as z,b as C,p as u,j as F,k as g,i as w,E as G,z as J,e as M,d as U,f as B,v as L,F as I,t as H,h as K,m as Q,G as V,I as b,J as W}from"../chunks/scheduler.gEqqeaCZ.js";import{S as X,i as Y,a as m,e as D,t as p,g as P,c as k,b as A,m as E,d as v}from"../chunks/index.BtSuiA6z.js";const fe={};function Z(_){let e,i,s;var n=_[1][0];function c(t,o){return{props:{data:t[3],form:t[2]}}}return n&&(e=b(n,c(_)),_[15](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][0])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[15](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&8&&(r.data=t[3]),o&4&&(r.form=t[2]),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[15](null),e&&v(e,t)}}}function x(_){let e,i,s;var n=_[1][0];function c(t,o){return{props:{data:t[3],$$slots:{default:[ne]},$$scope:{ctx:t}}}}return n&&(e=b(n,c(_)),_[14](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][0])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[14](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&8&&(r.data=t[3]),o&65591&&(r.$$scope={dirty:o,ctx:t}),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[14](null),e&&v(e,t)}}}function ee(_){let e,i,s;var n=_[1][1];function c(t,o){return{props:{data:t[4],form:t[2]}}}return n&&(e=b(n,c(_)),_[13](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][1])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[13](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&16&&(r.data=t[4]),o&4&&(r.form=t[2]),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[13](null),e&&v(e,t)}}}function te(_){let e,i,s;var n=_[1][1];function c(t,o){return{props:{data:t[4],$$slots:{default:[ie]},$$scope:{ctx:t}}}}return n&&(e=b(n,c(_)),_[12](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][1])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[12](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&16&&(r.data=t[4]),o&65575&&(r.$$scope={dirty:o,ctx:t}),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[12](null),e&&v(e,t)}}}function ie(_){let e,i,s;var n=_[1][2];function c(t,o){return{props:{data:t[5],form:t[2]}}}return n&&(e=b(n,c(_)),_[11](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][2])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[11](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&32&&(r.data=t[5]),o&4&&(r.form=t[2]),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[11](null),e&&v(e,t)}}}function ne(_){let e,i,s,n;const c=[te,ee],t=[];function o(r,l){return r[1][2]?0:1}return e=o(_),i=t[e]=c[e](_),{c(){i.c(),s=u()},l(r){i.l(r),s=u()},m(r,l){t[e].m(r,l),g(r,s,l),n=!0},p(r,l){let f=e;e=o(r),e===f?t[e].p(r,l):(P(),m(t[f],1,1,()=>{t[f]=null}),D(),i=t[e],i?i.p(r,l):(i=t[e]=c[e](r),i.c()),p(i,1),i.m(s.parentNode,s))},i(r){n||(p(i),n=!0)},o(r){m(i),n=!1},d(r){r&&w(s),t[e].d(r)}}}function T(_){let e,i=_[7]&&N(_);return{c(){e=M("div"),i&&i.c(),this.h()},l(s){e=U(s,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var n=B(e);i&&i.l(n),n.forEach(w),this.h()},h(){L(e,"id","svelte-announcer"),L(e,"aria-live","assertive"),L(e,"aria-atomic","true"),I(e,"position","absolute"),I(e,"left","0"),I(e,"top","0"),I(e,"clip","rect(0 0 0 0)"),I(e,"clip-path","inset(50%)"),I(e,"overflow","hidden"),I(e,"white-space","nowrap"),I(e,"width","1px"),I(e,"height","1px")},m(s,n){g(s,e,n),i&&i.m(e,null)},p(s,n){s[7]?i?i.p(s,n):(i=N(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&w(e),i&&i.d()}}}function N(_){let e;return{c(){e=H(_[8])},l(i){e=K(i,_[8])},m(i,s){g(i,e,s)},p(i,s){s&256&&Q(e,i[8])},d(i){i&&w(e)}}}function re(_){let e,i,s,n,c;const t=[x,Z],o=[];function r(f,d){return f[1][1]?0:1}e=r(_),i=o[e]=t[e](_);let l=_[6]&&T(_);return{c(){i.c(),s=C(),l&&l.c(),n=u()},l(f){i.l(f),s=F(f),l&&l.l(f),n=u()},m(f,d){o[e].m(f,d),g(f,s,d),l&&l.m(f,d),g(f,n,d),c=!0},p(f,[d]){let R=e;e=r(f),e===R?o[e].p(f,d):(P(),m(o[R],1,1,()=>{o[R]=null}),D(),i=o[e],i?i.p(f,d):(i=o[e]=t[e](f),i.c()),p(i,1),i.m(s.parentNode,s)),f[6]?l?l.p(f,d):(l=T(f),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},i(f){c||(p(i),c=!0)},o(f){m(i),c=!1},d(f){f&&(w(s),w(n)),o[e].d(f),l&&l.d(f)}}}function se(_,e,i){let{stores:s}=e,{page:n}=e,{constructors:c}=e,{components:t=[]}=e,{form:o}=e,{data_0:r=null}=e,{data_1:l=null}=e,{data_2:f=null}=e;G(s.page.notify);let d=!1,R=!1,O=null;J(()=>{const a=s.page.subscribe(()=>{d&&(i(7,R=!0),W().then(()=>{i(8,O=document.title||"untitled page")}))});return i(6,d=!0),a});function y(a){V[a?"unshift":"push"](()=>{t[2]=a,i(0,t)})}function $(a){V[a?"unshift":"push"](()=>{t[1]=a,i(0,t)})}function S(a){V[a?"unshift":"push"](()=>{t[1]=a,i(0,t)})}function j(a){V[a?"unshift":"push"](()=>{t[0]=a,i(0,t)})}function q(a){V[a?"unshift":"push"](()=>{t[0]=a,i(0,t)})}return _.$$set=a=>{"stores"in a&&i(9,s=a.stores),"page"in a&&i(10,n=a.page),"constructors"in a&&i(1,c=a.constructors),"components"in a&&i(0,t=a.components),"form"in a&&i(2,o=a.form),"data_0"in a&&i(3,r=a.data_0),"data_1"in a&&i(4,l=a.data_1),"data_2"in a&&i(5,f=a.data_2)},_.$$.update=()=>{_.$$.dirty&1536&&s.page.set(n)},[t,c,o,r,l,f,d,R,O,s,n,y,$,S,j,q]}class le extends X{constructor(e){super(),Y(this,e,se,re,z,{stores:9,page:10,constructors:1,components:0,form:2,data_0:3,data_1:4,data_2:5})}}const ce=[()=>h(()=>import("../nodes/0.CvMpNSFT.js"),__vite__mapDeps([0,1,2]),import.meta.url),()=>h(()=>import("../nodes/1.DnCJB6Qo.js"),__vite__mapDeps([3,1,2,4,5,6]),import.meta.url),()=>h(()=>import("../nodes/2.CbgfxZda.js"),__vite__mapDeps([7,8,1,2,9,10,6,11,12,4,5,13]),import.meta.url),()=>h(()=>import("../nodes/3.CLs8TFJa.js"),__vite__mapDeps([14,1,2,6,15,9,10,11,16,17,18,19,12,20]),import.meta.url),()=>h(()=>import("../nodes/4.ChOve-pn.js"),__vite__mapDeps([21,1,2,15,6,4,5,10,16,17,18,19,9,11,22]),import.meta.url),()=>h(()=>import("../nodes/5.CJb-rz7u.js"),__vite__mapDeps([23,1,2,15,6,4,5,10,16,17,18,19,24]),import.meta.url),()=>h(()=>import("../nodes/6.9KmTK4S5.js"),__vite__mapDeps([25,1,2,15,16,17,4,5,6,10,9,11,12,26]),import.meta.url),()=>h(()=>import("../nodes/7.ZcmHt9qV.js"),__vite__mapDeps([27,1,2,15,16,17,4,5,6,10,18,19,28]),import.meta.url),()=>h(()=>import("../nodes/8.NSEh19qL.js"),__vite__mapDeps([29,1,2,16,17,9,10,6,11,4,5,12,30]),import.meta.url),()=>h(()=>import("../nodes/9.Bj8yHWN3.js"),__vite__mapDeps([31,1,2,15,6,4,5,10,16,17,18,19,9,11,32]),import.meta.url),()=>h(()=>import("../nodes/10.CBRI7fwi.js"),__vite__mapDeps([33,1,2]),import.meta.url),()=>h(()=>import("../nodes/11.CstqbN8c.js"),__vite__mapDeps([34,1,2]),import.meta.url)],ue=[],me={"/(app)":[3,[2]],"/(app)/bracket":[4,[2]],"/(app)/match":[5,[2]],"/(app)/players":[7,[2]],"/(app)/player":[6,[2]],"/(terms)/privacy":[10],"/(app)/register":[8,[2]],"/(terms)/rules":[11],"/(app)/tournament":[9,[2]]},pe={handleError:({error:_})=>{console.error(_)},reroute:()=>{}};export{me as dictionary,pe as hooks,fe as matchers,ce as nodes,le as root,ue as server_loads}; diff --git a/_app/immutable/entry/start.B3rBPE0O.js b/_app/immutable/entry/start.B3rBPE0O.js new file mode 100644 index 0000000..3a4f676 --- /dev/null +++ b/_app/immutable/entry/start.B3rBPE0O.js @@ -0,0 +1 @@ +import{a as t}from"../chunks/entry.B5WQGdlh.js";export{t as start}; diff --git a/_app/immutable/nodes/0.CvMpNSFT.js b/_app/immutable/nodes/0.CvMpNSFT.js new file mode 100644 index 0000000..ec77dde --- /dev/null +++ b/_app/immutable/nodes/0.CvMpNSFT.js @@ -0,0 +1 @@ +import{s as l,c as i,u as r,g as u,a as f}from"../chunks/scheduler.gEqqeaCZ.js";import{S as _,i as c,t as p,a as m}from"../chunks/index.BtSuiA6z.js";function $(a){let s;const n=a[1].default,e=i(n,a,a[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,o){e&&e.m(t,o),s=!0},p(t,[o]){e&&e.p&&(!s||o&1)&&r(e,n,t,t[0],s?f(n,t[0],o,null):u(t[0]),null)},i(t){s||(p(e,t),s=!0)},o(t){m(e,t),s=!1},d(t){e&&e.d(t)}}}function d(a,s,n){let{$$slots:e={},$$scope:t}=s;return a.$$set=o=>{"$$scope"in o&&n(0,t=o.$$scope)},[t,e]}class S extends _{constructor(s){super(),c(this,s,d,$,l,{})}}export{S as component}; diff --git a/_app/immutable/nodes/1.DnCJB6Qo.js b/_app/immutable/nodes/1.DnCJB6Qo.js new file mode 100644 index 0000000..60bbc8e --- /dev/null +++ b/_app/immutable/nodes/1.DnCJB6Qo.js @@ -0,0 +1 @@ +import{s as x,e as u,t as h,b as S,d,f as v,h as b,i as m,j,k as _,l as g,m as E,n as $,o as k}from"../chunks/scheduler.gEqqeaCZ.js";import{S as q,i as y}from"../chunks/index.BtSuiA6z.js";import{p as C}from"../chunks/stores.CoMZMUm9.js";function H(i){var f;let t,s=i[0].status+"",r,o,n,p=((f=i[0].error)==null?void 0:f.message)+"",c;return{c(){t=u("h1"),r=h(s),o=S(),n=u("p"),c=h(p)},l(e){t=d(e,"H1",{});var a=v(t);r=b(a,s),a.forEach(m),o=j(e),n=d(e,"P",{});var l=v(n);c=b(l,p),l.forEach(m)},m(e,a){_(e,t,a),g(t,r),_(e,o,a),_(e,n,a),g(n,c)},p(e,[a]){var l;a&1&&s!==(s=e[0].status+"")&&E(r,s),a&1&&p!==(p=((l=e[0].error)==null?void 0:l.message)+"")&&E(c,p)},i:$,o:$,d(e){e&&(m(t),m(o),m(n))}}}function P(i,t,s){let r;return k(i,C,o=>s(0,r=o)),[r]}class B extends q{constructor(t){super(),y(this,t,P,H,x,{})}}export{B as component}; diff --git a/_app/immutable/nodes/10.CBRI7fwi.js b/_app/immutable/nodes/10.CBRI7fwi.js new file mode 100644 index 0000000..73f6bfd --- /dev/null +++ b/_app/immutable/nodes/10.CBRI7fwi.js @@ -0,0 +1,1286 @@ +import{s as l,H as p,p as a,D as c,k as r,n as e,i as d}from"../chunks/scheduler.gEqqeaCZ.js";import{S as h,i as u}from"../chunks/index.BtSuiA6z.js";const f=` + + + + + + + + +

 

+

DRAGONFLY "SEARCHERS OF NOTTINGHAM" COMPETITION 

+

PRIVACY POLICY 

+

 

+

Last Updated June 6, 2024 

+

 

+

Welcome to the website (the “Site”) of the Dragonfly "Searchers of Nottingham" Competition (the “Competition”). Through the Site Dragonfly Operations, LLC (“Company,” “we,” or “our”) administers the Competition and related services (the “Service”).  

+

 

+

This Privacy Policy explains what Personal Data (defined below) we collect, how we use and share that data, and your choices concerning our data practices. This Privacy Policy is incorporated into and forms part of our Official Rules which are available on the Site.  For information on how to enter the Competition and the terms and conditions of entry please visit the Official Rules. 

+

 

+

Before using the Service or submitting any Personal Data to Company, please review this Privacy Policy carefully and contact us if you have any questions. By using the Service, you agree to the practices described in this Privacy Policy. If you do not agree to this Privacy Policy, please do not access the Site or otherwise use the Service. 

+

 

+

1. PERSONAL DATA WE COLLECT 

+

We collect information that alone or in combination with other information in our possession could be used to identify you (“Personal Data”) as follows: 

+

Personal Data You Provide: We collect Personal Data from you when you sign up to participate in the Competition. The Personal Data we collect includes your email address, and if you are a winner of the Competition, we will also collect your name and mailing address. Additionally, we may receive Personal Data from third party sites that are linked with the Service. For example, if you sign up through a third party service such as Github, we may collect other information about you that is made publicly available on such third party service. The Personal Data collected during these interactions may vary based on what you are asked to submit in connection with a particular feature of the Service or that you otherwise choose to share with us.  

+

We may also have pages on social media sites like Instagram, Facebook, Twitter, and LinkedIn 

+

(“Social Media Pages”). When you interact with our Social Media Pages, we will collect Personal Data that you elect to provide to us, such as your contact details. In addition, the companies that host our Social Media Pages may provide us with aggregate information and analytics regarding the use of our Social Media Pages. 

+

Internet Activity Data: When you visit, use, and interact with the Service, we may receive certain information about your visit, use, or interactions. For example, we may monitor the number of people that visit the Service, peak hours of visits, which page(s) are visited, the domains our visitors come from (e.g., google.com, yahoo.com, etc.), and which browsers people use to access the Service (e.g., Chrome, Firefox, Microsoft Internet Explorer, etc.), broad geographical information, and navigation pattern. In particular, the following information is created and automatically logged in our systems:  

+
    +
  • Log Data: Information that your browser automatically sends whenever you visit the Site. Log Data includes your Internet Protocol address, browser type and settings, the date and time of your request, and how you interacted with the Site.  
  • +
  • Cookies Data: Please see the Cookies section below to learn more about how we use cookies. 
  • +
  • Device Data: Includes name of the device, operating system, and browser you are using. Information collected may depend on the type of device you use and its settings.  
  • +
  • Usage Data: We collect information about how you use our Service, such as the types of content that you view or engage with, the features you use, the actions you take, and the time, frequency, and duration of your activities. 
  • +
  • Location Data: We derive a rough estimate of your location from your IP address.  
  • +
+

 

+

Personal Information We Process on Behalf of Our Business Customers: When you use and interact with the Service, we will have your IP address in order to ensure that you are able to access the Services, and we will collect your browser information so that we may provide any necessary technical support through a third party vendor.  

+

Cookies: We use cookies to operate and administer our Site, gather usage data on our Site, and improve your experience on it. A “cookie” is a piece of information sent to your browser by a website you visit. Cookies can be stored on your computer for different periods of time. Some cookies expire after a certain amount of time, or upon logging out (session cookies), others survive after your browser is closed until a defined expiration date set in the cookie (as determined by the third party placing it), and help recognize your computer when you open your browser and browse the Internet again (persistent cookies). 

+

 

+

On most web browsers, you will find a “help” section on the toolbar. Please refer to this section for information on how to receive a notification when you are receiving a new cookie and how to turn cookies off. Please see the links below for guidance on how to modify your web browser’s settings on the most popular browsers: 

+

 

+
    +
  • Internet Explorer 
  • +
  • Mozilla Firefox 
  • +
  • Google Chrome 
  • +
  • Apple Safari 
  • +
+

 

+

Please note that if you limit the ability of websites to set cookies, you may be unable to access certain parts of the Site and you may not be able to benefit from the full functionality of the Site. 

+

 

+

Advertising networks may use cookies to collect Personal Data. Most advertising networks offer you a way to opt out of targeted advertising. If you would like to find out more information, please         visit the Network Advertising Initiative’s online resources at http://www.networkadvertising.org and follow the opt-out instructions there. 

+

If you access the Site on your mobile device, you may not be able to control tracking technologies through the settings.  

+

Online Tracking and Do Not Track Signals: We and our third party service providers, including Amazon Web Services and Vercel, may use cookies, pixels, or other tracking technologies to collect information about your browsing activities over time and across different websites following your use of the Site and use that information to send targeted advertisements. Our Site currently does not respond to “Do Not Track” (“DNT”) signals and operates as described in this Privacy Policy whether or not a DNT signal is received. If we do respond to DNT signals in the future, we will update this Privacy Policy to describe how we do so.  

+

 

+

2. HOW WE USE PERSONAL DATA 

+

We may use Personal Data for the following purposes: 

+

 

+
    +
  • To provide the Service, including fulfilling any prizes awarded in the Competition, and send you any information you request about our Service; 
  • +
  • To respond to your inquiries, comments, feedback, or questions; 
  • +
  • To send administrative information to you, for example, information regarding the Service and changes to our terms, conditions, and policies; 
  • +
  • To maintain and improve the Service; 
  • +
  • To prevent fraud, criminal activity, or misuses of our Service, and to ensure the security of our IT systems, architecture, and networks; and 
  • +
  • To comply with legal obligations and legal process and to protect our rights, privacy, safety, or property, and/or that of our affiliates, you, or other third parties. 
  • +
+

 

+

Aggregated Information.  We may aggregate Personal Data and use the aggregated  information to analyze the effectiveness of our Service, to improve and add features to our Service, and for other similar purposes. In addition, from time to time, we may analyze the general behavior and characteristics of users of our Service and share aggregated information like general user statistics with prospective business partners. We may collect aggregated information through the Service, through cookies, and through other means described in this Privacy Policy. 

+


+


+

3. SHARING AND DISCLOSURE OF PERSONAL DATA 

+

In certain circumstances we may share the categories of Personal Data described above without further notice to you, unless required by the law, with the following categories of third parties: 

+

 

+
    +
  • Prize Fulfillment: In connection with fulfilling the prizes in the Competition, we may share your Personal Data to assist us in fulfilling and delivering prizes to winners of the Competition, including for example the provider of the merchandise that will be awarded during the Competition. 
  • +
  • Vendors and Service Providers: To assist us in meeting business operations needs and to perform certain services and functions, we may share Personal Data with vendors and service providers, including providers of hosting services, cloud services, and other information technology services providers, email communication software and email newsletter services, advertising and marketing services, payment processors, customer relationship management and customer support services, and analytics services. Pursuant to our instructions, these parties will access, process, or store Personal Data in the course of performing their duties to us.  
  • +
  • Business Transfers: If we are involved in a merger, acquisition, financing due diligence, reorganization, bankruptcy, receivership, sale of all or a portion of our assets, or transition of service to another provider (collectively a “Transaction”), your Personal Data and other information may be shared in the diligence process with counterparties and others assisting with the Transaction and transferred to a successor or affiliate as part of that Transaction along with other assets. 
  • +
  • Legal Requirements: If required to do so by law or in the good faith belief that such action is necessary to (i) comply with a legal obligation, including to meet national security or law enforcement requirements, (ii) protect and defend our rights or property, (iii) prevent fraud, (iv) act in urgent circumstances to protect the personal safety of users of the Service, or the public, or (v) protect against legal liability. 
  • +
+

 

+

4. UPDATE YOUR INFORMATION 

+

Please contact us if you need to change or correct your Personal Data.  

+

 

+

5. CHILDREN 

+

Our Service is not directed to children who are under the age of 18. Company does not knowingly collect Personal Data from children under the age of 18. If you have reason to believe that a child under the age of 16 has provided Personal Data to Company through the Service please contact us and we will endeavor to delete that information from our databases. 

+

 

+

6. LINKS TO OTHER WEBSITES 

+

The Service may contain links to other websites not operated or controlled by Company, including social media services (“Third Party Sites”). The information that you share with Third Party Sites will be governed by the specific privacy policies and Official Rules of the Third Party Sites and not by this Privacy Policy. By providing these links we do not imply that we endorse or have reviewed these sites. Please contact the Third Party Sites directly for information on their privacy practices and policies.  

+

 

+

7. SECURITY 

+

You use the Service at your own risk. We implement commercially reasonable technical, administrative, and organizational measures to protect Personal Data both online and offline from loss, misuse, and unauthorized access, disclosure, alteration, or destruction. However, no Internet or e-mail transmission is ever fully secure or error free. In particular, e-mail sent to or from us may not be secure. Therefore, you should take special care in deciding what information you send to us via the Service or e-mail. Please keep this in mind when disclosing any Personal Data to Company via the Internet. In addition, we are not responsible for circumvention of any privacy settings or security measures contained on the Service, or third party websites. 

+

8. INTERNATIONAL USERS 

+

By using our Service, you understand and acknowledge that your Personal Data will be transferred from your location to our facilities and servers in the United States. 

+

9. YOUR CHOICES 

+

In certain circumstances providing Personal Data is optional. However, if you choose not to provide Personal Data that is needed to use some features of our Service, you may be unable to use those features. You can also contact us to ask us to update or correct your Personal Data. 

+

10. CHANGES TO THE PRIVACY POLICY 

+

The Service and our business may change from time to time. As a result, we may change this Privacy Policy at any time. When we do, we will post an updated version on this page, unless another type of notice is required by the applicable law. By continuing to use our Service or providing us with Personal Data after we have posted an updated Privacy Policy, or notified you by other means if applicable, you consent to the revised Privacy Policy and practices described in it. 

+

 

+

11. CONTACT US 

+

If you have any questions about our Privacy Policy or information practices, please feel free to contact us at privacy@dragonfly.xyz.  

+


+


+

 

+
+


+
+ + +`;function g(o){let n,s;return{c(){n=new p(!1),s=a(),this.h()},l(t){n=c(t,!1),s=a(),this.h()},h(){n.a=s},m(t,i){n.m(f,t,i),r(t,s,i)},p:e,i:e,o:e,d(t){t&&(d(s),n.d())}}}class m extends h{constructor(n){super(),u(this,n,null,g,l,{})}}export{m as component}; diff --git a/_app/immutable/nodes/11.CstqbN8c.js b/_app/immutable/nodes/11.CstqbN8c.js new file mode 100644 index 0000000..7712ff9 --- /dev/null +++ b/_app/immutable/nodes/11.CstqbN8c.js @@ -0,0 +1 @@ +import{s as l,H as r,p as o,D as c,k as p,n as s,i as d}from"../chunks/scheduler.gEqqeaCZ.js";import{S as h,i as u}from"../chunks/index.BtSuiA6z.js";const m=`

Dragonfly CTF Competition

OFFICIAL RULES

THESE OFFICIAL RULES CONTAIN AN ARBITRATION AGREEMENT, WHICH WILL, WITH LIMITED EXCEPTION, REQUIRE YOU TO SUBMIT CLAIMS YOU HAVE AGAINST SPONSOR TO BINDING AND FINAL ARBITRATION. UNDER THE ARBITRATION AGREEMENT, (1) YOU

WILL ONLY BE PERMITTED TO PURSUE CLAIMS AGAINST SPONSOR ON AN INDIVIDUAL BASIS, NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY CLASS OR REPRESENTATIVE ACTION OR PROCEEDING, AND (2) YOU WILL ONLY BE PERMITTED TO SEEK RELIEF

(INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ON AN INDIVIDUAL

BASIS.

The Dragonfly CTF Competition (the “Competition”) begins on Friday, May 6, 2023 at 00:00 AM UTC (the “Competition Start Date”) and ends at 00:00 AM UTC on Sunday, May 8, 2023 (the “Competition End Date”) (such period referred to herein as the “Competition Period”). The Competition is sponsored by Dragonfly Operations, LLC (the “Sponsor”).

  1. HOW TO ENTER: NO PURCHASE NECESSARY TO ENTER OR CLAIM PRIZE. A PURCHASE WILL NOT INCREASE YOUR CHANCES OF WINNING. Participation in the Competition is voluntary.  All entries are subject to Sponsor’s privacy policy located at ctf.dragonfly.xyz/privacy.

Individuals or teams may participate in the Competition. At any time during the Competition Period, Individual or team participants (each a “Participant”) may enter the Competition by completing all required steps in the sign-up process located at https://ctf.dragonfly.xyz (the “Website”), including without limitation providing the Participant’s name, email address, the names of the other team members (if applicable) and the team name (if applicable). After the Participants complete the sign-up process, they will receive access to the CTF dashboard (the “Dashboard”), which is where the Challenges (as defined below) are made available and where Participants can submit their solutions for each Challenge.

For teams participating in the Competition, each team must be represented by one (1) team leader (the “Team Leader”). The Team Leader is the sole contact person for purposes of the Competition and is responsible for submitting the sign-up form, generating a team token to distribute to the other team members so that they can join the team and also access the Dashboard, and submitting the solutions to each puzzle.

During the Competition Period, the Participants will compete to solve a smart contract puzzle made from a collection of individual solidity/EVM challenges (the “Challenges”). Participants will submit a solution in the form of smart contracts (each a “Solution”). Each Solution will be evaluated against the puzzle through local transaction simulation for correctness and efficiency. A cumulative score will be automatically awarded to each Solution based on which individual Challenges have been completed. If a Solution completes all Challenges in the puzzle, extra points will also be awarded based on inverse gas usage from a predetermined baseline. The Dashboard will indicate the points awarded for each Challenge. No illegible, incomplete, forged or altered entries will be accepted. All entries become the property of Sponsor and will not be returned. One (1) entry per individual is permitted. An individual may not enter in both their individual capacity and as a member of a team.

  1. SELECTION OF WINNERS; PRIZE:

Participants will be ranked in terms of total cumulative points awarded at the end of the Challenge Period. In the event of a tie between two or more Participants, the Participant who completed the Challenges fastest will be deemed a winner. The top Participant based on total cumulative points will be eligible to receive a Milady Maker NFT as its prize, the Participant who completes all of the challenges in the least amount of time will be eligible to receive a Milady Maker NFT and the Participant who submits the most creative solutions to the Challenges (subject to the sole discretion of the Sponsor) will be eligible to receive a Milady Maker NFT (collectively, the “Winners”). To receive the applicable prize, (i) each potential Winner must have and communicate a wallet address that will allow the Winner to receive a Milady Maker NFT, (ii) each potential Winner must submit information sufficient to verify identity for purposes of determining eligibility, including without limitation name, address, date of birth, and government ID, all of which must be submitted within 2 weeks of their receiving the notice in Section 5 (such date, the “Due Date”). The Winners will also receive an invitation to meet the Dragonfly security team virtually via Zoom. Participation in the virtual meet and greet is voluntary.

In the case of a Participant that is a team, the prize(s) will only be awarded to the Team Leader. The

Team Leader is solely responsible for complying with all requirements applicable to receipt of such prize. The

Team Leader is also solely liable and responsible for sharing the prize with the other members of its team, in the Team Leader’s sole discretion. Sponsor will not be liable for any action or omission by any Team Leader, including without limitation any Team Leader’s failure to share a prize with the other team members.

Allow 3-4 weeks after validation of eligibility for receipt of prize. Odds of winning are affected by the number of eligible entries received by the Competition End Date. The Winners will be solely responsible for all other expenses not specifically set forth herein. The Sponsor reserves the right to substitute prizes of equal or greater value (based on the fair market value at the Competition End Date. No other substitution or transfer of prizes permitted. To receive a prize, the Participants may be required to provide proof of identification, including name, age, address and date of birth, and agree to provide any other information reasonably requested by Sponsor in order to deliver the prize. In order to receive the NFT prize, Winners are required to provide any information reasonably requested by Sponsor in order to fulfill and deliver the prize including their wallet address (as applicable), name, date of birth and a copy of their passport or other valid proof of identity. All federal, state, and local or other taxes on any prize, including income and/or sales taxes, are the sole responsibility of the Winner. Any Winner who receives a prize with a value of $600 or greater will be issued an IRS Form Misc-1099 for the actual value of the prize, and are advised to seek independent counsel regarding the tax implications of the prize winnings; provided, however, Sponsor may elect to gross up the prize to cover the Winner’s taxes for such prize.

  1. ELIGIBILITY:

Participant Eligibility. The Competition is only open to individuals who are (i) over eighteen (18) years of age at the time of entry and (ii) reside in a jurisdiction other than any jurisdiction comprehensively sanctioned by the United States Office of Foreign Asset Control (“OFAC”) at the time the entry is submitted (the list of sanctions programs administered by OFAC is available at https://www.treasury.gov/resource-center/sanctions/programs/pages/programs.aspx) and whom is not otherwise subject to OFAC sanctions. In addition, in order to be eligible to receive a prize, each potential winner must comply with the requirements set forth in Section 2. By participating in the Competition, each Participant accepts the conditions stated in these Official Rules, agrees to be bound by the decisions of Sponsor and warrants that she/he is eligible to participate in the Competition. Employees, independent contractors, interns, officers, and directors of Sponsor, affiliates, subsidiaries, advertising, Competition, and fulfillment agencies, and legal advisors, and their immediate family members and persons living in the same household, are not eligible to participate in the Competition. THE COMPETITION IS VOID WHERE PROHIBITED OR RESTRICTED BY LAW and is subject to applicable international, federal, state and local laws and regulations.

  1. USE OF CONTENT/SUBMISSIONS. By submitting solutions to the Challenges (“Submissions”) to Sponsor in connection with this Competition, you automatically represent and warrant that you have the right to grant, and do hereby grant, to Sponsor the paid-up, royalty-free, perpetual, irrevocable, sublicensable, non-exclusive right and license to (a) use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, perform and display any such Submissions (in whole or in part) worldwide and/or to incorporate all or any portion of it in other works in any form, media or technology now known or later developed for the full term of any patent, trademark, trade secret, copyright or other proprietary rights of any party that may exist in such Submissions; and (b) use the Submissions, including without limitation, the right and license to make, use, sell, offer for sale, and import any products and/or services which practice or embody, or are configured for use in practicing, all or any portion of the Submissions and the right to practice. BY SUBMITTING AN ENTRY, EACH PARTICIPANT ACKNOWLEDGES THAT HIS/HER ENTRY MAY BE POSTED ON SPONSOR’S WEBSITE, SOCIAL MEDIA CHANNELS AND OTHER CHANNELS, AND EDITED, IN SPONSOR’S DISCRETION. Inclusion of Submissions on Sponsor’s website, social media channels or other channels will include attribution to the photographer and you hereby grant Sponsor the paid-up, royalty-free, perpetual, irrevocable, sublicensable, non-exclusive right and license to use your name and other likeness for such purpose. Under no circumstances will Sponsor be required to treat any Submissions as confidential. Sponsor will be entitled to use the Submissions for any purpose whatsoever without compensation to you or any other person. For the avoidance of doubt, Sponsor will not be liable to you or any other person for any ideas for Sponsor’s business (including, without limitation, product designs or ideas) derived from the Submissions and will not incur any liability as a result of any similarities to the Submissions that may appear in any future products or services of Sponsor. You warrant that the content in the Submission has not been copied from any third party and its use by Sponsor will not infringe or involve the misappropriation of any third party rights and agree to indemnify and hold harmless Sponsor and all other third parties licensed above from and against any breach of this warranty.

  1. NOTIFICATION OF WINNERS:

The Winners will be notified by email using the information provided when the Participant entered the Competition, within approximately thirty (30) days of the Competition End Date.  Such notification to the Winners shall include instructions for proper acceptance of the prize by such Winner.  In the event a Winner does not accept a prize, a Winner is ineligible, or the prize or prize notification is not deliverable, an alternate Winner may be selected.  Sponsor is not responsible for and shall not be liable for late, lost, misdirected or unsuccessful efforts to notify a Winner.  Each Participant agrees to Sponsor’s use of their name, address, likeness, and/or prize information for promotional purposes in any medium without additional compensation to the extent permitted by law.  Where lawful, each Winner may be required to sign and return an Affidavit of Eligibility, Release of Liability, and Publicity Release.  All Participants will be notified of the points they earn from each Challenge (if any) through the Dashboard.

The Sponsor is not responsible for notifying or distributing the prize or redeemed merchandise amongst the other team members.

  1. WINNERS LIST:   The Winners List may be posted on the Sponsor’s website and social media accounts within approximately 5 days of the Competition End Date.
  2. CONDITIONS: Sponsor and its respective agents, directors, officers, shareholders, employees, insurers, servants, parents, subsidiaries, divisions, affiliates, predecessors, successors, representatives, advertising, Competition, and fulfillment agencies, and legal advisors (the “Released Entities”), are not responsible for, shall not be liable for, and hereby disclaim all liability arising from or relating to: (i) late, lost, delayed, damaged, misdirected, misaddressed, incomplete, or unintelligible entries; (ii) telephone, electronic, hardware or software program, network, Internet, computer or other malfunctions, failures, or difficulties of any kind, whether human or technical; (iii) failed, incomplete, garbled, or delayed computer or e-mail transmissions; (iv) any condition caused by events beyond the control of Sponsor; (v) any injuries, losses, or damages of any kind arising in connection with or as a result of any prize, or any portion thereof that may have been awarded, or acceptance, possession, or use of any prize, or any portion thereof that may have been awarded, or from participation in the Competition; (vi) any printing or typographical errors in any materials associated with the Competition; or (v) the Competition. Sponsor reserves the right, in its sole discretion, to suspend, modify or cancel the Competition should any unauthorized human intervention or other causes beyond Sponsor’s control corrupt or affect the administration, security, fairness or proper conduct of the Competition. In the event that proper administration of the Competition is prevented by such causes as contemplated above, Sponsor will pick the Winners from all eligible, non-suspect entries received prior to such action. By participating in the Competition, Participants and Winners agree to release, discharge and hold harmless the Released Entities, and all others associated with the development and execution of the Competition, from any and all losses, damages, rights, claims and actions of any kind arising out of or relating to the Competition, participation in the Competition, any prize, or any portion thereof that may have been awarded, and/or acceptance, possession, use or misuse of any prize, or any portion thereof that may have been awarded, including but not limited to statutory and common law claims for misappropriation or Participant’s right of publicity. The Sponsor’s computer is the official clock for the Competition. This Competition shall be governed by New York law.
  3. ARBITRATION AGREEMENT: PLEASE READ THIS SECTION CAREFULLY AS IT AFFECTS YOUR RIGHTS.

a. Agreement to Arbitrate. This Section 8 is referred to in these Official Rules as the “Arbitration Agreement.” You agree that any and all disputes or claims that have arisen or may arise between you and Sponsor, whether arising out of or relating to these Official Rules (including any alleged breach thereof), any advertising, any aspect of the relationship or transactions between us, shall be resolved exclusively through final and binding arbitration, rather than a court, in accordance with the terms of this Arbitration Agreement, except that you may assert individual claims in small claims court, if your claims qualify. Further, this Arbitration Agreement does not preclude you from bringing issues to the attention of federal, state, or local agencies, and such agencies can, if the law allows, seek relief against us on your behalf. You agree that, by entering into these Official Rules, you and Sponsor are each waiving the right to a trial by jury or to participate in a class action. Your rights will be determined by a neutral arbitrator, not a judge or jury. The Federal Arbitration Act governs the interpretation and enforcement of this Arbitration Agreement.

        b.        Prohibition of Class and Representative Actions and Non-Individualized Relief. YOU AND

SPONSOR AGREE THAT EACH OF US MAY BRING CLAIMS AGAINST THE OTHER ONLY ON AN INDIVIDUAL BASIS AND NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY PURPORTED CLASS OR REPRESENTATIVE ACTION OR PROCEEDING. UNLESS BOTH YOU AND SPONSOR AGREE

OTHERWISE, THE ARBITRATOR MAY NOT CONSOLIDATE OR JOIN MORE THAN ONE PERSON’S OR PARTY’S CLAIMS AND MAY NOT OTHERWISE PRESIDE OVER ANY FORM OF A CONSOLIDATED, REPRESENTATIVE, OR CLASS PROCEEDING. ALSO, THE ARBITRATOR MAY AWARD RELIEF (INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ONLY IN

FAVOR OF THE INDIVIDUAL PARTY SEEKING RELIEF AND ONLY TO THE EXTENT NECESSARY

TO PROVIDE RELIEF NECESSITATED BY THAT PARTY’S INDIVIDUAL CLAIM(S).

  1. Pre-Arbitration Dispute Resolution.        Sponsor is always interested in resolving disputes

amicably and efficiently, and most customer concerns can be resolved quickly and to the customer’s satisfaction by emailing Dragonfly at privacy@dragonfly.xyz. If such efforts prove unsuccessful, a party who intends to seek arbitration must first send to the other, by certified mail, a written Notice of Dispute (“Notice”). The Notice to Sponsor should be sent to Dragonfly Operations, LLC at 66 Franklin Street, Suite 300, Oakland, CA 94607 (“Notice Address”). The Notice must (i) describe the nature and basis of the claim or dispute and (ii) set forth the specific relief sought. If Sponsor and you do not resolve the claim within sixty (60) calendar days after the Notice is received, you or Sponsor may commence an arbitration proceeding. During the arbitration, the amount of any settlement offer made by Sponsor or you shall not be disclosed to the arbitrator until after the arbitrator determines the amount, if any, to which you or Sponsor is entitled.

  1. Arbitration Procedures. Arbitration will be conducted by a neutral arbitrator in accordance with the American Arbitration Association’s (“AAA”) rules and procedures, including the AAA’s Supplementary Procedures for Consumer-Related Disputes (collectively, the “AAA Rules”), as modified by this Arbitration Agreement. For information on the AAA, please visit its website, http://www.adr.org. Information about the AAA Rules and fees for consumer disputes can be found at the AAA’s consumer arbitration page, http://www.adr.org/consumer_arbitration. If there is any inconsistency between any term of the AAA Rules and any term of this Arbitration Agreement, the applicable terms of this Arbitration Agreement will control unless the arbitrator determines that the application of the inconsistent Arbitration Agreement terms would not result in a fundamentally fair arbitration. The arbitrator must also follow the provisions of these Official Rules as a court would. All issues are for the arbitrator to decide, including, but not limited to, issues relating to the scope, enforceability, and arbitrability of this Arbitration Agreement. Although arbitration proceedings are usually simpler and more streamlined than trials and other judicial proceedings, the arbitrator can award the same damages and relief on an individual basis that a court can award to an individual under these Official Rules and applicable law. Decisions by the arbitrator are enforceable in court and may be overturned by a court only for very limited reasons.

Unless Sponsor and you agree otherwise, any arbitration hearings will take place in a reasonably convenient location for both parties with due consideration of their ability to travel and other pertinent circumstances. If the parties are unable to agree on a location, the determination shall be made by AAA. If your claim is for $10,000 or less, Sponsor agrees that you may choose whether the arbitration will be conducted solely on the basis of documents submitted to the arbitrator, through a telephonic hearing, or by an in-person hearing as established by the AAA Rules. If your claim exceeds $10,000, the right to a hearing will be determined by the AAA Rules. Regardless of the manner in which the arbitration is conducted, the arbitrator shall issue a reasoned written decision sufficient to explain the essential findings and conclusions on which the award is based.

  1. Costs of Arbitration. Payment of all filing, administration, and arbitrator fees (collectively, the

“Arbitration Fees”) will be governed by the AAA Rules, unless otherwise provided in this Arbitration Agreement. If the value of the relief sought is $75,000 or less, at your request, Sponsor will pay all Arbitration Fees. If the value of relief sought is more than $75,000 and you are able to demonstrate to the arbitrator that you are economically unable to pay your portion of the Arbitration Fees or if the arbitrator otherwise determines for any reason that you should not be required to pay your portion of the Arbitration Fees, Sponsor will pay your portion of such fees. In addition, if you demonstrate to the arbitrator that the costs of arbitration will be prohibitive as compared to the costs of litigation, Sponsor will pay as much of the Arbitration Fees as the arbitrator deems necessary to prevent the arbitration from being cost-prohibitive. Finally, if the value of the relief sought is $75,000 or less, Sponsor will pay reasonable attorneys’ fees should you prevail. Sponsor will not seek attorneys’ fees from you. But, if you initiate an arbitration in which you seek more than $75,000 in relief, the payment of attorneys’ fees will be governed by the AAA Rules.

  1. Confidentiality. All aspects of the arbitration proceeding, and any ruling, decision, or award by

the arbitrator, will be strictly confidential for the benefit of all parties.

  1. Severability. Without limiting the severability provision in Section 8 of the these Official Rules,

if a court or the arbitrator decides that any term or provision of this Arbitration Agreement other than Section 8(b) above is invalid or unenforceable, the parties agree to replace such term or provision with a term or provision that is valid and enforceable and that comes closest to expressing the intention of the invalid or unenforceable term or provision, and this Arbitration Agreement shall be enforceable as so modified. If a court decides that any of the provisions of Section 8(b) is invalid or unenforceable, then the entirety of this Arbitration Agreement shall be null and void.  The remainder of these Official Rules will continue to apply.

  1. Future Changes to Arbitration Agreement. Notwithstanding any provision in these Official Rules to the contrary, Sponsor agrees that if it makes any future change to this Arbitration Agreement (other than a change to the Notice Address) while you are a user of the Services, you may reject any such change by sending Sponsor written notice within thirty (30) calendar days of the change to the Notice Address provided above. By rejecting any future change, you are agreeing that you will arbitrate any dispute between us in accordance with the language of this Arbitration Agreement.
  1. SPONSOR:  This Competition is sponsored by Dragonfly Operations, LLC at 66 Franklin Street, Suite 300, Oakland, CA 94607.
  2. NOTICE: Sponsor reserves the right to prosecute and seek damages against any individual who attempts to deliberately undermine the proper operation of the Competition in violation of these Official Rules and/or criminal and/or civil law.

FLAG-YOURE-IT

`;function f(a){let t,i;return{c(){t=new r(!1),i=o(),this.h()},l(e){t=c(e,!1),i=o(),this.h()},h(){t.a=i},m(e,n){t.m(m,e,n),p(e,i,n)},p:s,i:s,o:s,d(e){e&&(d(i),t.d())}}}class g extends h{constructor(t){super(),u(this,t,null,f,l,{})}}export{g as component}; diff --git a/_app/immutable/nodes/2.CbgfxZda.js b/_app/immutable/nodes/2.CbgfxZda.js new file mode 100644 index 0000000..e9ba519 --- /dev/null +++ b/_app/immutable/nodes/2.CbgfxZda.js @@ -0,0 +1 @@ +import{L as m}from"../chunks/2.DEesTFv4.js";export{m as component}; diff --git a/_app/immutable/nodes/3.CLs8TFJa.js b/_app/immutable/nodes/3.CLs8TFJa.js new file mode 100644 index 0000000..824c71b --- /dev/null +++ b/_app/immutable/nodes/3.CLs8TFJa.js @@ -0,0 +1,6 @@ +import{s as ft,e as m,d as _,f as P,i as u,k as p,o as gt,z as kt,q as z,n as U,p as De,b as C,t as H,j as T,h as L,v as d,l as i,m as ue,C as bt}from"../chunks/scheduler.gEqqeaCZ.js";import{S as ht,i as dt,g as ye,a as A,e as $e,t as G,c as ve,b as pe,m as ge,d as ke}from"../chunks/index.BtSuiA6z.js";import{b as ce}from"../chunks/paths.DTSw6QKH.js";import{e as He,u as mt,o as _t}from"../chunks/each.kVXWp4N9.js";import{g as vt,h as lt}from"../chunks/site.BlgjxTUG.js";import{P as yt,c as $t,e as wt,f as st,g as at,j as qe}from"../chunks/kit.D0HsIFJD.js";import{C as pt,P as Ct,L as Tt}from"../chunks/page.DRg7gFN1.js";import{P as Et}from"../chunks/player.PGhbgZJS.js";import{C as nt}from"../chunks/contest.DdHcFc7E.js";function rt(f,e,l){const t=f.slice();return t[9]=e[l],t}function ot(f,e,l){const t=f.slice();return t[12]=e[l],t[14]=l,t}function Mt(f){let e,l="No games have been played yet.";return{c(){e=m("div"),e.textContent=l},l(t){e=_(t,"DIV",{"data-svelte-h":!0}),z(e)!=="svelte-9a3pkb"&&(e.textContent=l)},m(t,n){p(t,e,n)},p:U,i:U,o:U,d(t){t&&u(e)}}}function xt(f){let e=[],l=new Map,t,n,r=He(f[2].slice().sort(f[5]));const o=s=>s[9].idx;for(let s=0;ss[14];for(let s=0;s{k[$]=null}),$e(),g=k[w],g?g.p(e,M):(g=k[w]=N[w](e),g.c()),G(g,1),g.m(y,null))},i(b){V||(G(g),V=!0)},o(b){A(g),V=!1},d(b){b&&u(l),O.d(),k[w].d()}}}function ut(f,e){let l,t,n,r,o,s=e[9].idx+1+"",a,c,E,q,y,I,w,g,S,V,F;function j($,x){return x&4&&(q=null),$[9].closedTime?zt:(q==null&&(q=$[4]($[9].startTime).getTime()-Date.now()0n&&it(e);const J=[It,Pt],b=[];function M($,x){var D;return(D=$[1][$[9].idx])!=null&&D.length?0:1}return g=M(e),S=b[g]=J[g](e),{key:f,first:null,c(){l=m("div"),t=m("h3"),n=m("img"),o=H(` + Season `),a=H(s),c=C(),E=m("span"),N.c(),y=C(),k&&k.c(),I=C(),w=m("div"),S.c(),V=C(),this.h()},l($){l=_($,"DIV",{class:!0});var x=P(l);t=_(x,"H3",{class:!0});var D=P(t);n=_(D,"IMG",{class:!0,src:!0,alt:!0}),o=L(D,` + Season `),a=L(D,s),c=T(D),E=_(D,"SPAN",{class:!0});var R=P(E);N.l(R),R.forEach(u),y=T(D),k&&k.l(D),D.forEach(u),I=T(x),w=_(x,"DIV",{class:!0});var W=P(w);S.l(W),W.forEach(u),V=T(x),x.forEach(u),this.h()},h(){d(n,"class","leaf svelte-1a5wz19"),bt(n.src,r=`${ce}/leaf.png`)||d(n,"src",r),d(n,"alt","season"),d(E,"class","smaller svelte-1a5wz19"),d(t,"class","svelte-1a5wz19"),d(w,"class","tournaments svelte-1a5wz19"),d(l,"class","season svelte-1a5wz19"),this.first=l},m($,x){p($,l,x),i(l,t),i(t,n),i(t,o),i(t,a),i(t,c),i(t,E),N.m(E,null),i(t,y),k&&k.m(t,null),i(l,I),i(l,w),b[g].m(w,null),i(l,V),F=!0},p($,x){e=$,(!F||x&4)&&s!==(s=e[9].idx+1+"")&&ue(a,s),O===(O=j(e,x))&&N?N.p(e,x):(N.d(1),N=O(e),N&&(N.c(),N.m(E,null))),e[9].prize&&e[9].prize>0n?k?k.p(e,x):(k=it(e),k.c(),k.m(t,null)):k&&(k.d(1),k=null);let D=g;g=M(e),g===D?b[g].p(e,x):(ye(),A(b[D],1,1,()=>{b[D]=null}),$e(),S=b[g],S?S.p(e,x):(S=b[g]=J[g](e),S.c()),G(S,1),S.m(w,null))},i($){F||(G(S),F=!0)},o($){A(S),F=!1},d($){$&&u(l),N.d(),k&&k.d(),b[g].d()}}}function Gt(f){let e,l,t,n;const r=[Dt,St,xt,Mt],o=[];function s(a,c){return a[0]instanceof Promise?0:a[0]instanceof Error?1:a[2].length>0?2:3}return l=s(f),t=o[l]=r[l](f),{c(){e=m("div"),t.c()},l(a){e=_(a,"DIV",{});var c=P(e);t.l(c),c.forEach(u)},m(a,c){p(a,e,c),o[l].m(e,null),n=!0},p(a,[c]){let E=l;l=s(a),l===E?o[l].p(a,c):(ye(),A(o[E],1,1,()=>{o[E]=null}),$e(),t=o[l],t?t.p(a,c):(t=o[l]=r[l](a),t.c()),G(t,1),t.m(e,null))},i(a){n||(G(t),n=!0)},o(a){A(t),n=!1},d(a){a&&u(e),o[l].d()}}}function Vt(f,e,l){let t;const{seasons:n}=vt();gt(f,n,y=>l(2,t=y));let r;const o=$t(y=>l(0,r=y));let s={};kt(async()=>{l(1,s=await o(a))});async function a(){const y=await fetch(`${yt}/results`);if(!y.ok)throw console.error(await y.text()),new Error(y.statusText);return(await y.json()).map(w=>({...w,time:new Date(w.time)})).reduce((w,g)=>Object.assign(w,{[g.season]:[...w[g.season]??[],g]}),{})}function c(y){return new Date(y.getTime()+Number(wt)*1e3)}return[r,s,t,n,c,(y,I)=>st(I.startTime,y.startTime),(y,I)=>st(I.time,y.time)]}class qt extends ht{constructor(e){super(),dt(this,e,Vt,Gt,ft,{})}}function Ft(f){let e,l="Searchers of Nottingham",t,n,r="Nottingham beckons, merchants bold! Hawk your wares, outmaneuvering rivals in the Market's fickle dance. Bribe your way to Sheriff and control the trade flow to your own benefit. Wit and coin win the day - become Nottingham's wealthiest merchant!";return{c(){e=m("h1"),e.textContent=l,t=C(),n=m("p"),n.textContent=r,this.h()},l(o){e=_(o,"H1",{class:!0,"data-svelte-h":!0}),z(e)!=="svelte-15mx40m"&&(e.textContent=l),t=T(o),n=_(o,"P",{class:!0,"data-svelte-h":!0}),z(n)!=="svelte-14pgpqd"&&(n.textContent=r),this.h()},h(){d(e,"class","initialed svelte-1hkdvg8"),d(n,"class","svelte-1hkdvg8")},m(o,s){p(o,e,s),p(o,t,s),p(o,n,s)},p:U,d(o){o&&(u(e),u(t),u(n))}}}function Bt(f){let e,l,t,n=`medieval illustration medieval illustration`,r,o,s='

Gameplay

Searchers of Nottingham is a multiplayer, MEV-themed game built on the Ethereum Virtual Machine. Players submit compiled smart contracts which represent Merchants at a medieval fair trying to stock their stall with goods (tokens). Merchants face each other in multiple small games. Each round Merchants will try to exchange their gold and goods at the Market (a constant product AMM). But a Merchant can also choose to bid gold to become the Sheriff for that round. The Sheriff chooses the order in which all trades are made and can also make their own trades at will. The first Merchant to acquire the maximum amount of any single good will win!

',a,c,E,q="The Contest",y,I,w='The contest will run approximately over a period of 15 days, with every 5 days marking a "Season." Seasons are made up of quick, daily tournaments and one final and conclusive tournament on the last day. Tournaments pit all players in the season against each other to produce an overall ranking.',g,S,V='On every day but the last of a season, two "Market Day" tournaments will be held. These tournaments award no prizes but can give players a sense of how well their contract performs against others.',F,j,O='On the last day of the season, a single "Grand Faire" tournament is held. Unlike Market Day tournaments, the Grand Faire DOES award prizes (in ETH) to the winner, and will also consist of more matches for certainty. The Grand Faire prize increases with each successive season, as players naturally become more sophisticated with time.',N,k,J,b,M=f[0].name+"",$,x,D,R,W,Fe="Tournaments",Le,fe,Be="Players are ranked in a series of offchain tournament-style matches against each other, consisting of 4 players at a time. The top performing players of each bracket advance into the next bracket, and so on. The player that maintains the highest overall ranking in the final bracket wins the tournament!",ze,he,Ue="To participate in tournaments, players must make at least one code submission while that season is open (before the Grand Faire). Only the most recent submission will be used. Submissions from a prior season will not automatically roll over into the next.",Pe,de,Re="Code submissions are published onchain but are encrypted with a key that will only be revealed when the season is closed (right before the Grand Faire). This allows players to decrypt past season winners to train against and incentivizes players to gradually refine their solutions.",we,Y,te,We="Contest Progress",Ie,me,le,Ce,K,se,Ye="Resources",Ne,B,ae,Je=`Game contracts (start here!) +
  • A foundry development environment containing all the core game logic, sample players, and a local match runner.
  • Here you can find much more technical detail about how the game logic works.
`,Oe,X,Q,je,Te,Ae,_e,Ke="
  • The deployed, onchain component of the contest, which handles registration, submissions, and payouts.
  • ",Ge,ne,Qe='Dragonfly Twitter Account
    • Here we'll post progress updates and any important announcements. Be sure to follow!
    ',Ve,re,Xe='Telegram Support Group
    • Overburdened Guildsmen? Find Solace Here!
    ',Ee,Z,Ze=`

    Legal Disclosures

    `,oe;return e=new Tt({props:{$$slots:{default:[Ft]},$$scope:{ctx:f}}}),le=new qt({}),{c(){ve(e.$$.fragment),l=C(),t=m("div"),t.innerHTML=n,r=C(),o=m("section"),o.innerHTML=s,a=C(),c=m("section"),E=m("h2"),E.textContent=q,y=C(),I=m("p"),I.textContent=w,g=C(),S=m("p"),S.textContent=V,F=C(),j=m("p"),j.textContent=O,N=C(),k=m("p"),J=H("The contest is free to join, but you will need a small amount of ETH on "),b=m("a"),$=H(M),D=H(" to cover gas for registration, submissions, and to claim any prizes."),R=C(),W=m("h3"),W.textContent=Fe,Le=C(),fe=m("p"),fe.innerHTML=Be,ze=C(),he=m("p"),he.innerHTML=Ue,Pe=C(),de=m("p"),de.textContent=Re,we=C(),Y=m("section"),te=m("h2"),te.textContent=We,Ie=C(),me=m("div"),ve(le.$$.fragment),Ce=C(),K=m("section"),se=m("h2"),se.textContent=Ye,Ne=C(),B=m("ul"),ae=m("li"),ae.innerHTML=Je,Oe=C(),X=m("li"),Q=m("a"),je=H("Contest contract"),Ae=C(),_e=m("ul"),_e.innerHTML=Ke,Ge=C(),ne=m("li"),ne.innerHTML=Qe,Ve=C(),re=m("li"),re.innerHTML=Xe,Ee=C(),Z=m("section"),Z.innerHTML=Ze,this.h()},l(h){pe(e.$$.fragment,h),l=T(h),t=_(h,"DIV",{class:!0,"data-svelte-h":!0}),z(t)!=="svelte-1gr30yy"&&(t.innerHTML=n),r=T(h),o=_(h,"SECTION",{class:!0,"data-svelte-h":!0}),z(o)!=="svelte-19dmwg8"&&(o.innerHTML=s),a=T(h),c=_(h,"SECTION",{class:!0});var v=P(c);E=_(v,"H2",{class:!0,"data-svelte-h":!0}),z(E)!=="svelte-yrzmmj"&&(E.textContent=q),y=T(v),I=_(v,"P",{class:!0,"data-svelte-h":!0}),z(I)!=="svelte-1igs3u"&&(I.textContent=w),g=T(v),S=_(v,"P",{"data-svelte-h":!0}),z(S)!=="svelte-1rfrtx"&&(S.textContent=V),F=T(v),j=_(v,"P",{"data-svelte-h":!0}),z(j)!=="svelte-1gxau71"&&(j.textContent=O),N=T(v),k=_(v,"P",{});var ie=P(k);J=L(ie,"The contest is free to join, but you will need a small amount of ETH on "),b=_(ie,"A",{href:!0,target:!0,class:!0});var be=P(b);$=L(be,M),be.forEach(u),D=L(ie," to cover gas for registration, submissions, and to claim any prizes."),ie.forEach(u),R=T(v),W=_(v,"H3",{class:!0,"data-svelte-h":!0}),z(W)!=="svelte-zjbopq"&&(W.textContent=Fe),Le=T(v),fe=_(v,"P",{"data-svelte-h":!0}),z(fe)!=="svelte-14dz9c9"&&(fe.innerHTML=Be),ze=T(v),he=_(v,"P",{"data-svelte-h":!0}),z(he)!=="svelte-imeu6z"&&(he.innerHTML=Ue),Pe=T(v),de=_(v,"P",{"data-svelte-h":!0}),z(de)!=="svelte-ufj0qf"&&(de.textContent=Re),v.forEach(u),we=T(h),Y=_(h,"SECTION",{id:!0,class:!0});var Me=P(Y);te=_(Me,"H2",{class:!0,"data-svelte-h":!0}),z(te)!=="svelte-3wh2cx"&&(te.textContent=We),Ie=T(Me),me=_(Me,"DIV",{class:!0});var et=P(me);pe(le.$$.fragment,et),et.forEach(u),Me.forEach(u),Ce=T(h),K=_(h,"SECTION",{class:!0});var xe=P(K);se=_(xe,"H2",{class:!0,"data-svelte-h":!0}),z(se)!=="svelte-jeimfp"&&(se.textContent=Ye),Ne=T(xe),B=_(xe,"UL",{class:!0});var ee=P(B);ae=_(ee,"LI",{class:!0,"data-svelte-h":!0}),z(ae)!=="svelte-j1752f"&&(ae.innerHTML=Je),Oe=T(ee),X=_(ee,"LI",{class:!0});var Se=P(X);Q=_(Se,"A",{href:!0,target:!0,class:!0});var tt=P(Q);je=L(tt,"Contest contract"),tt.forEach(u),Ae=T(Se),_e=_(Se,"UL",{"data-svelte-h":!0}),z(_e)!=="svelte-jdpcgb"&&(_e.innerHTML=Ke),Se.forEach(u),Ge=T(ee),ne=_(ee,"LI",{class:!0,"data-svelte-h":!0}),z(ne)!=="svelte-37zo31"&&(ne.innerHTML=Qe),Ve=T(ee),re=_(ee,"LI",{class:!0,"data-svelte-h":!0}),z(re)!=="svelte-f7mg1l"&&(re.innerHTML=Xe),ee.forEach(u),xe.forEach(u),Ee=T(h),Z=_(h,"SECTION",{class:!0,"data-svelte-h":!0}),z(Z)!=="svelte-1j0sw85"&&(Z.innerHTML=Ze),this.h()},h(){var h;d(t,"class","illustration svelte-1hkdvg8"),d(o,"class","svelte-1hkdvg8"),d(E,"class","svelte-1hkdvg8"),d(I,"class","svelte-1hkdvg8"),d(b,"href",x=Object.values(f[0].blockExplorers??{})[0].url),d(b,"target","_blank"),d(b,"class","svelte-1hkdvg8"),d(W,"class","svelte-1hkdvg8"),d(c,"class","svelte-1hkdvg8"),d(te,"class","svelte-1hkdvg8"),d(me,"class","content"),d(Y,"id","progress"),d(Y,"class","svelte-1hkdvg8"),d(se,"class","svelte-1hkdvg8"),d(ae,"class","svelte-1hkdvg8"),d(Q,"href",Te=`${(h=f[0].blockExplorers)==null?void 0:h.default.url}address/${nt}`),d(Q,"target","_blank"),d(Q,"class","svelte-1hkdvg8"),d(X,"class","svelte-1hkdvg8"),d(ne,"class","svelte-1hkdvg8"),d(re,"class","svelte-1hkdvg8"),d(B,"class","svelte-1hkdvg8"),d(K,"class","resources svelte-1hkdvg8"),d(Z,"class","svelte-1hkdvg8")},m(h,v){ge(e,h,v),p(h,l,v),p(h,t,v),p(h,r,v),p(h,o,v),p(h,a,v),p(h,c,v),i(c,E),i(c,y),i(c,I),i(c,g),i(c,S),i(c,F),i(c,j),i(c,N),i(c,k),i(k,J),i(k,b),i(b,$),i(k,D),i(c,R),i(c,W),i(c,Le),i(c,fe),i(c,ze),i(c,he),i(c,Pe),i(c,de),p(h,we,v),p(h,Y,v),i(Y,te),i(Y,Ie),i(Y,me),ge(le,me,null),p(h,Ce,v),p(h,K,v),i(K,se),i(K,Ne),i(K,B),i(B,ae),i(B,Oe),i(B,X),i(X,Q),i(Q,je),i(X,Ae),i(X,_e),i(B,Ge),i(B,ne),i(B,Ve),i(B,re),p(h,Ee,v),p(h,Z,v),oe=!0},p(h,v){var be;const ie={};v&4&&(ie.$$scope={dirty:v,ctx:h}),e.$set(ie),(!oe||v&1)&&M!==(M=h[0].name+"")&&ue($,M),(!oe||v&1&&x!==(x=Object.values(h[0].blockExplorers??{})[0].url))&&d(b,"href",x),(!oe||v&1&&Te!==(Te=`${(be=h[0].blockExplorers)==null?void 0:be.default.url}address/${nt}`))&&d(Q,"href",Te)},i(h){oe||(G(e.$$.fragment,h),G(le.$$.fragment,h),oe=!0)},o(h){A(e.$$.fragment,h),A(le.$$.fragment,h),oe=!1},d(h){h&&(u(l),u(t),u(r),u(o),u(a),u(c),u(we),u(Y),u(Ce),u(K),u(Ee),u(Z)),ke(e,h),ke(le)}}}function Ut(f){let e,l;return e=new Ct({props:{$$slots:{default:[Bt]},$$scope:{ctx:f}}}),{c(){ve(e.$$.fragment)},l(t){pe(e.$$.fragment,t)},m(t,n){ge(e,t,n),l=!0},p(t,[n]){const r={};n&5&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){l||(G(e.$$.fragment,t),l=!0)},o(t){A(e.$$.fragment,t),l=!1},d(t){ke(e,t)}}}function Rt(f,e,l){const{publicClient:t}=vt();let n;return l(0,n=t.chain),[n]}class ll extends ht{constructor(e){super(),dt(this,e,Rt,Ut,ft,{})}}export{ll as component}; diff --git a/_app/immutable/nodes/4.ChOve-pn.js b/_app/immutable/nodes/4.ChOve-pn.js new file mode 100644 index 0000000..74435ae --- /dev/null +++ b/_app/immutable/nodes/4.ChOve-pn.js @@ -0,0 +1,9 @@ +import{s as Ie,o as Pe,p as _e,k as P,i as d,b as F,e as M,t as b,j as N,d as C,f as S,q as he,h as y,v as D,l as m,m as H,n as ye}from"../chunks/scheduler.gEqqeaCZ.js";import{S as ze,i as Me,c as Y,b as Z,m as x,t as O,a as T,d as ee,g as ne,e as re}from"../chunks/index.BtSuiA6z.js";import{e as X,u as se,o as oe}from"../chunks/each.kVXWp4N9.js";import{b as ae}from"../chunks/paths.DTSw6QKH.js";import{p as Ce}from"../chunks/stores.CoMZMUm9.js";import{P as De,c as Se,g as me}from"../chunks/kit.D0HsIFJD.js";import{P as Le,L as Be,C as Ee}from"../chunks/page.DRg7gFN1.js";import{P as we}from"../chunks/player.PGhbgZJS.js";import{f as de}from"../chunks/site.BlgjxTUG.js";function ge(f,e,t){const l=f.slice();return l[7]=e[t],l[9]=t,l}function pe(f,e,t){const l=f.slice();return l[10]=e[t],l}function ke(f,e,t){const l=f.slice();return l[10]=e[t],l}function Fe(f){let e,t,l,r,s="Bracket Ranking",o,a,n=[],u=new Map,_,p,$,V="Matches",A,E,R,L=f[0].rankings.length+"",v,k,w=f[0].matches.length+"",g,h,z=f[0].matches.length/Math.ceil(f[0].rankings.length/4)+"",j,K,q,G,B=[],ie=new Map,Q;e=new Be({props:{$$slots:{default:[Oe]},$$scope:{ctx:f}}});let te=X(f[0].rankings);const ce=i=>i[10].address;for(let i=0;ii[7].id;for(let i=0;ig[10].address;for(let g=0;g{o[_]=null}),re()),~e?(t=o[e],t?t.p(n,u):(t=o[e]=s[e](n),t.c()),O(t,1),t.m(l.parentNode,l)):t=null)},i(n){r||(O(t),r=!0)},o(n){T(t),r=!1},d(n){n&&d(l),~e&&o[e].d(n)}}}function je(f){let e,t;return e=new Le({props:{title:"Bracket Details",$$slots:{default:[Ue]},$$scope:{ctx:f}}}),{c(){Y(e.$$.fragment)},l(l){Z(e.$$.fragment,l)},m(l,r){x(e,l,r),t=!0},p(l,[r]){const s={};r&32769&&(s.$$scope={dirty:r,ctx:l}),e.$set(s)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){ee(e,l)}}}function qe(f,e,t){let l;Pe(f,Ce,_=>t(4,l=_));let r,s,o,a;const n=Se(_=>t(0,a=_));function u(_){t(1,r=_.get("tournament")??void 0),t(2,s=Number(_.get("season")??"1")-1),t(3,o=Number(_.get("bracket")??"1")-1)}return f.$$.update=()=>{f.$$.dirty&16&&u(l.url.searchParams),f.$$.dirty&14&&(r&&s!==void 0&&o!==void 0?n(async()=>{const _=await fetch(`${De}/results/bracket?${new URLSearchParams({tournament:r,season:s.toString(),bracket:o.toString()})}`);if(!_.ok)throw console.error(await _.text()),new Error(_.statusText);const p=await _.json();return{...p,time:new Date(p.time)}}):t(0,a=new Error("Not Found")))},[a,r,s,o,l]}class et extends ze{constructor(e){super(),Me(this,e,qe,je,Ie,{})}}export{et as component}; diff --git a/_app/immutable/nodes/5.CJb-rz7u.js b/_app/immutable/nodes/5.CJb-rz7u.js new file mode 100644 index 0000000..c084372 --- /dev/null +++ b/_app/immutable/nodes/5.CJb-rz7u.js @@ -0,0 +1,24 @@ +import{s as We,o as Ye,p as pe,k as R,i as m,b as M,e as A,j as F,d as w,f as S,v as y,t as D,h as P,l as p,m as j,n as _e,q as Je,w as K,x as xe,y as me}from"../chunks/scheduler.gEqqeaCZ.js";import{S as et,i as tt,c as le,b as se,m as ae,t as U,a as H,d as ne,g as oe,e as ie}from"../chunks/index.BtSuiA6z.js";import{e as Q,u as Qe,o as lt,d as st}from"../chunks/each.kVXWp4N9.js";import{b as de}from"../chunks/paths.DTSw6QKH.js";import{p as at}from"../chunks/stores.CoMZMUm9.js";import{U as nt,P as rt,c as ot,g as we}from"../chunks/kit.D0HsIFJD.js";import{P as it,L as ft,C as Xe}from"../chunks/page.DRg7gFN1.js";import{P as ge}from"../chunks/player.PGhbgZJS.js";function Se(s,e,t){const l=s.slice();return l[14]=e[t],l[16]=t,l}function De(s,e,t){const l=s.slice();return l[17]=e[t].playerIdx,l[18]=e[t].swaps,l[20]=t,l}function Pe(s,e,t){const l=s.slice();return l[21]=e[t],l}function Ne(s,e,t){const l=s.slice();return l[24]=e[t],l[26]=t,l}function ze(s,e,t){const l=s.slice();return l[17]=e[t],l}function Be(s,e,t){const l=s.slice();return l[29]=e[t],l[26]=t,l}function ct(s){let e,t,l,n=[],_=new Map,c;e=new ft({props:{$$slots:{default:[ht]},$$scope:{ctx:s}}});let f=Q(s[0].rounds);const o=i=>i[16];for(let i=0;i0&&Fe(s);return{c(){t&&t.c(),e=pe()},l(l){t&&t.l(l),e=pe()},m(l,n){t&&t.m(l,n),R(l,e,n)},p(l,n){l[29]>0?t?t.p(l,n):(t=Fe(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&m(e),t&&t.d(l)}}}function Te(s){var E;let e,t,l,n,_,c,f,o,i,a=s[16]===s[0].rounds.length-1&&s[17]===s[0].winnerIdx&&Re();n=new ge({props:{name:s[0].players[s[17]].name}});let r=((E=s[14].block)==null?void 0:E.bids)&&s[14].block.bids[s[17]]>0&&Me(s),d=Q(s[14].balances[s[17]]),h=[];for(let u=0;u0?r?r.p(u,b):(r=Me(u),r.c(),r.m(t,c)):r&&(r.d(1),r=null),(!i||b[0]&1)&&K(t,"builder",u[17]===((I=u[14].block)==null?void 0:I.builderIdx)),b[0]&9){d=Q(u[14].balances[u[17]]);let k;for(k=0;kH(b[v],1,1,()=>{b[v]=null});return h=new ge({props:{name:s[0].players[s[14].block.builderIdx].name}}),{c(){for(let v=0;v1)},m(a,r){R(a,e,r),p(e,t),p(t,l),ae(n,l,null),p(t,_),p(e,c);for(let d=0;d1)},i(a){f||(U(n.$$.fragment,a),f=!0)},o(a){H(n.$$.fragment,a),f=!1},d(a){a&&m(e),ne(n),me(i,a)}}}function je(s,e){let t,l,n,_,c,f,o=e[16]+1+"",i,a,r,d,h,E,u,b,g,v=` + Block Activity`,I,k,$,O,L=[],G=new Map,B,V,J,X,W,x,$e,ee=Q(He(e[14].balances,e[9])),C=[];for(let N=0;NH(C[N],1,1,()=>{C[N]=null});function Ke(){return e[10](e[16])}let fe=Q(e[14].resupply[0]);const Ie=N=>N[26];for(let N=0;N{Y[T]=null}),ie(),J=Y[V],J?J.p(e,z):(J=Y[V]=Ee[V](e),J.c()),U(J,1),J.m(k,null)),(!W||z[0]&5)&&K(u,"expanded",e[2][e[16]])},i(N){if(!W){for(let z=0;z{c[a]=null}),ie()),~e?(t=c[e],t?t.p(o,i):(t=c[e]=_[e](o),t.c()),U(t,1),t.m(l.parentNode,l)):t=null)},i(o){n||(U(t),n=!0)},o(o){H(t),n=!1},d(o){o&&m(l),~e&&c[e].d(o)}}}function kt(s){let e,t;return e=new it({props:{title:"Match Details",$$slots:{default:[bt]},$$scope:{ctx:s}}}),{c(){le(e.$$.fragment)},l(l){se(e.$$.fragment,l)},m(l,n){ae(e,l,n),t=!0},p(l,n){const _={};n[0]&7|n[1]&1&&(_.$$scope={dirty:n,ctx:l}),e.$set(_)},i(l){t||(U(e.$$.fragment,l),t=!0)},o(l){H(e.$$.fragment,l),t=!1},d(l){ne(e,l)}}}const gt=/(\.?0+(e[-+]\d+)|\.?0+)$/;function $t(s){var l;const e=s[1].players,t=[];for(let n=2;nr.slice()):be(e);let o=t;for(;or.map((h,E)=>h-c[d][E]))}}function Et(s){return[...new Array(s)].fill(0)}function be(s){return[...new Array(s)].map(()=>[...new Array(s)].fill(0))}function ke(s,e,t,l){l=Math.min(e.length,l??e.length);let n=t;for(;n1e-5?e=s.toFixed(4):e=s.toExponential(4),e.replace(gt,"$2"))}function he(s){const e=Z(s);return s<0?e:`+${e}`}function He(s,e){const t=s.map(e);return s.map((l,n)=>n).sort((l,n)=>t[l]-t[n])}function Ge(s){const e=[];let t=null;for(const l of s)(!t||t.playerIdx!==l.playerIdx)&&(t={playerIdx:l.playerIdx,swaps:[]},e.push(t)),t.swaps.push(l);return e}function yt(s,e,t){let l;Ye(s,at,g=>t(8,l=g));const n=["🪙","🍞","🐟️","🍎","🥕","👕"];let _,c,f,o,i,a;const r=ot(g=>t(0,a=g));let d=[];function h(g){t(4,_=g.get("tournament")??void 0),t(5,c=Number(g.get("season")??"1")-1),t(6,f=Number(g.get("bracket")??"1")-1),t(1,i=Number(g.get("idx")??"1")-1),t(7,o=g.get("match")??void 0)}function E(g){return n[g]??"?"}const u=g=>-Math.max(...g),b=g=>t(2,d[g]=!d[g],d);return s.$$.update=()=>{s.$$.dirty[0]&256&&h(l.url.searchParams),s.$$.dirty[0]&240&&(_&&c!==void 0&&f!==void 0&&o?r(async()=>{const g=await fetch(`${rt}/results/match?${new URLSearchParams({tournament:_,season:c.toString(),bracket:f.toString(),id:o.toString()})}`);if(!g.ok)throw console.error(await g.text()),new Error(g.statusText);const v=await g.json(),[I,k]=$t(JSON.parse(v.logs));return{tournamentId:v.tournamentId,season:v.season,type:v.type,bracket:v.bracket,duration:v.duration,players:k.map($=>v.players.find(O=>O.address===$)),time:new Date(v.time),rounds:I,winnerIdx:k.findIndex($=>$===v.players[0].address)}}):t(0,a=new nt("Not found"))),s.$$.dirty[0]&1&&(a&&!(a instanceof Promise)&&!(a instanceof Error)?t(2,d=[...new Array(a.rounds.length)].map(()=>!1)):t(2,d=[]))},[a,i,d,E,_,c,f,o,l,u,b]}class Vt extends et{constructor(e){super(),tt(this,e,yt,kt,We,{},null,[-1,-1])}}export{Vt as component}; diff --git a/_app/immutable/nodes/6.9KmTK4S5.js b/_app/immutable/nodes/6.9KmTK4S5.js new file mode 100644 index 0000000..4f3c905 --- /dev/null +++ b/_app/immutable/nodes/6.9KmTK4S5.js @@ -0,0 +1,6 @@ +import{s as Oe,o as oe,b as $,p as G,j as z,k as I,i as f,e as C,d as E,q as W,v as w,t as R,f as N,h as V,l as h,m as F,n as J,x as re,B as ye,A as ve,r as Me}from"../chunks/scheduler.gEqqeaCZ.js";import{S as Re,i as Ve,c as de,b as _e,m as he,t as te,a as se,d as pe,g as Le,e as $e}from"../chunks/index.BtSuiA6z.js";import{e as ae,u as De,d as He}from"../chunks/each.kVXWp4N9.js";import{P as ze,L as Be,C as Ue}from"../chunks/page.DRg7gFN1.js";import{p as je}from"../chunks/stores.CoMZMUm9.js";import{t as fe,k as ce,r as Fe,P as Je,U as x,c as ue,g as ie}from"../chunks/kit.D0HsIFJD.js";import{g as Ke,k as Ge,h as be,f as ge}from"../chunks/site.BlgjxTUG.js";import{b as ke}from"../chunks/paths.DTSw6QKH.js";import{m as we,w as We,a as Ye,b as qe,S as Xe}from"../chunks/contest.DdHcFc7E.js";const Qe="0x0000000000000000000000000000000000000000000000000000000000000000";async function Ze(r,e,t){const s=Buffer.concat([fe(e),fe(t)]),l=await crypto.subtle.generateKey({name:"AES-GCM",length:128},!0,["encrypt","decrypt"]),n=crypto.getRandomValues(new Uint8Array(12)),a=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},l,s),i=await crypto.subtle.encrypt({name:"RSA-OAEP"},await crypto.subtle.importKey("jwk",xe(r),{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),await crypto.subtle.exportKey("raw",l));return{encryptedAesKey:ce(new Uint8Array(i)),encryptedCode:ce(new Uint8Array(a).slice(0,-16)),iv:ce(n)}}function xe(r){return JSON.parse(Buffer.from(fe(r)).toString())}function Ce(r,e,t){const s=r.slice();return s[29]=e[t],s[31]=t,s}function Ee(r,e,t){const s=r.slice();return s[32]=e[t],s}function Pe(r){let e,t,s,l,n,a,i=r[0].playerAddress+"",d,T,c,m;function M(u,P){return u[10]?tt:et}let b=M(r),p=b(r);function v(u,P){return u[8]?lt:st}let o=v(r),y=o(r);return{c(){e=C("div"),t=R(`Name: + `),p.c(),s=$(),l=C("div"),n=R("Address: "),a=C("a"),d=R(i),c=$(),m=C("div"),y.c(),this.h()},l(u){e=E(u,"DIV",{});var P=N(e);t=V(P,`Name: + `),p.l(P),P.forEach(f),s=z(u),l=E(u,"DIV",{class:!0});var O=N(l);n=V(O,"Address: "),a=E(O,"A",{class:!0,href:!0,target:!0});var D=N(a);d=V(D,i),D.forEach(f),O.forEach(f),c=z(u),m=E(u,"DIV",{class:!0});var B=N(m);y.l(B),B.forEach(f),this.h()},h(){var u,P,O;w(a,"class","address svelte-65gwcy"),w(a,"href",T=`${(O=(P=(u=r[12])==null?void 0:u.chain)==null?void 0:P.blockExplorers)==null?void 0:O.default.url}address/${r[0].playerAddress}`),w(a,"target","_blank"),w(l,"class","address svelte-65gwcy"),w(m,"class","is-active")},m(u,P){I(u,e,P),h(e,t),p.m(e,null),I(u,s,P),I(u,l,P),h(l,n),h(l,a),h(a,d),I(u,c,P),I(u,m,P),y.m(m,null)},p(u,P){var O,D,B;b===(b=M(u))&&p?p.p(u,P):(p.d(1),p=b(u),p&&(p.c(),p.m(e,null))),P[0]&1&&i!==(i=u[0].playerAddress+"")&&F(d,i),P[0]&1&&T!==(T=`${(B=(D=(O=u[12])==null?void 0:O.chain)==null?void 0:D.blockExplorers)==null?void 0:B.default.url}address/${u[0].playerAddress}`)&&w(a,"href",T),o!==(o=v(u))&&(y.d(1),y=o(u),y&&(y.c(),y.m(m,null)))},d(u){u&&(f(e),f(s),f(l),f(c),f(m)),p.d(),y.d()}}}function et(r){let e,t=r[0].playerName+"",s;return{c(){e=C("span"),s=R(t),this.h()},l(l){e=E(l,"SPAN",{class:!0});var n=N(e);s=V(n,t),n.forEach(f),this.h()},h(){w(e,"class","name svelte-65gwcy")},m(l,n){I(l,e,n),h(e,s)},p(l,n){n[0]&1&&t!==(t=l[0].playerName+"")&&F(s,t)},d(l){l&&f(e)}}}function tt(r){let e,t=r[0].playerName+"",s;return{c(){e=C("a"),s=R(t),this.h()},l(l){e=E(l,"A",{class:!0,target:!0,href:!0});var n=N(e);s=V(n,t),n.forEach(f),this.h()},h(){w(e,"class","name svelte-65gwcy"),w(e,"target","_blank"),w(e,"href",r[10])},m(l,n){I(l,e,n),h(e,s)},p(l,n){n[0]&1&&t!==(t=l[0].playerName+"")&&F(s,t),n[0]&1024&&w(e,"href",l[10])},d(l){l&&f(e)}}}function st(r){let e;return{c(){e=R("Awaiting submission ✘")},l(t){e=V(t,"Awaiting submission ✘")},m(t,s){I(t,e,s)},d(t){t&&f(e)}}}function lt(r){let e;return{c(){e=R("Submission received ✓")},l(t){e=V(t,"Submission received ✓")},m(t,s){I(t,e,s)},d(t){t&&f(e)}}}function nt(r){let e,t="Merchant Details",s,l,n=r[0]&&Pe(r);return{c(){e=C("h1"),e.textContent=t,s=$(),n&&n.c(),l=G(),this.h()},l(a){e=E(a,"H1",{class:!0,"data-svelte-h":!0}),W(e)!=="svelte-1g3lfz6"&&(e.textContent=t),s=z(a),n&&n.l(a),l=G(),this.h()},h(){w(e,"class","svelte-65gwcy")},m(a,i){I(a,e,i),I(a,s,i),n&&n.m(a,i),I(a,l,i)},p(a,i){a[0]?n?n.p(a,i):(n=Pe(a),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(a){a&&(f(e),f(s),f(l)),n&&n.d(a)}}}function rt(r){var v;let e,t,s,l="Performance History",n,a,i,d=r[9]>0n&&((v=r[2])==null?void 0:v.address)==r[0].playerAddress&&Se(r);function T(o,y){var u;return(u=o[0].seasonResults)!=null&&u.length?ot:ct}let c=T(r),m=c(r);function M(o,y){if(!o[1]||o[1].state!==Xe.Started)return ft;if(o[7])return ut}let b=M(r),p=b&&b(r);return{c(){e=C("section"),d&&d.c(),t=$(),s=C("h2"),s.textContent=l,n=$(),m.c(),a=$(),i=C("section"),p&&p.c(),this.h()},l(o){e=E(o,"SECTION",{class:!0});var y=N(e);d&&d.l(y),t=z(y),s=E(y,"H2",{class:!0,"data-svelte-h":!0}),W(s)!=="svelte-9rlwd4"&&(s.textContent=l),n=z(y),m.l(y),y.forEach(f),a=z(o),i=E(o,"SECTION",{class:!0});var u=N(i);p&&p.l(u),u.forEach(f),this.h()},h(){w(s,"class","svelte-65gwcy"),w(e,"class","stats svelte-65gwcy"),w(i,"class","tools svelte-65gwcy")},m(o,y){I(o,e,y),d&&d.m(e,null),h(e,t),h(e,s),h(e,n),m.m(e,null),I(o,a,y),I(o,i,y),p&&p.m(i,null)},p(o,y){var u;o[9]>0n&&((u=o[2])==null?void 0:u.address)==o[0].playerAddress?d?d.p(o,y):(d=Se(o),d.c(),d.m(e,t)):d&&(d.d(1),d=null),c===(c=T(o))&&m?m.p(o,y):(m.d(1),m=c(o),m&&(m.c(),m.m(e,null))),b===(b=M(o))&&p?p.p(o,y):(p&&p.d(1),p=b&&b(o),p&&(p.c(),p.m(i,null)))},i:J,o:J,d(o){o&&(f(e),f(a),f(i)),d&&d.d(),m.d(),p&&p.d()}}}function at(r){let e,t,s=ie(r[3])+"",l;return{c(){e=C("section"),t=C("div"),l=R(s),this.h()},l(n){e=E(n,"SECTION",{class:!0});var a=N(e);t=E(a,"DIV",{});var i=N(t);l=V(i,s),i.forEach(f),a.forEach(f),this.h()},h(){w(e,"class","not-found svelte-65gwcy")},m(n,a){I(n,e,a),h(e,t),h(t,l)},p(n,a){a[0]&8&&s!==(s=ie(n[3])+"")&&F(l,s)},i:J,o:J,d(n){n&&f(e)}}}function it(r){let e,t,s;return t=new Ue({}),{c(){e=C("section"),de(t.$$.fragment),this.h()},l(l){e=E(l,"SECTION",{class:!0});var n=N(e);_e(t.$$.fragment,n),n.forEach(f),this.h()},h(){w(e,"class","loading svelte-65gwcy")},m(l,n){I(l,e,n),he(t,e,null),s=!0},p:J,i(l){s||(te(t.$$.fragment,l),s=!0)},o(l){se(t.$$.fragment,l),s=!1},d(l){l&&f(e),pe(t)}}}function Se(r){let e,t,s,l=be(r[9])+"",n,a,i,d,T,c,m,M;return{c(){e=C("div"),t=C("p"),s=R("You have "),n=R(l),a=R(` ETH in unclaimed prizes! + `),i=C("button"),d=R("Claim Prize"),this.h()},l(b){e=E(b,"DIV",{class:!0});var p=N(e);t=E(p,"P",{});var v=N(t);s=V(v,"You have "),n=V(v,l),a=V(v,` ETH in unclaimed prizes! + `),i=E(v,"BUTTON",{"aria-busy":!0,class:!0});var o=N(i);d=V(o,"Claim Prize"),o.forEach(f),v.forEach(f),p.forEach(f),this.h()},h(){i.disabled=T=r[5]instanceof Promise,w(i,"aria-busy",c=r[5]instanceof Promise),w(i,"class","svelte-65gwcy"),w(e,"class","alert svelte-65gwcy")},m(b,p){I(b,e,p),h(e,t),h(t,s),h(t,n),h(t,a),h(t,i),h(i,d),m||(M=re(i,"click",r[19]),m=!0)},p(b,p){p[0]&512&&l!==(l=be(b[9])+"")&&F(n,l),p[0]&32&&T!==(T=b[5]instanceof Promise)&&(i.disabled=T),p[0]&32&&c!==(c=b[5]instanceof Promise)&&w(i,"aria-busy",c)},d(b){b&&f(e),m=!1,M()}}}function ot(r){let e=[],t=new Map,s,l=ae(r[0].seasonResults);const n=a=>a[31];for(let a=0;aDate
    Type
    Rank
    Score
    ",T,c=[],m=new Map,M,b=ae(r[29]);const p=v=>v[32].tournamentId;for(let v=0;v/out folder under a folder of the same name as your contract file.`,b,p,v="If you're inputing your code manually, make sure you provide the undeployed bytecode and not the "deployed" one. These are typically named bytecode and deployedBytecode, respectively, in compiler artifacts.",o,y,u,P,O,D,B,U,L,Y,Q;function q(k,S){return k[8]?dt:_t}let K=q(r),j=K(r);function le(k,S){return typeof k[4]=="string"&&k[4]!=="0x"?pt:ht}let ee=le(r),_=ee(r);function H(k,S){if(k[4]instanceof Error)return yt;if(typeof k[4]=="string"&&k[4]!=="0x")return mt}let g=H(r),A=g&&g(r);return{c(){e=C("section"),t=C("h2"),s=R("Submit code for season "),n=R(l),a=$(),j.c(),i=$(),d=C("p"),d.textContent=T,c=$(),m=C("p"),m.innerHTML=M,b=$(),p=C("p"),p.innerHTML=v,o=$(),y=C("div"),u=C("form"),P=C("textarea"),O=$(),D=C("button"),_.c(),L=$(),A&&A.c(),this.h()},l(k){e=E(k,"SECTION",{class:!0});var S=N(e);t=E(S,"H2",{class:!0});var Z=N(t);s=V(Z,"Submit code for season "),n=V(Z,l),Z.forEach(f),a=z(S),j.l(S),i=z(S),d=E(S,"P",{"data-svelte-h":!0}),W(d)!=="svelte-1fzlgoa"&&(d.textContent=T),c=z(S),m=E(S,"P",{"data-svelte-h":!0}),W(m)!=="svelte-1b18m7p"&&(m.innerHTML=M),b=z(S),p=E(S,"P",{"data-svelte-h":!0}),W(p)!=="svelte-uorx0t"&&(p.innerHTML=v),o=z(S),y=E(S,"DIV",{});var ne=N(y);u=E(ne,"FORM",{class:!0});var X=N(u);P=E(X,"TEXTAREA",{class:!0,placeholder:!0}),N(P).forEach(f),O=z(X),D=E(X,"BUTTON",{"aria-busy":!0,class:!0});var me=N(D);_.l(me),me.forEach(f),L=z(X),A&&A.l(X),X.forEach(f),ne.forEach(f),S.forEach(f),this.h()},h(){w(t,"class","svelte-65gwcy"),w(P,"class","bytecode svelte-65gwcy"),w(P,"placeholder","Drop JSON artifact or paste (hex) bytecode"),w(D,"aria-busy",B=r[4]instanceof Promise),D.disabled=U=r[4]instanceof Promise,w(D,"class","svelte-65gwcy"),w(u,"class","submit-bytecode svelte-65gwcy"),w(e,"class","svelte-65gwcy")},m(k,S){I(k,e,S),h(e,t),h(t,s),h(t,n),h(e,a),j.m(e,null),h(e,i),h(e,d),h(e,c),h(e,m),h(e,b),h(e,p),h(e,o),h(e,y),h(y,u),h(u,P),ye(P,r[6]),h(u,O),h(u,D),_.m(D,null),h(u,L),A&&A.m(u,null),Y||(Q=[re(P,"drop",ve(r[16])),re(P,"input",r[20]),re(u,"submit",ve(r[14]))],Y=!0)},p(k,S){S[0]&2&&l!==(l=(k[1].idx??0)+1+"")&&F(n,l),K!==(K=q(k))&&(j.d(1),j=K(k),j&&(j.c(),j.m(e,i))),S[0]&64&&ye(P,k[6]),ee!==(ee=le(k))&&(_.d(1),_=ee(k),_&&(_.c(),_.m(D,null))),S[0]&16&&B!==(B=k[4]instanceof Promise)&&w(D,"aria-busy",B),S[0]&16&&U!==(U=k[4]instanceof Promise)&&(D.disabled=U),g===(g=H(k))&&A?A.p(k,S):(A&&A.d(1),A=g&&g(k),A&&(A.c(),A.m(u,null)))},d(k){k&&f(e),j.d(),_.d(),A&&A.d(),Y=!1,Me(Q)}}}function ft(r){let e,t="Current season is closed and cannot accept new submissions at this time.";return{c(){e=C("div"),e.textContent=t},l(s){e=E(s,"DIV",{"data-svelte-h":!0}),W(e)!=="svelte-1e9vh8h"&&(e.textContent=t)},m(s,l){I(s,e,l)},p:J,d(s){s&&f(e)}}}function dt(r){let e,t="You have already submitted your player code for the current season but you can replace your submission up until the season close.";return{c(){e=C("p"),e.textContent=t,this.h()},l(s){e=E(s,"P",{class:!0,"data-svelte-h":!0}),W(e)!=="svelte-vl1vip"&&(e.textContent=t),this.h()},h(){w(e,"class","svelte-65gwcy")},m(s,l){I(s,e,l)},d(s){s&&f(e)}}}function _t(r){let e,t="You have not submitted player code for the current season, so you are not participating in any games.";return{c(){e=C("p"),e.textContent=t,this.h()},l(s){e=E(s,"P",{class:!0,"data-svelte-h":!0}),W(e)!=="svelte-1n2ihsk"&&(e.textContent=t),this.h()},h(){w(e,"class","svelte-65gwcy")},m(s,l){I(s,e,l)},d(s){s&&f(e)}}}function ht(r){let e;return{c(){e=R("Submit")},l(t){e=V(t,"Submit")},m(t,s){I(t,e,s)},d(t){t&&f(e)}}}function pt(r){let e;return{c(){e=R("Submitted!")},l(t){e=V(t,"Submitted!")},m(t,s){I(t,e,s)},d(t){t&&f(e)}}}function mt(r){return{c:J,l:J,m:J,p:J,d:J}}function yt(r){let e,t=ie(r[4])+"",s;return{c(){e=C("div"),s=R(t),this.h()},l(l){e=E(l,"DIV",{class:!0});var n=N(e);s=V(n,t),n.forEach(f),this.h()},h(){w(e,"class","error svelte-65gwcy")},m(l,n){I(l,e,n),h(e,s)},p(l,n){n[0]&16&&t!==(t=ie(l[4])+"")&&F(s,t)},d(l){l&&f(e)}}}function vt(r){let e,t,s,l,n,a;e=new Be({props:{$$slots:{default:[nt]},$$scope:{ctx:r}}});const i=[it,at,rt],d=[];function T(c,m){return c[3]instanceof Promise?0:c[3]instanceof Error?1:c[0]?2:-1}return~(s=T(r))&&(l=d[s]=i[s](r)),{c(){de(e.$$.fragment),t=$(),l&&l.c(),n=G()},l(c){_e(e.$$.fragment,c),t=z(c),l&&l.l(c),n=G()},m(c,m){he(e,c,m),I(c,t,m),~s&&d[s].m(c,m),I(c,n,m),a=!0},p(c,m){const M={};m[0]&1281|m[1]&16&&(M.$$scope={dirty:m,ctx:c}),e.$set(M);let b=s;s=T(c),s===b?~s&&d[s].p(c,m):(l&&(Le(),se(d[b],1,1,()=>{d[b]=null}),$e()),~s?(l=d[s],l?l.p(c,m):(l=d[s]=i[s](c),l.c()),te(l,1),l.m(n.parentNode,n)):l=null)},i(c){a||(te(e.$$.fragment,c),te(l),a=!0)},o(c){se(e.$$.fragment,c),se(l),a=!1},d(c){c&&(f(t),f(n)),pe(e,c),~s&&d[s].d(c)}}}function bt(r){let e,t;return e=new ze({props:{title:"Player Dashboard",$$slots:{default:[vt]},$$scope:{ctx:r}}}),{c(){de(e.$$.fragment)},l(s){_e(e.$$.fragment,s)},m(s,l){he(e,s,l),t=!0},p(s,l){const n={};l[0]&2047|l[1]&16&&(n.$$scope={dirty:l,ctx:s}),e.$set(n)},i(s){t||(te(e.$$.fragment,s),t=!0)},o(s){se(e.$$.fragment,s),t=!1},d(s){pe(e,s)}}}function Ne(r){return r.startsWith("0x")?r:`0x${r}`}function gt(r,e,t){let s,l,n;oe(r,je,_=>t(18,n=_));const{wallet:a,publicClient:i,seasons:d}=Ke();oe(r,a,_=>t(2,s=_)),oe(r,d,_=>t(17,l=_));let T,c,m,M=ue(_=>t(3,T=_)),b=ue(_=>t(4,c=_)),p=ue(_=>t(5,m=_)),v=null,o=null,y=!1,u=!1,P=0n,O=null,D=null;async function B(_){if(t(10,D=null),_.startsWith("github:")){const g=await(await fetch(`https://api.github.com/user/${_.slice(7)}`)).json();t(10,D=`https://github.com/${g.login}`)}}async function U(_){let H=_.get("address")??null,g=_.get("name")??null;H||g?await M(Y(H,g)):t(3,T=new Error("No player given"))}async function L(_,H,g){g=g??Fe(20);const[A,k]=await we({client:i,calls:[{fn:"operators",args:[H,g]},{fn:"playerCodeHash",args:[_,H]}]});t(7,y=A||g===H),t(8,u=k!==Qe)}async function Y(_,H){const g=await fetch(`${Je}/player-stats?${new URLSearchParams({..._?{address:_}:{name:H}})}`);if(!g.ok){if(g.status===404)throw new x("Player not found");try{throw new x(await g.json())}catch{throw new x("Failed to load")}}const A=await g.json(),k=[];for(const S of A.performance)(k[S.season]=k[S.season]??[]).push({...S,time:new Date(S.time)});k.reverse();for(const[S,Z]of k.entries())Z?Z.sort((ne,X)=>X.time.getTime()-ne.time.getTime()):k[S]=[];t(0,o={playerAddress:A.address,playerName:A.name,seasonResults:k,userId:A.userId})}function Q(){b(async()=>{let _=v??"0x";_.startsWith("0x")||(_=`0x${_}`);const H=_,g=Ge(H),A=await Ze(O.publicKey,o.playerAddress,H);let k;try{k=await We({client:s.client,fn:"submitCode",args:[O.idx,o.playerAddress,g,A]})}catch(S){if(/rejected/.test(S.message??""))return null;throw S}return console.debug(`TX submitted: ${k}`),await Ye(i,k),t(8,u=!0),k})}function q(){p(async()=>{if(!s||!o)return;let _=l.filter(g=>g.winner===(o==null?void 0:o.playerAddress)).map(g=>g.idx);if(_.length===0)return;const[...H]=await we({client:s.client,calls:_.map(g=>({fn:"winner",args:[g]}))});_=_.filter((g,A)=>H[A][1]!==0n),_.length!==0&&(await qe({client:s.client,calls:_.map(g=>({fn:"claim",args:[g,s.address]}))}),t(9,P=0n))})}async function K(_){var g,A;const H=(g=_.dataTransfer)==null?void 0:g.items[0];if(H){if(H.type!=="application/json"&&H.type!=="text/plain"){t(4,c=new x("Not a JSON compiler artifact."));return}const k=await((A=H.getAsFile())==null?void 0:A.text());try{t(6,v=j(JSON.parse(k)))}catch(S){if(S instanceof x)throw t(4,c=S),S;t(4,c=new x("Artifact not valid JSON."))}}}function j(_){var A;const H=/^0x[0-9a-f]*$/;let g=(A=_==null?void 0:_.bytecode)==null?void 0:A.object;if(typeof g=="string"&&H.test(g)||(g=_==null?void 0:_.bytecode,typeof g=="string"&&H.test(g)))return Ne(g);throw new x("Cannot find bytecode in artifact.")}const le=()=>q();function ee(){v=this.value,t(6,v)}return r.$$.update=()=>{r.$$.dirty[0]&262144&&U(n.url.searchParams),r.$$.dirty[0]&131079&&(t(1,O=l[l.length-1]??null),O&&o&&(t(9,P=l.filter(_=>_.winner===o.playerAddress).map(_=>_.unclaimedPrize).reduce((_,H)=>_+H,0n)),L(O.idx,o.playerAddress,s==null?void 0:s.address))),r.$$.dirty[0]&1&&o!=null&&o.userId&&B(o.userId)},[o,O,s,T,c,m,v,y,u,P,D,a,i,d,Q,q,K,l,n,le,ee]}class Nt extends Re{constructor(e){super(),Ve(this,e,gt,bt,Oe,{},null,[-1,-1])}}export{Nt as component}; diff --git a/_app/immutable/nodes/7.ZcmHt9qV.js b/_app/immutable/nodes/7.ZcmHt9qV.js new file mode 100644 index 0000000..cf89fb4 --- /dev/null +++ b/_app/immutable/nodes/7.ZcmHt9qV.js @@ -0,0 +1 @@ +import{s as x,o as O,z as ee,b as B,e as $,j as I,d as k,f as E,q as z,i as h,v as P,k as D,l as d,y as te,n as N,t as A,h as V,x as re,A as se,m as F}from"../chunks/scheduler.gEqqeaCZ.js";import{S as ae,i as le,c as M,b as T,m as U,t as w,a as C,d as q,g as H,e as R}from"../chunks/index.BtSuiA6z.js";import{e as J,u as ne,o as oe}from"../chunks/each.kVXWp4N9.js";import{P as ce,L as ie,C as Z}from"../chunks/page.DRg7gFN1.js";import{p as ue}from"../chunks/stores.CoMZMUm9.js";import{g as fe}from"../chunks/entry.B5WQGdlh.js";import{P as _e,U as he,c as me,g as K}from"../chunks/kit.D0HsIFJD.js";import"../chunks/paths.DTSw6QKH.js";import{P as de}from"../chunks/player.PGhbgZJS.js";function Q(i,t,e){const r=i.slice();return r[7]=t[e],r[9]=e,r}function W(i,t,e){const r=i.slice();return r[10]=t[e][0],r[11]=t[e][1],r}function pe(i){let t,e="Merchants";return{c(){t=$("h1"),t.textContent=e,this.h()},l(r){t=k(r,"H1",{class:!0,"data-svelte-h":!0}),z(t)!=="svelte-1twrlt1"&&(t.textContent=e),this.h()},h(){P(t,"class","svelte-u14j1h")},m(r,a){D(r,t,a)},p:N,d(r){r&&h(t)}}}function X(i){let t,e,r=i[11]+"",a,u,f;function l(){return i[5](i[10])}return{c(){t=$("div"),e=$("a"),a=A(r),this.h()},l(s){t=k(s,"DIV",{class:!0});var n=E(t);e=k(n,"A",{href:!0,class:!0});var c=E(e);a=V(c,r),c.forEach(h),n.forEach(h),this.h()},h(){P(e,"href","."),P(e,"class","svelte-u14j1h"),P(t,"class","opt svelte-u14j1h")},m(s,n){D(s,t,n),d(t,e),d(e,a),u||(f=re(e,"click",se(l)),u=!0)},p(s,n){i=s},d(s){s&&h(t),u=!1,f()}}}function ge(i){let t,e,r,a;const u=[ye,ke],f=[];function l(s,n){return s[1].length?0:1}return e=l(i),r=f[e]=u[e](i),{c(){t=$("div"),r.c(),this.h()},l(s){t=k(s,"DIV",{class:!0});var n=E(t);r.l(n),n.forEach(h),this.h()},h(){P(t,"class","players-list")},m(s,n){D(s,t,n),f[e].m(t,null),a=!0},p(s,n){let c=e;e=l(s),e===c?f[e].p(s,n):(H(),C(f[c],1,1,()=>{f[c]=null}),R(),r=f[e],r?r.p(s,n):(r=f[e]=u[e](s),r.c()),w(r,1),r.m(t,null))},i(s){a||(w(r),a=!0)},o(s){C(r),a=!1},d(s){s&&h(t),f[e].d()}}}function ve(i){let t,e,r,a=K(i[2])+"",u,f;return e=new Z({props:{failed:!0}}),{c(){t=$("div"),M(e.$$.fragment),r=B(),u=A(a),this.h()},l(l){t=k(l,"DIV",{class:!0});var s=E(t);T(e.$$.fragment,s),r=I(s),u=V(s,a),s.forEach(h),this.h()},h(){P(t,"class","error")},m(l,s){D(l,t,s),U(e,t,null),d(t,r),d(t,u),f=!0},p(l,s){(!f||s&4)&&a!==(a=K(l[2])+"")&&F(u,a)},i(l){f||(w(e.$$.fragment,l),f=!0)},o(l){C(e.$$.fragment,l),f=!1},d(l){l&&h(t),q(e)}}}function $e(i){let t,e,r;return e=new Z({}),{c(){t=$("div"),M(e.$$.fragment),this.h()},l(a){t=k(a,"DIV",{class:!0});var u=E(t);T(e.$$.fragment,u),u.forEach(h),this.h()},h(){P(t,"class","spinner")},m(a,u){D(a,t,u),U(e,t,null),r=!0},p:N,i(a){r||(w(e.$$.fragment,a),r=!0)},o(a){C(e.$$.fragment,a),r=!1},d(a){a&&h(t),q(e)}}}function ke(i){let t,e="No registered players.";return{c(){t=$("div"),t.textContent=e},l(r){t=k(r,"DIV",{"data-svelte-h":!0}),z(t)!=="svelte-1a0hpm9"&&(t.textContent=e)},m(r,a){D(r,t,a)},p:N,i:N,o:N,d(r){r&&h(t)}}}function ye(i){let t,e=[],r=new Map,a,u=J(i[1]);const f=l=>l[7].address;for(let l=0;l{g[j]=null}),R(),c=g[n],c?c.p(o,_):(c=g[n]=L[n](o),c.c()),w(c,1),c.m(r,null))},i(o){p||(w(t.$$.fragment,o),w(c),p=!0)},o(o){C(t.$$.fragment,o),C(c),p=!1},d(o){o&&(h(e),h(r)),q(t,o),te(m,o),g[n].d()}}}function Ee(i){let t,e;return t=new ce({props:{title:"Merchant Dashboard",$$slots:{default:[be]},$$scope:{ctx:i}}}),{c(){M(t.$$.fragment)},l(r){T(t.$$.fragment,r)},m(r,a){U(t,r,a),e=!0},p(r,[a]){const u={};a&16391&&(u.$$scope={dirty:a,ctx:r}),t.$set(u)},i(r){e||(w(t.$$.fragment,r),e=!0)},o(r){C(t.$$.fragment,r),e=!1},d(r){q(t,r)}}}function Pe(i,t){return t==="joined"?i.sort((e,r)=>e.created.getTime()-r.created.getTime()):i.sort((e,r)=>e.name.localeCompare(r.name)),i}function je(i,t,e){let r;O(i,ue,c=>e(4,r=c));let a;const u=me(c=>e(2,a=c));var f=(c=>(c.Name="name",c.Joined="joined",c.LastTournamentScore="tournament",c.LastScrimmage="scrimmage",c))(f||{});let{sortBy:l=void 0}=t,s=[];ee(async()=>{await u((async()=>{const c=await fetch(`${_e}/players`,{headers:{"content-type":"application/json"}});if(!c.ok){const{error:p}=await c.json();throw new he(`Failed to fetch players: ${p}`)}e(1,s=(await c.json()).map(p=>({name:p.name,address:p.address,created:new Date(p.created)}))),e(0,l=r.url.searchParams.get("sortBy")??"name")})())});const n=c=>e(0,l=c);return i.$$set=c=>{"sortBy"in c&&e(0,l=c.sortBy)},i.$$.update=()=>{if(i.$$.dirty&17){const c=r.url.searchParams.get("sortBy");l&&c!==l&&(r.url.searchParams.set("sortBy",l),fe(`?${r.url.searchParams.toString()}`))}i.$$.dirty&3&&e(1,s=Pe(s,l))},[l,s,a,f,r,n]}class Ve extends ae{constructor(t){super(),le(this,t,je,Ee,x,{sortBy:0})}}export{Ve as component}; diff --git a/_app/immutable/nodes/8.NSEh19qL.js b/_app/immutable/nodes/8.NSEh19qL.js new file mode 100644 index 0000000..d1ae92a --- /dev/null +++ b/_app/immutable/nodes/8.NSEh19qL.js @@ -0,0 +1,3 @@ +import{s as Ie,o as ye,z as Se,b as B,p as ke,j as M,k as I,i as d,e as p,d as b,q as x,v as l,n as se,t as j,f as w,h as q,l as c,B as oe,x as K,A as Pe,m as le,r as Te,C as $e}from"../chunks/scheduler.gEqqeaCZ.js";import{S as Re,i as Ae,c as de,b as he,m as me,t as ee,a as te,d as pe,g as Ne,e as Le}from"../chunks/index.BtSuiA6z.js";import{P as Oe,L as Ue,C as Be}from"../chunks/page.DRg7gFN1.js";import{g as Me,k as He,s as ce}from"../chunks/site.BlgjxTUG.js";import{r as ze,a as De,b as ue,U as ie,s as je,h as qe,c as Fe,O as Ve,g as Ce}from"../chunks/kit.D0HsIFJD.js";import{p as Ge}from"../chunks/stores.CoMZMUm9.js";import{g as Ee}from"../chunks/entry.B5WQGdlh.js";import{r as Ye,w as Je,a as xe,C as Qe}from"../chunks/contest.DdHcFc7E.js";import{b as fe}from"../chunks/paths.DTSw6QKH.js";function We(o){let e,t="Registration",s,a,r='This game is strictly for nerds so players must have a valid Github account to register. We may need to reach out to you about the contest (look for an "@dragonfly.xyz" email), so please make sure the email attached to the account is correct and reachable.';return{c(){e=p("h1"),e.textContent=t,s=B(),a=p("p"),a.textContent=r,this.h()},l(f){e=b(f,"H1",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-frft4h"&&(e.textContent=t),s=M(f),a=b(f,"P",{class:!0,"data-svelte-h":!0}),x(a)!=="svelte-1qe580g"&&(a.textContent=r),this.h()},h(){l(e,"class","svelte-b1tb46"),l(a,"class","svelte-b1tb46")},m(f,g){I(f,e,g),I(f,s,g),I(f,a,g)},p:se,d(f){f&&(d(e),d(s),d(a))}}}function Ke(o){let e,t="

    Connect your wallet to continue

    ";return{c(){e=p("section"),e.innerHTML=t,this.h()},l(s){e=b(s,"SECTION",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1tvp30p"&&(e.innerHTML=t),this.h()},h(){l(e,"class","svelte-b1tb46")},m(s,a){I(s,e,a)},p:se,d(s){s&&d(e)}}}function Xe(o){let e,t,s,a,r=o[7].address+"",f,g,i,_="publicly",k,S,y,R,n=o[7].chain.name+"",u,O,A,$,U,H,F,C,z,Y="Player Name",G,h,P,v,m,N,D,V,Q,X,T=o[7].chain.id===324&&we(o),J=et(o);return{c(){e=p("section"),t=p("p"),s=j("The connected wallet address ("),a=p("em"),f=j(r),g=j(") will "),i=p("em"),i.textContent=_,k=j(" identify your merchant onchain and will be used to make code submissions and claim prizes. You can authorize other addresses to submit code on your behalf, but only this address can ever claim prizes."),S=B(),y=p("p"),R=j("This wallet will also need to be supplied with a small amount of ETH on the "),u=j(n),O=j(" network to complete registration and to make code submissions."),T&&T.c(),A=B(),$=p("section"),U=p("form"),H=p("div"),J&&J.c(),F=B(),C=p("div"),z=p("label"),z.textContent=Y,G=B(),h=p("input"),P=B(),v=p("div"),m=p("button"),N=j("Register"),this.h()},l(E){e=b(E,"SECTION",{class:!0});var L=w(e);t=b(L,"P",{});var W=w(t);s=q(W,"The connected wallet address ("),a=b(W,"EM",{});var be=w(a);f=q(be,r),be.forEach(d),g=q(W,") will "),i=b(W,"EM",{"data-svelte-h":!0}),x(i)!=="svelte-1mydf0g"&&(i.textContent=_),k=q(W," identify your merchant onchain and will be used to make code submissions and claim prizes. You can authorize other addresses to submit code on your behalf, but only this address can ever claim prizes."),W.forEach(d),S=M(L),y=b(L,"P",{});var Z=w(y);R=q(Z,"This wallet will also need to be supplied with a small amount of ETH on the "),u=q(Z,n),O=q(Z," network to complete registration and to make code submissions."),T&&T.l(Z),Z.forEach(d),L.forEach(d),A=M(E),$=b(E,"SECTION",{class:!0});var _e=w($);U=b(_e,"FORM",{class:!0});var ae=w(U);H=b(ae,"DIV",{class:!0});var re=w(H);J&&J.l(re),F=M(re),C=b(re,"DIV",{});var ne=w(C);z=b(ne,"LABEL",{for:!0,"data-svelte-h":!0}),x(z)!=="svelte-1xky0ut"&&(z.textContent=Y),G=M(ne),h=b(ne,"INPUT",{id:!0,placeholder:!0,pattern:!0,minlength:!0,maxlength:!0,class:!0}),ne.forEach(d),re.forEach(d),P=M(ae),v=b(ae,"DIV",{class:!0});var ve=w(v);m=b(ve,"BUTTON",{type:!0,"aria-busy":!0,class:!0});var ge=w(m);N=q(ge,"Register"),ge.forEach(d),ve.forEach(d),ae.forEach(d),_e.forEach(d),this.h()},h(){l(e,"class","svelte-b1tb46"),l(z,"for","name"),l(h,"id","name"),l(h,"placeholder","Player name"),l(h,"pattern","^[a-z0-9_]+$"),l(h,"minlength","3"),l(h,"maxlength","32"),h.required=!0,l(h,"class","svelte-b1tb46"),l(H,"class","inputs svelte-b1tb46"),l(m,"type","submit"),m.disabled=D=o[2]instanceof Promise||o[0],l(m,"aria-busy",V=o[2]instanceof Promise),l(m,"class","svelte-b1tb46"),l(v,"class","svelte-b1tb46"),l(U,"class","register-form svelte-b1tb46"),l($,"class","svelte-b1tb46")},m(E,L){I(E,e,L),c(e,t),c(t,s),c(t,a),c(a,f),c(t,g),c(t,i),c(t,k),c(e,S),c(e,y),c(y,R),c(y,u),c(y,O),T&&T.m(y,null),I(E,A,L),I(E,$,L),c($,U),c(U,H),J&&J.m(H,null),c(H,F),c(H,C),c(C,z),c(C,G),c(C,h),oe(h,o[1]),c(U,P),c(U,v),c(v,m),c(m,N),Q||(X=[K(h,"input",o[15]),K(U,"submit",Pe(o[16]))],Q=!0)},p(E,L){L&128&&r!==(r=E[7].address+"")&&le(f,r),L&128&&n!==(n=E[7].chain.name+"")&&le(u,n),E[7].chain.id===324?T?T.p(E,L):(T=we(E),T.c(),T.m(y,null)):T&&(T.d(1),T=null),J.p(E,L),L&2&&h.value!==E[1]&&oe(h,E[1]),L&5&&D!==(D=E[2]instanceof Promise||E[0])&&(m.disabled=D),L&4&&V!==(V=E[2]instanceof Promise)&&l(m,"aria-busy",V)},d(E){E&&(d(e),d(A),d($)),T&&T.d(),J&&J.d(),Q=!1,Te(X)}}}function Ze(o){let e,t,s,a,r,f,g,i,_,k,S,y=`By registering, you agree to our + Contest Rules and + Privacy Agreement.`,R,n,u,O,A,$,U="By registering, you confirm that you are at least 18 years of age.",H,F,C,z,Y,G,h,P;return{c(){e=p("section"),t=p("form"),s=p("iframe"),r=B(),f=p("div"),g=p("div"),i=p("input"),k=B(),S=p("label"),S.innerHTML=y,R=B(),n=p("div"),u=p("input"),A=B(),$=p("label"),$.textContent=U,H=B(),F=p("p"),C=p("button"),z=j("Authenticate on Github"),this.h()},l(v){e=b(v,"SECTION",{class:!0});var m=w(e);t=b(m,"FORM",{class:!0});var N=w(t);s=b(N,"IFRAME",{src:!0,title:!0,class:!0}),w(s).forEach(d),r=M(N),f=b(N,"DIV",{class:!0});var D=w(f);g=b(D,"DIV",{});var V=w(g);i=b(V,"INPUT",{type:!0,id:!0,class:!0}),k=M(V),S=b(V,"LABEL",{for:!0,"data-svelte-h":!0}),x(S)!=="svelte-15pfxdz"&&(S.innerHTML=y),V.forEach(d),R=M(D),n=b(D,"DIV",{});var Q=w(n);u=b(Q,"INPUT",{type:!0,id:!0,class:!0}),A=M(Q),$=b(Q,"LABEL",{for:!0,"data-svelte-h":!0}),x($)!=="svelte-15qa1w5"&&($.textContent=U),Q.forEach(d),D.forEach(d),H=M(N),F=b(N,"P",{});var X=w(F);C=b(X,"BUTTON",{type:!0,"aria-busy":!0,class:!0});var T=w(C);z=q(T,"Authenticate on Github"),T.forEach(d),X.forEach(d),N.forEach(d),m.forEach(d),this.h()},h(){$e(s.src,a=`${fe}/terms/rules.html`)||l(s,"src",a),l(s,"title","rules"),l(s,"class","svelte-b1tb46"),l(i,"type","checkbox"),l(i,"id","terms-agree"),i.disabled=_=o[2]instanceof Promise,l(i,"class","svelte-b1tb46"),l(S,"for","terms-agree"),l(u,"type","checkbox"),l(u,"id","adult-agree"),u.disabled=O=o[2]instanceof Promise,l(u,"class","svelte-b1tb46"),l($,"for","adult-agree"),l(f,"class","checkboxes svelte-b1tb46"),l(C,"type","submit"),C.disabled=Y=o[2]instanceof Promise||!o[5]||!o[6],l(C,"aria-busy",G=o[2]instanceof Promise),l(C,"class","svelte-b1tb46"),l(t,"class","auth-form svelte-b1tb46"),l(e,"class","svelte-b1tb46")},m(v,m){I(v,e,m),c(e,t),c(t,s),c(t,r),c(t,f),c(f,g),c(g,i),i.checked=o[5],c(g,k),c(g,S),c(f,R),c(f,n),c(n,u),u.checked=o[6],c(n,A),c(n,$),c(t,H),c(t,F),c(F,C),c(C,z),h||(P=[K(i,"change",o[11]),K(u,"change",o[12]),K(t,"submit",Pe(o[13]))],h=!0)},p(v,m){m&4&&_!==(_=v[2]instanceof Promise)&&(i.disabled=_),m&32&&(i.checked=v[5]),m&4&&O!==(O=v[2]instanceof Promise)&&(u.disabled=O),m&64&&(u.checked=v[6]),m&100&&Y!==(Y=v[2]instanceof Promise||!v[5]||!v[6])&&(C.disabled=Y),m&4&&G!==(G=v[2]instanceof Promise)&&l(C,"aria-busy",G)},d(v){v&&d(e),h=!1,Te(P)}}}function we(o){let e,t=o[7].chain.name+"",s,a,r,f="here",g;return{c(){e=j("You can bridge ETH from Ethereum to "),s=j(t),a=B(),r=p("a"),r.textContent=f,g=j("."),this.h()},l(i){e=q(i,"You can bridge ETH from Ethereum to "),s=q(i,t),a=M(i),r=b(i,"A",{href:!0,target:!0,class:!0,"data-svelte-h":!0}),x(r)!=="svelte-gavom9"&&(r.textContent=f),g=q(i,"."),this.h()},h(){l(r,"href","https://portal.zksync.io/bridge/"),l(r,"target","_blank"),l(r,"class","svelte-b1tb46")},m(i,_){I(i,e,_),I(i,s,_),I(i,a,_),I(i,r,_),I(i,g,_)},p(i,_){_&128&&t!==(t=i[7].chain.name+"")&&le(s,t)},d(i){i&&(d(e),d(s),d(a),d(r),d(g))}}}function et(o){let e,t,s="Invite Code",a,r,f,g;return{c(){e=p("div"),t=p("label"),t.textContent=s,a=B(),r=p("input"),this.h()},l(i){e=b(i,"DIV",{});var _=w(e);t=b(_,"LABEL",{for:!0,"data-svelte-h":!0}),x(t)!=="svelte-1dqe8ur"&&(t.textContent=s),a=M(_),r=b(_,"INPUT",{placeholder:!0,id:!0,class:!0}),_.forEach(d),this.h()},h(){l(t,"for","invite-code"),l(r,"placeholder","Invite code"),l(r,"id","invite-code"),l(r,"class","svelte-b1tb46")},m(i,_){I(i,e,_),c(e,t),c(e,a),c(e,r),oe(r,o[4]),f||(g=K(r,"input",o[14]),f=!0)},p(i,_){_&16&&r.value!==i[4]&&oe(r,i[4])},d(i){i&&d(e),f=!1,g()}}}function tt(o){let e,t,s;return t=new Be({}),{c(){e=p("section"),de(t.$$.fragment),this.h()},l(a){e=b(a,"SECTION",{class:!0});var r=w(e);he(t.$$.fragment,r),r.forEach(d),this.h()},h(){l(e,"class","spinner svelte-b1tb46")},m(a,r){I(a,e,r),me(t,e,null),s=!0},p:se,i(a){s||(ee(t.$$.fragment,a),s=!0)},o(a){te(t.$$.fragment,a),s=!1},d(a){a&&d(e),pe(t)}}}function st(o){let e,t=Ce(o[2])+"",s;return{c(){e=p("section"),s=j(t),this.h()},l(a){e=b(a,"SECTION",{class:!0});var r=w(e);s=q(r,t),r.forEach(d),this.h()},h(){l(e,"class","error svelte-b1tb46")},m(a,r){I(a,e,r),c(e,s)},p(a,r){r&4&&t!==(t=Ce(a[2])+"")&&le(s,t)},i:se,o:se,d(a){a&&d(e)}}}function at(o){let e,t,s,a,r,f,g;e=new Ue({props:{$$slots:{default:[We]},$$scope:{ctx:o}}});function i(n,u){return n[3]?n[7]?Xe:Ke:Ze}let _=i(o),k=_(o);const S=[st,tt],y=[];function R(n,u){return n[2]instanceof Error?0:n[2]instanceof Promise?1:-1}return~(a=R(o))&&(r=y[a]=S[a](o)),{c(){de(e.$$.fragment),t=B(),k.c(),s=B(),r&&r.c(),f=ke()},l(n){he(e.$$.fragment,n),t=M(n),k.l(n),s=M(n),r&&r.l(n),f=ke()},m(n,u){me(e,n,u),I(n,t,u),k.m(n,u),I(n,s,u),~a&&y[a].m(n,u),I(n,f,u),g=!0},p(n,u){const O={};u&8388608&&(O.$$scope={dirty:u,ctx:n}),e.$set(O),_===(_=i(n))&&k?k.p(n,u):(k.d(1),k=_(n),k&&(k.c(),k.m(s.parentNode,s)));let A=a;a=R(n),a===A?~a&&y[a].p(n,u):(r&&(Ne(),te(y[A],1,1,()=>{y[A]=null}),Le()),~a?(r=y[a],r?r.p(n,u):(r=y[a]=S[a](n),r.c()),ee(r,1),r.m(f.parentNode,f)):r=null)},i(n){g||(ee(e.$$.fragment,n),ee(r),g=!0)},o(n){te(e.$$.fragment,n),te(r),g=!1},d(n){n&&(d(t),d(s),d(f)),pe(e,n),k.d(n),~a&&y[a].d(n)}}}function rt(o){let e,t;return e=new Oe({props:{title:"Register Merchant",$$slots:{default:[at]},$$scope:{ctx:o}}}),{c(){de(e.$$.fragment)},l(s){he(e.$$.fragment,s)},m(s,a){me(e,s,a),t=!0},p(s,[a]){const r={};a&8388863&&(r.$$scope={dirty:a,ctx:s}),e.$set(r)},i(s){t||(ee(e.$$.fragment,s),t=!0)},o(s){te(e.$$.fragment,s),t=!1},d(s){pe(e,s)}}}function nt(o,e,t){let s,a;ye(o,Ge,h=>t(18,a=h));const{wallet:r,publicClient:f}=Me();ye(o,r,h=>t(7,s=h));let g;const i=Fe(h=>t(2,g=h)),_=(()=>{const h=new URL(a.url);return h.search="",h.searchParams.append("callback",""),h.toString()})(),k={name:"Nottingham",version:"1",verifyingContract:Qe};let S=!1,y=null,R=null,n=null,u=null,O=!1,A=!1;async function $(){const h=new URL("https://github.com/login/oauth/authorize"),P=ze();localStorage.setItem("ghAuthState",P),h.searchParams.append("prompt","consent"),h.searchParams.append("client_id",De),h.searchParams.append("redirect_uri",_),h.searchParams.append("scope",["user:email"].join(" ")),h.searchParams.append("state",P),window.location.href=h.toString()}Se(async()=>{y=a.url.searchParams.get("code");const h=a.url.searchParams.get("state");if(!y||!h)return;{const v=new URL(a.url);v.search="",Ee(v)}const P=localStorage.getItem("ghAuthState");if(h!==P){console.error("Incorrect state hash from OAuth redirect!");return}await i((async()=>{const v=await fetch(`${ue}/redeem`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({githubAuth:y,redirectUri:_})});if(!v.ok){const{error:N}=await v.json();throw new ie(`Failed OAuth step: ${N}`)}const m=await v.json();t(3,R={userId:m.userId,email:m.email,hmac:m.hmac}),t(1,u=m.name.toLowerCase().replaceAll(/[^a-z0-9_]/g,""))})())});async function U(){!u||!R||await i((async()=>{if(await Ye({client:f,fn:"playerRegisteredBlock",args:[s.address]})!==0n)throw new ie("Address is already registered");let P;{const m=Math.floor(Date.now()/1e3)+Ve,N=await(s==null?void 0:s.client.signTypedData({account:s==null?void 0:s.address,domain:{...k,chainId:s.chain.id},types:{"Register Request":[{name:"name",type:"string"},{name:"expiry",type:"uint256"},{name:"auth",type:"string"}]},primaryType:"Register Request",message:{name:u,expiry:BigInt(m),auth:He(je(R.userId))}})),D=await fetch(`${ue}/register`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:u,...R,expiry:m,signature:N,inviteCode:n??void 0})});if(!D.ok){const{error:V}=await D.json();throw new ie(`Failed to request registration: ${V}`)}P=(await D.json()).confirmation}const v=await Je({client:s.client,fn:"register",args:[s.address,{expiry:P.expiry,nonce:P.nonce,metadata:P.metadata,r:ce(P.signature,0,32),s:ce(P.signature,32,64),v:qe(ce(P.signature,64))}]});console.info(`Registration tx hash: ${v}`),await Promise.all([(async()=>{const m=await fetch(`${ue}/confirm`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({address:s.address,txHash:v})});if(!m.ok){const{error:N}=await m.json();throw new ie(`Failed to confirm registration: ${N}`)}})(),xe(f,v)]),t(0,S=!0)})())}function H(){O=this.checked,t(5,O)}function F(){A=this.checked,t(6,A)}const C=()=>$();function z(){n=this.value,t(4,n)}function Y(){u=this.value,t(1,u)}const G=()=>U();return o.$$.update=()=>{o.$$.dirty&3&&S&&u&&Ee(`./player?${new URLSearchParams({name:u}).toString()}`)},[S,u,g,R,n,O,A,s,r,$,U,H,F,C,z,Y,G]}class pt extends Re{constructor(e){super(),Ae(this,e,nt,rt,Ie,{})}}export{pt as component}; diff --git a/_app/immutable/nodes/9.Bj8yHWN3.js b/_app/immutable/nodes/9.Bj8yHWN3.js new file mode 100644 index 0000000..6b81d2b --- /dev/null +++ b/_app/immutable/nodes/9.Bj8yHWN3.js @@ -0,0 +1,13 @@ +import{s as Le,o as Pe,p as de,k as w,i as m,b as M,e as y,j as V,d as E,f as I,q as we,v as N,l as h,t as $,h as k,m as j,n as Se}from"../chunks/scheduler.gEqqeaCZ.js";import{S as qe,i as Ce,c as K,b as W,m as X,t as B,a as A,d as Y,g as ee,e as te}from"../chunks/index.BtSuiA6z.js";import{e as J,u as oe,o as fe}from"../chunks/each.kVXWp4N9.js";import{b as pe}from"../chunks/paths.DTSw6QKH.js";import{p as Me}from"../chunks/stores.CoMZMUm9.js";import{P as Ve,c as Te,g as ge}from"../chunks/kit.D0HsIFJD.js";import{P as Be,L as Ae,C as De}from"../chunks/page.DRg7gFN1.js";import{P as Ie}from"../chunks/player.PGhbgZJS.js";import{f as le}from"../chunks/site.BlgjxTUG.js";function ve(_,e,t){const l=_.slice();return l[6]=e[t],l}function $e(_,e,t){const l=_.slice();return l[9]=e[t],l}function ke(_,e,t){const l=_.slice();return l[9]=e[t],l}function Fe(_){let e,t,l,i,c="Final Ranking",f,o,s=[],a=new Map,u,g,v=[],F=new Map,L;e=new Ae({props:{$$slots:{default:[Ge]},$$scope:{ctx:_}}});let S=J(_[0].rankings);const U=r=>r[9].address;for(let r=0;rr[6].idx;for(let r=0;rb[9].address;for(let b=0;b{f[u]=null}),te()),~e?(t=f[e],t?t.p(s,a):(t=f[e]=c[e](s),t.c()),B(t,1),t.m(l.parentNode,l)):t=null)},i(s){i||(B(t),i=!0)},o(s){A(t),i=!1},d(s){s&&m(l),~e&&f[e].d(s)}}}function Oe(_){let e,t;return e=new Be({props:{title:"Tournament Details",$$slots:{default:[Ne]},$$scope:{ctx:_}}}),{c(){K(e.$$.fragment)},l(l){W(e.$$.fragment,l)},m(l,i){X(e,l,i),t=!0},p(l,[i]){const c={};i&16385&&(c.$$scope={dirty:i,ctx:l}),e.$set(c)},i(l){t||(B(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){Y(e,l)}}}function Qe(_,e,t){let l;Pe(_,Me,a=>t(3,l=a));let i,c,f;const o=Te(a=>t(0,f=a));function s(a){t(1,i=a.get("id")??void 0),t(2,c=Number(a.get("season")??"1")-1)}return _.$$.update=()=>{_.$$.dirty&8&&s(l.url.searchParams),_.$$.dirty&6&&i&&o(async()=>{const a=await fetch(`${Ve}/results/tournament?${new URLSearchParams({id:i,season:c.toString()})}`);if(!a.ok)throw console.error(await a.text()),new Error(a.statusText);const u=await a.json();return{...u,time:new Date(u.time),brackets:u.brackets.sort((g,v)=>v.idx-g.idx)}})},[f,i,c,l]}class tt extends qe{constructor(e){super(),Ce(this,e,Qe,Oe,Le,{})}}export{tt as component}; diff --git a/_app/version.json b/_app/version.json new file mode 100644 index 0000000..65977db --- /dev/null +++ b/_app/version.json @@ -0,0 +1 @@ +{"version":"1718035516809"} \ No newline at end of file diff --git a/aged-paper.png b/aged-paper.png new file mode 100644 index 0000000..70c7918 Binary files /dev/null and b/aged-paper.png differ diff --git a/aristocrat.png b/aristocrat.png new file mode 100644 index 0000000..cbd2684 Binary files /dev/null and b/aristocrat.png differ diff --git a/attention-border.png b/attention-border.png new file mode 100644 index 0000000..b255cd2 Binary files /dev/null and b/attention-border.png differ diff --git a/bracket.html b/bracket.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/bracket.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/button-border.png b/button-border.png new file mode 100644 index 0000000..90620ef Binary files /dev/null and b/button-border.png differ diff --git a/cat-spinner.png b/cat-spinner.png new file mode 100644 index 0000000..e78c51f Binary files /dev/null and b/cat-spinner.png differ diff --git a/cat.png b/cat.png new file mode 100644 index 0000000..46ba62c Binary files /dev/null and b/cat.png differ diff --git a/charcoal-hl.png b/charcoal-hl.png new file mode 100644 index 0000000..31eb064 Binary files /dev/null and b/charcoal-hl.png differ diff --git a/coin-purse.png b/coin-purse.png new file mode 100644 index 0000000..3517930 Binary files /dev/null and b/coin-purse.png differ diff --git a/fair.png b/fair.png new file mode 100644 index 0000000..05765d4 Binary files /dev/null and b/fair.png differ diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..ae0386a Binary files /dev/null and b/favicon.png differ diff --git a/gold-leaf-texture.jpg b/gold-leaf-texture.jpg new file mode 100644 index 0000000..65942da Binary files /dev/null and b/gold-leaf-texture.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/index.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/leaf.png b/leaf.png new file mode 100644 index 0000000..0122f36 Binary files /dev/null and b/leaf.png differ diff --git a/lute.mp3 b/lute.mp3 new file mode 100644 index 0000000..41c76d0 Binary files /dev/null and b/lute.mp3 differ diff --git a/match.html b/match.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/match.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/merchants.png b/merchants.png new file mode 100644 index 0000000..8300bd7 Binary files /dev/null and b/merchants.png differ diff --git a/page-border.png b/page-border.png new file mode 100644 index 0000000..2f19ac9 Binary files /dev/null and b/page-border.png differ diff --git a/player.html b/player.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/player.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/players.html b/players.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/players.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/pointer-active.png b/pointer-active.png new file mode 100644 index 0000000..180226d Binary files /dev/null and b/pointer-active.png differ diff --git a/pointer.png b/pointer.png new file mode 100644 index 0000000..a07ce66 Binary files /dev/null and b/pointer.png differ diff --git a/privacy.html b/privacy.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/privacy.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/register.html b/register.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/register.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/rules.html b/rules.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/rules.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/sprites.png b/sprites.png new file mode 100644 index 0000000..597ca7b Binary files /dev/null and b/sprites.png differ diff --git a/terms/privacy.html b/terms/privacy.html new file mode 100644 index 0000000..db61a25 --- /dev/null +++ b/terms/privacy.html @@ -0,0 +1,1286 @@ + + + + + + + + + +

     

    +

    DRAGONFLY "SEARCHERS OF NOTTINGHAM" COMPETITION 

    +

    PRIVACY POLICY 

    +

     

    +

    Last Updated June 6, 2024 

    +

     

    +

    Welcome to the website (the “Site”) of the Dragonfly "Searchers of Nottingham" Competition (the “Competition”). Through the Site Dragonfly Operations, LLC (“Company,” “we,” or “our”) administers the Competition and related services (the “Service”).  

    +

     

    +

    This Privacy Policy explains what Personal Data (defined below) we collect, how we use and share that data, and your choices concerning our data practices. This Privacy Policy is incorporated into and forms part of our Official Rules which are available on the Site.  For information on how to enter the Competition and the terms and conditions of entry please visit the Official Rules. 

    +

     

    +

    Before using the Service or submitting any Personal Data to Company, please review this Privacy Policy carefully and contact us if you have any questions. By using the Service, you agree to the practices described in this Privacy Policy. If you do not agree to this Privacy Policy, please do not access the Site or otherwise use the Service. 

    +

     

    +

    1. PERSONAL DATA WE COLLECT 

    +

    We collect information that alone or in combination with other information in our possession could be used to identify you (“Personal Data”) as follows: 

    +

    Personal Data You Provide: We collect Personal Data from you when you sign up to participate in the Competition. The Personal Data we collect includes your email address, and if you are a winner of the Competition, we will also collect your name and mailing address. Additionally, we may receive Personal Data from third party sites that are linked with the Service. For example, if you sign up through a third party service such as Github, we may collect other information about you that is made publicly available on such third party service. The Personal Data collected during these interactions may vary based on what you are asked to submit in connection with a particular feature of the Service or that you otherwise choose to share with us.  

    +

    We may also have pages on social media sites like Instagram, Facebook, Twitter, and LinkedIn 

    +

    (“Social Media Pages”). When you interact with our Social Media Pages, we will collect Personal Data that you elect to provide to us, such as your contact details. In addition, the companies that host our Social Media Pages may provide us with aggregate information and analytics regarding the use of our Social Media Pages. 

    +

    Internet Activity Data: When you visit, use, and interact with the Service, we may receive certain information about your visit, use, or interactions. For example, we may monitor the number of people that visit the Service, peak hours of visits, which page(s) are visited, the domains our visitors come from (e.g., google.com, yahoo.com, etc.), and which browsers people use to access the Service (e.g., Chrome, Firefox, Microsoft Internet Explorer, etc.), broad geographical information, and navigation pattern. In particular, the following information is created and automatically logged in our systems:  

    +
      +
    • Log Data: Information that your browser automatically sends whenever you visit the Site. Log Data includes your Internet Protocol address, browser type and settings, the date and time of your request, and how you interacted with the Site.  
    • +
    • Cookies Data: Please see the Cookies section below to learn more about how we use cookies. 
    • +
    • Device Data: Includes name of the device, operating system, and browser you are using. Information collected may depend on the type of device you use and its settings.  
    • +
    • Usage Data: We collect information about how you use our Service, such as the types of content that you view or engage with, the features you use, the actions you take, and the time, frequency, and duration of your activities. 
    • +
    • Location Data: We derive a rough estimate of your location from your IP address.  
    • +
    +

     

    +

    Personal Information We Process on Behalf of Our Business Customers: When you use and interact with the Service, we will have your IP address in order to ensure that you are able to access the Services, and we will collect your browser information so that we may provide any necessary technical support through a third party vendor.  

    +

    Cookies: We use cookies to operate and administer our Site, gather usage data on our Site, and improve your experience on it. A “cookie” is a piece of information sent to your browser by a website you visit. Cookies can be stored on your computer for different periods of time. Some cookies expire after a certain amount of time, or upon logging out (session cookies), others survive after your browser is closed until a defined expiration date set in the cookie (as determined by the third party placing it), and help recognize your computer when you open your browser and browse the Internet again (persistent cookies). 

    +

     

    +

    On most web browsers, you will find a “help” section on the toolbar. Please refer to this section for information on how to receive a notification when you are receiving a new cookie and how to turn cookies off. Please see the links below for guidance on how to modify your web browser’s settings on the most popular browsers: 

    +

     

    +
      +
    • Internet Explorer 
    • +
    • Mozilla Firefox 
    • +
    • Google Chrome 
    • +
    • Apple Safari 
    • +
    +

     

    +

    Please note that if you limit the ability of websites to set cookies, you may be unable to access certain parts of the Site and you may not be able to benefit from the full functionality of the Site. 

    +

     

    +

    Advertising networks may use cookies to collect Personal Data. Most advertising networks offer you a way to opt out of targeted advertising. If you would like to find out more information, please         visit the Network Advertising Initiative’s online resources at http://www.networkadvertising.org and follow the opt-out instructions there. 

    +

    If you access the Site on your mobile device, you may not be able to control tracking technologies through the settings.  

    +

    Online Tracking and Do Not Track Signals: We and our third party service providers, including Amazon Web Services and Vercel, may use cookies, pixels, or other tracking technologies to collect information about your browsing activities over time and across different websites following your use of the Site and use that information to send targeted advertisements. Our Site currently does not respond to “Do Not Track” (“DNT”) signals and operates as described in this Privacy Policy whether or not a DNT signal is received. If we do respond to DNT signals in the future, we will update this Privacy Policy to describe how we do so.  

    +

     

    +

    2. HOW WE USE PERSONAL DATA 

    +

    We may use Personal Data for the following purposes: 

    +

     

    +
      +
    • To provide the Service, including fulfilling any prizes awarded in the Competition, and send you any information you request about our Service; 
    • +
    • To respond to your inquiries, comments, feedback, or questions; 
    • +
    • To send administrative information to you, for example, information regarding the Service and changes to our terms, conditions, and policies; 
    • +
    • To maintain and improve the Service; 
    • +
    • To prevent fraud, criminal activity, or misuses of our Service, and to ensure the security of our IT systems, architecture, and networks; and 
    • +
    • To comply with legal obligations and legal process and to protect our rights, privacy, safety, or property, and/or that of our affiliates, you, or other third parties. 
    • +
    +

     

    +

    Aggregated Information.  We may aggregate Personal Data and use the aggregated  information to analyze the effectiveness of our Service, to improve and add features to our Service, and for other similar purposes. In addition, from time to time, we may analyze the general behavior and characteristics of users of our Service and share aggregated information like general user statistics with prospective business partners. We may collect aggregated information through the Service, through cookies, and through other means described in this Privacy Policy. 

    +


    +


    +

    3. SHARING AND DISCLOSURE OF PERSONAL DATA 

    +

    In certain circumstances we may share the categories of Personal Data described above without further notice to you, unless required by the law, with the following categories of third parties: 

    +

     

    +
      +
    • Prize Fulfillment: In connection with fulfilling the prizes in the Competition, we may share your Personal Data to assist us in fulfilling and delivering prizes to winners of the Competition, including for example the provider of the merchandise that will be awarded during the Competition. 
    • +
    • Vendors and Service Providers: To assist us in meeting business operations needs and to perform certain services and functions, we may share Personal Data with vendors and service providers, including providers of hosting services, cloud services, and other information technology services providers, email communication software and email newsletter services, advertising and marketing services, payment processors, customer relationship management and customer support services, and analytics services. Pursuant to our instructions, these parties will access, process, or store Personal Data in the course of performing their duties to us.  
    • +
    • Business Transfers: If we are involved in a merger, acquisition, financing due diligence, reorganization, bankruptcy, receivership, sale of all or a portion of our assets, or transition of service to another provider (collectively a “Transaction”), your Personal Data and other information may be shared in the diligence process with counterparties and others assisting with the Transaction and transferred to a successor or affiliate as part of that Transaction along with other assets. 
    • +
    • Legal Requirements: If required to do so by law or in the good faith belief that such action is necessary to (i) comply with a legal obligation, including to meet national security or law enforcement requirements, (ii) protect and defend our rights or property, (iii) prevent fraud, (iv) act in urgent circumstances to protect the personal safety of users of the Service, or the public, or (v) protect against legal liability. 
    • +
    +

     

    +

    4. UPDATE YOUR INFORMATION 

    +

    Please contact us if you need to change or correct your Personal Data.  

    +

     

    +

    5. CHILDREN 

    +

    Our Service is not directed to children who are under the age of 18. Company does not knowingly collect Personal Data from children under the age of 18. If you have reason to believe that a child under the age of 16 has provided Personal Data to Company through the Service please contact us and we will endeavor to delete that information from our databases. 

    +

     

    +

    6. LINKS TO OTHER WEBSITES 

    +

    The Service may contain links to other websites not operated or controlled by Company, including social media services (“Third Party Sites”). The information that you share with Third Party Sites will be governed by the specific privacy policies and Official Rules of the Third Party Sites and not by this Privacy Policy. By providing these links we do not imply that we endorse or have reviewed these sites. Please contact the Third Party Sites directly for information on their privacy practices and policies.  

    +

     

    +

    7. SECURITY 

    +

    You use the Service at your own risk. We implement commercially reasonable technical, administrative, and organizational measures to protect Personal Data both online and offline from loss, misuse, and unauthorized access, disclosure, alteration, or destruction. However, no Internet or e-mail transmission is ever fully secure or error free. In particular, e-mail sent to or from us may not be secure. Therefore, you should take special care in deciding what information you send to us via the Service or e-mail. Please keep this in mind when disclosing any Personal Data to Company via the Internet. In addition, we are not responsible for circumvention of any privacy settings or security measures contained on the Service, or third party websites. 

    +

    8. INTERNATIONAL USERS 

    +

    By using our Service, you understand and acknowledge that your Personal Data will be transferred from your location to our facilities and servers in the United States. 

    +

    9. YOUR CHOICES 

    +

    In certain circumstances providing Personal Data is optional. However, if you choose not to provide Personal Data that is needed to use some features of our Service, you may be unable to use those features. You can also contact us to ask us to update or correct your Personal Data. 

    +

    10. CHANGES TO THE PRIVACY POLICY 

    +

    The Service and our business may change from time to time. As a result, we may change this Privacy Policy at any time. When we do, we will post an updated version on this page, unless another type of notice is required by the applicable law. By continuing to use our Service or providing us with Personal Data after we have posted an updated Privacy Policy, or notified you by other means if applicable, you consent to the revised Privacy Policy and practices described in it. 

    +

     

    +

    11. CONTACT US 

    +

    If you have any questions about our Privacy Policy or information practices, please feel free to contact us at privacy@dragonfly.xyz.  

    +


    +


    +

     

    +
    +


    +
    + + + \ No newline at end of file diff --git a/terms/rules.html b/terms/rules.html new file mode 100644 index 0000000..df5a1fc --- /dev/null +++ b/terms/rules.html @@ -0,0 +1 @@ +

    Dragonfly CTF Competition

    OFFICIAL RULES

    THESE OFFICIAL RULES CONTAIN AN ARBITRATION AGREEMENT, WHICH WILL, WITH LIMITED EXCEPTION, REQUIRE YOU TO SUBMIT CLAIMS YOU HAVE AGAINST SPONSOR TO BINDING AND FINAL ARBITRATION. UNDER THE ARBITRATION AGREEMENT, (1) YOU

    WILL ONLY BE PERMITTED TO PURSUE CLAIMS AGAINST SPONSOR ON AN INDIVIDUAL BASIS, NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY CLASS OR REPRESENTATIVE ACTION OR PROCEEDING, AND (2) YOU WILL ONLY BE PERMITTED TO SEEK RELIEF

    (INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ON AN INDIVIDUAL

    BASIS.

    The Dragonfly CTF Competition (the “Competition”) begins on Friday, May 6, 2023 at 00:00 AM UTC (the “Competition Start Date”) and ends at 00:00 AM UTC on Sunday, May 8, 2023 (the “Competition End Date”) (such period referred to herein as the “Competition Period”). The Competition is sponsored by Dragonfly Operations, LLC (the “Sponsor”).

    1. HOW TO ENTER: NO PURCHASE NECESSARY TO ENTER OR CLAIM PRIZE. A PURCHASE WILL NOT INCREASE YOUR CHANCES OF WINNING. Participation in the Competition is voluntary.  All entries are subject to Sponsor’s privacy policy located at ctf.dragonfly.xyz/privacy.

    Individuals or teams may participate in the Competition. At any time during the Competition Period, Individual or team participants (each a “Participant”) may enter the Competition by completing all required steps in the sign-up process located at https://ctf.dragonfly.xyz (the “Website”), including without limitation providing the Participant’s name, email address, the names of the other team members (if applicable) and the team name (if applicable). After the Participants complete the sign-up process, they will receive access to the CTF dashboard (the “Dashboard”), which is where the Challenges (as defined below) are made available and where Participants can submit their solutions for each Challenge.

    For teams participating in the Competition, each team must be represented by one (1) team leader (the “Team Leader”). The Team Leader is the sole contact person for purposes of the Competition and is responsible for submitting the sign-up form, generating a team token to distribute to the other team members so that they can join the team and also access the Dashboard, and submitting the solutions to each puzzle.

    During the Competition Period, the Participants will compete to solve a smart contract puzzle made from a collection of individual solidity/EVM challenges (the “Challenges”). Participants will submit a solution in the form of smart contracts (each a “Solution”). Each Solution will be evaluated against the puzzle through local transaction simulation for correctness and efficiency. A cumulative score will be automatically awarded to each Solution based on which individual Challenges have been completed. If a Solution completes all Challenges in the puzzle, extra points will also be awarded based on inverse gas usage from a predetermined baseline. The Dashboard will indicate the points awarded for each Challenge. No illegible, incomplete, forged or altered entries will be accepted. All entries become the property of Sponsor and will not be returned. One (1) entry per individual is permitted. An individual may not enter in both their individual capacity and as a member of a team.

    1. SELECTION OF WINNERS; PRIZE:

    Participants will be ranked in terms of total cumulative points awarded at the end of the Challenge Period. In the event of a tie between two or more Participants, the Participant who completed the Challenges fastest will be deemed a winner. The top Participant based on total cumulative points will be eligible to receive a Milady Maker NFT as its prize, the Participant who completes all of the challenges in the least amount of time will be eligible to receive a Milady Maker NFT and the Participant who submits the most creative solutions to the Challenges (subject to the sole discretion of the Sponsor) will be eligible to receive a Milady Maker NFT (collectively, the “Winners”). To receive the applicable prize, (i) each potential Winner must have and communicate a wallet address that will allow the Winner to receive a Milady Maker NFT, (ii) each potential Winner must submit information sufficient to verify identity for purposes of determining eligibility, including without limitation name, address, date of birth, and government ID, all of which must be submitted within 2 weeks of their receiving the notice in Section 5 (such date, the “Due Date”). The Winners will also receive an invitation to meet the Dragonfly security team virtually via Zoom. Participation in the virtual meet and greet is voluntary.

    In the case of a Participant that is a team, the prize(s) will only be awarded to the Team Leader. The

    Team Leader is solely responsible for complying with all requirements applicable to receipt of such prize. The

    Team Leader is also solely liable and responsible for sharing the prize with the other members of its team, in the Team Leader’s sole discretion. Sponsor will not be liable for any action or omission by any Team Leader, including without limitation any Team Leader’s failure to share a prize with the other team members.

    Allow 3-4 weeks after validation of eligibility for receipt of prize. Odds of winning are affected by the number of eligible entries received by the Competition End Date. The Winners will be solely responsible for all other expenses not specifically set forth herein. The Sponsor reserves the right to substitute prizes of equal or greater value (based on the fair market value at the Competition End Date. No other substitution or transfer of prizes permitted. To receive a prize, the Participants may be required to provide proof of identification, including name, age, address and date of birth, and agree to provide any other information reasonably requested by Sponsor in order to deliver the prize. In order to receive the NFT prize, Winners are required to provide any information reasonably requested by Sponsor in order to fulfill and deliver the prize including their wallet address (as applicable), name, date of birth and a copy of their passport or other valid proof of identity. All federal, state, and local or other taxes on any prize, including income and/or sales taxes, are the sole responsibility of the Winner. Any Winner who receives a prize with a value of $600 or greater will be issued an IRS Form Misc-1099 for the actual value of the prize, and are advised to seek independent counsel regarding the tax implications of the prize winnings; provided, however, Sponsor may elect to gross up the prize to cover the Winner’s taxes for such prize.

    1. ELIGIBILITY:

    Participant Eligibility. The Competition is only open to individuals who are (i) over eighteen (18) years of age at the time of entry and (ii) reside in a jurisdiction other than any jurisdiction comprehensively sanctioned by the United States Office of Foreign Asset Control (“OFAC”) at the time the entry is submitted (the list of sanctions programs administered by OFAC is available at https://www.treasury.gov/resource-center/sanctions/programs/pages/programs.aspx) and whom is not otherwise subject to OFAC sanctions. In addition, in order to be eligible to receive a prize, each potential winner must comply with the requirements set forth in Section 2. By participating in the Competition, each Participant accepts the conditions stated in these Official Rules, agrees to be bound by the decisions of Sponsor and warrants that she/he is eligible to participate in the Competition. Employees, independent contractors, interns, officers, and directors of Sponsor, affiliates, subsidiaries, advertising, Competition, and fulfillment agencies, and legal advisors, and their immediate family members and persons living in the same household, are not eligible to participate in the Competition. THE COMPETITION IS VOID WHERE PROHIBITED OR RESTRICTED BY LAW and is subject to applicable international, federal, state and local laws and regulations.

    1. USE OF CONTENT/SUBMISSIONS. By submitting solutions to the Challenges (“Submissions”) to Sponsor in connection with this Competition, you automatically represent and warrant that you have the right to grant, and do hereby grant, to Sponsor the paid-up, royalty-free, perpetual, irrevocable, sublicensable, non-exclusive right and license to (a) use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, perform and display any such Submissions (in whole or in part) worldwide and/or to incorporate all or any portion of it in other works in any form, media or technology now known or later developed for the full term of any patent, trademark, trade secret, copyright or other proprietary rights of any party that may exist in such Submissions; and (b) use the Submissions, including without limitation, the right and license to make, use, sell, offer for sale, and import any products and/or services which practice or embody, or are configured for use in practicing, all or any portion of the Submissions and the right to practice. BY SUBMITTING AN ENTRY, EACH PARTICIPANT ACKNOWLEDGES THAT HIS/HER ENTRY MAY BE POSTED ON SPONSOR’S WEBSITE, SOCIAL MEDIA CHANNELS AND OTHER CHANNELS, AND EDITED, IN SPONSOR’S DISCRETION. Inclusion of Submissions on Sponsor’s website, social media channels or other channels will include attribution to the photographer and you hereby grant Sponsor the paid-up, royalty-free, perpetual, irrevocable, sublicensable, non-exclusive right and license to use your name and other likeness for such purpose. Under no circumstances will Sponsor be required to treat any Submissions as confidential. Sponsor will be entitled to use the Submissions for any purpose whatsoever without compensation to you or any other person. For the avoidance of doubt, Sponsor will not be liable to you or any other person for any ideas for Sponsor’s business (including, without limitation, product designs or ideas) derived from the Submissions and will not incur any liability as a result of any similarities to the Submissions that may appear in any future products or services of Sponsor. You warrant that the content in the Submission has not been copied from any third party and its use by Sponsor will not infringe or involve the misappropriation of any third party rights and agree to indemnify and hold harmless Sponsor and all other third parties licensed above from and against any breach of this warranty.

    1. NOTIFICATION OF WINNERS:

    The Winners will be notified by email using the information provided when the Participant entered the Competition, within approximately thirty (30) days of the Competition End Date.  Such notification to the Winners shall include instructions for proper acceptance of the prize by such Winner.  In the event a Winner does not accept a prize, a Winner is ineligible, or the prize or prize notification is not deliverable, an alternate Winner may be selected.  Sponsor is not responsible for and shall not be liable for late, lost, misdirected or unsuccessful efforts to notify a Winner.  Each Participant agrees to Sponsor’s use of their name, address, likeness, and/or prize information for promotional purposes in any medium without additional compensation to the extent permitted by law.  Where lawful, each Winner may be required to sign and return an Affidavit of Eligibility, Release of Liability, and Publicity Release.  All Participants will be notified of the points they earn from each Challenge (if any) through the Dashboard.

    The Sponsor is not responsible for notifying or distributing the prize or redeemed merchandise amongst the other team members.

    1. WINNERS LIST:   The Winners List may be posted on the Sponsor’s website and social media accounts within approximately 5 days of the Competition End Date.
    2. CONDITIONS: Sponsor and its respective agents, directors, officers, shareholders, employees, insurers, servants, parents, subsidiaries, divisions, affiliates, predecessors, successors, representatives, advertising, Competition, and fulfillment agencies, and legal advisors (the “Released Entities”), are not responsible for, shall not be liable for, and hereby disclaim all liability arising from or relating to: (i) late, lost, delayed, damaged, misdirected, misaddressed, incomplete, or unintelligible entries; (ii) telephone, electronic, hardware or software program, network, Internet, computer or other malfunctions, failures, or difficulties of any kind, whether human or technical; (iii) failed, incomplete, garbled, or delayed computer or e-mail transmissions; (iv) any condition caused by events beyond the control of Sponsor; (v) any injuries, losses, or damages of any kind arising in connection with or as a result of any prize, or any portion thereof that may have been awarded, or acceptance, possession, or use of any prize, or any portion thereof that may have been awarded, or from participation in the Competition; (vi) any printing or typographical errors in any materials associated with the Competition; or (v) the Competition. Sponsor reserves the right, in its sole discretion, to suspend, modify or cancel the Competition should any unauthorized human intervention or other causes beyond Sponsor’s control corrupt or affect the administration, security, fairness or proper conduct of the Competition. In the event that proper administration of the Competition is prevented by such causes as contemplated above, Sponsor will pick the Winners from all eligible, non-suspect entries received prior to such action. By participating in the Competition, Participants and Winners agree to release, discharge and hold harmless the Released Entities, and all others associated with the development and execution of the Competition, from any and all losses, damages, rights, claims and actions of any kind arising out of or relating to the Competition, participation in the Competition, any prize, or any portion thereof that may have been awarded, and/or acceptance, possession, use or misuse of any prize, or any portion thereof that may have been awarded, including but not limited to statutory and common law claims for misappropriation or Participant’s right of publicity. The Sponsor’s computer is the official clock for the Competition. This Competition shall be governed by New York law.
    3. ARBITRATION AGREEMENT: PLEASE READ THIS SECTION CAREFULLY AS IT AFFECTS YOUR RIGHTS.

    a. Agreement to Arbitrate. This Section 8 is referred to in these Official Rules as the “Arbitration Agreement.” You agree that any and all disputes or claims that have arisen or may arise between you and Sponsor, whether arising out of or relating to these Official Rules (including any alleged breach thereof), any advertising, any aspect of the relationship or transactions between us, shall be resolved exclusively through final and binding arbitration, rather than a court, in accordance with the terms of this Arbitration Agreement, except that you may assert individual claims in small claims court, if your claims qualify. Further, this Arbitration Agreement does not preclude you from bringing issues to the attention of federal, state, or local agencies, and such agencies can, if the law allows, seek relief against us on your behalf. You agree that, by entering into these Official Rules, you and Sponsor are each waiving the right to a trial by jury or to participate in a class action. Your rights will be determined by a neutral arbitrator, not a judge or jury. The Federal Arbitration Act governs the interpretation and enforcement of this Arbitration Agreement.

            b.        Prohibition of Class and Representative Actions and Non-Individualized Relief. YOU AND

    SPONSOR AGREE THAT EACH OF US MAY BRING CLAIMS AGAINST THE OTHER ONLY ON AN INDIVIDUAL BASIS AND NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY PURPORTED CLASS OR REPRESENTATIVE ACTION OR PROCEEDING. UNLESS BOTH YOU AND SPONSOR AGREE

    OTHERWISE, THE ARBITRATOR MAY NOT CONSOLIDATE OR JOIN MORE THAN ONE PERSON’S OR PARTY’S CLAIMS AND MAY NOT OTHERWISE PRESIDE OVER ANY FORM OF A CONSOLIDATED, REPRESENTATIVE, OR CLASS PROCEEDING. ALSO, THE ARBITRATOR MAY AWARD RELIEF (INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ONLY IN

    FAVOR OF THE INDIVIDUAL PARTY SEEKING RELIEF AND ONLY TO THE EXTENT NECESSARY

    TO PROVIDE RELIEF NECESSITATED BY THAT PARTY’S INDIVIDUAL CLAIM(S).

    1. Pre-Arbitration Dispute Resolution.        Sponsor is always interested in resolving disputes

    amicably and efficiently, and most customer concerns can be resolved quickly and to the customer’s satisfaction by emailing Dragonfly at privacy@dragonfly.xyz. If such efforts prove unsuccessful, a party who intends to seek arbitration must first send to the other, by certified mail, a written Notice of Dispute (“Notice”). The Notice to Sponsor should be sent to Dragonfly Operations, LLC at 66 Franklin Street, Suite 300, Oakland, CA 94607 (“Notice Address”). The Notice must (i) describe the nature and basis of the claim or dispute and (ii) set forth the specific relief sought. If Sponsor and you do not resolve the claim within sixty (60) calendar days after the Notice is received, you or Sponsor may commence an arbitration proceeding. During the arbitration, the amount of any settlement offer made by Sponsor or you shall not be disclosed to the arbitrator until after the arbitrator determines the amount, if any, to which you or Sponsor is entitled.

    1. Arbitration Procedures. Arbitration will be conducted by a neutral arbitrator in accordance with the American Arbitration Association’s (“AAA”) rules and procedures, including the AAA’s Supplementary Procedures for Consumer-Related Disputes (collectively, the “AAA Rules”), as modified by this Arbitration Agreement. For information on the AAA, please visit its website, http://www.adr.org. Information about the AAA Rules and fees for consumer disputes can be found at the AAA’s consumer arbitration page, http://www.adr.org/consumer_arbitration. If there is any inconsistency between any term of the AAA Rules and any term of this Arbitration Agreement, the applicable terms of this Arbitration Agreement will control unless the arbitrator determines that the application of the inconsistent Arbitration Agreement terms would not result in a fundamentally fair arbitration. The arbitrator must also follow the provisions of these Official Rules as a court would. All issues are for the arbitrator to decide, including, but not limited to, issues relating to the scope, enforceability, and arbitrability of this Arbitration Agreement. Although arbitration proceedings are usually simpler and more streamlined than trials and other judicial proceedings, the arbitrator can award the same damages and relief on an individual basis that a court can award to an individual under these Official Rules and applicable law. Decisions by the arbitrator are enforceable in court and may be overturned by a court only for very limited reasons.

    Unless Sponsor and you agree otherwise, any arbitration hearings will take place in a reasonably convenient location for both parties with due consideration of their ability to travel and other pertinent circumstances. If the parties are unable to agree on a location, the determination shall be made by AAA. If your claim is for $10,000 or less, Sponsor agrees that you may choose whether the arbitration will be conducted solely on the basis of documents submitted to the arbitrator, through a telephonic hearing, or by an in-person hearing as established by the AAA Rules. If your claim exceeds $10,000, the right to a hearing will be determined by the AAA Rules. Regardless of the manner in which the arbitration is conducted, the arbitrator shall issue a reasoned written decision sufficient to explain the essential findings and conclusions on which the award is based.

    1. Costs of Arbitration. Payment of all filing, administration, and arbitrator fees (collectively, the

    “Arbitration Fees”) will be governed by the AAA Rules, unless otherwise provided in this Arbitration Agreement. If the value of the relief sought is $75,000 or less, at your request, Sponsor will pay all Arbitration Fees. If the value of relief sought is more than $75,000 and you are able to demonstrate to the arbitrator that you are economically unable to pay your portion of the Arbitration Fees or if the arbitrator otherwise determines for any reason that you should not be required to pay your portion of the Arbitration Fees, Sponsor will pay your portion of such fees. In addition, if you demonstrate to the arbitrator that the costs of arbitration will be prohibitive as compared to the costs of litigation, Sponsor will pay as much of the Arbitration Fees as the arbitrator deems necessary to prevent the arbitration from being cost-prohibitive. Finally, if the value of the relief sought is $75,000 or less, Sponsor will pay reasonable attorneys’ fees should you prevail. Sponsor will not seek attorneys’ fees from you. But, if you initiate an arbitration in which you seek more than $75,000 in relief, the payment of attorneys’ fees will be governed by the AAA Rules.

    1. Confidentiality. All aspects of the arbitration proceeding, and any ruling, decision, or award by

    the arbitrator, will be strictly confidential for the benefit of all parties.

    1. Severability. Without limiting the severability provision in Section 8 of the these Official Rules,

    if a court or the arbitrator decides that any term or provision of this Arbitration Agreement other than Section 8(b) above is invalid or unenforceable, the parties agree to replace such term or provision with a term or provision that is valid and enforceable and that comes closest to expressing the intention of the invalid or unenforceable term or provision, and this Arbitration Agreement shall be enforceable as so modified. If a court decides that any of the provisions of Section 8(b) is invalid or unenforceable, then the entirety of this Arbitration Agreement shall be null and void.  The remainder of these Official Rules will continue to apply.

    1. Future Changes to Arbitration Agreement. Notwithstanding any provision in these Official Rules to the contrary, Sponsor agrees that if it makes any future change to this Arbitration Agreement (other than a change to the Notice Address) while you are a user of the Services, you may reject any such change by sending Sponsor written notice within thirty (30) calendar days of the change to the Notice Address provided above. By rejecting any future change, you are agreeing that you will arbitrate any dispute between us in accordance with the language of this Arbitration Agreement.
    1. SPONSOR:  This Competition is sponsored by Dragonfly Operations, LLC at 66 Franklin Street, Suite 300, Oakland, CA 94607.
    2. NOTICE: Sponsor reserves the right to prosecute and seek damages against any individual who attempts to deliberately undermine the proper operation of the Competition in violation of these Official Rules and/or criminal and/or civil law.

    FLAG-YOURE-IT

    \ No newline at end of file diff --git a/text-input-border.png b/text-input-border.png new file mode 100644 index 0000000..aada104 Binary files /dev/null and b/text-input-border.png differ diff --git a/tournament.html b/tournament.html new file mode 100644 index 0000000..ac2f06f --- /dev/null +++ b/tournament.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + +