导航菜单

页面标题

页面副标题

BodyTech v7.6.4 - ClassDetailFragment.java 源代码

正在查看: BodyTech v7.6.4 应用的 ClassDetailFragment.java JAVA 源代码文件

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


package com.fitnessmobileapps.fma.feature.book;

import a2.b;
import android.content.ComponentCallbacks;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.widget.Toolbar;
import androidx.autofill.HintConstants;
import androidx.browser.customtabs.CustomTabsCallback;
import androidx.browser.customtabs.CustomTabsClient;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.browser.customtabs.CustomTabsServiceConnection;
import androidx.browser.customtabs.CustomTabsSession;
import androidx.compose.runtime.Composable;
import androidx.compose.runtime.ComposableTarget;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.internal.ComposableLambdaKt;
import androidx.compose.runtime.internal.StabilityInferred;
import androidx.compose.ui.platform.ComposeView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentResultListener;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.navigation.NavArgsLazy;
import androidx.navigation.NavBackStackEntry;
import androidx.navigation.NavController;
import androidx.navigation.NavHostController;
import androidx.navigation.fragment.FragmentKt;
import androidx.savedstate.SavedStateRegistryOwner;
import com.android.volley.VolleyError;
import com.fitnessmobileapps.bodytech39559.R;
import com.fitnessmobileapps.fma.core.compose.AvatarKt;
import com.fitnessmobileapps.fma.core.compose.a;
import com.fitnessmobileapps.fma.core.compose.theme.ThemeKt;
import com.fitnessmobileapps.fma.core.data.remote.exception.NoNetworkException;
import com.fitnessmobileapps.fma.core.domain.ClassEntity;
import com.fitnessmobileapps.fma.core.domain.UserCalendarEntity;
import com.fitnessmobileapps.fma.core.domain.e;
import com.fitnessmobileapps.fma.core.domain.h;
import com.fitnessmobileapps.fma.core.domain.w0;
import com.fitnessmobileapps.fma.core.flags.DevelopmentFlags;
import com.fitnessmobileapps.fma.core.functional.h;
import com.fitnessmobileapps.fma.exception.ApplicationException;
import com.fitnessmobileapps.fma.feature.authentication.AuthenticationActivity;
import com.fitnessmobileapps.fma.feature.authentication.AuthenticationActivityArgs;
import com.fitnessmobileapps.fma.feature.book.domain.interactor.error.LocationPermissionsNotEnabledException;
import com.fitnessmobileapps.fma.feature.book.domain.interactor.error.OutsideCheckInRadiusException;
import com.fitnessmobileapps.fma.feature.book.domain.interactor.error.OutsideSignInWindowException;
import com.fitnessmobileapps.fma.feature.book.domain.interactor.error.PreciseLocationPermissionsNotEnabledException;
import com.fitnessmobileapps.fma.feature.book.h0;
import com.fitnessmobileapps.fma.feature.book.presentation.FitmetrixClassView;
import com.fitnessmobileapps.fma.feature.book.presentation.SwitchAndBookViewKt;
import com.fitnessmobileapps.fma.feature.book.presentation.d;
import com.fitnessmobileapps.fma.feature.book.presentation.e;
import com.fitnessmobileapps.fma.feature.book.presentation.viewmodel.ClassDetailViewModel;
import com.fitnessmobileapps.fma.feature.book.presentation.viewmodel.ClassHeaderViewModel;
import com.fitnessmobileapps.fma.feature.book.s;
import com.fitnessmobileapps.fma.feature.buy.BuyServicesActivity;
import com.fitnessmobileapps.fma.feature.common.navigation.ToolbarKt;
import com.fitnessmobileapps.fma.feature.common.view.ViewMoreTextViewBindingKt;
import com.fitnessmobileapps.fma.feature.familyaccounts.presentation.UserIdentityState;
import com.fitnessmobileapps.fma.feature.familyaccounts.presentation.UserViewModel;
import com.fitnessmobileapps.fma.feature.location.util.BottomSheetUtilsKt;
import com.fitnessmobileapps.fma.feature.profile.CallToCompleteProfileFragment;
import com.fitnessmobileapps.fma.feature.profile.EditProfileActivity;
import com.fitnessmobileapps.fma.util.q0;
import com.fitnessmobileapps.fma.views.AddPaymentCardActivity;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.snackbar.Snackbar;
import com.mindbodyonline.gatekeeper.GateKeeper;
import com.mindbodyonline.gatekeeper.e;
import com.mindbodyonline.pickaspot.ui.PickASpotFragment;
import com.mindbodyonline.pickaspot.ui.param.ClassConfigurationKt;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.instrumentation.androidx.navigation.NavigationController;
import f6.CheckInData;
import j$.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.Function;
import kotlin.Lazy;
import kotlin.LazyThreadSafetyMode;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowKt;
import n5.AllowCreateSubscriberClientProfileResult;
import nn.a;
import org.koin.androidx.viewmodel.ext.android.FragmentExtKt;
import q3.f;
import r2.n2;
import r2.n3;
import r2.p2;
import r2.x2;
import v4.SubscriberClientRequiredInfoResult;

@StabilityInferred(parameters = 0)
@Metadata(d1 = {"\u0000Ü\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0011\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0010\u0011\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\r\b\u0007\u0018\u0000 \u0084\u00012\u00020\u00012\u00020\u0002:\u0002\u0085\u0001B\t¢\u0006\u0006\b\u0082\u0001\u0010\u0083\u0001J\b\u0010\u0004\u001a\u00020\u0003H\u0002J\b\u0010\u0005\u001a\u00020\u0003H\u0002J\f\u0010\u0007\u001a\u00020\u0003*\u00020\u0006H\u0002J$\u0010\r\u001a\u00020\u00032\u0006\u0010\b\u001a\u00020\u00062\u0006\u0010\n\u001a\u00020\t2\n\b\u0002\u0010\f\u001a\u0004\u0018\u00010\u000bH\u0002J\u0010\u0010\u0010\u001a\u00020\u00032\u0006\u0010\u000f\u001a\u00020\u000eH\u0002J\u0010\u0010\u0010\u001a\u00020\u00032\u0006\u0010\u0012\u001a\u00020\u0011H\u0002J\u0018\u0010\u0015\u001a\u00020\u00032\u0006\u0010\u0012\u001a\u00020\u00112\u0006\u0010\u0014\u001a\u00020\u0013H\u0002J\u001c\u0010\u0019\u001a\u00020\u00032\u0006\u0010\u0016\u001a\u00020\u00132\n\b\u0002\u0010\u0018\u001a\u0004\u0018\u00010\u0017H\u0002J\b\u0010\u001a\u001a\u00020\u0003H\u0002J\u0016\u0010\u001e\u001a\u00020\u00032\f\u0010\u001d\u001a\b\u0012\u0004\u0012\u00020\u001c0\u001bH\u0002J \u0010!\u001a\u00020\u00032\u0006\u0010 \u001a\u00020\u001f2\u0006\u0010\b\u001a\u00020\u00062\u0006\u0010\n\u001a\u00020\tH\u0002J\u0010\u0010$\u001a\u00020\u00032\u0006\u0010#\u001a\u00020\"H\u0002J\u0010\u0010&\u001a\u00020\u00032\u0006\u0010%\u001a\u00020\u0013H\u0002J\u0010\u0010'\u001a\u00020\u00032\u0006\u0010\u0016\u001a\u00020\u0013H\u0002J\b\u0010(\u001a\u00020\u0003H\u0002J\u0010\u0010)\u001a\u00020\u00032\u0006\u0010\b\u001a\u00020\u0006H\u0002J\u0010\u0010,\u001a\u00020\u00032\u0006\u0010+\u001a\u00020*H\u0002J\u0010\u0010-\u001a\u00020\u00032\u0006\u0010 \u001a\u00020\u001fH\u0002J\u0010\u00100\u001a\u00020\u00032\u0006\u0010/\u001a\u00020.H\u0002J\b\u00101\u001a\u00020\u0003H\u0002J\b\u00102\u001a\u00020\u0003H\u0002J\b\u00103\u001a\u00020\u0003H\u0002J\b\u00104\u001a\u00020\u0003H\u0002J\b\u00105\u001a\u00020\u0003H\u0002J\b\u00106\u001a\u00020\u0003H\u0002J\b\u00107\u001a\u00020\u0003H\u0002J\b\u00108\u001a\u00020\u0003H\u0002J\u0010\u0010:\u001a\u00020\u00032\u0006\u00109\u001a\u00020\u0013H\u0002J\b\u0010;\u001a\u00020\u0003H\u0002J\b\u0010<\u001a\u00020\u0003H\u0002J\u0014\u0010>\u001a\u00020\u00032\n\b\u0002\u0010=\u001a\u0004\u0018\u00010\u000bH\u0002J\b\u0010?\u001a\u00020\u0003H\u0002J\u0010\u0010B\u001a\u00020\u00032\u0006\u0010A\u001a\u00020@H\u0002J\u0018\u0010D\u001a\u00020\u00032\u0006\u0010C\u001a\u00020\u00132\u0006\u0010=\u001a\u00020\u000bH\u0002J\u0010\u0010E\u001a\u00020\u00032\u0006\u0010\b\u001a\u00020\u0006H\u0002J\b\u0010F\u001a\u00020\u0003H\u0002J\u0012\u0010I\u001a\u00020\u00032\b\u0010H\u001a\u0004\u0018\u00010GH\u0016J$\u0010O\u001a\u00020N2\u0006\u0010K\u001a\u00020J2\b\u0010M\u001a\u0004\u0018\u00010L2\b\u0010H\u001a\u0004\u0018\u00010GH\u0016J\u001a\u0010Q\u001a\u00020\u00032\u0006\u0010P\u001a\u00020N2\b\u0010H\u001a\u0004\u0018\u00010GH\u0016J\b\u0010R\u001a\u00020\u0003H\u0016J\b\u0010S\u001a\u00020\u0003H\u0016J\u0010\u0010V\u001a\u00020\t2\u0006\u0010U\u001a\u00020TH\u0016R\u001b\u0010\\\u001a\u00020W8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bX\u0010Y\u001a\u0004\bZ\u0010[R\u0018\u0010`\u001a\u0004\u0018\u00010]8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b^\u0010_R\u001b\u0010f\u001a\u00020a8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bb\u0010c\u001a\u0004\bd\u0010eR\u001b\u0010k\u001a\u00020g8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bh\u0010c\u001a\u0004\bi\u0010jR\u0018\u0010o\u001a\u0004\u0018\u00010l8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bm\u0010nR\u0016\u0010r\u001a\u00020\t8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bp\u0010qR.\u0010x\u001a\u001c\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\u0013 u*\n\u0012\u0004\u0012\u00020\u0013\u0018\u00010t0t0s8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bv\u0010wR\"\u0010{\u001a\u0010\u0012\f\u0012\n u*\u0004\u0018\u00010y0y0s8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bz\u0010wR\"\u0010}\u001a\u0010\u0012\f\u0012\n u*\u0004\u0018\u00010y0y0s8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b|\u0010wR\"\u0010\u007f\u001a\u0010\u0012\f\u0012\n u*\u0004\u0018\u00010y0y0s8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b~\u0010wR$\u0010\u0081\u0001\u001a\u0010\u0012\f\u0012\n u*\u0004\u0018\u00010y0y0s8\u0002X\u0082\u0004¢\u0006\u0007\n\u0005\b\u0080\u0001\u0010w¨\u0006\u0086\u0001"}, d2 = {"Lcom/fitnessmobileapps/fma/feature/book/ClassDetailFragment;", "Lcom/fitnessmobileapps/fma/views/fragments/b;", "Landroidx/appcompat/widget/Toolbar$OnMenuItemClickListener;", "", "O0", "P0", "Lcom/fitnessmobileapps/fma/core/domain/i;", "N0", "classEntity", "", "showCalendar", "Lcom/fitnessmobileapps/fma/feature/book/presentation/d$a;", "action", "X0", "", "error", "showError", "Landroidx/fragment/app/DialogFragment;", "dialogFragment", "", "tag", "k1", "message", "Landroid/content/DialogInterface$OnClickListener;", "listener", "T0", "u0", "", "Lcom/fitnessmobileapps/fma/core/domain/c1;", "calendars", "Z0", "Lcom/fitnessmobileapps/fma/feature/book/presentation/d$d$c;", "pickASpot", "r1", "", "calendarId", "t0", "spotNumber", "q1", "p1", "E0", "y0", "Lcom/fitnessmobileapps/fma/feature/book/presentation/h;", "fitmetrixData", "A0", "D0", "Ln5/a;", "allowCreateSubscriberClientProfileResult", "M0", "L0", "S0", "V0", "u1", "l1", "n1", "c1", "b1", HintConstants.AUTOFILL_HINT_PHONE_NUMBER, "e1", "g1", "i1", "bookingAction", "F0", "I0", "Landroid/net/Uri;", "livestreamUri", "B0", "origin", "C0", "z0", "J0", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "onDestroyView", "onResume", "Landroid/view/MenuItem;", "item", "onMenuItemClick", "Lcom/fitnessmobileapps/fma/feature/book/g0;", "c", "Landroidx/navigation/NavArgsLazy;", "v0", "()Lcom/fitnessmobileapps/fma/feature/book/g0;", "args", "Landroidx/browser/customtabs/CustomTabsSession;", "d", "Landroidx/browser/customtabs/CustomTabsSession;", "customTabsSession", "Lcom/fitnessmobileapps/fma/feature/book/presentation/viewmodel/ClassDetailViewModel;", "e", "Lkotlin/Lazy;", "w0", "()Lcom/fitnessmobileapps/fma/feature/book/presentation/viewmodel/ClassDetailViewModel;", "detailViewModel", "Lcom/fitnessmobileapps/fma/feature/familyaccounts/presentation/UserViewModel;", "k", "x0", "()Lcom/fitnessmobileapps/fma/feature/familyaccounts/presentation/UserViewModel;", "userViewModel", "Lr2/d0;", "n", "Lr2/d0;", "binding", "p", "Z", "showConfirmation", "Landroidx/activity/result/ActivityResultLauncher;", "", "kotlin.jvm.PlatformType", "q", "Landroidx/activity/result/ActivityResultLauncher;", "locationPermissionRequest", "Landroid/content/Intent;", "r", "buyLauncher", "t", "signInLauncher", "v", "updateProfileLauncher", "w", "addPaymentCardActivityLauncher", "<init>", "()V", "x", gf.a.A, "FMA_release"}, k = 1, mv = {1, 8, 0})
@Instrumented
public final class ClassDetailFragment extends com.fitnessmobileapps.fma.views.fragments.b implements Toolbar.OnMenuItemClickListener {

    public static final int f6348y = 8;

    private final NavArgsLazy args = new NavArgsLazy(kotlin.jvm.internal.v.b(ClassDetailFragmentArgs.class), new Function0<Bundle>() {
        {
            super(0);
        }

        @Override
        public final Bundle invoke() {
            Bundle arguments = Fragment.this.getArguments();
            if (arguments != null) {
                return arguments;
            }
            throw new IllegalStateException("Fragment " + Fragment.this + " has null arguments");
        }
    });

    private CustomTabsSession customTabsSession;

    private final Lazy detailViewModel;

    private final Lazy userViewModel;

    private r2.d0 binding;

    private boolean showConfirmation;

    private final ActivityResultLauncher<String[]> locationPermissionRequest;

    private final ActivityResultLauncher<Intent> buyLauncher;

    private final ActivityResultLauncher<Intent> signInLauncher;

    private final ActivityResultLauncher<Intent> updateProfileLauncher;

    private final ActivityResultLauncher<Intent> addPaymentCardActivityLauncher;

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n"}, d2 = {"Landroidx/activity/result/ActivityResult;", "result", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
    static final class b implements ActivityResultCallback<ActivityResult> {
        b() {
        }

        @Override
        public final void onActivityResult(ActivityResult result) {
            kotlin.jvm.internal.r.i(result, "result");
            if (result.getResultCode() == -1) {
                ClassDetailFragment.this.w0().o0();
            }
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n"}, d2 = {"Landroidx/activity/result/ActivityResult;", "result", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
    static final class c implements ActivityResultCallback<ActivityResult> {
        c() {
        }

        @Override
        public final void onActivityResult(ActivityResult result) {
            kotlin.jvm.internal.r.i(result, "result");
            if (result.getResultCode() == 555) {
                ClassDetailFragment.this.w0().o0();
            }
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0010$\n\u0002\u0010\u000e\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0005\u001a\u00020\u00042\u0012\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00020\u0000H\n"}, d2 = {"", "", "", "it", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
    static final class d implements ActivityResultCallback<Map<String, Boolean>> {

        public static final d f6362c = new d();

        d() {
        }

        @Override
        public final void onActivityResult(Map<String, Boolean> it) {
            kotlin.jvm.internal.r.i(it, "it");
        }
    }

    @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
    static final class f implements Observer, kotlin.jvm.internal.o {

        private final Function1 f6365c;

        f(Function1 function) {
            kotlin.jvm.internal.r.i(function, "function");
            this.f6365c = function;
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof Observer) && (obj instanceof kotlin.jvm.internal.o)) {
                return kotlin.jvm.internal.r.d(getFunctionDelegate(), ((kotlin.jvm.internal.o) obj).getFunctionDelegate());
            }
            return false;
        }

        @Override
        public final Function<?> getFunctionDelegate() {
            return this.f6365c;
        }

        public final int hashCode() {
            return getFunctionDelegate().hashCode();
        }

        @Override
        public final void onChanged(Object obj) {
            this.f6365c.invoke(obj);
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n"}, d2 = {"Landroidx/activity/result/ActivityResult;", "result", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
    static final class g implements ActivityResultCallback<ActivityResult> {
        g() {
        }

        @Override
        public final void onActivityResult(ActivityResult result) {
            kotlin.jvm.internal.r.i(result, "result");
            if (result.getResultCode() == -1) {
                ClassDetailFragment.this.w0().w1();
            }
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n"}, d2 = {"Landroidx/activity/result/ActivityResult;", "result", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
    static final class h implements ActivityResultCallback<ActivityResult> {
        h() {
        }

        @Override
        public final void onActivityResult(ActivityResult result) {
            kotlin.jvm.internal.r.i(result, "result");
            if (result.getResultCode() == -1) {
                ClassDetailFragment.this.w0().o0();
            }
        }
    }

    public ClassDetailFragment() {
        Lazy a10;
        Lazy a11;
        final Function0<nn.a> function0 = new Function0<nn.a>() {
            {
                super(0);
            }

            @Override
            public final nn.a invoke() {
                a.Companion companion = nn.a.INSTANCE;
                ComponentCallbacks componentCallbacks = this;
                return companion.b((ViewModelStoreOwner) componentCallbacks, componentCallbacks instanceof SavedStateRegistryOwner ? (SavedStateRegistryOwner) componentCallbacks : null);
            }
        };
        LazyThreadSafetyMode lazyThreadSafetyMode = LazyThreadSafetyMode.f33241e;
        final xn.a aVar = null;
        final Object[] objArr = 0 == true ? 1 : 0;
        a10 = kotlin.d.a(lazyThreadSafetyMode, new Function0<ClassDetailViewModel>() {
            {
                super(0);
            }

            @Override
            public final ClassDetailViewModel invoke() {
                return org.koin.androidx.viewmodel.ext.android.a.a(this, aVar, kotlin.jvm.internal.v.b(ClassDetailViewModel.class), function0, objArr);
            }
        });
        this.detailViewModel = a10;
        final Function0<nn.a> function02 = new Function0<nn.a>() {
            {
                super(0);
            }

            @Override
            public final nn.a invoke() {
                a.Companion companion = nn.a.INSTANCE;
                FragmentActivity requireActivity = Fragment.this.requireActivity();
                kotlin.jvm.internal.r.h(requireActivity, "requireActivity()");
                return companion.b(requireActivity, Fragment.this.requireActivity());
            }
        };
        final Object[] objArr2 = 0 == true ? 1 : 0;
        final Object[] objArr3 = 0 == true ? 1 : 0;
        a11 = kotlin.d.a(lazyThreadSafetyMode, new Function0<UserViewModel>() {
            {
                super(0);
            }

            @Override
            public final UserViewModel invoke() {
                return FragmentExtKt.a(Fragment.this, objArr2, kotlin.jvm.internal.v.b(UserViewModel.class), function02, objArr3);
            }
        });
        this.userViewModel = a11;
        this.showConfirmation = true;
        ActivityResultLauncher<String[]> registerForActivityResult = registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), d.f6362c);
        kotlin.jvm.internal.r.h(registerForActivityResult, "registerForActivityResul…plePermissions()\n    ) {}");
        this.locationPermissionRequest = registerForActivityResult;
        ActivityResultLauncher<Intent> registerForActivityResult2 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new c());
        kotlin.jvm.internal.r.h(registerForActivityResult2, "registerForActivityResul…Booking()\n        }\n    }");
        this.buyLauncher = registerForActivityResult2;
        ActivityResultLauncher<Intent> registerForActivityResult3 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new g());
        kotlin.jvm.internal.r.h(registerForActivityResult3, "registerForActivityResul…tSignIn()\n        }\n    }");
        this.signInLauncher = registerForActivityResult3;
        ActivityResultLauncher<Intent> registerForActivityResult4 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new h());
        kotlin.jvm.internal.r.h(registerForActivityResult4, "registerForActivityResul…)\n            }\n        }");
        this.updateProfileLauncher = registerForActivityResult4;
        ActivityResultLauncher<Intent> registerForActivityResult5 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new b());
        kotlin.jvm.internal.r.h(registerForActivityResult5, "registerForActivityResul…)\n            }\n        }");
        this.addPaymentCardActivityLauncher = registerForActivityResult5;
    }

    public final void A0(FitmetrixClassView fitmetrixData) {
        Context context = getContext();
        if (context != null) {
            CustomTabsIntent build = h2.a.a(new CustomTabsIntent.Builder(this.customTabsSession), context).build();
            kotlin.jvm.internal.r.h(build, "Builder(customTabsSession).branded(it).build()");
            build.launchUrl(context, fitmetrixData.getRedirectUri());
        }
    }

    public final void B0(Uri livestreamUri) {
        Context context = getContext();
        if (context != null) {
            CustomTabsIntent build = h2.a.a(new CustomTabsIntent.Builder(), context).build();
            kotlin.jvm.internal.r.h(build, "Builder().branded(it).build()");
            build.launchUrl(context, livestreamUri);
        }
    }

    public final void C0(String origin, d.a bookingAction) {
        NavController findNavController = FragmentKt.findNavController(this);
        h0.Companion companion = h0.INSTANCE;
        String simpleName = bookingAction.getClass().getSimpleName();
        kotlin.jvm.internal.r.h(simpleName, "bookingAction::class.java.simpleName");
        findNavController.navigate(companion.a(origin, simpleName));
    }

    public final void D0(d.AbstractC0184d.PickASpot pickASpot) {
        FragmentKt.findNavController(this).navigate(h0.INSTANCE.b(ClassConfigurationKt.toAndroid(pickASpot.getClassConfiguration()), pickASpot.getClientId(), pickASpot.getToolbarTitle()));
    }

    public final void E0() {
        Intent intent = new Intent(getContext(), (Class<?>) AuthenticationActivity.class);
        intent.putExtras(new AuthenticationActivityArgs(AuthenticationActivity.StartMode.LOGIN).b());
        this.signInLauncher.launch(intent);
    }

    public final void F0(final d.a bookingAction) {
        Bundle arguments;
        NavBackStackEntry currentBackStackEntry = FragmentKt.findNavController(this).getCurrentBackStackEntry();
        if (d4.b.a((currentBackStackEntry == null || (arguments = currentBackStackEntry.getArguments()) == null) ? null : arguments.getString(getString(R.string.nav_key_region)), bookingAction, new Function2<String, d.a, Unit>() {
            {
                super(2);
            }

            public final void a(String safeRegion, d.a safeBookingAction) {
                kotlin.jvm.internal.r.i(safeRegion, "safeRegion");
                kotlin.jvm.internal.r.i(safeBookingAction, "safeBookingAction");
                if (kotlin.jvm.internal.r.d(safeRegion, "home") || kotlin.jvm.internal.r.d(safeRegion, "profile")) {
                    ClassDetailFragment.this.C0(safeRegion, safeBookingAction);
                } else {
                    ClassDetailFragment.H0(bookingAction, ClassDetailFragment.this);
                }
            }

            @Override
            public Unit invoke(String str, d.a aVar) {
                a(str, aVar);
                return Unit.f33247a;
            }
        }) == null) {
            H0(bookingAction, this);
        }
    }

    static void G0(ClassDetailFragment classDetailFragment, d.a aVar, int i10, Object obj) {
        if ((i10 & 1) != 0) {
            aVar = null;
        }
        classDetailFragment.F0(aVar);
    }

    public static final void H0(d.a aVar, ClassDetailFragment classDetailFragment) {
        Unit unit;
        String name;
        if (DevelopmentFlags.f6092p.d()) {
            if (kotlin.jvm.internal.r.d(aVar, d.a.e.f6737a)) {
                String string = classDetailFragment.getString(R.string.booking_cancel_success);
                kotlin.jvm.internal.r.h(string, "getString(R.string.booking_cancel_success)");
                classDetailFragment.p1(string);
            } else if (kotlin.jvm.internal.r.d(aVar, d.a.i.f6741a)) {
                String string2 = classDetailFragment.getString(R.string.booking_you_have_left_waitlist);
                kotlin.jvm.internal.r.h(string2, "getString(R.string.booking_you_have_left_waitlist)");
                classDetailFragment.p1(string2);
            } else if (aVar instanceof d.a.RequestWaitlistSuccess) {
                ClassEntity classEntity = ((d.a.RequestWaitlistSuccess) aVar).getClassEntity();
                if (classEntity == null || (name = classEntity.getName()) == null) {
                    unit = null;
                } else {
                    String string3 = classDetailFragment.getString(R.string.booking_you_are_on_waitlist, name);
                    kotlin.jvm.internal.r.h(string3, "getString(\n             …                        )");
                    classDetailFragment.p1(string3);
                    unit = Unit.f33247a;
                }
                if (unit == null) {
                    String string4 = classDetailFragment.getString(R.string.booking_you_are_on_waitlist_null_class);
                    kotlin.jvm.internal.r.h(string4, "getString(R.string.booki…e_on_waitlist_null_class)");
                    classDetailFragment.p1(string4);
                }
            }
        }
        NavController findNavController = FragmentKt.findNavController(classDetailFragment);
        if (!(findNavController instanceof NavHostController) ? findNavController.popBackStack() : NavigationController.popBackStack((NavHostController) findNavController)) {
            return;
        }
        classDetailFragment.I0();
    }

    public final void I0() {
        ClassDetailViewModel.r1(w0(), v0().getClassInstanceId(), v0().getSiteId(), v0().getIsEnrollment(), null, 8, null);
    }

    private final void J0() {
        getParentFragmentManager().setFragmentResultListener("reservation_result_request_key", this, new FragmentResultListener() {
            @Override
            public final void onFragmentResult(String str, Bundle bundle) {
                ClassDetailFragment.K0(ClassDetailFragment.this, str, bundle);
            }
        });
    }

    public static final void K0(ClassDetailFragment this$0, String str, Bundle bundle) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        kotlin.jvm.internal.r.i(str, "<anonymous parameter 0>");
        kotlin.jvm.internal.r.i(bundle, "bundle");
        this$0.w0().i1(PickASpotFragment.INSTANCE.a(bundle));
    }

    public final void L0() {
        com.fitnessmobileapps.fma.feature.navigation.e.d(FragmentKt.findNavController(this), getString(R.string.profile_missing_billing_info_title), getString(R.string.profile_missing_billing_info), getString(R.string.profile_missing_billing_info_button), getString(R.string.not_now), "book.info.dialog.update.billing.info");
    }

    public final void M0(AllowCreateSubscriberClientProfileResult allowCreateSubscriberClientProfileResult) {
        if (allowCreateSubscriberClientProfileResult.getAllowCreateSubscriberClientProfile()) {
            com.fitnessmobileapps.fma.feature.navigation.e.d(FragmentKt.findNavController(this), getString(R.string.profile_missing_required_fields_title), getString(R.string.profile_missing_required_fields), getString(R.string.profile_missing_required_fields_button), getString(R.string.not_now), "book.info.dialog.update.profile");
        } else {
            com.fitnessmobileapps.fma.feature.navigation.e.b(FragmentKt.findNavController(this), allowCreateSubscriberClientProfileResult.e(), allowCreateSubscriberClientProfileResult.d(), CallToCompleteProfileFragment.Action.BOOK);
        }
    }

    public final void N0(ClassEntity classEntity) {
        String str;
        Context context = getContext();
        if (context == null || !(classEntity.getDateTime() instanceof h.StartDateTime)) {
            return;
        }
        long id2 = classEntity.getId();
        ZonedDateTime startDateTime = ((h.StartDateTime) classEntity.getDateTime()).getStartDateTime();
        String w10 = y3.b.w(((h.StartDateTime) classEntity.getDateTime()).getStartDateTime(), y3.a.q(), false, 4, null);
        if (w10 == null) {
            w10 = "TBD";
        }
        String str2 = w10;
        String name = classEntity.getName();
        String locationName = classEntity.getLocation().getLocationName();
        int siteId = classEntity.getLocation().getSiteId();
        ClassDetailViewModel w02 = w0();
        UserIdentityState value = x0().u().getValue();
        if (value == null || (str = value.getFirstName()) == null) {
            str = "";
        }
        Context requireContext = requireContext();
        kotlin.jvm.internal.r.h(requireContext, "requireContext()");
        String a10 = com.fitnessmobileapps.fma.core.compose.utils.b.a(requireContext, R.color.primary_brand);
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.r.h(requireContext2, "requireContext()");
        com.fitnessmobileapps.fma.util.d.d(context, new CheckInData(id2, startDateTime, str2, name, locationName, siteId, w02.n0(str, a10, com.fitnessmobileapps.fma.core.compose.utils.b.a(requireContext2, R.color.secondary_brand))));
    }

    public final void O0() {
        r2.d0 d0Var;
        x2 x2Var;
        ComposeView composeView = null;
        if (!w0().W1() && (d0Var = this.binding) != null && (x2Var = d0Var.f41847z) != null) {
            composeView = x2Var.f42501d;
        }
        if (composeView != null) {
            composeView.setContent(ComposableLambdaKt.composableLambdaInstance(-1945027652, true, new Function2<Composer, Integer, Unit>() {
                {
                    super(2);
                }

                @Override
                public Unit invoke(Composer composer, Integer num) {
                    invoke(composer, num.intValue());
                    return Unit.f33247a;
                }

                @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
                @Composable
                public final void invoke(Composer composer, int i10) {
                    if ((i10 & 11) == 2 && composer.getSkipping()) {
                        composer.skipToGroupEnd();
                        return;
                    }
                    if (ComposerKt.isTraceInProgress()) {
                        ComposerKt.traceEventStart(-1945027652, i10, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.setStaffIcon.<anonymous>.<anonymous> (ClassDetailFragment.kt:620)");
                    }
                    final ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                    ThemeKt.a(ComposableLambdaKt.composableLambda(composer, -2085097924, true, new Function2<Composer, Integer, Unit>() {
                        {
                            super(2);
                        }

                        @Override
                        public Unit invoke(Composer composer2, Integer num) {
                            invoke(composer2, num.intValue());
                            return Unit.f33247a;
                        }

                        @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
                        @Composable
                        public final void invoke(Composer composer2, int i11) {
                            if ((i11 & 11) == 2 && composer2.getSkipping()) {
                                composer2.skipToGroupEnd();
                                return;
                            }
                            if (ComposerKt.isTraceInProgress()) {
                                ComposerKt.traceEventStart(-2085097924, i11, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.setStaffIcon.<anonymous>.<anonymous>.<anonymous> (ClassDetailFragment.kt:621)");
                            }
                            w0 value = ClassDetailFragment.this.w0().getClassStaffViewModel().f().getValue();
                            AvatarKt.a(null, new a.C0141a(value != null ? i4.g.b(value) : null, 0.0f, 2, null), composer2, 0, 1);
                            if (ComposerKt.isTraceInProgress()) {
                                ComposerKt.traceEventEnd();
                            }
                        }
                    }), composer, 6);
                    if (ComposerKt.isTraceInProgress()) {
                        ComposerKt.traceEventEnd();
                    }
                }
            }));
        }
    }

    private final void P0() {
        getParentFragmentManager().setFragmentResultListener("book.info.dialog.update.profile", this, new FragmentResultListener() {
            @Override
            public final void onFragmentResult(String str, Bundle bundle) {
                ClassDetailFragment.Q0(ClassDetailFragment.this, str, bundle);
            }
        });
        getParentFragmentManager().setFragmentResultListener("book.info.dialog.update.billing.info", this, new FragmentResultListener() {
            @Override
            public final void onFragmentResult(String str, Bundle bundle) {
                ClassDetailFragment.R0(ClassDetailFragment.this, str, bundle);
            }
        });
    }

    public static final void Q0(ClassDetailFragment this$0, String str, Bundle bundle) {
        FragmentActivity activity;
        kotlin.jvm.internal.r.i(this$0, "this$0");
        kotlin.jvm.internal.r.i(bundle, "bundle");
        if (bundle.getInt("book.info.dialog.result.action") != 3 || (activity = this$0.getActivity()) == null) {
            return;
        }
        this$0.updateProfileLauncher.launch(new Intent(activity, (Class<?>) EditProfileActivity.class));
    }

    public static final void R0(ClassDetailFragment this$0, String str, Bundle bundle) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        kotlin.jvm.internal.r.i(bundle, "bundle");
        if (bundle.getInt("book.info.dialog.result.action") == 3) {
            this$0.addPaymentCardActivityLauncher.launch(AddPaymentCardActivity.B0(this$0.requireContext(), null, Boolean.TRUE));
        }
    }

    public final void S0() {
        String firstName;
        String firstName2;
        String str = "";
        if (DevelopmentFlags.f6100z.d()) {
            ClassDetailViewModel w02 = w0();
            UserIdentityState value = x0().u().getValue();
            if (value != null && (firstName2 = value.getFirstName()) != null) {
                str = firstName2;
            }
            Context requireContext = requireContext();
            kotlin.jvm.internal.r.h(requireContext, "requireContext()");
            String a10 = com.fitnessmobileapps.fma.core.compose.utils.b.a(requireContext, R.color.primary_brand);
            Context requireContext2 = requireContext();
            kotlin.jvm.internal.r.h(requireContext2, "requireContext()");
            Flow onEach = FlowKt.onEach(w02.Q1(str, a10, com.fitnessmobileapps.fma.core.compose.utils.b.a(requireContext2, R.color.secondary_brand)), new ClassDetailFragment$shareClass$1(this, null));
            LifecycleOwner viewLifecycleOwner = getViewLifecycleOwner();
            kotlin.jvm.internal.r.h(viewLifecycleOwner, "viewLifecycleOwner");
            FlowKt.launchIn(onEach, LifecycleOwnerKt.getLifecycleScope(viewLifecycleOwner));
            return;
        }
        Context requireContext3 = requireContext();
        kotlin.jvm.internal.r.h(requireContext3, "requireContext()");
        ClassDetailViewModel w03 = w0();
        ClassDetailViewModel w04 = w0();
        UserIdentityState value2 = x0().u().getValue();
        if (value2 != null && (firstName = value2.getFirstName()) != null) {
            str = firstName;
        }
        Context requireContext4 = requireContext();
        kotlin.jvm.internal.r.h(requireContext4, "requireContext()");
        String a11 = com.fitnessmobileapps.fma.core.compose.utils.b.a(requireContext4, R.color.primary_brand);
        Context requireContext5 = requireContext();
        kotlin.jvm.internal.r.h(requireContext5, "requireContext()");
        startActivity(w3.c.b(requireContext3, w03.P1(w04.n0(str, a11, com.fitnessmobileapps.fma.core.compose.utils.b.a(requireContext5, R.color.secondary_brand))), w0().getIsInviteAFriendEnabled()));
    }

    private final void T0(String message, DialogInterface.OnClickListener listener) {
        Context context = getContext();
        if (context != null) {
            new qb.b(context).setMessage(message).setPositiveButton(android.R.string.ok, listener).show();
        }
    }

    static void U0(ClassDetailFragment classDetailFragment, String str, DialogInterface.OnClickListener onClickListener, int i10, Object obj) {
        if ((i10 & 2) != 0) {
            onClickListener = null;
        }
        classDetailFragment.T0(str, onClickListener);
    }

    public final void V0() {
        String string = getString(R.string.add_client_to_class_failed);
        kotlin.jvm.internal.r.h(string, "getString(R.string.add_client_to_class_failed)");
        T0(string, new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i10) {
                ClassDetailFragment.W0(ClassDetailFragment.this, dialogInterface, i10);
            }
        });
    }

    public static final void W0(ClassDetailFragment this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        ClassDetailViewModel.r1(this$0.w0(), this$0.v0().getClassInstanceId(), this$0.v0().getSiteId(), this$0.v0().getIsEnrollment(), null, 8, null);
    }

    public final void X0(ClassEntity classEntity, boolean showCalendar, final d.a action) {
        ComposeView composeView;
        UserIdentityState value = x0().u().getValue();
        String str = null;
        if (value != null && value.getIsRelated()) {
            str = value.getFirstName();
        }
        if (DevelopmentFlags.f6087e.d()) {
            x0().I(true);
            BottomSheetUtilsKt.r(this, new BookingSuccessBottomSheetState(new s.b(classEntity, str), !showCalendar, w0().getIsInviteAFriendEnabled(), false, 8, null), new Function0<Unit>() {
                {
                    super(0);
                }

                @Override
                public Unit invoke() {
                    invoke2();
                    return Unit.f33247a;
                }

                public final void invoke2() {
                    a2.a.O(b.e.f217a.g(), b.g.f246a.e());
                    ClassDetailFragment.this.S0();
                }
            }, new Function0<Unit>() {
                {
                    super(0);
                }

                @Override
                public Unit invoke() {
                    invoke2();
                    return Unit.f33247a;
                }

                public final void invoke2() {
                    a2.a.e(b.e.f217a.g(), b.g.f246a.e());
                    ClassDetailFragment.this.w0().getClassHeaderViewModel().s();
                }
            }, new Function0<Unit>() {
                {
                    super(0);
                }

                @Override
                public Unit invoke() {
                    invoke2();
                    return Unit.f33247a;
                }

                public final void invoke2() {
                    if (DevelopmentFlags.f6092p.d()) {
                        ClassDetailFragment.this.F0(action);
                    }
                }
            });
            return;
        }
        final r rVar = new r();
        rVar.f(new s.b(classEntity, str), !showCalendar);
        r2.d0 d0Var = this.binding;
        if (d0Var == null || (composeView = d0Var.C) == null) {
            return;
        }
        composeView.setContent(ComposableLambdaKt.composableLambdaInstance(476477056, true, new Function2<Composer, Integer, Unit>() {
            {
                super(2);
            }

            @Override
            public Unit invoke(Composer composer, Integer num) {
                invoke(composer, num.intValue());
                return Unit.f33247a;
            }

            @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
            @Composable
            public final void invoke(Composer composer, int i10) {
                if ((i10 & 11) == 2 && composer.getSkipping()) {
                    composer.skipToGroupEnd();
                    return;
                }
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventStart(476477056, i10, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.showBookingConfirmation.<anonymous> (ClassDetailFragment.kt:754)");
                }
                final r rVar2 = r.this;
                final ClassDetailFragment classDetailFragment = this;
                ThemeKt.a(ComposableLambdaKt.composableLambda(composer, 429265920, true, new Function2<Composer, Integer, Unit>() {
                    {
                        super(2);
                    }

                    @Override
                    public Unit invoke(Composer composer2, Integer num) {
                        invoke(composer2, num.intValue());
                        return Unit.f33247a;
                    }

                    @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
                    @Composable
                    public final void invoke(Composer composer2, int i11) {
                        if ((i11 & 11) == 2 && composer2.getSkipping()) {
                            composer2.skipToGroupEnd();
                            return;
                        }
                        if (ComposerKt.isTraceInProgress()) {
                            ComposerKt.traceEventStart(429265920, i11, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.showBookingConfirmation.<anonymous>.<anonymous> (ClassDetailFragment.kt:755)");
                        }
                        r rVar3 = r.this;
                        final ClassDetailFragment classDetailFragment2 = classDetailFragment;
                        Function0<Unit> function0 = new Function0<Unit>() {
                            {
                                super(0);
                            }

                            @Override
                            public Unit invoke() {
                                invoke2();
                                return Unit.f33247a;
                            }

                            public final void invoke2() {
                                a2.a.e(b.e.f217a.g(), b.g.f246a.m());
                                ClassDetailFragment.this.w0().getClassHeaderViewModel().s();
                            }
                        };
                        final ClassDetailFragment classDetailFragment3 = classDetailFragment;
                        BookingSuccessDialogKt.a(rVar3, function0, new Function1<s, Unit>() {
                            {
                                super(1);
                            }

                            public final void a(s it) {
                                UserViewModel x02;
                                kotlin.jvm.internal.r.i(it, "it");
                                x02 = ClassDetailFragment.this.x0();
                                x02.I(true);
                                ClassDetailFragment.this.I0();
                            }

                            @Override
                            public Unit invoke(s sVar) {
                                a(sVar);
                                return Unit.f33247a;
                            }
                        }, composer2, 8, 0);
                        if (ComposerKt.isTraceInProgress()) {
                            ComposerKt.traceEventEnd();
                        }
                    }
                }), composer, 6);
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventEnd();
                }
            }
        }));
    }

    static void Y0(ClassDetailFragment classDetailFragment, ClassEntity classEntity, boolean z10, d.a aVar, int i10, Object obj) {
        if ((i10 & 4) != 0) {
            aVar = null;
        }
        classDetailFragment.X0(classEntity, z10, aVar);
    }

    public final void Z0(final List<UserCalendarEntity> calendars) {
        Context context = getContext();
        if (context != null) {
            qb.b bVar = new qb.b(context);
            ArrayList arrayList = new ArrayList(kotlin.collections.p.y(calendars, 10));
            Iterator<T> it = calendars.iterator();
            while (it.hasNext()) {
                arrayList.add(((UserCalendarEntity) it.next()).getName());
            }
            bVar.setSingleChoiceItems((CharSequence[]) arrayList.toArray(new String[0]), -1, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.a1(ClassDetailFragment.this, calendars, dialogInterface, i10);
                }
            }).show();
        }
    }

    public static final void a1(ClassDetailFragment this$0, List calendars, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        kotlin.jvm.internal.r.i(calendars, "$calendars");
        this$0.t0(((UserCalendarEntity) calendars.get(i10)).getId());
        dialogInterface.dismiss();
    }

    public final void b1() {
        String string = getString(R.string.cancel_error_message);
        kotlin.jvm.internal.r.h(string, "getString(R.string.cancel_error_message)");
        U0(this, string, null, 2, null);
    }

    public final void c1() {
        Context context = getContext();
        if (context != null) {
            new qb.b(context).setMessage(R.string.leave_waitlist_message).setPositiveButton(R.string.leave_waitlist_button_text, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.d1(ClassDetailFragment.this, dialogInterface, i10);
                }
            }).setNegativeButton(R.string.dismiss, null).show();
        }
    }

    public static final void d1(ClassDetailFragment this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        this$0.w0().p1();
    }

    public final void e1(final String phoneNumber) {
        Context context = getContext();
        if (context != null) {
            new qb.b(context).setMessage(getString(R.string.cannot_cancel_message, phoneNumber)).setPositiveButton(R.string.call_menu_title, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.f1(phoneNumber, this, dialogInterface, i10);
                }
            }).setNegativeButton(R.string.dismiss, null).show();
        }
    }

    public static final void f1(String phoneNumber, ClassDetailFragment this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(phoneNumber, "$phoneNumber");
        kotlin.jvm.internal.r.i(this$0, "this$0");
        Intent intent = new Intent();
        intent.setAction("android.intent.action.DIAL");
        intent.setData(Uri.parse("tel: " + phoneNumber));
        this$0.startActivity(intent);
    }

    public final void g1() {
        Context context = getContext();
        if (context != null) {
            new qb.b(context).setMessage(R.string.spot_not_available_full_class_message).setPositiveButton(R.string.view_schedule, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.h1(ClassDetailFragment.this, dialogInterface, i10);
                }
            }).setNegativeButton(R.string.dismiss, null).setCancelable(false).show();
        }
    }

    public static final void h1(ClassDetailFragment this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        G0(this$0, null, 1, null);
    }

    public final void i1() {
        Context context = getContext();
        if (context != null) {
            new qb.b(context).setMessage(R.string.spot_not_available_waitlist_class_message).setPositiveButton(R.string.action_waitlist_class, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.j1(ClassDetailFragment.this, dialogInterface, i10);
                }
            }).setNegativeButton(R.string.dismiss, null).setCancelable(false).show();
        }
    }

    public static final void j1(ClassDetailFragment this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        this$0.w0().o0();
    }

    private final void k1(DialogFragment dialogFragment, String tag) {
        FragmentManager supportFragmentManager;
        FragmentActivity activity = getActivity();
        if (activity == null || (supportFragmentManager = activity.getSupportFragmentManager()) == null) {
            return;
        }
        dialogFragment.show(supportFragmentManager, tag);
    }

    public final void l1() {
        Context context = getContext();
        if (context != null) {
            new qb.b(context).setMessage(R.string.cancel_class_confirmation_message).setPositiveButton(R.string.cancel_booking_button_text, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.m1(ClassDetailFragment.this, dialogInterface, i10);
                }
            }).setNegativeButton(R.string.dismiss, null).show();
        }
    }

    public static final void m1(ClassDetailFragment this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        this$0.w0().m0(false);
    }

    public final void n1() {
        Context context = getContext();
        if (context != null) {
            new qb.b(context).setMessage(R.string.class_late_cancel_message).setPositiveButton(R.string.late_cancel_booking_button_text, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.o1(ClassDetailFragment.this, dialogInterface, i10);
                }
            }).setNegativeButton(R.string.dismiss, null).show();
        }
    }

    public static final void o1(ClassDetailFragment this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        this$0.w0().m0(true);
    }

    public final void p1(String message) {
        r2.d0 d0Var = this.binding;
        if (d0Var != null) {
            Snackbar.n0(d0Var.f41841r, message, -1).V(d0Var.M).a0();
        }
    }

    public final void q1(String spotNumber) {
        String string = getString(R.string.spot_changed, spotNumber);
        kotlin.jvm.internal.r.h(string, "getString(R.string.spot_changed, spotNumber)");
        p1(string);
    }

    public final void r1(final d.AbstractC0184d.PickASpot pickASpot, final ClassEntity classEntity, final boolean showCalendar) {
        Context context = getContext();
        if (context != null) {
            cg.a aVar = cg.a.f1700a;
            String string = getString(R.string.spot_not_available);
            kotlin.jvm.internal.r.h(string, "getString(R.string.spot_not_available)");
            cg.a.c(aVar, string, null, 2, null);
            new qb.b(context).setTitle(R.string.something_went_wrong).setMessage(R.string.spot_not_available).setPositiveButton(R.string.try_again, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.s1(ClassDetailFragment.this, pickASpot, dialogInterface, i10);
                }
            }).setNegativeButton(R.string.dismiss, new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i10) {
                    ClassDetailFragment.t1(ClassDetailFragment.this, classEntity, showCalendar, dialogInterface, i10);
                }
            }).show();
        }
    }

    public static final void s1(ClassDetailFragment this$0, d.AbstractC0184d.PickASpot pickASpot, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        kotlin.jvm.internal.r.i(pickASpot, "$pickASpot");
        dialogInterface.dismiss();
        this$0.D0(pickASpot);
    }

    public final void showError(Throwable error) {
        FragmentManager supportFragmentManager;
        FragmentActivity activity = getActivity();
        if (((DialogFragment) ((activity == null || (supportFragmentManager = activity.getSupportFragmentManager()) == null) ? null : supportFragmentManager.findFragmentByTag("error dialog tag"))) == null) {
            if (error instanceof NoNetworkException) {
                showError(new com.fitnessmobileapps.fma.feature.profile.presentation.q(null, false, 3, null));
                return;
            }
            if (error instanceof VolleyError) {
                showError(new com.fitnessmobileapps.fma.feature.profile.presentation.q(null, false, 3, null));
                return;
            }
            if (!(error instanceof ApplicationException)) {
                showError(new com.fitnessmobileapps.fma.feature.profile.presentation.l(null, 1, null));
                return;
            }
            String message = error.getMessage();
            if (message == null) {
                message = "";
            }
            U0(this, message, null, 2, null);
        }
    }

    public final void t0(long calendarId) {
        w0().getClassHeaderViewModel().t(calendarId, new Function1<com.fitnessmobileapps.fma.core.functional.h<Boolean>, Unit>() {
            {
                super(1);
            }

            public final void a(com.fitnessmobileapps.fma.core.functional.h<Boolean> result) {
                kotlin.jvm.internal.r.i(result, "result");
                ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                String string = classDetailFragment.getString(result instanceof h.Success ? R.string.calendar_added_success : R.string.calendar_not_available);
                kotlin.jvm.internal.r.h(string, "getString(\n             …      }\n                )");
                classDetailFragment.p1(string);
            }

            @Override
            public Unit invoke(com.fitnessmobileapps.fma.core.functional.h<Boolean> hVar) {
                a(hVar);
                return Unit.f33247a;
            }
        });
    }

    public static final void t1(ClassDetailFragment this$0, ClassEntity classEntity, boolean z10, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.r.i(this$0, "this$0");
        kotlin.jvm.internal.r.i(classEntity, "$classEntity");
        dialogInterface.dismiss();
        this$0.showConfirmation = false;
        Y0(this$0, classEntity, z10, null, 4, null);
    }

    public final void u0() {
        ClassDetailViewModel w02 = w0();
        GateKeeper gateKeeper = GateKeeper.f21219a;
        w02.M1(gateKeeper.m(this, "android.permission.WRITE_CALENDAR") || gateKeeper.m(this, "android.permission.READ_CALENDAR"));
    }

    public final void u1() {
        String string = getString(R.string.add_client_to_class_failed);
        kotlin.jvm.internal.r.h(string, "getString(R.string.add_client_to_class_failed)");
        U0(this, string, null, 2, null);
    }

    public final ClassDetailFragmentArgs v0() {
        return (ClassDetailFragmentArgs) this.args.getValue();
    }

    public final ClassDetailViewModel w0() {
        return (ClassDetailViewModel) this.detailViewModel.getValue();
    }

    public final UserViewModel x0() {
        return (UserViewModel) this.userViewModel.getValue();
    }

    public final void y0(ClassEntity classEntity) {
        Intent intent = new Intent(requireContext(), (Class<?>) BuyServicesActivity.class);
        Bundle bundle = new Bundle();
        bundle.putParcelable("posServicesFragment_ARG_CLASS", x1.x.b(classEntity, v0().getIsEnrollment()));
        bundle.putString("posServicesFragment_ARG_REGION", b.e.f217a.g());
        intent.putExtras(bundle);
        this.buyLauncher.launch(intent);
    }

    public final void z0(ClassEntity classEntity) {
        FragmentKt.findNavController(this).navigate(h0.INSTANCE.c(x1.x.b(classEntity, false)));
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        P0();
        J0();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        kotlin.jvm.internal.r.i(inflater, "inflater");
        r2.d0 c10 = r2.d0.c(inflater);
        this.binding = c10;
        c10.i(w0());
        c10.g(x0());
        c10.setLifecycleOwner(getViewLifecycleOwner());
        MaterialToolbar onCreateView$lambda$1$lambda$0 = c10.f41836e.f42062c;
        if (v0().getIsModal()) {
            kotlin.jvm.internal.r.h(onCreateView$lambda$1$lambda$0, "onCreateView$lambda$1$lambda$0");
            ToolbarKt.f(onCreateView$lambda$1$lambda$0, FragmentKt.findNavController(this), getActivity());
        } else {
            kotlin.jvm.internal.r.h(onCreateView$lambda$1$lambda$0, "onCreateView$lambda$1$lambda$0");
            ToolbarKt.d(onCreateView$lambda$1$lambda$0, FragmentKt.findNavController(this), getActivity());
        }
        onCreateView$lambda$1$lambda$0.inflateMenu(R.menu.menu_class_detail);
        onCreateView$lambda$1$lambda$0.setOnMenuItemClickListener(this);
        n3 n3Var = c10.f41839p.f42126e;
        kotlin.jvm.internal.r.h(n3Var, "classDescription.descriptionText");
        LifecycleOwner viewLifecycleOwner = getViewLifecycleOwner();
        kotlin.jvm.internal.r.h(viewLifecycleOwner, "viewLifecycleOwner");
        ViewMoreTextViewBindingKt.c(n3Var, viewLifecycleOwner, 0, false, null, null, 30, null);
        n3 n3Var2 = c10.f41839p.f42127k;
        kotlin.jvm.internal.r.h(n3Var2, "classDescription.prerequisiteNotes");
        LifecycleOwner viewLifecycleOwner2 = getViewLifecycleOwner();
        kotlin.jvm.internal.r.h(viewLifecycleOwner2, "viewLifecycleOwner");
        ViewMoreTextViewBindingKt.c(n3Var2, viewLifecycleOwner2, 0, false, null, null, 30, null);
        View root = c10.getRoot();
        kotlin.jvm.internal.r.h(root, "inflate(inflater).apply …ifecycleOwner)\n    }.root");
        return root;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        this.binding = null;
    }

    @Override
    public boolean onMenuItemClick(MenuItem item) {
        kotlin.jvm.internal.r.i(item, "item");
        if (item.getItemId() != R.id.share) {
            return false;
        }
        a2.a.O(b.e.f217a.g(), b.g.f246a.C());
        S0();
        return false;
    }

    @Override
    public void onResume() {
        super.onResume();
        w0().N1(true);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        r2.j jVar;
        kotlin.jvm.internal.r.i(view, "view");
        super.onViewCreated(view, savedInstanceState);
        r2.d0 d0Var = this.binding;
        MaterialToolbar materialToolbar = (d0Var == null || (jVar = d0Var.f41836e) == null) ? null : jVar.f42062c;
        if (materialToolbar != null) {
            Context context = getContext();
            materialToolbar.setTitle(context != null ? context.getString(R.string.book_class) : null);
        }
        u0();
        w0().O1(v0().getRegion());
        ClassDetailViewModel.r1(w0(), v0().getClassInstanceId(), v0().getSiteId(), v0().getIsEnrollment(), null, 8, null);
        CustomTabsClient.bindCustomTabsService(requireContext(), "com.android.chrome", new e());
        w0().getClassHeaderViewModel().y().observe(getViewLifecycleOwner(), new f(new Function1<Boolean, Unit>() {
            {
                super(1);
            }

            public final void a(Boolean bool) {
                GateKeeper gateKeeper = GateKeeper.f21219a;
                ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                gateKeeper.u(classDetailFragment, gj.i.a("android.permission.WRITE_CALENDAR", classDetailFragment.getString(R.string.permissions_request_calendar, classDetailFragment.getString(R.string.bma_app_name))));
            }

            @Override
            public Unit invoke(Boolean bool) {
                a(bool);
                return Unit.f33247a;
            }
        }));
        w0().getClassHeaderViewModel().w().observe(getViewLifecycleOwner(), new f(new Function1<n, Unit>() {
            {
                super(1);
            }

            public final void a(final n nVar) {
                r2.d0 d0Var2;
                n2 n2Var;
                r2.d0 d0Var3;
                p2 p2Var;
                ComposeView composeView = null;
                if (ClassDetailFragment.this.w0().W1()) {
                    d0Var3 = ClassDetailFragment.this.binding;
                    if (d0Var3 != null && (p2Var = d0Var3.f41844w) != null) {
                        composeView = p2Var.f42280w;
                    }
                } else {
                    d0Var2 = ClassDetailFragment.this.binding;
                    if (d0Var2 != null && (n2Var = d0Var2.f41842t) != null) {
                        composeView = n2Var.f42206r;
                    }
                }
                if (nVar == null || composeView == null) {
                    return;
                }
                composeView.setContent(ComposableLambdaKt.composableLambdaInstance(2004163092, true, new Function2<Composer, Integer, Unit>() {
                    {
                        super(2);
                    }

                    @Override
                    public Unit invoke(Composer composer, Integer num) {
                        invoke(composer, num.intValue());
                        return Unit.f33247a;
                    }

                    @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
                    @Composable
                    public final void invoke(Composer composer, int i10) {
                        if ((i10 & 11) == 2 && composer.getSkipping()) {
                            composer.skipToGroupEnd();
                            return;
                        }
                        if (ComposerKt.isTraceInProgress()) {
                            ComposerKt.traceEventStart(2004163092, i10, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.onViewCreated.<anonymous>.<anonymous>.<anonymous> (ClassDetailFragment.kt:242)");
                        }
                        final n nVar2 = n.this;
                        ThemeKt.a(ComposableLambdaKt.composableLambda(composer, -1192487020, true, new Function2<Composer, Integer, Unit>() {
                            {
                                super(2);
                            }

                            @Override
                            public Unit invoke(Composer composer2, Integer num) {
                                invoke(composer2, num.intValue());
                                return Unit.f33247a;
                            }

                            @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
                            @Composable
                            public final void invoke(Composer composer2, int i11) {
                                if ((i11 & 11) == 2 && composer2.getSkipping()) {
                                    composer2.skipToGroupEnd();
                                    return;
                                }
                                if (ComposerKt.isTraceInProgress()) {
                                    ComposerKt.traceEventStart(-1192487020, i11, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.onViewCreated.<anonymous>.<anonymous>.<anonymous>.<anonymous> (ClassDetailFragment.kt:243)");
                                }
                                BookingStatusChipKt.c(null, n.this, composer2, 0, 1);
                                if (ComposerKt.isTraceInProgress()) {
                                    ComposerKt.traceEventEnd();
                                }
                            }
                        }), composer, 6);
                        if (ComposerKt.isTraceInProgress()) {
                            ComposerKt.traceEventEnd();
                        }
                    }
                }));
            }

            @Override
            public Unit invoke(n nVar) {
                a(nVar);
                return Unit.f33247a;
            }
        }));
        w0().getClassHeaderViewModel().L().observe(getViewLifecycleOwner(), new f(new Function1<n, Unit>() {
            {
                super(1);
            }

            public final void a(final n nVar) {
                r2.d0 d0Var2;
                n2 n2Var;
                r2.d0 d0Var3;
                p2 p2Var;
                ComposeView composeView = null;
                if (ClassDetailFragment.this.w0().W1()) {
                    d0Var3 = ClassDetailFragment.this.binding;
                    if (d0Var3 != null && (p2Var = d0Var3.f41844w) != null) {
                        composeView = p2Var.f42279v;
                    }
                } else {
                    d0Var2 = ClassDetailFragment.this.binding;
                    if (d0Var2 != null && (n2Var = d0Var2.f41842t) != null) {
                        composeView = n2Var.f42205q;
                    }
                }
                if (nVar != null) {
                    ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                    if (composeView != null) {
                        if (classDetailFragment.w0().W1()) {
                            composeView.setContent(ComposableLambdaKt.composableLambdaInstance(751016524, true, new Function2<Composer, Integer, Unit>() {
                                {
                                    super(2);
                                }

                                @Override
                                public Unit invoke(Composer composer, Integer num) {
                                    invoke(composer, num.intValue());
                                    return Unit.f33247a;
                                }

                                @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
                                @Composable
                                public final void invoke(Composer composer, int i10) {
                                    if ((i10 & 11) == 2 && composer.getSkipping()) {
                                        composer.skipToGroupEnd();
                                        return;
                                    }
                                    if (ComposerKt.isTraceInProgress()) {
                                        ComposerKt.traceEventStart(751016524, i10, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.onViewCreated.<anonymous>.<anonymous>.<anonymous>.<anonymous> (ClassDetailFragment.kt:255)");
                                    }
                                    BookingStatusChipKt.a(n.this, composer, 0);
                                    if (ComposerKt.isTraceInProgress()) {
                                        ComposerKt.traceEventEnd();
                                    }
                                }
                            }));
                        } else {
                            BookingStatusChipKt.e(composeView, nVar);
                        }
                    }
                }
            }

            @Override
            public Unit invoke(n nVar) {
                a(nVar);
                return Unit.f33247a;
            }
        }));
        w0().T0().observe(getViewLifecycleOwner(), new f(new Function1<Boolean, Unit>() {
            {
                super(1);
            }

            public final void a(Boolean showLocation) {
                r2.d0 d0Var2;
                p2 p2Var;
                ComposeView composeView;
                kotlin.jvm.internal.r.h(showLocation, "showLocation");
                if (!showLocation.booleanValue() || !ClassDetailFragment.this.w0().W1() || d0Var2 == null || (p2Var = d0Var2.f41844w) == null || (composeView = p2Var.A) == null) {
                    return;
                }
                composeView.setContent(ComposableSingletons$ClassDetailFragmentKt.f6387a.b());
            }

            @Override
            public Unit invoke(Boolean bool) {
                a(bool);
                return Unit.f33247a;
            }
        }));
        w0().getClassHeaderViewModel().x().observe(getViewLifecycleOwner(), new f(new Function1<BookingSuccessActionState, Unit>() {
            {
                super(1);
            }

            public final void a(final BookingSuccessActionState bookingSuccessActionState) {
                r2.d0 d0Var2;
                n2 n2Var;
                r2.d0 d0Var3;
                p2 p2Var;
                ComposeView composeView = null;
                if (ClassDetailFragment.this.w0().W1()) {
                    d0Var3 = ClassDetailFragment.this.binding;
                    if (d0Var3 != null && (p2Var = d0Var3.f41844w) != null) {
                        composeView = p2Var.C;
                    }
                } else {
                    d0Var2 = ClassDetailFragment.this.binding;
                    if (d0Var2 != null && (n2Var = d0Var2.f41842t) != null) {
                        composeView = n2Var.f42211y;
                    }
                }
                if (!bookingSuccessActionState.getIsBooked()) {
                    if (composeView == null) {
                        return;
                    }
                    composeView.setVisibility(8);
                } else if (composeView != null) {
                    final ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                    composeView.setVisibility(0);
                    composeView.setContent(ComposableLambdaKt.composableLambdaInstance(-968795697, true, new Function2<Composer, Integer, Unit>() {
                        {
                            super(2);
                        }

                        @Override
                        public Unit invoke(Composer composer, Integer num) {
                            invoke(composer, num.intValue());
                            return Unit.f33247a;
                        }

                        @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
                        @Composable
                        public final void invoke(Composer composer, int i10) {
                            if ((i10 & 11) == 2 && composer.getSkipping()) {
                                composer.skipToGroupEnd();
                                return;
                            }
                            if (ComposerKt.isTraceInProgress()) {
                                ComposerKt.traceEventStart(-968795697, i10, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.onViewCreated.<anonymous>.<anonymous>.<anonymous> (ClassDetailFragment.kt:286)");
                            }
                            final BookingSuccessActionState bookingSuccessActionState2 = BookingSuccessActionState.this;
                            final ClassDetailFragment classDetailFragment2 = classDetailFragment;
                            ThemeKt.a(ComposableLambdaKt.composableLambda(composer, 1196283727, true, new Function2<Composer, Integer, Unit>() {
                                {
                                    super(2);
                                }

                                @Override
                                public Unit invoke(Composer composer2, Integer num) {
                                    invoke(composer2, num.intValue());
                                    return Unit.f33247a;
                                }

                                @ComposableTarget(applier = "androidx.compose.ui.UiComposable")
                                @Composable
                                public final void invoke(Composer composer2, int i11) {
                                    if ((i11 & 11) == 2 && composer2.getSkipping()) {
                                        composer2.skipToGroupEnd();
                                        return;
                                    }
                                    if (ComposerKt.isTraceInProgress()) {
                                        ComposerKt.traceEventStart(1196283727, i11, -1, "com.fitnessmobileapps.fma.feature.book.ClassDetailFragment.onViewCreated.<anonymous>.<anonymous>.<anonymous>.<anonymous> (ClassDetailFragment.kt:287)");
                                    }
                                    boolean addCalendarEnabled = BookingSuccessActionState.this.getAddCalendarEnabled();
                                    boolean isInviteAFriendEnabled = classDetailFragment2.w0().getIsInviteAFriendEnabled();
                                    final ClassDetailFragment classDetailFragment3 = classDetailFragment2;
                                    Function0<Unit> function0 = new Function0<Unit>() {
                                        {
                                            super(0);
                                        }

                                        @Override
                                        public Unit invoke() {
                                            invoke2();
                                            return Unit.f33247a;
                                        }

                                        public final void invoke2() {
                                            a2.a.O(b.e.f217a.g(), b.g.f246a.h());
                                            ClassDetailFragment.this.S0();
                                        }
                                    };
                                    final ClassDetailFragment classDetailFragment4 = classDetailFragment2;
                                    BookingSuccessActionsKt.c(null, addCalendarEnabled, function0, new Function0<Unit>() {
                                        {
                                            super(0);
                                        }

                                        @Override
                                        public Unit invoke() {
                                            invoke2();
                                            return Unit.f33247a;
                                        }

                                        public final void invoke2() {
                                            a2.a.e(b.e.f217a.g(), b.g.f246a.h());
                                            ClassDetailFragment.this.w0().getClassHeaderViewModel().s();
                                        }
                                    }, isInviteAFriendEnabled, composer2, 0, 1);
                                    if (ComposerKt.isTraceInProgress()) {
                                        ComposerKt.traceEventEnd();
                                    }
                                }
                            }), composer, 6);
                            if (ComposerKt.isTraceInProgress()) {
                                ComposerKt.traceEventEnd();
                            }
                        }
                    }));
                }
            }

            @Override
            public Unit invoke(BookingSuccessActionState bookingSuccessActionState) {
                a(bookingSuccessActionState);
                return Unit.f33247a;
            }
        }));
        GateKeeper gateKeeper = GateKeeper.f21219a;
        final String[] b10 = q0.INSTANCE.b();
        FragmentActivity activity = getActivity();
        if (activity != null) {
            String simpleName = getClass().getSimpleName();
            kotlin.jvm.internal.r.h(simpleName, "getSimpleName(...)");
            gateKeeper.f(activity, simpleName, this, this);
        }
        FragmentActivity activity2 = getActivity();
        if (activity2 != null) {
            String simpleName2 = getClass().getSimpleName();
            kotlin.jvm.internal.r.h(simpleName2, "getSimpleName(...)");
            gateKeeper.e(activity2, simpleName2, this);
            MutableLiveData<com.mindbodyonline.gatekeeper.d> mutableLiveData = gateKeeper.j().get(simpleName2);
            if (mutableLiveData != null) {
                mutableLiveData.observe(this, new GateKeeper.c(new Function1<com.mindbodyonline.gatekeeper.d, Unit>() {
                    {
                        super(1);
                    }

                    public final void a(com.mindbodyonline.gatekeeper.d dVar) {
                        boolean e02;
                        com.mindbodyonline.gatekeeper.e b11;
                        e02 = ArraysKt___ArraysKt.e0(b10, dVar.a());
                        if (!e02 || (b11 = dVar.b()) == null) {
                            return;
                        }
                        if (!(b11 instanceof e.a)) {
                            if (b11 instanceof e.b) {
                                this.u0();
                            }
                        } else if (kotlin.jvm.internal.r.d(b11.getPermission(), "android.permission.WRITE_CALENDAR")) {
                            GateKeeper gateKeeper2 = GateKeeper.f21219a;
                            ClassDetailFragment classDetailFragment = this;
                            gateKeeper2.u(classDetailFragment, gj.i.a("android.permission.READ_CALENDAR", classDetailFragment.getString(R.string.calendar_rationale)));
                        } else {
                            ClassHeaderViewModel classHeaderViewModel = this.w0().getClassHeaderViewModel();
                            final ClassDetailFragment classDetailFragment2 = this;
                            classHeaderViewModel.z(new Function1<List<? extends UserCalendarEntity>, Unit>() {
                                {
                                    super(1);
                                }

                                @Override
                                public Unit invoke(List<? extends UserCalendarEntity> list) {
                                    invoke2((List<UserCalendarEntity>) list);
                                    return Unit.f33247a;
                                }

                                public final void invoke2(List<UserCalendarEntity> it) {
                                    kotlin.jvm.internal.r.i(it, "it");
                                    if (it.size() == 1) {
                                        ClassDetailFragment.this.t0(((UserCalendarEntity) CollectionsKt___CollectionsKt.s0(it)).getId());
                                    } else {
                                        ClassDetailFragment.this.Z0(it);
                                    }
                                }
                            });
                        }
                    }

                    @Override
                    public Unit invoke(com.mindbodyonline.gatekeeper.d dVar) {
                        a(dVar);
                        return Unit.f33247a;
                    }
                }));
            }
        }
        x0().r().observe(getViewLifecycleOwner(), new f(new Function1<Boolean, Unit>() {
            {
                super(1);
            }

            public final void a(Boolean bool) {
                UserViewModel x02;
                NavController findNavController = FragmentKt.findNavController(ClassDetailFragment.this);
                h0.Companion companion = h0.INSTANCE;
                b.e eVar = b.e.f217a;
                findNavController.navigate(companion.e(eVar.g()));
                x02 = ClassDetailFragment.this.x0();
                x02.F(eVar.g(), vf.q.f44386a.d());
            }

            @Override
            public Unit invoke(Boolean bool) {
                a(bool);
                return Unit.f33247a;
            }
        }));
        w0().getClassStaffViewModel().g().observe(getViewLifecycleOwner(), new f(new Function1<Boolean, Unit>() {
            {
                super(1);
            }

            public final void a(Boolean bool) {
                w0 value = ClassDetailFragment.this.w0().getClassStaffViewModel().f().getValue();
                if (value != null) {
                    ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                    if (value instanceof w0.Named) {
                        FragmentKt.findNavController(classDetailFragment).navigate(h0.INSTANCE.d(((w0.Named) value).getStaff().getId(), String.valueOf(classDetailFragment.v0().getSiteId()), b.e.f217a.g()));
                        return;
                    }
                    if (value instanceof w0.Substitute) {
                        FragmentKt.findNavController(classDetailFragment).navigate(h0.INSTANCE.d(((w0.Substitute) value).getStaff().getId(), String.valueOf(classDetailFragment.v0().getSiteId()), b.e.f217a.g()));
                    } else if (value instanceof w0.Assistant) {
                        FragmentKt.findNavController(classDetailFragment).navigate(h0.INSTANCE.d(((w0.Assistant) value).getStaff().getId(), String.valueOf(classDetailFragment.v0().getSiteId()), b.e.f217a.g()));
                    } else {
                        boolean z10 = value instanceof w0.b;
                    }
                }
            }

            @Override
            public Unit invoke(Boolean bool) {
                a(bool);
                return Unit.f33247a;
            }
        }));
        w0().getClassSpotReservationViewModel().a().observe(getViewLifecycleOwner(), new f(new Function1<d.AbstractC0184d.PickASpot, Unit>() {
            {
                super(1);
            }

            public final void a(d.AbstractC0184d.PickASpot it) {
                ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                kotlin.jvm.internal.r.h(it, "it");
                classDetailFragment.D0(it);
            }

            @Override
            public Unit invoke(d.AbstractC0184d.PickASpot pickASpot) {
                a(pickASpot);
                return Unit.f33247a;
            }
        }));
        w0().w0().observe(getViewLifecycleOwner(), new f(new Function1<com.fitnessmobileapps.fma.feature.book.presentation.d, Unit>() {
            {
                super(1);
            }

            public final void a(com.fitnessmobileapps.fma.feature.book.presentation.d action) {
                UserViewModel x02;
                UserViewModel x03;
                UserViewModel x04;
                String name;
                boolean z10;
                UserViewModel x05;
                if (kotlin.jvm.internal.r.d(action, d.a.m.f6745a)) {
                    ClassDetailFragment.this.E0();
                    return;
                }
                if (action instanceof d.a.BookMultiple) {
                    ClassDetailFragment.this.z0(((d.a.BookMultiple) action).getClassEntity());
                    return;
                }
                if (action instanceof d.a.BuyPass) {
                    ClassDetailFragment.this.y0(((d.a.BuyPass) action).getClassEntity());
                    return;
                }
                if (action instanceof d.a.OpenFitmetrix) {
                    ClassDetailFragment.this.A0(((d.a.OpenFitmetrix) action).getFitmetrixView());
                    return;
                }
                if (kotlin.jvm.internal.r.d(action, d.a.f.f6738a)) {
                    ClassDetailFragment.this.l1();
                    return;
                }
                if (kotlin.jvm.internal.r.d(action, d.a.g.f6739a)) {
                    ClassDetailFragment.this.n1();
                    return;
                }
                if (kotlin.jvm.internal.r.d(action, d.a.h.f6740a)) {
                    ClassDetailFragment.this.c1();
                    return;
                }
                if (action instanceof d.a.BookingSuccess) {
                    z10 = ClassDetailFragment.this.showConfirmation;
                    if (z10) {
                        ClassDetailFragment.this.w0().K1();
                        d.a.BookingSuccess bookingSuccess = (d.a.BookingSuccess) action;
                        ClassDetailFragment.this.X0(bookingSuccess.getClassEntity(), bookingSuccess.getShowCalendar(), (d.a) action);
                    } else {
                        x05 = ClassDetailFragment.this.x0();
                        x05.I(true);
                        if (DevelopmentFlags.f6092p.d()) {
                            ClassDetailFragment.this.F0((d.a) action);
                        } else {
                            ClassDetailFragment.this.I0();
                        }
                        String spotNumber = ((d.a.BookingSuccess) action).getSpotNumber();
                        if (spotNumber != null) {
                            ClassDetailFragment.this.q1(spotNumber);
                        }
                    }
                    if (DevelopmentFlags.H.d()) {
                        ClassDetailFragment.this.N0(((d.a.BookingSuccess) action).getClassEntity());
                        return;
                    }
                    return;
                }
                if (action instanceof d.a.RequestWaitlistSuccess) {
                    x04 = ClassDetailFragment.this.x0();
                    x04.I(true);
                    if (DevelopmentFlags.f6092p.d()) {
                        ClassDetailFragment.this.F0(new d.a.RequestWaitlistSuccess(((d.a.RequestWaitlistSuccess) action).getClassEntity()));
                        return;
                    }
                    ClassEntity classEntity = ((d.a.RequestWaitlistSuccess) action).getClassEntity();
                    if (classEntity == null || (name = classEntity.getName()) == null) {
                        final ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                        new Function0<Unit>() {
                            {
                                super(0);
                            }

                            @Override
                            public Unit invoke() {
                                invoke2();
                                return Unit.f33247a;
                            }

                            public final void invoke2() {
                                ClassDetailFragment classDetailFragment2 = ClassDetailFragment.this;
                                String string = classDetailFragment2.getString(R.string.booking_you_are_on_waitlist_null_class);
                                kotlin.jvm.internal.r.h(string, "getString(R.string.booki…e_on_waitlist_null_class)");
                                classDetailFragment2.p1(string);
                            }
                        };
                    } else {
                        ClassDetailFragment classDetailFragment2 = ClassDetailFragment.this;
                        String string = classDetailFragment2.getString(R.string.booking_you_are_on_waitlist, name);
                        kotlin.jvm.internal.r.h(string, "getString(\n             …                        )");
                        classDetailFragment2.p1(string);
                        Unit unit = Unit.f33247a;
                    }
                    ClassDetailFragment.this.I0();
                    return;
                }
                d.a.e eVar = d.a.e.f6737a;
                if (kotlin.jvm.internal.r.d(action, eVar)) {
                    x03 = ClassDetailFragment.this.x0();
                    x03.I(true);
                    if (DevelopmentFlags.H.d()) {
                        Context requireContext = ClassDetailFragment.this.requireContext();
                        kotlin.jvm.internal.r.h(requireContext, "requireContext()");
                        com.fitnessmobileapps.fma.util.d.a(requireContext, (int) ClassDetailFragment.this.v0().getClassInstanceId(), (int) ClassDetailFragment.this.v0().getSiteId());
                    }
                    if (DevelopmentFlags.f6092p.d()) {
                        ClassDetailFragment.this.F0(eVar);
                        return;
                    }
                    ClassDetailFragment classDetailFragment3 = ClassDetailFragment.this;
                    String string2 = classDetailFragment3.getString(R.string.booking_cancel_success);
                    kotlin.jvm.internal.r.h(string2, "getString(R.string.booking_cancel_success)");
                    classDetailFragment3.p1(string2);
                    ClassDetailFragment.this.I0();
                    return;
                }
                d.a.i iVar = d.a.i.f6741a;
                if (kotlin.jvm.internal.r.d(action, iVar)) {
                    x02 = ClassDetailFragment.this.x0();
                    x02.I(true);
                    if (DevelopmentFlags.f6092p.d()) {
                        ClassDetailFragment.this.F0(iVar);
                        return;
                    }
                    ClassDetailFragment classDetailFragment4 = ClassDetailFragment.this;
                    String string3 = classDetailFragment4.getString(R.string.booking_you_have_left_waitlist);
                    kotlin.jvm.internal.r.h(string3, "getString(R.string.booking_you_have_left_waitlist)");
                    classDetailFragment4.p1(string3);
                    ClassDetailFragment.this.I0();
                    return;
                }
                if (kotlin.jvm.internal.r.d(action, d.c.C0183c.f6749a)) {
                    ClassDetailFragment classDetailFragment5 = ClassDetailFragment.this;
                    String string4 = classDetailFragment5.getString(R.string.live_stream_too_early);
                    kotlin.jvm.internal.r.h(string4, "getString(R.string.live_stream_too_early)");
                    ClassDetailFragment.U0(classDetailFragment5, string4, null, 2, null);
                    return;
                }
                if (action instanceof d.c.Join) {
                    ClassDetailFragment.this.B0(((d.c.Join) action).getLivestreamUrl());
                    return;
                }
                if (kotlin.jvm.internal.r.d(action, d.c.b.f6748a)) {
                    ClassDetailFragment classDetailFragment6 = ClassDetailFragment.this;
                    String string5 = classDetailFragment6.getString(R.string.live_stream_ended);
                    kotlin.jvm.internal.r.h(string5, "getString(R.string.live_stream_ended)");
                    ClassDetailFragment.U0(classDetailFragment6, string5, null, 2, null);
                    return;
                }
                if (action instanceof d.AbstractC0184d.PickASpot) {
                    ClassDetailFragment classDetailFragment7 = ClassDetailFragment.this;
                    kotlin.jvm.internal.r.h(action, "action");
                    classDetailFragment7.D0((d.AbstractC0184d.PickASpot) action);
                    return;
                }
                if (action instanceof d.AbstractC0184d.SpotNotAvailable) {
                    d.AbstractC0184d.SpotNotAvailable spotNotAvailable = (d.AbstractC0184d.SpotNotAvailable) action;
                    ClassDetailFragment.this.r1(spotNotAvailable.getPickASpot(), spotNotAvailable.getClassEntity(), spotNotAvailable.getShowCalendar());
                    return;
                }
                if (action instanceof d.AbstractC0184d.SpotChanged) {
                    ClassDetailFragment.this.q1(((d.AbstractC0184d.SpotChanged) action).getSpotNumber());
                    return;
                }
                if (action instanceof d.AbstractC0184d.a) {
                    if (((d.AbstractC0184d.a) action).getReservationId() != null) {
                        ClassDetailFragment.this.g1();
                    }
                } else if (!(action instanceof d.AbstractC0184d.b)) {
                    mo.a.INSTANCE.a("Nothing to do here.", new Object[0]);
                } else if (((d.AbstractC0184d.b) action).getReservationId() != null) {
                    ClassDetailFragment.this.i1();
                }
            }

            @Override
            public Unit invoke(com.fitnessmobileapps.fma.feature.book.presentation.d dVar) {
                a(dVar);
                return Unit.f33247a;
            }
        }));
        w0().L0().observe(getViewLifecycleOwner(), new f(new Function1<SubscriberClientRequiredInfoResult, Unit>() {
            {
                super(1);
            }

            public final void a(SubscriberClientRequiredInfoResult subscriberClientRequiredInfoResult) {
                if (!subscriberClientRequiredInfoResult.getHasRequiredFields()) {
                    ClassDetailFragment.this.M0(subscriberClientRequiredInfoResult.getCanCreateProfile());
                } else {
                    if (subscriberClientRequiredInfoResult.getHasBillingInfo()) {
                        return;
                    }
                    ClassDetailFragment.this.L0();
                }
            }

            @Override
            public Unit invoke(SubscriberClientRequiredInfoResult subscriberClientRequiredInfoResult) {
                a(subscriberClientRequiredInfoResult);
                return Unit.f33247a;
            }
        }));
        w0().H0().observe(getViewLifecycleOwner(), new f(new Function1<com.fitnessmobileapps.fma.feature.book.presentation.e, Unit>() {
            {
                super(1);
            }

            public final void a(com.fitnessmobileapps.fma.feature.book.presentation.e eVar) {
                ActivityResultLauncher activityResultLauncher;
                if (kotlin.jvm.internal.r.d(eVar, e.a.f6759a)) {
                    ClassDetailFragment.this.V0();
                    return;
                }
                if (kotlin.jvm.internal.r.d(eVar, e.b.f6760a)) {
                    ClassDetailFragment.this.u1();
                    return;
                }
                if (kotlin.jvm.internal.r.d(eVar, e.c.f6761a)) {
                    ClassDetailFragment.this.b1();
                    return;
                }
                if (eVar instanceof e.CannotCancel) {
                    ClassDetailFragment.this.e1(((e.CannotCancel) eVar).getPhoneNumber());
                    return;
                }
                if (eVar instanceof e.SignInToClass) {
                    e.SignInToClass signInToClass = (e.SignInToClass) eVar;
                    Throwable throwable = signInToClass.getThrowable();
                    if (throwable instanceof OutsideSignInWindowException) {
                        ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                        String string = classDetailFragment.getString(R.string.check_in_error_outside_window);
                        kotlin.jvm.internal.r.h(string, "getString(R.string.check_in_error_outside_window)");
                        ClassDetailFragment.U0(classDetailFragment, string, null, 2, null);
                        return;
                    }
                    if (throwable instanceof OutsideCheckInRadiusException) {
                        BottomSheetUtilsKt.C(ClassDetailFragment.this);
                        return;
                    }
                    if ((throwable instanceof LocationPermissionsNotEnabledException) || (throwable instanceof PreciseLocationPermissionsNotEnabledException)) {
                        activityResultLauncher = ClassDetailFragment.this.locationPermissionRequest;
                        activityResultLauncher.launch(new String[]{"android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"});
                        final ClassDetailFragment classDetailFragment2 = ClassDetailFragment.this;
                        BottomSheetUtilsKt.w(classDetailFragment2, new Function0<Unit>() {
                            {
                                super(0);
                            }

                            @Override
                            public Unit invoke() {
                                invoke2();
                                return Unit.f33247a;
                            }

                            public final void invoke2() {
                                String packageName;
                                Context context2 = ClassDetailFragment.this.getContext();
                                if (context2 == null || (packageName = context2.getPackageName()) == null) {
                                    return;
                                }
                                ClassDetailFragment classDetailFragment3 = ClassDetailFragment.this;
                                Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
                                intent.setData(Uri.fromParts("package", packageName, null));
                                classDetailFragment3.startActivity(intent);
                            }
                        }, null, 2, null);
                        return;
                    }
                    if (!(throwable instanceof ApplicationException)) {
                        ClassDetailFragment.this.showError(signInToClass.getThrowable());
                        return;
                    }
                    ClassDetailFragment classDetailFragment3 = ClassDetailFragment.this;
                    String string2 = classDetailFragment3.getString(R.string.failed_check_in);
                    kotlin.jvm.internal.r.h(string2, "getString(R.string.failed_check_in)");
                    ClassDetailFragment.U0(classDetailFragment3, string2, null, 2, null);
                }
            }

            @Override
            public Unit invoke(com.fitnessmobileapps.fma.feature.book.presentation.e eVar) {
                a(eVar);
                return Unit.f33247a;
            }
        }));
        w0().getEmptyScreenViewModel().e().observe(getViewLifecycleOwner(), new f(new Function1<Boolean, Unit>() {
            {
                super(1);
            }

            public final void a(Boolean it) {
                kotlin.jvm.internal.r.h(it, "it");
                if (it.booleanValue()) {
                    ClassDetailViewModel.r1(ClassDetailFragment.this.w0(), ClassDetailFragment.this.v0().getClassInstanceId(), ClassDetailFragment.this.v0().getSiteId(), ClassDetailFragment.this.v0().getIsEnrollment(), null, 8, null);
                }
            }

            @Override
            public Unit invoke(Boolean bool) {
                a(bool);
                return Unit.f33247a;
            }
        }));
        w0().getClassStaffViewModel().f().observe(getViewLifecycleOwner(), new f(new Function1<w0, Unit>() {
            {
                super(1);
            }

            public final void a(w0 w0Var) {
                r2.d0 d0Var2;
                x2 x2Var;
                ClassDetailFragment.this.O0();
                d0Var2 = ClassDetailFragment.this.binding;
                ConstraintLayout constraintLayout = (d0Var2 == null || (x2Var = d0Var2.f41847z) == null) ? null : x2Var.f42504n;
                if (constraintLayout == null) {
                    return;
                }
                constraintLayout.setClickable(ClassDetailFragment.this.w0().getClassStaffViewModel().j());
            }

            @Override
            public Unit invoke(w0 w0Var) {
                a(w0Var);
                return Unit.f33247a;
            }
        }));
        if (DevelopmentFlags.f6099y.d()) {
            w0().x0().observe(getViewLifecycleOwner(), new f(new Function1<ClassEntity, Unit>() {
                {
                    super(1);
                }

                public final void a(ClassEntity classEntity) {
                    r2.d0 d0Var2;
                    TextView textView;
                    d0Var2 = ClassDetailFragment.this.binding;
                    if (d0Var2 == null || (textView = d0Var2.f41835d) == null) {
                        return;
                    }
                    ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                    com.fitnessmobileapps.fma.core.domain.e bookabilityState = classEntity.getBookabilityState();
                    if (!(bookabilityState instanceof e.m) && !kotlin.jvm.internal.r.d(bookabilityState, e.n.f5613a) && !kotlin.jvm.internal.r.d(bookabilityState, e.k.f5610a)) {
                        textView.setVisibility(8);
                        return;
                    }
                    textView.setVisibility(0);
                    kotlin.jvm.internal.a0 a0Var = kotlin.jvm.internal.a0.f33399a;
                    String string = classDetailFragment.getString(R.string.waitlist_additional_info, classEntity.getLocation().getSiteName());
                    String string2 = classDetailFragment.getString(R.string.sms_texting_terms);
                    kotlin.jvm.internal.r.h(string2, "getString(R.string.sms_texting_terms)");
                    String format = String.format(string + pf.c.a("https://co.mindbodyonline.com/legal/sms-texting-terms", string2) + classDetailFragment.getString(R.string.sms_texting_terms_apply), Arrays.copyOf(new Object[0], 0));
                    kotlin.jvm.internal.r.h(format, "format(...)");
                    textView.setText(Html.fromHtml(format));
                    textView.setMovementMethod(LinkMovementMethod.getInstance());
                }

                @Override
                public Unit invoke(ClassEntity classEntity) {
                    a(classEntity);
                    return Unit.f33247a;
                }
            }));
        }
        w0().a1().observe(getViewLifecycleOwner(), new f(new Function1<Function0<? extends Unit>, Unit>() {
            {
                super(1);
            }

            @Override
            public Unit invoke(Function0<? extends Unit> function0) {
                invoke2((Function0<Unit>) function0);
                return Unit.f33247a;
            }

            public final void invoke2(final Function0<Unit> function0) {
                if (function0 != null) {
                    ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                    SwitchAndBookViewKt.r(classDetailFragment, null, new Function0<Unit>() {
                        {
                            super(0);
                        }

                        @Override
                        public Unit invoke() {
                            invoke2();
                            return Unit.f33247a;
                        }

                        public final void invoke2() {
                            function0.invoke();
                        }
                    }, new ClassDetailFragment$onViewCreated$17$1$2(classDetailFragment.w0()), 1, null);
                }
            }
        }));
        w0().z0().observe(getViewLifecycleOwner(), new f(new Function1<Pair<? extends q3.f, ? extends Boolean>, Unit>() {
            {
                super(1);
            }

            public final void a(Pair<? extends q3.f, Boolean> pair) {
                q3.f e10 = pair.e();
                if (e10 != null) {
                    ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
                    if ((e10 instanceof f.ConnectClassResponse) || (e10 instanceof f.Error)) {
                        classDetailFragment.w0().f1(e10);
                    }
                }
            }

            @Override
            public Unit invoke(Pair<? extends q3.f, ? extends Boolean> pair) {
                a(pair);
                return Unit.f33247a;
            }
        }));
    }

    private final void showError(DialogFragment dialogFragment) {
        k1(dialogFragment, "error dialog tag");
    }

    @Metadata(d1 = {"\u0000\u001f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J\u0018\u0010\t\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u00022\u0006\u0010\b\u001a\u00020\u0007H\u0016¨\u0006\n"}, d2 = {"com/fitnessmobileapps/fma/feature/book/ClassDetailFragment$e", "Landroidx/browser/customtabs/CustomTabsServiceConnection;", "Landroid/content/ComponentName;", "p0", "", "onServiceDisconnected", "name", "Landroidx/browser/customtabs/CustomTabsClient;", "client", "onCustomTabsServiceConnected", "FMA_release"}, k = 1, mv = {1, 8, 0})
    public static final class e extends CustomTabsServiceConnection {

        @Metadata(d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u001a\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004H\u0016¨\u0006\b"}, d2 = {"com/fitnessmobileapps/fma/feature/book/ClassDetailFragment$e$a", "Landroidx/browser/customtabs/CustomTabsCallback;", "", "navigationEvent", "Landroid/os/Bundle;", "extras", "", "onNavigationEvent", "FMA_release"}, k = 1, mv = {1, 8, 0})
        public static final class a extends CustomTabsCallback {

            final ClassDetailFragment f6364a;

            a(ClassDetailFragment classDetailFragment) {
                this.f6364a = classDetailFragment;
            }

            @Override
            public void onNavigationEvent(int navigationEvent, Bundle extras) {
                super.onNavigationEvent(navigationEvent, extras);
                if (navigationEvent == 6) {
                    ClassDetailViewModel.r1(this.f6364a.w0(), this.f6364a.v0().getClassInstanceId(), this.f6364a.v0().getSiteId(), this.f6364a.v0().getIsEnrollment(), null, 8, null);
                }
            }
        }

        e() {
        }

        @Override
        public void onCustomTabsServiceConnected(ComponentName name, CustomTabsClient client) {
            kotlin.jvm.internal.r.i(name, "name");
            kotlin.jvm.internal.r.i(client, "client");
            client.warmup(0L);
            ClassDetailFragment classDetailFragment = ClassDetailFragment.this;
            classDetailFragment.customTabsSession = client.newSession(new a(classDetailFragment));
        }

        @Override
        public void onServiceDisconnected(ComponentName p02) {
        }
    }
}