import { createSignal, Show, Switch, Match } from "solid-js"; import { sendMessage } from "../App"; import { RuneCanvas } from "../components/RuneCanvas"; interface PanicProps { onCancel: () => void; onOpenExport: () => void; onDestroyed: () => void | Promise; } // Pseudo-random spread of PeachScript PUA codepoints for the Step 3 backdrop. const PANIC_RUNES = Array.from({ length: 80 }, (_, i) => String.fromCodePoint(0xe000 + (i * 19 + 7) % 256) ).join(""); function OverlayHeader(props: { title: string; onBack: () => void }) { return (
{props.title}
); } export function PanicView(props: PanicProps) { const [step, setStep] = createSignal<1 | 2 | 3>(1); const [confirmText, setConfirmText] = createSignal(""); const [destroying, setDestroying] = createSignal(false); const canDestroy = () => confirmText() === "DESTROY"; async function handleDestroy() { if (destroying()) return; setDestroying(true); const res = await sendMessage({ type: "DESTROY_VAULT" }); if (!res?.ok) { setDestroying(false); return; } await props.onDestroyed(); } return (

Before you destroy your vault

Once destroyed, your vault cannot be recovered. Ever. There is no undo, no support ticket, no way back.

If you haven't already, export your vault now. It takes ten seconds and you'll be glad you did.

I have already exported my vault or I don't want to.

This will permanently destroy your vault.

Every password, card, passkey, note, and setting will be wiped from this device. This cannot be undone.

Type DESTROY to confirm:

setConfirmText(e.currentTarget.value)} autocomplete="off" spellcheck={false} autocapitalize="off" aria-label="Type DESTROY to confirm" />
THIS IS YOUR LAST CHANCE

Your vault is about to be permanently destroyed.

There is no recovery.
There is no support.
There is no undo.

); }