package com.sistemasolton.itranvias.home.presentation.nearby;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import androidx.compose.foundation.layout.SizeKt;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.EffectsKt;
import androidx.compose.runtime.ProvidableCompositionLocal;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.runtime.internal.ComposableLambdaKt;
import androidx.compose.runtime.saveable.RememberSaveableKt;
import androidx.compose.runtime.saveable.Saver;
import androidx.compose.ui.Modifier;
import androidx.compose.ui.platform.AndroidCompositionLocals_androidKt;
import androidx.core.content.ContextCompat;
import androidx.core.view.PointerIconCompat;
import com.google.android.gms.maps.model.LatLng;
import com.google.maps.android.compose.CameraPositionState;
import com.google.maps.android.compose.GoogleMapKt;
import com.google.maps.android.compose.MapProperties;
import com.google.maps.android.compose.MapUiSettings;
import com.google.maps.android.compose.MarkerKt;
import com.google.maps.android.compose.MarkerState;
import java.util.List;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: NearbyScreen.android.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000$\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0006\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a/\u0010\u0000\u001a\u00020\u00012\b\u0010\u0002\u001a\u0004\u0018\u00010\u00032\b\u0010\u0004\u001a\u0004\u0018\u00010\u00032\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006H\u0007¢\u0006\u0002\u0010\b\u001a\u0015\u0010\t\u001a\u00020\u00012\u0006\u0010\n\u001a\u00020\u000bH\u0007¢\u0006\u0002\u0010\f¨\u0006\r"}, d2 = {"GoogleMaps", "", "latitude", "", "longitude", "paradasCercanas", "", "Lcom/sistemasolton/itranvias/home/presentation/nearby/ParadaConDistancia;", "(Ljava/lang/Double;Ljava/lang/Double;Ljava/util/List;Landroidx/compose/runtime/Composer;I)V", "SettingsController", "state", "Lcom/sistemasolton/itranvias/home/presentation/nearby/SettingsState;", "(Lcom/sistemasolton/itranvias/home/presentation/nearby/SettingsState;Landroidx/compose/runtime/Composer;I)V", "composeApp_release"}, k = 2, mv = {2, 1, 0}, xi = 48)
public final class NearbyScreen_androidKt {
    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GoogleMaps$lambda$0(Double d, Double d2, List list, int i, Composer composer, int i2) {
        GoogleMaps(d, d2, list, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GoogleMaps$lambda$2(Double d, Double d2, List list, int i, Composer composer, int i2) {
        GoogleMaps(d, d2, list, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit SettingsController$lambda$3(SettingsState settingsState, int i, Composer composer, int i2) {
        SettingsController(settingsState, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    public static final void GoogleMaps(final Double d, final Double d2, final List<ParadaConDistancia> paradasCercanas, Composer composer, final int i) {
        int i2;
        Composer composer2;
        Intrinsics.checkNotNullParameter(paradasCercanas, "paradasCercanas");
        Composer composerStartRestartGroup = composer.startRestartGroup(429483887);
        if ((i & 6) == 0) {
            i2 = (composerStartRestartGroup.changed(d) ? 4 : 2) | i;
        } else {
            i2 = i;
        }
        if ((i & 48) == 0) {
            i2 |= composerStartRestartGroup.changed(d2) ? 32 : 16;
        }
        if ((i & 384) == 0) {
            i2 |= composerStartRestartGroup.changedInstance(paradasCercanas) ? 256 : 128;
        }
        int i3 = i2;
        if ((i3 & 147) != 146 || !composerStartRestartGroup.getSkipping()) {
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventStart(429483887, i3, -1, "com.sistemasolton.itranvias.home.presentation.nearby.GoogleMaps (NearbyScreen.android.kt:26)");
            }
            if (d == null || d2 == null) {
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventEnd();
                }
                ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
                if (scopeUpdateScopeEndRestartGroup != null) {
                    scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.sistemasolton.itranvias.home.presentation.nearby.NearbyScreen_androidKt$$ExternalSyntheticLambda1
                        @Override // kotlin.jvm.functions.Function2
                        public final Object invoke(Object obj, Object obj2) {
                            return NearbyScreen_androidKt.GoogleMaps$lambda$0(d, d2, paradasCercanas, i, (Composer) obj, ((Integer) obj2).intValue());
                        }
                    });
                    return;
                }
                return;
            }
            composerStartRestartGroup.startReplaceableGroup(-1911106014);
            CameraPositionState cameraPositionState = (CameraPositionState) RememberSaveableKt.m3946rememberSaveable(new Object[0], (Saver) CameraPositionState.INSTANCE.getSaver(), (String) null, (Function0) new Function0<CameraPositionState>() { // from class: com.sistemasolton.itranvias.home.presentation.nearby.NearbyScreen_androidKt$GoogleMaps$$inlined$rememberCameraPositionState$1
                /* JADX WARN: Can't rename method to resolve collision */
                @Override // kotlin.jvm.functions.Function0
                public final CameraPositionState invoke() {
                    return new CameraPositionState(null, 1, null);
                }
            }, composerStartRestartGroup, 72, 0);
            composerStartRestartGroup.endReplaceableGroup();
            LatLng latLng = new LatLng(d.doubleValue(), d2.doubleValue());
            composerStartRestartGroup.startReplaceGroup(-1746271574);
            boolean zChangedInstance = composerStartRestartGroup.changedInstance(paradasCercanas) | composerStartRestartGroup.changedInstance(latLng) | composerStartRestartGroup.changedInstance(cameraPositionState);
            NearbyScreen_androidKt$GoogleMaps$2$1 nearbyScreen_androidKt$GoogleMaps$2$1RememberedValue = composerStartRestartGroup.rememberedValue();
            if (zChangedInstance || nearbyScreen_androidKt$GoogleMaps$2$1RememberedValue == Composer.INSTANCE.getEmpty()) {
                nearbyScreen_androidKt$GoogleMaps$2$1RememberedValue = new NearbyScreen_androidKt$GoogleMaps$2$1(paradasCercanas, latLng, cameraPositionState, null);
                composerStartRestartGroup.updateRememberedValue(nearbyScreen_androidKt$GoogleMaps$2$1RememberedValue);
            }
            composerStartRestartGroup.endReplaceGroup();
            EffectsKt.LaunchedEffect(paradasCercanas, latLng, (Function2) nearbyScreen_androidKt$GoogleMaps$2$1RememberedValue, composerStartRestartGroup, (i3 >> 6) & 14);
            composer2 = composerStartRestartGroup;
            GoogleMapKt.GoogleMap(false, SizeKt.fillMaxSize$default(Modifier.INSTANCE, 0.0f, 1, null), cameraPositionState, null, null, new MapProperties(false, false, true, false, null, null, null, 0.0f, 0.0f, 507, null), null, new MapUiSettings(false, false, false, true, false, false, false, false, false, false, PointerIconCompat.TYPE_VERTICAL_DOUBLE_ARROW, null), null, null, null, null, null, null, null, null, ComposableLambdaKt.rememberComposableLambda(-174689516, true, new Function2<Composer, Integer, Unit>() { // from class: com.sistemasolton.itranvias.home.presentation.nearby.NearbyScreen_androidKt.GoogleMaps.3
                @Override // kotlin.jvm.functions.Function2
                public /* bridge */ /* synthetic */ Unit invoke(Composer composer3, Integer num) {
                    invoke(composer3, num.intValue());
                    return Unit.INSTANCE;
                }

                public final void invoke(Composer composer3, int i4) {
                    if ((i4 & 3) == 2 && composer3.getSkipping()) {
                        composer3.skipToGroupEnd();
                        return;
                    }
                    if (ComposerKt.isTraceInProgress()) {
                        ComposerKt.traceEventStart(-174689516, i4, -1, "com.sistemasolton.itranvias.home.presentation.nearby.GoogleMaps.<anonymous> (NearbyScreen.android.kt:54)");
                    }
                    for (ParadaConDistancia paradaConDistancia : paradasCercanas) {
                        MarkerKt.m7830Markerqld6geY(MarkerKt.rememberMarkerState(null, new LatLng(paradaConDistancia.getParada().getPosy(), paradaConDistancia.getParada().getPosx()), composer3, 0, 1), null, 0.0f, 0L, false, false, null, 0L, 0.0f, null, null, paradaConDistancia.getParada().getId() + " - " + paradaConDistancia.getParada().getNombre(), false, 0.0f, null, null, null, null, composer3, MarkerState.$stable, 0, 260094);
                    }
                    if (ComposerKt.isTraceInProgress()) {
                        ComposerKt.traceEventEnd();
                    }
                }
            }, composerStartRestartGroup, 54), composer2, (CameraPositionState.$stable << 6) | 48 | (MapProperties.$stable << 15) | (MapUiSettings.$stable << 21), 1572864, 65369);
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventEnd();
            }
        } else {
            composerStartRestartGroup.skipToGroupEnd();
            composer2 = composerStartRestartGroup;
        }
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup2 = composer2.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup2 != null) {
            scopeUpdateScopeEndRestartGroup2.updateScope(new Function2() { // from class: com.sistemasolton.itranvias.home.presentation.nearby.NearbyScreen_androidKt$$ExternalSyntheticLambda2
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return NearbyScreen_androidKt.GoogleMaps$lambda$2(d, d2, paradasCercanas, i, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    public static final void SettingsController(final SettingsState state, Composer composer, final int i) {
        int i2;
        Intrinsics.checkNotNullParameter(state, "state");
        Composer composerStartRestartGroup = composer.startRestartGroup(1911795012);
        if ((i & 6) == 0) {
            i2 = (composerStartRestartGroup.changed(state) ? 4 : 2) | i;
        } else {
            i2 = i;
        }
        if ((i2 & 3) != 2 || !composerStartRestartGroup.getSkipping()) {
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventStart(1911795012, i2, -1, "com.sistemasolton.itranvias.home.presentation.nearby.SettingsController (NearbyScreen.android.kt:69)");
            }
            if (state.getOpen$composeApp_release()) {
                ProvidableCompositionLocal<Context> localContext = AndroidCompositionLocals_androidKt.getLocalContext();
                ComposerKt.sourceInformationMarkerStart(composerStartRestartGroup, 2023513938, "CC(<get-current>):CompositionLocal.kt#9igjgp");
                Object objConsume = composerStartRestartGroup.consume(localContext);
                ComposerKt.sourceInformationMarkerEnd(composerStartRestartGroup);
                Context context = (Context) objConsume;
                Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
                intent.setData(Uri.fromParts("package", context.getPackageName(), null));
                ContextCompat.startActivity(context, intent, null);
                state.setOpen$composeApp_release(false);
            }
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventEnd();
            }
        } else {
            composerStartRestartGroup.skipToGroupEnd();
        }
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.sistemasolton.itranvias.home.presentation.nearby.NearbyScreen_androidKt$$ExternalSyntheticLambda0
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return NearbyScreen_androidKt.SettingsController$lambda$3(state, i, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }
}