package p491;

import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Nullable;
import p138.p139.p143.p144.C2803;
import p447.AbstractC6930;
import p447.C6905;
import p447.C6916;
import p461.C7103;

/* JADX INFO: renamed from: ޓ.ޕ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC7348<T> {

    /* JADX INFO: renamed from: ޓ.ޕ$֏, reason: contains not printable characters */
    public static final class C7349<T> extends AbstractC7348<T> {

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

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final InterfaceC7320<T, String> f21270;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final boolean f21271;

        public C7349(String str, InterfaceC7320<T, String> interfaceC7320, boolean z) {
            this.f21269 = (String) Objects.requireNonNull(str, "name == null");
            this.f21270 = interfaceC7320;
            this.f21271 = z;
        }

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable T t) {
            String strMo10949;
            if (t == null || (strMo10949 = this.f21270.mo10949(t)) == null) {
                return;
            }
            c7362.m10970(this.f21269, strMo10949, this.f21271);
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$ؠ, reason: contains not printable characters */
    public static final class C7350<T> extends AbstractC7348<Map<String, T>> {

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

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

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

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final boolean f21275;

        public C7350(Method method, int i, InterfaceC7320<T, String> interfaceC7320, boolean z) {
            this.f21272 = method;
            this.f21273 = i;
            this.f21274 = interfaceC7320;
            this.f21275 = z;
        }

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable Object obj) {
            Map map = (Map) obj;
            if (map == null) {
                throw C7373.m10988(this.f21272, this.f21273, "Field map was null.", new Object[0]);
            }
            for (Map.Entry entry : map.entrySet()) {
                String str = (String) entry.getKey();
                if (str == null) {
                    throw C7373.m10988(this.f21272, this.f21273, "Field map contained null key.", new Object[0]);
                }
                Object value = entry.getValue();
                if (value == null) {
                    throw C7373.m10988(this.f21272, this.f21273, C2803.m4880("Field map contained null value for key '", str, "'."), new Object[0]);
                }
                String strMo10949 = this.f21274.mo10949((T) value);
                if (strMo10949 == null) {
                    throw C7373.m10988(this.f21272, this.f21273, "Field map value '" + value + "' converted to null by " + this.f21274.getClass().getName() + " for key '" + str + "'.", new Object[0]);
                }
                c7362.m10970(str, strMo10949, this.f21275);
            }
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$ހ, reason: contains not printable characters */
    public static final class C7351<T> extends AbstractC7348<T> {

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

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final InterfaceC7320<T, String> f21277;

        public C7351(String str, InterfaceC7320<T, String> interfaceC7320) {
            this.f21276 = (String) Objects.requireNonNull(str, "name == null");
            this.f21277 = interfaceC7320;
        }

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable T t) {
            String strMo10949;
            if (t == null || (strMo10949 = this.f21277.mo10949(t)) == null) {
                return;
            }
            c7362.m10969(this.f21276, strMo10949);
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$ށ, reason: contains not printable characters */
    public static final class C7352<T> extends AbstractC7348<T> {

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

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

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final C6905 f21280;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final InterfaceC7320<T, AbstractC6930> f21281;

        public C7352(Method method, int i, C6905 c6905, InterfaceC7320<T, AbstractC6930> interfaceC7320) {
            this.f21278 = method;
            this.f21279 = i;
            this.f21280 = c6905;
            this.f21281 = interfaceC7320;
        }

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable T t) {
            if (t == null) {
                return;
            }
            try {
                c7362.m10971(this.f21280, this.f21281.mo10949(t));
            } catch (IOException e) {
                throw C7373.m10988(this.f21278, this.f21279, "Unable to convert " + t + " to RequestBody", e);
            }
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$ނ, reason: contains not printable characters */
    public static final class C7353<T> extends AbstractC7348<Map<String, T>> {

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

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

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final InterfaceC7320<T, AbstractC6930> f21284;

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

        public C7353(Method method, int i, InterfaceC7320<T, AbstractC6930> interfaceC7320, String str) {
            this.f21282 = method;
            this.f21283 = i;
            this.f21284 = interfaceC7320;
            this.f21285 = str;
        }

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable Object obj) {
            Map map = (Map) obj;
            if (map == null) {
                throw C7373.m10988(this.f21282, this.f21283, "Part map was null.", new Object[0]);
            }
            for (Map.Entry entry : map.entrySet()) {
                String str = (String) entry.getKey();
                if (str == null) {
                    throw C7373.m10988(this.f21282, this.f21283, "Part map contained null key.", new Object[0]);
                }
                Object value = entry.getValue();
                if (value == null) {
                    throw C7373.m10988(this.f21282, this.f21283, C2803.m4880("Part map contained null value for key '", str, "'."), new Object[0]);
                }
                c7362.m10971(C6905.f20008.m10076("Content-Disposition", C2803.m4880("form-data; name=\"", str, "\""), "Content-Transfer-Encoding", this.f21285), this.f21284.mo10949((T) value));
            }
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$ރ, reason: contains not printable characters */
    public static final class C7354<T> extends AbstractC7348<T> {

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

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

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

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final InterfaceC7320<T, String> f21289;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public final boolean f21290;

        public C7354(Method method, int i, String str, InterfaceC7320<T, String> interfaceC7320, boolean z) {
            this.f21286 = method;
            this.f21287 = i;
            this.f21288 = (String) Objects.requireNonNull(str, "name == null");
            this.f21289 = interfaceC7320;
            this.f21290 = z;
        }

        /* JADX WARN: Removed duplicated region for block: B:52:0x00e5  */
        /* JADX WARN: Removed duplicated region for block: B:54:0x00e8  */
        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public void mo10966(C7362 c7362, @Nullable T t) {
            String strM10437;
            String strReplace;
            if (t == null) {
                throw C7373.m10988(this.f21286, this.f21287, C2803.m4884(C2803.m4889("Path parameter \""), this.f21288, "\" value must not be null."), new Object[0]);
            }
            String str = this.f21288;
            String strMo10949 = this.f21289.mo10949(t);
            boolean z = this.f21290;
            if (c7362.f21309 == null) {
                throw new AssertionError();
            }
            int length = strMo10949.length();
            int iCharCount = 0;
            while (iCharCount < length) {
                int iCodePointAt = strMo10949.codePointAt(iCharCount);
                int i = 47;
                if (iCodePointAt < 32 || iCodePointAt >= 127 || " \"<>^`{}|\\?#".indexOf(iCodePointAt) != -1 || (!z && (iCodePointAt == 47 || iCodePointAt == 37))) {
                    C7103 c7103 = new C7103();
                    c7103.mo10415(strMo10949, 0, iCharCount);
                    C7103 c71032 = null;
                    while (iCharCount < length) {
                        int iCodePointAt2 = strMo10949.codePointAt(iCharCount);
                        if (!z || (iCodePointAt2 != 9 && iCodePointAt2 != 10 && iCodePointAt2 != 12 && iCodePointAt2 != 13)) {
                            if (iCodePointAt2 < 32 || iCodePointAt2 >= 127 || " \"<>^`{}|\\?#".indexOf(iCodePointAt2) != -1 || (!z && (iCodePointAt2 == i || iCodePointAt2 == 37))) {
                                if (c71032 == null) {
                                    c71032 = new C7103();
                                }
                                c71032.m10425(iCodePointAt2);
                                while (!c71032.mo10436()) {
                                    int i2 = c71032.readByte() & 255;
                                    c7103.writeByte(37);
                                    c7103.writeByte((int) C7362.f21305[(i2 >> 4) & 15]);
                                    c7103.writeByte((int) C7362.f21305[i2 & 15]);
                                }
                            } else {
                                c7103.m10425(iCodePointAt2);
                            }
                        }
                        iCharCount += Character.charCount(iCodePointAt2);
                        i = 47;
                    }
                    strM10437 = c7103.m10437();
                    strReplace = c7362.f21309.replace("{" + str + "}", strM10437);
                    if (!C7362.f21306.matcher(strReplace).matches()) {
                        throw new IllegalArgumentException(C2803.m4879("@Path parameters shouldn't perform path traversal ('.' or '..'): ", strMo10949));
                    }
                    c7362.f21309 = strReplace;
                    return;
                }
                iCharCount += Character.charCount(iCodePointAt);
            }
            strM10437 = strMo10949;
            strReplace = c7362.f21309.replace("{" + str + "}", strM10437);
            if (!C7362.f21306.matcher(strReplace).matches()) {
            }
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$ބ, reason: contains not printable characters */
    public static final class C7355<T> extends AbstractC7348<T> {

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

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final InterfaceC7320<T, String> f21292;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final boolean f21293;

        public C7355(String str, InterfaceC7320<T, String> interfaceC7320, boolean z) {
            this.f21291 = (String) Objects.requireNonNull(str, "name == null");
            this.f21292 = interfaceC7320;
            this.f21293 = z;
        }

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable T t) {
            String strMo10949;
            if (t == null || (strMo10949 = this.f21292.mo10949(t)) == null) {
                return;
            }
            c7362.m10972(this.f21291, strMo10949, this.f21293);
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$ޅ, reason: contains not printable characters */
    public static final class C7356<T> extends AbstractC7348<Map<String, T>> {

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

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

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

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final boolean f21297;

        public C7356(Method method, int i, InterfaceC7320<T, String> interfaceC7320, boolean z) {
            this.f21294 = method;
            this.f21295 = i;
            this.f21296 = interfaceC7320;
            this.f21297 = z;
        }

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable Object obj) {
            Map map = (Map) obj;
            if (map == null) {
                throw C7373.m10988(this.f21294, this.f21295, "Query map was null", new Object[0]);
            }
            for (Map.Entry entry : map.entrySet()) {
                String str = (String) entry.getKey();
                if (str == null) {
                    throw C7373.m10988(this.f21294, this.f21295, "Query map contained null key.", new Object[0]);
                }
                Object value = entry.getValue();
                if (value == null) {
                    throw C7373.m10988(this.f21294, this.f21295, C2803.m4880("Query map contained null value for key '", str, "'."), new Object[0]);
                }
                String strMo10949 = this.f21296.mo10949((T) value);
                if (strMo10949 == null) {
                    throw C7373.m10988(this.f21294, this.f21295, "Query map value '" + value + "' converted to null by " + this.f21296.getClass().getName() + " for key '" + str + "'.", new Object[0]);
                }
                c7362.m10972(str, strMo10949, this.f21297);
            }
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$ކ, reason: contains not printable characters */
    public static final class C7357<T> extends AbstractC7348<T> {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final InterfaceC7320<T, String> f21298;

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

        public C7357(InterfaceC7320<T, String> interfaceC7320, boolean z) {
            this.f21298 = interfaceC7320;
            this.f21299 = z;
        }

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable T t) {
            if (t == null) {
                return;
            }
            c7362.m10972(this.f21298.mo10949(t), null, this.f21299);
        }
    }

    /* JADX INFO: renamed from: ޓ.ޕ$އ, reason: contains not printable characters */
    public static final class C7358 extends AbstractC7348<C6916.C6919> {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public static final C7358 f21300 = new C7358();

        @Override // p491.AbstractC7348
        /* JADX INFO: renamed from: ֏ */
        public void mo10966(C7362 c7362, @Nullable C6916.C6919 c6919) {
            C6916.C6919 c69192 = c6919;
            if (c69192 != null) {
                c7362.f21315.m10109(c69192);
            }
        }
    }

    /* JADX INFO: renamed from: ֏ */
    public abstract void mo10966(C7362 c7362, @Nullable T t);
}
