untitled

Pasted Nov 13, 2026, 5:09 AM1 file881 lines

Scan to open on your phone

Point a camera at the QR code - it opens this exact paste, no app needed.

https://codepastes.com/zzgs6ak4xj83fsar
untitled
@Composable
fun PrestigeCleanMainContent(
    idUsuario: String,
    nombreCompleto: String,
    rol: String,
    biometriaDisponible: Boolean,
    biometriaActivada: Boolean,
    onCambiarBiometria: () -> Unit,
    onCerrarSesion: () -> Unit
) {
    var selectedTab by remember { mutableStateOf("Inicio") }


    var ventaInicialId by remember {
        mutableStateOf<String?>(null)
    }
    var mostrarFormularioProducto by remember { mutableStateOf(false) }
    var mostrarRegistrosInactivos by remember {
        mutableStateOf(false)
    }
    var productoSeleccionado by remember {
        mutableStateOf<ProductoEntity?>(null)
    }
    var mostrarFormularioAroma by remember {
        mutableStateOf(false)
    }
    var aromaSeleccionado by remember {
        mutableStateOf<AromaEntity?>(null)
    }
    var mostrarFormularioPresentacion by remember {
        mutableStateOf(false)
    }
    var mensajeAroma by remember {
        mutableStateOf<String?>(null)
    }
    var presentacionSeleccionada by remember {
        mutableStateOf<PresentacionEntity?>(null)
    }
    val context = LocalContext.current

    val scope = rememberCoroutineScope()



    val productoDao = remember {
        DatabaseProvider.obtenerBaseDatos(context).productoDao()
    }
    val productos by productoDao.obtenerProductos()
        .collectAsState(initial = emptyList())
    val productosInactivos by productoDao.obtenerProductosInactivos()
        .collectAsState(initial = emptyList())
    val aromasInactivos by productoDao.obtenerTodosAromasInactivos()
        .collectAsState(initial = emptyList())

    val presentacionesInactivas by productoDao.obtenerTodasPresentacionesInactivas()
        .collectAsState(initial = emptyList())
    val todosProductos by productoDao.obtenerTodosProductos()
        .collectAsState(initial = emptyList())

    val todosAromas by productoDao.obtenerTodosAromas()
        .collectAsState(initial = emptyList())
    val aromasFlow = remember(productoSeleccionado?.id) {
        productoSeleccionado?.let {
            productoDao.obtenerAromas(it.id)
        } ?: kotlinx.coroutines.flow.flowOf(emptyList())
    }

    val aromas by aromasFlow.collectAsState(initial = emptyList())
    val presentacionesFlow = remember(aromaSeleccionado?.id) {
        aromaSeleccionado?.let {
            productoDao.obtenerPresentaciones(it.id)
        } ?: kotlinx.coroutines.flow.flowOf(emptyList())
    }

    val presentaciones by presentacionesFlow.collectAsState(initial = emptyList())

    val todasPresentacionesActivas by productoDao
        .obtenerTodasPresentacionesActivas()
        .collectAsState(initial = emptyList())
    val inventarios by productoDao
        .obtenerTodoInventario()
        .collectAsState(initial = emptyList())
    val clientes by productoDao.obtenerClientes()
        .collectAsState(initial = emptyList())
    val ventas by productoDao.obtenerVentas()
        .collectAsState(initial = emptyList())
    val todosLosPagos by productoDao.obtenerTodosLosPagos()
        .collectAsState(initial = emptyList())
    val lotes by productoDao.obtenerLotes()
        .collectAsState(initial = emptyList())

    val todosDetallesLote by productoDao.obtenerTodosDetallesLote()
        .collectAsState(initial = emptyList())

    val todosGastosLote by productoDao.obtenerTodosGastosLote()
        .collectAsState(initial = emptyList())

    val todosInventariosLote by productoDao.obtenerTodosInventariosLote()
        .collectAsState(initial = emptyList())
    val ingresosPorLoteYSede by productoDao
        .obtenerIngresosPorLoteYSede()
        .collectAsState(initial = emptyList())


    // FECHAS DEL DIA ACTUAL
    var inicioDia by remember {
        mutableStateOf(
            Calendar.getInstance().apply {
                set(Calendar.HOUR_OF_DAY, 0)
                set(Calendar.MINUTE, 0)
                set(Calendar.SECOND, 0)
                set(Calendar.MILLISECOND, 0)
            }.timeInMillis
        )
    }

    val finDia = remember(inicioDia) {
        Calendar.getInstance().apply {
            timeInMillis = inicioDia
            add(Calendar.DAY_OF_MONTH, 1)
        }.timeInMillis
    }

// ACTUALIZAR AUTOMATICAMENTE AL LLEGAR LA MEDIANOCHE
    LaunchedEffect(Unit) {
        while (true) {
            val ahora = Calendar.getInstance()

            val proximaMedianoche = (ahora.clone() as Calendar).apply {
                set(Calendar.HOUR_OF_DAY, 0)
                set(Calendar.MINUTE, 0)
                set(Calendar.SECOND, 0)
                set(Calendar.MILLISECOND, 0)
                add(Calendar.DAY_OF_MONTH, 1)
            }.timeInMillis

            val tiempoEspera = proximaMedianoche - System.currentTimeMillis()

            kotlinx.coroutines.delay(tiempoEspera.coerceAtLeast(1L))

            inicioDia = Calendar.getInstance().apply {
                set(Calendar.HOUR_OF_DAY, 0)
                set(Calendar.MINUTE, 0)
                set(Calendar.SECOND, 0)
                set(Calendar.MILLISECOND, 0)
            }.timeInMillis
        }
    }

// ESTADISTICAS DE ROOM

    val ventasDelDia by productoDao
        .obtenerVentasDelDia(inicioDia, finDia)
        .collectAsState(initial = 0.0)

    val dineroRecibidoHoy by productoDao
        .obtenerDineroRecibidoDelDia(inicioDia, finDia)
        .collectAsState(initial = 0.0)

    val totalPorCobrar by productoDao
        .obtenerTotalPorCobrar()
        .collectAsState(initial = 0.0)

    val inventarioDisponible by productoDao
        .obtenerInventarioDisponible()
        .collectAsState(initial = 0)

// FORMATO DE PESOS COLOMBIANOS

    val formatoPesos = remember {
        NumberFormat.getCurrencyInstance(Locale("es", "CO")).apply {
            maximumFractionDigits = 0
            minimumFractionDigits = 0
        }
    }

    Scaffold(
        containerColor = Navy,
        floatingActionButton = {},
        bottomBar = {
            NavigationBar(
                containerColor = CardBlue,
                contentColor = White
            ) {
                NavigationBarItem(
                    selected = selectedTab == "Inicio",
                    onClick = { selectedTab = "Inicio" },
                    icon = { Text("⌂", fontSize = 22.sp) },
                    label = { Text("Inicio") },
                    colors = navColors()
                )

                NavigationBarItem(
                    selected = selectedTab == "Ventas",
                    onClick = { selectedTab = "Ventas" },
                    icon = { Text("$", fontSize = 22.sp) },
                    label = { Text("Ventas") },
                    colors = navColors()
                )

                NavigationBarItem(
                    selected = selectedTab == "Productos",
                    onClick = { selectedTab = "Productos" },
                    icon = {
                        Icon(
                            painter = painterResource(id = R.drawable.ic_bottle),
                            contentDescription = "Productos",
                            tint = navColors().unselectedIconColor
                        )
                    },
                    label = { Text("Productos") },
                    colors = navColors()
                )

                NavigationBarItem(
                    selected = selectedTab == "Clientes",
                    onClick = { selectedTab = "Clientes" },
                    icon = { Text("♙", fontSize = 22.sp) },
                    label = { Text("Clientes") },
                    colors = navColors()
                )

                NavigationBarItem(
                    selected = selectedTab == "Reportes",
                    onClick = { selectedTab = "Reportes" },
                    icon = { Text("▤", fontSize = 22.sp) },
                    label = { Text("Reportes") },
                    colors = navColors()
                )
            }
        }
    ) { innerPadding ->

        when (selectedTab) {
            "Inicio" -> DashboardScreen(
                modifier = Modifier.padding(innerPadding),
                onNavigate = { selectedTab = it },
                ventasHoy = formatoPesos.format(ventasDelDia),
                dineroRecibido = formatoPesos.format(dineroRecibidoHoy),
                porCobrar = formatoPesos.format(totalPorCobrar),
                inventario = inventarioDisponible.toString(),
                idUsuario = idUsuario,
                nombreCompleto = nombreCompleto,
                rol = rol,
                onCerrarSesion = onCerrarSesion
            )

            "Ventas" -> VentaScreen(
                modifier = Modifier.padding(innerPadding),
                clientes = clientes,
                productos = productos,
                aromas = todosAromas.filter { it.activo },
                presentaciones = todasPresentacionesActivas,
                productoDao = productoDao,
                onVolver = { selectedTab = "Inicio" }
            )


            "Productos" -> {
                Box(
                    modifier = Modifier
                        .padding(innerPadding)
                        .fillMaxSize()
                ) {
                    when {
                        mostrarRegistrosInactivos -> {
                            RegistrosInactivosScreen(
                                productos = productosInactivos,
                                aromas = aromasInactivos,
                                presentaciones = presentacionesInactivas,
                                todosProductos = todosProductos,
                                todosAromas = todosAromas,
                                onVolver = {
                                    mostrarRegistrosInactivos = false
                                },
                                onReactivarProducto = { producto ->
                                    scope.launch {
                                        productoDao.reactivarProducto(producto.id)
                                    }
                                },
                                onReactivarAroma = { aroma ->
                                    scope.launch {
                                        productoDao.reactivarAroma(aroma.id)
                                    }
                                },
                                onReactivarPresentacion = { presentacion ->
                                    scope.launch {
                                        productoDao.reactivarPresentacion(presentacion.id)
                                    }
                                }
                            )
                        }

                        mostrarFormularioProducto -> {
                            AgregarProductoScreen(
                                onVolver = {
                                    mostrarFormularioProducto = false
                                },
                                onGuardar = { nombre, tipo, aroma ->
                                    scope.launch {
                                        try {
                                            val nuevoProductoId = UUID.randomUUID().toString()

                                            val nuevoProducto = ProductoEntity(
                                                id = nuevoProductoId,
                                                nombre = nombre,
                                                tipo = tipo
                                            )

                                            val nuevoAroma = AromaEntity(
                                                id = UUID.randomUUID().toString(),
                                                productoId = nuevoProductoId,
                                                nombre = aroma
                                            )

                                            productoDao.guardarProducto(nuevoProducto)
                                            productoDao.guardarAroma(nuevoAroma)

                                            mostrarFormularioProducto = false
                                        } catch (e: Exception) {
                                            mensajeAroma = e.message
                                                ?: "No se pudo guardar el producto."
                                        }
                                    }
                                }
                            )
                        }

                        productoSeleccionado != null &&
                                mostrarFormularioAroma -> {
                            AgregarAromaScreen(
                                nombreProducto = productoSeleccionado!!.nombre,
                                onVolver = {
                                    mostrarFormularioAroma = false
                                },
                                onGuardar = { nombre ->
                                    scope.launch {
                                        try {
                                            val nuevoAroma = AromaEntity(
                                                id = UUID.randomUUID().toString(),
                                                productoId = productoSeleccionado!!.id,
                                                nombre = nombre
                                            )

                                            productoDao.guardarAroma(nuevoAroma)
                                            mostrarFormularioAroma = false
                                        } catch (e: Exception) {
                                            mensajeAroma = e.message
                                                ?: "No se pudo guardar el aroma."
                                        }
                                    }
                                }
                            )
                        }

                        productoSeleccionado != null &&
                                aromaSeleccionado != null &&
                                mostrarFormularioPresentacion -> {
                            AgregarPresentacionScreen(
                                nombreProducto = productoSeleccionado!!.nombre,
                                nombreAroma = aromaSeleccionado!!.nombre,
                                onVolver = {
                                    mostrarFormularioPresentacion = false
                                },
                                onGuardar = { nombre, contenido, precio, fotoUri ->
                                    scope.launch {
                                        try {
                                            val nuevaPresentacion = PresentacionEntity(
                                                id = UUID.randomUUID().toString(),
                                                aromaId = aromaSeleccionado!!.id,
                                                nombre = nombre,
                                                contenidoMl = contenido,
                                                precio = precio,
                                                fotoUri = fotoUri

                                            )

                                            productoDao.guardarPresentacion(nuevaPresentacion)
                                            mostrarFormularioPresentacion = false
                                        } catch (e: Exception) {
                                            mensajeAroma = e.message
                                                ?: "No se pudo guardar la presentación."
                                        }
                                    }
                                }
                            )
                        }

                        productoSeleccionado != null &&
                                aromaSeleccionado != null &&
                                presentacionSeleccionada != null -> {
                            EditarPresentacionScreen(
                                nombreProducto = productoSeleccionado!!.nombre,
                                nombreAroma = aromaSeleccionado!!.nombre,
                                presentacion = presentacionSeleccionada!!,
                                onVolver = {
                                    presentacionSeleccionada = null
                                },
                                onGuardar = { nombre, contenido, precio, fotoUri ->
                                    scope.launch {
                                        try {
                                            val actualizada = presentacionSeleccionada!!.copy(
                                                nombre = nombre,
                                                contenidoMl = contenido,
                                                precio = precio,
                                                fotoUri = fotoUri
                                            )

                                            productoDao.guardarPresentacion(actualizada)
                                            presentacionSeleccionada = null
                                        } catch (e: Exception) {
                                            mensajeAroma = e.message
                                                ?: "No se pudo actualizar la presentación."
                                        }
                                    }
                                },
                                onEliminar = {
                                    scope.launch {
                                        try {
                                            productoDao.eliminarPresentacion(
                                                presentacionSeleccionada!!.id
                                            )
                                            presentacionSeleccionada = null
                                        } catch (e: Exception) {
                                            mensajeAroma = e.message
                                                ?: "No se pudo desactivar la presentación."
                                        }
                                    }
                                }
                            )
                        }

                        productoSeleccionado != null &&
                                aromaSeleccionado != null -> {
                            PresentacionesScreen(
                                nombreProducto = productoSeleccionado!!.nombre,
                                nombreAroma = aromaSeleccionado!!.nombre,
                                presentaciones = presentaciones,
                                onVolver = {
                                    aromaSeleccionado = null
                                },
                                onAgregarPresentacion = {
                                    mostrarFormularioPresentacion = true
                                },
                                onSeleccionarPresentacion = { presentacion ->
                                    presentacionSeleccionada = presentacion
                                }
                            )
                        }

                        productoSeleccionado != null -> {
                            AromasScreen(
                                nombreProducto = productoSeleccionado!!.nombre,
                                aromas = aromas,
                                onVolver = {
                                    productoSeleccionado = null
                                },
                                onAgregarAroma = {
                                    mostrarFormularioAroma = true
                                },
                                onSeleccionarAroma = { aroma ->
                                    aromaSeleccionado = aroma
                                },
                                onEliminarAroma = { aroma ->
                                    scope.launch {
                                        productoDao.eliminarAroma(aroma.id)
                                    }
                                },
                                onEditarAroma = { aroma, nuevoNombre ->
                                    scope.launch {
                                        productoDao.actualizarAroma(
                                            aroma.id,
                                            nuevoNombre
                                        )
                                    }
                                }
                            )
                        }

                        else -> {
                            ProductosScreen(
                                modifier = Modifier.fillMaxSize(),
                                productos = productos,
                                onAgregarProducto = {
                                    mostrarFormularioProducto = true
                                },
                                onVerInactivos = {
                                    mostrarRegistrosInactivos = true
                                },
                                onVolver = {
                                    selectedTab = "Inicio"
                                },
                                onSeleccionarProducto = { producto ->
                                    productoSeleccionado = producto
                                },
                                onDesactivarProducto = { producto ->
                                    scope.launch {
                                        productoDao.desactivarProducto(producto.id)
                                    }
                                },
                                onEditarProducto = { producto, nombre, tipo ->
                                    scope.launch {
                                        productoDao.actualizarProducto(
                                            producto.id,
                                            nombre,
                                            tipo
                                        )
                                    }
                                }
                            )
                        }
                    }
                }
            }


            "Produccion" -> ProduccionScreen(
                modifier = Modifier.padding(innerPadding),
                productos = productos,
                aromas = todosAromas.filter { it.activo },
                presentaciones = todasPresentacionesActivas,
                onVolver = {
                    selectedTab = "Inicio"
                },
                onGuardar = { lote, detalles, gastos, inventariosLote ->
                    scope.launch {
                        try {
                            productoDao.registrarLoteCompleto(
                                lote = lote,
                                detalles = detalles,
                                gastos = gastos,
                                inventariosLote = inventariosLote
                            )

                            selectedTab = "Inicio"
                        } catch (e: Exception) {
                            mensajeAroma = e.message ?: "No se pudo guardar el lote."
                        }
                    }
                }
            )

            "Inventario" -> InventarioScreen(
                modifier = Modifier.padding(innerPadding),
                productos = todosProductos,
                aromas = todosAromas,
                presentaciones = todasPresentacionesActivas + presentacionesInactivas,
                inventarios = inventarios,
                onVolver = {
                    selectedTab = "Inicio"
                }
            )


            "Lotes" -> HistorialLotesScreen(
                modifier = Modifier.padding(innerPadding),
                lotes = lotes,
                detalles = todosDetallesLote,
                gastos = todosGastosLote,
                inventariosLote = todosInventariosLote,
                ingresosPorLoteYSede = ingresosPorLoteYSede,
                productos = todosProductos,
                aromas = todosAromas,
                presentaciones = todasPresentacionesActivas + presentacionesInactivas,
                onEditarGasto = { gastoId, loteId, concepto, monto, observacion ->
                    scope.launch {
                        productoDao.actualizarGastoLote(
                            gastoId = gastoId,
                            loteId = loteId,
                            concepto = concepto,
                            monto = monto,
                            observacion = observacion
                        )
                    }
                },
                onEliminarGasto = { gastoId, loteId ->
                    scope.launch {
                        productoDao.eliminarGastoLote(
                            gastoId = gastoId,
                            loteId = loteId
                        )
                    }
                },
                onAgregarGasto = { gasto ->
                    scope.launch {
                        productoDao.guardarGastosLote(
                            listOf(gasto)
                        )
                    }
                },
                onEditarProduccion = { loteId, detalles, inventarios, onResultado ->
                    scope.launch {
                        try {
                            productoDao.editarLoteCompleto(
                                loteId = loteId,
                                detallesNuevos = detalles,
                                inventariosLoteNuevos = inventarios
                            )

                            onResultado(null)

                        } catch (e: Exception) {
                            onResultado(
                                e.message ?: "No se pudo editar la producción."
                            )
                        }
                    }
                },
                onEliminarLote = { loteId, onResultado ->
                    scope.launch {
                        try {
                            productoDao.eliminarLoteCompleto(loteId)
                            onResultado(null)
                        } catch (e: Exception) {
                            onResultado(
                                e.message ?: "No se pudo eliminar el lote."
                            )
                        }
                    }
                },
                onVolver = {
                    selectedTab = "Inicio"
                }
            )

            "Clientes" -> ClienteScreen(
                modifier = Modifier.padding(innerPadding),
                clientes = clientes,
                onGuardar = { cliente ->
                    scope.launch {
                        productoDao.guardarCliente(cliente)
                    }
                },
                onDesactivar = { clienteId ->
                    scope.launch {
                        productoDao.desactivarCliente(clienteId)
                    }
                },
                onVolver = {
                    selectedTab = "Inicio"
                }
            )

            "Historial" -> HistorialVentasScreen(
                modifier = Modifier.padding(innerPadding),
                ventas = ventas,
                clientes = clientes,
                productos = todosProductos,
                aromas = todosAromas,
                presentaciones = todasPresentacionesActivas + presentacionesInactivas,
                productoDao = productoDao,
                onVolver = {
                    ventaInicialId = null
                    selectedTab = "Inicio"
                },
                ventaInicialId = ventaInicialId
            )

            "Reportes" -> ReportesScreen(
                modifier = Modifier.padding(innerPadding),
                ventas = ventas,
                clientes = clientes,
                pagos = todosLosPagos,
                onAbrirVenta = { ventaId ->
                    ventaInicialId = ventaId
                    selectedTab = "Historial"
                }
            )


            "Configuracion" -> ConfiguracionScreen(
                modifier = Modifier.padding(innerPadding),
                onVolver = {
                    selectedTab = "Inicio"
                },
                onAbrirAcercaDe = {
                    selectedTab = "AcercaDe"
                },
                onAbrirMiCuenta = {
                    selectedTab = "MiCuenta"
                },
                biometriaDisponible = biometriaDisponible,
                biometriaActivada = biometriaActivada,
                onCambiarBiometria = onCambiarBiometria
            )

            "AcercaDe" -> AcercaDeScreen(
                modifier = Modifier.padding(innerPadding),
                onVolver = {
                    selectedTab = "Configuracion"
                }
            )

        }
    }


@Composable
fun PrestigeCleanApp() {

    var mostrarSplashPrestige by remember {
        mutableStateOf(false)
    }

    var mostrarMenu by remember {
        mutableStateOf(false)
    }

    var isLoading by remember {
        mutableStateOf(false)
    }

    var errorMessage by remember {
        mutableStateOf<String?>(null)
    }

    var mostrarDialogoGestionBiometria by remember {
        mutableStateOf(false)
    }

    var usuarioBiometria by remember {
        mutableStateOf("")
    }

    var contrasenaBiometria by remember {
        mutableStateOf("")
    }

    var mostrarFormularioActualizarBiometria by remember {
        mutableStateOf(false)
    }

    var mostrarConfirmacionDesactivarBiometria by remember {
        mutableStateOf(false)
    }

    var nombreCompletoUsuario by remember {
        mutableStateOf("")
    }

    var idUsuario by remember {
        mutableStateOf("")
    }

    var rolUsuario by remember {
        mutableStateOf("")
    }

    val context = LocalContext.current
    val activity = context as FragmentActivity
    val scope = rememberCoroutineScope()

    // Comprueba si existen credenciales biométricas guardadas.
    var biometricEnabled by remember {
        mutableStateOf(
            BiometricCredentialManager.hayCredenciales(context) &&
                    BiometricPromptManager.puedeUsarBiometria(context)
        )
    }

    // Credenciales temporales mientras se ofrece activar biometría.
    var credencialesPendientes by remember {
        mutableStateOf<Pair<String, String>?>(null)
    }

    var mostrarDialogoBiometria by remember {
        mutableStateOf(false)
    }

    // Entrada normal a la aplicación.
    LaunchedEffect(mostrarSplashPrestige) {
        if (mostrarSplashPrestige) {
            kotlinx.coroutines.delay(1800)
            mostrarMenu = true
            mostrarSplashPrestige = false
        }
    }

    // Pregunta si el usuario desea activar la biometría.
    if (mostrarDialogoBiometria) {
        AlertDialog(
            onDismissRequest = {
                mostrarDialogoBiometria = false
                credencialesPendientes = null
                mostrarSplashPrestige = true
            },
            title = {
                Text("Activar acceso biométrico")
            },
            text = {
                Text(
                    "¿Deseas utilizar tu huella o reconocimiento facial " +
                            "para iniciar sesión más rápidamente en Prestige Clean?"
                )
            },
            confirmButton = {
                TextButton(
                    onClick = {
                        mostrarDialogoBiometria = false

                        val credenciales = credencialesPendientes

                        if (credenciales != null) {
                            try {
                                val cipher =
                                    BiometricCredentialManager.crearCipherParaGuardar()

                                BiometricPromptManager.solicitarAutenticacion(
                                    activity = activity,
                                    cipher = cipher,
                                    titulo = "Activar acceso biométrico",
                                    subtitulo = "Confirma tu identidad",
                                    onAutenticado = { cipherAutenticado ->
                                        try {
                                            BiometricCredentialManager.guardarCredenciales(
                                                context = context,
                                                cipher = cipherAutenticado,
                                                usuario = credenciales.first,
                                                contrasena = credenciales.second
                                            )

                                            biometricEnabled = true

                                            Toast.makeText(
                                                context,
                                                "Acceso biométrico activado.",
                                                Toast.LENGTH_SHORT
                                            ).show()

                                        } catch (e: Exception) {
                                            Toast.makeText(
                                                context,
                                                "No se pudo activar la biometría.",
                                                Toast.LENGTH_LONG
                                            ).show()
                                        }

                                        credencialesPendientes = null
                                        mostrarSplashPrestige = true
                                    },
                                    onError = { mensaje ->
                                        Toast.makeText(
                                            context,
                                            "No se activó la biometría: $mensaje",
                                            Toast.LENGTH_LONG
                                        ).show()

                                        credencialesPendientes = null
                                        mostrarSplashPrestige = true
                                    }
                                )

                            } catch (e: Exception) {
                                Toast.makeText(
                                    context,
                                    e.message ?: "No se pudo configurar la biometría.",
                                    Toast.LENGTH_LONG
                                ).show()

                                credencialesPendientes = null
                                mostrarSplashPrestige = true
                            }
                        }
                    }
                ) {
                    Text("Activar")
                }
            },
            dismissButton = {
                TextButton(
                    onClick = {
                        mostrarDialogoBiometria = false
                        credencialesPendientes = null
                        mostrarSplashPrestige = true
                    }
                ) {
                    Text("Ahora no")
                }
            }
        )
    }

35,550 chars · codepastes.com