package p138.p176.p291.p296.p297.p303;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import p402.p411.p413.C6635;
import p402.p420.C6689;
import p447.AbstractC6930;
import p447.AbstractC6936;
import p447.C6866;
import p447.C6908;
import p447.C6914;
import p447.C6916;
import p447.C6921;
import p447.C6926;
import p447.C6928;
import p447.C6933;
import p447.p448.C6943;

/* JADX INFO: renamed from: ދ.ހ.ށ.ބ.ށ.ފ.ؠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C5819 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public static final C6921 f16503;

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final EnumC5818 f16504;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final String f16505;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final Map<String, String> f16506;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public C6916.C6917 f16508 = null;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final Map<String, String> f16507 = new HashMap();

    static {
        C6921.C6922 c6922 = new C6921.C6922(new C6921());
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        if (timeUnit == null) {
            C6635.m9824("unit");
            throw null;
        }
        c6922.f20111 = C6943.m10148("timeout", 10000L, timeUnit);
        f16503 = new C6921(c6922);
    }

    public C5819(EnumC5818 enumC5818, String str, Map<String, String> map) {
        this.f16504 = enumC5818;
        this.f16505 = str;
        this.f16506 = map;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C5819 m9123(String str, String str2) {
        AbstractC6930.C6931 c6931;
        C6916.C6917 c6917M9126 = m9126();
        if (c6917M9126 == null) {
            throw null;
        }
        if (str == null) {
            C6635.m9824("name");
            throw null;
        }
        if (str2 == null) {
            C6635.m9824("value");
            throw null;
        }
        C6916.C6919.C6920 c6920 = C6916.C6919.f20052;
        if (c6920 == null || (c6931 = AbstractC6930.Companion) == null) {
            throw null;
        }
        byte[] bytes = str2.getBytes(C6689.f19437);
        C6635.m9823((Object) bytes, "(this as java.lang.String).getBytes(charset)");
        c6917M9126.m10109(c6920.m10112(str, null, c6931.m10125(bytes, null, 0, bytes.length)));
        this.f16508 = c6917M9126;
        return this;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C5819 m9124(String str, String str2, String str3, File file) {
        C6914 c6914M10106 = C6914.f20034.m10106(str3);
        if (AbstractC6930.Companion == null) {
            throw null;
        }
        if (file == null) {
            C6635.m9824("file");
            throw null;
        }
        C6928 c6928 = new C6928(file, c6914M10106);
        C6916.C6917 c6917M9126 = m9126();
        if (c6917M9126 == null) {
            throw null;
        }
        if (str == null) {
            C6635.m9824("name");
            throw null;
        }
        c6917M9126.m10109(C6916.C6919.f20052.m10112(str, str2, c6928));
        this.f16508 = c6917M9126;
        return this;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C5821 m9125() throws IOException {
        C6908 c6908M10099;
        C6926.C6927 c6927 = new C6926.C6927();
        int i = -1;
        String string = new C6866(true, false, i, -1, false, false, false, i, i, false, false, false, null, null).toString();
        if (string.length() == 0) {
            c6927.m10118("Cache-Control");
        } else {
            c6927.m10119("Cache-Control", string);
        }
        String str = this.f16505;
        C6908.C6911 c6911 = C6908.f20012;
        if (c6911 == null) {
            throw null;
        }
        if (str == null) {
            C6635.m9824("$this$toHttpUrlOrNull");
            throw null;
        }
        try {
            c6908M10099 = c6911.m10099(str);
        } catch (IllegalArgumentException unused) {
            c6908M10099 = null;
        }
        C6908.C6909 c6909M10086 = c6908M10099.m10086();
        for (Map.Entry<String, String> entry : this.f16506.entrySet()) {
            c6909M10086.m10090(entry.getKey(), entry.getValue());
        }
        c6927.f20133 = c6909M10086.m10092();
        for (Map.Entry<String, String> entry2 : this.f16507.entrySet()) {
            c6927.m10119(entry2.getKey(), entry2.getValue());
        }
        C6916.C6917 c6917 = this.f16508;
        c6927.m10120(this.f16504.name(), c6917 == null ? null : c6917.m10110());
        C6933 c6933Mo10025 = f16503.mo10028(c6927.m10123()).mo10025();
        AbstractC6936 abstractC6936 = c6933Mo10025.f20152;
        return new C5821(c6933Mo10025.f20149, abstractC6936 != null ? abstractC6936.m10138() : null, c6933Mo10025.f20151);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C6916.C6917 m9126() {
        if (this.f16508 == null) {
            C6916.C6917 c6917 = new C6916.C6917(null, 1, 0 == true ? 1 : 0);
            c6917.m10108(C6916.f20039);
            this.f16508 = c6917;
        }
        return this.f16508;
    }
}
