181 lines
10 KiB
Java
181 lines
10 KiB
Java
package com.discord.widgets.settings.premium;
|
|
|
|
import android.os.Bundle;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import c.a.a.e.b;
|
|
import c.a.a.e.d;
|
|
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);
|
|
b.C0014b bVar = b.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");
|
|
b bVar2 = new b();
|
|
bVar2.k = r7;
|
|
bVar2.l = r9;
|
|
bVar2.m = b;
|
|
bVar2.n = areEqual;
|
|
bVar2.show(parentFragmentManager, b.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);
|
|
d.b bVar3 = d.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(bVar3);
|
|
m.checkNotNullParameter(parentFragmentManager2, "fragmentManager");
|
|
m.checkNotNullParameter(r72, "onMonthlyClickListener");
|
|
m.checkNotNullParameter(r92, "onYearlyClickListener");
|
|
m.checkNotNullParameter(b2, "upgradePrice");
|
|
d dVar = new d();
|
|
dVar.k = r72;
|
|
dVar.l = r92;
|
|
dVar.m = b2;
|
|
dVar.n = areEqual2;
|
|
Bundle bundle = new Bundle();
|
|
bundle.putBoolean("ARG_IS_TIER_1", z2);
|
|
dVar.setArguments(bundle);
|
|
dVar.show(parentFragmentManager2, d.class.getSimpleName());
|
|
}
|
|
}
|
|
}
|