import { b as g, a as A, k as T, i as s, c as e, e as H, f as _, A as O, t as v, s as R, d as M } from "./Logo1am-CaBWyNpM.js";
import { a1 as Y, __tla as __tla_0 } from "./App-BLnEEK_h.js";
import "./_virtual_wxt-plugins-CDnz5Vh6.js";
import "./request-fingerprint-BANtRL63.js";
import "./__vite-plugin-wasm-helper-D7K_KhUE.js";
import { __tla as __tla_1 } from "./cardano-e2kMgYtl.js";
let V;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    var j = v('<div class="px-3 pb-2 space-y-1.5 overflow-x-auto">'), z = v('<div class="border-t border-[var(--border-secondary)] bg-[var(--bg-secondary)] text-[10px] font-mono leading-tight select-text"style=z-index:50><button class="flex items-center justify-between w-full px-3 py-1.5 hover:bg-[var(--bg-tertiary)] transition-colors"><span class="font-semibold uppercase tracking-wider opacity-60">Debug</span><div class="flex items-center gap-2"><span class="inline-block w-1.5 h-1.5 rounded-full"></span><span class=opacity-50>%</span><span class=opacity-40>'), G = v('<div><div class="font-semibold uppercase tracking-wider opacity-40 mb-0.5"></div><div class="grid grid-cols-[auto_1fr] gap-x-3">'), X = v('<span class="opacity-50 whitespace-nowrap">'), q = v("<span class=whitespace-nowrap>");
    let h, l;
    V = ()=>{
        const t = Y(), [a, d] = g(Date.now()), [p, k] = g(!1), w = setInterval(()=>d(Date.now()), 1e3);
        A(()=>clearInterval(w));
        const n = ()=>t.syncProgress(), u = ()=>t.networkHealth(), c = ()=>t.sponsorHealth(), [f, C] = g(null), [S, D] = g(null), [m, I] = g(null);
        T(()=>{
            const r = n();
            f() === null && r.shielded.total > 0 && C(r.shielded.total), S() === null && r.dust.total > 0 && D(r.dust.total), m() === null && r.unshielded.total > 0 && I(r.unshielded.total);
        });
        const b = (r, i)=>i === null ? " (+0)" : ` (+${r - i})`, W = (r)=>r ? "#22c55e" : "#ef4444", x = (r)=>{
            if (!r) return "--";
            const i = Math.floor((a() - r) / 1e3);
            return i < 60 ? `${i}s ago` : `${Math.floor(i / 60)}m ${i % 60}s ago`;
        };
        return (()=>{
            var r = z(), i = r.firstChild, P = i.firstChild, E = P.nextSibling, y = E.firstChild, $ = y.nextSibling, N = $.firstChild, U = $.nextSibling;
            return i.$$click = ()=>k((o)=>!o), s($, ()=>n().percent, N), s(U, ()=>p() ? "+" : "-"), s(r, e(H, {
                get when () {
                    return !p();
                },
                get children () {
                    var o = j();
                    return s(o, e(h, {
                        title: "Sync",
                        get children () {
                            return [
                                e(l, {
                                    label: "Status",
                                    get value () {
                                        return t.isSynced() ? "SYNCED" : "SYNCING";
                                    },
                                    get ok () {
                                        return t.isSynced();
                                    }
                                }),
                                e(l, {
                                    label: "Overall",
                                    get value () {
                                        return `${n().percent}%`;
                                    }
                                }),
                                e(l, {
                                    label: "Shielded",
                                    get value () {
                                        return `${n().shielded.current} / ${n().shielded.total}${b(n().shielded.total, f())}`;
                                    }
                                }),
                                e(l, {
                                    label: "Unshielded",
                                    get value () {
                                        return `${n().unshielded.current} / ${n().unshielded.total}${b(n().unshielded.total, m())}`;
                                    }
                                }),
                                e(l, {
                                    label: "Dust",
                                    get value () {
                                        return `${n().dust.current} / ${n().dust.total}${b(n().dust.total, S())}`;
                                    }
                                })
                            ];
                        }
                    }), null), s(o, e(h, {
                        title: "Network",
                        get children () {
                            return [
                                e(l, {
                                    label: "Indexer",
                                    get value () {
                                        return u().indexer;
                                    },
                                    get ok () {
                                        return u().indexer === "up";
                                    }
                                }),
                                e(l, {
                                    label: "RPC",
                                    get value () {
                                        return u().rpc;
                                    },
                                    get ok () {
                                        return u().rpc === "up";
                                    }
                                }),
                                e(l, {
                                    label: "Overall",
                                    get value () {
                                        return u().overall;
                                    },
                                    get ok () {
                                        return u().overall === "healthy";
                                    }
                                }),
                                e(l, {
                                    label: "Checked",
                                    get value () {
                                        return x(u().lastChecked);
                                    }
                                })
                            ];
                        }
                    }), null), s(o, e(h, {
                        title: "Sponsor",
                        get children () {
                            return [
                                e(l, {
                                    label: "Status",
                                    get value () {
                                        return c().status;
                                    },
                                    get ok () {
                                        return c().status === "ready";
                                    }
                                }),
                                e(l, {
                                    label: "Wallets",
                                    get value () {
                                        return `${c().availableWallets} / ${c().totalWallets}`;
                                    }
                                }),
                                e(l, {
                                    label: "UTXOs",
                                    get value () {
                                        return String(c().totalUtxos);
                                    }
                                }),
                                e(l, {
                                    label: "Pending",
                                    get value () {
                                        return String(c().pendingTxs);
                                    }
                                }),
                                e(l, {
                                    label: "Checked",
                                    get value () {
                                        return x(c().lastChecked);
                                    }
                                })
                            ];
                        }
                    }), null), s(o, e(h, {
                        title: "Wallet",
                        get children () {
                            return [
                                e(l, {
                                    label: "Env",
                                    get value () {
                                        return t.environmentSettings().environment;
                                    }
                                }),
                                e(l, {
                                    label: "Wallet ID",
                                    get value () {
                                        return String(t.activeWalletId());
                                    }
                                }),
                                e(l, {
                                    label: "Account",
                                    get value () {
                                        return String(t.activeAccountIndex());
                                    }
                                }),
                                e(l, {
                                    label: "Pending Txs",
                                    get value () {
                                        return String(t.pendingCount());
                                    }
                                }),
                                e(l, {
                                    label: "History",
                                    get value () {
                                        return `${t.totalTransactions()} txs`;
                                    }
                                })
                            ];
                        }
                    }), null), o;
                }
            }), null), _((o)=>O(y, "background", W(t.isSynced()))), r;
        })();
    };
    h = (t)=>(()=>{
            var a = G(), d = a.firstChild, p = d.nextSibling;
            return s(d, ()=>t.title), s(p, ()=>t.children), a;
        })();
    l = (t)=>[
            (()=>{
                var a = X();
                return s(a, ()=>t.label), a;
            })(),
            (()=>{
                var a = q();
                return s(a, ()=>t.value), _((d)=>R(a, t.ok !== void 0 ? {
                        color: t.ok ? "#22c55e" : "#ef4444"
                    } : void 0, d)), a;
            })()
        ];
    M([
        "click"
    ]);
});
export { V as default, __tla };
