2021-12-21 23:37:30 +00:00
|
|
|
package b.a.k.f;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
|
import android.webkit.URLUtil;
|
2021-12-21 23:37:30 +00:00
|
|
|
import b.a.k.a;
|
2021-06-27 20:44:35 +00:00
|
|
|
import com.discord.i18n.Hook;
|
|
|
|
import com.discord.i18n.RenderContext;
|
|
|
|
import com.discord.simpleast.core.node.Node;
|
2021-11-08 18:25:28 +00:00
|
|
|
import d0.z.d.m;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.util.List;
|
|
|
|
/* compiled from: HookNode.kt */
|
|
|
|
public final class c extends Node.a<RenderContext> {
|
|
|
|
public final String a;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public c(String str) {
|
|
|
|
super(new Node[0]);
|
|
|
|
m.checkNotNullParameter(str, "key");
|
|
|
|
this.a = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.simpleast.core.node.Node.a, com.discord.simpleast.core.node.Node
|
|
|
|
public void render(SpannableStringBuilder spannableStringBuilder, Object obj) {
|
|
|
|
List<Object> list;
|
|
|
|
RenderContext renderContext = (RenderContext) obj;
|
|
|
|
m.checkNotNullParameter(spannableStringBuilder, "builder");
|
|
|
|
m.checkNotNullParameter(renderContext, "renderContext");
|
2022-02-14 21:43:51 +00:00
|
|
|
Hook hook = renderContext.f2688b.get(this.a);
|
2021-06-27 20:44:35 +00:00
|
|
|
int length = spannableStringBuilder.length();
|
|
|
|
super.render(spannableStringBuilder, renderContext);
|
|
|
|
Hook.a aVar = null;
|
2022-02-14 21:43:51 +00:00
|
|
|
CharSequence charSequence = hook != null ? hook.f2686b : null;
|
2021-10-05 20:14:30 +00:00
|
|
|
if (charSequence != null) {
|
|
|
|
spannableStringBuilder.replace(length, spannableStringBuilder.length(), charSequence);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!(hook == null || (list = hook.a) == null)) {
|
|
|
|
for (Object obj2 : list) {
|
|
|
|
spannableStringBuilder.setSpan(obj2, length, spannableStringBuilder.length(), 33);
|
|
|
|
}
|
|
|
|
}
|
2021-12-21 23:37:30 +00:00
|
|
|
Hook.a aVar2 = hook != null ? hook.c : null;
|
2021-06-27 20:44:35 +00:00
|
|
|
if (aVar2 != null) {
|
|
|
|
aVar = aVar2;
|
|
|
|
} else if (URLUtil.isValidUrl(this.a)) {
|
|
|
|
a aVar3 = a.d;
|
2022-02-14 21:43:51 +00:00
|
|
|
aVar = new Hook.a(a.f242b.mo1invoke(), a.c);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (aVar != null) {
|
|
|
|
Integer num = aVar.a;
|
|
|
|
if (num == null) {
|
|
|
|
a aVar4 = a.d;
|
2022-02-14 21:43:51 +00:00
|
|
|
num = a.f242b.mo1invoke();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-12-21 23:37:30 +00:00
|
|
|
spannableStringBuilder.setSpan(new b.a.k.e.a(new b(this, aVar), num), length, spannableStringBuilder.length(), 33);
|
2021-06-27 20:44:35 +00:00
|
|
|
renderContext.g = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|