package com.revenuecat.purchases.ui.revenuecatui.composables;

import E3.v;
import J4.c;
import coil.compose.AsyncImagePainter;
import com.revenuecat.purchases.ui.revenuecatui.composables.ImageSource;
import com.revenuecat.purchases.ui.revenuecatui.helpers.Logger;
import kotlin.jvm.internal.o;
import kotlin.jvm.internal.p;
import w4.C3137A;

/* JADX INFO: loaded from: classes3.dex */
public final class RemoteImageKt$AsyncImage$1$1 extends p implements c {
    final /* synthetic */ c $onError;
    final /* synthetic */ ImageSource $source;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public RemoteImageKt$AsyncImage$1$1(ImageSource imageSource, c cVar) {
        super(1);
        this.$source = imageSource;
        this.$onError = cVar;
    }

    @Override // J4.c
    public /* bridge */ /* synthetic */ Object invoke(Object obj) {
        invoke((AsyncImagePainter.State.Error) obj);
        return C3137A.f25453a;
    }

    public final void invoke(AsyncImagePainter.State.Error it) {
        String str;
        o.h(it, "it");
        ImageSource imageSource = this.$source;
        if (imageSource instanceof ImageSource.Local) {
            str = "Error loading local image: '" + ((ImageSource.Local) this.$source).getResource() + '\'';
        } else {
            if (!(imageSource instanceof ImageSource.Remote)) {
                throw new v();
            }
            str = "Error loading image from '" + ((ImageSource.Remote) this.$source).getUrlString() + '\'';
        }
        Logger.INSTANCE.e(str, it.getResult().getThrowable());
        c cVar = this.$onError;
        if (cVar != null) {
            cVar.invoke(it);
        }
    }
}
