discord-jadx/app/src/main/java/com/discord/widgets/settings/premium/WidgetChoosePlan$setUpRecyc...

182 lines
10 KiB
Java

package com.discord.widgets.settings.premium;
import android.os.Bundle;
import androidx.fragment.app.FragmentManager;
import c.a.a.e.c;
import c.a.a.e.e;
import com.android.billingclient.api.SkuDetails;
import com.discord.utilities.analytics.AnalyticsTracker;
import com.discord.utilities.analytics.Traits;
import com.discord.utilities.billing.GooglePlaySku;
import d0.z.d.m;
import d0.z.d.o;
import java.util.Objects;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function3;
/* compiled from: WidgetChoosePlan.kt */
public final class WidgetChoosePlan$setUpRecycler$2 extends o implements Function3<GooglePlaySku, String, SkuDetails, Unit> {
public final /* synthetic */ Traits.Location $locationTrait;
public final /* synthetic */ WidgetChoosePlan this$0;
/* compiled from: WidgetChoosePlan.kt */
/* renamed from: com.discord.widgets.settings.premium.WidgetChoosePlan$setUpRecycler$2$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function0<Unit> {
public final /* synthetic */ String $oldSkuName;
public final /* synthetic */ GooglePlaySku $sku;
public final /* synthetic */ WidgetChoosePlan$setUpRecycler$2 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(WidgetChoosePlan$setUpRecycler$2 widgetChoosePlan$setUpRecycler$2, GooglePlaySku googlePlaySku, String str) {
super(0);
this.this$0 = widgetChoosePlan$setUpRecycler$2;
this.$sku = googlePlaySku;
this.$oldSkuName = str;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
WidgetChoosePlan.access$getViewModel$p(this.this$0.this$0).buy(this.$sku, this.$oldSkuName, this.this$0.$locationTrait, "premium_upsell");
}
}
/* compiled from: WidgetChoosePlan.kt */
/* renamed from: com.discord.widgets.settings.premium.WidgetChoosePlan$setUpRecycler$2$2 reason: invalid class name */
public static final class AnonymousClass2 extends o implements Function0<Unit> {
public final /* synthetic */ String $oldSkuName;
public final /* synthetic */ GooglePlaySku $sku;
public final /* synthetic */ WidgetChoosePlan$setUpRecycler$2 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass2(WidgetChoosePlan$setUpRecycler$2 widgetChoosePlan$setUpRecycler$2, GooglePlaySku googlePlaySku, String str) {
super(0);
this.this$0 = widgetChoosePlan$setUpRecycler$2;
this.$sku = googlePlaySku;
this.$oldSkuName = str;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
Traits.Location location = new Traits.Location("Premium Upsell Modal", "Premium Upsell Modal", null, null, null, 28, null);
AnalyticsTracker.paymentFlowStarted$default(AnalyticsTracker.INSTANCE, location, Traits.Subscription.Companion.withGatewayPlanId(this.$sku.getUpgrade().getSkuName()), null, null, 12, null);
WidgetChoosePlan.access$getViewModel$p(this.this$0.this$0).buy(this.$sku.getUpgrade(), this.$oldSkuName, location, "premium_upsell");
}
}
/* compiled from: WidgetChoosePlan.kt */
/* renamed from: com.discord.widgets.settings.premium.WidgetChoosePlan$setUpRecycler$2$3 reason: invalid class name */
public static final class AnonymousClass3 extends o implements Function0<Unit> {
public final /* synthetic */ String $oldSkuName;
public final /* synthetic */ GooglePlaySku $sku;
public final /* synthetic */ WidgetChoosePlan$setUpRecycler$2 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass3(WidgetChoosePlan$setUpRecycler$2 widgetChoosePlan$setUpRecycler$2, GooglePlaySku googlePlaySku, String str) {
super(0);
this.this$0 = widgetChoosePlan$setUpRecycler$2;
this.$sku = googlePlaySku;
this.$oldSkuName = str;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
WidgetChoosePlan.access$getViewModel$p(this.this$0.this$0).buy(this.$sku, this.$oldSkuName, this.this$0.$locationTrait, "yearly_upsell");
}
}
/* compiled from: WidgetChoosePlan.kt */
/* renamed from: com.discord.widgets.settings.premium.WidgetChoosePlan$setUpRecycler$2$4 reason: invalid class name */
public static final class AnonymousClass4 extends o implements Function0<Unit> {
public final /* synthetic */ String $oldSkuName;
public final /* synthetic */ GooglePlaySku $sku;
public final /* synthetic */ WidgetChoosePlan$setUpRecycler$2 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass4(WidgetChoosePlan$setUpRecycler$2 widgetChoosePlan$setUpRecycler$2, GooglePlaySku googlePlaySku, String str) {
super(0);
this.this$0 = widgetChoosePlan$setUpRecycler$2;
this.$sku = googlePlaySku;
this.$oldSkuName = str;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
Traits.Location location = new Traits.Location("Yearly Upsell Modal", "Yearly Upsell Modal", null, null, null, 28, null);
AnalyticsTracker.paymentFlowStarted$default(AnalyticsTracker.INSTANCE, location, Traits.Subscription.Companion.withGatewayPlanId(this.$sku.getUpgrade().getSkuName()), null, null, 12, null);
WidgetChoosePlan.access$getViewModel$p(this.this$0.this$0).buy(this.$sku.getUpgrade(), this.$oldSkuName, location, "yearly_upsell");
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetChoosePlan$setUpRecycler$2(WidgetChoosePlan widgetChoosePlan, Traits.Location location) {
super(3);
this.this$0 = widgetChoosePlan;
this.$locationTrait = location;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object, java.lang.Object] */
@Override // kotlin.jvm.functions.Function3
public /* bridge */ /* synthetic */ Unit invoke(GooglePlaySku googlePlaySku, String str, SkuDetails skuDetails) {
invoke(googlePlaySku, str, skuDetails);
return Unit.a;
}
public final void invoke(GooglePlaySku googlePlaySku, String str, SkuDetails skuDetails) {
m.checkNotNullParameter(googlePlaySku, "sku");
if (googlePlaySku.getUpgrade() != null && skuDetails != null && googlePlaySku.getType() == GooglePlaySku.Type.PREMIUM_GUILD) {
AnalyticsTracker.paymentFlowStep$default(AnalyticsTracker.INSTANCE, this.$locationTrait, Traits.Subscription.Companion.withGatewayPlanId(googlePlaySku.getSkuName()), "premium_upsell", "plan_select", null, null, 48, null);
c.b bVar = c.j;
FragmentManager parentFragmentManager = this.this$0.getParentFragmentManager();
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
AnonymousClass1 r7 = new AnonymousClass1(this, googlePlaySku, str);
AnonymousClass2 r9 = new AnonymousClass2(this, googlePlaySku, str);
String b = skuDetails.b();
m.checkNotNullExpressionValue(b, "upgradeSkuDetails.price");
boolean areEqual = m.areEqual(googlePlaySku.getSkuName(), str);
Objects.requireNonNull(bVar);
m.checkNotNullParameter(parentFragmentManager, "fragmentManager");
m.checkNotNullParameter(r7, "onContinueClickListener");
m.checkNotNullParameter(r9, "onUpgradeClickListener");
m.checkNotNullParameter(b, "upgradePrice");
c cVar = new c();
cVar.k = r7;
cVar.l = r9;
cVar.m = b;
cVar.n = areEqual;
cVar.show(parentFragmentManager, c.class.getSimpleName());
} else if (googlePlaySku.getUpgrade() == null || skuDetails == null) {
WidgetChoosePlan.access$getViewModel$p(this.this$0).buy(googlePlaySku, str, this.$locationTrait, "plan_select");
} else {
AnalyticsTracker.paymentFlowStep$default(AnalyticsTracker.INSTANCE, this.$locationTrait, Traits.Subscription.Companion.withGatewayPlanId(googlePlaySku.getSkuName()), "yearly_upsell", "plan_select", null, null, 48, null);
e.b bVar2 = e.j;
FragmentManager parentFragmentManager2 = this.this$0.getParentFragmentManager();
m.checkNotNullExpressionValue(parentFragmentManager2, "parentFragmentManager");
AnonymousClass3 r72 = new AnonymousClass3(this, googlePlaySku, str);
AnonymousClass4 r92 = new AnonymousClass4(this, googlePlaySku, str);
String b2 = skuDetails.b();
m.checkNotNullExpressionValue(b2, "upgradeSkuDetails.price");
boolean areEqual2 = m.areEqual(googlePlaySku.getSkuName(), str);
boolean z2 = googlePlaySku.getType() == GooglePlaySku.Type.PREMIUM_TIER_1 || googlePlaySku.getType() == GooglePlaySku.Type.PREMIUM_TIER_1_AND_PREMIUM_GUILD;
Objects.requireNonNull(bVar2);
m.checkNotNullParameter(parentFragmentManager2, "fragmentManager");
m.checkNotNullParameter(r72, "onMonthlyClickListener");
m.checkNotNullParameter(r92, "onYearlyClickListener");
m.checkNotNullParameter(b2, "upgradePrice");
e eVar = new e();
eVar.k = r72;
eVar.l = r92;
eVar.m = b2;
eVar.n = areEqual2;
Bundle bundle = new Bundle();
bundle.putBoolean("ARG_IS_TIER_1", z2);
eVar.setArguments(bundle);
eVar.show(parentFragmentManager2, e.class.getSimpleName());
}
}
}