322 lines
12 KiB
Java
322 lines
12 KiB
Java
package c.a.a.c;
|
|
|
|
import android.content.Context;
|
|
import androidx.annotation.StringRes;
|
|
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 kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import rx.Observable;
|
|
import rx.functions.Func2;
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
public final class f extends AppViewModel<c> {
|
|
public static final a i = new a(null);
|
|
public final long j;
|
|
public final StorePremiumGuildSubscription k;
|
|
public final StoreSubscriptions l;
|
|
public final RestAPI m;
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
public static final class b {
|
|
public final StorePremiumGuildSubscription.State a;
|
|
public final StoreSubscriptions.SubscriptionsState b;
|
|
|
|
public b(StorePremiumGuildSubscription.State state, StoreSubscriptions.SubscriptionsState subscriptionsState) {
|
|
m.checkNotNullParameter(state, "premiumGuildSubscriptionState");
|
|
m.checkNotNullParameter(subscriptionsState, "subscriptionState");
|
|
this.a = state;
|
|
this.b = subscriptionsState;
|
|
}
|
|
|
|
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) && m.areEqual(this.b, bVar.b);
|
|
}
|
|
|
|
public int hashCode() {
|
|
StorePremiumGuildSubscription.State state = this.a;
|
|
int i = 0;
|
|
int hashCode = (state != null ? state.hashCode() : 0) * 31;
|
|
StoreSubscriptions.SubscriptionsState subscriptionsState = this.b;
|
|
if (subscriptionsState != null) {
|
|
i = subscriptionsState.hashCode();
|
|
}
|
|
return hashCode + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = c.d.b.a.a.K("StoreState(premiumGuildSubscriptionState=");
|
|
K.append(this.a);
|
|
K.append(", subscriptionState=");
|
|
K.append(this.b);
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
public static abstract class c {
|
|
public final boolean a;
|
|
public final boolean b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final boolean f35c;
|
|
public final boolean d;
|
|
public final boolean e;
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
public static final class a extends c {
|
|
public final ModelSubscription f;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public a(ModelSubscription modelSubscription) {
|
|
super(false, true, false, true, false, null);
|
|
m.checkNotNullParameter(modelSubscription, Traits.Payment.Type.SUBSCRIPTION);
|
|
this.f = modelSubscription;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof a) && m.areEqual(this.f, ((a) obj).f);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public int hashCode() {
|
|
ModelSubscription modelSubscription = this.f;
|
|
if (modelSubscription != null) {
|
|
return modelSubscription.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = c.d.b.a.a.K("CancelInProgress(subscription=");
|
|
K.append(this.f);
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
public static final class b extends c {
|
|
public final ModelSubscription f;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public b(ModelSubscription modelSubscription) {
|
|
super(false, false, false, false, true, null);
|
|
m.checkNotNullParameter(modelSubscription, Traits.Payment.Type.SUBSCRIPTION);
|
|
this.f = modelSubscription;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof b) && m.areEqual(this.f, ((b) obj).f);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public int hashCode() {
|
|
ModelSubscription modelSubscription = this.f;
|
|
if (modelSubscription != null) {
|
|
return modelSubscription.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = c.d.b.a.a.K("Cancelled(subscription=");
|
|
K.append(this.f);
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
/* renamed from: c.a.a.c.f$c$c reason: collision with other inner class name */
|
|
public static final class C0008c extends c {
|
|
public final Integer f;
|
|
|
|
public C0008c() {
|
|
this(null, 1);
|
|
}
|
|
|
|
public C0008c(@StringRes Integer num) {
|
|
super(false, false, false, false, true, null);
|
|
this.f = num;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ C0008c(Integer num, int i) {
|
|
this(null);
|
|
int i2 = i & 1;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof C0008c) && m.areEqual(this.f, ((C0008c) obj).f);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public int hashCode() {
|
|
Integer num = this.f;
|
|
if (num != null) {
|
|
return num.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
return c.d.b.a.a.z(c.d.b.a.a.K("Dismiss(dismissStringId="), this.f, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
public static final class d extends c {
|
|
public final ModelSubscription f;
|
|
|
|
public d(ModelSubscription modelSubscription) {
|
|
super(true, true, true, false, true, null);
|
|
this.f = modelSubscription;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof d) && m.areEqual(this.f, ((d) obj).f);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public int hashCode() {
|
|
ModelSubscription modelSubscription = this.f;
|
|
if (modelSubscription != null) {
|
|
return modelSubscription.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = c.d.b.a.a.K("FailureCancelling(subscription=");
|
|
K.append(this.f);
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
public static final class e extends c {
|
|
public final ModelSubscription f;
|
|
public final boolean g;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public e(ModelSubscription modelSubscription, boolean z2) {
|
|
super(false, true, true, false, true, null);
|
|
m.checkNotNullParameter(modelSubscription, Traits.Payment.Type.SUBSCRIPTION);
|
|
this.f = modelSubscription;
|
|
this.g = z2;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof e)) {
|
|
return false;
|
|
}
|
|
e eVar = (e) obj;
|
|
return m.areEqual(this.f, eVar.f) && this.g == eVar.g;
|
|
}
|
|
|
|
public int hashCode() {
|
|
ModelSubscription modelSubscription = this.f;
|
|
int hashCode = (modelSubscription != null ? modelSubscription.hashCode() : 0) * 31;
|
|
boolean z2 = this.g;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i = z2 ? 1 : 0;
|
|
int i2 = z2 ? 1 : 0;
|
|
int i3 = z2 ? 1 : 0;
|
|
return hashCode + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = c.d.b.a.a.K("Loaded(subscription=");
|
|
K.append(this.f);
|
|
K.append(", isFromInventory=");
|
|
return c.d.b.a.a.F(K, this.g, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: PremiumGuildSubscriptionCancelViewModel.kt */
|
|
/* renamed from: c.a.a.c.f$c$f reason: collision with other inner class name */
|
|
public static final class C0009f extends c {
|
|
public static final C0009f f = new C0009f();
|
|
|
|
public C0009f() {
|
|
super(false, true, false, false, true, null);
|
|
}
|
|
}
|
|
|
|
public c(boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this.a = z2;
|
|
this.b = z3;
|
|
this.f35c = z4;
|
|
this.d = z5;
|
|
this.e = z6;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
/* JADX WARNING: Unknown variable types count: 1 */
|
|
public f(long j, StorePremiumGuildSubscription storePremiumGuildSubscription, StoreSubscriptions storeSubscriptions, RestAPI restAPI, Observable observable, int i2) {
|
|
super(c.C0009f.f);
|
|
Observable observable2;
|
|
StorePremiumGuildSubscription premiumGuildSubscriptions = (i2 & 2) != 0 ? StoreStream.Companion.getPremiumGuildSubscriptions() : null;
|
|
StoreSubscriptions subscriptions = (i2 & 4) != 0 ? StoreStream.Companion.getSubscriptions() : null;
|
|
RestAPI api = (i2 & 8) != 0 ? RestAPI.Companion.getApi() : null;
|
|
if ((i2 & 16) != 0) {
|
|
Observable observePremiumGuildSubscriptionsState$default = StorePremiumGuildSubscription.observePremiumGuildSubscriptionsState$default(premiumGuildSubscriptions, null, 1, null);
|
|
Observable<StoreSubscriptions.SubscriptionsState> observeSubscriptions = subscriptions.observeSubscriptions();
|
|
e eVar = e.i;
|
|
observable2 = Observable.j(observePremiumGuildSubscriptionsState$default, observeSubscriptions, (Func2) (eVar != null ? new h(eVar) : eVar));
|
|
m.checkNotNullExpressionValue(observable2, "Observable.combineLatest… ::StoreState\n )");
|
|
} else {
|
|
observable2 = null;
|
|
}
|
|
m.checkNotNullParameter(premiumGuildSubscriptions, "storePremiumGuildSubscription");
|
|
m.checkNotNullParameter(subscriptions, "storeSubscriptions");
|
|
m.checkNotNullParameter(api, "api");
|
|
m.checkNotNullParameter(observable2, "storeObservable");
|
|
this.j = j;
|
|
this.k = premiumGuildSubscriptions;
|
|
this.l = subscriptions;
|
|
this.m = api;
|
|
premiumGuildSubscriptions.fetchUserGuildPremiumState();
|
|
subscriptions.fetchSubscriptions();
|
|
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 d(this), 62, (Object) null);
|
|
}
|
|
}
|