米游社.apk(点击下载) / u.java


package fn;

import android.util.LruCache;
import av.l0;
import av.n0;
import av.w;
import bg.n;
import com.alibaba.security.common.utils.NetWorkUtils;
import com.google.android.exoplayer2.text.ttml.TtmlNode;
import com.google.android.gms.common.GoogleApiAvailabilityLight;
import com.google.gson.annotations.SerializedName;
import com.huawei.hms.opendevice.i;
import com.mihoyo.commlib.utils.ExtensionKt;
import com.mihoyo.commlib.utils.LogUtils;
import com.mihoyo.hotfix.runtime.patch.RuntimeDirector;
import com.mihoyo.hyperion.rong.bean.HoYoMentionTextMessage;
import com.mihoyo.hyperion.rong.bean.HoYoMessageBean;
import com.mihoyo.hyperion.rong.bean.HoYoMessageContent;
import com.mihoyo.hyperion.rong.bean.content.info.EntityType;
import com.mihoyo.hyperion.rong.bean.content.info.LinkInfo;
import com.mihoyo.hyperion.rong.bean.content.info.SpanInfo;
import com.mihoyo.hyperion.villa.chat.bean.RoomPostMessageInfo;
import com.mihoyo.hyperion.villa.chat.bean.VillaListResponse;
import com.mihoyo.hyperion.villa.chat.bean.VillaResponse;
import du.d0;
import du.f0;
import du.k2;
import du.p;
import fn.x1;
import fu.g0;
import fu.x;
import i00.k;
import io.rong.imlib.model.Message;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import kotlin.Metadata;
import sm.v;
import vs.b0;
import zu.l;

@Metadata(bv = {}, d1 = {"\u0000b\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\n\bÆ\u0002\u0018\u00002\u00020\u0001:\u0003+,-B\t\b\u0002¢\u0006\u0004\b)\u0010*J\u0006\u0010\u0003\u001a\u00020\u0002J\u0016\u0010\b\u001a\n\u0012\u0004\u0012\u00020\u0007\u0018\u00010\u00062\u0006\u0010\u0005\u001a\u00020\u0004J\u0018\u0010\u000b\u001a\u0004\u0018\u00010\n2\u000e\u0010\t\u001a\n\u0012\u0004\u0012\u00020\u0007\u0018\u00010\u0006J\u000e\u0010\u000e\u001a\u00020\u00022\u0006\u0010\r\u001a\u00020\fJ\u0010\u0010\u0012\u001a\u0004\u0018\u00010\u00112\u0006\u0010\u0010\u001a\u00020\u000fJ\u0016\u0010\u0015\u001a\u00020\u00022\f\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\u00130\u0006H\u0002J\u0018\u0010\u0017\u001a\u00020\u00022\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u0016\u001a\u00020\nH\u0002J$\u0010\u001d\u001a\u0004\u0018\u00010\n2\u0006\u0010\u0019\u001a\u00020\u00182\b\u0010\u001a\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u001c\u001a\u00020\u001bH\u0002R\u001b\u0010#\u001a\u00020\u001e8BX‚„\u0002¢\u0006\f\n\u0004\b\u001f\u0010 \u001a\u0004\b!\u0010\"R'\u0010(\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00020$8BX‚„\u0002¢\u0006\f\n\u0004\b%\u0010 \u001a\u0004\b&\u0010'¨\u0006."}, d2 = {"Lfn/u;", "", "Ldu/k2;", "k", "", "text", "", "Lcom/mihoyo/hyperion/rong/bean/content/info/SpanInfo;", "r", "spanInfo", "Lcom/mihoyo/hyperion/rong/bean/content/info/LinkInfo;", "q", "Lcom/mihoyo/hyperion/rong/bean/HoYoMessageBean;", "msg", "s", "", "messageId", "Lfn/u$a;", GoogleApiAvailabilityLight.TRACKING_SOURCE_NOTIFICATION, "Lfn/u$c;", "list", "x", "linkInfo", "y", "Lfn/x1$a;", "webSummary", "sourceName", "", "isInternalLink", "j", "Lfn/u$b;", "api$delegate", "Ldu/d0;", "o", "()Lfn/u$b;", "api", "Lkotlin/Function1;", "log$delegate", TtmlNode.TAG_P, "()Lzu/l;", "log", "<init>", "()V", "a", "b", "c", "chat_release"}, k = 1, mv = {1, 7, 1})
/* compiled from: MessageAnalyzeHelper.kt */
public final class u {
    @uz.d

    /* renamed from: a  reason: collision with root package name */
    public static final u f59215a;

    /* renamed from: b  reason: collision with root package name */
    public static final Pattern f59216b = Pattern.compile("https?://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]");
    @uz.d

    /* renamed from: c  reason: collision with root package name */
    public static final CopyOnWriteArrayList<c> f59217c = new CopyOnWriteArrayList<>();
    @uz.d

    /* renamed from: d  reason: collision with root package name */
    public static final d0 f59218d = f0.c(d.f59228a);
    @uz.d

    /* renamed from: e  reason: collision with root package name */
    public static final v f59219e = new v();
    @uz.d

    /* renamed from: f  reason: collision with root package name */
    public static final LruCache<String, LinkInfo> f59220f = new LruCache<>(500);
    @uz.d

    /* renamed from: g  reason: collision with root package name */
    public static final d0 f59221g;
    @uz.d

    /* renamed from: h  reason: collision with root package name */
    public static final HashMap<Long, a> f59222h = new HashMap<>();
    public static RuntimeDirector m__m;

    @Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0006\b†\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003j\u0002\b\u0004j\u0002\b\u0005j\u0002\b\u0006¨\u0006\u0007"}, d2 = {"Lfn/u$a;", "", "<init>", "(Ljava/lang/String;I)V", "Loading", "Success", "Fail", "chat_release"}, k = 1, mv = {1, 7, 1})
    /* compiled from: MessageAnalyzeHelper.kt */
    public enum a {
        Loading,
        Success,
        Fail;
        
        public static RuntimeDirector m__m;

        public static a valueOf(String str) {
            Object valueOf;
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector == null || !runtimeDirector.isRedirect(1)) {
                valueOf = Enum.valueOf(a.class, str);
            } else {
                valueOf = runtimeDirector.invocationDispatch(1, null, str);
            }
            return (a) valueOf;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\bf\u0018\u00002\u00020\u0001J\u001a\u0010\u0006\u001a\u0014\u0012\u0010\u0012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00050\u00040\u00030\u0002H'¨\u0006\u0007"}, d2 = {"Lfn/u$b;", "", "Lvs/b0;", "Lcom/mihoyo/hyperion/villa/chat/bean/VillaResponse;", "Lcom/mihoyo/hyperion/villa/chat/bean/VillaListResponse;", "Lfn/u$c;", "a", "chat_release"}, k = 1, mv = {1, 7, 1})
    /* compiled from: MessageAnalyzeHelper.kt */
    public interface b {
        @k({bg.d.f9160d})
        @uz.d
        @i00.f("/vila/api/link_card/whitelist")
        b0<VillaResponse<VillaListResponse<c>>> a();
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0004\n\u0002\b\u0005\u0010\u0004\u001a\u00028\u0000\"\u0006\b\u0000\u0010\u0000\u0018\u0001H\n¢\u0006\u0004\b\u0001\u0010\u0002¨\u0006\u0003"}, d2 = {w1.a.f146648f5, "invoke", "()Ljava/lang/Object;", "bg/o$a", "<anonymous>"}, k = 3, mv = {1, 7, 1})
    /* compiled from: RetrofitClient.kt */
    public static final class d extends n0 implements zu.a<b> {

        /* renamed from: a  reason: collision with root package name */
        public static final d f59228a = new d();
        public static RuntimeDirector m__m;

        public d() {
            super(0);
        }

        /* JADX WARN: Type inference failed for: r0v2, types: [java.lang.Object, fn.u$b] */
        /* JADX WARN: Type inference failed for: r0v3, types: [java.lang.Object, fn.u$b] */
        /* JADX WARNING: Unknown variable types count: 2 */
        @Override // zu.a
        public final b invoke() {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector == null || !runtimeDirector.isRedirect(0)) {
                return n.f12799a.d(b.class);
            }
            return runtimeDirector.invocationDispatch(0, this, ga.a.f66507a);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0016\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u00040\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\u0007"}, d2 = {"", w1.a.f146648f5, "Lkotlin/Function1;", "", "Ldu/k2;", "a", "()Lzu/l;", "j9/x$a"}, k = 3, mv = {1, 7, 1})
    /* compiled from: LogUtils.kt */
    public static final class e extends n0 implements zu.a<l<? super String, ? extends k2>> {
        public static RuntimeDirector m__m;

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

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

        @Metadata(bv = {}, d1 = {"\u0000\u0014\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\b\u001a\u00020\u0004\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\u0007"}, d2 = {"", w1.a.f146648f5, "", "value", "Ldu/k2;", "invoke", "(Ljava/lang/String;)V", "j9/x$b", "<anonymous>"}, k = 3, mv = {1, 7, 1})
        /* compiled from: LogUtils.kt */
        public static final class a extends n0 implements l<String, k2> {
            public static RuntimeDirector m__m;

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

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

            /* JADX INFO: super call moved to the top of the method (can break code semantics) */
            public a(String str, String str2) {
                super(1);
                this.f59231a = str;
                this.f59232b = str2;
            }

            /* Return type fixed from 'java.lang.Object' to match base method */
            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
            @Override // zu.l
            public /* bridge */ /* synthetic */ k2 invoke(String str) {
                invoke(str);
                return k2.f53788a;
            }

            public final void invoke(@uz.d String str) {
                RuntimeDirector runtimeDirector = m__m;
                int i10 = 0;
                if (runtimeDirector == null || !runtimeDirector.isRedirect(0)) {
                    l0.p(str, "value");
                    try {
                        String str2 = this.f59231a;
                        String str3 = this.f59232b;
                        int length = str.length();
                        while (i10 < length) {
                            int min = Math.min(length - i10, 2000) + i10;
                            String obj = str.subSequence(i10, min).toString();
                            LogUtils.d(str2, str3 + ": " + obj);
                            i10 = min;
                        }
                    } catch (Throwable unused) {
                    }
                } else {
                    runtimeDirector.invocationDispatch(0, this, str);
                }
            }
        }

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public e(Object obj, String str) {
            super(0);
            this.f59229a = obj;
            this.f59230b = str;
        }

        @uz.d
        /* renamed from: a */
        public final l<String, k2> invoke() {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector != null && runtimeDirector.isRedirect(0)) {
                return (l) runtimeDirector.invocationDispatch(0, this, ga.a.f66507a);
            }
            Object obj = this.f59229a;
            String str = this.f59230b;
            String num = Integer.toString(System.identityHashCode(obj), xx.d.a(16));
            l0.o(num, "toString(this, checkRadix(radix))");
            return new a(str, u.class.getSimpleName() + xb.b.f156663i + num);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\b\u0010\u0001\u001a\u0004\u0018\u00010\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lio/rong/imlib/model/Message;", "it", "Ldu/k2;", "a", "(Lio/rong/imlib/model/Message;)V"}, k = 3, mv = {1, 7, 1})
    /* compiled from: MessageAnalyzeHelper.kt */
    public static final class f extends n0 implements l<Message, k2> {
        public static RuntimeDirector m__m;

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

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ LinkInfo f59234b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public f(HoYoMessageBean hoYoMessageBean, LinkInfo linkInfo) {
            super(1);
            this.f59233a = hoYoMessageBean;
            this.f59234b = linkInfo;
        }

        public final void a(@uz.e Message message) {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector != null && runtimeDirector.isRedirect(0)) {
                runtimeDirector.invocationDispatch(0, this, message);
            } else if (message == null) {
                u.f59222h.put(Long.valueOf(this.f59233a.getMessageId()), a.Fail);
            } else {
                u.f59222h.put(Long.valueOf(this.f59233a.getMessageId()), a.Success);
                ml.b.f90217a.e().i(message.getUId(), vh.a.f143772a.h(message, this.f59234b));
            }
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // zu.l
        public /* bridge */ /* synthetic */ k2 invoke(Message message) {
            a(message);
            return k2.f53788a;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000e\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0005\u001a\u00020\u00022\b\u0010\u0001\u001a\u0004\u0018\u00010\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"", "it", "Ldu/k2;", "invoke", "(Ljava/lang/String;)V", "<anonymous>"}, k = 3, mv = {1, 7, 1})
    /* compiled from: MessageAnalyzeHelper.kt */
    public static final class g extends n0 implements l<String, k2> {
        public static RuntimeDirector m__m;

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public g(HoYoMessageBean hoYoMessageBean) {
            super(1);
            this.f59235a = hoYoMessageBean;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // zu.l
        public /* bridge */ /* synthetic */ k2 invoke(String str) {
            invoke(str);
            return k2.f53788a;
        }

        public final void invoke(@uz.e String str) {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector == null || !runtimeDirector.isRedirect(0)) {
                u.f59215a.p().invoke(String.valueOf(str));
                u.f59222h.put(Long.valueOf(this.f59235a.getMessageId()), a.Fail);
                return;
            }
            runtimeDirector.invocationDispatch(0, this, str);
        }
    }

    static {
        u uVar = new u();
        f59215a = uVar;
        f59221g = f0.c(new e(uVar, "mihoyo"));
    }

    public static final void l(VillaResponse villaResponse) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(10)) {
            f59215a.x(((VillaListResponse) villaResponse.getData()).getList());
            return;
        }
        runtimeDirector.invocationDispatch(10, null, villaResponse);
    }

    public static final void m(Throwable th2) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(11)) {
            l<String, k2> p10 = f59215a.p();
            l0.o(th2, "it");
            p10.invoke(p.i(th2));
            return;
        }
        runtimeDirector.invocationDispatch(11, null, th2);
    }

    public static final void t(HoYoMessageBean hoYoMessageBean, String str, boolean z10, String str2, VillaResponse villaResponse) {
        RuntimeDirector runtimeDirector = m__m;
        RoomPostMessageInfo.Post post = null;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(12)) {
            l0.p(hoYoMessageBean, "$msg");
            l0.p(str, "$link");
            l0.p(str2, "$postId");
            RoomPostMessageInfo roomPostMessageInfo = (RoomPostMessageInfo) g0.R2(((VillaListResponse) villaResponse.getData()).getList(), 0);
            if (roomPostMessageInfo != null) {
                post = roomPostMessageInfo.getPost();
            }
            if (post == null || post.isDeleted() || post.isMissing()) {
                f59222h.put(Long.valueOf(hoYoMessageBean.getMessageId()), a.Fail);
                return;
            }
            LinkInfo linkInfo = new LinkInfo(post.getSubject(), post.getContent(), "https://bbs.mihoyo.com/favicon.ico", post.getDisplayImage(), "米游社", str, z10);
            f59220f.put(str2, linkInfo);
            f59215a.y(hoYoMessageBean, linkInfo);
            return;
        }
        runtimeDirector.invocationDispatch(12, null, hoYoMessageBean, str, Boolean.valueOf(z10), str2, villaResponse);
    }

    public static final void u(HoYoMessageBean hoYoMessageBean, Throwable th2) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(13)) {
            l0.p(hoYoMessageBean, "$msg");
            l<String, k2> p10 = f59215a.p();
            l0.o(th2, "it");
            p10.invoke(p.i(th2));
            f59222h.put(Long.valueOf(hoYoMessageBean.getMessageId()), a.Fail);
            return;
        }
        runtimeDirector.invocationDispatch(13, null, hoYoMessageBean, th2);
    }

    public static final void v(SpanInfo spanInfo, HoYoMessageBean hoYoMessageBean, x1.a aVar) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(14)) {
            l0.p(hoYoMessageBean, "$msg");
            u uVar = f59215a;
            l0.o(aVar, "webSummary");
            LinkInfo j10 = uVar.j(aVar, spanInfo.getEntity().getSourceName(), spanInfo.getEntity().isInternalLink());
            if (j10 != null) {
                uVar.y(hoYoMessageBean, j10);
                return;
            }
            return;
        }
        runtimeDirector.invocationDispatch(14, null, spanInfo, hoYoMessageBean, aVar);
    }

    public static final void w(HoYoMessageBean hoYoMessageBean, Throwable th2) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(15)) {
            l0.p(hoYoMessageBean, "$msg");
            l<String, k2> p10 = f59215a.p();
            l0.o(th2, "it");
            p10.invoke(p.i(th2));
            f59222h.put(Long.valueOf(hoYoMessageBean.getMessageId()), a.Fail);
            return;
        }
        runtimeDirector.invocationDispatch(15, null, hoYoMessageBean, th2);
    }

    public static final void z(HoYoMessageBean hoYoMessageBean, String str, LinkInfo linkInfo, Long l10) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(16)) {
            l0.p(hoYoMessageBean, "$msg");
            l0.p(linkInfo, "$linkInfo");
            ml.b.f90217a.e().k(hoYoMessageBean.getTargetId(), hoYoMessageBean.getChannelId(), str, hoYoMessageBean.getMessageTime(), new f(hoYoMessageBean, linkInfo), new g(hoYoMessageBean));
            return;
        }
        runtimeDirector.invocationDispatch(16, null, hoYoMessageBean, str, linkInfo, l10);
    }

    public final LinkInfo j(x1.a aVar, String str, boolean z10) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector != null && runtimeDirector.isRedirect(9)) {
            return (LinkInfo) runtimeDirector.invocationDispatch(9, this, aVar, str, Boolean.valueOf(z10));
        } else if (xx.b0.U1(aVar.n()) || xx.b0.U1(aVar.j())) {
            r1 r1Var = r1.f59206a;
            r1.g(r1Var, "解析失败: title " + aVar.n() + ", description:" + aVar.j() + ", cover:" + aVar.i(), null, 2, null);
            return null;
        } else {
            String n10 = aVar.n();
            String j10 = aVar.j();
            String k10 = aVar.k();
            String i10 = aVar.i();
            if (str == null) {
                str = "";
            }
            return new LinkInfo(n10, j10, k10, i10, str, aVar.l(), z10);
        }
    }

    public final void k() {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(2)) {
            at.c E5 = ExtensionKt.l(o().a()).E5(s.f59209a, t.f59212a);
            l0.o(E5, "api.getUrlWhitelist().ap…aceToString())\n        })");
            tn.g.a(E5, androidx.lifecycle.n0.h());
            return;
        }
        runtimeDirector.invocationDispatch(2, this, ga.a.f66507a);
    }

    @uz.e
    public final a n(long j10) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(8)) {
            return f59222h.get(Long.valueOf(j10));
        }
        return (a) runtimeDirector.invocationDispatch(8, this, Long.valueOf(j10));
    }

    public final b o() {
        RuntimeDirector runtimeDirector = m__m;
        return (runtimeDirector == null || !runtimeDirector.isRedirect(0)) ? (b) f59218d.getValue() : (b) runtimeDirector.invocationDispatch(0, this, ga.a.f66507a);
    }

    public final l<String, k2> p() {
        RuntimeDirector runtimeDirector = m__m;
        return (runtimeDirector == null || !runtimeDirector.isRedirect(1)) ? (l) f59221g.getValue() : (l) runtimeDirector.invocationDispatch(1, this, ga.a.f66507a);
    }

    @uz.e
    public final LinkInfo q(@uz.e List<SpanInfo> list) {
        T t10;
        SpanInfo.Entity entity;
        String url;
        T t11;
        boolean z10;
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector != null && runtimeDirector.isRedirect(5)) {
            return (LinkInfo) runtimeDirector.invocationDispatch(5, this, list);
        }
        if (list != null) {
            Iterator<T> it2 = list.iterator();
            while (true) {
                if (!it2.hasNext()) {
                    t11 = null;
                    break;
                }
                t11 = it2.next();
                T t12 = t11;
                if (t12.getEntity().getEntityType() != EntityType.LINK || t12.getEntity().isNotParsed()) {
                    z10 = false;
                    continue;
                } else {
                    z10 = true;
                    continue;
                }
                if (z10) {
                    break;
                }
            }
            t10 = t11;
        } else {
            t10 = null;
        }
        if (t10 == null || (entity = t10.getEntity()) == null || (url = entity.getUrl()) == null) {
            return null;
        }
        if (t10.getEntity().isInternalLink()) {
            String b10 = n0.f59164a.b(url);
            if (b10 == null) {
                return null;
            }
            return f59220f.get(b10);
        }
        x1.a f10 = x1.f59254a.f(url);
        if (f10 == null) {
            return null;
        }
        return j(f10, t10.getEntity().getSourceName(), t10.getEntity().isInternalLink());
    }

    @uz.e
    public final List<SpanInfo> r(@uz.d String str) {
        Matcher matcher;
        RuntimeDirector runtimeDirector = m__m;
        boolean z10 = false;
        boolean z11 = true;
        if (runtimeDirector != null && runtimeDirector.isRedirect(4)) {
            return (List) runtimeDirector.invocationDispatch(4, this, str);
        }
        l0.p(str, "text");
        if (xx.b0.U1(str)) {
            return null;
        }
        Matcher matcher2 = f59216b.matcher(str);
        ArrayList arrayList = new ArrayList();
        while (matcher2.find()) {
            String group = matcher2.group();
            for (T t10 : f59217c) {
                Pattern h10 = t10.h();
                if ((h10 == null || (matcher = h10.matcher(group)) == null || matcher.matches() != z11) ? z10 : z11) {
                    arrayList.add(new SpanInfo(matcher2.start(), matcher2.end() - matcher2.start(), new SpanInfo.Entity(EntityType.LINK.getType(), null, null, null, null, group, t10.g(), t10.k(), t10.j(), 30, null)));
                    z10 = false;
                    z11 = true;
                }
            }
        }
        return arrayList;
    }

    public final void s(@uz.d HoYoMessageBean hoYoMessageBean) {
        T t10;
        SpanInfo.Entity entity;
        String url;
        boolean z10;
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(6)) {
            l0.p(hoYoMessageBean, "msg");
            HoYoMessageContent messageContent = hoYoMessageBean.getMessageContent();
            HoYoMentionTextMessage hoYoMentionTextMessage = messageContent instanceof HoYoMentionTextMessage ? (HoYoMentionTextMessage) messageContent : null;
            if (hoYoMentionTextMessage != null && hoYoMentionTextMessage.getLinkInfo() == null) {
                Iterator<T> it2 = hoYoMentionTextMessage.getSpanInfo().iterator();
                while (true) {
                    if (!it2.hasNext()) {
                        t10 = null;
                        break;
                    }
                    t10 = it2.next();
                    T t11 = t10;
                    if (t11.getEntity().getEntityType() != EntityType.LINK || t11.getEntity().isNotParsed()) {
                        z10 = false;
                        continue;
                    } else {
                        z10 = true;
                        continue;
                    }
                    if (z10) {
                        break;
                    }
                }
                T t12 = t10;
                if (t12 != null && (entity = t12.getEntity()) != null && (url = entity.getUrl()) != null) {
                    boolean isInternalLink = t12.getEntity().isInternalLink();
                    if (isInternalLink) {
                        String b10 = n0.f59164a.b(url);
                        if (b10 != null) {
                            f59222h.put(Long.valueOf(hoYoMessageBean.getMessageId()), a.Loading);
                            at.c E5 = ExtensionKt.l(f59219e.b(x.l(b10))).E5(new q(hoYoMessageBean, url, isInternalLink, b10), new n(hoYoMessageBean));
                            l0.o(E5, "chatRoomModel.getBatchPo…t.Fail\n                })");
                            tn.g.a(E5, androidx.lifecycle.n0.h());
                            return;
                        }
                        return;
                    }
                    f59222h.put(Long.valueOf(hoYoMessageBean.getMessageId()), a.Loading);
                    at.c E52 = x1.k(x1.f59254a, url, false, 2, null).E5(new r(t12, hoYoMessageBean), new o(hoYoMessageBean));
                    l0.o(E52, "WebSummaryHelper.parseBy…esult.Fail\n            })");
                    tn.g.a(E52, androidx.lifecycle.n0.h());
                    return;
                }
                return;
            }
            return;
        }
        runtimeDirector.invocationDispatch(6, this, hoYoMessageBean);
    }

    public final void x(List<c> list) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(3)) {
            f59217c.clear();
            for (T t10 : list) {
                try {
                    t10.l(Pattern.compile(t10.i()));
                } catch (Exception e10) {
                    f59215a.p().invoke(p.i(e10));
                }
            }
            f59217c.addAll(list);
            return;
        }
        runtimeDirector.invocationDispatch(3, this, list);
    }

    public final void y(HoYoMessageBean hoYoMessageBean, LinkInfo linkInfo) {
        RuntimeDirector runtimeDirector = m__m;
        if (runtimeDirector == null || !runtimeDirector.isRedirect(7)) {
            String messageUid = hoYoMessageBean.getMessageUid();
            if (messageUid == null) {
                f59222h.put(Long.valueOf(hoYoMessageBean.getMessageId()), a.Fail);
                return;
            }
            at.c D5 = b0.O6(3, TimeUnit.SECONDS).D5(new p(hoYoMessageBean, messageUid, linkInfo));
            l0.o(D5, "timer(3, TimeUnit.SECOND…         })\n            }");
            tn.g.a(D5, androidx.lifecycle.n0.h());
            return;
        }
        runtimeDirector.invocationDispatch(7, this, hoYoMessageBean, linkInfo);
    }

    @Metadata(bv = {}, d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\b\n\u0002\u0010\b\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\t\b†\b\u0018\u00002\u00020\u0001B)\u0012\u0006\u0010\b\u001a\u00020\u0002\u0012\u0006\u0010\t\u001a\u00020\u0002\u0012\u0006\u0010\n\u001a\u00020\u0005\u0012\b\b\u0002\u0010\u000b\u001a\u00020\u0005¢\u0006\u0004\b!\u0010\"J\t\u0010\u0003\u001a\u00020\u0002HÆ\u0003J\t\u0010\u0004\u001a\u00020\u0002HÆ\u0003J\t\u0010\u0006\u001a\u00020\u0005HÆ\u0003J\t\u0010\u0007\u001a\u00020\u0005HÆ\u0003J1\u0010\f\u001a\u00020\u00002\b\b\u0002\u0010\b\u001a\u00020\u00022\b\b\u0002\u0010\t\u001a\u00020\u00022\b\b\u0002\u0010\n\u001a\u00020\u00052\b\b\u0002\u0010\u000b\u001a\u00020\u0005HÆ\u0001J\t\u0010\r\u001a\u00020\u0002HÖ\u0001J\t\u0010\u000f\u001a\u00020\u000eHÖ\u0001J\u0013\u0010\u0011\u001a\u00020\u00052\b\u0010\u0010\u001a\u0004\u0018\u00010\u0001HÖ\u0003R\u001a\u0010\b\u001a\u00020\u00028\u0006X‡\u0004¢\u0006\f\n\u0004\b\b\u0010\u0012\u001a\u0004\b\u0013\u0010\u0014R\u001a\u0010\t\u001a\u00020\u00028\u0006X‡\u0004¢\u0006\f\n\u0004\b\t\u0010\u0012\u001a\u0004\b\u0015\u0010\u0014R\u001a\u0010\n\u001a\u00020\u00058\u0006X‡\u0004¢\u0006\f\n\u0004\b\n\u0010\u0016\u001a\u0004\b\u0017\u0010\u0018R\u001a\u0010\u000b\u001a\u00020\u00058\u0006X‡\u0004¢\u0006\f\n\u0004\b\u000b\u0010\u0016\u001a\u0004\b\u0019\u0010\u0018R$\u0010\u001b\u001a\u0004\u0018\u00010\u001a8\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b\u001b\u0010\u001c\u001a\u0004\b\u001d\u0010\u001e\"\u0004\b\u001f\u0010 ¨\u0006#"}, d2 = {"Lfn/u$c;", "", "", "a", "b", "", "c", GoogleApiAvailabilityLight.TRACKING_SOURCE_DIALOG, "hostOrigin", "urlRegexp", "isNotParsed", "isInternalLink", com.huawei.hms.push.e.f31073a, "toString", "", "hashCode", NetWorkUtils.NETWORK_UNKNOWN, "equals", "Ljava/lang/String;", com.sdk.a.g.f40364a, "()Ljava/lang/String;", i.TAG, "Z", "k", "()Z", "j", "Ljava/util/regex/Pattern;", "mPattern", "Ljava/util/regex/Pattern;", "h", "()Ljava/util/regex/Pattern;", "l", "(Ljava/util/regex/Pattern;)V", "<init>", "(Ljava/lang/String;Ljava/lang/String;ZZ)V", "chat_release"}, k = 1, mv = {1, 7, 1})
    /* compiled from: MessageAnalyzeHelper.kt */
    public static final class c {
        public static RuntimeDirector m__m;
        @SerializedName("host_origin")
        @uz.d

        /* renamed from: a  reason: collision with root package name */
        public final String f59223a;
        @SerializedName("url_regexp")
        @uz.d

        /* renamed from: b  reason: collision with root package name */
        public final String f59224b;
        @SerializedName("is_not_parsed")

        /* renamed from: c  reason: collision with root package name */
        public final boolean f59225c;
        @SerializedName("is_internal_link")

        /* renamed from: d  reason: collision with root package name */
        public final boolean f59226d;
        @uz.e

        /* renamed from: e  reason: collision with root package name */
        public Pattern f59227e;

        public c(@uz.d String str, @uz.d String str2, boolean z10, boolean z11) {
            l0.p(str, "hostOrigin");
            l0.p(str2, "urlRegexp");
            this.f59223a = str;
            this.f59224b = str2;
            this.f59225c = z10;
            this.f59226d = z11;
        }

        public static /* synthetic */ c f(c cVar, String str, String str2, boolean z10, boolean z11, int i10, Object obj) {
            if ((i10 & 1) != 0) {
                str = cVar.f59223a;
            }
            if ((i10 & 2) != 0) {
                str2 = cVar.f59224b;
            }
            if ((i10 & 4) != 0) {
                z10 = cVar.f59225c;
            }
            if ((i10 & 8) != 0) {
                z11 = cVar.f59226d;
            }
            return cVar.e(str, str2, z10, z11);
        }

        @uz.d
        public final String a() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(6)) ? this.f59223a : (String) runtimeDirector.invocationDispatch(6, this, ga.a.f66507a);
        }

        @uz.d
        public final String b() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(7)) ? this.f59224b : (String) runtimeDirector.invocationDispatch(7, this, ga.a.f66507a);
        }

        public final boolean c() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(8)) ? this.f59225c : ((Boolean) runtimeDirector.invocationDispatch(8, this, ga.a.f66507a)).booleanValue();
        }

        public final boolean d() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(9)) ? this.f59226d : ((Boolean) runtimeDirector.invocationDispatch(9, this, ga.a.f66507a)).booleanValue();
        }

        @uz.d
        public final c e(@uz.d String str, @uz.d String str2, boolean z10, boolean z11) {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector == null || !runtimeDirector.isRedirect(10)) {
                l0.p(str, "hostOrigin");
                l0.p(str2, "urlRegexp");
                return new c(str, str2, z10, z11);
            }
            return (c) runtimeDirector.invocationDispatch(10, this, str, str2, Boolean.valueOf(z10), Boolean.valueOf(z11));
        }

        public boolean equals(@uz.e Object obj) {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector != null && runtimeDirector.isRedirect(13)) {
                return ((Boolean) runtimeDirector.invocationDispatch(13, this, obj)).booleanValue();
            } else if (this == obj) {
                return true;
            } else {
                if (!(obj instanceof c)) {
                    return false;
                }
                c cVar = (c) obj;
                return l0.g(this.f59223a, cVar.f59223a) && l0.g(this.f59224b, cVar.f59224b) && this.f59225c == cVar.f59225c && this.f59226d == cVar.f59226d;
            }
        }

        @uz.d
        public final String g() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(0)) ? this.f59223a : (String) runtimeDirector.invocationDispatch(0, this, ga.a.f66507a);
        }

        @uz.e
        public final Pattern h() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(4)) ? this.f59227e : (Pattern) runtimeDirector.invocationDispatch(4, this, ga.a.f66507a);
        }

        public int hashCode() {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector != null && runtimeDirector.isRedirect(12)) {
                return ((Integer) runtimeDirector.invocationDispatch(12, this, ga.a.f66507a)).intValue();
            }
            int hashCode = ((this.f59223a.hashCode() * 31) + this.f59224b.hashCode()) * 31;
            boolean z10 = this.f59225c;
            int i10 = 1;
            if (z10) {
                z10 = true;
            }
            int i11 = z10 ? 1 : 0;
            int i12 = z10 ? 1 : 0;
            int i13 = z10 ? 1 : 0;
            int i14 = (hashCode + i11) * 31;
            boolean z11 = this.f59226d;
            if (!z11) {
                i10 = z11 ? 1 : 0;
            }
            return i14 + i10;
        }

        @uz.d
        public final String i() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(1)) ? this.f59224b : (String) runtimeDirector.invocationDispatch(1, this, ga.a.f66507a);
        }

        public final boolean j() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(3)) ? this.f59226d : ((Boolean) runtimeDirector.invocationDispatch(3, this, ga.a.f66507a)).booleanValue();
        }

        public final boolean k() {
            RuntimeDirector runtimeDirector = m__m;
            return (runtimeDirector == null || !runtimeDirector.isRedirect(2)) ? this.f59225c : ((Boolean) runtimeDirector.invocationDispatch(2, this, ga.a.f66507a)).booleanValue();
        }

        public final void l(@uz.e Pattern pattern) {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector == null || !runtimeDirector.isRedirect(5)) {
                this.f59227e = pattern;
                return;
            }
            runtimeDirector.invocationDispatch(5, this, pattern);
        }

        @uz.d
        public String toString() {
            RuntimeDirector runtimeDirector = m__m;
            if (runtimeDirector != null && runtimeDirector.isRedirect(11)) {
                return (String) runtimeDirector.invocationDispatch(11, this, ga.a.f66507a);
            }
            return "WhiteListBean(hostOrigin=" + this.f59223a + ", urlRegexp=" + this.f59224b + ", isNotParsed=" + this.f59225c + ", isInternalLink=" + this.f59226d + ')';
        }

        /* JADX INFO: this call moved to the top of the method (can break code semantics) */
        public /* synthetic */ c(String str, String str2, boolean z10, boolean z11, int i10, w wVar) {
            this(str, str2, z10, (i10 & 8) != 0 ? false : z11);
        }
    }
}