# SPDX-License-Identifier: AGPL-3.0-only
# Copyright (c) 2026 sol pbc

"""Owner-facing copy and locked constants for the link pairing flow."""

from __future__ import annotations

from typing import Any

PAIR_LINK_HOST = "go.solstone.app"
PAIR_LINK_PATH = "/p"
MODAL_TITLE = "pair a device"
PRESENTATION_SELECTOR_LABEL = "pairing display"
PRESENTATION_PHONE_LABEL = "phone"
PRESENTATION_COMPUTER_LABEL = "computer"
PRESENTATION_GLASSES_LABEL = "glasses"
STEP_1 = "open the camera on the device you're adding"
STEP_2 = "point it at this code"
STEP_3 = "tap the link to open solstone"
PAIR_NETWORK_LINE = (
    "this device needs to be on your network (or your VPN) to pair. expires in 5:00."
)
DETAILS_DISCLOSURE = "verify this is really your home"
CA_FP_LABEL = "fingerprint"
CA_FP_NOTE = (
    "the device checks this when it scans, so no one on your wifi can impersonate home."
)
DEVICE_LABEL_FIELD_LABEL = "name this device"
DEVICE_LABEL_PLACEHOLDER = "e.g. my iPhone"
DEVICE_LABEL_PLACEHOLDER_COMPUTER = "e.g. my laptop"
DEVICE_LABEL_DEFAULT_FORMAT = "device — added {month} {day}"
PAIR_LINK_FIELD_LABEL = "pairing link"
PAIR_LINK_COPY_LABEL = "copy link"
PAIR_LINK_COPY_SUCCESS_TOAST = "pairing link copied"
PAIR_LINK_COPY_FAIL_TOAST = "couldn't copy pairing link"
EXPIRED_BUTTON = "this code expired — show a new one"
WINDOW_CLOSED_BUTTON = "pairing window closed — open a new one"
SUCCESS_HEADING = '"{label}" is now paired with your journal'
SUCCESS_SUBHEAD = "{short_fp} · paired just now"
SUCCESS_DONE = "done"
PAIR_ERROR_BODY = (
    "can't start pairing — your journal isn't reachable on a network address yet."
)
SUCCESS_VERIFY_NOTE = (
    "check the device you just paired — this fingerprint should match what it "
    "shows. didn't do this?"
)
SUCCESS_VERIFY_NOTE_ANYWHERE = (
    "this device can now reach home from anywhere. check it now — this "
    "fingerprint should match what it shows. didn't do this?"
)
SUCCESS_REMOVE_LABEL = "that wasn't me — remove"
# --- U4 first-run hero ---
HERO_TITLE = "let's connect a device"
HERO_BODY = (
    "your journal lives here, on this device. to read it from your phone or "
    "laptop, that device needs a way to reach it. right now it can be reached "
    "on your home network."
)
HERO_HOW_REACH_LABEL = "how reach works ▸"

# --- U2 reach-shell copy ---
STATUS_SENTENCES = {
    "direct_online": "your journal is reachable on your network.",
    "direct_online_vpn": "your journal is reachable on your network and over your VPN.",
    "reconnecting": "reconnecting to your journal…",
    "offline": "can't reach your journal right now.",
    "lan_unreachable": "your journal is running, but devices can't reach it to pair yet.",
    "spl_online": "your journal is reachable from anywhere.",
    "spl_finishing_setup": "finishing setup with your private network…",
    "spl_offline": (
        "your journal isn't reaching the network right now — devices can't connect "
        "from away. on your home wifi they still work."
    ),
    "checking": "checking your journal…",
}
BRANDLOCK_LINE = "your journal is always private, only yours."
REACH_SELECTOR_TITLE = "how your devices reach your journal"
REACH_SELECTOR_HINT = (
    "your choice — switch anytime. either way, what syncs is end-to-end encrypted "
    "and only your devices can read it."
)
MODE_BYO_NAME = "your own"
MODE_BYO_DESC = (
    "your devices reach your journal over your own network — same wifi, or your own "
    "VPN. the default."
)
MODE_BYO_DISCLOSURE = "sol pbc is never in the path"
MODE_HOSTED_NAME = "private network"
MODE_HOSTED_DESC = (
    "reach your journal from anywhere, through a relay sol pbc runs for you."
)
MODE_HOSTED_DISCLOSURE = "operated by sol pbc"
MODE_BYO_BODY_NOTE = (
    "your journal stays on this device. your other devices connect straight to it — "
    "nothing routes through sol pbc."
)
MODE_HOSTED_SETUP_NOTE = (
    "your journal stays on this device; the relay only passes along encrypted traffic "
    "it can't read."
)
MODE_HOSTED_SETUP_CTA = "set up the relay →"
APP_ONOFF_LABEL = "network"
APP_ONOFF_SUB_BYO = "on — reachable over your own network"
APP_ONOFF_SUB_HOSTED = "on — reachable from anywhere"
REACH_HOME_ADDRESS_LABEL = "home address"
REACH_HOST_ADDRESS_DISCLOSURE = "▸ use a different address"
REACH_HOST_ADDRESS_PLACEHOLDER = "192.168.1.44:7657"
REACH_HOST_ADDRESS_APPLY_LABEL = "apply"
REACH_HOST_ADDRESS_CLEAR_LABEL = "clear"
REACH_HOME_CANDIDATES_LABEL = "choose a home address"
REACH_HOME_CANDIDATES_REFRESH_FAIL = (
    "saved, but couldn't refresh. showing the last confirmed address."
)
REACH_HOME_CANDIDATES_UNAVAILABLE = (
    "couldn't check home addresses. you can still type one below."
)
HOME_CANDIDATES_ERROR = "couldn't check home addresses"
REACH_VPN_CANDIDATE_LABEL = "VPN address"
REACH_VPN_USE_THIS = "use this"
REACH_SPL_ACTIVE_BODY = "your devices reach home over the internet, wherever you are."
REACH_SPL_TRUST_LINE = (
    "the connection is end-to-end encrypted — sol pbc and cloudflare can see "
    "that your device and home met, and nothing inside."
)
REACH_SPL_MANAGE_LABEL = "manage your private network at services.solstone.app →"
REACH_SPL_CONNECTING_NOTE = "your home is connecting. this is usually quick."
CHECK_AGAIN_LABEL = "check again"
PRIVATE_LINK_DISABLE_CTA = "turn off your private network"
PRIVATE_LINK_SETTING_UP = "setting up your private network…"
PRIVATE_LINK_PORTAL_CTA = "continue to approve →"
PRIVATE_LINK_SETUP_SUCCESS = (
    "your private network is on. your devices can reach home from anywhere."
)
PRIVATE_LINK_SETUP_FAILED = "couldn't finish setting up your private network."
PRIVATE_LINK_NEEDS_SUBSCRIPTION_HEADLINE = "your private network needs a subscription"
PRIVATE_LINK_NEEDS_SUBSCRIPTION_DETAIL = (
    "your consent is saved. your private network needs an active subscription "
    "before it can turn on; set one up, then enable it again."
)
PRIVATE_LINK_NEEDS_SUBSCRIPTION_CTA = "set up a subscription"
PRIVATE_LINK_DISABLE_SUCCESS = (
    "your private network is off. devices connect directly again."
)
PRIVATE_LINK_DISABLE_FAILED = (
    "couldn't turn off your private network — it's still on. try again."
)
PRIVATE_LINK_NEEDS_REPAIR = "your private network needs setting up again."
PRIVATE_LINK_RETRY_CTA = "try again"

# --- U3 device-section copy ---
DEVICE_SECTION_TITLE = "your devices"
DEVICE_PAIR_CTA = "pair a device"
DEVICE_EMPTY_TITLE = "no devices connected yet"
DEVICE_EMPTY_BODY = "pair a device to read your journal on the go."
RECENT_SECTION_TITLE = "recently paired"
RECENT_NETWORK_LABEL = "on your network"
RECENT_NETWORK_LABEL_ANYWHERE = "from anywhere"
REFRESH_FAIL_NOTICE = "showing the last state we saw"
UNPAIR_TITLE_FORMAT = "unpair '{label}'?"
UNPAIR_BODY = (
    "this device loses access to your journal immediately and can't reconnect until "
    "you pair it again. anything stored on the device stays on the device."
)
DEVICE_STATUS_LABELS = {
    "online": "online",
    "recent": "recently seen",
    "offline": "offline",
}
DEVICE_GROUP_LABELS = {
    "observers": "observers",
    "peers": "peers",
}
DEVICE_ACTION_LABELS = {
    "rename": "rename",
    "copy_fingerprint": "copy fingerprint",
    "unpair": "unpair",
}
RECENT_SEE_ALL_LABEL = "see all ▸"
RECENT_SHOW_LESS_LABEL = "show less ▾"
FINGERPRINT_COPY_SUCCESS_TOAST = "fingerprint copied"
FINGERPRINT_COPY_FAIL_TOAST = "couldn't copy fingerprint"
RENAME_FAIL_TOAST = "couldn't rename device"
UNPAIR_SUCCESS_TOAST = "unpaired"
UNPAIR_FAIL_TOAST = "couldn't unpair this device"

# --- identity header (read-only journal mark) ---
IDENTITY_HEADER_LABEL = "this is your journal"
IDENTITY_ID_LABEL = "journal id"
IDENTITY_ID_COPY_LABEL = "copy"
IDENTITY_ID_COPY_SUCCESS_TOAST = "journal id copied"
IDENTITY_ID_COPY_FAIL_TOAST = "couldn't copy journal id"


def link_copy_payload() -> dict[str, Any]:
    """Return the complete static copy payload for the network workspace."""
    return {name: value for name, value in globals().items() if name.isupper()}
