package com.google.maps.android.compose.clustering;

import android.content.Context;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.DisposableEffectResult;
import androidx.compose.runtime.DisposableEffectScope;
import androidx.compose.runtime.EffectsKt;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.ProvidableCompositionLocal;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.runtime.SnapshotStateKt;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import androidx.compose.runtime.State;
import androidx.compose.ui.platform.AndroidCompositionLocals_androidKt;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.Marker;
import com.google.maps.android.clustering.Cluster;
import com.google.maps.android.clustering.ClusterItem;
import com.google.maps.android.clustering.ClusterManager;
import com.google.maps.android.clustering.view.ClusterRenderer;
import com.google.maps.android.clustering.view.DefaultClusterRenderer;
import com.google.maps.android.collections.MarkerManager;
import com.google.maps.android.compose.CameraPositionState;
import com.google.maps.android.compose.CameraPositionStateKt;
import com.google.maps.android.compose.ComposeUiViewRenderer;
import com.google.maps.android.compose.InputHandlerKt;
import com.google.maps.android.compose.MapComposeViewRenderKt;
import com.google.maps.android.compose.MapEffectKt;
import com.google.maps.android.compose.ReattachClickListenersKt;
import com.google.maps.android.compose.clustering.ClusteringKt;
import java.util.Collection;
import java.util.List;
import kotlin.Deprecated;
import kotlin.KotlinNothingValueException;
import kotlin.Metadata;
import kotlin.ReplaceWith;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
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.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.DelayKt;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowCollector;

/* JADX INFO: compiled from: Clustering.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000@\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u001e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\n\u001aß\u0001\u0010\u0000\u001a\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00032\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u0002H\u00020\u00052\u001a\b\u0002\u0010\u0006\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\b\u0012\u0004\u0012\u00020\t0\u00072\u0014\b\u0002\u0010\n\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\t0\u00072\u0014\b\u0002\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u00072\u0014\b\u0002\u0010\f\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u00072&\b\u0002\u0010\r\u001a \u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\b\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0007¢\u0006\u0002\b\u000e¢\u0006\u0002\b\u000f2 \b\u0002\u0010\u0010\u001a\u001a\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0007¢\u0006\u0002\b\u000e¢\u0006\u0002\b\u000f2\u0010\b\u0002\u0010\u0011\u001a\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0012H\u0007¢\u0006\u0002\u0010\u0013\u001aÍ\u0001\u0010\u0000\u001a\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00032\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u0002H\u00020\u00052\u001a\b\u0002\u0010\u0006\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\b\u0012\u0004\u0012\u00020\t0\u00072\u0014\b\u0002\u0010\n\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\t0\u00072\u0014\b\u0002\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u00072\u0014\b\u0002\u0010\f\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u00072&\b\u0002\u0010\r\u001a \u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\b\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0007¢\u0006\u0002\b\u000e¢\u0006\u0002\b\u000f2 \b\u0002\u0010\u0010\u001a\u001a\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0007¢\u0006\u0002\b\u000e¢\u0006\u0002\b\u000fH\u0007¢\u0006\u0002\u0010\u0014\u001a3\u0010\u0000\u001a\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00032\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u0002H\u00020\u00052\f\u0010\u0015\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0016H\u0007¢\u0006\u0002\u0010\u0017\u001a/\u0010\u0018\u001a\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0012\"\b\b\u0000\u0010\u0002*\u00020\u00032\u000e\u0010\u0015\u001a\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0016H\u0007¢\u0006\u0002\u0010\u0019\u001ak\u0010\u0018\u001a\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0012\"\b\b\u0000\u0010\u0002*\u00020\u00032\u001f\u0010\r\u001a\u001b\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\b\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0007¢\u0006\u0002\b\u000f2\u0019\u0010\u0010\u001a\u0015\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0007¢\u0006\u0002\b\u000f2\u000e\u0010\u0015\u001a\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0016H\u0007¢\u0006\u0002\u0010\u001a\u001a\u001f\u0010\u001b\u001a\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0016\"\b\b\u0000\u0010\u0002*\u00020\u0003H\u0007¢\u0006\u0002\u0010\u001c\u001am\u0010\u001b\u001a\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0016\"\b\b\u0000\u0010\u0002*\u00020\u00032\u001f\u0010\r\u001a\u001b\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\b\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0007¢\u0006\u0002\b\u000f2\u0019\u0010\u0010\u001a\u0015\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0007¢\u0006\u0002\b\u000f2\u0010\b\u0002\u0010\u0011\u001a\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0012H\u0003¢\u0006\u0002\u0010\u001d\u001a\u0019\u0010\u001e\u001a\u00020\u00012\n\u0010\u0015\u001a\u0006\u0012\u0002\b\u00030\u0016H\u0003¢\u0006\u0002\u0010\u001f¨\u0006 "}, d2 = {"Clustering", "", "T", "Lcom/google/maps/android/clustering/ClusterItem;", "items", "", "onClusterClick", "Lkotlin/Function1;", "Lcom/google/maps/android/clustering/Cluster;", "", "onClusterItemClick", "onClusterItemInfoWindowClick", "onClusterItemInfoWindowLongClick", "clusterContent", "Landroidx/compose/ui/UiComposable;", "Landroidx/compose/runtime/Composable;", "clusterItemContent", "clusterRenderer", "Lcom/google/maps/android/clustering/view/ClusterRenderer;", "(Ljava/util/Collection;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lcom/google/maps/android/clustering/view/ClusterRenderer;Landroidx/compose/runtime/Composer;II)V", "(Ljava/util/Collection;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V", "clusterManager", "Lcom/google/maps/android/clustering/ClusterManager;", "(Ljava/util/Collection;Lcom/google/maps/android/clustering/ClusterManager;Landroidx/compose/runtime/Composer;I)V", "rememberClusterRenderer", "(Lcom/google/maps/android/clustering/ClusterManager;Landroidx/compose/runtime/Composer;I)Lcom/google/maps/android/clustering/view/ClusterRenderer;", "(Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lcom/google/maps/android/clustering/ClusterManager;Landroidx/compose/runtime/Composer;I)Lcom/google/maps/android/clustering/view/ClusterRenderer;", "rememberClusterManager", "(Landroidx/compose/runtime/Composer;I)Lcom/google/maps/android/clustering/ClusterManager;", "(Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lcom/google/maps/android/clustering/view/ClusterRenderer;Landroidx/compose/runtime/Composer;II)Lcom/google/maps/android/clustering/ClusterManager;", "ResetMapListeners", "(Lcom/google/maps/android/clustering/ClusterManager;Landroidx/compose/runtime/Composer;I)V", "maps-compose-utils_release"}, k = 2, mv = {2, 0, 0}, xi = 48)
public final class ClusteringKt {
    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean Clustering$lambda$0(Cluster it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return false;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean Clustering$lambda$1(ClusterItem it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return false;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$10(Collection items, Function1 function1, Function1 function12, Function1 function13, Function1 function14, Function3 function3, Function3 function32, ClusterRenderer clusterRenderer, int i, int i2, Composer composer, int i3) {
        Intrinsics.checkNotNullParameter(items, "$items");
        Clustering(items, function1, function12, function13, function14, function3, function32, clusterRenderer, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean Clustering$lambda$11(Cluster it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return false;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean Clustering$lambda$12(ClusterItem it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return false;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$21(Collection items, Function1 function1, Function1 function12, Function1 function13, Function1 function14, Function3 function3, Function3 function32, int i, int i2, Composer composer, int i3) {
        Intrinsics.checkNotNullParameter(items, "$items");
        Clustering(items, function1, function12, function13, function14, function3, function32, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$24(Collection items, ClusterManager clusterManager, int i, Composer composer, int i2) {
        Intrinsics.checkNotNullParameter(items, "$items");
        Intrinsics.checkNotNullParameter(clusterManager, "$clusterManager");
        Clustering(items, clusterManager, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$4(Collection items, Function1 function1, Function1 function12, Function1 function13, Function1 function14, Function3 function3, Function3 function32, ClusterRenderer clusterRenderer, int i, int i2, Composer composer, int i3) {
        Intrinsics.checkNotNullParameter(items, "$items");
        Clustering(items, function1, function12, function13, function14, function3, function32, clusterRenderer, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit ResetMapListeners$lambda$30(ClusterManager clusterManager, int i, Composer composer, int i2) {
        Intrinsics.checkNotNullParameter(clusterManager, "$clusterManager");
        ResetMapListeners(clusterManager, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$2(ClusterItem it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$3(ClusterItem it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return Unit.INSTANCE;
    }

    @Deprecated(message = "If clusterRenderer is specified, clusterContent and clusterItemContent are not used; use a function that takes ClusterManager as an argument instead.", replaceWith = @ReplaceWith(expression = "\n            val clusterManager = rememberClusterManager<T>()\n            LaunchedEffect(clusterManager, clusterRenderer) {\n                clusterManager?.renderer = clusterRenderer\n            }\n            SideEffect {\n                clusterManager ?: return@SideEffect\n                clusterManager.setOnClusterClickListener(onClusterClick)\n                clusterManager.setOnClusterItemClickListener(onClusterItemClick)\n                clusterManager.setOnClusterItemInfoWindowClickListener(onClusterItemInfoWindowClick)\n                clusterManager.setOnClusterItemInfoWindowLongClickListener(onClusterItemInfoWindowLongClick)\n            }\n            if (clusterManager != null) {\n                Clustering(\n                    items = items,\n                    clusterManager = clusterManager,\n                )\n            }\n        ", imports = {"com.google.maps.android.compose.clustering.Clustering", "androidx.compose.runtime.SideEffect", "com.google.maps.android.clustering.ClusterManager"}))
    public static final <T extends ClusterItem> void Clustering(final Collection<? extends T> items, Function1<? super Cluster<T>, Boolean> function1, Function1<? super T, Boolean> function12, Function1<? super T, Unit> function13, Function1<? super T, Unit> function14, Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit> function3, Function3<? super T, ? super Composer, ? super Integer, Unit> function32, ClusterRenderer<T> clusterRenderer, Composer composer, final int i, final int i2) {
        Intrinsics.checkNotNullParameter(items, "items");
        Composer composerStartRestartGroup = composer.startRestartGroup(-2067283133);
        final Function1<? super Cluster<T>, Boolean> function15 = (i2 & 2) != 0 ? new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda19
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return Boolean.valueOf(ClusteringKt.Clustering$lambda$0((Cluster) obj));
            }
        } : function1;
        final Function1<? super T, Boolean> function16 = (i2 & 4) != 0 ? new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda20
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return Boolean.valueOf(ClusteringKt.Clustering$lambda$1((ClusterItem) obj));
            }
        } : function12;
        final Function1<? super T, Unit> function17 = (i2 & 8) != 0 ? new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda21
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return ClusteringKt.Clustering$lambda$2((ClusterItem) obj);
            }
        } : function13;
        final Function1<? super T, Unit> function18 = (i2 & 16) != 0 ? new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda22
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return ClusteringKt.Clustering$lambda$3((ClusterItem) obj);
            }
        } : function14;
        final Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit> function33 = (i2 & 32) != 0 ? null : function3;
        Function3<? super T, ? super Composer, ? super Integer, Unit> function34 = (i2 & 64) != 0 ? null : function32;
        ClusterRenderer<T> clusterRenderer2 = (i2 & 128) != 0 ? null : clusterRenderer;
        int i3 = i >> 15;
        final ClusterManager clusterManagerRememberClusterManager = rememberClusterManager(function33, function34, clusterRenderer2, composerStartRestartGroup, (i3 & 112) | (i3 & 14) | 512, 0);
        if (clusterManagerRememberClusterManager == null) {
            ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
            if (scopeUpdateScopeEndRestartGroup != null) {
                final Function3<? super T, ? super Composer, ? super Integer, Unit> function35 = function34;
                final ClusterRenderer<T> clusterRenderer3 = clusterRenderer2;
                scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda23
                    @Override // kotlin.jvm.functions.Function2
                    public final Object invoke(Object obj, Object obj2) {
                        return ClusteringKt.Clustering$lambda$4(items, function15, function16, function17, function18, function33, function35, clusterRenderer3, i, i2, (Composer) obj, ((Integer) obj2).intValue());
                    }
                });
                return;
            }
            return;
        }
        final Function1<? super Cluster<T>, Boolean> function19 = function15;
        final Function1<? super T, Boolean> function110 = function16;
        final Function1<? super T, Unit> function111 = function17;
        final Function1<? super T, Unit> function112 = function18;
        EffectsKt.SideEffect(new Function0() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda24
            @Override // kotlin.jvm.functions.Function0
            public final Object invoke() {
                return ClusteringKt.Clustering$lambda$9(clusterManagerRememberClusterManager, function19, function110, function111, function112);
            }
        }, composerStartRestartGroup, 0);
        Clustering(items, clusterManagerRememberClusterManager, composerStartRestartGroup, 72);
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup2 = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup2 != null) {
            final Function3<? super T, ? super Composer, ? super Integer, Unit> function36 = function34;
            final ClusterRenderer<T> clusterRenderer4 = clusterRenderer2;
            scopeUpdateScopeEndRestartGroup2.updateScope(new Function2() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda1
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return ClusteringKt.Clustering$lambda$10(items, function15, function16, function17, function18, function33, function36, clusterRenderer4, i, i2, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$9(ClusterManager clusterManager, final Function1 function1, final Function1 function12, final Function1 function13, final Function1 function14) {
        Intrinsics.checkNotNullParameter(clusterManager, "$clusterManager");
        clusterManager.setOnClusterClickListener(new ClusterManager.OnClusterClickListener() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda0
            @Override // com.google.maps.android.clustering.ClusterManager.OnClusterClickListener
            public final boolean onClusterClick(Cluster cluster) {
                return ClusteringKt.Clustering$lambda$9$lambda$5(function1, cluster);
            }
        });
        clusterManager.setOnClusterItemClickListener(new ClusterManager.OnClusterItemClickListener() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda11
            @Override // com.google.maps.android.clustering.ClusterManager.OnClusterItemClickListener
            public final boolean onClusterItemClick(ClusterItem clusterItem) {
                return ClusteringKt.Clustering$lambda$9$lambda$6(function12, clusterItem);
            }
        });
        clusterManager.setOnClusterItemInfoWindowClickListener(new ClusterManager.OnClusterItemInfoWindowClickListener() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda17
            @Override // com.google.maps.android.clustering.ClusterManager.OnClusterItemInfoWindowClickListener
            public final void onClusterItemInfoWindowClick(ClusterItem clusterItem) {
                ClusteringKt.Clustering$lambda$9$lambda$7(function13, clusterItem);
            }
        });
        clusterManager.setOnClusterItemInfoWindowLongClickListener(new ClusterManager.OnClusterItemInfoWindowLongClickListener() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda18
            @Override // com.google.maps.android.clustering.ClusterManager.OnClusterItemInfoWindowLongClickListener
            public final void onClusterItemInfoWindowLongClick(ClusterItem clusterItem) {
                ClusteringKt.Clustering$lambda$9$lambda$8(function14, clusterItem);
            }
        });
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean Clustering$lambda$9$lambda$5(Function1 tmp0, Cluster cluster) {
        Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
        return ((Boolean) tmp0.invoke(cluster)).booleanValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean Clustering$lambda$9$lambda$6(Function1 tmp0, ClusterItem clusterItem) {
        Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
        return ((Boolean) tmp0.invoke(clusterItem)).booleanValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void Clustering$lambda$9$lambda$7(Function1 tmp0, ClusterItem clusterItem) {
        Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
        tmp0.invoke(clusterItem);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void Clustering$lambda$9$lambda$8(Function1 tmp0, ClusterItem clusterItem) {
        Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
        tmp0.invoke(clusterItem);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$13(ClusterItem it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$14(ClusterItem it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return Unit.INSTANCE;
    }

    public static final <T extends ClusterItem> void Clustering(final Collection<? extends T> items, Function1<? super Cluster<T>, Boolean> function1, Function1<? super T, Boolean> function12, Function1<? super T, Unit> function13, Function1<? super T, Unit> function14, Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit> function3, Function3<? super T, ? super Composer, ? super Integer, Unit> function32, Composer composer, final int i, final int i2) {
        Intrinsics.checkNotNullParameter(items, "items");
        Composer composerStartRestartGroup = composer.startRestartGroup(-1166995596);
        final Function1<? super Cluster<T>, Boolean> function15 = (i2 & 2) != 0 ? new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda9
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return Boolean.valueOf(ClusteringKt.Clustering$lambda$11((Cluster) obj));
            }
        } : function1;
        final Function1<? super T, Boolean> function16 = (i2 & 4) != 0 ? new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda10
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return Boolean.valueOf(ClusteringKt.Clustering$lambda$12((ClusterItem) obj));
            }
        } : function12;
        final Function1<? super T, Unit> function17 = (i2 & 8) != 0 ? new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda12
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return ClusteringKt.Clustering$lambda$13((ClusterItem) obj);
            }
        } : function13;
        final Function1<? super T, Unit> function18 = (i2 & 16) != 0 ? new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda13
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return ClusteringKt.Clustering$lambda$14((ClusterItem) obj);
            }
        } : function14;
        final Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit> function33 = (i2 & 32) != 0 ? null : function3;
        final Function3<? super T, ? super Composer, ? super Integer, Unit> function34 = (i2 & 64) == 0 ? function32 : null;
        final ClusterManager clusterManagerRememberClusterManager = rememberClusterManager(composerStartRestartGroup, 0);
        int i3 = i >> 15;
        final ClusterRenderer clusterRendererRememberClusterRenderer = rememberClusterRenderer(function33, function34, clusterManagerRememberClusterManager, composerStartRestartGroup, (i3 & 112) | (i3 & 14) | 512);
        EffectsKt.SideEffect(new Function0() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda14
            @Override // kotlin.jvm.functions.Function0
            public final Object invoke() {
                return ClusteringKt.Clustering$lambda$15(clusterManagerRememberClusterManager, clusterRendererRememberClusterRenderer);
            }
        }, composerStartRestartGroup, 0);
        final Function1<? super Cluster<T>, Boolean> function19 = function15;
        final Function1<? super T, Boolean> function110 = function16;
        final Function1<? super T, Unit> function111 = function17;
        final Function1<? super T, Unit> function112 = function18;
        EffectsKt.SideEffect(new Function0() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda15
            @Override // kotlin.jvm.functions.Function0
            public final Object invoke() {
                return ClusteringKt.Clustering$lambda$20(clusterManagerRememberClusterManager, function19, function110, function111, function112);
            }
        }, composerStartRestartGroup, 0);
        if (clusterManagerRememberClusterManager != null) {
            Clustering(items, clusterManagerRememberClusterManager, composerStartRestartGroup, 72);
        }
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda16
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return ClusteringKt.Clustering$lambda$21(items, function15, function16, function17, function18, function33, function34, i, i2, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$15(ClusterManager clusterManager, ClusterRenderer clusterRenderer) {
        if (!Intrinsics.areEqual(clusterManager != null ? clusterManager.getRenderer() : null, clusterRenderer) && clusterManager != null) {
            if (clusterRenderer == null) {
                return Unit.INSTANCE;
            }
            clusterManager.setRenderer(clusterRenderer);
        }
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Clustering$lambda$20(ClusterManager clusterManager, final Function1 function1, final Function1 function12, final Function1 function13, final Function1 function14) {
        if (clusterManager == null) {
            return Unit.INSTANCE;
        }
        clusterManager.setOnClusterClickListener(new ClusterManager.OnClusterClickListener() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda3
            @Override // com.google.maps.android.clustering.ClusterManager.OnClusterClickListener
            public final boolean onClusterClick(Cluster cluster) {
                return ClusteringKt.Clustering$lambda$20$lambda$16(function1, cluster);
            }
        });
        clusterManager.setOnClusterItemClickListener(new ClusterManager.OnClusterItemClickListener() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda4
            @Override // com.google.maps.android.clustering.ClusterManager.OnClusterItemClickListener
            public final boolean onClusterItemClick(ClusterItem clusterItem) {
                return ClusteringKt.Clustering$lambda$20$lambda$17(function12, clusterItem);
            }
        });
        clusterManager.setOnClusterItemInfoWindowClickListener(new ClusterManager.OnClusterItemInfoWindowClickListener() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda5
            @Override // com.google.maps.android.clustering.ClusterManager.OnClusterItemInfoWindowClickListener
            public final void onClusterItemInfoWindowClick(ClusterItem clusterItem) {
                ClusteringKt.Clustering$lambda$20$lambda$18(function13, clusterItem);
            }
        });
        clusterManager.setOnClusterItemInfoWindowLongClickListener(new ClusterManager.OnClusterItemInfoWindowLongClickListener() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda6
            @Override // com.google.maps.android.clustering.ClusterManager.OnClusterItemInfoWindowLongClickListener
            public final void onClusterItemInfoWindowLongClick(ClusterItem clusterItem) {
                ClusteringKt.Clustering$lambda$20$lambda$19(function14, clusterItem);
            }
        });
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean Clustering$lambda$20$lambda$16(Function1 tmp0, Cluster cluster) {
        Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
        return ((Boolean) tmp0.invoke(cluster)).booleanValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean Clustering$lambda$20$lambda$17(Function1 tmp0, ClusterItem clusterItem) {
        Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
        return ((Boolean) tmp0.invoke(clusterItem)).booleanValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void Clustering$lambda$20$lambda$18(Function1 tmp0, ClusterItem clusterItem) {
        Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
        tmp0.invoke(clusterItem);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void Clustering$lambda$20$lambda$19(Function1 tmp0, ClusterItem clusterItem) {
        Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
        tmp0.invoke(clusterItem);
    }

    public static final <T extends ClusterItem> void Clustering(final Collection<? extends T> items, final ClusterManager<T> clusterManager, Composer composer, final int i) {
        Intrinsics.checkNotNullParameter(items, "items");
        Intrinsics.checkNotNullParameter(clusterManager, "clusterManager");
        Composer composerStartRestartGroup = composer.startRestartGroup(-1455015223);
        ResetMapListeners(clusterManager, composerStartRestartGroup, 8);
        InputHandlerKt.InputHandler(null, null, null, null, new AnonymousClass14(clusterManager.getMarkerManager()), new AnonymousClass15(clusterManager.getMarkerManager()), null, new AnonymousClass16(clusterManager.getMarkerManager()), new AnonymousClass17(clusterManager.getMarkerManager()), new AnonymousClass18(clusterManager.getMarkerManager()), new AnonymousClass19(clusterManager.getMarkerManager()), composerStartRestartGroup, 0, 0, 79);
        CameraPositionState currentCameraPositionState = CameraPositionStateKt.getCurrentCameraPositionState(composerStartRestartGroup, 0);
        EffectsKt.LaunchedEffect(currentCameraPositionState, new AnonymousClass20(currentCameraPositionState, clusterManager, null), composerStartRestartGroup, CameraPositionState.$stable | 64);
        State stateRememberUpdatedState = SnapshotStateKt.rememberUpdatedState(items, composerStartRestartGroup, 8);
        EffectsKt.LaunchedEffect(stateRememberUpdatedState, new AnonymousClass21(stateRememberUpdatedState, clusterManager, null), composerStartRestartGroup, 64);
        EffectsKt.DisposableEffect(stateRememberUpdatedState, (Function1<? super DisposableEffectScope, ? extends DisposableEffectResult>) new Function1() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda7
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return ClusteringKt.Clustering$lambda$23(clusterManager, (DisposableEffectScope) obj);
            }
        }, composerStartRestartGroup, 0);
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda8
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return ClusteringKt.Clustering$lambda$24(items, clusterManager, i, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$14, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
    /* synthetic */ class AnonymousClass14 extends FunctionReferenceImpl implements Function1<Marker, Boolean> {
        AnonymousClass14(Object obj) {
            super(1, obj, MarkerManager.class, "onMarkerClick", "onMarkerClick(Lcom/google/android/gms/maps/model/Marker;)Z", 0);
        }

        @Override // kotlin.jvm.functions.Function1
        public final Boolean invoke(Marker p0) {
            Intrinsics.checkNotNullParameter(p0, "p0");
            return Boolean.valueOf(((MarkerManager) this.receiver).onMarkerClick(p0));
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$15, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
    /* synthetic */ class AnonymousClass15 extends FunctionReferenceImpl implements Function1<Marker, Unit> {
        AnonymousClass15(Object obj) {
            super(1, obj, MarkerManager.class, "onInfoWindowClick", "onInfoWindowClick(Lcom/google/android/gms/maps/model/Marker;)V", 0);
        }

        @Override // kotlin.jvm.functions.Function1
        public /* bridge */ /* synthetic */ Unit invoke(Marker marker) {
            invoke2(marker);
            return Unit.INSTANCE;
        }

        /* JADX INFO: renamed from: invoke, reason: avoid collision after fix types in other method */
        public final void invoke2(Marker p0) {
            Intrinsics.checkNotNullParameter(p0, "p0");
            ((MarkerManager) this.receiver).onInfoWindowClick(p0);
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$16, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
    /* synthetic */ class AnonymousClass16 extends FunctionReferenceImpl implements Function1<Marker, Unit> {
        AnonymousClass16(Object obj) {
            super(1, obj, MarkerManager.class, "onInfoWindowLongClick", "onInfoWindowLongClick(Lcom/google/android/gms/maps/model/Marker;)V", 0);
        }

        @Override // kotlin.jvm.functions.Function1
        public /* bridge */ /* synthetic */ Unit invoke(Marker marker) {
            invoke2(marker);
            return Unit.INSTANCE;
        }

        /* JADX INFO: renamed from: invoke, reason: avoid collision after fix types in other method */
        public final void invoke2(Marker p0) {
            Intrinsics.checkNotNullParameter(p0, "p0");
            ((MarkerManager) this.receiver).onInfoWindowLongClick(p0);
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$17, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
    /* synthetic */ class AnonymousClass17 extends FunctionReferenceImpl implements Function1<Marker, Unit> {
        AnonymousClass17(Object obj) {
            super(1, obj, MarkerManager.class, "onMarkerDrag", "onMarkerDrag(Lcom/google/android/gms/maps/model/Marker;)V", 0);
        }

        @Override // kotlin.jvm.functions.Function1
        public /* bridge */ /* synthetic */ Unit invoke(Marker marker) {
            invoke2(marker);
            return Unit.INSTANCE;
        }

        /* JADX INFO: renamed from: invoke, reason: avoid collision after fix types in other method */
        public final void invoke2(Marker p0) {
            Intrinsics.checkNotNullParameter(p0, "p0");
            ((MarkerManager) this.receiver).onMarkerDrag(p0);
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$18, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
    /* synthetic */ class AnonymousClass18 extends FunctionReferenceImpl implements Function1<Marker, Unit> {
        AnonymousClass18(Object obj) {
            super(1, obj, MarkerManager.class, "onMarkerDragEnd", "onMarkerDragEnd(Lcom/google/android/gms/maps/model/Marker;)V", 0);
        }

        @Override // kotlin.jvm.functions.Function1
        public /* bridge */ /* synthetic */ Unit invoke(Marker marker) {
            invoke2(marker);
            return Unit.INSTANCE;
        }

        /* JADX INFO: renamed from: invoke, reason: avoid collision after fix types in other method */
        public final void invoke2(Marker p0) {
            Intrinsics.checkNotNullParameter(p0, "p0");
            ((MarkerManager) this.receiver).onMarkerDragEnd(p0);
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$19, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
    /* synthetic */ class AnonymousClass19 extends FunctionReferenceImpl implements Function1<Marker, Unit> {
        AnonymousClass19(Object obj) {
            super(1, obj, MarkerManager.class, "onMarkerDragStart", "onMarkerDragStart(Lcom/google/android/gms/maps/model/Marker;)V", 0);
        }

        @Override // kotlin.jvm.functions.Function1
        public /* bridge */ /* synthetic */ Unit invoke(Marker marker) {
            invoke2(marker);
            return Unit.INSTANCE;
        }

        /* JADX INFO: renamed from: invoke, reason: avoid collision after fix types in other method */
        public final void invoke2(Marker p0) {
            Intrinsics.checkNotNullParameter(p0, "p0");
            ((MarkerManager) this.receiver).onMarkerDragStart(p0);
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$20, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.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.clustering.ClusteringKt$Clustering$20", f = "Clustering.kt", i = {}, l = {178}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass20 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        final /* synthetic */ CameraPositionState $cameraPositionState;
        final /* synthetic */ ClusterManager<T> $clusterManager;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        AnonymousClass20(CameraPositionState cameraPositionState, ClusterManager<T> clusterManager, Continuation<? super AnonymousClass20> continuation) {
            super(2, continuation);
            this.$cameraPositionState = cameraPositionState;
            this.$clusterManager = clusterManager;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            return new AnonymousClass20(this.$cameraPositionState, this.$clusterManager, continuation);
        }

        @Override // kotlin.jvm.functions.Function2
        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return ((AnonymousClass20) 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);
                final CameraPositionState cameraPositionState = this.$cameraPositionState;
                Flow flowSnapshotFlow = SnapshotStateKt.snapshotFlow(new Function0() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$20$$ExternalSyntheticLambda0
                    @Override // kotlin.jvm.functions.Function0
                    public final Object invoke() {
                        return Boolean.valueOf(cameraPositionState.isMoving());
                    }
                });
                final ClusterManager<T> clusterManager = this.$clusterManager;
                this.label = 1;
                if (flowSnapshotFlow.collect(new FlowCollector() { // from class: com.google.maps.android.compose.clustering.ClusteringKt.Clustering.20.2
                    @Override // kotlinx.coroutines.flow.FlowCollector
                    public /* bridge */ /* synthetic */ Object emit(Object obj2, Continuation continuation) {
                        return emit(((Boolean) obj2).booleanValue(), (Continuation<? super Unit>) continuation);
                    }

                    public final Object emit(boolean z, Continuation<? super Unit> continuation) {
                        if (!z) {
                            clusterManager.onCameraIdle();
                        }
                        return Unit.INSTANCE;
                    }
                }, 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;
        }
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$21, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.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.clustering.ClusteringKt$Clustering$21", f = "Clustering.kt", i = {}, l = {187}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass21 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        final /* synthetic */ ClusterManager<T> $clusterManager;
        final /* synthetic */ State<Collection<T>> $itemsState;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        AnonymousClass21(State<? extends Collection<? extends T>> state, ClusterManager<T> clusterManager, Continuation<? super AnonymousClass21> continuation) {
            super(2, continuation);
            this.$itemsState = state;
            this.$clusterManager = clusterManager;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            return new AnonymousClass21(this.$itemsState, this.$clusterManager, continuation);
        }

        @Override // kotlin.jvm.functions.Function2
        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return ((AnonymousClass21) 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);
                final State<Collection<T>> state = this.$itemsState;
                Flow flowSnapshotFlow = SnapshotStateKt.snapshotFlow(new Function0() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$21$$ExternalSyntheticLambda0
                    @Override // kotlin.jvm.functions.Function0
                    public final Object invoke() {
                        return ClusteringKt.AnonymousClass21.invokeSuspend$lambda$0(state);
                    }
                });
                final ClusterManager<T> clusterManager = this.$clusterManager;
                this.label = 1;
                if (flowSnapshotFlow.collect(new FlowCollector() { // from class: com.google.maps.android.compose.clustering.ClusteringKt.Clustering.21.2
                    @Override // kotlinx.coroutines.flow.FlowCollector
                    public /* bridge */ /* synthetic */ Object emit(Object obj2, Continuation continuation) {
                        return emit((List) obj2, (Continuation<? super Unit>) continuation);
                    }

                    public final Object emit(List<? extends T> list, Continuation<? super Unit> continuation) {
                        clusterManager.clearItems();
                        clusterManager.addItems(list);
                        clusterManager.cluster();
                        return Unit.INSTANCE;
                    }
                }, 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;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final List invokeSuspend$lambda$0(State state) {
            return CollectionsKt.toList((Iterable) state.getValue());
        }
    }

    public static final <T extends ClusterItem> ClusterRenderer<T> rememberClusterRenderer(ClusterManager<T> clusterManager, Composer composer, int i) {
        composer.startReplaceableGroup(265698616);
        ProvidableCompositionLocal<Context> localContext = AndroidCompositionLocals_androidKt.getLocalContext();
        ComposerKt.sourceInformationMarkerStart(composer, 2023513938, "CC:CompositionLocal.kt#9igjgp");
        Object objConsume = composer.consume(localContext);
        ComposerKt.sourceInformationMarkerEnd(composer);
        Context context = (Context) objConsume;
        composer.startReplaceableGroup(-691004875);
        Object objRememberedValue = composer.rememberedValue();
        if (objRememberedValue == Composer.INSTANCE.getEmpty()) {
            objRememberedValue = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
            composer.updateRememberedValue(objRememberedValue);
        }
        MutableState mutableState = (MutableState) objRememberedValue;
        composer.endReplaceableGroup();
        if (clusterManager == null) {
            composer.endReplaceableGroup();
            return null;
        }
        MapEffectKt.MapEffect(context, new C06011(context, clusterManager, mutableState, null), composer, 72);
        ClusterRenderer<T> clusterRenderer = (ClusterRenderer) mutableState.getValue();
        composer.endReplaceableGroup();
        return clusterRenderer;
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterRenderer$1, reason: invalid class name and case insensitive filesystem */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;", "map", "Lcom/google/android/gms/maps/GoogleMap;"}, k = 3, mv = {2, 0, 0}, xi = 48)
    @DebugMetadata(c = "com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterRenderer$1", f = "Clustering.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
    static final class C06011 extends SuspendLambda implements Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> {
        final /* synthetic */ ClusterManager<T> $clusterManager;
        final /* synthetic */ MutableState<ClusterRenderer<T>> $clusterRendererState;
        final /* synthetic */ Context $context;
        /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        C06011(Context context, ClusterManager<T> clusterManager, MutableState<ClusterRenderer<T>> mutableState, Continuation<? super C06011> continuation) {
            super(3, continuation);
            this.$context = context;
            this.$clusterManager = clusterManager;
            this.$clusterRendererState = mutableState;
        }

        @Override // kotlin.jvm.functions.Function3
        public final Object invoke(CoroutineScope coroutineScope, GoogleMap googleMap, Continuation<? super Unit> continuation) {
            C06011 c06011 = new C06011(this.$context, this.$clusterManager, this.$clusterRendererState, continuation);
            c06011.L$0 = googleMap;
            return c06011.invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARN: Type inference incomplete: some casts might be missing */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Object invokeSuspend(Object obj) throws Throwable {
            IntrinsicsKt.getCOROUTINE_SUSPENDED();
            if (this.label != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            ResultKt.throwOnFailure(obj);
            this.$clusterRendererState.setValue(new DefaultClusterRenderer(this.$context, (GoogleMap) this.L$0, this.$clusterManager));
            return Unit.INSTANCE;
        }
    }

    public static final <T extends ClusterItem> ClusterRenderer<T> rememberClusterRenderer(Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit> function3, Function3<? super T, ? super Composer, ? super Integer, Unit> function32, ClusterManager<T> clusterManager, Composer composer, int i) {
        composer.startReplaceableGroup(1274126648);
        State stateRememberUpdatedState = SnapshotStateKt.rememberUpdatedState(function3, composer, i & 14);
        State stateRememberUpdatedState2 = SnapshotStateKt.rememberUpdatedState(function32, composer, (i >> 3) & 14);
        ProvidableCompositionLocal<Context> localContext = AndroidCompositionLocals_androidKt.getLocalContext();
        ComposerKt.sourceInformationMarkerStart(composer, 2023513938, "CC:CompositionLocal.kt#9igjgp");
        Object objConsume = composer.consume(localContext);
        ComposerKt.sourceInformationMarkerEnd(composer);
        Context context = (Context) objConsume;
        State stateRememberUpdatedState3 = SnapshotStateKt.rememberUpdatedState(MapComposeViewRenderKt.rememberComposeUiViewRenderer(composer, 0), composer, 8);
        composer.startReplaceableGroup(-690968811);
        Object objRememberedValue = composer.rememberedValue();
        if (objRememberedValue == Composer.INSTANCE.getEmpty()) {
            objRememberedValue = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
            composer.updateRememberedValue(objRememberedValue);
        }
        MutableState mutableState = (MutableState) objRememberedValue;
        composer.endReplaceableGroup();
        if (clusterManager == null) {
            composer.endReplaceableGroup();
            return null;
        }
        MapEffectKt.MapEffect(context, new C06022(context, clusterManager, stateRememberUpdatedState3, stateRememberUpdatedState, stateRememberUpdatedState2, mutableState, null), composer, 72);
        ClusterRenderer<T> clusterRenderer = (ClusterRenderer) mutableState.getValue();
        composer.endReplaceableGroup();
        return clusterRenderer;
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterRenderer$2, reason: invalid class name and case insensitive filesystem */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;", "map", "Lcom/google/android/gms/maps/GoogleMap;"}, k = 3, mv = {2, 0, 0}, xi = 48)
    @DebugMetadata(c = "com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterRenderer$2", f = "Clustering.kt", i = {}, l = {252}, m = "invokeSuspend", n = {}, s = {})
    static final class C06022 extends SuspendLambda implements Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> {
        final /* synthetic */ State<Function3<Cluster<T>, Composer, Integer, Unit>> $clusterContentState;
        final /* synthetic */ State<Function3<T, Composer, Integer, Unit>> $clusterItemContentState;
        final /* synthetic */ ClusterManager<T> $clusterManager;
        final /* synthetic */ MutableState<ClusterRenderer<T>> $clusterRendererState;
        final /* synthetic */ Context $context;
        final /* synthetic */ State<ComposeUiViewRenderer> $viewRendererState;
        private /* synthetic */ Object L$0;
        /* synthetic */ Object L$1;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        C06022(Context context, ClusterManager<T> clusterManager, State<? extends ComposeUiViewRenderer> state, State<? extends Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit>> state2, State<? extends Function3<? super T, ? super Composer, ? super Integer, Unit>> state3, MutableState<ClusterRenderer<T>> mutableState, Continuation<? super C06022> continuation) {
            super(3, continuation);
            this.$context = context;
            this.$clusterManager = clusterManager;
            this.$viewRendererState = state;
            this.$clusterContentState = state2;
            this.$clusterItemContentState = state3;
            this.$clusterRendererState = mutableState;
        }

        @Override // kotlin.jvm.functions.Function3
        public final Object invoke(CoroutineScope coroutineScope, GoogleMap googleMap, Continuation<? super Unit> continuation) {
            C06022 c06022 = new C06022(this.$context, this.$clusterManager, this.$viewRendererState, this.$clusterContentState, this.$clusterItemContentState, this.$clusterRendererState, continuation);
            c06022.L$0 = coroutineScope;
            c06022.L$1 = googleMap;
            return c06022.invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARN: Type inference incomplete: some casts might be missing */
        @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);
                this.$clusterRendererState.setValue(new ComposeUiClusterRenderer(this.$context, (CoroutineScope) this.L$0, (GoogleMap) this.L$1, this.$clusterManager, this.$viewRendererState, this.$clusterContentState, this.$clusterItemContentState));
                this.L$0 = null;
                this.label = 1;
                if (DelayKt.awaitCancellation(this) == coroutine_suspended) {
                    return coroutine_suspended;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ResultKt.throwOnFailure(obj);
            }
            throw new KotlinNothingValueException();
        }
    }

    public static final <T extends ClusterItem> ClusterManager<T> rememberClusterManager(Composer composer, int i) {
        composer.startReplaceableGroup(-2110674323);
        ProvidableCompositionLocal<Context> localContext = AndroidCompositionLocals_androidKt.getLocalContext();
        ComposerKt.sourceInformationMarkerStart(composer, 2023513938, "CC:CompositionLocal.kt#9igjgp");
        Object objConsume = composer.consume(localContext);
        ComposerKt.sourceInformationMarkerEnd(composer);
        Context context = (Context) objConsume;
        composer.startReplaceableGroup(1682557565);
        Object objRememberedValue = composer.rememberedValue();
        if (objRememberedValue == Composer.INSTANCE.getEmpty()) {
            objRememberedValue = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
            composer.updateRememberedValue(objRememberedValue);
        }
        MutableState mutableState = (MutableState) objRememberedValue;
        composer.endReplaceableGroup();
        MapEffectKt.MapEffect(context, new AnonymousClass1(mutableState, context, null), composer, 72);
        ClusterManager<T> clusterManager = (ClusterManager) mutableState.getValue();
        composer.endReplaceableGroup();
        return clusterManager;
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterManager$1, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;", "map", "Lcom/google/android/gms/maps/GoogleMap;"}, k = 3, mv = {2, 0, 0}, xi = 48)
    @DebugMetadata(c = "com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterManager$1", f = "Clustering.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass1 extends SuspendLambda implements Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> {
        final /* synthetic */ MutableState<ClusterManager<T>> $clusterManagerState;
        final /* synthetic */ Context $context;
        /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        AnonymousClass1(MutableState<ClusterManager<T>> mutableState, Context context, Continuation<? super AnonymousClass1> continuation) {
            super(3, continuation);
            this.$clusterManagerState = mutableState;
            this.$context = context;
        }

        @Override // kotlin.jvm.functions.Function3
        public final Object invoke(CoroutineScope coroutineScope, GoogleMap googleMap, Continuation<? super Unit> continuation) {
            AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$clusterManagerState, this.$context, continuation);
            anonymousClass1.L$0 = googleMap;
            return anonymousClass1.invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARN: Type inference incomplete: some casts might be missing */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Object invokeSuspend(Object obj) throws Throwable {
            IntrinsicsKt.getCOROUTINE_SUSPENDED();
            if (this.label != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            ResultKt.throwOnFailure(obj);
            this.$clusterManagerState.setValue((ClusterManager<T>) new ClusterManager(this.$context, (GoogleMap) this.L$0));
            return Unit.INSTANCE;
        }
    }

    private static final <T extends ClusterItem> ClusterManager<T> rememberClusterManager(Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit> function3, Function3<? super T, ? super Composer, ? super Integer, Unit> function32, ClusterRenderer<T> clusterRenderer, Composer composer, int i, int i2) {
        composer.startReplaceableGroup(-1803998396);
        ClusterRenderer<T> clusterRenderer2 = (i2 & 4) != 0 ? null : clusterRenderer;
        State stateRememberUpdatedState = SnapshotStateKt.rememberUpdatedState(function3, composer, i & 14);
        State stateRememberUpdatedState2 = SnapshotStateKt.rememberUpdatedState(function32, composer, (i >> 3) & 14);
        ProvidableCompositionLocal<Context> localContext = AndroidCompositionLocals_androidKt.getLocalContext();
        ComposerKt.sourceInformationMarkerStart(composer, 2023513938, "CC:CompositionLocal.kt#9igjgp");
        Object objConsume = composer.consume(localContext);
        ComposerKt.sourceInformationMarkerEnd(composer);
        Context context = (Context) objConsume;
        State stateRememberUpdatedState3 = SnapshotStateKt.rememberUpdatedState(MapComposeViewRenderKt.rememberComposeUiViewRenderer(composer, 0), composer, 8);
        composer.startReplaceableGroup(1682583069);
        Object objRememberedValue = composer.rememberedValue();
        if (objRememberedValue == Composer.INSTANCE.getEmpty()) {
            objRememberedValue = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
            composer.updateRememberedValue(objRememberedValue);
        }
        MutableState mutableState = (MutableState) objRememberedValue;
        composer.endReplaceableGroup();
        MapEffectKt.MapEffect(context, new AnonymousClass2(context, mutableState, stateRememberUpdatedState, stateRememberUpdatedState2, clusterRenderer2, stateRememberUpdatedState3, null), composer, 72);
        ClusterManager<T> clusterManager = (ClusterManager) mutableState.getValue();
        composer.endReplaceableGroup();
        return clusterManager;
    }

    /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterManager$2, reason: invalid class name */
    /* JADX INFO: compiled from: Clustering.kt */
    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;", "map", "Lcom/google/android/gms/maps/GoogleMap;"}, k = 3, mv = {2, 0, 0}, xi = 48)
    @DebugMetadata(c = "com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterManager$2", f = "Clustering.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass2 extends SuspendLambda implements Function3<CoroutineScope, GoogleMap, Continuation<? super Unit>, Object> {
        final /* synthetic */ State<Function3<Cluster<T>, Composer, Integer, Unit>> $clusterContentState;
        final /* synthetic */ State<Function3<T, Composer, Integer, Unit>> $clusterItemContentState;
        final /* synthetic */ MutableState<ClusterManager<T>> $clusterManagerState;
        final /* synthetic */ ClusterRenderer<T> $clusterRenderer;
        final /* synthetic */ Context $context;
        final /* synthetic */ State<ComposeUiViewRenderer> $viewRendererState;
        private /* synthetic */ Object L$0;
        /* synthetic */ Object L$1;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        AnonymousClass2(Context context, MutableState<ClusterManager<T>> mutableState, State<? extends Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit>> state, State<? extends Function3<? super T, ? super Composer, ? super Integer, Unit>> state2, ClusterRenderer<T> clusterRenderer, State<? extends ComposeUiViewRenderer> state3, Continuation<? super AnonymousClass2> continuation) {
            super(3, continuation);
            this.$context = context;
            this.$clusterManagerState = mutableState;
            this.$clusterContentState = state;
            this.$clusterItemContentState = state2;
            this.$clusterRenderer = clusterRenderer;
            this.$viewRendererState = state3;
        }

        @Override // kotlin.jvm.functions.Function3
        public final Object invoke(CoroutineScope coroutineScope, GoogleMap googleMap, Continuation<? super Unit> continuation) {
            AnonymousClass2 anonymousClass2 = new AnonymousClass2(this.$context, this.$clusterManagerState, this.$clusterContentState, this.$clusterItemContentState, this.$clusterRenderer, this.$viewRendererState, continuation);
            anonymousClass2.L$0 = coroutineScope;
            anonymousClass2.L$1 = googleMap;
            return anonymousClass2.invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARN: Type inference incomplete: some casts might be missing */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Object invokeSuspend(Object obj) throws Throwable {
            IntrinsicsKt.getCOROUTINE_SUSPENDED();
            if (this.label != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            ResultKt.throwOnFailure(obj);
            CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
            GoogleMap googleMap = (GoogleMap) this.L$1;
            ClusterManager clusterManager = new ClusterManager(this.$context, googleMap);
            BuildersKt__Builders_commonKt.launch$default(coroutineScope, null, null, new AnonymousClass1(this.$clusterContentState, this.$clusterItemContentState, this.$clusterRenderer, this.$context, googleMap, clusterManager, this.$viewRendererState, null), 3, null);
            this.$clusterManagerState.setValue((ClusterManager<T>) clusterManager);
            return Unit.INSTANCE;
        }

        /* JADX INFO: renamed from: com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterManager$2$1, reason: invalid class name */
        /* JADX INFO: compiled from: Clustering.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.clustering.ClusteringKt$rememberClusterManager$2$1", f = "Clustering.kt", i = {}, l = {288}, m = "invokeSuspend", n = {}, s = {})
        static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
            final /* synthetic */ State<Function3<Cluster<T>, Composer, Integer, Unit>> $clusterContentState;
            final /* synthetic */ State<Function3<T, Composer, Integer, Unit>> $clusterItemContentState;
            final /* synthetic */ ClusterManager<T> $clusterManager;
            final /* synthetic */ ClusterRenderer<T> $clusterRenderer;
            final /* synthetic */ Context $context;
            final /* synthetic */ GoogleMap $map;
            final /* synthetic */ State<ComposeUiViewRenderer> $viewRendererState;
            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(State<? extends Function3<? super Cluster<T>, ? super Composer, ? super Integer, Unit>> state, State<? extends Function3<? super T, ? super Composer, ? super Integer, Unit>> state2, ClusterRenderer<T> clusterRenderer, Context context, GoogleMap googleMap, ClusterManager<T> clusterManager, State<? extends ComposeUiViewRenderer> state3, Continuation<? super AnonymousClass1> continuation) {
                super(2, continuation);
                this.$clusterContentState = state;
                this.$clusterItemContentState = state2;
                this.$clusterRenderer = clusterRenderer;
                this.$context = context;
                this.$map = googleMap;
                this.$clusterManager = clusterManager;
                this.$viewRendererState = state3;
            }

            @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
            public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
                AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$clusterContentState, this.$clusterItemContentState, this.$clusterRenderer, this.$context, this.$map, this.$clusterManager, this.$viewRendererState, 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);
                    final CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
                    final State<Function3<Cluster<T>, Composer, Integer, Unit>> state = this.$clusterContentState;
                    final State<Function3<T, Composer, Integer, Unit>> state2 = this.$clusterItemContentState;
                    Flow flowSnapshotFlow = SnapshotStateKt.snapshotFlow(new Function0() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$rememberClusterManager$2$1$$ExternalSyntheticLambda0
                        @Override // kotlin.jvm.functions.Function0
                        public final Object invoke() {
                            return Boolean.valueOf(ClusteringKt.AnonymousClass2.AnonymousClass1.invokeSuspend$lambda$0(state, state2));
                        }
                    });
                    final ClusterRenderer<T> clusterRenderer = this.$clusterRenderer;
                    final Context context = this.$context;
                    final GoogleMap googleMap = this.$map;
                    final ClusterManager<T> clusterManager = this.$clusterManager;
                    final State<ComposeUiViewRenderer> state3 = this.$viewRendererState;
                    final State<Function3<Cluster<T>, Composer, Integer, Unit>> state4 = this.$clusterContentState;
                    final State<Function3<T, Composer, Integer, Unit>> state5 = this.$clusterItemContentState;
                    this.label = 1;
                    if (flowSnapshotFlow.collect(new FlowCollector() { // from class: com.google.maps.android.compose.clustering.ClusteringKt.rememberClusterManager.2.1.2
                        @Override // kotlinx.coroutines.flow.FlowCollector
                        public /* bridge */ /* synthetic */ Object emit(Object obj2, Continuation continuation) {
                            return emit(((Boolean) obj2).booleanValue(), (Continuation<? super Unit>) continuation);
                        }

                        public final Object emit(boolean z, Continuation<? super Unit> continuation) {
                            ComposeUiClusterRenderer defaultClusterRenderer;
                            DefaultClusterRenderer defaultClusterRenderer2 = clusterRenderer;
                            if (defaultClusterRenderer2 == null) {
                                if (z) {
                                    defaultClusterRenderer = new ComposeUiClusterRenderer(context, coroutineScope, googleMap, clusterManager, state3, state4, state5);
                                } else {
                                    defaultClusterRenderer = new DefaultClusterRenderer(context, googleMap, clusterManager);
                                }
                                defaultClusterRenderer2 = defaultClusterRenderer;
                            }
                            clusterManager.setRenderer(defaultClusterRenderer2);
                            return Unit.INSTANCE;
                        }
                    }, 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;
            }

            /* JADX INFO: Access modifiers changed from: private */
            public static final boolean invokeSuspend$lambda$0(State state, State state2) {
                return (state.getValue() == null && state2.getValue() == null) ? false : true;
            }
        }
    }

    private static final void ResetMapListeners(final ClusterManager<?> clusterManager, Composer composer, final int i) {
        Composer composerStartRestartGroup = composer.startRestartGroup(-895341247);
        Function0<Unit> function0RememberReattachClickListenersHandle = ReattachClickListenersKt.rememberReattachClickListenersHandle(composerStartRestartGroup, 0);
        composerStartRestartGroup.startReplaceableGroup(-1746958547);
        boolean zChanged = composerStartRestartGroup.changed(function0RememberReattachClickListenersHandle);
        ClusteringKt$ResetMapListeners$1$1 clusteringKt$ResetMapListeners$1$1RememberedValue = composerStartRestartGroup.rememberedValue();
        if (zChanged || clusteringKt$ResetMapListeners$1$1RememberedValue == Composer.INSTANCE.getEmpty()) {
            clusteringKt$ResetMapListeners$1$1RememberedValue = new ClusteringKt$ResetMapListeners$1$1(function0RememberReattachClickListenersHandle, null);
            composerStartRestartGroup.updateRememberedValue(clusteringKt$ResetMapListeners$1$1RememberedValue);
        }
        composerStartRestartGroup.endReplaceableGroup();
        EffectsKt.LaunchedEffect(clusterManager, function0RememberReattachClickListenersHandle, (Function2) clusteringKt$ResetMapListeners$1$1RememberedValue, composerStartRestartGroup, 520);
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$$ExternalSyntheticLambda2
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return ClusteringKt.ResetMapListeners$lambda$30(clusterManager, i, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final DisposableEffectResult Clustering$lambda$23(final ClusterManager clusterManager, DisposableEffectScope DisposableEffect) {
        Intrinsics.checkNotNullParameter(clusterManager, "$clusterManager");
        Intrinsics.checkNotNullParameter(DisposableEffect, "$this$DisposableEffect");
        return new DisposableEffectResult() { // from class: com.google.maps.android.compose.clustering.ClusteringKt$Clustering$lambda$23$$inlined$onDispose$1
            @Override // androidx.compose.runtime.DisposableEffectResult
            public void dispose() {
                clusterManager.clearItems();
                clusterManager.cluster();
            }
        };
    }
}