/**
 * User-facing strings in generated template files (Makefile, .env.example).
 * Keys must match the language used by the CLI (en, pt, es).
 *
 * @module scaffold/shared/template-strings
 */

const TEMPLATE_STRINGS = {
  en: {
    launch: { dev: 'dev', prod: 'prod' },
    features: {
      comment1: '/// Feature flags — generated by Kasy CLI based on user choices.',
      comment2: '/// When false, the router skips that feature\'s routes and the guard ignores it.',
      comment3: '/// When true, the app includes web support:',
      comment4: '///   - anonymous sign-up is disabled on web (user is redirected to /signin)',
      comment5: '///   - onboarding is skipped on web',
      comment6: '///   - home widgets and background fetch are no-ops on web',
      comment7: '/// When true, RevenueCat Web Billing is enabled for subscriptions on web.',
    },
    makefile: {
      comment1: '# Run the app — Flutter picks the first available device',
      comment2: '# Usage: make run | make run-ios | make run-android | make run-web',
      comment3: "# Hot reload: press 'r' in the terminal while the app is running",
      comment4: '# run-ios/run-android: shows device list — select iPhone, simulator or Android',
      releaseIos: '# iOS App Store release (requires: kasy ios configure)',
      releaseIosTarget: 'release-ios',
    },
    envExample: {
      generated: '# Generated by Kasy CLI',
      dartDefine: '# Copy this file to .env for local development',
      envSource: '# .env is the local source of truth. --dart-define remains supported for CI/release.',
      envDev: 'ENV=dev   # or prod',
      supabase: '# Supabase',
      apiRest: '# API REST',
      revenuecat: '# RevenueCat',
      revenuecatTest: '# Test Store key (test_xxx) — auto-used on simulator/emulator',
      revenuecatProd: '# Production keys — auto-used on physical devices',
      sentry: '# Sentry (prod only)',
      mixpanel: '# Mixpanel',
      llmChat: '# LLM Chat — Cloud/Edge Function endpoint (API key stays on the server, not here)',
    },
  },
  pt: {
    launch: { dev: 'desenv', prod: 'prod' },
    features: {
      comment1: '/// Feature flags — gerado pelo Kasy CLI conforme escolhas do usuário.',
      comment2: '/// Quando false, o router ignora as rotas dessa feature e o guard ignora.',
      comment3: '/// Quando true, o app inclui suporte web:',
      comment4: '///   - cadastro anônimo desativado na web (usuário redirecionado para /signin)',
      comment5: '///   - onboarding ignorado na web',
      comment6: '///   - home widgets e background fetch são no-op na web',
      comment7: '/// Quando true, RevenueCat Web Billing está ativo para assinaturas na web.',
    },
    makefile: {
      comment1: '# Rode o app — Flutter escolhe o primeiro dispositivo disponível',
      comment2: '# Uso: make run | make run-ios | make run-android | make run-web',
      comment3: "# Hot reload: pressione 'r' no terminal enquanto o app roda",
      comment4: '# run-ios/run-android: mostra lista de dispositivos — selecione iPhone, simulador ou Android',
      releaseIos: '# Release iOS na App Store (requer: kasy ios configure)',
      releaseIosTarget: 'release-ios',
    },
    envExample: {
      generated: '# Gerado pelo Kasy CLI',
      dartDefine: '# Copie este arquivo para .env no desenvolvimento local',
      envSource: '# O .env é a fonte local. --dart-define segue suportado para CI/release.',
      envDev: 'ENV=dev   # ou prod',
      supabase: '# Supabase',
      apiRest: '# API REST',
      revenuecat: '# RevenueCat',
      revenuecatTest: '# Chave Test Store (test_xxx) — usada automaticamente em simulador/emulador',
      revenuecatProd: '# Chaves de produção — usadas automaticamente em dispositivo físico',
      sentry: '# Sentry (apenas prod)',
      mixpanel: '# Mixpanel',
      llmChat: '# LLM Chat — endpoint da Cloud/Edge Function (a chave de API fica no servidor, não aqui)',
    },
  },
  es: {
    launch: { dev: 'dev', prod: 'prod' },
    features: {
      comment1: '/// Feature flags — generado por Kasy CLI según elecciones del usuario.',
      comment2: '/// Cuando false, el router ignora las rutas de esa feature y el guard ignora.',
      comment3: '/// Cuando true, el app incluye soporte web:',
      comment4: '///   - registro anónimo desactivado en web (usuario redirigido a /signin)',
      comment5: '///   - onboarding ignorado en web',
      comment6: '///   - home widgets y background fetch son no-op en web',
      comment7: '/// Cuando true, RevenueCat Web Billing está activo para suscripciones en web.',
    },
    makefile: {
      comment1: '# Ejecuta el app — Flutter elige el primer dispositivo disponible',
      comment2: '# Uso: make run | make run-ios | make run-android | make run-web',
      comment3: "# Hot reload: pulsa 'r' en la terminal mientras el app corre",
      comment4: '# run-ios/run-android: muestra lista de dispositivos — selecciona iPhone, simulador o Android',
      releaseIos: '# Release iOS en App Store (requiere: kasy ios configure)',
      releaseIosTarget: 'release-ios',
    },
    envExample: {
      generated: '# Generado por Kasy CLI',
      dartDefine: '# Copia este archivo a .env para desarrollo local',
      envSource: '# .env es la fuente local. --dart-define sigue soportado para CI/release.',
      envDev: 'ENV=dev   # o prod',
      supabase: '# Supabase',
      apiRest: '# API REST',
      revenuecat: '# RevenueCat',
      revenuecatTest: '# Clave Test Store (test_xxx) — se usa automáticamente en simulador/emulador',
      revenuecatProd: '# Claves de producción — se usan automáticamente en dispositivo físico',
      sentry: '# Sentry (solo prod)',
      mixpanel: '# Mixpanel',
      llmChat: '# LLM Chat — endpoint de Cloud/Edge Function (la clave de API queda en el servidor, no aquí)',
    },
  },
};

function getStrings(lang) {
  const l = lang && TEMPLATE_STRINGS[lang] ? lang : 'en';
  return TEMPLATE_STRINGS[l];
}

module.exports = { TEMPLATE_STRINGS, getStrings };
