package com.google.maps.android.compose;

import androidx.compose.runtime.Applier;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.EffectsKt;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.core.view.MotionEventCompat;
import com.google.android.gms.maps.GoogleMap;
import java.util.Arrays;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScope;

/* JADX INFO: compiled from: MapEffect.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000.\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0011\n\u0002\b\u0002\u001aF\u0010\u0000\u001a\u00020\u00012\b\u0010\u0002\u001a\u0004\u0018\u00010\u00032-\u0010\u0004\u001a)\b\u0001\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u0007\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00010\b\u0012\u0006\u0012\u0004\u0018\u00010\u00030\u0005¢\u0006\u0002\b\tH\u0007¢\u0006\u0002\u0010\n\u001aP\u0010\u0000\u001a\u00020\u00012\b\u0010\u0002\u001a\u0004\u0018\u00010\u00032\b\u0010\u000b\u001a\u0004\u0018\u00010\u00032-\u0010\u0004\u001a)\b\u0001\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u0007\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00010\b\u0012\u0006\u0012\u0004\u0018\u00010\u00030\u0005¢\u0006\u0002\b\tH\u0007¢\u0006\u0002\u0010\f\u001aZ\u0010\u0000\u001a\u00020\u00012\b\u0010\u0002\u001a\u0004\u0018\u00010\u00032\b\u0010\u000b\u001a\u0004\u0018\u00010\u00032\b\u0010\r\u001a\u0004\u0018\u00010\u00032-\u0010\u0004\u001a)\b\u0001\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u0007\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00010\b\u0012\u0006\u0012\u0004\u0018\u00010\u00030\u0005¢\u0006\u0002\b\tH\u0007¢\u0006\u0002\u0010\u000e\u001aT\u0010\u0000\u001a\u00020\u00012\u0016\u0010\u000f\u001a\f\u0012\b\b\u0001\u0012\u0004\u0018\u00010\u00030\u0010\"\u0004\u0018\u00010\u00032-\u0010\u0004\u001a)\b\u0001\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u0007\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00010\b\u0012\u0006\u0012\u0004\u0018\u00010\u00030\u0005¢\u0006\u0002\b\tH\u0007¢\u0006\u0002\u0010\u0011¨\u0006\u0012"}, d2 = {"MapEffect", "", "key1", "", "block", "Lkotlin/Function3;", "Lkotlinx/coroutines/CoroutineScope;", "Lcom/google/android/gms/maps/GoogleMap;", "Lkotlin/coroutines/Continuation;", "Lkotlin/ExtensionFunctionType;", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;I)V", "key2", "(Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;I)V", "key3", "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;I)V", "keys", "", "([Ljava/lang/Object;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;I)V", "maps-compose_release"}, k = 2, mv = {2, 0, 0}, xi = 48)
public final class MapEffectKt {
    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit MapEffect$lambda$0(Object obj, Function3 block, int i, Composer composer, int i2) {
        Intrinsics.checkNotNullParameter(block, "$block");
        MapEffect(obj, (Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object>) block, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit MapEffect$lambda$1(Object obj, Object obj2, Function3 block, int i, Composer composer, int i2) {
        Intrinsics.checkNotNullParameter(block, "$block");
        MapEffect(obj, obj2, block, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit MapEffect$lambda$2(Object obj, Object obj2, Object obj3, Function3 block, int i, Composer composer, int i2) {
        Intrinsics.checkNotNullParameter(block, "$block");
        MapEffect(obj, obj2, obj3, block, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit MapEffect$lambda$3(Object[] keys, Function3 block, int i, Composer composer, int i2) {
        Intrinsics.checkNotNullParameter(keys, "$keys");
        Intrinsics.checkNotNullParameter(block, "$block");
        MapEffect(Arrays.copyOf(keys, keys.length), (Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object>) block, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    public static final void MapEffect(final Object obj, final Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object> block, Composer composer, final int i) {
        Intrinsics.checkNotNullParameter(block, "block");
        Composer composerStartRestartGroup = composer.startRestartGroup(-357282938);
        Applier<?> applier = composerStartRestartGroup.getApplier();
        Intrinsics.checkNotNull(applier, "null cannot be cast to non-null type com.google.maps.android.compose.MapApplier");
        EffectsKt.LaunchedEffect(obj, new AnonymousClass1(block, ((MapApplier) applier).getMap(), null), composerStartRestartGroup, 72);
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.MapEffectKt$$ExternalSyntheticLambda2
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj2, Object obj3) {
                    return MapEffectKt.MapEffect$lambda$0(obj, block, i, (Composer) obj2, ((Integer) obj3).intValue());
                }
            });
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.MapEffectKt$MapEffect$1, reason: invalid class name */
    /* JADX INFO: compiled from: MapEffect.kt */
    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {2, 0, 0}, xi = 48)
    @DebugMetadata(c = "com.google.maps.android.compose.MapEffectKt$MapEffect$1", f = "MapEffect.kt", i = {}, l = {26}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        final /* synthetic */ Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> $block;
        final /* synthetic */ GoogleMap $map;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        AnonymousClass1(Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object> function3, GoogleMap googleMap, Continuation<? super AnonymousClass1> continuation) {
            super(2, continuation);
            this.$block = function3;
            this.$map = googleMap;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$block, this.$map, continuation);
            anonymousClass1.L$0 = obj;
            return anonymousClass1;
        }

        @Override // kotlin.jvm.functions.Function2
        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Object invokeSuspend(Object obj) throws Throwable {
            Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
            int i = this.label;
            if (i == 0) {
                ResultKt.throwOnFailure(obj);
                CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
                Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> function3 = this.$block;
                GoogleMap googleMap = this.$map;
                this.label = 1;
                if (function3.invoke(coroutineScope, googleMap, this) == coroutine_suspended) {
                    return coroutine_suspended;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ResultKt.throwOnFailure(obj);
            }
            return Unit.INSTANCE;
        }
    }

    public static final void MapEffect(final Object obj, final Object obj2, final Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object> block, Composer composer, final int i) {
        Intrinsics.checkNotNullParameter(block, "block");
        Composer composerStartRestartGroup = composer.startRestartGroup(-834763738);
        Applier<?> applier = composerStartRestartGroup.getApplier();
        Intrinsics.checkNotNull(applier, "null cannot be cast to non-null type com.google.maps.android.compose.MapApplier");
        EffectsKt.LaunchedEffect(obj, obj2, new AnonymousClass3(block, ((MapApplier) applier).getMap(), null), composerStartRestartGroup, 584);
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.MapEffectKt$$ExternalSyntheticLambda1
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj3, Object obj4) {
                    return MapEffectKt.MapEffect$lambda$1(obj, obj2, block, i, (Composer) obj3, ((Integer) obj4).intValue());
                }
            });
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.MapEffectKt$MapEffect$3, reason: invalid class name */
    /* JADX INFO: compiled from: MapEffect.kt */
    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {2, 0, 0}, xi = 48)
    @DebugMetadata(c = "com.google.maps.android.compose.MapEffectKt$MapEffect$3", f = "MapEffect.kt", i = {}, l = {MotionEventCompat.AXIS_GENERIC_15}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass3 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        final /* synthetic */ Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> $block;
        final /* synthetic */ GoogleMap $map;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        AnonymousClass3(Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object> function3, GoogleMap googleMap, Continuation<? super AnonymousClass3> continuation) {
            super(2, continuation);
            this.$block = function3;
            this.$map = googleMap;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            AnonymousClass3 anonymousClass3 = new AnonymousClass3(this.$block, this.$map, continuation);
            anonymousClass3.L$0 = obj;
            return anonymousClass3;
        }

        @Override // kotlin.jvm.functions.Function2
        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return ((AnonymousClass3) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Object invokeSuspend(Object obj) throws Throwable {
            Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
            int i = this.label;
            if (i == 0) {
                ResultKt.throwOnFailure(obj);
                CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
                Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> function3 = this.$block;
                GoogleMap googleMap = this.$map;
                this.label = 1;
                if (function3.invoke(coroutineScope, googleMap, this) == coroutine_suspended) {
                    return coroutine_suspended;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ResultKt.throwOnFailure(obj);
            }
            return Unit.INSTANCE;
        }
    }

    public static final void MapEffect(final Object obj, final Object obj2, final Object obj3, final Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object> block, Composer composer, final int i) {
        Intrinsics.checkNotNullParameter(block, "block");
        Composer composerStartRestartGroup = composer.startRestartGroup(-88380218);
        Applier<?> applier = composerStartRestartGroup.getApplier();
        Intrinsics.checkNotNull(applier, "null cannot be cast to non-null type com.google.maps.android.compose.MapApplier");
        EffectsKt.LaunchedEffect(obj, obj2, obj3, new AnonymousClass5(block, ((MapApplier) applier).getMap(), null), composerStartRestartGroup, 4680);
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.MapEffectKt$$ExternalSyntheticLambda3
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj4, Object obj5) {
                    return MapEffectKt.MapEffect$lambda$2(obj, obj2, obj3, block, i, (Composer) obj4, ((Integer) obj5).intValue());
                }
            });
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.MapEffectKt$MapEffect$5, reason: invalid class name */
    /* JADX INFO: compiled from: MapEffect.kt */
    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {2, 0, 0}, xi = 48)
    @DebugMetadata(c = "com.google.maps.android.compose.MapEffectKt$MapEffect$5", f = "MapEffect.kt", i = {}, l = {71}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass5 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        final /* synthetic */ Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> $block;
        final /* synthetic */ GoogleMap $map;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        AnonymousClass5(Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object> function3, GoogleMap googleMap, Continuation<? super AnonymousClass5> continuation) {
            super(2, continuation);
            this.$block = function3;
            this.$map = googleMap;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            AnonymousClass5 anonymousClass5 = new AnonymousClass5(this.$block, this.$map, continuation);
            anonymousClass5.L$0 = obj;
            return anonymousClass5;
        }

        @Override // kotlin.jvm.functions.Function2
        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return ((AnonymousClass5) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Object invokeSuspend(Object obj) throws Throwable {
            Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
            int i = this.label;
            if (i == 0) {
                ResultKt.throwOnFailure(obj);
                CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
                Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> function3 = this.$block;
                GoogleMap googleMap = this.$map;
                this.label = 1;
                if (function3.invoke(coroutineScope, googleMap, this) == coroutine_suspended) {
                    return coroutine_suspended;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ResultKt.throwOnFailure(obj);
            }
            return Unit.INSTANCE;
        }
    }

    public static final void MapEffect(final Object[] keys, final Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object> block, Composer composer, final int i) {
        Intrinsics.checkNotNullParameter(keys, "keys");
        Intrinsics.checkNotNullParameter(block, "block");
        Composer composerStartRestartGroup = composer.startRestartGroup(-276920653);
        Applier<?> applier = composerStartRestartGroup.getApplier();
        Intrinsics.checkNotNull(applier, "null cannot be cast to non-null type com.google.maps.android.compose.MapApplier");
        EffectsKt.LaunchedEffect(Arrays.copyOf(keys, keys.length), (Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object>) new AnonymousClass7(block, ((MapApplier) applier).getMap(), null), composerStartRestartGroup, 72);
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.MapEffectKt$$ExternalSyntheticLambda0
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return MapEffectKt.MapEffect$lambda$3(keys, block, i, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.MapEffectKt$MapEffect$7, reason: invalid class name */
    /* JADX INFO: compiled from: MapEffect.kt */
    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {2, 0, 0}, xi = 48)
    @DebugMetadata(c = "com.google.maps.android.compose.MapEffectKt$MapEffect$7", f = "MapEffect.kt", i = {}, l = {94}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass7 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        final /* synthetic */ Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> $block;
        final /* synthetic */ GoogleMap $map;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        AnonymousClass7(Function3<? super CoroutineScope, ? super GoogleMap, ? super Continuation<? super Unit>, ? extends Object> function3, GoogleMap googleMap, Continuation<? super AnonymousClass7> continuation) {
            super(2, continuation);
            this.$block = function3;
            this.$map = googleMap;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            AnonymousClass7 anonymousClass7 = new AnonymousClass7(this.$block, this.$map, continuation);
            anonymousClass7.L$0 = obj;
            return anonymousClass7;
        }

        @Override // kotlin.jvm.functions.Function2
        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return ((AnonymousClass7) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Object invokeSuspend(Object obj) throws Throwable {
            Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
            int i = this.label;
            if (i == 0) {
                ResultKt.throwOnFailure(obj);
                CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
                Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> function3 = this.$block;
                GoogleMap googleMap = this.$map;
                this.label = 1;
                if (function3.invoke(coroutineScope, googleMap, this) == coroutine_suspended) {
                    return coroutine_suspended;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ResultKt.throwOnFailure(obj);
            }
            return Unit.INSTANCE;
        }
    }
}