@luno-kit/ui 0.0.9 → 0.0.11-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
"use strict";var rn=Object.create;var No=Object.defineProperty;var an=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var un=Object.getPrototypeOf,cn=Object.prototype.hasOwnProperty;var dn=(o,n)=>{for(var e in n)No(o,e,{get:n[e],enumerable:!0})},he=(o,n,e,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of sn(n))!cn.call(o,t)&&t!==e&&No(o,t,{get:()=>n[t],enumerable:!(l=an(n,t))||l.enumerable});return o};var j=(o,n,e)=>(e=o!=null?rn(un(o)):{},he(n||!o||!o.__esModule?No(e,"default",{value:o,enumerable:!0}):e,o)),mn=o=>he(No({},"__esModule",{value:!0}),o);var Zn={};dn(Zn,{ConnectButton:()=>je,LunoKitProvider:()=>Mn,useAccountModal:()=>to,useChainModal:()=>lo,useCloseAllModals:()=>ye,useConnectModal:()=>no,useLunoTheme:()=>ce});module.exports=mn(Zn);var Do=require("@luno-kit/react"),Ze=require("@luno-kit/react/utils"),Co=require("react");var Fo=require("react/jsx-runtime"),pn=o=>(0,Fo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"arrow_svg__icon",viewBox:"0 0 256 256",width:"20",height:"20",fill:"currentColor",...o,children:(0,Fo.jsx)("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"})}),Go=pn;var $o=require("react/jsx-runtime"),fn=o=>(0,$o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",viewBox:"0 0 256 256",...o,children:(0,$o.jsx)("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"})}),mo=fn;var Zo=require("react/jsx-runtime"),hn=o=>(0,Zo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",viewBox:"0 0 256 256",...o,children:(0,Zo.jsx)("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"})}),Z=hn;var W=require("react/jsx-runtime"),xn=o=>(0,W.jsxs)("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13294",width:"100%",height:"100%",...o,children:[(0,W.jsx)("path",{d:"M170.837333 263.338667c-55.893333 25.173333-74.837333 53.333333-74.837333 72.661333 0 19.328 18.944 47.488 74.837333 72.661333 52.906667 23.808 128.256 39.338667 213.162667 39.338667 84.906667 0 160.256-15.530667 213.12-39.338667 55.893333-25.173333 74.88-53.333333 74.88-72.661333 0-19.328-18.944-47.488-74.88-72.661333C544.213333 239.573333 468.906667 224 384 224c-84.906667 0-160.256 15.573333-213.162667 39.338667zM144.64 205.013333C207.530667 176.64 292.181333 160 384 160c91.818667 0 176.469333 16.682667 239.402667 45.013333 59.904 26.922667 112.597333 70.826667 112.597333 130.986667s-52.693333 104.021333-112.597333 130.986667C560.469333 495.36 475.818667 512 384 512c-91.818667 0-176.469333-16.682667-239.402667-45.013333C84.693333 440.021333 32 396.16 32 336s52.693333-104.064 112.597333-130.986667z",fill:"currentColor","p-id":"13295"}),(0,W.jsx)("path",{d:"M64 304a32 32 0 0 1 32 32v160c0 19.370667 18.944 47.530667 74.837333 72.661333 52.906667 23.808 128.213333 39.338667 213.162667 39.338667 84.949333 0 160.298667-15.530667 213.162667-39.338667 55.893333-25.173333 74.837333-53.290667 74.837333-72.661333v-160a32 32 0 0 1 64 0v160c0 60.245333-52.650667 104.106667-112.554667 131.029333-62.933333 28.330667-147.626667 44.970667-239.445333 44.970667-91.861333 0-176.512-16.64-239.445333-44.970667C84.650667 600.064 32 556.202667 32 496v-160a32 32 0 0 1 32-32z",fill:"currentColor","p-id":"13296"}),(0,W.jsx)("path",{d:"M256 436.010667a32 32 0 0 1 32 32v160a32 32 0 0 1-64 0v-160a32 32 0 0 1 32-32zM672.128 383.829333a32 32 0 0 1 34.858667-28.885333c75.946667 7.082667 144.469333 25.813333 195.072 53.333333 48.810667 26.581333 89.941333 66.773333 89.941333 119.722667 0 60.245333-52.650667 104.106667-112.554667 131.029333-62.933333 28.288-147.626667 44.970667-239.445333 44.970667-81.621333 0-157.482667-13.269333-217.173333-35.626667a32 32 0 1 1 22.4-59.946666c51.456 19.242667 119.594667 31.573333 194.773333 31.573333 84.949333 0 160.256-15.530667 213.162667-39.338667 55.893333-25.173333 74.837333-53.290667 74.837333-72.661333 0-16.64-13.866667-40.277333-56.533333-63.488-40.96-22.272-100.437333-39.338667-170.453334-45.866667a32 32 0 0 1-28.885333-34.816z",fill:"currentColor","p-id":"13297"}),(0,W.jsx)("path",{d:"M960 496a32 32 0 0 1 32 32v160c0 60.245333-52.650667 104.106667-112.554667 131.029333-62.933333 28.288-147.626667 44.970667-239.445333 44.970667-91.861333 0-176.512-16.64-239.445333-44.970667-59.904-26.965333-112.554667-70.826667-112.554667-131.029333v-50.773333a32 32 0 0 1 64 0v50.773333c0 19.370667 18.944 47.530667 74.837333 72.661333 52.906667 23.808 128.213333 39.338667 213.162667 39.338667 84.949333 0 160.298667-15.530667 213.162667-39.338667 55.893333-25.173333 74.837333-53.290667 74.837333-72.661333v-160a32 32 0 0 1 32-32z",fill:"currentColor","p-id":"13298"}),(0,W.jsx)("path",{d:"M768 628.010667a32 32 0 0 1 32 32v160a32 32 0 0 1-64 0v-160a32 32 0 0 1 32-32zM512 436.010667a32 32 0 0 1 32 32v352a32 32 0 0 1-64 0v-352a32 32 0 0 1 32-32z",fill:"currentColor","p-id":"13299"})]}),zo=xn;var Uo=require("react/jsx-runtime"),gn=o=>(0,Uo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"copy_svg__icon",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 256 256",...o,children:(0,Uo.jsx)("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"})}),jo=gn;var po=require("react/jsx-runtime"),vn=o=>(0,po.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",version:"1.1","p-id":"8135",width:"256",height:"256",...o,children:[(0,po.jsx)("path",{d:"M512 64L126.26 286.74l-2.26 1.31v448L512 960l385.74-222.74L900 736V288z m353.3 652L512 920 158.7 716V308L512 104l353.3 204z","p-id":"8136",fill:"currentColor"}),(0,po.jsx)("path",{d:"M314.55 589.97l-79.49-272.91-27.3 15.82v358.24l34.65 20.05V466.46l85.64 294.07 21.15 12.19V251.18l-34.65 20.05v318.74zM403.1 803.85l34.65 20.05V529.33h186.88v-34.66H437.75v-244.5l74.05-45.03 124.92 79.79 18.64-29.22-143.16-91.37-109.1 66.29v573.22zM724.36 338.72v405.49l34.66-20.05V360.28l60.24 37.38v-40.8l-149.2-92.79-18.33 29.42 72.63 45.23z","p-id":"8137",fill:"currentColor"})]}),Wo=vn;var Qo=require("react/jsx-runtime"),wn=o=>(0,Qo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 256 256",width:"20",height:"20",...o,children:(0,Qo.jsx)("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"})}),qo=wn;var fo=require("react/jsx-runtime"),Cn=o=>(0,fo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 38 38",fill:"none",...o,children:[(0,fo.jsx)("path",{d:"M18.273 1.51489L3.90896 10.5424C2.41176 11.443 1.77589 12.1511 2.00136 12.6666H29.374L24.7431 3.04502C23.4245 0.849886 20.52 0.163352 18.273 1.51489ZM16.3185 12.54L6.91729 10.8844L19.5776 3.68595C20.5998 3.07162 21.9184 3.38322 22.5188 4.38262L25.8084 10.8844L16.3185 12.54Z",fill:"currentColor"}),(0,fo.jsx)("path",{d:"M31.9757 10.1333H6.02426C3.401 10.1333 1.26666 12.217 1.26666 14.7782V33.3551C1.26666 35.9163 3.401 38 6.02426 38H31.9757C34.599 38 36.7333 35.9163 36.7333 33.3551V14.7782C36.7333 12.217 34.599 10.1333 31.9757 10.1333ZM34.1379 27.0218H24.624C22.9545 27.0218 21.5967 25.6956 21.5967 24.0666C21.5967 22.4377 22.9545 21.1115 24.624 21.1115H34.1392V27.0218H34.1379ZM34.1379 18.5782H24.624C21.5219 18.5782 19 21.0393 19 24.0666C19 27.094 21.5219 29.5551 24.6227 29.5551H34.1379V33.3551C34.1379 34.5204 33.1677 35.4666 31.9757 35.4666H6.02426C4.83233 35.4666 3.86206 34.5204 3.86206 33.3551V14.7782C3.86206 13.6128 4.83233 12.6666 6.02426 12.6666H31.9757C33.1677 12.6666 34.1379 13.6128 34.1379 14.7782V18.5782ZM23.3257 24.0666C23.3257 24.9989 24.0996 25.7551 25.0547 25.7551C26.011 25.7551 26.7849 24.9989 26.7849 24.0666C26.7849 23.1344 26.011 22.3782 25.0547 22.3782C24.0996 22.3782 23.3257 23.1344 23.3257 24.0666Z",fill:"currentColor"})]}),Ko=Cn;var Jo=require("react/jsx-runtime"),bn=o=>(0,Jo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",fill:"none",...o,children:(0,Jo.jsx)("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z",fill:"currentColor"})}),Xo=bn;var Yo=require("react/jsx-runtime"),yn=o=>(0,Yo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"list_svg__icon",viewBox:"0 0 256 256",width:"20",height:"20",fill:"currentColor",...o,children:(0,Yo.jsx)("path",{d:"M232,48V88a8,8,0,0,1-16,0V56H184a8,8,0,0,1,0-16h40A8,8,0,0,1,232,48ZM72,200H40V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16Zm152-40a8,8,0,0,0-8,8v32H184a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,224,160ZM32,96a8,8,0,0,0,8-8V56H72a8,8,0,0,0,0-16H32a8,8,0,0,0-8,8V88A8,8,0,0,0,32,96ZM188,167l-56,32a8,8,0,0,1-7.94,0L68,167A8,8,0,0,1,64,160V96a8,8,0,0,1,4-7l56-32a8,8,0,0,1,7.94,0l56,32a8,8,0,0,1,4,7v64A8,8,0,0,1,188,167ZM88.12,96,128,118.79,167.88,96,128,73.21ZM80,155.36l40,22.85V132.64L80,109.79Zm96,0V109.79l-40,22.85v45.57Z"})}),oe=yn;var ee=require("react/jsx-runtime"),Nn=o=>(0,ee.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"search_svg__icon",viewBox:"0 0 256 256",width:"20",height:"20",fill:"currentColor",...o,children:(0,ee.jsx)("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"})}),ne=Nn;var te=require("react/jsx-runtime"),Sn=o=>(0,te.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"success_svg__icon",viewBox:"0 0 256 256",width:"20",height:"20",fill:"currentColor",...o,children:(0,te.jsx)("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"})}),le=Sn;var re=require("react/jsx-runtime"),kn=o=>(0,re.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",className:"switch_svg__icon",viewBox:"0 0 256 256",fill:"currentColor",...o,children:(0,re.jsx)("path",{d:"M253.66,133.66l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L216,132.69V128A88,88,0,0,0,56.49,76.67a8,8,0,0,1-13-9.34A104,104,0,0,1,232,128v4.69l10.34-10.35a8,8,0,0,1,11.32,11.32Zm-41.18,55A104,104,0,0,1,24,128v-4.69L13.66,133.66A8,8,0,0,1,2.34,122.34l24-24a8,8,0,0,1,11.32,0l24,24a8,8,0,0,1-11.32,11.32L40,123.31V128a87.62,87.62,0,0,0,22.24,58.41A79.66,79.66,0,0,1,98.3,157.66a48,48,0,1,1,59.4,0,79.59,79.59,0,0,1,36.08,28.78,89.68,89.68,0,0,0,5.71-7.11,8,8,0,0,1,13,9.34ZM128,152a32,32,0,1,0-32-32A32,32,0,0,0,128,152Zm0,64a88.2,88.2,0,0,0,53.92-18.49,64,64,0,0,0-107.84,0A87.57,87.57,0,0,0,128,216Z"})}),ae=kn;var z=require("react");function So({initialView:o,animationDuration:n=200,animationEasing:e="ease-out"}){let[l,t]=(0,z.useState)(o),[r,s]=(0,z.useState)(!1),u=(0,z.useRef)(null),m=(0,z.useRef)(null),p=(0,z.useCallback)(d=>{if(d===l||r)return;if(s(!0),!u.current){t(d),s(!1);return}let a=u.current,c=a.offsetHeight;t(d),requestAnimationFrame(()=>{if(!a||!m.current){s(!1);return}let g=m.current.offsetHeight;a.animate([{height:`${c}px`},{height:`${g}px`}],{duration:n,easing:e,fill:"forwards"}).addEventListener("finish",()=>{s(!1)})})},[l,r,n,e]),f=(0,z.useCallback)(()=>{t(o),s(!1)},[o]);return{currentView:l,isAnimating:r,containerRef:u,currentViewRef:m,handleViewChange:p,resetView:f}}var S=require("react");var ge=require("react"),xe=["--color-accentColor","--color-walletSelectItemBackground","--color-walletSelectItemBackgroundHover","--color-walletSelectItemText","--color-connectButtonBackground","--color-connectButtonInnerBackground","--color-connectButtonText","--color-accountActionItemBackground","--color-accountActionItemBackgroundHover","--color-accountActionItemText","--color-accountSelectItemBackground","--color-accountSelectItemBackgroundHover","--color-accountSelectItemText","--color-currentNetworkButtonBackground","--color-currentNetworkButtonText","--color-networkSelectItemBackground","--color-networkSelectItemBackgroundHover","--color-networkSelectItemText","--color-assetSelectItemBackground","--color-navigationButtonBackground","--color-separatorLine","--color-modalBackground","--color-modalBackdrop","--color-modalBorder","--color-modalText","--color-modalTextSecondary","--color-modalControlButtonBackgroundHover","--color-modalControlButtonText","--color-success","--color-successForeground","--color-warning","--color-warningForeground","--color-error","--color-errorForeground","--color-info","--color-infoForeground","--color-skeleton","--color-defaultIconBackground","--font-body","--radius-walletSelectItem","--radius-connectButton","--radius-modalControlButton","--radius-accountActionItem","--radius-accountSelectItem","--radius-currentNetworkButton","--radius-networkSelectItem","--radius-assetSelectItem","--radius-modal","--radius-modalMobile","--shadow-button","--shadow-modal","--blur-modalOverlay"],ve=(o,n)=>{(0,ge.useEffect)(()=>{if(typeof window>"u")return;let e=document.documentElement;o.type==="complete"&&o.completeTheme?(Object.entries(o.completeTheme.colors).forEach(([l,t])=>{t&&e.style.setProperty(`--color-${l}`,t)}),Object.entries(o.completeTheme.fonts).forEach(([l,t])=>{t&&e.style.setProperty(`--font-${l}`,t)}),Object.entries(o.completeTheme.radii).forEach(([l,t])=>{t&&e.style.setProperty(`--radius-${l}`,t)}),Object.entries(o.completeTheme.shadows).forEach(([l,t])=>{t&&e.style.setProperty(`--shadow-${l}`,t)}),Object.entries(o.completeTheme.blurs).forEach(([l,t])=>{t&&e.style.setProperty(`--blur-${l}`,t)}),e.removeAttribute("data-theme")):o.type==="partial"&&o.partialOverrides?(e.setAttribute("data-theme",n),Object.keys(o.partialOverrides).length>0&&(xe.forEach(t=>{e.style.removeProperty(t)}),o.partialOverrides.colors&&Object.entries(o.partialOverrides.colors).forEach(([t,r])=>{r&&e.style.setProperty(`--color-${t}`,r)}),o.partialOverrides.fonts&&Object.entries(o.partialOverrides.fonts).forEach(([t,r])=>{r&&e.style.setProperty(`--font-${t}`,r)}),o.partialOverrides.radii&&Object.entries(o.partialOverrides.radii).forEach(([t,r])=>{r&&e.style.setProperty(`--radius-${t}`,r)}),o.partialOverrides.shadows&&Object.entries(o.partialOverrides.shadows).forEach(([t,r])=>{r&&e.style.setProperty(`--shadow-${t}`,r)}),o.partialOverrides.blurs&&Object.entries(o.partialOverrides.blurs).forEach(([t,r])=>{r&&e.style.setProperty(`--blur-${t}`,r)}))):(e.setAttribute("data-theme",n),xe.forEach(l=>{e.style.removeProperty(l)}))},[o,n])};var Ce=require("react/jsx-runtime"),ie="luno.lastThemePreference",Tn=o=>{try{localStorage.setItem(ie,JSON.stringify(o))}catch{}},we=(0,S.createContext)(void 0),se=o=>"colors"in o&&"fonts"in o&&"radii"in o&&"shadows"in o&&"blurs"in o,An=()=>{let[o,n]=(0,S.useState)(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return(0,S.useEffect)(()=>{if(typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),l=t=>{n(t.matches?"dark":"light")};return l(e),e.addEventListener("change",l),()=>e.removeEventListener("change",l)},[]),o},ue=({children:o,theme:n})=>{let e=An(),[l,t]=(0,S.useState)(()=>{if(typeof window<"u")try{let a=localStorage.getItem(ie);if(a){let c=JSON.parse(a);if(c?.isAuto)return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(c?.preferredTheme)return c.preferredTheme}}catch{}return!n||se(n)?"light":n.defaultMode||"light"}),[r,s]=(0,S.useState)(()=>{if(typeof window<"u")try{let a=localStorage.getItem(ie);if(a)return JSON.parse(a)?.isAuto??!1}catch{}return!n||se(n)?!1:n.autoMode??!1}),u=(0,S.useMemo)(()=>{if(!n)return{type:"default",completeTheme:null,partialOverrides:null};if(se(n))return{type:"complete",completeTheme:n,partialOverrides:null};let d=n;if(d.theme)return{type:"complete",completeTheme:d.theme,partialOverrides:null};let a=null;return l==="light"&&d.light?a=d.light:l==="dark"&&d.dark?a=d.dark:a={...d},{type:"partial",completeTheme:null,partialOverrides:a}},[l,n]),m=(0,S.useMemo)(()=>u.type==="complete"?u.completeTheme:null,[u]);ve(u,l);let p=(0,S.useCallback)(d=>{let a=d==="auto";s(a),t(a?e||"light":d);let c={isAuto:a,...a?{}:{preferredTheme:d}};Tn(c)},[e]);(0,S.useEffect)(()=>{r&&t(e||"light")},[e,r]);let f=(0,S.useMemo)(()=>({themeMode:l,setThemeChoice:p,currentTheme:m}),[l,p,m]);return(0,Ce.jsx)(we.Provider,{value:f,children:o})},ce=()=>{let o=(0,S.useContext)(we);if(!o)throw new Error("useLunoTheme must be used within a ThemeProvider (which is part of LunoKitProvider)");return o};var Se=require("@luno-kit/react"),ko=require("@tanstack/react-query"),ke=require("react");var Y=require("@luno-kit/react"),k=require("react"),Ne=require("react/jsx-runtime");function de(){let[o,n]=(0,k.useState)(!1),e=(0,k.useCallback)(()=>n(!0),[]),l=(0,k.useCallback)(()=>n(!1),[]);return{isOpen:o,open:e,close:l}}var ho=(0,k.createContext)(void 0),be=({children:o})=>{let{isOpen:n,open:e,close:l}=de(),{isOpen:t,open:r,close:s}=de(),{isOpen:u,open:m,close:p}=de(),f=(0,Y.useStatus)(),d=(0,k.useCallback)(()=>{l(),s(),p()},[l,s,p]);(0,k.useEffect)(()=>{f===Y.ConnectionStatus.Disconnected&&(s(),p())},[f,s,p]);let a=(0,k.useMemo)(()=>({isConnectModalOpen:n,isAccountModalOpen:t,isChainModalOpen:u,openConnectModal:f!==Y.ConnectionStatus.Connected?e:void 0,closeConnectModal:l,openAccountModal:f===Y.ConnectionStatus.Connected?r:void 0,closeAccountModal:s,openChainModal:f===Y.ConnectionStatus.Connected?m:void 0,closeChainModal:p,closeAllModals:d}),[n,e,l,t,r,s,u,m,p,d,f]);return(0,Ne.jsx)(ho.Provider,{value:a,children:o})},no=()=>{let o=(0,k.useContext)(ho);if(!o)throw new Error("[ModalContext]: useConnectModal must be used within a ModalProvider");return{isOpen:o.isConnectModalOpen,open:o.openConnectModal,close:o.closeConnectModal}},to=()=>{let o=(0,k.useContext)(ho);if(!o)throw new Error("[ModalContext]: useAccountModal must be used within a ModalProvider");return{isOpen:o.isAccountModalOpen,open:o.openAccountModal,close:o.closeAccountModal}},lo=()=>{let o=(0,k.useContext)(ho);if(!o)throw new Error("[ModalContext]: useChainModal must be used within a ModalProvider");return{isOpen:o.isChainModalOpen,open:o.openChainModal,close:o.closeChainModal}},ye=()=>{let o=(0,k.useContext)(ho);if(!o)throw new Error("[ModalContext]: useCloseAllModals must be used within a ModalProvider");return o.closeAllModals};var I=require("react/jsx-runtime"),Mn=({children:o,config:n,queryClientConfig:e,theme:l})=>{let[t]=(0,ke.useState)(()=>new ko.QueryClient(e));return(0,I.jsx)(ko.QueryClientProvider,{client:t,children:(0,I.jsx)(Se.LunoProvider,{config:n,children:(0,I.jsx)(ue,{theme:l,children:(0,I.jsxs)(be,{children:[(0,I.jsx)("div",{children:o}),(0,I.jsx)(In,{modalSize:n.modalSize})]})})})})},In=({modalSize:o})=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Me,{size:o}),(0,I.jsx)(Te,{}),(0,I.jsx)(Ae,{})]});var Ie=require("clsx"),Ve=require("tailwind-merge"),Vn=(0,Ve.extendTailwindMerge)({extend:{classGroups:{"font-size":["text-xs","text-sm","text-base","text-lg"]}}});function i(...o){return Vn((0,Ie.clsx)(o))}function Pe(o,n){let e;return()=>{e&&clearTimeout(e),e=setTimeout(()=>{e=null,o()},n)}}var To=require("react");var xo=require("react/jsx-runtime"),Ao=({copyText:o,label:n,className:e=""})=>{let[l,t]=(0,To.useState)(!1),r=(0,To.useCallback)(async s=>{try{return navigator.clipboard?.writeText?(await navigator.clipboard.writeText(s),t(!0),setTimeout(()=>t(!1),2e3),!0):!1}catch(u){return console.error("Copy failed:",u),!1}},[]);return(0,xo.jsxs)("button",{type:"button",className:i("luno:cursor-pointer luno:bg-transparent luno:border-none luno:p-1 luno:m-0 luno:inline-flex luno:items-center luno:justify-center luno:gap-1","luno:rounded-modalControlButton luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200",e),onClick:()=>!l&&o&&r(o),"aria-label":"Copy address to clipboard",disabled:l,children:[l?(0,xo.jsx)(le,{className:"luno:text-accentColor",width:16,height:16}):(0,xo.jsx)(jo,{width:16,height:16}),n]})};var D=j(require("@radix-ui/react-dialog"),1),Mo=j(require("react"),1);var go=require("react/jsx-runtime"),Pn=({open:o,onOpenChange:n,children:e,contentClassName:l,overlayClassName:t})=>(0,go.jsx)(D.Root,{open:o,onOpenChange:n,children:(0,go.jsxs)(D.Portal,{children:[Mo.default.createElement(D.Overlay,{className:i("luno:fixed luno:inset-0 luno:z-[100] luno:bg-modalBackdrop luno-kit","luno:data-[state=open]:[animation:overlay-in_150ms_ease-out]",t)}),(0,go.jsx)(D.Content,{className:i("luno-kit luno:font-body luno:fixed luno:z-[200] luno:text-modalText luno:text-base luno:leading-base","luno:bg-modalBackground luno:shadow-modal luno:focus:outline-none luno:overflow-hidden luno:border luno:border-modalBorder","luno:transition-all luno:duration-200","luno:rounded-t-modalMobile luno:bottom-0 luno:left-0 luno:w-full","luno:translate-y-0 luno:-translate-x-0","luno:data-[state=open]:[animation:slide-up_200ms_ease-out]","luno:md:bottom-auto luno:md:left-1/2 luno:md:top-1/2 luno:md:-translate-x-1/2 luno:md:-translate-y-1/2","luno:md:w-auto luno:md:rounded-modal","luno:md:data-[state=open]:[animation:dialog-in_150ms_ease-out]",l),children:e})]})}),Rn=({children:o,className:n})=>Mo.default.createElement(D.Title,{className:n},o),Bn=({children:o,className:n,onClick:e})=>Mo.default.createElement(D.Close,{className:n,onClick:e},o),ro=Pn,Q=Bn,q=Rn;var Ee=require("react");var Vo=require("@luno-kit/react"),U=j(require("react"),1);var ao=require("@luno-kit/react"),vo=require("@luno-kit/react/utils"),Re=require("@tanstack/react-query"),Ln=async({apiUrl:o,apiKey:n,address:e})=>{try{let l=await fetch(`${o}/api/scan/account/tokens`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":n},body:JSON.stringify({address:e})});if(!l.ok)throw new Error(`Subscan API error: ${l.status}`);let t=await l.json();if(t.code!==0)throw new Error(`Subscan API error: ${t.message}`);let r=t.data.assets||[],s=t.data.native||[],u=t.data.builtin||[],m=r.filter(a=>a.token_image||a.unique_id?.includes("nft")).map(a=>({balance:a.balance,decimals:a.decimals,balanceFormatted:(0,vo.formatBalance)(a.balance,a.decimals),logoURI:a.token_image,symbol:a.symbol,assetId:a.asset_id,price:a.price})),p=r.filter(a=>!a.token_image&&!a.unique_id?.includes("nft")).map(a=>({balance:a.balance,decimals:a.decimals,balanceFormatted:(0,vo.formatBalance)(a.balance,a.decimals,4),logoURI:a.token_image,symbol:a.symbol,assetId:a.asset_id,price:a.price})),f=s.map(a=>({balance:a.balance,decimals:a.decimals,balanceFormatted:(0,vo.formatBalance)(a.balance,a.decimals,4),logoURI:"",symbol:a.symbol,assetId:0,price:a.price})),d=u.map(a=>({balance:a.balance,decimals:a.decimals,balanceFormatted:(0,vo.formatBalance)(a.balance,a.decimals,4),logoURI:"",symbol:a.symbol,assetId:a.unique_id,price:a.price}));return{nfts:[...m],tokens:[...f,...p,...d]}}catch(l){throw console.error("Failed to fetch tokens from Subscan:",l),l}};function so(){let{address:o}=(0,ao.useAccount)(),n=(0,ao.useConfig)(),{chain:e}=(0,ao.useChain)(),l=e?.subscan?.api,t=n?.subscan?.apiKey;return(0,Re.useQuery)({queryKey:["subscan","asset-list",o,e?.genesisHash,l,t],queryFn:()=>Ln({address:o,apiKey:t,apiUrl:l}),enabled:!!o&&!!t&&!!l,staleTime:n?.subscan?.cacheTime||6e4})}var io=require("react/jsx-runtime"),Io=({type:o})=>(0,io.jsxs)("div",{className:"luno:flex luno:flex-col luno:gap-1 luno:items-center luno:justify-center luno:min-h-[300px] luno:text-center",children:[(0,io.jsx)(Ko,{className:"luno:w-[38px] luno:h-[38px] luno:mb-2"}),(0,io.jsxs)("div",{className:"luno:text-modalText luno:text-base luno:leading-base",children:["No ",o," found"]}),(0,io.jsx)("div",{className:"luno:text-sm luno:text-modalTextSecondary luno:max-w-[260px]",children:"Switch to a different network or account to view more assets"})]});var C=require("react/jsx-runtime"),Be=U.default.memo(()=>{let{data:o,isFetching:n,error:e}=so(),l=(0,U.useMemo)(()=>o?o.nfts:[],[o]);return n?(0,C.jsx)("div",{className:"luno:flex luno:justify-center luno:w-full",children:(0,C.jsx)("div",{className:"luno:flex luno:flex-wrap luno:justify-between luno:max-w-[350px] luno:w-full luno:min-h-[300px] luno:gap-y-4",children:[1,2,3,4].map(t=>(0,C.jsx)("div",{className:"luno:animate-pulse luno:bg-skeleton luno:w-[155px] luno:h-[198px] luno:rounded-assetSelectItem"},`skeleton-${t}`))})}):e?(0,C.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:justify-center luno:min-h-[300px] luno:text-center luno:p-4",children:[(0,C.jsx)("div",{className:"luno:text-error luno:mb-2",children:"Failed to load assets"}),(0,C.jsx)("div",{className:"luno:text-modalTextSecondary luno:text-sm",children:e instanceof Error?e.message:"Unknown error"})]}):l.length?(0,C.jsx)("div",{className:"luno:flex luno:justify-center luno:w-full",children:(0,C.jsx)("div",{className:"luno:flex luno:flex-wrap luno:justify-between luno:max-w-[350px] luno:w-full luno:gap-y-4",children:l.map(t=>(0,C.jsx)(En,{asset:t},`${t.symbol}-${t.balance}`))})}):(0,C.jsx)(Io,{type:"NFTs"})}),En=U.default.memo(({asset:o})=>{let{chain:n}=(0,Vo.useChain)(),{address:e}=(0,Vo.useAccount)(),[l,t]=(0,U.useState)(!!o.logoURI),[r,s]=(0,U.useState)(o.logoURI),u=(0,U.useMemo)(()=>n?.subscan?.url?`${n.subscan.url.endsWith("/")?n.subscan.url.slice(0,-1):n.subscan.url}/nft_item?collection_id=${o.assetId}&address=${e}`:"",[n,o,e]);return(0,C.jsx)("div",{className:i("luno:w-[155px] luno:h-[198px] luno:flex luno:items-center luno:p-2.5 luno:rounded-assetSelectItem luno:cursor-default","luno:bg-assetSelectItemBackground","luno:transition-colors luno:duration-200"),children:(0,C.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:justify-center",children:[(0,C.jsxs)("div",{className:"luno:relative luno:w-[135px] luno:h-[135px] luno:flex luno:items-center luno:justify-center luno:rounded-[6px] luno:overflow-hidden",children:[l&&(0,C.jsx)("div",{className:"luno:absolute luno:inset-0 luno:flex luno:items-center luno:justify-center luno:animate-pulse luno:bg-gray-500",children:(0,C.jsx)("div",{className:"luno:w-4 luno:h-4 luno:border-2 luno:border-t-transparent luno:border-white luno:rounded-full luno:animate-spin"})}),r?(0,C.jsx)("img",{src:r,alt:`${o.symbol}-NFT`,className:i("luno:w-full luno:h-full luno:object-cover",l?"luno:opacity-0":"luno:opacity-100 luno:transition-opacity luno:duration-200"),onLoad:()=>t(!1),onError:()=>{t(!1),s("")}}):(0,C.jsx)(Wo,{className:"luno:w-full luno:h-full luno:object-cover"})]}),(0,C.jsxs)("div",{className:"luno:flex luno:items-center luno:justify-between luno:w-full luno:mt-0.5",children:[(0,C.jsxs)("span",{className:"luno:font-medium luno:text-sm luno:leading-sm luno:text-modalText",children:[o.balance||"-"," NFTs"]}),(0,C.jsx)("button",{className:"luno:cursor-pointer luno:bg-transparent luno:border-none luno:p-1 luno:m-0 luno:inline-flex luno:items-center luno:justify-center luno:gap-1 luno:rounded-modalControlButton luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200",onClick:()=>u&&window.open(u),children:(0,C.jsx)(Xo,{})})]}),(0,C.jsx)("div",{className:"luno:w-full luno:text-left luno:text-xs luno:text-modalTextSecondary luno:font-medium luno:whitespace-nowrap luno:max-w-[135px] luno:overflow-hidden luno:text-ellipsis",children:o.symbol||o.assetId})]})})});var co=j(require("react"),1);var wo=require("react");var uo=require("react/jsx-runtime"),K=({iconUrl:o,resourceName:n,className:e})=>{let[l,t]=(0,wo.useState)(!!o),[r,s]=(0,wo.useState)(!1),u=(0,wo.useMemo)(()=>{if(!n)return"-";let m=n.match(/^([^-]+)-/);return m?.[1]?m[1].charAt(0).toUpperCase():n.charAt(0).toUpperCase()},[n]);return o&&!r?(0,uo.jsxs)("div",{className:i("luno:relative luno:w-full luno:h-full",e),children:[l&&(0,uo.jsx)("div",{className:"luno:absolute luno:inset-0 luno:flex luno:items-center luno:justify-center luno:rounded-full luno:animate-pulse luno:bg-skeleton"}),(0,uo.jsx)("img",{src:o,alt:n||"icon",className:i("luno:w-full luno:h-full luno:object-cover luno:rounded-full",l?"luno:opacity-0":"luno:opacity-100 luno:transition-opacity luno:duration-200"),onLoad:()=>t(!1),onError:()=>{t(!1),s(!0)}})]}):(0,uo.jsx)("div",{className:i("luno:w-full luno:h-full luno:text-white luno:font-semibold","luno:flex luno:items-center luno:justify-center luno:rounded-full luno:bg-defaultIconBackground",e),children:u})};var N=require("react/jsx-runtime"),Dn=o=>`https://raw.githubusercontent.com/Luno-lab/luno-assets/refs/heads/main/assets/tokens/${o?.toLowerCase().trim()||""}.webp`,Le=co.default.memo(()=>{let{data:o,error:n,isFetching:e}=so(),l=(0,co.useMemo)(()=>o?[...o.tokens].sort((t,r)=>{let s=t.price?parseFloat(t.balance)/10**t.decimals*parseFloat(t.price):0;return(r.price?parseFloat(r.balance)/10**r.decimals*parseFloat(r.price):0)-s}):[],[o]);return e?(0,N.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5 luno:min-h-[300px]",children:[1,2,3,4,5].map(t=>(0,N.jsx)("div",{className:"luno:animate-pulse luno:bg-skeleton luno:h-[54px] luno:rounded-assetSelectItem"},`skeleton-${t}`))}):n?(0,N.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:justify-center luno:min-h-[300px] luno:text-center luno:p-4",children:[(0,N.jsx)("div",{className:"luno:text-error luno:mb-2",children:"Failed to load assets"}),(0,N.jsx)("div",{className:"luno:text-modalTextSecondary luno:text-sm",children:n instanceof Error?n.message:"Unknown error"})]}):l.length?(0,N.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5",children:l.map(t=>(0,N.jsx)(_n,{asset:t},`${t.symbol}-${t.assetId}`))}):(0,N.jsx)(Io,{type:"Tokens"})}),_n=co.default.memo(({asset:o})=>{let n=o.logoURI||Dn(o.symbol),e=co.default.useMemo(()=>{if(!o.price)return null;let l=parseFloat(o.balance)/10**o.decimals,t=parseFloat(o.price);return`$${(l*t).toFixed(2)}`},[o.balance,o.decimals,o.price]);return(0,N.jsxs)("div",{role:"listitem",className:i("luno:flex luno:items-center luno:justify-between luno:p-2.5 luno:rounded-assetSelectItem luno:cursor-default","luno:bg-assetSelectItemBackground","luno:transition-colors luno:duration-200"),children:[(0,N.jsxs)("div",{className:"luno:flex luno:items-center luno:gap-2",children:[(0,N.jsx)(K,{className:"luno:w-[30px] luno:h-[30px] luno:flex luno:items-center luno:justify-center",iconUrl:n,resourceName:`${o.symbol}-token`}),(0,N.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-start",children:[(0,N.jsx)("span",{className:"luno:font-medium luno:text-sm luno:leading-sm luno:text-modalText",children:o.symbol||"Unknown"}),(0,N.jsx)("span",{className:"luno:text-xs luno:text-modalTextSecondary luno:font-medium luno:whitespace-nowrap",children:o.balanceFormatted})]})]}),o.price&&(0,N.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-end",children:[(0,N.jsx)("span",{className:"luno:font-medium luno:text-sm luno:leading-sm luno:text-modalText",children:e}),(0,N.jsxs)("span",{className:"luno:text-xs luno:text-modalTextSecondary luno:font-medium luno:whitespace-nowrap",children:["$",o.price]})]})]})});var J=require("react/jsx-runtime");var On=[{key:"Tokens",label:"Tokens"},{key:"NFTs",label:"NFTs"}],De=()=>{let[o,n]=(0,Ee.useState)("Tokens");return(0,J.jsxs)("div",{className:i("luno:flex luno:flex-col luno:gap-3.5 luno:p-4 luno:pt-0"),children:[(0,J.jsx)("div",{className:i("luno:flex luno:items-center luno:gap-1.5 luno:w-full"),children:On.map(e=>(0,J.jsx)("button",{onClick:()=>n(e.key),className:i("luno:px-3.5 luno:flex luno:items-center luno:justify-center luno:cursor-pointer luno:min-w-[48px] luno:min-h-[24px] luno:rounded-networkSelectItem luno:text-[12px] luno:leading-[16px] luno:font-medium luno:transition-colors",o===e.key?"luno:bg-navigationButtonBackground luno:text-modalText":"luno:bg-transparent text-modalTextSecondary luno:hover:text-modalText"),children:e.label},e.key))}),(0,J.jsx)("div",{className:i("luno:overflow-y-auto luno:flex-1 luno:min-h-[350px] luno:max-h-[350px]"),children:o==="Tokens"?(0,J.jsx)(Le,{}):(0,J.jsx)(Be,{})})]})};var me=require("react/jsx-runtime"),Po=()=>(0,me.jsx)("div",{className:"luno:relative",children:(0,me.jsx)(De,{})});Po.title="View Assets";var _=require("@luno-kit/react"),Oe=require("@luno-kit/react/utils"),He=require("react");var h=require("react/jsx-runtime"),Fe=({onViewChange:o,onModalClose:n})=>{let{address:e}=(0,_.useAccount)(),{chain:l}=(0,_.useChain)(),t=(0,_.useChains)(),{disconnectAsync:r}=(0,_.useDisconnect)(),{data:s}=(0,_.useBalance)({address:t.length>0?e:void 0}),u=(0,_.useConfig)(),{refetch:m}=so(),p=(0,He.useMemo)(()=>{let d={key:"Chain Name",content:(0,h.jsxs)("div",{className:"luno:flex luno:items-stretch luno:w-full luno:justify-between",children:[(0,h.jsxs)("div",{className:"luno:flex luno:items-center luno:gap-2",children:[(0,h.jsx)("div",{className:"luno:relative",children:(0,h.jsx)(K,{className:"luno:w-[24px] luno:h-[24px]",iconUrl:l?.chainIconUrl,resourceName:`${l?.name}-chain`})}),(0,h.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-start",children:[(0,h.jsx)("span",{className:"luno:text-base luno:leading-base luno:text-modalText",children:l?.name||"Polkadot"}),s?(0,h.jsxs)("span",{className:"luno:text-modalTextSecondary luno:text-xs luno:leading-xs",children:[s.formattedTransferable||"0.00"," ",l?.nativeCurrency?.symbol||"DOT"]}):(0,h.jsx)("span",{className:"luno:animate-pulse luno:rounded luno:w-[80px] luno:h-[16px] luno:bg-skeleton"})]})]}),(0,h.jsx)("div",{className:"luno:flex luno:items-center luno:justify-center",children:(0,h.jsx)(Go,{className:"luno:w-[16px] luno:h-[16px] luno:text-modalTextSecondary"})})]}),onClick:()=>o("switchChain")},a={key:"Switch Account",content:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ae,{className:"luno:w-[24px] luno:h-[24px]"}),(0,h.jsx)("span",{className:"luno:text-base luno:text-accountActionItemText",children:"Switch Account"})]}),onClick:()=>o("switchAccount")},c={key:"View Assets",content:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(zo,{className:"luno:w-[24px] luno:h-[24px]"}),(0,h.jsx)("span",{className:"luno:text-base luno:text-accountActionItemText",children:"View Assets"})]}),onClick:()=>{o("assetList"),m()}},g={key:"View on Explorer",content:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(oe,{className:"luno:w-[24px] luno:h-[24px]"}),(0,h.jsx)("span",{className:"luno:text-base luno:text-accountActionItemText luno:font-medium",children:"View on Explorer"})]}),onClick:()=>window.open((0,Oe.getExplorerUrl)(l?.blockExplorers?.default?.url,e,"address"))};return t.length===0?[a]:u?.subscan?.apiKey?[d,g,c,a]:[d,g,a]},[o,l,e,s,t,u]),f=async()=>{await r(),n()};return(0,h.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:gap-3 luno:w-full",children:[(0,h.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5 luno:w-full luno:px-4",children:p.map(d=>(0,h.jsx)(_e,{onClick:d.onClick,children:d.content},d.key))}),(0,h.jsx)("div",{className:"luno:w-full luno:mx-[-100px] luno:h-[1px] luno:bg-separatorLine"}),(0,h.jsx)("div",{className:"luno:w-full luno:px-4 luno:pb-4",children:(0,h.jsxs)(_e,{onClick:f,children:[(0,h.jsx)(qo,{}),(0,h.jsx)("span",{className:"luno:text-base luno:text-accountActionItemText ",children:"Disconnect"})]})})]})},_e=({children:o,onClick:n})=>(0,h.jsx)("button",{type:"button",onClick:()=>n?.(),className:i("luno:w-full luno:p-2.5 luno:rounded-accountActionItem luno:border-none luno:text-left luno:flex luno:items-center luno:gap-2 luno:font-medium","luno:bg-accountActionItemBackground luno:hover:bg-accountActionItemBackgroundHover","luno:transition-colors luno:duration-200",n?"luno:cursor-pointer":"luno:cursor-auto"),"aria-label":typeof o=="string"?o:void 0,children:o});var O=require("@luno-kit/react"),Ge=require("@luno-kit/react/utils"),Ro=j(require("react"),1);var V=require("react/jsx-runtime"),Bo=({onBack:o})=>{let{accounts:n,selectAccount:e}=(0,O.useAccounts)(),{address:l}=(0,O.useAccount)(),t=(0,Ro.useCallback)(r=>{e(r),o()},[o]);return(0,V.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5 luno:overflow-auto luno:max-h-[400px] luno:no-scrollbar luno:p-4 luno:pt-0",children:n.map(r=>(0,V.jsx)(Hn,{account:r,isSelected:r.address===l,selectAccount:t},r.address))})};Bo.title="Switch Account";var Hn=Ro.default.memo(({isSelected:o,account:n,selectAccount:e})=>{let{chain:l}=(0,O.useChain)(),t=(0,O.useChains)(),r=n.address,{data:s}=(0,O.useBalance)({address:t.length>0?r:void 0}),u=(0,O.useActiveConnector)();return(0,V.jsxs)("button",{type:"button",onClick:()=>e(n),className:i("luno:px-3.5 luno:py-2.5 luno:w-full luno:rounded-accountSelectItem luno:border-none","luno:bg-accountSelectItemBackground","luno:text-left luno:flex luno:items-center luno:justify-between luno:gap-2","luno:transition-colors luno:duration-200",o?"luno:cursor-auto":"luno:cursor-pointer luno:hover:bg-accountSelectItemBackgroundHover"),"aria-label":n.name||r,disabled:o,children:[(0,V.jsxs)("div",{className:"luno:flex luno:items-center luno:gap-2 luno:grow luno:overflow-hidden",children:[(0,V.jsx)("div",{className:"luno:shrink-0 luno:w-[24px] luno:h-[24px] luno:rounded-full luno:flex luno:items-center luno:justify-center",children:u?.icon&&(0,V.jsx)("img",{src:u?.icon,alt:"luno account"})}),(0,V.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-start luno:overflow-hidden",children:[(0,V.jsx)("span",{className:"luno:whitespace-nowrap luno:max-w-full luno:text-ellipsis luno:overflow-hidden luno:font-medium luno:text-sm luno:leading-sm luno:text-accountSelectItemText",children:n.name||(0,Ge.formatAddress)(r)}),t.length>0&&(s?(0,V.jsxs)("span",{className:"luno:text-xs luno:text-modalTextSecondary luno:font-medium",children:[s?.formattedTransferable||"0.00"," ",l?.nativeCurrency?.symbol||"DOT"]}):(0,V.jsx)("span",{className:"luno:animate-pulse luno:rounded luno:w-[60px] luno:h-[16px] luno:bg-skeleton"}))]})]}),o&&(0,V.jsx)("div",{className:"luno:shrink-0 luno:border-[1px] luno:border-solid luno:border-accentColor luno:rounded-full luno:overflow-hidden luno:flex luno:items-center luno:justify-center luno:w-[18px] luno:h-[18px]",children:(0,V.jsx)("div",{className:"luno:rounded-full luno:bg-accentColor luno:w-[10px] luno:h-[10px]"})})]})});var X=require("@luno-kit/react"),oo=j(require("react"),1);var w=require("react/jsx-runtime"),Lo=({onChainSwitched:o,className:n=""})=>{let{chain:e}=(0,X.useChain)(),l=(0,X.useChains)(),{switchChainAsync:t}=(0,X.useSwitchChain)(),{isApiReady:r,apiError:s}=(0,X.useApi)(),[u,m]=(0,oo.useState)(null),[p,f]=(0,oo.useState)(""),d=(0,oo.useMemo)(()=>l.filter(c=>p.trim()?c.name.toLowerCase().includes(p.toLowerCase()):!0),[l,p]),a=async c=>{if(c.genesisHash!==e?.genesisHash&&!(!r&&!s)){m(c.genesisHash);try{await t({chainId:c.genesisHash}),o?.(c)}catch(g){console.error("Failed to switch chain:",g)}finally{m(null)}}};return(0,w.jsxs)("div",{className:i("luno:flex luno:flex-col luno:gap-3.5",n),children:[(0,w.jsx)("div",{className:"luno:relative luno:pt-1",children:(0,w.jsxs)("div",{className:"luno:relative",children:[(0,w.jsx)(ne,{className:"luno:absolute luno:left-3 luno:top-1/2 luno:transform luno:-translate-y-1/2 luno:w-4 luno:h-4 luno:text-modalTextSecondary"}),(0,w.jsx)("input",{type:"text",placeholder:"Search by name",value:p,onChange:c=>f(c.target.value),className:"luno:w-full luno:pl-10 luno:pr-3 luno:py-2 luno:text-sm luno:border luno:border-networkSelectItemBackgroundHover luno:rounded-md luno:focus:ring-2 luno:focus:ring-accentColor luno:focus:outline-none luno:focus:border-transparent"})]})}),d.length>0&&(0,w.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5 luno:overflow-y-auto luno:max-h-[380px]",children:d.map(c=>(0,w.jsx)(Fn,{chain:c,isSelected:c.genesisHash===e?.genesisHash,onSelect:a,isLoading:(u===c.genesisHash||!r)&&!s,isSwitching:u===c.genesisHash},c.genesisHash))}),d.length===0&&(0,w.jsx)("div",{className:"luno:flex luno:items-center luno:justify-center luno:py-12",children:(0,w.jsx)("span",{className:"luno:text-modalTextSecondary luno:text-xs",children:"No chains available"})})]})},Fn=oo.default.memo(({chain:o,isSelected:n,isLoading:e,onSelect:l,isSwitching:t})=>(0,w.jsxs)("button",{onClick:()=>l(o),disabled:n||e,className:i("luno:flex luno:items-center luno:justify-between luno:p-2.5 luno:rounded-networkSelectItem","luno:bg-networkSelectItemBackground","luno:transition-colors luno:duration-200",n||e?"luno:cursor-default":"luno:cursor-pointer luno:hover:bg-networkSelectItemBackgroundHover",e&&"luno:opacity-80"),children:[(0,w.jsxs)("div",{className:"luno:flex luno:items-center luno:gap-2",children:[(0,w.jsx)(K,{className:"luno:w-[20px] luno:h-[20px] luno:flex luno:items-center luno:justify-center luno:leading-[20px]",iconUrl:o?.chainIconUrl,resourceName:`${o?.name}-chain`}),(0,w.jsx)("div",{className:"luno:flex luno:flex-col luno:items-start",children:(0,w.jsx)("span",{className:"luno:font-medium luno:text-base luno:text-modalText",children:o.name})})]}),(0,w.jsx)("div",{className:"luno:flex luno:items-center luno:justify-center luno:h-[20px]",children:n?e?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{className:"luno:text-accentColor luno:text-xs luno:leading-xs luno:mr-1.5",children:t?"Switching":"Connecting"}),(0,w.jsx)("div",{className:"loading luno:text-accentColor luno:w-[15px] luno:h-[15px]"})]}):(0,w.jsxs)("span",{className:"luno:relative luno:flex luno:w-[10px] luno:h-[10px]",children:[(0,w.jsx)("span",{className:"luno:[animation:ping_1.2s_cubic-bezier(0,0,0.2,1)_infinite] luno:absolute luno:top-[0] luno:left-[0] luno:inline-flex luno:h-full luno:w-full luno:rounded-full luno:bg-accentColor"}),(0,w.jsx)("span",{className:"luno:relative luno:inline-flex luno:rounded-full luno:h-full luno:w-full luno:bg-accentColor"})]}):null})]}));var $e=require("react/jsx-runtime"),Eo=({onBack:o})=>(0,$e.jsx)(Lo,{className:"luno:p-4 luno:pt-0"});Eo.title="Select Networks";var v=require("react/jsx-runtime");var Te=()=>{let{isOpen:o,close:n}=to(),{address:e,account:l}=(0,Do.useAccount)(),t=(0,Do.useActiveConnector)(),{currentView:r,containerRef:s,currentViewRef:u,handleViewChange:m,resetView:p}=So({initialView:"main"}),f=(0,Co.useCallback)(()=>{n(),p()},[n]),d=(0,Co.useMemo)(()=>r==="switchAccount"?Bo.title:r==="switchChain"?Eo.title:r==="assetList"?Po.title:null,[r]),a=(0,Co.useMemo)(()=>({main:(0,v.jsx)(Fe,{onViewChange:m,onModalClose:f}),switchAccount:(0,v.jsx)(Bo,{onBack:()=>m("main")}),switchChain:(0,v.jsx)(Eo,{onBack:()=>m("main")}),assetList:(0,v.jsx)(Po,{})}),[m,f]);return(0,v.jsx)(ro,{open:o,onOpenChange:f,children:(0,v.jsxs)("div",{className:i("luno:flex luno:flex-col luno:w-full luno:md:w-[360px] luno:max-h-[512px] luno:text-modalText","luno:bg-modalBackground luno:shadow-modal",r==="main"?"luno:gap-5":"luno:gap-3.5"),children:[(0,v.jsxs)("div",{className:i("luno:flex luno:items-stretch luno:justify-between luno:w-full luno:px-4 luno:pt-4"),children:[r==="main"?(0,v.jsxs)("div",{className:i("luno:flex luno:items-center luno:gap-3 luno:max-w-[80%]"),children:[t?.icon&&(0,v.jsx)("div",{className:i("luno:flex luno:items-center luno:justify-center luno:w-[40px] luno:h-[40px] luno:shrink-0"),children:(0,v.jsx)("img",{src:t.icon,alt:"luno",className:i("luno:w-full luno:h-full luno:object-contain")})}),(0,v.jsxs)("div",{className:i("luno:flex luno:flex-col luno:items-start luno:gap-1.5 luno:max-w-full"),children:[(0,v.jsx)(q,{className:"luno:sr-only",children:"Account Details"}),(0,v.jsxs)("div",{className:i("luno:flex luno:items-center luno:gap-0.5 luno:w-full"),children:[(0,v.jsx)("span",{className:i("luno:text-base luno:text-modalText luno:font-semibold"),children:(0,Ze.formatAddress)(e)}),(0,v.jsx)(Ao,{copyText:e})]}),(0,v.jsx)("div",{className:i("luno:text-sm luno:leading-sm luno:text-modalTextSecondary luno:font-medium luno:text-ellipsis luno:overflow-hidden luno:whitespace-nowrap",l?.name&&l?.name.length>30?"luno:w-[90%]":""),children:l?.name||t?.name})]})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("button",{className:i("luno:flex luno:items-center luno:justify-center luno:w-[30px] luno:h-[30px] luno:cursor-pointer luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200"),onClick:()=>m("main"),"aria-label":"Back",children:(0,v.jsx)(mo,{})}),(0,v.jsx)(q,{className:i("luno:text-lg luno:leading-lg luno:text-modalText luno:font-semibold luno:transition-opacity luno:duration-300"),children:d})]}),(0,v.jsx)(Q,{className:i("luno:shrink-0 luno:z-10 luno:flex luno:items-center luno:justify-center luno:h-[30px] luno:w-[30px] luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200 luno:cursor-pointer"),children:(0,v.jsx)(Z,{})})]}),(0,v.jsx)("div",{ref:s,className:i("luno:relative"),children:(0,v.jsx)("div",{ref:u,children:a[r]})})]})})};var $=require("react/jsx-runtime"),Ae=()=>{let{isOpen:o,close:n}=lo();return(0,$.jsx)(ro,{open:o,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)("div",{className:"luno:flex luno:flex-col luno:w-full luno:md:w-[360px] luno:max-h-[512px] luno:p-4 luno:gap-3.5 luno:text-modalText",children:[(0,$.jsxs)("div",{className:"luno:flex luno:items-center luno:justify-between luno:w-full",children:[(0,$.jsx)("div",{className:"luno:w-[30px]"})," ",(0,$.jsx)(q,{className:"luno:text-lg luno:leading-lg luno:text-modalText luno:font-semibold luno:transition-opacity luno:duration-300",children:"Select Network"}),(0,$.jsx)(Q,{className:"luno:z-10 luno:flex luno:items-center luno:justify-center luno:h-[30px] luno:w-[30px] luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200 luno:cursor-pointer",children:(0,$.jsx)(Z,{})})]}),(0,$.jsx)(Lo,{})]})})};var Ue=require("@luno-kit/react/utils");var T=require("@luno-kit/react");function ze(){let o=(0,T.useStatus)(),{account:n,address:e}=(0,T.useAccount)(),{chain:l}=(0,T.useChain)(),t=(0,T.useChains)(),{data:r}=(0,T.useBalance)({address:t.length>0?e:void 0}),s=(0,T.useActiveConnector)(),{open:u,isOpen:m}=no(),{open:p,isOpen:f}=to(),{open:d,isOpen:a}=lo(),c=o===T.ConnectionStatus.Connecting,g=o===T.ConnectionStatus.Connected,y=o===T.ConnectionStatus.Disconnected||o===T.ConnectionStatus.Disconnecting,F=!!l&&t.some(B=>B.genesisHash.toLowerCase()===l.genesisHash.toLowerCase());return{activeConnector:s,connectionStatus:o,isConnected:g,isDisconnected:y,isConnecting:c,account:n,address:e,currentChain:l,configuredChains:t,isChainSupported:F,chainIconUrl:l?.chainIconUrl,chainName:l?.name,balance:r,openConnectModal:u,openAccountModal:p,openChainModal:d,isConnectModalOpen:m,isAccountModalOpen:f,isChainModalOpen:a}}var _o=require("react");var Oo=()=>{let[o,n]=(0,_o.useState)({height:void 0,width:void 0});return(0,_o.useEffect)(()=>{let e=Pe(()=>{n({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),o};var A=require("react/jsx-runtime"),bo="luno:transition-transform luno:transition-[125] luno:hover:scale-[1.03] luno:transition-ease",je=({className:o,label:n="Connect Wallet",accountStatus:e="full",chainStatus:l="full",showBalance:t=!0,displayPreference:r="address"})=>{let{isConnected:s,isDisconnected:u,account:m,balance:p,openConnectModal:f,openAccountModal:d,openChainModal:a,chainIconUrl:c,chainName:g,currentChain:y,configuredChains:F,activeConnector:B}=ze(),{width:L}=Oo(),M=L&&L>768;return u||!s||!B?(0,A.jsx)("button",{type:"button",onClick:()=>f?.(),className:i("luno:cursor-pointer luno:font-semibold luno:inline-flex luno:items-center luno:justify-center luno:focus:outline-none","luno:text-connectButtonText luno:bg-connectButtonBackground luno:shadow-button luno:active:scale-[0.95]","luno:rounded-connectButton",bo,"luno:px-3.5 luno:text-base luno:leading-base luno:min-h-[40px]",o),children:n}):(0,A.jsxs)("div",{className:i("luno:text-modalText luno:flex luno:items-stretch luno:bg-transparent luno:font-semibold luno:text-base luno:leading-base luno:gap-3",o),children:[l!=="none"&&F.length>0&&(0,A.jsxs)("button",{type:"button",onClick:()=>a?.(),className:i("luno:flex luno:items-center luno:rounded-currentNetworkButton luno:cursor-pointer","luno:bg-currentNetworkButtonBackground luno:shadow-button","luno:py-2 luno:px-2.5 luno:gap-1.5",bo),"aria-label":"Switch chain",children:[l==="full"||l==="icon"?(0,A.jsx)(K,{iconUrl:c,resourceName:`${g}-chain`,className:i("luno:w-[24px] luno:h-[24px]")}):null,(l==="full"||l==="name")&&M&&(0,A.jsx)("span",{children:y?.name||"Unknown Chain"})]}),(0,A.jsxs)("button",{type:"button",onClick:()=>d?.(),className:i("luno:flex luno:items-center luno:cursor-pointer luno:rounded-connectButton luno:bg-connectButtonBackground luno:shadow-button",bo),"aria-label":"Open account modal",children:[F.length>0&&t&&M&&(0,A.jsx)("div",{className:i("luno:p-2 luno:pl-3"),children:p?(0,A.jsxs)("span",{children:[p?.formattedTransferable||p?.formattedTotal||0," ",y?.nativeCurrency?.symbol||""]}):(0,A.jsx)("span",{className:i("luno:block luno:animate-pulse luno:rounded luno:w-[80px] luno:h-[20px] luno:bg-accountActionItemBackgroundHover")})}),(0,A.jsxs)("div",{className:i("luno:flex luno:items-center luno:overflow-hidden luno:bg-connectButtonInnerBackground luno:border-2 luno:border-connectButtonBackground luno:rounded-connectButton luno:gap-1.5 luno:max-h-[40px]",F.length>0&&t&&M?"luno:bg-connectButtonInnerBackground luno:py-1.5 luno:px-2":"luno:bg-connectButtonBackground luno:py-2 luno:px-2.5"),children:[e==="full"&&(0,A.jsx)("span",{className:i("luno:w-[24px] luno:h-[24px] luno:flex luno:items-center luno:justify-center"),children:(0,A.jsx)("img",{src:B.icon,alt:"luno account"})}),(0,A.jsx)("span",{className:i(r==="name"&&m?.name?"luno:text-ellipsis luno:overflow-hidden luno:max-w-[115px] luno:whitespace-nowrap":""),children:r==="name"&&m?.name?m?.name:(0,Ue.formatAddress)(m?.address)})]})]})]})};var nn=require("@luno-kit/react"),tn=require("@luno-kit/react/utils"),eo=require("react");var Qe=require("@luno-kit/react"),qe=require("@luno-kit/react/utils"),yo=j(require("react"),1);var R=require("react/jsx-runtime"),Gn=["polkadot-js","subwallet-js","talisman","walletconnect","nova","nova-mobile"],$n=["polkagate","fearless-wallet","mimir","enkrypt"],Ke=yo.default.memo(({onConnect:o})=>{let n=(0,Qe.useConnectors)(),e=n.filter(s=>s.isInstalled()),l=n.filter(s=>Gn.includes(s.id)&&!s.isInstalled()),t=n.filter(s=>$n.includes(s.id)&&!s.isInstalled()),r=(0,yo.useMemo)(()=>[{title:"Installed",group:e},{title:"Popular",group:l},{title:"More",group:t}],[e,l,t]);if((0,qe.isMobileDevice)()){let s=n.filter(u=>u.links.deepLink);return(0,R.jsx)("div",{className:"luno:flex luno:flex-col luno:items-start luno:gap-1 luno:w-full",children:s.map(u=>(0,R.jsx)(We,{connector:u,onConnect:()=>o(u)},`${u.id}-${u.name}`))})}return(0,R.jsx)("div",{className:"luno:flex luno:flex-col luno:items-start luno:gap-4 luno:w-full luno:overflow-y-auto luno:max-h-[400px]",children:r.map(s=>s.group.length===0?null:(0,R.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-start luno:gap-2 luno:w-full",children:[(0,R.jsx)("div",{className:i("luno:text-sm luno:font-semibold luno:leading-base",s.title==="Installed"?"luno:text-accentColor":"luno:text-modalTextSecondary"),children:s.title}),(0,R.jsx)("div",{className:"luno:flex luno:flex-col luno:items-start luno:gap-1.5 luno:w-full",children:s.group.map(u=>(0,R.jsx)(We,{connector:u,onConnect:()=>o(u)},u.id))})]},s.title))})}),We=yo.default.memo(({connector:o,onConnect:n})=>(0,R.jsxs)("button",{onClick:n,className:i("luno:cursor-pointer luno:bg-walletSelectItemBackground luno:p-2 luno:w-full luno:flex luno:items-center luno:gap-3 luno:rounded-walletSelectItem luno:border-none","luno:hover:bg-walletSelectItemBackgroundHover luno:transition-transform luno:active:scale-[0.95]","luno:text-left"),children:[(0,R.jsx)("div",{className:"luno:w-[28px] luno:h-[28px] luno:rounded-[6px] luno:overflow-hidden",children:(0,R.jsx)("img",{src:o.icon,alt:o.name,className:"luno:w-full luno:h-full"})}),(0,R.jsx)("span",{className:"luno:font-semibold luno:leading-base luno:text-base luno:text-modalText",children:o.name})]}));var en=j(require("react"),1);var Je=require("cuer"),H=require("react/jsx-runtime"),Xe=({logoBackground:o,uri:n,size:e})=>{if(!n){let r=Math.floor(14.25),s=e/57,u=r*s,m=Math.ceil(57/2-r/2),p=m+r,f=()=>{let c=[];for(let g=0;g<57;g++)for(let y=0;y<57;y++){if(g>=m&&g<p&&y>=m&&y<p||g<8&&y<8||g<8&&y>=49||g>=49&&y<8)continue;let B=y+.5,L=g+.5;c.push((0,H.jsx)("rect",{x:B-.4,y:L-.4,width:.8,height:.8,rx:.4,fill:"var(--color-walletSelectItemBackground)"},`${g}-${y}`))}return c},d=({position:c})=>{let g=7*s,y={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0}};return(0,H.jsxs)("div",{className:"luno:absolute luno:z-[4]",style:{width:`${g}px`,height:`${g}px`,...y[c]},children:[(0,H.jsx)("div",{className:"luno:absolute luno:inset-0",style:{borderRadius:`${2*s}px`,border:`${s}px solid var(--color-walletSelectItemBackground)`}}),(0,H.jsx)("div",{className:"luno:absolute luno:left-1/2 luno:top-1/2 luno:-translate-x-1/2 luno:-translate-y-1/2",style:{width:`${3*s}px`,height:`${3*s}px`,borderRadius:`${.5*s}px`,backgroundColor:"var(--color-walletSelectItemBackground)"}})]})},a=()=>{let c=m*s;return(0,H.jsx)("div",{className:"luno:absolute luno:z-[4] luno:flex luno:items-center luno:justify-center luno:box-border",style:{width:`${u}px`,height:`${u}px`,left:`${c}px`,top:`${c}px`,borderRadius:`${s}px`,padding:`${s/2}px`},children:(0,H.jsx)("img",{src:o,alt:"QR Code Logo",className:"luno:h-full luno:w-full luno:object-cover",style:{borderRadius:`${s}px`}})})};return(0,H.jsxs)("div",{className:"luno:relative luno:overflow-hidden luno:flex luno:items-center luno:justify-center",style:{width:e,height:e,borderRadius:`${2*s}px`},children:[(0,H.jsx)("svg",{className:"luno:absolute luno:inset-0 luno:z-[3]",width:e,height:e,viewBox:"0 0 57 57",children:f()}),(0,H.jsx)("div",{className:"luno:absolute luno:inset-0 luno:z-[100]",style:{background:"linear-gradient(90deg, transparent 50%, var(--color-walletSelectItemBackgroundHover), transparent)",backgroundSize:"200% 100%",transform:"scale(1.5) rotate(45deg)",animation:"shimmer 1000ms linear infinite both"}}),d({position:"top-left"}),d({position:"top-right"}),d({position:"bottom-left"}),o&&a()]})}return(0,H.jsx)(Je.Cuer,{arena:o,value:n})};var Ho=require("react");var on=require("react/jsx-runtime"),Ye=({size:o=160,dotCount:n=300,duration:e=3,className:l=""})=>{let t=(0,Ho.useRef)(null);return(0,Ho.useEffect)(()=>{if(!t.current)return;let r=1,s=2,u=Math.PI*(3-Math.sqrt(5)),m=o/2,p=m-s-r,f="http://www.w3.org/2000/svg";t.current.innerHTML="";let d=document.createElementNS(f,"svg");d.setAttribute("width",o.toString()),d.setAttribute("height",o.toString()),d.setAttribute("viewBox",`0 0 ${o} ${o}`),d.style.display="block",t.current.appendChild(d);for(let a=0;a<n;a++){let c=a+.5,g=c/n,y=Math.sqrt(g)*p,F=c*u,B=m+y*Math.cos(F),L=m+y*Math.sin(F),M=document.createElementNS(f,"circle");M.setAttribute("cx",B.toString()),M.setAttribute("cy",L.toString()),M.setAttribute("r",r.toString()),M.setAttribute("fill","currentColor"),M.setAttribute("opacity","0.6"),d.appendChild(M);let P=document.createElementNS(f,"animate");P.setAttribute("attributeName","r"),P.setAttribute("values",`${r*.5};${r*1.8};${r*.5}`),P.setAttribute("dur",`${e}s`),P.setAttribute("begin",`${g*e}s`),P.setAttribute("repeatCount","indefinite"),P.setAttribute("calcMode","spline"),P.setAttribute("keySplines","0.4 0 0.6 1;0.4 0 0.6 1"),M.appendChild(P);let E=document.createElementNS(f,"animate");E.setAttribute("attributeName","opacity"),E.setAttribute("values","0.2;1;0.2"),E.setAttribute("dur",`${e}s`),E.setAttribute("begin",`${g*e}s`),E.setAttribute("repeatCount","indefinite"),E.setAttribute("calcMode","spline"),E.setAttribute("keySplines","0.4 0 0.6 1;0.4 0 0.6 1"),M.appendChild(E)}},[o,n,e]),(0,on.jsx)("div",{ref:t,className:i("luno:text-accentColor luno:inline-flex luno:w-full luno:h-full luno:justify-center luno:align-center",l)})};var x=require("react/jsx-runtime"),pe=en.default.memo(({selectedConnector:o,onConnect:n,qrCode:e,isWide:l,connectState:t})=>{let r=o?.hasConnectionUri();return(0,x.jsxs)("div",{className:i("luno:flex luno:flex-col luno:items-center",l?"luno:w-[450px] luno:p-4 luno:min-h-[472px]":"luno:justify-center luno:w-full luno:min-h-[400px]"),children:[l&&(0,x.jsx)("div",{className:"luno:w-full",children:(0,x.jsxs)("div",{className:"luno:flex luno:items-center luno:justify-between",children:[(0,x.jsx)("div",{}),(0,x.jsx)(Q,{className:"luno:z-10 luno:w-[30px] luno:h-[30px] luno:flex luno:items-center luno:justify-center luno:cursor-pointer luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200",children:(0,x.jsx)(Z,{})})]})}),(0,x.jsx)("div",{className:i("luno:flex luno:items-center luno:gap-4 luno:flex-col luno:grow luno:justify-center",o&&r?"luno:max-w-[300px]":"luno:max-w-[360px]"),children:o?r?(0,x.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:gap-2.5",children:[(0,x.jsx)(Xe,{size:300,logoBackground:o.icon,uri:e}),(0,x.jsxs)("div",{className:"luno:text-base luno:leading-base luno:font-medium luno:text-center luno:text-modalTextSecondary",children:["Scan the QR code with"," ",o.id==="nova"?"the Nova":"your phone"]}),(0,x.jsx)("div",{className:"luno:min-h-[20px] luno:flex luno:items-center luno:justify-center",children:o.links?.browserExtension?(0,x.jsxs)("div",{onClick:()=>window.open(o.links.browserExtension),className:"luno:cursor-pointer luno:text-sm luno:text-accentColor luno:font-medium luno:text-center luno:hover:text-modalText",children:["Don't have ",o.name,"?"]}):e?(0,x.jsx)(Ao,{className:"luno:text-sm luno:leading-sm luno:font-medium luno:text-accentColor",copyText:e,label:"Copy Link"}):null})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"luno:w-[80px] luno:h-[80px]",children:(0,x.jsx)("img",{src:o.icon,className:"luno:w-full luno:h-full",alt:""})}),(0,x.jsxs)("p",{className:"luno:text-lg luno:leading-lg luno:text-modalFont luno:font-bold",children:["Opening ",o.name,"..."]}),(0,x.jsx)("p",{className:"luno:pb-[10px] luno:text-base luno:text-modalTextSecondary luno:leading-base luno:font-medium luno:text-center",children:"Confirm connection in the extension"}),t.isConnecting&&(0,x.jsx)("div",{className:"loading luno:text-modalText luno:w-[24px]"}),!o.isInstalled()&&o.links.browserExtension&&(0,x.jsxs)("div",{onClick:()=>window.open(o.links.browserExtension),className:"luno:cursor-pointer luno:pt-6 luno:text-sm luno:text-accentColor luno:font-medium luno:text-center luno:hover:text-modalText",children:["Don\u2018t have ",o.name,"?"]}),!t.isConnecting&&t.isError&&o.isInstalled()&&(0,x.jsx)("button",{className:i("luno:rounded-connectButton luno:focus:outline-none luno:py-[4px] luno:px-[12px] luno:cursor-pointer luno:font-semibold luno:text-sm luno:text-modalText luno:bg-connectButtonBackground luno:shadow-connectButton luno:active:scale-[0.95]",bo),onClick:()=>n(o),children:"Retry"})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"luno:w-[160px] luno:h-[160px] luno:mb-4",children:(0,x.jsx)(Ye,{})}),(0,x.jsx)("div",{className:"luno:cursor-pointer luno:text-base luno:leading-base luno:text-accentColor luno:font-semibold luno:text-center",onClick:()=>window.open("https://polkadot.com/get-started/wallets/"),children:"New to wallets?"}),(0,x.jsx)("p",{className:"luno:text-modalTextSecondary luno:w-[250px] luno:text-sm luno:leading-sm luno:font-medium luno:text-center",children:"Connect your wallet to start exploring and interacting with DApps."})]})}),(0,x.jsx)("div",{})]})});var b=require("react/jsx-runtime");var Me=({size:o="wide"})=>{let{isOpen:n,close:e}=no(),{connectAsync:l,reset:t,isPending:r,isError:s}=(0,nn.useConnect)(),[u,m]=(0,eo.useState)(null),[p,f]=(0,eo.useState)(),{width:d}=Oo(),a=d&&d>768,c=!!(o==="wide"&&a),{containerRef:g,currentViewRef:y,resetView:F,handleViewChange:B,currentView:L}=So({initialView:"Connect Wallet"}),M=async G=>{let fe=await G.getConnectionUri();f(fe)},P=async G=>{if((0,tn.isMobileDevice)()&&G.links.deepLink)try{await l({connectorId:G.id}),E(!1);return}catch{window.location.href=`${G.links.deepLink}?url=${window.location.href}`;return}!c&&B("walletView"),m(G),f(void 0),G.hasConnectionUri()&&M(G),await l({connectorId:G.id}),E(!1)},E=G=>{!G&&e(),t(),F(),m(null),f(void 0)},ln=(0,eo.useMemo)(()=>({"Connect Wallet":(0,b.jsx)(Ke,{onConnect:P}),walletView:(0,b.jsx)(pe,{connectState:{isConnecting:r,isError:s},isWide:c,selectedConnector:u,qrCode:p,onConnect:P})}),[c,u,p,P,r,s]);return(0,eo.useEffect)(()=>{c&&L==="walletView"&&B("Connect Wallet")},[c,L]),(0,b.jsx)(ro,{open:n,onOpenChange:E,children:(0,b.jsxs)("div",{className:i("luno:flex luno:items-stretch luno:justify-between luno:w-full luno:md:max-h-[504px] luno:md:max-w-[724px]"),children:[(0,b.jsxs)("div",{className:i("luno:flex luno:flex-col luno:items-start luno:py-4 luno:px-5 luno:w-full luno:md:w-auto",c?"luno:md:min-w-[300px] luno:border-r-[1px] luno:border-r-solid luno:border-r-separatorLine":"luno:md:min-w-[360px]"),children:[(0,b.jsxs)("div",{className:i("luno:flex luno:items-center luno:justify-between luno:w-full",!c&&"luno:pb-4"),children:[L==="Connect Wallet"?(0,b.jsxs)(b.Fragment,{children:[!c&&(0,b.jsx)("div",{className:i("luno:w-[30px] luno:h-[30px]"),"aria-hidden":!0}),(0,b.jsx)(q,{className:i("luno:text-lg luno:leading-lg luno:text-modalText luno:font-bold",c?"luno:pb-6":"luno:flex-1 luno:text-center"),children:"Connect Wallet"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{className:i("luno:flex luno:items-center luno:justify-center luno:w-[30px] luno:h-[30px] luno:cursor-pointer luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200"),onClick:()=>B("Connect Wallet"),"aria-label":"Back",children:(0,b.jsx)(mo,{})}),(0,b.jsx)(q,{className:i("luno:text-lg luno:leading-lg luno:text-modalText luno:font-semibold luno:transition-opacity luno:duration-300"),children:u?.name})]}),!c&&(0,b.jsx)(Q,{className:"luno:z-10 luno:w-[30px] luno:h-[30px] luno:flex luno:items-center luno:justify-center luno:cursor-pointer luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200",children:(0,b.jsx)(Z,{})})]}),(0,b.jsx)("div",{ref:g,className:i("luno:relative luno:overflow-hidden luno:w-full"),children:(0,b.jsx)("div",{ref:y,children:ln[L]})}),!c&&L==="Connect Wallet"&&(0,b.jsx)("p",{className:"luno:cursor-pointer luno:w-full luno:pt-4 luno:text-sm luno:leading-sm luno:text-accentColor luno:font-medium luno:text-center luno:hover:text-modalText",onClick:()=>window.open("https://polkadot.com/get-started/wallets/"),children:"New to wallets?"})]}),c&&(0,b.jsx)(pe,{connectState:{isConnecting:r,isError:s},isWide:c,selectedConnector:u,qrCode:p,onConnect:P})]})})};0&&(module.exports={ConnectButton,LunoKitProvider,useAccountModal,useChainModal,useCloseAllModals,useConnectModal,useLunoTheme});
|
|
2
|
+
"use strict";var rn=Object.create;var No=Object.defineProperty;var an=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var un=Object.getPrototypeOf,cn=Object.prototype.hasOwnProperty;var dn=(o,n)=>{for(var e in n)No(o,e,{get:n[e],enumerable:!0})},he=(o,n,e,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of sn(n))!cn.call(o,t)&&t!==e&&No(o,t,{get:()=>n[t],enumerable:!(l=an(n,t))||l.enumerable});return o};var j=(o,n,e)=>(e=o!=null?rn(un(o)):{},he(n||!o||!o.__esModule?No(e,"default",{value:o,enumerable:!0}):e,o)),mn=o=>he(No({},"__esModule",{value:!0}),o);var Zn={};dn(Zn,{ConnectButton:()=>je,LunoKitProvider:()=>Mn,useAccountModal:()=>to,useChainModal:()=>lo,useCloseAllModals:()=>ye,useConnectModal:()=>no,useLunoTheme:()=>ce});module.exports=mn(Zn);var Do=require("@luno-kit/react"),Ze=require("@luno-kit/react/utils"),Co=require("react");var Fo=require("react/jsx-runtime"),pn=o=>(0,Fo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"arrow_svg__icon",viewBox:"0 0 256 256",width:"20",height:"20",fill:"currentColor",...o,children:(0,Fo.jsx)("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"})}),Go=pn;var $o=require("react/jsx-runtime"),fn=o=>(0,$o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",viewBox:"0 0 256 256",...o,children:(0,$o.jsx)("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"})}),mo=fn;var Zo=require("react/jsx-runtime"),hn=o=>(0,Zo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",viewBox:"0 0 256 256",...o,children:(0,Zo.jsx)("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"})}),Z=hn;var W=require("react/jsx-runtime"),xn=o=>(0,W.jsxs)("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13294",width:"100%",height:"100%",...o,children:[(0,W.jsx)("path",{d:"M170.837333 263.338667c-55.893333 25.173333-74.837333 53.333333-74.837333 72.661333 0 19.328 18.944 47.488 74.837333 72.661333 52.906667 23.808 128.256 39.338667 213.162667 39.338667 84.906667 0 160.256-15.530667 213.12-39.338667 55.893333-25.173333 74.88-53.333333 74.88-72.661333 0-19.328-18.944-47.488-74.88-72.661333C544.213333 239.573333 468.906667 224 384 224c-84.906667 0-160.256 15.573333-213.162667 39.338667zM144.64 205.013333C207.530667 176.64 292.181333 160 384 160c91.818667 0 176.469333 16.682667 239.402667 45.013333 59.904 26.922667 112.597333 70.826667 112.597333 130.986667s-52.693333 104.021333-112.597333 130.986667C560.469333 495.36 475.818667 512 384 512c-91.818667 0-176.469333-16.682667-239.402667-45.013333C84.693333 440.021333 32 396.16 32 336s52.693333-104.064 112.597333-130.986667z",fill:"currentColor","p-id":"13295"}),(0,W.jsx)("path",{d:"M64 304a32 32 0 0 1 32 32v160c0 19.370667 18.944 47.530667 74.837333 72.661333 52.906667 23.808 128.213333 39.338667 213.162667 39.338667 84.949333 0 160.298667-15.530667 213.162667-39.338667 55.893333-25.173333 74.837333-53.290667 74.837333-72.661333v-160a32 32 0 0 1 64 0v160c0 60.245333-52.650667 104.106667-112.554667 131.029333-62.933333 28.330667-147.626667 44.970667-239.445333 44.970667-91.861333 0-176.512-16.64-239.445333-44.970667C84.650667 600.064 32 556.202667 32 496v-160a32 32 0 0 1 32-32z",fill:"currentColor","p-id":"13296"}),(0,W.jsx)("path",{d:"M256 436.010667a32 32 0 0 1 32 32v160a32 32 0 0 1-64 0v-160a32 32 0 0 1 32-32zM672.128 383.829333a32 32 0 0 1 34.858667-28.885333c75.946667 7.082667 144.469333 25.813333 195.072 53.333333 48.810667 26.581333 89.941333 66.773333 89.941333 119.722667 0 60.245333-52.650667 104.106667-112.554667 131.029333-62.933333 28.288-147.626667 44.970667-239.445333 44.970667-81.621333 0-157.482667-13.269333-217.173333-35.626667a32 32 0 1 1 22.4-59.946666c51.456 19.242667 119.594667 31.573333 194.773333 31.573333 84.949333 0 160.256-15.530667 213.162667-39.338667 55.893333-25.173333 74.837333-53.290667 74.837333-72.661333 0-16.64-13.866667-40.277333-56.533333-63.488-40.96-22.272-100.437333-39.338667-170.453334-45.866667a32 32 0 0 1-28.885333-34.816z",fill:"currentColor","p-id":"13297"}),(0,W.jsx)("path",{d:"M960 496a32 32 0 0 1 32 32v160c0 60.245333-52.650667 104.106667-112.554667 131.029333-62.933333 28.288-147.626667 44.970667-239.445333 44.970667-91.861333 0-176.512-16.64-239.445333-44.970667-59.904-26.965333-112.554667-70.826667-112.554667-131.029333v-50.773333a32 32 0 0 1 64 0v50.773333c0 19.370667 18.944 47.530667 74.837333 72.661333 52.906667 23.808 128.213333 39.338667 213.162667 39.338667 84.949333 0 160.298667-15.530667 213.162667-39.338667 55.893333-25.173333 74.837333-53.290667 74.837333-72.661333v-160a32 32 0 0 1 32-32z",fill:"currentColor","p-id":"13298"}),(0,W.jsx)("path",{d:"M768 628.010667a32 32 0 0 1 32 32v160a32 32 0 0 1-64 0v-160a32 32 0 0 1 32-32zM512 436.010667a32 32 0 0 1 32 32v352a32 32 0 0 1-64 0v-352a32 32 0 0 1 32-32z",fill:"currentColor","p-id":"13299"})]}),zo=xn;var Uo=require("react/jsx-runtime"),gn=o=>(0,Uo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"copy_svg__icon",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 256 256",...o,children:(0,Uo.jsx)("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"})}),jo=gn;var po=require("react/jsx-runtime"),vn=o=>(0,po.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",version:"1.1","p-id":"8135",width:"256",height:"256",...o,children:[(0,po.jsx)("path",{d:"M512 64L126.26 286.74l-2.26 1.31v448L512 960l385.74-222.74L900 736V288z m353.3 652L512 920 158.7 716V308L512 104l353.3 204z","p-id":"8136",fill:"currentColor"}),(0,po.jsx)("path",{d:"M314.55 589.97l-79.49-272.91-27.3 15.82v358.24l34.65 20.05V466.46l85.64 294.07 21.15 12.19V251.18l-34.65 20.05v318.74zM403.1 803.85l34.65 20.05V529.33h186.88v-34.66H437.75v-244.5l74.05-45.03 124.92 79.79 18.64-29.22-143.16-91.37-109.1 66.29v573.22zM724.36 338.72v405.49l34.66-20.05V360.28l60.24 37.38v-40.8l-149.2-92.79-18.33 29.42 72.63 45.23z","p-id":"8137",fill:"currentColor"})]}),Wo=vn;var Qo=require("react/jsx-runtime"),wn=o=>(0,Qo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 256 256",width:"20",height:"20",...o,children:(0,Qo.jsx)("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"})}),qo=wn;var fo=require("react/jsx-runtime"),Cn=o=>(0,fo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 38 38",fill:"none",...o,children:[(0,fo.jsx)("path",{d:"M18.273 1.51489L3.90896 10.5424C2.41176 11.443 1.77589 12.1511 2.00136 12.6666H29.374L24.7431 3.04502C23.4245 0.849886 20.52 0.163352 18.273 1.51489ZM16.3185 12.54L6.91729 10.8844L19.5776 3.68595C20.5998 3.07162 21.9184 3.38322 22.5188 4.38262L25.8084 10.8844L16.3185 12.54Z",fill:"currentColor"}),(0,fo.jsx)("path",{d:"M31.9757 10.1333H6.02426C3.401 10.1333 1.26666 12.217 1.26666 14.7782V33.3551C1.26666 35.9163 3.401 38 6.02426 38H31.9757C34.599 38 36.7333 35.9163 36.7333 33.3551V14.7782C36.7333 12.217 34.599 10.1333 31.9757 10.1333ZM34.1379 27.0218H24.624C22.9545 27.0218 21.5967 25.6956 21.5967 24.0666C21.5967 22.4377 22.9545 21.1115 24.624 21.1115H34.1392V27.0218H34.1379ZM34.1379 18.5782H24.624C21.5219 18.5782 19 21.0393 19 24.0666C19 27.094 21.5219 29.5551 24.6227 29.5551H34.1379V33.3551C34.1379 34.5204 33.1677 35.4666 31.9757 35.4666H6.02426C4.83233 35.4666 3.86206 34.5204 3.86206 33.3551V14.7782C3.86206 13.6128 4.83233 12.6666 6.02426 12.6666H31.9757C33.1677 12.6666 34.1379 13.6128 34.1379 14.7782V18.5782ZM23.3257 24.0666C23.3257 24.9989 24.0996 25.7551 25.0547 25.7551C26.011 25.7551 26.7849 24.9989 26.7849 24.0666C26.7849 23.1344 26.011 22.3782 25.0547 22.3782C24.0996 22.3782 23.3257 23.1344 23.3257 24.0666Z",fill:"currentColor"})]}),Ko=Cn;var Jo=require("react/jsx-runtime"),bn=o=>(0,Jo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",fill:"none",...o,children:(0,Jo.jsx)("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z",fill:"currentColor"})}),Xo=bn;var Yo=require("react/jsx-runtime"),yn=o=>(0,Yo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"list_svg__icon",viewBox:"0 0 256 256",width:"20",height:"20",fill:"currentColor",...o,children:(0,Yo.jsx)("path",{d:"M232,48V88a8,8,0,0,1-16,0V56H184a8,8,0,0,1,0-16h40A8,8,0,0,1,232,48ZM72,200H40V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16Zm152-40a8,8,0,0,0-8,8v32H184a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,224,160ZM32,96a8,8,0,0,0,8-8V56H72a8,8,0,0,0,0-16H32a8,8,0,0,0-8,8V88A8,8,0,0,0,32,96ZM188,167l-56,32a8,8,0,0,1-7.94,0L68,167A8,8,0,0,1,64,160V96a8,8,0,0,1,4-7l56-32a8,8,0,0,1,7.94,0l56,32a8,8,0,0,1,4,7v64A8,8,0,0,1,188,167ZM88.12,96,128,118.79,167.88,96,128,73.21ZM80,155.36l40,22.85V132.64L80,109.79Zm96,0V109.79l-40,22.85v45.57Z"})}),oe=yn;var ee=require("react/jsx-runtime"),Nn=o=>(0,ee.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"search_svg__icon",viewBox:"0 0 256 256",width:"20",height:"20",fill:"currentColor",...o,children:(0,ee.jsx)("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"})}),ne=Nn;var te=require("react/jsx-runtime"),Sn=o=>(0,te.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"success_svg__icon",viewBox:"0 0 256 256",width:"20",height:"20",fill:"currentColor",...o,children:(0,te.jsx)("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"})}),le=Sn;var re=require("react/jsx-runtime"),kn=o=>(0,re.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",className:"switch_svg__icon",viewBox:"0 0 256 256",fill:"currentColor",...o,children:(0,re.jsx)("path",{d:"M253.66,133.66l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L216,132.69V128A88,88,0,0,0,56.49,76.67a8,8,0,0,1-13-9.34A104,104,0,0,1,232,128v4.69l10.34-10.35a8,8,0,0,1,11.32,11.32Zm-41.18,55A104,104,0,0,1,24,128v-4.69L13.66,133.66A8,8,0,0,1,2.34,122.34l24-24a8,8,0,0,1,11.32,0l24,24a8,8,0,0,1-11.32,11.32L40,123.31V128a87.62,87.62,0,0,0,22.24,58.41A79.66,79.66,0,0,1,98.3,157.66a48,48,0,1,1,59.4,0,79.59,79.59,0,0,1,36.08,28.78,89.68,89.68,0,0,0,5.71-7.11,8,8,0,0,1,13,9.34ZM128,152a32,32,0,1,0-32-32A32,32,0,0,0,128,152Zm0,64a88.2,88.2,0,0,0,53.92-18.49,64,64,0,0,0-107.84,0A87.57,87.57,0,0,0,128,216Z"})}),ae=kn;var z=require("react");function So({initialView:o,animationDuration:n=200,animationEasing:e="ease-out"}){let[l,t]=(0,z.useState)(o),[r,s]=(0,z.useState)(!1),u=(0,z.useRef)(null),m=(0,z.useRef)(null),p=(0,z.useCallback)(d=>{if(d===l||r)return;if(s(!0),!u.current){t(d),s(!1);return}let a=u.current,c=a.offsetHeight;t(d),requestAnimationFrame(()=>{if(!a||!m.current){s(!1);return}let g=m.current.offsetHeight;a.animate([{height:`${c}px`},{height:`${g}px`}],{duration:n,easing:e,fill:"forwards"}).addEventListener("finish",()=>{s(!1)})})},[l,r,n,e]),f=(0,z.useCallback)(()=>{t(o),s(!1)},[o]);return{currentView:l,isAnimating:r,containerRef:u,currentViewRef:m,handleViewChange:p,resetView:f}}var S=require("react");var ge=require("react"),xe=["--color-accentColor","--color-walletSelectItemBackground","--color-walletSelectItemBackgroundHover","--color-walletSelectItemText","--color-connectButtonBackground","--color-connectButtonInnerBackground","--color-connectButtonText","--color-accountActionItemBackground","--color-accountActionItemBackgroundHover","--color-accountActionItemText","--color-accountSelectItemBackground","--color-accountSelectItemBackgroundHover","--color-accountSelectItemText","--color-currentNetworkButtonBackground","--color-currentNetworkButtonText","--color-networkSelectItemBackground","--color-networkSelectItemBackgroundHover","--color-networkSelectItemText","--color-assetSelectItemBackground","--color-navigationButtonBackground","--color-separatorLine","--color-modalBackground","--color-modalBackdrop","--color-modalBorder","--color-modalText","--color-modalTextSecondary","--color-modalControlButtonBackgroundHover","--color-modalControlButtonText","--color-success","--color-successForeground","--color-warning","--color-warningForeground","--color-error","--color-errorForeground","--color-info","--color-infoForeground","--color-skeleton","--color-defaultIconBackground","--font-body","--radius-walletSelectItem","--radius-connectButton","--radius-modalControlButton","--radius-accountActionItem","--radius-accountSelectItem","--radius-currentNetworkButton","--radius-networkSelectItem","--radius-assetSelectItem","--radius-modal","--radius-modalMobile","--shadow-button","--shadow-modal","--blur-modalOverlay"],ve=(o,n)=>{(0,ge.useEffect)(()=>{if(typeof window>"u")return;let e=document.documentElement;o.type==="complete"&&o.completeTheme?(Object.entries(o.completeTheme.colors).forEach(([l,t])=>{t&&e.style.setProperty(`--color-${l}`,t)}),Object.entries(o.completeTheme.fonts).forEach(([l,t])=>{t&&e.style.setProperty(`--font-${l}`,t)}),Object.entries(o.completeTheme.radii).forEach(([l,t])=>{t&&e.style.setProperty(`--radius-${l}`,t)}),Object.entries(o.completeTheme.shadows).forEach(([l,t])=>{t&&e.style.setProperty(`--shadow-${l}`,t)}),Object.entries(o.completeTheme.blurs).forEach(([l,t])=>{t&&e.style.setProperty(`--blur-${l}`,t)}),e.removeAttribute("data-theme")):o.type==="partial"&&o.partialOverrides?(e.setAttribute("data-theme",n),Object.keys(o.partialOverrides).length>0&&(xe.forEach(t=>{e.style.removeProperty(t)}),o.partialOverrides.colors&&Object.entries(o.partialOverrides.colors).forEach(([t,r])=>{r&&e.style.setProperty(`--color-${t}`,r)}),o.partialOverrides.fonts&&Object.entries(o.partialOverrides.fonts).forEach(([t,r])=>{r&&e.style.setProperty(`--font-${t}`,r)}),o.partialOverrides.radii&&Object.entries(o.partialOverrides.radii).forEach(([t,r])=>{r&&e.style.setProperty(`--radius-${t}`,r)}),o.partialOverrides.shadows&&Object.entries(o.partialOverrides.shadows).forEach(([t,r])=>{r&&e.style.setProperty(`--shadow-${t}`,r)}),o.partialOverrides.blurs&&Object.entries(o.partialOverrides.blurs).forEach(([t,r])=>{r&&e.style.setProperty(`--blur-${t}`,r)}))):(e.setAttribute("data-theme",n),xe.forEach(l=>{e.style.removeProperty(l)}))},[o,n])};var Ce=require("react/jsx-runtime"),ie="luno.lastThemePreference",Tn=o=>{try{localStorage.setItem(ie,JSON.stringify(o))}catch{}},we=(0,S.createContext)(void 0),se=o=>"colors"in o&&"fonts"in o&&"radii"in o&&"shadows"in o&&"blurs"in o,An=()=>{let[o,n]=(0,S.useState)(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return(0,S.useEffect)(()=>{if(typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),l=t=>{n(t.matches?"dark":"light")};return l(e),e.addEventListener("change",l),()=>e.removeEventListener("change",l)},[]),o},ue=({children:o,theme:n})=>{let e=An(),[l,t]=(0,S.useState)(()=>{if(typeof window<"u")try{let a=localStorage.getItem(ie);if(a){let c=JSON.parse(a);if(c?.isAuto)return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(c?.preferredTheme)return c.preferredTheme}}catch{}return!n||se(n)?"light":n.defaultMode||"light"}),[r,s]=(0,S.useState)(()=>{if(typeof window<"u")try{let a=localStorage.getItem(ie);if(a)return JSON.parse(a)?.isAuto??!1}catch{}return!n||se(n)?!1:n.autoMode??!1}),u=(0,S.useMemo)(()=>{if(!n)return{type:"default",completeTheme:null,partialOverrides:null};if(se(n))return{type:"complete",completeTheme:n,partialOverrides:null};let d=n;if(d.theme)return{type:"complete",completeTheme:d.theme,partialOverrides:null};let a=null;return l==="light"&&d.light?a=d.light:l==="dark"&&d.dark?a=d.dark:a={...d},{type:"partial",completeTheme:null,partialOverrides:a}},[l,n]),m=(0,S.useMemo)(()=>u.type==="complete"?u.completeTheme:null,[u]);ve(u,l);let p=(0,S.useCallback)(d=>{let a=d==="auto";s(a),t(a?e||"light":d);let c={isAuto:a,...a?{}:{preferredTheme:d}};Tn(c)},[e]);(0,S.useEffect)(()=>{r&&t(e||"light")},[e,r]);let f=(0,S.useMemo)(()=>({themeMode:l,setThemeChoice:p,currentTheme:m}),[l,p,m]);return(0,Ce.jsx)(we.Provider,{value:f,children:o})},ce=()=>{let o=(0,S.useContext)(we);if(!o)throw new Error("useLunoTheme must be used within a ThemeProvider (which is part of LunoKitProvider)");return o};var Se=require("@luno-kit/react"),ko=require("@tanstack/react-query"),ke=require("react");var Y=require("@luno-kit/react"),k=require("react"),Ne=require("react/jsx-runtime");function de(){let[o,n]=(0,k.useState)(!1),e=(0,k.useCallback)(()=>n(!0),[]),l=(0,k.useCallback)(()=>n(!1),[]);return{isOpen:o,open:e,close:l}}var ho=(0,k.createContext)(void 0),be=({children:o})=>{let{isOpen:n,open:e,close:l}=de(),{isOpen:t,open:r,close:s}=de(),{isOpen:u,open:m,close:p}=de(),f=(0,Y.useStatus)(),d=(0,k.useCallback)(()=>{l(),s(),p()},[l,s,p]);(0,k.useEffect)(()=>{f===Y.ConnectionStatus.Disconnected&&(s(),p())},[f,s,p]);let a=(0,k.useMemo)(()=>({isConnectModalOpen:n,isAccountModalOpen:t,isChainModalOpen:u,openConnectModal:f!==Y.ConnectionStatus.Connected?e:void 0,closeConnectModal:l,openAccountModal:f===Y.ConnectionStatus.Connected?r:void 0,closeAccountModal:s,openChainModal:f===Y.ConnectionStatus.Connected?m:void 0,closeChainModal:p,closeAllModals:d}),[n,e,l,t,r,s,u,m,p,d,f]);return(0,Ne.jsx)(ho.Provider,{value:a,children:o})},no=()=>{let o=(0,k.useContext)(ho);if(!o)throw new Error("[ModalContext]: useConnectModal must be used within a ModalProvider");return{isOpen:o.isConnectModalOpen,open:o.openConnectModal,close:o.closeConnectModal}},to=()=>{let o=(0,k.useContext)(ho);if(!o)throw new Error("[ModalContext]: useAccountModal must be used within a ModalProvider");return{isOpen:o.isAccountModalOpen,open:o.openAccountModal,close:o.closeAccountModal}},lo=()=>{let o=(0,k.useContext)(ho);if(!o)throw new Error("[ModalContext]: useChainModal must be used within a ModalProvider");return{isOpen:o.isChainModalOpen,open:o.openChainModal,close:o.closeChainModal}},ye=()=>{let o=(0,k.useContext)(ho);if(!o)throw new Error("[ModalContext]: useCloseAllModals must be used within a ModalProvider");return o.closeAllModals};var I=require("react/jsx-runtime"),Mn=({children:o,config:n,queryClientConfig:e,theme:l})=>{let[t]=(0,ke.useState)(()=>new ko.QueryClient(e));return(0,I.jsx)(ko.QueryClientProvider,{client:t,children:(0,I.jsx)(Se.LunoProvider,{config:n,children:(0,I.jsx)(ue,{theme:l,children:(0,I.jsxs)(be,{children:[(0,I.jsx)("div",{children:o}),(0,I.jsx)(In,{modalSize:n.modalSize})]})})})})},In=({modalSize:o})=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Me,{size:o}),(0,I.jsx)(Te,{}),(0,I.jsx)(Ae,{})]});var Ie=require("clsx"),Ve=require("tailwind-merge"),Vn=(0,Ve.extendTailwindMerge)({extend:{classGroups:{"font-size":["text-xs","text-sm","text-base","text-lg"]}}});function i(...o){return Vn((0,Ie.clsx)(o))}function Pe(o,n){let e;return()=>{e&&clearTimeout(e),e=setTimeout(()=>{e=null,o()},n)}}var To=require("react");var xo=require("react/jsx-runtime"),Ao=({copyText:o,label:n,className:e=""})=>{let[l,t]=(0,To.useState)(!1),r=(0,To.useCallback)(async s=>{try{return navigator.clipboard?.writeText?(await navigator.clipboard.writeText(s),t(!0),setTimeout(()=>t(!1),2e3),!0):!1}catch(u){return console.error("Copy failed:",u),!1}},[]);return(0,xo.jsxs)("button",{type:"button",className:i("luno:cursor-pointer luno:bg-transparent luno:border-none luno:p-1 luno:m-0 luno:inline-flex luno:items-center luno:justify-center luno:gap-1","luno:rounded-modalControlButton luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200",e),onClick:()=>!l&&o&&r(o),"aria-label":"Copy address to clipboard",disabled:l,children:[l?(0,xo.jsx)(le,{className:"luno:text-accentColor",width:16,height:16}):(0,xo.jsx)(jo,{width:16,height:16}),n]})};var D=j(require("@radix-ui/react-dialog"),1),Mo=j(require("react"),1);var go=require("react/jsx-runtime"),Pn=({open:o,onOpenChange:n,children:e,contentClassName:l,overlayClassName:t})=>(0,go.jsx)(D.Root,{open:o,onOpenChange:n,children:(0,go.jsxs)(D.Portal,{children:[Mo.default.createElement(D.Overlay,{className:i("luno:fixed luno:inset-0 luno:z-[100] luno:bg-modalBackdrop luno-kit","luno:data-[state=open]:[animation:overlay-in_150ms_ease-out]",t)}),(0,go.jsx)(D.Content,{className:i("luno-kit luno:font-body luno:fixed luno:z-[200] luno:text-modalText luno:text-base luno:leading-base","luno:bg-modalBackground luno:shadow-modal luno:focus:outline-none luno:overflow-hidden luno:border luno:border-modalBorder","luno:transition-all luno:duration-200","luno:rounded-t-modalMobile luno:bottom-0 luno:left-0 luno:w-full","luno:translate-y-0 luno:-translate-x-0","luno:data-[state=open]:[animation:slide-up_200ms_ease-out]","luno:md:bottom-auto luno:md:left-1/2 luno:md:top-1/2 luno:md:-translate-x-1/2 luno:md:-translate-y-1/2","luno:md:w-auto luno:md:rounded-modal","luno:md:data-[state=open]:[animation:dialog-in_150ms_ease-out]",l),children:e})]})}),Rn=({children:o,className:n})=>Mo.default.createElement(D.Title,{className:n},o),Bn=({children:o,className:n,onClick:e})=>Mo.default.createElement(D.Close,{className:n,onClick:e},o),ro=Pn,Q=Bn,q=Rn;var Ee=require("react");var Vo=require("@luno-kit/react"),U=j(require("react"),1);var ao=require("@luno-kit/react"),vo=require("@luno-kit/react/utils"),Re=require("@tanstack/react-query"),Ln=async({apiUrl:o,apiKey:n,address:e})=>{try{let l=await fetch(`${o}/api/scan/account/tokens`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":n},body:JSON.stringify({address:e})});if(!l.ok)throw new Error(`Subscan API error: ${l.status}`);let t=await l.json();if(t.code!==0)throw new Error(`Subscan API error: ${t.message}`);let r=t.data.assets||[],s=t.data.native||[],u=t.data.builtin||[],m=r.filter(a=>a.token_image||a.unique_id?.includes("nft")).map(a=>({balance:a.balance,decimals:a.decimals,balanceFormatted:(0,vo.formatBalance)(a.balance,a.decimals),logoURI:a.token_image,symbol:a.symbol,assetId:a.asset_id,price:a.price})),p=r.filter(a=>!a.token_image&&!a.unique_id?.includes("nft")).map(a=>({balance:a.balance,decimals:a.decimals,balanceFormatted:(0,vo.formatBalance)(a.balance,a.decimals,4),logoURI:a.token_image,symbol:a.symbol,assetId:a.asset_id,price:a.price})),f=s.map(a=>({balance:a.balance,decimals:a.decimals,balanceFormatted:(0,vo.formatBalance)(a.balance,a.decimals,4),logoURI:"",symbol:a.symbol,assetId:0,price:a.price})),d=u.map(a=>({balance:a.balance,decimals:a.decimals,balanceFormatted:(0,vo.formatBalance)(a.balance,a.decimals,4),logoURI:"",symbol:a.symbol,assetId:a.unique_id,price:a.price}));return{nfts:[...m],tokens:[...f,...p,...d]}}catch(l){throw console.error("Failed to fetch tokens from Subscan:",l),l}};function so(){let{address:o}=(0,ao.useAccount)(),n=(0,ao.useConfig)(),{chain:e}=(0,ao.useChain)(),l=e?.subscan?.api,t=n?.subscan?.apiKey;return(0,Re.useQuery)({queryKey:["subscan","asset-list",o,e?.genesisHash,l,t],queryFn:()=>Ln({address:o,apiKey:t,apiUrl:l}),enabled:!!o&&!!t&&!!l,staleTime:n?.subscan?.cacheTime||6e4})}var io=require("react/jsx-runtime"),Io=({type:o})=>(0,io.jsxs)("div",{className:"luno:flex luno:flex-col luno:gap-1 luno:items-center luno:justify-center luno:min-h-[300px] luno:text-center",children:[(0,io.jsx)(Ko,{className:"luno:w-[38px] luno:h-[38px] luno:mb-2"}),(0,io.jsxs)("div",{className:"luno:text-modalText luno:text-base luno:leading-base",children:["No ",o," found"]}),(0,io.jsx)("div",{className:"luno:text-sm luno:text-modalTextSecondary luno:max-w-[260px]",children:"Switch to a different network or account to view more assets"})]});var C=require("react/jsx-runtime"),Be=U.default.memo(()=>{let{data:o,isFetching:n,error:e}=so(),l=(0,U.useMemo)(()=>o?o.nfts:[],[o]);return n?(0,C.jsx)("div",{className:"luno:flex luno:justify-center luno:w-full",children:(0,C.jsx)("div",{className:"luno:flex luno:flex-wrap luno:justify-between luno:max-w-[350px] luno:w-full luno:min-h-[300px] luno:gap-y-4",children:[1,2,3,4].map(t=>(0,C.jsx)("div",{className:"luno:animate-pulse luno:bg-skeleton luno:w-[155px] luno:h-[198px] luno:rounded-assetSelectItem"},`skeleton-${t}`))})}):e?(0,C.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:justify-center luno:min-h-[300px] luno:text-center luno:p-4",children:[(0,C.jsx)("div",{className:"luno:text-error luno:mb-2",children:"Failed to load assets"}),(0,C.jsx)("div",{className:"luno:text-modalTextSecondary luno:text-sm",children:e instanceof Error?e.message:"Unknown error"})]}):l.length?(0,C.jsx)("div",{className:"luno:flex luno:justify-center luno:w-full",children:(0,C.jsx)("div",{className:"luno:flex luno:flex-wrap luno:justify-between luno:max-w-[350px] luno:w-full luno:gap-y-4",children:l.map(t=>(0,C.jsx)(En,{asset:t},`${t.symbol}-${t.balance}`))})}):(0,C.jsx)(Io,{type:"NFTs"})}),En=U.default.memo(({asset:o})=>{let{chain:n}=(0,Vo.useChain)(),{address:e}=(0,Vo.useAccount)(),[l,t]=(0,U.useState)(!!o.logoURI),[r,s]=(0,U.useState)(o.logoURI),u=(0,U.useMemo)(()=>n?.subscan?.url?`${n.subscan.url.endsWith("/")?n.subscan.url.slice(0,-1):n.subscan.url}/nft_item?collection_id=${o.assetId}&address=${e}`:"",[n,o,e]);return(0,C.jsx)("div",{className:i("luno:w-[155px] luno:h-[198px] luno:flex luno:items-center luno:p-2.5 luno:rounded-assetSelectItem luno:cursor-default","luno:bg-assetSelectItemBackground","luno:transition-colors luno:duration-200"),children:(0,C.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:justify-center",children:[(0,C.jsxs)("div",{className:"luno:relative luno:w-[135px] luno:h-[135px] luno:flex luno:items-center luno:justify-center luno:rounded-[6px] luno:overflow-hidden",children:[l&&(0,C.jsx)("div",{className:"luno:absolute luno:inset-0 luno:flex luno:items-center luno:justify-center luno:animate-pulse luno:bg-gray-500",children:(0,C.jsx)("div",{className:"luno:w-4 luno:h-4 luno:border-2 luno:border-t-transparent luno:border-white luno:rounded-full luno:animate-spin"})}),r?(0,C.jsx)("img",{src:r,alt:`${o.symbol}-NFT`,className:i("luno:w-full luno:h-full luno:object-cover",l?"luno:opacity-0":"luno:opacity-100 luno:transition-opacity luno:duration-200"),onLoad:()=>t(!1),onError:()=>{t(!1),s("")}}):(0,C.jsx)(Wo,{className:"luno:w-full luno:h-full luno:object-cover"})]}),(0,C.jsxs)("div",{className:"luno:flex luno:items-center luno:justify-between luno:w-full luno:mt-0.5",children:[(0,C.jsxs)("span",{className:"luno:font-medium luno:text-sm luno:leading-sm luno:text-modalText",children:[o.balance||"-"," NFTs"]}),(0,C.jsx)("button",{className:"luno:cursor-pointer luno:bg-transparent luno:border-none luno:p-1 luno:m-0 luno:inline-flex luno:items-center luno:justify-center luno:gap-1 luno:rounded-modalControlButton luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200",onClick:()=>u&&window.open(u),children:(0,C.jsx)(Xo,{})})]}),(0,C.jsx)("div",{className:"luno:w-full luno:text-left luno:text-xs luno:text-modalTextSecondary luno:font-medium luno:whitespace-nowrap luno:max-w-[135px] luno:overflow-hidden luno:text-ellipsis",children:o.symbol||o.assetId})]})})});var co=j(require("react"),1);var wo=require("react");var uo=require("react/jsx-runtime"),K=({iconUrl:o,resourceName:n,className:e})=>{let[l,t]=(0,wo.useState)(!!o),[r,s]=(0,wo.useState)(!1),u=(0,wo.useMemo)(()=>{if(!n)return"-";let m=n.match(/^([^-]+)-/);return m?.[1]?m[1].charAt(0).toUpperCase():n.charAt(0).toUpperCase()},[n]);return o&&!r?(0,uo.jsxs)("div",{className:i("luno:relative luno:w-full luno:h-full",e),children:[l&&(0,uo.jsx)("div",{className:"luno:absolute luno:inset-0 luno:flex luno:items-center luno:justify-center luno:rounded-full luno:animate-pulse luno:bg-skeleton"}),(0,uo.jsx)("img",{src:o,alt:n||"icon",className:i("luno:w-full luno:h-full luno:object-cover luno:rounded-full",l?"luno:opacity-0":"luno:opacity-100 luno:transition-opacity luno:duration-200"),onLoad:()=>t(!1),onError:()=>{t(!1),s(!0)}})]}):(0,uo.jsx)("div",{className:i("luno:w-full luno:h-full luno:text-white luno:font-semibold","luno:flex luno:items-center luno:justify-center luno:rounded-full luno:bg-defaultIconBackground",e),children:u})};var N=require("react/jsx-runtime"),Dn=o=>`https://raw.githubusercontent.com/Luno-lab/luno-assets/refs/heads/main/assets/tokens/${o?.toLowerCase().trim()||""}.webp`,Le=co.default.memo(()=>{let{data:o,error:n,isFetching:e}=so(),l=(0,co.useMemo)(()=>o?[...o.tokens].sort((t,r)=>{let s=t.price?parseFloat(t.balance)/10**t.decimals*parseFloat(t.price):0;return(r.price?parseFloat(r.balance)/10**r.decimals*parseFloat(r.price):0)-s}):[],[o]);return e?(0,N.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5 luno:min-h-[300px]",children:[1,2,3,4,5].map(t=>(0,N.jsx)("div",{className:"luno:animate-pulse luno:bg-skeleton luno:h-[54px] luno:rounded-assetSelectItem"},`skeleton-${t}`))}):n?(0,N.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:justify-center luno:min-h-[300px] luno:text-center luno:p-4",children:[(0,N.jsx)("div",{className:"luno:text-error luno:mb-2",children:"Failed to load assets"}),(0,N.jsx)("div",{className:"luno:text-modalTextSecondary luno:text-sm",children:n instanceof Error?n.message:"Unknown error"})]}):l.length?(0,N.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5",children:l.map(t=>(0,N.jsx)(_n,{asset:t},`${t.symbol}-${t.assetId}`))}):(0,N.jsx)(Io,{type:"Tokens"})}),_n=co.default.memo(({asset:o})=>{let n=o.logoURI||Dn(o.symbol),e=co.default.useMemo(()=>{if(!o.price)return null;let l=parseFloat(o.balance)/10**o.decimals,t=parseFloat(o.price);return`$${(l*t).toFixed(2)}`},[o.balance,o.decimals,o.price]);return(0,N.jsxs)("div",{role:"listitem",className:i("luno:flex luno:items-center luno:justify-between luno:p-2.5 luno:rounded-assetSelectItem luno:cursor-default","luno:bg-assetSelectItemBackground","luno:transition-colors luno:duration-200"),children:[(0,N.jsxs)("div",{className:"luno:flex luno:items-center luno:gap-2",children:[(0,N.jsx)(K,{className:"luno:w-[30px] luno:h-[30px] luno:flex luno:items-center luno:justify-center",iconUrl:n,resourceName:`${o.symbol}-token`}),(0,N.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-start",children:[(0,N.jsx)("span",{className:"luno:font-medium luno:text-sm luno:leading-sm luno:text-modalText",children:o.symbol||"Unknown"}),(0,N.jsx)("span",{className:"luno:text-xs luno:text-modalTextSecondary luno:font-medium luno:whitespace-nowrap",children:o.balanceFormatted})]})]}),o.price&&(0,N.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-end",children:[(0,N.jsx)("span",{className:"luno:font-medium luno:text-sm luno:leading-sm luno:text-modalText",children:e}),(0,N.jsxs)("span",{className:"luno:text-xs luno:text-modalTextSecondary luno:font-medium luno:whitespace-nowrap",children:["$",o.price]})]})]})});var J=require("react/jsx-runtime");var On=[{key:"Tokens",label:"Tokens"},{key:"NFTs",label:"NFTs"}],De=()=>{let[o,n]=(0,Ee.useState)("Tokens");return(0,J.jsxs)("div",{className:i("luno:flex luno:flex-col luno:gap-3.5 luno:p-4 luno:pt-0"),children:[(0,J.jsx)("div",{className:i("luno:flex luno:items-center luno:gap-1.5 luno:w-full"),children:On.map(e=>(0,J.jsx)("button",{onClick:()=>n(e.key),className:i("luno:px-3.5 luno:flex luno:items-center luno:justify-center luno:cursor-pointer luno:min-w-[48px] luno:min-h-[24px] luno:rounded-networkSelectItem luno:text-[12px] luno:leading-[16px] luno:font-medium luno:transition-colors",o===e.key?"luno:bg-navigationButtonBackground luno:text-modalText":"luno:bg-transparent text-modalTextSecondary luno:hover:text-modalText"),children:e.label},e.key))}),(0,J.jsx)("div",{className:i("luno:overflow-y-auto luno:flex-1 luno:min-h-[350px] luno:max-h-[350px]"),children:o==="Tokens"?(0,J.jsx)(Le,{}):(0,J.jsx)(Be,{})})]})};var me=require("react/jsx-runtime"),Po=()=>(0,me.jsx)("div",{className:"luno:relative",children:(0,me.jsx)(De,{})});Po.title="View Assets";var _=require("@luno-kit/react"),Oe=require("@luno-kit/react/utils"),He=require("react");var h=require("react/jsx-runtime"),Fe=({onViewChange:o,onModalClose:n})=>{let{address:e}=(0,_.useAccount)(),{chain:l}=(0,_.useChain)(),t=(0,_.useChains)(),{disconnectAsync:r}=(0,_.useDisconnect)(),{data:s}=(0,_.useBalance)({address:t.length>0?e:void 0}),u=(0,_.useConfig)(),{refetch:m}=so(),p=(0,He.useMemo)(()=>{let d={key:"Chain Name",content:(0,h.jsxs)("div",{className:"luno:flex luno:items-stretch luno:w-full luno:justify-between",children:[(0,h.jsxs)("div",{className:"luno:flex luno:items-center luno:gap-2",children:[(0,h.jsx)("div",{className:"luno:relative",children:(0,h.jsx)(K,{className:"luno:w-[24px] luno:h-[24px]",iconUrl:l?.chainIconUrl,resourceName:`${l?.name}-chain`})}),(0,h.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-start",children:[(0,h.jsx)("span",{className:"luno:text-base luno:leading-base luno:text-modalText",children:l?.name||"Polkadot"}),s?(0,h.jsxs)("span",{className:"luno:text-modalTextSecondary luno:text-xs luno:leading-xs",children:[s.formattedTransferable||"0.00"," ",l?.nativeCurrency?.symbol||"DOT"]}):(0,h.jsx)("span",{className:"luno:animate-pulse luno:rounded luno:w-[80px] luno:h-[16px] luno:bg-skeleton"})]})]}),(0,h.jsx)("div",{className:"luno:flex luno:items-center luno:justify-center",children:(0,h.jsx)(Go,{className:"luno:w-[16px] luno:h-[16px] luno:text-modalTextSecondary"})})]}),onClick:()=>o("switchChain")},a={key:"Switch Account",content:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ae,{className:"luno:w-[24px] luno:h-[24px]"}),(0,h.jsx)("span",{className:"luno:text-base luno:text-accountActionItemText",children:"Switch Account"})]}),onClick:()=>o("switchAccount")},c={key:"View Assets",content:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(zo,{className:"luno:w-[24px] luno:h-[24px]"}),(0,h.jsx)("span",{className:"luno:text-base luno:text-accountActionItemText",children:"View Assets"})]}),onClick:()=>{o("assetList"),m()}},g={key:"View on Explorer",content:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(oe,{className:"luno:w-[24px] luno:h-[24px]"}),(0,h.jsx)("span",{className:"luno:text-base luno:text-accountActionItemText luno:font-medium",children:"View on Explorer"})]}),onClick:()=>window.open((0,Oe.getExplorerUrl)(l?.blockExplorers?.default?.url,e,"address"))};return t.length===0?[a]:u?.subscan?.apiKey?[d,g,c,a]:[d,g,a]},[o,l,e,s,t,u]),f=async()=>{await r(),n()};return(0,h.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:gap-3 luno:w-full",children:[(0,h.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5 luno:w-full luno:px-4",children:p.map(d=>(0,h.jsx)(_e,{onClick:d.onClick,children:d.content},d.key))}),(0,h.jsx)("div",{className:"luno:w-full luno:mx-[-100px] luno:h-[1px] luno:bg-separatorLine"}),(0,h.jsx)("div",{className:"luno:w-full luno:px-4 luno:pb-4",children:(0,h.jsxs)(_e,{onClick:f,children:[(0,h.jsx)(qo,{}),(0,h.jsx)("span",{className:"luno:text-base luno:text-accountActionItemText ",children:"Disconnect"})]})})]})},_e=({children:o,onClick:n})=>(0,h.jsx)("button",{type:"button",onClick:()=>n?.(),className:i("luno:w-full luno:p-2.5 luno:rounded-accountActionItem luno:border-none luno:text-left luno:flex luno:items-center luno:gap-2 luno:font-medium","luno:bg-accountActionItemBackground luno:hover:bg-accountActionItemBackgroundHover","luno:transition-colors luno:duration-200",n?"luno:cursor-pointer":"luno:cursor-auto"),"aria-label":typeof o=="string"?o:void 0,children:o});var O=require("@luno-kit/react"),Ge=require("@luno-kit/react/utils"),Ro=j(require("react"),1);var V=require("react/jsx-runtime"),Bo=({onBack:o})=>{let{accounts:n,selectAccount:e}=(0,O.useAccounts)(),{address:l}=(0,O.useAccount)(),t=(0,Ro.useCallback)(r=>{e(r),o()},[o]);return(0,V.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5 luno:overflow-auto luno:max-h-[400px] luno:no-scrollbar luno:p-4 luno:pt-0",children:n.map(r=>(0,V.jsx)(Hn,{account:r,isSelected:r.address===l,selectAccount:t},r.address))})};Bo.title="Switch Account";var Hn=Ro.default.memo(({isSelected:o,account:n,selectAccount:e})=>{let{chain:l}=(0,O.useChain)(),t=(0,O.useChains)(),r=n.address,{data:s}=(0,O.useBalance)({address:t.length>0?r:void 0}),u=(0,O.useActiveConnector)();return(0,V.jsxs)("button",{type:"button",onClick:()=>e(n),className:i("luno:px-3.5 luno:py-2.5 luno:w-full luno:rounded-accountSelectItem luno:border-none","luno:bg-accountSelectItemBackground","luno:text-left luno:flex luno:items-center luno:justify-between luno:gap-2","luno:transition-colors luno:duration-200",o?"luno:cursor-auto":"luno:cursor-pointer luno:hover:bg-accountSelectItemBackgroundHover"),"aria-label":n.name||r,disabled:o,children:[(0,V.jsxs)("div",{className:"luno:flex luno:items-center luno:gap-2 luno:grow luno:overflow-hidden",children:[(0,V.jsx)("div",{className:"luno:shrink-0 luno:w-[24px] luno:h-[24px] luno:rounded-full luno:flex luno:items-center luno:justify-center",children:u?.icon&&(0,V.jsx)("img",{src:u?.icon,alt:"luno account"})}),(0,V.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-start luno:overflow-hidden",children:[(0,V.jsx)("span",{className:"luno:whitespace-nowrap luno:max-w-full luno:text-ellipsis luno:overflow-hidden luno:font-medium luno:text-sm luno:leading-sm luno:text-accountSelectItemText",children:n.name||(0,Ge.formatAddress)(r)}),t.length>0&&(s?(0,V.jsxs)("span",{className:"luno:text-xs luno:text-modalTextSecondary luno:font-medium",children:[s?.formattedTransferable||"0.00"," ",l?.nativeCurrency?.symbol||"DOT"]}):(0,V.jsx)("span",{className:"luno:animate-pulse luno:rounded luno:w-[60px] luno:h-[16px] luno:bg-skeleton"}))]})]}),o&&(0,V.jsx)("div",{className:"luno:shrink-0 luno:border-[1px] luno:border-solid luno:border-accentColor luno:rounded-full luno:overflow-hidden luno:flex luno:items-center luno:justify-center luno:w-[18px] luno:h-[18px]",children:(0,V.jsx)("div",{className:"luno:rounded-full luno:bg-accentColor luno:w-[10px] luno:h-[10px]"})})]})});var X=require("@luno-kit/react"),oo=j(require("react"),1);var w=require("react/jsx-runtime"),Lo=({onChainSwitched:o,className:n=""})=>{let{chain:e}=(0,X.useChain)(),l=(0,X.useChains)(),{switchChainAsync:t}=(0,X.useSwitchChain)(),{isApiReady:r,apiError:s}=(0,X.useApi)(),[u,m]=(0,oo.useState)(null),[p,f]=(0,oo.useState)(""),d=(0,oo.useMemo)(()=>l.filter(c=>p.trim()?c.name.toLowerCase().includes(p.toLowerCase()):!0),[l,p]),a=async c=>{if(c.genesisHash!==e?.genesisHash&&!(!r&&!s)){m(c.genesisHash);try{await t({chainId:c.genesisHash}),o?.(c)}catch(g){console.error("Failed to switch chain:",g)}finally{m(null)}}};return(0,w.jsxs)("div",{className:i("luno:flex luno:flex-col luno:gap-3.5",n),children:[(0,w.jsx)("div",{className:"luno:relative luno:pt-1",children:(0,w.jsxs)("div",{className:"luno:relative",children:[(0,w.jsx)(ne,{className:"luno:absolute luno:left-3 luno:top-1/2 luno:transform luno:-translate-y-1/2 luno:w-4 luno:h-4 luno:text-modalTextSecondary"}),(0,w.jsx)("input",{type:"text",placeholder:"Search by name",value:p,onChange:c=>f(c.target.value),className:"luno:w-full luno:pl-10 luno:pr-3 luno:py-2 luno:text-sm luno:border luno:border-networkSelectItemBackgroundHover luno:rounded-md luno:focus:ring-2 luno:focus:ring-accentColor luno:focus:outline-none luno:focus:border-transparent"})]})}),d.length>0&&(0,w.jsx)("div",{className:"luno:flex luno:flex-col luno:gap-1.5 luno:overflow-y-auto luno:max-h-[380px]",children:d.map(c=>(0,w.jsx)(Fn,{chain:c,isSelected:c.genesisHash===e?.genesisHash,onSelect:a,isLoading:(u===c.genesisHash||!r)&&!s,isSwitching:u===c.genesisHash},c.genesisHash))}),d.length===0&&(0,w.jsx)("div",{className:"luno:flex luno:items-center luno:justify-center luno:py-12",children:(0,w.jsx)("span",{className:"luno:text-modalTextSecondary luno:text-xs",children:"No chains available"})})]})},Fn=oo.default.memo(({chain:o,isSelected:n,isLoading:e,onSelect:l,isSwitching:t})=>(0,w.jsxs)("button",{onClick:()=>l(o),disabled:n||e,className:i("luno:flex luno:items-center luno:justify-between luno:p-2.5 luno:rounded-networkSelectItem","luno:bg-networkSelectItemBackground","luno:transition-colors luno:duration-200",n||e?"luno:cursor-default":"luno:cursor-pointer luno:hover:bg-networkSelectItemBackgroundHover",e&&"luno:opacity-80"),children:[(0,w.jsxs)("div",{className:"luno:flex luno:items-center luno:gap-2",children:[(0,w.jsx)(K,{className:"luno:w-[20px] luno:h-[20px] luno:flex luno:items-center luno:justify-center luno:leading-[20px]",iconUrl:o?.chainIconUrl,resourceName:`${o?.name}-chain`}),(0,w.jsx)("div",{className:"luno:flex luno:flex-col luno:items-start",children:(0,w.jsx)("span",{className:"luno:font-medium luno:text-base luno:text-modalText",children:o.name})})]}),(0,w.jsx)("div",{className:"luno:flex luno:items-center luno:justify-center luno:h-[20px]",children:n?e?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{className:"luno:text-accentColor luno:text-xs luno:leading-xs luno:mr-1.5",children:t?"Switching":"Connecting"}),(0,w.jsx)("div",{className:"luno-loading luno:text-accentColor luno:w-[15px] luno:h-[15px]"})]}):(0,w.jsxs)("span",{className:"luno:relative luno:flex luno:w-[10px] luno:h-[10px]",children:[(0,w.jsx)("span",{className:"luno:[animation:ping_1.2s_cubic-bezier(0,0,0.2,1)_infinite] luno:absolute luno:top-[0] luno:left-[0] luno:inline-flex luno:h-full luno:w-full luno:rounded-full luno:bg-accentColor"}),(0,w.jsx)("span",{className:"luno:relative luno:inline-flex luno:rounded-full luno:h-full luno:w-full luno:bg-accentColor"})]}):null})]}));var $e=require("react/jsx-runtime"),Eo=({onBack:o})=>(0,$e.jsx)(Lo,{className:"luno:p-4 luno:pt-0"});Eo.title="Select Networks";var v=require("react/jsx-runtime");var Te=()=>{let{isOpen:o,close:n}=to(),{address:e,account:l}=(0,Do.useAccount)(),t=(0,Do.useActiveConnector)(),{currentView:r,containerRef:s,currentViewRef:u,handleViewChange:m,resetView:p}=So({initialView:"main"}),f=(0,Co.useCallback)(()=>{n(),p()},[n]),d=(0,Co.useMemo)(()=>r==="switchAccount"?Bo.title:r==="switchChain"?Eo.title:r==="assetList"?Po.title:null,[r]),a=(0,Co.useMemo)(()=>({main:(0,v.jsx)(Fe,{onViewChange:m,onModalClose:f}),switchAccount:(0,v.jsx)(Bo,{onBack:()=>m("main")}),switchChain:(0,v.jsx)(Eo,{onBack:()=>m("main")}),assetList:(0,v.jsx)(Po,{})}),[m,f]);return(0,v.jsx)(ro,{open:o,onOpenChange:f,children:(0,v.jsxs)("div",{className:i("luno:flex luno:flex-col luno:w-full luno:md:w-[360px] luno:max-h-[512px] luno:text-modalText","luno:bg-modalBackground luno:shadow-modal",r==="main"?"luno:gap-5":"luno:gap-3.5"),children:[(0,v.jsxs)("div",{className:i("luno:flex luno:items-stretch luno:justify-between luno:w-full luno:px-4 luno:pt-4"),children:[r==="main"?(0,v.jsxs)("div",{className:i("luno:flex luno:items-center luno:gap-3 luno:max-w-[80%]"),children:[t?.icon&&(0,v.jsx)("div",{className:i("luno:flex luno:items-center luno:justify-center luno:w-[40px] luno:h-[40px] luno:shrink-0"),children:(0,v.jsx)("img",{src:t.icon,alt:"luno",className:i("luno:w-full luno:h-full luno:object-contain")})}),(0,v.jsxs)("div",{className:i("luno:flex luno:flex-col luno:items-start luno:gap-1.5 luno:max-w-full"),children:[(0,v.jsx)(q,{className:"luno:sr-only",children:"Account Details"}),(0,v.jsxs)("div",{className:i("luno:flex luno:items-center luno:gap-0.5 luno:w-full"),children:[(0,v.jsx)("span",{className:i("luno:text-base luno:text-modalText luno:font-semibold"),children:(0,Ze.formatAddress)(e)}),(0,v.jsx)(Ao,{copyText:e})]}),(0,v.jsx)("div",{className:i("luno:text-sm luno:leading-sm luno:text-modalTextSecondary luno:font-medium luno:text-ellipsis luno:overflow-hidden luno:whitespace-nowrap",l?.name&&l?.name.length>30?"luno:w-[90%]":""),children:l?.name||t?.name})]})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("button",{className:i("luno:flex luno:items-center luno:justify-center luno:w-[30px] luno:h-[30px] luno:cursor-pointer luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200"),onClick:()=>m("main"),"aria-label":"Back",children:(0,v.jsx)(mo,{})}),(0,v.jsx)(q,{className:i("luno:text-lg luno:leading-lg luno:text-modalText luno:font-semibold luno:transition-opacity luno:duration-300"),children:d})]}),(0,v.jsx)(Q,{className:i("luno:shrink-0 luno:z-10 luno:flex luno:items-center luno:justify-center luno:h-[30px] luno:w-[30px] luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200 luno:cursor-pointer"),children:(0,v.jsx)(Z,{})})]}),(0,v.jsx)("div",{ref:s,className:i("luno:relative"),children:(0,v.jsx)("div",{ref:u,children:a[r]})})]})})};var $=require("react/jsx-runtime"),Ae=()=>{let{isOpen:o,close:n}=lo();return(0,$.jsx)(ro,{open:o,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)("div",{className:"luno:flex luno:flex-col luno:w-full luno:md:w-[360px] luno:max-h-[512px] luno:p-4 luno:gap-3.5 luno:text-modalText",children:[(0,$.jsxs)("div",{className:"luno:flex luno:items-center luno:justify-between luno:w-full",children:[(0,$.jsx)("div",{className:"luno:w-[30px]"})," ",(0,$.jsx)(q,{className:"luno:text-lg luno:leading-lg luno:text-modalText luno:font-semibold luno:transition-opacity luno:duration-300",children:"Select Network"}),(0,$.jsx)(Q,{className:"luno:z-10 luno:flex luno:items-center luno:justify-center luno:h-[30px] luno:w-[30px] luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200 luno:cursor-pointer",children:(0,$.jsx)(Z,{})})]}),(0,$.jsx)(Lo,{})]})})};var Ue=require("@luno-kit/react/utils");var T=require("@luno-kit/react");function ze(){let o=(0,T.useStatus)(),{account:n,address:e}=(0,T.useAccount)(),{chain:l}=(0,T.useChain)(),t=(0,T.useChains)(),{data:r}=(0,T.useBalance)({address:t.length>0?e:void 0}),s=(0,T.useActiveConnector)(),{open:u,isOpen:m}=no(),{open:p,isOpen:f}=to(),{open:d,isOpen:a}=lo(),c=o===T.ConnectionStatus.Connecting,g=o===T.ConnectionStatus.Connected,y=o===T.ConnectionStatus.Disconnected||o===T.ConnectionStatus.Disconnecting,F=!!l&&t.some(B=>B.genesisHash.toLowerCase()===l.genesisHash.toLowerCase());return{activeConnector:s,connectionStatus:o,isConnected:g,isDisconnected:y,isConnecting:c,account:n,address:e,currentChain:l,configuredChains:t,isChainSupported:F,chainIconUrl:l?.chainIconUrl,chainName:l?.name,balance:r,openConnectModal:u,openAccountModal:p,openChainModal:d,isConnectModalOpen:m,isAccountModalOpen:f,isChainModalOpen:a}}var _o=require("react");var Oo=()=>{let[o,n]=(0,_o.useState)({height:void 0,width:void 0});return(0,_o.useEffect)(()=>{let e=Pe(()=>{n({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),o};var A=require("react/jsx-runtime"),bo="luno:transition-transform luno:transition-[125] luno:hover:scale-[1.03] luno:transition-ease",je=({className:o,label:n="Connect Wallet",accountStatus:e="full",chainStatus:l="full",showBalance:t=!0,displayPreference:r="address"})=>{let{isConnected:s,isDisconnected:u,account:m,balance:p,openConnectModal:f,openAccountModal:d,openChainModal:a,chainIconUrl:c,chainName:g,currentChain:y,configuredChains:F,activeConnector:B}=ze(),{width:L}=Oo(),M=L&&L>768;return u||!s||!B?(0,A.jsx)("button",{type:"button",onClick:()=>f?.(),className:i("luno-kit luno:cursor-pointer luno:font-semibold luno:inline-flex luno:items-center luno:justify-center luno:focus:outline-none","luno:text-connectButtonText luno:bg-connectButtonBackground luno:shadow-button luno:active:scale-[0.95]","luno:rounded-connectButton",bo,"luno:px-3.5 luno:text-base luno:leading-base luno:min-h-[40px]",o),children:n}):(0,A.jsxs)("div",{className:i("luno-kit luno:text-modalText luno:flex luno:items-stretch luno:bg-transparent luno:font-semibold luno:text-base luno:leading-base luno:gap-3",o),children:[l!=="none"&&F.length>0&&(0,A.jsxs)("button",{type:"button",onClick:()=>a?.(),className:i("luno:flex luno:items-center luno:rounded-currentNetworkButton luno:cursor-pointer","luno:bg-currentNetworkButtonBackground luno:shadow-button","luno:py-2 luno:px-2.5 luno:gap-1.5",bo),"aria-label":"Switch chain",children:[l==="full"||l==="icon"?(0,A.jsx)(K,{iconUrl:c,resourceName:`${g}-chain`,className:i("luno:w-[24px] luno:h-[24px]")}):null,(l==="full"||l==="name")&&M&&(0,A.jsx)("span",{children:y?.name||"Unknown Chain"})]}),(0,A.jsxs)("button",{type:"button",onClick:()=>d?.(),className:i("luno:flex luno:items-center luno:cursor-pointer luno:rounded-connectButton luno:bg-connectButtonBackground luno:shadow-button",bo),"aria-label":"Open account modal",children:[F.length>0&&t&&M&&(0,A.jsx)("div",{className:i("luno:p-2 luno:pl-3"),children:p?(0,A.jsxs)("span",{children:[p?.formattedTransferable||p?.formattedTotal||0," ",y?.nativeCurrency?.symbol||""]}):(0,A.jsx)("span",{className:i("luno:block luno:animate-pulse luno:rounded luno:w-[80px] luno:h-[20px] luno:bg-accountActionItemBackgroundHover")})}),(0,A.jsxs)("div",{className:i("luno:flex luno:items-center luno:overflow-hidden luno:bg-connectButtonInnerBackground luno:border-2 luno:border-connectButtonBackground luno:rounded-connectButton luno:gap-1.5 luno:max-h-[40px]",F.length>0&&t&&M?"luno:bg-connectButtonInnerBackground luno:py-1.5 luno:px-2":"luno:bg-connectButtonBackground luno:py-2 luno:px-2.5"),children:[e==="full"&&(0,A.jsx)("span",{className:i("luno:w-[24px] luno:h-[24px] luno:flex luno:items-center luno:justify-center"),children:(0,A.jsx)("img",{src:B.icon,alt:"luno account"})}),(0,A.jsx)("span",{className:i(r==="name"&&m?.name?"luno:text-ellipsis luno:overflow-hidden luno:max-w-[115px] luno:whitespace-nowrap":""),children:r==="name"&&m?.name?m?.name:(0,Ue.formatAddress)(m?.address)})]})]})]})};var nn=require("@luno-kit/react"),tn=require("@luno-kit/react/utils"),eo=require("react");var Qe=require("@luno-kit/react"),qe=require("@luno-kit/react/utils"),yo=j(require("react"),1);var R=require("react/jsx-runtime"),Gn=["polkadot-js","subwallet-js","talisman","walletconnect","nova","nova-mobile"],$n=["polkagate","fearless-wallet","mimir","enkrypt"],Ke=yo.default.memo(({onConnect:o})=>{let n=(0,Qe.useConnectors)(),e=n.filter(s=>s.isInstalled()),l=n.filter(s=>Gn.includes(s.id)&&!s.isInstalled()),t=n.filter(s=>$n.includes(s.id)&&!s.isInstalled()),r=(0,yo.useMemo)(()=>[{title:"Installed",group:e},{title:"Popular",group:l},{title:"More",group:t}],[e,l,t]);if((0,qe.isMobileDevice)()){let s=n.filter(u=>u.links.deepLink);return(0,R.jsx)("div",{className:"luno:flex luno:flex-col luno:items-start luno:gap-1 luno:w-full",children:s.map(u=>(0,R.jsx)(We,{connector:u,onConnect:()=>o(u)},`${u.id}-${u.name}`))})}return(0,R.jsx)("div",{className:"luno:flex luno:flex-col luno:items-start luno:gap-4 luno:w-full luno:overflow-y-auto luno:max-h-[400px]",children:r.map(s=>s.group.length===0?null:(0,R.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-start luno:gap-2 luno:w-full",children:[(0,R.jsx)("div",{className:i("luno:text-sm luno:font-semibold luno:leading-base",s.title==="Installed"?"luno:text-accentColor":"luno:text-modalTextSecondary"),children:s.title}),(0,R.jsx)("div",{className:"luno:flex luno:flex-col luno:items-start luno:gap-1.5 luno:w-full",children:s.group.map(u=>(0,R.jsx)(We,{connector:u,onConnect:()=>o(u)},u.id))})]},s.title))})}),We=yo.default.memo(({connector:o,onConnect:n})=>(0,R.jsxs)("button",{onClick:n,className:i("luno:cursor-pointer luno:bg-walletSelectItemBackground luno:p-2 luno:w-full luno:flex luno:items-center luno:gap-3 luno:rounded-walletSelectItem luno:border-none","luno:hover:bg-walletSelectItemBackgroundHover luno:transition-transform luno:active:scale-[0.95]","luno:text-left"),children:[(0,R.jsx)("div",{className:"luno:w-[28px] luno:h-[28px] luno:rounded-[6px] luno:overflow-hidden",children:(0,R.jsx)("img",{src:o.icon,alt:o.name,className:"luno:w-full luno:h-full"})}),(0,R.jsx)("span",{className:"luno:font-semibold luno:leading-base luno:text-base luno:text-modalText",children:o.name})]}));var en=j(require("react"),1);var Je=require("cuer"),H=require("react/jsx-runtime"),Xe=({logoBackground:o,uri:n,size:e})=>{if(!n){let r=Math.floor(14.25),s=e/57,u=r*s,m=Math.ceil(57/2-r/2),p=m+r,f=()=>{let c=[];for(let g=0;g<57;g++)for(let y=0;y<57;y++){if(g>=m&&g<p&&y>=m&&y<p||g<8&&y<8||g<8&&y>=49||g>=49&&y<8)continue;let B=y+.5,L=g+.5;c.push((0,H.jsx)("rect",{x:B-.4,y:L-.4,width:.8,height:.8,rx:.4,fill:"var(--color-walletSelectItemBackground)"},`${g}-${y}`))}return c},d=({position:c})=>{let g=7*s,y={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0}};return(0,H.jsxs)("div",{className:"luno:absolute luno:z-[4]",style:{width:`${g}px`,height:`${g}px`,...y[c]},children:[(0,H.jsx)("div",{className:"luno:absolute luno:inset-0",style:{borderRadius:`${2*s}px`,border:`${s}px solid var(--color-walletSelectItemBackground)`}}),(0,H.jsx)("div",{className:"luno:absolute luno:left-1/2 luno:top-1/2 luno:-translate-x-1/2 luno:-translate-y-1/2",style:{width:`${3*s}px`,height:`${3*s}px`,borderRadius:`${.5*s}px`,backgroundColor:"var(--color-walletSelectItemBackground)"}})]})},a=()=>{let c=m*s;return(0,H.jsx)("div",{className:"luno:absolute luno:z-[4] luno:flex luno:items-center luno:justify-center luno:box-border",style:{width:`${u}px`,height:`${u}px`,left:`${c}px`,top:`${c}px`,borderRadius:`${s}px`,padding:`${s/2}px`},children:(0,H.jsx)("img",{src:o,alt:"QR Code Logo",className:"luno:h-full luno:w-full luno:object-cover",style:{borderRadius:`${s}px`}})})};return(0,H.jsxs)("div",{className:"luno:relative luno:overflow-hidden luno:flex luno:items-center luno:justify-center",style:{width:e,height:e,borderRadius:`${2*s}px`},children:[(0,H.jsx)("svg",{className:"luno:absolute luno:inset-0 luno:z-[3]",width:e,height:e,viewBox:"0 0 57 57",children:f()}),(0,H.jsx)("div",{className:"luno:absolute luno:inset-0 luno:z-[100]",style:{background:"linear-gradient(90deg, transparent 50%, var(--color-walletSelectItemBackgroundHover), transparent)",backgroundSize:"200% 100%",transform:"scale(1.5) rotate(45deg)",animation:"shimmer 1000ms linear infinite both"}}),d({position:"top-left"}),d({position:"top-right"}),d({position:"bottom-left"}),o&&a()]})}return(0,H.jsx)(Je.Cuer,{arena:o,value:n})};var Ho=require("react");var on=require("react/jsx-runtime"),Ye=({size:o=160,dotCount:n=300,duration:e=3,className:l=""})=>{let t=(0,Ho.useRef)(null);return(0,Ho.useEffect)(()=>{if(!t.current)return;let r=1,s=2,u=Math.PI*(3-Math.sqrt(5)),m=o/2,p=m-s-r,f="http://www.w3.org/2000/svg";t.current.innerHTML="";let d=document.createElementNS(f,"svg");d.setAttribute("width",o.toString()),d.setAttribute("height",o.toString()),d.setAttribute("viewBox",`0 0 ${o} ${o}`),d.style.display="block",t.current.appendChild(d);for(let a=0;a<n;a++){let c=a+.5,g=c/n,y=Math.sqrt(g)*p,F=c*u,B=m+y*Math.cos(F),L=m+y*Math.sin(F),M=document.createElementNS(f,"circle");M.setAttribute("cx",B.toString()),M.setAttribute("cy",L.toString()),M.setAttribute("r",r.toString()),M.setAttribute("fill","currentColor"),M.setAttribute("opacity","0.6"),d.appendChild(M);let P=document.createElementNS(f,"animate");P.setAttribute("attributeName","r"),P.setAttribute("values",`${r*.5};${r*1.8};${r*.5}`),P.setAttribute("dur",`${e}s`),P.setAttribute("begin",`${g*e}s`),P.setAttribute("repeatCount","indefinite"),P.setAttribute("calcMode","spline"),P.setAttribute("keySplines","0.4 0 0.6 1;0.4 0 0.6 1"),M.appendChild(P);let E=document.createElementNS(f,"animate");E.setAttribute("attributeName","opacity"),E.setAttribute("values","0.2;1;0.2"),E.setAttribute("dur",`${e}s`),E.setAttribute("begin",`${g*e}s`),E.setAttribute("repeatCount","indefinite"),E.setAttribute("calcMode","spline"),E.setAttribute("keySplines","0.4 0 0.6 1;0.4 0 0.6 1"),M.appendChild(E)}},[o,n,e]),(0,on.jsx)("div",{ref:t,className:i("luno:text-accentColor luno:inline-flex luno:w-full luno:h-full luno:justify-center luno:align-center",l)})};var x=require("react/jsx-runtime"),pe=en.default.memo(({selectedConnector:o,onConnect:n,qrCode:e,isWide:l,connectState:t})=>{let r=o?.hasConnectionUri();return(0,x.jsxs)("div",{className:i("luno:flex luno:flex-col luno:items-center",l?"luno:w-[450px] luno:p-4 luno:min-h-[472px]":"luno:justify-center luno:w-full luno:min-h-[400px]"),children:[l&&(0,x.jsx)("div",{className:"luno:w-full",children:(0,x.jsxs)("div",{className:"luno:flex luno:items-center luno:justify-between",children:[(0,x.jsx)("div",{}),(0,x.jsx)(Q,{className:"luno:z-10 luno:w-[30px] luno:h-[30px] luno:flex luno:items-center luno:justify-center luno:cursor-pointer luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200",children:(0,x.jsx)(Z,{})})]})}),(0,x.jsx)("div",{className:i("luno:flex luno:items-center luno:gap-4 luno:flex-col luno:grow luno:justify-center",o&&r?"luno:max-w-[300px]":"luno:max-w-[360px]"),children:o?r?(0,x.jsxs)("div",{className:"luno:flex luno:flex-col luno:items-center luno:gap-2.5",children:[(0,x.jsx)(Xe,{size:300,logoBackground:o.icon,uri:e}),(0,x.jsxs)("div",{className:"luno:text-base luno:leading-base luno:font-medium luno:text-center luno:text-modalTextSecondary",children:["Scan the QR code with"," ",o.id==="nova"?"the Nova":"your phone"]}),(0,x.jsx)("div",{className:"luno:min-h-[20px] luno:flex luno:items-center luno:justify-center",children:o.links?.browserExtension?(0,x.jsxs)("div",{onClick:()=>window.open(o.links.browserExtension),className:"luno:cursor-pointer luno:text-sm luno:text-accentColor luno:font-medium luno:text-center luno:hover:text-modalText",children:["Don't have ",o.name,"?"]}):e?(0,x.jsx)(Ao,{className:"luno:text-sm luno:leading-sm luno:font-medium luno:text-accentColor",copyText:e,label:"Copy Link"}):null})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"luno:w-[80px] luno:h-[80px]",children:(0,x.jsx)("img",{src:o.icon,className:"luno:w-full luno:h-full",alt:""})}),(0,x.jsxs)("p",{className:"luno:text-lg luno:leading-lg luno:text-modalFont luno:font-bold",children:["Opening ",o.name,"..."]}),(0,x.jsx)("p",{className:"luno:pb-[10px] luno:text-base luno:text-modalTextSecondary luno:leading-base luno:font-medium luno:text-center",children:"Confirm connection in the extension"}),t.isConnecting&&(0,x.jsx)("div",{className:"luno-loading luno:text-modalText luno:w-[24px]"}),!o.isInstalled()&&o.links.browserExtension&&(0,x.jsxs)("div",{onClick:()=>window.open(o.links.browserExtension),className:"luno:cursor-pointer luno:pt-6 luno:text-sm luno:text-accentColor luno:font-medium luno:text-center luno:hover:text-modalText",children:["Don\u2018t have ",o.name,"?"]}),!t.isConnecting&&t.isError&&o.isInstalled()&&(0,x.jsx)("button",{className:i("luno:rounded-connectButton luno:focus:outline-none luno:py-[4px] luno:px-[12px] luno:cursor-pointer luno:font-semibold luno:text-sm luno:text-modalText luno:bg-connectButtonBackground luno:shadow-connectButton luno:active:scale-[0.95]",bo),onClick:()=>n(o),children:"Retry"})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"luno:w-[160px] luno:h-[160px] luno:mb-4",children:(0,x.jsx)(Ye,{})}),(0,x.jsx)("div",{className:"luno:cursor-pointer luno:text-base luno:leading-base luno:text-accentColor luno:font-semibold luno:text-center",onClick:()=>window.open("https://polkadot.com/get-started/wallets/"),children:"New to wallets?"}),(0,x.jsx)("p",{className:"luno:text-modalTextSecondary luno:w-[250px] luno:text-sm luno:leading-sm luno:font-medium luno:text-center",children:"Connect your wallet to start exploring and interacting with DApps."})]})}),(0,x.jsx)("div",{})]})});var b=require("react/jsx-runtime");var Me=({size:o="wide"})=>{let{isOpen:n,close:e}=no(),{connectAsync:l,reset:t,isPending:r,isError:s}=(0,nn.useConnect)(),[u,m]=(0,eo.useState)(null),[p,f]=(0,eo.useState)(),{width:d}=Oo(),a=d&&d>768,c=!!(o==="wide"&&a),{containerRef:g,currentViewRef:y,resetView:F,handleViewChange:B,currentView:L}=So({initialView:"Connect Wallet"}),M=async G=>{let fe=await G.getConnectionUri();f(fe)},P=async G=>{if((0,tn.isMobileDevice)()&&G.links.deepLink)try{await l({connectorId:G.id}),E(!1);return}catch{window.location.href=`${G.links.deepLink}?url=${window.location.href}`;return}!c&&B("walletView"),m(G),f(void 0),G.hasConnectionUri()&&M(G),await l({connectorId:G.id}),E(!1)},E=G=>{!G&&e(),t(),F(),m(null),f(void 0)},ln=(0,eo.useMemo)(()=>({"Connect Wallet":(0,b.jsx)(Ke,{onConnect:P}),walletView:(0,b.jsx)(pe,{connectState:{isConnecting:r,isError:s},isWide:c,selectedConnector:u,qrCode:p,onConnect:P})}),[c,u,p,P,r,s]);return(0,eo.useEffect)(()=>{c&&L==="walletView"&&B("Connect Wallet")},[c,L]),(0,b.jsx)(ro,{open:n,onOpenChange:E,children:(0,b.jsxs)("div",{className:i("luno:flex luno:items-stretch luno:justify-between luno:w-full luno:md:max-h-[504px] luno:md:max-w-[724px]"),children:[(0,b.jsxs)("div",{className:i("luno:flex luno:flex-col luno:items-start luno:py-4 luno:px-5 luno:w-full luno:md:w-auto",c?"luno:md:min-w-[300px] luno:border-r-[1px] luno:border-r-solid luno:border-r-separatorLine":"luno:md:min-w-[360px]"),children:[(0,b.jsxs)("div",{className:i("luno:flex luno:items-center luno:justify-between luno:w-full",!c&&"luno:pb-4"),children:[L==="Connect Wallet"?(0,b.jsxs)(b.Fragment,{children:[!c&&(0,b.jsx)("div",{className:i("luno:w-[30px] luno:h-[30px]"),"aria-hidden":!0}),(0,b.jsx)(q,{className:i("luno:text-lg luno:leading-lg luno:text-modalText luno:font-bold",c?"luno:pb-6":"luno:flex-1 luno:text-center"),children:"Connect Wallet"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{className:i("luno:flex luno:items-center luno:justify-center luno:w-[30px] luno:h-[30px] luno:cursor-pointer luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200"),onClick:()=>B("Connect Wallet"),"aria-label":"Back",children:(0,b.jsx)(mo,{})}),(0,b.jsx)(q,{className:i("luno:text-lg luno:leading-lg luno:text-modalText luno:font-semibold luno:transition-opacity luno:duration-300"),children:u?.name})]}),!c&&(0,b.jsx)(Q,{className:"luno:z-10 luno:w-[30px] luno:h-[30px] luno:flex luno:items-center luno:justify-center luno:cursor-pointer luno:rounded-modalControlButton luno:border-none luno:hover:bg-modalControlButtonBackgroundHover luno:transition-colors luno:duration-200",children:(0,b.jsx)(Z,{})})]}),(0,b.jsx)("div",{ref:g,className:i("luno:relative luno:overflow-hidden luno:w-full"),children:(0,b.jsx)("div",{ref:y,children:ln[L]})}),!c&&L==="Connect Wallet"&&(0,b.jsx)("p",{className:"luno:cursor-pointer luno:w-full luno:pt-4 luno:text-sm luno:leading-sm luno:text-accentColor luno:font-medium luno:text-center luno:hover:text-modalText",onClick:()=>window.open("https://polkadot.com/get-started/wallets/"),children:"New to wallets?"})]}),c&&(0,b.jsx)(pe,{connectState:{isConnecting:r,isError:s},isWide:c,selectedConnector:u,qrCode:p,onConnect:P})]})})};0&&(module.exports={ConnectButton,LunoKitProvider,useAccountModal,useChainModal,useCloseAllModals,useConnectModal,useLunoTheme});
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|