package c.a.a.e.a; import android.content.Context; import com.discord.app.AppViewModel; import com.discord.stores.StoreAudioDevices; import com.discord.stores.StoreAudioManagerV2; import com.discord.stores.StoreStream; import com.discord.utilities.rx.ObservableExtensionsKt; import d0.z.d.m; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; import rx.Observable; /* compiled from: AudioOutputSelectionDialogViewModel.kt */ public final class f extends AppViewModel { public static final a i = new a(null); public final StoreAudioDevices j; public final StoreAudioManagerV2 k; /* compiled from: AudioOutputSelectionDialogViewModel.kt */ public static final class a { public a(DefaultConstructorMarker defaultConstructorMarker) { } } /* compiled from: AudioOutputSelectionDialogViewModel.kt */ public static final class b { public final StoreAudioDevices.AudioDevicesState a; public b(StoreAudioDevices.AudioDevicesState audioDevicesState) { m.checkNotNullParameter(audioDevicesState, "audioDevicesState"); this.a = audioDevicesState; } public boolean equals(Object obj) { if (this != obj) { return (obj instanceof b) && m.areEqual(this.a, ((b) obj).a); } return true; } public int hashCode() { StoreAudioDevices.AudioDevicesState audioDevicesState = this.a; if (audioDevicesState != null) { return audioDevicesState.hashCode(); } return 0; } public String toString() { StringBuilder K = c.d.b.a.a.K("StoreState(audioDevicesState="); K.append(this.a); K.append(")"); return K.toString(); } } /* compiled from: AudioOutputSelectionDialogViewModel.kt */ public static abstract class c { /* compiled from: AudioOutputSelectionDialogViewModel.kt */ public static final class a extends c { public final StoreAudioDevices.OutputDevice a; public final boolean b; /* renamed from: c reason: collision with root package name */ public final StoreAudioDevices.OutputDevice.BluetoothAudio f37c; public final boolean d; public final boolean e; public final boolean f; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public a(StoreAudioDevices.OutputDevice outputDevice, boolean z2, StoreAudioDevices.OutputDevice.BluetoothAudio bluetoothAudio, boolean z3, boolean z4, boolean z5) { super(null); m.checkNotNullParameter(outputDevice, "selectedAudioOutput"); this.a = outputDevice; this.b = z2; this.f37c = bluetoothAudio; this.d = z3; this.e = z4; this.f = z5; } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof a)) { return false; } a aVar = (a) obj; return m.areEqual(this.a, aVar.a) && this.b == aVar.b && m.areEqual(this.f37c, aVar.f37c) && this.d == aVar.d && this.e == aVar.e && this.f == aVar.f; } public int hashCode() { StoreAudioDevices.OutputDevice outputDevice = this.a; int i = 0; int hashCode = (outputDevice != null ? outputDevice.hashCode() : 0) * 31; boolean z2 = this.b; int i2 = 1; if (z2) { z2 = true; } int i3 = z2 ? 1 : 0; int i4 = z2 ? 1 : 0; int i5 = z2 ? 1 : 0; int i6 = (hashCode + i3) * 31; StoreAudioDevices.OutputDevice.BluetoothAudio bluetoothAudio = this.f37c; if (bluetoothAudio != null) { i = bluetoothAudio.hashCode(); } int i7 = (i6 + i) * 31; boolean z3 = this.d; if (z3) { z3 = true; } int i8 = z3 ? 1 : 0; int i9 = z3 ? 1 : 0; int i10 = z3 ? 1 : 0; int i11 = (i7 + i8) * 31; boolean z4 = this.e; if (z4) { z4 = true; } int i12 = z4 ? 1 : 0; int i13 = z4 ? 1 : 0; int i14 = z4 ? 1 : 0; int i15 = (i11 + i12) * 31; boolean z5 = this.f; if (!z5) { i2 = z5 ? 1 : 0; } return i15 + i2; } public String toString() { StringBuilder K = c.d.b.a.a.K("Loaded(selectedAudioOutput="); K.append(this.a); K.append(", showBluetoothItem="); K.append(this.b); K.append(", bluetoothDevice="); K.append(this.f37c); K.append(", showSpeakerItem="); K.append(this.d); K.append(", showWiredItem="); K.append(this.e); K.append(", showEarpieceItem="); return c.d.b.a.a.F(K, this.f, ")"); } } /* compiled from: AudioOutputSelectionDialogViewModel.kt */ public static final class b extends c { public static final b a = new b(); public b() { super(null); } } public c() { } public c(DefaultConstructorMarker defaultConstructorMarker) { } } public f() { this(null, null, null, 7); } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public f(StoreAudioDevices storeAudioDevices, StoreAudioManagerV2 storeAudioManagerV2, Observable observable, int i2) { super(c.b.a); Observable observable2; StoreAudioDevices audioDevices = (i2 & 1) != 0 ? StoreStream.Companion.getAudioDevices() : null; StoreAudioManagerV2 audioManagerV2 = (i2 & 2) != 0 ? StoreStream.Companion.getAudioManagerV2() : null; if ((i2 & 4) == 0) { observable2 = null; } else if (audioDevices.getEnabled()) { observable2 = audioDevices.observeAudioDevicesState().F(d.i); m.checkNotNullExpressionValue(observable2, "storeAudioDevices.observ…tate(audioDevicesState) }"); } else { observable2 = audioManagerV2.observeAudioManagerState().F(e.i); m.checkNotNullExpressionValue(observable2, "storeAudioManager.observ….asAudioDevicesState()) }"); } m.checkNotNullParameter(audioDevices, "storeAudioDevices"); m.checkNotNullParameter(audioManagerV2, "storeAudioManager"); m.checkNotNullParameter(observable2, "storeStateObservable"); this.j = audioDevices; this.k = audioManagerV2; ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable2), this, null, 2, null), f.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new c(this), 62, (Object) null); } }