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

import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import com.google.android.gms.maps.StreetViewPanorama;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.StreetViewPanoramaCamera;
import com.google.android.gms.maps.model.StreetViewPanoramaLink;
import com.google.android.gms.maps.model.StreetViewPanoramaLocation;
import com.google.android.gms.maps.model.StreetViewSource;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: StreetViewCameraPositionState.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000J\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0007\u0018\u00002\u00020\u0001B\t\b\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0016\u0010\u001f\u001a\u00020 2\u0006\u0010!\u001a\u00020\u00102\u0006\u0010\"\u001a\u00020#J+\u0010$\u001a\u00020 2\u0006\u0010%\u001a\u00020&2\n\b\u0002\u0010'\u001a\u0004\u0018\u00010#2\n\b\u0002\u0010(\u001a\u0004\u0018\u00010)¢\u0006\u0002\u0010*J\u000e\u0010$\u001a\u00020 2\u0006\u0010+\u001a\u00020,R\u0011\u0010\u0004\u001a\u00020\u00058F¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007R+\u0010\t\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u00058@@@X\u0080\u008e\u0002¢\u0006\u0012\n\u0004\b\r\u0010\u000e\u001a\u0004\b\n\u0010\u0007\"\u0004\b\u000b\u0010\fR\u0011\u0010\u000f\u001a\u00020\u00108F¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u0012R+\u0010\u0013\u001a\u00020\u00102\u0006\u0010\b\u001a\u00020\u00108@@@X\u0080\u008e\u0002¢\u0006\u0012\n\u0004\b\u0017\u0010\u000e\u001a\u0004\b\u0014\u0010\u0012\"\u0004\b\u0015\u0010\u0016R(\u0010\u001a\u001a\u0004\u0018\u00010\u00192\b\u0010\u0018\u001a\u0004\u0018\u00010\u0019@@X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001b\u0010\u001c\"\u0004\b\u001d\u0010\u001e¨\u0006-"}, d2 = {"Lcom/google/maps/android/compose/streetview/StreetViewCameraPositionState;", "", "<init>", "()V", "location", "Lcom/google/android/gms/maps/model/StreetViewPanoramaLocation;", "getLocation", "()Lcom/google/android/gms/maps/model/StreetViewPanoramaLocation;", "<set-?>", "rawLocation", "getRawLocation$maps_compose_release", "setRawLocation$maps_compose_release", "(Lcom/google/android/gms/maps/model/StreetViewPanoramaLocation;)V", "rawLocation$delegate", "Landroidx/compose/runtime/MutableState;", "panoramaCamera", "Lcom/google/android/gms/maps/model/StreetViewPanoramaCamera;", "getPanoramaCamera", "()Lcom/google/android/gms/maps/model/StreetViewPanoramaCamera;", "rawPanoramaCamera", "getRawPanoramaCamera$maps_compose_release", "setRawPanoramaCamera$maps_compose_release", "(Lcom/google/android/gms/maps/model/StreetViewPanoramaCamera;)V", "rawPanoramaCamera$delegate", "value", "Lcom/google/android/gms/maps/StreetViewPanorama;", "panorama", "getPanorama$maps_compose_release", "()Lcom/google/android/gms/maps/StreetViewPanorama;", "setPanorama$maps_compose_release", "(Lcom/google/android/gms/maps/StreetViewPanorama;)V", "animateTo", "", "camera", "durationMs", "", "setPosition", "position", "Lcom/google/android/gms/maps/model/LatLng;", "radius", "source", "Lcom/google/android/gms/maps/model/StreetViewSource;", "(Lcom/google/android/gms/maps/model/LatLng;Ljava/lang/Integer;Lcom/google/android/gms/maps/model/StreetViewSource;)V", "panoId", "", "maps-compose_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
public final class StreetViewCameraPositionState {
    public static final int $stable = 8;
    private StreetViewPanorama panorama;

    /* JADX INFO: renamed from: rawLocation$delegate, reason: from kotlin metadata */
    private final MutableState rawLocation = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(new StreetViewPanoramaLocation(new StreetViewPanoramaLink[0], new LatLng(0.0d, 0.0d), ""), null, 2, null);

    /* JADX INFO: renamed from: rawPanoramaCamera$delegate, reason: from kotlin metadata */
    private final MutableState rawPanoramaCamera = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(new StreetViewPanoramaCamera(0.0f, 0.0f, 0.0f), null, 2, null);

    public final StreetViewPanoramaLocation getLocation() {
        return getRawLocation$maps_compose_release();
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final StreetViewPanoramaLocation getRawLocation$maps_compose_release() {
        return (StreetViewPanoramaLocation) this.rawLocation.getValue();
    }

    public final void setRawLocation$maps_compose_release(StreetViewPanoramaLocation streetViewPanoramaLocation) {
        Intrinsics.checkNotNullParameter(streetViewPanoramaLocation, "<set-?>");
        this.rawLocation.setValue(streetViewPanoramaLocation);
    }

    public final StreetViewPanoramaCamera getPanoramaCamera() {
        return getRawPanoramaCamera$maps_compose_release();
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final StreetViewPanoramaCamera getRawPanoramaCamera$maps_compose_release() {
        return (StreetViewPanoramaCamera) this.rawPanoramaCamera.getValue();
    }

    public final void setRawPanoramaCamera$maps_compose_release(StreetViewPanoramaCamera streetViewPanoramaCamera) {
        Intrinsics.checkNotNullParameter(streetViewPanoramaCamera, "<set-?>");
        this.rawPanoramaCamera.setValue(streetViewPanoramaCamera);
    }

    /* JADX INFO: renamed from: getPanorama$maps_compose_release, reason: from getter */
    public final StreetViewPanorama getPanorama() {
        return this.panorama;
    }

    public final void setPanorama$maps_compose_release(StreetViewPanorama streetViewPanorama) {
        StreetViewPanorama streetViewPanorama2 = this.panorama;
        if (streetViewPanorama2 == null && streetViewPanorama == null) {
            return;
        }
        if (streetViewPanorama2 != null && streetViewPanorama != null) {
            throw new IllegalStateException("StreetViewCameraPositionState may only be associated with one StreetView at a time.".toString());
        }
        this.panorama = streetViewPanorama;
    }

    public final void animateTo(StreetViewPanoramaCamera camera, int durationMs) {
        Intrinsics.checkNotNullParameter(camera, "camera");
        StreetViewPanorama streetViewPanorama = this.panorama;
        if (streetViewPanorama != null) {
            streetViewPanorama.animateTo(camera, durationMs);
        }
    }

    public static /* synthetic */ void setPosition$default(StreetViewCameraPositionState streetViewCameraPositionState, LatLng latLng, Integer num, StreetViewSource streetViewSource, int i, Object obj) {
        if ((i & 2) != 0) {
            num = null;
        }
        if ((i & 4) != 0) {
            streetViewSource = null;
        }
        streetViewCameraPositionState.setPosition(latLng, num, streetViewSource);
    }

    public final void setPosition(LatLng position, Integer radius, StreetViewSource source) {
        StreetViewPanorama streetViewPanorama;
        Intrinsics.checkNotNullParameter(position, "position");
        if (radius == null && source == null) {
            StreetViewPanorama streetViewPanorama2 = this.panorama;
            if (streetViewPanorama2 != null) {
                streetViewPanorama2.setPosition(position);
                return;
            }
            return;
        }
        if (radius == null || source != null) {
            if (radius == null || (streetViewPanorama = this.panorama) == null) {
                return;
            }
            streetViewPanorama.setPosition(position, radius.intValue(), source);
            return;
        }
        StreetViewPanorama streetViewPanorama3 = this.panorama;
        if (streetViewPanorama3 != null) {
            streetViewPanorama3.setPosition(position, radius.intValue());
        }
    }

    public final void setPosition(String panoId) {
        Intrinsics.checkNotNullParameter(panoId, "panoId");
        StreetViewPanorama streetViewPanorama = this.panorama;
        if (streetViewPanorama != null) {
            streetViewPanorama.setPosition(panoId);
        }
    }
}