package androidx.fragment.app;

import android.animation.Animator;
import android.app.Activity;
import android.app.Application;
import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import androidx.lifecycle.C1115y;
import androidx.lifecycle.EnumC1107p;
import androidx.lifecycle.EnumC1108q;
import androidx.lifecycle.InterfaceC1102k;
import androidx.lifecycle.InterfaceC1113w;
import com.revenuecat.purchases.common.Constants;
import d2.AbstractC1866c;
import d2.C1867d;
import d3.C1931v0;
import g.AbstractC2050d;
import g.AbstractC2055i;
import g.C2057k;
import g.InterfaceC2048b;
import g.InterfaceC2049c;
import h.AbstractC2068b;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import m3.AbstractC2478m;
import n2.C2616g;
import n2.C2617h;
import n2.InterfaceC2618i;
import p2.C2720a;
import x1.AbstractC3209a;

/* JADX INFO: loaded from: classes.dex */
public abstract class G implements ComponentCallbacks, View.OnCreateContextMenuListener, InterfaceC1113w, androidx.lifecycle.j0, InterfaceC1102k, InterfaceC2618i, InterfaceC2049c {
    static final int ACTIVITY_CREATED = 4;
    static final int ATTACHED = 0;
    static final int AWAITING_ENTER_EFFECTS = 6;
    static final int AWAITING_EXIT_EFFECTS = 3;
    static final int CREATED = 1;
    static final int INITIALIZING = -1;
    static final int RESUMED = 7;
    static final int STARTED = 5;
    static final Object USE_DEFAULT_TRANSITION = new Object();
    static final int VIEW_CREATED = 2;
    boolean mAdded;
    C mAnimationInfo;
    Bundle mArguments;
    int mBackStackNesting;
    boolean mBeingSaved;
    private boolean mCalled;
    ViewGroup mContainer;
    int mContainerId;
    private int mContentLayoutId;
    androidx.lifecycle.d0 mDefaultFactory;
    boolean mDeferStart;
    boolean mDetached;
    int mFragmentId;
    AbstractC1050g0 mFragmentManager;
    boolean mFromLayout;
    boolean mHasMenu;
    boolean mHidden;
    boolean mHiddenChanged;
    S mHost;
    boolean mInLayout;
    boolean mIsCreated;
    LayoutInflater mLayoutInflater;
    C1115y mLifecycleRegistry;
    G mParentFragment;
    boolean mPerformedCreateView;
    Handler mPostponedHandler;
    public String mPreviousWho;
    boolean mRemoving;
    boolean mRestored;
    boolean mRetainInstance;
    boolean mRetainInstanceChangedWhileDetached;
    Bundle mSavedFragmentState;
    C2617h mSavedStateRegistryController;
    Boolean mSavedUserVisibleHint;
    Bundle mSavedViewRegistryState;
    SparseArray<Parcelable> mSavedViewState;
    String mTag;
    G mTarget;
    int mTargetRequestCode;
    View mView;
    A0 mViewLifecycleOwner;
    int mState = -1;
    String mWho = UUID.randomUUID().toString();
    String mTargetWho = null;
    private Boolean mIsPrimaryNavigationFragment = null;
    AbstractC1050g0 mChildFragmentManager = new h0();
    boolean mMenuVisible = true;
    boolean mUserVisibleHint = true;
    Runnable mPostponedDurationRunnable = new RunnableC1065w(this, 0);
    EnumC1108q mMaxState = EnumC1108q.f12184e;
    androidx.lifecycle.F mViewLifecycleOwnerLiveData = new androidx.lifecycle.F();
    private final AtomicInteger mNextLocalRequestCode = new AtomicInteger();
    private final ArrayList<D> mOnPreAttachedListeners = new ArrayList<>();
    private final D mSavedStateAttachListener = new C1066x(this);

    public G() {
        d();
    }

    @Deprecated
    public static G instantiate(Context context, String str) {
        return instantiate(context, str, null);
    }

    public final C a() {
        if (this.mAnimationInfo == null) {
            C c6 = new C();
            c6.f11497i = null;
            Object obj = USE_DEFAULT_TRANSITION;
            c6.f11498j = obj;
            c6.f11499k = null;
            c6.l = obj;
            c6.f11500m = null;
            c6.f11501n = obj;
            c6.f11504q = 1.0f;
            c6.f11505r = null;
            this.mAnimationInfo = c6;
        }
        return this.mAnimationInfo;
    }

    public final int b() {
        EnumC1108q enumC1108q = this.mMaxState;
        return (enumC1108q == EnumC1108q.f12181b || this.mParentFragment == null) ? enumC1108q.ordinal() : Math.min(enumC1108q.ordinal(), this.mParentFragment.b());
    }

    public final G c(boolean z6) {
        String str;
        if (z6) {
            X1.c cVar = X1.d.f8547a;
            X1.d.b(new X1.f(this, "Attempting to get target fragment from fragment " + this));
            X1.d.a(this).getClass();
        }
        G g6 = this.mTarget;
        if (g6 != null) {
            return g6;
        }
        AbstractC1050g0 abstractC1050g0 = this.mFragmentManager;
        if (abstractC1050g0 == null || (str = this.mTargetWho) == null) {
            return null;
        }
        return abstractC1050g0.f11606c.b(str);
    }

    public void callStartTransitionListener(boolean z6) {
        ViewGroup viewGroup;
        AbstractC1050g0 abstractC1050g0;
        C c6 = this.mAnimationInfo;
        if (c6 != null) {
            c6.f11506s = false;
        }
        if (this.mView == null || (viewGroup = this.mContainer) == null || (abstractC1050g0 = this.mFragmentManager) == null) {
            return;
        }
        C1058o c1058oH = C1058o.h(viewGroup, abstractC1050g0);
        c1058oH.i();
        if (z6) {
            this.mHost.f11541c.post(new RunnableC1059p(c1058oH, 1));
        } else {
            c1058oH.d();
        }
        Handler handler = this.mPostponedHandler;
        if (handler != null) {
            handler.removeCallbacks(this.mPostponedDurationRunnable);
            this.mPostponedHandler = null;
        }
    }

    public O createFragmentContainer() {
        return new C1067y(this);
    }

    public final void d() {
        this.mLifecycleRegistry = new C1115y(this, true);
        this.mSavedStateRegistryController = new C2617h(new C2720a(this, new C1931v0(this, 9)));
        this.mDefaultFactory = null;
        if (this.mOnPreAttachedListeners.contains(this.mSavedStateAttachListener)) {
            return;
        }
        D d6 = this.mSavedStateAttachListener;
        if (this.mState >= 0) {
            d6.a();
        } else {
            this.mOnPreAttachedListeners.add(d6);
        }
    }

    public void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        printWriter.print(str);
        printWriter.print("mFragmentId=#");
        printWriter.print(Integer.toHexString(this.mFragmentId));
        printWriter.print(" mContainerId=#");
        printWriter.print(Integer.toHexString(this.mContainerId));
        printWriter.print(" mTag=");
        printWriter.println(this.mTag);
        printWriter.print(str);
        printWriter.print("mState=");
        printWriter.print(this.mState);
        printWriter.print(" mWho=");
        printWriter.print(this.mWho);
        printWriter.print(" mBackStackNesting=");
        printWriter.println(this.mBackStackNesting);
        printWriter.print(str);
        printWriter.print("mAdded=");
        printWriter.print(this.mAdded);
        printWriter.print(" mRemoving=");
        printWriter.print(this.mRemoving);
        printWriter.print(" mFromLayout=");
        printWriter.print(this.mFromLayout);
        printWriter.print(" mInLayout=");
        printWriter.println(this.mInLayout);
        printWriter.print(str);
        printWriter.print("mHidden=");
        printWriter.print(this.mHidden);
        printWriter.print(" mDetached=");
        printWriter.print(this.mDetached);
        printWriter.print(" mMenuVisible=");
        printWriter.print(this.mMenuVisible);
        printWriter.print(" mHasMenu=");
        printWriter.println(this.mHasMenu);
        printWriter.print(str);
        printWriter.print("mRetainInstance=");
        printWriter.print(this.mRetainInstance);
        printWriter.print(" mUserVisibleHint=");
        printWriter.println(this.mUserVisibleHint);
        if (this.mFragmentManager != null) {
            printWriter.print(str);
            printWriter.print("mFragmentManager=");
            printWriter.println(this.mFragmentManager);
        }
        if (this.mHost != null) {
            printWriter.print(str);
            printWriter.print("mHost=");
            printWriter.println(this.mHost);
        }
        if (this.mParentFragment != null) {
            printWriter.print(str);
            printWriter.print("mParentFragment=");
            printWriter.println(this.mParentFragment);
        }
        if (this.mArguments != null) {
            printWriter.print(str);
            printWriter.print("mArguments=");
            printWriter.println(this.mArguments);
        }
        if (this.mSavedFragmentState != null) {
            printWriter.print(str);
            printWriter.print("mSavedFragmentState=");
            printWriter.println(this.mSavedFragmentState);
        }
        if (this.mSavedViewState != null) {
            printWriter.print(str);
            printWriter.print("mSavedViewState=");
            printWriter.println(this.mSavedViewState);
        }
        if (this.mSavedViewRegistryState != null) {
            printWriter.print(str);
            printWriter.print("mSavedViewRegistryState=");
            printWriter.println(this.mSavedViewRegistryState);
        }
        G gC = c(false);
        if (gC != null) {
            printWriter.print(str);
            printWriter.print("mTarget=");
            printWriter.print(gC);
            printWriter.print(" mTargetRequestCode=");
            printWriter.println(this.mTargetRequestCode);
        }
        printWriter.print(str);
        printWriter.print("mPopDirection=");
        printWriter.println(getPopDirection());
        if (getEnterAnim() != 0) {
            printWriter.print(str);
            printWriter.print("getEnterAnim=");
            printWriter.println(getEnterAnim());
        }
        if (getExitAnim() != 0) {
            printWriter.print(str);
            printWriter.print("getExitAnim=");
            printWriter.println(getExitAnim());
        }
        if (getPopEnterAnim() != 0) {
            printWriter.print(str);
            printWriter.print("getPopEnterAnim=");
            printWriter.println(getPopEnterAnim());
        }
        if (getPopExitAnim() != 0) {
            printWriter.print(str);
            printWriter.print("getPopExitAnim=");
            printWriter.println(getPopExitAnim());
        }
        if (this.mContainer != null) {
            printWriter.print(str);
            printWriter.print("mContainer=");
            printWriter.println(this.mContainer);
        }
        if (this.mView != null) {
            printWriter.print(str);
            printWriter.print("mView=");
            printWriter.println(this.mView);
        }
        if (getAnimatingAway() != null) {
            printWriter.print(str);
            printWriter.print("mAnimatingAway=");
            printWriter.println(getAnimatingAway());
        }
        if (getContext() != null) {
            androidx.loader.app.b.a(this).c(str, fileDescriptor, printWriter, strArr);
        }
        printWriter.print(str);
        printWriter.println("Child " + this.mChildFragmentManager + Constants.SUBS_ID_BASE_PLAN_ID_SEPARATOR);
        this.mChildFragmentManager.u(Z0.o.n(str, "  "), fileDescriptor, printWriter, strArr);
    }

    public final C1064v e(AbstractC2068b abstractC2068b, A a6, InterfaceC2048b interfaceC2048b) {
        if (this.mState > 1) {
            throw new IllegalStateException(Z0.o.m("Fragment ", this, " is attempting to registerForActivityResult after being created. Fragments must call registerForActivityResult() before they are created (i.e. initialization, onAttach(), or onCreate())."));
        }
        AtomicReference atomicReference = new AtomicReference();
        B b5 = new B(this, a6, atomicReference, abstractC2068b, interfaceC2048b);
        if (this.mState >= 0) {
            b5.a();
        } else {
            this.mOnPreAttachedListeners.add(b5);
        }
        return new C1064v(atomicReference);
    }

    public final boolean equals(Object obj) {
        return super.equals(obj);
    }

    public G findFragmentByWho(String str) {
        return str.equals(this.mWho) ? this : this.mChildFragmentManager.f11606c.c(str);
    }

    public String generateActivityResultKey() {
        return "fragment_" + this.mWho + "_rq#" + this.mNextLocalRequestCode.getAndIncrement();
    }

    public final L getActivity() {
        S s6 = this.mHost;
        if (s6 == null) {
            return null;
        }
        return s6.f11539a;
    }

    public boolean getAllowEnterTransitionOverlap() {
        Boolean bool;
        C c6 = this.mAnimationInfo;
        if (c6 == null || (bool = c6.f11503p) == null) {
            return true;
        }
        return bool.booleanValue();
    }

    public boolean getAllowReturnTransitionOverlap() {
        Boolean bool;
        C c6 = this.mAnimationInfo;
        if (c6 == null || (bool = c6.f11502o) == null) {
            return true;
        }
        return bool.booleanValue();
    }

    public View getAnimatingAway() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        c6.getClass();
        return null;
    }

    public final Bundle getArguments() {
        return this.mArguments;
    }

    public final AbstractC1050g0 getChildFragmentManager() {
        if (this.mHost != null) {
            return this.mChildFragmentManager;
        }
        throw new IllegalStateException(Z0.o.m("Fragment ", this, " has not been attached yet."));
    }

    public Context getContext() {
        S s6 = this.mHost;
        if (s6 == null) {
            return null;
        }
        return s6.f11540b;
    }

    @Override // androidx.lifecycle.InterfaceC1102k
    public AbstractC1866c getDefaultViewModelCreationExtras() {
        Application application;
        Context applicationContext = requireContext().getApplicationContext();
        while (true) {
            if (!(applicationContext instanceof ContextWrapper)) {
                application = null;
                break;
            }
            if (applicationContext instanceof Application) {
                application = (Application) applicationContext;
                break;
            }
            applicationContext = ((ContextWrapper) applicationContext).getBaseContext();
        }
        if (application == null && AbstractC1050g0.H(3)) {
            Log.d("FragmentManager", "Could not find Application instance from Context " + requireContext().getApplicationContext() + ", you will not be able to use AndroidViewModel with the default ViewModelProvider.Factory");
        }
        C1867d c1867d = new C1867d(0);
        LinkedHashMap linkedHashMap = c1867d.f15010a;
        if (application != null) {
            linkedHashMap.put(androidx.lifecycle.c0.f12161c, application);
        }
        linkedHashMap.put(androidx.lifecycle.X.f12140a, this);
        linkedHashMap.put(androidx.lifecycle.X.f12141b, this);
        if (getArguments() != null) {
            linkedHashMap.put(androidx.lifecycle.X.f12142c, getArguments());
        }
        return c1867d;
    }

    @Override // androidx.lifecycle.InterfaceC1102k
    public androidx.lifecycle.d0 getDefaultViewModelProviderFactory() {
        Application application;
        if (this.mFragmentManager == null) {
            throw new IllegalStateException("Can't access ViewModels from detached fragment");
        }
        if (this.mDefaultFactory == null) {
            Context applicationContext = requireContext().getApplicationContext();
            while (true) {
                if (!(applicationContext instanceof ContextWrapper)) {
                    application = null;
                    break;
                }
                if (applicationContext instanceof Application) {
                    application = (Application) applicationContext;
                    break;
                }
                applicationContext = ((ContextWrapper) applicationContext).getBaseContext();
            }
            if (application == null && AbstractC1050g0.H(3)) {
                Log.d("FragmentManager", "Could not find Application instance from Context " + requireContext().getApplicationContext() + ", you will need CreationExtras to use AndroidViewModel with the default ViewModelProvider.Factory");
            }
            this.mDefaultFactory = new androidx.lifecycle.Z(application, this, getArguments());
        }
        return this.mDefaultFactory;
    }

    public int getEnterAnim() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return 0;
        }
        return c6.f11490b;
    }

    public Object getEnterTransition() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        return c6.f11497i;
    }

    public androidx.core.app.S getEnterTransitionCallback() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        c6.getClass();
        return null;
    }

    public int getExitAnim() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return 0;
        }
        return c6.f11491c;
    }

    public Object getExitTransition() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        return c6.f11499k;
    }

    public androidx.core.app.S getExitTransitionCallback() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        c6.getClass();
        return null;
    }

    public View getFocusedView() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        return c6.f11505r;
    }

    @Deprecated
    public final AbstractC1050g0 getFragmentManager() {
        return this.mFragmentManager;
    }

    public final Object getHost() {
        S s6 = this.mHost;
        if (s6 == null) {
            return null;
        }
        return ((K) s6).f11526e;
    }

    public final int getId() {
        return this.mFragmentId;
    }

    public final LayoutInflater getLayoutInflater() {
        LayoutInflater layoutInflater = this.mLayoutInflater;
        return layoutInflater == null ? performGetLayoutInflater(null) : layoutInflater;
    }

    @Override // androidx.lifecycle.InterfaceC1113w
    public androidx.lifecycle.r getLifecycle() {
        return this.mLifecycleRegistry;
    }

    @Deprecated
    public androidx.loader.app.b getLoaderManager() {
        return androidx.loader.app.b.a(this);
    }

    public int getNextTransition() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return 0;
        }
        return c6.f11494f;
    }

    public final G getParentFragment() {
        return this.mParentFragment;
    }

    public final AbstractC1050g0 getParentFragmentManager() {
        AbstractC1050g0 abstractC1050g0 = this.mFragmentManager;
        if (abstractC1050g0 != null) {
            return abstractC1050g0;
        }
        throw new IllegalStateException(Z0.o.m("Fragment ", this, " not associated with a fragment manager."));
    }

    public boolean getPopDirection() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return false;
        }
        return c6.f11489a;
    }

    public int getPopEnterAnim() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return 0;
        }
        return c6.f11492d;
    }

    public int getPopExitAnim() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return 0;
        }
        return c6.f11493e;
    }

    public float getPostOnViewCreatedAlpha() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return 1.0f;
        }
        return c6.f11504q;
    }

    public Object getReenterTransition() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        Object obj = c6.l;
        return obj == USE_DEFAULT_TRANSITION ? getExitTransition() : obj;
    }

    public final Resources getResources() {
        return requireContext().getResources();
    }

    @Deprecated
    public final boolean getRetainInstance() {
        X1.c cVar = X1.d.f8547a;
        X1.d.b(new X1.e(this, "Attempting to get retain instance for fragment " + this));
        X1.d.a(this).getClass();
        return this.mRetainInstance;
    }

    public Object getReturnTransition() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        Object obj = c6.f11498j;
        return obj == USE_DEFAULT_TRANSITION ? getEnterTransition() : obj;
    }

    @Override // n2.InterfaceC2618i
    public final C2616g getSavedStateRegistry() {
        return this.mSavedStateRegistryController.f21615b;
    }

    public Object getSharedElementEnterTransition() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        return c6.f11500m;
    }

    public Object getSharedElementReturnTransition() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return null;
        }
        Object obj = c6.f11501n;
        return obj == USE_DEFAULT_TRANSITION ? getSharedElementEnterTransition() : obj;
    }

    public ArrayList<String> getSharedElementSourceNames() {
        ArrayList<String> arrayList;
        C c6 = this.mAnimationInfo;
        return (c6 == null || (arrayList = c6.f11495g) == null) ? new ArrayList<>() : arrayList;
    }

    public ArrayList<String> getSharedElementTargetNames() {
        ArrayList<String> arrayList;
        C c6 = this.mAnimationInfo;
        return (c6 == null || (arrayList = c6.f11496h) == null) ? new ArrayList<>() : arrayList;
    }

    public final String getString(int i6) {
        return getResources().getString(i6);
    }

    public final String getTag() {
        return this.mTag;
    }

    @Deprecated
    public final G getTargetFragment() {
        return c(true);
    }

    @Deprecated
    public final int getTargetRequestCode() {
        X1.c cVar = X1.d.f8547a;
        X1.d.b(new X1.f(this, "Attempting to get target request code from fragment " + this));
        X1.d.a(this).getClass();
        return this.mTargetRequestCode;
    }

    public final CharSequence getText(int i6) {
        return getResources().getText(i6);
    }

    @Deprecated
    public boolean getUserVisibleHint() {
        return this.mUserVisibleHint;
    }

    public View getView() {
        return this.mView;
    }

    public InterfaceC1113w getViewLifecycleOwner() {
        A0 a02 = this.mViewLifecycleOwner;
        if (a02 != null) {
            return a02;
        }
        throw new IllegalStateException(Z0.o.m("Can't access the Fragment View's LifecycleOwner for ", this, " when getView() is null i.e., before onCreateView() or after onDestroyView()"));
    }

    public androidx.lifecycle.E getViewLifecycleOwnerLiveData() {
        return this.mViewLifecycleOwnerLiveData;
    }

    @Override // androidx.lifecycle.j0
    public androidx.lifecycle.i0 getViewModelStore() {
        if (this.mFragmentManager == null) {
            throw new IllegalStateException("Can't access ViewModels from detached fragment");
        }
        int iB = b();
        EnumC1108q enumC1108q = EnumC1108q.f12180a;
        if (iB != 1) {
            return this.mFragmentManager.f11602M.getViewModelStore(this);
        }
        throw new IllegalStateException("Calling getViewModelStore() before a Fragment reaches onCreate() when using setMaxLifecycle(INITIALIZED) is not supported");
    }

    public final boolean hasOptionsMenu() {
        return this.mHasMenu;
    }

    public final int hashCode() {
        return super.hashCode();
    }

    public void initState() {
        d();
        this.mPreviousWho = this.mWho;
        this.mWho = UUID.randomUUID().toString();
        this.mAdded = false;
        this.mRemoving = false;
        this.mFromLayout = false;
        this.mInLayout = false;
        this.mRestored = false;
        this.mBackStackNesting = 0;
        this.mFragmentManager = null;
        this.mChildFragmentManager = new h0();
        this.mHost = null;
        this.mFragmentId = 0;
        this.mContainerId = 0;
        this.mTag = null;
        this.mHidden = false;
        this.mDetached = false;
    }

    public final boolean isAdded() {
        return this.mHost != null && this.mAdded;
    }

    public final boolean isDetached() {
        return this.mDetached;
    }

    public final boolean isHidden() {
        if (this.mHidden) {
            return true;
        }
        AbstractC1050g0 abstractC1050g0 = this.mFragmentManager;
        if (abstractC1050g0 != null) {
            G g6 = this.mParentFragment;
            abstractC1050g0.getClass();
            if (g6 == null ? false : g6.isHidden()) {
                return true;
            }
        }
        return false;
    }

    public final boolean isInBackStack() {
        return this.mBackStackNesting > 0;
    }

    public final boolean isInLayout() {
        return this.mInLayout;
    }

    public final boolean isMenuVisible() {
        if (!this.mMenuVisible) {
            return false;
        }
        if (this.mFragmentManager != null) {
            G g6 = this.mParentFragment;
            if (!(g6 == null ? true : g6.isMenuVisible())) {
                return false;
            }
        }
        return true;
    }

    public boolean isPostponed() {
        C c6 = this.mAnimationInfo;
        if (c6 == null) {
            return false;
        }
        return c6.f11506s;
    }

    public final boolean isRemoving() {
        return this.mRemoving;
    }

    public final boolean isResumed() {
        return this.mState >= 7;
    }

    public final boolean isStateSaved() {
        AbstractC1050g0 abstractC1050g0 = this.mFragmentManager;
        if (abstractC1050g0 == null) {
            return false;
        }
        return abstractC1050g0.f11595F || abstractC1050g0.f11596G;
    }

    public final boolean isVisible() {
        View view;
        return (!isAdded() || isHidden() || (view = this.mView) == null || view.getWindowToken() == null || this.mView.getVisibility() != 0) ? false : true;
    }

    public void noteStateNotSaved() {
        this.mChildFragmentManager.M();
    }

    @Deprecated
    public void onActivityCreated(Bundle bundle) {
        this.mCalled = true;
    }

    @Deprecated
    public void onActivityResult(int i6, int i7, Intent intent) {
        if (AbstractC1050g0.H(2)) {
            Log.v("FragmentManager", "Fragment " + this + " received the following in onActivityResult(): requestCode: " + i6 + " resultCode: " + i7 + " data: " + intent);
        }
    }

    public void onAttach(Context context) {
        this.mCalled = true;
        S s6 = this.mHost;
        L l = s6 == null ? null : s6.f11539a;
        if (l != null) {
            this.mCalled = false;
            onAttach((Activity) l);
        }
    }

    @Deprecated
    public void onAttachFragment(G g6) {
    }

    @Override // android.content.ComponentCallbacks
    public void onConfigurationChanged(Configuration configuration) {
        this.mCalled = true;
    }

    public boolean onContextItemSelected(MenuItem menuItem) {
        return false;
    }

    public void onCreate(Bundle bundle) {
        this.mCalled = true;
        restoreChildFragmentState();
        AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
        if (abstractC1050g0.f11622t >= 1) {
            return;
        }
        abstractC1050g0.f11595F = false;
        abstractC1050g0.f11596G = false;
        abstractC1050g0.f11602M.setIsStateSaved(false);
        abstractC1050g0.t(1);
    }

    public Animation onCreateAnimation(int i6, boolean z6, int i7) {
        return null;
    }

    public Animator onCreateAnimator(int i6, boolean z6, int i7) {
        return null;
    }

    @Override // android.view.View.OnCreateContextMenuListener
    public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
        requireActivity().onCreateContextMenu(contextMenu, view, contextMenuInfo);
    }

    @Deprecated
    public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
    }

    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        int i6 = this.mContentLayoutId;
        if (i6 != 0) {
            return layoutInflater.inflate(i6, viewGroup, false);
        }
        return null;
    }

    public void onDestroy() {
        this.mCalled = true;
    }

    @Deprecated
    public void onDestroyOptionsMenu() {
    }

    public void onDestroyView() {
        this.mCalled = true;
    }

    public void onDetach() {
        this.mCalled = true;
    }

    public LayoutInflater onGetLayoutInflater(Bundle bundle) {
        return getLayoutInflater(bundle);
    }

    public void onHiddenChanged(boolean z6) {
    }

    public void onInflate(Context context, AttributeSet attributeSet, Bundle bundle) {
        this.mCalled = true;
        S s6 = this.mHost;
        L l = s6 == null ? null : s6.f11539a;
        if (l != null) {
            this.mCalled = false;
            onInflate((Activity) l, attributeSet, bundle);
        }
    }

    @Override // android.content.ComponentCallbacks
    public void onLowMemory() {
        this.mCalled = true;
    }

    public void onMultiWindowModeChanged(boolean z6) {
    }

    @Deprecated
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        return false;
    }

    @Deprecated
    public void onOptionsMenuClosed(Menu menu) {
    }

    public void onPause() {
        this.mCalled = true;
    }

    public void onPictureInPictureModeChanged(boolean z6) {
    }

    @Deprecated
    public void onPrepareOptionsMenu(Menu menu) {
    }

    public void onPrimaryNavigationFragmentChanged(boolean z6) {
    }

    @Deprecated
    public void onRequestPermissionsResult(int i6, String[] strArr, int[] iArr) {
    }

    public void onResume() {
        this.mCalled = true;
    }

    public void onSaveInstanceState(Bundle bundle) {
    }

    public void onStart() {
        this.mCalled = true;
    }

    public void onStop() {
        this.mCalled = true;
    }

    public void onViewCreated(View view, Bundle bundle) {
    }

    public void onViewStateRestored(Bundle bundle) {
        this.mCalled = true;
    }

    public void performActivityCreated(Bundle bundle) {
        this.mChildFragmentManager.M();
        this.mState = 3;
        this.mCalled = false;
        onActivityCreated(bundle);
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onActivityCreated()"));
        }
        if (AbstractC1050g0.H(3)) {
            Log.d("FragmentManager", "moveto RESTORE_VIEW_STATE: " + this);
        }
        if (this.mView != null) {
            Bundle bundle2 = this.mSavedFragmentState;
            restoreViewState(bundle2 != null ? bundle2.getBundle("savedInstanceState") : null);
        }
        this.mSavedFragmentState = null;
        AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
        abstractC1050g0.f11595F = false;
        abstractC1050g0.f11596G = false;
        abstractC1050g0.f11602M.setIsStateSaved(false);
        abstractC1050g0.t(4);
    }

    public void performAttach() {
        Iterator<D> it = this.mOnPreAttachedListeners.iterator();
        while (it.hasNext()) {
            it.next().a();
        }
        this.mOnPreAttachedListeners.clear();
        this.mChildFragmentManager.b(this.mHost, createFragmentContainer(), this);
        this.mState = 0;
        this.mCalled = false;
        onAttach((Context) this.mHost.f11540b);
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onAttach()"));
        }
        Iterator it2 = this.mFragmentManager.f11616n.iterator();
        while (it2.hasNext()) {
            ((l0) it2.next()).a(this);
        }
        AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
        abstractC1050g0.f11595F = false;
        abstractC1050g0.f11596G = false;
        abstractC1050g0.f11602M.setIsStateSaved(false);
        abstractC1050g0.t(0);
    }

    public void performConfigurationChanged(Configuration configuration) {
        onConfigurationChanged(configuration);
    }

    public boolean performContextItemSelected(MenuItem menuItem) {
        if (this.mHidden) {
            return false;
        }
        if (onContextItemSelected(menuItem)) {
            return true;
        }
        return this.mChildFragmentManager.i(menuItem);
    }

    public void performCreate(Bundle bundle) {
        this.mChildFragmentManager.M();
        this.mState = 1;
        this.mCalled = false;
        this.mLifecycleRegistry.addObserver(new C1068z(this));
        onCreate(bundle);
        this.mIsCreated = true;
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onCreate()"));
        }
        this.mLifecycleRegistry.c(EnumC1107p.ON_CREATE);
    }

    public boolean performCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
        boolean z6 = false;
        if (this.mHidden) {
            return false;
        }
        if (this.mHasMenu && this.mMenuVisible) {
            onCreateOptionsMenu(menu, menuInflater);
            z6 = true;
        }
        return this.mChildFragmentManager.j(menu, menuInflater) | z6;
    }

    public void performCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.mChildFragmentManager.M();
        this.mPerformedCreateView = true;
        this.mViewLifecycleOwner = new A0(this, getViewModelStore(), new RunnableC1063u(this, 0));
        View viewOnCreateView = onCreateView(layoutInflater, viewGroup, bundle);
        this.mView = viewOnCreateView;
        if (viewOnCreateView == null) {
            if (this.mViewLifecycleOwner.f11480e != null) {
                throw new IllegalStateException("Called getViewLifecycleOwner() but onCreateView() returned null");
            }
            this.mViewLifecycleOwner = null;
            return;
        }
        this.mViewLifecycleOwner.b();
        if (AbstractC1050g0.H(3)) {
            Log.d("FragmentManager", "Setting ViewLifecycleOwner on View " + this.mView + " for Fragment " + this);
        }
        androidx.lifecycle.X.i(this.mView, this.mViewLifecycleOwner);
        androidx.lifecycle.X.j(this.mView, this.mViewLifecycleOwner);
        AbstractC2478m.p(this.mView, this.mViewLifecycleOwner);
        this.mViewLifecycleOwnerLiveData.h(this.mViewLifecycleOwner);
    }

    public void performDestroy() {
        this.mChildFragmentManager.k();
        this.mLifecycleRegistry.c(EnumC1107p.ON_DESTROY);
        this.mState = 0;
        this.mCalled = false;
        this.mIsCreated = false;
        onDestroy();
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onDestroy()"));
        }
    }

    public void performDestroyView() {
        this.mChildFragmentManager.t(1);
        if (this.mView != null) {
            A0 a02 = this.mViewLifecycleOwner;
            a02.b();
            if (a02.f11480e.f12191c.compareTo(EnumC1108q.f12182c) >= 0) {
                this.mViewLifecycleOwner.a(EnumC1107p.ON_DESTROY);
            }
        }
        this.mState = 1;
        this.mCalled = false;
        onDestroyView();
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onDestroyView()"));
        }
        androidx.loader.app.b.a(this).d();
        this.mPerformedCreateView = false;
    }

    public void performDetach() {
        this.mState = -1;
        this.mCalled = false;
        onDetach();
        this.mLayoutInflater = null;
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onDetach()"));
        }
        AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
        if (abstractC1050g0.f11597H) {
            return;
        }
        abstractC1050g0.k();
        this.mChildFragmentManager = new h0();
    }

    public LayoutInflater performGetLayoutInflater(Bundle bundle) {
        LayoutInflater layoutInflaterOnGetLayoutInflater = onGetLayoutInflater(bundle);
        this.mLayoutInflater = layoutInflaterOnGetLayoutInflater;
        return layoutInflaterOnGetLayoutInflater;
    }

    public void performLowMemory() {
        onLowMemory();
    }

    public void performMultiWindowModeChanged(boolean z6) {
        onMultiWindowModeChanged(z6);
    }

    public boolean performOptionsItemSelected(MenuItem menuItem) {
        if (this.mHidden) {
            return false;
        }
        if (this.mHasMenu && this.mMenuVisible && onOptionsItemSelected(menuItem)) {
            return true;
        }
        return this.mChildFragmentManager.o(menuItem);
    }

    public void performOptionsMenuClosed(Menu menu) {
        if (this.mHidden) {
            return;
        }
        if (this.mHasMenu && this.mMenuVisible) {
            onOptionsMenuClosed(menu);
        }
        this.mChildFragmentManager.p(menu);
    }

    public void performPause() {
        this.mChildFragmentManager.t(5);
        if (this.mView != null) {
            this.mViewLifecycleOwner.a(EnumC1107p.ON_PAUSE);
        }
        this.mLifecycleRegistry.c(EnumC1107p.ON_PAUSE);
        this.mState = 6;
        this.mCalled = false;
        onPause();
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onPause()"));
        }
    }

    public void performPictureInPictureModeChanged(boolean z6) {
        onPictureInPictureModeChanged(z6);
    }

    public boolean performPrepareOptionsMenu(Menu menu) {
        boolean z6 = false;
        if (this.mHidden) {
            return false;
        }
        if (this.mHasMenu && this.mMenuVisible) {
            onPrepareOptionsMenu(menu);
            z6 = true;
        }
        return this.mChildFragmentManager.s(menu) | z6;
    }

    public void performPrimaryNavigationFragmentChanged() {
        this.mFragmentManager.getClass();
        boolean zK = AbstractC1050g0.K(this);
        Boolean bool = this.mIsPrimaryNavigationFragment;
        if (bool == null || bool.booleanValue() != zK) {
            this.mIsPrimaryNavigationFragment = Boolean.valueOf(zK);
            onPrimaryNavigationFragmentChanged(zK);
            AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
            abstractC1050g0.b0();
            abstractC1050g0.q(abstractC1050g0.f11626x);
        }
    }

    public void performResume() {
        this.mChildFragmentManager.M();
        this.mChildFragmentManager.x(true);
        this.mState = 7;
        this.mCalled = false;
        onResume();
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onResume()"));
        }
        C1115y c1115y = this.mLifecycleRegistry;
        EnumC1107p enumC1107p = EnumC1107p.ON_RESUME;
        c1115y.c(enumC1107p);
        if (this.mView != null) {
            this.mViewLifecycleOwner.f11480e.c(enumC1107p);
        }
        AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
        abstractC1050g0.f11595F = false;
        abstractC1050g0.f11596G = false;
        abstractC1050g0.f11602M.setIsStateSaved(false);
        abstractC1050g0.t(7);
    }

    public void performSaveInstanceState(Bundle bundle) {
        onSaveInstanceState(bundle);
    }

    public void performStart() {
        this.mChildFragmentManager.M();
        this.mChildFragmentManager.x(true);
        this.mState = 5;
        this.mCalled = false;
        onStart();
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onStart()"));
        }
        C1115y c1115y = this.mLifecycleRegistry;
        EnumC1107p enumC1107p = EnumC1107p.ON_START;
        c1115y.c(enumC1107p);
        if (this.mView != null) {
            this.mViewLifecycleOwner.f11480e.c(enumC1107p);
        }
        AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
        abstractC1050g0.f11595F = false;
        abstractC1050g0.f11596G = false;
        abstractC1050g0.f11602M.setIsStateSaved(false);
        abstractC1050g0.t(5);
    }

    public void performStop() {
        AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
        abstractC1050g0.f11596G = true;
        abstractC1050g0.f11602M.setIsStateSaved(true);
        abstractC1050g0.t(4);
        if (this.mView != null) {
            this.mViewLifecycleOwner.a(EnumC1107p.ON_STOP);
        }
        this.mLifecycleRegistry.c(EnumC1107p.ON_STOP);
        this.mState = 4;
        this.mCalled = false;
        onStop();
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onStop()"));
        }
    }

    public void performViewCreated() {
        Bundle bundle = this.mSavedFragmentState;
        onViewCreated(this.mView, bundle != null ? bundle.getBundle("savedInstanceState") : null);
        this.mChildFragmentManager.t(2);
    }

    public void postponeEnterTransition() {
        a().f11506s = true;
    }

    @Override // g.InterfaceC2049c
    public final <I, O> AbstractC2050d registerForActivityResult(AbstractC2068b abstractC2068b, InterfaceC2048b interfaceC2048b) {
        return e(abstractC2068b, new A(this, 0), interfaceC2048b);
    }

    public void registerForContextMenu(View view) {
        view.setOnCreateContextMenuListener(this);
    }

    @Deprecated
    public final void requestPermissions(String[] strArr, int i6) {
        if (this.mHost == null) {
            throw new IllegalStateException(Z0.o.m("Fragment ", this, " not attached to Activity"));
        }
        AbstractC1050g0 parentFragmentManager = getParentFragmentManager();
        if (parentFragmentManager.f11592C == null) {
            parentFragmentManager.f11623u.getClass();
            return;
        }
        parentFragmentManager.f11593D.addLast(new C1044d0(this.mWho, i6));
        parentFragmentManager.f11592C.a(strArr);
    }

    public final L requireActivity() {
        L activity = getActivity();
        if (activity != null) {
            return activity;
        }
        throw new IllegalStateException(Z0.o.m("Fragment ", this, " not attached to an activity."));
    }

    public final Bundle requireArguments() {
        Bundle arguments = getArguments();
        if (arguments != null) {
            return arguments;
        }
        throw new IllegalStateException(Z0.o.m("Fragment ", this, " does not have any arguments."));
    }

    public final Context requireContext() {
        Context context = getContext();
        if (context != null) {
            return context;
        }
        throw new IllegalStateException(Z0.o.m("Fragment ", this, " not attached to a context."));
    }

    @Deprecated
    public final AbstractC1050g0 requireFragmentManager() {
        return getParentFragmentManager();
    }

    public final Object requireHost() {
        Object host = getHost();
        if (host != null) {
            return host;
        }
        throw new IllegalStateException(Z0.o.m("Fragment ", this, " not attached to a host."));
    }

    public final G requireParentFragment() {
        G parentFragment = getParentFragment();
        if (parentFragment != null) {
            return parentFragment;
        }
        if (getContext() == null) {
            throw new IllegalStateException(Z0.o.m("Fragment ", this, " is not attached to any Fragment or host"));
        }
        throw new IllegalStateException("Fragment " + this + " is not a child Fragment, it is directly attached to " + getContext());
    }

    public final View requireView() {
        View view = getView();
        if (view != null) {
            return view;
        }
        throw new IllegalStateException(Z0.o.m("Fragment ", this, " did not return a View from onCreateView() or this was called before onCreateView()."));
    }

    public void restoreChildFragmentState() {
        Bundle bundle;
        Bundle bundle2 = this.mSavedFragmentState;
        if (bundle2 == null || (bundle = bundle2.getBundle("childFragmentManager")) == null) {
            return;
        }
        this.mChildFragmentManager.S(bundle);
        AbstractC1050g0 abstractC1050g0 = this.mChildFragmentManager;
        abstractC1050g0.f11595F = false;
        abstractC1050g0.f11596G = false;
        abstractC1050g0.f11602M.setIsStateSaved(false);
        abstractC1050g0.t(1);
    }

    public final void restoreViewState(Bundle bundle) {
        SparseArray<Parcelable> sparseArray = this.mSavedViewState;
        if (sparseArray != null) {
            this.mView.restoreHierarchyState(sparseArray);
            this.mSavedViewState = null;
        }
        this.mCalled = false;
        onViewStateRestored(bundle);
        if (!this.mCalled) {
            throw new G0(Z0.o.m("Fragment ", this, " did not call through to super.onViewStateRestored()"));
        }
        if (this.mView != null) {
            this.mViewLifecycleOwner.a(EnumC1107p.ON_CREATE);
        }
    }

    public void setAllowEnterTransitionOverlap(boolean z6) {
        a().f11503p = Boolean.valueOf(z6);
    }

    public void setAllowReturnTransitionOverlap(boolean z6) {
        a().f11502o = Boolean.valueOf(z6);
    }

    public void setAnimations(int i6, int i7, int i8, int i9) {
        if (this.mAnimationInfo == null && i6 == 0 && i7 == 0 && i8 == 0 && i9 == 0) {
            return;
        }
        a().f11490b = i6;
        a().f11491c = i7;
        a().f11492d = i8;
        a().f11493e = i9;
    }

    public void setArguments(Bundle bundle) {
        if (this.mFragmentManager != null && isStateSaved()) {
            throw new IllegalStateException("Fragment already added and state has been saved");
        }
        this.mArguments = bundle;
    }

    public void setEnterSharedElementCallback(androidx.core.app.S s6) {
        a().getClass();
    }

    public void setEnterTransition(Object obj) {
        a().f11497i = obj;
    }

    public void setExitSharedElementCallback(androidx.core.app.S s6) {
        a().getClass();
    }

    public void setExitTransition(Object obj) {
        a().f11499k = obj;
    }

    public void setFocusedView(View view) {
        a().f11505r = view;
    }

    @Deprecated
    public void setHasOptionsMenu(boolean z6) {
        if (this.mHasMenu != z6) {
            this.mHasMenu = z6;
            if (!isAdded() || isHidden()) {
                return;
            }
            ((K) this.mHost).f11526e.invalidateMenu();
        }
    }

    public void setInitialSavedState(F f6) {
        Bundle bundle;
        if (this.mFragmentManager != null) {
            throw new IllegalStateException("Fragment already added");
        }
        if (f6 == null || (bundle = f6.f11519a) == null) {
            bundle = null;
        }
        this.mSavedFragmentState = bundle;
    }

    public void setMenuVisibility(boolean z6) {
        if (this.mMenuVisible != z6) {
            this.mMenuVisible = z6;
            if (this.mHasMenu && isAdded() && !isHidden()) {
                ((K) this.mHost).f11526e.invalidateMenu();
            }
        }
    }

    public void setNextTransition(int i6) {
        if (this.mAnimationInfo == null && i6 == 0) {
            return;
        }
        a();
        this.mAnimationInfo.f11494f = i6;
    }

    public void setPopDirection(boolean z6) {
        if (this.mAnimationInfo == null) {
            return;
        }
        a().f11489a = z6;
    }

    public void setPostOnViewCreatedAlpha(float f6) {
        a().f11504q = f6;
    }

    public void setReenterTransition(Object obj) {
        a().l = obj;
    }

    @Deprecated
    public void setRetainInstance(boolean z6) {
        X1.c cVar = X1.d.f8547a;
        X1.d.b(new X1.e(this, "Attempting to set retain instance for fragment " + this));
        X1.d.a(this).getClass();
        this.mRetainInstance = z6;
        AbstractC1050g0 abstractC1050g0 = this.mFragmentManager;
        if (abstractC1050g0 == null) {
            this.mRetainInstanceChangedWhileDetached = true;
        } else if (z6) {
            abstractC1050g0.f11602M.addRetainedFragment(this);
        } else {
            abstractC1050g0.f11602M.removeRetainedFragment(this);
        }
    }

    public void setReturnTransition(Object obj) {
        a().f11498j = obj;
    }

    public void setSharedElementEnterTransition(Object obj) {
        a().f11500m = obj;
    }

    public void setSharedElementNames(ArrayList<String> arrayList, ArrayList<String> arrayList2) {
        a();
        C c6 = this.mAnimationInfo;
        c6.f11495g = arrayList;
        c6.f11496h = arrayList2;
    }

    public void setSharedElementReturnTransition(Object obj) {
        a().f11501n = obj;
    }

    @Deprecated
    public void setTargetFragment(G g6, int i6) {
        if (g6 != null) {
            X1.c cVar = X1.d.f8547a;
            X1.d.b(new X1.f(this, "Attempting to set target fragment " + g6 + " with request code " + i6 + " for fragment " + this));
            X1.d.a(this).getClass();
        }
        AbstractC1050g0 abstractC1050g0 = this.mFragmentManager;
        AbstractC1050g0 abstractC1050g02 = g6 != null ? g6.mFragmentManager : null;
        if (abstractC1050g0 != null && abstractC1050g02 != null && abstractC1050g0 != abstractC1050g02) {
            throw new IllegalArgumentException(Z0.o.m("Fragment ", g6, " must share the same FragmentManager to be set as a target fragment"));
        }
        for (G gC = g6; gC != null; gC = gC.c(false)) {
            if (gC.equals(this)) {
                throw new IllegalArgumentException("Setting " + g6 + " as the target of " + this + " would create a target cycle");
            }
        }
        if (g6 == null) {
            this.mTargetWho = null;
            this.mTarget = null;
        } else if (this.mFragmentManager == null || g6.mFragmentManager == null) {
            this.mTargetWho = null;
            this.mTarget = g6;
        } else {
            this.mTargetWho = g6.mWho;
            this.mTarget = null;
        }
        this.mTargetRequestCode = i6;
    }

    @Deprecated
    public void setUserVisibleHint(boolean z6) {
        X1.c cVar = X1.d.f8547a;
        X1.d.b(new X1.a(this, "Attempting to set user visible hint to " + z6 + " for fragment " + this));
        X1.d.a(this).getClass();
        boolean z7 = false;
        if (!this.mUserVisibleHint && z6 && this.mState < 5 && this.mFragmentManager != null && isAdded() && this.mIsCreated) {
            AbstractC1050g0 abstractC1050g0 = this.mFragmentManager;
            o0 o0VarF = abstractC1050g0.f(this);
            G g6 = o0VarF.f11684c;
            if (g6.mDeferStart) {
                if (abstractC1050g0.f11605b) {
                    abstractC1050g0.f11598I = true;
                } else {
                    g6.mDeferStart = false;
                    o0VarF.k();
                }
            }
        }
        this.mUserVisibleHint = z6;
        if (this.mState < 5 && !z6) {
            z7 = true;
        }
        this.mDeferStart = z7;
        if (this.mSavedFragmentState != null) {
            this.mSavedUserVisibleHint = Boolean.valueOf(z6);
        }
    }

    public boolean shouldShowRequestPermissionRationale(String str) {
        S s6 = this.mHost;
        if (s6 == null) {
            return false;
        }
        K k6 = (K) s6;
        int i6 = Build.VERSION.SDK_INT;
        if (i6 < 33) {
            k6.getClass();
            if (TextUtils.equals("android.permission.POST_NOTIFICATIONS", str)) {
                return false;
            }
        }
        L l = k6.f11526e;
        if (i6 >= 32) {
            return l.shouldShowRequestPermissionRationale(str);
        }
        if (i6 != 31) {
            return l.shouldShowRequestPermissionRationale(str);
        }
        try {
            return ((Boolean) PackageManager.class.getMethod("shouldShowRequestPermissionRationale", String.class).invoke(l.getApplication().getPackageManager(), str)).booleanValue();
        } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException unused) {
            return l.shouldShowRequestPermissionRationale(str);
        }
    }

    public void startActivity(Intent intent) {
        startActivity(intent, null);
    }

    @Deprecated
    public void startActivityForResult(Intent intent, int i6) {
        startActivityForResult(intent, i6, null);
    }

    @Deprecated
    public void startIntentSenderForResult(IntentSender intentSender, int i6, Intent intent, int i7, int i8, int i9, Bundle bundle) {
        if (this.mHost == null) {
            throw new IllegalStateException(Z0.o.m("Fragment ", this, " not attached to Activity"));
        }
        if (AbstractC1050g0.H(2)) {
            Log.v("FragmentManager", "Fragment " + this + " received the following in startIntentSenderForResult() requestCode: " + i6 + " IntentSender: " + intentSender + " fillInIntent: " + intent + " options: " + bundle);
        }
        AbstractC1050g0 parentFragmentManager = getParentFragmentManager();
        if (parentFragmentManager.f11591B == null) {
            S s6 = parentFragmentManager.f11623u;
            if (i6 == -1) {
                s6.f11539a.startIntentSenderForResult(intentSender, i6, intent, i7, i8, i9, bundle);
                return;
            } else {
                s6.getClass();
                throw new IllegalStateException("Starting intent sender with a requestCode requires a FragmentActivity host");
            }
        }
        if (bundle != null) {
            if (intent == null) {
                intent = new Intent();
                intent.putExtra("androidx.fragment.extra.ACTIVITY_OPTIONS_BUNDLE", true);
            }
            if (AbstractC1050g0.H(2)) {
                Log.v("FragmentManager", "ActivityOptions " + bundle + " were added to fillInIntent " + intent + " for fragment " + this);
            }
            intent.putExtra("androidx.activity.result.contract.extra.ACTIVITY_OPTIONS_BUNDLE", bundle);
        }
        kotlin.jvm.internal.o.h(intentSender, "intentSender");
        C2057k c2057k = new C2057k(intentSender, intent, i7, i8);
        parentFragmentManager.f11593D.addLast(new C1044d0(this.mWho, i6));
        if (AbstractC1050g0.H(2)) {
            Log.v("FragmentManager", "Fragment " + this + "is launching an IntentSender for result ");
        }
        parentFragmentManager.f11591B.a(c2057k);
    }

    public void startPostponedEnterTransition() {
        if (this.mAnimationInfo == null || !a().f11506s) {
            return;
        }
        if (this.mHost == null) {
            a().f11506s = false;
        } else if (Looper.myLooper() != this.mHost.f11541c.getLooper()) {
            this.mHost.f11541c.postAtFrontOfQueue(new RunnableC1065w(this, 1));
        } else {
            callStartTransitionListener(true);
        }
    }

    public String toString() {
        StringBuilder sb = new StringBuilder(128);
        sb.append(getClass().getSimpleName());
        sb.append("{");
        sb.append(Integer.toHexString(System.identityHashCode(this)));
        sb.append("} (");
        sb.append(this.mWho);
        if (this.mFragmentId != 0) {
            sb.append(" id=0x");
            sb.append(Integer.toHexString(this.mFragmentId));
        }
        if (this.mTag != null) {
            sb.append(" tag=");
            sb.append(this.mTag);
        }
        sb.append(")");
        return sb.toString();
    }

    public void unregisterForContextMenu(View view) {
        view.setOnCreateContextMenuListener(null);
    }

    @Deprecated
    public static G instantiate(Context context, String str, Bundle bundle) {
        try {
            G g6 = (G) Z.b(str, context.getClassLoader()).getConstructor(new Class[0]).newInstance(new Object[0]);
            if (bundle == null) {
                return g6;
            }
            bundle.setClassLoader(g6.getClass().getClassLoader());
            g6.setArguments(bundle);
            return g6;
        } catch (IllegalAccessException e6) {
            throw new E3.v(Z0.o.o("Unable to instantiate fragment ", str, ": make sure class name exists, is public, and has an empty constructor that is public"), e6);
        } catch (InstantiationException e7) {
            throw new E3.v(Z0.o.o("Unable to instantiate fragment ", str, ": make sure class name exists, is public, and has an empty constructor that is public"), e7);
        } catch (NoSuchMethodException e8) {
            throw new E3.v(Z0.o.o("Unable to instantiate fragment ", str, ": could not find Fragment constructor"), e8);
        } catch (InvocationTargetException e9) {
            throw new E3.v(Z0.o.o("Unable to instantiate fragment ", str, ": calling Fragment constructor caused an exception"), e9);
        }
    }

    public final String getString(int i6, Object... objArr) {
        return getResources().getString(i6, objArr);
    }

    public final void postponeEnterTransition(long j4, TimeUnit timeUnit) {
        a().f11506s = true;
        Handler handler = this.mPostponedHandler;
        if (handler != null) {
            handler.removeCallbacks(this.mPostponedDurationRunnable);
        }
        AbstractC1050g0 abstractC1050g0 = this.mFragmentManager;
        if (abstractC1050g0 != null) {
            this.mPostponedHandler = abstractC1050g0.f11623u.f11541c;
        } else {
            this.mPostponedHandler = new Handler(Looper.getMainLooper());
        }
        this.mPostponedHandler.removeCallbacks(this.mPostponedDurationRunnable);
        this.mPostponedHandler.postDelayed(this.mPostponedDurationRunnable, timeUnit.toMillis(j4));
    }

    public final <I, O> AbstractC2050d registerForActivityResult(AbstractC2068b abstractC2068b, AbstractC2055i abstractC2055i, InterfaceC2048b interfaceC2048b) {
        return e(abstractC2068b, new A(abstractC2055i, 2), interfaceC2048b);
    }

    public void startActivity(Intent intent, Bundle bundle) {
        S s6 = this.mHost;
        if (s6 == null) {
            throw new IllegalStateException(Z0.o.m("Fragment ", this, " not attached to Activity"));
        }
        AbstractC3209a.startActivity(s6.f11540b, intent, bundle);
    }

    @Deprecated
    public void startActivityForResult(Intent intent, int i6, Bundle bundle) {
        if (this.mHost == null) {
            throw new IllegalStateException(Z0.o.m("Fragment ", this, " not attached to Activity"));
        }
        AbstractC1050g0 parentFragmentManager = getParentFragmentManager();
        if (parentFragmentManager.f11590A != null) {
            parentFragmentManager.f11593D.addLast(new C1044d0(this.mWho, i6));
            if (bundle != null) {
                intent.putExtra("androidx.activity.result.contract.extra.ACTIVITY_OPTIONS_BUNDLE", bundle);
            }
            parentFragmentManager.f11590A.a(intent);
            return;
        }
        S s6 = parentFragmentManager.f11623u;
        if (i6 == -1) {
            AbstractC3209a.startActivity(s6.f11540b, intent, bundle);
        } else {
            s6.getClass();
            throw new IllegalStateException("Starting activity with a requestCode requires a FragmentActivity host");
        }
    }

    @Deprecated
    public LayoutInflater getLayoutInflater(Bundle bundle) {
        S s6 = this.mHost;
        if (s6 != null) {
            L l = ((K) s6).f11526e;
            LayoutInflater layoutInflaterCloneInContext = l.getLayoutInflater().cloneInContext(l);
            layoutInflaterCloneInContext.setFactory2(this.mChildFragmentManager.f11609f);
            return layoutInflaterCloneInContext;
        }
        throw new IllegalStateException("onGetLayoutInflater() cannot be executed until the Fragment is attached to the FragmentManager.");
    }

    @Deprecated
    public void onAttach(Activity activity) {
        this.mCalled = true;
    }

    @Deprecated
    public void onInflate(Activity activity, AttributeSet attributeSet, Bundle bundle) {
        this.mCalled = true;
    }
}
