导航菜单

页面标题

页面副标题

Crafto v9.3.3 - D7.java 源代码

正在查看: Crafto v9.3.3 应用的 D7.java JAVA 源代码文件

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


package com.crafto.android.ui.home;

import A8.C0131h;
import A8.C0138j0;
import A8.C0148m1;
import A8.C0153o0;
import A8.C0155p;
import A8.C0163t;
import A8.C0167v;
import Da.C0195e0;
import Da.C0202i;
import Da.C0204j;
import Da.C0220r0;
import Da.C0222s0;
import Da.C0224t0;
import E7.C0241e;
import E8.C0304g6;
import E8.C0323j1;
import E8.C0327j5;
import E8.C0405u4;
import E8.C0420w5;
import E8.C0439z3;
import Ga.C0607q4;
import Ga.C0693y7;
import Hb.i;
import J8.C0752p1;
import J8.C0779z;
import J9.C0802c3;
import J9.C0845i2;
import J9.C0894p2;
import J9.C0902q3;
import J9.C0916s4;
import J9.C0924t5;
import J9.C0951x4;
import J9.C0953y;
import J9.C0957y3;
import J9.ViewOnClickListenerC0825f3;
import L8.C1037m;
import L8.C1053u0;
import L8.C1055v0;
import L8.C1057w0;
import O8.C1140i;
import O8.C1150n;
import O8.C1174z0;
import Oa.C1189o;
import P8.C1197a0;
import P8.C1217k0;
import Pa.C1247h0;
import Pa.C1256m;
import Pa.C1258n;
import Q7.ViewOnClickListenerC1313u;
import Q7.W0;
import Q8.C1332h;
import Q8.C1334j;
import Q8.C1346w;
import Q8.C1349z;
import Ra.C1362l;
import Ra.C1365o;
import Ra.C1366p;
import Ra.C1371v;
import Ra.C1372w;
import Ua.C1448u;
import Ua.C1450w;
import Va.C1466m;
import Xk.c;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Application;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.ParcelFileDescriptor;
import android.provider.MediaStore;
import android.text.Editable;
import android.text.method.PasswordTransformationMethod;
import android.util.SparseArray;
import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupMenu;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.result.ActivityResult;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatEditText;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.LinearLayoutCompat;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.FileProvider;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.lifecycle.v0;
import androidx.media3.common.PlaybackException;
import androidx.media3.datasource.cache.a;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2;
import c9.C1579a;
import c9.C1580b;
import com.airbnb.lottie.LottieAnimationView;
import com.amazonaws.mobile.client.AWSMobileClient;
import com.amazonaws.mobile.config.AWSConfiguration;
import com.arthenica.ffmpegkit.FFmpegKitConfig;
import com.clevertap.android.sdk.Constants;
import com.clevertap.android.sdk.db.Column;
import com.clevertap.android.sdk.variables.CTVariableUtils;
import com.crafto.android.CraftoApp;
import com.crafto.android.data.InitDataDeserializer;
import com.crafto.android.data.mapper.UserDataMapper;
import com.crafto.android.data.model.ActionButtonData;
import com.crafto.android.data.model.AddAnniversaryAlarmData;
import com.crafto.android.data.model.GamificationData;
import com.crafto.android.data.model.HelpButton;
import com.crafto.android.data.model.HindiEnglishFontObject;
import com.crafto.android.data.model.HoliColorDetails;
import com.crafto.android.data.model.HomeScreenNewButtonsData;
import com.crafto.android.data.model.IndiaFontQuoteData;
import com.crafto.android.data.model.InitData;
import com.crafto.android.data.model.MembershipData;
import com.crafto.android.data.model.MembershipPlanDetails;
import com.crafto.android.data.model.MetaInit;
import com.crafto.android.data.model.MetaObject;
import com.crafto.android.data.model.PlanData;
import com.crafto.android.data.model.PostMedia;
import com.crafto.android.data.model.PostPaymentData;
import com.crafto.android.data.model.QuoteData;
import com.crafto.android.data.model.QuotesSupportData;
import com.crafto.android.data.model.SocialMedia;
import com.crafto.android.data.model.Translations;
import com.crafto.android.data.model.User;
import com.crafto.android.data.model.UserAdditionalData;
import com.crafto.android.data.model.UserConfigData;
import com.crafto.android.data.model.Widget;
import com.crafto.android.data.model.crafto.PurchasePremiumData;
import com.crafto.android.data.model.creation.CreationV2Data;
import com.crafto.android.data.model.dynamic_render.ImageGuidelines;
import com.crafto.android.data.model.festivals.holi.HoliHomeWidgetData;
import com.crafto.android.data.model.gallery.Media;
import com.crafto.android.data.model.kinesis.KinesisData;
import com.crafto.android.data.model.membership.DLocalOptionData;
import com.crafto.android.data.model.membership.GooglePlayBillingData;
import com.crafto.android.data.model.membership.MembershipPaymentData;
import com.crafto.android.data.model.membership.MembershipPaymentOrderData;
import com.crafto.android.data.model.membership.MembsershipDetailsData;
import com.crafto.android.data.model.membership.PaymentStatus;
import com.crafto.android.data.model.membership.ProfileImageData;
import com.crafto.android.data.model.politics.PoliticalCategorySearchWidget;
import com.crafto.android.data.model.quotes.MoreCategoryObject;
import com.crafto.android.data.model.quotes.QuotesCategory;
import com.crafto.android.data.model.quotes.QuotesCategoryObject;
import com.crafto.android.data.model.remove_background.RemoveBackgroundPopup;
import com.crafto.android.data.model.tags.Tag;
import com.crafto.android.data.model.tts.VoiceData;
import com.crafto.android.data.model.video.VideoMetadata;
import com.crafto.android.data.model.video.VoiceOverData;
import com.crafto.android.ui.a_screens.membership_plan_options.EbanxPaymentProcessActivity;
import com.crafto.android.ui.base.BaseActivity;
import com.crafto.android.ui.custom_view.CustomCountdownTimer;
import com.crafto.android.ui.home.D7;
import com.crafto.android.ui.home.D7.C1610c;
import com.crafto.android.ui.home.D7.C1618k;
import com.crafto.android.ui.home.D7.L;
import com.crafto.android.ui.home.D7.S;
import com.crafto.android.ui.home.creation.a;
import com.crafto.android.ui.home.profile.c;
import com.crafto.android.ui.home.quotes.QuoteView;
import com.crafto.android.ui.ted_image_picker.builder.type.MediaType;
import com.crafto.android.utility.PreferencesHelper;
import com.crafto.android.utility.a;
import com.crafto.android.utility.functional.AppEnums;
import com.crafto.android.utility.ui.Coin;
import com.crafto.android.utility.ui.android13.Android13NotificationActivity;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.card.MaterialCardView;
import com.google.android.material.chip.Chip;
import com.google.android.material.chip.ChipGroup;
import com.google.android.material.textview.MaterialTextView;
import com.google.firebase.perf.network.FirebasePerfOkHttpClient;
import com.yalantis.ucrop.UCrop;
import do.a;
import e8.C2194k;
import e9.C2216g;
import h8.C2291d;
import i8.C2326I;
import i8.C2329L;
import i8.C2346k;
import i8.C2350o;
import j8.C2400p;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import k8.C2431c;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.CallableReference;
import kotlin.jvm.internal.FunctionAdapter;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.MutablePropertyReference0Impl;
import kotlin.jvm.internal.Ref;
import kotlin.jvm.internal.Reflection;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.jvm.internal.StringCompanionObject;
import kotlin.jvm.internal.TypeIntrinsics;
import kotlin.ranges.IntRange;
import kotlin.text.StringsKt;
import kotlinx.coroutines.CoroutineExceptionHandler;
import l8.C2457H0;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.ResponseBody;
import org.jetbrains.annotations.NotNull;
import p8.C2769b;
import q8.C2807b;
import q8.C2811f;
import s7.C2941a;
import t7.C3029ac;
import t7.C3039b5;
import t7.C3047bd;
import t7.C3053c2;
import t7.C3181jc;
import t7.Ce;
import t7.Sc;
import t7.Xd;
import t8.C3449a;
import w.h;
import y2.a;
import z7.C3533a1;
import z8.C3624b;

@Metadata
@SourceDebugExtension({"SMAP\nTrendingHomeFullScreenExpFragment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment\n+ 2 FragmentViewModelLazy.kt\nandroidx/fragment/app/FragmentViewModelLazyKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 4 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 5 Standard.kt\ncom/crafto/android/utility/extension_functions/StandardKt\n+ 6 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 7 ViewGroup.kt\nandroidx/core/view/ViewGroupKt\n+ 8 Uri.kt\nandroidx/core/net/UriKt\n+ 9 CoroutineExceptionHandler.kt\nkotlinx/coroutines/CoroutineExceptionHandlerKt\n+ 10 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n*L\n1#1,22219:1\n172#2,9:22220\n172#2,9:22229\n106#2,15:22238\n106#2,15:22253\n106#2,15:22268\n106#2,15:22283\n106#2,15:22298\n1#3:22313\n1557#4:22314\n1628#4,3:22315\n1872#4,3:22318\n1872#4,3:22329\n1872#4,3:22333\n1872#4,3:22340\n1872#4,3:22346\n1872#4,3:22349\n1872#4,3:22352\n1872#4,3:22355\n1872#4,3:22358\n1872#4,3:22361\n1872#4,3:22364\n1755#4,3:22375\n1863#4,2:22385\n1567#4:22387\n1598#4,4:22388\n1567#4:22392\n1598#4,4:22393\n1872#4,3:22401\n1872#4,3:22404\n1863#4,2:22407\n1872#4,3:22409\n1863#4,2:22412\n1872#4,3:22439\n1872#4,3:22443\n1872#4,3:22446\n1872#4,3:22449\n1872#4,3:22452\n1872#4,3:22455\n1872#4,3:22458\n1863#4,2:22461\n17#5:22321\n18#5,5:22324\n17#5:22415\n18#5,5:22418\n17#5:22423\n18#5:22426\n17#5:22427\n18#5,5:22430\n20#5,3:22435\n12364#6,2:22322\n13402#6,2:22336\n13402#6,2:22338\n12364#6,2:22416\n12364#6,2:22424\n12364#6,2:22428\n43#7:22332\n43#7:22414\n43#7:22438\n43#7:22442\n36#8:22343\n36#8:22344\n36#8:22345\n36#8:22382\n36#8:22383\n36#8:22384\n46#9,4:22367\n46#9,4:22371\n46#9,4:22397\n37#10:22378\n36#10,3:22379\n*S KotlinDebug\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment\n*L\n755#1:22220,9\n757#1:22229,9\n759#1:22238,15\n761#1:22253,15\n763#1:22268,15\n765#1:22283,15\n767#1:22298,15\n4517#1:22314\n4517#1:22315,3\n6566#1:22318,3\n7525#1:22329,3\n8786#1:22333,3\n11747#1:22340,3\n15698#1:22346,3\n15719#1:22349,3\n15755#1:22352,3\n15811#1:22355,3\n15826#1:22358,3\n20986#1:22361,3\n21014#1:22364,3\n21478#1:22375,3\n21703#1:22385,2\n21708#1:22387\n21708#1:22388,4\n21714#1:22392\n21714#1:22393,4\n1290#1:22401,3\n1463#1:22404,3\n1681#1:22407,2\n1859#1:22409,3\n1981#1:22412,2\n5342#1:22439,3\n9030#1:22443,3\n9275#1:22446,3\n11077#1:22449,3\n15389#1:22452,3\n15783#1:22455,3\n19243#1:22458,3\n21835#1:22461,2\n6843#1:22321\n6843#1:22324,5\n2691#1:22415\n2691#1:22418,5\n3854#1:22423\n3854#1:22426\n3865#1:22427\n3865#1:22430,5\n3854#1:22435,3\n6843#1:22322,2\n8948#1:22336,2\n8956#1:22338,2\n2691#1:22416,2\n3854#1:22424,2\n3865#1:22428,2\n8017#1:22332\n2720#1:22414\n4965#1:22438\n5779#1:22442\n15268#1:22343\n15382#1:22344\n15433#1:22345\n21635#1:22382\n21646#1:22383\n21650#1:22384\n21342#1:22367,4\n21395#1:22371,4\n21752#1:22397,4\n21568#1:22378\n21568#1:22379,3\n*E\n"})
public final class D7 extends com.crafto.android.ui.home.G<C3053c2> implements I7.c {
    public static Bitmap R4;
    public static boolean S4;
    public static RemoveBackgroundPopup T4;
    public static boolean U4;
    public String A2;
    public Hb.p0 A3;
    public AppEnums.f A4;
    public Hb.F B3;
    public boolean B4;
    public PostMedia C2;
    public Bb.j C3;
    public dl.M0 C4;
    public Hb.a0 D3;
    public int D4;
    public Ab.H E3;
    public boolean E4;
    public Cb.a F3;
    public boolean F4;
    public Hb.q G3;
    public boolean G4;
    public W7.J0 H3;
    public boolean H4;
    public Hb.H I3;
    public boolean I4;
    public Lb.b J3;
    public PaymentStatus J4;
    public Pb.h K3;

    @NotNull
    public final i.c<Intent> K4;
    public Hb.k0 L3;
    public com.crafto.android.ui.home.profile.e L4;
    public Ob.i M3;
    public QuoteData M4;
    public Mb.d N3;
    public Long N4;

    @NotNull
    public final ArrayList<Media> O3;

    @NotNull
    public final Hk.s O4;

    @NotNull
    public final SharedPreferencesOnSharedPreferenceChangeListenerC1781m7 P3;
    public boolean Q2;

    @NotNull
    public final Hk.s Q3;
    public boolean R2;
    public Ab.t R3;
    public boolean S2;
    public QuotesCategory S3;
    public Uri T2;

    @NotNull
    public final Hk.k T3;
    public boolean U2;

    @NotNull
    public final Hk.k U3;
    public List<QuotesCategory> V1;
    public QuoteData V2;

    @NotNull
    public final Hk.k V3;
    public User W2;

    @NotNull
    public final Hk.k W3;
    public boolean X2;

    @NotNull
    public final Hk.k X3;

    @NotNull
    public final Hk.k Y3;
    public int Z;
    public View Z2;
    public C3449a Z3;

    @NotNull
    public String a4;
    public final int b4;

    @NotNull
    public ArrayList<Tag> c4;

    @NotNull
    public final Hk.s d4;
    public MetaInit<InitData> e4;
    public boolean f2;
    public Ij.e f3;
    public boolean f4;
    public Integer g2;
    public boolean g3;
    public Uri g4;
    public int h2;
    public Boolean h3;
    public Uri h4;
    public Integer i3;
    public String i4;
    public boolean j2;

    @NotNull
    public final i.c<Intent> j4;
    public BaseActivity.a k2;

    @NotNull
    public final i.c<i.j> k4;
    public User l2;
    public InitData l3;
    public boolean l4;
    public E7.G m3;

    @NotNull
    public String m4;
    public boolean n2;
    public E7.G n3;
    public boolean n4;
    public W7.B0 o3;

    @NotNull
    public final RunnableC1619l o4;
    public int p1;
    public String p2;
    public int p4;
    public String q2;
    public C1692e9 q3;

    @NotNull
    public final Hk.s q4;
    public boolean r2;
    public w.g r3;
    public boolean r4;
    public int s2;
    public boolean s4;
    public boolean t2;
    public MembershipPlanDetails t3;
    public boolean t4;
    public long u2;
    public Ab.M u3;
    public boolean u4;
    public boolean v2;
    public PreferencesHelper v3;

    @NotNull
    public ArrayList v4;
    public Uri w2;
    public com.crafto.android.ui.home.profile.a w3;
    public QuotesCategory w4;
    public String x1;
    public InitData x2;
    public Hb.c x3;
    public QuotesCategory x4;
    public String y1;
    public int y2;
    public UserDataMapper y3;
    public Uri y4;
    public QuoteView z2;
    public Hb.C z3;
    public int z4;
    public static long P4 = System.currentTimeMillis();
    public static boolean Q4 = true;
    public static boolean V4 = true;

    @NotNull
    public final Handler Y = new Handler(Looper.getMainLooper());

    @NotNull
    public String i2 = "";
    public long m2 = System.currentTimeMillis();
    public boolean o2 = true;

    @NotNull
    public String B2 = "SQUARE";

    @NotNull
    public final String D2 = "Special Day";

    @NotNull
    public final String E2 = "QUOTE_DOWNLOAD_DAY_SPECIAL";

    @NotNull
    public final String F2 = "QUOTE_DOWNLOAD";

    @NotNull
    public final String G2 = "PROFILE_PHOTO";

    @NotNull
    public final String H2 = "FILTER_PHOTO";

    @NotNull
    public final String I2 = "BG_REMOVE_BE_PHOTO";

    @NotNull
    public final String J2 = "ANNIVERSARY_VIDEO_WITH_IMAGE";

    @NotNull
    public final String K2 = "ANNIVERSARY_IMAGE";

    @NotNull
    public final String L2 = "FULLSCREEN_VIDEO_BG_IMAGE";

    @NotNull
    public final String M2 = "BUSINESS_PRODUCT_IMAGE";

    @NotNull
    public final String N2 = "PRODUCT_PHOTO";

    @NotNull
    public final String O2 = "BRAZIL_BUSINESS_PRODUCT_PHOTO";

    @NotNull
    public final String P2 = "OTHER_USER_PROFILE_IMAGE";
    public int Y2 = -1;

    @NotNull
    public final String a3 = "crafto_image";

    @NotNull
    public final String b3 = "crafto_image_screenshot";

    @NotNull
    public final String c3 = "crafto_home_image";

    @NotNull
    public String d3 = "https://www.google.com/search?q=square+poster+INTERPOLATE&tbm=isch";

    @NotNull
    public final String e3 = "https://www.google.com/search?q=+INTERPOLATE+background&tbm=isch";
    public boolean j3 = true;
    public boolean k3 = true;

    @NotNull
    public final AppEnums.StoragePermissionResult.d p3 = AppEnums.StoragePermissionResult.d.a;

    @NotNull
    public final h.b s3 = new h.b();

    public static final class A extends ViewPager2.g {
        public A() {
        }

        public final void c(int i) {
            CardView cardView;
            ViewPager2 viewPager2;
            UserConfigData e;
            D7 d7 = D7.this;
            int i2 = d7.y2;
            if (!(i2 == i && i2 == 0) && i2 == i) {
                return;
            }
            if (i == 0 && (e = d7.e2().e()) != null && e.getLogHomeApi() && D7.P4 > 0) {
                com.crafto.android.ui.base.a.f0(D7.this, "Api Logging", "Home Screen", null, String.valueOf(System.currentTimeMillis() - D7.P4), "Home Api Response Render Time", 0, null, 996);
                D7.P4 = 0L;
            }
            do.a.a.c(Eb.J0.a(i, "mytag tab position is "), new Object[0]);
            C3053c2 c3053c2 = (C3053c2) d7.y;
            if (c3053c2 != null && (viewPager2 = c3053c2.k2) != null) {
                d7.x0(new E7.r(viewPager2, i));
            }
            C3053c2 c3053c22 = (C3053c2) d7.y;
            if (c3053c22 != null && (cardView = c3053c22.p1) != null) {
                Eb.X0.l(cardView);
            }
            d7.x2();
            d7.x0(new C0693y7(i, d7));
        }
    }

    public static final class B implements ViewTreeObserver.OnGlobalLayoutListener {
        public B() {
        }

        @Override
        public final void onGlobalLayout() {
            ViewTreeObserver viewTreeObserver;
            boolean z = D7.Q4;
            final D7 d7 = D7.this;
            d7.getClass();
            do.a.a.c("initialiseAmazonWebServicesClient", new Object[0]);
            if (!CraftoApp.y) {
                d7.x0(new Function0() {
                    public final Object invoke() {
                        boolean z2 = D7.Q4;
                        D7 d72 = D7.this;
                        Intrinsics.checkNotNullParameter(d72, "this$0");
                        FragmentActivity activity = d72.getActivity();
                        AWSConfiguration aWSConfiguration = new AWSConfiguration(activity != null ? activity.getApplicationContext() : null);
                        do.a.a.c("initialiseAmazonWebServicesClient configuration " + aWSConfiguration, new Object[0]);
                        AWSMobileClient j = AWSMobileClient.j();
                        FragmentActivity activity2 = d72.getActivity();
                        j.n(activity2 != null ? activity2.getApplicationContext() : null, aWSConfiguration, new C1704f9());
                        CraftoApp.y = true;
                        return Boolean.FALSE;
                    }
                });
            }
            View view = d7.getView();
            if (view == null || (viewTreeObserver = view.getViewTreeObserver()) == null) {
                return;
            }
            viewTreeObserver.removeOnGlobalLayoutListener(this);
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$onCreate$1$3", f = "TrendingHomeFullScreenExpFragment.kt", l = {850}, m = "invokeSuspend")
    public static final class G extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$onCreate$1$3$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final D7 a;

            public a(D7 d7, Kk.c<? super a> cVar) {
                super(2, cVar);
                this.a = d7;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new a(this.a, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                Jb.a.b((String) null, new Bb.m(this.a, 3));
                return Unit.a;
            }
        }

        public G(Kk.c<? super G> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new G(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(Constants.PN_LARGE_ICON_DOWNLOAD_TIMEOUT_IN_MILLIS, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            D7 d7 = D7.this;
            dl.g.b(androidx.lifecycle.J.a(d7), dl.Z.a, (dl.J) null, new a(d7, null), 2);
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$onCreate$3", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class H extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public H(Kk.c<? super H> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new H(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            D7 d7 = D7.this;
            User E = d7.e2().E();
            if (E != null && E.isBusinessUser()) {
                for (int i = 1; i < 101; i++) {
                    ArrayList arrayList = Ab.d.a;
                    BaseActivity a = Eb.E.a(d7);
                    Hb.q qVar = d7.G3;
                    Hb.q qVar2 = null;
                    if (qVar == null) {
                        Intrinsics.throwUninitializedPropertyAccessException("colorUtil");
                        qVar = null;
                    }
                    Ab.d.b(a, qVar, false, new C1783m9());
                    BaseActivity a2 = Eb.E.a(d7);
                    Hb.q qVar3 = d7.G3;
                    if (qVar3 != null) {
                        qVar2 = qVar3;
                    } else {
                        Intrinsics.throwUninitializedPropertyAccessException("colorUtil");
                    }
                    Ab.d.b(a2, qVar2, true, new C1794n9());
                }
            }
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$openAppRatingDialogWithDelay$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {2640}, m = "invokeSuspend")
    public static final class I extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public I(Kk.c<? super I> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new I(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(Constants.PN_IMAGE_DOWNLOAD_TIMEOUT_IN_MILLIS, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            try {
                D7 d7 = D7.this;
                boolean z = D7.Q4;
                d7.P2();
            } catch (Exception e) {
                do.a.a.e(e);
            }
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$playPauseCurrentItem$1$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {18747}, m = "invokeSuspend")
    public static final class J extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;
        public final QuoteData c;

        public J(QuoteData quoteData, Kk.c<? super J> cVar) {
            super(2, cVar);
            this.c = quoteData;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new J(this.c, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(500L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            QuoteData quoteData = this.c;
            D7 d7 = D7.this;
            d7.x0(new Q7.W(1, quoteData, d7));
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$playPauseCurrentItem$1$1$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {18865}, m = "invokeSuspend")
    public static final class K extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public K(Kk.c<? super K> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new K(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(500L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            D7 d7 = D7.this;
            E7.G g = d7.m3;
            if (g != null) {
                g.notifyItemChanged(d7.y2);
            }
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$pollBgRemove$1$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {7230}, m = "invokeSuspend")
    public static final class L extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;
        public final String c;
        public final boolean d;

        public L(String str, boolean z, Kk.c<? super L> cVar) {
            super(2, cVar);
            this.c = str;
            this.d = z;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new L(this.c, this.d, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(Constants.PN_LARGE_ICON_DOWNLOAD_TIMEOUT_IN_MILLIS, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            D7 d7 = D7.this;
            d7.x0(new O9.i(d7, this.c, this.d));
            return Unit.a;
        }
    }

    @SourceDebugExtension({"SMAP\nCoroutineExceptionHandler.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CoroutineExceptionHandler.kt\nkotlinx/coroutines/CoroutineExceptionHandlerKt$CoroutineExceptionHandler$1\n+ 2 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment\n*L\n1#1,48:1\n21396#2,2:49\n*E\n"})
    public static final class N extends kotlin.coroutines.a implements CoroutineExceptionHandler {
        public final void handleException(CoroutineContext coroutineContext, Throwable th) {
            do.a.a.e(th);
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment", f = "TrendingHomeFullScreenExpFragment.kt", l = {21548, 21566}, m = "runFileMappingAlgorithm")
    public static final class O extends Mk.c {
        public D7 a;
        public File[] b;
        public List c;
        public int d;
        public int e;
        public int f;
        public int g;
        public int h;
        public int i;
        public int j;
        public boolean k;
        public long l;
        public Object m;
        public int o;

        public O(Kk.c<? super O> cVar) {
            super(cVar);
        }

        public final Object invokeSuspend(@NotNull Object obj) {
            this.m = obj;
            this.o |= Integer.MIN_VALUE;
            boolean z = D7.Q4;
            return D7.this.l3(0, null, 0, false, 0, this);
        }
    }

    public static final class P implements androidx.lifecycle.T, FunctionAdapter {
        public final Function1 a;

        public P(Function1 function1) {
            Intrinsics.checkNotNullParameter(function1, "function");
            this.a = function1;
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof androidx.lifecycle.T) && (obj instanceof FunctionAdapter)) {
                return Intrinsics.areEqual(getFunctionDelegate(), ((FunctionAdapter) obj).getFunctionDelegate());
            }
            return false;
        }

        @NotNull
        public final Hk.h<?> getFunctionDelegate() {
            return this.a;
        }

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

        public final void onChanged(Object obj) {
            this.a.invoke(obj);
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$setQuotesData$3$11", f = "TrendingHomeFullScreenExpFragment.kt", l = {4484}, m = "invokeSuspend")
    public static final class Q extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public Q(Kk.c<? super Q> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new Q(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(1200L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            D7 d7 = D7.this;
            d7.x0(new C1189o(d7, 1));
            d7.W();
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$setQuotesData$3$12", f = "TrendingHomeFullScreenExpFragment.kt", l = {4506}, m = "invokeSuspend")
    public static final class R extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public R(Kk.c<? super R> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new R(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(Constants.PN_IMAGE_DOWNLOAD_TIMEOUT_IN_MILLIS, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            D7 d7 = D7.this;
            d7.x0(new K4(d7, 1));
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$shareDownloadVideoUsingFFmpeg$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class S extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public final N5.d b;
        public final String c;
        public final QuoteData d;
        public final AppEnums.f e;
        public final Function1<String, Unit> f;

        public S(N5.d dVar, String str, QuoteData quoteData, AppEnums.f fVar, Function1<? super String, Unit> function1, Kk.c<? super S> cVar) {
            super(2, cVar);
            this.b = dVar;
            this.c = str;
            this.d = quoteData;
            this.e = fVar;
            this.f = function1;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new S(this.b, this.c, this.d, this.e, this.f, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            final N5.d dVar = this.b;
            final String str = this.c;
            final QuoteData quoteData = this.d;
            final AppEnums.f fVar = this.e;
            final Function1<String, Unit> function1 = this.f;
            final D7 d7 = D7.this;
            d7.x0(new Function0() {
                public final Object invoke() {
                    RelativeLayout relativeLayout;
                    RelativeLayout relativeLayout2;
                    a.a aVar2 = do.a.a;
                    StringBuilder sb = new StringBuilder("session ");
                    N5.d dVar2 = dVar;
                    sb.append(dVar2);
                    aVar2.c(sb.toString(), new Object[0]);
                    boolean a = N5.l.a(dVar2.i);
                    D7 d72 = d7;
                    if (!a) {
                        d72.F0(2132018772);
                        C3053c2 c3053c2 = (C3053c2) d72.y;
                        if (c3053c2 != null && (relativeLayout = c3053c2.x2) != null) {
                            Eb.X0.l(relativeLayout);
                        }
                        aVar2.d("failStackTrace " + dVar2.j, new Object[0]);
                        return Unit.a;
                    }
                    StringBuilder sb2 = new StringBuilder("outputFilePath ");
                    String str2 = str;
                    sb2.append(str2);
                    aVar2.c(sb2.toString(), new Object[0]);
                    QuoteData quoteData2 = quoteData;
                    quoteData2.setVideoUri(str2);
                    AppEnums.f fVar2 = fVar;
                    if (fVar2 != null) {
                        boolean z = D7.Q4;
                        d72.L3(quoteData2, fVar2);
                    }
                    Function1 function12 = function1;
                    if (function12 != null) {
                        Intrinsics.checkNotNull(str2);
                        function12.invoke(str2);
                    }
                    C3053c2 c3053c22 = (C3053c2) d72.y;
                    if (c3053c22 == null || (relativeLayout2 = c3053c22.x2) == null) {
                        return null;
                    }
                    Eb.X0.l(relativeLayout2);
                    return Unit.a;
                }
            });
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$showPrePremiumBgRemovalPopupWithUrl$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class T extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public T(Kk.c<? super T> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new T(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            RelativeLayout relativeLayout;
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            C3053c2 c3053c2 = (C3053c2) D7.this.y;
            if (c3053c2 != null && (relativeLayout = c3053c2.Z) != null) {
                Eb.X0.l(relativeLayout);
            }
            return Unit.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$showProgress$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class U extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public U(Kk.c<? super U> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new U(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            D7 d7 = D7.this;
            d7.x0(new C0951x4(d7, 1));
            return Unit.a;
        }
    }

    public static final class V extends Lambda implements Function0<androidx.lifecycle.x0> {
        public final Fragment a;

        public V(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a.requireActivity().getViewModelStore();
        }
    }

    public static final class W extends Lambda implements Function0<y2.a> {
        public final Fragment a;

        public W(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a.requireActivity().getDefaultViewModelCreationExtras();
        }
    }

    public static final class X extends Lambda implements Function0<v0.b> {
        public final Fragment a;

        public X(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a.requireActivity().getDefaultViewModelProviderFactory();
        }
    }

    public static final class Y extends Lambda implements Function0<androidx.lifecycle.x0> {
        public final Fragment a;

        public Y(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a.requireActivity().getViewModelStore();
        }
    }

    public static final class Z extends Lambda implements Function0<y2.a> {
        public final Fragment a;

        public Z(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a.requireActivity().getDefaultViewModelCreationExtras();
        }
    }

    public static final class C1608a {
        public static D7 a(BaseActivity.a aVar, int i, boolean z, long j, boolean z2, User user, int i2) {
            boolean z3 = D7.Q4;
            if ((i2 & 4) != 0) {
                i = 0;
            }
            if ((i2 & 8) != 0) {
                z = false;
            }
            if ((i2 & 16) != 0) {
                j = 0;
            }
            if ((i2 & 32) != 0) {
                z2 = false;
            }
            if ((i2 & 64) != 0) {
                user = null;
            }
            Intrinsics.checkNotNullParameter(aVar, "listner");
            do.a.a.c(J1.c.c(j, "mytag deeplink: redirect quote id: "), new Object[0]);
            D7 d7 = new D7();
            d7.k2 = aVar;
            d7.t2 = z;
            d7.u2 = j;
            d7.v2 = z2;
            d7.l2 = user;
            Bundle bundle = new Bundle();
            bundle.putBoolean("extra_flag_open_editor", false);
            bundle.putInt("extra_position", i);
            d7.setArguments(bundle);
            return d7;
        }
    }

    public static final class a0 extends Lambda implements Function0<v0.b> {
        public final Fragment a;

        public a0(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a.requireActivity().getDefaultViewModelProviderFactory();
        }
    }

    public class C1609b {
        public static final int[] a;

        static {
            int[] iArr = new int[E9.a.values().length];
            try {
                iArr[E9.a.GENERATE.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[E9.a.GENERATE_AGAIN.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[E9.a.SHARE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr[E9.a.DOWNLOAD.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr[E9.a.IMAGE_LOADING_FAILED.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                iArr[E9.a.LANDED.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            a = iArr;
        }
    }

    public static final class b0 extends Lambda implements Function0<v0.b> {
        public final Fragment a;
        public final Hk.k b;

        public b0(Fragment fragment, Hk.k kVar) {
            super(0);
            this.a = fragment;
            this.b = kVar;
        }

        public final Object invoke() {
            v0.b defaultViewModelProviderFactory;
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.b);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return (uVar2 == null || (defaultViewModelProviderFactory = uVar2.getDefaultViewModelProviderFactory()) == null) ? this.a.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$checkRecurringPaymentStatus$1$1$1$3", f = "TrendingHomeFullScreenExpFragment.kt", l = {18625}, m = "invokeSuspend")
    public static final class C1610c extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public C1610c(Kk.c<? super C1610c> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new C1610c(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(3000L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            HashMap hashMap = com.crafto.android.utility.a.a;
            com.crafto.android.utility.a.g++;
            int i2 = com.crafto.android.utility.a.g;
            boolean z = D7.Q4;
            D7.this.u1(i2);
            return Unit.a;
        }
    }

    public static final class c0 extends Lambda implements Function0<Fragment> {
        public final Fragment a;

        public c0(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a;
        }
    }

    @SourceDebugExtension({"SMAP\nCoroutineExceptionHandler.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CoroutineExceptionHandler.kt\nkotlinx/coroutines/CoroutineExceptionHandlerKt$CoroutineExceptionHandler$1\n+ 2 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment\n*L\n1#1,48:1\n21753#2,2:49\n*E\n"})
    public static final class C1611d extends kotlin.coroutines.a implements CoroutineExceptionHandler {
        public final void handleException(CoroutineContext coroutineContext, Throwable th) {
            do.a.a.e(th);
        }
    }

    public static final class d0 extends Lambda implements Function0<androidx.lifecycle.y0> {
        public final Function0 a;

        public d0(c0 c0Var) {
            super(0);
            this.a = c0Var;
        }

        public final Object invoke() {
            return (androidx.lifecycle.y0) this.a.invoke();
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createBitmapFromFiles$3", f = "TrendingHomeFullScreenExpFragment.kt", l = {21762}, m = "invokeSuspend")
    @SourceDebugExtension({"SMAP\nTrendingHomeFullScreenExpFragment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$createBitmapFromFiles$3\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,22219:1\n1#2:22220\n*E\n"})
    public static final class C1612e extends Mk.i implements Function2<dl.H, Kk.c<? super Bitmap>, Object> {
        public int a;
        public int b;
        public int c;
        public Object d;
        public final boolean e;
        public final D7 f;
        public final File[] g;
        public final int h;
        public final Context i;

        public C1612e(boolean z, D7 d7, File[] fileArr, int i, Context context, Kk.c<? super C1612e> cVar) {
            super(2, cVar);
            this.e = z;
            this.f = d7;
            this.g = fileArr;
            this.h = i;
            this.i = context;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            C1612e c1612e = new C1612e(this.e, this.f, this.g, this.h, this.i, cVar);
            c1612e.d = obj;
            return c1612e;
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final java.lang.Object invokeSuspend(java.lang.Object r19) {
            throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.C1612e.invokeSuspend(java.lang.Object):java.lang.Object");
        }
    }

    public static final class e0 extends Lambda implements Function0<androidx.lifecycle.x0> {
        public final Hk.k a;

        public e0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            return FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a).getViewModelStore();
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class C1613f extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public final Context a;
        public final Ref.ObjectRef<Uri> b;
        public final Ref.ObjectRef<Uri> c;
        public final QuoteData d;
        public final D7 e;
        public final Function1<String, Unit> f;
        public final AppEnums.f g;

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final D7 a;

            public a(D7 d7, Kk.c<? super a> cVar) {
                super(2, cVar);
                this.a = d7;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new a(this.a, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                D7 d7 = this.a;
                d7.x0(new W8.d(d7, 2));
                return Unit.a;
            }
        }

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$1$3", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class b extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final String a;
            public final QuoteData b;
            public final D7 c;
            public final String d;
            public final Function1<String, Unit> e;
            public final AppEnums.f f;
            public final Context g;

            @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$1$3$session$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
            public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                public final D7 a;
                public final N5.d b;
                public final String c;
                public final Function1<String, Unit> d;
                public final AppEnums.f e;
                public final QuoteData f;
                public final Context g;

                @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$1$3$session$1$1$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {12775, 12793}, m = "invokeSuspend")
                public static final class C0038a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                    public Uri a;
                    public int b;
                    public final AppEnums.f c;
                    public final D7 d;
                    public final QuoteData e;
                    public final String f;
                    public final Context g;

                    public C0038a(AppEnums.f fVar, D7 d7, QuoteData quoteData, String str, Context context, Kk.c<? super C0038a> cVar) {
                        super(2, cVar);
                        this.c = fVar;
                        this.d = d7;
                        this.e = quoteData;
                        this.f = str;
                        this.g = context;
                    }

                    public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                        return new C0038a(this.c, this.d, this.e, this.f, this.g, cVar);
                    }

                    public final Object invoke(Object obj, Object obj2) {
                        return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                    }

                    public final java.lang.Object invokeSuspend(java.lang.Object r23) {
                        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.C1613f.b.a.C0038a.invokeSuspend(java.lang.Object):java.lang.Object");
                    }
                }

                public a(D7 d7, N5.d dVar, String str, Function1<? super String, Unit> function1, AppEnums.f fVar, QuoteData quoteData, Context context, Kk.c<? super a> cVar) {
                    super(2, cVar);
                    this.a = d7;
                    this.b = dVar;
                    this.c = str;
                    this.d = function1;
                    this.e = fVar;
                    this.f = quoteData;
                    this.g = context;
                }

                public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                    return new a(this.a, this.b, this.c, this.d, this.e, this.f, this.g, cVar);
                }

                public final Object invoke(Object obj, Object obj2) {
                    return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                }

                public final Object invokeSuspend(Object obj) {
                    Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                    Hk.q.b(obj);
                    final N5.d dVar = this.b;
                    final String str = this.c;
                    final Function1<String, Unit> function1 = this.d;
                    final D7 d7 = this.a;
                    final AppEnums.f fVar = this.e;
                    final QuoteData quoteData = this.f;
                    final Context context = this.g;
                    d7.x0(new Function0() {
                        public final Object invoke() {
                            a.a aVar2 = do.a.a;
                            StringBuilder sb = new StringBuilder("session ");
                            N5.d dVar2 = dVar;
                            sb.append(dVar2);
                            aVar2.c(sb.toString(), new Object[0]);
                            boolean a = N5.l.a(dVar2.i);
                            D7 d72 = d7;
                            if (!a) {
                                boolean z = D7.Q4;
                                d72.A2();
                                return Unit.a;
                            }
                            StringBuilder sb2 = new StringBuilder("input_video_uri ");
                            String str2 = str;
                            sb2.append(str2);
                            aVar2.c(sb2.toString(), new Object[0]);
                            Function1 function12 = function1;
                            if (function12 != null) {
                                Intrinsics.checkNotNull(str2);
                                function12.invoke(str2);
                            }
                            return dl.g.b(androidx.lifecycle.J.a(d72), (CoroutineContext) null, (dl.J) null, new D7.C1613f.b.a.C0038a(fVar, d72, quoteData, str2, context, null), 3);
                        }
                    });
                    return Unit.a;
                }
            }

            public b(String str, QuoteData quoteData, D7 d7, String str2, Function1<? super String, Unit> function1, AppEnums.f fVar, Context context, Kk.c<? super b> cVar) {
                super(2, cVar);
                this.a = str;
                this.b = quoteData;
                this.c = d7;
                this.d = str2;
                this.e = function1;
                this.f = fVar;
                this.g = context;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new b(this.a, this.b, this.c, this.d, this.e, this.f, this.g, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                final D7 d7 = this.c;
                final String str = this.d;
                final Function1<String, Unit> function1 = this.e;
                final AppEnums.f fVar = this.f;
                final QuoteData quoteData = this.b;
                final Context context = this.g;
                N5.d a2 = N5.c.a(this.a, new N5.e() {
                    public final void b(N5.d dVar) {
                        D7 d72 = D7.this;
                        androidx.lifecycle.E a3 = androidx.lifecycle.J.a(d72);
                        kl.c cVar = dl.Z.a;
                        dl.g.b(a3, il.p.a, (dl.J) null, new D7.C1613f.b.a(d72, dVar, str, function1, fVar, quoteData, context, null), 2);
                    }
                });
                QuoteData quoteData2 = this.b;
                if (quoteData2 != null) {
                    quoteData2.setSessionId(new Long(a2.a));
                }
                return Unit.a;
            }
        }

        public C1613f(Context context, Ref.ObjectRef<Uri> objectRef, Ref.ObjectRef<Uri> objectRef2, QuoteData quoteData, D7 d7, Function1<? super String, Unit> function1, AppEnums.f fVar, Kk.c<? super C1613f> cVar) {
            super(2, cVar);
            this.a = context;
            this.b = objectRef;
            this.c = objectRef2;
            this.d = quoteData;
            this.e = d7;
            this.f = function1;
            this.g = fVar;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return new C1613f(this.a, this.b, this.c, this.d, this.e, this.f, this.g, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            String str;
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            Ref.ObjectRef<Uri> objectRef = this.b;
            Uri uri = (Uri) objectRef.element;
            Context context = this.a;
            String c = FFmpegKitConfig.c(context, uri);
            Ref.ObjectRef<Uri> objectRef2 = this.c;
            String c2 = FFmpegKitConfig.c(context, (Uri) objectRef2.element);
            a.a aVar2 = do.a.a;
            aVar2.c("mytag top bitmap render #2 0", new Object[0]);
            File cacheDir = context.getCacheDir();
            Intrinsics.checkNotNullExpressionValue(cacheDir, "getCacheDir(...)");
            String absolutePath = new File(cacheDir, c0.c.b(new StringBuilder(), ".mp4")).getAbsolutePath();
            QuoteData quoteData = this.d;
            if (quoteData == null || (str = quoteData.getVideoUrl()) == null) {
                str = "";
            }
            aVar2.c("isTopImageQuoteDesign_ true topLayoutHeight 0", new Object[0]);
            String l = Intrinsics.areEqual(quoteData.isShowPurchaseScreenV2(), Boolean.FALSE) ? "-i [videoUrl] -i [topImageFileName] -filter_complex [0]scale=640:-2[top];[1]scale=640:-2[center];[top][center]overlay=0:[bottomLayoutHeight][output1] -map [output1] -map 0:a? -c:v libx264 -preset ultrafast -crf 21 -c:a copy -shortest -movflags +faststart [outputPath]" : kotlin.text.p.l("-i [videoUrl] -i [topImageFileName] -filter_complex [0]scale=640:-2[top];[1]scale=640:-2[center];[top][center]overlay=0:[bottomLayoutHeight][output1] -map [output1] -map 0:a? -c:v libx264 -preset ultrafast -crf 21 -c:a copy -shortest -movflags +faststart [outputPath]", "640", "240");
            aVar2.c(C1.e.a("mytag command is ", l), new Object[0]);
            Intrinsics.checkNotNull(c2);
            String l2 = kotlin.text.p.l(kotlin.text.p.l(l, "[quoteImageFileName]", c2), "[videoUrl]", kotlin.text.p.l(str, " ", "%20"));
            Intrinsics.checkNotNull(c);
            String l3 = kotlin.text.p.l(kotlin.text.p.l(kotlin.text.p.l(l2, "[topImageFileName]", c), "[topLayoutHeight]", String.valueOf(0)), "[bottomLayoutHeight]", String.valueOf(0));
            Intrinsics.checkNotNull(absolutePath);
            String l4 = kotlin.text.p.l(l3, "[outputPath]", absolutePath);
            Boolean isShowPurchaseScreenV2 = quoteData.isShowPurchaseScreenV2();
            Boolean bool = Boolean.TRUE;
            boolean areEqual = Intrinsics.areEqual(isShowPurchaseScreenV2, bool);
            final D7 d7 = this.e;
            if (areEqual && (Intrinsics.areEqual(quoteData.getVideoBufferingInSplitScreen(), bool) || Intrinsics.areEqual(quoteData.getShowVideoScreenshotInSplitScreen(), bool))) {
                quoteData.setBottomImageUriForVideo(((Uri) objectRef.element).toString());
                androidx.lifecycle.E a2 = androidx.lifecycle.J.a(d7);
                kl.c cVar = dl.Z.a;
                dl.g.b(a2, il.p.a, (dl.J) null, new a(d7, null), 2);
                Function1<String, Unit> function1 = this.f;
                if (function1 != null) {
                    String uri2 = ((Uri) objectRef2.element).toString();
                    Intrinsics.checkNotNullExpressionValue(uri2, "toString(...)");
                    function1.invoke(uri2);
                }
            } else {
                FFmpegKitConfig.h = new N5.p() {
                    public final void a(N5.o oVar) {
                        D7 d72 = D7.this;
                        d72.x0(new O8.C(2, oVar, d72));
                    }
                };
                dl.g.b(androidx.lifecycle.J.a(d7), dl.Z.a, (dl.J) null, new b(l4, this.d, this.e, absolutePath, this.f, this.g, this.a, null), 2);
            }
            return Unit.a;
        }
    }

    public static final class f0 extends Lambda implements Function0<y2.a> {
        public final Hk.k a;

        public f0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return uVar2 != null ? uVar2.getDefaultViewModelCreationExtras() : a.a.b;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$2$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class C1614g extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public final Context a;
        public final Ref.ObjectRef<Uri> b;
        public final QuoteData c;
        public final UserConfigData d;
        public final D7 e;
        public final Function1<String, Unit> f;
        public final long g;
        public final AppEnums.f h;

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$2$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final D7 a;

            public a(D7 d7, Kk.c<? super a> cVar) {
                super(2, cVar);
                this.a = d7;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new a(this.a, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                D7 d7 = this.a;
                d7.x0(new I7.e(d7, 3));
                return Unit.a;
            }
        }

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$2$1$3", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class b extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final long a;
            public final QuoteData b;
            public final String c;
            public final D7 d;
            public final String e;
            public final Function1<String, Unit> f;
            public final long g;
            public final AppEnums.f h;
            public final Context i;

            @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$2$1$3$session$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
            public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                public final D7 a;
                public final N5.d b;
                public final String c;
                public final Function1<String, Unit> d;
                public final long e;
                public final QuoteData f;
                public final String g;
                public final AppEnums.f h;
                public final Context i;

                @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$2$1$3$session$1$1$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {13041, 13060}, m = "invokeSuspend")
                public static final class C0039a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                    public Uri a;
                    public int b;
                    public final AppEnums.f c;
                    public final D7 d;
                    public final QuoteData e;
                    public final String f;
                    public final Context g;

                    public C0039a(AppEnums.f fVar, D7 d7, QuoteData quoteData, String str, Context context, Kk.c<? super C0039a> cVar) {
                        super(2, cVar);
                        this.c = fVar;
                        this.d = d7;
                        this.e = quoteData;
                        this.f = str;
                        this.g = context;
                    }

                    public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                        return new C0039a(this.c, this.d, this.e, this.f, this.g, cVar);
                    }

                    public final Object invoke(Object obj, Object obj2) {
                        return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                    }

                    public final java.lang.Object invokeSuspend(java.lang.Object r23) {
                        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.C1614g.b.a.C0039a.invokeSuspend(java.lang.Object):java.lang.Object");
                    }
                }

                public a(D7 d7, N5.d dVar, String str, Function1<? super String, Unit> function1, long j, QuoteData quoteData, String str2, AppEnums.f fVar, Context context, Kk.c<? super a> cVar) {
                    super(2, cVar);
                    this.a = d7;
                    this.b = dVar;
                    this.c = str;
                    this.d = function1;
                    this.e = j;
                    this.f = quoteData;
                    this.g = str2;
                    this.h = fVar;
                    this.i = context;
                }

                public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                    return new a(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, this.i, cVar);
                }

                public final Object invoke(Object obj, Object obj2) {
                    return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                }

                public final Object invokeSuspend(Object obj) {
                    Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                    Hk.q.b(obj);
                    final N5.d dVar = this.b;
                    final String str = this.c;
                    final Function1<String, Unit> function1 = this.d;
                    final long j = this.e;
                    final QuoteData quoteData = this.f;
                    final String str2 = this.g;
                    final D7 d7 = this.a;
                    final AppEnums.f fVar = this.h;
                    final Context context = this.i;
                    d7.x0(new Function0() {
                        public final Object invoke() {
                            a.a aVar2 = do.a.a;
                            StringBuilder sb = new StringBuilder("session ");
                            N5.d dVar2 = dVar;
                            sb.append(dVar2);
                            aVar2.c(sb.toString(), new Object[0]);
                            boolean a = N5.l.a(dVar2.i);
                            D7 d72 = d7;
                            if (!a) {
                                boolean z = D7.Q4;
                                d72.A2();
                                return Unit.a;
                            }
                            StringBuilder sb2 = new StringBuilder("input_video_uri ");
                            String str3 = str;
                            sb2.append(str3);
                            aVar2.c(sb2.toString(), new Object[0]);
                            Function1 function12 = function1;
                            if (function12 != null) {
                                Intrinsics.checkNotNull(str3);
                                function12.invoke(str3);
                            }
                            String valueOf = String.valueOf(System.currentTimeMillis() - j);
                            QuoteData quoteData2 = quoteData;
                            Pair pair = new Pair("Template Id", quoteData2 != null ? Integer.valueOf(quoteData2.getDesign()) : null);
                            Pair pair2 = new Pair("Content Type", quoteData2 != null ? quoteData2.getContentType() : null);
                            Pair pair3 = new Pair("Source", "Server");
                            Pair pair4 = new Pair("Content Url", quoteData2 != null ? quoteData2.getVideoUrl() : null);
                            Pair pair5 = new Pair("Audio Url", quoteData2 != null ? quoteData2.getAudioUrl() : null);
                            VoiceOverData voiceOverData = quoteData2.getVoiceOverData();
                            Pair pair6 = new Pair("isVoiceOverVideo", voiceOverData != null ? voiceOverData.isVoiceOverVideo() : null);
                            Pair pair7 = new Pair("shouldWaitForVoiceData", Boolean.valueOf(quoteData2.getShouldWaitForVoiceData()));
                            StringBuilder sb3 = new StringBuilder("name_");
                            VoiceData voiceData = quoteData2.getVoiceData();
                            sb3.append(voiceData != null ? voiceData.getName() : null);
                            sb3.append(" file_");
                            VoiceData voiceData2 = quoteData2.getVoiceData();
                            sb3.append(voiceData2 != null ? voiceData2.getFileLocation() : null);
                            com.crafto.android.ui.base.a.f0(d72, "Video Logs", "Home Screen", null, valueOf, "Video Processing Completed", 0, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, pair6, pair7, new Pair("voiceData", sb3.toString()), new Pair("Ffmpeg Command", str2)}), 484);
                            return dl.g.b(androidx.lifecycle.J.a(d72), (CoroutineContext) null, (dl.J) null, new D7.C1614g.b.a.C0039a(fVar, d72, quoteData2, str3, context, null), 3);
                        }
                    });
                    return Unit.a;
                }
            }

            public b(long j, QuoteData quoteData, String str, D7 d7, String str2, Function1<? super String, Unit> function1, long j2, AppEnums.f fVar, Context context, Kk.c<? super b> cVar) {
                super(2, cVar);
                this.a = j;
                this.b = quoteData;
                this.c = str;
                this.d = d7;
                this.e = str2;
                this.f = function1;
                this.g = j2;
                this.h = fVar;
                this.i = context;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new b(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, this.i, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                String valueOf = String.valueOf(System.currentTimeMillis() - this.a);
                QuoteData quoteData = this.b;
                Pair pair = new Pair("Template Id", quoteData != null ? new Integer(quoteData.getDesign()) : null);
                Pair pair2 = new Pair("Content Type", quoteData != null ? quoteData.getContentType() : null);
                Pair pair3 = new Pair("Content Url", quoteData != null ? quoteData.getVideoUrl() : null);
                Pair pair4 = new Pair("Audio Url", quoteData != null ? quoteData.getAudioUrl() : null);
                VoiceOverData voiceOverData = quoteData.getVoiceOverData();
                Pair pair5 = new Pair("isVoiceOverVideo", voiceOverData != null ? voiceOverData.isVoiceOverVideo() : null);
                Pair pair6 = new Pair("shouldWaitForVoiceData", Boolean.valueOf(quoteData.getShouldWaitForVoiceData()));
                StringBuilder sb = new StringBuilder("name_");
                VoiceData voiceData = quoteData.getVoiceData();
                sb.append(voiceData != null ? voiceData.getName() : null);
                sb.append(" file_");
                VoiceData voiceData2 = quoteData.getVoiceData();
                sb.append(voiceData2 != null ? voiceData2.getFileLocation() : null);
                com.crafto.android.ui.base.a.f0(this.d, "Video Logs", "Home Screen", null, valueOf, "Video Processing Start", 0, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, pair6, new Pair("voiceData", sb.toString()), new Pair("Ffmpeg Command", this.c)}), 484);
                final AppEnums.f fVar = this.h;
                final Context context = this.i;
                final D7 d7 = this.d;
                final String str = this.e;
                final Function1<String, Unit> function1 = this.f;
                final long j = this.g;
                final QuoteData quoteData2 = this.b;
                final String str2 = this.c;
                quoteData.setSessionId(new Long(N5.c.a(str2, new N5.e() {
                    public final void b(N5.d dVar) {
                        D7 d72 = D7.this;
                        androidx.lifecycle.E a2 = androidx.lifecycle.J.a(d72);
                        kl.c cVar = dl.Z.a;
                        dl.g.b(a2, il.p.a, (dl.J) null, new D7.C1614g.b.a(d72, dVar, str, function1, j, quoteData2, str2, fVar, context, null), 2);
                    }
                }).a));
                return Unit.a;
            }
        }

        public C1614g(Context context, Ref.ObjectRef<Uri> objectRef, QuoteData quoteData, UserConfigData userConfigData, D7 d7, Function1<? super String, Unit> function1, long j, AppEnums.f fVar, Kk.c<? super C1614g> cVar) {
            super(2, cVar);
            this.a = context;
            this.b = objectRef;
            this.c = quoteData;
            this.d = userConfigData;
            this.e = d7;
            this.f = function1;
            this.g = j;
            this.h = fVar;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return new C1614g(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            String str;
            String str2;
            CreationV2Data creationVersion2;
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            Ref.ObjectRef<Uri> objectRef = this.b;
            Uri uri = (Uri) objectRef.element;
            Context context = this.a;
            String c = FFmpegKitConfig.c(context, uri);
            File cacheDir = context.getCacheDir();
            Intrinsics.checkNotNullExpressionValue(cacheDir, "getCacheDir(...)");
            String absolutePath = new File(cacheDir, c0.c.b(new StringBuilder(), ".mp4")).getAbsolutePath();
            QuoteData quoteData = this.c;
            if (quoteData == null || (str = quoteData.getVideoUrl()) == null) {
                str = "";
            }
            UserConfigData userConfigData = this.d;
            if (userConfigData == null || (creationVersion2 = userConfigData.getCreationVersion2()) == null || (str2 = creationVersion2.getFeedDownloadCommand3()) == null) {
                str2 = "-i [quoteImageFileName] -i [videoUrl] -filter_complex [0]scale=480:-2[quote];[1]scale=480:-2[video];[video][quote]overlay=0:0[output] -map [output] -map 1:a? -c:v libx264 -preset veryfast -crf 21 -c:a copy -shortest -movflags +faststart [outputPath]";
            }
            Intrinsics.checkNotNull(c);
            String l = kotlin.text.p.l(kotlin.text.p.l(str2, "[quoteImageFileName]", c), "[videoUrl]", kotlin.text.p.l(str, " ", "%20"));
            Intrinsics.checkNotNull(absolutePath);
            String l2 = kotlin.text.p.l(l, "[outputPath]", absolutePath);
            Boolean isShowPurchaseScreenV2 = quoteData.isShowPurchaseScreenV2();
            Boolean bool = Boolean.TRUE;
            boolean areEqual = Intrinsics.areEqual(isShowPurchaseScreenV2, bool);
            final D7 d7 = this.e;
            if (areEqual && (Intrinsics.areEqual(quoteData.getVideoBufferingInSplitScreen(), bool) || Intrinsics.areEqual(quoteData.getShowVideoScreenshotInSplitScreen(), bool))) {
                quoteData.setBottomImageUriForVideo(((Uri) objectRef.element).toString());
                androidx.lifecycle.E a2 = androidx.lifecycle.J.a(d7);
                kl.c cVar = dl.Z.a;
                dl.g.b(a2, il.p.a, (dl.J) null, new a(d7, null), 2);
                Function1<String, Unit> function1 = this.f;
                if (function1 != null) {
                    String uri2 = ((Uri) objectRef.element).toString();
                    Intrinsics.checkNotNullExpressionValue(uri2, "toString(...)");
                    function1.invoke(uri2);
                }
            } else {
                FFmpegKitConfig.h = new N5.p() {
                    public final void a(final N5.o oVar) {
                        final D7 d72 = D7.this;
                        d72.x0(new Function0() {
                            public final Object invoke() {
                                ProgressBar progressBar;
                                a.a aVar2 = do.a.a;
                                StringBuilder sb = new StringBuilder("enableStatisticsCallback ");
                                N5.o oVar2 = oVar;
                                sb.append(oVar2);
                                aVar2.c(sb.toString(), new Object[0]);
                                D7 d73 = d72;
                                E7.G g = d73.m3;
                                I7.m e = g != null ? g.e(d73.y2) : null;
                                if (e instanceof InitData) {
                                    InitData initData = (InitData) e;
                                    Widget widget = initData.getWidget();
                                    if ((widget != null ? widget.getData() : null) instanceof QuoteData) {
                                        Widget widget2 = initData.getWidget();
                                        I7.m data = widget2 != null ? widget2.getData() : null;
                                        Intrinsics.checkNotNull(data, "null cannot be cast to non-null type com.crafto.android.data.model.QuoteData");
                                        QuoteData quoteData2 = (QuoteData) data;
                                        aVar2.c("enableStatisticsCallback_sessionId " + quoteData2.getSessionId(), new Object[0]);
                                        Long sessionId = quoteData2.getSessionId();
                                        long j = oVar2.a;
                                        if (sessionId != null && sessionId.longValue() == j) {
                                            int q2 = D7.q2(quoteData2.getVideoLength(), (int) oVar2.f);
                                            if (q2 > 100) {
                                                q2 = 100;
                                            }
                                            aVar2.c(Eb.J0.a(q2, "loadingPercentage "), new Object[0]);
                                            C3053c2 c3053c2 = (C3053c2) d73.y;
                                            if (c3053c2 != null && (progressBar = c3053c2.v2) != null) {
                                                progressBar.setProgress(q2);
                                            }
                                        }
                                    }
                                }
                                return Unit.a;
                            }
                        });
                    }
                };
                dl.g.b(androidx.lifecycle.J.a(d7), dl.Z.a, (dl.J) null, new b(this.g, this.c, l2, this.e, absolutePath, this.f, System.currentTimeMillis(), this.h, this.a, null), 2);
            }
            return Unit.a;
        }
    }

    public static final class g0 extends Lambda implements Function0<v0.b> {
        public final Fragment a;
        public final Hk.k b;

        public g0(Fragment fragment, Hk.k kVar) {
            super(0);
            this.a = fragment;
            this.b = kVar;
        }

        public final Object invoke() {
            v0.b defaultViewModelProviderFactory;
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.b);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return (uVar2 == null || (defaultViewModelProviderFactory = uVar2.getDefaultViewModelProviderFactory()) == null) ? this.a.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$4$6", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    @SourceDebugExtension({"SMAP\nTrendingHomeFullScreenExpFragment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$4$6\n+ 2 Standard.kt\ncom/crafto/android/utility/extension_functions/StandardKt\n+ 3 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,22219:1\n17#2:22220\n18#2,5:22223\n17#2:22228\n18#2,5:22231\n17#2:22236\n18#2,5:22239\n12364#3,2:22221\n12364#3,2:22229\n12364#3,2:22237\n*S KotlinDebug\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$4$6\n*L\n13465#1:22220\n13465#1:22223,5\n13769#1:22228\n13769#1:22231,5\n13476#1:22236\n13476#1:22239,5\n13465#1:22221,2\n13769#1:22229,2\n13476#1:22237,2\n*E\n"})
    public static final class C1615h extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public final Ref.IntRef b;
        public final Bitmap c;
        public final QuoteData d;
        public final Bitmap e;
        public final Bitmap f;
        public final Context g;
        public final Ref.ObjectRef<Uri> h;
        public final Ref.ObjectRef<Uri> i;
        public final Ref.ObjectRef<String> j;
        public final Ref.ObjectRef<String> k;
        public final Ref.ObjectRef<Uri> l;
        public final int m;
        public final Ref.FloatRef n;
        public final Ref.FloatRef o;
        public final Ref.IntRef p;
        public final Ref.FloatRef q;
        public final String r;
        public final Ref.ObjectRef<String> s;
        public final String t;
        public final Ref.ObjectRef<Uri> u;
        public final Function1<String, Unit> v;
        public final long w;
        public final AppEnums.f x;

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$4$6$1$4$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final D7 a;

            public a(D7 d7, Kk.c<? super a> cVar) {
                super(2, cVar);
                this.a = d7;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new a(this.a, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                final D7 d7 = this.a;
                d7.x0(new Function0() {
                    public final Object invoke() {
                        boolean z = D7.Q4;
                        D7.this.A2();
                        return Unit.a;
                    }
                });
                return Unit.a;
            }
        }

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$4$6$1$4$4", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class b extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final long a;
            public final QuoteData b;
            public final Ref.ObjectRef<String> c;
            public final D7 d;
            public final String e;
            public final Function1<String, Unit> f;
            public final long g;
            public final Ref.ObjectRef<String> h;
            public final AppEnums.f i;
            public final Context j;

            @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$4$6$1$4$4$session$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
            public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                public final D7 a;
                public final N5.d b;
                public final String c;
                public final Function1<String, Unit> d;
                public final long e;
                public final QuoteData f;
                public final Ref.ObjectRef<String> g;
                public final Ref.ObjectRef<String> h;
                public final AppEnums.f i;
                public final Context j;

                @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$4$6$1$4$4$session$1$1$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {14007, 14026}, m = "invokeSuspend")
                public static final class C0040a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                    public Uri a;
                    public int b;
                    public final AppEnums.f c;
                    public final D7 d;
                    public final QuoteData e;
                    public final String f;
                    public final Context g;

                    public C0040a(AppEnums.f fVar, D7 d7, QuoteData quoteData, String str, Context context, Kk.c<? super C0040a> cVar) {
                        super(2, cVar);
                        this.c = fVar;
                        this.d = d7;
                        this.e = quoteData;
                        this.f = str;
                        this.g = context;
                    }

                    public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                        return new C0040a(this.c, this.d, this.e, this.f, this.g, cVar);
                    }

                    public final Object invoke(Object obj, Object obj2) {
                        return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                    }

                    public final java.lang.Object invokeSuspend(java.lang.Object r23) {
                        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.C1615h.b.a.C0040a.invokeSuspend(java.lang.Object):java.lang.Object");
                    }
                }

                public a(D7 d7, N5.d dVar, String str, Function1<? super String, Unit> function1, long j, QuoteData quoteData, Ref.ObjectRef<String> objectRef, Ref.ObjectRef<String> objectRef2, AppEnums.f fVar, Context context, Kk.c<? super a> cVar) {
                    super(2, cVar);
                    this.a = d7;
                    this.b = dVar;
                    this.c = str;
                    this.d = function1;
                    this.e = j;
                    this.f = quoteData;
                    this.g = objectRef;
                    this.h = objectRef2;
                    this.i = fVar;
                    this.j = context;
                }

                public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                    return new a(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, this.i, this.j, cVar);
                }

                public final Object invoke(Object obj, Object obj2) {
                    return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                }

                public final Object invokeSuspend(Object obj) {
                    Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                    Hk.q.b(obj);
                    final N5.d dVar = this.b;
                    final String str = this.c;
                    final Function1<String, Unit> function1 = this.d;
                    final D7 d7 = this.a;
                    final long j = this.e;
                    final QuoteData quoteData = this.f;
                    final Ref.ObjectRef<String> objectRef = this.g;
                    final Ref.ObjectRef<String> objectRef2 = this.h;
                    final AppEnums.f fVar = this.i;
                    final Context context = this.j;
                    d7.x0(new Function0() {
                        public final java.lang.Object invoke() {
                            throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.C1771l8.invoke():java.lang.Object");
                        }
                    });
                    return Unit.a;
                }
            }

            public b(long j, long j2, Kk.c cVar, Context context, QuoteData quoteData, D7 d7, AppEnums.f fVar, String str, Function1 function1, Ref.ObjectRef objectRef, Ref.ObjectRef objectRef2) {
                super(2, cVar);
                this.a = j;
                this.b = quoteData;
                this.c = objectRef;
                this.d = d7;
                this.e = str;
                this.f = function1;
                this.g = j2;
                this.h = objectRef2;
                this.i = fVar;
                this.j = context;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                AppEnums.f fVar = this.i;
                Context context = this.j;
                long j = this.a;
                QuoteData quoteData = this.b;
                Ref.ObjectRef<String> objectRef = this.c;
                return new b(j, this.g, cVar, context, quoteData, this.d, fVar, this.e, this.f, objectRef, this.h);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                String valueOf = String.valueOf(System.currentTimeMillis() - this.a);
                QuoteData quoteData = this.b;
                Pair pair = new Pair("Template Id", quoteData != null ? new Integer(quoteData.getDesign()) : null);
                Pair pair2 = new Pair("Content Type", quoteData != null ? quoteData.getContentType() : null);
                Pair pair3 = new Pair("Content Url", quoteData != null ? quoteData.getVideoUrl() : null);
                Pair pair4 = new Pair("Audio Url", quoteData != null ? quoteData.getAudioUrl() : null);
                VoiceOverData voiceOverData = quoteData.getVoiceOverData();
                Pair pair5 = new Pair("isVoiceOverVideo", voiceOverData != null ? voiceOverData.isVoiceOverVideo() : null);
                Pair pair6 = new Pair("shouldWaitForVoiceData", Boolean.valueOf(quoteData.getShouldWaitForVoiceData()));
                StringBuilder sb = new StringBuilder("name_");
                VoiceData voiceData = quoteData.getVoiceData();
                sb.append(voiceData != null ? voiceData.getName() : null);
                sb.append(" file_");
                VoiceData voiceData2 = quoteData.getVoiceData();
                sb.append(voiceData2 != null ? voiceData2.getFileLocation() : null);
                Pair pair7 = new Pair("voiceData", sb.toString());
                final Ref.ObjectRef<String> objectRef = this.c;
                com.crafto.android.ui.base.a.f0(this.d, "Video Logs", "Home Screen", null, valueOf, "Video Processing Start", 0, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, pair6, pair7, new Pair("Ffmpeg Command", objectRef.element)}), 484);
                String str = (String) objectRef.element;
                final AppEnums.f fVar = this.i;
                final Context context = this.j;
                final D7 d7 = this.d;
                final String str2 = this.e;
                final Function1<String, Unit> function1 = this.f;
                final long j = this.g;
                final QuoteData quoteData2 = this.b;
                final Ref.ObjectRef<String> objectRef2 = this.h;
                quoteData.setSessionId(new Long(N5.c.a(str, new N5.e() {
                    public final void b(N5.d dVar) {
                        D7 d72 = D7.this;
                        androidx.lifecycle.E a2 = androidx.lifecycle.J.a(d72);
                        kl.c cVar = dl.Z.a;
                        dl.g.b(a2, il.p.a, (dl.J) null, new D7.C1615h.b.a(d72, dVar, str2, function1, j, quoteData2, objectRef2, objectRef, fVar, context, null), 2);
                    }
                }).a));
                return Unit.a;
            }
        }

        public C1615h(Ref.IntRef intRef, Bitmap bitmap, QuoteData quoteData, Bitmap bitmap2, Bitmap bitmap3, Context context, Ref.ObjectRef<Uri> objectRef, Ref.ObjectRef<Uri> objectRef2, Ref.ObjectRef<String> objectRef3, Ref.ObjectRef<String> objectRef4, Ref.ObjectRef<Uri> objectRef5, int i, Ref.FloatRef floatRef, Ref.FloatRef floatRef2, Ref.IntRef intRef2, Ref.FloatRef floatRef3, String str, Ref.ObjectRef<String> objectRef6, String str2, Ref.ObjectRef<Uri> objectRef7, Function1<? super String, Unit> function1, long j, AppEnums.f fVar, Kk.c<? super C1615h> cVar) {
            super(2, cVar);
            this.b = intRef;
            this.c = bitmap;
            this.d = quoteData;
            this.e = bitmap2;
            this.f = bitmap3;
            this.g = context;
            this.h = objectRef;
            this.i = objectRef2;
            this.j = objectRef3;
            this.k = objectRef4;
            this.l = objectRef5;
            this.m = i;
            this.n = floatRef;
            this.o = floatRef2;
            this.p = intRef2;
            this.q = floatRef3;
            this.r = str;
            this.s = objectRef6;
            this.t = str2;
            this.u = objectRef7;
            this.v = function1;
            this.w = j;
            this.x = fVar;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new C1615h(this.b, this.c, this.d, this.e, this.f, this.g, this.h, this.i, this.j, this.k, this.l, this.m, this.n, this.o, this.p, this.q, this.r, this.s, this.t, this.u, this.v, this.w, this.x, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            final Ref.IntRef intRef = this.b;
            final Bitmap bitmap = this.c;
            final QuoteData quoteData = this.d;
            final Bitmap bitmap2 = this.e;
            final Bitmap bitmap3 = this.f;
            final Context context = this.g;
            final Ref.ObjectRef<Uri> objectRef = this.h;
            final Ref.ObjectRef<Uri> objectRef2 = this.i;
            final D7 d7 = D7.this;
            final Ref.ObjectRef<String> objectRef3 = this.j;
            final Ref.ObjectRef<String> objectRef4 = this.k;
            final Ref.ObjectRef<Uri> objectRef5 = this.l;
            final int i = this.m;
            final Ref.FloatRef floatRef = this.n;
            final Ref.FloatRef floatRef2 = this.o;
            final Ref.IntRef intRef2 = this.p;
            final Ref.FloatRef floatRef3 = this.q;
            final String str = this.r;
            final Ref.ObjectRef<String> objectRef6 = this.s;
            final String str2 = this.t;
            final Ref.ObjectRef<Uri> objectRef7 = this.u;
            final Function1<String, Unit> function1 = this.v;
            final long j = this.w;
            final AppEnums.f fVar = this.x;
            d7.x0(new Function0() {
                public final java.lang.Object invoke() {
                    throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.C1691e8.invoke():java.lang.Object");
                }
            });
            return Unit.a;
        }
    }

    public static final class h0 extends Lambda implements Function0<Fragment> {
        public final Fragment a;

        public h0(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$5$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class C1616i extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public final Context a;
        public final Ref.ObjectRef<Uri> b;
        public final QuoteData c;
        public final D7 d;
        public final Ref.ObjectRef<String> e;
        public final long f;
        public final Function1<String, Unit> g;
        public final AppEnums.f h;

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$5$1$1$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final long a;
            public final QuoteData b;
            public final D7 c;
            public final Ref.ObjectRef<String> d;
            public final String e;
            public final Function1<String, Unit> f;
            public final long g;
            public final Ref.ObjectRef<String> h;
            public final AppEnums.f i;
            public final Context j;

            @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$5$1$1$2$session$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
            public static final class C0041a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                public final D7 a;
                public final N5.d b;
                public final String c;
                public final Function1<String, Unit> d;
                public final long e;
                public final QuoteData f;
                public final Ref.ObjectRef<String> g;
                public final AppEnums.f h;
                public final Context i;

                @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$5$1$1$2$session$1$1$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {14299, 14328}, m = "invokeSuspend")
                public static final class C0042a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                    public Uri a;
                    public int b;
                    public final AppEnums.f c;
                    public final D7 d;
                    public final QuoteData e;
                    public final String f;
                    public final Context g;

                    public C0042a(AppEnums.f fVar, D7 d7, QuoteData quoteData, String str, Context context, Kk.c<? super C0042a> cVar) {
                        super(2, cVar);
                        this.c = fVar;
                        this.d = d7;
                        this.e = quoteData;
                        this.f = str;
                        this.g = context;
                    }

                    public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                        return new C0042a(this.c, this.d, this.e, this.f, this.g, cVar);
                    }

                    public final Object invoke(Object obj, Object obj2) {
                        return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                    }

                    public final java.lang.Object invokeSuspend(java.lang.Object r23) {
                        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.C1616i.a.C0041a.C0042a.invokeSuspend(java.lang.Object):java.lang.Object");
                    }
                }

                public C0041a(D7 d7, N5.d dVar, String str, Function1<? super String, Unit> function1, long j, QuoteData quoteData, Ref.ObjectRef<String> objectRef, AppEnums.f fVar, Context context, Kk.c<? super C0041a> cVar) {
                    super(2, cVar);
                    this.a = d7;
                    this.b = dVar;
                    this.c = str;
                    this.d = function1;
                    this.e = j;
                    this.f = quoteData;
                    this.g = objectRef;
                    this.h = fVar;
                    this.i = context;
                }

                public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                    return new C0041a(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, this.i, cVar);
                }

                public final Object invoke(Object obj, Object obj2) {
                    return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                }

                public final Object invokeSuspend(Object obj) {
                    Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                    Hk.q.b(obj);
                    final N5.d dVar = this.b;
                    final String str = this.c;
                    final Function1<String, Unit> function1 = this.d;
                    final long j = this.e;
                    final D7 d7 = this.a;
                    final QuoteData quoteData = this.f;
                    final Ref.ObjectRef<String> objectRef = this.g;
                    final AppEnums.f fVar = this.h;
                    final Context context = this.i;
                    d7.x0(new Function0() {
                        public final Object invoke() {
                            VoiceData voiceData;
                            VoiceData voiceData2;
                            VoiceOverData voiceOverData;
                            a.a aVar2 = do.a.a;
                            StringBuilder sb = new StringBuilder("session ");
                            N5.d dVar2 = dVar;
                            sb.append(dVar2);
                            aVar2.c(sb.toString(), new Object[0]);
                            boolean a = N5.l.a(dVar2.i);
                            D7 d72 = d7;
                            if (!a) {
                                boolean z = D7.Q4;
                                d72.A2();
                                return Unit.a;
                            }
                            StringBuilder sb2 = new StringBuilder("input_video_uri ");
                            String str2 = str;
                            sb2.append(str2);
                            aVar2.c(sb2.toString(), new Object[0]);
                            Function1 function12 = function1;
                            if (function12 != null) {
                                Intrinsics.checkNotNull(str2);
                                function12.invoke(str2);
                            }
                            long currentTimeMillis = System.currentTimeMillis() - j;
                            long currentTimeMillis2 = System.currentTimeMillis() - d72.m2;
                            StringBuilder a2 = defpackage.m.a(aVar2, J1.c.c(currentTimeMillis, "videoProcessingTime_ "), new Object[0], "videoProcessingTime_2 ");
                            a2.append(currentTimeMillis2);
                            aVar2.c(a2.toString(), new Object[0]);
                            String valueOf = String.valueOf(currentTimeMillis);
                            QuoteData quoteData2 = quoteData;
                            Pair pair = new Pair("Template Id", quoteData2 != null ? Integer.valueOf(quoteData2.getDesign()) : null);
                            Pair pair2 = new Pair("Content Type", quoteData2 != null ? quoteData2.getContentType() : null);
                            Pair pair3 = new Pair("Source", objectRef.element);
                            Pair pair4 = new Pair("Content Url", quoteData2 != null ? quoteData2.getVideoUrl() : null);
                            Pair pair5 = new Pair("Audio Url", quoteData2 != null ? quoteData2.getAudioUrl() : null);
                            Pair pair6 = new Pair("isVoiceOverVideo", (quoteData2 == null || (voiceOverData = quoteData2.getVoiceOverData()) == null) ? null : voiceOverData.isVoiceOverVideo());
                            Pair pair7 = new Pair("shouldWaitForVoiceData", quoteData2 != null ? Boolean.valueOf(quoteData2.getShouldWaitForVoiceData()) : null);
                            StringBuilder sb3 = new StringBuilder("name_");
                            sb3.append((quoteData2 == null || (voiceData2 = quoteData2.getVoiceData()) == null) ? null : voiceData2.getName());
                            sb3.append(" file_");
                            sb3.append((quoteData2 == null || (voiceData = quoteData2.getVoiceData()) == null) ? null : voiceData.getFileLocation());
                            com.crafto.android.ui.base.a.f0(d72, "Video Logs", "Home Screen", null, valueOf, "Video Processing Completed", 0, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, pair6, pair7, new Pair("voiceData", sb3.toString())}), 484);
                            return dl.g.b(androidx.lifecycle.J.a(d72), (CoroutineContext) null, (dl.J) null, new D7.C1616i.a.C0041a.C0042a(fVar, d72, quoteData2, str2, context, null), 3);
                        }
                    });
                    return Unit.a;
                }
            }

            public a(long j, long j2, Kk.c cVar, Context context, QuoteData quoteData, D7 d7, AppEnums.f fVar, String str, Function1 function1, Ref.ObjectRef objectRef, Ref.ObjectRef objectRef2) {
                super(2, cVar);
                this.a = j;
                this.b = quoteData;
                this.c = d7;
                this.d = objectRef;
                this.e = str;
                this.f = function1;
                this.g = j2;
                this.h = objectRef2;
                this.i = fVar;
                this.j = context;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                AppEnums.f fVar = this.i;
                Context context = this.j;
                long j = this.a;
                QuoteData quoteData = this.b;
                D7 d7 = this.c;
                Ref.ObjectRef<String> objectRef = this.d;
                return new a(j, this.g, cVar, context, quoteData, d7, fVar, this.e, this.f, objectRef, this.h);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                VoiceData voiceData;
                VoiceData voiceData2;
                VoiceOverData voiceOverData;
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                String valueOf = String.valueOf(System.currentTimeMillis() - this.a);
                String str = null;
                QuoteData quoteData = this.b;
                Pair pair = new Pair("Template Id", quoteData != null ? new Integer(quoteData.getDesign()) : null);
                Pair pair2 = new Pair("Content Type", quoteData != null ? quoteData.getContentType() : null);
                Pair pair3 = new Pair("Content Url", quoteData != null ? quoteData.getVideoUrl() : null);
                Pair pair4 = new Pair("Audio Url", quoteData != null ? quoteData.getAudioUrl() : null);
                Pair pair5 = new Pair("isVoiceOverVideo", (quoteData == null || (voiceOverData = quoteData.getVoiceOverData()) == null) ? null : voiceOverData.isVoiceOverVideo());
                Pair pair6 = new Pair("shouldWaitForVoiceData", quoteData != null ? Boolean.valueOf(quoteData.getShouldWaitForVoiceData()) : null);
                StringBuilder sb = new StringBuilder("name_");
                sb.append((quoteData == null || (voiceData2 = quoteData.getVoiceData()) == null) ? null : voiceData2.getName());
                sb.append(" file_");
                if (quoteData != null && (voiceData = quoteData.getVoiceData()) != null) {
                    str = voiceData.getFileLocation();
                }
                sb.append(str);
                com.crafto.android.ui.base.a.f0(this.c, "Video Logs", "Home Screen", null, valueOf, "Video Processing Start", 0, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, pair6, new Pair("voiceData", sb.toString())}), 484);
                String str2 = (String) this.d.element;
                final AppEnums.f fVar = this.i;
                final Context context = this.j;
                final D7 d7 = this.c;
                final String str3 = this.e;
                final Function1<String, Unit> function1 = this.f;
                final long j = this.g;
                final QuoteData quoteData2 = this.b;
                final Ref.ObjectRef<String> objectRef = this.h;
                N5.d a = N5.c.a(str2, new N5.e() {
                    public final void b(N5.d dVar) {
                        D7 d72 = D7.this;
                        androidx.lifecycle.E a2 = androidx.lifecycle.J.a(d72);
                        kl.c cVar = dl.Z.a;
                        dl.g.b(a2, il.p.a, (dl.J) null, new D7.C1616i.a.C0041a(d72, dVar, str3, function1, j, quoteData2, objectRef, fVar, context, null), 2);
                    }
                });
                if (quoteData != null) {
                    quoteData.setSessionId(new Long(a.a));
                }
                return Unit.a;
            }
        }

        public C1616i(Context context, Ref.ObjectRef<Uri> objectRef, QuoteData quoteData, D7 d7, Ref.ObjectRef<String> objectRef2, long j, Function1<? super String, Unit> function1, AppEnums.f fVar, Kk.c<? super C1616i> cVar) {
            super(2, cVar);
            this.a = context;
            this.b = objectRef;
            this.c = quoteData;
            this.d = d7;
            this.e = objectRef2;
            this.f = j;
            this.g = function1;
            this.h = fVar;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return new C1616i(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            String str;
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            Uri uri = (Uri) this.b.element;
            Context context = this.a;
            final String c = FFmpegKitConfig.c(context, uri);
            File cacheDir = context.getCacheDir();
            Intrinsics.checkNotNullExpressionValue(cacheDir, "getCacheDir(...)");
            final String absolutePath = new File(cacheDir, c0.c.b(new StringBuilder(), ".mp4")).getAbsolutePath();
            QuoteData quoteData = this.c;
            if (quoteData == null || (str = quoteData.getAudioUrl()) == null) {
                str = "";
            }
            final AppEnums.f fVar = this.h;
            final Context context2 = this.a;
            final Ref.ObjectRef<String> objectRef = this.e;
            final D7 d7 = this.d;
            final long j = this.f;
            final QuoteData quoteData2 = this.c;
            final Function1<String, Unit> function1 = this.g;
            final String str2 = str;
            D7.R0(d7, str, new Function1() {
                public final Object invoke(Object obj2) {
                    String l;
                    String str3 = (String) obj2;
                    a.a aVar2 = do.a.a;
                    Ref.ObjectRef b = W7.r.b(aVar2, C1.e.a("getExoplayerCachedUri cachedUri ", str3), new Object[0]);
                    String str4 = c;
                    Intrinsics.checkNotNull(str4);
                    String l2 = kotlin.text.p.l("-framerate 1 -loop 1 -i [quoteImageFileName] -i [audioUrl] -filter_complex [0]scale=1080:-2[output1] -map [output1] -map 1:a? -shortest -c:v libx264 -preset veryfast -crf 21 -c:a copy -pix_fmt yuv420p -movflags +faststart [outputPath]", "[quoteImageFileName]", str4);
                    String str5 = absolutePath;
                    Intrinsics.checkNotNull(str5);
                    String l3 = kotlin.text.p.l(l2, "[outputPath]", str5);
                    b.element = l3;
                    Ref.ObjectRef objectRef2 = objectRef;
                    if (str3 != null) {
                        objectRef2.element = "Cache";
                        l = kotlin.text.p.l((String) b.element, "[audioUrl]", str3);
                    } else {
                        l = kotlin.text.p.l(l3, "[audioUrl]", kotlin.text.p.l(str2, " ", "%20"));
                    }
                    b.element = l;
                    aVar2.c("finalCommand__audio " + ((String) b.element), new Object[0]);
                    D7 d72 = d7;
                    FFmpegKitConfig.h = new C1793n8(d72);
                    long currentTimeMillis = System.currentTimeMillis();
                    dl.g.b(androidx.lifecycle.J.a(d72), dl.Z.a, (dl.J) null, new D7.C1616i.a(j, currentTimeMillis, null, context2, quoteData2, d72, fVar, str5, function1, b, objectRef2), 2);
                    return Unit.a;
                }
            });
            return Unit.a;
        }
    }

    public static final class i0 extends Lambda implements Function0<androidx.lifecycle.y0> {
        public final Function0 a;

        public i0(h0 h0Var) {
            super(0);
            this.a = h0Var;
        }

        public final Object invoke() {
            return (androidx.lifecycle.y0) this.a.invoke();
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$6$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class C1617j extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public final Context a;
        public final Ref.ObjectRef<Uri> b;
        public final Ref.ObjectRef<Uri> c;
        public final Ref.ObjectRef<Uri> d;
        public final QuoteData e;
        public final Bitmap f;
        public final D7 g;
        public final Bitmap h;
        public final Bitmap i;
        public final Bitmap j;
        public final UserConfigData k;
        public final Function1<String, Unit> l;
        public final AppEnums.f m;

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$6$1$1$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final D7 a;

            public a(D7 d7, Kk.c<? super a> cVar) {
                super(2, cVar);
                this.a = d7;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new a(this.a, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                D7 d7 = this.a;
                d7.x0(new C1830q8(d7, 0));
                return Unit.a;
            }
        }

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$6$1$1$4", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class b extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final String a;
            public final QuoteData b;
            public final D7 c;
            public final String d;
            public final Function1<String, Unit> e;
            public final AppEnums.f f;
            public final Context g;

            @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$6$1$1$4$session$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
            public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                public final D7 a;
                public final N5.d b;
                public final String c;
                public final Function1<String, Unit> d;
                public final AppEnums.f e;
                public final QuoteData f;
                public final Context g;

                @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$createVideoWithUserDetails$1$1$6$1$1$4$session$1$1$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {14760, 14781}, m = "invokeSuspend")
                public static final class C0043a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
                    public Uri a;
                    public int b;
                    public final AppEnums.f c;
                    public final D7 d;
                    public final QuoteData e;
                    public final String f;
                    public final Context g;

                    public C0043a(AppEnums.f fVar, D7 d7, QuoteData quoteData, String str, Context context, Kk.c<? super C0043a> cVar) {
                        super(2, cVar);
                        this.c = fVar;
                        this.d = d7;
                        this.e = quoteData;
                        this.f = str;
                        this.g = context;
                    }

                    public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                        return new C0043a(this.c, this.d, this.e, this.f, this.g, cVar);
                    }

                    public final Object invoke(Object obj, Object obj2) {
                        return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                    }

                    public final java.lang.Object invokeSuspend(java.lang.Object r23) {
                        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.C1617j.b.a.C0043a.invokeSuspend(java.lang.Object):java.lang.Object");
                    }
                }

                public a(D7 d7, N5.d dVar, String str, Function1<? super String, Unit> function1, AppEnums.f fVar, QuoteData quoteData, Context context, Kk.c<? super a> cVar) {
                    super(2, cVar);
                    this.a = d7;
                    this.b = dVar;
                    this.c = str;
                    this.d = function1;
                    this.e = fVar;
                    this.f = quoteData;
                    this.g = context;
                }

                public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                    return new a(this.a, this.b, this.c, this.d, this.e, this.f, this.g, cVar);
                }

                public final Object invoke(Object obj, Object obj2) {
                    return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
                }

                public final Object invokeSuspend(Object obj) {
                    Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                    Hk.q.b(obj);
                    final N5.d dVar = this.b;
                    final String str = this.c;
                    final Function1<String, Unit> function1 = this.d;
                    final D7 d7 = this.a;
                    final AppEnums.f fVar = this.e;
                    final QuoteData quoteData = this.f;
                    final Context context = this.g;
                    d7.x0(new Function0() {
                        public final Object invoke() {
                            a.a aVar2 = do.a.a;
                            StringBuilder sb = new StringBuilder("session ");
                            N5.d dVar2 = dVar;
                            sb.append(dVar2);
                            aVar2.c(sb.toString(), new Object[0]);
                            boolean a = N5.l.a(dVar2.i);
                            D7 d72 = d7;
                            if (!a) {
                                boolean z = D7.Q4;
                                d72.A2();
                                return Unit.a;
                            }
                            StringBuilder sb2 = new StringBuilder("input_video_uri ");
                            String str2 = str;
                            sb2.append(str2);
                            aVar2.c(sb2.toString(), new Object[0]);
                            Function1 function12 = function1;
                            if (function12 != null) {
                                Intrinsics.checkNotNull(str2);
                                function12.invoke(str2);
                            }
                            return dl.g.b(androidx.lifecycle.J.a(d72), (CoroutineContext) null, (dl.J) null, new D7.C1617j.b.a.C0043a(fVar, d72, quoteData, str2, context, null), 3);
                        }
                    });
                    return Unit.a;
                }
            }

            public b(String str, QuoteData quoteData, D7 d7, String str2, Function1<? super String, Unit> function1, AppEnums.f fVar, Context context, Kk.c<? super b> cVar) {
                super(2, cVar);
                this.a = str;
                this.b = quoteData;
                this.c = d7;
                this.d = str2;
                this.e = function1;
                this.f = fVar;
                this.g = context;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new b(this.a, this.b, this.c, this.d, this.e, this.f, this.g, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                final D7 d7 = this.c;
                final String str = this.d;
                final Function1<String, Unit> function1 = this.e;
                final AppEnums.f fVar = this.f;
                final QuoteData quoteData = this.b;
                final Context context = this.g;
                N5.d a2 = N5.c.a(this.a, new N5.e() {
                    public final void b(N5.d dVar) {
                        D7 d72 = D7.this;
                        androidx.lifecycle.E a3 = androidx.lifecycle.J.a(d72);
                        kl.c cVar = dl.Z.a;
                        dl.g.b(a3, il.p.a, (dl.J) null, new D7.C1617j.b.a(d72, dVar, str, function1, fVar, quoteData, context, null), 2);
                    }
                });
                QuoteData quoteData2 = this.b;
                if (quoteData2 != null) {
                    quoteData2.setSessionId(new Long(a2.a));
                }
                return Unit.a;
            }
        }

        public C1617j(Context context, Ref.ObjectRef<Uri> objectRef, Ref.ObjectRef<Uri> objectRef2, Ref.ObjectRef<Uri> objectRef3, QuoteData quoteData, Bitmap bitmap, D7 d7, Bitmap bitmap2, Bitmap bitmap3, Bitmap bitmap4, UserConfigData userConfigData, Function1<? super String, Unit> function1, AppEnums.f fVar, Kk.c<? super C1617j> cVar) {
            super(2, cVar);
            this.a = context;
            this.b = objectRef;
            this.c = objectRef2;
            this.d = objectRef3;
            this.e = quoteData;
            this.f = bitmap;
            this.g = d7;
            this.h = bitmap2;
            this.i = bitmap3;
            this.j = bitmap4;
            this.k = userConfigData;
            this.l = function1;
            this.m = fVar;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return new C1617j(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, this.i, this.j, this.k, this.l, this.m, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final java.lang.Object invokeSuspend(java.lang.Object r27) {
            throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.C1617j.invokeSuspend(java.lang.Object):java.lang.Object");
        }
    }

    public static final class j0 extends Lambda implements Function0<androidx.lifecycle.x0> {
        public final Hk.k a;

        public j0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            return FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a).getViewModelStore();
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$editNameFlow$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    @SourceDebugExtension({"SMAP\nTrendingHomeFullScreenExpFragment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$editNameFlow$1$1\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,22219:1\n1863#2,2:22220\n*S KotlinDebug\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$editNameFlow$1$1\n*L\n12196#1:22220,2\n*E\n"})
    public static final class C1618k extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public final QuoteData b;
        public final int c;

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$editNameFlow$1$1$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
        public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public final D7 a;

            public a(D7 d7, Kk.c<? super a> cVar) {
                super(2, cVar);
                this.a = d7;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new a(this.a, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                Hk.q.b(obj);
                D7 d7 = this.a;
                E7.G g = d7.m3;
                if (g != null) {
                    g.notifyDataSetChanged();
                }
                d7.Z2(true);
                return Unit.a;
            }
        }

        public C1618k(QuoteData quoteData, int i, Kk.c<? super C1618k> cVar) {
            super(2, cVar);
            this.b = quoteData;
            this.c = i;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new C1618k(this.b, this.c, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            ArrayList<I7.m> arrayList;
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            D7 d7 = D7.this;
            E7.G g = d7.m3;
            int i = this.c;
            if (g != null && (arrayList = g.l) != null) {
                Iterator<I7.m> it = arrayList.iterator();
                while (it.hasNext()) {
                    I7.m next = it.next();
                    if (next instanceof InitData) {
                        InitData initData = (InitData) next;
                        Widget widget = initData.getWidget();
                        if ((widget != null ? widget.getData() : null) instanceof QuoteData) {
                            Widget widget2 = initData.getWidget();
                            I7.m data = widget2 != null ? widget2.getData() : null;
                            QuoteData quoteData = data instanceof QuoteData ? (QuoteData) data : null;
                            if (quoteData != null) {
                                quoteData.setNameResizeBy(i);
                            }
                        }
                    }
                }
            }
            this.b.setNameResizeBy(i);
            androidx.lifecycle.E a2 = androidx.lifecycle.J.a(d7);
            kl.c cVar = dl.Z.a;
            dl.g.b(a2, il.p.a, (dl.J) null, new a(d7, null), 2);
            return Unit.a;
        }
    }

    public static final class k0 extends Lambda implements Function0<y2.a> {
        public final Hk.k a;

        public k0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return uVar2 != null ? uVar2.getDefaultViewModelCreationExtras() : a.a.b;
        }
    }

    @SourceDebugExtension({"SMAP\nTrendingHomeFullScreenExpFragment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$gamificationCoinAnimRunnable$1\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,22219:1\n1#2:22220\n*E\n"})
    public static final class RunnableC1619l implements Runnable {

        @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$gamificationCoinAnimRunnable$1$run$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {2497}, m = "invokeSuspend")
        public static final class a extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
            public int a;
            public final D7 b;

            public a(D7 d7, Kk.c<? super a> cVar) {
                super(2, cVar);
                this.b = d7;
            }

            public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
                return new a(this.b, cVar);
            }

            public final Object invoke(Object obj, Object obj2) {
                return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
            }

            public final Object invokeSuspend(Object obj) {
                Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
                int i = this.a;
                if (i == 0) {
                    Hk.q.b(obj);
                    this.a = 1;
                    if (dl.T.b(1200L, this) == aVar) {
                        return aVar;
                    }
                } else {
                    if (i != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    Hk.q.b(obj);
                }
                final D7 d7 = this.b;
                C3053c2 c3053c2 = (C3053c2) d7.y;
                final MaterialCardView materialCardView = c3053c2 != null ? c3053c2.g : null;
                Intrinsics.checkNotNull(materialCardView);
                Function0 function0 = new Function0() {
                    public final Object invoke() {
                        GamificationData gamificationData;
                        TextView textView;
                        TextView textView2;
                        D7 d72 = D7.this;
                        UserConfigData e = d72.e2().e();
                        if (e == null || (gamificationData = e.getGamificationData()) == null) {
                            return Unit.a;
                        }
                        C3053c2 c3053c22 = (C3053c2) d72.y;
                        if (c3053c22 != null && (textView2 = c3053c22.q) != null) {
                            textView2.setText(String.valueOf(Integer.valueOf(gamificationData.getAppLaunchPoints())));
                        }
                        C3053c2 c3053c23 = (C3053c2) d72.y;
                        if (c3053c23 != null && (textView = c3053c23.r) != null) {
                            String valueOf = String.valueOf(Integer.valueOf(gamificationData.getAppLaunchPoints()));
                            Intrinsics.checkNotNullParameter(textView, "<this>");
                            Intrinsics.checkNotNullParameter(valueOf, "newText");
                            TranslateAnimation translateAnimation = new TranslateAnimation(0.0f, 0.0f, 0.0f, -textView.getHeight());
                            translateAnimation.setDuration(400L);
                            translateAnimation.setFillAfter(false);
                            TranslateAnimation translateAnimation2 = new TranslateAnimation(0.0f, 0.0f, textView.getHeight(), 0.0f);
                            translateAnimation2.setDuration(400L);
                            translateAnimation2.setFillAfter(true);
                            translateAnimation.setAnimationListener(new Pb.l(textView, valueOf, translateAnimation2));
                            textView.startAnimation(translateAnimation);
                        }
                        return Unit.a;
                    }
                };
                boolean z = D7.Q4;
                Intrinsics.checkNotNullParameter(materialCardView, "view");
                materialCardView.measure(View.MeasureSpec.makeMeasureSpec(0, 0), View.MeasureSpec.makeMeasureSpec(materialCardView.getHeight(), 1073741824));
                int measuredWidth = materialCardView.getMeasuredWidth();
                ValueAnimator ofInt = ValueAnimator.ofInt(materialCardView.getWidth(), measuredWidth);
                ofInt.setDuration(1000L);
                ofInt.setInterpolator(new DecelerateInterpolator());
                ofInt.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                    @Override
                    public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                        boolean z2 = D7.Q4;
                        View view = materialCardView;
                        Intrinsics.checkNotNullParameter(view, "$view");
                        Intrinsics.checkNotNullParameter(valueAnimator, "it");
                        Object animatedValue = valueAnimator.getAnimatedValue();
                        Intrinsics.checkNotNull(animatedValue, "null cannot be cast to non-null type kotlin.Int");
                        view.getLayoutParams().width = ((Integer) animatedValue).intValue();
                        view.requestLayout();
                    }
                });
                ofInt.addListener(new G7(function0, measuredWidth, 1000L, materialCardView));
                materialCardView.setVisibility(0);
                ofInt.start();
                return Unit.a;
            }
        }

        public RunnableC1619l() {
        }

        @Override
        public final void run() {
            D7 d7;
            AnimatorSet animatorSet;
            ObjectAnimator objectAnimator;
            double nextDouble;
            RelativeLayout relativeLayout;
            RelativeLayout relativeLayout2;
            MaterialCardView materialCardView;
            RelativeLayout relativeLayout3;
            int i = 2;
            D7 d72 = D7.this;
            int i2 = d72.p1;
            int i3 = d72.Z;
            View view = null;
            Handler handler = d72.Y;
            if (i2 >= i3) {
                dl.g.b(androidx.lifecycle.J.a(d72), (CoroutineContext) null, (dl.J) null, new a(d72, null), 3);
                handler.removeCallbacks(this);
                return;
            }
            C3053c2 c3053c2 = (C3053c2) d72.y;
            if (c3053c2 != null && (relativeLayout3 = c3053c2.a) != null) {
                int i4 = Coin.a;
                FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
                layoutParams.gravity = 17;
                Intrinsics.checkNotNullParameter(relativeLayout3, "frameLayout");
                Intrinsics.checkNotNullParameter(layoutParams, "layoutParams");
                Context context = relativeLayout3.getContext();
                Intrinsics.checkNotNullExpressionValue(context, "getContext(...)");
                view = new Coin(context);
                view.setLayoutParams(layoutParams);
                relativeLayout3.addView(view);
            }
            int[] iArr = new int[2];
            C3053c2 c3053c22 = (C3053c2) d72.y;
            if (c3053c22 != null && (materialCardView = c3053c22.f) != null) {
                materialCardView.getLocationOnScreen(iArr);
            }
            C3053c2 c3053c23 = (C3053c2) d72.y;
            int width = (c3053c23 == null || (relativeLayout2 = c3053c23.a) == null) ? 0 : relativeLayout2.getWidth() / 2;
            C3053c2 c3053c24 = (C3053c2) d72.y;
            Number valueOf = (c3053c24 == null || (relativeLayout = c3053c24.a) == null) ? 0 : Double.valueOf(relativeLayout.getHeight() / 1.5d);
            if (view != null) {
                float f = iArr[0];
                float floatValue = valueOf.floatValue();
                float f2 = iArr[1];
                B7.l lVar = new B7.l(d72, i);
                Long l = 800L;
                Long l2 = 1200L;
                Pair pair = new Pair(l, l2);
                Long l3 = 200L;
                Long l4 = 500L;
                Pair pair2 = new Pair(l3, l4);
                Intrinsics.checkNotNullParameter(view, "<this>");
                Intrinsics.checkNotNullParameter(pair, "translateDurationRange");
                Intrinsics.checkNotNullParameter(pair2, "rotationDurationRange");
                Intrinsics.checkNotNullParameter(lVar, "onAnimationEnd");
                c.a aVar = Xk.c.a;
                long longValue = l.longValue();
                long longValue2 = l2.longValue();
                aVar.getClass();
                Xk.a aVar2 = Xk.c.b;
                long f3 = aVar2.f(longValue, longValue2);
                AnimatorSet animatorSet2 = new AnimatorSet();
                ObjectAnimator ofFloat = ObjectAnimator.ofFloat(view, "rotation", 0.0f, 360.0f);
                d7 = d72;
                ofFloat.setDuration(aVar2.f(l3.longValue(), l4.longValue()));
                ofFloat.setRepeatMode(1);
                ofFloat.setInterpolator(new LinearInterpolator());
                Unit unit = Unit.a;
                ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(view, "translationX", width, f);
                ofFloat2.setDuration(f3);
                aVar2.getClass();
                if (!Double.isInfinite(1.0d) || Double.isInfinite(0.5d) || Double.isNaN(0.5d) || Double.isInfinite(1.5d) || Double.isNaN(1.5d)) {
                    animatorSet = animatorSet2;
                    objectAnimator = ofFloat;
                    nextDouble = 0.5d + (aVar2.g().nextDouble() * 1.0d);
                } else {
                    animatorSet = animatorSet2;
                    objectAnimator = ofFloat;
                    double d = 2;
                    double nextDouble2 = ((1.5d / d) - (0.5d / d)) * aVar2.g().nextDouble();
                    nextDouble = 0.5d + nextDouble2 + nextDouble2;
                }
                if (nextDouble >= 1.5d) {
                    nextDouble = Math.nextAfter(1.5d, Double.NEGATIVE_INFINITY);
                }
                ofFloat2.setInterpolator(new AccelerateInterpolator((float) nextDouble));
                ObjectAnimator ofFloat3 = ObjectAnimator.ofFloat(view, "translationY", floatValue, f2);
                ofFloat3.setDuration(f3);
                ofFloat3.setInterpolator(new LinearInterpolator());
                animatorSet.playTogether(objectAnimator, ofFloat2, ofFloat3);
                animatorSet.addListener(new Pb.k(lVar, view));
                animatorSet.start();
            } else {
                d7 = d72;
            }
            handler.postDelayed(this, 0L);
            d7.p1++;
        }
    }

    public static final class l0 extends Lambda implements Function0<Fragment> {
        public final Fragment a;

        public l0(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$getData$3", f = "TrendingHomeFullScreenExpFragment.kt", l = {7999}, m = "invokeSuspend")
    public static final class C1620m extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public C1620m(Kk.c<? super C1620m> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new C1620m(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(3000L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            final D7 d7 = D7.this;
            d7.x0(new Function0() {
                public final Object invoke() {
                    D7 d72 = D7.this;
                    User E = d72.e2().E();
                    if (E != null && !E.isUserPremium()) {
                        d72.x0(new Eb.c0(d72, new H8(), 2, new Ma.d(1)));
                        d72.x0(new C0924t5(d72, 1));
                    }
                    return Unit.a;
                }
            });
            return Unit.a;
        }
    }

    public static final class m0 extends Lambda implements Function0<v0.b> {
        public final Fragment a;
        public final Hk.k b;

        public m0(Fragment fragment, Hk.k kVar) {
            super(0);
            this.a = fragment;
            this.b = kVar;
        }

        public final Object invoke() {
            v0.b defaultViewModelProviderFactory;
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.b);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return (uVar2 == null || (defaultViewModelProviderFactory = uVar2.getDefaultViewModelProviderFactory()) == null) ? this.a.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$getTopLayoutBitmapForVideo$1$5$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {15085}, m = "invokeSuspend")
    public static final class C1621n extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;
        public final RecyclerView.D b;

        public C1621n(RecyclerView.D d, Kk.c<? super C1621n> cVar) {
            super(2, cVar);
            this.b = d;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return new C1621n(this.b, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            MaterialButton addNameBtn;
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(200L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            QuoteView quoteView = ((J8.J1) this.b).f;
            if (quoteView != null && (addNameBtn = quoteView.getAddNameBtn()) != null) {
                Eb.X0.V(addNameBtn);
            }
            return Unit.a;
        }
    }

    public static final class n0 extends Lambda implements Function0<Fragment> {
        public final Fragment a;

        public n0(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$getTopLayoutBitmapForVideo$1$6$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {15101}, m = "invokeSuspend")
    public static final class C1622o extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;
        public final RecyclerView.D b;

        public C1622o(RecyclerView.D d, Kk.c<? super C1622o> cVar) {
            super(2, cVar);
            this.b = d;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return new C1622o(this.b, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            MaterialButton addNameBtn;
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(100L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            QuoteView quoteView = ((J8.J1) this.b).f;
            if (quoteView != null && (addNameBtn = quoteView.getAddNameBtn()) != null) {
                Eb.X0.V(addNameBtn);
            }
            return Unit.a;
        }
    }

    public static final class o0 extends Lambda implements Function0<androidx.lifecycle.y0> {
        public final Function0 a;

        public o0(n0 n0Var) {
            super(0);
            this.a = n0Var;
        }

        public final Object invoke() {
            return (androidx.lifecycle.y0) this.a.invoke();
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$hideProgress$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class C1623p extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public C1623p(Kk.c<? super C1623p> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new C1623p(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            D7 d7 = D7.this;
            d7.x0(new C0304g6(d7, 3));
            return Unit.a;
        }
    }

    public static final class p0 extends Lambda implements Function0<androidx.lifecycle.x0> {
        public final Hk.k a;

        public p0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            return FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a).getViewModelStore();
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$initScreenshotListenerParent$1$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {796}, m = "invokeSuspend")
    public static final class C1624q extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public C1624q() {
            throw null;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return new C1624q(2, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(3500L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            boolean z = D7.Q4;
            D7.Q4 = true;
            return Unit.a;
        }
    }

    public static final class q0 extends Lambda implements Function0<y2.a> {
        public final Hk.k a;

        public q0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return uVar2 != null ? uVar2.getDefaultViewModelCreationExtras() : a.a.b;
        }
    }

    public class C1625r extends MutablePropertyReference0Impl {
        public final Object get() {
            return ((D7) ((CallableReference) this).receiver).m3;
        }

        public final void set(Object obj) {
            ((D7) ((CallableReference) this).receiver).m3 = (E7.G) obj;
        }
    }

    public static final class r0 extends Lambda implements Function0<v0.b> {
        public final Fragment a;
        public final Hk.k b;

        public r0(Fragment fragment, Hk.k kVar) {
            super(0);
            this.a = fragment;
            this.b = kVar;
        }

        public final Object invoke() {
            v0.b defaultViewModelProviderFactory;
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.b);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return (uVar2 == null || (defaultViewModelProviderFactory = uVar2.getDefaultViewModelProviderFactory()) == null) ? this.a.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
        }
    }

    public class C1626s extends MutablePropertyReference0Impl {
        public final Object get() {
            return ((D7) ((CallableReference) this).receiver).m3;
        }

        public final void set(Object obj) {
            ((D7) ((CallableReference) this).receiver).m3 = (E7.G) obj;
        }
    }

    public static final class s0 extends Lambda implements Function0<androidx.lifecycle.y0> {
        public final Function0 a;

        public s0(l0 l0Var) {
            super(0);
            this.a = l0Var;
        }

        public final Object invoke() {
            return (androidx.lifecycle.y0) this.a.invoke();
        }
    }

    public class C1627t extends MutablePropertyReference0Impl {
        public final Object get() {
            return ((D7) ((CallableReference) this).receiver).m3;
        }

        public final void set(Object obj) {
            ((D7) ((CallableReference) this).receiver).m3 = (E7.G) obj;
        }
    }

    public static final class t0 extends Lambda implements Function0<androidx.lifecycle.x0> {
        public final Hk.k a;

        public t0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            return FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a).getViewModelStore();
        }
    }

    public class C1628u extends MutablePropertyReference0Impl {
        public final Object get() {
            return ((D7) ((CallableReference) this).receiver).m3;
        }

        public final void set(Object obj) {
            ((D7) ((CallableReference) this).receiver).m3 = (E7.G) obj;
        }
    }

    public static final class u0 extends Lambda implements Function0<y2.a> {
        public final Hk.k a;

        public u0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return uVar2 != null ? uVar2.getDefaultViewModelCreationExtras() : a.a.b;
        }
    }

    public static final class C1629v implements a.InterfaceC0051a {
    }

    public static final class v0 extends Lambda implements Function0<v0.b> {
        public final Fragment a;
        public final Hk.k b;

        public v0(Fragment fragment, Hk.k kVar) {
            super(0);
            this.a = fragment;
            this.b = kVar;
        }

        public final Object invoke() {
            v0.b defaultViewModelProviderFactory;
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.b);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return (uVar2 == null || (defaultViewModelProviderFactory = uVar2.getDefaultViewModelProviderFactory()) == null) ? this.a.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$initializeObservers$8$1$1$1$5", f = "TrendingHomeFullScreenExpFragment.kt", l = {5141}, m = "invokeSuspend")
    public static final class C1630w extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public C1630w(Kk.c<? super C1630w> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new C1630w(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(1000L, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            D7 d7 = D7.this;
            d7.x0(new E7.p(d7, 2));
            return Unit.a;
        }
    }

    public static final class w0 extends Lambda implements Function0<Fragment> {
        public final Fragment a;

        public w0(Fragment fragment) {
            super(0);
            this.a = fragment;
        }

        public final Object invoke() {
            return this.a;
        }
    }

    public static final class C1631x implements a.InterfaceC0051a {
    }

    public static final class x0 extends Lambda implements Function0<androidx.lifecycle.y0> {
        public final Function0 a;

        public x0(w0 w0Var) {
            super(0);
            this.a = w0Var;
        }

        public final Object invoke() {
            return (androidx.lifecycle.y0) this.a.invoke();
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$initializeObservers$8$1$1$5$6", f = "TrendingHomeFullScreenExpFragment.kt", l = {5309}, m = "invokeSuspend")
    public static final class C1632y extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public int a;

        public C1632y(Kk.c<? super C1632y> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new C1632y(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i = this.a;
            if (i == 0) {
                Hk.q.b(obj);
                this.a = 1;
                if (dl.T.b(Constants.PN_LARGE_ICON_DOWNLOAD_TIMEOUT_IN_MILLIS, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Hk.q.b(obj);
            }
            D7 d7 = D7.this;
            d7.x0(new C1716g9(d7, 0));
            return Unit.a;
        }
    }

    public static final class y0 extends Lambda implements Function0<androidx.lifecycle.x0> {
        public final Hk.k a;

        public y0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            return FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a).getViewModelStore();
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$initializeViews$14$1", f = "TrendingHomeFullScreenExpFragment.kt", l = {}, m = "invokeSuspend")
    public static final class C1633z extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public C1633z(Kk.c<? super C1633z> cVar) {
            super(2, cVar);
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new C1633z(cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            Hk.q.b(obj);
            boolean z = D7.Q4;
            D7 d7 = D7.this;
            d7.r2().getClass();
            boolean z2 = C1808p1.i3 != null;
            do.a.a.c(Ng.Z.c("politicsViewModel_refreshPoliticalFeed ", z2), new Object[0]);
            if (z2) {
                if (!d7.r2().n) {
                    C1808p1.i3 = null;
                }
                D7.a2(d7, null, true, 1);
            } else {
                d7.M2();
            }
            return Unit.a;
        }
    }

    public static final class z0 extends Lambda implements Function0<y2.a> {
        public final Hk.k a;

        public z0(Hk.k kVar) {
            super(0);
            this.a = kVar;
        }

        public final Object invoke() {
            androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a);
            androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
            return uVar2 != null ? uVar2.getDefaultViewModelCreationExtras() : a.a.b;
        }
    }

    public D7() {
        Hk.l.b(new C1770l7());
        Intrinsics.checkNotNullExpressionValue(registerForActivityResult(new j.f(), new O2.K0()), "registerForActivityResult(...)");
        this.O3 = new ArrayList<>();
        this.P3 = new SharedPreferences.OnSharedPreferenceChangeListener() {
            @Override
            public final void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String str) {
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                d7.x0(new C0420w5(str, d7, sharedPreferences, 1));
            }
        };
        this.Q3 = Hk.l.b(new J9.V1(this, 1));
        this.T3 = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(C1808p1.class), new V(this), new W(this), new X(this));
        this.U3 = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(O8.a1.class), new Y(this), new Z(this), new a0(this));
        l0 l0Var = new l0(this);
        Hk.m mVar = Hk.m.NONE;
        Hk.k a = Hk.l.a(mVar, new s0(l0Var));
        this.V3 = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(z8.u.class), new t0(a), new u0(a), new v0(this, a));
        Hk.k a2 = Hk.l.a(mVar, new x0(new w0(this)));
        this.W3 = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(c9.d.class), new y0(a2), new z0(a2), new b0(this, a2));
        Hk.k a3 = Hk.l.a(mVar, new d0(new c0(this)));
        this.X3 = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(C3624b.class), new e0(a3), new f0(a3), new g0(this, a3));
        Hk.k a4 = Hk.l.a(mVar, new i0(new h0(this)));
        this.Y3 = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(T7.P.class), new j0(a4), new k0(a4), new m0(this, a4));
        Hk.k a5 = Hk.l.a(mVar, new o0(new n0(this)));
        FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(C2769b.class), new p0(a5), new q0(a5), new r0(this, a5));
        this.a4 = "";
        this.b4 = 2;
        this.c4 = new ArrayList<>();
        this.d4 = Hk.l.b(new U4.k(this, 1));
        i.c<Intent> registerForActivityResult = registerForActivityResult(new j.g(), new C1792n7(this, 0));
        Intrinsics.checkNotNullExpressionValue(registerForActivityResult, "registerForActivityResult(...)");
        this.j4 = registerForActivityResult;
        i.c<i.j> registerForActivityResult2 = registerForActivityResult(new j.d(), new C1803o7(this));
        Intrinsics.checkNotNullExpressionValue(registerForActivityResult2, "registerForActivityResult(...)");
        this.k4 = registerForActivityResult2;
        this.m4 = a.e.i;
        this.o4 = new RunnableC1619l();
        this.q4 = Hk.l.b(new C0195e0(this, 1));
        this.v4 = new ArrayList();
        this.D4 = 0;
        i.c<Intent> registerForActivityResult3 = registerForActivityResult(new j.g(), new i.a() {
            public final void onActivityResult(Object obj) {
                ActivityResult activityResult = (ActivityResult) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter(activityResult, "result");
                if (activityResult.a == -1) {
                    Intent intent = activityResult.b;
                    Uri data = intent != null ? intent.getData() : null;
                    String str = d7.i4;
                    if (Intrinsics.areEqual(str, "System Gallery")) {
                        if (data != null) {
                            d7.o4(data);
                        }
                    } else {
                        if (Intrinsics.areEqual(str, "Invoke")) {
                            d7.s4(data);
                            return;
                        }
                        QuoteData quoteData = d7.V2;
                        Integer cropWidth = quoteData != null ? quoteData.getCropWidth() : null;
                        QuoteData quoteData2 = d7.V2;
                        d7.q3(data, cropWidth, quoteData2 != null ? quoteData2.getCropHeight() : null);
                    }
                }
            }
        });
        Intrinsics.checkNotNullExpressionValue(registerForActivityResult3, "registerForActivityResult(...)");
        this.K4 = registerForActivityResult3;
        this.O4 = Hk.l.b(new C1829q7());
    }

    @NotNull
    public static Bitmap A1() {
        Bitmap createBitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
        Intrinsics.checkNotNullExpressionValue(createBitmap, "createBitmap(...)");
        new Canvas(createBitmap).drawColor(0);
        return createBitmap;
    }

    public static void D1(D7 d7, int i, QuoteData quoteData, AppEnums.f fVar, QuoteView quoteView, Function1 function1, int i2) {
        d7.C1(i, quoteData, fVar, (i2 & 8) != 0 ? null : quoteView, (i2 & 16) != 0 ? null : function1);
    }

    public static void F2(final com.crafto.android.ui.home.D7 r274, final boolean r275, java.lang.Integer r276, com.crafto.android.data.model.QuoteData r277, android.view.View r278, java.lang.Boolean r279, java.lang.String r280, com.crafto.android.data.model.User r281, boolean r282, java.lang.Boolean r283, com.crafto.android.data.model.InitData r284, boolean r285, boolean r286, kotlin.jvm.functions.Function0 r287, int r288) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.F2(com.crafto.android.ui.home.D7, boolean, java.lang.Integer, com.crafto.android.data.model.QuoteData, android.view.View, java.lang.Boolean, java.lang.String, com.crafto.android.data.model.User, boolean, java.lang.Boolean, com.crafto.android.data.model.InitData, boolean, boolean, kotlin.jvm.functions.Function0, int):void");
    }

    @NotNull
    public static Jj.f G1(@NotNull String str, @NotNull final File file, @NotNull final Function1 function1) {
        Intrinsics.checkNotNullParameter(str, Constants.KEY_URL);
        Intrinsics.checkNotNullParameter(file, CTVariableUtils.FILE);
        Intrinsics.checkNotNullParameter(function1, "completed");
        do.a.a.c("downloadFile " + str + " , " + file, new Object[0]);
        final Request build = new Request.Builder().url(str).build();
        Jj.f fVar = new Jj.f((D6) new Rn.a() {
            public final void a(Rn.b bVar) {
                boolean z = D7.Q4;
                Request request = build;
                Intrinsics.checkNotNullParameter(request, "$request");
                Function1 function12 = function1;
                Intrinsics.checkNotNullParameter(function12, "$completed");
                File file2 = file;
                Intrinsics.checkNotNullParameter(file2, "$file");
                FirebasePerfOkHttpClient.enqueue(new OkHttpClient.Builder().build().newCall(request), new C1873u8(function12, file2));
            }
        });
        Intrinsics.checkNotNullExpressionValue(fVar, "fromPublisher(...)");
        return fVar;
    }

    public static void H2(final D7 d7, final I7.a aVar, final int i, final AppEnums.f fVar, Throwable th, Exception exc, final Long l, int i2) {
        Throwable th2 = (i2 & 8) != 0 ? null : th;
        final Exception exc2 = (i2 & 16) != 0 ? null : exc;
        d7.getClass();
        a.a aVar2 = do.a.a;
        aVar2.c("logExceptionEvent clickType " + fVar + " canLogImageLoadExceptionEvent " + d7.r4, new Object[0]);
        if (d7.r4) {
            aVar2.c("logExceptionEvent clickType 1 " + fVar, new Object[0]);
            final Throwable th3 = th2;
            d7.x0(new Function0() {
                public final java.lang.Object invoke() {
                    throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.C1880v4.invoke():java.lang.Object");
                }
            });
            aVar2.c("logging exception event start #2", new Object[0]);
        }
    }

    public static void O2(int r10, android.view.View r11, com.crafto.android.data.model.QuoteData r12, com.crafto.android.ui.home.D7 r13, kotlin.jvm.functions.Function0 r14) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.O2(int, android.view.View, com.crafto.android.data.model.QuoteData, com.crafto.android.ui.home.D7, kotlin.jvm.functions.Function0):void");
    }

    public static final void Q0(D7 d7) {
        d7.c4.clear();
        d7.x3(d7.c4);
        ((E7.F) d7.d4.getValue()).i(d7.c4);
    }

    public static final void R0(D7 d7, String str, Function1 function1) {
        int i;
        d7.getClass();
        if (str != null) {
            try {
                Mb.d dVar = W7.v0.a;
                Boolean b = W7.v0.b(str);
                a.a aVar = do.a.a;
                aVar.c("isCached " + b + " videoUrl " + str, new Object[0]);
                if (!Intrinsics.areEqual(b, Boolean.TRUE)) {
                    String str2 = "VID-" + (System.currentTimeMillis() / 1000) + ".mp4";
                    Context context = d7.getContext();
                    File file = new File(context != null ? context.getCacheDir() : null, "videos");
                    File file2 = new File(file, str2);
                    file.mkdirs();
                    try {
                        Jj.f G1 = G1(str, file2, function1);
                        zj.q qVar = rk.a.b;
                        Gj.b.a(qVar, "scheduler is null");
                        new Jj.i(new Jj.g(new Jj.k(G1, qVar), Aj.a.a()), new C1802o6(new C0131h(d7, 3)), Gj.a.c).a(new Ij.d(new P2.n(d7)));
                        return;
                    } catch (Exception e) {
                        do.a.a.e(e);
                        function1.invoke((Object) null);
                        Unit unit = Unit.a;
                        return;
                    }
                }
                a.a aVar2 = W7.v0.e;
                if (aVar2 != null) {
                    L2.f fVar = new L2.f(Uri.parse(str));
                    androidx.media3.datasource.cache.a a = aVar2.a();
                    Intrinsics.checkNotNullExpressionValue(a, "createDataSource(...)");
                    String str3 = "VID-" + (System.currentTimeMillis() / 1000) + ".mp4";
                    Context context2 = d7.getContext();
                    File file3 = new File(context2 != null ? context2.getCacheDir() : null, "videos");
                    File file4 = new File(file3, str3);
                    file3.mkdirs();
                    FileOutputStream fileOutputStream = new FileOutputStream(file4);
                    try {
                        try {
                            try {
                                androidx.media3.datasource.cache.a aVar3 = a;
                                byte[] bArr = new byte[1024];
                                aVar.c("getCachedData <<<<Starting fetch...mTotalBytesToRead " + aVar3.a(fVar), new Object[0]);
                                i = 0;
                                while (i != -1) {
                                    try {
                                        i = aVar3.read(bArr, 0, 1024);
                                        if (i != -1) {
                                            fileOutputStream.write(bArr, 0, i);
                                        }
                                    } catch (IOException unused) {
                                        a.close();
                                        fileOutputStream.flush();
                                        fileOutputStream.close();
                                        do.a.a.c("bytesRead " + i, new Object[0]);
                                        function1.invoke(file4.getAbsolutePath());
                                        a.close();
                                        fileOutputStream.flush();
                                        fileOutputStream.close();
                                        return;
                                    }
                                }
                                aVar3.close();
                                fileOutputStream.flush();
                            } catch (IOException unused2) {
                                i = 0;
                            }
                            fileOutputStream.close();
                            do.a.a.c("bytesRead " + i, new Object[0]);
                            function1.invoke(file4.getAbsolutePath());
                            a.close();
                            fileOutputStream.flush();
                        } finally {
                            a.close();
                            fileOutputStream.flush();
                            fileOutputStream.close();
                        }
                    } catch (IOException unused3) {
                        a.close();
                        fileOutputStream.flush();
                    } catch (Throwable th) {
                        throw th;
                    }
                    fileOutputStream.close();
                    return;
                }
                return;
            } catch (Exception e2) {
                do.a.a.e(e2);
                function1.invoke(str);
            }
            do.a.a.e(e2);
            function1.invoke(str);
        }
    }

    public static final java.io.Serializable S0(com.crafto.android.ui.home.D7 r12, java.io.File[] r13, int r14, Kk.c r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.S0(com.crafto.android.ui.home.D7, java.io.File[], int, Kk.c):java.io.Serializable");
    }

    public static final void T0(D7 d7, Function1 function1) {
        d7.getClass();
        do.a.a.c("getMediaV2", new Object[0]);
        AppCompatActivity a = Eb.E.a(d7);
        MediaType mediaType = MediaType.IMAGE;
        Intrinsics.checkNotNullParameter(a, "context");
        Intrinsics.checkNotNullParameter(mediaType, "mediaType");
        Intrinsics.checkNotNullParameter("", "dirType");
        Nj.a aVar = new Nj.a(new Pb.g(mediaType, "", a));
        Intrinsics.checkNotNullExpressionValue(aVar, "create(...)");
        zj.q qVar = rk.a.b;
        Gj.b.a(qVar, "scheduler is null");
        Nj.b bVar = new Nj.b(new Nj.e(new Nj.g(aVar, qVar), Aj.a.a()), new O2.L(new S6()));
        final T6 t6 = new T6(0, d7, function1);
        Ij.e eVar = new Ij.e(new Ej.b() {
            public final void accept(Object obj) {
                boolean z = D7.Q4;
                Function1 function12 = t6;
                Intrinsics.checkNotNullParameter(function12, "$tmp0");
                function12.invoke(obj);
            }
        }, Gj.a.e);
        bVar.c(eVar);
        d7.f3 = eVar;
    }

    public static void T2(D7 d7, int i, boolean z, QuoteData quoteData, boolean z2, int i2) {
        if ((i2 & 4) != 0) {
            quoteData = null;
        }
        if ((i2 & 8) != 0) {
            z2 = false;
        }
        d7.getClass();
        C1140i c1140i = new C1140i();
        Bundle bundle = new Bundle();
        bundle.putInt("extra_page_data", i);
        bundle.putBoolean("extra_flag", false);
        bundle.putBoolean("extra_type", z);
        bundle.putSerializable("extra_quotesdata", quoteData);
        bundle.putBoolean("extra_experiment_flag", z2);
        c1140i.setArguments(bundle);
        FragmentActivity activity = d7.getActivity();
        BaseActivity baseActivity = activity instanceof BaseActivity ? (BaseActivity) activity : null;
        if (baseActivity != null) {
            BaseActivity.G(baseActivity, c1140i, false, "EditPartyFragment");
        }
    }

    public static final Uri U0(Bitmap bitmap, D7 d7) {
        d7.getClass();
        if (bitmap != null) {
            a.a aVar = do.a.a;
            StringBuilder a = defpackage.m.a(aVar, C7.a(bitmap, new StringBuilder("bitmap.width ")), new Object[0], "bitmap.height ");
            a.append(bitmap.getHeight());
            String a2 = z5.g.a(defpackage.m.a(aVar, a.toString(), new Object[0], "crafto_"));
            try {
                File file = new File(Eb.E.a(d7).getCacheDir(), "images");
                file.mkdirs();
                FileOutputStream fileOutputStream = new FileOutputStream(file + '/' + a2 + ".png");
                bitmap.compress(Bitmap.CompressFormat.PNG, 90, fileOutputStream);
                fileOutputStream.close();
                return FileProvider.d(Eb.E.a(d7), "com.crafto.android.fileprovider", new File(new File(Eb.E.a(d7).getCacheDir(), "images"), a2 + ".png"));
            } catch (IOException e) {
                do.a.a.e(e);
            }
        }
        return null;
    }

    public static QuotesCategory U1(String str, List list) {
        if (list == null) {
            return null;
        }
        Iterator it = list.iterator();
        while (it.hasNext()) {
            QuotesCategory quotesCategory = (QuotesCategory) it.next();
            if (Intrinsics.areEqual(quotesCategory.getName(), str)) {
                return quotesCategory;
            }
        }
        return null;
    }

    public static void U2(D7 d7, boolean z, QuoteData quoteData, boolean z2, int i) {
        if ((i & 2) != 0) {
            quoteData = null;
        }
        if ((i & 4) != 0) {
            z2 = false;
        }
        d7.getClass();
        O8.J0 j02 = new O8.J0();
        Bundle bundle = new Bundle();
        bundle.putBoolean("extra_flag", z);
        bundle.putSerializable("extra_quotesdata", quoteData);
        bundle.putBoolean("extra_experiment_flag", z2);
        j02.setArguments(bundle);
        FragmentActivity activity = d7.getActivity();
        BaseActivity baseActivity = activity instanceof BaseActivity ? (BaseActivity) activity : null;
        if (baseActivity != null) {
            BaseActivity.G(baseActivity, j02, false, "PartySelectionFragment");
        }
    }

    public static final void V0(Hb.c.b r8, android.view.View r9, com.crafto.android.ui.home.D7 r10, com.crafto.android.data.model.QuoteData r11, kotlin.jvm.functions.Function0 r12, java.lang.String r13, android.net.Uri r14) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.V0(Hb.c$b, android.view.View, com.crafto.android.ui.home.D7, com.crafto.android.data.model.QuoteData, kotlin.jvm.functions.Function0, java.lang.String, android.net.Uri):void");
    }

    public static int V1(String str, List list) {
        if (list == null) {
            return a.e.P0;
        }
        int i = 0;
        for (Object obj : list) {
            int i2 = i + 1;
            if (i < 0) {
                kotlin.collections.t.m();
                throw null;
            }
            if (Intrinsics.areEqual(((QuotesCategory) obj).getValue(), str)) {
                return i;
            }
            i = i2;
        }
        return a.e.P0;
    }

    public static final void W0(final int i, Context context, Bitmap bitmap, Bitmap bitmap2, final QuoteData quoteData, final D7 d7, final AppEnums.f fVar, Ref.ObjectRef objectRef, Ref.ObjectRef objectRef2, final boolean z) {
        File file;
        String ffmpegCommand;
        String str;
        if (bitmap != null) {
            a.a aVar = do.a.a;
            StringBuilder a = defpackage.m.a(aVar, C7.a(bitmap, new StringBuilder("bitmap.width ")), new Object[0], "bitmap.height ");
            a.append(bitmap.getHeight());
            String a2 = z5.g.a(defpackage.m.a(aVar, a.toString(), new Object[0], "crafto_"));
            String b = c0.c.b(new StringBuilder("crafto_"), "-_bottom");
            try {
                File file2 = new File(context.getCacheDir(), "images");
                file2.mkdirs();
                FileOutputStream fileOutputStream = new FileOutputStream(file2 + '/' + a2 + ".png");
                FileOutputStream fileOutputStream2 = new FileOutputStream(file2 + '/' + b + ".png");
                Bitmap.CompressFormat compressFormat = Bitmap.CompressFormat.PNG;
                bitmap.compress(compressFormat, 90, fileOutputStream);
                if (bitmap2 != null) {
                    bitmap2.compress(compressFormat, 100, fileOutputStream2);
                }
                fileOutputStream.close();
                fileOutputStream2.close();
                File file3 = new File(context.getCacheDir(), "images");
                File file4 = new File(file3, a2 + ".png");
                File file5 = new File(file3, b + ".png");
                objectRef.element = FileProvider.d(context, "com.crafto.android.fileprovider", file4);
                objectRef2.element = FileProvider.d(context, "com.crafto.android.fileprovider", file5);
            } catch (IOException e) {
                do.a.a.e(e);
            }
        }
        a.a aVar2 = do.a.a;
        aVar2.c("imageUri " + objectRef.element, new Object[0]);
        String c = FFmpegKitConfig.c(context, (Uri) objectRef.element);
        String c2 = FFmpegKitConfig.c(context, (Uri) objectRef2.element);
        aVar2.c(C1.e.a("bitmap fileName ", c), new Object[0]);
        if (c != null) {
            File cacheDir = context.getCacheDir();
            Intrinsics.checkNotNullExpressionValue(cacheDir, "getCacheDir(...)");
            if (Intrinsics.areEqual(quoteData != null ? quoteData.getContentType() : null, "GIF")) {
                file = new File(cacheDir, c0.c.b(new StringBuilder(), ".gif"));
            } else {
                file = (Intrinsics.areEqual(quoteData != null ? quoteData.getContentType() : null, "ANNIVERSARY") && quoteData.getVideoUrl() == null) ? new File(cacheDir, c0.c.b(new StringBuilder(), ".jpeg")) : new File(cacheDir, c0.c.b(new StringBuilder(), ".mp4"));
            }
            final File file6 = file;
            if (quoteData == null || (ffmpegCommand = quoteData.getFfmpegCommand()) == null) {
                return;
            }
            String str2 = kotlin.text.p.l(ffmpegCommand, "profileImage", c) + ' ' + file6.getAbsolutePath();
            User user = d7.W2;
            if (user == null || (str = user.getDisplayNameFromNames()) == null) {
                str = "";
            }
            String l = kotlin.text.p.l(str2, "userName", str);
            Intrinsics.checkNotNull(c2);
            final String l2 = kotlin.text.p.l(l, "bottomOverlayImage", c2);
            if (quoteData.getVideoUri() == null) {
                d7.x0(new Function0() {
                    public final Object invoke() {
                        boolean z2 = D7.Q4;
                        final D7 d72 = D7.this;
                        Intrinsics.checkNotNullParameter(d72, "$this_run");
                        String str3 = l2;
                        Intrinsics.checkNotNullParameter(str3, "$exe");
                        File file7 = file6;
                        Intrinsics.checkNotNullParameter(file7, "$file");
                        final AppEnums.f fVar2 = fVar;
                        Intrinsics.checkNotNullParameter(fVar2, "$clickType");
                        final String absolutePath = file7.getAbsolutePath();
                        Intrinsics.checkNotNullExpressionValue(absolutePath, "getAbsolutePath(...)");
                        d72.getClass();
                        a.a aVar3 = do.a.a;
                        StringBuilder a3 = defpackage.m.a(aVar3, C1.e.a("executeFfmpegCommand ", str3), new Object[0], "executeFfmpegCommand processingVideo ");
                        final QuoteData quoteData2 = quoteData;
                        a3.append(quoteData2 != null ? Boolean.valueOf(quoteData2.getProcessingVideo()) : null);
                        aVar3.c(a3.toString(), new Object[0]);
                        FFmpegKitConfig.h = new N5.p() {
                            public final void a(N5.o oVar) {
                                boolean z3 = D7.Q4;
                                D7 d73 = D7.this;
                                Intrinsics.checkNotNullParameter(d73, "this$0");
                                d73.x0(new J9.Q0(1, d73, oVar));
                            }
                        };
                        if (quoteData2 != null) {
                            quoteData2.setProcessingVideo(true);
                        }
                        final long currentTimeMillis = System.currentTimeMillis();
                        final boolean z3 = z;
                        final int i2 = i;
                        long j = N5.c.a(str3, new N5.e() {
                            public final void b(N5.d dVar) {
                                boolean z4 = D7.Q4;
                                D7 d73 = D7.this;
                                Intrinsics.checkNotNullParameter(d73, "this$0");
                                String str4 = absolutePath;
                                Intrinsics.checkNotNullParameter(str4, "$filePath");
                                AppEnums.f fVar3 = fVar2;
                                Intrinsics.checkNotNullParameter(fVar3, "$clickType");
                                androidx.lifecycle.E a4 = androidx.lifecycle.J.a(d73);
                                kl.c cVar = dl.Z.a;
                                dl.g.b(a4, il.p.a, (dl.J) null, new C1928z8(d73, dVar, str4, quoteData2, currentTimeMillis, z3, fVar3, i2, null), 2);
                            }
                        }).a;
                        if (quoteData2 != null) {
                            quoteData2.setSessionId(Long.valueOf(j));
                        }
                        aVar3.c(J1.c.c(j, "session.sessionId "), new Object[0]);
                        return Unit.a;
                    }
                });
                return;
            }
            if (Build.VERSION.SDK_INT >= 29) {
                d7.L3(quoteData, fVar);
                return;
            }
            FragmentActivity activity = d7.getActivity();
            if (activity != null) {
                String[] strArr = Hb.I.a;
                if (Hb.I.e(activity, d7.f)) {
                    return;
                }
                d7.L3(quoteData, fVar);
            }
        }
    }

    public static Integer W1(PurchasePremiumData purchasePremiumData) {
        do.a.a.c("getChipTagByType " + purchasePremiumData, new Object[0]);
        ProfileImageData previewImage = purchasePremiumData.getPreviewImage();
        String type = previewImage != null ? previewImage.getType() : null;
        InitDataDeserializer.Companion companion = InitDataDeserializer.Companion;
        if (Intrinsics.areEqual(type, companion.getPurchasePremiumImageWidget())) {
            return 0;
        }
        if (Intrinsics.areEqual(type, companion.getPurchasePremiumPhoneWidget())) {
            return 1;
        }
        if (Intrinsics.areEqual(type, companion.getPurchasePremiumBusinessWidget())) {
            return 2;
        }
        return Intrinsics.areEqual(type, companion.getPurchasePremiumAddPhotoNoPhoneWidget()) ? 3 : null;
    }

    public static final Uri X0(D7 d7, String str, String str2, String str3) {
        Uri insert;
        ContentResolver contentResolver;
        ContentResolver contentResolver2;
        ContentResolver contentResolver3;
        Context context = d7.getContext();
        Context applicationContext = context != null ? context.getApplicationContext() : null;
        ContentValues contentValues = new ContentValues();
        String str4 = (Hb.J.a(str) || Intrinsics.areEqual(str, "FULLSCREEN_IMAGE_ON_VIDEO")) ? Environment.DIRECTORY_MOVIES : Environment.DIRECTORY_PICTURES;
        int i = Build.VERSION.SDK_INT;
        if (i >= 29) {
            StringBuilder a = P0.g1.a(str4, '/');
            a.append(applicationContext != null ? applicationContext.getString(2132017335) : null);
            contentValues.put("relative_path", a.toString());
            contentValues.put("date_added", Long.valueOf(System.currentTimeMillis() / 1000));
            contentValues.put("is_pending", (Integer) 1);
        } else {
            contentValues.put("date_added", Long.valueOf(System.currentTimeMillis() / 1000));
        }
        contentValues.put("_display_name", str2);
        if (Hb.J.a(str) || Intrinsics.areEqual(str, "FULLSCREEN_IMAGE_ON_VIDEO")) {
            contentValues.put("mime_type", "video/mp4");
        } else if (Intrinsics.areEqual(str, "GIF")) {
            contentValues.put("mime_type", "image/gif");
        } else if (Intrinsics.areEqual(str, "IMAGE")) {
            contentValues.put("mime_type", "image/jpeg");
        }
        if (i >= 29) {
            insert = (applicationContext == null || (contentResolver3 = applicationContext.getContentResolver()) == null) ? null : contentResolver3.insert((Hb.J.a(str) || Intrinsics.areEqual(str, "FULLSCREEN_IMAGE_ON_VIDEO")) ? MediaStore.Video.Media.getContentUri("external_primary") : MediaStore.Images.Media.getContentUri("external_primary"), contentValues);
        } else {
            insert = (Hb.J.a(str) || Intrinsics.areEqual(str, "FULLSCREEN_IMAGE_ON_VIDEO")) ? d7.requireContext().getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, contentValues) : d7.requireContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
        }
        if (insert == null) {
            return null;
        }
        if (Hb.J.a(str) || Intrinsics.areEqual(str, "IMAGE") || Intrinsics.areEqual(str, "FULLSCREEN_IMAGE_ON_VIDEO") || Intrinsics.areEqual(str, "GIF")) {
            ParcelFileDescriptor openFileDescriptor = (applicationContext == null || (contentResolver = applicationContext.getContentResolver()) == null) ? null : contentResolver.openFileDescriptor(insert, Constants.INAPP_WINDOW);
            if (openFileDescriptor != null) {
                try {
                    FileOutputStream fileOutputStream = new FileOutputStream(openFileDescriptor.getFileDescriptor());
                    try {
                        FileInputStream fileInputStream = new FileInputStream(str3);
                        try {
                            byte[] bArr = new byte[8192];
                            while (true) {
                                int read = fileInputStream.read(bArr);
                                if (read <= 0) {
                                    break;
                                }
                                fileOutputStream.write(bArr, 0, read);
                            }
                            Unit unit = Unit.a;
                            Rk.a.b(fileInputStream, (Throwable) null);
                            Rk.a.b(fileOutputStream, (Throwable) null);
                        } finally {
                        }
                    } finally {
                    }
                } catch (Throwable th) {
                    try {
                        throw th;
                    } catch (Throwable th2) {
                        Rk.a.b(openFileDescriptor, th);
                        throw th2;
                    }
                }
            }
            Rk.a.b(openFileDescriptor, (Throwable) null);
        }
        contentValues.clear();
        if (Build.VERSION.SDK_INT >= 29) {
            if (!Hb.J.a(str) && !Intrinsics.areEqual(str, "GIF")) {
                Intrinsics.areEqual(str, "FULLSCREEN_IMAGE_ON_VIDEO");
            }
            contentValues.put("is_pending", (Integer) 0);
            if (applicationContext != null && (contentResolver2 = applicationContext.getContentResolver()) != null) {
                contentResolver2.update(insert, contentValues, null, null);
            }
        }
        return insert;
    }

    public static final Uri Y0(D7 d7, String str, String str2) {
        Uri insert;
        ContentResolver contentResolver;
        ContentResolver contentResolver2;
        ContentResolver contentResolver3;
        d7.getClass();
        do.a.a.c("saveVideoFileV1_ " + str + ' ' + str2, new Object[0]);
        Context context = d7.getContext();
        Context applicationContext = context != null ? context.getApplicationContext() : null;
        ContentValues contentValues = new ContentValues();
        String str3 = Environment.DIRECTORY_MOVIES;
        int i = Build.VERSION.SDK_INT;
        if (i >= 29) {
            StringBuilder a = P0.g1.a(str3, '/');
            a.append(applicationContext != null ? applicationContext.getString(2132017335) : null);
            contentValues.put("relative_path", a.toString());
            contentValues.put("date_added", Long.valueOf(System.currentTimeMillis() / 1000));
            contentValues.put("is_pending", (Integer) 1);
        } else {
            contentValues.put("date_added", Long.valueOf(System.currentTimeMillis() / 1000));
        }
        contentValues.put("_display_name", str);
        contentValues.put("mime_type", "video/mp4");
        if (i >= 29) {
            insert = (applicationContext == null || (contentResolver3 = applicationContext.getContentResolver()) == null) ? null : contentResolver3.insert(MediaStore.Video.Media.getContentUri("external_primary"), contentValues);
        } else {
            insert = d7.requireContext().getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, contentValues);
        }
        if (insert == null) {
            return null;
        }
        ParcelFileDescriptor openFileDescriptor = (applicationContext == null || (contentResolver2 = applicationContext.getContentResolver()) == null) ? null : contentResolver2.openFileDescriptor(insert, Constants.INAPP_WINDOW);
        if (openFileDescriptor != null) {
            try {
                FileOutputStream fileOutputStream = new FileOutputStream(openFileDescriptor.getFileDescriptor());
                try {
                    FileInputStream fileInputStream = new FileInputStream(str2);
                    try {
                        byte[] bArr = new byte[8192];
                        while (true) {
                            int read = fileInputStream.read(bArr);
                            if (read <= 0) {
                                break;
                            }
                            fileOutputStream.write(bArr, 0, read);
                        }
                        Unit unit = Unit.a;
                        Rk.a.b(fileInputStream, (Throwable) null);
                        Rk.a.b(fileOutputStream, (Throwable) null);
                    } finally {
                    }
                } finally {
                }
            } catch (Throwable th) {
                try {
                    throw th;
                } catch (Throwable th2) {
                    Rk.a.b(openFileDescriptor, th);
                    throw th2;
                }
            }
        }
        Rk.a.b(openFileDescriptor, (Throwable) null);
        contentValues.clear();
        if (Build.VERSION.SDK_INT >= 29) {
            contentValues.put("is_pending", (Integer) 0);
            if (applicationContext != null && (contentResolver = applicationContext.getContentResolver()) != null) {
                contentResolver.update(insert, contentValues, null, null);
            }
        }
        return insert;
    }

    public static final void Z0(com.crafto.android.ui.home.D7 r5, com.crafto.android.data.model.QuoteData r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.Z0(com.crafto.android.ui.home.D7, com.crafto.android.data.model.QuoteData):void");
    }

    public static final void a1(D7 d7, String str) {
        d7.getClass();
        int i = 0;
        do.a.a.c(C1.e.a("updateListForGreetName ", str), new Object[0]);
        E7.G g = d7.m3;
        ArrayList<I7.m> arrayList = g != null ? g.l : null;
        if (arrayList != null) {
            for (Object obj : arrayList) {
                int i2 = i + 1;
                if (i < 0) {
                    kotlin.collections.t.m();
                    throw null;
                }
                I7.m mVar = (I7.m) obj;
                if (mVar instanceof InitData) {
                    Widget widget = ((InitData) mVar).getWidget();
                    I7.m data = widget != null ? widget.getData() : null;
                    if (data instanceof QuoteData) {
                        ((QuoteData) data).setGreetingText(str);
                    }
                }
                i = i2;
            }
        }
        E7.G g2 = d7.m3;
        if (g2 != null) {
            g2.notifyDataSetChanged();
        }
    }

    public static void a2(final D7 d7, Boolean bool, boolean z, int i) {
        Pair pair;
        MetaInit metaInit;
        String offset;
        Integer countryId;
        int i2 = 2;
        int i3 = 1;
        if ((i & 1) != 0) {
            bool = Boolean.FALSE;
        }
        if ((i & 2) != 0) {
            z = false;
        }
        d7.getClass();
        a.a aVar = do.a.a;
        aVar.c("getInitData", new Object[0]);
        d7.B4 = bool != null ? bool.booleanValue() : false;
        aVar.c("mytag redirect to quote id " + d7.u2, new Object[0]);
        d7.x0(new Function0() {
            public final Object invoke() {
                LinearLayoutCompat linearLayoutCompat;
                AppCompatTextView appCompatTextView;
                String string;
                PoliticalCategorySearchWidget politicalCategorySearchWidget;
                LinearLayoutCompat linearLayoutCompat2;
                LinearLayoutCompat linearLayoutCompat3;
                MaterialButton materialButton;
                boolean z2 = D7.Q4;
                D7 d72 = D7.this;
                Intrinsics.checkNotNullParameter(d72, "this$0");
                C3053c2 c3053c2 = (C3053c2) d72.y;
                if (c3053c2 != null && (materialButton = c3053c2.o) != null) {
                    Eb.X0.l(materialButton);
                }
                if (!d72.l4) {
                    C3053c2 c3053c22 = (C3053c2) d72.y;
                    if (c3053c22 == null || (linearLayoutCompat = c3053c22.g2) == null) {
                        return null;
                    }
                    Eb.X0.l(linearLayoutCompat);
                    return Unit.a;
                }
                QuotesCategory quotesCategory = d72.r2().m;
                if (!Intrinsics.areEqual(quotesCategory != null ? quotesCategory.getValue() : null, "Political")) {
                    QuotesCategory quotesCategory2 = d72.r2().m;
                    if (!Intrinsics.areEqual(quotesCategory2 != null ? quotesCategory2.getValue() : null, a.e.i)) {
                        C3053c2 c3053c23 = (C3053c2) d72.y;
                        if (c3053c23 == null || (linearLayoutCompat3 = c3053c23.g2) == null) {
                            return null;
                        }
                        Eb.X0.l(linearLayoutCompat3);
                        return Unit.a;
                    }
                }
                C3053c2 c3053c24 = (C3053c2) d72.y;
                if (c3053c24 != null && (linearLayoutCompat2 = c3053c24.g2) != null) {
                    Eb.X0.V(linearLayoutCompat2);
                }
                C3053c2 c3053c25 = (C3053c2) d72.y;
                if (c3053c25 == null || (appCompatTextView = c3053c25.u2) == null) {
                    return null;
                }
                UserConfigData userConfigData = (UserConfigData) d72.q4.getValue();
                if (userConfigData == null || (politicalCategorySearchWidget = userConfigData.getPoliticalCategorySearchWidget()) == null || (string = politicalCategorySearchWidget.getCreateQuoteText()) == null) {
                    string = d72.getString(2132017220);
                    Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
                }
                appCompatTextView.setText(string);
                return Unit.a;
            }
        });
        Boolean bool2 = Boolean.FALSE;
        if (Intrinsics.areEqual(bool, bool2)) {
            d7.Z3(true);
        }
        if (d7.v2) {
            C1808p1 r2 = d7.r2();
            User user = d7.W2;
            Long userId = user != null ? user.getUserId() : null;
            long j = d7.u2;
            r2.getClass();
            HashMap<String, Object> hashMap = new HashMap<>();
            Ab.H h = r2.e;
            if (userId != null) {
                hashMap.put(h.g, Long.valueOf(userId.longValue()));
            }
            User E2 = r2.c.E();
            if (E2 != null && (countryId = E2.getCountryId()) != null) {
                hashMap.put(h.S0, Integer.valueOf(countryId.intValue()));
            }
            androidx.lifecycle.S s = r2.w;
            if (s != null && (pair = (Pair) s.getValue()) != null && (metaInit = (MetaInit) pair.a) != null && (offset = metaInit.getOffset()) != null) {
                hashMap.put(h.e1, offset);
            }
            if (j > 0) {
                hashMap.put(h.p, Long.valueOf(j));
            }
            Gb.f.a(r2.a.fetchFollowingFeedData(hashMap), new C1055v0(r2, i2), new Pa.G0(r2, i3), false, 12);
            d7.u2 = 0L;
            return;
        }
        long j2 = d7.u2;
        List list = a.e.a;
        if (j2 > 0 && d7.t2) {
            d7.r2().l(d7.l2, d7.u2);
            d7.u2 = 0L;
            return;
        }
        if (d7.t2) {
            if (Intrinsics.areEqual(bool, bool2)) {
                MetaInit<InitData> metaInit2 = d7.r2().u;
                String offset2 = metaInit2 != null ? metaInit2.getOffset() : null;
                if (offset2 == null || StringsKt.J(offset2)) {
                    return;
                }
                d7.r2().l(d7.l2, 0L);
                return;
            }
            return;
        }
        PostPaymentData t = d7.e2().t();
        if (t != null && Intrinsics.areEqual(t.isPaymentDone(), Boolean.TRUE)) {
            dl.M0 m02 = d7.C4;
            if (m02 != null) {
                m02.k((CancellationException) null);
            }
            d7.C4 = dl.g.b(androidx.lifecycle.J.a(d7), (CoroutineContext) null, (dl.J) null, new R8(d7, bool, z, null), 3);
            return;
        }
        aVar.c("isSkipableFragmentVisible false", new Object[0]);
        dl.M0 m03 = d7.C4;
        if (m03 != null) {
            m03.k((CancellationException) null);
        }
        d7.C4 = dl.g.b(androidx.lifecycle.J.a(d7), (CoroutineContext) null, (dl.J) null, new S8(d7, bool, z, null), 3);
    }

    public static void g3(final com.crafto.android.ui.home.D7 r18, android.view.View r19, com.crafto.android.data.model.QuoteData r20, final boolean r21, final com.crafto.android.data.model.QuoteData r22, final int r23, final com.crafto.android.utility.functional.AppEnums.f r24) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.g3(com.crafto.android.ui.home.D7, android.view.View, com.crafto.android.data.model.QuoteData, boolean, com.crafto.android.data.model.QuoteData, int, com.crafto.android.utility.functional.AppEnums$f):void");
    }

    public static void h4(D7 d7, QuoteData quoteData) {
        BaseActivity.a aVar = d7.k2;
        if (aVar != null) {
            aVar.k(quoteData, new sa(d7, null), null, null);
        }
    }

    public static String i2(SocialMedia socialMedia, String str) {
        String shareChat;
        if (socialMedia == null || str == null || StringsKt.J(str)) {
            return "";
        }
        String lowerCase = str.toLowerCase(Locale.ROOT);
        Intrinsics.checkNotNullExpressionValue(lowerCase, "toLowerCase(...)");
        switch (lowerCase.hashCode()) {
            case -1581589577:
                if (!lowerCase.equals("sharechat") || (shareChat = socialMedia.getShareChat()) == null) {
                }
                break;
            case -916346253:
                if (!lowerCase.equals("twitter") || (shareChat = socialMedia.getTwitter()) == null) {
                }
                break;
            case 3641930:
                if (!lowerCase.equals("wapp")) {
                }
                shareChat = socialMedia.getWapp();
                if (shareChat == null) {
                }
                break;
            case 28903346:
                if (!lowerCase.equals("instagram") || (shareChat = socialMedia.getInstagram()) == null) {
                }
                break;
            case 96619420:
                if (!lowerCase.equals("email") || (shareChat = socialMedia.getEmail()) == null) {
                }
                break;
            case 106642798:
                if (!lowerCase.equals("phone") || (shareChat = socialMedia.getPhone()) == null) {
                }
                break;
            case 497130182:
                if (!lowerCase.equals("facebook") || (shareChat = socialMedia.getFacebook()) == null) {
                }
                break;
            case 1224335515:
                if (!lowerCase.equals("website") || (shareChat = socialMedia.getWebsite()) == null) {
                }
                break;
            case 1934780818:
                if (!lowerCase.equals("whatsapp")) {
                }
                shareChat = socialMedia.getWapp();
                if (shareChat == null) {
                }
                break;
        }
        return "";
    }

    public static void i4(int i, QuoteData quoteData, D7 d7) {
        d7.getClass();
        if (Intrinsics.areEqual(quoteData.getType(), "Political") && (a.e.i0.contains(Integer.valueOf(quoteData.getDesign())) || a.e.j0.contains(Integer.valueOf(quoteData.getDesign())))) {
            d7.V2(i, quoteData);
            return;
        }
        QuoteData copy$default = QuoteData.copy$default(quoteData, null, null, null, null, null, null, null, null, 0, null, null, false, null, null, null, null, false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, false, false, false, null, null, null, false, null, null, null, null, null, null, 0.0f, null, null, null, null, null, null, null, null, false, false, false, false, false, false, false, false, 0, 0, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, null, null, null, null, false, null, false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, false, false, null, null, null, null, false, false, false, false, false, false, false, null, null, null, false, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, false, null, false, null, null, null, null, null, false, false, false, false, false, null, 0, null, null, null, null, null, 0.0d, false, null, null, null, null, null, null, false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, null, null, false, false, false, false, null, null, false, null, null, null, null, null, false, null, null, false, null, null, null, null, null, false, null, null, null, null, null, null, null, null, 0.0f, null, false, null, null, null, null, false, false, 0L, null, -1, -1, -1, -1, -1, -1, -1, 65535, null);
        copy$default.setFontData(quoteData.getFontData());
        copy$default.setUser(quoteData.getUser());
        copy$default.getAddBusinessProductPhoto();
        quoteData.setEditingProfile(false);
        C1808p1 r2 = d7.r2();
        r2.getClass();
        Intrinsics.checkNotNullParameter(copy$default, "quoteData");
        r2.u2 = copy$default;
        QuotesCategory quotesCategory = d7.r2().m;
        Q7.W0 a = W0.a.a(i, quotesCategory != null ? quotesCategory.getName() : null, new ua(i, quoteData, d7), "PURPLE", false, false, true, 720);
        if (d7.getActivity() instanceof BaseActivity) {
            BaseActivity activity = d7.getActivity();
            Intrinsics.checkNotNull(activity, "null cannot be cast to non-null type com.crafto.android.ui.base.BaseActivity");
            BaseActivity.G(activity, a, true, "PremiumEditTemplateFragment");
        }
    }

    public static void l1(final com.crafto.android.ui.home.D7 r16, final int r17, java.lang.Boolean r18, final java.lang.String r19, final boolean r20, boolean r21) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.l1(com.crafto.android.ui.home.D7, int, java.lang.Boolean, java.lang.String, boolean, boolean):void");
    }

    public static String l2(StackTraceElement[] stackTraceElementArr) {
        StringBuilder sb = new StringBuilder();
        for (StackTraceElement stackTraceElement : stackTraceElementArr) {
            sb.append(stackTraceElement.toString());
        }
        String sb2 = sb.toString();
        Intrinsics.checkNotNullExpressionValue(sb2, "toString(...)");
        return sb2;
    }

    public static String m2(Throwable[] thArr) {
        StringBuilder sb = new StringBuilder();
        for (Throwable th : thArr) {
            sb.append(th.getMessage() + ' ' + th.getCause() + ' ' + th.getLocalizedMessage() + '}');
        }
        String sb2 = sb.toString();
        Intrinsics.checkNotNullExpressionValue(sb2, "toString(...)");
        return sb2;
    }

    public static void m3(int r9, android.view.View r10, com.crafto.android.data.model.QuoteData r11, com.crafto.android.ui.home.D7 r12, kotlin.jvm.functions.Function0 r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.m3(int, android.view.View, com.crafto.android.data.model.QuoteData, com.crafto.android.ui.home.D7, kotlin.jvm.functions.Function0):void");
    }

    public static void p2(final D7 d7, User user, final Boolean bool, final String str, int i) {
        final String slug;
        if ((i & 2) != 0) {
            bool = Boolean.FALSE;
        }
        if ((i & 4) != 0) {
            str = null;
        }
        d7.getClass();
        if (user == null || (slug = user.getSlug()) == null) {
            return;
        }
        Gb.f.a(d7.r2().k(slug, false), new Function1() {
            public final Object invoke(Object obj) {
                final User user2 = (User) obj;
                boolean z = D7.Q4;
                final D7 d72 = D7.this;
                Intrinsics.checkNotNullParameter(d72, "this$0");
                final String str2 = slug;
                Intrinsics.checkNotNullParameter(str2, "$it");
                Intrinsics.checkNotNullParameter(user2, Column.DATA);
                final Boolean bool2 = bool;
                final String str3 = str;
                d72.x0(new Function0() {
                    public final java.lang.Object invoke() {
                        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.C1639a4.invoke():java.lang.Object");
                    }
                });
                return Unit.a;
            }
        }, new C1641a6(0), false, 12);
    }

    public static boolean q1(InitData initData) {
        Widget widget;
        I7.m data = (initData == null || (widget = initData.getWidget()) == null) ? null : widget.getData();
        QuoteData quoteData = data instanceof QuoteData ? (QuoteData) data : null;
        return (quoteData == null || !Intrinsics.areEqual(quoteData.getContentType(), "QUOTE") || quoteData.getAudioUrl() == null) ? false : true;
    }

    public static int q2(Integer num, int i) {
        return i / ((num != null ? num.intValue() : 12) * 10);
    }

    public static void q4(QuoteData quoteData, QuoteView quoteView) {
        MaterialButton addNameBtn;
        Unit unit;
        MaterialButton addNameBtn2;
        AppCompatTextView addedNameTV;
        AppCompatTextView addedNameTVShadow;
        AppCompatTextView addedNameTV2;
        AppCompatTextView addedNameTVShadow2;
        AppCompatTextView addedNameTV3;
        AppCompatTextView addedNameTVShadow3;
        MaterialButton addNameBtn3;
        AppCompatImageView profileIcon;
        if (quoteData == null || quoteData.getDesign() != 701) {
            return;
        }
        if (quoteView != null && (profileIcon = quoteView.getProfileIcon()) != null) {
            Eb.X0.V(profileIcon);
        }
        String greetingText = quoteData.getGreetingText();
        if (greetingText != null && greetingText.length() != 0) {
            if (quoteView != null && (addNameBtn3 = quoteView.getAddNameBtn()) != null) {
                Eb.X0.l(addNameBtn3);
            }
            if (quoteView != null && (addedNameTVShadow3 = quoteView.getAddedNameTVShadow()) != null) {
                Eb.X0.V(addedNameTVShadow3);
            }
            if (quoteView != null && (addedNameTV3 = quoteView.getAddedNameTV()) != null) {
                Eb.X0.V(addedNameTV3);
            }
            if (quoteView != null && (addedNameTVShadow2 = quoteView.getAddedNameTVShadow()) != null) {
                addedNameTVShadow2.setText(quoteData.getGreetingText());
            }
            if (quoteView == null || (addedNameTV2 = quoteView.getAddedNameTV()) == null) {
                return;
            }
            addedNameTV2.setText(quoteData.getGreetingText());
            Unit unit2 = Unit.a;
            return;
        }
        if (quoteView != null && (addedNameTVShadow = quoteView.getAddedNameTVShadow()) != null) {
            Eb.X0.l(addedNameTVShadow);
        }
        if (quoteView != null && (addedNameTV = quoteView.getAddedNameTV()) != null) {
            Eb.X0.l(addedNameTV);
        }
        if (quoteData.getAddNameTitle() != null) {
            if (quoteView == null || (addNameBtn2 = quoteView.getAddNameBtn()) == null) {
                unit = null;
            } else {
                Eb.X0.V(addNameBtn2);
                unit = Unit.a;
            }
            if (unit != null) {
                return;
            }
        }
        if (quoteView == null || (addNameBtn = quoteView.getAddNameBtn()) == null) {
            return;
        }
        Eb.X0.l(addNameBtn);
        Unit unit3 = Unit.a;
    }

    public static boolean r1(QuoteData quoteData) {
        return (quoteData == null || !Intrinsics.areEqual(quoteData.getContentType(), "QUOTE") || quoteData.getAudioUrl() == null) ? false : true;
    }

    public static void s1(final D7 d7, String str) {
        AppCompatImageView appCompatImageView;
        Context context;
        C3053c2 c3053c2 = (C3053c2) d7.y;
        if (c3053c2 == null || (appCompatImageView = c3053c2.i2) == null || (context = appCompatImageView.getContext()) == null) {
            return;
        }
        final boolean z = true;
        Eb.X0.h(context, str, 0, (Integer) null, (I7.c) null, (I7.m) null, 0, false, new Function1() {
            public final Object invoke(Object obj) {
                final Bitmap bitmap = (Bitmap) obj;
                boolean z2 = D7.Q4;
                final D7 d72 = D7.this;
                Intrinsics.checkNotNullParameter(d72, "this$0");
                final boolean z3 = z;
                d72.x0(new Function0() {
                    public final Object invoke() {
                        AppCompatImageView appCompatImageView2;
                        Bitmap bitmap2;
                        Bitmap d;
                        boolean z4 = D7.Q4;
                        D7 d73 = d72;
                        Intrinsics.checkNotNullParameter(d73, "this$0");
                        UserConfigData e = d73.e2().e();
                        Bitmap bitmap3 = bitmap;
                        if (e != null && Intrinsics.areEqual(e.isRemoveBgExperiment(), Boolean.TRUE) && bitmap3 != null && (d = Eb.d.d(bitmap3)) != null) {
                            do.a.a.c(Rd.p.a(d, new StringBuilder("trimBitmap "), ' '), new Object[0]);
                            bitmap3 = d;
                        }
                        if (z3) {
                            if (bitmap3 != null) {
                                Intrinsics.checkNotNullParameter(bitmap3, "bitmap");
                                try {
                                    int width = bitmap3.getWidth();
                                    int height = bitmap3.getHeight();
                                    bitmap2 = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
                                    Intrinsics.checkNotNullExpressionValue(bitmap2, "createBitmap(...)");
                                    Canvas canvas = new Canvas(bitmap2);
                                    Paint paint = new Paint();
                                    paint.setAntiAlias(true);
                                    Shader.TileMode tileMode = Shader.TileMode.CLAMP;
                                    paint.setShader(new BitmapShader(bitmap3, tileMode, tileMode));
                                    canvas.drawCircle(width / 2.0f, height / 2.0f, Math.min(width, height) / 2.0f, paint);
                                } catch (Exception unused) {
                                    bitmap2 = null;
                                }
                                if (bitmap2 != null) {
                                    bitmap3 = bitmap2;
                                }
                            } else {
                                bitmap3 = null;
                            }
                        }
                        C3053c2 c3053c22 = (C3053c2) d73.y;
                        if (c3053c22 == null || (appCompatImageView2 = c3053c22.i2) == null) {
                            return null;
                        }
                        appCompatImageView2.setImageBitmap(bitmap3);
                        appCompatImageView2.setScaleType(ImageView.ScaleType.CENTER_CROP);
                        return appCompatImageView2;
                    }
                });
                return Unit.a;
            }
        }, 1016);
    }

    public static void s3(int i, View view, QuoteData quoteData, D7 d7) {
        View cardWhatsAppShareLayout;
        d7.getClass();
        Intrinsics.checkNotNullParameter(view, "view");
        a.a aVar = do.a.a;
        Ref.ObjectRef b = W7.r.b(aVar, "sendScreenshotAnalytics", new Object[0]);
        b.element = view;
        if (view instanceof QuoteView) {
            aVar.c("mytag sending screenshot so hiding", new Object[0]);
            User user = d7.W2;
            if ((user == null || !user.isBusinessUser()) && (cardWhatsAppShareLayout = ((QuoteView) view).getCardWhatsAppShareLayout()) != null) {
                Eb.X0.l(cardWhatsAppShareLayout);
            }
            View quoteShareLayout = ((QuoteView) view).getQuoteShareLayout();
            if (quoteShareLayout == null) {
                quoteShareLayout = view;
            }
            b.element = quoteShareLayout;
        }
        androidx.lifecycle.E a = androidx.lifecycle.J.a(d7);
        kl.c cVar = dl.Z.a;
        dl.g.b(a, kl.b.b, (dl.J) null, new V9(null, view, quoteData, d7, b), 2);
    }

    public static boolean t1(InitData initData) {
        String videoPreviewUrl;
        Widget widget;
        I7.m data = (initData == null || (widget = initData.getWidget()) == null) ? null : widget.getData();
        MembershipData membershipData = data instanceof MembershipData ? (MembershipData) data : null;
        return (membershipData == null || !Intrinsics.areEqual(membershipData.isVideoPreview(), Boolean.TRUE) || (videoPreviewUrl = membershipData.getVideoPreviewUrl()) == null || StringsKt.J(videoPreviewUrl)) ? false : true;
    }

    public final void A2() {
        ProgressBar progressBar;
        RelativeLayout relativeLayout;
        ProgressBar progressBar2;
        C3053c2 c3053c2 = (C3053c2) this.y;
        if (c3053c2 != null && (progressBar2 = c3053c2.v2) != null) {
            progressBar2.setIndeterminate(false);
        }
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 != null && (relativeLayout = c3053c22.x2) != null) {
            Eb.X0.l(relativeLayout);
        }
        C3053c2 c3053c23 = (C3053c2) this.y;
        if (c3053c23 == null || (progressBar = c3053c23.v2) == null) {
            return;
        }
        progressBar.setProgress(0);
    }

    public final void A3() {
        String profileImageUrl;
        AppCompatImageView appCompatImageView;
        User user = this.W2;
        if (user == null || (profileImageUrl = user.getProfileImageUrl()) == null) {
            return;
        }
        User user2 = this.W2;
        if (user2 != null && user2.isNoBgImage(null)) {
            s1(this, profileImageUrl);
            return;
        }
        C3053c2 c3053c2 = (C3053c2) this.y;
        if (c3053c2 == null || (appCompatImageView = c3053c2.i2) == null) {
            return;
        }
        Eb.X0.I(appCompatImageView, profileImageUrl, (Function2) null, (Function1) null, 14);
    }

    public final void A4(int i, QuoteData quoteData) {
        a.a aVar = do.a.a;
        StringBuilder a = defpackage.m.a(aVar, Eb.J0.a(i, "videoPause "), new Object[0], "videoPause ");
        a.append(quoteData.getVideoCurrentMillis());
        aVar.c(a.toString(), new Object[0]);
        String type = quoteData.getType();
        String url = quoteData.getUrl();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Content Type", quoteData.getContentType());
        Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
        VoiceOverData voiceOverData = quoteData.getVoiceOverData();
        Pair pair4 = new Pair("isVoiceOverVideo", voiceOverData != null ? voiceOverData.isVoiceOverVideo() : null);
        Pair pair5 = new Pair("shouldWaitForVoiceData", Boolean.valueOf(quoteData.getShouldWaitForVoiceData()));
        StringBuilder sb = new StringBuilder("name_");
        VoiceData voiceData = quoteData.getVoiceData();
        sb.append(voiceData != null ? voiceData.getName() : null);
        sb.append(" file_");
        VoiceData voiceData2 = quoteData.getVoiceData();
        sb.append(voiceData2 != null ? voiceData2.getFileLocation() : null);
        com.crafto.android.ui.base.a.f0(this, "videoPause", "Home Screen", name, type, url, i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, new Pair("voiceData", sb.toString()), new Pair("Duration", Long.valueOf(quoteData.getVideoCurrentMillis()))}), 416);
    }

    @Override
    public final void B(final I7.a aVar, final int i, @NotNull final AppEnums.f fVar, @NotNull final String str, final Long l) {
        Intrinsics.checkNotNullParameter(fVar, "clickType");
        Intrinsics.checkNotNullParameter(str, "imageLibrary");
        I7.b.f(fVar, str);
        if (this.s4) {
            x0(new Function0() {
                public final Object invoke() {
                    boolean z = D7.Q4;
                    D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    AppEnums.f fVar2 = fVar;
                    Intrinsics.checkNotNullParameter(fVar2, "$clickType");
                    String str2 = str;
                    Intrinsics.checkNotNullParameter(str2, "$imageLibrary");
                    QuotesCategory quotesCategory = d7.r2().m;
                    String str3 = null;
                    String name = quotesCategory != null ? quotesCategory.getName() : null;
                    HashMap hashMap = new HashMap();
                    I7.a aVar2 = aVar;
                    if (aVar2 instanceof QuoteData) {
                        QuoteData quoteData = (QuoteData) aVar2;
                        str3 = quoteData.getAddBusinessProductPhoto() ? com.crafto.android.utility.a.c : quoteData.getUrl();
                        hashMap.put("Template Id", Integer.valueOf(quoteData.getDesign()));
                        hashMap.put("Slot", quoteData.getSlot());
                        hashMap.put("Content Type", quoteData.getContentType());
                        hashMap.put("Content Format", quoteData.getContentFormat());
                        User user = d7.W2;
                        hashMap.put("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false));
                        hashMap.put("Original Photo Size", Integer.valueOf((int) quoteData.getOriginalPhotoSize()));
                        hashMap.put("Original Name Size", Integer.valueOf((int) quoteData.getOriginalNameSize()));
                        hashMap.put("New Photo Size", Integer.valueOf((int) (quoteData.getOriginalPhotoSize() + quoteData.getPhotoResizeBy())));
                        hashMap.put("New Name Size", Integer.valueOf((int) (quoteData.getOriginalNameSize() + quoteData.getNameResizeBy())));
                        hashMap.put("isShareWithNameEnabled", quoteData.isShareWithNameEnabled());
                        hashMap.put("isShareWithNameForTwitterUI", quoteData.isShareWithNameForTwitterUI());
                        hashMap.put("hidePhotoInFeeds", quoteData.getHidePhotoInFeeds());
                        hashMap.put("isShareWithPhotoEnabled", Boolean.valueOf(quoteData.isShareWithPhotoEnabled()));
                        hashMap.put("variantType", quoteData.getVariantType());
                        hashMap.put("Content Text", quoteData.getContentText());
                    }
                    String str4 = str3;
                    hashMap.put("Duration", l);
                    String str5 = Intrinsics.areEqual(fVar2, AppEnums.f.Y0.a) ? "User Image Load Success" : Intrinsics.areEqual(fVar2, AppEnums.f.K0.a) ? "Content Image Load Success" : "";
                    hashMap.put("Image Loading Library", str2);
                    com.crafto.android.ui.base.a.f0(d7, "Image Load Status", d7.y0(), name, str4, str5, i, hashMap, 416);
                    return Unit.a;
                }
            });
        }
    }

    public final void B1(final String str, final DLocalOptionData dLocalOptionData) {
        final MembershipPlanDetails membershipPlanDetails = this.t3;
        if (membershipPlanDetails == null) {
            F0(2132019406);
        } else {
            c4();
            Gb.f.a(T7.P.f(c2(), membershipPlanDetails, dLocalOptionData.getPaymentMethodId(), dLocalOptionData.getPaymentMethodFlow(), str, null, 16), new Function1() {
                public final Object invoke(Object obj) {
                    MembershipPaymentData membershipPaymentData;
                    MembershipPaymentOrderData membershipPaymentOrderData;
                    MembershipPaymentData membershipPaymentData2;
                    MembershipPaymentData membershipPaymentData3;
                    MembershipPaymentOrderData membershipPaymentOrderData2 = (MembershipPaymentOrderData) obj;
                    boolean z = D7.Q4;
                    D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    MembershipPlanDetails membershipPlanDetails2 = membershipPlanDetails;
                    Intrinsics.checkNotNullParameter(membershipPlanDetails2, "$plan");
                    DLocalOptionData dLocalOptionData2 = dLocalOptionData;
                    Intrinsics.checkNotNullParameter(dLocalOptionData2, "$selectedPaymentType");
                    Intrinsics.checkNotNullParameter(membershipPaymentOrderData2, Column.DATA);
                    User E2 = d7.e2().E();
                    if (E2 != null) {
                        E2.setCpfcnpjNumber(str);
                    }
                    if (E2 != null) {
                        E2.setMembershipPaymentData(new MembershipPaymentData(null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, 65535, null));
                    }
                    if (E2 != null && (membershipPaymentData3 = E2.getMembershipPaymentData()) != null) {
                        membershipPaymentData3.setPaymentMethod(membershipPlanDetails2.getPaymentMethod());
                    }
                    membershipPaymentOrderData2.setPaymentMethod(membershipPlanDetails2.getPaymentMethod());
                    if (E2 != null && (membershipPaymentData2 = E2.getMembershipPaymentData()) != null) {
                        membershipPaymentData2.setMembershipPaymentOrderData(membershipPaymentOrderData2);
                    }
                    if (E2 != null && (membershipPaymentData = E2.getMembershipPaymentData()) != null && (membershipPaymentOrderData = membershipPaymentData.getMembershipPaymentOrderData()) != null) {
                        membershipPaymentOrderData.setPaymentMethodFlow(dLocalOptionData2.getPaymentMethodFlow());
                    }
                    d7.e2().r0(E2);
                    BaseActivity.a aVar = d7.i;
                    if (aVar != null) {
                        EbanxPaymentProcessActivity.p = true;
                        D7.S4 = false;
                        com.crafto.android.utility.a.g = 0;
                        d7.e2().e0(0);
                        aVar.i(E2);
                    }
                    com.crafto.android.ui.base.a.f0(d7, "Log", d7.y0(), null, membershipPaymentOrderData2.toString(), "Order Fetch Success", 0, null, 996);
                    d7.W();
                    return Unit.a;
                }
            }, new J9.h6(this, 2), false, 12);
        }
    }

    public final void B2(int i, QuoteData quoteData, AppEnums.f fVar) {
        IndiaFontQuoteData indiaFontQuoteData;
        IndiaFontQuoteData indiaFontQuoteData2;
        IndiaFontQuoteData indiaFontQuoteData3;
        IndiaFontQuoteData indiaFontQuoteData4;
        Context context = getContext();
        if (context != null) {
            Toast.makeText(context, context.getString(2132018704), 0).show();
        }
        r2().w(quoteData);
        User user = this.W2;
        Pair k = Eb.z0.k(quoteData, user != null ? user.getDisplayNameFromNames() : null);
        boolean z = fVar instanceof AppEnums.f.Q;
        String str = z ? "Download Action" : "Share";
        String y02 = y0();
        String type = quoteData.getType();
        String url = quoteData.getUrl();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Source Category", quoteData.getSourceCategory());
        Pair pair2 = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Integer frameId = quoteData.getFrameId();
        if (frameId == null) {
            ImageGuidelines imageGuidelines = quoteData.getImageGuidelines();
            frameId = imageGuidelines != null ? imageGuidelines.getFrameId() : null;
        }
        Pair pair3 = new Pair("Frame Id", frameId);
        Pair pair4 = new Pair("Content Type", quoteData.getContentType());
        Pair pair5 = new Pair("Click Location", z ? "Ineligible Share" : "Ineligible Download");
        Pair pair6 = new Pair("Content Format", quoteData.getContentFormat());
        User user2 = this.W2;
        com.crafto.android.ui.base.a.f0(this, str, y02, name, url, type, i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, pair6, new Pair("Crafto Premium State", Boolean.valueOf(user2 != null ? user2.isUserPremium() : false)), new Pair("Region Feed Type", quoteData.getRegion()), new Pair("Feed Number", quoteData.getFeedNumber()), new Pair("Font", k != null ? (String) k.a : null), new Pair("Audio Url", quoteData.getAudioUrl()), new Pair("Is Shadow Enabled", (k == null || (indiaFontQuoteData4 = (IndiaFontQuoteData) k.b) == null) ? null : Boolean.valueOf(indiaFontQuoteData4.isShadowRequired())), new Pair("Is Shadow With Color Enabled", (k == null || (indiaFontQuoteData3 = (IndiaFontQuoteData) k.b) == null) ? null : Boolean.valueOf(indiaFontQuoteData3.isShadowWithColor())), new Pair("Is Border Enabled", (k == null || (indiaFontQuoteData2 = (IndiaFontQuoteData) k.b) == null) ? null : Boolean.valueOf(indiaFontQuoteData2.isBorderRequired())), new Pair("Is Gradient", (k == null || (indiaFontQuoteData = (IndiaFontQuoteData) k.b) == null) ? null : Boolean.valueOf(indiaFontQuoteData.isGradient())), new Pair("Font Size", Float.valueOf(quoteData.getOriginalNameSize())), new Pair("quoteCreatorType", quoteData.getQuoteCreatorType()), new Pair("quoteCreatorId", quoteData.getQuoteCreatorId()), new Pair("feature", quoteData.getFeature())}), 416);
    }

    public final void B3(final com.crafto.android.data.model.MetaInit<com.crafto.android.data.model.InitData> r68) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.B3(com.crafto.android.data.model.MetaInit):void");
    }

    public final void B4(int i, QuoteData quoteData) {
        do.a.a.c(Eb.J0.a(i, "videoPlay "), new Object[0]);
        String type = quoteData.getType();
        String url = quoteData.getUrl();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Content Type", quoteData.getContentType());
        Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
        VoiceOverData voiceOverData = quoteData.getVoiceOverData();
        Pair pair4 = new Pair("isVoiceOverVideo", voiceOverData != null ? voiceOverData.isVoiceOverVideo() : null);
        Pair pair5 = new Pair("shouldWaitForVoiceData", Boolean.valueOf(quoteData.getShouldWaitForVoiceData()));
        StringBuilder sb = new StringBuilder("name_");
        VoiceData voiceData = quoteData.getVoiceData();
        sb.append(voiceData != null ? voiceData.getName() : null);
        sb.append(" file_");
        VoiceData voiceData2 = quoteData.getVoiceData();
        sb.append(voiceData2 != null ? voiceData2.getFileLocation() : null);
        com.crafto.android.ui.base.a.f0(this, "videoPlay", "Home Screen", name, type, url, i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, new Pair("voiceData", sb.toString())}), 416);
    }

    @Override
    public final void C(I7.a aVar, int i, @NotNull AppEnums.f fVar, Exception exc, Long l) {
        Intrinsics.checkNotNullParameter(fVar, "clickType");
        I7.b.d(fVar);
        H2(this, aVar, i, fVar, null, exc, l, 8);
    }

    public final void C1(int r58, com.crafto.android.data.model.QuoteData r59, com.crafto.android.utility.functional.AppEnums.f r60, com.crafto.android.ui.home.quotes.QuoteView r61, kotlin.jvm.functions.Function1<? super java.lang.String, kotlin.Unit> r62) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.C1(int, com.crafto.android.data.model.QuoteData, com.crafto.android.utility.functional.AppEnums$f, com.crafto.android.ui.home.quotes.QuoteView, kotlin.jvm.functions.Function1):void");
    }

    public final void C2() {
        Mb.d dVar;
        Mb.d dVar2;
        ViewPager2 viewPager2;
        C3053c2 c3053c2;
        ConstraintLayout constraintLayout;
        ViewPager2 viewPager22;
        ViewPager2 viewPager23;
        ViewPager2 viewPager24;
        ViewPager2 viewPager25;
        int i = 2;
        int i2 = 0;
        do.a.a.c("initAdapter selectedCategory " + this.S3, new Object[0]);
        final Ref.BooleanRef booleanRef = new Ref.BooleanRef();
        final Ref.ObjectRef objectRef = new Ref.ObjectRef();
        AppEnums.g.a aVar = AppEnums.g.a.a;
        User E2 = e2().E();
        E9.k kVar = new E9.k(L(), new Function3() {
            public final Object invoke(Object obj, Object obj2, Object obj3) {
                String str = (String) obj;
                int intValue = ((Integer) obj2).intValue();
                View view = (View) obj3;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter(str, "prompt");
                Intrinsics.checkNotNullParameter(view, "inputView");
                d7.x0(new Q8.I(intValue, 1, view, d7, str));
                return Unit.a;
            }
        }, new Da.d1(this, 3), new C1448u(this, 2), new Function1() {
            public final Object invoke(Object obj) {
                Bitmap bitmap = (Bitmap) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter(bitmap, "bitmap");
                dl.g.b(androidx.lifecycle.J.a(d7), (CoroutineContext) null, (dl.J) null, new Q8(d7, bitmap, null), 3);
                return Unit.a;
            }
        }, new C1450w(this, 1), new P3(this, i2));
        C2346k c2346k = new C2346k(false);
        U7.o oVar = new U7.o(e2().z(), new C1726h7(this, i2), new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                CardView cardView;
                String str = (String) obj2;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter((MembershipData) obj, com.clevertap.android.sdk.leanplum.Constants.IAP_ITEM_PARAM);
                C3053c2 c3053c22 = (C3053c2) d7.y;
                if (c3053c22 != null && (cardView = c3053c22.p1) != null) {
                    Eb.X0.l(cardView);
                }
                d7.l4();
                QuotesCategory quotesCategory = d7.S3;
                com.crafto.android.ui.base.a.f0(d7, "Click Action", "Home Screen", quotesCategory != null ? quotesCategory.getValue() : null, null, str, 0, null, 1000);
                return Unit.a;
            }
        });
        L7.m mVar = new L7.m(new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                String str = (String) obj;
                final int intValue = ((Integer) obj2).intValue();
                boolean z = D7.Q4;
                final D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                QuotesCategory quotesCategory = d7.r2().m;
                com.crafto.android.ui.base.a.f0(d7, "Click Action", "Home Screen", quotesCategory != null ? quotesCategory.getName() : null, str, "Color Choose", intValue, kotlin.collections.Q.f(new Pair[]{new Pair("Source", "Color Personality Widget")}), 416);
                d7.v4.add(str);
                if (d7.v4.size() == 2) {
                    String str2 = (String) CollectionsKt.G(0, d7.v4);
                    String str3 = (String) CollectionsKt.G(1, d7.v4);
                    if (str2 != null && str3 != null) {
                        Function1<? super HoliColorDetails, Unit> function1 = new Function1() {
                            public final Object invoke(Object obj3) {
                                int i3;
                                I7.m e;
                                HoliColorDetails holiColorDetails = (HoliColorDetails) obj3;
                                boolean z2 = D7.Q4;
                                D7 d72 = d7;
                                Intrinsics.checkNotNullParameter(d72, "this$0");
                                Intrinsics.checkNotNullParameter(holiColorDetails, "personality");
                                E7.G g = d72.m3;
                                if (g != null && (e = g.e((i3 = intValue))) != null) {
                                    InitData initData = e instanceof InitData ? (InitData) e : null;
                                    if (initData != null) {
                                        initData.setType(InitDataDeserializer.Companion.getHOLI_COLOUR_PERSONALITY_GENERATED());
                                        Widget widget = ((InitData) e).getWidget();
                                        I7.a data = widget != null ? widget.getData() : null;
                                        holiColorDetails.setHoliHomeWidgetData(data instanceof HoliHomeWidgetData ? (HoliHomeWidgetData) data : null);
                                        Unit unit = Unit.a;
                                        initData.setWidget(new Widget(null, null, null, null, holiColorDetails, null, null, null, 239, null));
                                    }
                                    E7.G g2 = d72.m3;
                                    if (g2 != null) {
                                        g2.notifyItemChanged(i3);
                                    }
                                }
                                return Unit.a;
                            }
                        };
                        Intrinsics.checkNotNullParameter(str2, "color1");
                        Intrinsics.checkNotNullParameter(str3, "color2");
                        Intrinsics.checkNotNullParameter(function1, "personalityGenerated");
                        g8.d dVar3 = new g8.d();
                        dVar3.m2 = function1;
                        Bundle bundle = new Bundle();
                        bundle.putString("param_1", str2);
                        bundle.putString("param_2", str3);
                        dVar3.setArguments(bundle);
                        BaseActivity activity = d7.getActivity();
                        BaseActivity baseActivity = activity instanceof BaseActivity ? activity : null;
                        if (baseActivity != null) {
                            BaseActivity.G(baseActivity, dVar3, true, "HoliDetailsFragment");
                        }
                    }
                    dl.g.b(androidx.lifecycle.J.a(d7), (CoroutineContext) null, (dl.J) null, new K8(d7, intValue, null), 3);
                    d7.v4 = new ArrayList();
                }
                return Unit.a;
            }
        }, new C1894w7(this, i2));
        User user = this.W2;
        L7.r rVar = new L7.r(user != null ? user.getProfileImageUrl() : null, new Uk.n() {
            public final Object invoke(Object obj, Object obj2, Object obj3, Object obj4) {
                int intValue = ((Integer) obj2).intValue();
                final HoliColorDetails holiColorDetails = (HoliColorDetails) obj3;
                HoliHomeWidgetData holiHomeWidgetData = (HoliHomeWidgetData) obj4;
                boolean z = D7.Q4;
                final D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter(holiColorDetails, Column.DATA);
                PreferencesHelper e2 = d7.e2();
                String string = e2.a.getString(e2.J, null);
                final FragmentActivity activity = d7.getActivity();
                if (activity != null) {
                    d7.j2().getClass();
                    AppEnums.j.b bVar = Hb.a0.i(activity) ? AppEnums.j.b.a : AppEnums.j.a.a;
                    if (bVar == null) {
                        bVar = AppEnums.j.a.a;
                    }
                    final AppEnums.j.b bVar2 = bVar;
                    if (string == null) {
                        d7.x0(new G4(d7, intValue, holiHomeWidgetData));
                    } else if (holiColorDetails.getShareBitmap()) {
                        final Uri parse = Uri.parse(string);
                        Intrinsics.checkNotNullExpressionValue(parse, "parse(...)");
                        d7.x0(new Function0() {
                            public final Object invoke() {
                                boolean z2 = D7.Q4;
                                D7 d72 = D7.this;
                                Intrinsics.checkNotNullParameter(d72, "this$0");
                                FragmentActivity fragmentActivity = activity;
                                Intrinsics.checkNotNullParameter(fragmentActivity, "$context");
                                Uri uri = parse;
                                Intrinsics.checkNotNullParameter(uri, "$link");
                                AppEnums.j jVar = bVar2;
                                Intrinsics.checkNotNullParameter(jVar, "$shareType");
                                return dl.g.b(androidx.lifecycle.J.a(d72), (CoroutineContext) null, (dl.J) null, new C1717ga(fragmentActivity, d72, holiColorDetails, uri, jVar, null), 3);
                            }
                        });
                    } else {
                        d7.j2().p(activity, holiColorDetails, Uri.parse(string), bVar2, (Bitmap) null);
                    }
                }
                QuotesCategory quotesCategory = d7.r2().m;
                String name = quotesCategory != null ? quotesCategory.getName() : null;
                QuotesCategory quotesCategory2 = d7.S3;
                com.crafto.android.ui.base.a.f0(d7, "Share", "Home Screen", name, string, quotesCategory2 != null ? quotesCategory2.getValue() : null, intValue, kotlin.collections.Q.f(new Pair[]{new Pair("Source", "Color Personality Widget")}), 416);
                return Unit.a;
            }
        }, new Function3() {
            public final Object invoke(Object obj, Object obj2, Object obj3) {
                int intValue = ((Integer) obj2).intValue();
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter((HoliColorDetails) obj3, Column.DATA);
                d7.getClass();
                d7.x0(new G4(d7, intValue, (HoliHomeWidgetData) obj));
                return Unit.a;
            }
        });
        U7.j jVar = new U7.j(e2().z(), new X9(2, this, D7.class, "onRenewMembership", "onRenewMembership(Lcom/crafto/android/data/model/InitData;Ljava/lang/String;)V", 0), androidx.lifecycle.J.a(this), false, new Function1() {
            public final Object invoke(Object obj) {
                long j;
                Widget widget;
                boolean booleanValue = ((Boolean) obj).booleanValue();
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Ref.BooleanRef booleanRef2 = booleanRef;
                Intrinsics.checkNotNullParameter(booleanRef2, "$promotionalVideoStarted");
                Ref.ObjectRef objectRef2 = objectRef;
                Intrinsics.checkNotNullParameter(objectRef2, "$startTime");
                a.a aVar2 = do.a.a;
                aVar2.c(Ng.Z.c("MembershipExpiredFullscreenBannerCell videoPlayingListener ", booleanValue), new Object[0]);
                long currentTimeMillis = System.currentTimeMillis();
                InitData initData = d7.x2;
                if ((((initData == null || (widget = initData.getWidget()) == null) ? null : widget.getData()) instanceof MembershipData) && booleanValue) {
                    booleanRef2.element = true;
                    objectRef2.element = new Date(currentTimeMillis);
                    j = currentTimeMillis;
                    com.crafto.android.ui.base.a.f0(d7, "videoPlay", d7.y0(), "Quotes List", null, "Promotional Video", 0, null, 1000);
                } else {
                    j = currentTimeMillis;
                }
                aVar2.c("MembershipExpiredFullscreenBannerCell promotionalVideoStarted " + booleanRef2.element, new Object[0]);
                if (!booleanValue) {
                    Date date = new Date(j);
                    if (booleanRef2.element) {
                        com.crafto.android.ui.base.a.f0(d7, "videoPause", d7.y0(), "Quotes List", null, "Promotional Video", 0, null, 1000);
                        Date date2 = (Date) objectRef2.element;
                        Long valueOf = date2 != null ? Long.valueOf(date.getTime() - date2.getTime()) : null;
                        if (valueOf != null) {
                            com.crafto.android.ui.base.a.f0(d7, "videoPlayTime", d7.y0(), "Quotes List", valueOf.toString(), "Promotional Video", 0, null, 992);
                        }
                        booleanRef2.element = false;
                    }
                }
                return Unit.a;
            }
        }, new C0148m1(this, i));
        User user2 = this.W2;
        C2350o c2350o = new C2350o(user2, (user2 == null || !user2.isUserPremium()) ? AppEnums.e.f.a : AppEnums.e.r.a, false, false, e2().z(), 122);
        User user3 = this.W2;
        AppEnums.e.r rVar2 = (user3 == null || !user3.isUserPremium()) ? AppEnums.e.f.a : AppEnums.e.r.a;
        float z = e2().z();
        e2().B();
        com.crafto.android.ui.home.profile.a R1 = R1();
        Mb.d dVar3 = this.N3;
        if (dVar3 != null) {
            dVar = dVar3;
        } else {
            Intrinsics.throwUninitializedPropertyAccessException("soundPoolManager");
            dVar = null;
        }
        J8.K1 k1 = new J8.K1(user3, null, rVar2, false, null, false, z, false, false, false, R1, dVar, 15610);
        User user4 = this.W2;
        AppEnums.e.r rVar3 = (user4 == null || !user4.isUserPremium()) ? AppEnums.e.f.a : AppEnums.e.r.a;
        float z2 = e2().z();
        e2().B();
        C0779z c0779z = new C0779z(user4, rVar3, z2);
        User user5 = this.W2;
        AppEnums.e.r rVar4 = (user5 == null || !user5.isUserPremium()) ? AppEnums.e.f.a : AppEnums.e.r.a;
        float z3 = e2().z();
        boolean B2 = e2().B();
        com.crafto.android.ui.home.profile.a R12 = R1();
        Mb.d dVar4 = this.N3;
        if (dVar4 != null) {
            dVar2 = dVar4;
        } else {
            Intrinsics.throwUninitializedPropertyAccessException("soundPoolManager");
            dVar2 = null;
        }
        E8.A3 a3 = new E8.A3(user5, rVar4, false, false, z3, B2, false, R12, false, dVar2, 23802);
        User user6 = this.W2;
        this.m3 = new E7.G(this, aVar, E2, kVar, c2346k, oVar, mVar, rVar, jVar, c2350o, k1, c0779z, a3, new C0439z3(user6, null, (user6 == null || !user6.isUserPremium()) ? AppEnums.e.g.a : AppEnums.e.r.a, false, false, null, null, false, e2().z(), null, false, false, false, false, false, R1(), 65002), new G8.b(new Da.U(this, i)), new C2291d(new Da.V(this, i)));
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 != null && (viewPager25 = c3053c22.k2) != null) {
            viewPager25.setOffscreenPageLimit(1);
        }
        C3053c2 c3053c23 = (C3053c2) this.y;
        if (c3053c23 != null && (viewPager24 = c3053c23.k2) != null) {
            viewPager24.setAdapter(this.m3);
        }
        C3053c2 c3053c24 = (C3053c2) this.y;
        if (c3053c24 != null && (viewPager23 = c3053c24.k2) != null) {
            viewPager23.setOrientation(1);
        }
        C3053c2 c3053c25 = (C3053c2) this.y;
        if (c3053c25 != null && (viewPager22 = c3053c25.k2) != null) {
            Eb.X0.V(viewPager22);
        }
        QuotesCategory quotesCategory = this.S3;
        if (!Intrinsics.areEqual(quotesCategory != null ? quotesCategory.getValue() : null, a.e.d) && (c3053c2 = (C3053c2) this.y) != null && (constraintLayout = c3053c2.M) != null) {
            Eb.X0.l(constraintLayout);
        }
        C3053c2 c3053c26 = (C3053c2) this.y;
        if (c3053c26 == null || (viewPager2 = c3053c26.k2) == null) {
            return;
        }
        viewPager2.b(new Y9(this));
    }

    public final void C3() {
        do.a.a.c("setShareDownloadClickCount", new Object[0]);
        long j = e2().a.getLong("share_download_counter", 0L) + 1;
        e2().a.edit().putLong("share_download_counter", j).apply();
        List list = a.e.a;
        long j2 = a.e.C1;
        if (j == j2) {
            P2();
            return;
        }
        if (j == 5 * j2) {
            P2();
        } else if (j == 10 * j2) {
            P2();
        } else if (j == 20 * j2) {
            P2();
        }
    }

    public final void C4(int i, QuoteData quoteData) {
        Object obj;
        Object obj2;
        Object obj3;
        Object obj4;
        Object obj5;
        UserConfigData e;
        if (this.u4) {
            String y02 = y0();
            String type = quoteData.getType();
            QuotesCategory quotesCategory = r2().m;
            obj = "Template Id";
            obj2 = "Content Type";
            obj3 = "Content Format";
            obj4 = "Time Taken";
            obj5 = "Source";
            com.crafto.android.ui.base.a.f0(this, "Video Load Status", y02, quotesCategory != null ? quotesCategory.getName() : null, type, "Video Load Success", i, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", Integer.valueOf(quoteData.getDesign())), new Pair("Content Type", quoteData.getContentType()), new Pair("Content Format", quoteData.getContentFormat()), new Pair("Time Taken", quoteData.getTimeToLoadVideo()), new Pair("Source", quoteData.getUrl())}), 416);
        } else {
            obj = "Template Id";
            obj2 = "Content Type";
            obj3 = "Content Format";
            obj4 = "Time Taken";
            obj5 = "Source";
        }
        if (this.j3 || ((e = e2().e()) != null && e.getLogLoadEventForAllContent())) {
            this.j3 = false;
            String type2 = quoteData.getType();
            String upperCase = a.e.G1.toUpperCase(Locale.ROOT);
            Intrinsics.checkNotNullExpressionValue(upperCase, "toUpperCase(...)");
            QuotesCategory quotesCategory2 = r2().m;
            com.crafto.android.ui.base.a.f0(this, "Content Load", "Home Screen", quotesCategory2 != null ? quotesCategory2.getName() : null, type2, upperCase, i, kotlin.collections.Q.f(new Pair[]{new Pair(obj, Integer.valueOf(quoteData.getDesign())), new Pair(obj2, quoteData.getContentType()), new Pair(obj3, quoteData.getContentFormat()), new Pair(obj4, quoteData.getTimeToLoadVideo()), new Pair(obj5, quoteData.getUrl())}), 416);
        }
    }

    @Override
    public final void D(final QuoteData quoteData, final int i, @NotNull AppEnums.f.T0 t02, final Long l) {
        Intrinsics.checkNotNullParameter(t02, "clickType");
        Intrinsics.checkNotNullParameter("Coil", "imageLibrary");
        do.a.a.c(Eb.J0.a(i, "onQuoteBitmapLoaded parentPosition "), new Object[0]);
        x0(new Function0() {
            public final String d = "Coil";

            public final Object invoke() {
                boolean z = D7.Q4;
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                String str = this.d;
                Intrinsics.checkNotNullParameter(str, "$imageLibrary");
                I7.a aVar = quoteData;
                QuoteData quoteData2 = aVar instanceof QuoteData ? (QuoteData) aVar : null;
                UserConfigData e = d7.e2().e();
                if (e != null && e.getLogImageLog()) {
                    String y02 = d7.y0();
                    String url = quoteData2 != null ? quoteData2.getUrl() : null;
                    QuotesCategory quotesCategory = d7.r2().m;
                    com.crafto.android.ui.base.a.f0(d7, "Image Loading Logs", y02, quotesCategory != null ? quotesCategory.getName() : null, url, "Image Bitmap Loaded", i, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", quoteData2 != null ? Integer.valueOf(quoteData2.getDesign()) : null), new Pair("Content Type", quoteData2 != null ? quoteData2.getContentType() : null), new Pair("Content Format", quoteData2 != null ? quoteData2.getContentFormat() : null), new Pair("Time Taken", l), new Pair("Source", str)}), 416);
                }
                return Unit.a;
            }
        });
    }

    public final void D2() {
        BaseActivity a = Eb.E.a(this);
        C0327j5 c0327j5 = new C0327j5(this, 2);
        Intrinsics.checkNotNullParameter(a, "context");
        Intrinsics.checkNotNullParameter(c0327j5, "captured");
        try {
            this.o3 = new W7.B0(a, c0327j5);
        } catch (Exception e) {
            a.a aVar = do.a.a;
            aVar.c("mytag amplitude - error init screenshot listener", new Object[0]);
            aVar.e(e);
        }
    }

    public final void D3() {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.D3():void");
    }

    public final void D4(QuoteData quoteData) {
        ActionButtonData actionButtonsText;
        ActionButtonData actionButtonsText2;
        com.crafto.android.ui.base.a.f0(this, "Click Action", y0(), null, null, "Annual Plan", 0, null, 1004);
        PlanData planData = null;
        if (e2().n() != null) {
            HomeScreenNewButtonsData homeScreenNewButtonDetails = quoteData.getHomeScreenNewButtonDetails();
            if (homeScreenNewButtonDetails != null && (actionButtonsText2 = homeScreenNewButtonDetails.getActionButtonsText()) != null) {
                planData = actionButtonsText2.getAnnual();
            }
            k4(quoteData, planData);
            return;
        }
        HomeScreenNewButtonsData homeScreenNewButtonDetails2 = quoteData.getHomeScreenNewButtonDetails();
        if (homeScreenNewButtonDetails2 != null && (actionButtonsText = homeScreenNewButtonDetails2.getActionButtonsText()) != null) {
            planData = actionButtonsText.getAnnual();
        }
        c4();
        x0(new C0924t5(this, 1));
        x0(new Eb.c0(this, new C1847s4(this, quoteData, planData), 2, new B7.B(this, 2)));
    }

    public final void E1() {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, null, "Delete Quotes Design", 0, null, 1004);
    }

    public final void E2(int r23, android.view.View r24, com.crafto.android.data.model.QuoteData r25) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.E2(int, android.view.View, com.crafto.android.data.model.QuoteData):void");
    }

    public final void E3(com.crafto.android.data.model.User r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.E3(com.crafto.android.data.model.User):void");
    }

    public final void F1(final int r54, final android.view.View r55, com.crafto.android.data.model.QuoteData r56, final com.crafto.android.utility.functional.AppEnums.f r57) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.F1(int, android.view.View, com.crafto.android.data.model.QuoteData, com.crafto.android.utility.functional.AppEnums$f):void");
    }

    public final void F3(FragmentManager fragmentManager) {
        if (fragmentManager.getFragments().size() > 0) {
            int size = fragmentManager.getFragments().size();
            int i = size - 1;
            a.a aVar = do.a.a;
            aVar.c(Eb.J0.a(i, "topIndex "), new Object[0]);
            if (fragmentManager.getFragments().get(i) instanceof j6.u) {
                i = size - 2;
            }
            aVar.c(Eb.J0.a(i, "topIndex "), new Object[0]);
            Fragment fragment = (Fragment) fragmentManager.getFragments().get(i);
            aVar.c("topFragment " + fragment, new Object[0]);
            z3(true);
            com.crafto.android.ui.base.a aVar2 = fragment instanceof com.crafto.android.ui.base.a ? (com.crafto.android.ui.base.a) fragment : null;
            if (aVar2 != null) {
                aVar2.V();
            }
        }
    }

    public final void G2(DLocalOptionData dLocalOptionData) {
        String y02 = y0();
        String paymentMethodId = dLocalOptionData.getPaymentMethodId();
        MembershipPlanDetails membershipPlanDetails = this.t3;
        Pair pair = new Pair("Term", membershipPlanDetails != null ? membershipPlanDetails.getTerm() : null);
        MembershipPlanDetails membershipPlanDetails2 = this.t3;
        com.crafto.android.ui.base.a.f0(this, "Click Action", y02, null, paymentMethodId, "dLocal Option Select", 0, kotlin.collections.Q.f(new Pair[]{pair, new Pair("Amount", membershipPlanDetails2 != null ? membershipPlanDetails2.getDisplayAmount() : null), new Pair("DLocal Payment Method Flow", dLocalOptionData.getPaymentMethodFlow()), new Pair("DLocal Payment Method Name", dLocalOptionData.getName())}), 484);
    }

    public final void G3(QuoteData quoteData) {
        VoiceOverData voiceOverData;
        if (quoteData != null) {
            quoteData.setVoiceData(null);
        }
        a.a aVar = do.a.a;
        aVar.c("setVoiceOverData_1", new Object[0]);
        if (quoteData == null || (voiceOverData = quoteData.getVoiceOverData()) == null || !Intrinsics.areEqual(voiceOverData.isVoiceOverVideo(), Boolean.TRUE) || quoteData.getVoiceData() != null) {
            return;
        }
        aVar.c("isVoiceOverVideo__ " + quoteData.getVoiceOverData(), new Object[0]);
        Ob.i iVar = this.M3;
        if (iVar == null) {
            Intrinsics.throwUninitializedPropertyAccessException("androidTTS");
            iVar = null;
        }
        VoiceOverData voiceOverData2 = quoteData.getVoiceOverData();
        boolean h = iVar.h(voiceOverData2 != null ? voiceOverData2.getVoiceOverName() : null);
        PreferencesHelper preferencesHelper = iVar.b;
        VoiceData p = h ? preferencesHelper.p() : preferencesHelper.o();
        aVar.c("voiceLocal " + p, new Object[0]);
        if (p == null) {
            com.crafto.android.ui.base.a.f0(this, "TTS Logs New", y0(), null, null, "voiceDataNotFound", 0, null, 1004);
            return;
        }
        aVar.c("isVoiceOverVideo__ " + p, new Object[0]);
        Ob.i iVar2 = this.M3;
        if (iVar2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("androidTTS");
            iVar2 = null;
        }
        if (iVar2.c(quoteData, p)) {
            quoteData.setVoiceData(p);
        } else {
            quoteData.setVoiceData(null);
        }
        com.crafto.android.ui.base.a.f0(this, "TTS Logs New", y0(), null, p.getName(), "voiceDataFound", 0, null, 996);
    }

    public final void H1(int i, QuoteData quoteData) {
        String type = quoteData.getType();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        String contentType = quoteData.getContentType();
        Pair pair2 = new Pair("Content Type", (contentType == null || StringsKt.J(contentType)) ? "QUOTE" : quoteData.getContentType());
        Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Log", "Home Screen", name, type, "Drag", i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false)), new Pair("Source", quoteData.getUrl())}), 416);
    }

    public final void H3(boolean z) {
        ConstraintLayout constraintLayout;
        ConstraintLayout constraintLayout2;
        ConstraintLayout constraintLayout3;
        TextView textView;
        String string;
        if (!z) {
            C3053c2 c3053c2 = (C3053c2) this.y;
            if (c3053c2 == null || (constraintLayout = c3053c2.Y) == null) {
                return;
            }
            Eb.X0.l(constraintLayout);
            return;
        }
        W();
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 != null && (textView = c3053c22.t2) != null) {
            Translations I2 = e2().I();
            if (I2 == null || (string = I2.getWhatsappStatusLoadingMsg()) == null) {
                string = getString(2132018824);
                Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
            }
            textView.setText(string);
        }
        C3053c2 c3053c23 = (C3053c2) this.y;
        if (c3053c23 != null && (constraintLayout3 = c3053c23.M) != null) {
            Eb.X0.V(constraintLayout3);
        }
        C3053c2 c3053c24 = (C3053c2) this.y;
        if (c3053c24 == null || (constraintLayout2 = c3053c24.Y) == null) {
            return;
        }
        Eb.X0.V(constraintLayout2);
    }

    @Override
    public final boolean I() {
        FragmentManager supportFragmentManager;
        List fragments;
        FragmentManager supportFragmentManager2;
        FragmentManager supportFragmentManager3;
        List fragments2;
        Fragment fragment;
        C3047bd c3047bd;
        ConstraintLayout constraintLayout;
        try {
            C3053c2 c3053c2 = (C3053c2) this.y;
            if (c3053c2 != null && (c3047bd = c3053c2.w) != null && (constraintLayout = c3047bd.a) != null && Eb.X0.s(constraintLayout)) {
                r3();
                return true;
            }
        } catch (Exception e) {
            do.a.a.e(e);
        }
        FragmentActivity activity = getActivity();
        if (activity != null && (supportFragmentManager = activity.getSupportFragmentManager()) != null && (fragments = supportFragmentManager.getFragments()) != null && fragments.size() > 2 && e2().h()) {
            FragmentActivity activity2 = getActivity();
            if (Intrinsics.areEqual((activity2 == null || (supportFragmentManager3 = activity2.getSupportFragmentManager()) == null || (fragments2 = supportFragmentManager3.getFragments()) == null || (fragment = (Fragment) fragments2.get(1)) == null) ? null : fragment.getTag(), "Plan Options Screen With Benifits Comparison")) {
                FragmentActivity activity3 = getActivity();
                if (activity3 != null && (supportFragmentManager2 = activity3.getSupportFragmentManager()) != null) {
                    supportFragmentManager2.popBackStack();
                }
                return true;
            }
        }
        return this instanceof C1762l;
    }

    public final void I1(int i, View view, QuoteData quoteData) {
        QuoteData quoteData2 = quoteData == null ? null : quoteData;
        if (quoteData2 == null || !quoteData2.getShowResizeDialog()) {
            if (quoteData == null) {
                quoteData = null;
            }
            if (quoteData != null) {
                P0(quoteData, i, "Edit Name");
                Unit unit = Unit.a;
                return;
            }
            return;
        }
        QuoteData quoteData3 = quoteData == null ? null : quoteData;
        if (quoteData3 == null || quoteData3.getShowName()) {
            J1(quoteData, view, i, "Button Clicked");
            Unit unit2 = Unit.a;
            return;
        }
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "NAME", "Add Name", null, 0, null, 1008);
        QuoteView quoteView = view instanceof QuoteView ? (QuoteView) view : null;
        if (quoteView != null) {
            Intrinsics.checkNotNullParameter(quoteView, "<this>");
            Intrinsics.checkNotNullParameter(quoteData, "quoteData");
            TextView tvNameBtn = quoteView.getTvNameBtn();
            if (tvNameBtn != null) {
                String changeNameTitle = quoteData.getChangeNameTitle();
                if (changeNameTitle == null) {
                    changeNameTitle = quoteView.getContext().getString(2132017511);
                    Intrinsics.checkNotNullExpressionValue(changeNameTitle, "getString(...)");
                }
                tvNameBtn.setText(changeNameTitle);
            }
            TextView tvEditOrAddName = quoteView.getTvEditOrAddName();
            if (tvEditOrAddName != null) {
                String changeNameTitle2 = quoteData.getChangeNameTitle();
                if (changeNameTitle2 == null) {
                    changeNameTitle2 = quoteView.getContext().getString(2132017511);
                    Intrinsics.checkNotNullExpressionValue(changeNameTitle2, "getString(...)");
                }
                tvEditOrAddName.setText(changeNameTitle2);
            }
            quoteData.setShowName(true);
            AppCompatTextView dialogHeading = quoteView.getDialogHeading();
            if (dialogHeading != null) {
                Eb.X0.V(dialogHeading);
            }
            AppCompatTextView tvName = quoteView.getTvName();
            if (tvName != null) {
                Eb.X0.V(tvName);
            }
            View descriptionContainer = quoteView.getDescriptionContainer();
            if (descriptionContainer != null) {
                Eb.X0.V(descriptionContainer);
            }
        }
        E7.G g = this.m3;
        if (g != null) {
            g.notifyItemChanged(i);
            Unit unit3 = Unit.a;
        }
    }

    public final void I2(QuoteData quoteData) {
        ActionButtonData actionButtonsText;
        ActionButtonData actionButtonsText2;
        com.crafto.android.ui.base.a.f0(this, "Click Action", y0(), null, null, "Monthly Plan", 0, null, 1004);
        PlanData planData = null;
        if (e2().n() != null) {
            HomeScreenNewButtonsData homeScreenNewButtonDetails = quoteData.getHomeScreenNewButtonDetails();
            if (homeScreenNewButtonDetails != null && (actionButtonsText2 = homeScreenNewButtonDetails.getActionButtonsText()) != null) {
                planData = actionButtonsText2.getMonthly();
            }
            k4(quoteData, planData);
            return;
        }
        HomeScreenNewButtonsData homeScreenNewButtonDetails2 = quoteData.getHomeScreenNewButtonDetails();
        if (homeScreenNewButtonDetails2 != null && (actionButtonsText = homeScreenNewButtonDetails2.getActionButtonsText()) != null) {
            planData = actionButtonsText.getMonthly();
        }
        c4();
        x0(new C0924t5(this, 1));
        x0(new Eb.c0(this, new C1847s4(this, quoteData, planData), 2, new B7.B(this, 2)));
    }

    public final void I3() {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Birthday reminder widget", null, this.i2, "Birthday alarm lagaye", 0, null, 996);
    }

    @Override
    public final i4.a J0(ViewGroup viewGroup) {
        String str;
        View inflate = getLayoutInflater().inflate(2131558772, viewGroup, false);
        int i = 2131361896;
        String str2 = "Missing required view with ID: ";
        if (N4.e.b(2131361896, inflate) != null) {
            i = 2131361915;
            ConstraintLayout b = N4.e.b(2131361915, inflate);
            if (b != null) {
                i = 2131361968;
                LottieAnimationView b2 = N4.e.b(2131361968, inflate);
                if (b2 != null) {
                    i = 2131362063;
                    ConstraintLayout b3 = N4.e.b(2131362063, inflate);
                    if (b3 != null) {
                        i = 2131362064;
                        TextView textView = (TextView) N4.e.b(2131362064, inflate);
                        if (textView != null) {
                            i = 2131362248;
                            MaterialCardView b4 = N4.e.b(2131362248, inflate);
                            if (b4 != null) {
                                i = 2131362249;
                                MaterialCardView b5 = N4.e.b(2131362249, inflate);
                                if (b5 != null) {
                                    i = 2131362282;
                                    if (N4.e.b(2131362282, inflate) != null) {
                                        i = 2131362326;
                                        ChipGroup b6 = N4.e.b(2131362326, inflate);
                                        if (b6 != null) {
                                            i = 2131362327;
                                            RelativeLayout relativeLayout = (RelativeLayout) N4.e.b(2131362327, inflate);
                                            if (relativeLayout != null) {
                                                i = 2131362362;
                                                ConstraintLayout b7 = N4.e.b(2131362362, inflate);
                                                if (b7 != null) {
                                                    i = 2131362367;
                                                    ConstraintLayout b8 = N4.e.b(2131362367, inflate);
                                                    if (b8 != null) {
                                                        i = 2131362410;
                                                        if (N4.e.b(2131362410, inflate) != null) {
                                                            i = 2131362657;
                                                            if (N4.e.b(2131362657, inflate) != null) {
                                                                i = 2131362806;
                                                                AppCompatTextView b10 = N4.e.b(2131362806, inflate);
                                                                if (b10 != null) {
                                                                    i = 2131362807;
                                                                    if (N4.e.b(2131362807, inflate) != null) {
                                                                        i = 2131362809;
                                                                        ConstraintLayout b11 = N4.e.b(2131362809, inflate);
                                                                        if (b11 != null) {
                                                                            i = 2131362867;
                                                                            AppCompatEditText b12 = N4.e.b(2131362867, inflate);
                                                                            if (b12 != null) {
                                                                                i = 2131362966;
                                                                                MaterialButton b13 = N4.e.b(2131362966, inflate);
                                                                                if (b13 != null) {
                                                                                    i = 2131363039;
                                                                                    FrameLayout frameLayout = (FrameLayout) N4.e.b(2131363039, inflate);
                                                                                    if (frameLayout != null) {
                                                                                        i = 2131363073;
                                                                                        TextView textView2 = (TextView) N4.e.b(2131363073, inflate);
                                                                                        if (textView2 != null) {
                                                                                            i = 2131363074;
                                                                                            TextView textView3 = (TextView) N4.e.b(2131363074, inflate);
                                                                                            if (textView3 != null) {
                                                                                                i = 2131363177;
                                                                                                View b14 = N4.e.b(2131363177, inflate);
                                                                                                if (b14 != null) {
                                                                                                    i = 2131363306;
                                                                                                    ConstraintLayout b15 = N4.e.b(2131363306, inflate);
                                                                                                    if (b15 != null) {
                                                                                                        int i2 = 2131362530;
                                                                                                        CustomCountdownTimer customCountdownTimer = (CustomCountdownTimer) N4.e.b(2131362530, b15);
                                                                                                        if (customCountdownTimer != null) {
                                                                                                            i2 = 2131363450;
                                                                                                            if (N4.e.b(2131363450, b15) != null) {
                                                                                                                i2 = 2131363650;
                                                                                                                LottieAnimationView b16 = N4.e.b(2131363650, b15);
                                                                                                                if (b16 != null) {
                                                                                                                    ConstraintLayout constraintLayout = b15;
                                                                                                                    i2 = 2131364921;
                                                                                                                    MaterialTextView b17 = N4.e.b(2131364921, b15);
                                                                                                                    if (b17 != null) {
                                                                                                                        i2 = 2131365062;
                                                                                                                        MaterialTextView b18 = N4.e.b(2131365062, b15);
                                                                                                                        if (b18 != null) {
                                                                                                                            C3029ac c3029ac = new C3029ac(constraintLayout, customCountdownTimer, b16, constraintLayout, b17, b18);
                                                                                                                            View b19 = N4.e.b(2131363310, inflate);
                                                                                                                            if (b19 != null) {
                                                                                                                                C3181jc a = C3181jc.a(b19);
                                                                                                                                ConstraintLayout b20 = N4.e.b(2131363316, inflate);
                                                                                                                                if (b20 != null) {
                                                                                                                                    int i3 = 2131362689;
                                                                                                                                    if (N4.e.b(2131362689, b20) != null) {
                                                                                                                                        ConstraintLayout constraintLayout2 = b20;
                                                                                                                                        i3 = 2131365367;
                                                                                                                                        MaterialTextView b21 = N4.e.b(2131365367, b20);
                                                                                                                                        if (b21 != null) {
                                                                                                                                            i3 = 2131365368;
                                                                                                                                            AppCompatImageView b22 = N4.e.b(2131365368, b20);
                                                                                                                                            if (b22 != null) {
                                                                                                                                                i3 = 2131365369;
                                                                                                                                                MaterialTextView b23 = N4.e.b(2131365369, b20);
                                                                                                                                                if (b23 != null) {
                                                                                                                                                    Sc sc = new Sc(constraintLayout2, constraintLayout2, b21, b22, b23);
                                                                                                                                                    ConstraintLayout b24 = N4.e.b(2131363319, inflate);
                                                                                                                                                    if (b24 != null) {
                                                                                                                                                        int i4 = 2131362145;
                                                                                                                                                        if (N4.e.b(2131362145, b24) != null) {
                                                                                                                                                            AppCompatImageView b25 = N4.e.b(2131363396, b24);
                                                                                                                                                            if (b25 != null) {
                                                                                                                                                                str = "Missing required view with ID: ";
                                                                                                                                                                LottieAnimationView b26 = N4.e.b(2131363651, b24);
                                                                                                                                                                if (b26 != null) {
                                                                                                                                                                    MaterialTextView b27 = N4.e.b(com.clevertap.android.sdk.R.id.title, b24);
                                                                                                                                                                    if (b27 != null) {
                                                                                                                                                                        C3047bd c3047bd = new C3047bd(b24, b25, b26, b27);
                                                                                                                                                                        AppCompatImageView b28 = N4.e.b(2131363379, inflate);
                                                                                                                                                                        if (b28 != null) {
                                                                                                                                                                            AppCompatImageView b29 = N4.e.b(2131363397, inflate);
                                                                                                                                                                            if (b29 == null) {
                                                                                                                                                                                str2 = str;
                                                                                                                                                                                i = 2131363397;
                                                                                                                                                                            } else if (N4.e.b(2131363426, inflate) != null) {
                                                                                                                                                                                AppCompatImageView b30 = N4.e.b(2131363432, inflate);
                                                                                                                                                                                if (b30 != null) {
                                                                                                                                                                                    AppCompatImageView b31 = N4.e.b(2131363433, inflate);
                                                                                                                                                                                    if (b31 != null) {
                                                                                                                                                                                        AppCompatImageView b32 = N4.e.b(2131363435, inflate);
                                                                                                                                                                                        if (b32 != null) {
                                                                                                                                                                                            LinearLayoutCompat b33 = N4.e.b(2131363578, inflate);
                                                                                                                                                                                            if (b33 != null) {
                                                                                                                                                                                                ConstraintLayout b34 = N4.e.b(2131363596, inflate);
                                                                                                                                                                                                if (b34 != null) {
                                                                                                                                                                                                    RelativeLayout relativeLayout2 = (RelativeLayout) N4.e.b(2131363857, inflate);
                                                                                                                                                                                                    if (relativeLayout2 != null) {
                                                                                                                                                                                                        RelativeLayout relativeLayout3 = (RelativeLayout) inflate;
                                                                                                                                                                                                        ProgressBar progressBar = (ProgressBar) N4.e.b(2131363989, inflate);
                                                                                                                                                                                                        if (progressBar != null) {
                                                                                                                                                                                                            ConstraintLayout b35 = N4.e.b(2131363990, inflate);
                                                                                                                                                                                                            if (b35 == null) {
                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                i = 2131363990;
                                                                                                                                                                                                            } else if (N4.e.b(2131364209, inflate) == null) {
                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                i = 2131364209;
                                                                                                                                                                                                            } else if (((TextView) N4.e.b(2131364210, inflate)) == null) {
                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                i = 2131364210;
                                                                                                                                                                                                            } else if (((RelativeLayout) N4.e.b(2131364234, inflate)) != null) {
                                                                                                                                                                                                                RelativeLayout relativeLayout4 = (RelativeLayout) N4.e.b(2131364275, inflate);
                                                                                                                                                                                                                if (relativeLayout4 != null) {
                                                                                                                                                                                                                    CardView b36 = N4.e.b(2131364290, inflate);
                                                                                                                                                                                                                    if (b36 != null) {
                                                                                                                                                                                                                        RecyclerView b37 = N4.e.b(2131364291, inflate);
                                                                                                                                                                                                                        if (b37 != null) {
                                                                                                                                                                                                                            AppCompatImageView b38 = N4.e.b(2131364395, inflate);
                                                                                                                                                                                                                            if (b38 == null) {
                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                i = 2131364395;
                                                                                                                                                                                                                            } else if (N4.e.b(2131364397, inflate) != null) {
                                                                                                                                                                                                                                AppCompatEditText b39 = N4.e.b(2131364399, inflate);
                                                                                                                                                                                                                                if (b39 != null) {
                                                                                                                                                                                                                                    RelativeLayout relativeLayout5 = (RelativeLayout) N4.e.b(2131364400, inflate);
                                                                                                                                                                                                                                    if (relativeLayout5 != null) {
                                                                                                                                                                                                                                        LinearLayoutCompat b40 = N4.e.b(2131364553, inflate);
                                                                                                                                                                                                                                        if (b40 == null) {
                                                                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                                                                            i = 2131364553;
                                                                                                                                                                                                                                        } else if (N4.e.b(2131364554, inflate) != null) {
                                                                                                                                                                                                                                            AppCompatImageView b41 = N4.e.b(2131364634, inflate);
                                                                                                                                                                                                                                            if (b41 == null) {
                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                i = 2131364634;
                                                                                                                                                                                                                                            } else if (((TextView) N4.e.b(2131364635, inflate)) == null) {
                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                i = 2131364635;
                                                                                                                                                                                                                                            } else if (((TextView) N4.e.b(2131364636, inflate)) == null) {
                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                i = 2131364636;
                                                                                                                                                                                                                                            } else if (((LinearLayout) N4.e.b(2131364638, inflate)) == null) {
                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                i = 2131364638;
                                                                                                                                                                                                                                            } else if (((LinearLayout) N4.e.b(2131364811, inflate)) != null) {
                                                                                                                                                                                                                                                AppCompatImageView b42 = N4.e.b(2131364806, inflate);
                                                                                                                                                                                                                                                if (b42 != null) {
                                                                                                                                                                                                                                                    LinearLayout linearLayout = (LinearLayout) N4.e.b(2131364821, inflate);
                                                                                                                                                                                                                                                    if (linearLayout == null) {
                                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                                        i = 2131364821;
                                                                                                                                                                                                                                                    } else if (N4.e.b(2131364837, inflate) == null) {
                                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                                        i = 2131364837;
                                                                                                                                                                                                                                                    } else if (N4.e.b(2131364838, inflate) != null) {
                                                                                                                                                                                                                                                        ViewPager2 b43 = N4.e.b(2131364839, inflate);
                                                                                                                                                                                                                                                        if (b43 != null) {
                                                                                                                                                                                                                                                            RecyclerView b44 = N4.e.b(2131364840, inflate);
                                                                                                                                                                                                                                                            if (b44 == null) {
                                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                                i = 2131364840;
                                                                                                                                                                                                                                                            } else if (N4.e.b(2131364841, inflate) != null) {
                                                                                                                                                                                                                                                                RelativeLayout relativeLayout6 = (RelativeLayout) N4.e.b(2131364865, inflate);
                                                                                                                                                                                                                                                                if (relativeLayout6 != null) {
                                                                                                                                                                                                                                                                    RelativeLayout relativeLayout7 = (RelativeLayout) N4.e.b(2131364866, inflate);
                                                                                                                                                                                                                                                                    if (relativeLayout7 != null) {
                                                                                                                                                                                                                                                                        MaterialTextView b45 = N4.e.b(2131364883, inflate);
                                                                                                                                                                                                                                                                        if (b45 != null) {
                                                                                                                                                                                                                                                                            AppCompatTextView b46 = N4.e.b(2131364912, inflate);
                                                                                                                                                                                                                                                                            if (b46 == null) {
                                                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                                                i = 2131364912;
                                                                                                                                                                                                                                                                            } else if (N4.e.b(2131364969, inflate) == null) {
                                                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                                                i = 2131364969;
                                                                                                                                                                                                                                                                            } else if (N4.e.b(2131365044, inflate) != null) {
                                                                                                                                                                                                                                                                                AppCompatTextView b47 = N4.e.b(2131365045, inflate);
                                                                                                                                                                                                                                                                                if (b47 != null) {
                                                                                                                                                                                                                                                                                    MaterialTextView b48 = N4.e.b(2131365063, inflate);
                                                                                                                                                                                                                                                                                    if (b48 != null) {
                                                                                                                                                                                                                                                                                        MaterialTextView b49 = N4.e.b(2131365081, inflate);
                                                                                                                                                                                                                                                                                        if (b49 != null) {
                                                                                                                                                                                                                                                                                            TextView textView4 = (TextView) N4.e.b(2131365085, inflate);
                                                                                                                                                                                                                                                                                            if (textView4 != null) {
                                                                                                                                                                                                                                                                                                AppCompatTextView b50 = N4.e.b(2131365193, inflate);
                                                                                                                                                                                                                                                                                                if (b50 != null) {
                                                                                                                                                                                                                                                                                                    ProgressBar progressBar2 = (ProgressBar) N4.e.b(2131365250, inflate);
                                                                                                                                                                                                                                                                                                    if (progressBar2 == null) {
                                                                                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                                                                                        i = 2131365250;
                                                                                                                                                                                                                                                                                                    } else if (N4.e.b(2131365263, inflate) == null) {
                                                                                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                                                                                        i = 2131365263;
                                                                                                                                                                                                                                                                                                    } else if (((RelativeLayout) N4.e.b(2131365264, inflate)) != null) {
                                                                                                                                                                                                                                                                                                        TextView textView5 = (TextView) N4.e.b(2131365269, inflate);
                                                                                                                                                                                                                                                                                                        if (textView5 != null) {
                                                                                                                                                                                                                                                                                                            RelativeLayout relativeLayout8 = (RelativeLayout) N4.e.b(2131365270, inflate);
                                                                                                                                                                                                                                                                                                            if (relativeLayout8 != null) {
                                                                                                                                                                                                                                                                                                                AppCompatImageView b51 = N4.e.b(2131365339, inflate);
                                                                                                                                                                                                                                                                                                                if (b51 == null) {
                                                                                                                                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                                                                                                                                    i = 2131365339;
                                                                                                                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                                                                                                                    if (((ProgressBar) N4.e.b(2131365359, inflate)) != null) {
                                                                                                                                                                                                                                                                                                                        C3053c2 c3053c2 = new C3053c2(relativeLayout3, b, b2, b3, textView, b4, b5, b6, relativeLayout, b7, b8, b10, b11, b12, b13, frameLayout, textView2, textView3, b14, c3029ac, a, sc, c3047bd, b28, b29, b30, b31, b32, b33, b34, relativeLayout2, relativeLayout3, progressBar, b35, relativeLayout4, b36, b37, b38, b39, relativeLayout5, b40, b41, b42, linearLayout, b43, b44, relativeLayout6, relativeLayout7, b45, b46, b47, b48, b49, textView4, b50, progressBar2, textView5, relativeLayout8, b51);
                                                                                                                                                                                                                                                                                                                        Intrinsics.checkNotNullExpressionValue(c3053c2, "inflate(...)");
                                                                                                                                                                                                                                                                                                                        return c3053c2;
                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                                                                                                                                    i = 2131365359;
                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                                                                                i = 2131365270;
                                                                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                                                                        } else {
                                                                                                                                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                                                                                                                                            i = 2131365269;
                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                    } else {
                                                                                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                                                                                        i = 2131365264;
                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                                                                                                                    i = 2131365193;
                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                                                                i = 2131365085;
                                                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                                                        } else {
                                                                                                                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                                                                                                                            i = 2131365081;
                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                    } else {
                                                                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                                                                        i = 2131365063;
                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                                                                                                    i = 2131365045;
                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                                                i = 2131365044;
                                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                                        } else {
                                                                                                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                                                                                                            i = 2131364883;
                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                    } else {
                                                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                                                        i = 2131364866;
                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                                                                                    i = 2131364865;
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                                i = 2131364841;
                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                        } else {
                                                                                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                                                                                            i = 2131364839;
                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                    } else {
                                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                                        i = 2131364838;
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                                                                    i = 2131364806;
                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                                i = 2131364811;
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                        } else {
                                                                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                                                                            i = 2131364554;
                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                    } else {
                                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                                        i = 2131364400;
                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                                                    i = 2131364399;
                                                                                                                                                                                                                                }
                                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                                i = 2131364397;
                                                                                                                                                                                                                            }
                                                                                                                                                                                                                        } else {
                                                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                                                            i = 2131364291;
                                                                                                                                                                                                                        }
                                                                                                                                                                                                                    } else {
                                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                                        i = 2131364290;
                                                                                                                                                                                                                    }
                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                                    i = 2131364275;
                                                                                                                                                                                                                }
                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                                i = 2131364234;
                                                                                                                                                                                                            }
                                                                                                                                                                                                        } else {
                                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                                            i = 2131363989;
                                                                                                                                                                                                        }
                                                                                                                                                                                                    } else {
                                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                                        i = 2131363857;
                                                                                                                                                                                                    }
                                                                                                                                                                                                } else {
                                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                                    i = 2131363596;
                                                                                                                                                                                                }
                                                                                                                                                                                            } else {
                                                                                                                                                                                                str2 = str;
                                                                                                                                                                                                i = 2131363578;
                                                                                                                                                                                            }
                                                                                                                                                                                        } else {
                                                                                                                                                                                            str2 = str;
                                                                                                                                                                                            i = 2131363435;
                                                                                                                                                                                        }
                                                                                                                                                                                    } else {
                                                                                                                                                                                        str2 = str;
                                                                                                                                                                                        i = 2131363433;
                                                                                                                                                                                    }
                                                                                                                                                                                } else {
                                                                                                                                                                                    str2 = str;
                                                                                                                                                                                    i = 2131363432;
                                                                                                                                                                                }
                                                                                                                                                                            } else {
                                                                                                                                                                                str2 = str;
                                                                                                                                                                                i = 2131363426;
                                                                                                                                                                            }
                                                                                                                                                                        } else {
                                                                                                                                                                            str2 = str;
                                                                                                                                                                            i = 2131363379;
                                                                                                                                                                        }
                                                                                                                                                                    } else {
                                                                                                                                                                        i4 = com.clevertap.android.sdk.R.id.title;
                                                                                                                                                                    }
                                                                                                                                                                } else {
                                                                                                                                                                    i4 = 2131363651;
                                                                                                                                                                }
                                                                                                                                                            } else {
                                                                                                                                                                str = "Missing required view with ID: ";
                                                                                                                                                                i4 = 2131363396;
                                                                                                                                                            }
                                                                                                                                                        } else {
                                                                                                                                                            str = "Missing required view with ID: ";
                                                                                                                                                        }
                                                                                                                                                        throw new NullPointerException(str.concat(b24.getResources().getResourceName(i4)));
                                                                                                                                                    }
                                                                                                                                                    i = 2131363319;
                                                                                                                                                }
                                                                                                                                            }
                                                                                                                                        }
                                                                                                                                    }
                                                                                                                                    throw new NullPointerException("Missing required view with ID: ".concat(b20.getResources().getResourceName(i3)));
                                                                                                                                }
                                                                                                                                i = 2131363316;
                                                                                                                            } else {
                                                                                                                                i = 2131363310;
                                                                                                                            }
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                        throw new NullPointerException("Missing required view with ID: ".concat(b15.getResources().getResourceName(i2)));
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        throw new NullPointerException(str2.concat(inflate.getResources().getResourceName(i)));
    }

    public final void J1(final QuoteData quoteData, final View view, int i, String str) {
        do.a.a.c("click_fontData " + quoteData.getFontData(), new Object[0]);
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "NAME", str, null, 0, null, 1008);
        int nameResizeBy = quoteData.getNameResizeBy();
        int originalNameSize = (int) quoteData.getOriginalNameSize();
        Function1 function1 = new Function1() {
            public final Object invoke(Object obj) {
                int intValue = ((Integer) obj).intValue();
                boolean z = D7.Q4;
                View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                QuoteData quoteData2 = quoteData;
                Intrinsics.checkNotNullParameter(quoteData2, "$click");
                QuoteView quoteView = view2 instanceof QuoteView ? (QuoteView) view2 : null;
                if (quoteView != null) {
                    Eb.z0.j0(quoteView, "RESIZE_NAME", false);
                }
                d7.r2().B(String.valueOf(intValue), "PROFILE_NAME_SIZE_PREFERENCE");
                dl.g.b(androidx.lifecycle.J.a(d7), (CoroutineContext) null, (dl.J) null, d7.new C1618k(quoteData2, intValue, null), 3);
                return Unit.a;
            }
        };
        Function1 function12 = new Function1() {
            public final Object invoke(Object obj) {
                int intValue = ((Integer) obj).intValue();
                boolean z = D7.Q4;
                QuoteData quoteData2 = quoteData;
                Intrinsics.checkNotNullParameter(quoteData2, "$click");
                View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                quoteData2.setNameResizeBy(intValue);
                QuoteView quoteView = view2 instanceof QuoteView ? (QuoteView) view2 : null;
                if (quoteView != null) {
                    Eb.z0.r0(quoteData2, quoteView);
                }
                return Unit.a;
            }
        };
        Function1 function13 = new Function1() {
            public final Object invoke(Object obj) {
                ((Integer) obj).intValue();
                boolean z = D7.Q4;
                View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                QuoteData quoteData2 = quoteData;
                Intrinsics.checkNotNullParameter(quoteData2, "$click");
                QuoteView quoteView = view2 instanceof QuoteView ? (QuoteView) view2 : null;
                if (quoteView != null) {
                    Eb.z0.j0(quoteView, "RESIZE_NAME", false);
                }
                Context context = view2.getContext();
                if (context != null) {
                    Eb.D.g(context, d7.e2(), "RESIZE_NAME", new C0752p1(1, view2, quoteData2));
                }
                return Unit.a;
            }
        };
        C1826q4 c1826q4 = new C1826q4(i, view, quoteData, this);
        Function0 function0 = new Function0() {
            public final Object invoke() {
                boolean z = D7.Q4;
                View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                QuoteData quoteData2 = quoteData;
                Intrinsics.checkNotNullParameter(quoteData2, "$click");
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                QuoteView quoteView = view2 instanceof QuoteView ? (QuoteView) view2 : null;
                if (quoteView != null) {
                    Eb.z0.j0(quoteView, "RESIZE_NAME", false);
                }
                HindiEnglishFontObject userNameFonts = quoteData2.getUserNameFonts();
                if (userNameFonts != null) {
                    userNameFonts.setHindiFonts(Ab.u.l);
                }
                HindiEnglishFontObject userNameFonts2 = quoteData2.getUserNameFonts();
                if (userNameFonts2 != null) {
                    userNameFonts2.setEnglishFonts(Ab.u.m);
                }
                quoteData2.setEnableFontsForName(false);
                E7.G g = d7.m3;
                if (g != null) {
                    g.notifyItemChanged(d7.y2);
                }
                return Unit.a;
            }
        };
        Intrinsics.checkNotNullParameter("RESIZE_NAME", Constants.KEY_TYPE);
        Intrinsics.checkNotNullParameter(quoteData, "quoteData");
        Intrinsics.checkNotNullParameter(function1, "onDone");
        Intrinsics.checkNotNullParameter(function12, "onPreview");
        Intrinsics.checkNotNullParameter(function13, "onRemove");
        Intrinsics.checkNotNullParameter(c1826q4, "onChangePhoto");
        Intrinsics.checkNotNullParameter(function0, "onFontReset");
        new N7.s("RESIZE_NAME", nameResizeBy, originalNameSize, quoteData, function1, function12, function13, c1826q4, function0).show(getChildFragmentManager(), "ViewResizeOptionDialog");
    }

    public final boolean J2() {
        int i = Build.VERSION.SDK_INT;
        if (26 <= i && i < 29) {
            this.o2 = false;
            FragmentActivity activity = getActivity();
            if (activity != null) {
                String[] strArr = Hb.I.a;
                if (Hb.I.e(activity, this.f)) {
                    return true;
                }
            }
        }
        return false;
    }

    public final void J3(final int r51, android.view.View r52, com.crafto.android.data.model.QuoteData r53, final com.crafto.android.utility.functional.AppEnums.f r54) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.J3(int, android.view.View, com.crafto.android.data.model.QuoteData, com.crafto.android.utility.functional.AppEnums$f):void");
    }

    public final void K1(final QuoteData quoteData, final View view, String str) {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "PROFILE_PHOTO", str, null, 0, null, 1008);
        int photoResizeBy = quoteData.getPhotoResizeBy();
        int originalPhotoSize = (int) quoteData.getOriginalPhotoSize();
        Function1 function1 = new Function1() {
            public final Object invoke(Object obj) {
                int intValue = ((Integer) obj).intValue();
                boolean z = D7.Q4;
                View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                QuoteView quoteView = view2 instanceof QuoteView ? (QuoteView) view2 : null;
                if (quoteView != null) {
                    Eb.z0.j0(quoteView, "RESIZE_PHOTO", false);
                }
                d7.r2().B(String.valueOf(intValue), "PROFILE_IMAGE_SIZE_PREFERENCE");
                dl.g.b(androidx.lifecycle.J.a(d7), (CoroutineContext) null, (dl.J) null, new C1895w8(d7, intValue, null), 3);
                return Unit.a;
            }
        };
        Eb.g gVar = new Eb.g(1, quoteData, view);
        J8.W w = new J8.W(1, quoteData, view, this);
        J8.X x = new J8.X(view, this, quoteData, 1);
        Function0 function0 = new Function0() {
            public final Object invoke() {
                boolean z = D7.Q4;
                View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                QuoteData quoteData2 = quoteData;
                Intrinsics.checkNotNullParameter(quoteData2, "$click");
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                QuoteView quoteView = view2 instanceof QuoteView ? (QuoteView) view2 : null;
                if (quoteView != null) {
                    Eb.z0.j0(quoteView, "RESIZE_NAME", false);
                }
                HindiEnglishFontObject userNameFonts = quoteData2.getUserNameFonts();
                if (userNameFonts != null) {
                    userNameFonts.setHindiFonts(Ab.u.l);
                }
                HindiEnglishFontObject userNameFonts2 = quoteData2.getUserNameFonts();
                if (userNameFonts2 != null) {
                    userNameFonts2.setEnglishFonts(Ab.u.m);
                }
                quoteData2.setEnableFontsForName(false);
                E7.G g = d7.m3;
                if (g != null) {
                    g.notifyItemChanged(d7.y2);
                }
                return Unit.a;
            }
        };
        Intrinsics.checkNotNullParameter("RESIZE_PHOTO", Constants.KEY_TYPE);
        Intrinsics.checkNotNullParameter(quoteData, "quoteData");
        Intrinsics.checkNotNullParameter(function1, "onDone");
        Intrinsics.checkNotNullParameter(gVar, "onPreview");
        Intrinsics.checkNotNullParameter(w, "onRemove");
        Intrinsics.checkNotNullParameter(x, "onChangePhoto");
        Intrinsics.checkNotNullParameter(function0, "onFontReset");
        new N7.s("RESIZE_PHOTO", photoResizeBy, originalPhotoSize, quoteData, function1, gVar, w, x, function0).show(getChildFragmentManager(), "ViewResizeOptionDialog");
    }

    public final void K2() {
        x0(new Aa.d(this, 2));
    }

    public final void K3(QuoteData quoteData, AppEnums.f fVar) {
        c4();
        String dynamicImageUri = quoteData != null ? quoteData.getDynamicImageUri() : null;
        a.a aVar = do.a.a;
        aVar.c(C1.e.a("shareDownloadGif renderedVideoUri ", dynamicImageUri), new Object[0]);
        if (dynamicImageUri == null) {
            W();
            return;
        }
        String str = kotlin.ranges.d.i(Xk.c.a, new IntRange(1, 10, 1)) + ".gif";
        String url = quoteData.getUrl();
        if (url != null) {
            String substring = url.substring(Math.max(0, url.length() - 20));
            Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
            str = kotlin.text.p.l(substring, "/", "") + ".gif";
        }
        aVar.c(C1.e.a("fileName ", str), new Object[0]);
        try {
            File file = new File(Eb.E.a(this).getCacheDir(), "videos");
            file.mkdirs();
            FileOutputStream fileOutputStream = new FileOutputStream(file + '/' + str);
            FileInputStream fileInputStream = new FileInputStream(dynamicImageUri);
            byte[] bArr = new byte[1024];
            while (true) {
                int read = fileInputStream.read(bArr);
                if (read == -1) {
                    fileInputStream.close();
                    fileOutputStream.flush();
                    fileOutputStream.close();
                    dl.g.b(androidx.lifecycle.J.a(this), (CoroutineContext) null, (dl.J) null, new C1681da(null, FileProvider.d(Eb.E.a(this), "com.crafto.android.fileprovider", new File(new File(Eb.E.a(this).getCacheDir(), "videos"), str)), quoteData, this, fVar, dynamicImageUri), 3);
                    return;
                }
                fileOutputStream.write(bArr, 0, read);
            }
        } catch (Exception e) {
            W();
            do.a.a.e(e);
            Unit unit = Unit.a;
        }
    }

    public final void L1(final int i, final View view, final QuoteData quoteData) {
        J8.B b = new J8.B(quoteData, this, view, 1);
        ?? r5 = new Function0() {
            public final Object invoke() {
                boolean z = D7.Q4;
                final View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                final D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                final QuoteData quoteData2 = quoteData;
                Intrinsics.checkNotNullParameter(quoteData2, "$click");
                Context context = view2.getContext();
                if (context != null) {
                    final int i2 = i;
                    Eb.D.g(context, (PreferencesHelper) null, (String) null, new Function0() {
                        public final Object invoke() {
                            ConstraintLayout constraintLayout;
                            boolean z2 = D7.Q4;
                            D7 d72 = d7;
                            Intrinsics.checkNotNullParameter(d72, "this$0");
                            QuoteData quoteData3 = quoteData2;
                            Intrinsics.checkNotNullParameter(quoteData3, "$click");
                            View view3 = view2;
                            Intrinsics.checkNotNullParameter(view3, "$view");
                            E7.G g = d72.m3;
                            RecyclerView.D f = g != null ? g.f(i2) : null;
                            C0323j1 c0323j1 = f instanceof C0323j1 ? (C0323j1) f : null;
                            if (c0323j1 != null) {
                                Xd xd = c0323j1.k;
                                if (xd != null && (constraintLayout = xd.i) != null) {
                                    Eb.X0.l(constraintLayout);
                                }
                                c0323j1.l0(quoteData3, view3 instanceof QuoteView ? (QuoteView) view3 : null);
                            }
                            d72.k3();
                            d72.r2().B("false", "BUSINESS_PRODUCT_PHOTO");
                            return Unit.a;
                        }
                    });
                }
                return Unit.a;
            }
        };
        Intrinsics.checkNotNullParameter(b, "editPhoto");
        Intrinsics.checkNotNullParameter((Object) r5, "removePhoto");
        new C0167v(b, r5).show(getChildFragmentManager(), "EditOrRemovePhotoDialogFragment");
        String type = quoteData.getType();
        String url = quoteData.getUrl();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Content Type", quoteData.getContentType());
        Pair pair3 = new Pair("Click Location", "Edit Product Photo Button");
        Pair pair4 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Edit Product Photo", "Home Screen", name, url, type, i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false))}), 416);
    }

    public final void L2(final int i, final View view, final QuoteData quoteData) {
        x0(new Function0() {
            public final Object invoke() {
                boolean z = D7.Q4;
                final D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                final QuoteData quoteData2 = quoteData;
                Intrinsics.checkNotNullParameter(quoteData2, "$click");
                PopupMenu popupMenu = new PopupMenu(new ContextThemeWrapper(d7.getContext(), 2132084193), view2);
                popupMenu.getMenuInflater().inflate(2131689481, popupMenu.getMenu());
                final Ref.ObjectRef objectRef = new Ref.ObjectRef();
                objectRef.element = "";
                final int i2 = i;
                popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
                    @Override
                    public final boolean onMenuItemClick(final MenuItem menuItem) {
                        boolean z2 = D7.Q4;
                        final D7 d72 = D7.this;
                        Intrinsics.checkNotNullParameter(d72, "this$0");
                        final Ref.ObjectRef objectRef2 = objectRef;
                        Intrinsics.checkNotNullParameter(objectRef2, "$reportType");
                        final QuoteData quoteData3 = quoteData2;
                        Intrinsics.checkNotNullParameter(quoteData3, "$click");
                        final int i3 = i2;
                        d72.x0(new Function0() {
                            public final Object invoke() {
                                boolean z3 = D7.Q4;
                                Ref.ObjectRef objectRef3 = objectRef2;
                                Intrinsics.checkNotNullParameter(objectRef3, "$reportType");
                                final D7 d73 = d72;
                                Intrinsics.checkNotNullParameter(d73, "this$0");
                                final QuoteData quoteData4 = quoteData3;
                                Intrinsics.checkNotNullParameter(quoteData4, "$click");
                                MenuItem menuItem2 = menuItem;
                                switch (menuItem2.getItemId()) {
                                    case 2131364279:
                                        objectRef3.element = "CONTENT";
                                        break;
                                    case 2131364280:
                                        objectRef3.element = "USER";
                                        break;
                                }
                                String str = (String) objectRef3.element;
                                FragmentActivity activity = d73.getActivity();
                                if (activity != null) {
                                    Function2<? super String, ? super String, Unit> function2 = new Function2() {
                                        public final Object invoke(Object obj, Object obj2) {
                                            int i4 = 3;
                                            QuoteData quoteData5 = quoteData4;
                                            String str2 = (String) obj;
                                            String str3 = (String) obj2;
                                            boolean z4 = D7.Q4;
                                            final D7 d74 = D7.this;
                                            Intrinsics.checkNotNullParameter(d74, "this$0");
                                            Intrinsics.checkNotNullParameter(str2, "reason");
                                            Intrinsics.checkNotNullParameter(str3, Constants.KEY_TYPE);
                                            try {
                                                do.a.a.c("onSubmitClick " + str2, new Object[0]);
                                                User user = d74.t;
                                                if (user != null && (!StringsKt.J(str2))) {
                                                    Gb.f.a(d74.r2().t(user.getSlug(), quoteData5, str2, str3), new C0138j0(d74, i4), new Function2() {
                                                        public final Object invoke(Object obj3, Object obj4) {
                                                            Throwable th = (Throwable) obj3;
                                                            boolean z5 = D7.Q4;
                                                            D7 d75 = D7.this;
                                                            Intrinsics.checkNotNullParameter(d75, "this$0");
                                                            Intrinsics.checkNotNullParameter(th, "throwable");
                                                            Intrinsics.checkNotNullParameter((Db.a) obj4, "failure");
                                                            do.a.a.f(th, "reportContent error", new Object[0]);
                                                            d75.F0(2132019407);
                                                            return Unit.a;
                                                        }
                                                    }, false, 12);
                                                    com.crafto.android.ui.base.a.f0(d74, "Report", "Home Screen", null, str2, "Submit", 0, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", quoteData5 != null ? Integer.valueOf(quoteData5.getDesign()) : null), new Pair("Content Type", quoteData5 != null ? quoteData5.getContentType() : null), new Pair("Content Format", quoteData5 != null ? quoteData5.getContentFormat() : null), new Pair("Source", quoteData5 != null ? quoteData5.getUrl() : null), new Pair("Quote Id", quoteData5 != null ? quoteData5.getIdentifier() : null)}), 484);
                                                }
                                            } catch (Exception e) {
                                                do.a.a.e(e);
                                            }
                                            return Unit.a;
                                        }
                                    };
                                    Intrinsics.checkNotNullParameter(activity, "activity");
                                    Intrinsics.checkNotNullParameter("Home Screen", "screenName");
                                    Intrinsics.checkNotNullParameter(str, Constants.KEY_TYPE);
                                    Intrinsics.checkNotNullParameter(function2, "onSubmitClick");
                                    V8.a aVar = new V8.a(activity);
                                    aVar.a = activity;
                                    aVar.b = "Home Screen";
                                    aVar.c = str;
                                    aVar.d = function2;
                                    aVar.setCancelable(true);
                                    aVar.show();
                                }
                                CharSequence title = menuItem2.getTitle();
                                com.crafto.android.ui.base.a.f0(d73, "Report", "Home Screen", null, title != null ? title.toString() : null, "Landed", i3, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", Integer.valueOf(quoteData4.getDesign())), new Pair("Content Type", quoteData4.getContentType()), new Pair("Content Format", quoteData4.getContentFormat()), new Pair("Source", quoteData4.getUrl()), new Pair("Quote Id", quoteData4.getIdentifier())}), 420);
                                return Unit.a;
                            }
                        });
                        return true;
                    }
                });
                com.crafto.android.ui.base.a.f0(d7, "Report", "Home Screen", null, quoteData2.getUrl(), null, i2, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", Integer.valueOf(quoteData2.getDesign())), new Pair("Content Type", quoteData2.getContentType()), new Pair("Content Format", quoteData2.getContentFormat()), new Pair("Source", quoteData2.getUrl()), new Pair("Quote Id", quoteData2.getIdentifier())}), 436);
                popupMenu.show();
                return Unit.a;
            }
        });
    }

    public final void L3(QuoteData quoteData, AppEnums.f fVar) {
        String url;
        c4();
        String videoUri = quoteData != null ? quoteData.getVideoUri() : null;
        a.a aVar = do.a.a;
        aVar.c(C1.e.a("downloadVideo renderedVideoUri ", videoUri), new Object[0]);
        if (videoUri != null) {
            String str = kotlin.ranges.d.i(Xk.c.a, new IntRange(1, 10, 1)) + ".mp4";
            String url2 = quoteData.getUrl();
            if (url2 != null) {
                String substring = url2.substring(Math.max(0, url2.length() - 20));
                Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
                str = kotlin.text.p.l(substring, "/", "") + ".mp4";
            }
            aVar.c(C1.e.a("fileName ", str), new Object[0]);
            try {
                File file = new File(Eb.E.a(this).getCacheDir(), "videos");
                file.mkdirs();
                FileOutputStream fileOutputStream = new FileOutputStream(file + '/' + str);
                FileInputStream fileInputStream = new FileInputStream(videoUri);
                byte[] bArr = new byte[1024];
                while (true) {
                    int read = fileInputStream.read(bArr);
                    if (read == -1) {
                        fileInputStream.close();
                        fileOutputStream.flush();
                        fileOutputStream.close();
                        dl.g.b(androidx.lifecycle.J.a(this), (CoroutineContext) null, (dl.J) null, new C1693ea(null, FileProvider.d(Eb.E.a(this), "com.crafto.android.fileprovider", new File(new File(Eb.E.a(this).getCacheDir(), "videos"), str)), quoteData, this, fVar, videoUri), 3);
                        return;
                    }
                    fileOutputStream.write(bArr, 0, read);
                }
            } catch (Exception e) {
                W();
                do.a.a.e(e);
                Unit unit = Unit.a;
            }
        } else {
            if ((quoteData != null ? quoteData.getFfmpegImageUri() : null) == null) {
                W();
                return;
            }
            String ffmpegImageUri = quoteData != null ? quoteData.getFfmpegImageUri() : null;
            if (ffmpegImageUri == null) {
                W();
                return;
            }
            String str2 = kotlin.ranges.d.i(Xk.c.a, new IntRange(1, 10, 1)) + ".jpeg";
            if (quoteData != null && (url = quoteData.getUrl()) != null) {
                String substring2 = url.substring(Math.max(0, url.length() - 20));
                Intrinsics.checkNotNullExpressionValue(substring2, "substring(...)");
                str2 = kotlin.text.p.l(substring2, "/", "") + ".jpeg";
            }
            aVar.c(C1.e.a("fileName ", str2), new Object[0]);
            try {
                File file2 = new File(Eb.E.a(this).getCacheDir(), "images");
                file2.mkdirs();
                FileOutputStream fileOutputStream2 = new FileOutputStream(file2 + '/' + str2);
                FileInputStream fileInputStream2 = new FileInputStream(ffmpegImageUri);
                byte[] bArr2 = new byte[1024];
                while (true) {
                    int read2 = fileInputStream2.read(bArr2);
                    if (read2 == -1) {
                        fileInputStream2.close();
                        fileOutputStream2.flush();
                        fileOutputStream2.close();
                        dl.g.b(androidx.lifecycle.J.a(this), (CoroutineContext) null, (dl.J) null, new L9(null, FileProvider.d(Eb.E.a(this), "com.crafto.android.fileprovider", new File(new File(Eb.E.a(this).getCacheDir(), "images"), str2)), quoteData, this, fVar, ffmpegImageUri), 3);
                        return;
                    }
                    fileOutputStream2.write(bArr2, 0, read2);
                }
            } catch (Exception e2) {
                W();
                do.a.a.e(e2);
                Unit unit2 = Unit.a;
            }
        }
    }

    public final void M1() {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, null, "Edit Quotes Design", 0, null, 1004);
    }

    public final void M2() {
        UserAdditionalData userPersonalData;
        UserAdditionalData userPersonalData2;
        try {
            do.a.a.c("onRefresh", new Object[0]);
            QuotesCategory quotesCategory = this.S3;
            if (Intrinsics.areEqual(quotesCategory != null ? quotesCategory.getValue() : null, a.e.d)) {
                H3(true);
            } else {
                H3(false);
                c4();
            }
            User user = this.W2;
            if (user != null && (userPersonalData2 = user.getUserPersonalData()) != null) {
                userPersonalData2.setGreeteePhotoUrl(null);
            }
            User user2 = this.W2;
            if (user2 != null && (userPersonalData = user2.getUserPersonalData()) != null) {
                userPersonalData.setBirthdayUserName(null);
            }
            E7.G g = this.m3;
            if (g != null) {
                g.g(null);
            }
            r2().p.setValue((Object) null);
            r2().l = false;
            this.j3 = true;
            this.k3 = true;
            this.x1 = null;
            this.y1 = null;
            C2();
            new Handler(Looper.getMainLooper()).post(new Runnable() {
                @Override
                public final void run() {
                    boolean z = D7.Q4;
                    D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    d7.x0(new Oa.C(d7, 1));
                }
            });
            if (V4) {
                p2(this, e2().E(), Boolean.TRUE, null, 4);
                V4 = false;
            }
            a2(this, Boolean.TRUE, false, 2);
            this.z2 = null;
            if (Build.VERSION.SDK_INT >= 24) {
                FFmpegKitConfig.nativeFFmpegCancel(0L);
            }
        } catch (Exception e) {
            do.a.a.e(e);
        }
    }

    public final void M3(final QuoteData quoteData, final AppEnums.f fVar, boolean z, final Function1<? super String, Unit> function1) {
        TextView textView;
        RelativeLayout relativeLayout;
        ProgressBar progressBar;
        if (z) {
            C3053c2 c3053c2 = (C3053c2) this.y;
            if (c3053c2 != null && (progressBar = c3053c2.v2) != null) {
                progressBar.setIndeterminate(false);
            }
            C3053c2 c3053c22 = (C3053c2) this.y;
            if (c3053c22 != null && (relativeLayout = c3053c22.x2) != null) {
                Eb.X0.V(relativeLayout);
            }
            C3053c2 c3053c23 = (C3053c2) this.y;
            if (c3053c23 != null && (textView = c3053c23.w2) != null) {
                textView.setText(getString(2132018463));
            }
        }
        File file = new File(Eb.E.a(this).getCacheDir(), c0.c.b(new StringBuilder(), ".mp4"));
        String videoUrl = quoteData.getVideoUrl();
        final String absolutePath = file.getAbsolutePath();
        String c = P2.k.c(new StringBuilder("-i "), videoUrl != null ? kotlin.text.p.l(videoUrl, " ", "%20") : null, " -c:v libx264 -preset ultrafast -c:a copy ", absolutePath);
        do.a.a.c(C1.e.a("executableCommand ", c), new Object[0]);
        N5.c.a(c, new N5.e() {
            public final void b(N5.d dVar) {
                boolean z2 = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                QuoteData quoteData2 = quoteData;
                Intrinsics.checkNotNullParameter(quoteData2, "$click");
                androidx.lifecycle.E a = androidx.lifecycle.J.a(d7);
                kl.c cVar = dl.Z.a;
                dl.g.b(a, il.p.a, (dl.J) null, d7.new S(dVar, absolutePath, quoteData2, fVar, function1, null), 2);
            }
        });
    }

    @Override
    public final void N() {
        Boolean paidContentRedirection;
        UserConfigData e;
        Boolean paidContentRedirection2;
        PostPaymentData t;
        Boolean isPaymentDone;
        C3053c2 c3053c2;
        ChipGroup chipGroup;
        String str;
        String str2;
        String name;
        CharSequence text;
        String obj;
        Integer countryId;
        User E2 = e2().E();
        int i = 1;
        if (E2 != null && E2.isUserPremium()) {
            do.a.a.c("setSelectedImages_", new Object[0]);
            x0(new Ga.T2(i, E2, this));
            e2().r0(E2);
        }
        C2();
        r2().getClass();
        String str3 = C1808p1.i3;
        if (!this.S2) {
            C1808p1 r2 = r2();
            r2.getClass();
            HashMap<String, Object> hashMap = new HashMap<>();
            PreferencesHelper preferencesHelper = r2.c;
            User E3 = preferencesHelper.E();
            SharedPreferences sharedPreferences = preferencesHelper.a;
            String str4 = preferencesHelper.d;
            Ab.H h = r2.e;
            if (E3 != null && (countryId = E3.getCountryId()) != null) {
                hashMap.put(h.S0, Integer.valueOf(countryId.intValue()));
            }
            Pair pair = (Pair) r2.k2.getValue();
            if (pair != null) {
                String str5 = (String) pair.a;
                if (str5 != null) {
                    hashMap.put(h.y, str5);
                }
                String str6 = (String) pair.b;
                if (str6 != null) {
                    hashMap.put(h.w, str6);
                }
            }
            try {
                TimeZone timeZone = TimeZone.getDefault();
                String str7 = timeZone.getDisplayName(true, 0).toString();
                hashMap.put(h.L1, str7);
                hashMap.put(h.M1, timeZone.getID());
                if (!sharedPreferences.getBoolean(str4, false)) {
                    try {
                        Bb.j jVar = r2.k;
                        if (jVar != null) {
                            jVar.m(kotlin.collections.Q.f(new Pair[]{new Pair("Time Zone Time", str7), new Pair("Time Zone Area", timeZone.getID())}));
                        }
                        sharedPreferences.edit().putBoolean(str4, true).apply();
                    } catch (Exception unused) {
                    }
                }
            } catch (Exception e2) {
                do.a.a.e(e2);
            }
            Gb.f<MetaObject<QuotesCategoryObject>> quotesCategory = r2.a.getQuotesCategory(hashMap);
            UserConfigData e3 = preferencesHelper.e();
            Gb.f.a(quotesCategory, new L8.l1(r2, i), new C1636a1(), e3 != null ? Intrinsics.areEqual(e3.isRetryApiEligible(), Boolean.TRUE) : false, 4);
        }
        a.a aVar = do.a.a;
        aVar.c(C1.e.a("redirectionCategory__1 ", str3), new Object[0]);
        if (str3 == null || StringsKt.J(str3)) {
            aVar.c(C1.e.a("redirectionCategory__2 ", str3), new Object[0]);
            UserConfigData e4 = e2().e();
            if (e4 == null || (paidContentRedirection = e4.getPaidContentRedirection()) == null) {
                aVar.c(C1.e.a("redirectionCategory__9 ", str3), new Object[0]);
                a2(this, null, false, 3);
            } else {
                boolean booleanValue = paidContentRedirection.booleanValue();
                aVar.c("redirectionCategory__3 " + str3 + " flag " + booleanValue, new Object[0]);
                if (booleanValue) {
                    aVar.c("redirectionCategory__7 " + str3 + " flag " + booleanValue, new Object[0]);
                    PostPaymentData t2 = e2().t();
                    if (t2 == null || !Intrinsics.areEqual(t2.isPaymentDone(), Boolean.FALSE)) {
                        aVar.c("redirectionCategory__6 " + str3 + " flag " + booleanValue, new Object[0]);
                        a2(this, null, true, 1);
                    } else {
                        aVar.c("redirectionCategory__5 " + str3 + " flag " + booleanValue, new Object[0]);
                        a2(this, null, false, 3);
                    }
                } else {
                    aVar.c("redirectionCategory__4 " + str3 + " flag " + booleanValue, new Object[0]);
                    a2(this, null, false, 3);
                }
            }
        }
        p2(this, e2().E(), null, "getData", 2);
        dl.g.b(androidx.lifecycle.J.a(this), (CoroutineContext) null, (dl.J) null, new C1620m(null), 3);
        if (!this.S2 || (e = e2().e()) == null || (paidContentRedirection2 = e.getPaidContentRedirection()) == null || !paidContentRedirection2.booleanValue() || (t = e2().t()) == null || (isPaymentDone = t.isPaymentDone()) == null || !isPaymentDone.booleanValue() || (c3053c2 = (C3053c2) this.y) == null || (chipGroup = c3053c2.h) == null) {
            return;
        }
        int childCount = chipGroup.getChildCount();
        for (int i2 = 0; i2 < childCount; i2++) {
            Chip a = W1.h0.a(chipGroup, i2);
            Chip chip = a instanceof Chip ? a : null;
            if (chip == null || (text = chip.getText()) == null || (obj = text.toString()) == null) {
                str = null;
            } else {
                str = obj.toLowerCase(Locale.ROOT);
                Intrinsics.checkNotNullExpressionValue(str, "toLowerCase(...)");
            }
            QuotesCategory category = t.getCategory();
            if (category == null || (name = category.getName()) == null) {
                str2 = null;
            } else {
                str2 = name.toLowerCase(Locale.ROOT);
                Intrinsics.checkNotNullExpressionValue(str2, "toLowerCase(...)");
            }
            if (Intrinsics.areEqual(str, str2)) {
                PostPaymentData t3 = e2().t();
                if (t3 != null) {
                    t3.setCategoryClicked(Boolean.TRUE);
                }
                e2().i0(t3, false);
                W1.h0.a(chipGroup, i2).performClick();
                return;
            }
        }
    }

    public final void N1() {
        ViewPager2 viewPager2;
        ViewPager2 viewPager22;
        a.a aVar = do.a.a;
        aVar.c("enableSwipe", new Object[0]);
        VB vb = this.y;
        C3053c2 c3053c2 = (C3053c2) vb;
        if (c3053c2 == null || (viewPager2 = c3053c2.k2) == null || viewPager2.r) {
            aVar.c("nothing", new Object[0]);
            return;
        }
        C3053c2 c3053c22 = (C3053c2) vb;
        if (c3053c22 == null || (viewPager22 = c3053c22.k2) == null) {
            return;
        }
        viewPager22.setUserInputEnabled(true);
    }

    public final void N2(Tag tag) {
        AppCompatEditText appCompatEditText;
        String tagTitle = tag.getTagTitle();
        if (tagTitle != null) {
            C1808p1.v(r2(), tagTitle);
            e4(tagTitle, "search");
            com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, tagTitle, "Search", 0, null, 996);
        }
        Q().b(new KinesisData(e2().E(), tag, "SEARCH", y0()));
        C3053c2 c3053c2 = (C3053c2) this.y;
        if (c3053c2 != null && (appCompatEditText = c3053c2.n) != null) {
            Editable.Factory factory = Editable.Factory.getInstance();
            Eb.I0.c(StringCompanionObject.INSTANCE);
            appCompatEditText.setText(factory.newEditable(""));
        }
        Hb.p0 s2 = s2();
        AppCompatActivity a = Eb.E.a(this);
        s2.getClass();
        Hb.p0.c(a);
    }

    public final void N3(int i, final View view, final QuoteData quoteData) {
        com.crafto.android.ui.base.a.f0(this, "Click Action", y0(), null, null, "Without Photo", 0, null, 1004);
        if (!quoteData.isVideoWithImage() && !Intrinsics.areEqual(quoteData.getContentType(), "ANNIVERSARY_VIDEO_WITH_IMAGE") && !Intrinsics.areEqual(quoteData.getContentType(), "ADD_USER_PHOTO_VIDEO") && !Intrinsics.areEqual(quoteData.getContentType(), "VIDEO_FRAME")) {
            F2(this, true, quoteData.getChipTag(), quoteData, view, null, null, null, false, null, null, true, true, null, 10224);
        } else if (quoteData.getVideoUrl() != null) {
            D1(this, i, quoteData, null, null, new Function1() {
                public final Object invoke(Object obj) {
                    String str = (String) obj;
                    boolean z = D7.Q4;
                    QuoteData quoteData2 = quoteData;
                    Intrinsics.checkNotNullParameter(quoteData2, "$click");
                    D7 d7 = this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    View view2 = view;
                    Intrinsics.checkNotNullParameter(view2, "$view");
                    Intrinsics.checkNotNullParameter(str, "premiumUri");
                    Integer chipTag = quoteData2.getChipTag();
                    String videoUrlNonPremium = quoteData2.getVideoUrlNonPremium();
                    if (videoUrlNonPremium == null) {
                        videoUrlNonPremium = quoteData2.getVideoUrl();
                    }
                    D7.F2(d7, true, chipTag, QuoteData.copy$default(quoteData2, null, null, null, null, null, null, null, null, 0, null, null, false, null, null, null, null, false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, false, false, false, null, null, null, false, null, null, null, null, null, null, 0.0f, null, null, null, null, null, null, videoUrlNonPremium, null, false, false, false, false, false, false, false, false, 0, 0, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, null, null, null, null, false, null, false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, false, false, null, null, null, null, false, false, false, false, false, false, false, null, null, null, false, null, null, null, null, null, null, null, null, str, null, null, null, 0, null, null, null, false, null, false, null, null, null, null, null, false, false, false, false, false, null, 0, null, null, null, null, null, 0.0d, false, null, null, null, null, null, null, false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, null, null, false, false, false, false, null, null, false, null, null, null, null, null, false, null, null, false, null, null, null, null, null, false, null, null, null, null, null, null, null, null, 0.0f, null, false, null, null, null, null, false, false, 0L, null, -1, -1, -129, -1, -67108865, -1, -1, 65535, null), view2, null, null, null, false, null, null, true, true, new Qb.e(d7, 1), 2032);
                    return Unit.a;
                }
            }, 8);
        } else {
            F2(this, true, quoteData.getChipTag(), quoteData, view, null, null, null, false, null, null, false, true, new D4(this, 0), 4080);
        }
    }

    public final void O1(int i, QuoteData quoteData) {
        if (this.k3) {
            this.k3 = false;
            String type = quoteData.getType();
            String upperCase = a.e.H1.toUpperCase(Locale.ROOT);
            Intrinsics.checkNotNullExpressionValue(upperCase, "toUpperCase(...)");
            QuotesCategory quotesCategory = r2().m;
            com.crafto.android.ui.base.a.f0(this, "Content Load", "Home Screen", quotesCategory != null ? quotesCategory.getName() : null, type, upperCase, i, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", Integer.valueOf(quoteData.getDesign())), new Pair("Content Type", quoteData.getContentType()), new Pair("Content Format", quoteData.getContentFormat()), new Pair("Time Taken", quoteData.getTimeToLoadVideo()), new Pair("Source", quoteData.getUrl())}), 416);
        }
    }

    public final void O3(final int i, String str) {
        Hb.C X1 = X1();
        FragmentManager childFragmentManager = getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        G7.k kVar = new G7.k(this, 3);
        Function0<Unit> function0 = new Function0() {
            public final Object invoke() {
                ArrayList<I7.m> arrayList;
                I7.m mVar;
                Widget widget;
                boolean z = D7.Q4;
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                E7.G g = d7.m3;
                int i2 = i;
                if (g != null && (arrayList = g.l) != null && (mVar = arrayList.get(i2)) != null) {
                    InitData initData = mVar instanceof InitData ? (InitData) mVar : null;
                    I7.m data = (initData == null || (widget = initData.getWidget()) == null) ? null : widget.getData();
                    r3 = data instanceof QuoteData ? (QuoteData) data : null;
                    if (r3 != null) {
                        r3.setShowGreetingView(false);
                    }
                    r3 = Unit.a;
                }
                E7.G g2 = d7.m3;
                if (g2 != null) {
                    g2.notifyItemChanged(i2, r3);
                }
                return Unit.a;
            }
        };
        X1.getClass();
        Intrinsics.checkNotNullParameter(childFragmentManager, "childFragmentManager");
        Intrinsics.checkNotNullParameter(str, "greetingText");
        Intrinsics.checkNotNullParameter(kVar, "onTextChange");
        Intrinsics.checkNotNullParameter(function0, "onRemoveGreeting");
        Intrinsics.checkNotNullParameter(str, "greetingText");
        Intrinsics.checkNotNullParameter(kVar, "onTextChange");
        Intrinsics.checkNotNullParameter(function0, "onRemoveGreeting");
        C2811f c2811f = new C2811f();
        c2811f.m = kVar;
        c2811f.n = function0;
        Bundle bundle = new Bundle();
        bundle.putString("selectedGreeting", str);
        c2811f.setArguments(bundle);
        c2811f.show(childFragmentManager, "Add Greeting Text Dialog");
    }

    public final void P0(QuoteData quoteData, int i, String str) {
        this.V2 = quoteData;
        if (str == null) {
            str = "Edit Name";
        }
        String str2 = str;
        User user = this.t;
        String slug = user != null ? user.getSlug() : null;
        Intrinsics.checkNotNullParameter(str2, Constants.KEY_TYPE);
        new C0155p(str2, slug, null, null, null, null).show(getChildFragmentManager(), "EditOrRemoveNameDialogFragment");
        String url = quoteData.getUrl();
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Slot", quoteData.getSlot());
        Pair pair3 = new Pair("Content Type", quoteData.getContentType());
        Pair pair4 = new Pair("Content Format", quoteData.getContentFormat());
        User user2 = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "Edit Name Button", url, "Edit Name", i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, new Pair("Crafto Premium State", Boolean.valueOf(user2 != null ? user2.isUserPremium() : false))}), 416);
    }

    @NotNull
    public final Bb.j P1() {
        Bb.j jVar = this.C3;
        if (jVar != null) {
            return jVar;
        }
        Intrinsics.throwUninitializedPropertyAccessException("analyticsUtil");
        return null;
    }

    public final void P2() {
        if (isAdded()) {
            PreferencesHelper e2 = e2();
            if (e2.a.getBoolean(e2.c, false)) {
                do.a.a.c("Open AppRatingBottomSheet Already rated", new Object[0]);
                return;
            }
            do.a.a.c("Open AppRatingBottomSheet", new Object[0]);
            UserConfigData e = e2().e();
            final boolean showPlayStoreInAppRating = e != null ? e.getShowPlayStoreInAppRating() : false;
            UserConfigData e3 = e2().e();
            boolean showInAppRating = e3 != null ? e3.getShowInAppRating() : false;
            if (showInAppRating) {
                x0(new Function0(this) {
                    public final D7 b;
                    public final String c = null;

                    {
                        this.b = this;
                    }

                    public final Object invoke() {
                        boolean z = D7.Q4;
                        final D7 d7 = this.b;
                        Intrinsics.checkNotNullParameter(d7, "this$0");
                        do.a.a.c("showInAppRatingBottomSheet", new Object[0]);
                        Function3<? super Integer, ? super Boolean, ? super Boolean, Unit> function3 = new Function3() {
                            public final Object invoke(Object obj, Object obj2, Object obj3) {
                                FragmentActivity activity;
                                final int intValue = ((Integer) obj).intValue();
                                boolean booleanValue = ((Boolean) obj2).booleanValue();
                                boolean booleanValue2 = ((Boolean) obj3).booleanValue();
                                boolean z2 = D7.Q4;
                                final D7 d72 = D7.this;
                                Intrinsics.checkNotNullParameter(d72, "this$0");
                                if (d72.W2 != null) {
                                    d72.r2().B(!booleanValue ? "dismiss" : String.valueOf(intValue), "PLAYSTORE_RATING");
                                }
                                if (booleanValue2 && (activity = d72.getActivity()) != null) {
                                    Function3<? super String, ? super Boolean, ? super Integer, Unit> function32 = new Function3() {
                                        public final Object invoke(Object obj4, Object obj5, Object obj6) {
                                            int i = intValue;
                                            String str = (String) obj4;
                                            boolean booleanValue3 = ((Boolean) obj5).booleanValue();
                                            boolean z3 = D7.Q4;
                                            D7 d73 = d72;
                                            Intrinsics.checkNotNullParameter(d73, "this$0");
                                            Intrinsics.checkNotNullParameter(str, "feedback");
                                            try {
                                                do.a.a.c("onSubmitClick " + str, new Object[0]);
                                                User user = d73.t;
                                                if (user != null) {
                                                    d73.r2().B(!booleanValue3 ? "dismiss" : String.valueOf(i), "PLAYSTORE_RATING");
                                                    if (!StringsKt.J(str)) {
                                                        d73.r2().s(user, str);
                                                        com.crafto.android.ui.base.a.f0(d73, "In App Feedback", "Home Screen", null, str, "Submit", 0, null, 996);
                                                    }
                                                }
                                            } catch (Exception e4) {
                                                do.a.a.e(e4);
                                            }
                                            return Unit.a;
                                        }
                                    };
                                    Intrinsics.checkNotNullParameter(activity, "activity");
                                    Intrinsics.checkNotNullParameter("Content Detail", "screenName");
                                    Intrinsics.checkNotNullParameter(function32, "onSubmitClick");
                                    D7.n nVar = new D7.n(activity);
                                    nVar.a = activity;
                                    nVar.b = intValue;
                                    nVar.c = "Content Detail";
                                    nVar.d = function32;
                                    nVar.setCancelable(true);
                                    nVar.show();
                                    com.crafto.android.ui.base.a.f0(d72, "In App Feedback", "Home Screen", null, null, "Landed", 0, null, 1004);
                                }
                                return Unit.a;
                            }
                        };
                        Intrinsics.checkNotNullParameter(function3, "openFeedbackDialog");
                        D7.i.r = function3;
                        D7.i.s = showPlayStoreInAppRating;
                        D7.i iVar = new D7.i();
                        Bundle bundle = new Bundle();
                        Ab.H h = d7.E3;
                        Ab.H h2 = null;
                        if (h == null) {
                            Intrinsics.throwUninitializedPropertyAccessException("paramsConstants");
                            h = null;
                        }
                        bundle.putString(h.F1, this.c);
                        Ab.H h3 = d7.E3;
                        if (h3 != null) {
                            h2 = h3;
                        } else {
                            Intrinsics.throwUninitializedPropertyAccessException("paramsConstants");
                        }
                        bundle.putString(h2.E1, "Content Detail");
                        iVar.setArguments(bundle);
                        iVar.show(d7.getChildFragmentManager(), iVar.getTag());
                        return Unit.a;
                    }
                });
            } else {
                com.crafto.android.ui.base.a.f0(this, "In App Rating", y0(), null, String.valueOf(showInAppRating), "blockedByApi", 0, null, 996);
            }
        }
    }

    public final void P3(int i) {
        K2();
        String str = this.i2;
        User user = this.t;
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "Birthday reminder widget", str, "Show Next", i, kotlin.collections.Q.f(new Pair[]{new Pair("Crafto Premium State", user != null ? Boolean.valueOf(user.isUserPremium()) : null)}), 416);
    }

    @NotNull
    public final Hb.c Q1() {
        Hb.c cVar = this.x3;
        if (cVar != null) {
            return cVar;
        }
        Intrinsics.throwUninitializedPropertyAccessException("appUtility");
        return null;
    }

    public final void Q2() {
        dl.g.b(androidx.lifecycle.J.a(this), (CoroutineContext) null, (dl.J) null, new I(null), 3);
    }

    public final void Q3() {
        UserAdditionalData userPersonalData;
        User user = this.W2;
        String birthdayUserName = (user == null || (userPersonalData = user.getUserPersonalData()) == null) ? null : userPersonalData.getBirthdayUserName();
        Hb.C X1 = X1();
        FragmentManager childFragmentManager = getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        J9.H3 h3 = new J9.H3(this, 1);
        Boolean bool = Boolean.FALSE;
        X1.getClass();
        Hb.C.e(childFragmentManager, birthdayUserName, h3, bool);
    }

    @NotNull
    public final com.crafto.android.ui.home.profile.a R1() {
        com.crafto.android.ui.home.profile.a aVar = this.w3;
        if (aVar != null) {
            return aVar;
        }
        Intrinsics.throwUninitializedPropertyAccessException("bgRemover");
        return null;
    }

    public final void R2(int i, QuoteData quoteData) {
        this.G4 = true;
        r2().I = (quoteData.getDesign() == 703 && Intrinsics.areEqual(quoteData.getContentType(), "VIDEO_FRAME")) ? this.I2 : quoteData.isFilterEnabled() ? this.H2 : this.G2;
        FragmentActivity activity = getActivity();
        if (activity != null) {
            String[] strArr = Hb.I.a;
            Intrinsics.checkNotNullParameter(activity, "<this>");
            i.c<String[]> cVar = this.g;
            Intrinsics.checkNotNullParameter(cVar, "resultLauncher");
            String[] strArr2 = Hb.I.c;
            if (Hb.I.d(activity, strArr2)) {
                this.A4 = AppEnums.f.m.a;
                Hb.H b2 = b2();
                BaseActivity a = Eb.E.a(this);
                int i2 = a.e.k2;
                Hb.i L2 = L();
                BaseActivity a2 = Eb.E.a(this);
                L2.getClass();
                Hb.H.a(b2, a, i2, Hb.i.j(a2));
            } else {
                cVar.launch(strArr2);
            }
        }
        String y02 = y0();
        String type = quoteData.getType();
        String url = quoteData.getUrl();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        String contentType = quoteData.getContentType();
        Pair pair2 = new Pair("Content Type", (contentType == null || StringsKt.J(contentType)) ? "QUOTE" : quoteData.getContentType());
        Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Open Camera", y02, name, url, type, i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false))}), 416);
    }

    public final void R3() {
        User user = this.W2;
        if (user == null || user.isBusinessUser()) {
            return;
        }
        M9.v vVar = new M9.v(this, 1);
        Intrinsics.checkNotNullParameter(vVar, "onMoreClick");
        i8.X x = new i8.X();
        x.p = vVar;
        x.show(getChildFragmentManager(), "Birthday Reminder Sheet");
    }

    public final Bitmap S1(final int i, final QuoteData quoteData, final QuoteView quoteView) {
        final Ref.ObjectRef objectRef = new Ref.ObjectRef();
        x0(new Function0() {
            public final java.lang.Object invoke() {
                throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.I5.invoke():java.lang.Object");
            }
        });
        return (Bitmap) objectRef.element;
    }

    public final void S2() {
        Intent a;
        X1().getClass();
        if (Hb.C.b()) {
            a = new Intent("android.intent.action.GET_CONTENT", MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            a.setType("*/*");
            Intrinsics.checkNotNull(a.putExtra("android.intent.extra.MIME_TYPES", new String[]{"image/*"}));
        } else {
            a = E7.D.a("android.intent.action.PICK", "image/*");
        }
        this.K4.launch(a);
    }

    public final void S3() {
        GamificationData gamificationData;
        UserConfigData e = e2().e();
        if (e == null || (gamificationData = e.getGamificationData()) == null || !Intrinsics.areEqual(gamificationData.isGamificationAnimationEnabled(), Boolean.TRUE)) {
            return;
        }
        this.Z = 5;
        this.p1 = 0;
        Handler handler = this.Y;
        RunnableC1619l runnableC1619l = this.o4;
        handler.removeCallbacks(runnableC1619l);
        handler.post(runnableC1619l);
    }

    public final QuotesCategory T1(List<QuotesCategory> list) {
        QuotesCategory quotesCategory = this.S3;
        if (!kotlin.text.p.h(quotesCategory != null ? quotesCategory.getName() : null, "Birthday", true)) {
            QuotesCategory quotesCategory2 = this.S3;
            if (!kotlin.text.p.h(quotesCategory2 != null ? quotesCategory2.getName() : null, "Anniversary", true)) {
                QuotesCategory quotesCategory3 = this.S3;
                if (!kotlin.text.p.h(quotesCategory3 != null ? quotesCategory3.getName() : null, "Political", true)) {
                    return U1("All", list);
                }
            }
        }
        return this.S3;
    }

    public final void T3(String str) {
        Integer valueOf = Integer.valueOf(J1.a.getColor(Eb.E.a(this), 2131101245) | (-16777216));
        h.b bVar = this.s3;
        bVar.getClass();
        Bundle bundle = new Bundle();
        bundle.putInt("android.support.customtabs.extra.TOOLBAR_COLOR", valueOf.intValue());
        bVar.d = bundle;
        Integer valueOf2 = Integer.valueOf(J1.a.getColor(Eb.E.a(this), 2131101245) | (-16777216));
        if (bVar.c == null) {
            bVar.c = new SparseArray();
        }
        SparseArray sparseArray = bVar.c;
        Bundle bundle2 = new Bundle();
        bundle2.putInt("android.support.customtabs.extra.TOOLBAR_COLOR", valueOf2.intValue());
        sparseArray.put(2, bundle2);
        Intent intent = bVar.a;
        intent.putExtra("android.support.customtabs.extra.ENABLE_URLBAR_HIDING", true);
        intent.putExtra("android.support.customtabs.extra.TITLE_VISIBILITY", 1);
        w.h a = bVar.a();
        Intrinsics.checkNotNullExpressionValue(a, "build(...)");
        intent.putExtra("android.support.customtabs.extra.TITLE_VISIBILITY", 1);
        if (!this.f2) {
            a.a(Eb.E.a(this), Uri.parse(kotlin.text.p.l(this.d3, "INTERPOLATE", kotlin.text.p.l(str, " ", "+"))));
            return;
        }
        a.a(Eb.E.a(this), Uri.parse(kotlin.text.p.l(this.e3, "INTERPOLATE", kotlin.text.p.l(str, " ", "+"))));
    }

    @Override
    public final void U() {
        Intent intent;
        Bundle extras;
        boolean z;
        String uri;
        try {
            do.a.a.c("handleRedirections", new Object[0]);
            FragmentActivity activity = getActivity();
            if (activity == null || (intent = activity.getIntent()) == null || (extras = intent.getExtras()) == null) {
                return;
            }
            if (extras.getBoolean("redirect_to", false) && Intrinsics.areEqual(extras.getString("redirect_url"), "diwaliVideoScreen")) {
                l4();
                z = true;
            } else {
                z = false;
            }
            if (K().j != null) {
                l4();
            }
            Uri uri2 = K().d;
            if (uri2 == null || (uri = uri2.toString()) == null) {
                return;
            }
            Cb.a aVar = this.F3;
            if (aVar == null) {
                Intrinsics.throwUninitializedPropertyAccessException("deepLinkConstants");
                aVar = null;
            }
            if (StringsKt.C(uri, aVar.q, false)) {
                if (!z) {
                    l4();
                }
                K().d = null;
            }
        } catch (Exception e) {
            do.a.a.e(e);
        }
    }

    public final void U3(String str) {
        Hb.C X1 = X1();
        FragmentManager childFragmentManager = getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        Integer num = this.g2;
        H3 h3 = new H3(0, this);
        X1.getClass();
        Intrinsics.checkNotNullParameter(childFragmentManager, "childFragmentManager");
        Intrinsics.checkNotNullParameter(h3, "onFilterClick");
        Intrinsics.checkNotNullParameter(h3, "onFilterClick");
        C2329L c2329l = new C2329L();
        c2329l.n = h3;
        Bundle bundle = new Bundle();
        if (num != null) {
            bundle.putInt("extra_page_data", num.intValue());
        }
        c2329l.setArguments(bundle);
        c2329l.show(childFragmentManager, "BirthdayFilterDialogFragment");
        Integer num2 = this.g2;
        com.crafto.android.ui.base.a.f0(this, str, "Home Screen", "Quotes List", num2 != null ? num2.toString() : null, "Filter", 0, null, 992);
    }

    @Override
    public final void V() {
        do.a.a.c("mytag NewVideoDesignViewHolder_bind: handleVideoPlayingOnPauseResume", new Object[0]);
        Mb.d dVar = W7.v0.a;
        Z2(true);
    }

    public final void V2(int i, QuoteData quoteData) {
        if (quoteData != null) {
            C1644a9 c1644a9 = new C1644a9(i, quoteData, this);
            Intrinsics.checkNotNullParameter(quoteData, "quoteData");
            O8.O o = new O8.O();
            o.D2 = c1644a9;
            Bundle bundle = new Bundle();
            bundle.putSerializable("extraQuote", quoteData);
            bundle.putInt("extraPosition", 0);
            bundle.putBoolean("extra_flag", false);
            o.setArguments(bundle);
            BaseActivity activity = getActivity();
            BaseActivity baseActivity = activity instanceof BaseActivity ? activity : null;
            if (baseActivity != null) {
                BaseActivity.G(baseActivity, o, false, "EditPoliticalTemplateFragment");
            }
        }
    }

    public final void V3() {
        String profileImageUrl;
        RelativeLayout relativeLayout;
        RelativeLayout relativeLayout2;
        Intent intent;
        FragmentActivity activity = getActivity();
        boolean z = (activity == null || (intent = activity.getIntent()) == null || !intent.getBooleanExtra("extra_flag_onboarding_payment_screem", false)) ? false : true;
        a.a aVar = do.a.a;
        StringBuilder a = defpackage.m.a(aVar, Ng.Z.c("showFirstLaunchPrePremiumBgRemovalPopup overrideRedirection true deferDisplay ", z), new Object[0], "showFirstLaunchPrePremiumBgRemovalPopup ");
        PreferencesHelper e2 = e2();
        a.append(e2.a.getBoolean(e2.D, false));
        a.append(' ');
        UserConfigData e = e2().e();
        Uri uri = null;
        a.append(e != null ? e.getBeforePremiumRemoveBackgroundDialog() : null);
        aVar.c(a.toString(), new Object[0]);
        UserConfigData e3 = e2().e();
        if ((e3 != null ? e3.getBeforePremiumRemoveBackgroundDialog() : null) != null) {
            PreferencesHelper e22 = e2();
            if (e22.a.getBoolean(e22.D, false)) {
                User user = this.W2;
                if (user == null || !user.isUserPremium()) {
                    StringBuilder sb = new StringBuilder("showFirstLaunchPrePremiumBgRemovalPopup isUserPremium ");
                    User user2 = this.W2;
                    aVar.c(C2941a.a(sb, user2 != null ? Boolean.valueOf(user2.isUserPremium()) : null, ' '), new Object[0]);
                    User E2 = e2().E();
                    com.crafto.android.ui.home.profile.e.Y = E2 != null ? E2.getProfileImageUrl() : null;
                    PreferencesHelper e23 = e2();
                    com.crafto.android.ui.home.profile.e.Z = e23.a.getString(e23.r, null);
                    C3053c2 c3053c2 = (C3053c2) this.y;
                    if (c3053c2 != null && (relativeLayout2 = c3053c2.Z) != null) {
                        Eb.X0.V(relativeLayout2);
                    }
                    aVar.c("showPrePremiumBgRemovalPopup()", new Object[0]);
                    C3053c2 c3053c22 = (C3053c2) this.y;
                    if (c3053c22 != null && (relativeLayout = c3053c22.Z) != null) {
                        Eb.X0.V(relativeLayout);
                    }
                    PreferencesHelper e24 = e2();
                    final String string = e24.a.getString(e24.r, null);
                    StringBuilder sb2 = new StringBuilder("showPrePremiumBgRemovalPopup url ");
                    sb2.append(string);
                    sb2.append(' ');
                    User E3 = e2().E();
                    sb2.append(E3 != null ? E3.getProfileImageUrl() : null);
                    aVar.c(sb2.toString(), new Object[0]);
                    User E4 = e2().E();
                    final String str = (E4 == null || (profileImageUrl = E4.getProfileImageUrl()) == null) ? string : profileImageUrl;
                    PreferencesHelper e25 = e2();
                    String string2 = e25.a.getString(e25.t, null);
                    if (string2 != null && string2.length() != 0) {
                        uri = Uri.parse(string2);
                    }
                    if (str != null && StringsKt.C(str, "nobgimage", false)) {
                        String[] strArr = {string, str};
                        for (int i = 0; i < 2; i++) {
                            if (strArr[i] == null) {
                                return;
                            }
                        }
                        ArrayList t = kotlin.collections.o.t(strArr);
                        String str2 = (String) t.get(0);
                        String str3 = (String) t.get(1);
                        a.a aVar2 = do.a.a;
                        aVar2.c("showPrePremiumBgRemovalPopup inside itlet", new Object[0]);
                        FragmentActivity activity2 = getActivity();
                        if (activity2 != null) {
                            aVar2.c("showPrePremiumBgRemovalPopup inside itlet getBitmap", new Object[0]);
                            Hb.i L2 = L();
                            C1757k5 c1757k5 = new C1757k5(0, this, str2);
                            L2.getClass();
                            Intrinsics.checkNotNullParameter(activity2, "context");
                            Intrinsics.checkNotNullParameter(str2, "url1");
                            Intrinsics.checkNotNullParameter(str3, "url2");
                            Intrinsics.checkNotNullParameter(c1757k5, "completed");
                            Ref.ObjectRef objectRef = new Ref.ObjectRef();
                            Ref.ObjectRef objectRef2 = new Ref.ObjectRef();
                            Eb.X0.h(activity2, str2, 0, (Integer) null, (I7.c) null, (I7.m) null, 0, false, new C0607q4(1, objectRef2, objectRef, c1757k5), 1020);
                            Eb.X0.h(activity2, str3, 0, (Integer) null, (I7.c) null, (I7.m) null, 0, false, new Hb.e(objectRef2, objectRef, 0, c1757k5), 1020);
                            return;
                        }
                        return;
                    }
                    if (uri == null || str == null || string == null) {
                        aVar.c("showPrePremiumBgRemovalPopup nobgimage false", new Object[0]);
                        final FragmentActivity activity3 = getActivity();
                        if (activity3 == null || str == null) {
                            return;
                        }
                        aVar.c("showPrePremiumBgRemovalPopup getBitmapFromUrlV2 121", new Object[0]);
                        Eb.X0.h(activity3, str, 0, (Integer) null, (I7.c) null, (I7.m) null, 0, false, new Function1() {
                            public final Object invoke(Object obj) {
                                Bitmap bitmap = (Bitmap) obj;
                                boolean z2 = D7.Q4;
                                final D7 d7 = D7.this;
                                Intrinsics.checkNotNullParameter(d7, "this$0");
                                FragmentActivity fragmentActivity = activity3;
                                Intrinsics.checkNotNullParameter(fragmentActivity, "$ctx");
                                final String str4 = str;
                                Intrinsics.checkNotNullParameter(str4, "$url");
                                if (bitmap != null) {
                                    do.a.a.c("showPrePremiumBgRemovalPopup generateSelfieBitmap 121 wasde", new Object[0]);
                                    d7.R1().a(fragmentActivity, bitmap, true, new Function2() {
                                        public final Object invoke(Object obj2, Object obj3) {
                                            boolean z3 = D7.Q4;
                                            D7 d72 = D7.this;
                                            Intrinsics.checkNotNullParameter(d72, "this$0");
                                            String str5 = str4;
                                            Intrinsics.checkNotNullParameter(str5, "$url");
                                            do.a.a.c("showPrePremiumBgRemovalPopup showPrePremiumBgRemovalPopupWithUrl 123", new Object[0]);
                                            d72.b4(str5, (Bitmap) obj2, (Bitmap) obj3);
                                            return Unit.a;
                                        }
                                    });
                                }
                                return Unit.a;
                            }
                        }, 1020);
                        return;
                    }
                    FragmentActivity activity4 = getActivity();
                    if (activity4 != null) {
                        Hb.i L3 = L();
                        ?? r4 = new Function2() {
                            public final Object invoke(Object obj, Object obj2) {
                                boolean z2 = D7.Q4;
                                D7 d7 = D7.this;
                                Intrinsics.checkNotNullParameter(d7, "this$0");
                                do.a.a.c("showPrePremiumBgRemovalPopup getBimapsFromUrl uri", new Object[0]);
                                String str4 = string;
                                d7.b4(str4, (Bitmap) obj2, (Bitmap) obj);
                                return Unit.a;
                            }
                        };
                        L3.getClass();
                        Intrinsics.checkNotNullParameter(activity4, "context");
                        Intrinsics.checkNotNullParameter(uri, "url1");
                        Intrinsics.checkNotNullParameter(str, "url2");
                        Intrinsics.checkNotNullParameter((Object) r4, "completed");
                        Ref.ObjectRef objectRef3 = new Ref.ObjectRef();
                        Ref.ObjectRef objectRef4 = new Ref.ObjectRef();
                        String uri2 = uri.toString();
                        Intrinsics.checkNotNullExpressionValue(uri2, "toString(...)");
                        Eb.X0.c(activity4, uri2, new Hb.l(objectRef3, objectRef4, (C1768l5) r4));
                        Eb.X0.h(activity4, str, 0, (Integer) null, (I7.c) null, (I7.m) null, 0, false, new Hb.f(objectRef4, objectRef3, (C1768l5) r4), 1020);
                    }
                }
            }
        }
    }

    @Override
    public final void W() {
        do.a.a.c("hideProgress", new Object[0]);
        androidx.lifecycle.E a = androidx.lifecycle.J.a(this);
        kl.c cVar = dl.Z.a;
        dl.g.b(a, il.p.a, (dl.J) null, new C1623p(null), 2);
    }

    public final void W2(QuoteData quoteData) {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, null, "Profile Click", 0, null, 1004);
        String creatorSlug = quoteData.getCreatorSlug();
        C2216g R2 = R();
        BaseActivity activity = getActivity();
        BaseActivity baseActivity = activity instanceof BaseActivity ? activity : null;
        User E2 = e2().E();
        boolean h = kotlin.text.p.h(creatorSlug, E2 != null ? E2.getSlug() : null, true);
        BaseActivity.a aVar = this.k2;
        R2.getClass();
        com.crafto.android.ui.home.profile.c a = c.a.a(null, creatorSlug, false, h, null, 44);
        a.i = aVar;
        if (baseActivity != null) {
            BaseActivity.G(baseActivity, a, false, "ProfileFragment");
        }
    }

    public final void W3(final GamificationData gamificationData) {
        String valueOf;
        String y02 = y0();
        String str = (gamificationData == null || !Intrinsics.areEqual(gamificationData.getMilestoneTobeAchievedNext(), Boolean.TRUE)) ? "Gamification Milestone BottomSheet" : "Gamification Progress BottomSheet";
        if (gamificationData == null || !Intrinsics.areEqual(gamificationData.getMilestoneTobeAchievedNext(), Boolean.TRUE)) {
            valueOf = String.valueOf(gamificationData != null ? Integer.valueOf(gamificationData.getAppLaunchPoints()) : null);
        } else {
            valueOf = String.valueOf(gamificationData.getAppLaunchPoints() + 10);
            if (valueOf == null) {
                valueOf = "10";
            }
        }
        com.crafto.android.ui.base.a.f0(this, "Landed", y02, str, valueOf, null, 0, null, 1008);
        C1904x6 c1904x6 = new C1904x6(0, this, gamificationData);
        Function1<? super QuoteData, Unit> function1 = new Function1() {
            public final Object invoke(Object obj) {
                QuoteData quoteData = (QuoteData) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter(quoteData, "quoteData");
                com.crafto.android.ui.base.a.f0(d7, "Share", d7.y0(), "Gamification Milestone BottomSheet", quoteData.getUrl(), null, 0, null, 1008);
                return Unit.a;
            }
        };
        Function0<Unit> function0 = new Function0() {
            public final Object invoke() {
                String str2;
                boolean z = D7.Q4;
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                GamificationData gamificationData2 = GamificationData.this;
                if (gamificationData2 == null || (str2 = String.valueOf(gamificationData2.getAppLaunchPoints() + 10)) == null) {
                    str2 = "10";
                }
                com.crafto.android.ui.base.a.f0(d7, "Click Action", "Gamification Progress BottomSheet", "Gamification Progress BottomSheet", str2, "Collect Now", 0, null, 992);
                d7.v2();
                return Unit.a;
            }
        };
        Intrinsics.checkNotNullParameter(c1904x6, "onDismiss");
        Intrinsics.checkNotNullParameter(function1, "shareNowClicked");
        Intrinsics.checkNotNullParameter(function0, "collectPointClicked");
        C2194k c2194k = new C2194k();
        c2194k.o = function1;
        c2194k.m = c1904x6;
        c2194k.n = function0;
        c2194k.setArguments(new Bundle());
        c2194k.show(getParentFragmentManager(), "Gamification Milestone BottomSheet");
    }

    @NotNull
    public final Hb.C X1() {
        Hb.C c = this.z3;
        if (c != null) {
            return c;
        }
        Intrinsics.throwUninitializedPropertyAccessException("dialogUtil");
        return null;
    }

    public final void X2(String str, Boolean bool, Boolean bool2) {
        if (getChildFragmentManager().findFragmentByTag("Religion Selection Screen") == null) {
            C2216g R2 = R();
            FragmentActivity activity = getActivity();
            C1346w c1346w = new C1346w(this, 2);
            Ga.R8 r82 = new Ga.R8(this, 1);
            Boolean bool3 = Boolean.TRUE;
            Boolean bool4 = Boolean.FALSE;
            R2.getClass();
            Intrinsics.checkNotNullParameter(str, "location");
            if (activity != null) {
                C2216g.b(R2, activity, c1346w, r82, null, bool, bool4, bool3, bool2, str, 8);
            }
        }
    }

    public final void X3(int i, boolean z) {
        View profileIconLayout;
        View profileIconLayout2;
        View profileIconLayout3;
        View profileIconLayout4;
        E7.G g = this.m3;
        RecyclerView.D f = g != null ? g.f(i) : null;
        if (f instanceof J8.J1) {
            J8.J1 j1 = (J8.J1) f;
            if (z) {
                QuoteView quoteView = j1.f;
                if (quoteView == null || (profileIconLayout4 = quoteView.getProfileIconLayout()) == null) {
                    return;
                }
                Eb.X0.l(profileIconLayout4);
                return;
            }
            QuoteView quoteView2 = j1.f;
            if (quoteView2 == null || (profileIconLayout3 = quoteView2.getProfileIconLayout()) == null) {
                return;
            }
            Eb.X0.V(profileIconLayout3);
            return;
        }
        if (f instanceof s8.J) {
            s8.J j = (s8.J) f;
            if (z) {
                QuoteView quoteView3 = j.g;
                if (quoteView3 == null || (profileIconLayout2 = quoteView3.getProfileIconLayout()) == null) {
                    return;
                }
                Eb.X0.l(profileIconLayout2);
                return;
            }
            QuoteView quoteView4 = j.g;
            if (quoteView4 == null || (profileIconLayout = quoteView4.getProfileIconLayout()) == null) {
                return;
            }
            Eb.X0.V(profileIconLayout);
        }
    }

    @Override
    public final void Y() {
        MaterialTextView materialTextView;
        C3047bd c3047bd;
        AppCompatImageView appCompatImageView;
        C3047bd c3047bd2;
        ConstraintLayout constraintLayout;
        FrameLayout frameLayout;
        C3053c2 c3053c2 = (C3053c2) this.y;
        if (c3053c2 != null && (frameLayout = c3053c2.p) != null) {
            Eb.X0.T(frameLayout, false, 0, new C0220r0(this, 4), 3);
        }
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 != null && (c3047bd2 = c3053c22.w) != null && (constraintLayout = c3047bd2.a) != null) {
            Eb.X0.T(constraintLayout, false, 0, new C0222s0(this, 4), 3);
        }
        C3053c2 c3053c23 = (C3053c2) this.y;
        if (c3053c23 != null && (c3047bd = c3053c23.w) != null && (appCompatImageView = c3047bd.b) != null) {
            Eb.X0.T(appCompatImageView, false, 0, new C0224t0(this, 5), 3);
        }
        C3053c2 c3053c24 = (C3053c2) this.y;
        if (c3053c24 == null || (materialTextView = c3053c24.o2) == null) {
            return;
        }
        Eb.X0.T(materialTextView, false, 0, new C0845i2(this, 1), 3);
    }

    @NotNull
    public final Hb.F Y1() {
        Hb.F f = this.B3;
        if (f != null) {
            return f;
        }
        Intrinsics.throwUninitializedPropertyAccessException("fileUtils");
        return null;
    }

    public final void Y2(boolean z) {
        if (getChildFragmentManager().findFragmentByTag("Select state dropdown") == null) {
            User E2 = e2().E();
            if (E2 == null || !E2.isBusinessUser()) {
                C2216g R2 = R();
                FragmentActivity activity = getActivity();
                Q8.A a = new Q8.A(this, 1);
                R2.getClass();
                C2216g.q(activity, a);
                return;
            }
            if (getChildFragmentManager().findFragmentByTag("Select state dropdown") == null) {
                C2216g R3 = R();
                FragmentActivity activity2 = getActivity();
                C1349z c1349z = new C1349z(this, 2);
                R3.getClass();
                if (activity2 != null) {
                    C1362l c1362l = new C1362l(c1349z, 1);
                    U8.g gVar = new U8.g();
                    gVar.j = c1362l;
                    gVar.k = z;
                    gVar.show(activity2.getSupportFragmentManager(), "Select state dropdown");
                }
            }
        }
    }

    public final void Y3(int i, boolean z) {
        ConstraintLayout clOverlapingText;
        ConstraintLayout clOverlapingText2;
        ConstraintLayout clOverlapingText3;
        ConstraintLayout clOverlapingText4;
        ConstraintLayout clOverlapingText5;
        ConstraintLayout clOverlapingText6;
        E7.G g = this.m3;
        RecyclerView.D f = g != null ? g.f(i) : null;
        if (f instanceof J8.J1) {
            J8.J1 j1 = (J8.J1) f;
            if (z) {
                QuoteView quoteView = j1.f;
                if (quoteView == null || (clOverlapingText6 = quoteView.getClOverlapingText()) == null) {
                    return;
                }
                Eb.X0.l(clOverlapingText6);
                return;
            }
            QuoteView quoteView2 = j1.f;
            if (quoteView2 == null || (clOverlapingText5 = quoteView2.getClOverlapingText()) == null) {
                return;
            }
            Eb.X0.V(clOverlapingText5);
            return;
        }
        if (f instanceof E8.T5) {
            E8.T5 t5 = (E8.T5) f;
            if (z) {
                QuoteView quoteView3 = t5.j;
                if (quoteView3 == null || (clOverlapingText4 = quoteView3.getClOverlapingText()) == null) {
                    return;
                }
                Eb.X0.l(clOverlapingText4);
                return;
            }
            QuoteView quoteView4 = t5.j;
            if (quoteView4 == null || (clOverlapingText3 = quoteView4.getClOverlapingText()) == null) {
                return;
            }
            Eb.X0.V(clOverlapingText3);
            return;
        }
        if (f instanceof s8.J) {
            s8.J j = (s8.J) f;
            if (z) {
                QuoteView quoteView5 = j.g;
                if (quoteView5 == null || (clOverlapingText2 = quoteView5.getClOverlapingText()) == null) {
                    return;
                }
                Eb.X0.l(clOverlapingText2);
                return;
            }
            QuoteView quoteView6 = j.g;
            if (quoteView6 == null || (clOverlapingText = quoteView6.getClOverlapingText()) == null) {
                return;
            }
            Eb.X0.V(clOverlapingText);
        }
    }

    @Override
    public final void Z() {
        k2().o.observe(getViewLifecycleOwner(), new P(new C0163t(this, 1)));
        r2().o.observe(getViewLifecycleOwner(), new P(new Y6(this, 0)));
        r2().p.observe(getViewLifecycleOwner(), new P(new Da.G(this, 1)));
        r2().s.observe(getViewLifecycleOwner(), new P(new Da.H(this, 3)));
        r2().t.observe(getViewLifecycleOwner(), new P(new Da.I(this, 4)));
        r2().w.observe(getViewLifecycleOwner(), new P(new Da.J(this, 2)));
        r2().x.observe(getViewLifecycleOwner(), new P(new Da.K(this, 1)));
        androidx.lifecycle.I viewLifecycleOwner = getViewLifecycleOwner();
        Intrinsics.checkNotNullExpressionValue(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        Eb.F.a(viewLifecycleOwner, d2().l, new A8.W0(this, 2));
        androidx.lifecycle.I viewLifecycleOwner2 = getViewLifecycleOwner();
        Intrinsics.checkNotNullExpressionValue(viewLifecycleOwner2, "getViewLifecycleOwner(...)");
        Eb.F.a(viewLifecycleOwner2, o2().b, new C1654b7());
        d2().i.observe(getViewLifecycleOwner(), new P(new A8.Y0(this, 2)));
        androidx.lifecycle.I viewLifecycleOwner3 = getViewLifecycleOwner();
        Intrinsics.checkNotNullExpressionValue(viewLifecycleOwner3, "getViewLifecycleOwner(...)");
        Eb.F.a(viewLifecycleOwner3, d2().k, new B6(0));
        androidx.lifecycle.I viewLifecycleOwner4 = getViewLifecycleOwner();
        Intrinsics.checkNotNullExpressionValue(viewLifecycleOwner4, "getViewLifecycleOwner(...)");
        Eb.F.a(viewLifecycleOwner4, d2().j, new J9.A0(this, 2));
        androidx.lifecycle.I viewLifecycleOwner5 = getViewLifecycleOwner();
        Intrinsics.checkNotNullExpressionValue(viewLifecycleOwner5, "getViewLifecycleOwner(...)");
        Eb.F.a(viewLifecycleOwner5, r2().y, new C0153o0(this, 1));
        r2().p2.observe(getViewLifecycleOwner(), new P(new Function1() {
            public final Object invoke(Object obj) {
                AppCompatImageView appCompatImageView;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                if (Intrinsics.areEqual((Boolean) obj, Boolean.TRUE)) {
                    C3053c2 c3053c2 = (C3053c2) d7.y;
                    if (c3053c2 != null && (appCompatImageView = c3053c2.i2) != null) {
                        appCompatImageView.performClick();
                    }
                    d7.r2().p2.postValue(Boolean.FALSE);
                }
                return Unit.a;
            }
        }));
        r2().f3.observe(getViewLifecycleOwner(), new P(new C0202i(this, 1)));
        r2().g3.observe(getViewLifecycleOwner(), new P(new C0204j(this, 1)));
        r2().J2.observe(getViewLifecycleOwner(), new P(new C1371v(this, 1)));
        r2().P2.observe(getViewLifecycleOwner(), new P(new C1372w(this, 1)));
        r2().R2.observe(getViewLifecycleOwner(), new P(new J9.Z0(this, 2)));
        r2().T2.observe(getViewLifecycleOwner(), new P(new K2(this, 1)));
        r2().V2.observe(getViewLifecycleOwner(), new P(new Z6(this, 0)));
        r2().X2.observe(getViewLifecycleOwner(), new P(new M2(this, 1)));
        r2().Z2.observe(getViewLifecycleOwner(), new P(new C1642a7(this, 0)));
        r2().b3.observe(getViewLifecycleOwner(), new P(new A8.P0(this, 1)));
    }

    @NotNull
    public final Pb.h Z1() {
        Pb.h hVar = this.K3;
        if (hVar != null) {
            return hVar;
        }
        Intrinsics.throwUninitializedPropertyAccessException("imageGalleryUtil");
        return null;
    }

    public final void Z2(final boolean z) {
        do.a.a.c(Ng.Z.c("mytag playPauseCurrentItem ", z), new Object[0]);
        x0(new Function0() {
            public final java.lang.Object invoke() {
                throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.C1916y7.invoke():java.lang.Object");
            }
        });
    }

    public final void Z3(boolean z) {
        ProgressBar progressBar;
        int i;
        ProgressBar progressBar2;
        ArrayList<I7.m> arrayList;
        if (z) {
            E7.G g = this.m3;
            if (g == null || (arrayList = g.l) == null) {
                List list = a.e.a;
                i = 0;
            } else {
                i = arrayList.size();
            }
            List list2 = a.e.a;
            if (i > 0) {
                C3053c2 c3053c2 = (C3053c2) this.y;
                if (c3053c2 == null || (progressBar2 = c3053c2.X) == null) {
                    return;
                }
                Eb.X0.V(progressBar2);
                return;
            }
        }
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 == null || (progressBar = c3053c22.X) == null) {
            return;
        }
        Eb.X0.l(progressBar);
    }

    @Override
    public final void a0() {
        View view;
        LinearLayout linearLayout;
        LinearLayout linearLayout2;
        RelativeLayout relativeLayout;
        LinearLayoutCompat linearLayoutCompat;
        AppCompatImageView appCompatImageView;
        MaterialButton materialButton;
        AppCompatImageView appCompatImageView2;
        View view2;
        LinearLayout linearLayout3;
        LinearLayout linearLayout4;
        RelativeLayout relativeLayout2;
        LinearLayoutCompat linearLayoutCompat2;
        ViewTreeObserver viewTreeObserver;
        AppCompatTextView appCompatTextView;
        ConstraintLayout constraintLayout;
        ViewPager2 viewPager2;
        RelativeLayout relativeLayout3;
        C3029ac c3029ac;
        ConstraintLayout constraintLayout2;
        AppCompatEditText appCompatEditText;
        AppCompatEditText appCompatEditText2;
        RecyclerView recyclerView;
        AppCompatEditText appCompatEditText3;
        AppCompatEditText appCompatEditText4;
        RelativeLayout relativeLayout4;
        AppCompatImageView appCompatImageView3;
        AppCompatImageView appCompatImageView4;
        AppCompatImageView appCompatImageView5;
        ConstraintLayout constraintLayout3;
        this.W2 = e2().E();
        UserConfigData e = e2().e();
        if (e != null && e.getShowBirthdayReminderDialog()) {
            Hb.C X1 = X1();
            PreferencesHelper e2 = e2();
            X1.getClass();
            Intrinsics.checkNotNullParameter(e2, "preferencesHelper");
            long j = e2.a.getLong("lastShownTimestampDialog", 0L);
            SharedPreferences sharedPreferences = e2.a;
            int i = sharedPreferences.getInt("dialogCount", 0);
            int i2 = 4;
            if (i < 4) {
                if (i == 0) {
                    i2 = 0;
                } else if (i == 1) {
                    i2 = 2;
                } else if (i == 2) {
                    i2 = 3;
                } else if (i != 3) {
                    i2 = Integer.MAX_VALUE;
                }
                long currentTimeMillis = System.currentTimeMillis();
                long days = TimeUnit.MILLISECONDS.toDays(currentTimeMillis - j);
                do.a.a.c("daysToNextDialog " + i2 + " elapsedDays " + days, new Object[0]);
                if (days >= i2 || i == 0) {
                    sharedPreferences.edit().putLong("lastShownTimestampDialog", currentTimeMillis).apply();
                    sharedPreferences.edit().putInt("dialogCount", i + 1).apply();
                    R3();
                }
            }
        }
        a.a aVar = do.a.a;
        aVar.c("preferencesHelper.getShowTutorial() " + e2().a.getBoolean("showTutorial", true), new Object[0]);
        x0(new Da.J0(this, 2));
        x0(new Da.F(this, 1));
        x0(new R3(this, 0));
        D3();
        C2();
        D2();
        A3();
        C3053c2 c3053c2 = (C3053c2) this.y;
        if (c3053c2 != null && (constraintLayout3 = c3053c2.b) != null) {
            constraintLayout3.setOnClickListener(new ViewOnClickListenerC0825f3(this, 1));
        }
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 != null && (appCompatImageView5 = c3053c22.y1) != null) {
            appCompatImageView5.setOnClickListener(new ViewOnClickListenerC1313u(this, 1));
        }
        C3053c2 c3053c23 = (C3053c2) this.y;
        if (c3053c23 != null && (appCompatImageView4 = c3053c23.i2) != null) {
            Eb.X0.T(appCompatImageView4, false, 0, new C0957y3(this, 2), 3);
        }
        C3053c2 c3053c24 = (C3053c2) this.y;
        if (c3053c24 != null && (appCompatImageView3 = c3053c24.I) != null) {
            Eb.X0.T(appCompatImageView3, false, 0, new Eb.q(this, 3), 3);
        }
        StringBuilder sb = new StringBuilder(" showCreation - ");
        User E2 = e2().E();
        Drawable drawable = null;
        sb.append(E2 != null ? Boolean.valueOf(E2.getShowCreation()) : null);
        aVar.c(sb.toString(), new Object[0]);
        C3053c2 c3053c25 = (C3053c2) this.y;
        if (c3053c25 != null && (relativeLayout4 = c3053c25.P) != null) {
            final int i3 = 0;
            relativeLayout4.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view3) {
                    CardView cardView;
                    Object obj = this;
                    switch (i3) {
                        case 0:
                            boolean z = D7.Q4;
                            D7 d7 = (D7) obj;
                            Intrinsics.checkNotNullParameter(d7, "this$0");
                            C3053c2 c3053c26 = (C3053c2) d7.y;
                            if (c3053c26 != null && (cardView = c3053c26.p1) != null) {
                                Eb.X0.l(cardView);
                                break;
                            }
                            break;
                        default:
                            com.google.android.material.textfield.y yVar = (com.google.android.material.textfield.y) obj;
                            EditText editText = yVar.f;
                            if (editText != null) {
                                int selectionEnd = editText.getSelectionEnd();
                                EditText editText2 = yVar.f;
                                if (editText2 == null || !(editText2.getTransformationMethod() instanceof PasswordTransformationMethod)) {
                                    yVar.f.setTransformationMethod(PasswordTransformationMethod.getInstance());
                                } else {
                                    yVar.f.setTransformationMethod(null);
                                }
                                if (selectionEnd >= 0) {
                                    yVar.f.setSelection(selectionEnd);
                                }
                                yVar.q();
                                break;
                            }
                            break;
                    }
                }
            });
        }
        C3053c2 c3053c26 = (C3053c2) this.y;
        if (c3053c26 != null && (appCompatEditText4 = c3053c26.V1) != null) {
            appCompatEditText4.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                @Override
                public final void onFocusChange(View view3, boolean z) {
                    boolean z2 = D7.Q4;
                    D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    if (z) {
                        com.crafto.android.ui.base.a.f0(d7, "Click Action", "Quotes List", null, null, Intrinsics.areEqual(d7.m4, a.e.j) ? "Search Political Party" : "Search Special Day", 0, null, 1004);
                    }
                }
            });
        }
        C3053c2 c3053c27 = (C3053c2) this.y;
        if (c3053c27 != null && (appCompatEditText3 = c3053c27.V1) != null) {
            appCompatEditText3.setOnEditorActionListener(new TextView.OnEditorActionListener() {
                @Override
                public final boolean onEditorAction(final TextView textView, final int i4, KeyEvent keyEvent) {
                    boolean z = D7.Q4;
                    final D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    d7.x0(new Function0() {
                        public final Object invoke() {
                            String str;
                            String str2;
                            AppCompatEditText appCompatEditText5;
                            boolean z2 = D7.Q4;
                            D7 d72 = d7;
                            Intrinsics.checkNotNullParameter(d72, "this$0");
                            if (i4 == 3) {
                                if (Intrinsics.areEqual(d72.m4, a.e.j)) {
                                    str = "searchPoliticalParty";
                                    str2 = "Party poster search widget";
                                } else {
                                    str = "searchSpecialDay";
                                    str2 = "Special day search widget";
                                }
                                String str3 = str2;
                                TextView textView2 = textView;
                                d72.e4(textView2.getText().toString(), str);
                                com.crafto.android.ui.base.a.f0(d72, "Click Action", "Quotes List", str3, textView2.getText().toString(), "Search", 0, null, 992);
                                C3053c2 c3053c28 = (C3053c2) d72.y;
                                if (c3053c28 != null && (appCompatEditText5 = c3053c28.V1) != null) {
                                    Editable.Factory factory = Editable.Factory.getInstance();
                                    Eb.I0.c(StringCompanionObject.INSTANCE);
                                    appCompatEditText5.setText(factory.newEditable(""));
                                }
                                Hb.p0 s2 = d72.s2();
                                AppCompatActivity a = Eb.E.a(d72);
                                s2.getClass();
                                Hb.p0.c(a);
                            }
                            return Unit.a;
                        }
                    });
                    return false;
                }
            });
        }
        C3053c2 c3053c28 = (C3053c2) this.y;
        Hk.s sVar = this.d4;
        if (c3053c28 != null && (recyclerView = c3053c28.x1) != null) {
            recyclerView.setAdapter((E7.F) sVar.getValue());
        }
        x3(this.c4);
        ((E7.F) sVar.getValue()).i(this.c4);
        C3053c2 c3053c29 = (C3053c2) this.y;
        if (c3053c29 != null && (appCompatEditText2 = c3053c29.n) != null) {
            appCompatEditText2.addTextChangedListener(new C1657ba(this));
        }
        C3053c2 c3053c210 = (C3053c2) this.y;
        if (c3053c210 != null && (appCompatEditText = c3053c210.n) != null) {
            appCompatEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
                @Override
                public final boolean onEditorAction(final TextView textView, final int i4, KeyEvent keyEvent) {
                    boolean z = D7.Q4;
                    final D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    d7.x0(new Function0() {
                        public final Object invoke() {
                            boolean z2 = D7.Q4;
                            D7 d72 = d7;
                            Intrinsics.checkNotNullParameter(d72, "this$0");
                            if (i4 == 3) {
                                d72.N2(new Tag(null, textView.getText().toString(), false, 5, null));
                            }
                            return Unit.a;
                        }
                    });
                    return false;
                }
            });
        }
        C3053c2 c3053c211 = (C3053c2) this.y;
        if (c3053c211 != null && (c3029ac = c3053c211.t) != null && (constraintLayout2 = c3029ac.d) != null) {
            Eb.X0.T(constraintLayout2, false, 0, new C1057w0(this, 1), 3);
        }
        C3053c2 c3053c212 = (C3053c2) this.y;
        if (c3053c212 != null && (relativeLayout3 = c3053c212.Q) != null) {
            Eb.X0.T(relativeLayout3, false, 0, new J9.U5(this, 4), 3);
        }
        C3449a c3449a = this.Z3;
        if (c3449a == null) {
            Intrinsics.throwUninitializedPropertyAccessException("homeFragmentViewModel");
            c3449a = null;
        }
        c3449a.a.observe(getViewLifecycleOwner(), new P(new J0(this, 1)));
        long j2 = e2().a.getLong("app_launch_counter", 0L);
        long j3 = a.e.D1;
        if (j2 == j3) {
            Q2();
        } else if (e2().a.getLong("app_launch_counter", 0L) == 5 * j3) {
            Q2();
        } else if (e2().a.getLong("app_launch_counter", 0L) == 10 * j3) {
            Q2();
        } else if (e2().a.getLong("app_launch_counter", 0L) == 20 * j3) {
            Q2();
        }
        r2().Z.observe(getViewLifecycleOwner(), new P(new C7.p(this, 3)));
        C3449a c3449a2 = this.Z3;
        if (c3449a2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("homeFragmentViewModel");
            c3449a2 = null;
        }
        c3449a2.b.observe(getViewLifecycleOwner(), new P(new Function1() {
            public final Object invoke(Object obj) {
                C3053c2 c3053c213;
                AppCompatImageView appCompatImageView6;
                String str = (String) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                if (str != null && (c3053c213 = (C3053c2) d7.y) != null && (appCompatImageView6 = c3053c213.i2) != null) {
                    Eb.X0.I(appCompatImageView6, str, (Function2) null, (Function1) null, 14);
                }
                return Unit.a;
            }
        }));
        r2().H2.observe(getViewLifecycleOwner(), new P(new J9.O1(this, 1)));
        r2().l2.observe(getViewLifecycleOwner(), new P(new C0405u4(this, 2)));
        ((O8.a1) this.U3.getValue()).g.observe(getViewLifecycleOwner(), new P(new Ra.y0(this, 1)));
        r2().y2.observe(getViewLifecycleOwner(), new P(new C0894p2(this, 3)));
        new HashMap().put("Screen Name", "Home Screen");
        C3053c2 c3053c213 = (C3053c2) this.y;
        if (c3053c213 != null && (viewPager2 = c3053c213.k2) != null) {
            viewPager2.b(new A());
        }
        C3053c2 c3053c214 = (C3053c2) this.y;
        if (c3053c214 != null && (constraintLayout = c3053c214.j) != null) {
            Eb.X0.T(constraintLayout, false, 0, new C1150n(this, 2), 3);
        }
        C3053c2 c3053c215 = (C3053c2) this.y;
        if (c3053c215 != null && (appCompatTextView = c3053c215.p2) != null) {
            Eb.X0.T(appCompatTextView, false, 0, new J9.D2(this, 4), 3);
        }
        k2().i.observe(getViewLifecycleOwner(), new P(new J9.R2(this, 3)));
        androidx.lifecycle.I viewLifecycleOwner = getViewLifecycleOwner();
        Intrinsics.checkNotNullExpressionValue(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        Eb.F.a(viewLifecycleOwner, r2().Y, new C0802c3(this, 3));
        d2().p.observe(getViewLifecycleOwner(), new P(new C0902q3(this, 3)));
        r2().j2.observe(getViewLifecycleOwner(), new P(new O8.Q0(this, 2)));
        r2().k2.observe(getViewLifecycleOwner(), new P(new O8.Z0(this, 2)));
        View view3 = getView();
        if (view3 != null && (viewTreeObserver = view3.getViewTreeObserver()) != null) {
            viewTreeObserver.addOnGlobalLayoutListener(new B());
        }
        if (this.t2 || this.v2) {
            C3053c2 c3053c216 = (C3053c2) this.y;
            if (c3053c216 != null && (linearLayoutCompat = c3053c216.L) != null) {
                Eb.X0.V(linearLayoutCompat);
            }
            C3053c2 c3053c217 = (C3053c2) this.y;
            if (c3053c217 != null && (relativeLayout = c3053c217.f2) != null) {
                Eb.X0.l(relativeLayout);
            }
            C3053c2 c3053c218 = (C3053c2) this.y;
            ViewGroup.LayoutParams layoutParams = (c3053c218 == null || (linearLayout2 = c3053c218.j2) == null) ? null : linearLayout2.getLayoutParams();
            RelativeLayout.LayoutParams layoutParams2 = layoutParams instanceof RelativeLayout.LayoutParams ? (RelativeLayout.LayoutParams) layoutParams : null;
            if (layoutParams2 != null) {
                layoutParams2.height = Eb.H0.a(0);
            }
            if (layoutParams2 != null) {
                layoutParams2.topMargin = Eb.H0.a(0);
            }
            C3053c2 c3053c219 = (C3053c2) this.y;
            if (c3053c219 != null && (linearLayout = c3053c219.j2) != null) {
                linearLayout.setLayoutParams(layoutParams2);
            }
            C3053c2 c3053c220 = (C3053c2) this.y;
            if (c3053c220 != null && (view = c3053c220.s) != null) {
                Context context = getContext();
                if (context != null) {
                    Intrinsics.checkNotNullParameter(context, "<this>");
                    drawable = J1.a.getDrawable(context, 2131233837);
                }
                view.setBackground(drawable);
            }
            A0(2131101194, a.e.r0);
        } else {
            C3053c2 c3053c221 = (C3053c2) this.y;
            if (c3053c221 != null && (linearLayoutCompat2 = c3053c221.L) != null) {
                Eb.X0.l(linearLayoutCompat2);
            }
            C3053c2 c3053c222 = (C3053c2) this.y;
            if (c3053c222 != null && (relativeLayout2 = c3053c222.f2) != null) {
                Eb.X0.V(relativeLayout2);
            }
            C3053c2 c3053c223 = (C3053c2) this.y;
            ViewGroup.LayoutParams layoutParams3 = (c3053c223 == null || (linearLayout4 = c3053c223.j2) == null) ? null : linearLayout4.getLayoutParams();
            RelativeLayout.LayoutParams layoutParams4 = layoutParams3 instanceof RelativeLayout.LayoutParams ? (RelativeLayout.LayoutParams) layoutParams3 : null;
            if (layoutParams4 != null) {
                layoutParams4.height = -2;
            }
            C3053c2 c3053c224 = (C3053c2) this.y;
            if (c3053c224 != null && (linearLayout3 = c3053c224.j2) != null) {
                linearLayout3.setLayoutParams(layoutParams4);
            }
            C3053c2 c3053c225 = (C3053c2) this.y;
            if (c3053c225 != null && (view2 = c3053c225.s) != null) {
                Context context2 = getContext();
                if (context2 != null) {
                    Intrinsics.checkNotNullParameter(context2, "<this>");
                    drawable = J1.a.getDrawable(context2, 2131232365);
                }
                view2.setBackground(drawable);
            }
            A0(2131101194, a.e.q0);
        }
        C3053c2 c3053c226 = (C3053c2) this.y;
        if (c3053c226 != null && (appCompatImageView2 = c3053c226.x) != null) {
            Eb.X0.T(appCompatImageView2, false, 0, new Q7.X(this, 1), 3);
        }
        C3053c2 c3053c227 = (C3053c2) this.y;
        if (c3053c227 != null && (materialButton = c3053c227.o) != null) {
            Eb.X0.T(materialButton, false, 0, new C1037m(this, 1), 3);
        }
        C3053c2 c3053c228 = (C3053c2) this.y;
        if (c3053c228 == null || (appCompatImageView = c3053c228.y) == null) {
            return;
        }
        Eb.X0.T(appCompatImageView, false, 0, new C0916s4(this, 5), 3);
    }

    public final void a3(final String str, final boolean z) {
        do.a.a.c("SkipablePremiumPlanScreenExpFragment_pollBgRemove", new Object[0]);
        final long currentTimeMillis = System.currentTimeMillis();
        final String str2 = Intrinsics.areEqual(this.A4, AppEnums.f.E0.a) ? "Gallery" : "Camera";
        com.crafto.android.ui.base.a.f0(this, "Log", y0(), str2, null, "removeBgPollStarted", 0, kotlin.collections.Q.f(new Pair[]{new Pair("Source", "Full Screen Video Frame")}), 488);
        C1808p1 r2 = r2();
        r2.getClass();
        Intrinsics.checkNotNullParameter(str, Constants.KEY_URL);
        Gb.f.a(r2.a.getRemovedBgImageForUrl(kotlin.collections.Q.f(new Pair[]{new Pair(r2.e.j0, str)})), new Function1() {
            public final Object invoke(Object obj) {
                QuotesCategory quotesCategory;
                String value;
                PostMedia postMedia = (PostMedia) obj;
                boolean z2 = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                String str3 = str2;
                Intrinsics.checkNotNullParameter(str3, "$location");
                String str4 = str;
                Intrinsics.checkNotNullParameter(str4, "$mediaUrl");
                Intrinsics.checkNotNullParameter(postMedia, Column.DATA);
                a.a aVar = do.a.a;
                StringBuilder a = defpackage.m.a(aVar, "bgRemovePollingCount " + d7.z4, new Object[0], "pollBgRemove ");
                a.append(postMedia.getState());
                StringBuilder a2 = defpackage.m.a(aVar, a.toString(), new Object[0], "pollBgRemove_generatedImage ");
                a2.append(postMedia.getMediaURL());
                aVar.c(a2.toString(), new Object[0]);
                boolean areEqual = Intrinsics.areEqual(postMedia.getState(), "GENERATED");
                boolean z3 = z;
                if (areEqual) {
                    com.crafto.android.ui.base.a.f0(d7, "Log", d7.y0(), str3, String.valueOf(System.currentTimeMillis() - currentTimeMillis), "removeBgPollCompleted", 0, kotlin.collections.Q.f(new Pair[]{new Pair(Constants.KEY_URL, postMedia.getMediaURL()), new Pair("Source", "Full Screen Video Frame")}), 480);
                    String mediaURL = postMedia.getMediaURL();
                    if (mediaURL != null) {
                        String str5 = "";
                        if (!z3 && (quotesCategory = d7.S3) != null && (value = quotesCategory.getValue()) != null) {
                            str5 = value;
                        }
                        d7.e2().T(str5, mediaURL);
                    }
                    d7.r4(postMedia);
                } else {
                    dl.g.b(androidx.lifecycle.J.a(d7), (CoroutineContext) null, (dl.J) null, d7.new L(str4, z3, null), 3);
                }
                d7.z4++;
                return Unit.a;
            }
        }, new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                Throwable th = (Throwable) obj;
                boolean z2 = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                String str3 = str2;
                Intrinsics.checkNotNullParameter(str3, "$location");
                Intrinsics.checkNotNullParameter(th, "throwable");
                Intrinsics.checkNotNullParameter((Db.a) obj2, "failure");
                do.a.a.d("uploadFilterImage Failed " + th, new Object[0]);
                com.crafto.android.ui.base.a.f0(d7, "Log", d7.y0(), str3, th.getMessage(), "removeBgPollError", 0, kotlin.collections.Q.f(new Pair[]{new Pair("Source", "Full Screen Video Frame")}), 480);
                d7.z4 = d7.z4 + 1;
                return Unit.a;
            }
        }, false, 12);
    }

    public final void a4(QuoteData quoteData, final QuoteData quoteData2, final AppEnums.f fVar, final int i, final View view) {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, null, "Paheli answer", 0, kotlin.collections.Q.f(new Pair[]{new Pair(new Bb.k().d, Integer.valueOf(i))}), 492);
        N8.f fVar2 = new N8.f(quoteData != null ? quoteData.getPaheli() : null, new Function0() {
            public final Object invoke() {
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                QuoteData quoteData3 = quoteData2;
                Intrinsics.checkNotNullParameter(quoteData3, "$click");
                AppEnums.f fVar3 = fVar;
                Intrinsics.checkNotNullParameter(fVar3, "$clickType");
                View view2 = view;
                Intrinsics.checkNotNullParameter(view2, "$view");
                d7.J3(i, view2, quoteData3, fVar3);
                return Unit.a;
            }
        });
        FragmentManager childFragmentManager = getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        Intrinsics.checkNotNullParameter(childFragmentManager, "manager");
        fVar2.show(childFragmentManager, "Paheli Dialog");
    }

    public final void b1(int i, QuoteData quoteData) {
        do.a.a.c("ADD_BIRTHDAY_NAME", new Object[0]);
        Q3();
        String url = quoteData.getUrl();
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Slot", quoteData.getSlot());
        Pair pair3 = new Pair("Content Type", quoteData.getContentType());
        Pair pair4 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Birthday Name Dialog", "Add Birthday Name", url, "Add Name", i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false))}), 416);
    }

    @NotNull
    public final Hb.H b2() {
        Hb.H h = this.I3;
        if (h != null) {
            return h;
        }
        Intrinsics.throwUninitializedPropertyAccessException("intentRedirectUtil");
        return null;
    }

    public final void b3() {
        final long currentTimeMillis = System.currentTimeMillis();
        final String str = Intrinsics.areEqual(this.A4, AppEnums.f.E0.a) ? "Gallery" : "Camera";
        com.crafto.android.ui.base.a.f0(this, "Log", y0(), str, null, "filterPollStarted", 0, null, 1000);
        Gb.f.a(d2().e(), new Function1() {
            public final Object invoke(Object obj) {
                PostMedia postMedia = (PostMedia) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                String str2 = str;
                Intrinsics.checkNotNullParameter(str2, "$location");
                Intrinsics.checkNotNullParameter(postMedia, Column.DATA);
                a.a aVar = do.a.a;
                StringBuilder a = defpackage.m.a(aVar, "pollCount " + d7.p4, new Object[0], "pollFilterImage ");
                a.append(postMedia.getState());
                StringBuilder a2 = defpackage.m.a(aVar, a.toString(), new Object[0], "pollFilterImage_generatedImage ");
                a2.append(postMedia.getGeneratedImage());
                aVar.c(a2.toString(), new Object[0]);
                if (Intrinsics.areEqual(postMedia.getState(), "GENERATED")) {
                    com.crafto.android.ui.base.a.f0(d7, "Log", d7.y0(), str2, String.valueOf(System.currentTimeMillis() - currentTimeMillis), "filterPollCompleted", 0, kotlin.collections.Q.f(new Pair[]{new Pair(Constants.KEY_URL, postMedia.getGeneratedImage())}), 480);
                    d7.r4(postMedia);
                    d7.e2().a0();
                } else {
                    dl.g.b(androidx.lifecycle.J.a(d7), (CoroutineContext) null, (dl.J) null, new C1896w9(d7, null), 3);
                }
                d7.p4++;
                return Unit.a;
            }
        }, new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                Throwable th = (Throwable) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                String str2 = str;
                Intrinsics.checkNotNullParameter(str2, "$location");
                Intrinsics.checkNotNullParameter(th, "throwable");
                Intrinsics.checkNotNullParameter((Db.a) obj2, "failure");
                do.a.a.d("uploadFilterImage Failed " + th, new Object[0]);
                com.crafto.android.ui.base.a.f0(d7, "Log", d7.y0(), str2, th.getMessage(), "filterPollError", 0, null, 992);
                d7.p4 = d7.p4 + 1;
                return Unit.a;
            }
        }, false, 12);
    }

    public final void b4(final String str, final Bitmap bitmap, final Bitmap bitmap2) {
        if (bitmap != null) {
            x0(new Function0() {
                public final Object invoke() {
                    FragmentActivity activity;
                    FragmentManager supportFragmentManager;
                    boolean z = D7.Q4;
                    final D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    final Bitmap bitmap3 = bitmap;
                    Intrinsics.checkNotNullParameter(bitmap3, "$removeBgBitmap");
                    final String str2 = str;
                    Intrinsics.checkNotNullParameter(str2, "$url");
                    UserConfigData e = d7.e2().e();
                    Fragment fragment = null;
                    RemoveBackgroundPopup beforePremiumRemoveBackgroundDialog = e != null ? e.getBeforePremiumRemoveBackgroundDialog() : null;
                    if (beforePremiumRemoveBackgroundDialog != null) {
                        PreferencesHelper e2 = d7.e2();
                        e2.a.edit().putBoolean(e2.D, false).apply();
                        FragmentActivity activity2 = d7.getActivity();
                        if (activity2 != null && (supportFragmentManager = activity2.getSupportFragmentManager()) != null) {
                            fragment = supportFragmentManager.findFragmentByTag("RemoveBackgroundDialogFragment");
                        }
                        if (fragment == null && (activity = d7.getActivity()) != null) {
                            com.crafto.android.ui.home.profile.a R1 = d7.R1();
                            UserConfigData e3 = d7.e2().e();
                            String title = beforePremiumRemoveBackgroundDialog.getTitle();
                            String subtitle = beforePremiumRemoveBackgroundDialog.getSubtitle();
                            String action = beforePremiumRemoveBackgroundDialog.getAction();
                            FragmentManager childFragmentManager = d7.getChildFragmentManager();
                            Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
                            Function2 function2 = new Function2() {
                                public final Object invoke(Object obj, Object obj2) {
                                    int i = 1;
                                    int i2 = 0;
                                    boolean booleanValue = ((Boolean) obj2).booleanValue();
                                    boolean z2 = D7.Q4;
                                    D7 d72 = D7.this;
                                    Intrinsics.checkNotNullParameter(d72, "this$0");
                                    Bitmap bitmap4 = bitmap3;
                                    Intrinsics.checkNotNullParameter(bitmap4, "$removeBgBitmap");
                                    String str3 = str2;
                                    Intrinsics.checkNotNullParameter(str3, "$url");
                                    D7.R4 = null;
                                    Context context = d72.getContext();
                                    if (context != null) {
                                        d72.L().getClass();
                                        Uri a = Hb.i.a(context, bitmap4, "no_bg_image.png");
                                        if (a != null) {
                                            C3624b o2 = d72.o2();
                                            AppCompatActivity a2 = Eb.E.a(d72);
                                            K6 k6 = new K6(d72, booleanValue, str3, i2);
                                            o2.getClass();
                                            Intrinsics.checkNotNullParameter(a2, "context");
                                            Intrinsics.checkNotNullParameter(a, "uri");
                                            Intrinsics.checkNotNullParameter("user", "folderPath");
                                            MultipartBody.Part d = o2.d(a2, String.valueOf(System.currentTimeMillis()), a, null);
                                            if (d != null) {
                                                Intrinsics.checkNotNullParameter("user", Constants.KEY_TYPE);
                                                Intrinsics.checkNotNullParameter(d, CTVariableUtils.FILE);
                                                a.a aVar = do.a.a;
                                                aVar.c("mytag upload multiple files - all " + d, new Object[0]);
                                                aVar.c("uploadMultipleFilesDynamic " + d, new Object[0]);
                                                z8.h hVar = o2.a;
                                                hVar.getClass();
                                                Intrinsics.checkNotNullParameter("user", Constants.KEY_TYPE);
                                                Intrinsics.checkNotNullParameter(d, CTVariableUtils.FILE);
                                                Gb.f.a(Gb.g.a(hVar.b.uploadSingleFileDynamic("user", d), hVar.a), new C1365o(k6, i), new C1366p(k6, i), false, 12);
                                            }
                                        }
                                    }
                                    return Unit.a;
                                }
                            };
                            R1.getClass();
                            com.crafto.android.ui.home.profile.a.c(activity, e3, title, subtitle, action, bitmap2, bitmap3, childFragmentManager, function2);
                        }
                    }
                    return Boolean.FALSE;
                }
            });
        }
        androidx.lifecycle.E a = androidx.lifecycle.J.a(this);
        kl.c cVar = dl.Z.a;
        dl.g.b(a, il.p.a, (dl.J) null, new T(null), 2);
    }

    @Override
    public final int c0() {
        return 2131558772;
    }

    public final void c1(QuoteData quoteData) {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "All", null, quoteData.getChangeProductServicesCTA() + " Button", 0, null, 1000);
        J9.G3 g3 = new J9.G3(this, 1);
        Intrinsics.checkNotNullParameter(g3, "onSubmit");
        B7.D d = new B7.D(g3);
        BaseActivity activity = getActivity();
        BaseActivity baseActivity = activity instanceof BaseActivity ? activity : null;
        if (baseActivity != null) {
            BaseActivity.G(baseActivity, d, false, "Edit Product Screen");
        }
    }

    public final T7.P c2() {
        return (T7.P) this.Y3.getValue();
    }

    public final void c3(MembershipPlanDetails membershipPlanDetails, Function2<? super MembershipPaymentOrderData, ? super User, Unit> function2) {
        Gb.f.a(T7.P.f(c2(), membershipPlanDetails, null, null, null, null, 30), new E8.F2(this, membershipPlanDetails, function2, 1), new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                Throwable th = (Throwable) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter(th, Constants.KEY_T);
                Intrinsics.checkNotNullParameter((Db.a) obj2, "<unused var>");
                d7.F0(2132018772);
                FragmentActivity activity = d7.getActivity();
                if (activity != null) {
                    activity.onBackPressed();
                }
                do.a.a.e(th);
                return Unit.a;
            }
        }, false, 12);
    }

    public final void c4() {
        do.a.a.c("showProgress", new Object[0]);
        androidx.lifecycle.E a = androidx.lifecycle.J.a(this);
        kl.c cVar = dl.Z.a;
        dl.g.b(a, il.p.a, (dl.J) null, new U(null), 2);
    }

    @Override
    public final void d() {
        I7.b.h();
    }

    @Override
    public final BaseActivity.a d0() {
        return new C();
    }

    public final void d1(int r23, com.crafto.android.data.model.QuoteData r24, com.crafto.android.utility.functional.AppEnums.f r25) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.d1(int, com.crafto.android.data.model.QuoteData, com.crafto.android.utility.functional.AppEnums$f):void");
    }

    public final z8.u d2() {
        return (z8.u) this.V3.getValue();
    }

    public final void d3(int i) {
        this.N4 = Long.valueOf(System.currentTimeMillis());
        Context context = getContext();
        if (context != null) {
            dl.g.b(androidx.lifecycle.J.a(this), dl.Z.a.plus(new N(CoroutineExceptionHandler.a.a)), (dl.J) null, new M(context, i, null), 2);
        }
    }

    public final void d4() {
        RemoveBackgroundPopup removeBackgroundPopup = T4;
        if (removeBackgroundPopup != null) {
            this.n4 = true;
            if (removeBackgroundPopup.getBackgroundRemovedImageUrl() == null) {
                dl.g.b(androidx.lifecycle.J.a(this), (CoroutineContext) null, (dl.J) null, new wa(this, 0, null), 3);
                return;
            }
            x0(new C1711g4(this, this.G2, new PostMedia(null, null, null, null, removeBackgroundPopup.getBackgroundRemovedImageUrl(), null, null, 0L, 0L, false, new PostMedia(null, null, null, null, removeBackgroundPopup.getOriginalImageUrl(), null, null, 0L, 0L, false, null, null, null, null, false, null, null, false, null, 524271, null), null, null, null, false, new PostMedia(null, null, null, null, removeBackgroundPopup.getBackgroundRemovedImageUrl(), null, null, 0L, 0L, false, null, null, null, null, false, null, null, false, null, 524271, null), null, false, null, 490479, null), removeBackgroundPopup.getTitle(), removeBackgroundPopup.getSubtitle(), removeBackgroundPopup.getAction(), "Home User Image Background Removal"));
        }
    }

    public final void e1(QuoteData quoteData) {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "All", null, quoteData.getChangeProductServicesCTA() + " Top Button", 0, null, 1000);
        Mb.a aVar = new Mb.a(this, 1);
        Intrinsics.checkNotNullParameter(aVar, "onSubmit");
        B7.D d = new B7.D(aVar);
        BaseActivity activity = getActivity();
        BaseActivity baseActivity = activity instanceof BaseActivity ? activity : null;
        if (baseActivity != null) {
            BaseActivity.G(baseActivity, d, false, "Edit Product Screen");
        }
    }

    @NotNull
    public final PreferencesHelper e2() {
        PreferencesHelper preferencesHelper = this.v3;
        if (preferencesHelper != null) {
            return preferencesHelper;
        }
        Intrinsics.throwUninitializedPropertyAccessException("preferencesHelper");
        return null;
    }

    public final void e3(Uri uri) {
        int i = 1;
        a.a aVar = do.a.a;
        aVar.c("processImageWithUri", new Object[0]);
        if (uri != null) {
            ArrayList e = kotlin.collections.t.e(new Uri[]{uri});
            String str = r2().I;
            String str2 = this.E2;
            String str3 = Intrinsics.areEqual(str, str2) ? a.e.V1 : Intrinsics.areEqual(r2().I, this.O2) ? a.e.W1 : Intrinsics.areEqual(r2().I, this.P2) ? a.e.X1 : null;
            aVar.c("BRAZIL_BUSINESS_PRODUCT_PHOTO -> process images", new Object[0]);
            Context context = getContext();
            if (context != null) {
                c4();
                z8.u.g(d2(), (ContextWrapper) context, e, new A9(), null, str3, false, 232);
            }
            QuoteData quoteData = this.V2;
            if (quoteData == null || !quoteData.getAddProductPhoto() || Intrinsics.areEqual(r2().I, str2)) {
                c4();
            } else {
                x0(new C1835r3(this, i));
            }
        }
    }

    public final void e4(String str, String str2) {
        FragmentManager supportFragmentManager;
        FragmentTransaction beginTransaction;
        FragmentTransaction add;
        FragmentTransaction addToBackStack;
        if (str.length() == 0) {
            return;
        }
        this.p2 = str2;
        C1808p1.v(r2(), str);
        S4 s4 = new S4(this, 0);
        Intrinsics.checkNotNullParameter(str, "searchQuery");
        Intrinsics.checkNotNullParameter(s4, "userAction");
        do.a.a.c("parentLocation ".concat(str2), new Object[0]);
        W8.e eVar = new W8.e();
        Bundle bundle = new Bundle();
        bundle.putString("search_query", str);
        bundle.putString("location", str2);
        eVar.setArguments(bundle);
        eVar.p1 = s4;
        FragmentActivity activity = getActivity();
        if (activity == null || (supportFragmentManager = activity.getSupportFragmentManager()) == null || (beginTransaction = supportFragmentManager.beginTransaction()) == null || (add = beginTransaction.add(android.R.id.content, eVar, eVar.getTag())) == null || (addToBackStack = add.addToBackStack(eVar.getTag())) == null) {
            return;
        }
        addToBackStack.commit();
    }

    public final void f1(int i, QuoteData quoteData) {
        String str;
        String slug;
        this.V2 = quoteData;
        this.X2 = true;
        C1808p1 r2 = r2();
        User user = this.W2;
        String str2 = "";
        if (user == null || (str = user.getFirstName()) == null) {
            Eb.I0.c(StringCompanionObject.INSTANCE);
            str = "";
        }
        User user2 = this.W2;
        if (user2 == null || (slug = user2.getSlug()) == null) {
            Eb.I0.c(StringCompanionObject.INSTANCE);
        } else {
            str2 = slug;
        }
        r2.E(str, str2);
        r2().u(a.e.x);
        String url = quoteData.getUrl();
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Slot", quoteData.getSlot());
        Pair pair3 = new Pair("Content Type", quoteData.getContentType());
        Pair pair4 = new Pair("Content Format", quoteData.getContentFormat());
        User user3 = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "Add Name Button", url, "Add Name", i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, new Pair("Crafto Premium State", Boolean.valueOf(user3 != null ? user3.isUserPremium() : false))}), 416);
    }

    public final Bitmap f2(int i) {
        QuoteView quoteView;
        AppCompatImageView profileIcon;
        View profileIconLayout;
        E7.G g = this.m3;
        RecyclerView.D f = g != null ? g.f(i) : null;
        if (f instanceof J8.J1) {
            QuoteView quoteView2 = ((J8.J1) f).f;
            if (quoteView2 == null || (profileIconLayout = quoteView2.getProfileIconLayout()) == null) {
                return null;
            }
            return B7.a(profileIconLayout, this);
        }
        if (!(f instanceof s8.J) || (quoteView = ((s8.J) f).g) == null || (profileIcon = quoteView.getProfileIcon()) == null) {
            return null;
        }
        j2().getClass();
        return Hb.a0.f(profileIcon);
    }

    public final void f3() {
        UserAdditionalData userBusinessData;
        UserAdditionalData userBusinessData2;
        UserAdditionalData userBusinessData3;
        UserAdditionalData userBusinessData4;
        User user;
        PostMedia noBgImage;
        String mediaURL;
        PostMedia postMedia = this.C2;
        String mediaURL2 = postMedia != null ? postMedia.getMediaURL() : null;
        PostMedia postMedia2 = this.C2;
        if (postMedia2 != null && (noBgImage = postMedia2.getNoBgImage()) != null && (mediaURL = noBgImage.getMediaURL()) != null) {
            mediaURL2 = mediaURL;
        }
        PostMedia postMedia3 = this.C2;
        if (postMedia3 != null) {
            postMedia3.setSelected(true);
        }
        User user2 = this.W2;
        if ((user2 != null ? user2.getUserBusinessData() : null) == null && (user = this.W2) != null) {
            user.setUserBusinessData(new UserAdditionalData(null, null, null, null, null, null, null, null, null, null, null, false, false, false, false, null, null, null, null, null, false, false, null, null, null, null, null, null, 0L, 0L, null, null, null, null, null, null, false, null, null, null, null, null, false, -1, 2047, null));
        }
        User user3 = this.W2;
        if (user3 != null && (userBusinessData4 = user3.getUserBusinessData()) != null) {
            userBusinessData4.setSelectedProductImage(mediaURL2);
        }
        User user4 = this.W2;
        if (user4 != null && (userBusinessData3 = user4.getUserBusinessData()) != null) {
            PostMedia postMedia4 = this.C2;
            userBusinessData3.setSelectedProductImageId(postMedia4 != null ? postMedia4.getMediaId() : null);
        }
        User user5 = this.W2;
        if (user5 != null && (userBusinessData2 = user5.getUserBusinessData()) != null) {
            PostMedia postMedia5 = this.C2;
            userBusinessData2.setNoBackgroundImageSelected(postMedia5 != null ? postMedia5.isNoBackgroundImageSelected() : null);
        }
        User user6 = this.W2;
        if (user6 != null && (userBusinessData = user6.getUserBusinessData()) != null) {
            userBusinessData.setShowBusinessProductPhoto(true);
        }
        User user7 = this.W2;
        boolean z = false;
        final Ref.ObjectRef b = W7.r.b(do.a.a, "updateUserBusinessData", new Object[0]);
        b.element = user7;
        if (user7 == null) {
            b.element = user7;
        }
        final Ab.O o = null;
        Gb.f.a(r2().x((User) b.element), new Function1() {
            public final Object invoke(Object obj) {
                boolean z2 = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Ref.ObjectRef objectRef = b;
                Intrinsics.checkNotNullParameter(objectRef, "$userData");
                Intrinsics.checkNotNullParameter((ResponseBody) obj, "it");
                d7.e2().r0((User) objectRef.element);
                d7.r2().f2.postValue(Boolean.TRUE);
                Ab.O o2 = o;
                if (o2 != null) {
                    o2.onSuccess("");
                }
                return Unit.a;
            }
        }, new C1865u0(null, 1), false, 12);
        User user8 = this.W2;
        if (user8 != null) {
            x0(new C1745j4(user8, this, z));
        }
        r2().B("true", "BUSINESS_PRODUCT_PHOTO");
    }

    public final void f4(QuoteData quoteData, Function0<Unit> function0) {
        long currentTimeMillis = System.currentTimeMillis();
        a.a aVar = do.a.a;
        aVar.c(J1.c.c(currentTimeMillis, "videoMeta startTime "), new Object[0]);
        VideoMetadata videoMetadata = quoteData.getVideoMetadata();
        StringBuilder sb = new StringBuilder("videoMeta_url ");
        sb.append(quoteData.getVideoUrl());
        sb.append("\n videoMeta videoSize ");
        sb.append(videoMetadata != null ? videoMetadata.getVideoSize() : null);
        sb.append("\n videoMeta videoDuration ");
        sb.append(videoMetadata != null ? videoMetadata.getVideoDuration() : null);
        sb.append("\n videoMeta audioBitrate ");
        sb.append(videoMetadata != null ? videoMetadata.getAudioBitrate() : null);
        sb.append("\n videoMeta videoBitrate ");
        sb.append(videoMetadata != null ? videoMetadata.getVideoBitrate() : null);
        sb.append("\n videoMeta totalFrames ");
        sb.append(videoMetadata != null ? videoMetadata.getTotalFrames() : null);
        aVar.c(sb.toString(), new Object[0]);
        UserConfigData e = e2().e();
        if (e == null || !e.getShowVideoHdDialog()) {
            function0.invoke();
            return;
        }
        com.crafto.android.ui.base.a.f0(this, "Landed", "Home Screen", "Video Quality Dialog", null, null, 0, null, 1016);
        quoteData.setDownloadQuality("HD");
        function0.invoke();
    }

    public final void g1(QuoteData quoteData) {
        PostPaymentData t = e2().t();
        QuotesCategory quotesCategory = this.S3;
        if (quotesCategory != null && quotesCategory.getName() != null && t != null) {
            t.setCategory(T1(this.V1));
        }
        if (t != null) {
            Integer identifier = quoteData.getIdentifier();
            t.setQuoteId(identifier != null ? identifier.toString() : null);
        }
        e2().i0(t, false);
    }

    public final Bitmap g2(final int i, final QuoteData quoteData, final QuoteView quoteView) {
        final Ref.ObjectRef b = W7.r.b(do.a.a, "getQuoteLayoutBitmapForVideo", new Object[0]);
        x0(new Function0() {
            public final Object invoke() {
                View quoteShareLayout;
                View quoteShareLayout2;
                View quoteShareLayout3;
                View quoteShareLayout4;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Ref.ObjectRef objectRef = b;
                Intrinsics.checkNotNullParameter(objectRef, "$bitmap");
                E7.G g = d7.m3;
                RecyclerView.D f = g != null ? g.f(i) : null;
                QuoteView quoteView2 = quoteView;
                if (quoteView2 == null) {
                    J8.J1 j1 = f instanceof J8.J1 ? (J8.J1) f : null;
                    quoteView2 = j1 != null ? j1.f : null;
                }
                if (quoteView2 != null) {
                    IntRange intRange = new IntRange(201, 250, 1);
                    QuoteData quoteData2 = quoteData;
                    Integer valueOf = quoteData2 != null ? Integer.valueOf(quoteData2.getDesign()) : null;
                    if ((valueOf != null && intRange.l(valueOf.intValue())) || (quoteData2 != null && quoteData2.getDesign() == 76)) {
                        View quoteShareLayout5 = quoteView2.getQuoteShareLayout();
                        if (quoteShareLayout5 == null) {
                            return null;
                        }
                        objectRef.element = B7.a(quoteShareLayout5, d7);
                        return Unit.a;
                    }
                }
                if (f instanceof J8.J1) {
                    QuoteView quoteView3 = ((J8.J1) f).f;
                    if (quoteView3 == null || (quoteShareLayout4 = quoteView3.getQuoteShareLayout()) == null) {
                        return null;
                    }
                    objectRef.element = B7.a(quoteShareLayout4, d7);
                    return Unit.a;
                }
                if (f instanceof C0323j1) {
                    QuoteView quoteView4 = ((C0323j1) f).g;
                    if (quoteView4 == null || (quoteShareLayout3 = quoteView4.getQuoteShareLayout()) == null) {
                        return null;
                    }
                    objectRef.element = B7.a(quoteShareLayout3, d7);
                    return Unit.a;
                }
                if (f instanceof s8.J) {
                    QuoteView quoteView5 = ((s8.J) f).g;
                    if (quoteView5 == null || (quoteShareLayout2 = quoteView5.getQuoteShareLayout()) == null) {
                        return null;
                    }
                    objectRef.element = B7.a(quoteShareLayout2, d7);
                    return Unit.a;
                }
                if (!(f instanceof E8.T5)) {
                    return Boolean.FALSE;
                }
                QuoteView quoteView6 = ((E8.T5) f).j;
                if (quoteView6 == null || (quoteShareLayout = quoteView6.getQuoteShareLayout()) == null) {
                    return null;
                }
                objectRef.element = B7.a(quoteShareLayout, d7);
                return Unit.a;
            }
        });
        return (Bitmap) b.element;
    }

    public final void g4() {
        RelativeLayout relativeLayout;
        TextView textView;
        String string;
        Translations translation;
        ProgressBar progressBar;
        C3053c2 c3053c2 = (C3053c2) this.y;
        if (c3053c2 != null && (progressBar = c3053c2.v2) != null) {
            progressBar.setIndeterminate(false);
        }
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 != null && (textView = c3053c22.w2) != null) {
            UserConfigData e = e2().e();
            if (e == null || (translation = e.getTranslation()) == null || (string = translation.getProcessingVideo()) == null) {
                string = getString(2132018389);
                Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
            }
            textView.setText(string);
        }
        C3053c2 c3053c23 = (C3053c2) this.y;
        if (c3053c23 == null || (relativeLayout = c3053c23.x2) == null) {
            return;
        }
        Eb.X0.V(relativeLayout);
    }

    public final void h1(int r21, android.view.View r22, com.crafto.android.data.model.QuoteData r23, com.crafto.android.utility.functional.AppEnums.f r24) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.h1(int, android.view.View, com.crafto.android.data.model.QuoteData, com.crafto.android.utility.functional.AppEnums$f):void");
    }

    public final int h2(String str, ArrayList arrayList) {
        Object obj;
        Object obj2;
        r2().getClass();
        String str2 = C1808p1.i3;
        if (str2 != null && !StringsKt.J(str2)) {
            if (!StringsKt.J(str)) {
                Iterator it = arrayList.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        obj2 = null;
                        break;
                    }
                    obj2 = it.next();
                    if (((QuotesCategory) obj2).getSelected()) {
                        break;
                    }
                }
                QuotesCategory quotesCategory = (QuotesCategory) obj2;
                if (quotesCategory != null) {
                    quotesCategory.setSelected(false);
                }
            }
            Iterator it2 = arrayList.iterator();
            while (true) {
                if (!it2.hasNext()) {
                    obj = null;
                    break;
                }
                obj = it2.next();
                if (Intrinsics.areEqual(((QuotesCategory) obj).getValue(), str)) {
                    break;
                }
            }
            QuotesCategory quotesCategory2 = (QuotesCategory) obj;
            if (quotesCategory2 != null) {
                quotesCategory2.setSelected(true);
                if (!r2().n) {
                    C1808p1.i3 = null;
                }
            }
        }
        Iterator it3 = arrayList.iterator();
        int i = 0;
        while (it3.hasNext()) {
            int i2 = i + 1;
            if (((QuotesCategory) it3.next()).getSelected()) {
                return i;
            }
            i = i2;
        }
        ((QuotesCategory) arrayList.get(0)).setSelected(true);
        return 0;
    }

    public final void h3(final QuoteData quoteData, final AppEnums.f fVar, final boolean z, final int i, final Bitmap bitmap, final boolean z2) {
        final Ref.ObjectRef b = W7.r.b(do.a.a, "processVideoWithProfileImage--", new Object[0]);
        final Ref.ObjectRef objectRef = new Ref.ObjectRef();
        x0(new Function0() {
            public final Object invoke() {
                QuoteView quoteView;
                View bottomOverlayLayout;
                Bitmap a;
                boolean z3 = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Ref.ObjectRef objectRef2 = b;
                Intrinsics.checkNotNullParameter(objectRef2, "$imageUri");
                Ref.ObjectRef objectRef3 = objectRef;
                Intrinsics.checkNotNullParameter(objectRef3, "$bottomOverlayImageUri");
                AppEnums.f fVar2 = fVar;
                Intrinsics.checkNotNullParameter(fVar2, "$clickType");
                Context context = d7.getContext();
                if (context == null) {
                    return null;
                }
                boolean z4 = z2;
                int i2 = i;
                Bitmap bitmap2 = bitmap;
                QuoteData quoteData2 = quoteData;
                boolean z5 = z;
                if (!z4) {
                    return dl.g.b(androidx.lifecycle.J.a(d7), dl.Z.a, (dl.J) null, new K9(d7, bitmap2, objectRef2, context, objectRef3, quoteData2, fVar2, z5, i2, null), 2);
                }
                E7.G g = d7.m3;
                RecyclerView.D f = g != null ? g.f(i2) : null;
                C2326I c2326i = f instanceof C2326I ? (C2326I) f : null;
                if (c2326i == null || (quoteView = c2326i.c) == null || (bottomOverlayLayout = quoteView.getBottomOverlayLayout()) == null || (a = B7.a(bottomOverlayLayout, d7)) == null) {
                    return null;
                }
                return dl.g.b(androidx.lifecycle.J.a(d7), dl.Z.a, (dl.J) null, new I9(d7, a, bitmap2, objectRef2, context, objectRef3, quoteData2, fVar2, z5, i2, null), 2);
            }
        });
    }

    public final void i1(com.crafto.android.data.model.AddAnniversaryAlarmData r10, android.view.View r11) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.i1(com.crafto.android.data.model.AddAnniversaryAlarmData, android.view.View):void");
    }

    public final void i3(int i, QuoteData quoteData) {
        User user = this.W2;
        if (user == null || !Intrinsics.areEqual(user.isLogFirstContent(), Boolean.TRUE)) {
            return;
        }
        String type = quoteData.getType();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        String contentType = quoteData.getContentType();
        Pair pair2 = new Pair("Content Type", (contentType == null || StringsKt.J(contentType)) ? "QUOTE" : quoteData.getContentType());
        Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
        User user2 = this.W2;
        com.crafto.android.ui.base.a.f0(this, "First Profile Picture Loaded", "Home Screen", name, type, null, i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, new Pair("Crafto Premium State", Boolean.valueOf(user2 != null ? user2.isUserPremium() : false)), new Pair("Source", quoteData.getUrl())}), 432);
    }

    @Override
    public final void j(final I7.m mVar, final int i, @NotNull AppEnums.f.b1 b1Var, final PlaybackException playbackException) {
        Intrinsics.checkNotNullParameter(b1Var, "clickType");
        I7.b.e(b1Var);
        if (this.t4) {
            x0(new Function0() {
                public final Long e = 0L;

                public final Object invoke() {
                    String str;
                    String str2;
                    boolean z = D7.Q4;
                    D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    do.a.a.c("logging exception event start #1 - exo", new Object[0]);
                    QuotesCategory quotesCategory = d7.r2().m;
                    String name = quotesCategory != null ? quotesCategory.getName() : null;
                    HashMap hashMap = new HashMap();
                    I7.a aVar = mVar;
                    if (aVar instanceof QuoteData) {
                        QuoteData quoteData = (QuoteData) aVar;
                        str = quoteData.getAddBusinessProductPhoto() ? com.crafto.android.utility.a.c : quoteData.getUrl();
                        hashMap.put("Template Id", Integer.valueOf(quoteData.getDesign()));
                        hashMap.put("Slot", quoteData.getSlot());
                        hashMap.put("Content Type", quoteData.getContentType());
                        hashMap.put("Content Format", quoteData.getContentFormat());
                        User user = d7.W2;
                        hashMap.put("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false));
                        hashMap.put("Original Photo Size", Integer.valueOf((int) quoteData.getOriginalPhotoSize()));
                        hashMap.put("Original Name Size", Integer.valueOf((int) quoteData.getOriginalNameSize()));
                        hashMap.put("New Photo Size", Integer.valueOf((int) (quoteData.getOriginalPhotoSize() + quoteData.getPhotoResizeBy())));
                        hashMap.put("New Name Size", Integer.valueOf((int) (quoteData.getOriginalNameSize() + quoteData.getNameResizeBy())));
                        hashMap.put("isShareWithNameEnabled", quoteData.isShareWithNameEnabled());
                        hashMap.put("isShareWithNameForTwitterUI", quoteData.isShareWithNameForTwitterUI());
                        hashMap.put("hidePhotoInFeeds", quoteData.getHidePhotoInFeeds());
                        hashMap.put("isShareWithPhotoEnabled", Boolean.valueOf(quoteData.isShareWithPhotoEnabled()));
                        hashMap.put("variantType", quoteData.getVariantType());
                        hashMap.put("Content Text", quoteData.getContentText());
                    } else {
                        str = null;
                    }
                    PlaybackException playbackException2 = playbackException;
                    if (playbackException2 != null) {
                        hashMap.put("Message", playbackException2.getMessage());
                        hashMap.put("Localised Message", playbackException2.getLocalizedMessage());
                        StackTraceElement[] stackTrace = playbackException2.getStackTrace();
                        Intrinsics.checkNotNullExpressionValue(stackTrace, "getStackTrace(...)");
                        hashMap.put("Stack Trace", D7.l2(stackTrace));
                        Throwable[] suppressed = playbackException2.getSuppressed();
                        Intrinsics.checkNotNullExpressionValue(suppressed, "getSuppressed(...)");
                        hashMap.put("Suppressed", D7.m2(suppressed));
                        hashMap.put("Cause", playbackException2.getCause());
                        str2 = name;
                        hashMap.put("Timestamp Milliseconds", Long.valueOf(playbackException2.b));
                        try {
                            Intrinsics.checkNotNullParameter(playbackException2, "<this>");
                            Iterator it = Ok.b.a.b(playbackException2).iterator();
                            int i2 = 0;
                            while (it.hasNext()) {
                                Object next = it.next();
                                int i3 = i2 + 1;
                                if (i2 < 0) {
                                    kotlin.collections.t.m();
                                    throw null;
                                }
                                Throwable th = (Throwable) next;
                                StringBuilder sb = new StringBuilder();
                                sb.append("Suppressed Exception");
                                Iterator it2 = it;
                                sb.append(' ');
                                sb.append(i2);
                                sb.append(' ');
                                sb.append("Message");
                                hashMap.put(sb.toString(), th.getMessage());
                                hashMap.put("Suppressed Exception " + i2 + " Localised Message", th.getLocalizedMessage());
                                StackTraceElement[] stackTrace2 = th.getStackTrace();
                                Intrinsics.checkNotNullExpressionValue(stackTrace2, "getStackTrace(...)");
                                hashMap.put("Suppressed Exception " + i2 + " Stack Trace", D7.l2(stackTrace2));
                                Throwable[] suppressed2 = th.getSuppressed();
                                Intrinsics.checkNotNullExpressionValue(suppressed2, "getSuppressed(...)");
                                hashMap.put("Suppressed Exception " + i2 + " Suppressed", D7.m2(suppressed2));
                                hashMap.put("Suppressed Exception " + i2 + " Cause", th.getCause());
                                i2 = i3;
                                it = it2;
                            }
                        } catch (Exception unused) {
                        }
                    } else {
                        str2 = name;
                    }
                    hashMap.put("Duration", this.e);
                    String y02 = d7.y0();
                    int i4 = i;
                    com.crafto.android.ui.base.a.f0(d7, "Video Load Status", y02, str2, str, "Video Load Exception", i4, hashMap, 416);
                    com.crafto.android.ui.base.a.f0(d7, "Landed", "Retry", null, null, "Retry", i4, null, 940);
                    return Unit.a;
                }
            });
            do.a.a.c("logging exception event start #2 - exo", new Object[0]);
        }
    }

    public final void j1(int i, QuoteData quoteData) {
        ArrayList<I7.m> arrayList;
        int i2 = 1;
        do.a.a.c("captionImageChange position " + i + ' ' + quoteData.getDynamicImageUri(), new Object[0]);
        E7.G g = this.m3;
        if (g != null && (arrayList = g.l) != null) {
            x0(new L8.T(quoteData, arrayList, this, i2));
        }
        String type = quoteData.getType();
        QuotesCategory quotesCategory = r2().m;
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", quotesCategory != null ? quotesCategory.getName() : null, type, "captionImageChange", i, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", Integer.valueOf(quoteData.getDesign())), new Pair("Content Type", quoteData.getContentType()), new Pair("Content Format", quoteData.getContentFormat())}), 416);
    }

    @NotNull
    public final Hb.a0 j2() {
        Hb.a0 a0Var = this.D3;
        if (a0Var != null) {
            return a0Var;
        }
        Intrinsics.throwUninitializedPropertyAccessException("shareUtil");
        return null;
    }

    public final void j3(QuotesSupportData quotesSupportData) {
        do.a.a.c("SUPPORT", new Object[0]);
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, null, "Support Widget", 0, null, 1004);
        if (quotesSupportData == null) {
            quotesSupportData = null;
        }
        if (quotesSupportData != null) {
            if (e2().a.getBoolean("fb_messenger_flag", false) || e2().a.getBoolean("whatsapp_flag", false)) {
                Hb.C X1 = X1();
                FragmentActivity activity = getActivity();
                PreferencesHelper e2 = e2();
                C1852s9 c1852s9 = new C1852s9(this);
                X1.getClass();
                Intrinsics.checkNotNullParameter(e2, "preferencesHelper");
                Intrinsics.checkNotNullParameter(this, "fragment");
                if (activity != null) {
                    try {
                        Ce a = Ce.a(LayoutInflater.from(activity));
                        Intrinsics.checkNotNullExpressionValue(a, "inflate(...)");
                        com.google.android.material.bottomsheet.h hVar = new com.google.android.material.bottomsheet.h(activity, 2132082703);
                        hVar.getBehavior().w(3);
                        boolean z = e2.a.getBoolean("whatsapp_flag", false);
                        LinearLayout linearLayout = a.d;
                        if (!z && linearLayout != null) {
                            Eb.X0.l(linearLayout);
                        }
                        boolean z2 = e2.a.getBoolean("fb_messenger_flag", false);
                        LinearLayout linearLayout2 = a.c;
                        if (!z2 && linearLayout2 != null) {
                            Eb.X0.l(linearLayout2);
                        }
                        if (linearLayout != null) {
                            linearLayout.setOnClickListener(new Hb.y(quotesSupportData, c1852s9, hVar, X1, activity));
                        }
                        if (linearLayout2 != null) {
                            linearLayout2.setOnClickListener(new Hb.z(activity, quotesSupportData, c1852s9, hVar));
                        }
                        LinearLayout linearLayout3 = a.b;
                        if (linearLayout3 != null) {
                            linearLayout3.setOnClickListener(new Hb.A(activity, quotesSupportData, c1852s9, hVar));
                        }
                        hVar.setContentView(a.a);
                        hVar.show();
                    } catch (Exception e) {
                        do.a.a.e(e);
                    }
                }
                com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "Support Sheet", null, "Landed", 0, null, 1000);
            }
        }
    }

    public final void j4() {
        int i = 1;
        int i2 = 3;
        do.a.a.c("cropStyle_ #2 " + this.B2, new Object[0]);
        Context context = getContext();
        if (context != null && Intrinsics.areEqual(Eb.D.f(context), Boolean.TRUE)) {
            com.crafto.android.ui.base.a.f0(this, "Landed", "Developer Options Setting Dialog", null, null, null, 0, null, 1020);
            Hb.C X1 = X1();
            FragmentActivity activity = getActivity();
            Na.d dVar = new Na.d(this, i);
            Ga.J8 j82 = new Ga.J8(this, i2);
            X1.getClass();
            Hb.C.h(activity, dVar, j82);
            return;
        }
        UserConfigData e = e2().e();
        int i3 = Build.VERSION.SDK_INT;
        i.c<i.j> cVar = this.k4;
        if (i3 >= 34) {
            this.d = new Ga.K8(this, i2);
            Pb.h.e(Z1(), cVar);
            return;
        }
        if (e != null && e.getUseDefaultGalleryPicker()) {
            FragmentActivity activity2 = getActivity();
            if (activity2 != null) {
                String[] strArr = Hb.I.a;
                if (Hb.I.b(activity2, this.f)) {
                    this.i4 = null;
                    S2();
                    return;
                }
                return;
            }
            return;
        }
        if (e != null && e.getUseGoogleGalleryPicker()) {
            this.d = new Ga.M8(this, i2);
            Pb.h.e(Z1(), cVar);
            return;
        }
        if (e == null || !e.getUseThirdPartyImagePicker()) {
            this.d = new C1466m(this, 2);
            Pb.h.f(Z1(), M(), this.e, (String) null, false, 28);
            return;
        }
        this.d = new Ga.N8(this, 4);
        w0();
        D5.g gVar = this.b;
        if (gVar != null) {
            Pb.h.c(Z1(), gVar);
        }
    }

    @Override
    public final void k0(@NotNull final Bundle bundle, @NotNull final String str) {
        Intrinsics.checkNotNullParameter(str, "requestKey");
        Intrinsics.checkNotNullParameter(bundle, "bundle");
        x0(new Function0() {
            public final Object invoke() {
                boolean z = D7.Q4;
                String str2 = str;
                Intrinsics.checkNotNullParameter(str2, "$requestKey");
                Bundle bundle2 = bundle;
                Intrinsics.checkNotNullParameter(bundle2, "$bundle");
                D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                a.a aVar = do.a.a;
                aVar.c("onFragmentResultListener " + str2 + ' ' + bundle2, new Object[0]);
                String string = bundle2.getString(a.e.t);
                String string2 = bundle2.getString(a.e.s);
                if ((Intrinsics.areEqual(string, "MembershipPlanOptionsWithPreviewDifferenceFragment") && Intrinsics.areEqual(string2, "VIDEO")) || D7.t1(d7.x2)) {
                    aVar.c("quotesListAdapter?.notifyItemChanged 1", new Object[0]);
                }
                return Unit.a;
            }
        });
    }

    public final void k1(int i, QuoteData quoteData) {
        Q3();
        String url = quoteData.getUrl();
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Slot", quoteData.getSlot());
        Pair pair3 = new Pair("Content Type", quoteData.getContentType());
        Pair pair4 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Birthday Name Dialog", "Update Birthday Name", url, "Edit Name", i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false))}), 416);
    }

    @NotNull
    public final Ab.M k2() {
        Ab.M m = this.u3;
        if (m != null) {
            return m;
        }
        Intrinsics.throwUninitializedPropertyAccessException("singletonData");
        return null;
    }

    public final void k3() {
        ArrayList<I7.m> arrayList;
        UserAdditionalData userBusinessData;
        E7.G g = this.m3;
        if (g == null || (arrayList = g.l) == null) {
            return;
        }
        Iterator<I7.m> it = arrayList.iterator();
        Intrinsics.checkNotNullExpressionValue(it, "iterator(...)");
        while (it.hasNext()) {
            I7.m next = it.next();
            Intrinsics.checkNotNullExpressionValue(next, "next(...)");
            I7.m mVar = next;
            if (mVar instanceof InitData) {
                InitData initData = (InitData) mVar;
                Widget widget = initData.getWidget();
                if ((widget != null ? widget.getData() : null) instanceof QuoteData) {
                    Widget widget2 = initData.getWidget();
                    I7.m data = widget2 != null ? widget2.getData() : null;
                    Intrinsics.checkNotNull(data, "null cannot be cast to non-null type com.crafto.android.data.model.QuoteData");
                    User user = ((QuoteData) data).getUser();
                    if (user != null && (userBusinessData = user.getUserBusinessData()) != null) {
                        userBusinessData.setShowBusinessProductPhoto(false);
                    }
                }
            }
        }
        E7.G g2 = this.m3;
        if (g2 != null) {
            g2.notifyDataSetChanged();
        }
    }

    public final void k4(QuoteData quoteData, PlanData planData) {
        MembershipPlanDetails membershipPlanDetails;
        GooglePlayBillingData googlePlayBillingData;
        ArrayList<MembershipPlanDetails> premiumPlan;
        Object obj;
        MembsershipDetailsData n = e2().n();
        if (n == null || (premiumPlan = n.getPremiumPlan()) == null) {
            membershipPlanDetails = null;
        } else {
            Iterator<T> it = premiumPlan.iterator();
            while (true) {
                if (!it.hasNext()) {
                    obj = null;
                    break;
                } else {
                    obj = it.next();
                    if (Intrinsics.areEqual(((MembershipPlanDetails) obj).getPlanId(), planData != null ? planData.getIdentifier() : null)) {
                        break;
                    }
                }
            }
            membershipPlanDetails = (MembershipPlanDetails) obj;
        }
        if (membershipPlanDetails != null) {
            MembsershipDetailsData n2 = e2().n();
            if (quoteData == null || !quoteData.isSpecialDayVideo()) {
                K().j = null;
            } else {
                K().j = quoteData != null ? quoteData.getVideoUri() : null;
            }
            z0(membershipPlanDetails, (n2 == null || (googlePlayBillingData = n2.getGooglePlayBillingData()) == null) ? false : Intrinsics.areEqual(googlePlayBillingData.getShowCheckoutScreenAsDialog(), Boolean.TRUE), y0(), new a9.f(1, this, n2));
        }
    }

    @Override
    public final void l(I7.a aVar, int i, @NotNull AppEnums.f fVar, @NotNull View view) {
        Intrinsics.checkNotNullParameter(fVar, "clickType");
        Intrinsics.checkNotNullParameter(view, "view");
        do.a.a.c("mytag quote listen #1 " + fVar, new Object[0]);
        this.h2 = i;
        x0(new Q3(this, aVar, fVar, i, view));
    }

    public final java.lang.Object l3(int r24, java.io.File[] r25, int r26, boolean r27, int r28, Kk.c<? super java.io.File[]> r29) {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.l3(int, java.io.File[], int, boolean, int, Kk.c):java.lang.Object");
    }

    public final void l4() {
        BaseActivity.a aVar = this.i;
        if (aVar != null) {
            aVar.l(new xa(this));
        }
    }

    public final void m1(int i, QuoteData quoteData) {
        int i2 = 2;
        this.V2 = quoteData;
        Ref.BooleanRef booleanRef = new Ref.BooleanRef();
        int design = quoteData.getDesign();
        if (52 <= design && design < 56 && com.crafto.android.utility.a.f) {
            x0(new J9.M5(i2, this, booleanRef));
        }
        x2();
        Boolean isNameEnabledQuote = quoteData.isNameEnabledQuote();
        String variantType = quoteData.getVariantType();
        if (variantType == null) {
            Eb.I0.c(StringCompanionObject.INSTANCE);
            variantType = "";
        }
        l1(this, i, isNameEnabledQuote, variantType, false, booleanRef.element);
        String y02 = y0();
        String type = quoteData.getType();
        String url = quoteData.getUrl();
        QuotesCategory quotesCategory = r2().m;
        Integer num = null;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Slot", quoteData.getSlot());
        Pair pair3 = new Pair("Content Type", quoteData.getContentType());
        Pair pair4 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        Pair pair5 = new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false));
        Integer frameId = quoteData.getFrameId();
        if (frameId == null) {
            ImageGuidelines imageGuidelines = quoteData.getImageGuidelines();
            if (imageGuidelines != null) {
                num = imageGuidelines.getFrameId();
            }
        } else {
            num = frameId;
        }
        com.crafto.android.ui.base.a.f0(this, "Design Change", y02, name, url, type, i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, pair5, new Pair("Frame Id", num)}), 416);
    }

    public final void m4() {
        int i = 1;
        try {
            do.a.a.c("startSystemGalleryActivity", new Object[0]);
            UserConfigData e = e2().e();
            int i2 = Build.VERSION.SDK_INT;
            i.c<i.j> cVar = this.k4;
            if (i2 >= 34) {
                this.d = new C1256m(this, 3);
                UserConfigData e2 = e2().e();
                if (e2 == null || !e2.getUseActionGalleryPicker()) {
                    Pb.h.e(Z1(), cVar);
                } else {
                    Intent intent = new Intent("android.intent.action.PICK");
                    intent.setType("image/*");
                    this.j4.launch(intent);
                }
            } else {
                FragmentActivity activity = getActivity();
                if (activity != null) {
                    String[] strArr = Hb.I.a;
                    if (Hb.I.b(activity, this.f)) {
                        if (e != null && e.getUseDefaultGalleryPicker()) {
                            this.i4 = "System Gallery";
                            S2();
                        } else if (e != null && e.getUseGoogleGalleryPicker()) {
                            this.d = new C1258n(this, 2);
                            Pb.h.e(Z1(), cVar);
                        } else if (e == null || !e.getUseThirdPartyImagePicker()) {
                            this.d = new E8.z6(this, i);
                            Pb.h.f(Z1(), M(), this.e, (String) null, false, 28);
                        } else {
                            this.d = new E7.C(this, 4);
                            w0();
                            D5.g gVar = this.b;
                            if (gVar != null) {
                                Pb.h.c(Z1(), gVar);
                            }
                        }
                    }
                }
            }
        } catch (Exception e3) {
            do.a.a.e(e3);
        }
    }

    @Override
    public final void n0() {
        do.a.a.c("mytag on page selected", new Object[0]);
    }

    public final void n1(int i, QuoteData quoteData) {
        if ((quoteData == null ? null : quoteData) != null) {
            x0(new C1247h0(1, this, quoteData));
        }
        E7.G g = this.m3;
        if (g != null) {
            g.notifyItemChanged(i);
        }
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, null, "Change Quotes Design", 0, null, 1004);
    }

    public final Bitmap n2(int i, QuoteData quoteData, QuoteView quoteView) {
        Ref.ObjectRef b = W7.r.b(do.a.a, "getTopLayoutBitmapForVideo", new Object[0]);
        x0(new Ga.E3(this, i, quoteView, quoteData, b));
        return (Bitmap) b.element;
    }

    public final void n3(int i, QuoteData quoteData) {
        String type = quoteData.getType();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        String contentType = quoteData.getContentType();
        Pair pair2 = new Pair("Content Type", (contentType == null || StringsKt.J(contentType)) ? "QUOTE" : quoteData.getContentType());
        Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Log", "Home Screen", name, type, "Scale", i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false)), new Pair("Source", quoteData.getUrl())}), 416);
    }

    public final void n4(QuoteData quoteData) {
        HelpButton helpButton;
        HelpButton helpButton2;
        HelpButton helpButton3;
        HelpButton helpButton4;
        User user = quoteData.getUser();
        String str = null;
        if (user == null || (helpButton3 = user.getHelpButton()) == null || !helpButton3.getShowWhatsappHelpOption()) {
            Hb.H b2 = b2();
            FragmentActivity activity = getActivity();
            User user2 = this.W2;
            String link = (user2 == null || (helpButton = user2.getHelpButton()) == null) ? null : helpButton.getLink();
            b2.getClass();
            Hb.H.e(activity, link);
        } else {
            Hb.H b22 = b2();
            FragmentActivity activity2 = getActivity();
            User user3 = this.W2;
            String link2 = (user3 == null || (helpButton4 = user3.getHelpButton()) == null) ? null : helpButton4.getLink();
            b22.getClass();
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setData(Uri.parse(link2));
            if (activity2 != null) {
                activity2.startActivity(intent);
            }
        }
        User user4 = this.W2;
        if (user4 != null && (helpButton2 = user4.getHelpButton()) != null) {
            str = helpButton2.getLink();
        }
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, str, "Help Clicked", 0, null, 996);
    }

    public final void o1(int i, QuoteData quoteData) {
        a.a aVar = do.a.a;
        aVar.c("CHANGE_GREET_NAME_", new Object[0]);
        String greetingText = quoteData.getGreetingText();
        aVar.c("showAddNameDialog__1", new Object[0]);
        Hb.C X1 = X1();
        FragmentManager childFragmentManager = getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        C1174z0 c1174z0 = new C1174z0(1, quoteData, this);
        Boolean bool = Boolean.TRUE;
        X1.getClass();
        Hb.C.e(childFragmentManager, greetingText, c1174z0, bool);
        String url = quoteData.getUrl();
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        Pair pair2 = new Pair("Slot", quoteData.getSlot());
        Pair pair3 = new Pair("Content Type", quoteData.getContentType());
        Pair pair4 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Greet Name Dialog", "Add name in GM", url, "Edit Name", i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, pair4, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false))}), 416);
    }

    public final C3624b o2() {
        return (C3624b) this.X3.getValue();
    }

    public final void o3(final AddAnniversaryAlarmData addAnniversaryAlarmData, final int i) {
        Hb.C X1 = X1();
        FragmentManager childFragmentManager = getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        String selectedAnniversaryAlarmMonthTitle = addAnniversaryAlarmData.getSelectedAnniversaryAlarmMonthTitle();
        Function2 function2 = new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                String str = (String) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                AddAnniversaryAlarmData addAnniversaryAlarmData2 = addAnniversaryAlarmData;
                Intrinsics.checkNotNullParameter(addAnniversaryAlarmData2, "$click");
                com.crafto.android.ui.base.a.f0(d7, "Click Action", "Birthday reminder widget", null, d7.i2, "Month Enter", 0, null, 996);
                addAnniversaryAlarmData2.setSelectedAnniversaryAlarmMonthTitle(str);
                addAnniversaryAlarmData2.setSelectedAnniversaryAlarmMonth((Integer) obj2);
                E7.G g = d7.m3;
                RecyclerView.D f = g != null ? g.f(i) : null;
                C2346k.a aVar = f instanceof C2346k.a ? (C2346k.a) f : null;
                if (aVar != null) {
                    ((C3039b5) aVar.a).b.setText(str);
                }
                return Unit.a;
            }
        };
        X1.getClass();
        Hb.C.g(childFragmentManager, 2, selectedAnniversaryAlarmMonthTitle, function2);
    }

    public final void o4(Uri uri) {
        int i = 1;
        String str = r2().I;
        String str2 = this.E2;
        if (Intrinsics.areEqual(str, str2)) {
            this.h4 = uri;
        }
        C3624b.h(o2(), Eb.E.a(this), kotlin.collections.t.e(new Uri[]{uri}), new H3(i, this));
        this.g4 = uri;
        Pb.h.a(Z1(), M(), uri, this, false, !Intrinsics.areEqual(r2().I, str2) ? "SQUARE" : null, false, (Float) null, (Float) null, 464);
    }

    @Override
    public final void onActivityResult(int i, int i2, Intent intent) {
        User user;
        String slug;
        int i3 = 1;
        super.onActivityResult(i, i2, intent);
        do.a.a.c("TrendingHomeFullScreenExpFragment onActivityResult", new Object[0]);
        try {
            Iterator it = getChildFragmentManager().getFragments().iterator();
            while (it.hasNext()) {
                ((Fragment) it.next()).onActivityResult(i, i2, intent);
            }
            if (i2 == -1) {
                if (i == a.e.a2) {
                    Uri data = intent != null ? intent.getData() : null;
                    QuoteData quoteData = this.V2;
                    Integer cropWidth = quoteData != null ? quoteData.getCropWidth() : null;
                    QuoteData quoteData2 = this.V2;
                    q3(data, cropWidth, quoteData2 != null ? quoteData2.getCropHeight() : null);
                    return;
                }
                if (i == a.e.k2) {
                    do.a.a.c("REQUEST_CODE_CAMERA", new Object[0]);
                    Hb.i L2 = L();
                    BaseActivity a = Eb.E.a(this);
                    L2.getClass();
                    Uri j = Hb.i.j(a);
                    if (j != null) {
                        AppCompatActivity a2 = Eb.E.a(this);
                        String uri = j.toString();
                        Intrinsics.checkNotNullExpressionValue(uri, "toString(...)");
                        Eb.X0.c(a2, uri, new D(j));
                        return;
                    }
                    return;
                }
                if (i == 1151) {
                    a.a aVar = do.a.a;
                    aVar.c("RESULT_OK - RC_PAYMENT_STATUS", new Object[0]);
                    aVar.c("checkPaymentStatus", new Object[0]);
                    User user2 = this.W2;
                    if (user2 == null || (slug = user2.getSlug()) == null) {
                        return;
                    }
                    Gb.f.a(r2().k(slug, false), new Ja.C(this, i3), new C1780m6(), false, 12);
                    return;
                }
                if (i != 69) {
                    if (i == a.e.j2) {
                        Uri data2 = intent != null ? intent.getData() : null;
                        Intrinsics.checkNotNull(data2);
                        if (getContext() != null) {
                            String uri2 = data2.toString();
                            Intrinsics.checkNotNullExpressionValue(uri2, "toString(...)");
                            Uri uri3 = a.c.a;
                            if (StringsKt.C(uri2, ".Statuses", false)) {
                                requireActivity().getContentResolver().takePersistableUriPermission(data2, 1);
                                PreferencesHelper e2 = e2();
                                e2.a.edit().putString(e2.K, data2.toString()).apply();
                                PreferencesHelper e22 = e2();
                                e22.a.edit().putBoolean(e22.L, true).apply();
                                com.crafto.android.ui.base.a.f0(this, "Log", "Whatsapp status loaded", null, null, "Whatsapp status folder permission granted", 0, null, 1004);
                            }
                            v4();
                            H3(true);
                            InitData initData = this.l3;
                            if (initData != null) {
                                r2().o(new WeakReference<>(getActivity()), initData);
                                return;
                            }
                            return;
                        }
                        return;
                    }
                    return;
                }
                Intrinsics.checkNotNull(intent);
                this.y4 = UCrop.getOutput(intent);
                d2().e = true;
                if (this.j2) {
                    Uri uri4 = this.y4;
                    if (uri4 != null) {
                        AppCompatActivity a3 = Eb.E.a(this);
                        String uri5 = uri4.toString();
                        Intrinsics.checkNotNullExpressionValue(uri5, "toString(...)");
                        Eb.X0.c(a3, uri5, new J7(this, uri4));
                        return;
                    }
                    return;
                }
                if (Intrinsics.areEqual(r2().I, this.G2)) {
                    UserConfigData e = e2().e();
                    if ((e != null ? e.getBeforePremiumRemoveBackgroundDialog() : null) != null && ((user = this.W2) == null || !user.isUserPremium())) {
                        Uri uri6 = this.y4;
                        do.a.a.c("showPrePremiumBgRemovalPopup()", new Object[0]);
                        c4();
                        com.crafto.android.ui.home.profile.e.Q = uri6;
                        if (uri6 != null) {
                            AppCompatActivity a4 = Eb.E.a(this);
                            String uri7 = uri6.toString();
                            Intrinsics.checkNotNullExpressionValue(uri7, "toString(...)");
                            Eb.X0.c(a4, uri7, new qa(this, uri6));
                            return;
                        }
                        return;
                    }
                }
                if (Intrinsics.areEqual(r2().I, this.L2)) {
                    Uri uri8 = this.y4;
                    if (uri8 != null) {
                        AppCompatActivity a5 = Eb.E.a(this);
                        String uri9 = uri8.toString();
                        Intrinsics.checkNotNullExpressionValue(uri9, "toString(...)");
                        Eb.X0.c(a5, uri9, new E());
                        return;
                    }
                    return;
                }
                if (!Intrinsics.areEqual(r2().I, this.H2)) {
                    e3(this.y4);
                    return;
                }
                Uri uri10 = this.y4;
                if (uri10 != null) {
                    AppCompatActivity a6 = Eb.E.a(this);
                    String uri11 = uri10.toString();
                    Intrinsics.checkNotNullExpressionValue(uri11, "toString(...)");
                    Eb.X0.c(a6, uri11, new F());
                }
            }
        } catch (Exception e3) {
            do.a.a.e(e3);
        }
    }

    @Override
    public final void onAttach(@NotNull Context context) {
        Intrinsics.checkNotNullParameter(context, "context");
        super.onAttach(context);
        try {
            String m = e2().m();
            if (m != null) {
                do.a.a.c("getLocale ".concat(m), new Object[0]);
                Locale locale = new Locale(m);
                String str = a.e.R;
                if (StringsKt.C(m, str, false)) {
                    locale = new Locale((String) CollectionsKt.E(StringsKt.T(m, new String[]{str}, 0, 6)), (String) CollectionsKt.K(StringsKt.T(m, new String[]{str}, 0, 6)));
                }
                Locale.setDefault(locale);
                Configuration configuration = new Configuration();
                configuration.locale = locale;
                context.getResources().updateConfiguration(configuration, context.getResources().getDisplayMetrics());
                Q1().k(Eb.E.a(this), m);
            }
        } catch (Exception e) {
            do.a.a.e(e);
        }
    }

    @Override
    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        x0(new J9.D1(this, 1));
        FragmentActivity activity = getActivity();
        final FragmentManager supportFragmentManager = activity != null ? activity.getSupportFragmentManager() : null;
        if (supportFragmentManager != null) {
            supportFragmentManager.addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
                public final void onBackStackChangeCancelled() {
                    androidx.fragment.app.t.a(this);
                }

                public final void onBackStackChangeCommitted(Fragment fragment, boolean z) {
                    androidx.fragment.app.t.b(this, fragment, z);
                }

                public final void onBackStackChangeProgressed(f.c cVar) {
                    androidx.fragment.app.t.c(this, cVar);
                }

                public final void onBackStackChangeStarted(Fragment fragment, boolean z) {
                    androidx.fragment.app.t.d(this, fragment, z);
                }

                public final void onBackStackChanged() {
                    boolean z = D7.Q4;
                    D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    FragmentManager fragmentManager = supportFragmentManager;
                    Intrinsics.checkNotNullParameter(fragmentManager, "$fm");
                    d7.x0(new E3(d7, fragmentManager, 1));
                }
            });
        }
        dl.g.b(androidx.lifecycle.J.a(this), dl.Z.a, (dl.J) null, new H(null), 2);
        int i = 0;
        x0(new C1702f7(this, i));
        x0(new C1714g7(this, i));
    }

    @Override
    public final void onDestroy() {
        Ij.e eVar;
        Ij.e eVar2 = this.f3;
        if (eVar2 != null && !eVar2.b() && (eVar = this.f3) != null) {
            Fj.b.dispose(eVar);
        }
        super.onDestroy();
    }

    @Override
    public final void onDestroyView() {
        super.onDestroyView();
        if (this.v2) {
            r2().v.postValue(new Pair((Object) null, Boolean.FALSE));
        }
    }

    public final void onPause() {
        do.a.a.c("onPause", new Object[0]);
        super.onPause();
        x0(new A8.I1(this, 2));
    }

    public final void onResume() {
        UserConfigData e;
        super.onResume();
        com.crafto.android.ui.home.profile.e eVar = this.L4;
        if (eVar != null) {
            eVar.show(getChildFragmentManager(), "RemoveBackgroundDialogFragment");
            this.L4 = null;
        }
        if (this.n2 && (e = e2().e()) != null && !e.isAnniversaryAlarmCreated()) {
            this.n2 = false;
            k2().p = true;
            R3();
        }
        x0(new Function0() {
            public final Object invoke() {
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                PreferencesHelper e2 = d7.e2();
                e2.getClass();
                SharedPreferencesOnSharedPreferenceChangeListenerC1781m7 sharedPreferencesOnSharedPreferenceChangeListenerC1781m7 = d7.P3;
                Intrinsics.checkNotNullParameter(sharedPreferencesOnSharedPreferenceChangeListenerC1781m7, "preferencesListener");
                e2.a.registerOnSharedPreferenceChangeListener(sharedPreferencesOnSharedPreferenceChangeListenerC1781m7);
                return Unit.a;
            }
        });
        do.a.a.c("mytag onResume: trendinghomefullscreenexpfragment", new Object[0]);
        x0(new Function0() {
            public final Object invoke() {
                D7 d7;
                FragmentActivity activity;
                FragmentManager supportFragmentManager;
                Widget widget;
                boolean z = D7.Q4;
                D7 d72 = D7.this;
                Intrinsics.checkNotNullParameter(d72, "this$0");
                int i = d72.e2().a.getInt("paymentStatusStripDismissCount", 0);
                if (EbanxPaymentProcessActivity.p && i < com.crafto.android.utility.a.i) {
                    EbanxPaymentProcessActivity.p = false;
                    D7.S4 = true;
                    d72.u1(com.crafto.android.utility.a.g);
                }
                if (Build.VERSION.SDK_INT >= 33 && Android13NotificationActivity.s) {
                    if (Eb.D.b(Eb.E.a(d72), Hb.I.d)) {
                        com.crafto.android.ui.base.a.f0(d72, "Log", "notificationSettingScreen", null, "Allowed", "notificationPermission", 0, null, 996);
                    } else {
                        com.crafto.android.ui.base.a.f0(d72, "Log", "notificationSettingScreen", null, "Ignored", "notificationPermission", 0, null, 996);
                    }
                    Android13NotificationActivity.s = false;
                }
                do.a.a.c("mytag onResume trending home full screen exp fr " + d72.R2, new Object[0]);
                if (d72.t2 || d72.v2) {
                    d72.A0(2131101194, a.e.r0);
                } else {
                    d72.A0(2131101194, a.e.q0);
                }
                if (d72.isAdded() && d72.R2) {
                    d72.R2 = false;
                    Ab.t tVar = d72.R3;
                    if (tVar != null) {
                        tVar.dismiss();
                    }
                }
                if (Intrinsics.areEqual(BaseActivity.k, Boolean.TRUE)) {
                    Boolean bool = Boolean.FALSE;
                    d7 = d72;
                    D7.F2(d72, true, null, null, null, bool, null, d72.t, false, null, null, false, false, null, 16256);
                    BaseActivity.k = bool;
                } else {
                    d7 = d72;
                }
                InitData initData = d7.x2;
                if (((((initData == null || (widget = initData.getWidget()) == null) ? null : widget.getData()) instanceof QuoteData) || D7.t1(d7.x2)) && (activity = d7.getActivity()) != null && (supportFragmentManager = activity.getSupportFragmentManager()) != null) {
                    d7.F3(supportFragmentManager);
                }
                return Unit.a;
            }
        });
    }

    public final void onStart() {
        W7.B0 b02;
        super.onStart();
        a.a aVar = do.a.a;
        aVar.c("detectScreenshots", new Object[0]);
        FragmentActivity activity = getActivity();
        if (activity == null || !Hb.I.d(activity, Hb.I.a) || (b02 = this.o3) == null) {
            return;
        }
        aVar.c("detectScreenshots start", new Object[0]);
        if (b02.d == null) {
            ContentResolver contentResolver = b02.a.getContentResolver();
            Intrinsics.checkNotNullExpressionValue(contentResolver, "getContentResolver(...)");
            aVar.c("registerObserver", new Object[0]);
            W7.A0 a02 = new W7.A0(b02, new Handler(Looper.getMainLooper()));
            contentResolver.registerContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, true, a02);
            b02.d = a02;
        }
    }

    @Override
    public final void onStop() {
        super.onStop();
        W7.B0 b02 = this.o3;
        if (b02 != null) {
            do.a.a.c("detectScreenshots stop", new Object[0]);
            W7.A0 a02 = b02.d;
            if (a02 != null) {
                b02.a.getContentResolver().unregisterContentObserver(a02);
            }
            b02.d = null;
        }
        do.a.a.c("mytag webview download -> on stop", new Object[0]);
    }

    @Override
    public final void p0() {
        if (this.F4) {
            this.F4 = false;
        }
    }

    public final void p1(int i, QuoteData quoteData) {
        U2(this, false, null, false, 6);
        String y02 = y0();
        String url = quoteData.getUrl();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        String contentType = quoteData.getContentType();
        Pair pair2 = new Pair("Content Type", (contentType == null || StringsKt.J(contentType)) ? "QUOTE" : quoteData.getContentType());
        Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
        User user = this.W2;
        com.crafto.android.ui.base.a.f0(this, "Click Action", y02, name, url, "Change Political Party", i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false))}), 416);
    }

    public final void p3() {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Birthday reminder widget", null, this.i2, "Name text field", 0, null, 996);
    }

    public final void p4(QuoteData quoteData) {
        String str;
        String value;
        String value2;
        String greeteeName;
        String greeteePhotoUrl;
        String str2;
        String categoryType = quoteData.getCategoryType();
        String str3 = null;
        if (categoryType != null) {
            str = categoryType.toLowerCase(Locale.ROOT);
            Intrinsics.checkNotNullExpressionValue(str, "toLowerCase(...)");
        } else {
            str = null;
        }
        Locale locale = Locale.ROOT;
        if (!B.O.c("Birthday", locale, "toLowerCase(...)", str)) {
            String categoryType2 = quoteData.getCategoryType();
            if (categoryType2 != null) {
                str2 = categoryType2.toLowerCase(locale);
                Intrinsics.checkNotNullExpressionValue(str2, "toLowerCase(...)");
            } else {
                str2 = null;
            }
            if (!B.O.c("Anniversary", locale, "toLowerCase(...)", str2)) {
                return;
            }
        }
        c9.d dVar = (c9.d) this.W3.getValue();
        User user = quoteData.getUser();
        QuotesCategory quotesCategory = this.S3;
        dVar.getClass();
        if (user != null) {
            HashMap<String, Object> hashMap = new HashMap<>();
            UserAdditionalData userPersonalData = user.getUserPersonalData();
            Ab.H h = dVar.b;
            if (userPersonalData != null && (greeteePhotoUrl = userPersonalData.getGreeteePhotoUrl()) != null) {
                hashMap.put(h.l, greeteePhotoUrl);
            }
            if (quotesCategory != null && (value2 = quotesCategory.getValue()) != null && value2.equals("Birthday")) {
                UserAdditionalData userPersonalData2 = user.getUserPersonalData();
                if (userPersonalData2 == null || (greeteeName = userPersonalData2.getGreeteeName()) == null) {
                    UserAdditionalData userPersonalData3 = user.getUserPersonalData();
                    if (userPersonalData3 != null) {
                        str3 = userPersonalData3.getBirthdayUserName();
                    }
                } else {
                    str3 = greeteeName;
                }
                if (str3 != null) {
                    hashMap.put(h.m, str3);
                }
            }
            hashMap.put(h.I0, Boolean.valueOf(user.isUserPremiumServer()));
            Integer countryId = user.getCountryId();
            if (countryId != null) {
                hashMap.put(h.X0, Integer.valueOf(countryId.intValue()));
            }
            Long userId = user.getUserId();
            if (userId != null) {
                hashMap.put(h.g, Long.valueOf(userId.longValue()));
            }
            if (quotesCategory != null && (value = quotesCategory.getValue()) != null) {
                hashMap.put(h.V, value);
            }
            Integer identifier = quoteData.getIdentifier();
            if (identifier != null) {
                hashMap.put(h.p, Integer.valueOf(identifier.intValue()));
            }
            String videoUrl = quoteData.getVideoUrl();
            if (videoUrl == null) {
                videoUrl = quoteData.getUrl();
            }
            if (videoUrl != null) {
                hashMap.put(h.Y, videoUrl);
            }
            do.a.a.c("updateBirthdayEvent params " + hashMap, new Object[0]);
            C1579a c1579a = dVar.a;
            c1579a.getClass();
            Intrinsics.checkNotNullParameter(hashMap, "params");
            Gb.f.a(Gb.g.a(c1579a.b.updateBirthdayEvent(hashMap), c1579a.a), new C1580b(), new c9.c(), false, 12);
        }
    }

    @Override
    public final void q0() {
        do.a.a.c("mytag on permission granted " + this.F4, new Object[0]);
        D2();
        if (this.F4) {
            this.F4 = false;
            x0(new Function0() {
                public final Object invoke() {
                    boolean z = D7.Q4;
                    D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    com.crafto.android.ui.base.a.f0(d7, "Landed", "System Gallery", null, null, "Upload Day Special", 0, null, 1004);
                    d7.r2().I = d7.E2;
                    d7.m4();
                    return Unit.a;
                }
            });
            return;
        }
        if (this.G4) {
            Hb.H b2 = b2();
            BaseActivity a = Eb.E.a(this);
            int i = a.e.k2;
            Hb.i L2 = L();
            BaseActivity a2 = Eb.E.a(this);
            L2.getClass();
            Hb.H.a(b2, a, i, Hb.i.j(a2));
            return;
        }
        if (this.H4) {
            this.H4 = false;
            j4();
        } else {
            if (this.o2) {
                this.i4 = null;
                S2();
            }
            this.o2 = true;
        }
    }

    public final void q3(Uri uri, Integer num, Integer num2) {
        if (Intrinsics.areEqual(r2().I, this.E2)) {
            this.h4 = uri;
        }
        this.w2 = uri;
        Pb.h.a(Z1(), M(), uri, this, false, this.B2, false, num != null ? Float.valueOf(num.intValue()) : null, num2 != null ? Float.valueOf(num2.intValue()) : null, 88);
    }

    @Override
    public final void r(I7.a aVar, int i, @NotNull AppEnums.f fVar) {
        Tag tag;
        String tagTitle;
        AppCompatEditText appCompatEditText;
        Intrinsics.checkNotNullParameter(fVar, "clickType");
        I7.b.a(fVar);
        if ((aVar instanceof Tag) && Intrinsics.areEqual(fVar, AppEnums.f.S.a) && (tagTitle = (tag = (Tag) aVar).getTagTitle()) != null) {
            C3053c2 c3053c2 = (C3053c2) this.y;
            if (c3053c2 != null && (appCompatEditText = c3053c2.n) != null) {
                appCompatEditText.setText(tagTitle);
            }
            N2(tag);
        }
    }

    @Override
    public final void r0() {
        PreferencesHelper e2 = e2();
        String string = e2.a.getString(e2.H, null);
        if (string != null) {
            T3(string);
        }
    }

    public final C1808p1 r2() {
        return (C1808p1) this.T3.getValue();
    }

    public final void r3() {
        ChipGroup chipGroup;
        C3047bd c3047bd;
        ConstraintLayout constraintLayout;
        C3053c2 c3053c2 = (C3053c2) this.y;
        if (c3053c2 != null && (c3047bd = c3053c2.w) != null && (constraintLayout = c3047bd.a) != null) {
            Eb.X0.l(constraintLayout);
        }
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 == null || (chipGroup = c3053c22.h) == null) {
            return;
        }
        QuotesCategory quotesCategory = this.S3;
        Chip findViewWithTag = chipGroup.findViewWithTag(quotesCategory != null ? quotesCategory.getCurrentCategory() : null);
        if (findViewWithTag != null) {
            findViewWithTag.performClick();
        }
    }

    public final void r4(PostMedia postMedia) {
        do.a.a.c("updateSelectedProfileImage", new Object[0]);
        x0(new La.B(1, this, postMedia));
        W();
    }

    @Override
    public final void s(Uri uri) {
        Function1<? super Uri, Unit> function1 = this.d;
        if (function1 != null) {
            function1.invoke(uri);
        }
    }

    @Override
    public final void s0() {
        this.d = new C1217k0(this, 1);
        Pb.h.e(Z1(), this.k4);
    }

    @NotNull
    public final Hb.p0 s2() {
        Hb.p0 p0Var = this.A3;
        if (p0Var != null) {
            return p0Var;
        }
        Intrinsics.throwUninitializedPropertyAccessException("viewUtil");
        return null;
    }

    public final void s4(Uri uri) {
        ArrayList<I7.m> arrayList;
        e2().x0(uri);
        E7.G g = this.m3;
        if (g != null && (arrayList = g.l) != null) {
            x0(new E8.P4(arrayList, uri, 1, this));
        }
        W();
    }

    public final Bitmap t2(int i) {
        QuoteView quoteView;
        ConstraintLayout clOverlapingText;
        ConstraintLayout clOverlapingText2;
        E7.G g = this.m3;
        RecyclerView.D f = g != null ? g.f(i) : null;
        if (f instanceof J8.J1) {
            QuoteView quoteView2 = ((J8.J1) f).f;
            if (quoteView2 == null || (clOverlapingText2 = quoteView2.getClOverlapingText()) == null) {
                return null;
            }
            j2().getClass();
            return Hb.a0.f(clOverlapingText2);
        }
        if (!(f instanceof s8.J) || (quoteView = ((s8.J) f).g) == null || (clOverlapingText = quoteView.getClOverlapingText()) == null) {
            return null;
        }
        j2().getClass();
        return Hb.a0.f(clOverlapingText);
    }

    public final void t3(final AddAnniversaryAlarmData addAnniversaryAlarmData, final int i) {
        Hb.C X1 = X1();
        FragmentManager childFragmentManager = getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        String valueOf = String.valueOf(addAnniversaryAlarmData.getSelectedAnniversaryAlarmDate());
        Function2 function2 = new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                Integer valueOf2;
                int i2 = i;
                String str = (String) obj;
                boolean z = D7.Q4;
                D7 d7 = D7.this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                AddAnniversaryAlarmData addAnniversaryAlarmData2 = addAnniversaryAlarmData;
                Intrinsics.checkNotNullParameter(addAnniversaryAlarmData2, "$click");
                com.crafto.android.ui.base.a.f0(d7, "Click Action", "Birthday reminder widget", null, d7.i2, "Date Enter", 0, null, 996);
                if (str != null) {
                    try {
                        valueOf2 = Integer.valueOf(Integer.parseInt(str));
                    } catch (Exception e) {
                        do.a.a.e(e);
                    }
                } else {
                    valueOf2 = null;
                }
                addAnniversaryAlarmData2.setSelectedAnniversaryAlarmDate(valueOf2);
                E7.G g = d7.m3;
                RecyclerView.D f = g != null ? g.f(i2) : null;
                C2346k.a aVar = f instanceof C2346k.a ? (C2346k.a) f : null;
                if (aVar != null) {
                    ((C3039b5) aVar.a).c.setText(str);
                }
                return Unit.a;
            }
        };
        X1.getClass();
        Hb.C.g(childFragmentManager, 1, valueOf, function2);
    }

    public final void t4(final String str, final String str2, final Long l) {
        do.a.a.c("updateSelectedProfileImage", new Object[0]);
        x0(new Function0() {
            public final java.lang.Object invoke() {
                throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.C1723h4.invoke():java.lang.Object");
            }
        });
    }

    public final void u1(final int i) {
        User user;
        String slug;
        do.a.a.c(Eb.J0.a(i, "mytag get order - consume count = "), new Object[0]);
        if (!S4 || (user = this.W2) == null || (slug = user.getSlug()) == null) {
            return;
        }
        Gb.f.a(r2().k(slug, true), new Function1() {
            public final Object invoke(Object obj) {
                final User user2 = (User) obj;
                boolean z = D7.Q4;
                final D7 d7 = this;
                Intrinsics.checkNotNullParameter(d7, "this$0");
                Intrinsics.checkNotNullParameter(user2, Column.DATA);
                d7.J4 = user2.getPaymentStatus();
                final int i2 = i;
                d7.x0(new Function0() {
                    public final Object invoke() {
                        boolean z2 = D7.Q4;
                        D7 d72 = D7.this;
                        Intrinsics.checkNotNullParameter(d72, "this$0");
                        User user3 = user2;
                        Intrinsics.checkNotNullParameter(user3, "$data");
                        if (D7.S4 && !d72.I4) {
                            d72.I4 = true;
                            do.a.a.c("mytag landed event: here #1", new Object[0]);
                            String y02 = d72.y0();
                            PaymentStatus paymentStatus = user3.getPaymentStatus();
                            com.crafto.android.ui.base.a.f0(d72, "Landed", y02, "Payment Status", null, null, 0, kotlin.collections.Q.f(new Pair[]{new Pair("Status", paymentStatus != null ? paymentStatus.getState() : null), new Pair("Payment Type", d72.e2().k())}), 504);
                        }
                        PaymentStatus paymentStatus2 = user3.getPaymentStatus();
                        if (paymentStatus2 != null) {
                            String state = paymentStatus2.getState();
                            D7.S4 = (Intrinsics.areEqual(state, "SUCCESS") || Intrinsics.areEqual(state, a.e.l1)) ? false : D7.S4;
                        } else {
                            D7.S4 = false;
                        }
                        if (i2 > com.crafto.android.utility.a.h) {
                            D7.S4 = false;
                        }
                        if (D7.S4) {
                            dl.g.b(androidx.lifecycle.J.a(d72), (CoroutineContext) null, (dl.J) null, d72.new C1610c(null), 3);
                        }
                        d72.E3(user3);
                        return Unit.a;
                    }
                });
                return Unit.a;
            }
        }, new G3(), false, 12);
    }

    public final void u2(int i, QuoteData quoteData) {
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, quoteData.getUrl(), "Add Greeting", i, null, 932);
        String greetingText = quoteData.getGreetingText();
        if (greetingText == null) {
            greetingText = "";
        }
        O3(i, greetingText);
    }

    public final void u3(final QuotesCategoryObject quotesCategoryObject, boolean z) {
        ArrayList<QuotesCategory> categories;
        C3053c2 c3053c2;
        ChipGroup chipGroup;
        QuotesCategory quotesCategory;
        ChipGroup chipGroup2;
        ChipGroup chipGroup3;
        MoreCategoryObject moreCategories;
        ArrayList<QuotesCategory> categories2;
        Object obj;
        ChipGroup chipGroup4;
        ChipGroup chipGroup5;
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 != null && (chipGroup5 = c3053c22.h) != null) {
            chipGroup5.removeAllViews();
        }
        Drawable drawable = null;
        final ArrayList<QuotesCategory> mainCategories = quotesCategoryObject != null ? quotesCategoryObject.getMainCategories() : null;
        this.V1 = mainCategories;
        do.a.a.c(E2.b.b("setCategoryChips ", mainCategories), new Object[0]);
        if (mainCategories != null) {
            int i = 0;
            for (Object obj2 : mainCategories) {
                int i2 = i + 1;
                if (i < 0) {
                    kotlin.collections.t.m();
                    throw null;
                }
                final QuotesCategory quotesCategory2 = (QuotesCategory) obj2;
                Chip inflate = getLayoutInflater().inflate(2131558994, (ViewGroup) null, false);
                Intrinsics.checkNotNull(inflate, "null cannot be cast to non-null type com.google.android.material.chip.Chip");
                Chip chip = inflate;
                chip.setText(quotesCategory2.getName());
                chip.setTag(quotesCategory2.getValue());
                String icon = quotesCategory2.getIcon();
                if (icon != null) {
                    Eb.X0.c(Eb.E.a(this), icon, new W9(chip, this));
                }
                chip.setId(View.generateViewId());
                chip.setChecked(quotesCategory2.getSelected());
                chip.setTypeface(chip.getTypeface(), 1);
                chip.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                    @Override
                    public final void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
                        QuotesCategoryObject quotesCategoryObject2;
                        ArrayList<QuotesCategory> mainCategories2;
                        ConstraintLayout constraintLayout;
                        CardView cardView;
                        boolean z3 = D7.Q4;
                        D7 d7 = D7.this;
                        Intrinsics.checkNotNullParameter(d7, "this$0");
                        QuotesCategory quotesCategory3 = quotesCategory2;
                        Intrinsics.checkNotNullParameter(quotesCategory3, "$category");
                        C3053c2 c3053c23 = (C3053c2) d7.y;
                        if (c3053c23 != null && (cardView = c3053c23.p1) != null) {
                            Eb.X0.l(cardView);
                        }
                        QuotesCategory quotesCategory4 = d7.r2().m;
                        do.a.a.c("selectedCategory " + d7.S3, new Object[0]);
                        d7.x2();
                        String valueOf = StringsKt.J(String.valueOf(compoundButton != null ? compoundButton.getText() : null)) ? String.valueOf(compoundButton != null ? compoundButton.getText() : null) : String.valueOf(quotesCategory3.getName());
                        String value = quotesCategory3.getValue();
                        if (value == null) {
                            value = "";
                        }
                        if (!Intrinsics.areEqual(quotesCategory4 != null ? quotesCategory4.getValue() : null, valueOf) && z2) {
                            C3053c2 c3053c24 = (C3053c2) d7.y;
                            if (c3053c24 != null && (constraintLayout = c3053c24.m) != null) {
                                Eb.X0.l(constraintLayout);
                            }
                            QuotesCategory quotesCategory5 = d7.S3;
                            String value2 = quotesCategory5 != null ? quotesCategory5.getValue() : null;
                            List<QuotesCategory> list = mainCategories;
                            QuotesCategory U1 = D7.U1(valueOf, list);
                            d7.S3 = U1;
                            if (U1 != null) {
                                String value3 = U1.getValue();
                                U1.setListPosition(Integer.valueOf(D7.V1(value3 != null ? value3 : "", list)));
                            }
                            QuotesCategory quotesCategory6 = d7.S3;
                            if (quotesCategory6 != null) {
                                quotesCategory6.setCurrentCategory(value2);
                            }
                            int V1 = D7.V1(valueOf, list);
                            QuotesCategory quotesCategory7 = d7.r2().m;
                            String name = quotesCategory7 != null ? quotesCategory7.getName() : null;
                            QuotesCategory quotesCategory8 = d7.S3;
                            com.crafto.android.ui.base.a.f0(d7, "Click Action", "Home Screen", name, valueOf, "New Category List", V1, kotlin.collections.Q.f(new Pair[]{new Pair("Slot", quotesCategory8 != null ? quotesCategory8.getSlot() : null), new Pair("Key", value)}), 416);
                            d7.Q().b(new KinesisData(d7.W2, d7.S3, "CLICK_CATEGORY", d7.y0()));
                            QuotesCategory quotesCategory9 = d7.x4;
                            if (quotesCategory9 != null) {
                                Integer categoryId = quotesCategory9.getCategoryId();
                                QuotesCategory quotesCategory10 = d7.S3;
                                if (!Intrinsics.areEqual(categoryId, quotesCategory10 != null ? quotesCategory10.getCategoryId() : null) && (quotesCategoryObject2 = quotesCategoryObject) != null && (mainCategories2 = quotesCategoryObject2.getMainCategories()) != null) {
                                    TypeIntrinsics.asMutableCollection(mainCategories2).remove(d7.x4);
                                    for (QuotesCategory quotesCategory11 : list) {
                                        QuotesCategory quotesCategory12 = d7.S3;
                                        quotesCategory11.setSelected(Intrinsics.areEqual(quotesCategory12 != null ? quotesCategory12.getCategoryId() : null, quotesCategory11.getCategoryId()));
                                    }
                                    d7.x4 = null;
                                    d7.u3(quotesCategoryObject2, false);
                                }
                            }
                            PostPaymentData t = d7.e2().t();
                            if (t != null) {
                                t.setCategory(d7.T1(list));
                            }
                            d7.e2().i0(t, false);
                            d7.r2().m = d7.S3;
                            d7.v4();
                            d7.M2();
                        }
                        d7.Z2(false);
                    }
                });
                C3053c2 c3053c23 = (C3053c2) this.y;
                if (c3053c23 != null && (chipGroup4 = c3053c23.h) != null) {
                    chipGroup4.addView(chip);
                }
                i = i2;
            }
        }
        if (z) {
            if (quotesCategoryObject == null || (moreCategories = quotesCategoryObject.getMoreCategories()) == null || (categories2 = moreCategories.getCategories()) == null) {
                quotesCategory = null;
            } else {
                Iterator<T> it = categories2.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        obj = null;
                        break;
                    }
                    obj = it.next();
                    String value = ((QuotesCategory) obj).getValue();
                    r2().getClass();
                    if (Intrinsics.areEqual(value, C1808p1.i3)) {
                        break;
                    }
                }
                quotesCategory = (QuotesCategory) obj;
            }
            if (quotesCategory != null) {
                this.w4 = quotesCategory;
                this.x4 = quotesCategory;
                quotesCategory.setSelected(true);
                Chip inflate2 = getLayoutInflater().inflate(2131558994, (ViewGroup) null, false);
                Intrinsics.checkNotNull(inflate2, "null cannot be cast to non-null type com.google.android.material.chip.Chip");
                Chip chip2 = inflate2;
                chip2.setText(quotesCategory.getName());
                chip2.setId(View.generateViewId());
                chip2.setChecked(true);
                C3053c2 c3053c24 = (C3053c2) this.y;
                if (c3053c24 != null && (chipGroup3 = c3053c24.h) != null) {
                    chipGroup3.addView(chip2);
                }
                C3053c2 c3053c25 = (C3053c2) this.y;
                this.D4 = ((c3053c25 == null || (chipGroup2 = c3053c25.h) == null) ? 1 : chipGroup2.getChildCount()) - 1;
                r2().m = quotesCategory;
            }
            if (!r2().n) {
                C1808p1.i3 = null;
            }
            M2();
        }
        final MoreCategoryObject moreCategories2 = quotesCategoryObject != null ? quotesCategoryObject.getMoreCategories() : null;
        if (moreCategories2 != null && (categories = moreCategories2.getCategories()) != null && categories.size() > 0) {
            Chip inflate3 = getLayoutInflater().inflate(2131558994, (ViewGroup) null, false);
            Intrinsics.checkNotNull(inflate3, "null cannot be cast to non-null type com.google.android.material.chip.Chip");
            Chip chip3 = inflate3;
            chip3.setText(moreCategories2.getMoreText());
            chip3.setId(View.generateViewId());
            chip3.setChecked(false);
            chip3.setCheckable(false);
            chip3.setLayoutDirection(1);
            chip3.setTypeface(chip3.getTypeface(), 1);
            Context context = getContext();
            if (context != null) {
                Intrinsics.checkNotNullParameter(context, "<this>");
                drawable = J1.a.getDrawable(context, 2131232741);
            }
            chip3.setChipIcon(drawable);
            if (getContext() != null && (c3053c2 = (C3053c2) this.y) != null && (chipGroup = c3053c2.h) != null) {
                chipGroup.addView(chip3);
            }
            Eb.X0.T(chip3, false, 0, new Function1() {
                public final Object invoke(Object obj3) {
                    boolean z2 = D7.Q4;
                    final D7 d7 = this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    Intrinsics.checkNotNullParameter((View) obj3, "it");
                    final MoreCategoryObject moreCategoryObject = moreCategories2;
                    if (moreCategoryObject != null) {
                        d7.getClass();
                        ArrayList<QuotesCategory> categories3 = moreCategoryObject.getCategories();
                        if (categories3 != null) {
                            Iterator<QuotesCategory> it2 = categories3.iterator();
                            Intrinsics.checkNotNullExpressionValue(it2, "iterator(...)");
                            while (true) {
                                if (!it2.hasNext()) {
                                    break;
                                }
                                QuotesCategory next = it2.next();
                                Intrinsics.checkNotNullExpressionValue(next, "next(...)");
                                QuotesCategory quotesCategory3 = next;
                                if (d7.x4 == null) {
                                    quotesCategory3.setSelected(false);
                                } else if (quotesCategory3.getSelected()) {
                                    d7.w4 = quotesCategory3;
                                    break;
                                }
                            }
                        }
                    }
                    Hb.C X1 = d7.X1();
                    FragmentManager childFragmentManager = d7.getChildFragmentManager();
                    Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
                    final QuotesCategoryObject quotesCategoryObject2 = quotesCategoryObject;
                    Function1<? super QuotesCategory, Unit> function1 = new Function1() {
                        public final Object invoke(Object obj4) {
                            ArrayList<QuotesCategory> arrayList;
                            ArrayList<QuotesCategory> mainCategories2;
                            QuotesCategory quotesCategory4 = (QuotesCategory) obj4;
                            boolean z3 = D7.Q4;
                            D7 d72 = d7;
                            Intrinsics.checkNotNullParameter(d72, "this$0");
                            Intrinsics.checkNotNullParameter(quotesCategory4, "click");
                            MoreCategoryObject moreCategoryObject2 = MoreCategoryObject.this;
                            if (moreCategoryObject2 == null || (arrayList = moreCategoryObject2.getCategories()) == null) {
                                arrayList = kotlin.collections.F.a;
                            }
                            QuotesCategoryObject quotesCategoryObject3 = quotesCategoryObject2;
                            ArrayList<QuotesCategory> mainCategories3 = quotesCategoryObject3 != null ? quotesCategoryObject3.getMainCategories() : null;
                            d72.x4 = quotesCategory4;
                            for (QuotesCategory quotesCategory5 : arrayList) {
                                quotesCategory5.setSelected(Intrinsics.areEqual(quotesCategory5.getCategoryId(), quotesCategory4.getCategoryId()));
                            }
                            if (d72.w4 != null && quotesCategoryObject3 != null && (mainCategories2 = quotesCategoryObject3.getMainCategories()) != null) {
                                TypeIntrinsics.asMutableCollection(mainCategories2).remove(d72.w4);
                            }
                            quotesCategory4.setSelected(true);
                            if (mainCategories3 != null) {
                                mainCategories3.add(quotesCategory4);
                            }
                            d72.u3(quotesCategoryObject3, false);
                            QuotesCategory quotesCategory6 = d72.S3;
                            String value2 = quotesCategory6 != null ? quotesCategory6.getValue() : null;
                            QuotesCategory U1 = D7.U1(String.valueOf(quotesCategory4.getName()), arrayList);
                            d72.S3 = U1;
                            if (U1 != null) {
                                String value3 = U1.getValue();
                                if (value3 == null) {
                                    value3 = "";
                                }
                                U1.setListPosition(Integer.valueOf(D7.V1(value3, arrayList)));
                            }
                            String valueOf = String.valueOf(quotesCategory4.getName());
                            int V1 = D7.V1(String.valueOf(quotesCategory4.getName()), moreCategoryObject2 != null ? moreCategoryObject2.getCategories() : null);
                            QuotesCategory quotesCategory7 = d72.r2().m;
                            String name = quotesCategory7 != null ? quotesCategory7.getName() : null;
                            Pair pair = new Pair("Slot", quotesCategory4.getSlot());
                            String value4 = quotesCategory4.getValue();
                            String str = value2;
                            com.crafto.android.ui.base.a.f0(d72, "Click Action", "Home Screen", name, valueOf, "New Category List", V1, kotlin.collections.Q.f(new Pair[]{pair, new Pair("Key", value4 != null ? value4 : "")}), 416);
                            d72.Q().b(new KinesisData(d72.T().E(), D7.U1(String.valueOf(quotesCategory4.getName()), moreCategoryObject2 != null ? moreCategoryObject2.getCategories() : null), "CLICK_CATEGORY", "More Category Dialog"));
                            QuotesCategory quotesCategory8 = d72.S3;
                            if (quotesCategory8 != null) {
                                quotesCategory8.setCurrentCategory(str);
                            }
                            d72.r2().m = d72.S3;
                            d72.M2();
                            return Unit.a;
                        }
                    };
                    X1.getClass();
                    Intrinsics.checkNotNullParameter(childFragmentManager, "childFragmentManager");
                    Intrinsics.checkNotNullParameter(function1, "onCategoryClick");
                    Intrinsics.checkNotNullParameter(function1, "categoryClick");
                    C2431c c2431c = new C2431c();
                    c2431c.m = function1;
                    Bundle bundle = new Bundle();
                    if (moreCategoryObject != null) {
                        bundle.putSerializable("extra_page_data", moreCategoryObject);
                    }
                    c2431c.setArguments(bundle);
                    c2431c.show(childFragmentManager, "MoreCategoriesDialogFragment");
                    Integer num = d7.g2;
                    com.crafto.android.ui.base.a.f0(d7, "Click Action", "Home Screen", "Quotes List", num != null ? num.toString() : null, "Filter", 0, null, 992);
                    return Unit.a;
                }
            }, 3);
        }
        this.S2 = true;
    }

    public final void u4(QuoteData quoteData, AppEnums.f fVar) {
        Integer countryId;
        C1808p1 r2 = r2();
        r2.getClass();
        Intrinsics.checkNotNullParameter(fVar, "clickType");
        if (quoteData != null) {
            HashMap<String, Object> hashMap = new HashMap<>();
            boolean z = fVar instanceof AppEnums.f.B;
            Ab.H h = r2.e;
            if (z) {
                String str = h.o;
                String upperCase = a.e.x2.toUpperCase(Locale.ROOT);
                Intrinsics.checkNotNullExpressionValue(upperCase, "toUpperCase(...)");
                hashMap.put(str, upperCase);
            } else {
                String str2 = h.o;
                String upperCase2 = a.e.v2.toUpperCase(Locale.ROOT);
                Intrinsics.checkNotNullExpressionValue(upperCase2, "toUpperCase(...)");
                hashMap.put(str2, upperCase2);
            }
            User E2 = r2.c.E();
            if (E2 != null && (countryId = E2.getCountryId()) != null) {
                hashMap.put(h.X0, Integer.valueOf(countryId.intValue()));
            }
            Integer identifier = quoteData.getIdentifier();
            if (identifier != null) {
                hashMap.put(h.p, Integer.valueOf(identifier.intValue()));
            }
            String url = quoteData.getUrl();
            if (url != null) {
                hashMap.put(h.X, url);
            }
            String slot = quoteData.getSlot();
            if (slot != null) {
                hashMap.put(h.n, slot);
            }
            Ab.J j = r2.b;
            j.getClass();
            Intrinsics.checkNotNullParameter(hashMap, "params");
            Gb.f.a(Gb.g.a(j.b.updateShareDownloadData(hashMap), j.a), new Z0(0), new C1648b1(0), false, 12);
        }
    }

    public final void v1() {
        UserAdditionalData userPersonalData;
        User E2 = e2().E();
        if (E2 != null && (userPersonalData = E2.getUserPersonalData()) != null) {
            userPersonalData.setBirthdayUserName(null);
        }
        e2().r0(E2);
    }

    public final void v2() {
        throw new UnsupportedOperationException("Method not decompiled: com.crafto.android.ui.home.D7.v2():void");
    }

    public final void v3(QuoteData quoteData) {
        User user;
        UserConfigData e;
        UserConfigData e2 = e2().e();
        if (((e2 != null ? e2.getBeforePremiumRemoveBackgroundDialog() : null) == null && ((e = e2().e()) == null || !e.getNonPremiumBgRemoveExpFromBE())) || quoteData == null) {
            return;
        }
        if (R4 != null && quoteData != null && (user = quoteData.getUser()) != null) {
            List list = a.e.a;
            user.setProfileImageUrl(a.e.M1);
        }
        if (quoteData != null) {
            quoteData.resetGuidelines();
        }
    }

    public final void v4() {
        C3047bd c3047bd;
        LottieAnimationView lottieAnimationView;
        C3047bd c3047bd2;
        LottieAnimationView lottieAnimationView2;
        C3047bd c3047bd3;
        ConstraintLayout constraintLayout;
        C3047bd c3047bd4;
        LottieAnimationView lottieAnimationView3;
        C3047bd c3047bd5;
        LottieAnimationView lottieAnimationView4;
        C3047bd c3047bd6;
        MaterialTextView materialTextView;
        C3047bd c3047bd7;
        AppCompatImageView appCompatImageView;
        C3047bd c3047bd8;
        ConstraintLayout constraintLayout2;
        QuotesCategory quotesCategory = this.S3;
        if (Intrinsics.areEqual(quotesCategory != null ? quotesCategory.getValue() : null, a.e.d)) {
            PreferencesHelper e2 = e2();
            if (e2.a.getBoolean(e2.L, false)) {
                C3053c2 c3053c2 = (C3053c2) this.y;
                if (c3053c2 != null && (c3047bd3 = c3053c2.w) != null && (constraintLayout = c3047bd3.a) != null) {
                    Eb.X0.l(constraintLayout);
                }
                C3053c2 c3053c22 = (C3053c2) this.y;
                if (c3053c22 != null && (c3047bd2 = c3053c22.w) != null && (lottieAnimationView2 = c3047bd2.c) != null) {
                    lottieAnimationView2.cancelAnimation();
                }
                C3053c2 c3053c23 = (C3053c2) this.y;
                if (c3053c23 == null || (c3047bd = c3053c23.w) == null || (lottieAnimationView = c3047bd.c) == null) {
                    return;
                }
                lottieAnimationView.clearAnimation();
                return;
            }
            C3053c2 c3053c24 = (C3053c2) this.y;
            if (c3053c24 != null && (c3047bd8 = c3053c24.w) != null && (constraintLayout2 = c3047bd8.a) != null) {
                Eb.X0.V(constraintLayout2);
            }
            C3053c2 c3053c25 = (C3053c2) this.y;
            if (c3053c25 != null && (c3047bd7 = c3053c25.w) != null && (appCompatImageView = c3047bd7.b) != null) {
                Eb.X0.l(appCompatImageView);
            }
            C3053c2 c3053c26 = (C3053c2) this.y;
            if (c3053c26 != null && (c3047bd6 = c3053c26.w) != null && (materialTextView = c3047bd6.d) != null) {
                Translations I2 = e2().I();
                materialTextView.setText(I2 != null ? I2.getWhatsappStatusPermissionMsg() : null);
            }
            C3053c2 c3053c27 = (C3053c2) this.y;
            if (c3053c27 != null && (c3047bd5 = c3053c27.w) != null && (lottieAnimationView4 = c3047bd5.c) != null) {
                lottieAnimationView4.setAnimation(2131951621);
            }
            C3053c2 c3053c28 = (C3053c2) this.y;
            if (c3053c28 != null && (c3047bd4 = c3053c28.w) != null && (lottieAnimationView3 = c3047bd4.c) != null) {
                lottieAnimationView3.playAnimation();
            }
            new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
                @Override
                public final void run() {
                    C3047bd c3047bd9;
                    AppCompatImageView appCompatImageView2;
                    boolean z = D7.Q4;
                    D7 d7 = D7.this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    C3053c2 c3053c29 = (C3053c2) d7.y;
                    if (c3053c29 == null || (c3047bd9 = c3053c29.w) == null || (appCompatImageView2 = c3047bd9.b) == null) {
                        return;
                    }
                    Eb.X0.V(appCompatImageView2);
                }
            }, Constants.PN_IMAGE_DOWNLOAD_TIMEOUT_IN_MILLIS);
            com.crafto.android.ui.base.a.f0(this, "Landed", "Status folder permission", null, null, null, 0, null, 1020);
        }
    }

    @Override
    public final void w(I7.a aVar, int i, int i2, AppEnums.f fVar, View view) {
        I7.b.b(fVar, view);
    }

    public final void w1() {
        FragmentManager supportFragmentManager;
        Fragment findFragmentByTag;
        FragmentManager supportFragmentManager2;
        FragmentManager supportFragmentManager3;
        FragmentTransaction beginTransaction;
        FragmentTransaction remove;
        FragmentActivity activity = getActivity();
        if (activity == null || (supportFragmentManager = activity.getSupportFragmentManager()) == null || (findFragmentByTag = supportFragmentManager.findFragmentByTag("Religion Selection Screen")) == null) {
            return;
        }
        FragmentActivity activity2 = getActivity();
        if (activity2 != null && (supportFragmentManager3 = activity2.getSupportFragmentManager()) != null && (beginTransaction = supportFragmentManager3.beginTransaction()) != null && (remove = beginTransaction.remove(findFragmentByTag)) != null) {
            remove.commit();
        }
        FragmentActivity activity3 = getActivity();
        if (activity3 == null || (supportFragmentManager2 = activity3.getSupportFragmentManager()) == null) {
            return;
        }
        supportFragmentManager2.popBackStack();
    }

    public final void w2() {
        do.a.a.c("hideCaption position ", new Object[0]);
        int i = C2400p.e;
        C2400p.f = false;
        Xf.k.b(e2().a, "showCaptionTutorial", false);
    }

    public final void w3(User user, String str) {
        String str2;
        UserAdditionalData userPersonalData;
        UserAdditionalData userPersonalData2;
        String addNameTitle;
        do.a.a.c("updateListForBirthdayName_", new Object[0]);
        if ((user != null ? user.getUserPersonalData() : null) == null) {
            if (user != null) {
                user.setUserPersonalData(new UserAdditionalData(null, null, null, null, null, null, null, null, null, null, null, false, false, false, false, null, null, null, null, null, false, false, null, null, null, null, null, null, 0L, 0L, null, this.x1, null, null, null, null, false, null, null, null, str, null, false, Integer.MAX_VALUE, 1791, null));
            }
            str2 = str;
        } else {
            if (user == null || (userPersonalData2 = user.getUserPersonalData()) == null) {
                str2 = str;
            } else {
                str2 = str;
                userPersonalData2.setBirthdayUserName(str2);
            }
            String str3 = this.x1;
            if (str3 != null && user != null && (userPersonalData = user.getUserPersonalData()) != null) {
                userPersonalData.setGreeteePhotoUrl(str3);
            }
        }
        E7.G g = this.m3;
        ArrayList<I7.m> arrayList = g != null ? g.l : null;
        if (arrayList != null) {
            int i = 0;
            for (Object obj : arrayList) {
                int i2 = i + 1;
                if (i < 0) {
                    kotlin.collections.t.m();
                    throw null;
                }
                I7.m mVar = (I7.m) obj;
                if (mVar instanceof InitData) {
                    Widget widget = ((InitData) mVar).getWidget();
                    I7.m data = widget != null ? widget.getData() : null;
                    if (data instanceof QuoteData) {
                        QuoteData quoteData = (QuoteData) data;
                        int design = quoteData.getDesign();
                        if (194 > design || design >= 200 || (addNameTitle = quoteData.getAddNameTitle()) == null || StringsKt.J(addNameTitle)) {
                            quoteData.setUser(user);
                        } else {
                            quoteData.setGreetingText(str2);
                            do.a.a.c("click.greetingText__ " + quoteData.getGreetingText(), new Object[0]);
                        }
                        i = i2;
                    }
                }
                i = i2;
            }
        }
    }

    public final void w4(int i, QuoteData quoteData) {
        int i2 = 1;
        int i3 = 2;
        int i4 = 0;
        do.a.a.c("mytag upload profile photo #3", new Object[0]);
        r2().I = "upload_caption";
        int i5 = Build.VERSION.SDK_INT;
        i.c<i.j> cVar = this.k4;
        if (i5 >= 34) {
            this.d = new B7.y(this, i3);
            Pb.h.e(Z1(), cVar);
        } else {
            FragmentActivity activity = getActivity();
            if (activity != null) {
                String[] strArr = Hb.I.a;
                if (Hb.I.b(activity, this.f)) {
                    J9.C3 c3 = new J9.C3(this, i3);
                    UserConfigData e = e2().e();
                    if (i5 >= 34) {
                        this.d = new A7.d(c3, i3);
                        Pb.h.e(Z1(), cVar);
                    } else if (e != null && e.getUseDefaultGalleryPicker()) {
                        this.i4 = "Invoke";
                        S2();
                    } else if (e != null && e.getUseGoogleGalleryPicker()) {
                        this.d = new C0953y(c3, i3);
                        Pb.h.e(Z1(), cVar);
                    } else if (e == null || !e.getUseThirdPartyImagePicker()) {
                        this.d = new J9.A(c3, i2);
                        Pb.h.f(Z1(), M(), this.e, (String) null, false, 28);
                    } else {
                        this.d = new C1758k6(c3, i4);
                        w0();
                        D5.g gVar = this.b;
                        if (gVar != null) {
                            Pb.h.c(Z1(), gVar);
                        }
                    }
                }
            }
        }
        String type = quoteData.getType();
        String url = quoteData.getUrl();
        QuotesCategory quotesCategory = r2().m;
        com.crafto.android.ui.base.a.f0(this, "Upload Photo", "Home Screen", quotesCategory != null ? quotesCategory.getName() : null, type, url, i, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", Integer.valueOf(quoteData.getDesign())), new Pair("Content Type", quoteData.getContentType()), new Pair("Content Format", quoteData.getContentFormat())}), 416);
    }

    public final void x1(int i, QuoteData quoteData) {
        int i2 = 1;
        QuotesCategory quotesCategory = r2().m;
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", quotesCategory != null ? quotesCategory.getName() : null, null, "Comment Button Click", i, kotlin.collections.Q.f(new Pair[]{new Pair("Template Id", Integer.valueOf(quoteData.getDesign())), new Pair("Content Type", quoteData.getContentType()), new Pair("Content Format", quoteData.getContentFormat()), new Pair("Source", quoteData.getUrl()), new Pair("Quote Id", quoteData.getIdentifier())}), 424);
        Hb.C X1 = X1();
        long intValue = quoteData.getIdentifier() != null ? r3.intValue() : 0L;
        FragmentManager childFragmentManager = getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        C1332h c1332h = new C1332h(this, quoteData, i, i2);
        C1334j c1334j = new C1334j(this, quoteData, i, i2);
        X1.getClass();
        Intrinsics.checkNotNullParameter(childFragmentManager, "childFragmentManager");
        C2807b c2807b = new C2807b();
        c2807b.m = c1332h;
        c2807b.n = c1334j;
        c2807b.setArguments(Q1.c.a(new Pair[]{new Pair(Constants.KEY_ID, Long.valueOf(intValue))}));
        c2807b.show(childFragmentManager, "Quote Feedback");
    }

    public final void x2() {
        AppCompatEditText appCompatEditText;
        AppCompatEditText appCompatEditText2;
        FragmentActivity activity = getActivity();
        if (activity != null) {
            s2().getClass();
            Hb.p0.c(activity);
            C3053c2 c3053c2 = (C3053c2) this.y;
            if (c3053c2 != null && (appCompatEditText2 = c3053c2.n) != null) {
                appCompatEditText2.clearFocus();
            }
            C3053c2 c3053c22 = (C3053c2) this.y;
            if (c3053c22 == null || (appCompatEditText = c3053c22.V1) == null) {
                return;
            }
            appCompatEditText.clearFocus();
        }
    }

    public final void x3(ArrayList arrayList) {
        CardView cardView;
        CardView cardView2;
        if (arrayList.size() > 0) {
            C3053c2 c3053c2 = (C3053c2) this.y;
            if (c3053c2 == null || (cardView2 = c3053c2.p1) == null) {
                return;
            }
            Eb.X0.V(cardView2);
            return;
        }
        C3053c2 c3053c22 = (C3053c2) this.y;
        if (c3053c22 == null || (cardView = c3053c22.p1) == null) {
            return;
        }
        Eb.X0.l(cardView);
    }

    public final void x4(int i, View view, QuoteData quoteData) {
        boolean z = quoteData instanceof QuoteData;
        QuoteData quoteData2 = z ? quoteData : null;
        if (quoteData2 == null || !quoteData2.getShowResizeDialog()) {
            z4(quoteData);
            do.a.a.c("mytag upload profile photo #1", new Object[0]);
            String y02 = y0();
            String type = quoteData.getType();
            String url = quoteData.getUrl();
            QuotesCategory quotesCategory = r2().m;
            String name = quotesCategory != null ? quotesCategory.getName() : null;
            Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
            String contentType = quoteData.getContentType();
            Pair pair2 = new Pair("Content Type", (contentType == null || StringsKt.J(contentType)) ? "QUOTE" : quoteData.getContentType());
            Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
            User user = this.W2;
            com.crafto.android.ui.base.a.f0(this, "Upload Photo", y02, name, url, type, i, kotlin.collections.Q.f(new Pair[]{pair, pair2, pair3, new Pair("Crafto Premium State", Boolean.valueOf(user != null ? user.isUserPremium() : false))}), 416);
            return;
        }
        QuoteData quoteData3 = z ? quoteData : null;
        if (quoteData3 == null || quoteData3.getShowProfilePhoto()) {
            K1(quoteData, view, "Button Clicked");
            return;
        }
        com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", "PROFILE_PHOTO", "Add Photo", null, 0, null, 1008);
        QuoteView quoteView = view instanceof QuoteView ? (QuoteView) view : null;
        if (quoteView != null) {
            Eb.z0.l0(quoteView, quoteData, (Boolean) null, (User) null, false, 14);
        }
        E7.G g = this.m3;
        if (g != null) {
            g.notifyItemChanged(i);
        }
    }

    @Override
    public final void y(I7.a aVar, int i, @NotNull AppEnums.f fVar, Throwable th, Long l) {
        Intrinsics.checkNotNullParameter(fVar, "clickType");
        I7.b.g(fVar);
        H2(this, aVar, i, fVar, th, null, l, 16);
    }

    @Override
    @NotNull
    public final String y0() {
        return this.t2 ? "Created Quote Preview" : this.v2 ? "Following Feed" : "Home Screen";
    }

    public final void y1(int i, final View view, final QuoteData quoteData) {
        User user;
        String str;
        String name;
        a.a aVar = do.a.a;
        int i2 = 0;
        StringBuilder a = defpackage.m.a(aVar, Eb.J0.a(i, "CONTENT_LOAD_SUCCESS "), new Object[0], "CONTENT_LOAD_S2 ");
        a.append(quoteData.getUrl());
        aVar.c(a.toString(), new Object[0]);
        User E2 = e2().E();
        if (E2 != null && E2.isBusinessUser() && Intrinsics.areEqual(E2.getLanguage(), "HINDI")) {
            QuotesCategory quotesCategory = this.S3;
            if (quotesCategory == null || (name = quotesCategory.getName()) == null) {
                str = null;
            } else {
                str = name.toLowerCase(Locale.ROOT);
                Intrinsics.checkNotNullExpressionValue(str, "toLowerCase(...)");
            }
            List list = a.e.a;
            if (Intrinsics.areEqual(str, a.e.F1)) {
                i2 = 1;
            }
        }
        if (this.y2 == i2) {
            QuotesCategory quotesCategory2 = this.S3;
            String type = quotesCategory2 != null ? quotesCategory2.getType() : null;
            List list2 = a.e.a;
            if (Intrinsics.areEqual(type, a.e.b1) || (user = this.W2) == null || !Intrinsics.areEqual(user.isLogFirstContent(), Boolean.TRUE)) {
                return;
            }
            x0(new Function0() {
                public final Object invoke() {
                    boolean z = D7.Q4;
                    D7 d7 = this;
                    Intrinsics.checkNotNullParameter(d7, "this$0");
                    View view2 = view;
                    Intrinsics.checkNotNullParameter(view2, "$view");
                    QuoteData quoteData2 = quoteData;
                    Intrinsics.checkNotNullParameter(quoteData2, "$click");
                    D7.s3(4, view2, quoteData2, d7);
                    return Unit.a;
                }
            });
        }
    }

    public final void y2() {
        C3029ac c3029ac;
        ConstraintLayout constraintLayout;
        C3029ac c3029ac2;
        CustomCountdownTimer customCountdownTimer;
        W7.o0 o0Var;
        C3029ac c3029ac3;
        LottieAnimationView lottieAnimationView;
        C3029ac c3029ac4;
        LottieAnimationView lottieAnimationView2;
        FragmentActivity activity = getActivity();
        if ((activity != null ? activity.getApplication() : null) instanceof CraftoApp) {
            FragmentActivity activity2 = getActivity();
            Application application = activity2 != null ? activity2.getApplication() : null;
            Intrinsics.checkNotNull(application, "null cannot be cast to non-null type com.crafto.android.CraftoApp");
            ((CraftoApp) application).j = true;
            C3053c2 c3053c2 = (C3053c2) this.y;
            if (c3053c2 != null && (c3029ac4 = c3053c2.t) != null && (lottieAnimationView2 = c3029ac4.c) != null) {
                lottieAnimationView2.clearAnimation();
            }
            C3053c2 c3053c22 = (C3053c2) this.y;
            if (c3053c22 != null && (c3029ac3 = c3053c22.t) != null && (lottieAnimationView = c3029ac3.c) != null) {
                lottieAnimationView.cancelAnimation();
            }
            C3053c2 c3053c23 = (C3053c2) this.y;
            if (c3053c23 != null && (c3029ac2 = c3053c23.t) != null && (customCountdownTimer = c3029ac2.b) != null && (o0Var = customCountdownTimer.c) != null) {
                o0Var.cancel();
            }
            C3053c2 c3053c24 = (C3053c2) this.y;
            if (c3053c24 == null || (c3029ac = c3053c24.t) == null || (constraintLayout = c3029ac.d) == null) {
                return;
            }
            Eb.X0.l(constraintLayout);
        }
    }

    public final void y3(boolean z) {
        MaterialTextView materialTextView;
        AppCompatImageView appCompatImageView;
        RecyclerView recyclerView;
        MaterialTextView materialTextView2;
        MaterialTextView materialTextView3;
        AppCompatImageView appCompatImageView2;
        RecyclerView recyclerView2;
        MaterialTextView materialTextView4;
        if (!z) {
            C3053c2 c3053c2 = (C3053c2) this.y;
            if (c3053c2 != null && (materialTextView2 = c3053c2.r2) != null) {
                Eb.X0.V(materialTextView2);
            }
            C3053c2 c3053c22 = (C3053c2) this.y;
            if (c3053c22 != null && (recyclerView = c3053c22.l2) != null) {
                Eb.X0.V(recyclerView);
            }
            C3053c2 c3053c23 = (C3053c2) this.y;
            if (c3053c23 != null && (appCompatImageView = c3053c23.B) != null) {
                Eb.X0.l(appCompatImageView);
            }
            C3053c2 c3053c24 = (C3053c2) this.y;
            if (c3053c24 == null || (materialTextView = c3053c24.s2) == null) {
                return;
            }
            Eb.X0.l(materialTextView);
            return;
        }
        v4();
        C3053c2 c3053c25 = (C3053c2) this.y;
        if (c3053c25 != null && (materialTextView4 = c3053c25.r2) != null) {
            Eb.X0.l(materialTextView4);
        }
        C3053c2 c3053c26 = (C3053c2) this.y;
        if (c3053c26 != null && (recyclerView2 = c3053c26.l2) != null) {
            Eb.X0.l(recyclerView2);
        }
        C3053c2 c3053c27 = (C3053c2) this.y;
        if (c3053c27 != null && (appCompatImageView2 = c3053c27.B) != null) {
            Eb.X0.V(appCompatImageView2);
        }
        C3053c2 c3053c28 = (C3053c2) this.y;
        if (c3053c28 != null && (materialTextView3 = c3053c28.s2) != null) {
            Eb.X0.V(materialTextView3);
        }
        com.crafto.android.ui.base.a.f0(this, "Landed", "Whatsapp status loaded", null, null, "No content screen", 0, null, 1004);
    }

    public final void y4(int i, View view, QuoteData quoteData) {
        String str;
        char c;
        D7 d7;
        int i2;
        User user;
        User user2;
        do.a.a.c("mytag upload profile photo #2", new Object[0]);
        this.V2 = quoteData;
        C1808p1 r2 = r2();
        if (Intrinsics.areEqual(quoteData.getContentType(), "ANNIVERSARY_IMAGE") || Intrinsics.areEqual(quoteData.getContentType(), "ADD_USER_PHOTO_QUOTE") || quoteData.getDesign() == 199) {
            str = "Anniversary Image";
        } else if (Intrinsics.areEqual(quoteData.getContentType(), "FULLSCREEN_IMAGE_ON_VIDEO")) {
            str = this.L2;
        } else if (Intrinsics.areEqual(quoteData.getCropStyle(), "FIXED") && (user2 = this.W2) != null && user2.isBusinessUser()) {
            com.crafto.android.ui.base.a.f0(this, "Click Action", "Home Screen", null, null, "Change Product Photo", 0, null, 1004);
            str = this.M2;
        } else {
            str = "upload_others_photo";
        }
        r2.I = str;
        String cropStyle = quoteData.getCropStyle();
        if (cropStyle == null) {
            cropStyle = "SQUARE";
        }
        this.B2 = cropStyle;
        if (quoteData.getShowBirthdayPricingFlow()) {
            C3533a1.k2 = quoteData.getUrl();
            this.Y2 = i;
            c = 0;
            F2(this, true, quoteData.getChipTag(), quoteData, view, null, null, null, false, null, null, false, false, null, 12272);
            quoteData.setSelectedCategory(r2().m);
            i2 = 1;
            d7 = this;
        } else {
            c = 0;
            d7 = this;
            if (!Intrinsics.areEqual(quoteData.isPremiumRequiredToChangePhoto(), Boolean.TRUE) || ((user = d7.W2) != null && user.isUserPremium())) {
                if (Build.VERSION.SDK_INT >= 34) {
                    i2 = 1;
                    d7.d = new Va.V(d7, i2);
                    Pb.h.e(Z1(), d7.k4);
                } else {
                    i2 = 1;
                    d7.H4 = true;
                    FragmentActivity activity = getActivity();
                    if (activity != null) {
                        String[] strArr = Hb.I.a;
                        if (Hb.I.b(activity, d7.f)) {
                            j4();
                        }
                    }
                }
            }
            F2(this, true, quoteData.getChipTag(), quoteData, view, null, null, null, false, null, null, false, false, null, 16368);
            i2 = 1;
        }
        String url = quoteData.getUrl();
        String type = quoteData.getType();
        QuotesCategory quotesCategory = r2().m;
        String name = quotesCategory != null ? quotesCategory.getName() : null;
        Pair pair = new Pair("Template Id", Integer.valueOf(quoteData.getDesign()));
        String contentType = quoteData.getContentType();
        Pair pair2 = new Pair("Content Type", (contentType == null || StringsKt.J(contentType)) ? "QUOTE" : quoteData.getContentType());
        Pair pair3 = new Pair("Content Format", quoteData.getContentFormat());
        User user3 = d7.W2;
        Pair pair4 = new Pair("Crafto Premium State", Boolean.valueOf(user3 != null ? user3.isUserPremium() : false));
        Pair[] pairArr = new Pair[4];
        pairArr[c] = pair;
        pairArr[i2] = pair2;
        pairArr[2] = pair3;
        pairArr[3] = pair4;
        com.crafto.android.ui.base.a.f0(this, "Upload Photo", "Home Screen", name, url, type, i, kotlin.collections.Q.f(pairArr), 416);
    }

    public final Object z1(Context context, File[] fileArr, boolean z, int i, Kk.c<? super Bitmap> cVar) {
        ExecutorService newSingleThreadExecutor = Executors.newSingleThreadExecutor();
        Intrinsics.checkNotNullExpressionValue(newSingleThreadExecutor, "newSingleThreadExecutor(...)");
        return dl.g.e(cVar, new dl.l0(newSingleThreadExecutor).plus(new C1611d(CoroutineExceptionHandler.a.a)), new C1612e(z, this, fileArr, i, context, null));
    }

    public final void z2() {
        x0(new T4(this, 0));
    }

    public final void z3(boolean z) {
        Widget widget;
        Widget widget2;
        Widget widget3;
        Widget widget4;
        InitData initData = this.x2;
        I7.m mVar = null;
        if (((initData == null || (widget4 = initData.getWidget()) == null) ? null : widget4.getData()) instanceof QuoteData) {
            InitData initData2 = this.x2;
            I7.m data = (initData2 == null || (widget3 = initData2.getWidget()) == null) ? null : widget3.getData();
            Intrinsics.checkNotNull(data, "null cannot be cast to non-null type com.crafto.android.data.model.QuoteData");
            ((QuoteData) data).setPageSelected(z);
        }
        InitData initData3 = this.x2;
        if (((initData3 == null || (widget2 = initData3.getWidget()) == null) ? null : widget2.getData()) instanceof MembershipData) {
            InitData initData4 = this.x2;
            if (initData4 != null && (widget = initData4.getWidget()) != null) {
                mVar = widget.getData();
            }
            Intrinsics.checkNotNull(mVar, "null cannot be cast to non-null type com.crafto.android.data.model.MembershipData");
            ((MembershipData) mVar).setPageSelected(z);
        }
    }

    public final void z4(QuoteData quoteData) {
        String str;
        User user;
        C3533a1.k2 = quoteData.getUrl();
        String cropStyle = quoteData.getCropStyle();
        if (cropStyle == null) {
            cropStyle = "SQUARE";
        }
        this.B2 = cropStyle;
        if (Intrinsics.areEqual(quoteData.isPremiumRequiredToChangePhoto(), Boolean.TRUE) && ((user = this.W2) == null || !user.isUserPremium())) {
            F2(this, true, quoteData.getChipTag(), quoteData, getView(), null, null, null, false, null, null, false, false, null, 16368);
            return;
        }
        C1808p1 r2 = r2();
        if (Intrinsics.areEqual(quoteData.getContentType(), "ANNIVERSARY_VIDEO_WITH_IMAGE") || Intrinsics.areEqual(quoteData.getContentType(), "ADD_USER_PHOTO_VIDEO")) {
            str = this.J2;
        } else if (Intrinsics.areEqual(quoteData.getContentType(), "ANNIVERSARY_IMAGE") || Intrinsics.areEqual(quoteData.getContentType(), "ADD_USER_PHOTO_QUOTE")) {
            str = this.K2;
        } else if (quoteData.getDesign() == 703 && Intrinsics.areEqual(quoteData.getContentType(), "VIDEO_FRAME")) {
            this.A4 = AppEnums.f.E0.a;
            str = this.I2;
        } else if (quoteData.isFilterEnabled()) {
            this.A4 = AppEnums.f.E0.a;
            str = this.H2;
        } else {
            if (Intrinsics.areEqual(quoteData.getContentType(), "VIDEO_FRAME")) {
                this.A4 = AppEnums.f.E0.a;
            }
            str = this.G2;
        }
        r2.I = str;
        if (Intrinsics.areEqual(this.B2, "FIXED")) {
            r2().I = "BUSINESS_PRODUCT_IMAGE";
        }
        if (Build.VERSION.SDK_INT >= 34) {
            this.d = new C1053u0(this, 3);
            UserConfigData e = e2().e();
            if (e == null || !e.getUseActionGalleryPicker()) {
                Pb.h.e(Z1(), this.k4);
                return;
            } else {
                this.j4.launch(E7.D.a("android.intent.action.PICK", "image/*"));
                return;
            }
        }
        this.H4 = true;
        FragmentActivity activity = getActivity();
        if (activity != null) {
            String[] strArr = Hb.I.a;
            if (Hb.I.b(activity, this.f)) {
                j4();
            }
        }
    }

    public static final class C implements BaseActivity.a {
        @Override
        public final void g(QuoteData quoteData, String str, a.InterfaceC0051a interfaceC0051a, Integer num, Function1 function1) {
            C0241e.c(quoteData, interfaceC0051a);
        }

        @Override
        public final void h(QuoteData quoteData, C2457H0 c2457h0) {
            C0241e.a(quoteData, c2457h0);
        }

        @Override
        public final void k(QuoteData quoteData, sa saVar, String str, Function1 function1) {
            Intrinsics.checkNotNullParameter(quoteData, "click");
        }

        @Override
        public final void l(xa xaVar) {
            C0241e.b(xaVar);
        }

        @Override
        public final void b() {
        }

        @Override
        public final void c() {
        }

        @Override
        public final void d() {
        }

        @Override
        public final void f() {
        }

        @Override
        public final void a(Function1 function1) {
        }

        @Override
        public final void i(User user) {
        }

        @Override
        public final void n(C1197a0 c1197a0) {
        }

        @Override
        public final void o(User user) {
        }

        @Override
        public final void m(User user, Function0 function0, QuoteData quoteData, InitData initData, Bitmap bitmap) {
        }

        @Override
        public final void j(User user, String str, Integer num, QuoteData quoteData, boolean z, Boolean bool, InitData initData, boolean z2, Integer num2, Function0 function0) {
        }
    }

    public static final class D implements i.a {
        public final Uri b;

        public D(Uri uri) {
            this.b = uri;
        }

        public final void b(Bitmap bitmap) {
            D7 d7 = D7.this;
            d7.x0(new Bb.f<>(bitmap, d7, 1, this.b));
        }

        public final void a() {
        }
    }

    @SourceDebugExtension({"SMAP\nTrendingHomeFullScreenExpFragment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$onActivityResult$3$1\n+ 2 Uri.kt\nandroidx/core/net/UriKt\n*L\n1#1,22219:1\n36#2:22220\n*S KotlinDebug\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$onActivityResult$3$1\n*L\n19138#1:22220\n*E\n"})
    public static final class E implements i.a {
        public E() {
        }

        public final void b(Bitmap bitmap) {
            D7 d7 = D7.this;
            bj.j context = d7.getContext();
            if (context != null) {
                Hb.i L = d7.L();
                Bb.h hVar = new Bb.h(1, d7, context);
                L.getClass();
                Intrinsics.checkNotNullParameter(context, "context");
                Intrinsics.checkNotNullParameter(hVar, "onBitmapReceived");
                if (bitmap != null) {
                    Hb.i.g((ContextWrapper) context, bitmap, new E8.L2(bitmap, L, 1, hVar));
                }
            }
        }

        public final void a() {
        }
    }

    @SourceDebugExtension({"SMAP\nTrendingHomeFullScreenExpFragment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$onActivityResult$4$1\n+ 2 Uri.kt\nandroidx/core/net/UriKt\n*L\n1#1,22219:1\n36#2:22220\n*S KotlinDebug\n*F\n+ 1 TrendingHomeFullScreenExpFragment.kt\ncom/crafto/android/ui/home/TrendingHomeFullScreenExpFragment$onActivityResult$4$1\n*L\n19172#1:22220\n*E\n"})
    public static final class F implements i.a {
        public F() {
        }

        public final void b(final Bitmap bitmap) {
            final D7 d7 = D7.this;
            d7.x0(new Function0() {
                public final Object invoke() {
                    D7 d72 = d7;
                    Intrinsics.checkNotNullParameter(d72, "this$0");
                    Bitmap bitmap2 = bitmap;
                    if (bitmap2 == null) {
                        return null;
                    }
                    d72.L().getClass();
                    Intrinsics.checkNotNullParameter(bitmap2, "src");
                    int width = bitmap2.getWidth() / 20;
                    int height = bitmap2.getHeight() / 20;
                    do.a.a.c(Rd.p.a(bitmap2, K.N.c(width, height, "addBitmapPadding padding_x ", " padding_y ", " src "), ' '), new Object[0]);
                    Bitmap createBitmap = Bitmap.createBitmap(bitmap2.getWidth() + width, bitmap2.getHeight() + height, Bitmap.Config.ARGB_8888);
                    Intrinsics.checkNotNullExpressionValue(createBitmap, "createBitmap(...)");
                    Canvas canvas = new Canvas(createBitmap);
                    canvas.drawARGB(12, 12, 12, 12);
                    float f = 2;
                    canvas.drawBitmap(bitmap2, width / f, height / f, (Paint) null);
                    Uri l = Hb.i.l(d72.L(), Eb.E.a(d72), createBitmap);
                    if (l != null) {
                        return d72.x0(new E8.u6(1, d72, l));
                    }
                    return null;
                }
            });
        }

        public final void a() {
        }
    }

    @Mk.e(c = "com.crafto.android.ui.home.TrendingHomeFullScreenExpFragment$prepareSortedGalleryImageEvent$1$2", f = "TrendingHomeFullScreenExpFragment.kt", l = {21403}, m = "invokeSuspend")
    public static final class M extends Mk.i implements Function2<dl.H, Kk.c<? super Unit>, Object> {
        public D7 a;
        public Context b;
        public int c;
        public int d;
        public final Context f;
        public final int g;

        public M(Context context, int i, Kk.c<? super M> cVar) {
            super(2, cVar);
            this.f = context;
            this.g = i;
        }

        public final Kk.c<Unit> create(Object obj, Kk.c<?> cVar) {
            return D7.this.new M(this.f, this.g, cVar);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((dl.H) obj, (Kk.c) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(Object obj) {
            int i;
            Object z1;
            D7 d7;
            Context context;
            Lk.a aVar = Lk.a.COROUTINE_SUSPENDED;
            int i2 = this.d;
            if (i2 == 0) {
                Hk.q.b(obj);
                File[] listFiles = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "Camera").listFiles();
                if (listFiles != null) {
                    File[] fileArr = (File[]) kotlin.collections.o.C(listFiles);
                    D7 d72 = D7.this;
                    this.a = d72;
                    Context context2 = this.f;
                    this.b = context2;
                    i = this.g;
                    this.c = i;
                    this.d = 1;
                    boolean z = D7.Q4;
                    z1 = d72.z1(context2, fileArr, true, i, this);
                    if (z1 == aVar) {
                        return aVar;
                    }
                    d7 = d72;
                    context = context2;
                }
                return Unit.a;
            }
            if (i2 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            int i3 = this.c;
            context = this.b;
            d7 = this.a;
            Hk.q.b(obj);
            i = i3;
            z1 = obj;
            Bitmap bitmap = (Bitmap) z1;
            if (bitmap != null) {
                d7.L().getClass();
                Uri a2 = Hb.i.a(context, bitmap, i + "_sorted_camera_images.jpg");
                if (a2 != null) {
                    ArrayList arrayList = new ArrayList();
                    Iterator it = kotlin.collections.t.e(new Uri[]{a2}).iterator();
                    Intrinsics.checkNotNullExpressionValue(it, "iterator(...)");
                    int i4 = 1;
                    while (it.hasNext()) {
                        Object next = it.next();
                        Intrinsics.checkNotNullExpressionValue(next, "next(...)");
                        MultipartBody.Part f = d7.d2().f(context, Eb.J0.a(i4, "files"), (Uri) next, a.e.e, new a(), false, false);
                        if (f != null) {
                            arrayList.add(f);
                        }
                        i4++;
                    }
                    d7.d2().p(i == 3 ? a.e.Q1 : a.e.P1, arrayList, false);
                }
            }
            return Unit.a;
        }

        public static final class a implements Ab.O {
            public final void a(int i) {
            }

            public final void onError(String str) {
            }

            public final void onSuccess(String str) {
            }
        }
    }

    @Override
    public final void t(I7.a aVar, int i) {
    }
}