package p000.p001.p002.p018.p019;

import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
import ar.tvplayer.core.data.prefs.ރ;
import ar.tvplayer.core.domain.ލ;
import ar.tvplayer.core.domain.ޏ;
import ar.tvplayer.core.domain.ޑ;
import ar.tvplayer.core.util.CommonUtilsKt;
import ar.tvplayer.tv.settings.ui.general.֏;
import ar.tvplayer.tv.settings.ui.parentalcontrols.ؠ;
import ar.tvplayer.tv.settings.ui.playback.ށ;
import ar.tvplayer.tv.settings.ui.playlists.ހ;
import ar.tvplayer.tv.settings.ui.tvguide.ނ;
import p000.p001.p002.p008.p009.EnumC0824;
import p000.p001.p002.p018.C1209;
import p000.p001.p002.p018.p019.C1215;
import p000.p001.p021.C1255;
import p000.p001.p021.p022.C1243;
import p037.p089.p090.AbstractC2014;
import p037.p091.p093.AbstractC2098;
import p037.p099.AbstractC2245;
import p037.p099.AbstractC2248;
import p037.p099.C2250;
import p037.p099.C2251;
import p037.p099.InterfaceC2219;
import p037.p099.InterfaceC2230;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.InterfaceC6538;
import p402.InterfaceC6540;
import p402.p411.p412.InterfaceC6603;
import p402.p411.p413.AbstractC6636;
import p402.p411.p413.C6635;

/* JADX INFO: renamed from: ނ.֏.֏.ޅ.ޅ.ؠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
public final class C1211 extends AbstractC2098 {

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final InterfaceC6538 f4309 = C4303.m7065((InterfaceC6603) new C1213());

    /* JADX INFO: renamed from: ނ.֏.֏.ޅ.ޅ.ؠ$֏, reason: contains not printable characters */
    public static final class C1212<T> implements InterfaceC2230<C1215.C1216> {
        public C1212() {
        }

        @Override // p037.p099.InterfaceC2230
        /* JADX INFO: renamed from: ֏ */
        public void mo1576(C1215.C1216 c1216) {
            C1211.this.m2465();
        }
    }

    /* JADX INFO: renamed from: ނ.֏.֏.ޅ.ޅ.ؠ$ؠ, reason: contains not printable characters */
    public static final class C1213 extends AbstractC6636 implements InterfaceC6603<C1215> {
        public C1213() {
            super(0);
        }

        /* JADX WARN: Multi-variable type inference failed */
        @Override // p402.p411.p412.InterfaceC6603
        /* JADX INFO: renamed from: ނ */
        public C1215 mo1543() {
            C1211 c1211 = C1211.this;
            C1214 c1214 = new C1214();
            C2251 viewModelStore = c1211.getViewModelStore();
            String canonicalName = C1215.class.getCanonicalName();
            if (canonicalName == null) {
                throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
            }
            String strM4879 = C2803.m4879("androidx.lifecycle.ViewModelProvider.DefaultKey:", canonicalName);
            AbstractC2245 abstractC2245Mo4300 = viewModelStore.f7211.get(strM4879);
            if (!C1215.class.isInstance(abstractC2245Mo4300)) {
                abstractC2245Mo4300 = c1214 instanceof AbstractC2248 ? ((AbstractC2248) c1214).mo4300(strM4879, C1215.class) : c1214.mo1666(C1215.class);
                AbstractC2245 abstractC2245Put = viewModelStore.f7211.put(strM4879, abstractC2245Mo4300);
                if (abstractC2245Put != null) {
                    abstractC2245Put.mo2103();
                }
            } else if (c1214 instanceof C2250) {
                ((C2250) c1214).mo4301(abstractC2245Mo4300);
            }
            C6635.m9823((Object) abstractC2245Mo4300, "ViewModelProvider(this, …ctory).get(T::class.java)");
            return (C1215) abstractC2245Mo4300;
        }
    }

    @Override // p037.p106.AbstractC2273, androidx.fragment.app.Fragment
    public /* synthetic */ void onDestroyView() {
        super.onDestroyView();
    }

    @Override // p037.p091.p093.AbstractC2098, p037.p106.AbstractC2273, androidx.fragment.app.Fragment
    public void onViewCreated(View view, Bundle bundle) {
        if (view == null) {
            C6635.m9824("view");
            throw null;
        }
        super.onViewCreated(view, bundle);
        C1243<C1215.C1216> c1243 = ((C1215) this.f4309.getValue()).f4312;
        InterfaceC2219 viewLifecycleOwner = getViewLifecycleOwner();
        C6635.m9823((Object) viewLifecycleOwner, "viewLifecycleOwner");
        c1243.mo342(viewLifecycleOwner, new C1212());
    }

    @Override // p037.p106.AbstractC2273
    /* JADX INFO: renamed from: ֏ */
    public void mo1836(Bundle bundle, String str) {
        m4316(C1209.settings, str);
        m2465();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m2464(Fragment fragment) {
        Fragment fragment2 = this.mParentFragment;
        if (!(fragment2 instanceof C1210)) {
            fragment2 = null;
        }
        C1210 c1210 = (C1210) fragment2;
        if (c1210 != null) {
            c1210.m4073(fragment);
        }
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00f5  */
    /* JADX WARN: Removed duplicated region for block: B:79:0x012c  */
    @Override // p037.p106.AbstractC2273, p037.p106.C2287.InterfaceC2290
    /* JADX INFO: renamed from: ؠ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public boolean mo1837(Preference preference) {
        AbstractC2014 childFragmentManager;
        boolean z;
        AbstractC2014 childFragmentManager2;
        AbstractC2014 childFragmentManager3;
        if (preference == null) {
            C6635.m9824("pref");
            throw null;
        }
        if (super.mo1837(preference)) {
            return true;
        }
        String str = preference.f1018;
        if (str != null) {
            switch (str.hashCode()) {
                case -1912505353:
                    if (str.equals("settingsTvGuide")) {
                        if (!ލ.֏(EnumC0824.SETTINGS) && ލ.֏(EnumC0824.TV_GUIDE) && ލ.֏(false, 1)) {
                            Fragment fragment = this.mParentFragment;
                            if (fragment != null && (childFragmentManager = fragment.getChildFragmentManager()) != null) {
                                ލ.֏(childFragmentManager, true, 2, false, false, (String) null, 28);
                            }
                        } else {
                            m2464((Fragment) new ނ());
                        }
                        return true;
                    }
                    break;
                case -1371659426:
                    if (str.equals("settingsPlayback")) {
                        m2464((Fragment) new ށ());
                        return true;
                    }
                    break;
                case -1016297659:
                    if (str.equals("settingsGeneral")) {
                        m2464((Fragment) new ֏());
                        return true;
                    }
                    break;
                case -727027090:
                    if (str.equals("settingsParentalControls")) {
                        if (!(ޏ.ވ.ހ().length() > 0)) {
                            if (CommonUtilsKt.ރ()) {
                                ޏ r11 = ޏ.ވ;
                                if (r11 == null) {
                                    throw null;
                                }
                                boolean z2 = ((Number) ޏ.ބ.m9835(r11, ޏ.ށ[2])).intValue() == 2;
                                boolean z3 = ޑ.֏;
                                boolean z4 = C1255.f4369;
                                boolean z5 = ލ.ؠ;
                                if (z2 && z3 && (!z4 || z5)) {
                                    z = true;
                                }
                                if (z || ލ.֏(EnumC0824.SETTINGS) || !ލ.֏(false, 1)) {
                                    m2464((Fragment) new ؠ());
                                } else {
                                    if (ރ.ߠ.ޚ().length() > 0) {
                                        Fragment fragment2 = this.mParentFragment;
                                        if (fragment2 != null && (childFragmentManager2 = fragment2.getChildFragmentManager()) != null) {
                                            ލ.֏(childFragmentManager2, true, 0, false, false, (String) null, 28);
                                        }
                                    }
                                }
                            }
                            z = false;
                            if (z) {
                                m2464((Fragment) new ؠ());
                            }
                        }
                        return true;
                    }
                    break;
                case -632384214:
                    if (str.equals("settingsAbout")) {
                        m2464((Fragment) new ar.tvplayer.tv.settings.ui.about.֏());
                        return true;
                    }
                    break;
                case -618925907:
                    if (str.equals("settingsOther")) {
                        m2464((Fragment) new ar.tvplayer.tv.settings.ui.other.ؠ());
                        return true;
                    }
                    break;
                case 192267495:
                    if (str.equals("settingsAppearance")) {
                        m2464((Fragment) new ar.tvplayer.tv.settings.ui.appearance.ށ());
                        return true;
                    }
                    break;
                case 437720062:
                    if (str.equals("settingsPlaylists")) {
                        if (!ލ.֏(EnumC0824.SETTINGS) && ލ.֏(EnumC0824.PLAYLISTS) && ލ.֏(false, 1)) {
                            Fragment fragment3 = this.mParentFragment;
                            if (fragment3 != null && (childFragmentManager3 = fragment3.getChildFragmentManager()) != null) {
                                ލ.֏(childFragmentManager3, true, 1, false, false, (String) null, 28);
                            }
                        } else {
                            m2464((Fragment) new ހ());
                        }
                        return true;
                    }
                    break;
                case 1025316624:
                    if (str.equals("settingsUnlockPremium")) {
                        ލ.ތ(this);
                        return true;
                    }
                    break;
                case 1982910164:
                    if (str.equals("settingsRemoteControl")) {
                        m2464((Fragment) new ar.tvplayer.tv.settings.ui.remotecontrol.ށ());
                        return true;
                    }
                    break;
            }
        }
        StringBuilder sbM4889 = C2803.m4889("Unhandled preference, key: ");
        sbM4889.append(preference.f1018);
        throw new IllegalStateException(sbM4889.toString());
    }

    /* JADX WARN: Removed duplicated region for block: B:24:0x004b  */
    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m2465() {
        Preference preferenceMo363 = mo363("settingsUnlockPremium");
        if (preferenceMo363 != null) {
            boolean z = false;
            if (!(ޏ.ވ.ހ().length() > 0)) {
                if (CommonUtilsKt.ރ()) {
                    ޏ r1 = ޏ.ވ;
                    if (r1 == null) {
                        throw null;
                    }
                    boolean z2 = ((Number) ޏ.ބ.m9835(r1, ޏ.ށ[2])).intValue() == 2;
                    boolean z3 = ޑ.֏;
                    boolean z4 = C1255.f4369;
                    boolean z5 = ލ.ؠ;
                    if (z2 && z3 && (!z4 || z5)) {
                        z = true;
                    }
                }
            }
            preferenceMo363.m395(!z);
            preferenceMo363.m381(ލ.ރ(this));
        }
    }
}
