forked from Juby210/discord-jadx
227 lines
8.3 KiB
Java
227 lines
8.3 KiB
Java
package c.a.a.c;
|
|
|
|
import android.content.Context;
|
|
import com.discord.app.AppViewModel;
|
|
import com.discord.models.domain.ModelSubscription;
|
|
import com.discord.stores.StorePremiumGuildSubscription;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.stores.StoreSubscriptions;
|
|
import com.discord.utilities.analytics.Traits;
|
|
import com.discord.utilities.rest.RestAPI;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import d0.z.d.m;
|
|
import java.util.Objects;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import rx.Observable;
|
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
|
public final class k extends AppViewModel<c> {
|
|
public static final a j = new a(null);
|
|
public final long k;
|
|
public final StoreSubscriptions l;
|
|
public final StorePremiumGuildSubscription m;
|
|
public final RestAPI n;
|
|
|
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
|
public static final class b {
|
|
public final StoreSubscriptions.SubscriptionsState a;
|
|
|
|
public b(StoreSubscriptions.SubscriptionsState subscriptionsState) {
|
|
m.checkNotNullParameter(subscriptionsState, "subscriptionState");
|
|
this.a = subscriptionsState;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof b) && m.areEqual(this.a, ((b) obj).a);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public int hashCode() {
|
|
StoreSubscriptions.SubscriptionsState subscriptionsState = this.a;
|
|
if (subscriptionsState != null) {
|
|
return subscriptionsState.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = c.d.b.a.a.R("StoreState(subscriptionState=");
|
|
R.append(this.a);
|
|
R.append(")");
|
|
return R.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
|
public static abstract class c {
|
|
|
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
|
public static final class a extends c {
|
|
public final Integer a;
|
|
|
|
public a() {
|
|
this(null, 1);
|
|
}
|
|
|
|
public a(Integer num) {
|
|
super(null);
|
|
this.a = num;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ a(Integer num, int i) {
|
|
this(null);
|
|
int i2 = i & 1;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof a) && m.areEqual(this.a, ((a) obj).a);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public int hashCode() {
|
|
Integer num = this.a;
|
|
if (num != null) {
|
|
return num.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
return c.d.b.a.a.E(c.d.b.a.a.R("Dismiss(errorToastStringResId="), this.a, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
|
public static final class b extends c {
|
|
public final ModelSubscription a;
|
|
public final boolean b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final boolean f38c;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public b(ModelSubscription modelSubscription, boolean z2, boolean z3) {
|
|
super(null);
|
|
m.checkNotNullParameter(modelSubscription, Traits.Payment.Type.SUBSCRIPTION);
|
|
this.a = modelSubscription;
|
|
this.b = z2;
|
|
this.f38c = z3;
|
|
}
|
|
|
|
public static b a(b bVar, ModelSubscription modelSubscription, boolean z2, boolean z3, int i) {
|
|
ModelSubscription modelSubscription2 = (i & 1) != 0 ? bVar.a : null;
|
|
if ((i & 2) != 0) {
|
|
z2 = bVar.b;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
z3 = bVar.f38c;
|
|
}
|
|
Objects.requireNonNull(bVar);
|
|
m.checkNotNullParameter(modelSubscription2, Traits.Payment.Type.SUBSCRIPTION);
|
|
return new b(modelSubscription2, z2, z3);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof b)) {
|
|
return false;
|
|
}
|
|
b bVar = (b) obj;
|
|
return m.areEqual(this.a, bVar.a) && this.b == bVar.b && this.f38c == bVar.f38c;
|
|
}
|
|
|
|
public int hashCode() {
|
|
ModelSubscription modelSubscription = this.a;
|
|
int hashCode = (modelSubscription != null ? modelSubscription.hashCode() : 0) * 31;
|
|
boolean z2 = this.b;
|
|
int i = 1;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i2 = z2 ? 1 : 0;
|
|
int i3 = z2 ? 1 : 0;
|
|
int i4 = z2 ? 1 : 0;
|
|
int i5 = (hashCode + i2) * 31;
|
|
boolean z3 = this.f38c;
|
|
if (!z3) {
|
|
i = z3 ? 1 : 0;
|
|
}
|
|
return i5 + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = c.d.b.a.a.R("Loaded(subscription=");
|
|
R.append(this.a);
|
|
R.append(", uncancelInProgress=");
|
|
R.append(this.b);
|
|
R.append(", error=");
|
|
return c.d.b.a.a.L(R, this.f38c, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
|
/* renamed from: c.a.a.c.k$c$c reason: collision with other inner class name */
|
|
public static final class C0009c extends c {
|
|
public static final C0009c a = new C0009c();
|
|
|
|
public C0009c() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
|
public static final class d extends c {
|
|
public static final d a = new d();
|
|
|
|
public d() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
public c() {
|
|
}
|
|
|
|
public c(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public k(long j2, StoreSubscriptions storeSubscriptions, StorePremiumGuildSubscription storePremiumGuildSubscription, RestAPI restAPI, Observable observable, int i) {
|
|
super(c.C0009c.a);
|
|
Observable observable2;
|
|
StoreSubscriptions subscriptions = (i & 2) != 0 ? StoreStream.Companion.getSubscriptions() : null;
|
|
StorePremiumGuildSubscription premiumGuildSubscriptions = (i & 4) != 0 ? StoreStream.Companion.getPremiumGuildSubscriptions() : null;
|
|
RestAPI api = (i & 8) != 0 ? RestAPI.Companion.getApi() : null;
|
|
if ((i & 16) != 0) {
|
|
observable2 = subscriptions.observeSubscriptions().F(j.j);
|
|
m.checkNotNullExpressionValue(observable2, "storeSubscriptions\n …toreState(it)\n }");
|
|
} else {
|
|
observable2 = null;
|
|
}
|
|
m.checkNotNullParameter(subscriptions, "storeSubscriptions");
|
|
m.checkNotNullParameter(premiumGuildSubscriptions, "storePremiumGuildSubscription");
|
|
m.checkNotNullParameter(api, "restAPI");
|
|
m.checkNotNullParameter(observable2, "storeObservable");
|
|
this.k = j2;
|
|
this.l = subscriptions;
|
|
this.m = premiumGuildSubscriptions;
|
|
this.n = api;
|
|
subscriptions.fetchSubscriptions();
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable2), this, null, 2, null), k.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new i(this), 62, (Object) null);
|
|
}
|
|
}
|