package c.a.a.f; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import androidx.fragment.app.Fragment; import c.a.i.v4; import com.discord.app.AppDialog; import com.discord.stores.StoreNotices; import com.discord.stores.StoreStream; import com.discord.utilities.string.StringUtilsKt; import com.discord.utilities.uri.UriHandler; import com.discord.utilities.viewbinding.FragmentViewBindingDelegate; import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt; import com.google.android.material.button.MaterialButton; import d0.z.d.k; import d0.z.d.m; import java.util.Objects; import kotlin.Unit; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.reflect.KProperty; /* compiled from: WidgetMaskedLinksDialog.kt */ public final class a extends AppDialog { public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.W(a.class, "binding", "getBinding()Lcom/discord/databinding/WidgetMaskedLinksDialogBinding;", 0)}; public static final b j = new b(null); public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, c.i, null, 2, null); /* compiled from: java-style lambda group */ /* renamed from: c.a.a.f.a$a reason: collision with other inner class name */ public static final class View$OnClickListenerC0016a implements View.OnClickListener { public final /* synthetic */ int i; public final /* synthetic */ Object j; public final /* synthetic */ Object k; public View$OnClickListenerC0016a(int i, Object obj, Object obj2) { this.i = i; this.j = obj; this.k = obj2; } @Override // android.view.View.OnClickListener public final void onClick(View view) { int i = this.i; if (i == 0) { a aVar = (a) this.j; m.checkNotNullExpressionValue(view, "v"); Context context = view.getContext(); m.checkNotNullExpressionValue(context, "v.context"); String str = (String) this.k; KProperty[] kPropertyArr = a.i; Objects.requireNonNull(aVar); UriHandler.handle$default(UriHandler.INSTANCE, context, str, null, 4, null); aVar.dismiss(); } else if (i == 1) { a aVar2 = (a) this.j; m.checkNotNullExpressionValue(view, "v"); Context context2 = view.getContext(); m.checkNotNullExpressionValue(context2, "v.context"); String str2 = (String) this.k; KProperty[] kPropertyArr2 = a.i; Objects.requireNonNull(aVar2); StoreStream.Companion.getMaskedLinks().trustDomain(str2); UriHandler.handle$default(UriHandler.INSTANCE, context2, str2, null, 4, null); aVar2.dismiss(); } else { throw null; } } } /* compiled from: WidgetMaskedLinksDialog.kt */ public static final class b { public b(DefaultConstructorMarker defaultConstructorMarker) { } } /* compiled from: WidgetMaskedLinksDialog.kt */ public static final /* synthetic */ class c extends k implements Function1 { public static final c i = new c(); public c() { super(1, v4.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/WidgetMaskedLinksDialogBinding;", 0); } /* 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 // kotlin.jvm.functions.Function1 public v4 invoke(View view) { View view2 = view; m.checkNotNullParameter(view2, "p1"); int i2 = 2131363788; TextView textView = (TextView) view2.findViewById(2131363788); if (textView != null) { i2 = 2131363789; MaterialButton materialButton = (MaterialButton) view2.findViewById(2131363789); if (materialButton != null) { i2 = 2131363790; MaterialButton materialButton2 = (MaterialButton) view2.findViewById(2131363790); if (materialButton2 != null) { i2 = 2131363791; TextView textView2 = (TextView) view2.findViewById(2131363791); if (textView2 != null) { i2 = 2131365491; TextView textView3 = (TextView) view2.findViewById(2131365491); if (textView3 != null) { return new v4((LinearLayout) view2, textView, materialButton, materialButton2, textView2, textView3); } } } } } throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2))); } } /* compiled from: WidgetMaskedLinksDialog.kt */ public static final class d implements View.OnClickListener { public final /* synthetic */ a i; public d(a aVar) { this.i = aVar; } @Override // android.view.View.OnClickListener public final void onClick(View view) { this.i.dismiss(); } } public a() { super(2131559077); } public final v4 g() { return (v4) this.k.getValue((Fragment) this, i[0]); } @Override // androidx.fragment.app.Fragment public void onDestroy() { super.onDestroy(); StoreNotices notices = StoreStream.Companion.getNotices(); Objects.requireNonNull(j); StoreNotices.markSeen$default(notices, "WIDGET_SPOOPY_LINKS_DIALOG", 0, 2, null); } @Override // com.discord.app.AppDialog public void onViewBound(View view) { String str; Object obj; m.checkNotNullParameter(view, "view"); super.onViewBound(view); Bundle arguments = getArguments(); if (arguments == null || (str = arguments.getString("WIDGET_SPOOPY_LINKS_DIALOG_URL")) == null) { str = ""; } m.checkNotNullExpressionValue(str, "arguments?.getString(DIALOG_URL) ?: \"\""); try { obj = StringUtilsKt.toPunyCodeASCIIUrl(str); } catch (Exception unused) { dismiss(); obj = Unit.a; } TextView textView = g().b; m.checkNotNullExpressionValue(textView, "binding.maskedLinksBodyText"); c.a.l.b.n(textView, 2131890973, new Object[]{obj}, null, 4); g().f169c.setOnClickListener(new d(this)); g().d.setOnClickListener(new View$OnClickListenerC0016a(0, this, str)); g().e.setOnClickListener(new View$OnClickListenerC0016a(1, this, str)); } }