package com.ironsource;

import com.ironsource.mediationsdk.logger.IronLog;
import com.ironsource.qe;
import com.mbridge.msdk.foundation.download.core.DownloadCommon;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import org.json.JSONObject;
@Metadata(d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0002\u0010\t\n\u0002\b\b\b\u0000\u0018\u00002\u00020\u00012\u00020\u0002B\u0007¢\u0006\u0004\b\u0011\u0010\u0012J\b\u0010\u0004\u001a\u00020\u0003H\u0016J\u0012\u0010\u0007\u001a\u00020\u00062\b\u0010\u0005\u001a\u0004\u0018\u00010\u0003H\u0016J\b\u0010\t\u001a\u00020\bH\u0016J\b\u0010\u0007\u001a\u00020\nH\u0016J\b\u0010\f\u001a\u00020\u000bH\u0016R\u0016\u0010\u0004\u001a\u00020\u00038\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0007\u0010\rR\u0014\u0010\u0010\u001a\u00020\u00038BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u000e\u0010\u000f¨\u0006\u0013"}, d2 = {"Lcom/ironsource/eb;", "Lcom/ironsource/qe;", "Lcom/ironsource/qe$a;", "Lorg/json/JSONObject;", "config", "epConfig", "", "a", "", "c", "", "", DownloadCommon.DOWNLOAD_REPORT_FIND_FILE_RESULT_VALUE_B, "Lorg/json/JSONObject;", "d", "()Lorg/json/JSONObject;", fb.f2336a, "<init>", "()V", "mediationsdk_release"}, k = 1, mv = {1, 8, 0})
/* loaded from: classes4.dex */
public final class eb implements qe, qe.a {

    /* renamed from: a  reason: collision with root package name */
    private JSONObject f2297a = new JSONObject();

    private final JSONObject d() {
        JSONObject optJSONObject = this.f2297a.optJSONObject(fb.f2336a);
        return optJSONObject == null ? new JSONObject() : optJSONObject;
    }

    @Override // com.ironsource.gb
    public int a() {
        String optString = d().optString(hb.b);
        Intrinsics.checkNotNullExpressionValue(optString, "traits.optString(ISN_CTRL_INIT_DELAY)");
        Integer intOrNull = StringsKt.toIntOrNull(optString);
        if (intOrNull != null) {
            return intOrNull.intValue();
        }
        return 0;
    }

    @Override // com.ironsource.qe.a
    public void a(JSONObject jSONObject) {
        if (jSONObject == null) {
            jSONObject = this.f2297a;
        }
        this.f2297a = jSONObject;
        IronLog.INTERNAL.verbose("setEpConfig: " + this.f2297a);
    }

    @Override // com.ironsource.gb
    public long b() {
        String optString = d().optString(hb.c);
        Intrinsics.checkNotNullExpressionValue(optString, "traits.optString(LPM_BN_…FRESH_ANIMATION_DURATION)");
        Long longOrNull = StringsKt.toLongOrNull(optString);
        if (longOrNull != null) {
            return longOrNull.longValue();
        }
        return 0L;
    }

    @Override // com.ironsource.gb
    public boolean c() {
        String optString = d().optString(hb.f2391a);
        Intrinsics.checkNotNullExpressionValue(optString, "traits.optString(IS_EP_CONFIG_ENABLED)");
        String lowerCase = optString.toLowerCase(Locale.ROOT);
        Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(Locale.ROOT)");
        return Intrinsics.areEqual(lowerCase, "true");
    }

    @Override // com.ironsource.qe
    public JSONObject config() {
        return this.f2297a;
    }
}
