package com.google.maps.android.compose;

import androidx.compose.runtime.ComposablesKt;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.runtime.Updater;
import androidx.compose.ui.graphics.Color;
import androidx.compose.ui.graphics.ColorKt;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.PatternItem;
import com.google.android.gms.maps.model.Polygon;
import com.google.android.gms.maps.model.PolygonOptions;
import com.google.maps.android.data.kml.KmlPolygon;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: Polygon.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000F\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a·\u0001\u0010\u0000\u001a\u00020\u00012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u00032\b\b\u0002\u0010\u0005\u001a\u00020\u00062\b\b\u0002\u0010\u0007\u001a\u00020\b2\b\b\u0002\u0010\t\u001a\u00020\u00062\u0014\b\u0002\u0010\n\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u00030\u00032\b\b\u0002\u0010\u000b\u001a\u00020\b2\b\b\u0002\u0010\f\u001a\u00020\r2\u0010\b\u0002\u0010\u000e\u001a\n\u0012\u0004\u0012\u00020\u000f\u0018\u00010\u00032\b\b\u0002\u0010\u0010\u001a\u00020\u00112\n\b\u0002\u0010\u0012\u001a\u0004\u0018\u00010\u00132\b\b\u0002\u0010\u0014\u001a\u00020\u00062\b\b\u0002\u0010\u0015\u001a\u00020\u00112\u0014\b\u0002\u0010\u0016\u001a\u000e\u0012\u0004\u0012\u00020\u0018\u0012\u0004\u0012\u00020\u00010\u0017H\u0007¢\u0006\u0004\b\u0019\u0010\u001a¨\u0006\u001b"}, d2 = {KmlPolygon.GEOMETRY_TYPE, "", "points", "", "Lcom/google/android/gms/maps/model/LatLng;", "clickable", "", "fillColor", "Landroidx/compose/ui/graphics/Color;", "geodesic", "holes", "strokeColor", "strokeJointType", "", "strokePattern", "Lcom/google/android/gms/maps/model/PatternItem;", "strokeWidth", "", "tag", "", "visible", "zIndex", "onClick", "Lkotlin/Function1;", "Lcom/google/android/gms/maps/model/Polygon;", "Polygon-qT8xWJw", "(Ljava/util/List;ZJZLjava/util/List;JILjava/util/List;FLjava/lang/Object;ZFLkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;III)V", "maps-compose_release"}, k = 2, mv = {2, 0, 0}, xi = 48)
public final class PolygonKt {
    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$15(List points, boolean z, long j, boolean z2, List list, long j2, int i, List list2, float f, Object obj, boolean z3, float f2, Function1 function1, int i2, int i3, int i4, Composer composer, int i5) {
        Intrinsics.checkNotNullParameter(points, "$points");
        m7842PolygonqT8xWJw(points, z, j, z2, list, j2, i, list2, f, obj, z3, f2, function1, composer, RecomposeScopeImplKt.updateChangedFlags(i2 | 1), RecomposeScopeImplKt.updateChangedFlags(i3), i4);
        return Unit.INSTANCE;
    }

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

    /* JADX INFO: renamed from: Polygon-qT8xWJw, reason: not valid java name */
    public static final void m7842PolygonqT8xWJw(final List<LatLng> points, boolean z, long j, boolean z2, List<? extends List<LatLng>> list, long j2, int i, List<? extends PatternItem> list2, float f, Object obj, boolean z3, float f2, Function1<? super Polygon, Unit> function1, Composer composer, final int i2, final int i3, final int i4) {
        Intrinsics.checkNotNullParameter(points, "points");
        Composer composerStartRestartGroup = composer.startRestartGroup(-52967640);
        boolean z4 = (i4 & 2) != 0 ? false : z;
        long jM4527getBlack0d7_KjU = (i4 & 4) != 0 ? Color.INSTANCE.m4527getBlack0d7_KjU() : j;
        boolean z5 = (i4 & 8) != 0 ? false : z2;
        List<? extends List<LatLng>> listEmptyList = (i4 & 16) != 0 ? CollectionsKt.emptyList() : list;
        long jM4527getBlack0d7_KjU2 = (i4 & 32) != 0 ? Color.INSTANCE.m4527getBlack0d7_KjU() : j2;
        int i5 = (i4 & 64) != 0 ? 0 : i;
        List<? extends PatternItem> list3 = (i4 & 128) != 0 ? null : list2;
        float f3 = (i4 & 256) != 0 ? 10.0f : f;
        Object obj2 = (i4 & 512) != 0 ? null : obj;
        boolean z6 = (i4 & 1024) != 0 ? true : z3;
        float f4 = (i4 & 2048) != 0 ? 0.0f : f2;
        Function1<? super Polygon, Unit> function12 = (i4 & 4096) != 0 ? new Function1() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda0
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj3) {
                return PolygonKt.Polygon_qT8xWJw$lambda$0((Polygon) obj3);
            }
        } : function1;
        final MapApplier mapApplier = (MapApplier) composerStartRestartGroup.getApplier();
        final Object obj3 = obj2;
        final Function1<? super Polygon, Unit> function13 = function12;
        final boolean z7 = z4;
        final long j3 = jM4527getBlack0d7_KjU;
        final boolean z8 = z5;
        final Function1<? super Polygon, Unit> function14 = function12;
        final List<? extends List<LatLng>> list4 = listEmptyList;
        final List<? extends PatternItem> list5 = list3;
        final Object obj4 = obj2;
        final long j4 = jM4527getBlack0d7_KjU2;
        final List<? extends List<LatLng>> list6 = listEmptyList;
        final int i6 = i5;
        final float f5 = f3;
        final boolean z9 = z6;
        final float f6 = f4;
        final Function0 function0 = new Function0() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda9
            @Override // kotlin.jvm.functions.Function0
            public final Object invoke() {
                return PolygonKt.Polygon_qT8xWJw$lambda$2(mapApplier, obj3, function13, points, z7, j3, z8, list4, j4, i6, list5, f5, z9, f6);
            }
        };
        composerStartRestartGroup.startReplaceableGroup(1886828752);
        ComposerKt.sourceInformation(composerStartRestartGroup, "CC(ComposeNode):Composables.kt#9igjgp");
        if (!(composerStartRestartGroup.getApplier() instanceof MapApplier)) {
            ComposablesKt.invalidApplier();
        }
        composerStartRestartGroup.startNode();
        if (composerStartRestartGroup.getInserting()) {
            composerStartRestartGroup.createNode(new Function0<PolygonNode>() { // from class: com.google.maps.android.compose.PolygonKt$Polygon-qT8xWJw$$inlined$ComposeNode$1
                {
                    super(0);
                }

                /* JADX WARN: Type inference failed for: r0v1, types: [com.google.maps.android.compose.PolygonNode, java.lang.Object] */
                @Override // kotlin.jvm.functions.Function0
                public final PolygonNode invoke() {
                    return function0.invoke();
                }
            });
        } else {
            composerStartRestartGroup.useNode();
        }
        Composer composerM3820constructorimpl = Updater.m3820constructorimpl(composerStartRestartGroup);
        Updater.m3830updateimpl(composerM3820constructorimpl, function14, (Function2<? super T, ? super Function1<? super Polygon, Unit>, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda10
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$3((PolygonNode) obj5, (Function1) obj6);
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, points, (Function2<? super T, ? super List<LatLng>, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda11
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$4((PolygonNode) obj5, (List) obj6);
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Boolean.valueOf(z4), (Function2<? super T, ? super Boolean, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda12
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$5((PolygonNode) obj5, ((Boolean) obj6).booleanValue());
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Color.m4491boximpl(jM4527getBlack0d7_KjU), new Function2<PolygonNode, Color, Unit>() { // from class: com.google.maps.android.compose.PolygonKt$Polygon$3$4
            @Override // kotlin.jvm.functions.Function2
            public /* bridge */ /* synthetic */ Unit invoke(PolygonNode polygonNode, Color color) {
                m7843invoke4WTKRHQ(polygonNode, color.m4511unboximpl());
                return Unit.INSTANCE;
            }

            /* JADX INFO: renamed from: invoke-4WTKRHQ, reason: not valid java name */
            public final void m7843invoke4WTKRHQ(PolygonNode update, long j5) {
                Intrinsics.checkNotNullParameter(update, "$this$update");
                update.getPolygon().setFillColor(ColorKt.m4555toArgb8_81llA(j5));
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Boolean.valueOf(z5), (Function2<? super T, ? super Boolean, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda13
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$6((PolygonNode) obj5, ((Boolean) obj6).booleanValue());
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, list6, (Function2<? super T, ? super List<? extends List<LatLng>>, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda1
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$7((PolygonNode) obj5, (List) obj6);
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Color.m4491boximpl(jM4527getBlack0d7_KjU2), new Function2<PolygonNode, Color, Unit>() { // from class: com.google.maps.android.compose.PolygonKt$Polygon$3$7
            @Override // kotlin.jvm.functions.Function2
            public /* bridge */ /* synthetic */ Unit invoke(PolygonNode polygonNode, Color color) {
                m7844invoke4WTKRHQ(polygonNode, color.m4511unboximpl());
                return Unit.INSTANCE;
            }

            /* JADX INFO: renamed from: invoke-4WTKRHQ, reason: not valid java name */
            public final void m7844invoke4WTKRHQ(PolygonNode update, long j5) {
                Intrinsics.checkNotNullParameter(update, "$this$update");
                update.getPolygon().setStrokeColor(ColorKt.m4555toArgb8_81llA(j5));
            }
        });
        Function2 function2 = new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda2
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$8((PolygonNode) obj5, ((Integer) obj6).intValue());
            }
        };
        boolean inserting = composerM3820constructorimpl.getInserting();
        if (inserting || !Intrinsics.areEqual(composerM3820constructorimpl.rememberedValue(), Integer.valueOf(i5))) {
            composerM3820constructorimpl.updateRememberedValue(Integer.valueOf(i5));
            if (!inserting) {
                composerM3820constructorimpl.apply(Integer.valueOf(i5), function2);
            }
        }
        Updater.m3830updateimpl(composerM3820constructorimpl, list5, (Function2<? super T, ? super List<? extends PatternItem>, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda3
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$9((PolygonNode) obj5, (List) obj6);
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Float.valueOf(f3), (Function2<? super T, ? super Float, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda4
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$10((PolygonNode) obj5, ((Float) obj6).floatValue());
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, obj4, (Function2<? super T, ? super Object, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda5
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$11((PolygonNode) obj5, obj6);
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Boolean.valueOf(z6), (Function2<? super T, ? super Boolean, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda6
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$12((PolygonNode) obj5, ((Boolean) obj6).booleanValue());
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Float.valueOf(f4), (Function2<? super T, ? super Float, Unit>) new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda7
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj5, Object obj6) {
                return PolygonKt.Polygon_qT8xWJw$lambda$14$lambda$13((PolygonNode) obj5, ((Float) obj6).floatValue());
            }
        });
        composerStartRestartGroup.endNode();
        composerStartRestartGroup.endReplaceableGroup();
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            final boolean z10 = z4;
            final long j5 = jM4527getBlack0d7_KjU;
            final boolean z11 = z5;
            final long j6 = jM4527getBlack0d7_KjU2;
            final int i7 = i5;
            final float f7 = f3;
            final boolean z12 = z6;
            final float f8 = f4;
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.PolygonKt$$ExternalSyntheticLambda8
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj5, Object obj6) {
                    return PolygonKt.Polygon_qT8xWJw$lambda$15(points, z10, j5, z11, list6, j6, i7, list5, f7, obj4, z12, f8, function14, i2, i3, i4, (Composer) obj5, ((Integer) obj6).intValue());
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final PolygonNode Polygon_qT8xWJw$lambda$2(MapApplier mapApplier, Object obj, Function1 function1, List points, boolean z, long j, boolean z2, List list, long j2, int i, List list2, float f, boolean z3, float f2) {
        GoogleMap map;
        Intrinsics.checkNotNullParameter(points, "$points");
        if (mapApplier != null && (map = mapApplier.getMap()) != null) {
            PolygonOptions polygonOptions = new PolygonOptions();
            polygonOptions.addAll(points);
            polygonOptions.clickable(z);
            polygonOptions.fillColor(ColorKt.m4555toArgb8_81llA(j));
            polygonOptions.geodesic(z2);
            Iterator it = list.iterator();
            while (it.hasNext()) {
                polygonOptions.addHole((List) it.next());
            }
            polygonOptions.strokeColor(ColorKt.m4555toArgb8_81llA(j2));
            polygonOptions.strokeJointType(i);
            polygonOptions.strokePattern(list2);
            polygonOptions.strokeWidth(f);
            polygonOptions.visible(z3);
            polygonOptions.zIndex(f2);
            Polygon polygonAddPolygon = map.addPolygon(polygonOptions);
            Intrinsics.checkNotNullExpressionValue(polygonAddPolygon, "this.addPolygon(\n       …ons(optionsActions)\n    )");
            if (polygonAddPolygon != null) {
                polygonAddPolygon.setTag(obj);
                return new PolygonNode(polygonAddPolygon, function1);
            }
        }
        throw new IllegalStateException("Error adding polygon".toString());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$3(PolygonNode update, Function1 it) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        Intrinsics.checkNotNullParameter(it, "it");
        update.setOnPolygonClick(it);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$4(PolygonNode update, List it) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        Intrinsics.checkNotNullParameter(it, "it");
        update.getPolygon().setPoints(it);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$5(PolygonNode update, boolean z) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getPolygon().setClickable(z);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$6(PolygonNode update, boolean z) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getPolygon().setGeodesic(z);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$7(PolygonNode update, List it) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        Intrinsics.checkNotNullParameter(it, "it");
        update.getPolygon().setHoles(it);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$8(PolygonNode update, int i) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getPolygon().setStrokeJointType(i);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$9(PolygonNode update, List list) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getPolygon().setStrokePattern(list);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$10(PolygonNode update, float f) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getPolygon().setStrokeWidth(f);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$11(PolygonNode update, Object obj) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getPolygon().setTag(obj);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$12(PolygonNode update, boolean z) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getPolygon().setVisible(z);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit Polygon_qT8xWJw$lambda$14$lambda$13(PolygonNode update, float f) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getPolygon().setZIndex(f);
        return Unit.INSTANCE;
    }
}