package c8;

import ca.canadapost.core.data.flex.model.FlexLocation;
import kotlin.jvm.internal.t;

/* loaded from: classes.dex */
public abstract class b {
    public static final c a(FlexLocation.FlexLocationItem item) {
        t.g(item, "item");
        c cVar = c.GENERIC_LOCATION;
        FlexLocation.FlexLocationItem.Apl apl = item.getApl();
        FlexLocation.FlexLocationItem.Flex flex = item.getFlex();
        if (apl == null || flex == null) {
            return apl != null ? apl.isSaved() ? c.APL_ADDRESS_ADDED : cVar : (flex == null || !flex.isSaved()) ? cVar : c.FLEX_ADDRESS_ADDED;
        }
        return (apl.isSaved() && flex.isSaved()) ? c.FLEX_APL_BOTH_ADDED_LOCATION : apl.isSaved() ? c.FLEX_NOT_APL_ADDED_LOCATION : flex.isSaved() ? c.FLEX_ADDED_APL_NOT_LOCATION : c.FLEX_APL_LOCATION;
    }

    public static final c b(FlexLocation.FlexLocationItem item) {
        t.g(item, "item");
        c cVar = c.NONE;
        FlexLocation.FlexLocationItem.Apl apl = item.getApl();
        FlexLocation.FlexLocationItem.Flex flex = item.getFlex();
        return (apl == null || flex == null) ? (flex == null || flex.isSaved()) ? (flex == null && apl == null) ? c.GENERIC_LOCATION_SELECTED : cVar : c.GENERIC_LOCATION_SELECTED : (apl.isSaved() || flex.isSaved()) ? cVar : c.FLEX_APL_LOCATION_SELECTED;
    }
}
