导航菜单

页面标题

页面副标题

Biko v2.0.23 - PaymentLauncherViewModel.java 源代码

正在查看: Biko v2.0.23 应用的 PaymentLauncherViewModel.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.stripe.android.payments.paymentlauncher;

import android.app.Application;
import androidx.activity.result.ActivityResultCaller;
import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.SavedStateHandle;
import androidx.lifecycle.SavedStateHandleSupport;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelKt;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.viewmodel.CreationExtras;
import com.stripe.android.StripeIntentResult;
import com.stripe.android.core.exception.LocalStripeException;
import com.stripe.android.core.injection.UIContext;
import com.stripe.android.core.networking.AnalyticsRequestExecutor;
import com.stripe.android.core.networking.ApiRequest;
import com.stripe.android.model.ConfirmPaymentIntentParams;
import com.stripe.android.model.ConfirmSetupIntentParams;
import com.stripe.android.model.ConfirmStripeIntentParams;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.networking.PaymentAnalyticsEvent;
import com.stripe.android.networking.PaymentAnalyticsRequestFactory;
import com.stripe.android.networking.StripeRepository;
import com.stripe.android.payments.DefaultReturnUrl;
import com.stripe.android.payments.PaymentFlowResult;
import com.stripe.android.payments.PaymentIntentFlowResultProcessor;
import com.stripe.android.payments.SetupIntentFlowResultProcessor;
import com.stripe.android.payments.core.authentication.PaymentAuthenticatorRegistry;
import com.stripe.android.payments.core.injection.DaggerPaymentLauncherViewModelFactoryComponent;
import com.stripe.android.payments.core.injection.NamedConstantsKt;
import com.stripe.android.payments.core.injection.PaymentLauncherViewModelSubcomponent;
import com.stripe.android.payments.paymentlauncher.InternalPaymentResult;
import com.stripe.android.payments.paymentlauncher.PaymentLauncherContract;
import com.stripe.android.utils.CreationExtrasKtxKt;
import com.stripe.android.view.AuthActivityStarterHost;
import dagger.Lazy;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.flow.MutableStateFlow;
import kotlinx.coroutines.flow.StateFlowKt;

@Metadata(d1 = {"\u0000ª\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010%\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0000\u0018\u0000 E2\u00020\u0001:\u0002EFB\u0093\u0001\b\u0007\u0012\b\b\u0001\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\u0006\u0010\b\u001a\u00020\t\u0012\f\u0010\n\u001a\b\u0012\u0004\u0012\u00020\f0\u000b\u0012\u0012\u0010\r\u001a\u000e\u0012\u0004\u0012\u00020\u000f\u0012\u0004\u0012\u00020\u000f0\u000e\u0012\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\u00120\u0011\u0012\f\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\u00140\u0011\u0012\u0006\u0010\u0015\u001a\u00020\u0016\u0012\u0006\u0010\u0017\u001a\u00020\u0018\u0012\b\b\u0001\u0010\u0019\u001a\u00020\u001a\u0012\u0006\u0010\u001b\u001a\u00020\u001c\u0012\b\b\u0001\u0010\u001d\u001a\u00020\u0003¢\u0006\u0002\u0010\u001eJ4\u0010'\u001a\b\u0012\u0004\u0012\u00020)0(2\u0006\u0010*\u001a\u00020+2\b\u0010,\u001a\u0004\u0018\u00010\u000fH\u0082@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b-\u0010.J\u001d\u0010/\u001a\u0002002\u0006\u0010*\u001a\u00020+2\u0006\u00101\u001a\u000202H\u0000¢\u0006\u0002\b3J\u001d\u00104\u001a\u0002002\u0006\u00105\u001a\u00020\u000f2\u0006\u00101\u001a\u000202H\u0000¢\u0006\u0002\b6J\u0012\u00107\u001a\u0002002\b\u0010,\u001a\u0004\u0018\u00010\u000fH\u0002J\u0015\u00108\u001a\u0002002\u0006\u00109\u001a\u00020:H\u0001¢\u0006\u0002\b;J\u0016\u0010<\u001a\u0002002\f\u0010=\u001a\b\u0012\u0004\u0012\u00020)0>H\u0002J\u001d\u0010?\u001a\u0002002\u0006\u0010@\u001a\u00020A2\u0006\u0010B\u001a\u00020CH\u0000¢\u0006\u0002\bDR\u000e\u0010\u0015\u001a\u00020\u0016X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\n\u001a\b\u0012\u0004\u0012\u00020\f0\u000bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\tX\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u001f\u001a\u00020\u00038BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b \u0010!R\u001c\u0010\"\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010$0#X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b%\u0010&R\u000e\u0010\u001d\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\u00120\u0011X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\u00140\u0011X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0017\u001a\u00020\u0018X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\u001cX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010\r\u001a\u000e\u0012\u0004\u0012\u00020\u000f\u0012\u0004\u0012\u00020\u000f0\u000eX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\u001aX\u0082\u0004¢\u0006\u0002\n\u0000\u0082\u0002\u000f\n\u0002\b!\n\u0005\b¡\u001e0\u0001\n\u0002\b\u0019¨\u0006G"}, d2 = {"Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherViewModel;", "Landroidx/lifecycle/ViewModel;", NamedConstantsKt.IS_PAYMENT_INTENT, "", "stripeApiRepository", "Lcom/stripe/android/networking/StripeRepository;", "authenticatorRegistry", "Lcom/stripe/android/payments/core/authentication/PaymentAuthenticatorRegistry;", "defaultReturnUrl", "Lcom/stripe/android/payments/DefaultReturnUrl;", "apiRequestOptionsProvider", "Ljavax/inject/Provider;", "Lcom/stripe/android/core/networking/ApiRequest$Options;", "threeDs1IntentReturnUrlMap", "", "", "lazyPaymentIntentFlowResultProcessor", "Ldagger/Lazy;", "Lcom/stripe/android/payments/PaymentIntentFlowResultProcessor;", "lazySetupIntentFlowResultProcessor", "Lcom/stripe/android/payments/SetupIntentFlowResultProcessor;", "analyticsRequestExecutor", "Lcom/stripe/android/core/networking/AnalyticsRequestExecutor;", "paymentAnalyticsRequestFactory", "Lcom/stripe/android/networking/PaymentAnalyticsRequestFactory;", "uiContext", "Lkotlin/coroutines/CoroutineContext;", "savedStateHandle", "Landroidx/lifecycle/SavedStateHandle;", NamedConstantsKt.IS_INSTANT_APP, "(ZLcom/stripe/android/networking/StripeRepository;Lcom/stripe/android/payments/core/authentication/PaymentAuthenticatorRegistry;Lcom/stripe/android/payments/DefaultReturnUrl;Ljavax/inject/Provider;Ljava/util/Map;Ldagger/Lazy;Ldagger/Lazy;Lcom/stripe/android/core/networking/AnalyticsRequestExecutor;Lcom/stripe/android/networking/PaymentAnalyticsRequestFactory;Lkotlin/coroutines/CoroutineContext;Landroidx/lifecycle/SavedStateHandle;Z)V", "hasStarted", "getHasStarted", "()Z", "internalPaymentResult", "Lkotlinx/coroutines/flow/MutableStateFlow;", "Lcom/stripe/android/payments/paymentlauncher/InternalPaymentResult;", "getInternalPaymentResult$payments_core_release", "()Lkotlinx/coroutines/flow/MutableStateFlow;", "confirmIntent", "Lkotlin/Result;", "Lcom/stripe/android/model/StripeIntent;", "confirmStripeIntentParams", "Lcom/stripe/android/model/ConfirmStripeIntentParams;", "returnUrl", "confirmIntent-0E7RQCE", "(Lcom/stripe/android/model/ConfirmStripeIntentParams;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "confirmStripeIntent", "", "host", "Lcom/stripe/android/view/AuthActivityStarterHost;", "confirmStripeIntent$payments_core_release", "handleNextActionForStripeIntent", "clientSecret", "handleNextActionForStripeIntent$payments_core_release", "logReturnUrl", "onPaymentFlowResult", "paymentFlowResult", "Lcom/stripe/android/payments/PaymentFlowResult$Unvalidated;", "onPaymentFlowResult$payments_core_release", "postResult", "stripeIntentResult", "Lcom/stripe/android/StripeIntentResult;", "register", "activityResultCaller", "Landroidx/activity/result/ActivityResultCaller;", "lifecycleOwner", "Landroidx/lifecycle/LifecycleOwner;", "register$payments_core_release", "Companion", "Factory", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class PaymentLauncherViewModel extends ViewModel {

    public static final Companion INSTANCE = new Companion(null);
    private static final List<String> EXPAND_PAYMENT_METHOD = CollectionsKt.listOf("payment_method");
    public static final String KEY_HAS_STARTED = "key_has_started";
    public static final String REQUIRED_ERROR = "API request returned an invalid response.";
    public static final String TIMEOUT_ERROR = "Payment fails due to time out. \n";
    public static final String UNKNOWN_ERROR = "Payment fails due to unknown error. \n";
    private final AnalyticsRequestExecutor analyticsRequestExecutor;
    private final Provider<ApiRequest.Options> apiRequestOptionsProvider;
    private final PaymentAuthenticatorRegistry authenticatorRegistry;
    private final DefaultReturnUrl defaultReturnUrl;
    private final MutableStateFlow<InternalPaymentResult> internalPaymentResult;
    private final boolean isInstantApp;
    private final boolean isPaymentIntent;
    private final Lazy<PaymentIntentFlowResultProcessor> lazyPaymentIntentFlowResultProcessor;
    private final Lazy<SetupIntentFlowResultProcessor> lazySetupIntentFlowResultProcessor;
    private final PaymentAnalyticsRequestFactory paymentAnalyticsRequestFactory;
    private final SavedStateHandle savedStateHandle;
    private final StripeRepository stripeApiRepository;
    private final Map<String, String> threeDs1IntentReturnUrlMap;
    private final CoroutineContext uiContext;

    @Inject
    public PaymentLauncherViewModel(@Named("isPaymentIntent") boolean z, StripeRepository stripeRepository, PaymentAuthenticatorRegistry paymentAuthenticatorRegistry, DefaultReturnUrl defaultReturnUrl, Provider<ApiRequest.Options> provider, Map<String, String> map, Lazy<PaymentIntentFlowResultProcessor> lazy, Lazy<SetupIntentFlowResultProcessor> lazy2, AnalyticsRequestExecutor analyticsRequestExecutor, PaymentAnalyticsRequestFactory paymentAnalyticsRequestFactory, @UIContext CoroutineContext coroutineContext, SavedStateHandle savedStateHandle, @Named("isInstantApp") boolean z2) {
        Intrinsics.checkNotNullParameter(stripeRepository, "stripeApiRepository");
        Intrinsics.checkNotNullParameter(paymentAuthenticatorRegistry, "authenticatorRegistry");
        Intrinsics.checkNotNullParameter(defaultReturnUrl, "defaultReturnUrl");
        Intrinsics.checkNotNullParameter(provider, "apiRequestOptionsProvider");
        Intrinsics.checkNotNullParameter(map, "threeDs1IntentReturnUrlMap");
        Intrinsics.checkNotNullParameter(lazy, "lazyPaymentIntentFlowResultProcessor");
        Intrinsics.checkNotNullParameter(lazy2, "lazySetupIntentFlowResultProcessor");
        Intrinsics.checkNotNullParameter(analyticsRequestExecutor, "analyticsRequestExecutor");
        Intrinsics.checkNotNullParameter(paymentAnalyticsRequestFactory, "paymentAnalyticsRequestFactory");
        Intrinsics.checkNotNullParameter(coroutineContext, "uiContext");
        Intrinsics.checkNotNullParameter(savedStateHandle, "savedStateHandle");
        this.isPaymentIntent = z;
        this.stripeApiRepository = stripeRepository;
        this.authenticatorRegistry = paymentAuthenticatorRegistry;
        this.defaultReturnUrl = defaultReturnUrl;
        this.apiRequestOptionsProvider = provider;
        this.threeDs1IntentReturnUrlMap = map;
        this.lazyPaymentIntentFlowResultProcessor = lazy;
        this.lazySetupIntentFlowResultProcessor = lazy2;
        this.analyticsRequestExecutor = analyticsRequestExecutor;
        this.paymentAnalyticsRequestFactory = paymentAnalyticsRequestFactory;
        this.uiContext = coroutineContext;
        this.savedStateHandle = savedStateHandle;
        this.isInstantApp = z2;
        this.internalPaymentResult = StateFlowKt.MutableStateFlow((Object) null);
    }

    private final boolean getHasStarted() {
        Boolean bool = (Boolean) this.savedStateHandle.get(KEY_HAS_STARTED);
        if (bool != null) {
            return bool.booleanValue();
        }
        return false;
    }

    public final MutableStateFlow<InternalPaymentResult> getInternalPaymentResult$payments_core_release() {
        return this.internalPaymentResult;
    }

    public final void register$payments_core_release(ActivityResultCaller activityResultCaller, LifecycleOwner lifecycleOwner) {
        Intrinsics.checkNotNullParameter(activityResultCaller, "activityResultCaller");
        Intrinsics.checkNotNullParameter(lifecycleOwner, "lifecycleOwner");
        this.authenticatorRegistry.onNewActivityResultCaller(activityResultCaller, new PaymentLauncherViewModel$register$1(this));
        lifecycleOwner.getLifecycle().addObserver(new DefaultLifecycleObserver() {
            public void onDestroy(LifecycleOwner owner) {
                PaymentAuthenticatorRegistry paymentAuthenticatorRegistry;
                Intrinsics.checkNotNullParameter(owner, "owner");
                paymentAuthenticatorRegistry = PaymentLauncherViewModel.this.authenticatorRegistry;
                paymentAuthenticatorRegistry.onLauncherInvalidated();
                super.onDestroy(owner);
            }
        });
    }

    public final void confirmStripeIntent$payments_core_release(ConfirmStripeIntentParams confirmStripeIntentParams, AuthActivityStarterHost host) {
        Intrinsics.checkNotNullParameter(confirmStripeIntentParams, "confirmStripeIntentParams");
        Intrinsics.checkNotNullParameter(host, "host");
        if (getHasStarted()) {
            return;
        }
        BuildersKt.launch$default(ViewModelKt.getViewModelScope(this), (CoroutineContext) null, (CoroutineStart) null, new PaymentLauncherViewModel$confirmStripeIntent$1(this, confirmStripeIntentParams, host, null), 3, (Object) null);
    }

    public final java.lang.Object m258confirmIntent0E7RQCE(com.stripe.android.model.ConfirmStripeIntentParams r6, java.lang.String r7, kotlin.coroutines.Continuation<? super kotlin.Result<? extends com.stripe.android.model.StripeIntent>> r8) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.payments.paymentlauncher.PaymentLauncherViewModel.m258confirmIntent0E7RQCE(com.stripe.android.model.ConfirmStripeIntentParams, java.lang.String, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final void handleNextActionForStripeIntent$payments_core_release(String clientSecret, AuthActivityStarterHost host) {
        Intrinsics.checkNotNullParameter(clientSecret, "clientSecret");
        Intrinsics.checkNotNullParameter(host, "host");
        if (getHasStarted()) {
            return;
        }
        BuildersKt.launch$default(ViewModelKt.getViewModelScope(this), (CoroutineContext) null, (CoroutineStart) null, new PaymentLauncherViewModel$handleNextActionForStripeIntent$1(this, clientSecret, host, null), 3, (Object) null);
    }

    public final void onPaymentFlowResult$payments_core_release(PaymentFlowResult.Unvalidated paymentFlowResult) {
        Intrinsics.checkNotNullParameter(paymentFlowResult, "paymentFlowResult");
        BuildersKt.launch$default(ViewModelKt.getViewModelScope(this), (CoroutineContext) null, (CoroutineStart) null, new PaymentLauncherViewModel$onPaymentFlowResult$1(this, paymentFlowResult, null), 3, (Object) null);
    }

    public final void postResult(StripeIntentResult<? extends StripeIntent> stripeIntentResult) {
        InternalPaymentResult.Completed completed;
        MutableStateFlow<InternalPaymentResult> mutableStateFlow = this.internalPaymentResult;
        int outcome = stripeIntentResult.getOutcome();
        if (outcome == 1) {
            completed = new InternalPaymentResult.Completed(stripeIntentResult.getIntent());
        } else if (outcome == 2) {
            completed = new InternalPaymentResult.Failed(new LocalStripeException(stripeIntentResult.getFailureMessage()));
        } else if (outcome == 3) {
            completed = InternalPaymentResult.Canceled.INSTANCE;
        } else if (outcome == 4) {
            completed = new InternalPaymentResult.Failed(new LocalStripeException(TIMEOUT_ERROR + stripeIntentResult.getFailureMessage()));
        } else {
            completed = new InternalPaymentResult.Failed(new LocalStripeException(UNKNOWN_ERROR + stripeIntentResult.getFailureMessage()));
        }
        mutableStateFlow.setValue(completed);
    }

    public final void logReturnUrl(String returnUrl) {
        PaymentAnalyticsEvent paymentAnalyticsEvent;
        if (Intrinsics.areEqual(returnUrl, this.defaultReturnUrl.getValue())) {
            paymentAnalyticsEvent = PaymentAnalyticsEvent.ConfirmReturnUrlDefault;
        } else if (returnUrl == null) {
            paymentAnalyticsEvent = PaymentAnalyticsEvent.ConfirmReturnUrlNull;
        } else {
            paymentAnalyticsEvent = PaymentAnalyticsEvent.ConfirmReturnUrlCustom;
        }
        this.analyticsRequestExecutor.executeAsync(PaymentAnalyticsRequestFactory.createRequest$payments_core_release$default(this.paymentAnalyticsRequestFactory, paymentAnalyticsEvent, null, null, null, null, 30, null));
    }

    @Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B\u0013\u0012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003¢\u0006\u0002\u0010\u0005J-\u0010\u0006\u001a\u0002H\u0007\"\b\b\u0000\u0010\u0007*\u00020\b2\f\u0010\t\u001a\b\u0012\u0004\u0012\u0002H\u00070\n2\u0006\u0010\u000b\u001a\u00020\fH\u0016¢\u0006\u0002\u0010\rR\u0014\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherViewModel$Factory;", "Landroidx/lifecycle/ViewModelProvider$Factory;", "argsSupplier", "Lkotlin/Function0;", "Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherContract$Args;", "(Lkotlin/jvm/functions/Function0;)V", "create", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "extras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Ljava/lang/Class;Landroidx/lifecycle/viewmodel/CreationExtras;)Landroidx/lifecycle/ViewModel;", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Factory implements ViewModelProvider.Factory {
        private final Function0<PaymentLauncherContract.Args> argsSupplier;

        public Factory(Function0<? extends PaymentLauncherContract.Args> function0) {
            Intrinsics.checkNotNullParameter(function0, "argsSupplier");
            this.argsSupplier = function0;
        }

        public <T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras) {
            Intrinsics.checkNotNullParameter(modelClass, "modelClass");
            Intrinsics.checkNotNullParameter(extras, "extras");
            final PaymentLauncherContract.Args args = (PaymentLauncherContract.Args) this.argsSupplier.invoke();
            Application requireApplication = CreationExtrasKtxKt.requireApplication(extras);
            SavedStateHandle createSavedStateHandle = SavedStateHandleSupport.createSavedStateHandle(extras);
            PaymentLauncherViewModelSubcomponent.Builder viewModelSubcomponentBuilder = DaggerPaymentLauncherViewModelFactoryComponent.builder().context(requireApplication).enableLogging(args.getEnableLogging()).publishableKeyProvider(new Function0<String>() {
                {
                    super(0);
                }

                public final String invoke() {
                    return PaymentLauncherContract.Args.this.getPublishableKey();
                }
            }).stripeAccountIdProvider(new Function0<String>() {
                {
                    super(0);
                }

                public final String invoke() {
                    return PaymentLauncherContract.Args.this.getStripeAccountId();
                }
            }).productUsage(args.getProductUsage()).includePaymentSheetAuthenticators(args.getIncludePaymentSheetAuthenticators()).build().getViewModelSubcomponentBuilder();
            boolean z = false;
            if (args instanceof PaymentLauncherContract.Args.IntentConfirmationArgs) {
                ConfirmStripeIntentParams confirmStripeIntentParams = ((PaymentLauncherContract.Args.IntentConfirmationArgs) args).getConfirmStripeIntentParams();
                if (!(confirmStripeIntentParams instanceof ConfirmPaymentIntentParams)) {
                    if (!(confirmStripeIntentParams instanceof ConfirmSetupIntentParams)) {
                        throw new NoWhenBranchMatchedException();
                    }
                }
                z = true;
            } else {
                if (!(args instanceof PaymentLauncherContract.Args.PaymentIntentNextActionArgs)) {
                    if (!(args instanceof PaymentLauncherContract.Args.SetupIntentNextActionArgs)) {
                        throw new NoWhenBranchMatchedException();
                    }
                }
                z = true;
            }
            PaymentLauncherViewModel viewModel = viewModelSubcomponentBuilder.isPaymentIntent(z).savedStateHandle(createSavedStateHandle).build().getViewModel();
            Intrinsics.checkNotNull(viewModel, "null cannot be cast to non-null type T of com.stripe.android.payments.paymentlauncher.PaymentLauncherViewModel.Factory.create");
            return viewModel;
        }
    }

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0002\b\b\b\u0080\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0017\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007R\u0016\u0010\b\u001a\u00020\u00058\u0000X\u0081T¢\u0006\b\n\u0000\u0012\u0004\b\t\u0010\u0002R\u000e\u0010\n\u001a\u00020\u0005X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\u0005X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\u0005X\u0086T¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherViewModel$Companion;", "", "()V", "EXPAND_PAYMENT_METHOD", "", "", "getEXPAND_PAYMENT_METHOD", "()Ljava/util/List;", "KEY_HAS_STARTED", "getKEY_HAS_STARTED$payments_core_release$annotations", "REQUIRED_ERROR", "TIMEOUT_ERROR", "UNKNOWN_ERROR", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public static void getKEY_HAS_STARTED$payments_core_release$annotations() {
        }

        private Companion() {
        }

        public final List<String> getEXPAND_PAYMENT_METHOD() {
            return PaymentLauncherViewModel.EXPAND_PAYMENT_METHOD;
        }
    }
}