{
  "schema": 1,
  "id": "ext.discord",
  "name": "Discord Rich Presence",
  "version": "1.0.1",
  "category": "tool",
  "description": "Zeigt in Discord, woran du arbeitest: Datei, Projekt, Sprache und Dauer — mit Leerlauf, privaten Projekten und Repository-Knopf. Bringt Programmcode mit.",
  "author": "Lumen",
  "icon": "DC",
  "color": "#5865f2",
  "license": "MIT",
  "minAppVersion": "0.5.0",
  "keywords": [
    "discord",
    "rich presence",
    "presence",
    "status",
    "rpc"
  ],
  "readme": "# Discord Rich Presence\n\nShows in your Discord profile what you are working on in Lumen — *Editing\nMain.java*, *in my-project*, the language as an image and how long you have\nbeen at it.\n\nThe extension talks to the Discord client running on your machine directly\n(its local IPC socket `discord-ipc-N`, Flatpak and Snap included, or the named\npipe on Windows). Nothing is sent anywhere else. Discord accepts about one\nupdate every 15 seconds; changes in between are gathered, and with Discord\nclosed the extension quietly tries again later.\n\n> Brings program code: Lumen asks before installing it and runs it in its main\n> process.\n\n## Setup\n\nIt works out of the box with Lumen's own Discord application. To show a name\nof your own (“Playing …”), create an application at\n[discord.com/developers](https://discord.com/developers/applications) and put\nits *Application ID* into *Settings → Extensions → Discord Rich Presence*.\nUpload art assets named after the language ids (`java`, `typescript`,\n`python` …) and one called `lumen`.\n\n## Settings\n\n| Setting | What it does |\n| --- | --- |\n| Client ID | The Discord application; empty means no connection |\n| File name, project, language, elapsed time | Each can be switched off |\n| Count time from | Lumen's start, opening the project or switching to the file |\n| “View repository” button | Links the project's `origin` remote, credentials stripped — for public repositories only |\n| Idle after (minutes) | Minutes without window focus until Lumen counts as idle; `0` turns it off |\n| When idle | Show the idle text, or clear the presence altogether |\n| Idle text | Shown when idle or when no file is open |\n| In private projects | Hide file and project names, or show nothing at all |\n| Private folders | Absolute paths, one per line; projects inside count as private |\n\n## Commands\n\n- **Discord: Reconnect** — rebuilds the connection at once (also a click on\n  the *Discord* entry in the status bar, which shows whether it is connected).\n- **Discord: Enable / Disable / Toggle Rich Presence** — remembered across\n  restarts.\n- **Discord: Toggle Private Project** — marks the open project as private (or\n  not). In private projects no names and no repository link reach Discord.\n\n## Formerly built in\n\nLumen used to ship Discord Rich Presence as a bundled add-on (`tool.discord`).\nIt now lives here; its settings do not carry over — the defaults match the old\nones.\n",
  "settings": [
    {
      "key": "clientId",
      "label": "Client-ID (Application ID)",
      "type": "text",
      "default": "1550197013260275863",
      "placeholder": "123456789012345678",
      "hint": "Die Anwendung, deren Name in Discord als „Spielt …“ erscheint. Eine eigene legst du unter discord.com/developers an; ihre Bilder heißen wie die Sprach-IDs (java, typescript …) plus lumen. Leer = keine Verbindung.",
      "section": "Verbindung",
      "i18n": {
        "en": {
          "label": "Client ID (Application ID)",
          "hint": "The application whose name appears in Discord as “Playing …”. Create your own at discord.com/developers; its art assets are named after the language IDs (java, typescript …) plus lumen. Empty = no connection.",
          "section": "Connection"
        },
        "es": {
          "label": "ID de cliente (Application ID)",
          "hint": "La aplicación cuyo nombre aparece en Discord como «Jugando a …». Crea la tuya en discord.com/developers; sus imágenes se llaman como los ID de lenguaje (java, typescript …) más lumen. Vacío = sin conexión.",
          "section": "Conexión"
        },
        "fr": {
          "label": "ID client (Application ID)",
          "hint": "L’application dont le nom apparaît dans Discord comme « Joue à … ». Créez la vôtre sur discord.com/developers ; ses images portent le nom des ID de langage (java, typescript …) plus lumen. Vide = aucune connexion.",
          "section": "Connexion"
        },
        "pl": {
          "label": "ID klienta (Application ID)",
          "hint": "Aplikacja, której nazwa pojawia się w Discordzie jako „Gra w …”. Własną utworzysz na discord.com/developers; jej obrazy nazywają się jak identyfikatory języków (java, typescript …) oraz lumen. Puste = brak połączenia.",
          "section": "Połączenie"
        },
        "it": {
          "label": "ID client (Application ID)",
          "hint": "L’applicazione il cui nome compare su Discord come “Sta giocando a …”. Creane una tua su discord.com/developers; le sue immagini si chiamano come gli ID dei linguaggi (java, typescript …) più lumen. Vuoto = nessuna connessione.",
          "section": "Connessione"
        },
        "pt": {
          "label": "ID do cliente (Application ID)",
          "hint": "A aplicação cujo nome aparece no Discord como “Jogando …”. Crie a sua em discord.com/developers; as imagens têm o nome dos IDs de linguagem (java, typescript …) mais lumen. Vazio = sem conexão.",
          "section": "Conexão"
        },
        "nl": {
          "label": "Client-ID (Application ID)",
          "hint": "De applicatie waarvan de naam in Discord verschijnt als „Speelt …”. Maak je eigen aan op discord.com/developers; de afbeeldingen heten zoals de taal-ID’s (java, typescript …) plus lumen. Leeg = geen verbinding.",
          "section": "Verbinding"
        }
      }
    },
    {
      "key": "showFileName",
      "label": "Dateiname",
      "type": "toggle",
      "default": "true",
      "section": "Angezeigt wird",
      "i18n": {
        "en": {
          "label": "File name",
          "section": "Shown in Discord"
        },
        "es": {
          "label": "Nombre de archivo",
          "section": "Se muestra"
        },
        "fr": {
          "label": "Nom du fichier",
          "section": "Affiché"
        },
        "pl": {
          "label": "Nazwa pliku",
          "section": "Pokazywane"
        },
        "it": {
          "label": "Nome del file",
          "section": "Mostrato"
        },
        "pt": {
          "label": "Nome do arquivo",
          "section": "Exibido"
        },
        "nl": {
          "label": "Bestandsnaam",
          "section": "Getoond"
        }
      }
    },
    {
      "key": "showProject",
      "label": "Projekt",
      "type": "toggle",
      "default": "true",
      "section": "Angezeigt wird",
      "i18n": {
        "en": {
          "label": "Project",
          "section": "Shown in Discord"
        },
        "es": {
          "label": "Proyecto",
          "section": "Se muestra"
        },
        "fr": {
          "label": "Projet",
          "section": "Affiché"
        },
        "pl": {
          "label": "Projekt",
          "section": "Pokazywane"
        },
        "it": {
          "label": "Progetto",
          "section": "Mostrato"
        },
        "pt": {
          "label": "Projeto",
          "section": "Exibido"
        },
        "nl": {
          "label": "Project",
          "section": "Getoond"
        }
      }
    },
    {
      "key": "showLanguage",
      "label": "Sprache (als Bild)",
      "type": "toggle",
      "default": "true",
      "section": "Angezeigt wird",
      "i18n": {
        "en": {
          "label": "Language (as image)",
          "section": "Shown in Discord"
        },
        "es": {
          "label": "Lenguaje (como imagen)",
          "section": "Se muestra"
        },
        "fr": {
          "label": "Langage (en image)",
          "section": "Affiché"
        },
        "pl": {
          "label": "Język (jako obraz)",
          "section": "Pokazywane"
        },
        "it": {
          "label": "Linguaggio (come immagine)",
          "section": "Mostrato"
        },
        "pt": {
          "label": "Linguagem (como imagem)",
          "section": "Exibido"
        },
        "nl": {
          "label": "Taal (als afbeelding)",
          "section": "Getoond"
        }
      }
    },
    {
      "key": "showElapsed",
      "label": "Verstrichene Zeit",
      "type": "toggle",
      "default": "true",
      "section": "Angezeigt wird",
      "i18n": {
        "en": {
          "label": "Elapsed time",
          "section": "Shown in Discord"
        },
        "es": {
          "label": "Tiempo transcurrido",
          "section": "Se muestra"
        },
        "fr": {
          "label": "Temps écoulé",
          "section": "Affiché"
        },
        "pl": {
          "label": "Upływający czas",
          "section": "Pokazywane"
        },
        "it": {
          "label": "Tempo trascorso",
          "section": "Mostrato"
        },
        "pt": {
          "label": "Tempo decorrido",
          "section": "Exibido"
        },
        "nl": {
          "label": "Verstreken tijd",
          "section": "Getoond"
        }
      }
    },
    {
      "key": "elapsedFrom",
      "label": "Zeit gezählt ab",
      "type": "select",
      "default": "session",
      "when": "showElapsed",
      "section": "Angezeigt wird",
      "choices": [
        {
          "value": "session",
          "label": "Start von Lumen"
        },
        {
          "value": "project",
          "label": "Öffnen des Projekts"
        },
        {
          "value": "file",
          "label": "Wechsel zur Datei"
        }
      ],
      "i18n": {
        "en": {
          "label": "Count time from",
          "section": "Shown in Discord",
          "choices": {
            "session": "Lumen’s start",
            "project": "Opening the project",
            "file": "Switching to the file"
          }
        },
        "es": {
          "label": "Contar el tiempo desde",
          "section": "Se muestra",
          "choices": {
            "session": "el inicio de Lumen",
            "project": "la apertura del proyecto",
            "file": "el cambio al archivo"
          }
        },
        "fr": {
          "label": "Compter le temps depuis",
          "section": "Affiché",
          "choices": {
            "session": "le démarrage de Lumen",
            "project": "l’ouverture du projet",
            "file": "le passage au fichier"
          }
        },
        "pl": {
          "label": "Licz czas od",
          "section": "Pokazywane",
          "choices": {
            "session": "uruchomienia Lumen",
            "project": "otwarcia projektu",
            "file": "przełączenia na plik"
          }
        },
        "it": {
          "label": "Conta il tempo da",
          "section": "Mostrato",
          "choices": {
            "session": "l’avvio di Lumen",
            "project": "l’apertura del progetto",
            "file": "il passaggio al file"
          }
        },
        "pt": {
          "label": "Contar o tempo desde",
          "section": "Exibido",
          "choices": {
            "session": "o início do Lumen",
            "project": "a abertura do projeto",
            "file": "a troca para o arquivo"
          }
        },
        "nl": {
          "label": "Tijd tellen vanaf",
          "section": "Getoond",
          "choices": {
            "session": "de start van Lumen",
            "project": "het openen van het project",
            "file": "het wisselen naar het bestand"
          }
        }
      }
    },
    {
      "key": "repoButton",
      "label": "Knopf „Repository ansehen“",
      "type": "toggle",
      "default": "false",
      "hint": "Verlinkt das origin-Remote des Projekts (ohne Zugangsdaten). Nur für öffentliche Repositorys einschalten.",
      "section": "Angezeigt wird",
      "i18n": {
        "en": {
          "label": "“View repository” button",
          "hint": "Links the project’s origin remote (without credentials). Only turn on for public repositories.",
          "section": "Shown in Discord"
        },
        "es": {
          "label": "Botón «Ver repositorio»",
          "hint": "Enlaza el remoto origin del proyecto (sin credenciales). Actívalo solo para repositorios públicos.",
          "section": "Se muestra"
        },
        "fr": {
          "label": "Bouton « Voir le dépôt »",
          "hint": "Pointe vers le remote origin du projet (sans identifiants). À activer uniquement pour les dépôts publics.",
          "section": "Affiché"
        },
        "pl": {
          "label": "Przycisk „Zobacz repozytorium”",
          "hint": "Linkuje do zdalnego origin projektu (bez danych logowania). Włączaj tylko dla publicznych repozytoriów.",
          "section": "Pokazywane"
        },
        "it": {
          "label": "Pulsante “Vedi repository”",
          "hint": "Collega il remote origin del progetto (senza credenziali). Attivalo solo per repository pubblici.",
          "section": "Mostrato"
        },
        "pt": {
          "label": "Botão “Ver repositório”",
          "hint": "Aponta para o remoto origin do projeto (sem credenciais). Ligue apenas para repositórios públicos.",
          "section": "Exibido"
        },
        "nl": {
          "label": "Knop „Repository bekijken”",
          "hint": "Linkt naar de origin-remote van het project (zonder inloggegevens). Alleen aanzetten voor openbare repository’s.",
          "section": "Getoond"
        }
      }
    },
    {
      "key": "idleMinutes",
      "label": "Leerlauf nach (Minuten ohne Fokus)",
      "type": "number",
      "default": "5",
      "min": 0,
      "max": 240,
      "step": 1,
      "hint": "0 schaltet den Leerlauf aus.",
      "section": "Leerlauf",
      "i18n": {
        "en": {
          "label": "Idle after (minutes without focus)",
          "hint": "0 turns idle detection off.",
          "section": "Idle"
        },
        "es": {
          "label": "Inactivo tras (minutos sin foco)",
          "hint": "0 desactiva la detección de inactividad.",
          "section": "Inactividad"
        },
        "fr": {
          "label": "Inactif après (minutes sans focus)",
          "hint": "0 désactive la détection d’inactivité.",
          "section": "Inactivité"
        },
        "pl": {
          "label": "Bezczynność po (minutach bez fokusu)",
          "hint": "0 wyłącza wykrywanie bezczynności.",
          "section": "Bezczynność"
        },
        "it": {
          "label": "Inattivo dopo (minuti senza focus)",
          "hint": "0 disattiva il rilevamento dell’inattività.",
          "section": "Inattività"
        },
        "pt": {
          "label": "Ocioso após (minutos sem foco)",
          "hint": "0 desliga a detecção de ociosidade.",
          "section": "Ociosidade"
        },
        "nl": {
          "label": "Inactief na (minuten zonder focus)",
          "hint": "0 schakelt inactiviteitsdetectie uit.",
          "section": "Inactiviteit"
        }
      }
    },
    {
      "key": "idleAction",
      "label": "Im Leerlauf",
      "type": "select",
      "default": "idle",
      "section": "Leerlauf",
      "choices": [
        {
          "value": "idle",
          "label": "Leerlauf-Text zeigen"
        },
        {
          "value": "clear",
          "label": "Nichts anzeigen"
        }
      ],
      "i18n": {
        "en": {
          "label": "When idle",
          "section": "Idle",
          "choices": {
            "idle": "Show the idle text",
            "clear": "Show nothing"
          }
        },
        "es": {
          "label": "Al estar inactivo",
          "section": "Inactividad",
          "choices": {
            "idle": "Mostrar el texto de inactividad",
            "clear": "No mostrar nada"
          }
        },
        "fr": {
          "label": "En cas d’inactivité",
          "section": "Inactivité",
          "choices": {
            "idle": "Afficher le texte d’inactivité",
            "clear": "Ne rien afficher"
          }
        },
        "pl": {
          "label": "Podczas bezczynności",
          "section": "Bezczynność",
          "choices": {
            "idle": "Pokaż tekst bezczynności",
            "clear": "Nic nie pokazuj"
          }
        },
        "it": {
          "label": "In caso di inattività",
          "section": "Inattività",
          "choices": {
            "idle": "Mostra il testo di inattività",
            "clear": "Non mostrare nulla"
          }
        },
        "pt": {
          "label": "Quando ocioso",
          "section": "Ociosidade",
          "choices": {
            "idle": "Mostrar o texto de ociosidade",
            "clear": "Não mostrar nada"
          }
        },
        "nl": {
          "label": "Bij inactiviteit",
          "section": "Inactiviteit",
          "choices": {
            "idle": "Inactiviteitstekst tonen",
            "clear": "Niets tonen"
          }
        }
      }
    },
    {
      "key": "idleText",
      "label": "Leerlauf-Text",
      "type": "text",
      "default": "",
      "placeholder": "Im Leerlauf",
      "hint": "Erscheint im Leerlauf und ohne offene Datei. Leer = Standardtext.",
      "section": "Leerlauf",
      "i18n": {
        "en": {
          "label": "Idle text",
          "hint": "Shown when idle and when no file is open. Empty = default text.",
          "placeholder": "Idle",
          "section": "Idle"
        },
        "es": {
          "label": "Texto de inactividad",
          "hint": "Se muestra en inactividad y sin archivo abierto. Vacío = texto predeterminado.",
          "placeholder": "Inactivo",
          "section": "Inactividad"
        },
        "fr": {
          "label": "Texte d’inactivité",
          "hint": "Affiché en cas d’inactivité et sans fichier ouvert. Vide = texte par défaut.",
          "placeholder": "Inactif",
          "section": "Inactivité"
        },
        "pl": {
          "label": "Tekst bezczynności",
          "hint": "Pokazywany podczas bezczynności i bez otwartego pliku. Puste = tekst domyślny.",
          "placeholder": "Bezczynny",
          "section": "Bezczynność"
        },
        "it": {
          "label": "Testo di inattività",
          "hint": "Mostrato in caso di inattività e senza file aperto. Vuoto = testo predefinito.",
          "placeholder": "Inattivo",
          "section": "Inattività"
        },
        "pt": {
          "label": "Texto de ociosidade",
          "hint": "Exibido quando ocioso e sem arquivo aberto. Vazio = texto padrão.",
          "placeholder": "Ocioso",
          "section": "Ociosidade"
        },
        "nl": {
          "label": "Inactiviteitstekst",
          "hint": "Getoond bij inactiviteit en zonder geopend bestand. Leeg = standaardtekst.",
          "placeholder": "Inactief",
          "section": "Inactiviteit"
        }
      }
    },
    {
      "key": "privateMode",
      "label": "In privaten Projekten",
      "type": "select",
      "default": "names",
      "hint": "Ein Projekt wird privat über „Discord: Projekt privat schalten“ oder die Liste darunter.",
      "section": "Privatsphäre",
      "choices": [
        {
          "value": "names",
          "label": "Datei- und Projektnamen verbergen"
        },
        {
          "value": "hide",
          "label": "Gar nichts anzeigen"
        }
      ],
      "i18n": {
        "en": {
          "label": "In private projects",
          "hint": "Mark a project private with “Discord: Toggle Private Project” or the list below.",
          "section": "Privacy",
          "choices": {
            "names": "Hide file and project names",
            "hide": "Show nothing at all"
          }
        },
        "es": {
          "label": "En proyectos privados",
          "hint": "Marca un proyecto como privado con «Discord: Alternar proyecto privado» o con la lista de abajo.",
          "section": "Privacidad",
          "choices": {
            "names": "Ocultar nombres de archivo y proyecto",
            "hide": "No mostrar nada"
          }
        },
        "fr": {
          "label": "Dans les projets privés",
          "hint": "Rendez un projet privé avec « Discord : Basculer le projet privé » ou la liste ci-dessous.",
          "section": "Confidentialité",
          "choices": {
            "names": "Masquer les noms de fichier et de projet",
            "hide": "Ne rien afficher du tout"
          }
        },
        "pl": {
          "label": "W prywatnych projektach",
          "hint": "Oznacz projekt jako prywatny poleceniem „Discord: Przełącz projekt prywatny” lub listą poniżej.",
          "section": "Prywatność",
          "choices": {
            "names": "Ukryj nazwy plików i projektu",
            "hide": "Nie pokazuj niczego"
          }
        },
        "it": {
          "label": "Nei progetti privati",
          "hint": "Rendi privato un progetto con “Discord: Attiva/disattiva progetto privato” o con l’elenco qui sotto.",
          "section": "Privacy",
          "choices": {
            "names": "Nascondi i nomi di file e progetto",
            "hide": "Non mostrare nulla"
          }
        },
        "pt": {
          "label": "Em projetos privados",
          "hint": "Marque um projeto como privado com “Discord: Alternar projeto privado” ou com a lista abaixo.",
          "section": "Privacidade",
          "choices": {
            "names": "Ocultar nomes de arquivo e projeto",
            "hide": "Não mostrar nada"
          }
        },
        "nl": {
          "label": "In privéprojecten",
          "hint": "Maak een project privé met „Discord: Privéproject wisselen” of met de lijst hieronder.",
          "section": "Privacy",
          "choices": {
            "names": "Bestands- en projectnamen verbergen",
            "hide": "Helemaal niets tonen"
          }
        }
      }
    },
    {
      "key": "privateProjects",
      "label": "Private Ordner",
      "type": "textarea",
      "default": "",
      "rows": 3,
      "placeholder": "/home/ich/arbeit",
      "hint": "Ein absoluter Pfad pro Zeile; Projekte darin gelten als privat.",
      "section": "Privatsphäre",
      "i18n": {
        "en": {
          "label": "Private folders",
          "hint": "One absolute path per line; projects inside count as private.",
          "placeholder": "/home/me/work",
          "section": "Privacy"
        },
        "es": {
          "label": "Carpetas privadas",
          "hint": "Una ruta absoluta por línea; los proyectos dentro se consideran privados.",
          "placeholder": "/home/yo/trabajo",
          "section": "Privacidad"
        },
        "fr": {
          "label": "Dossiers privés",
          "hint": "Un chemin absolu par ligne ; les projets qu’il contient sont considérés comme privés.",
          "placeholder": "/home/moi/travail",
          "section": "Confidentialité"
        },
        "pl": {
          "label": "Prywatne foldery",
          "hint": "Jedna ścieżka bezwzględna na wiersz; projekty w środku są prywatne.",
          "placeholder": "/home/ja/praca",
          "section": "Prywatność"
        },
        "it": {
          "label": "Cartelle private",
          "hint": "Un percorso assoluto per riga; i progetti al suo interno sono privati.",
          "placeholder": "/home/io/lavoro",
          "section": "Privacy"
        },
        "pt": {
          "label": "Pastas privadas",
          "hint": "Um caminho absoluto por linha; os projetos dentro contam como privados.",
          "placeholder": "/home/eu/trabalho",
          "section": "Privacidade"
        },
        "nl": {
          "label": "Privémappen",
          "hint": "Eén absoluut pad per regel; projecten daarin gelden als privé.",
          "placeholder": "/home/ik/werk",
          "section": "Privacy"
        }
      }
    }
  ],
  "pages": [],
  "agents": [],
  "views": [],
  "commands": [
    {
      "id": "discord.reconnect",
      "title": "Discord: Neu verbinden",
      "category": "Discord",
      "icon": "refresh-cw",
      "i18n": {
        "en": {
          "title": "Discord: Reconnect"
        },
        "es": {
          "title": "Discord: Reconectar"
        },
        "fr": {
          "title": "Discord : Se reconnecter"
        },
        "pl": {
          "title": "Discord: Połącz ponownie"
        },
        "it": {
          "title": "Discord: Riconnetti"
        },
        "pt": {
          "title": "Discord: Reconectar"
        },
        "nl": {
          "title": "Discord: Opnieuw verbinden"
        }
      }
    },
    {
      "id": "discord.enable",
      "title": "Discord: Rich Presence einschalten",
      "category": "Discord",
      "icon": "play",
      "i18n": {
        "en": {
          "title": "Discord: Enable Rich Presence"
        },
        "es": {
          "title": "Discord: Activar Rich Presence"
        },
        "fr": {
          "title": "Discord : Activer la Rich Presence"
        },
        "pl": {
          "title": "Discord: Włącz Rich Presence"
        },
        "it": {
          "title": "Discord: Attiva Rich Presence"
        },
        "pt": {
          "title": "Discord: Ligar Rich Presence"
        },
        "nl": {
          "title": "Discord: Rich Presence aanzetten"
        }
      }
    },
    {
      "id": "discord.disable",
      "title": "Discord: Rich Presence ausschalten",
      "category": "Discord",
      "icon": "pause",
      "i18n": {
        "en": {
          "title": "Discord: Disable Rich Presence"
        },
        "es": {
          "title": "Discord: Desactivar Rich Presence"
        },
        "fr": {
          "title": "Discord : Désactiver la Rich Presence"
        },
        "pl": {
          "title": "Discord: Wyłącz Rich Presence"
        },
        "it": {
          "title": "Discord: Disattiva Rich Presence"
        },
        "pt": {
          "title": "Discord: Desligar Rich Presence"
        },
        "nl": {
          "title": "Discord: Rich Presence uitzetten"
        }
      }
    },
    {
      "id": "discord.toggle",
      "title": "Discord: Rich Presence ein-/ausschalten",
      "category": "Discord",
      "icon": "messages",
      "i18n": {
        "en": {
          "title": "Discord: Toggle Rich Presence"
        },
        "es": {
          "title": "Discord: Alternar Rich Presence"
        },
        "fr": {
          "title": "Discord : Basculer la Rich Presence"
        },
        "pl": {
          "title": "Discord: Przełącz Rich Presence"
        },
        "it": {
          "title": "Discord: Attiva/disattiva Rich Presence"
        },
        "pt": {
          "title": "Discord: Alternar Rich Presence"
        },
        "nl": {
          "title": "Discord: Rich Presence wisselen"
        }
      }
    },
    {
      "id": "discord.toggle-private",
      "title": "Discord: Projekt privat schalten",
      "category": "Discord",
      "icon": "eye-off",
      "i18n": {
        "en": {
          "title": "Discord: Toggle Private Project"
        },
        "es": {
          "title": "Discord: Alternar proyecto privado"
        },
        "fr": {
          "title": "Discord : Basculer le projet privé"
        },
        "pl": {
          "title": "Discord: Przełącz projekt prywatny"
        },
        "it": {
          "title": "Discord: Attiva/disattiva progetto privato"
        },
        "pt": {
          "title": "Discord: Alternar projeto privado"
        },
        "nl": {
          "title": "Discord: Privéproject wisselen"
        }
      }
    }
  ],
  "code": {
    "main": "import { createRequire as __lumenRequire } from 'node:module'; const require = __lumenRequire(import.meta.url);\nimport De from\"node:fs/promises\";import ve from\"node:path\";import{createConnection as Q}from\"node:net\";import{randomUUID as F}from\"node:crypto\";import x from\"node:path\";var ee=0,E=1,te=2,ne=3,ie=4;var re=1024*1024;function S(t,e){let n=Buffer.from(JSON.stringify(e??{}),\"utf8\"),i=Buffer.alloc(8);return i.writeInt32LE(t,0),i.writeInt32LE(n.length,4),Buffer.concat([i,n])}function oe(t){let e=[],n=0;for(;t.length-n>=8;){let i=t.readUInt32LE(n),r=t.readUInt32LE(n+4);if(t.length-n-8<r)break;let s=t.subarray(n+8,n+8+r).toString(\"utf8\");n+=8+r,e.push({op:i,data:se(s)})}return{frames:e,rest:t.subarray(n)}}function se(t){try{return JSON.parse(t)}catch{return null}}function ce(t=process.platform,e=process.env){let n=Array.from({length:10},(s,a)=>a);if(t===\"win32\")return n.map(s=>`\\\\\\\\?\\\\pipe\\\\discord-ipc-${s}`);let i=e.XDG_RUNTIME_DIR||e.TMPDIR||e.TMP||e.TEMP||\"/tmp\",r=n.map(s=>x.join(i,`discord-ipc-${s}`));if(!e.XDG_RUNTIME_DIR)return r;for(let s of[\"app/com.discordapp.Discord\",\"snap.discord\"])for(let a of n)r.push(x.join(e.XDG_RUNTIME_DIR,s,`discord-ipc-${a}`));return r}var y=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t);var T=class{constructor(e={}){this.throttleMs=e.throttleMs??15e3,this.retryMs=e.retryMs??15e3,this.maxRetryMs=e.maxRetryMs??6e4,this.handshakeTimeoutMs=e.handshakeTimeoutMs??1e4,this.socketPaths=e.socketPaths??(()=>ce()),this.onStatus=e.onStatus??(()=>{}),this.log=e.log??(n=>console.warn(`[discord] ${n}`)),this.pid=e.pid??process.pid,this.clientId=\"\",this.socket=null,this.buffer=Buffer.alloc(0),this.ready=!1,this.pending=void 0,this.lastSentJson=null,this.lastSentAt=0,this.nextRetryMs=this.retryMs,this.retryTimer=null,this.throttleTimer=null,this.handshakeTimer=null,this.current={state:\"disconnected\"},this.lastLogged=\"\",this.attempt=0,this.connecting=!1}status(){return this.current}update(e,n){let i=String(e??\"\").trim();if(!i||n===null){this.stop();return}if(i!==this.clientId&&(this.stop(),this.clientId=i),this.pending=n,this.socket){this.flush();return}this.retryTimer||this.connecting||this.connect()}reconnect(){if(this.nextRetryMs=this.retryMs,this.clearRetry(),this.dropSocket(),!this.clientId||!this.pending){this.setStatus({state:\"disconnected\"});return}this.connect()}stop(){this.pending=void 0,this.clearRetry(),this.clearThrottle();let e=this.socket;e&&this.ready&&!e.destroyed&&e.end(S(E,{cmd:\"SET_ACTIVITY\",args:{pid:this.pid,activity:null},nonce:F()})),this.dropSocket(),this.nextRetryMs=this.retryMs,this.setStatus({state:\"disconnected\"})}setStatus(e){let n=e.state===this.current.state&&e.message===this.current.message&&e.user===this.current.user;this.current=e,!n&&this.onStatus(e)}logOnce(e){e!==this.lastLogged&&(this.lastLogged=e,this.log(e))}clearRetry(){this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null)}clearThrottle(){this.throttleTimer&&(clearTimeout(this.throttleTimer),this.throttleTimer=null)}clearHandshake(){this.handshakeTimer&&(clearTimeout(this.handshakeTimer),this.handshakeTimer=null)}dropSocket(){this.attempt++,this.connecting=!1,this.clearHandshake(),this.clearThrottle();let e=this.socket;this.socket=null,this.ready=!1,this.buffer=Buffer.alloc(0),e&&(e.removeAllListeners(),e.on(\"error\",()=>{}),!e.destroyed&&!e.writableEnded&&e.destroy())}connect(){this.clearRetry(),this.connecting=!0,this.setStatus({state:\"connecting\"}),this.tryPath(this.socketPaths(),0,++this.attempt)}tryPath(e,n,i){if(i!==this.attempt||!this.pending||!this.clientId)return;if(n>=e.length){this.connecting=!1,this.setStatus({state:\"disconnected\"}),this.scheduleRetry();return}let r=Q(e[n]),s=()=>{r.removeAllListeners(),r.on(\"error\",()=>{}),r.destroy(),this.tryPath(e,n+1,i)};r.once(\"error\",s),r.once(\"connect\",()=>{r.off(\"error\",s),this.attach(r,i)})}attach(e,n){if(n!==this.attempt||!this.pending||!this.clientId){e.on(\"error\",()=>{}),e.destroy();return}this.connecting=!1,this.socket=e,this.ready=!1,this.buffer=Buffer.alloc(0),e.on(\"data\",i=>this.receive(e,i)),e.on(\"error\",i=>{e===this.socket&&this.logOnce(i.message)}),e.on(\"close\",()=>{e===this.socket&&(this.dropSocket(),this.current.state!==\"error\"&&this.setStatus({state:\"disconnected\"}),this.scheduleRetry())}),this.handshakeTimer=setTimeout(()=>{this.handshakeTimer=null,!(e!==this.socket||this.ready)&&(this.setStatus({state:\"error\",message:\"Handshake timeout\"}),e.destroy())},this.handshakeTimeoutMs),e.write(S(ee,{v:1,client_id:this.clientId}))}scheduleRetry(){if(this.retryTimer||!this.pending||!this.clientId)return;let e=this.nextRetryMs;this.nextRetryMs=Math.min(this.nextRetryMs*2,this.maxRetryMs),this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.connect()},e)}receive(e,n){if(e!==this.socket)return;let{frames:i,rest:r}=oe(Buffer.concat([this.buffer,n]));if(this.buffer=r,r.length>re){e.destroy();return}for(let s of i){if(e!==this.socket)return;this.handleFrame(e,s.op,s.data)}}handleFrame(e,n,i){if(n===ne){e.write(S(ie,i));return}if(n===te){let s=y(i)&&typeof i.message==\"string\"?i.message:\"Closed by Discord\";this.logOnce(s),this.setStatus({state:\"error\",message:s}),e.destroy();return}if(n!==E||!y(i))return;if(i.cmd===\"DISPATCH\"&&i.evt===\"READY\"){this.onReady(i.data);return}if(i.evt!==\"ERROR\")return;let r=y(i.data)&&typeof i.data.message==\"string\"?i.data.message:\"Discord error\";this.logOnce(r),this.setStatus({...this.current,message:r})}onReady(e){this.clearHandshake(),this.ready=!0,this.nextRetryMs=this.retryMs,this.lastLogged=\"\",this.lastSentJson=null;let n=y(e)&&y(e.user)?e.user:null,i=n&&typeof n.global_name==\"string\"?n.global_name:n?.username;this.setStatus({state:\"connected\",user:typeof i==\"string\"?i:void 0}),this.flush()}flush(){if(!this.ready||!this.socket||!this.pending)return;let e=JSON.stringify(this.pending);if(e===this.lastSentJson)return;let n=this.lastSentAt+this.throttleMs-Date.now();if(n>0){if(this.throttleTimer)return;this.throttleTimer=setTimeout(()=>{this.throttleTimer=null,this.flush()},n);return}this.lastSentJson=e,this.lastSentAt=Date.now(),this.socket.write(S(E,{cmd:\"SET_ACTIVITY\",args:{pid:this.pid,activity:this.pending},nonce:F()}))}};var ae=\"1550197013260275863\",de={clientId:ae,showFileName:\"true\",showProject:\"true\",showLanguage:\"true\",showElapsed:\"true\",elapsedFrom:\"session\",idleText:\"\",idleMinutes:\"5\",idleAction:\"idle\",repoButton:\"false\",privateMode:\"names\",privateProjects:\"\"},le=new Set([\"session\",\"project\",\"file\"]),ue=new Set([\"idle\",\"clear\"]),pe=new Set([\"names\",\"hide\"]),j=t=>t===\"true\"||t===!0,_=(t,e,n)=>t.has(e)?e:n;function z(t={}){let e={...de,...t},n=Number(e.idleMinutes);return{clientId:/^\\d{1,32}$/.test(String(e.clientId).trim())?String(e.clientId).trim():\"\",showFileName:j(e.showFileName),showProject:j(e.showProject),showLanguage:j(e.showLanguage),showElapsed:j(e.showElapsed),elapsedFrom:_(le,e.elapsedFrom,\"session\"),idleText:String(e.idleText??\"\").trim(),idleMinutes:Number.isFinite(n)&&n>0?n:0,idleAction:_(ue,e.idleAction,\"idle\"),repoButton:j(e.repoButton),privateMode:_(pe,e.privateMode,\"names\"),privateProjects:String(e.privateProjects??\"\").split(/\\r?\\n/).map(i=>i.trim()).filter(Boolean)}}var U=t=>String(t).replace(/\\\\/g,\"/\").replace(/\\/+$/,\"\");function $(t,e){if(!t)return!1;let n=U(t);return e.some(i=>{let r=U(i);return r?n===r||n.startsWith(`${r}/`):!1})}function he(t){let e=String(t??\"\").trim(),n=/^[\\w.-]+@([\\w.-]+):(?!\\/)(.+?)(?:\\.git)?\\/?$/.exec(e);if(n)return`https://${n[1]}/${n[2]}`;let i;try{i=new URL(e)}catch{return null}if(![\"https:\",\"http:\",\"ssh:\",\"git:\"].includes(i.protocol)||!i.hostname)return null;let r=i.pathname.replace(/\\.git\\/?$/,\"\").replace(/\\/+$/,\"\");if(!r||r===\"/\")return null;let s=i.protocol===\"http:\"?\"http:\":\"https:\",a=i.port&&(i.protocol===\"https:\"||i.protocol===\"http:\")?`:${i.port}`:\"\";return`${s}//${i.hostname}${a}${r}`}function H(t){let e=[],n=null;for(let r of String(t??\"\").split(/\\r?\\n/)){let s=/^\\s*\\[\\s*remote\\s+\"([^\"]+)\"\\s*\\]/.exec(r);if(s){n={name:s[1],url:null},e.push(n);continue}if(/^\\s*\\[/.test(r)){n=null;continue}let a=/^\\s*url\\s*=\\s*(.+?)\\s*$/.exec(r);n&&a&&!n.url&&(n.url=a[1])}let i=e.find(r=>r.name===\"origin\"&&r.url)??e.find(r=>r.url);return i?he(i.url):null}var fe=t=>String(t).split(/[\\\\/]/).filter(Boolean).pop()??String(t),me=t=>String(t).toLowerCase().replace(/[^a-z0-9_]/g,\"_\");function V(t,e,n){if(t.idle&&e.idleAction===\"clear\"||t.private&&e.privateMode===\"hide\")return null;let i=e.showFileName&&!t.private,r={},s=e.idleText||n(\"activity.idle\");r.details=s,t.file&&!t.idle&&i&&(r.details=n(\"activity.editing\",{file:fe(t.file.path)})),t.file&&!t.idle&&!i&&(r.details=n(\"activity.editingHidden\"));let a=t.project?.name;a&&e.showProject&&!t.private&&(r.state=n(\"activity.project\",{project:a})),a&&e.showProject&&t.private&&(r.state=n(\"activity.privateProject\")),e.showElapsed&&t.start&&(r.timestamps={start:t.start});let u=t.version?n(\"activity.version\",{version:t.version}):\"Lumen\";r.assets={large_image:\"lumen\",large_text:u},e.repoButton&&t.repoUrl&&!t.private&&(r.buttons=[{label:n(\"activity.repoButton\"),url:t.repoUrl}]);let l=t.file?.languageId;return!l||!e.showLanguage||t.idle||(r.assets={large_image:me(l),large_text:t.file.languageName||l,small_image:\"lumen\",small_text:u}),r}var b={de:{activity:{editing:\"Bearbeitet {file}\",editingHidden:\"Bearbeitet eine Datei\",idle:\"Im Leerlauf\",project:\"in {project}\",privateProject:\"in einem privaten Projekt\",version:\"Lumen {version}\",repoButton:\"Repository ansehen\"},status:{connected:\"Discord: verbunden\",connectedAs:\"Discord: verbunden als {user}\",connecting:\"Discord: verbinde \\u2026\",disconnected:\"Discord: nicht verbunden (l\\xE4uft Discord?)\",error:\"Discord: Fehler \\u2014 {message}\",disabled:\"Discord Rich Presence ist ausgeschaltet \\u2014 klicken zum Einschalten\",noClientId:\"Discord: keine Client-ID eingestellt\",click:\"Klicken, um neu zu verbinden\"},toast:{missingClientId:\"Discord Rich Presence braucht eine Client-ID: Anwendung unter discord.com/developers anlegen und die ID in den Einstellungen der Erweiterung eintragen.\",connecting:\"Verbinde mit Discord \\u2026\",connected:\"Mit Discord verbunden\",connectedAs:\"Mit Discord verbunden als {user}\",error:\"Discord: {message}\",enabled:\"Discord Rich Presence ist eingeschaltet\",disabled:\"Discord Rich Presence ist ausgeschaltet\",privateOn:\"\\u201E{project}\\u201C gilt jetzt als privat \\u2014 Namen erscheinen nicht in Discord\",privateOff:\"\\u201E{project}\\u201C ist nicht mehr privat\",noProject:\"Kein Projekt ge\\xF6ffnet.\"}},en:{activity:{editing:\"Editing {file}\",editingHidden:\"Editing a file\",idle:\"Idle\",project:\"in {project}\",privateProject:\"in a private project\",version:\"Lumen {version}\",repoButton:\"View repository\"},status:{connected:\"Discord: connected\",connectedAs:\"Discord: connected as {user}\",connecting:\"Discord: connecting\\u2026\",disconnected:\"Discord: not connected (is Discord running?)\",error:\"Discord: error \\u2014 {message}\",disabled:\"Discord Rich Presence is off \\u2014 click to turn it on\",noClientId:\"Discord: no client ID set\",click:\"Click to reconnect\"},toast:{missingClientId:\"Discord Rich Presence needs a client ID: create an application at discord.com/developers and enter its ID in the extension\\u2019s settings.\",connecting:\"Connecting to Discord\\u2026\",connected:\"Connected to Discord\",connectedAs:\"Connected to Discord as {user}\",error:\"Discord: {message}\",enabled:\"Discord Rich Presence is on\",disabled:\"Discord Rich Presence is off\",privateOn:\"\\u201C{project}\\u201D is now private \\u2014 names no longer appear in Discord\",privateOff:\"\\u201C{project}\\u201D is no longer private\",noProject:\"No project is open.\"}},es:{activity:{editing:\"Editando {file}\",editingHidden:\"Editando un archivo\",idle:\"Inactivo\",project:\"en {project}\",privateProject:\"en un proyecto privado\",version:\"Lumen {version}\",repoButton:\"Ver repositorio\"},status:{connected:\"Discord: conectado\",connectedAs:\"Discord: conectado como {user}\",connecting:\"Discord: conectando\\u2026\",disconnected:\"Discord: sin conexi\\xF3n (\\xBFest\\xE1 abierto Discord?)\",error:\"Discord: error \\u2014 {message}\",disabled:\"Discord Rich Presence est\\xE1 desactivado \\u2014 haz clic para activarlo\",noClientId:\"Discord: no hay ID de cliente\",click:\"Haz clic para reconectar\"},toast:{missingClientId:\"Discord Rich Presence necesita un ID de cliente: crea una aplicaci\\xF3n en discord.com/developers e introduce su ID en los ajustes de la extensi\\xF3n.\",connecting:\"Conectando con Discord\\u2026\",connected:\"Conectado a Discord\",connectedAs:\"Conectado a Discord como {user}\",error:\"Discord: {message}\",enabled:\"Discord Rich Presence est\\xE1 activado\",disabled:\"Discord Rich Presence est\\xE1 desactivado\",privateOn:\"\\xAB{project}\\xBB ahora es privado: los nombres ya no aparecen en Discord\",privateOff:\"\\xAB{project}\\xBB ya no es privado\",noProject:\"No hay ning\\xFAn proyecto abierto.\"}},fr:{activity:{editing:\"Modifie {file}\",editingHidden:\"Modifie un fichier\",idle:\"Inactif\",project:\"dans {project}\",privateProject:\"dans un projet priv\\xE9\",version:\"Lumen {version}\",repoButton:\"Voir le d\\xE9p\\xF4t\"},status:{connected:\"Discord : connect\\xE9\",connectedAs:\"Discord : connect\\xE9 en tant que {user}\",connecting:\"Discord : connexion\\u2026\",disconnected:\"Discord : non connect\\xE9 (Discord est-il lanc\\xE9 ?)\",error:\"Discord : erreur \\u2014 {message}\",disabled:\"Discord Rich Presence est d\\xE9sactiv\\xE9 \\u2014 cliquez pour l\\u2019activer\",noClientId:\"Discord : aucun ID client d\\xE9fini\",click:\"Cliquez pour vous reconnecter\"},toast:{missingClientId:\"Discord Rich Presence n\\xE9cessite un ID client : cr\\xE9ez une application sur discord.com/developers et saisissez son ID dans les param\\xE8tres de l\\u2019extension.\",connecting:\"Connexion \\xE0 Discord\\u2026\",connected:\"Connect\\xE9 \\xE0 Discord\",connectedAs:\"Connect\\xE9 \\xE0 Discord en tant que {user}\",error:\"Discord : {message}\",enabled:\"Discord Rich Presence est activ\\xE9\",disabled:\"Discord Rich Presence est d\\xE9sactiv\\xE9\",privateOn:\"\\xAB {project} \\xBB est d\\xE9sormais priv\\xE9 \\u2014 les noms n\\u2019apparaissent plus dans Discord\",privateOff:\"\\xAB {project} \\xBB n\\u2019est plus priv\\xE9\",noProject:\"Aucun projet ouvert.\"}},pl:{activity:{editing:\"Edytuje {file}\",editingHidden:\"Edytuje plik\",idle:\"Bezczynny\",project:\"w {project}\",privateProject:\"w prywatnym projekcie\",version:\"Lumen {version}\",repoButton:\"Zobacz repozytorium\"},status:{connected:\"Discord: po\\u0142\\u0105czono\",connectedAs:\"Discord: po\\u0142\\u0105czono jako {user}\",connecting:\"Discord: \\u0142\\u0105czenie\\u2026\",disconnected:\"Discord: brak po\\u0142\\u0105czenia (czy Discord dzia\\u0142a?)\",error:\"Discord: b\\u0142\\u0105d \\u2014 {message}\",disabled:\"Discord Rich Presence jest wy\\u0142\\u0105czony \\u2014 kliknij, aby w\\u0142\\u0105czy\\u0107\",noClientId:\"Discord: nie ustawiono ID klienta\",click:\"Kliknij, aby po\\u0142\\u0105czy\\u0107 ponownie\"},toast:{missingClientId:\"Discord Rich Presence wymaga ID klienta: utw\\xF3rz aplikacj\\u0119 na discord.com/developers i wpisz jej ID w ustawieniach rozszerzenia.\",connecting:\"\\u0141\\u0105czenie z Discordem\\u2026\",connected:\"Po\\u0142\\u0105czono z Discordem\",connectedAs:\"Po\\u0142\\u0105czono z Discordem jako {user}\",error:\"Discord: {message}\",enabled:\"Discord Rich Presence jest w\\u0142\\u0105czony\",disabled:\"Discord Rich Presence jest wy\\u0142\\u0105czony\",privateOn:\"\\u201E{project}\\u201D jest teraz prywatny \\u2014 nazwy nie pojawiaj\\u0105 si\\u0119 w Discordzie\",privateOff:\"\\u201E{project}\\u201D nie jest ju\\u017C prywatny\",noProject:\"Nie otwarto \\u017Cadnego projektu.\"}},it:{activity:{editing:\"Modifica {file}\",editingHidden:\"Modifica un file\",idle:\"Inattivo\",project:\"in {project}\",privateProject:\"in un progetto privato\",version:\"Lumen {version}\",repoButton:\"Vedi repository\"},status:{connected:\"Discord: connesso\",connectedAs:\"Discord: connesso come {user}\",connecting:\"Discord: connessione\\u2026\",disconnected:\"Discord: non connesso (Discord \\xE8 in esecuzione?)\",error:\"Discord: errore \\u2014 {message}\",disabled:\"Discord Rich Presence \\xE8 disattivato \\u2014 fai clic per attivarlo\",noClientId:\"Discord: nessun ID client impostato\",click:\"Fai clic per riconnettere\"},toast:{missingClientId:\"Discord Rich Presence richiede un ID client: crea un\\u2019applicazione su discord.com/developers e inserisci il suo ID nelle impostazioni dell\\u2019estensione.\",connecting:\"Connessione a Discord\\u2026\",connected:\"Connesso a Discord\",connectedAs:\"Connesso a Discord come {user}\",error:\"Discord: {message}\",enabled:\"Discord Rich Presence \\xE8 attivo\",disabled:\"Discord Rich Presence \\xE8 disattivato\",privateOn:\"\\u201C{project}\\u201D ora \\xE8 privato: i nomi non compaiono pi\\xF9 su Discord\",privateOff:\"\\u201C{project}\\u201D non \\xE8 pi\\xF9 privato\",noProject:\"Nessun progetto aperto.\"}},pt:{activity:{editing:\"Editando {file}\",editingHidden:\"Editando um arquivo\",idle:\"Ocioso\",project:\"em {project}\",privateProject:\"em um projeto privado\",version:\"Lumen {version}\",repoButton:\"Ver reposit\\xF3rio\"},status:{connected:\"Discord: conectado\",connectedAs:\"Discord: conectado como {user}\",connecting:\"Discord: conectando\\u2026\",disconnected:\"Discord: desconectado (o Discord est\\xE1 aberto?)\",error:\"Discord: erro \\u2014 {message}\",disabled:\"O Discord Rich Presence est\\xE1 desligado \\u2014 clique para ligar\",noClientId:\"Discord: nenhum ID do cliente definido\",click:\"Clique para reconectar\"},toast:{missingClientId:\"O Discord Rich Presence precisa de um ID do cliente: crie uma aplica\\xE7\\xE3o em discord.com/developers e informe o ID nas configura\\xE7\\xF5es da extens\\xE3o.\",connecting:\"Conectando ao Discord\\u2026\",connected:\"Conectado ao Discord\",connectedAs:\"Conectado ao Discord como {user}\",error:\"Discord: {message}\",enabled:\"O Discord Rich Presence est\\xE1 ligado\",disabled:\"O Discord Rich Presence est\\xE1 desligado\",privateOn:\"\\u201C{project}\\u201D agora \\xE9 privado \\u2014 os nomes n\\xE3o aparecem mais no Discord\",privateOff:\"\\u201C{project}\\u201D n\\xE3o \\xE9 mais privado\",noProject:\"Nenhum projeto aberto.\"}},nl:{activity:{editing:\"Bewerkt {file}\",editingHidden:\"Bewerkt een bestand\",idle:\"Inactief\",project:\"in {project}\",privateProject:\"in een priv\\xE9project\",version:\"Lumen {version}\",repoButton:\"Repository bekijken\"},status:{connected:\"Discord: verbonden\",connectedAs:\"Discord: verbonden als {user}\",connecting:\"Discord: verbinden\\u2026\",disconnected:\"Discord: niet verbonden (draait Discord?)\",error:\"Discord: fout \\u2014 {message}\",disabled:\"Discord Rich Presence staat uit \\u2014 klik om het aan te zetten\",noClientId:\"Discord: geen client-ID ingesteld\",click:\"Klik om opnieuw te verbinden\"},toast:{missingClientId:\"Discord Rich Presence heeft een client-ID nodig: maak een applicatie aan op discord.com/developers en vul de ID in bij de instellingen van de extensie.\",connecting:\"Verbinden met Discord\\u2026\",connected:\"Verbonden met Discord\",connectedAs:\"Verbonden met Discord als {user}\",error:\"Discord: {message}\",enabled:\"Discord Rich Presence staat aan\",disabled:\"Discord Rich Presence staat uit\",privateOn:\"\\u201E{project}\\u201D is nu priv\\xE9 \\u2014 namen verschijnen niet meer in Discord\",privateOff:\"\\u201E{project}\\u201D is niet langer priv\\xE9\",noProject:\"Geen project geopend.\"}}},Te=Object.keys(b);function G(t,e){let n=t;for(let i of e.split(\".\")){if(!n||typeof n!=\"object\")return;n=n[i]}return typeof n==\"string\"?n:void 0}function ge(t){let e=String(t.locale?.()??\"en\");if(b[e])return e;let n=e.split(\"-\")[0];return b[n]?n:\"en\"}function J(t){return(e,n={})=>{let i=G(b[ge(t)],e)??G(b.en,e)??e;return String(i).replace(/\\{(\\w+)\\}/g,(r,s)=>s in n?String(n[s]):r)}}var ye=600,je=3e4,K={connected:{icon:\"messages\",tone:\"success\"},connecting:{icon:\"loader\",tone:\"muted\"},disconnected:{icon:\"circle-dashed\",tone:\"muted\"},error:{icon:\"circle-alert\",tone:\"danger\"}};async function be(t){if(!t)return null;let e=await De.readFile(ve.join(t,\".git\",\"config\"),\"utf8\").catch(()=>null);return e?H(e):null}function _e(t){let e=J(t),n=Date.now(),i=z(t.settings.all()),r=t.storage.get(\"enabled\",!0)!==!1,s=t.storage.get(\"privateProjects\",[]);Array.isArray(s)||(s=[]);let a=t.events.last(\"activeFile\"),u=t.events.last(\"project\"),l=a?.path?a:null,d=u?.root?{root:u.root,name:u.name}:null,B=Date.now(),L=Date.now(),I=null,k=!1,A=null,m=null,P=null,p=!1,w=!1,g=\"\",M=!1,h=new T({onStatus(o){v(),Y(o)},log:o=>t.log(o)}),X=()=>!!d&&$(d.root,[...i.privateProjects,...s]);function q(){return i.elapsedFrom===\"file\"&&l?B:i.elapsedFrom===\"project\"&&d?L:n}function f(){if(p||!Object.keys(t.settings.all()).length)return;if(!r){h.stop();return}if(!i.clientId){if(h.stop(),M)return;M=!0,t.ui.notify(e(\"toast.missingClientId\"),\"info\");return}let o=V({file:l?{path:l.path,languageId:l.languageId,languageName:l.languageName}:null,project:d,private:X(),idle:k,start:q(),version:t.appVersion,repoUrl:A},i,e);h.update(i.clientId,o)}function D(){m||p||(m=setTimeout(()=>{m=null,f()},ye))}function v(){if(p)return;if(!r){t.statusBar.set(\"status\",{text:\"Discord\",icon:\"pause\",tone:\"muted\",tooltip:e(\"status.disabled\"),command:\"discord.enable\",side:\"right\",priority:5});return}let o=h.status(),c=K[o.state]??K.disconnected;t.statusBar.set(\"status\",{text:\"Discord\",icon:c.icon,tone:c.tone,tooltip:`${W(o)}\n${e(\"status.click\")}`,command:\"discord.reconnect\",side:\"right\",priority:5})}function W(o){return i.clientId?o.state===\"connected\"&&o.user?e(\"status.connectedAs\",{user:o.user}):o.state===\"error\"?e(\"status.error\",{message:o.message??\"\"}):e(`status.${o.state}`):e(\"status.noClientId\")}function Y(o){if(!p){if(o.state===\"connected\"&&w){w=!1,t.ui.notify(o.user?e(\"toast.connectedAs\",{user:o.user}):e(\"toast.connected\"),\"success\");return}o.state!==\"error\"||!o.message||o.message===g||(g=o.message,t.ui.notify(e(\"toast.error\",{message:o.message}),\"warning\"))}}function O(){let o=I!==null&&i.idleMinutes>0&&Date.now()-I>=i.idleMinutes*6e4;o!==k&&(k=o,f())}function C(){P&&(clearInterval(P),P=null)}function R(o){r=o,t.storage.set(\"enabled\",o),g=\"\",w=o,t.ui.notify(e(o?\"toast.enabled\":\"toast.disabled\"),\"info\"),v(),f()}let Z={\"discord.reconnect\":()=>{if(!r){R(!0);return}if(!i.clientId){t.ui.notify(e(\"toast.missingClientId\"),\"info\");return}w=!0,g=\"\",t.ui.notify(e(\"toast.connecting\"),\"info\"),f(),h.reconnect()},\"discord.enable\":()=>R(!0),\"discord.disable\":()=>R(!1),\"discord.toggle\":()=>R(!r),\"discord.toggle-private\":()=>{if(!d){t.ui.notify(e(\"toast.noProject\"),\"info\");return}let o=s.includes(d.root);s=o?s.filter(c=>c!==d.root):[...s,d.root],t.storage.set(\"privateProjects\",s),t.ui.notify(e(o?\"toast.privateOff\":\"toast.privateOn\",{project:d.name??d.root}),\"info\"),f()}};for(let[o,c]of Object.entries(Z))t.commands.register(o,c);async function N(){let o=d?.root??null,c=await be(o);p||(d?.root??null)!==o||(A=c,D())}return t.events.on(\"activeFile\",o=>{let c=o.path?o:null;c?.path!==l?.path&&(B=Date.now()),l=c,D()}),t.events.on(\"project\",o=>{let c=o.root??null;c!==(d?.root??null)&&(L=Date.now()),d=c?{root:c,name:o.name}:null,A=null,N(),D()}),t.events.on(\"windowBlur\",()=>{I=Date.now(),C(),P=setInterval(O,je)}),t.events.on(\"windowFocus\",()=>{I=null,C(),O()}),t.events.on(\"locale\",()=>{v(),D()}),t.settings.onDidChange(o=>{let c=i.clientId;i=z(o),i.clientId!==c&&(M=!1),g=\"\",v(),O(),D()}),v(),N(),f(),()=>{p=!0,m&&clearTimeout(m),C(),h.stop()}}export{_e as activate};\n"
  },
  "addon": {
    "schema": 1,
    "languages": [],
    "themes": [],
    "commands": [],
    "events": [],
    "templates": [],
    "projectKinds": [],
    "snippets": [],
    "id": "ext.discord",
    "name": "Discord Rich Presence",
    "version": "1.0.1",
    "description": "Zeigt in Discord, woran du arbeitest: Datei, Projekt, Sprache und Dauer — mit Leerlauf, privaten Projekten und Repository-Knopf. Bringt Programmcode mit.",
    "author": "Lumen",
    "icon": "DC",
    "color": "#5865f2",
    "category": "tool"
  }
}
