package com.google.maps.android.compose;

import androidx.compose.runtime.Composer;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.ui.geometry.Offset;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.BitmapDescriptor;
import com.google.android.gms.maps.model.GroundOverlay;
import com.google.android.gms.maps.model.GroundOverlayOptions;
import io.ktor.http.LinkHeader;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: GroundOverlay.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\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u001a}\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u000b2\n\b\u0002\u0010\f\u001a\u0004\u0018\u00010\r2\b\b\u0002\u0010\u000e\u001a\u00020\t2\b\b\u0002\u0010\u000f\u001a\u00020\u000b2\b\b\u0002\u0010\u0010\u001a\u00020\t2\u0014\b\u0002\u0010\u0011\u001a\u000e\u0012\u0004\u0012\u00020\u0013\u0012\u0004\u0012\u00020\u00010\u0012H\u0007¢\u0006\u0004\b\u0014\u0010\u0015\u001a\u0014\u0010\u0002\u001a\u00020\u0001*\u00020\u00132\u0006\u0010\u0002\u001a\u00020\u0003H\u0002\u001a\u0014\u0010\u0002\u001a\u00020\u0016*\u00020\u00162\u0006\u0010\u0002\u001a\u00020\u0003H\u0002¨\u0006\u0017"}, d2 = {"GroundOverlay", "", "position", "Lcom/google/maps/android/compose/GroundOverlayPosition;", "image", "Lcom/google/android/gms/maps/model/BitmapDescriptor;", LinkHeader.Parameters.Anchor, "Landroidx/compose/ui/geometry/Offset;", "bearing", "", "clickable", "", "tag", "", "transparency", "visible", "zIndex", "onClick", "Lkotlin/Function1;", "Lcom/google/android/gms/maps/model/GroundOverlay;", "GroundOverlay-bPm4XcI", "(Lcom/google/maps/android/compose/GroundOverlayPosition;Lcom/google/android/gms/maps/model/BitmapDescriptor;JFZLjava/lang/Object;FZFLkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V", "Lcom/google/android/gms/maps/model/GroundOverlayOptions;", "maps-compose_release"}, k = 2, mv = {2, 0, 0}, xi = 48)
public final class GroundOverlayKt {
    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GroundOverlay_bPm4XcI$lambda$13(GroundOverlayPosition position, BitmapDescriptor image, long j, float f, boolean z, Object obj, float f2, boolean z2, float f3, Function1 function1, int i, int i2, Composer composer, int i3) {
        Intrinsics.checkNotNullParameter(position, "$position");
        Intrinsics.checkNotNullParameter(image, "$image");
        m7780GroundOverlaybPm4XcI(position, image, j, f, z, obj, f2, z2, f3, function1, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
        return Unit.INSTANCE;
    }

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

    /* JADX WARN: Removed duplicated region for block: B:101:0x0126  */
    /* JADX WARN: Removed duplicated region for block: B:107:0x014d  */
    /* JADX WARN: Removed duplicated region for block: B:108:0x014f  */
    /* JADX WARN: Removed duplicated region for block: B:109:0x0158  */
    /* JADX WARN: Removed duplicated region for block: B:112:0x015d  */
    /* JADX WARN: Removed duplicated region for block: B:113:0x0160  */
    /* JADX WARN: Removed duplicated region for block: B:115:0x0164  */
    /* JADX WARN: Removed duplicated region for block: B:116:0x0168  */
    /* JADX WARN: Removed duplicated region for block: B:119:0x016d  */
    /* JADX WARN: Removed duplicated region for block: B:120:0x016f  */
    /* JADX WARN: Removed duplicated region for block: B:122:0x0173  */
    /* JADX WARN: Removed duplicated region for block: B:123:0x0176  */
    /* JADX WARN: Removed duplicated region for block: B:125:0x017a  */
    /* JADX WARN: Removed duplicated region for block: B:126:0x017e  */
    /* JADX WARN: Removed duplicated region for block: B:128:0x0182  */
    /* JADX WARN: Removed duplicated region for block: B:129:0x0185  */
    /* JADX WARN: Removed duplicated region for block: B:131:0x0189  */
    /* JADX WARN: Removed duplicated region for block: B:132:0x0190  */
    /* JADX WARN: Removed duplicated region for block: B:135:0x019a  */
    /* JADX WARN: Removed duplicated region for block: B:138:0x01cd  */
    /* JADX WARN: Removed duplicated region for block: B:141:0x01d9  */
    /* JADX WARN: Removed duplicated region for block: B:142:0x01e4  */
    /* JADX WARN: Removed duplicated region for block: B:146:0x0267  */
    /* JADX WARN: Removed duplicated region for block: B:148:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0069  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x006c  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x0085  */
    /* JADX WARN: Removed duplicated region for block: B:48:0x0088  */
    /* JADX WARN: Removed duplicated region for block: B:58:0x00a3  */
    /* JADX WARN: Removed duplicated region for block: B:61:0x00aa  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x00b1  */
    /* JADX WARN: Removed duplicated region for block: B:71:0x00ca  */
    /* JADX WARN: Removed duplicated region for block: B:72:0x00d1  */
    /* JADX WARN: Removed duplicated region for block: B:81:0x00e9  */
    /* JADX WARN: Removed duplicated region for block: B:82:0x00f0  */
    /* JADX WARN: Removed duplicated region for block: B:91:0x0109  */
    /* JADX WARN: Removed duplicated region for block: B:93:0x010e  */
    /* JADX INFO: renamed from: GroundOverlay-bPm4XcI, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public static final void m7780GroundOverlaybPm4XcI(final com.google.maps.android.compose.GroundOverlayPosition r24, final com.google.android.gms.maps.model.BitmapDescriptor r25, long r26, float r28, boolean r29, java.lang.Object r30, float r31, boolean r32, float r33, kotlin.jvm.functions.Function1<? super com.google.android.gms.maps.model.GroundOverlay, kotlin.Unit> r34, androidx.compose.runtime.Composer r35, final int r36, final int r37) {
        /*
            Method dump skipped, instruction units count: 635
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.maps.android.compose.GroundOverlayKt.m7780GroundOverlaybPm4XcI(com.google.maps.android.compose.GroundOverlayPosition, com.google.android.gms.maps.model.BitmapDescriptor, long, float, boolean, java.lang.Object, float, boolean, float, kotlin.jvm.functions.Function1, androidx.compose.runtime.Composer, int, int):void");
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final GroundOverlayNode GroundOverlay_bPm4XcI$lambda$2(MapApplier mapApplier, Object obj, Function1 function1, long j, float f, boolean z, BitmapDescriptor image, GroundOverlayPosition position, float f2, boolean z2, float f3) {
        GoogleMap map;
        Intrinsics.checkNotNullParameter(image, "$image");
        Intrinsics.checkNotNullParameter(position, "$position");
        if (mapApplier != null && (map = mapApplier.getMap()) != null) {
            GroundOverlayOptions groundOverlayOptions = new GroundOverlayOptions();
            groundOverlayOptions.anchor(Offset.m4257getXimpl(j), Offset.m4258getYimpl(j));
            groundOverlayOptions.bearing(f);
            groundOverlayOptions.clickable(z);
            groundOverlayOptions.image(image);
            position(groundOverlayOptions, position);
            groundOverlayOptions.transparency(f2);
            groundOverlayOptions.visible(z2);
            groundOverlayOptions.zIndex(f3);
            GroundOverlay groundOverlayAddGroundOverlay = map.addGroundOverlay(groundOverlayOptions);
            if (groundOverlayAddGroundOverlay != null) {
                groundOverlayAddGroundOverlay.setTag(obj);
                return new GroundOverlayNode(groundOverlayAddGroundOverlay, function1);
            }
        }
        throw new IllegalStateException("Error adding ground overlay".toString());
    }

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

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GroundOverlay_bPm4XcI$lambda$12$lambda$4(GroundOverlayNode update, float f) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getGroundOverlay().setBearing(f);
        return Unit.INSTANCE;
    }

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

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GroundOverlay_bPm4XcI$lambda$12$lambda$6(GroundOverlayNode update, BitmapDescriptor it) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        Intrinsics.checkNotNullParameter(it, "it");
        update.getGroundOverlay().setImage(it);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GroundOverlay_bPm4XcI$lambda$12$lambda$7(GroundOverlayNode update, GroundOverlayPosition it) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        Intrinsics.checkNotNullParameter(it, "it");
        position(update.getGroundOverlay(), it);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GroundOverlay_bPm4XcI$lambda$12$lambda$8(GroundOverlayNode update, Object obj) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getGroundOverlay().setTag(obj);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GroundOverlay_bPm4XcI$lambda$12$lambda$9(GroundOverlayNode update, float f) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getGroundOverlay().setTransparency(f);
        return Unit.INSTANCE;
    }

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

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit GroundOverlay_bPm4XcI$lambda$12$lambda$11(GroundOverlayNode update, float f) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getGroundOverlay().setZIndex(f);
        return Unit.INSTANCE;
    }

    private static final void position(GroundOverlay groundOverlay, GroundOverlayPosition groundOverlayPosition) {
        if (groundOverlayPosition.getLatLngBounds() != null) {
            groundOverlay.setPositionFromBounds(groundOverlayPosition.getLatLngBounds());
            return;
        }
        if (groundOverlayPosition.getLocation() != null) {
            groundOverlay.setPosition(groundOverlayPosition.getLocation());
        }
        if (groundOverlayPosition.getWidth() != null && groundOverlayPosition.getHeight() == null) {
            groundOverlay.setDimensions(groundOverlayPosition.getWidth().floatValue());
        } else {
            if (groundOverlayPosition.getWidth() == null || groundOverlayPosition.getHeight() == null) {
                return;
            }
            groundOverlay.setDimensions(groundOverlayPosition.getWidth().floatValue(), groundOverlayPosition.getHeight().floatValue());
        }
    }

    private static final GroundOverlayOptions position(GroundOverlayOptions groundOverlayOptions, GroundOverlayPosition groundOverlayPosition) {
        if (groundOverlayPosition.getLatLngBounds() != null) {
            GroundOverlayOptions groundOverlayOptionsPositionFromBounds = groundOverlayOptions.positionFromBounds(groundOverlayPosition.getLatLngBounds());
            Intrinsics.checkNotNullExpressionValue(groundOverlayOptionsPositionFromBounds, "positionFromBounds(...)");
            return groundOverlayOptionsPositionFromBounds;
        }
        if (groundOverlayPosition.getLocation() == null || groundOverlayPosition.getWidth() == null) {
            throw new IllegalStateException("Invalid position " + groundOverlayPosition);
        }
        if (groundOverlayPosition.getHeight() == null) {
            GroundOverlayOptions groundOverlayOptionsPosition = groundOverlayOptions.position(groundOverlayPosition.getLocation(), groundOverlayPosition.getWidth().floatValue());
            Intrinsics.checkNotNullExpressionValue(groundOverlayOptionsPosition, "position(...)");
            return groundOverlayOptionsPosition;
        }
        GroundOverlayOptions groundOverlayOptionsPosition2 = groundOverlayOptions.position(groundOverlayPosition.getLocation(), groundOverlayPosition.getWidth().floatValue(), groundOverlayPosition.getHeight().floatValue());
        Intrinsics.checkNotNullExpressionValue(groundOverlayOptionsPosition2, "position(...)");
        return groundOverlayOptionsPosition2;
    }
}