package defpackage;

import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.e;
import androidx.leanback.widget.VerticalGridView;
import androidx.lifecycle.n;
import androidx.lifecycle.s;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.ExoPlayer;
import androidx.media3.exoplayer.upstream.CmcdData;
import com.strmr.ps.R;
import com.strmr.ps.data.auth.FeatureGateManager;
import com.strmr.ps.data.local.dao.TraktUserItemDao;
import com.strmr.ps.data.local.entity.AllDebridAccount;
import com.strmr.ps.data.local.entity.EasyDebridAccount;
import com.strmr.ps.data.local.entity.PremiumizeAccount;
import com.strmr.ps.data.local.entity.RealDebridAccount;
import com.strmr.ps.data.local.entity.TorBoxAccount;
import com.strmr.ps.data.local.entity.TraktAccount;
import com.strmr.ps.data.model.trakt.TraktTokenResponse;
import com.strmr.ps.data.model.trakt.TraktUser;
import com.strmr.ps.data.model.trakt.TraktUserIds;
import com.strmr.ps.data.model.trakt.TraktUserMovieStats;
import com.strmr.ps.data.model.trakt.TraktUserShowStats;
import com.strmr.ps.data.model.trakt.TraktUserStats;
import com.strmr.ps.data.remote.api.TraktApiService;
import com.strmr.ps.data.repository.AllDebridRepository;
import com.strmr.ps.data.repository.EasyDebridRepository;
import com.strmr.ps.data.repository.OmdbRepository;
import com.strmr.ps.data.repository.PreferencesRepository;
import com.strmr.ps.data.repository.PremiumizeRepository;
import com.strmr.ps.data.repository.RealDebridRepository;
import com.strmr.ps.data.repository.RpdbRepository;
import com.strmr.ps.data.repository.TorBoxRepository;
import com.strmr.ps.data.repository.TraktAccountRepository;
import com.strmr.ps.data.repository.TraktAuthRepository;
import com.strmr.ps.data.supabase.DeviceManager;
import com.strmr.ps.data.supabase.SettingsSyncManager;
import dagger.hilt.android.AndroidEntryPoint;
import defpackage.q38;
import defpackage.vn8;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.coroutines.jvm.internal.ContinuationImpl;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0007\u0018\u00002\u00020\u0001:\u0001\u0004B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0005"}, d2 = {"La4;", "Landroidx/fragment/app/o;", "<init>", "()V", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@AndroidEntryPoint
@vx8
public final class a4 extends z34 {
    public int aa;
    public PremiumizeAccount ab;
    public RealDebridAccount ac;
    public AllDebridAccount ad;
    public TorBoxAccount ae;
    public EasyDebridAccount af;
    public boolean ah;
    public boolean ai;
    public boolean aj;
    public boolean ak;
    public boolean al;
    public boolean am;
    public boolean an;
    public e ao;
    public fx4 ap;
    public boolean aq;
    public float ar;
    public String as;
    public VerticalGridView f;
    public wm8 i;
    public TraktAuthRepository j;
    public TraktAccountRepository k;
    public TraktUserItemDao l;
    public TraktApiService m;
    public PremiumizeRepository n;
    public RealDebridRepository o;
    public AllDebridRepository p;
    public TorBoxRepository q;
    public EasyDebridRepository r;
    public RpdbRepository s;
    public OmdbRepository t;
    public PreferencesRepository u;
    public DeviceManager v;
    public FeatureGateManager w;
    public SettingsSyncManager x;
    public boolean z;
    public List y = ik2.a;
    public boolean ag = true;

    @Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\b\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001R\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"La4$a;", "", "", "LARGE_LIBRARY_THRESHOLD", "I", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class a {
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public /* synthetic */ class b {
        static {
            int[] iArr = new int[q3.values().length];
            try {
                iArr[0] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                q3 q3Var = q3.a;
                iArr[1] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                q3 q3Var2 = q3.a;
                iArr[2] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                q3 q3Var3 = q3.a;
                iArr[3] = 4;
            } catch (NoSuchFieldError unused4) {
            }
        }
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class c implements zs6, sr3 {
        public final /* synthetic */ sq3 a;

        public c(sq3 sq3Var) {
            this.a = sq3Var;
        }

        @Override // defpackage.zs6
        public final /* synthetic */ void a(Object obj) {
            this.a.invoke(obj);
        }

        @Override // defpackage.sr3
        public final lr3 b() {
            return this.a;
        }

        public final boolean equals(Object obj) {
            if (!(obj instanceof zs6) || !(obj instanceof sr3)) {
                return false;
            }
            return this.a.equals(((sr3) obj).b());
        }

        public final int hashCode() {
            return this.a.hashCode();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:107:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:110:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:39:0x00ac  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x00b1  */
    /* JADX WARN: Removed duplicated region for block: B:46:0x00ce  */
    /* JADX WARN: Removed duplicated region for block: B:53:0x00fc  */
    /* JADX WARN: Removed duplicated region for block: B:79:0x013e  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /* JADX WARN: Removed duplicated region for block: B:82:0x0144  */
    /* JADX WARN: Removed duplicated region for block: B:87:0x0155  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object l(a4 a4Var, TraktTokenResponse traktTokenResponse, ContinuationImpl continuationImpl) {
        u4 u4Var;
        String strN;
        TraktApiService traktApiService;
        Object userProfile;
        Object objA;
        TraktUser traktUser;
        TraktUser traktUser2;
        String str;
        a4 a4Var2;
        a4 a4Var3;
        TraktUserIds ids;
        Object objA2;
        String slug;
        TraktApiService traktApiService2;
        TraktUserStats traktUserStats;
        int iIntValue;
        qm5 qm5Var;
        w4 w4Var;
        TraktUserShowStats shows;
        Integer watched;
        TraktUserMovieStats movies;
        Integer watched2;
        if (continuationImpl instanceof u4) {
            u4Var = (u4) continuationImpl;
            int i = u4Var.i;
            if ((i & Integer.MIN_VALUE) != 0) {
                u4Var.i = i - Integer.MIN_VALUE;
            } else {
                u4Var = new u4(a4Var, continuationImpl);
            }
        }
        Object allAccountsSync = u4Var.e;
        ck1 ck1Var = ck1.a;
        int i2 = u4Var.i;
        e6a e6aVar = e6a.a;
        switch (i2) {
            case 0:
                s38.b(allAccountsSync);
                strN = n41.n("Bearer ", traktTokenResponse.getAccessToken());
                try {
                    traktApiService = a4Var.m;
                } catch (Throwable th) {
                    th = th;
                    objA = s38.a(th);
                }
                if (traktApiService == null) {
                    cr4.n("traktApiService");
                    throw null;
                }
                u4Var.a = a4Var;
                u4Var.b = traktTokenResponse;
                u4Var.c = strN;
                u4Var.i = 1;
                userProfile = traktApiService.getUserProfile(strN, u4Var);
                if (userProfile == ck1Var) {
                    return ck1Var;
                }
                objA = (TraktUser) userProfile;
                if (objA instanceof q38.b) {
                    objA = null;
                }
                traktUser = (TraktUser) objA;
                if (traktUser != null) {
                    m12 m12Var = sc2.a;
                    qm5 qm5Var2 = sm5.a;
                    v4 v4Var = new v4(a4Var, null);
                    u4Var.a = null;
                    u4Var.b = null;
                    u4Var.c = null;
                    u4Var.i = 2;
                    if (wj0.f(qm5Var2, v4Var, u4Var) == ck1Var) {
                        return ck1Var;
                    }
                    return e6aVar;
                }
                TraktAccountRepository traktAccountRepositoryQ = a4Var.q();
                u4Var.a = a4Var;
                u4Var.b = strN;
                u4Var.c = traktUser;
                u4Var.i = 3;
                if (traktAccountRepositoryQ.saveDeviceToken(traktTokenResponse, traktUser, u4Var) == ck1Var) {
                    return ck1Var;
                }
                traktUser2 = traktUser;
                str = strN;
                TraktAccountRepository traktAccountRepositoryQ2 = a4Var.q();
                u4Var.a = a4Var;
                u4Var.b = str;
                u4Var.c = traktUser2;
                u4Var.d = a4Var;
                u4Var.i = 4;
                allAccountsSync = traktAccountRepositoryQ2.getAllAccountsSync(u4Var);
                if (allAccountsSync != ck1Var) {
                    return ck1Var;
                }
                a4Var2 = a4Var;
                a4Var.y = (List) allAccountsSync;
                try {
                    ids = traktUser2.getIds();
                } catch (Throwable th2) {
                    th = th2;
                }
                if (ids != null || (slug = ids.getSlug()) == null) {
                    objA2 = null;
                    if (objA2 instanceof q38.b) {
                        objA2 = null;
                    }
                    traktUserStats = (TraktUserStats) objA2;
                    iIntValue = 0;
                    int iIntValue2 = (traktUserStats == null || (movies = traktUserStats.getMovies()) == null || (watched2 = movies.getWatched()) == null) ? 0 : watched2.intValue();
                    if (traktUserStats != null && (shows = traktUserStats.getShows()) != null && (watched = shows.getWatched()) != null) {
                        iIntValue = watched.intValue();
                    }
                    int i3 = iIntValue2 + iIntValue;
                    m12 m12Var2 = sc2.a;
                    qm5Var = sm5.a;
                    w4Var = new w4(a4Var2, i3, null);
                    u4Var.a = null;
                    u4Var.b = null;
                    u4Var.c = null;
                    u4Var.d = null;
                    u4Var.i = 6;
                    if (wj0.f(qm5Var, w4Var, u4Var) == ck1Var) {
                        return ck1Var;
                    }
                    return e6aVar;
                }
                try {
                    traktApiService2 = a4Var2.m;
                } catch (Throwable th3) {
                    th = th3;
                    a4Var3 = a4Var2;
                    objA2 = s38.a(th);
                }
                if (traktApiService2 == null) {
                    cr4.n("traktApiService");
                    throw null;
                }
                u4Var.a = a4Var2;
                u4Var.b = null;
                u4Var.c = null;
                u4Var.d = null;
                u4Var.i = 5;
                allAccountsSync = traktApiService2.getUserStats(slug, str, u4Var);
                if (allAccountsSync == ck1Var) {
                    return ck1Var;
                }
                a4Var3 = a4Var2;
                objA2 = (TraktUserStats) allAccountsSync;
                a4Var2 = a4Var3;
                if (objA2 instanceof q38.b) {
                }
                traktUserStats = (TraktUserStats) objA2;
                iIntValue = 0;
                if (traktUserStats == null) {
                    if (traktUserStats != null) {
                        iIntValue = watched.intValue();
                    }
                    int i32 = iIntValue2 + iIntValue;
                    m12 m12Var22 = sc2.a;
                    qm5Var = sm5.a;
                    w4Var = new w4(a4Var2, i32, null);
                    u4Var.a = null;
                    u4Var.b = null;
                    u4Var.c = null;
                    u4Var.d = null;
                    u4Var.i = 6;
                    if (wj0.f(qm5Var, w4Var, u4Var) == ck1Var) {
                    }
                }
                return e6aVar;
                a4Var3 = a4Var2;
                objA2 = s38.a(th);
                a4Var2 = a4Var3;
                if (objA2 instanceof q38.b) {
                }
                traktUserStats = (TraktUserStats) objA2;
                iIntValue = 0;
                if (traktUserStats == null) {
                }
                return e6aVar;
            case 1:
                String str2 = (String) u4Var.c;
                traktTokenResponse = (TraktTokenResponse) u4Var.b;
                a4 a4Var4 = u4Var.a;
                try {
                    s38.b(allAccountsSync);
                    strN = str2;
                    a4Var = a4Var4;
                    userProfile = allAccountsSync;
                    objA = (TraktUser) userProfile;
                } catch (Throwable th4) {
                    strN = str2;
                    a4Var = a4Var4;
                    th = th4;
                    objA = s38.a(th);
                }
                if (objA instanceof q38.b) {
                }
                traktUser = (TraktUser) objA;
                if (traktUser != null) {
                }
                break;
            case 2:
            case 6:
                s38.b(allAccountsSync);
                return e6aVar;
            case 3:
                TraktUser traktUser3 = (TraktUser) u4Var.c;
                String str3 = (String) u4Var.b;
                a4 a4Var5 = u4Var.a;
                s38.b(allAccountsSync);
                traktUser2 = traktUser3;
                a4Var = a4Var5;
                str = str3;
                TraktAccountRepository traktAccountRepositoryQ22 = a4Var.q();
                u4Var.a = a4Var;
                u4Var.b = str;
                u4Var.c = traktUser2;
                u4Var.d = a4Var;
                u4Var.i = 4;
                allAccountsSync = traktAccountRepositoryQ22.getAllAccountsSync(u4Var);
                if (allAccountsSync != ck1Var) {
                }
                break;
            case 4:
                a4Var = u4Var.d;
                traktUser2 = (TraktUser) u4Var.c;
                str = (String) u4Var.b;
                a4Var2 = u4Var.a;
                s38.b(allAccountsSync);
                a4Var.y = (List) allAccountsSync;
                ids = traktUser2.getIds();
                if (ids != null) {
                    break;
                }
                objA2 = null;
                if (objA2 instanceof q38.b) {
                }
                traktUserStats = (TraktUserStats) objA2;
                iIntValue = 0;
                if (traktUserStats == null) {
                }
                return e6aVar;
            case 5:
                a4Var3 = u4Var.a;
                try {
                    s38.b(allAccountsSync);
                    objA2 = (TraktUserStats) allAccountsSync;
                    break;
                } catch (Throwable th5) {
                    th = th5;
                    objA2 = s38.a(th);
                }
                a4Var2 = a4Var3;
                if (objA2 instanceof q38.b) {
                }
                traktUserStats = (TraktUserStats) objA2;
                iIntValue = 0;
                if (traktUserStats == null) {
                }
                return e6aVar;
            default:
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:30:0x009c, code lost:
    
        if (defpackage.wj0.f(r2, r4, r0) == r1) goto L31;
     */
    /* JADX WARN: Removed duplicated region for block: B:29:0x0089  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object m(a4 a4Var, String str, ContinuationImpl continuationImpl) {
        x4 x4Var;
        Object objM120saveOAuthTokengIAlus;
        a4 a4Var2;
        Object obj;
        Throwable thA;
        if (continuationImpl instanceof x4) {
            x4Var = (x4) continuationImpl;
            int i = x4Var.e;
            if ((i & Integer.MIN_VALUE) != 0) {
                x4Var.e = i - Integer.MIN_VALUE;
            } else {
                x4Var = new x4(a4Var, continuationImpl);
            }
        }
        Object obj2 = x4Var.c;
        ck1 ck1Var = ck1.a;
        int i2 = x4Var.e;
        if (i2 == 0) {
            s38.b(obj2);
            PremiumizeRepository premiumizeRepositoryV = a4Var.v();
            x4Var.a = a4Var;
            x4Var.e = 1;
            objM120saveOAuthTokengIAlus = premiumizeRepositoryV.m120saveOAuthTokengIAlus(str, x4Var);
            if (objM120saveOAuthTokengIAlus != ck1Var) {
            }
            return ck1Var;
        }
        if (i2 != 1) {
            if (i2 != 2) {
                if (i2 != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj2);
                return e6a.a;
            }
            obj = x4Var.b;
            a4Var2 = (a4) x4Var.a;
            s38.b(obj2);
            thA = q38.a(obj);
            if (thA != null) {
                m12 m12Var = sc2.a;
                qm5 qm5Var = sm5.a;
                z4 z4Var = new z4(a4Var2, thA, null);
                x4Var.a = obj;
                x4Var.b = null;
                x4Var.e = 3;
            }
            return e6a.a;
        }
        a4Var = (a4) x4Var.a;
        s38.b(obj2);
        objM120saveOAuthTokengIAlus = ((q38) obj2).a;
        Object obj3 = objM120saveOAuthTokengIAlus;
        a4Var2 = a4Var;
        obj = obj3;
        if (!(obj instanceof q38.b)) {
            a4Var2.ab = (PremiumizeAccount) obj;
            a4Var2.ah = true;
            m12 m12Var2 = sc2.a;
            qm5 qm5Var2 = sm5.a;
            y4 y4Var = new y4(a4Var2, null);
            x4Var.a = a4Var2;
            x4Var.b = obj;
            x4Var.e = 2;
            if (wj0.f(qm5Var2, y4Var, x4Var) != ck1Var) {
            }
            return ck1Var;
        }
        thA = q38.a(obj);
        if (thA != null) {
        }
        return e6a.a;
    }

    public final void aa() {
        String strE = s().e();
        if (strE == null) {
            return;
        }
        n nVarH = vw2.h(this, "getViewLifecycleOwner(...)");
        m12 m12Var = sc2.a;
        wj0.c(nVarH, m02.c, null, new w5(this, strE, null), 2);
    }

    public final void ab() {
        ArrayList arrayListN = n();
        wm8 wm8Var = this.i;
        if (wm8Var != null) {
            wm8Var.e(arrayListN);
        } else {
            cr4.n("adapter");
            throw null;
        }
    }

    public final void ac(String str, qq3 qq3Var, qq3 qq3Var2) {
        CharSequence[] charSequenceArr = {getString(R.string.dialog_auth_option_code), getString(R.string.dialog_auth_option_apikey)};
        Context contextRequireContext = requireContext();
        cr4.f(contextRequireContext, "requireContext(...)");
        gv3 gv3Var = new gv3(contextRequireContext, R.style.Theme_Strmr_Dialog_TV);
        gv3Var.d = getString(R.string.note_api_key_for_bundles);
        gv3Var.b(charSequenceArr, new z3(qq3Var, qq3Var2, 0));
        gv3Var.setTitle((CharSequence) getString(R.string.dialog_connect_service, str)).setNegativeButton((CharSequence) getString(R.string.action_cancel), (DialogInterface.OnClickListener) null).show();
    }

    public final void ad(e eVar, TextView textView, int i, String str) {
        wj0.c(vw2.h(this, "getViewLifecycleOwner(...)"), null, null, new j6(i, eVar, this, textView, str, null), 3);
    }

    /* JADX WARN: Failed to find 'out' block for switch in B:98:0x02c1. Please report as an issue. */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:152:0x04b4  */
    /* JADX WARN: Type inference failed for: r16v0, types: [java.lang.String, java.lang.Throwable] */
    /* JADX WARN: Type inference failed for: r19v2, types: [java.lang.Long, java.lang.Object] */
    /* JADX WARN: Type inference failed for: r1v36 */
    /* JADX WARN: Type inference failed for: r1v38, types: [java.lang.Object] */
    /* JADX WARN: Type inference failed for: r1v40 */
    /* JADX WARN: Type inference failed for: r25v13 */
    /* JADX WARN: Type inference failed for: r25v15 */
    /* JADX WARN: Type inference failed for: r25v22, types: [java.lang.String] */
    /* JADX WARN: Type inference failed for: r25v23 */
    /* JADX WARN: Type inference failed for: r29v10 */
    /* JADX WARN: Type inference failed for: r29v11, types: [u3] */
    /* JADX WARN: Type inference failed for: r29v12 */
    /* JADX WARN: Type inference failed for: r2v0 */
    /* JADX WARN: Type inference failed for: r2v1 */
    /* JADX WARN: Type inference failed for: r2v19 */
    /* JADX WARN: Type inference failed for: r2v3 */
    /* JADX WARN: Type inference failed for: r2v4 */
    /* JADX WARN: Type inference failed for: r2v41 */
    /* JADX WARN: Type inference failed for: r2v43 */
    /* JADX WARN: Type inference failed for: r2v44 */
    /* JADX WARN: Type inference failed for: r2v5 */
    /* JADX WARN: Type inference failed for: r2v8 */
    /* JADX WARN: Type inference failed for: r2v82 */
    /* JADX WARN: Type inference failed for: r2v84 */
    /* JADX WARN: Type inference failed for: r2v85 */
    /* JADX WARN: Type inference failed for: r2v86 */
    /* JADX WARN: Type inference failed for: r2v9, types: [java.lang.Object] */
    /* JADX WARN: Type inference failed for: r31v10 */
    /* JADX WARN: Type inference failed for: r31v11, types: [java.lang.String] */
    /* JADX WARN: Type inference failed for: r31v12 */
    /* JADX WARN: Type inference failed for: r31v13 */
    /* JADX WARN: Type inference failed for: r31v14, types: [java.lang.String] */
    /* JADX WARN: Type inference failed for: r31v15 */
    /* JADX WARN: Type inference failed for: r31v16 */
    /* JADX WARN: Type inference failed for: r31v17, types: [java.lang.String] */
    /* JADX WARN: Type inference failed for: r31v18 */
    /* JADX WARN: Type inference failed for: r31v4 */
    /* JADX WARN: Type inference failed for: r31v5, types: [java.lang.String] */
    /* JADX WARN: Type inference failed for: r31v6 */
    /* JADX WARN: Type inference failed for: r31v7 */
    /* JADX WARN: Type inference failed for: r31v8, types: [java.lang.String] */
    /* JADX WARN: Type inference failed for: r31v9 */
    /* JADX WARN: Type inference failed for: r41v0, types: [java.lang.Object] */
    /* JADX WARN: Type inference failed for: r41v1 */
    /* JADX WARN: Type inference failed for: r41v10 */
    /* JADX WARN: Type inference failed for: r41v11 */
    /* JADX WARN: Type inference failed for: r41v12 */
    /* JADX WARN: Type inference failed for: r41v13 */
    /* JADX WARN: Type inference failed for: r41v14 */
    /* JADX WARN: Type inference failed for: r41v15 */
    /* JADX WARN: Type inference failed for: r41v16 */
    /* JADX WARN: Type inference failed for: r41v17 */
    /* JADX WARN: Type inference failed for: r41v18 */
    /* JADX WARN: Type inference failed for: r41v19 */
    /* JADX WARN: Type inference failed for: r41v2 */
    /* JADX WARN: Type inference failed for: r41v20 */
    /* JADX WARN: Type inference failed for: r41v21 */
    /* JADX WARN: Type inference failed for: r41v22 */
    /* JADX WARN: Type inference failed for: r41v23 */
    /* JADX WARN: Type inference failed for: r41v24 */
    /* JADX WARN: Type inference failed for: r41v25 */
    /* JADX WARN: Type inference failed for: r41v26 */
    /* JADX WARN: Type inference failed for: r41v3 */
    /* JADX WARN: Type inference failed for: r41v4 */
    /* JADX WARN: Type inference failed for: r41v5 */
    /* JADX WARN: Type inference failed for: r41v6 */
    /* JADX WARN: Type inference failed for: r41v7 */
    /* JADX WARN: Type inference failed for: r41v8 */
    /* JADX WARN: Type inference failed for: r41v9 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final ArrayList n() {
        ?? r16;
        ?? rVar;
        Integer num;
        ArrayList arrayList;
        vn8.a aVar;
        ?? r31;
        String string;
        ?? r41;
        ?? r1;
        ?? r412;
        ?? r312;
        String string2;
        ?? r413;
        String accountStatus;
        ?? r414;
        Iterator it;
        Integer num2;
        Long l;
        ?? Ai;
        String string3;
        PremiumizeAccount premiumizeAccount = this.ab;
        ?? r2 = 0;
        Integer daysRemaining = premiumizeAccount != null ? v().getDaysRemaining(premiumizeAccount) : null;
        RealDebridAccount realDebridAccount = this.ac;
        Integer daysRemaining2 = realDebridAccount != null ? w().getDaysRemaining(realDebridAccount) : null;
        AllDebridAccount allDebridAccount = this.ad;
        Integer daysRemaining3 = allDebridAccount != null ? r().getDaysRemaining(allDebridAccount) : null;
        TorBoxAccount torBoxAccount = this.ae;
        Integer daysRemaining4 = torBoxAccount != null ? torBoxAccount.getDaysRemaining() : null;
        EasyDebridAccount easyDebridAccount = this.af;
        Integer daysRemaining5 = easyDebridAccount != null ? easyDebridAccount.getDaysRemaining() : null;
        String string4 = getString(R.string.header_trakt_profiles);
        cr4.f(string4, "getString(...)");
        vn8.f fVar = new vn8.f("trakt_header", string4, null);
        List list = this.y;
        ArrayList arrayList2 = new ArrayList(y41.p(list, 10));
        Iterator it2 = list.iterator();
        while (true) {
            r16 = r2;
            if (!it2.hasNext()) {
                break;
            }
            TraktAccount traktAccount = (TraktAccount) it2.next();
            boolean zB = cr4.b(traktAccount.getUserSlug(), this.as);
            if (zB && this.aq) {
                it = it2;
                Ai = getString(R.string.syncing_percent, Integer.valueOf((int) (this.ar * 100)));
            } else {
                Integer statsMoviesWatched = traktAccount.getStatsMoviesWatched();
                Integer statsShowsWatched = traktAccount.getStatsShowsWatched();
                Long statsMinutesWatched = traktAccount.getStatsMinutesWatched();
                ?? ValueOf = statsMinutesWatched != null ? Long.valueOf(statsMinutesWatched.longValue() / ((long) 60)) : r16;
                Long lastSyncAt = traktAccount.getLastSyncAt();
                ArrayList arrayList3 = new ArrayList();
                ?? r19 = ValueOf;
                if (statsMoviesWatched == null || statsMoviesWatched.intValue() <= 0) {
                    it = it2;
                    num2 = statsShowsWatched;
                    l = lastSyncAt;
                } else {
                    it = it2;
                    num2 = statsShowsWatched;
                    l = lastSyncAt;
                    String quantityString = getResources().getQuantityString(R.plurals.plural_movies_watched, statsMoviesWatched.intValue(), statsMoviesWatched);
                    cr4.f(quantityString, "getQuantityString(...)");
                    arrayList3.add(quantityString);
                }
                if (num2 != null && num2.intValue() > 0) {
                    String quantityString2 = getResources().getQuantityString(R.plurals.plural_shows_watched, num2.intValue(), num2);
                    cr4.f(quantityString2, "getQuantityString(...)");
                    arrayList3.add(quantityString2);
                }
                if (r19 != 0 && r19.longValue() > 0) {
                    String string5 = getString(R.string.profile_hours_watched, r19);
                    cr4.f(string5, "getString(...)");
                    arrayList3.add(string5);
                }
                if (l != null) {
                    long jLongValue = l.longValue();
                    long jCurrentTimeMillis = System.currentTimeMillis() - jLongValue;
                    if (jCurrentTimeMillis < 60000) {
                        string3 = getString(R.string.synced_just_now);
                        cr4.f(string3, "getString(...)");
                    } else if (jCurrentTimeMillis < 3600000) {
                        string3 = getString(R.string.synced_minutes_ago, Integer.valueOf((int) (jCurrentTimeMillis / ((long) ExoPlayer.DEFAULT_STUCK_PLAYING_NOT_ENDING_TIMEOUT_MS))));
                        cr4.d(string3);
                    } else if (jCurrentTimeMillis < 86400000) {
                        string3 = getString(R.string.synced_hours_ago, Integer.valueOf((int) (jCurrentTimeMillis / ((long) 3600000))));
                        cr4.d(string3);
                    } else if (jCurrentTimeMillis < 604800000) {
                        string3 = getString(R.string.synced_days_ago, Integer.valueOf((int) (jCurrentTimeMillis / ((long) 86400000))));
                        cr4.d(string3);
                    } else {
                        string3 = getString(R.string.synced_date, new SimpleDateFormat("MMM d", Locale.US).format(new Date(jLongValue)));
                        cr4.d(string3);
                    }
                    arrayList3.add(string3);
                }
                Ai = !arrayList3.isEmpty() ? y41.ai(arrayList3, " · ", null, null, null, 62) : r16;
            }
            String strN = n41.n("trakt_", traktAccount.getUserSlug());
            int i = 1;
            String userSlug = traktAccount.getUserSlug();
            int i2 = 2;
            String userName = traktAccount.getUserName();
            List list2 = cj7.a;
            Integer avatarResourceId = traktAccount.getAvatarResourceId();
            arrayList2.add(new vn8.s(strN, userSlug, userName, (avatarResourceId == null || !cj7.a.contains(avatarResourceId)) ? cj7.b : avatarResourceId.intValue(), zB, Ai, new t3(this, traktAccount, i2), new t3(this, traktAccount, 0), new t3(this, traktAccount, i), zB ? new u3(this, 9) : r16));
            r2 = r16;
            it2 = it;
        }
        ?? cVar = this.ag ? new vn8.c(new u3(this, 1)) : r16;
        List<String> debridPriorityOrder = u().getDebridPriorityOrder();
        int size = debridPriorityOrder.size();
        List<String> list3 = debridPriorityOrder;
        ArrayList arrayList4 = new ArrayList(y41.p(list3, 10));
        Iterator it3 = list3.iterator();
        int i3 = 0;
        ?? r22 = cVar;
        while (it3.hasNext()) {
            Object next = it3.next();
            int i4 = i3 + 1;
            if (i3 < 0) {
                y41.bm();
                throw r16;
            }
            final String str = (String) next;
            boolean z = i3 > 0;
            boolean z2 = i3 < size + (-1);
            Iterator it4 = it3;
            int i5 = size;
            switch (str.hashCode()) {
                case -1517726582:
                    num = daysRemaining;
                    ?? r415 = r22;
                    arrayList = arrayList2;
                    r41 = r415;
                    if (str.equals("realdebrid")) {
                        String string6 = getString(R.string.debrid_realdebrid_name);
                        cr4.f(string6, "getString(...)");
                        String string7 = getString(R.string.debrid_realdebrid_desc);
                        cr4.f(string7, "getString(...)");
                        int color = sf1.getColor(requireContext(), R.color.brand_realdebrid);
                        boolean z3 = this.ai;
                        final int i6 = 7;
                        final int i7 = 8;
                        aVar = new vn8.a("realdebrid", string6, string7, "RD", color, z3, z3 ? getString(R.string.debrid_status_premium) : r16, o(daysRemaining2), new s3(this, 3), z, z2, new qq3(this) { // from class: r3
                            public final /* synthetic */ a4 b;

                            {
                                this.b = this;
                            }

                            @Override // defpackage.qq3
                            public final Object invoke() {
                                switch (i6) {
                                    case 0:
                                        String str2 = str;
                                        a4 a4Var = this.b;
                                        a4Var.u().moveDebridPriorityDown(str2);
                                        a4Var.ab();
                                        break;
                                    case 1:
                                        String str3 = str;
                                        a4 a4Var2 = this.b;
                                        a4Var2.u().moveDebridPriorityUp(str3);
                                        a4Var2.ab();
                                        break;
                                    case 2:
                                        String str4 = str;
                                        a4 a4Var3 = this.b;
                                        a4Var3.u().moveDebridPriorityDown(str4);
                                        a4Var3.ab();
                                        break;
                                    case 3:
                                        String str5 = str;
                                        a4 a4Var4 = this.b;
                                        a4Var4.u().moveDebridPriorityUp(str5);
                                        a4Var4.ab();
                                        break;
                                    case 4:
                                        String str6 = str;
                                        a4 a4Var5 = this.b;
                                        a4Var5.u().moveDebridPriorityDown(str6);
                                        a4Var5.ab();
                                        break;
                                    case 5:
                                        String str7 = str;
                                        a4 a4Var6 = this.b;
                                        a4Var6.u().moveDebridPriorityUp(str7);
                                        a4Var6.ab();
                                        break;
                                    case 6:
                                        String str8 = str;
                                        a4 a4Var7 = this.b;
                                        a4Var7.u().moveDebridPriorityDown(str8);
                                        a4Var7.ab();
                                        break;
                                    case 7:
                                        String str9 = str;
                                        a4 a4Var8 = this.b;
                                        a4Var8.u().moveDebridPriorityUp(str9);
                                        a4Var8.ab();
                                        break;
                                    case 8:
                                        String str10 = str;
                                        a4 a4Var9 = this.b;
                                        a4Var9.u().moveDebridPriorityDown(str10);
                                        a4Var9.ab();
                                        break;
                                    default:
                                        String str11 = str;
                                        a4 a4Var10 = this.b;
                                        a4Var10.u().moveDebridPriorityUp(str11);
                                        a4Var10.ab();
                                        break;
                                }
                                return e6a.a;
                            }
                        }, new qq3(this) { // from class: r3
                            public final /* synthetic */ a4 b;

                            {
                                this.b = this;
                            }

                            @Override // defpackage.qq3
                            public final Object invoke() {
                                switch (i7) {
                                    case 0:
                                        String str2 = str;
                                        a4 a4Var = this.b;
                                        a4Var.u().moveDebridPriorityDown(str2);
                                        a4Var.ab();
                                        break;
                                    case 1:
                                        String str3 = str;
                                        a4 a4Var2 = this.b;
                                        a4Var2.u().moveDebridPriorityUp(str3);
                                        a4Var2.ab();
                                        break;
                                    case 2:
                                        String str4 = str;
                                        a4 a4Var3 = this.b;
                                        a4Var3.u().moveDebridPriorityDown(str4);
                                        a4Var3.ab();
                                        break;
                                    case 3:
                                        String str5 = str;
                                        a4 a4Var4 = this.b;
                                        a4Var4.u().moveDebridPriorityUp(str5);
                                        a4Var4.ab();
                                        break;
                                    case 4:
                                        String str6 = str;
                                        a4 a4Var5 = this.b;
                                        a4Var5.u().moveDebridPriorityDown(str6);
                                        a4Var5.ab();
                                        break;
                                    case 5:
                                        String str7 = str;
                                        a4 a4Var6 = this.b;
                                        a4Var6.u().moveDebridPriorityUp(str7);
                                        a4Var6.ab();
                                        break;
                                    case 6:
                                        String str8 = str;
                                        a4 a4Var7 = this.b;
                                        a4Var7.u().moveDebridPriorityDown(str8);
                                        a4Var7.ab();
                                        break;
                                    case 7:
                                        String str9 = str;
                                        a4 a4Var8 = this.b;
                                        a4Var8.u().moveDebridPriorityUp(str9);
                                        a4Var8.ab();
                                        break;
                                    case 8:
                                        String str10 = str;
                                        a4 a4Var9 = this.b;
                                        a4Var9.u().moveDebridPriorityDown(str10);
                                        a4Var9.ab();
                                        break;
                                    default:
                                        String str11 = str;
                                        a4 a4Var10 = this.b;
                                        a4Var10.u().moveDebridPriorityUp(str11);
                                        a4Var10.ab();
                                        break;
                                }
                                return e6a.a;
                            }
                        }, 8);
                        r41 = r415;
                        r1 = aVar;
                    }
                    r1 = r16;
                    break;
                case -867981036:
                    num = daysRemaining;
                    ?? r416 = r22;
                    arrayList = arrayList2;
                    r414 = r416;
                    if (str.equals("torbox")) {
                        TorBoxAccount torBoxAccount2 = this.ae;
                        if (torBoxAccount2 == null || (string = torBoxAccount2.getPlanName()) == null) {
                            if (!this.ak) {
                                r31 = r16;
                                String string8 = getString(R.string.debrid_torbox_name);
                                cr4.f(string8, "getString(...)");
                                String string9 = getString(R.string.debrid_torbox_desc);
                                cr4.f(string9, "getString(...)");
                                final int i8 = 1;
                                final int i9 = 2;
                                aVar = new vn8.a("torbox", string8, string9, "TB", sf1.getColor(requireContext(), R.color.brand_torbox), this.ak, r31, o(daysRemaining4), new s3(this, 0), z, z2, new qq3(this) { // from class: r3
                                    public final /* synthetic */ a4 b;

                                    {
                                        this.b = this;
                                    }

                                    @Override // defpackage.qq3
                                    public final Object invoke() {
                                        switch (i8) {
                                            case 0:
                                                String str2 = str;
                                                a4 a4Var = this.b;
                                                a4Var.u().moveDebridPriorityDown(str2);
                                                a4Var.ab();
                                                break;
                                            case 1:
                                                String str3 = str;
                                                a4 a4Var2 = this.b;
                                                a4Var2.u().moveDebridPriorityUp(str3);
                                                a4Var2.ab();
                                                break;
                                            case 2:
                                                String str4 = str;
                                                a4 a4Var3 = this.b;
                                                a4Var3.u().moveDebridPriorityDown(str4);
                                                a4Var3.ab();
                                                break;
                                            case 3:
                                                String str5 = str;
                                                a4 a4Var4 = this.b;
                                                a4Var4.u().moveDebridPriorityUp(str5);
                                                a4Var4.ab();
                                                break;
                                            case 4:
                                                String str6 = str;
                                                a4 a4Var5 = this.b;
                                                a4Var5.u().moveDebridPriorityDown(str6);
                                                a4Var5.ab();
                                                break;
                                            case 5:
                                                String str7 = str;
                                                a4 a4Var6 = this.b;
                                                a4Var6.u().moveDebridPriorityUp(str7);
                                                a4Var6.ab();
                                                break;
                                            case 6:
                                                String str8 = str;
                                                a4 a4Var7 = this.b;
                                                a4Var7.u().moveDebridPriorityDown(str8);
                                                a4Var7.ab();
                                                break;
                                            case 7:
                                                String str9 = str;
                                                a4 a4Var8 = this.b;
                                                a4Var8.u().moveDebridPriorityUp(str9);
                                                a4Var8.ab();
                                                break;
                                            case 8:
                                                String str10 = str;
                                                a4 a4Var9 = this.b;
                                                a4Var9.u().moveDebridPriorityDown(str10);
                                                a4Var9.ab();
                                                break;
                                            default:
                                                String str11 = str;
                                                a4 a4Var10 = this.b;
                                                a4Var10.u().moveDebridPriorityUp(str11);
                                                a4Var10.ab();
                                                break;
                                        }
                                        return e6a.a;
                                    }
                                }, new qq3(this) { // from class: r3
                                    public final /* synthetic */ a4 b;

                                    {
                                        this.b = this;
                                    }

                                    @Override // defpackage.qq3
                                    public final Object invoke() {
                                        switch (i9) {
                                            case 0:
                                                String str2 = str;
                                                a4 a4Var = this.b;
                                                a4Var.u().moveDebridPriorityDown(str2);
                                                a4Var.ab();
                                                break;
                                            case 1:
                                                String str3 = str;
                                                a4 a4Var2 = this.b;
                                                a4Var2.u().moveDebridPriorityUp(str3);
                                                a4Var2.ab();
                                                break;
                                            case 2:
                                                String str4 = str;
                                                a4 a4Var3 = this.b;
                                                a4Var3.u().moveDebridPriorityDown(str4);
                                                a4Var3.ab();
                                                break;
                                            case 3:
                                                String str5 = str;
                                                a4 a4Var4 = this.b;
                                                a4Var4.u().moveDebridPriorityUp(str5);
                                                a4Var4.ab();
                                                break;
                                            case 4:
                                                String str6 = str;
                                                a4 a4Var5 = this.b;
                                                a4Var5.u().moveDebridPriorityDown(str6);
                                                a4Var5.ab();
                                                break;
                                            case 5:
                                                String str7 = str;
                                                a4 a4Var6 = this.b;
                                                a4Var6.u().moveDebridPriorityUp(str7);
                                                a4Var6.ab();
                                                break;
                                            case 6:
                                                String str8 = str;
                                                a4 a4Var7 = this.b;
                                                a4Var7.u().moveDebridPriorityDown(str8);
                                                a4Var7.ab();
                                                break;
                                            case 7:
                                                String str9 = str;
                                                a4 a4Var8 = this.b;
                                                a4Var8.u().moveDebridPriorityUp(str9);
                                                a4Var8.ab();
                                                break;
                                            case 8:
                                                String str10 = str;
                                                a4 a4Var9 = this.b;
                                                a4Var9.u().moveDebridPriorityDown(str10);
                                                a4Var9.ab();
                                                break;
                                            default:
                                                String str11 = str;
                                                a4 a4Var10 = this.b;
                                                a4Var10.u().moveDebridPriorityUp(str11);
                                                a4Var10.ab();
                                                break;
                                        }
                                        return e6a.a;
                                    }
                                }, 8);
                                r41 = r416;
                                r1 = aVar;
                            } else {
                                string = getString(R.string.debrid_status_premium);
                                r31 = string;
                                String string82 = getString(R.string.debrid_torbox_name);
                                cr4.f(string82, "getString(...)");
                                String string92 = getString(R.string.debrid_torbox_desc);
                                cr4.f(string92, "getString(...)");
                                final int i82 = 1;
                                final int i92 = 2;
                                aVar = new vn8.a("torbox", string82, string92, "TB", sf1.getColor(requireContext(), R.color.brand_torbox), this.ak, r31, o(daysRemaining4), new s3(this, 0), z, z2, new qq3(this) { // from class: r3
                                    public final /* synthetic */ a4 b;

                                    {
                                        this.b = this;
                                    }

                                    @Override // defpackage.qq3
                                    public final Object invoke() {
                                        switch (i82) {
                                            case 0:
                                                String str2 = str;
                                                a4 a4Var = this.b;
                                                a4Var.u().moveDebridPriorityDown(str2);
                                                a4Var.ab();
                                                break;
                                            case 1:
                                                String str3 = str;
                                                a4 a4Var2 = this.b;
                                                a4Var2.u().moveDebridPriorityUp(str3);
                                                a4Var2.ab();
                                                break;
                                            case 2:
                                                String str4 = str;
                                                a4 a4Var3 = this.b;
                                                a4Var3.u().moveDebridPriorityDown(str4);
                                                a4Var3.ab();
                                                break;
                                            case 3:
                                                String str5 = str;
                                                a4 a4Var4 = this.b;
                                                a4Var4.u().moveDebridPriorityUp(str5);
                                                a4Var4.ab();
                                                break;
                                            case 4:
                                                String str6 = str;
                                                a4 a4Var5 = this.b;
                                                a4Var5.u().moveDebridPriorityDown(str6);
                                                a4Var5.ab();
                                                break;
                                            case 5:
                                                String str7 = str;
                                                a4 a4Var6 = this.b;
                                                a4Var6.u().moveDebridPriorityUp(str7);
                                                a4Var6.ab();
                                                break;
                                            case 6:
                                                String str8 = str;
                                                a4 a4Var7 = this.b;
                                                a4Var7.u().moveDebridPriorityDown(str8);
                                                a4Var7.ab();
                                                break;
                                            case 7:
                                                String str9 = str;
                                                a4 a4Var8 = this.b;
                                                a4Var8.u().moveDebridPriorityUp(str9);
                                                a4Var8.ab();
                                                break;
                                            case 8:
                                                String str10 = str;
                                                a4 a4Var9 = this.b;
                                                a4Var9.u().moveDebridPriorityDown(str10);
                                                a4Var9.ab();
                                                break;
                                            default:
                                                String str11 = str;
                                                a4 a4Var10 = this.b;
                                                a4Var10.u().moveDebridPriorityUp(str11);
                                                a4Var10.ab();
                                                break;
                                        }
                                        return e6a.a;
                                    }
                                }, new qq3(this) { // from class: r3
                                    public final /* synthetic */ a4 b;

                                    {
                                        this.b = this;
                                    }

                                    @Override // defpackage.qq3
                                    public final Object invoke() {
                                        switch (i92) {
                                            case 0:
                                                String str2 = str;
                                                a4 a4Var = this.b;
                                                a4Var.u().moveDebridPriorityDown(str2);
                                                a4Var.ab();
                                                break;
                                            case 1:
                                                String str3 = str;
                                                a4 a4Var2 = this.b;
                                                a4Var2.u().moveDebridPriorityUp(str3);
                                                a4Var2.ab();
                                                break;
                                            case 2:
                                                String str4 = str;
                                                a4 a4Var3 = this.b;
                                                a4Var3.u().moveDebridPriorityDown(str4);
                                                a4Var3.ab();
                                                break;
                                            case 3:
                                                String str5 = str;
                                                a4 a4Var4 = this.b;
                                                a4Var4.u().moveDebridPriorityUp(str5);
                                                a4Var4.ab();
                                                break;
                                            case 4:
                                                String str6 = str;
                                                a4 a4Var5 = this.b;
                                                a4Var5.u().moveDebridPriorityDown(str6);
                                                a4Var5.ab();
                                                break;
                                            case 5:
                                                String str7 = str;
                                                a4 a4Var6 = this.b;
                                                a4Var6.u().moveDebridPriorityUp(str7);
                                                a4Var6.ab();
                                                break;
                                            case 6:
                                                String str8 = str;
                                                a4 a4Var7 = this.b;
                                                a4Var7.u().moveDebridPriorityDown(str8);
                                                a4Var7.ab();
                                                break;
                                            case 7:
                                                String str9 = str;
                                                a4 a4Var8 = this.b;
                                                a4Var8.u().moveDebridPriorityUp(str9);
                                                a4Var8.ab();
                                                break;
                                            case 8:
                                                String str10 = str;
                                                a4 a4Var9 = this.b;
                                                a4Var9.u().moveDebridPriorityDown(str10);
                                                a4Var9.ab();
                                                break;
                                            default:
                                                String str11 = str;
                                                a4 a4Var10 = this.b;
                                                a4Var10.u().moveDebridPriorityUp(str11);
                                                a4Var10.ab();
                                                break;
                                        }
                                        return e6a.a;
                                    }
                                }, 8);
                                r41 = r416;
                                r1 = aVar;
                            }
                            break;
                        } else {
                            if (string.length() > 0) {
                                StringBuilder sb = new StringBuilder();
                                String strValueOf = String.valueOf(string.charAt(0));
                                cr4.e(strValueOf, "null cannot be cast to non-null type java.lang.String");
                                String upperCase = strValueOf.toUpperCase(Locale.ROOT);
                                cr4.f(upperCase, "toUpperCase(...)");
                                sb.append((Object) upperCase);
                                String strSubstring = string.substring(1);
                                cr4.f(strSubstring, "substring(...)");
                                sb.append(strSubstring);
                                string = sb.toString();
                            }
                            if (string != null) {
                                r31 = string;
                                String string822 = getString(R.string.debrid_torbox_name);
                                cr4.f(string822, "getString(...)");
                                String string922 = getString(R.string.debrid_torbox_desc);
                                cr4.f(string922, "getString(...)");
                                final int i822 = 1;
                                final int i922 = 2;
                                aVar = new vn8.a("torbox", string822, string922, "TB", sf1.getColor(requireContext(), R.color.brand_torbox), this.ak, r31, o(daysRemaining4), new s3(this, 0), z, z2, new qq3(this) { // from class: r3
                                    public final /* synthetic */ a4 b;

                                    {
                                        this.b = this;
                                    }

                                    @Override // defpackage.qq3
                                    public final Object invoke() {
                                        switch (i822) {
                                            case 0:
                                                String str2 = str;
                                                a4 a4Var = this.b;
                                                a4Var.u().moveDebridPriorityDown(str2);
                                                a4Var.ab();
                                                break;
                                            case 1:
                                                String str3 = str;
                                                a4 a4Var2 = this.b;
                                                a4Var2.u().moveDebridPriorityUp(str3);
                                                a4Var2.ab();
                                                break;
                                            case 2:
                                                String str4 = str;
                                                a4 a4Var3 = this.b;
                                                a4Var3.u().moveDebridPriorityDown(str4);
                                                a4Var3.ab();
                                                break;
                                            case 3:
                                                String str5 = str;
                                                a4 a4Var4 = this.b;
                                                a4Var4.u().moveDebridPriorityUp(str5);
                                                a4Var4.ab();
                                                break;
                                            case 4:
                                                String str6 = str;
                                                a4 a4Var5 = this.b;
                                                a4Var5.u().moveDebridPriorityDown(str6);
                                                a4Var5.ab();
                                                break;
                                            case 5:
                                                String str7 = str;
                                                a4 a4Var6 = this.b;
                                                a4Var6.u().moveDebridPriorityUp(str7);
                                                a4Var6.ab();
                                                break;
                                            case 6:
                                                String str8 = str;
                                                a4 a4Var7 = this.b;
                                                a4Var7.u().moveDebridPriorityDown(str8);
                                                a4Var7.ab();
                                                break;
                                            case 7:
                                                String str9 = str;
                                                a4 a4Var8 = this.b;
                                                a4Var8.u().moveDebridPriorityUp(str9);
                                                a4Var8.ab();
                                                break;
                                            case 8:
                                                String str10 = str;
                                                a4 a4Var9 = this.b;
                                                a4Var9.u().moveDebridPriorityDown(str10);
                                                a4Var9.ab();
                                                break;
                                            default:
                                                String str11 = str;
                                                a4 a4Var10 = this.b;
                                                a4Var10.u().moveDebridPriorityUp(str11);
                                                a4Var10.ab();
                                                break;
                                        }
                                        return e6a.a;
                                    }
                                }, new qq3(this) { // from class: r3
                                    public final /* synthetic */ a4 b;

                                    {
                                        this.b = this;
                                    }

                                    @Override // defpackage.qq3
                                    public final Object invoke() {
                                        switch (i922) {
                                            case 0:
                                                String str2 = str;
                                                a4 a4Var = this.b;
                                                a4Var.u().moveDebridPriorityDown(str2);
                                                a4Var.ab();
                                                break;
                                            case 1:
                                                String str3 = str;
                                                a4 a4Var2 = this.b;
                                                a4Var2.u().moveDebridPriorityUp(str3);
                                                a4Var2.ab();
                                                break;
                                            case 2:
                                                String str4 = str;
                                                a4 a4Var3 = this.b;
                                                a4Var3.u().moveDebridPriorityDown(str4);
                                                a4Var3.ab();
                                                break;
                                            case 3:
                                                String str5 = str;
                                                a4 a4Var4 = this.b;
                                                a4Var4.u().moveDebridPriorityUp(str5);
                                                a4Var4.ab();
                                                break;
                                            case 4:
                                                String str6 = str;
                                                a4 a4Var5 = this.b;
                                                a4Var5.u().moveDebridPriorityDown(str6);
                                                a4Var5.ab();
                                                break;
                                            case 5:
                                                String str7 = str;
                                                a4 a4Var6 = this.b;
                                                a4Var6.u().moveDebridPriorityUp(str7);
                                                a4Var6.ab();
                                                break;
                                            case 6:
                                                String str8 = str;
                                                a4 a4Var7 = this.b;
                                                a4Var7.u().moveDebridPriorityDown(str8);
                                                a4Var7.ab();
                                                break;
                                            case 7:
                                                String str9 = str;
                                                a4 a4Var8 = this.b;
                                                a4Var8.u().moveDebridPriorityUp(str9);
                                                a4Var8.ab();
                                                break;
                                            case 8:
                                                String str10 = str;
                                                a4 a4Var9 = this.b;
                                                a4Var9.u().moveDebridPriorityDown(str10);
                                                a4Var9.ab();
                                                break;
                                            default:
                                                String str11 = str;
                                                a4 a4Var10 = this.b;
                                                a4Var10.u().moveDebridPriorityUp(str11);
                                                a4Var10.ab();
                                                break;
                                        }
                                        return e6a.a;
                                    }
                                }, 8);
                                r41 = r416;
                                r1 = aVar;
                                break;
                            }
                        }
                    }
                    r41 = r414;
                    r1 = r16;
                    break;
                case -364706834:
                    num = daysRemaining;
                    ?? r417 = r22;
                    arrayList = arrayList2;
                    r414 = r417;
                    if (str.equals(PreferencesRepository.DEBRID_EASYDEBRID)) {
                        String string10 = getString(R.string.debrid_easydebrid_name);
                        cr4.f(string10, "getString(...)");
                        String string11 = getString(R.string.debrid_easydebrid_desc);
                        cr4.f(string11, "getString(...)");
                        int color2 = sf1.getColor(requireContext(), R.color.brand_easydebrid);
                        boolean z4 = this.al;
                        final int i10 = 3;
                        final int i11 = 4;
                        aVar = new vn8.a(PreferencesRepository.DEBRID_EASYDEBRID, string10, string11, "ED", color2, z4, z4 ? getString(R.string.debrid_status_premium) : r16, o(daysRemaining5), new s3(this, 1), z, z2, new qq3(this) { // from class: r3
                            public final /* synthetic */ a4 b;

                            {
                                this.b = this;
                            }

                            @Override // defpackage.qq3
                            public final Object invoke() {
                                switch (i10) {
                                    case 0:
                                        String str2 = str;
                                        a4 a4Var = this.b;
                                        a4Var.u().moveDebridPriorityDown(str2);
                                        a4Var.ab();
                                        break;
                                    case 1:
                                        String str3 = str;
                                        a4 a4Var2 = this.b;
                                        a4Var2.u().moveDebridPriorityUp(str3);
                                        a4Var2.ab();
                                        break;
                                    case 2:
                                        String str4 = str;
                                        a4 a4Var3 = this.b;
                                        a4Var3.u().moveDebridPriorityDown(str4);
                                        a4Var3.ab();
                                        break;
                                    case 3:
                                        String str5 = str;
                                        a4 a4Var4 = this.b;
                                        a4Var4.u().moveDebridPriorityUp(str5);
                                        a4Var4.ab();
                                        break;
                                    case 4:
                                        String str6 = str;
                                        a4 a4Var5 = this.b;
                                        a4Var5.u().moveDebridPriorityDown(str6);
                                        a4Var5.ab();
                                        break;
                                    case 5:
                                        String str7 = str;
                                        a4 a4Var6 = this.b;
                                        a4Var6.u().moveDebridPriorityUp(str7);
                                        a4Var6.ab();
                                        break;
                                    case 6:
                                        String str8 = str;
                                        a4 a4Var7 = this.b;
                                        a4Var7.u().moveDebridPriorityDown(str8);
                                        a4Var7.ab();
                                        break;
                                    case 7:
                                        String str9 = str;
                                        a4 a4Var8 = this.b;
                                        a4Var8.u().moveDebridPriorityUp(str9);
                                        a4Var8.ab();
                                        break;
                                    case 8:
                                        String str10 = str;
                                        a4 a4Var9 = this.b;
                                        a4Var9.u().moveDebridPriorityDown(str10);
                                        a4Var9.ab();
                                        break;
                                    default:
                                        String str11 = str;
                                        a4 a4Var10 = this.b;
                                        a4Var10.u().moveDebridPriorityUp(str11);
                                        a4Var10.ab();
                                        break;
                                }
                                return e6a.a;
                            }
                        }, new qq3(this) { // from class: r3
                            public final /* synthetic */ a4 b;

                            {
                                this.b = this;
                            }

                            @Override // defpackage.qq3
                            public final Object invoke() {
                                switch (i11) {
                                    case 0:
                                        String str2 = str;
                                        a4 a4Var = this.b;
                                        a4Var.u().moveDebridPriorityDown(str2);
                                        a4Var.ab();
                                        break;
                                    case 1:
                                        String str3 = str;
                                        a4 a4Var2 = this.b;
                                        a4Var2.u().moveDebridPriorityUp(str3);
                                        a4Var2.ab();
                                        break;
                                    case 2:
                                        String str4 = str;
                                        a4 a4Var3 = this.b;
                                        a4Var3.u().moveDebridPriorityDown(str4);
                                        a4Var3.ab();
                                        break;
                                    case 3:
                                        String str5 = str;
                                        a4 a4Var4 = this.b;
                                        a4Var4.u().moveDebridPriorityUp(str5);
                                        a4Var4.ab();
                                        break;
                                    case 4:
                                        String str6 = str;
                                        a4 a4Var5 = this.b;
                                        a4Var5.u().moveDebridPriorityDown(str6);
                                        a4Var5.ab();
                                        break;
                                    case 5:
                                        String str7 = str;
                                        a4 a4Var6 = this.b;
                                        a4Var6.u().moveDebridPriorityUp(str7);
                                        a4Var6.ab();
                                        break;
                                    case 6:
                                        String str8 = str;
                                        a4 a4Var7 = this.b;
                                        a4Var7.u().moveDebridPriorityDown(str8);
                                        a4Var7.ab();
                                        break;
                                    case 7:
                                        String str9 = str;
                                        a4 a4Var8 = this.b;
                                        a4Var8.u().moveDebridPriorityUp(str9);
                                        a4Var8.ab();
                                        break;
                                    case 8:
                                        String str10 = str;
                                        a4 a4Var9 = this.b;
                                        a4Var9.u().moveDebridPriorityDown(str10);
                                        a4Var9.ab();
                                        break;
                                    default:
                                        String str11 = str;
                                        a4 a4Var10 = this.b;
                                        a4Var10.u().moveDebridPriorityUp(str11);
                                        a4Var10.ab();
                                        break;
                                }
                                return e6a.a;
                            }
                        }, 8);
                        r41 = r417;
                        r1 = aVar;
                    }
                    r41 = r414;
                    r1 = r16;
                    break;
                case 40904269:
                    num = daysRemaining;
                    ?? r418 = r22;
                    arrayList = arrayList2;
                    r414 = r418;
                    if (str.equals("alldebrid")) {
                        String string12 = getString(R.string.debrid_alldebrid_name);
                        cr4.f(string12, "getString(...)");
                        String string13 = getString(R.string.debrid_alldebrid_desc);
                        cr4.f(string13, "getString(...)");
                        int color3 = sf1.getColor(requireContext(), R.color.brand_alldebrid);
                        boolean z5 = this.aj;
                        ?? string14 = z5 ? getString(R.string.debrid_status_premium) : r16;
                        String strO = o(daysRemaining3);
                        s3 s3Var = new s3(this, 5);
                        final int i12 = 9;
                        qq3 qq3Var = new qq3(this) { // from class: r3
                            public final /* synthetic */ a4 b;

                            {
                                this.b = this;
                            }

                            @Override // defpackage.qq3
                            public final Object invoke() {
                                switch (i12) {
                                    case 0:
                                        String str2 = str;
                                        a4 a4Var = this.b;
                                        a4Var.u().moveDebridPriorityDown(str2);
                                        a4Var.ab();
                                        break;
                                    case 1:
                                        String str3 = str;
                                        a4 a4Var2 = this.b;
                                        a4Var2.u().moveDebridPriorityUp(str3);
                                        a4Var2.ab();
                                        break;
                                    case 2:
                                        String str4 = str;
                                        a4 a4Var3 = this.b;
                                        a4Var3.u().moveDebridPriorityDown(str4);
                                        a4Var3.ab();
                                        break;
                                    case 3:
                                        String str5 = str;
                                        a4 a4Var4 = this.b;
                                        a4Var4.u().moveDebridPriorityUp(str5);
                                        a4Var4.ab();
                                        break;
                                    case 4:
                                        String str6 = str;
                                        a4 a4Var5 = this.b;
                                        a4Var5.u().moveDebridPriorityDown(str6);
                                        a4Var5.ab();
                                        break;
                                    case 5:
                                        String str7 = str;
                                        a4 a4Var6 = this.b;
                                        a4Var6.u().moveDebridPriorityUp(str7);
                                        a4Var6.ab();
                                        break;
                                    case 6:
                                        String str8 = str;
                                        a4 a4Var7 = this.b;
                                        a4Var7.u().moveDebridPriorityDown(str8);
                                        a4Var7.ab();
                                        break;
                                    case 7:
                                        String str9 = str;
                                        a4 a4Var8 = this.b;
                                        a4Var8.u().moveDebridPriorityUp(str9);
                                        a4Var8.ab();
                                        break;
                                    case 8:
                                        String str10 = str;
                                        a4 a4Var9 = this.b;
                                        a4Var9.u().moveDebridPriorityDown(str10);
                                        a4Var9.ab();
                                        break;
                                    default:
                                        String str11 = str;
                                        a4 a4Var10 = this.b;
                                        a4Var10.u().moveDebridPriorityUp(str11);
                                        a4Var10.ab();
                                        break;
                                }
                                return e6a.a;
                            }
                        };
                        final int i13 = 0;
                        aVar = new vn8.a("alldebrid", string12, string13, "AD", color3, z5, string14, strO, s3Var, z, z2, qq3Var, new qq3(this) { // from class: r3
                            public final /* synthetic */ a4 b;

                            {
                                this.b = this;
                            }

                            @Override // defpackage.qq3
                            public final Object invoke() {
                                switch (i13) {
                                    case 0:
                                        String str2 = str;
                                        a4 a4Var = this.b;
                                        a4Var.u().moveDebridPriorityDown(str2);
                                        a4Var.ab();
                                        break;
                                    case 1:
                                        String str3 = str;
                                        a4 a4Var2 = this.b;
                                        a4Var2.u().moveDebridPriorityUp(str3);
                                        a4Var2.ab();
                                        break;
                                    case 2:
                                        String str4 = str;
                                        a4 a4Var3 = this.b;
                                        a4Var3.u().moveDebridPriorityDown(str4);
                                        a4Var3.ab();
                                        break;
                                    case 3:
                                        String str5 = str;
                                        a4 a4Var4 = this.b;
                                        a4Var4.u().moveDebridPriorityUp(str5);
                                        a4Var4.ab();
                                        break;
                                    case 4:
                                        String str6 = str;
                                        a4 a4Var5 = this.b;
                                        a4Var5.u().moveDebridPriorityDown(str6);
                                        a4Var5.ab();
                                        break;
                                    case 5:
                                        String str7 = str;
                                        a4 a4Var6 = this.b;
                                        a4Var6.u().moveDebridPriorityUp(str7);
                                        a4Var6.ab();
                                        break;
                                    case 6:
                                        String str8 = str;
                                        a4 a4Var7 = this.b;
                                        a4Var7.u().moveDebridPriorityDown(str8);
                                        a4Var7.ab();
                                        break;
                                    case 7:
                                        String str9 = str;
                                        a4 a4Var8 = this.b;
                                        a4Var8.u().moveDebridPriorityUp(str9);
                                        a4Var8.ab();
                                        break;
                                    case 8:
                                        String str10 = str;
                                        a4 a4Var9 = this.b;
                                        a4Var9.u().moveDebridPriorityDown(str10);
                                        a4Var9.ab();
                                        break;
                                    default:
                                        String str11 = str;
                                        a4 a4Var10 = this.b;
                                        a4Var10.u().moveDebridPriorityUp(str11);
                                        a4Var10.ab();
                                        break;
                                }
                                return e6a.a;
                            }
                        }, 8);
                        r41 = r418;
                        r1 = aVar;
                    }
                    r41 = r414;
                    r1 = r16;
                    break;
                case 575248285:
                    if (str.equals("premiumize")) {
                        PremiumizeAccount premiumizeAccount2 = this.ab;
                        if (premiumizeAccount2 == null || (accountStatus = premiumizeAccount2.getAccountStatus()) == null) {
                            r412 = r22;
                            arrayList = arrayList2;
                        } else {
                            r412 = r22;
                            if (accountStatus.length() > 0) {
                                StringBuilder sb2 = new StringBuilder();
                                arrayList = arrayList2;
                                String strValueOf2 = String.valueOf(accountStatus.charAt(0));
                                cr4.e(strValueOf2, "null cannot be cast to non-null type java.lang.String");
                                String upperCase2 = strValueOf2.toUpperCase(Locale.ROOT);
                                cr4.f(upperCase2, "toUpperCase(...)");
                                sb2.append((Object) upperCase2);
                                String strSubstring2 = accountStatus.substring(1);
                                cr4.f(strSubstring2, "substring(...)");
                                sb2.append(strSubstring2);
                                string2 = sb2.toString();
                            } else {
                                arrayList = arrayList2;
                                string2 = accountStatus;
                            }
                            if (string2 != null) {
                                r312 = string2;
                                r413 = r412;
                                String string15 = getString(R.string.debrid_premiumize_name);
                                cr4.f(string15, "getString(...)");
                                String string16 = getString(R.string.debrid_premiumize_desc);
                                cr4.f(string16, "getString(...)");
                                final int i14 = 5;
                                num = daysRemaining;
                                final int i15 = 6;
                                aVar = new vn8.a("premiumize", string15, string16, "P", sf1.getColor(requireContext(), R.color.brand_premiumize), this.ah, r312, o(daysRemaining), new s3(this, 2), z, z2, new qq3(this) { // from class: r3
                                    public final /* synthetic */ a4 b;

                                    {
                                        this.b = this;
                                    }

                                    @Override // defpackage.qq3
                                    public final Object invoke() {
                                        switch (i14) {
                                            case 0:
                                                String str2 = str;
                                                a4 a4Var = this.b;
                                                a4Var.u().moveDebridPriorityDown(str2);
                                                a4Var.ab();
                                                break;
                                            case 1:
                                                String str3 = str;
                                                a4 a4Var2 = this.b;
                                                a4Var2.u().moveDebridPriorityUp(str3);
                                                a4Var2.ab();
                                                break;
                                            case 2:
                                                String str4 = str;
                                                a4 a4Var3 = this.b;
                                                a4Var3.u().moveDebridPriorityDown(str4);
                                                a4Var3.ab();
                                                break;
                                            case 3:
                                                String str5 = str;
                                                a4 a4Var4 = this.b;
                                                a4Var4.u().moveDebridPriorityUp(str5);
                                                a4Var4.ab();
                                                break;
                                            case 4:
                                                String str6 = str;
                                                a4 a4Var5 = this.b;
                                                a4Var5.u().moveDebridPriorityDown(str6);
                                                a4Var5.ab();
                                                break;
                                            case 5:
                                                String str7 = str;
                                                a4 a4Var6 = this.b;
                                                a4Var6.u().moveDebridPriorityUp(str7);
                                                a4Var6.ab();
                                                break;
                                            case 6:
                                                String str8 = str;
                                                a4 a4Var7 = this.b;
                                                a4Var7.u().moveDebridPriorityDown(str8);
                                                a4Var7.ab();
                                                break;
                                            case 7:
                                                String str9 = str;
                                                a4 a4Var8 = this.b;
                                                a4Var8.u().moveDebridPriorityUp(str9);
                                                a4Var8.ab();
                                                break;
                                            case 8:
                                                String str10 = str;
                                                a4 a4Var9 = this.b;
                                                a4Var9.u().moveDebridPriorityDown(str10);
                                                a4Var9.ab();
                                                break;
                                            default:
                                                String str11 = str;
                                                a4 a4Var10 = this.b;
                                                a4Var10.u().moveDebridPriorityUp(str11);
                                                a4Var10.ab();
                                                break;
                                        }
                                        return e6a.a;
                                    }
                                }, new qq3(this) { // from class: r3
                                    public final /* synthetic */ a4 b;

                                    {
                                        this.b = this;
                                    }

                                    @Override // defpackage.qq3
                                    public final Object invoke() {
                                        switch (i15) {
                                            case 0:
                                                String str2 = str;
                                                a4 a4Var = this.b;
                                                a4Var.u().moveDebridPriorityDown(str2);
                                                a4Var.ab();
                                                break;
                                            case 1:
                                                String str3 = str;
                                                a4 a4Var2 = this.b;
                                                a4Var2.u().moveDebridPriorityUp(str3);
                                                a4Var2.ab();
                                                break;
                                            case 2:
                                                String str4 = str;
                                                a4 a4Var3 = this.b;
                                                a4Var3.u().moveDebridPriorityDown(str4);
                                                a4Var3.ab();
                                                break;
                                            case 3:
                                                String str5 = str;
                                                a4 a4Var4 = this.b;
                                                a4Var4.u().moveDebridPriorityUp(str5);
                                                a4Var4.ab();
                                                break;
                                            case 4:
                                                String str6 = str;
                                                a4 a4Var5 = this.b;
                                                a4Var5.u().moveDebridPriorityDown(str6);
                                                a4Var5.ab();
                                                break;
                                            case 5:
                                                String str7 = str;
                                                a4 a4Var6 = this.b;
                                                a4Var6.u().moveDebridPriorityUp(str7);
                                                a4Var6.ab();
                                                break;
                                            case 6:
                                                String str8 = str;
                                                a4 a4Var7 = this.b;
                                                a4Var7.u().moveDebridPriorityDown(str8);
                                                a4Var7.ab();
                                                break;
                                            case 7:
                                                String str9 = str;
                                                a4 a4Var8 = this.b;
                                                a4Var8.u().moveDebridPriorityUp(str9);
                                                a4Var8.ab();
                                                break;
                                            case 8:
                                                String str10 = str;
                                                a4 a4Var9 = this.b;
                                                a4Var9.u().moveDebridPriorityDown(str10);
                                                a4Var9.ab();
                                                break;
                                            default:
                                                String str11 = str;
                                                a4 a4Var10 = this.b;
                                                a4Var10.u().moveDebridPriorityUp(str11);
                                                a4Var10.ab();
                                                break;
                                        }
                                        return e6a.a;
                                    }
                                }, 8);
                                r41 = r413;
                                r1 = aVar;
                                break;
                            }
                        }
                        if (!this.ah) {
                            r312 = r16;
                            r413 = r412;
                            String string152 = getString(R.string.debrid_premiumize_name);
                            cr4.f(string152, "getString(...)");
                            String string162 = getString(R.string.debrid_premiumize_desc);
                            cr4.f(string162, "getString(...)");
                            final int i142 = 5;
                            num = daysRemaining;
                            final int i152 = 6;
                            aVar = new vn8.a("premiumize", string152, string162, "P", sf1.getColor(requireContext(), R.color.brand_premiumize), this.ah, r312, o(daysRemaining), new s3(this, 2), z, z2, new qq3(this) { // from class: r3
                                public final /* synthetic */ a4 b;

                                {
                                    this.b = this;
                                }

                                @Override // defpackage.qq3
                                public final Object invoke() {
                                    switch (i142) {
                                        case 0:
                                            String str2 = str;
                                            a4 a4Var = this.b;
                                            a4Var.u().moveDebridPriorityDown(str2);
                                            a4Var.ab();
                                            break;
                                        case 1:
                                            String str3 = str;
                                            a4 a4Var2 = this.b;
                                            a4Var2.u().moveDebridPriorityUp(str3);
                                            a4Var2.ab();
                                            break;
                                        case 2:
                                            String str4 = str;
                                            a4 a4Var3 = this.b;
                                            a4Var3.u().moveDebridPriorityDown(str4);
                                            a4Var3.ab();
                                            break;
                                        case 3:
                                            String str5 = str;
                                            a4 a4Var4 = this.b;
                                            a4Var4.u().moveDebridPriorityUp(str5);
                                            a4Var4.ab();
                                            break;
                                        case 4:
                                            String str6 = str;
                                            a4 a4Var5 = this.b;
                                            a4Var5.u().moveDebridPriorityDown(str6);
                                            a4Var5.ab();
                                            break;
                                        case 5:
                                            String str7 = str;
                                            a4 a4Var6 = this.b;
                                            a4Var6.u().moveDebridPriorityUp(str7);
                                            a4Var6.ab();
                                            break;
                                        case 6:
                                            String str8 = str;
                                            a4 a4Var7 = this.b;
                                            a4Var7.u().moveDebridPriorityDown(str8);
                                            a4Var7.ab();
                                            break;
                                        case 7:
                                            String str9 = str;
                                            a4 a4Var8 = this.b;
                                            a4Var8.u().moveDebridPriorityUp(str9);
                                            a4Var8.ab();
                                            break;
                                        case 8:
                                            String str10 = str;
                                            a4 a4Var9 = this.b;
                                            a4Var9.u().moveDebridPriorityDown(str10);
                                            a4Var9.ab();
                                            break;
                                        default:
                                            String str11 = str;
                                            a4 a4Var10 = this.b;
                                            a4Var10.u().moveDebridPriorityUp(str11);
                                            a4Var10.ab();
                                            break;
                                    }
                                    return e6a.a;
                                }
                            }, new qq3(this) { // from class: r3
                                public final /* synthetic */ a4 b;

                                {
                                    this.b = this;
                                }

                                @Override // defpackage.qq3
                                public final Object invoke() {
                                    switch (i152) {
                                        case 0:
                                            String str2 = str;
                                            a4 a4Var = this.b;
                                            a4Var.u().moveDebridPriorityDown(str2);
                                            a4Var.ab();
                                            break;
                                        case 1:
                                            String str3 = str;
                                            a4 a4Var2 = this.b;
                                            a4Var2.u().moveDebridPriorityUp(str3);
                                            a4Var2.ab();
                                            break;
                                        case 2:
                                            String str4 = str;
                                            a4 a4Var3 = this.b;
                                            a4Var3.u().moveDebridPriorityDown(str4);
                                            a4Var3.ab();
                                            break;
                                        case 3:
                                            String str5 = str;
                                            a4 a4Var4 = this.b;
                                            a4Var4.u().moveDebridPriorityUp(str5);
                                            a4Var4.ab();
                                            break;
                                        case 4:
                                            String str6 = str;
                                            a4 a4Var5 = this.b;
                                            a4Var5.u().moveDebridPriorityDown(str6);
                                            a4Var5.ab();
                                            break;
                                        case 5:
                                            String str7 = str;
                                            a4 a4Var6 = this.b;
                                            a4Var6.u().moveDebridPriorityUp(str7);
                                            a4Var6.ab();
                                            break;
                                        case 6:
                                            String str8 = str;
                                            a4 a4Var7 = this.b;
                                            a4Var7.u().moveDebridPriorityDown(str8);
                                            a4Var7.ab();
                                            break;
                                        case 7:
                                            String str9 = str;
                                            a4 a4Var8 = this.b;
                                            a4Var8.u().moveDebridPriorityUp(str9);
                                            a4Var8.ab();
                                            break;
                                        case 8:
                                            String str10 = str;
                                            a4 a4Var9 = this.b;
                                            a4Var9.u().moveDebridPriorityDown(str10);
                                            a4Var9.ab();
                                            break;
                                        default:
                                            String str11 = str;
                                            a4 a4Var10 = this.b;
                                            a4Var10.u().moveDebridPriorityUp(str11);
                                            a4Var10.ab();
                                            break;
                                    }
                                    return e6a.a;
                                }
                            }, 8);
                            r41 = r413;
                            r1 = aVar;
                        } else {
                            string2 = getString(R.string.debrid_status_premium);
                            r312 = string2;
                            r413 = r412;
                            String string1522 = getString(R.string.debrid_premiumize_name);
                            cr4.f(string1522, "getString(...)");
                            String string1622 = getString(R.string.debrid_premiumize_desc);
                            cr4.f(string1622, "getString(...)");
                            final int i1422 = 5;
                            num = daysRemaining;
                            final int i1522 = 6;
                            aVar = new vn8.a("premiumize", string1522, string1622, "P", sf1.getColor(requireContext(), R.color.brand_premiumize), this.ah, r312, o(daysRemaining), new s3(this, 2), z, z2, new qq3(this) { // from class: r3
                                public final /* synthetic */ a4 b;

                                {
                                    this.b = this;
                                }

                                @Override // defpackage.qq3
                                public final Object invoke() {
                                    switch (i1422) {
                                        case 0:
                                            String str2 = str;
                                            a4 a4Var = this.b;
                                            a4Var.u().moveDebridPriorityDown(str2);
                                            a4Var.ab();
                                            break;
                                        case 1:
                                            String str3 = str;
                                            a4 a4Var2 = this.b;
                                            a4Var2.u().moveDebridPriorityUp(str3);
                                            a4Var2.ab();
                                            break;
                                        case 2:
                                            String str4 = str;
                                            a4 a4Var3 = this.b;
                                            a4Var3.u().moveDebridPriorityDown(str4);
                                            a4Var3.ab();
                                            break;
                                        case 3:
                                            String str5 = str;
                                            a4 a4Var4 = this.b;
                                            a4Var4.u().moveDebridPriorityUp(str5);
                                            a4Var4.ab();
                                            break;
                                        case 4:
                                            String str6 = str;
                                            a4 a4Var5 = this.b;
                                            a4Var5.u().moveDebridPriorityDown(str6);
                                            a4Var5.ab();
                                            break;
                                        case 5:
                                            String str7 = str;
                                            a4 a4Var6 = this.b;
                                            a4Var6.u().moveDebridPriorityUp(str7);
                                            a4Var6.ab();
                                            break;
                                        case 6:
                                            String str8 = str;
                                            a4 a4Var7 = this.b;
                                            a4Var7.u().moveDebridPriorityDown(str8);
                                            a4Var7.ab();
                                            break;
                                        case 7:
                                            String str9 = str;
                                            a4 a4Var8 = this.b;
                                            a4Var8.u().moveDebridPriorityUp(str9);
                                            a4Var8.ab();
                                            break;
                                        case 8:
                                            String str10 = str;
                                            a4 a4Var9 = this.b;
                                            a4Var9.u().moveDebridPriorityDown(str10);
                                            a4Var9.ab();
                                            break;
                                        default:
                                            String str11 = str;
                                            a4 a4Var10 = this.b;
                                            a4Var10.u().moveDebridPriorityUp(str11);
                                            a4Var10.ab();
                                            break;
                                    }
                                    return e6a.a;
                                }
                            }, new qq3(this) { // from class: r3
                                public final /* synthetic */ a4 b;

                                {
                                    this.b = this;
                                }

                                @Override // defpackage.qq3
                                public final Object invoke() {
                                    switch (i1522) {
                                        case 0:
                                            String str2 = str;
                                            a4 a4Var = this.b;
                                            a4Var.u().moveDebridPriorityDown(str2);
                                            a4Var.ab();
                                            break;
                                        case 1:
                                            String str3 = str;
                                            a4 a4Var2 = this.b;
                                            a4Var2.u().moveDebridPriorityUp(str3);
                                            a4Var2.ab();
                                            break;
                                        case 2:
                                            String str4 = str;
                                            a4 a4Var3 = this.b;
                                            a4Var3.u().moveDebridPriorityDown(str4);
                                            a4Var3.ab();
                                            break;
                                        case 3:
                                            String str5 = str;
                                            a4 a4Var4 = this.b;
                                            a4Var4.u().moveDebridPriorityUp(str5);
                                            a4Var4.ab();
                                            break;
                                        case 4:
                                            String str6 = str;
                                            a4 a4Var5 = this.b;
                                            a4Var5.u().moveDebridPriorityDown(str6);
                                            a4Var5.ab();
                                            break;
                                        case 5:
                                            String str7 = str;
                                            a4 a4Var6 = this.b;
                                            a4Var6.u().moveDebridPriorityUp(str7);
                                            a4Var6.ab();
                                            break;
                                        case 6:
                                            String str8 = str;
                                            a4 a4Var7 = this.b;
                                            a4Var7.u().moveDebridPriorityDown(str8);
                                            a4Var7.ab();
                                            break;
                                        case 7:
                                            String str9 = str;
                                            a4 a4Var8 = this.b;
                                            a4Var8.u().moveDebridPriorityUp(str9);
                                            a4Var8.ab();
                                            break;
                                        case 8:
                                            String str10 = str;
                                            a4 a4Var9 = this.b;
                                            a4Var9.u().moveDebridPriorityDown(str10);
                                            a4Var9.ab();
                                            break;
                                        default:
                                            String str11 = str;
                                            a4 a4Var10 = this.b;
                                            a4Var10.u().moveDebridPriorityUp(str11);
                                            a4Var10.ab();
                                            break;
                                    }
                                    return e6a.a;
                                }
                            }, 8);
                            r41 = r413;
                            r1 = aVar;
                        }
                        break;
                    }
                default:
                    num = daysRemaining;
                    r414 = r22;
                    arrayList = arrayList2;
                    r41 = r414;
                    r1 = r16;
                    break;
            }
            arrayList4.add(r1);
            i3 = i4;
            it3 = it4;
            size = i5;
            r22 = r41;
            arrayList2 = arrayList;
            daysRemaining = num;
        }
        ?? r419 = r22;
        ArrayList arrayList5 = arrayList2;
        ArrayList arrayListX = y41.x(arrayList4);
        if (this.y.size() > 1) {
            String string17 = getString(R.string.setting_show_profile_picker);
            cr4.f(string17, "getString(...)");
            rVar = new vn8.r("show_profile_picker_on_start", string17, u().getShowProfilePickerOnStart(), getString(R.string.setting_show_profile_picker_desc), new s3(this, 6), 16);
        } else {
            rVar = r16;
        }
        String string18 = getString(R.string.header_strmr_account);
        cr4.f(string18, "getString(...)");
        vn8.f fVar2 = new vn8.f("strmr_header", string18, r16);
        vn8.o oVar = new vn8.o(this.z, this.aa, new u3(this, 6), new u3(this, 7), new u3(this, 0), new u3(this, 8));
        ArrayList arrayList6 = new ArrayList();
        arrayList6.add(fVar2);
        arrayList6.add(oVar);
        arrayList6.add(fVar);
        arrayList6.addAll(arrayList5);
        if (r419 != 0) {
            arrayList6.add(r419);
        }
        if (rVar != 0) {
            arrayList6.add(rVar);
        }
        String string19 = getString(R.string.header_debrid_services);
        cr4.f(string19, "getString(...)");
        arrayList6.add(new vn8.f("debrid_header", string19, getString(R.string.note_debrid_section_hint)));
        arrayList6.addAll(arrayListX);
        String string20 = getString(R.string.header_rating_posters);
        cr4.f(string20, "getString(...)");
        arrayList6.add(new vn8.f("rpdb_header", string20, null));
        String string21 = getString(R.string.rpdb_name);
        cr4.f(string21, "getString(...)");
        String string22 = getString(R.string.rpdb_desc);
        cr4.f(string22, "getString(...)");
        boolean z6 = this.am;
        arrayList6.add(new vn8.a("rpdb", string21, string22, "R", -14326805, z6, z6 ? getString(R.string.label_connected) : null, this.am ? x().getPosterTypeLabel() : null, new s3(this, 7), false, false, null, null, 31752));
        String string23 = getString(R.string.omdb_name);
        cr4.f(string23, "getString(...)");
        String string24 = getString(R.string.omdb_desc);
        cr4.f(string24, "getString(...)");
        boolean z7 = this.an;
        arrayList6.add(new vn8.a("omdb", string23, string24, "O", -680437, z7, z7 ? getString(R.string.label_connected) : null, null, new s3(this, 8), false, false, null, null, 32008));
        return arrayList6;
    }

    public final String o(Integer num) {
        if (num == null) {
            return null;
        }
        return num.intValue() <= 0 ? getString(R.string.debrid_status_expired) : getResources().getQuantityString(R.plurals.plural_days_remaining, num.intValue(), num);
    }

    @Override // androidx.fragment.app.o
    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        cr4.g(layoutInflater, "inflater");
        return layoutInflater.inflate(R.layout.fragment_accounts, viewGroup, false);
    }

    @Override // androidx.fragment.app.o
    public final void onViewCreated(View view, Bundle bundle) {
        cr4.g(view, "view");
        super.onViewCreated(view, bundle);
        VerticalGridView verticalGridView = (VerticalGridView) view.findViewById(R.id.accounts_list);
        this.f = verticalGridView;
        if (verticalGridView == null) {
            cr4.n("accountsList");
            throw null;
        }
        verticalGridView.setWindowAlignment(1);
        VerticalGridView verticalGridView2 = this.f;
        if (verticalGridView2 == null) {
            cr4.n("accountsList");
            throw null;
        }
        verticalGridView2.setWindowAlignmentOffsetPercent(-1.0f);
        VerticalGridView verticalGridView3 = this.f;
        if (verticalGridView3 == null) {
            cr4.n("accountsList");
            throw null;
        }
        verticalGridView3.setItemAlignmentOffsetPercent(-1.0f);
        n();
        wm8 wm8Var = new wm8(new un8());
        this.i = wm8Var;
        VerticalGridView verticalGridView4 = this.f;
        if (verticalGridView4 == null) {
            cr4.n("accountsList");
            throw null;
        }
        verticalGridView4.setAdapter(wm8Var);
        i85 viewLifecycleOwner = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        n nVarA = s.a(viewLifecycleOwner);
        m12 m12Var = sc2.a;
        wj0.c(nVarA, m02.c, null, new q4(this, null), 2);
        Context contextRequireContext = requireContext();
        cr4.f(contextRequireContext, "requireContext(...)");
        osa osaVarD = osa.d(contextRequireContext);
        t58 t58VarT = osaVarD.c.f().t("trakt_sync_worker");
        r74 r74Var = lta.y;
        bd5.a(t58VarT, r74Var, osaVarD.d).f(getViewLifecycleOwner(), new c(new s3(this, 4)));
        Context contextRequireContext2 = requireContext();
        cr4.f(contextRequireContext2, "requireContext(...)");
        osa osaVarD2 = osa.d(contextRequireContext2);
        bd5.a(osaVarD2.c.f().t("trakt_initial_sync"), r74Var, osaVarD2.d).f(getViewLifecycleOwner(), new c(new s3(this, 9)));
    }

    public final void p(String str, String str2, ImageView imageView, View view) {
        wj0.c(vw2.h(this, "getViewLifecycleOwner(...)"), null, null, new m4(view, imageView, str, str2, null), 3);
    }

    public final TraktAccountRepository q() {
        TraktAccountRepository traktAccountRepository = this.k;
        if (traktAccountRepository != null) {
            return traktAccountRepository;
        }
        cr4.n("accountRepository");
        throw null;
    }

    public final AllDebridRepository r() {
        AllDebridRepository allDebridRepository = this.p;
        if (allDebridRepository != null) {
            return allDebridRepository;
        }
        cr4.n("allDebridRepository");
        throw null;
    }

    public final DeviceManager s() {
        DeviceManager deviceManager = this.v;
        if (deviceManager != null) {
            return deviceManager;
        }
        cr4.n("deviceManager");
        throw null;
    }

    public final FeatureGateManager t() {
        FeatureGateManager featureGateManager = this.w;
        if (featureGateManager != null) {
            return featureGateManager;
        }
        cr4.n("featureGateManager");
        throw null;
    }

    public final PreferencesRepository u() {
        PreferencesRepository preferencesRepository = this.u;
        if (preferencesRepository != null) {
            return preferencesRepository;
        }
        cr4.n("preferencesRepository");
        throw null;
    }

    public final PremiumizeRepository v() {
        PremiumizeRepository premiumizeRepository = this.n;
        if (premiumizeRepository != null) {
            return premiumizeRepository;
        }
        cr4.n("premiumizeRepository");
        throw null;
    }

    public final RealDebridRepository w() {
        RealDebridRepository realDebridRepository = this.o;
        if (realDebridRepository != null) {
            return realDebridRepository;
        }
        cr4.n("realDebridRepository");
        throw null;
    }

    public final RpdbRepository x() {
        RpdbRepository rpdbRepository = this.s;
        if (rpdbRepository != null) {
            return rpdbRepository;
        }
        cr4.n("rpdbRepository");
        throw null;
    }

    public final TorBoxRepository y() {
        TorBoxRepository torBoxRepository = this.q;
        if (torBoxRepository != null) {
            return torBoxRepository;
        }
        cr4.n("torBoxRepository");
        throw null;
    }

    public final void z() {
        String strE = s().e();
        if (strE == null) {
            return;
        }
        n nVarH = vw2.h(this, "getViewLifecycleOwner(...)");
        m12 m12Var = sc2.a;
        wj0.c(nVarH, m02.c, null, new v5(this, strE, null), 2);
    }
}
