WeChat.apk(点击下载) / ContactWidgetTabBizInfo.java


package com.tencent.mm.plugin.profile.ui.tab;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.RelativeLayout;
import androidx.appcompat.app.ActionBar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.x;
import androidx.lifecycle.a0;
import androidx.lifecycle.r;
import androidx.viewpager.widget.ViewPager;
import bg0.w0;
import bw3.cj;
import bw3.d40;
import bw3.dj;
import bw3.e54;
import bw3.ej;
import bw3.hi;
import bw3.kh;
import bw3.lh;
import bw3.rj;
import bw3.ue;
import bw3.uh;
import bw3.wf;
import bw3.zl0;
import com.tencent.mm.R;
import com.tencent.mm.feature.biz.BizContactObserver;
import com.tencent.mm.plugin.profile.ui.ContactInfoUI;
import com.tencent.mm.plugin.profile.ui.DialogContactInfoUI;
import com.tencent.mm.plugin.profile.ui.tab.ContactWidgetTabBizHeaderController;
import com.tencent.mm.plugin.profile.ui.tab.data.BizProfileDataFetcher;
import com.tencent.mm.plugin.profile.ui.tab.list.BizProfileErrorFragment;
import com.tencent.mm.plugin.profile.ui.tab.list.BizProfileTabMsgFragment;
import com.tencent.mm.plugin.profile.ui.tab.list.BizProfileTabVideoFragment;
import com.tencent.mm.plugin.profile.ui.tab.observer.BizProfileExtraOperateObserver;
import com.tencent.mm.plugin.profile.ui.tab.observer.BizProfileWidgetOperateObserver;
import com.tencent.mm.plugin.profile.ui.tab.ting.AudioFragmentStub;
import com.tencent.mm.plugin.profile.ui.tab.ting.BaseAudioFragment;
import com.tencent.mm.plugin.profile.ui.tab.ting.BizProfileTabAudioFragment;
import com.tencent.mm.plugin.profile.ui.tab.ting.BizProfileTabAudioWithAlbumFragment;
import com.tencent.mm.plugin.profile.ui.tab.view.BizProfileTabLayout;
import com.tencent.mm.sdk.event.IListener;
import com.tencent.mm.sdk.platformtools.BuildInfo;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MultiProcessMMKV;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.sdk.platformtools.WeChatEnvironment;
import com.tencent.mm.storage.u0;
import com.tencent.mm.storage.z1;
import com.tencent.mm.ui.MMActivityController;
import com.tencent.mm.ui.w;
import com.tencent.tmassistantsdk.openSDK.OpenSDKTool4Assistant;
import d60.z;
import dk0.j0;
import ie1.h;
import ih.c;
import ih.s0;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import jo3.z0;
import junit.framework.Assert;
import kotlin.Metadata;
import lh4.f0;
import org.json.JSONObject;
import p64.e0;
import p64.q;
import t2.a;
import t32.a2;
import t32.k5;
import t32.p1;
import xg4.c0;
import xg4.q0;

@Metadata(bv = {}, d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u00012\u00020\u0002:\u0001\rB+\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0005\u0012\b\u0010\b\u001a\u0004\u0018\u00010\u0007\u0012\u0006\u0010\n\u001a\u00020\t¢\u0006\u0004\b\u000b\u0010\f¨\u0006\u000e"}, d2 = {"Lcom/tencent/mm/plugin/profile/ui/tab/ContactWidgetTabBizInfo;", "Lgu3/b;", "Landroidx/lifecycle/r;", "Lcom/tencent/mm/plugin/profile/ui/ContactInfoUI;", "context", "", "brandIconUrl", "Lbw3/d40;", "customizedInfo", "", "enterTime", "<init>", "(Lcom/tencent/mm/plugin/profile/ui/ContactInfoUI;Ljava/lang/String;Lbw3/d40;J)V", "a", "app_release"}, k = 1, mv = {1, 7, 1})
public final class ContactWidgetTabBizInfo implements gu3.b, r {
    public boolean A = true;
    public String B = "";
    public int C;
    public wg4.l<String, String> D;
    public final wg4.g E = wg4.h.a(new i(this));
    public final wg4.g F = wg4.h.a(new j(this));
    public final wg4.g G = wg4.h.a(new h(this));
    public final wg4.g H = wg4.h.a(new c(this));
    public final wg4.g I = wg4.h.a(new d(this));
    public final f J = new f(this);
    public View K;
    public String L;
    public final wg4.g M;
    public Fragment N;
    public e0 P;
    public final int Q;
    public final int R;
    public final int S;
    public final int T;
    public final int U;
    public final int V;
    public final int W;
    public boolean X;
    public ViewGroup Y;
    public final int Z;

    /* renamed from: d  reason: collision with root package name */
    public final ContactInfoUI f138341d;

    /* renamed from: e  reason: collision with root package name */
    public String f138342e;

    /* renamed from: f  reason: collision with root package name */
    public d40 f138343f;

    /* renamed from: g  reason: collision with root package name */
    public long f138344g;

    /* renamed from: h  reason: collision with root package name */
    public List<gs2.a> f138345h = new ArrayList();

    /* renamed from: i  reason: collision with root package name */
    public z1 f138346i;

    /* renamed from: j  reason: collision with root package name */
    public ih.c f138347j;

    /* renamed from: n  reason: collision with root package name */
    public int f138348n;

    /* renamed from: o  reason: collision with root package name */
    public hi f138349o;

    /* renamed from: p  reason: collision with root package name */
    public List<? extends c.a> f138350p;

    /* renamed from: p0  reason: collision with root package name */
    public final String f138351p0;

    /* renamed from: q  reason: collision with root package name */
    public c.b f138352q;

    /* renamed from: r  reason: collision with root package name */
    public boolean f138353r;

    /* renamed from: s  reason: collision with root package name */
    public boolean f138354s = true;

    /* renamed from: t  reason: collision with root package name */
    public boolean f138355t;

    /* renamed from: u  reason: collision with root package name */
    public final String f138356u = "crashFlag";

    /* renamed from: v  reason: collision with root package name */
    public ContactWidgetTabBizHeaderController f138357v;

    /* renamed from: w  reason: collision with root package name */
    public final List<Fragment> f138358w = new ArrayList();

    /* renamed from: x  reason: collision with root package name */
    public ViewPager f138359x;

    /* renamed from: y  reason: collision with root package name */
    public a f138360y;

    /* renamed from: z  reason: collision with root package name */
    public BizProfileTabLayout f138361z;

    public static final class a extends x {

        /* renamed from: d  reason: collision with root package name */
        public final List<Fragment> f138362d;

        /* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: java.util.List<? extends androidx.fragment.app.Fragment> */
        /* JADX WARN: Multi-variable type inference failed */
        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public a(List<? extends Fragment> list, FragmentManager fragmentManager) {
            super(fragmentManager);
            lh4.m.g(list, "fragments");
            lh4.m.g(fragmentManager, "fm");
            this.f138362d = list;
        }

        @Override // androidx.viewpager.widget.a
        public int getCount() {
            return this.f138362d.size();
        }

        @Override // androidx.fragment.app.x
        public Fragment getItem(int i15) {
            return this.f138362d.get(i15);
        }

        @Override // androidx.fragment.app.x
        public long getItemId(int i15) {
            return (long) System.identityHashCode(this.f138362d.get(i15));
        }

        @Override // androidx.viewpager.widget.a
        public int getItemPosition(Object obj) {
            lh4.m.g(obj, "item");
            int S = c0.S(this.f138362d, obj);
            if (S == -1) {
                return -2;
            }
            return S;
        }
    }

    public static final class b<T> implements a0 {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138363d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ AudioFragmentStub f138364e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ String f138365f;

        public b(ContactWidgetTabBizInfo contactWidgetTabBizInfo, AudioFragmentStub audioFragmentStub, String str) {
            this.f138363d = contactWidgetTabBizInfo;
            this.f138364e = audioFragmentStub;
            this.f138365f = str;
        }

        @Override // androidx.lifecycle.a0
        public void onChanged(Object obj) {
            boolean z15;
            BaseAudioFragment baseAudioFragment;
            String str;
            String str2;
            BizProfileDataFetcher.a aVar = (BizProfileDataFetcher.a) obj;
            if (aVar.f138412h) {
                zl0 zl02 = aVar.f138411g;
                boolean z16 = true;
                if (zl02 == null || zl02.f44600e <= 0 || zl02.f44599d.size() <= 0) {
                    z15 = false;
                } else {
                    z15 = true;
                }
                if (z15) {
                    BaseAudioFragment bizProfileTabAudioWithAlbumFragment = new BizProfileTabAudioWithAlbumFragment();
                    String str3 = this.f138365f;
                    ContactWidgetTabBizInfo contactWidgetTabBizInfo = this.f138363d;
                    bizProfileTabAudioWithAlbumFragment.f138586d = str3;
                    z1 z1Var = contactWidgetTabBizInfo.f138346i;
                    if (z1Var != null) {
                        str2 = z1Var.getUsername();
                    } else {
                        str2 = null;
                    }
                    bizProfileTabAudioWithAlbumFragment.f138587e = str2;
                    bizProfileTabAudioWithAlbumFragment.f138589g = aVar;
                    baseAudioFragment = bizProfileTabAudioWithAlbumFragment;
                } else {
                    BizProfileTabAudioFragment bizProfileTabAudioFragment = new BizProfileTabAudioFragment();
                    String str4 = this.f138365f;
                    ContactWidgetTabBizInfo contactWidgetTabBizInfo2 = this.f138363d;
                    bizProfileTabAudioFragment.f138586d = str4;
                    z1 z1Var2 = contactWidgetTabBizInfo2.f138346i;
                    if (z1Var2 != null) {
                        str = z1Var2.getUsername();
                    } else {
                        str = null;
                    }
                    bizProfileTabAudioFragment.f138587e = str;
                    bizProfileTabAudioFragment.f138589g = aVar;
                    List<com.tencent.mm.plugin.finder.feed.model.c> list = aVar.f138405a;
                    if (list != null) {
                        ((ArrayList) bizProfileTabAudioFragment.f138591j).clear();
                        ((ArrayList) bizProfileTabAudioFragment.f138591j).addAll(list);
                    }
                    BizProfileDataFetcher e15 = contactWidgetTabBizInfo2.e();
                    lh4.m.g(e15, "dataFetcher");
                    bizProfileTabAudioFragment.f138588f = e15;
                    e15.f138400n.observe(bizProfileTabAudioFragment, new hs2.d(bizProfileTabAudioFragment));
                    baseAudioFragment = bizProfileTabAudioFragment;
                }
                Integer valueOf = Integer.valueOf(((ArrayList) this.f138363d.f138358w).indexOf(this.f138364e));
                ContactWidgetTabBizInfo contactWidgetTabBizInfo3 = this.f138363d;
                int intValue = valueOf.intValue();
                if (intValue < 0 || intValue >= ((ArrayList) contactWidgetTabBizInfo3.f138358w).size()) {
                    z16 = false;
                }
                if (!z16) {
                    valueOf = null;
                }
                if (valueOf != null) {
                    ContactWidgetTabBizInfo contactWidgetTabBizInfo4 = this.f138363d;
                    ((ArrayList) contactWidgetTabBizInfo4.f138358w).set(valueOf.intValue(), baseAudioFragment == 1 ? 1 : 0);
                    a aVar2 = contactWidgetTabBizInfo4.f138360y;
                    if (aVar2 != null) {
                        aVar2.notifyDataSetChanged();
                    } else {
                        lh4.m.p("pagerAdapter");
                        throw null;
                    }
                }
            }
        }
    }

    public static final class c extends lh4.o implements kh4.a<Integer> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138366d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public c(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            super(0);
            this.f138366d = contactWidgetTabBizInfo;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Integer invoke() {
            int i15 = 0;
            int intExtra = this.f138366d.f138341d.getIntent().getIntExtra("biz_profile_tab_type", 0);
            if (intExtra <= 1) {
                i15 = intExtra;
            }
            return Integer.valueOf(i15);
        }
    }

    public static final class d extends lh4.o implements kh4.a<Boolean> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138367d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public d(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            super(0);
            this.f138367d = contactWidgetTabBizInfo;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Boolean invoke() {
            return Boolean.valueOf(this.f138367d.f138341d.getIntent().getBooleanExtra("biz_profile_enter_from_finder", false));
        }
    }

    public static final class e extends lh4.o implements kh4.a<Long> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138368d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public e(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            super(0);
            this.f138368d = contactWidgetTabBizInfo;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Long invoke() {
            return Long.valueOf(this.f138368d.f138341d.getIntent().getLongExtra("finder_feed_id", 0));
        }
    }

    public static final class f implements r0 {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138369a;

        public f(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            this.f138369a = contactWidgetTabBizInfo;
        }

        @Override // com.tencent.mm.plugin.profile.ui.tab.r0
        public void a() {
            ContactWidgetTabBizInfo.c(this.f138369a);
        }

        @Override // com.tencent.mm.plugin.profile.ui.tab.r0
        public void b() {
            ContactWidgetTabBizInfo.b(this.f138369a);
        }
    }

    public static final class g<T> implements a0 {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138370d;

        public g(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            this.f138370d = contactWidgetTabBizInfo;
        }

        /* JADX DEBUG: Failed to insert an additional move for type inference into block B:234:0x0189 */
        /* JADX DEBUG: Failed to insert an additional move for type inference into block B:159:0x030d */
        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Type inference failed for: r2v0, types: [com.tencent.mm.plugin.profile.ui.tab.ContactWidgetTabBizInfo] */
        /* JADX WARN: Type inference failed for: r7v2 */
        /* JADX WARN: Type inference failed for: r10v5, types: [androidx.fragment.app.Fragment, java.lang.Object] */
        /* JADX WARN: Type inference failed for: r11v7 */
        /* JADX WARN: Type inference failed for: r10v6, types: [androidx.fragment.app.Fragment] */
        /* JADX WARN: Type inference failed for: r7v6 */
        /* JADX WARN: Type inference failed for: r0v11 */
        /* JADX WARN: Type inference failed for: r0v14 */
        /* JADX WARN: Type inference failed for: r0v16 */
        /* JADX WARN: Type inference failed for: r7v7 */
        /* JADX WARN: Type inference failed for: r7v9 */
        /* JADX WARN: Type inference failed for: r7v11, types: [java.util.ArrayList] */
        /* JADX WARN: Type inference failed for: r10v7, types: [com.tencent.mm.plugin.profile.ui.tab.list.BizProfileTabVideoFragment, androidx.fragment.app.Fragment, java.lang.Object] */
        /* JADX WARN: Type inference failed for: r10v12, types: [androidx.fragment.app.Fragment, java.lang.Object] */
        /* JADX WARN: Type inference failed for: r11v20 */
        /* JADX WARN: Type inference failed for: r11v22 */
        /* JADX WARN: Type inference failed for: r11v33 */
        /* JADX WARN: Type inference failed for: r11v34 */
        /* JADX WARN: Type inference failed for: r11v37 */
        /* JADX WARN: Type inference failed for: r7v38 */
        /* JADX WARN: Type inference failed for: r7v40 */
        /* JADX WARN: Type inference failed for: r7v41 */
        /* JADX WARN: Type inference failed for: r7v42 */
        /* JADX WARN: Type inference failed for: r7v43 */
        /* JADX WARN: Type inference failed for: r7v52 */
        /* JADX WARN: Type inference failed for: r7v56 */
        /* JADX WARN: Type inference failed for: r7v61 */
        /* JADX WARNING: Removed duplicated region for block: B:134:0x022b  */
        /* JADX WARNING: Removed duplicated region for block: B:135:0x022c  */
        /* JADX WARNING: Removed duplicated region for block: B:141:0x024e A[ADDED_TO_REGION] */
        /* JADX WARNING: Removed duplicated region for block: B:150:0x02ad A[ADDED_TO_REGION] */
        /* JADX WARNING: Removed duplicated region for block: B:164:0x0323  */
        /* JADX WARNING: Removed duplicated region for block: B:169:0x032c A[ADDED_TO_REGION] */
        /* JADX WARNING: Removed duplicated region for block: B:172:0x0334  */
        /* JADX WARNING: Removed duplicated region for block: B:181:0x0350  */
        /* JADX WARNING: Removed duplicated region for block: B:28:0x007b  */
        /* JADX WARNING: Removed duplicated region for block: B:29:0x0080  */
        /* JADX WARNING: Removed duplicated region for block: B:63:0x00df  */
        /* JADX WARNING: Removed duplicated region for block: B:80:0x0132  */
        /* JADX WARNING: Unknown variable types count: 10 */
        @Override // androidx.lifecycle.a0
        public void onChanged(Object obj) {
            ?? r75;
            ContactWidgetTabBizInfo contactWidgetTabBizInfo;
            hi hiVar;
            Object obj2;
            ?? r112;
            boolean z15;
            lh lhVar;
            LinkedList<kh> linkedList;
            ?? r113;
            e54 e542;
            e54 e543;
            e54 e544;
            ?? r76;
            hi hiVar2 = (hi) obj;
            ?? r25 = this.f138370d;
            r25.f138349o = hiVar2;
            r25.h();
            ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController = r25.f138357v;
            if (contactWidgetTabBizHeaderController != null) {
                hi hiVar3 = r25.f138349o;
                ih.c cVar = r25.f138347j;
                String str = r25.L;
                contactWidgetTabBizHeaderController.f138316p = hiVar3;
                contactWidgetTabBizHeaderController.f138315o = cVar;
                contactWidgetTabBizHeaderController.f138326z = str;
                if (hiVar3 != null) {
                    int i15 = hiVar3.f23807j;
                    if ((i15 & 2) != 0) {
                        contactWidgetTabBizHeaderController.f138307d = true;
                    }
                    if ((i15 & 128) != 0) {
                        contactWidgetTabBizHeaderController.f138308e = true;
                        String b15 = a.b(contactWidgetTabBizHeaderController.f138310g, 128, hiVar3);
                        contactWidgetTabBizHeaderController.f138309f = b15;
                        if (Util.isNullOrNil(b15)) {
                            contactWidgetTabBizHeaderController.f138309f = contactWidgetTabBizHeaderController.f138310g.getString(R.string.ak8);
                        }
                    }
                    try {
                        c.b bVar = contactWidgetTabBizHeaderController.E;
                        JSONObject jSONObject = bVar.f233085a;
                        if (jSONObject != null) {
                            bVar.f233090f = jSONObject.optString("ConferenceContactExpireTime");
                        }
                        String str2 = bVar.f233090f;
                        if (!Util.isNullOrNil(str2)) {
                            long j15 = Util.getLong(str2, 0);
                            if (j15 > 0 && j15 - (System.currentTimeMillis() / 1000) < 0) {
                                r76 = true;
                                if (r76 == false) {
                                    contactWidgetTabBizHeaderController.f138318r.f138515k = true;
                                } else {
                                    contactWidgetTabBizHeaderController.f138318r.f138515k = false;
                                }
                                contactWidgetTabBizHeaderController.f138318r.n();
                            }
                        }
                    } catch (Exception unused) {
                    }
                    r76 = false;
                    if (r76 == false) {
                    }
                    contactWidgetTabBizHeaderController.f138318r.n();
                }
                contactWidgetTabBizHeaderController.f138320t.e(hiVar3);
                contactWidgetTabBizHeaderController.k();
            }
            String str3 = null;
            r25.D = new wg4.l<>(a.a(1, (hiVar2 == null || (e544 = hiVar2.f23817w) == null) ? null : e544.f20124e), a.a(2, (hiVar2 == null || (e543 = hiVar2.f23817w) == null) ? null : e543.f20124e));
            r25.C = (hiVar2 == null || (e542 = hiVar2.f23817w) == null) ? 0 : e542.f20123d;
            String b16 = hiVar2 != null ? a.b(r25.f138341d, 4, hiVar2) : null;
            if (b16 != null) {
                if ((b16.length() > 0) == true) {
                    r75 = true;
                    if (r75 == false) {
                        ViewPager viewPager = r25.f138359x;
                        if (viewPager != null) {
                            viewPager.setVisibility(0);
                            BizProfileTabLayout bizProfileTabLayout = r25.f138361z;
                            if (bizProfileTabLayout != null) {
                                bizProfileTabLayout.setVisibility(8);
                                BizProfileTabLayout bizProfileTabLayout2 = r25.f138361z;
                                if (bizProfileTabLayout2 != null) {
                                    bizProfileTabLayout2.r();
                                    BizProfileErrorFragment bizProfileErrorFragment = new BizProfileErrorFragment();
                                    lh4.m.g(b16, OpenSDKTool4Assistant.EXTRA_ERROR_MSG);
                                    bizProfileErrorFragment.f138463j = b16;
                                    ((ArrayList) r25.f138358w).clear();
                                    ((ArrayList) r25.f138358w).add(bizProfileErrorFragment);
                                    a aVar = r25.f138360y;
                                    if (aVar != null) {
                                        aVar.notifyDataSetChanged();
                                    } else {
                                        lh4.m.p("pagerAdapter");
                                        throw null;
                                    }
                                } else {
                                    lh4.m.p("menuTabLayout");
                                    throw null;
                                }
                            } else {
                                lh4.m.p("menuTabLayout");
                                throw null;
                            }
                        } else {
                            lh4.m.p("viewPager");
                            throw null;
                        }
                    } else {
                        synchronized (r25) {
                            int size = ((ArrayList) r25.f138358w).size();
                            f0 f0Var = new f0();
                            List<Fragment> list = r25.f138358w;
                            ArrayList arrayList = new ArrayList();
                            Iterator it = ((ArrayList) list).iterator();
                            while (it.hasNext()) {
                                Object next = it.next();
                                if (next instanceof BizProfileTabMsgFragment) {
                                    arrayList.add(next);
                                }
                            }
                            f0Var.f253292d = (T) c0.Q(arrayList);
                            Iterator it4 = ((ArrayList) r25.f138358w).iterator();
                            while (true) {
                                if (!it4.hasNext()) {
                                    obj2 = null;
                                    break;
                                }
                                obj2 = it4.next();
                                Fragment fragment = (Fragment) obj2;
                                if (!(fragment instanceof p1) || !((p1) fragment).z()) {
                                    r113 = false;
                                    continue;
                                } else {
                                    r113 = true;
                                    continue;
                                }
                                if (r113 == true) {
                                    break;
                                }
                            }
                            ?? r102 = (Fragment) obj2;
                            List<Fragment> list2 = r25.f138358w;
                            ArrayList arrayList2 = new ArrayList();
                            Iterator it5 = ((ArrayList) list2).iterator();
                            while (it5.hasNext()) {
                                Object next2 = it5.next();
                                if (next2 instanceof BaseAudioFragment) {
                                    arrayList2.add(next2);
                                }
                            }
                            BaseAudioFragment baseAudioFragment = (BaseAudioFragment) c0.Q(arrayList2);
                            if (!(hiVar2 == null || hiVar2.f23803f == null || f0Var.f253292d != null)) {
                                T t15 = (T) new BizProfileTabMsgFragment();
                                t15.f138488o = r25.g();
                                hi hiVar4 = r25.f138349o;
                                if (hiVar4 == null) {
                                    hiVar4 = new hi();
                                }
                                t15.P(hiVar4);
                                Bundle bundle = new Bundle();
                                z1 z1Var = r25.f138346i;
                                lh4.m.d(z1Var);
                                String username = z1Var.getUsername();
                                lh4.m.f(username, "contact!!.username");
                                cb2.d.d(bundle, "contact", username);
                                t15.setArguments(bundle);
                                t15.Q(r25.e());
                                f0Var.f253292d = t15;
                                ((ArrayList) r25.f138358w).add(0, t15);
                            }
                            Integer valueOf = hiVar2 != null ? Integer.valueOf(hiVar2.f23814t) : null;
                            if ((hiVar2 == null || (lhVar = hiVar2.f23805h) == null || (linkedList = lhVar.f28492d) == null) ? false : !linkedList.isEmpty()) {
                                if (valueOf != null) {
                                    if (valueOf.intValue() == 0) {
                                        r112 = true;
                                        if (valueOf == null) {
                                            if (valueOf.intValue() == 1) {
                                                z15 = true;
                                                Log.i("MicroMsg.ContactWidgetTabBizInfo", "update, VideoTabType is " + valueOf);
                                                if (z15 || r102 != 0) {
                                                    if (r112 != true && r102 == 0) {
                                                        r102 = new BizProfileTabVideoFragment();
                                                        hi hiVar5 = r25.f138349o;
                                                        if (hiVar5 == null) {
                                                            hiVar5 = new hi();
                                                        }
                                                        r102.O(hiVar5);
                                                        Bundle bundle2 = new Bundle();
                                                        z1 z1Var2 = r25.f138346i;
                                                        lh4.m.d(z1Var2);
                                                        String username2 = z1Var2.getUsername();
                                                        lh4.m.f(username2, "contact!!.username");
                                                        cb2.d.d(bundle2, "contact", username2);
                                                        r102.setArguments(bundle2);
                                                        r102.P(r25.e());
                                                        BizProfileTabLayout bizProfileTabLayout3 = r25.f138361z;
                                                        if (bizProfileTabLayout3 != null) {
                                                            String string = r25.f138341d.getString(R.string.f367769ak3);
                                                            lh4.m.f(string, "context.getString(R.stri…z_profile_tab_name_video)");
                                                            bizProfileTabLayout3.setVideoTabText(string);
                                                            ((ArrayList) r25.f138358w).add(r102);
                                                            Log.i("MicroMsg.ContactWidgetTabBizInfo", "update mp fragment");
                                                        } else {
                                                            lh4.m.p("menuTabLayout");
                                                            throw null;
                                                        }
                                                    } else if (r112 == false && !z15 && r102 != 0) {
                                                        ((ArrayList) r25.f138358w).remove(r102);
                                                        Log.i("MicroMsg.ContactWidgetTabBizInfo", "remove fragment");
                                                    }
                                                } else if (r25.N == null) {
                                                    BizProfileTabLayout bizProfileTabLayout4 = r25.f138361z;
                                                    if (bizProfileTabLayout4 != null) {
                                                        String string2 = r25.f138341d.getString(R.string.f8e);
                                                        lh4.m.f(string2, "context.getString(com.te…dk.R.string.finder_title)");
                                                        bizProfileTabLayout4.setVideoTabText(string2);
                                                        z1 z1Var3 = r25.f138346i;
                                                        lh4.m.d(z1Var3);
                                                        r102 = ((k5) yz3.j.c(k5.class)).zM0(z1Var3.getUsername(), ((Number) ((wg4.n) r25.M).getValue()).longValue()).c();
                                                        r25.N = r102;
                                                        List<Fragment> list3 = r25.f138358w;
                                                        lh4.m.d(r102);
                                                        ((ArrayList) list3).add(r102);
                                                        Log.i("MicroMsg.ContactWidgetTabBizInfo", "add finder fragment");
                                                    } else {
                                                        lh4.m.p("menuTabLayout");
                                                        throw null;
                                                    }
                                                }
                                                if ((hiVar2 == null && hiVar2.C == 1) == true || baseAudioFragment != null) {
                                                    if ((hiVar2 == null && hiVar2.C == 0) == true && baseAudioFragment != null) {
                                                        ((ArrayList) r25.f138358w).remove(baseAudioFragment);
                                                    }
                                                } else {
                                                    r25.d(hiVar2);
                                                }
                                                if (size != ((ArrayList) r25.f138358w).size()) {
                                                    a aVar2 = r25.f138360y;
                                                    if (aVar2 != null) {
                                                        aVar2.notifyDataSetChanged();
                                                    } else {
                                                        lh4.m.p("pagerAdapter");
                                                        throw null;
                                                    }
                                                }
                                                r25.j(r102, z15);
                                            }
                                        }
                                        z15 = false;
                                        Log.i("MicroMsg.ContactWidgetTabBizInfo", "update, VideoTabType is " + valueOf);
                                        if (z15) {
                                        }
                                        if (r112 != true) {
                                        }
                                        ((ArrayList) r25.f138358w).remove(r102);
                                        Log.i("MicroMsg.ContactWidgetTabBizInfo", "remove fragment");
                                        if ((hiVar2 == null && hiVar2.C == 1) == true) {
                                        }
                                        ((ArrayList) r25.f138358w).remove(baseAudioFragment);
                                        if (size != ((ArrayList) r25.f138358w).size()) {
                                        }
                                        r25.j(r102, z15);
                                    }
                                }
                            }
                            r112 = false;
                            if (valueOf == null) {
                            }
                            z15 = false;
                            Log.i("MicroMsg.ContactWidgetTabBizInfo", "update, VideoTabType is " + valueOf);
                            if (z15) {
                            }
                            if (r112 != true) {
                            }
                            ((ArrayList) r25.f138358w).remove(r102);
                            Log.i("MicroMsg.ContactWidgetTabBizInfo", "remove fragment");
                            if ((hiVar2 == null && hiVar2.C == 1) == true) {
                            }
                            ((ArrayList) r25.f138358w).remove(baseAudioFragment);
                            if (size != ((ArrayList) r25.f138358w).size()) {
                            }
                            r25.j(r102, z15);
                        }
                        r25.k(true);
                    }
                    contactWidgetTabBizInfo = this.f138370d;
                    if (contactWidgetTabBizInfo.f138346i != null || contactWidgetTabBizInfo.f138347j == null || (hiVar = contactWidgetTabBizInfo.f138349o) == null || hiVar.f23802e == null || hiVar.f23801d == null) {
                        Log.w("MicroMsg.ContactWidgetTabBizInfo", "reportUpdate fail, err");
                    }
                    boolean g15 = contactWidgetTabBizInfo.g();
                    z1 z1Var4 = contactWidgetTabBizInfo.f138346i;
                    lh4.m.d(z1Var4);
                    String username3 = z1Var4.getUsername();
                    int i16 = contactWidgetTabBizInfo.f138348n;
                    ih.c cVar2 = contactWidgetTabBizInfo.f138347j;
                    lh4.m.d(cVar2);
                    int i17 = cVar2.field_type;
                    long j16 = contactWidgetTabBizInfo.f138344g;
                    z1 z1Var5 = contactWidgetTabBizInfo.f138346i;
                    lh4.m.d(z1Var5);
                    boolean z35 = z1Var5.z3();
                    hi hiVar6 = contactWidgetTabBizInfo.f138349o;
                    lh4.m.d(hiVar6);
                    wf wfVar = hiVar6.f23802e;
                    int i18 = wfVar != null ? wfVar.f40986d : 0;
                    hi hiVar7 = contactWidgetTabBizInfo.f138349o;
                    lh4.m.d(hiVar7);
                    wf wfVar2 = hiVar7.f23802e;
                    int i19 = wfVar2 != null ? wfVar2.f40987e : 0;
                    hi hiVar8 = contactWidgetTabBizInfo.f138349o;
                    lh4.m.d(hiVar8);
                    String b17 = as2.c.b(hiVar8.f23803f);
                    hi hiVar9 = contactWidgetTabBizInfo.f138349o;
                    lh4.m.d(hiVar9);
                    String a15 = as2.c.a(hiVar9.f23806i);
                    hi hiVar10 = contactWidgetTabBizInfo.f138349o;
                    lh4.m.d(hiVar10);
                    ue ueVar = hiVar10.f23801d;
                    if (ueVar != null) {
                        str3 = ueVar.f38586d;
                    }
                    as2.c.c(username3, i16, i17 == 0 ? 1 : i17 == 1 ? 2 : 0, 3, j16, 0, z35 ? 1 : 0, i18, i19, 0, b17, a15, str3, "", (String) ((wg4.n) contactWidgetTabBizInfo.F).getValue(), contactWidgetTabBizInfo.f(), contactWidgetTabBizInfo.f138341d.getIntent(), g15 ? 1 : 0);
                    hi hiVar11 = contactWidgetTabBizInfo.f138349o;
                    if (!(hiVar11 == null || hiVar11.f23806i == null)) {
                        z1 z1Var6 = contactWidgetTabBizInfo.f138346i;
                        lh4.m.d(z1Var6);
                        as2.f.a(z1Var6.getUsername(), 104, contactWidgetTabBizInfo.f138348n, contactWidgetTabBizInfo.f138344g, contactWidgetTabBizInfo.f138341d.getIntent());
                    }
                    if (contactWidgetTabBizInfo.f138349o != null) {
                        z1 z1Var7 = contactWidgetTabBizInfo.f138346i;
                        lh4.m.d(z1Var7);
                        as2.f.a(z1Var7.getUsername(), 101, contactWidgetTabBizInfo.f138348n, contactWidgetTabBizInfo.f138344g, contactWidgetTabBizInfo.f138341d.getIntent());
                        return;
                    }
                    return;
                }
            }
            r75 = false;
            if (r75 == false) {
            }
            contactWidgetTabBizInfo = this.f138370d;
            if (contactWidgetTabBizInfo.f138346i != null) {
            }
            Log.w("MicroMsg.ContactWidgetTabBizInfo", "reportUpdate fail, err");
        }
    }

    public static final class h extends lh4.o implements kh4.a<BizProfileDataFetcher> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138371d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public h(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            super(0);
            this.f138371d = contactWidgetTabBizInfo;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public BizProfileDataFetcher invoke() {
            String str;
            ContactWidgetTabBizInfo contactWidgetTabBizInfo = this.f138371d;
            int i15 = contactWidgetTabBizInfo.f138348n;
            z1 z1Var = contactWidgetTabBizInfo.f138346i;
            if (z1Var != null) {
                str = z1Var.getUsername();
            } else {
                str = null;
            }
            if (str == null) {
                str = "";
            }
            ContactWidgetTabBizInfo contactWidgetTabBizInfo2 = this.f138371d;
            BizProfileDataFetcher bizProfileDataFetcher = new BizProfileDataFetcher(i15, str, contactWidgetTabBizInfo2.f138341d, contactWidgetTabBizInfo2.f());
            bizProfileDataFetcher.f138404r = this.f138371d.g() ? 1 : 0;
            return bizProfileDataFetcher;
        }
    }

    public static final class i extends lh4.o implements kh4.a<String> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138372d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public i(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            super(0);
            this.f138372d = contactWidgetTabBizInfo;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public String invoke() {
            Bundle bundleExtra = this.f138372d.f138341d.getIntent().getBundleExtra("Contact_Ext_Args");
            if (bundleExtra != null) {
                return bundleExtra.getString("Contact_Ext_Args_Search_Click_Id", "");
            }
            return null;
        }
    }

    public static final class j extends lh4.o implements kh4.a<String> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138373d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public j(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            super(0);
            this.f138373d = contactWidgetTabBizInfo;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public String invoke() {
            Bundle bundleExtra = this.f138373d.f138341d.getIntent().getBundleExtra("Contact_Ext_Args");
            if (bundleExtra != null) {
                return bundleExtra.getString("Contact_Ext_Args_Search_Id", "");
            }
            return null;
        }
    }

    public static final class k implements MenuItem.OnMenuItemClickListener {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138374d;

        public k(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            this.f138374d = contactWidgetTabBizInfo;
        }

        public final boolean onMenuItemClick(MenuItem menuItem) {
            ContactWidgetTabBizInfo.c(this.f138374d);
            return true;
        }
    }

    public static final class l implements MenuItem.OnMenuItemClickListener {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138375d;

        public l(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            this.f138375d = contactWidgetTabBizInfo;
        }

        public final boolean onMenuItemClick(MenuItem menuItem) {
            ContactWidgetTabBizInfo.b(this.f138375d);
            return false;
        }
    }

    public static final class m implements MenuItem.OnMenuItemClickListener {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138376d;

        public m(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            this.f138376d = contactWidgetTabBizInfo;
        }

        public final boolean onMenuItemClick(MenuItem menuItem) {
            ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController = this.f138376d.f138357v;
            if (contactWidgetTabBizHeaderController == null) {
                return true;
            }
            contactWidgetTabBizHeaderController.e();
            return true;
        }
    }

    public static final class n implements Runnable {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138377d;

        public n(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            this.f138377d = contactWidgetTabBizInfo;
        }

        public final void run() {
            ViewGroup.LayoutParams layoutParams;
            ContactWidgetTabBizInfo contactWidgetTabBizInfo = this.f138377d;
            if (contactWidgetTabBizInfo.Y == null) {
                contactWidgetTabBizInfo.Y = (ViewGroup) contactWidgetTabBizInfo.f138341d.findViewById(R.id.coz);
            }
            ViewGroup viewGroup = this.f138377d.Y;
            if (viewGroup != null) {
                RelativeLayout.LayoutParams layoutParams2 = null;
                if (viewGroup != null) {
                    layoutParams = viewGroup.getLayoutParams();
                } else {
                    layoutParams = null;
                }
                if (layoutParams instanceof RelativeLayout.LayoutParams) {
                    layoutParams2 = (RelativeLayout.LayoutParams) layoutParams;
                }
                if (layoutParams2 != null) {
                    ContactWidgetTabBizInfo contactWidgetTabBizInfo2 = this.f138377d;
                    layoutParams2.addRule(15, -1);
                    ViewGroup viewGroup2 = contactWidgetTabBizInfo2.Y;
                    if (viewGroup2 != null) {
                        viewGroup2.setLayoutParams(layoutParams2);
                    }
                }
            }
        }
    }

    public static final class o implements f91.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ ContactWidgetTabBizInfo f138378a;

        public o(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
            this.f138378a = contactWidgetTabBizInfo;
        }

        @Override // f91.a
        public /* synthetic */ boolean a(Object obj, String str, int i15) {
            return false;
        }

        @Override // f91.a
        public final Map<String, Object> b(String str) {
            z1 z1Var = this.f138378a.f138346i;
            lh4.m.d(z1Var);
            return q0.b(new wg4.l("bizusername", z1Var.getUsername()));
        }
    }

    public ContactWidgetTabBizInfo(ContactInfoUI contactInfoUI, String str, d40 d402, long j15) {
        lh4.m.g(contactInfoUI, "context");
        this.f138341d = contactInfoUI;
        this.f138342e = str;
        this.f138343f = d402;
        this.f138344g = j15;
        this.f138345h.add(new BizProfileExtraOperateObserver());
        this.f138345h.add(new BizProfileWidgetOperateObserver(contactInfoUI));
        this.M = wg4.h.a(new e(this));
        this.Q = 2;
        this.R = 3;
        this.S = 4;
        this.T = 5;
        this.U = 6;
        this.V = 7;
        this.W = 8;
        this.Z = 1;
        this.f138351p0 = "https://mp.weixin.qq.com/mp/infringement?username=%s&from=1#wechat_redirect";
    }

    public static final void b(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
        String str;
        p64.n nVar = new p64.n((Context) contactWidgetTabBizInfo.f138341d, 1, false);
        nVar.f281245i = new c0(contactWidgetTabBizInfo);
        nVar.f281259q = new d0(contactWidgetTabBizInfo);
        nVar.q();
        z1 z1Var = contactWidgetTabBizInfo.f138346i;
        if (z1Var != null) {
            str = z1Var.getUsername();
        } else {
            str = null;
        }
        as2.f.a(str, 600, contactWidgetTabBizInfo.f138348n, contactWidgetTabBizInfo.f138344g, contactWidgetTabBizInfo.f138341d.getIntent());
    }

    public static final void c(ContactWidgetTabBizInfo contactWidgetTabBizInfo) {
        String str;
        ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController = contactWidgetTabBizInfo.f138357v;
        if (contactWidgetTabBizHeaderController != null) {
            if (!contactWidgetTabBizHeaderController.f138308e || !(!Util.isNullOrNil(contactWidgetTabBizHeaderController.f138309f))) {
                contactWidgetTabBizHeaderController = null;
            }
            if (contactWidgetTabBizHeaderController != null) {
                q qVar = new q(contactWidgetTabBizInfo.f138341d);
                qVar.g(contactWidgetTabBizHeaderController.f138309f);
                qVar.n(contactWidgetTabBizInfo.f138341d.getString(R.string.ak7));
                qVar.l(e0.f138417a);
                qVar.o();
                return;
            }
        }
        z1 z1Var = contactWidgetTabBizInfo.f138346i;
        String username = z1Var != null ? z1Var.getUsername() : null;
        Intent Cd0 = ((z00.o) yz3.j.c(z00.o.class)).Cd0();
        Cd0.putExtra("ftsneedkeyboard", true);
        Cd0.putExtra("ftsbizscene", 136);
        Map<String, String> tq4 = ((z00.o) yz3.j.c(z00.o.class)).tq(136, true, 0);
        lh4.m.f(tq4, "params");
        tq4.put("userName", username);
        hi hiVar = contactWidgetTabBizInfo.f138349o;
        if (!Util.isNullOrNil(hiVar != null ? hiVar.f23811q : null)) {
            hi hiVar2 = contactWidgetTabBizInfo.f138349o;
            tq4.put("thirdExtParam", hiVar2 != null ? hiVar2.f23811q : null);
        }
        Cd0.putExtra("rawUrl", z0.e(tq4, 0));
        Cd0.putExtra("key_load_js_without_delay", true);
        Cd0.putExtra("ftsbizusername", username);
        Cd0.putExtra(w.j.f187148n, 13307);
        String str2 = w.j.f187149o;
        int i15 = contactWidgetTabBizInfo.f138348n;
        zr2.b Ga = com.tencent.mm.plugin.profile.h.WN0().Ga(username);
        if (Ga != null) {
            str = Ga.field_decryptUserName;
        } else {
            str = "";
        }
        Cd0.putStringArrayListExtra(str2, new as2.e(username, 1302, str, String.valueOf(u0.f175105c), i15));
        Cd0.addFlags(67108864);
        sv3.b.y(contactWidgetTabBizInfo.f138341d, Cd0, null);
        as2.f.d(username, 1301, contactWidgetTabBizInfo.f138344g, contactWidgetTabBizInfo.f138341d.getIntent(), contactWidgetTabBizInfo.g() ? 1 : 0);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:95:0x02a3, code lost:
        if (r5.f23814t != 1) goto L_0x03ed;
     */
    /* JADX WARNING: Removed duplicated region for block: B:139:0x0404  */
    /* JADX WARNING: Removed duplicated region for block: B:172:0x04ec  */
    @Override // gu3.a
    public boolean I(k14.g gVar, z1 z1Var, boolean z15, int i15) {
        boolean z16;
        ViewPager viewPager;
        View j15;
        View findViewById;
        LinkedList<kh> linkedList;
        LinkedList<kh> linkedList2;
        String username;
        if (this.f138341d.isFinishing()) {
            return true;
        }
        boolean z17 = false;
        Assert.assertTrue(z1Var != null);
        String nullAsNil = Util.nullAsNil(z1Var != null ? z1Var.getUsername() : null);
        lh4.m.f(nullAsNil, "nullAsNil(contact?.username)");
        Assert.assertTrue(nullAsNil.length() > 0);
        Assert.assertTrue(gVar != null);
        synchronized (this) {
            if (z1Var != null) {
                if (!this.f138355t) {
                    this.f138355t = true;
                    MultiProcessMMKV singleMMKV = MultiProcessMMKV.getSingleMMKV("ProfileCrashCheck");
                    if (singleMMKV.decodeBool(this.f138356u, false)) {
                        Log.i("MicroMsg.ContactWidgetTabBizInfo", "checkCrash clear data with crash flag");
                        com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(1378, 0, 1, false);
                        String username2 = z1Var.getUsername();
                        lh4.m.f(username2, "contact.username");
                        xr2.m.a(username2);
                    }
                    singleMMKV.encode(this.f138356u, true);
                    Log.i("MicroMsg.ContactWidgetTabBizInfo", "checkCrash add crash flag");
                    if ((BuildInfo.DEBUG || BuildInfo.IS_FLAVOR_RED || WeChatEnvironment.hasDebugger()) && singleMMKV.decodeInt("testCrash", 0) == 1) {
                        Assert.assertTrue("checkCrash testCrash", false);
                    }
                    ((xc4.j) xc4.j.f338034d).i(new b0(singleMMKV, this), 1000);
                }
            }
        }
        Iterator it = ((ArrayList) this.f138345h).iterator();
        while (it.hasNext()) {
            ((gs2.a) it.next()).I(gVar, z1Var, z15, i15);
        }
        this.f138346i = z1Var;
        this.f138348n = i15;
        this.f138341d.getIntent().getIntExtra("add_more_friend_search_scene", 0);
        String stringExtra = this.f138341d.getIntent().getStringExtra("key_channel_session_id");
        if (stringExtra == null) {
            stringExtra = "";
        }
        this.B = stringExtra;
        boolean VT = ((s0) z.q(s0.class)).VT();
        this.f138353r = !VT;
        Log.i("MicroMsg.ContactWidgetTabBizInfo", "updateBizTeenModeStatus addContactScene: %d, blockAddContact: %b, isBizTeenModeAllowAll: %b", Integer.valueOf(this.f138348n), Boolean.valueOf(this.f138353r), Boolean.valueOf(VT));
        ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController = this.f138357v;
        if (contactWidgetTabBizHeaderController != null) {
            contactWidgetTabBizHeaderController.f138324x = this.f138353r;
        }
        if (this.f138354s) {
            this.f138354s = false;
            View findViewById2 = this.f138341d.findViewById(R.id.jlv);
            if (findViewById2 != null) {
                k30.a aVar = new k30.a();
                ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                aVar.c(8);
                j30.a.d(findViewById2, aVar.b(), "com/tencent/mm/plugin/profile/ui/tab/ContactWidgetTabBizInfo", "hideOriginContentView", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                findViewById2.setVisibility(((Integer) aVar.a(0)).intValue());
                j30.a.e(findViewById2, "com/tencent/mm/plugin/profile/ui/tab/ContactWidgetTabBizInfo", "hideOriginContentView", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            }
            ListView listView = this.f138341d.getListView();
            if (listView != null) {
                listView.setVisibility(8);
            }
            View findViewById3 = this.f138341d.findViewById(R.id.l2v);
            if (findViewById3 != null) {
                k30.a aVar2 = new k30.a();
                ThreadLocal<k30.a> threadLocal2 = k30.c.f244265a;
                aVar2.c(8);
                j30.a.d(findViewById3, aVar2.b(), "com/tencent/mm/plugin/profile/ui/tab/ContactWidgetTabBizInfo", "hideOriginContentView", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                findViewById3.setVisibility(((Integer) aVar2.a(0)).intValue());
                j30.a.e(findViewById3, "com/tencent/mm/plugin/profile/ui/tab/ContactWidgetTabBizInfo", "hideOriginContentView", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            }
            if (MultiProcessMMKV.getMMKV("test_biz_profile").getBoolean("noCache", false)) {
                this.f138349o = new hi();
            } else {
                z1 z1Var2 = this.f138346i;
                if (!(z1Var2 == null || (username = z1Var2.getUsername()) == null)) {
                    this.f138349o = xr2.m.b(username);
                }
            }
            View inflate = LayoutInflater.from(this.f138341d).inflate(R.layout.a1_, (ViewGroup) null);
            lh4.m.f(inflate, "inflater.inflate(R.layou…ntact_info_biz_tab, null)");
            this.K = inflate;
            this.f138341d.setContentView(inflate);
            View view = this.K;
            if (view != null) {
                View findViewById4 = view.findViewById(R.id.c67);
                lh4.m.f(findViewById4, "contentView.findViewById…(R.id.combo_content_view)");
                this.f138359x = (ViewPager) findViewById4;
                View view2 = this.K;
                if (view2 != null) {
                    View findViewById5 = view2.findViewById(R.id.anj);
                    lh4.m.f(findViewById5, "contentView.findViewById…_profile_menu_tab_layout)");
                    BizProfileTabLayout bizProfileTabLayout = (BizProfileTabLayout) findViewById5;
                    this.f138361z = bizProfileTabLayout;
                    bizProfileTabLayout.setOnTabSelected(new j0(this));
                    BizProfileTabLayout bizProfileTabLayout2 = this.f138361z;
                    if (bizProfileTabLayout2 != null) {
                        bizProfileTabLayout2.setOnServiceTabSelected(new k0(this));
                        ContactInfoUI contactInfoUI = this.f138341d;
                        View view3 = this.K;
                        if (view3 != null) {
                            ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController2 = new ContactWidgetTabBizHeaderController(contactInfoUI, view3, this.J);
                            contactWidgetTabBizHeaderController2.H = new l0(this);
                            this.f138357v = contactWidgetTabBizHeaderController2;
                            contactWidgetTabBizHeaderController2.f138324x = this.f138353r;
                            f0 f0Var = new f0();
                            hi hiVar = this.f138349o;
                            if (hiVar != null) {
                                if (((Number) ((wg4.n) this.H).getValue()).intValue() == 1) {
                                    lh lhVar = hiVar.f23805h;
                                    if ((lhVar == null || (linkedList2 = lhVar.f28492d) == null || !linkedList2.isEmpty()) ? false : true) {
                                    }
                                }
                                List<Fragment> list = this.f138358w;
                                BizProfileTabMsgFragment bizProfileTabMsgFragment = new BizProfileTabMsgFragment();
                                bizProfileTabMsgFragment.f138488o = g();
                                hi hiVar2 = this.f138349o;
                                if (hiVar2 == null) {
                                    hiVar2 = new hi();
                                }
                                bizProfileTabMsgFragment.P(hiVar2);
                                Bundle bundle = new Bundle();
                                z1 z1Var3 = this.f138346i;
                                lh4.m.d(z1Var3);
                                String username3 = z1Var3.getUsername();
                                lh4.m.f(username3, "contact!!.username");
                                cb2.d.d(bundle, "contact", username3);
                                bizProfileTabMsgFragment.setArguments(bundle);
                                bizProfileTabMsgFragment.Q(e());
                                bizProfileTabMsgFragment.f138487n = this.f138344g;
                                bizProfileTabMsgFragment.f138456f = this.f138357v;
                                ((ArrayList) list).add(bizProfileTabMsgFragment);
                                lh lhVar2 = hiVar.f23805h;
                                boolean z18 = ((lhVar2 == null || (linkedList = lhVar2.f28492d) == null) ? false : linkedList.isEmpty() ^ true) && hiVar.f23814t == 0;
                                z16 = hiVar.f23814t == 1;
                                Log.i("MicroMsg.ContactWidgetTabBizInfo", "init, VideoTabType is " + hiVar.f23814t);
                                if (z16) {
                                    if (this.N == null) {
                                        z1 z1Var4 = this.f138346i;
                                        lh4.m.d(z1Var4);
                                        this.N = ((k5) yz3.j.c(k5.class)).zM0(z1Var4.getUsername(), ((Number) ((wg4.n) this.M).getValue()).longValue()).c();
                                    }
                                    f0Var.f253292d = (T) this.N;
                                    BizProfileTabLayout bizProfileTabLayout3 = this.f138361z;
                                    if (bizProfileTabLayout3 != null) {
                                        String string = this.f138341d.getString(R.string.f8e);
                                        lh4.m.f(string, "context.getString(com.te…dk.R.string.finder_title)");
                                        bizProfileTabLayout3.setVideoTabText(string);
                                        List<Fragment> list2 = this.f138358w;
                                        T t15 = f0Var.f253292d;
                                        lh4.m.d(t15);
                                        ((ArrayList) list2).add(t15);
                                    } else {
                                        lh4.m.p("menuTabLayout");
                                        throw null;
                                    }
                                } else if (z18) {
                                    T t16 = (T) new BizProfileTabVideoFragment();
                                    hi hiVar3 = this.f138349o;
                                    if (hiVar3 == null) {
                                        hiVar3 = new hi();
                                    }
                                    t16.O(hiVar3);
                                    Bundle bundle2 = new Bundle();
                                    z1 z1Var5 = this.f138346i;
                                    lh4.m.d(z1Var5);
                                    String username4 = z1Var5.getUsername();
                                    lh4.m.f(username4, "contact!!.username");
                                    cb2.d.d(bundle2, "contact", username4);
                                    t16.setArguments(bundle2);
                                    t16.P(e());
                                    this.f138344g = this.f138344g;
                                    t16.f138456f = this.f138357v;
                                    f0Var.f253292d = t16;
                                    BizProfileTabLayout bizProfileTabLayout4 = this.f138361z;
                                    if (bizProfileTabLayout4 != null) {
                                        String string2 = this.f138341d.getString(R.string.f367769ak3);
                                        lh4.m.f(string2, "context.getString(R.stri…z_profile_tab_name_video)");
                                        bizProfileTabLayout4.setVideoTabText(string2);
                                        List<Fragment> list3 = this.f138358w;
                                        T t17 = f0Var.f253292d;
                                        lh4.m.d(t17);
                                        ((ArrayList) list3).add(t17);
                                    } else {
                                        lh4.m.p("menuTabLayout");
                                        throw null;
                                    }
                                }
                                if (hiVar.C == 1) {
                                    d(this.f138349o);
                                }
                                a aVar3 = new a(this.f138358w, this.f138341d.getSupportFragmentManager());
                                this.f138360y = aVar3;
                                viewPager = this.f138359x;
                                if (viewPager == null) {
                                    viewPager.setAdapter(aVar3);
                                    a aVar4 = this.f138360y;
                                    if (aVar4 != null) {
                                        aVar4.notifyDataSetChanged();
                                        ViewPager viewPager2 = this.f138359x;
                                        if (viewPager2 != null) {
                                            viewPager2.addOnPageChangeListener(new m0(this, f0Var));
                                            j(f0Var.f253292d, z16);
                                            k(false);
                                            ContactInfoUI contactInfoUI2 = this.f138341d;
                                            contactInfoUI2.getClass();
                                            if (contactInfoUI2 instanceof DialogContactInfoUI) {
                                                ActionBar supportActionBar = this.f138341d.getSupportActionBar();
                                                if (supportActionBar != null) {
                                                    supportActionBar.o();
                                                }
                                            } else {
                                                e3.e eVar = new e3.e(this.f138341d, new i0(this));
                                                ActionBar supportActionBar2 = this.f138341d.getSupportActionBar();
                                                if (!(supportActionBar2 == null || (j15 = supportActionBar2.j()) == null || (findViewById = j15.findViewById(R.id.f361678gp)) == null)) {
                                                    findViewById.setOnTouchListener(new g0(eVar));
                                                }
                                                ContactInfoUI contactInfoUI3 = this.f138341d;
                                                Object obj = t2.a.f309129a;
                                                contactInfoUI3.setMMTitleColor(a.d.a(contactInfoUI3, R.color.FG_0));
                                                this.f138341d.setMMTitleVisibility(0);
                                                this.f138341d.setTitleDividerVis(false);
                                                this.f138341d.setIsDarkActionbarBg(false);
                                                ContactInfoUI contactInfoUI4 = this.f138341d;
                                                contactInfoUI4.setActionbarColor(contactInfoUI4.getResources().getColor(R.color.f357929c));
                                                this.f138341d.hideActionbarLine();
                                                this.f138341d.setBackBtn(new h0(this), R.raw.actionbar_icon_dark_back);
                                                i(true, true);
                                            }
                                            h();
                                            if (z1Var != null) {
                                                w0.WN0().c(z1Var.getUsername(), null);
                                            }
                                            e().c().observe(this.f138341d, new g(this));
                                            if (z1Var != null) {
                                                if (z1Var.z3() && z1Var.q3() > 0) {
                                                    z17 = true;
                                                }
                                                this.A = z17;
                                            }
                                            e().b();
                                        } else {
                                            lh4.m.p("viewPager");
                                            throw null;
                                        }
                                    } else {
                                        lh4.m.p("pagerAdapter");
                                        throw null;
                                    }
                                } else {
                                    lh4.m.p("viewPager");
                                    throw null;
                                }
                            }
                            z16 = false;
                            a aVar32 = new a(this.f138358w, this.f138341d.getSupportFragmentManager());
                            this.f138360y = aVar32;
                            viewPager = this.f138359x;
                            if (viewPager == null) {
                            }
                        } else {
                            lh4.m.p("contentView");
                            throw null;
                        }
                    } else {
                        lh4.m.p("menuTabLayout");
                        throw null;
                    }
                } else {
                    lh4.m.p("contentView");
                    throw null;
                }
            } else {
                lh4.m.p("contentView");
                throw null;
            }
        } else if (z1Var != null) {
            if (z1Var.z3() && z1Var.q3() > 0) {
                z17 = true;
            }
            if (this.A != z17) {
                e().b();
                i(true, true);
            }
            this.A = z17;
        }
        ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController3 = this.f138357v;
        if (contactWidgetTabBizHeaderController3 == null) {
            return true;
        }
        contactWidgetTabBizHeaderController3.h(z1Var, this.f138342e, this.f138347j, this.f138349o, i15, z15);
        return true;
    }

    @Override // gu3.a
    public boolean a(String str) {
        return true;
    }

    public final void d(hi hiVar) {
        xv3.b bVar;
        rj rjVar;
        if (hiVar == null || (rjVar = hiVar.f23813s) == null) {
            bVar = null;
        } else {
            bVar = rjVar.f35401d;
        }
        String b15 = j0.b(bVar);
        AudioFragmentStub audioFragmentStub = new AudioFragmentStub();
        ((ArrayList) this.f138358w).add(audioFragmentStub);
        e().f138400n.observe(this.f138341d, new b(this, audioFragmentStub, b15));
        BizProfileDataFetcher e15 = e();
        lh4.m.f(b15, "finderUsername");
        e15.getClass();
        ((a2) yz3.j.c(a2.class)).hn0(b15, null, new cs2.h(e15, true));
    }

    public final BizProfileDataFetcher e() {
        return (BizProfileDataFetcher) ((wg4.n) this.G).getValue();
    }

    public final String f() {
        return (String) ((wg4.n) this.E).getValue();
    }

    public final boolean g() {
        return this.f138341d.isFragmentMode() || (this.f138341d instanceof DialogContactInfoUI);
    }

    public final void h() {
        String str;
        String str2;
        c.b bVar;
        String str3;
        int i15;
        String str4;
        String str5;
        String str6;
        String str7;
        int i16;
        String str8;
        String str9;
        String str10;
        z1 z1Var = this.f138346i;
        if (z1Var != null) {
            String str11 = null;
            if (z1Var != null) {
                str = z1Var.getUsername();
            } else {
                str = null;
            }
            ih.c b15 = bg0.l.b(str);
            this.f138352q = null;
            boolean z15 = false;
            if ((b15 == null || b15.w2(false) == null) && this.f138343f != null) {
                b15 = new ih.c();
                z1 z1Var2 = this.f138346i;
                if (z1Var2 != null) {
                    str7 = z1Var2.getUsername();
                } else {
                    str7 = null;
                }
                b15.field_username = str7;
                d40 d402 = this.f138343f;
                if (d402 != null) {
                    i16 = d402.f18974d;
                } else {
                    i16 = 0;
                }
                b15.field_brandFlag = i16;
                if (d402 != null) {
                    str8 = d402.f18977g;
                } else {
                    str8 = null;
                }
                b15.field_brandIconURL = str8;
                if (d402 != null) {
                    str9 = d402.f18976f;
                } else {
                    str9 = null;
                }
                b15.field_brandInfo = str9;
                if (d402 != null) {
                    str10 = d402.f18975e;
                } else {
                    str10 = null;
                }
                b15.field_extInfo = str10;
                b15.field_type = b15.w2(false).j();
            }
            if (b15 != null) {
                if (b15.field_brandInfo == null && b15.field_extInfo == null && this.f138343f != null) {
                    z1 z1Var3 = this.f138346i;
                    if (z1Var3 != null) {
                        str3 = z1Var3.getUsername();
                    } else {
                        str3 = null;
                    }
                    b15.field_username = str3;
                    d40 d403 = this.f138343f;
                    if (d403 != null) {
                        i15 = d403.f18974d;
                    } else {
                        i15 = 0;
                    }
                    b15.field_brandFlag = i15;
                    if (d403 != null) {
                        str4 = d403.f18977g;
                    } else {
                        str4 = null;
                    }
                    b15.field_brandIconURL = str4;
                    if (d403 != null) {
                        str5 = d403.f18976f;
                    } else {
                        str5 = null;
                    }
                    b15.field_brandInfo = str5;
                    if (d403 != null) {
                        str6 = d403.f18975e;
                    } else {
                        str6 = null;
                    }
                    b15.field_extInfo = str6;
                    b15.field_type = b15.w2(false).j();
                }
                this.f138347j = b15;
                this.f138350p = b15.s2();
                c.b w25 = b15.w2(false);
                this.f138352q = w25;
                if (w25 != null) {
                    str2 = w25.o();
                } else {
                    str2 = null;
                }
                if (str2 != null) {
                    c.b bVar2 = this.f138352q;
                    if (bVar2 != null) {
                        str11 = bVar2.o();
                    }
                    if (str11 == null || str11.length() == 0) {
                        z15 = true;
                    }
                    if (z15 && (bVar = this.f138352q) != null) {
                        bVar.o();
                    }
                }
            }
        }
    }

    public final void i(boolean z15, boolean z16) {
        if (z16 || z15 != this.X) {
            ContactInfoUI contactInfoUI = this.f138341d;
            contactInfoUI.getClass();
            if (contactInfoUI instanceof DialogContactInfoUI) {
                Log.i("MicroMsg.ContactWidgetTabBizInfo", "isDialogStyle");
                return;
            }
            Log.i("MicroMsg.ContactWidgetTabBizInfo", "updateActionBarMenu  return");
            this.X = z15;
            this.f138341d.removeAllOptionMenu();
            if (this.A || z15) {
                if (!this.f138353r) {
                    this.f138341d.addIconOptionMenu(1, R.string.jzr, R.raw.actionbar_icon_dark_search, new k(this));
                }
                this.f138341d.addIconOptionMenu(0, R.string.b4l, R.raw.actionbar_icon_dark_more, new l(this));
                return;
            }
            ContactInfoUI contactInfoUI2 = this.f138341d;
            contactInfoUI2.addTextOptionMenu(2, contactInfoUI2.getString(R.string.bbp), new m(this), null, MMActivityController.r.f176535f);
            if (g()) {
                View view = this.K;
                if (view != null) {
                    view.post(new n(this));
                } else {
                    lh4.m.p("contentView");
                    throw null;
                }
            }
        }
    }

    public final void j(Fragment fragment, boolean z15) {
        int i15;
        if (fragment != null && ((Number) ((wg4.n) this.H).getValue()).intValue() == 1) {
            if (z15 || !((Boolean) ((wg4.n) this.I).getValue()).booleanValue()) {
                i15 = ((ArrayList) this.f138358w).indexOf(fragment);
            } else {
                i15 = 0;
            }
            if (i15 >= 0) {
                ViewPager viewPager = this.f138359x;
                if (viewPager != null) {
                    viewPager.setCurrentItem(i15, false);
                } else {
                    lh4.m.p("viewPager");
                    throw null;
                }
            }
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:126:0x016a  */
    /* JADX WARNING: Removed duplicated region for block: B:154:? A[RETURN, SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x007a  */
    /* JADX WARNING: Removed duplicated region for block: B:47:0x0089  */
    /* JADX WARNING: Removed duplicated region for block: B:52:0x0097  */
    public final void k(boolean z15) {
        boolean z16;
        BizProfileTabLayout bizProfileTabLayout;
        boolean z17;
        cj cjVar;
        dj djVar;
        LinkedList<ej> linkedList;
        BizProfileTabLayout bizProfileTabLayout2 = this.f138361z;
        if (bizProfileTabLayout2 != null) {
            bizProfileTabLayout2.r();
            Iterator it = ((ArrayList) this.f138358w).iterator();
            boolean z18 = false;
            boolean z19 = false;
            boolean z25 = false;
            boolean z26 = false;
            while (it.hasNext()) {
                Fragment fragment = (Fragment) it.next();
                if ((fragment instanceof p1) && ((p1) fragment).z()) {
                    z19 = true;
                } else if (fragment instanceof BizProfileTabMsgFragment) {
                    z25 = true;
                } else if (fragment instanceof BaseAudioFragment) {
                    z26 = true;
                }
            }
            hi hiVar = this.f138349o;
            if ((hiVar == null || (cjVar = hiVar.f23806i) == null || (djVar = cjVar.f18347d) == null || (linkedList = djVar.f19369g) == null || !(linkedList.isEmpty() ^ true)) ? false : true) {
                if (this.f138357v != null) {
                    if (((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.b.f231627p5, 0) == 1) {
                        z17 = true;
                        if (!z17) {
                            z16 = true;
                            if (z25 && (z19 || z26 || z16)) {
                                bizProfileTabLayout = this.f138361z;
                                if (bizProfileTabLayout == null) {
                                    ViewGroup viewGroup = bizProfileTabLayout.f138625y;
                                    if (viewGroup != null) {
                                        viewGroup.setVisibility(0);
                                    } else {
                                        lh4.m.p("mMsgLayout");
                                        throw null;
                                    }
                                } else {
                                    lh4.m.p("menuTabLayout");
                                    throw null;
                                }
                            }
                            if (z19 && (z25 || z26 || z16)) {
                                BizProfileTabLayout bizProfileTabLayout3 = this.f138361z;
                                if (bizProfileTabLayout3 != null) {
                                    ViewGroup viewGroup2 = bizProfileTabLayout3.f138626z;
                                    if (viewGroup2 != null) {
                                        viewGroup2.setVisibility(0);
                                    } else {
                                        lh4.m.p("mVideoLayout");
                                        throw null;
                                    }
                                } else {
                                    lh4.m.p("menuTabLayout");
                                    throw null;
                                }
                            }
                            if (z26 && (z25 || z19 || z16)) {
                                BizProfileTabLayout bizProfileTabLayout4 = this.f138361z;
                                if (bizProfileTabLayout4 != null) {
                                    ViewGroup audioTab = bizProfileTabLayout4.getAudioTab();
                                    z81.a.c(audioTab, "biz_home_aduio_tab");
                                    z81.a.e(audioTab, 40, 29426);
                                    z81.a.a(audioTab, new o(this));
                                    BizProfileTabLayout bizProfileTabLayout5 = this.f138361z;
                                    if (bizProfileTabLayout5 != null) {
                                        ViewGroup viewGroup3 = bizProfileTabLayout5.A;
                                        if (viewGroup3 != null) {
                                            viewGroup3.setVisibility(0);
                                        } else {
                                            lh4.m.p("mAudioLayout");
                                            throw null;
                                        }
                                    } else {
                                        lh4.m.p("menuTabLayout");
                                        throw null;
                                    }
                                } else {
                                    lh4.m.p("menuTabLayout");
                                    throw null;
                                }
                            }
                            if (z16) {
                                BizProfileTabLayout bizProfileTabLayout6 = this.f138361z;
                                if (bizProfileTabLayout6 != null) {
                                    ViewGroup viewGroup4 = bizProfileTabLayout6.B;
                                    if (viewGroup4 != null) {
                                        viewGroup4.setVisibility(0);
                                    } else {
                                        lh4.m.p("mServiceLayout");
                                        throw null;
                                    }
                                } else {
                                    lh4.m.p("menuTabLayout");
                                    throw null;
                                }
                            }
                            BizProfileTabLayout bizProfileTabLayout7 = this.f138361z;
                            if (bizProfileTabLayout7 != null) {
                                ViewPager viewPager = this.f138359x;
                                if (viewPager != null) {
                                    int currentItem = viewPager.getCurrentItem();
                                    if (currentItem >= 0 && currentItem < bizProfileTabLayout7.getTabCount()) {
                                        if (currentItem == 0) {
                                            bizProfileTabLayout7.u();
                                        } else if (currentItem == 1) {
                                            bizProfileTabLayout7.w();
                                        } else if (currentItem == 2) {
                                            bizProfileTabLayout7.t();
                                        }
                                    }
                                    if (((ArrayList) this.f138358w).size() <= 1) {
                                        BizProfileTabLayout bizProfileTabLayout8 = this.f138361z;
                                        if (bizProfileTabLayout8 == null) {
                                            lh4.m.p("menuTabLayout");
                                            throw null;
                                        } else if (bizProfileTabLayout8.getTabCount() <= 0) {
                                            BizProfileTabLayout bizProfileTabLayout9 = this.f138361z;
                                            if (bizProfileTabLayout9 != null) {
                                                bizProfileTabLayout9.setVisibility(8);
                                                z16 = false;
                                                z19 = false;
                                                z26 = false;
                                                if (!z15) {
                                                    if (z18) {
                                                        cs2.j.f193618a.b(this.f138346i, 0, this.f138348n, this.f138344g, f());
                                                    }
                                                    if (z19) {
                                                        cs2.j.f193618a.b(this.f138346i, 1, this.f138348n, this.f138344g, f());
                                                    }
                                                    if (z26) {
                                                        cs2.j.f193618a.b(this.f138346i, 4, this.f138348n, this.f138344g, f());
                                                    }
                                                    if (z16) {
                                                        cs2.j.f193618a.b(this.f138346i, 2, this.f138348n, this.f138344g, f());
                                                    }
                                                    if (!z18 && !z19 && !z26 && !z16) {
                                                        cs2.j.f193618a.b(this.f138346i, 3, this.f138348n, this.f138344g, f());
                                                        return;
                                                    }
                                                    return;
                                                }
                                                return;
                                            }
                                            lh4.m.p("menuTabLayout");
                                            throw null;
                                        }
                                    }
                                    BizProfileTabLayout bizProfileTabLayout10 = this.f138361z;
                                    if (bizProfileTabLayout10 != null) {
                                        bizProfileTabLayout10.setVisibility(0);
                                        z18 = z25;
                                        if (!z15) {
                                        }
                                    } else {
                                        lh4.m.p("menuTabLayout");
                                        throw null;
                                    }
                                } else {
                                    lh4.m.p("viewPager");
                                    throw null;
                                }
                            } else {
                                lh4.m.p("menuTabLayout");
                                throw null;
                            }
                        }
                    }
                }
                z17 = false;
                if (!z17) {
                }
            }
            z16 = false;
            bizProfileTabLayout = this.f138361z;
            if (bizProfileTabLayout == null) {
            }
        } else {
            lh4.m.p("menuTabLayout");
            throw null;
        }
    }

    @Override // gu3.a
    public void onActivityResult(int i15, int i16, Intent intent) {
        Fragment fragment;
        uh uhVar;
        Log.i("MicroMsg.ContactWidgetTabBizInfo", "onActivityResult, requestCode = %d, resultCode = %d", Integer.valueOf(i15), Integer.valueOf(i16));
        if (i15 == this.Z) {
            if (i16 == -1 && intent != null) {
                String stringExtra = intent.getStringExtra("be_send_card_name");
                String stringExtra2 = intent.getStringExtra("received_card_name");
                boolean booleanExtra = intent.getBooleanExtra("Is_Chatroom", false);
                String stringExtra3 = intent.getStringExtra("custom_send_text");
                hh2.k a15 = hh2.n.a();
                hi hiVar = this.f138349o;
                if (hiVar != null) {
                    uhVar = hiVar.f23818x;
                } else {
                    uhVar = null;
                }
                a15.Qa(stringExtra, stringExtra2, booleanExtra, uhVar);
                hh2.n.a().kv(stringExtra3, stringExtra2);
                ContactInfoUI contactInfoUI = this.f138341d;
                com.tencent.mm.ui.widget.snackbar.b.a(contactInfoUI, contactInfoUI.getString(R.string.f_p));
            }
        } else if (i15 == 10010 && (fragment = this.N) != null) {
            fragment.onActivityResult(i15, i16, intent);
        }
    }

    @Override // gu3.b
    public boolean onCreate() {
        int i15;
        String str;
        int i16;
        z1 z1Var = this.f138346i;
        if (z1Var == null || this.f138347j == null) {
            Log.w("MicroMsg.ContactWidgetTabBizInfo", "reportStart fail, err");
        } else {
            String username = z1Var.getUsername();
            int i17 = this.f138348n;
            ih.c cVar = this.f138347j;
            lh4.m.d(cVar);
            int i18 = cVar.field_type;
            long j15 = this.f138344g;
            z1 z1Var2 = this.f138346i;
            lh4.m.d(z1Var2);
            boolean z35 = z1Var2.z3();
            String str2 = this.B;
            String str3 = (String) ((wg4.n) this.F).getValue();
            String f15 = f();
            Intent intent = this.f138341d.getIntent();
            boolean g15 = g();
            if (i18 == 0) {
                i15 = 1;
            } else {
                if (i18 == 1) {
                    i16 = 2;
                } else {
                    i16 = 0;
                }
                i15 = i16;
            }
            if (str2 != null) {
                str = str2;
            } else {
                str = "";
            }
            as2.c.c(username, i17, i15, 1, j15, 0, z35 ? 1 : 0, 0, 0, 0, "", "", "", str, str3, f15, intent, g15 ? 1 : 0);
        }
        ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController = this.f138357v;
        if (contactWidgetTabBizHeaderController != null) {
            if (contactWidgetTabBizHeaderController.N == null && ((r21.d) z.q(r21.d.class)).iN()) {
                ContactWidgetTabBizHeaderController.BizFinderLineStatusChangedEventListenerImpl bizFinderLineStatusChangedEventListenerImpl = new ContactWidgetTabBizHeaderController.BizFinderLineStatusChangedEventListenerImpl(contactWidgetTabBizHeaderController);
                contactWidgetTabBizHeaderController.N = bizFinderLineStatusChangedEventListenerImpl;
                bizFinderLineStatusChangedEventListenerImpl.alive();
            }
            as2.a aVar = as2.a.f8147a;
            as2.a.f8148b = System.currentTimeMillis();
            ((HashMap) as2.a.f8149c).clear();
            as2.a.f8150d.clear();
            contactWidgetTabBizHeaderController.f138310g.setRequestedOrientation(1);
        }
        return true;
    }

    /* JADX WARNING: Removed duplicated region for block: B:58:0x016b  */
    @Override // gu3.b
    public boolean onDestroy() {
        String b15;
        rj rjVar;
        rj rjVar2;
        hi hiVar;
        int i15;
        IListener iListener;
        long currentTimeMillis = System.currentTimeMillis();
        z1 z1Var = this.f138346i;
        lh4.m.d(z1Var);
        ((r21.d) z.q(r21.d.class)).Up(currentTimeMillis, z1Var.getUsername());
        ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController = this.f138357v;
        String str = null;
        if (!(contactWidgetTabBizHeaderController == null || (iListener = contactWidgetTabBizHeaderController.N) == null)) {
            iListener.dead();
            contactWidgetTabBizHeaderController.N = null;
        }
        as2.a aVar = as2.a.f8147a;
        z1 z1Var2 = this.f138346i;
        lh4.m.d(z1Var2);
        String username = z1Var2.getUsername();
        lh4.m.f(username, "contact!!.username");
        int i16 = this.f138348n;
        for (Map.Entry entry : ((HashMap) as2.a.f8149c).entrySet()) {
            as2.f.a(username, ((Number) entry.getKey()).intValue(), i16, as2.a.f8148b, null);
        }
        Iterator<as2.b> it = as2.a.f8150d.iterator();
        while (it.hasNext()) {
            as2.f.a(username, it.next().f8151a, i16, as2.a.f8148b, null);
        }
        ((HashMap) as2.a.f8149c).clear();
        as2.a.f8150d.clear();
        if (!(this.f138346i == null || this.f138347j == null || (hiVar = this.f138349o) == null || hiVar.f23802e == null)) {
            lh4.m.d(hiVar);
            if (hiVar.f23801d != null) {
                long currentTimeMillis2 = System.currentTimeMillis();
                z1 z1Var3 = this.f138346i;
                lh4.m.d(z1Var3);
                String username2 = z1Var3.getUsername();
                int i17 = this.f138348n;
                ih.c cVar = this.f138347j;
                lh4.m.d(cVar);
                int i18 = cVar.field_type;
                long j15 = this.f138344g;
                z1 z1Var4 = this.f138346i;
                lh4.m.d(z1Var4);
                boolean z35 = z1Var4.z3();
                hi hiVar2 = this.f138349o;
                lh4.m.d(hiVar2);
                int i19 = hiVar2.f23802e.f40986d;
                hi hiVar3 = this.f138349o;
                lh4.m.d(hiVar3);
                wf wfVar = hiVar3.f23802e;
                int i25 = wfVar != null ? wfVar.f40987e : 0;
                hi hiVar4 = this.f138349o;
                lh4.m.d(hiVar4);
                String b16 = as2.c.b(hiVar4.f23803f);
                hi hiVar5 = this.f138349o;
                lh4.m.d(hiVar5);
                String a15 = as2.c.a(hiVar5.f23806i);
                hi hiVar6 = this.f138349o;
                lh4.m.d(hiVar6);
                ue ueVar = hiVar6.f23801d;
                String str2 = ueVar != null ? ueVar.f38586d : null;
                String str3 = (String) ((wg4.n) this.F).getValue();
                String f15 = f();
                Intent intent = this.f138341d.getIntent();
                boolean g15 = g();
                if (i18 == 0) {
                    i15 = 1;
                } else if (i18 == 1) {
                    i15 = 2;
                } else {
                    i15 = 0;
                }
                as2.c.c(username2, i17, i15, 2, j15, currentTimeMillis2, z35 ? 1 : 0, i19, i25, 0, b16, a15, str2, "", str3, f15, intent, g15 ? 1 : 0);
                hi hiVar7 = this.f138349o;
                b15 = j0.b((hiVar7 != null || (rjVar2 = hiVar7.f23813s) == null) ? null : rjVar2.f35401d);
                hi hiVar8 = this.f138349o;
                String b17 = j0.b((hiVar8 != null || (rjVar = hiVar8.f23813s) == null) ? null : rjVar.f35402e);
                if (((b15 != null || b15.length() == 0) ? 1 : null) == null) {
                    if (((b17 == null || b17.length() == 0) ? 1 : null) == null) {
                        com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
                        Object[] objArr = new Object[5];
                        objArr[0] = Long.valueOf(this.f138344g);
                        z1 z1Var5 = this.f138346i;
                        if (z1Var5 != null) {
                            str = z1Var5.getUsername();
                        }
                        if (str == null) {
                            str = "";
                        }
                        objArr[1] = str;
                        objArr[2] = 1;
                        objArr[3] = b15;
                        objArr[4] = b17;
                        qVar.g(22118, objArr);
                    }
                }
                return true;
            }
        }
        Log.w("MicroMsg.ContactWidgetTabBizInfo", "reportEnd fail, err");
        hi hiVar72 = this.f138349o;
        if (hiVar72 != null) {
        }
        b15 = j0.b((hiVar72 != null || (rjVar2 = hiVar72.f23813s) == null) ? null : rjVar2.f35401d);
        hi hiVar82 = this.f138349o;
        if (hiVar82 != null) {
        }
        String b172 = j0.b((hiVar82 != null || (rjVar = hiVar82.f23813s) == null) ? null : rjVar.f35402e);
        if (b15 != null) {
        }
        if (((b15 != null || b15.length() == 0) ? 1 : null) == null) {
        }
        return true;
    }

    @Override // gu3.a
    public boolean onDetach() {
        return true;
    }

    @Override // gu3.b
    public void onPause() {
        Fragment fragment;
        k5.a aVar;
        r21.b bVar;
        ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController = this.f138357v;
        if (!(contactWidgetTabBizHeaderController == null || (bVar = contactWidgetTabBizHeaderController.M) == null)) {
            bVar.stopCheck();
        }
        if (this.f138341d.isFinishing() && (fragment = this.N) != null) {
            if (fragment instanceof k5.a) {
                aVar = (k5.a) fragment;
            } else {
                aVar = null;
            }
            if (aVar != null) {
                aVar.F();
            }
        }
    }

    @Override // gu3.b
    public void onResume() {
        ContactWidgetTabBizHeaderController contactWidgetTabBizHeaderController = this.f138357v;
        if (contactWidgetTabBizHeaderController != null) {
            if (((r21.d) z.q(r21.d.class)).iN()) {
                if (contactWidgetTabBizHeaderController.M == null) {
                    contactWidgetTabBizHeaderController.M = ((r21.d) z.q(r21.d.class)).pk0(8);
                }
                ((r21.d) z.q(r21.d.class)).x3();
                contactWidgetTabBizHeaderController.M.a(contactWidgetTabBizHeaderController.f138317q);
            }
            contactWidgetTabBizHeaderController.f138320t.d();
            String str = contactWidgetTabBizHeaderController.f138317q;
            Set<String> set = BizContactObserver.f74580a;
            lh4.m.g(str, "bizUser");
            Set<String> set2 = BizContactObserver.f74580a;
            boolean z15 = true;
            if (set2 == null || !((HashSet) set2).contains(str)) {
                z15 = false;
            }
            if (z15) {
                contactWidgetTabBizHeaderController.f138318r.a();
            }
        }
    }
}