package ඓ.ῲ.K;

import android.annotation.SuppressLint;
import android.content.Context;
import android.widget.ImageView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Priority;
import com.bumptech.glide.request.RequestCoordinator;
import com.bumptech.glide.request.SingleRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import ඓ.ῲ.K.ᓣ.C0825;
import ඓ.ῲ.K.ᓣ.C0845;
import ඓ.ῲ.K.ᕣ.ᨨ.AbstractC0951;
import ඓ.ῲ.K.㗗.AbstractC1189;
import ඓ.ῲ.K.㗗.AbstractC1198;
import ඓ.ῲ.K.㗗.AbstractC1200;
import ඓ.ῲ.K.㗗.C1190;
import ඓ.ῲ.K.㗗.C1196;
import ඓ.ῲ.K.㗗.C1197;
import ඓ.ῲ.K.㗗.㿎.AbstractC1203;
import ඓ.ῲ.K.㗗.㿎.AbstractC1211;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.㳳.C1841;

/* renamed from: ඓ.ῲ.K.㴹  reason: contains not printable characters */
/* compiled from: RequestBuilder */
public class C1218<TranscodeType> extends AbstractC1198<C1218<TranscodeType>> implements Cloneable, AbstractC0823<C1218<TranscodeType>> {

    /* renamed from: В  reason: contains not printable characters */
    public C1218<TranscodeType> f4830;

    /* renamed from: ಯ  reason: contains not printable characters */
    public Float f4831;

    /* renamed from: ᆯ  reason: contains not printable characters */
    public final C1220 f4832;

    /* renamed from: ሽ  reason: contains not printable characters */
    public Object f4833;

    /* renamed from: ጒ  reason: contains not printable characters */
    public boolean f4834 = true;

    /* renamed from: ᑾ  reason: contains not printable characters */
    public List<AbstractC1200<TranscodeType>> f4835;

    /* renamed from: ᝁ  reason: contains not printable characters */
    public final Class<TranscodeType> f4836;

    /* renamed from: ⶍ  reason: contains not printable characters */
    public AbstractC1221<?, ? super TranscodeType> f4837;

    /* renamed from: 㒁  reason: contains not printable characters */
    public boolean f4838;

    /* renamed from: 㮔  reason: contains not printable characters */
    public final Context f4839;

    /* renamed from: 㮝  reason: contains not printable characters */
    public C1218<TranscodeType> f4840;

    /* renamed from: 㹎  reason: contains not printable characters */
    public boolean f4841;

    /* renamed from: 䃖  reason: contains not printable characters */
    public final ComponentCallbacks2C1163 f4842;

    /* renamed from: ඓ.ῲ.K.㴹$K  reason: contains not printable characters */
    /* compiled from: RequestBuilder */
    public static /* synthetic */ class C1219 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public static final /* synthetic */ int[] f4843 = new int[Priority.values().length];

        /* renamed from: K  reason: contains not printable characters */
        public static final /* synthetic */ int[] f4844 = new int[ImageView.ScaleType.values().length];

        /* JADX WARNING: Can't wrap try/catch for region: R(24:0|(2:1|2)|3|(2:5|6)|7|(2:9|10)|11|(2:13|14)|15|17|18|19|20|21|22|23|24|25|26|27|28|29|30|(3:31|32|34)) */
        /* JADX WARNING: Can't wrap try/catch for region: R(26:0|1|2|3|(2:5|6)|7|(2:9|10)|11|13|14|15|17|18|19|20|21|22|23|24|25|26|27|28|29|30|(3:31|32|34)) */
        /* JADX WARNING: Can't wrap try/catch for region: R(28:0|1|2|3|(2:5|6)|7|(2:9|10)|11|13|14|15|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|34) */
        /* JADX WARNING: Can't wrap try/catch for region: R(29:0|1|2|3|5|6|7|(2:9|10)|11|13|14|15|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|34) */
        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Missing exception handler attribute for start block: B:19:0x0048 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:21:0x0052 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:23:0x005c */
        /* JADX WARNING: Missing exception handler attribute for start block: B:25:0x0066 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:27:0x0071 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:29:0x007c */
        /* JADX WARNING: Missing exception handler attribute for start block: B:31:0x0087 */
        static {
            try {
                f4843[Priority.LOW.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f4843[Priority.NORMAL.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f4843[Priority.HIGH.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f4843[Priority.IMMEDIATE.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            f4844[ImageView.ScaleType.CENTER_CROP.ordinal()] = 1;
            f4844[ImageView.ScaleType.CENTER_INSIDE.ordinal()] = 2;
            f4844[ImageView.ScaleType.FIT_CENTER.ordinal()] = 3;
            f4844[ImageView.ScaleType.FIT_START.ordinal()] = 4;
            f4844[ImageView.ScaleType.FIT_END.ordinal()] = 5;
            f4844[ImageView.ScaleType.FIT_XY.ordinal()] = 6;
            f4844[ImageView.ScaleType.CENTER.ordinal()] = 7;
            try {
                f4844[ImageView.ScaleType.MATRIX.ordinal()] = 8;
            } catch (NoSuchFieldError unused5) {
            }
        }
    }

    static {
        C1190 r0 = (C1190) ((C1190) ((C1190) new C1190().m3224(AbstractC0951.f4299)).m3219(Priority.LOW)).m3228(true);
    }

    /* JADX DEBUG: Multi-variable search result rejected for r7v4, resolved type: java.util.List<ඓ.ῲ.K.㗗.㸾<TranscodeType>> */
    /* JADX WARN: Multi-variable type inference failed */
    @SuppressLint({"CheckResult"})
    public C1218(ComponentCallbacks2C1161 r4, ComponentCallbacks2C1163 r5, Class<TranscodeType> cls, Context context) {
        this.f4842 = r5;
        this.f4836 = cls;
        this.f4839 = context;
        C1220 r7 = r5.f4681.f4673;
        AbstractC1221<?, ?> r0 = r7.f4853.get(cls);
        if (r0 == null) {
            for (Map.Entry<Class<?>, AbstractC1221<?, ?>> entry : r7.f4853.entrySet()) {
                if (entry.getKey().isAssignableFrom(cls)) {
                    r0 = (AbstractC1221<?, ? super TranscodeType>) entry.getValue();
                }
            }
        }
        this.f4837 = (AbstractC1221<?, ? super TranscodeType>) (r0 == null ? (AbstractC1221<?, ? super TranscodeType>) C1220.f4845 : r0);
        this.f4832 = r4.f4673;
        for (AbstractC1200<Object> r6 : r5.f4679) {
            if (r6 != null) {
                if (this.f4835 == null) {
                    this.f4835 = new ArrayList();
                }
                this.f4835.add(r6);
            }
        }
        m3292((AbstractC1198<?>) r5.m3117());
    }

    @Override // ඓ.ῲ.K.㗗.AbstractC1198, ඓ.ῲ.K.㗗.AbstractC1198, java.lang.Object
    /* renamed from: clone  reason: collision with other method in class */
    public AbstractC1198 m3293clone() {
        C1218 r0 = (C1218) super.clone();
        r0.f4837 = r0.f4837.clone();
        return r0;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final Priority m3286(Priority priority) {
        int ordinal = priority.ordinal();
        if (ordinal == 0 || ordinal == 1) {
            return Priority.IMMEDIATE;
        }
        if (ordinal == 2) {
            return Priority.HIGH;
        }
        if (ordinal == 3) {
            return Priority.NORMAL;
        }
        StringBuilder r0 = C1293.m3416("unknown priority: ");
        r0.append(this.f4745);
        throw new IllegalArgumentException(r0.toString());
    }

    @Override // ඓ.ῲ.K.㗗.AbstractC1198
    /* renamed from: K  reason: contains not printable characters */
    public C1218<TranscodeType> m3292(AbstractC1198<?> k) {
        C1841.m4783(k, "Argument must not be null");
        return (C1218) super.m3227(k);
    }

    @Override // ඓ.ῲ.K.㗗.AbstractC1198, ඓ.ῲ.K.㗗.AbstractC1198, java.lang.Object
    public Object clone() throws CloneNotSupportedException {
        C1218 r0 = (C1218) super.clone();
        r0.f4837 = r0.f4837.clone();
        return r0;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final <Y extends AbstractC1211<TranscodeType>> Y m3291(Y y, AbstractC1200<TranscodeType> r17, AbstractC1198<?> k, Executor executor) {
        C1841.m4783(y, "Argument must not be null");
        if (this.f4841) {
            AbstractC1189 r0 = m3287(new Object(), y, r17, (RequestCoordinator) null, this.f4837, k.f4745, k.f4755, k.f4749, k, executor);
            AbstractC1189 r1 = y.m3266();
            if (r0.m3181(r1)) {
                if (!(!k.m3208() && r1.m3178())) {
                    C1841.m4783(r1, "Argument must not be null");
                    if (!r1.isRunning()) {
                        r1.m3179();
                    }
                    return y;
                }
            }
            this.f4842.m3123((AbstractC1211<?>) y);
            y.m3272(r0);
            this.f4842.m3124(y, r0);
            return y;
        }
        throw new IllegalArgumentException("You must call #load() before calling #into()");
    }

    /* renamed from: K  reason: contains not printable characters */
    public AbstractC1203<ImageView, TranscodeType> m3290(ImageView imageView) {
        AbstractC1198<?> k;
        C0845.m2459();
        C1841.m4783(imageView, "Argument must not be null");
        if (!AbstractC1198.m3206(this.f4751, (int) RecyclerView.AbstractC0269.FLAG_MOVED) && this.f4756 && imageView.getScaleType() != null) {
            switch (C1219.f4844[imageView.getScaleType().ordinal()]) {
                case 1:
                    C1218 r0 = (C1218) super.clone();
                    r0.f4837 = r0.f4837.clone();
                    k = r0.m3230();
                    break;
                case 2:
                    C1218 r02 = (C1218) super.clone();
                    r02.f4837 = r02.f4837.clone();
                    k = r02.m3209();
                    break;
                case 3:
                case 4:
                case 5:
                    C1218 r03 = (C1218) super.clone();
                    r03.f4837 = r03.f4837.clone();
                    k = r03.m3229();
                    break;
                case 6:
                    C1218 r04 = (C1218) super.clone();
                    r04.f4837 = r04.f4837.clone();
                    k = r04.m3209();
                    break;
            }
            C1220 r1 = this.f4832;
            AbstractC1203<ImageView, TranscodeType> r4 = r1.f4846.m3264(imageView, this.f4836);
            m3291(r4, null, k, C0825.f4050);
            return r4;
        }
        k = this;
        C1220 r12 = this.f4832;
        AbstractC1203<ImageView, TranscodeType> r42 = r12.f4846.m3264(imageView, this.f4836);
        m3291(r42, null, k, C0825.f4050);
        return r42;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final AbstractC1189 m3287(Object obj, AbstractC1211<TranscodeType> r22, AbstractC1200<TranscodeType> r23, RequestCoordinator requestCoordinator, AbstractC1221<?, ? super TranscodeType> r25, Priority priority, int i, int i2, AbstractC1198<?> k, Executor executor) {
        C1196 r15;
        C1196 r5;
        C1197 r13;
        int i3;
        int i4;
        Priority priority2;
        int i5;
        int i6;
        if (this.f4840 != null) {
            C1196 r52 = new C1196(obj, requestCoordinator);
            r15 = r52;
            r5 = r52;
        } else {
            r15 = null;
            r5 = requestCoordinator;
        }
        C1218<TranscodeType> r0 = this.f4830;
        if (r0 != null) {
            if (!this.f4838) {
                AbstractC1221<?, ? super TranscodeType> r16 = r0.f4834 ? r25 : r0.f4837;
                if (AbstractC1198.m3206(this.f4830.f4751, 8)) {
                    priority2 = this.f4830.f4745;
                } else {
                    priority2 = m3286(priority);
                }
                C1218<TranscodeType> r02 = this.f4830;
                int i7 = r02.f4755;
                int i8 = r02.f4749;
                if (C0845.m2460(i, i2)) {
                    C1218<TranscodeType> r2 = this.f4830;
                    if (!C0845.m2460(r2.f4755, r2.f4749)) {
                        i6 = k.f4755;
                        i5 = k.f4749;
                        C1197 r10 = new C1197(obj, r5);
                        C1197 r132 = r10;
                        AbstractC1189 r102 = m3288(obj, r22, r23, k, r10, r25, priority, i, i2, executor);
                        this.f4838 = true;
                        C1218<TranscodeType> r9 = this.f4830;
                        AbstractC1189 r03 = r9.m3287(obj, r22, r23, r132, r16, priority2, i6, i5, r9, executor);
                        this.f4838 = false;
                        r132.f4733 = r102;
                        r132.f4739 = r03;
                        r13 = r132;
                    }
                }
                i5 = i8;
                i6 = i7;
                C1197 r103 = new C1197(obj, r5);
                C1197 r1322 = r103;
                AbstractC1189 r1022 = m3288(obj, r22, r23, k, r103, r25, priority, i, i2, executor);
                this.f4838 = true;
                C1218<TranscodeType> r92 = this.f4830;
                AbstractC1189 r032 = r92.m3287(obj, r22, r23, r1322, r16, priority2, i6, i5, r92, executor);
                this.f4838 = false;
                r1322.f4733 = r1022;
                r1322.f4739 = r032;
                r13 = r1322;
            } else {
                throw new IllegalStateException("You cannot use a request as both the main request and a thumbnail, consider using clone() on the request(s) passed to thumbnail()");
            }
        } else if (this.f4831 != null) {
            C1197 r14 = new C1197(obj, r5);
            AbstractC1189 r104 = m3288(obj, r22, r23, k, r14, r25, priority, i, i2, executor);
            AbstractC1189 r04 = m3288(obj, r22, r23, k.clone().m3215(this.f4831.floatValue()), r14, r25, m3286(priority), i, i2, executor);
            r14.f4733 = r104;
            r14.f4739 = r04;
            r13 = r14;
        } else {
            r13 = m3288(obj, r22, r23, k, r5, r25, priority, i, i2, executor);
        }
        if (r15 == null) {
            return r13;
        }
        C1218<TranscodeType> r05 = this.f4840;
        int i9 = r05.f4755;
        int i10 = r05.f4749;
        if (C0845.m2460(i, i2)) {
            C1218<TranscodeType> r24 = this.f4840;
            if (!C0845.m2460(r24.f4755, r24.f4749)) {
                i4 = k.f4755;
                i3 = k.f4749;
                C1218<TranscodeType> r93 = this.f4840;
                AbstractC1189 r06 = r93.m3287(obj, r22, r23, r15, r93.f4837, r93.f4745, i4, i3, r93, executor);
                r15.f4727 = r13;
                r15.f4732 = r06;
                return r15;
            }
        }
        i3 = i10;
        i4 = i9;
        C1218<TranscodeType> r932 = this.f4840;
        AbstractC1189 r062 = r932.m3287(obj, r22, r23, r15, r932.f4837, r932.f4745, i4, i3, r932, executor);
        r15.f4727 = r13;
        r15.f4732 = r062;
        return r15;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final AbstractC1189 m3288(Object obj, AbstractC1211<TranscodeType> r21, AbstractC1200<TranscodeType> r22, AbstractC1198<?> k, RequestCoordinator requestCoordinator, AbstractC1221<?, ? super TranscodeType> r25, Priority priority, int i, int i2, Executor executor) {
        Context context = this.f4839;
        C1220 r3 = this.f4832;
        return new SingleRequest(context, r3, obj, this.f4833, this.f4836, k, i, i2, priority, r21, r22, this.f4835, requestCoordinator, r3.f4850, r25.f4856, executor);
    }
}
