package androidx.view;

import android.os.Bundle;
import androidx.media3.container.NalUnitUtil;
import androidx.view.bc;
import defpackage.cr4;
import defpackage.vw2;
import defpackage.y41;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes.dex */
@bc.b("navigation")
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0017\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001¨\u0006\u0003"}, d2 = {"Landroidx/navigation/au;", "Landroidx/navigation/bc;", "Landroidx/navigation/at;", "navigation-common_release"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public class au extends bc<at> {
    public final bf c;

    public au(bf bfVar) {
        this.c = bfVar;
    }

    @Override // androidx.view.bc
    public final ao a() {
        return new at(this);
    }

    @Override // androidx.view.bc
    public final void d(List list, aw awVar) {
        String strValueOf;
        Iterator it = list.iterator();
        while (it.hasNext()) {
            NavBackStackEntry navBackStackEntry = (NavBackStackEntry) it.next();
            ao aoVar = navBackStackEntry.b;
            cr4.e(aoVar, "null cannot be cast to non-null type androidx.navigation.NavGraph");
            at atVar = (at) aoVar;
            Bundle bundleA = navBackStackEntry.a();
            int i = atVar.n;
            if (i == 0) {
                StringBuilder sb = new StringBuilder("no start destination defined via app:startDestination for ");
                int i2 = atVar.j;
                if (i2 != 0) {
                    strValueOf = atVar.c;
                    if (strValueOf == null) {
                        strValueOf = String.valueOf(i2);
                    }
                } else {
                    strValueOf = "the root navigation";
                }
                sb.append(strValueOf);
                throw new IllegalStateException(sb.toString().toString());
            }
            ao aoVarH = atVar.h(i, false);
            if (aoVarH == null) {
                if (atVar.o == null) {
                    atVar.o = String.valueOf(atVar.n);
                }
                String str = atVar.o;
                cr4.d(str);
                throw new IllegalArgumentException(vw2.ab("navigation destination ", str, " is not a direct child of this NavGraph"));
            }
            this.c.b(aoVarH.a).d(y41.am(b().a(aoVarH, aoVarH.b(bundleA))), awVar);
        }
    }
}
