import { i18n } from "@mariozechner/mini-lit"; import { Dialog, DialogContent, DialogHeader, } from "@mariozechner/mini-lit/dist/Dialog.js"; import { Input } from "@mariozechner/mini-lit/dist/Input.js"; import { Label } from "@mariozechner/mini-lit/dist/Label.js"; import { Switch } from "@mariozechner/mini-lit/dist/Switch.js"; import { getProviders } from "@mariozechner/pi-ai"; import { html, LitElement, type TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators.js"; import "../components/ProviderKeyInput.js"; import { getAppStorage } from "../storage/app-storage.js"; // Base class for settings tabs export abstract class SettingsTab extends LitElement { abstract getTabName(): string; protected createRenderRoot() { return this; } } // API Keys Tab @customElement("api-keys-tab") export class ApiKeysTab extends SettingsTab { getTabName(): string { return i18n("API Keys"); } render(): TemplateResult { const providers = getProviders(); return html`
${i18n( "Configure API keys for LLM providers. Keys are stored locally in your browser.", )}
${providers.map( (provider) => html`${i18n( "Allows browser-based apps to bypass CORS restrictions when calling LLM providers. Required for Z-AI and Anthropic with OAuth token.", )}
${i18n(
"Format: The proxy must accept requests as