package fi0; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Looper; import android.text.Editable; import android.text.TextWatcher; import android.widget.EditText; import androidx.lifecycle.Lifecycle; import bh0.b; import ch0.m0; import ci0.f; import com.alibaba.wireless.security.open.nocaptcha.INoCaptchaComponent; import com.meizu.cloud.pushsdk.notification.model.AdvanceSetting; import com.tencent.ugc.videoprocessor.watermark.data.AnimatedPasterJsonConfig; import com.uber.autodispose.b0; import com.xingin.android.redutils.base.XhsActivity; import com.xingin.android.xhscomm.router.Routers; import com.xingin.capa.lib.R$id; import com.xingin.capa.lib.R$string; import com.xingin.capa.lib.base.CapaApplication; import com.xingin.capa.lib.bean.CapaVideoCoverBean; import com.xingin.capa.lib.newcapa.session.CapaVideoModel; import com.xingin.capa.lib.post.utils.CapaAbConfig; import com.xingin.capa.lib.video.entity.VideoTemplate; import com.xingin.capa.v2.feature.template.label.TemplateLabelDialog; import com.xingin.capa.v2.feature.template.model.TemplateLabelModel; import com.xingin.capa.v2.session2.internal.IVideoEditor; import com.xingin.capa.v2.session2.model.EditableVideo2; import com.xingin.capa.v2.utils.s; import com.xingin.foundation.framework.v2.ControllerExtensionsKt; import com.xingin.utils.core.x0; import dw2.a0; import dw2.r; import hi0.j; import ij0.p; import ij0.u; import ij0.w; import ja.b1; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import kotlin.Lazy; import kotlin.LazyKt__LazyJVMKt; import kotlin.Metadata; import kotlin.Unit; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Lambda; import kotlin.math.MathKt__MathJVMKt; import oi0.k0; import pq0.y; import pq0.z; @Metadata(bv = {}, d1 = {"\u0000p\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0007\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\n\u0018\u00002\u0014\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0000\u0012\u0004\u0012\u00020\u00030\u00012\u00020\u0004:\u0001GB\u0007¢\u0006\u0004\bE\u0010FJ\b\u0010\u0006\u001a\u00020\u0005H\u0002J\b\u0010\u0007\u001a\u00020\u0005H\u0002J\b\u0010\b\u001a\u00020\u0005H\u0002J\b\u0010\t\u001a\u00020\u0005H\u0002J\u0010\u0010\f\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\nH\u0002J\b\u0010\r\u001a\u00020\u0005H\u0002J\b\u0010\u000e\u001a\u00020\u0005H\u0002J\b\u0010\u000f\u001a\u00020\u0005H\u0002J\b\u0010\u0010\u001a\u00020\u0005H\u0002J\b\u0010\u0012\u001a\u00020\u0011H\u0002J\b\u0010\u0013\u001a\u00020\u0011H\u0002J\b\u0010\u0014\u001a\u00020\u0011H\u0002J\b\u0010\u0015\u001a\u00020\u0011H\u0002J\b\u0010\u0016\u001a\u00020\u0005H\u0002J\b\u0010\u0017\u001a\u00020\u0005H\u0002J\b\u0010\u0018\u001a\u00020\u0005H\u0002J\u0010\u0010\u001b\u001a\u00020\u00052\u0006\u0010\u001a\u001a\u00020\u0019H\u0002J\u0012\u0010\u001e\u001a\u00020\u00052\b\u0010\u001d\u001a\u0004\u0018\u00010\u001cH\u0015J\u0016\u0010!\u001a\u00020\u00052\f\u0010 \u001a\b\u0012\u0004\u0012\u00020\n0\u001fH\u0016J\b\u0010\"\u001a\u00020\u0005H\u0016J\b\u0010#\u001a\u00020\u0005H\u0014R\u001b\u0010)\u001a\u00020$8BX\u0002¢\u0006\f\n\u0004\b%\u0010&\u001a\u0004\b'\u0010(R\u001b\u0010.\u001a\u00020*8BX\u0002¢\u0006\f\n\u0004\b+\u0010&\u001a\u0004\b,\u0010-R\"\u00100\u001a\u00020/8\u0006@\u0006X.¢\u0006\u0012\n\u0004\b0\u00101\u001a\u0004\b2\u00103\"\u0004\b4\u00105R\"\u00107\u001a\u0002068\u0006@\u0006X.¢\u0006\u0012\n\u0004\b7\u00108\u001a\u0004\b9\u0010:\"\u0004\b;\u0010<R(\u0010?\u001a\b\u0012\u0004\u0012\u00020>0=8\u0006@\u0006X.¢\u0006\u0012\n\u0004\b?\u0010@\u001a\u0004\bA\u0010B\"\u0004\bC\u0010D¨\u0006H"}, d2 = {"Lfi0/e0;", "Ltu0/b;", "Lfi0/j0;", "Lfi0/g0;", "", "", INoCaptchaComponent.f17802y1, "initListener", "g2", "m2", "Lcom/xingin/capa/v2/feature/template/model/TemplateLabelModel;", "label", "l2", "L1", "k2", INoCaptchaComponent.f17800x1, "o2", "", "E1", "D1", "B1", "C1", "n2", "w1", "d2", "", "videoCover", "K1", "Landroid/os/Bundle;", "savedInstanceState", "onAttach", "", "labelList", "j2", "i2", "onDetach", "Lii0/c;", "repo$delegate", "Lkotlin/Lazy;", "F1", "()Lii0/c;", "repo", "Lhi0/j;", "uploadManager$delegate", "H1", "()Lhi0/j;", "uploadManager", "Lcom/xingin/android/redutils/base/XhsActivity;", "activity", "Lcom/xingin/android/redutils/base/XhsActivity;", "getActivity", "()Lcom/xingin/android/redutils/base/XhsActivity;", "setActivity", "(Lcom/xingin/android/redutils/base/XhsActivity;)V", "Lwp0/e;", "session", "Lwp0/e;", "G1", "()Lwp0/e;", "setSession", "(Lwp0/e;)V", "Ldx2/b;", "Lbh0/b;", "videoPlayerInEvent", "Ldx2/b;", "I1", "()Ldx2/b;", "setVideoPlayerInEvent", "(Ldx2/b;)V", "<init>", "()V", "a", "capa_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public final class e0 extends tu0.b<j0, e0, g0> { /* renamed from: m reason: collision with root package name */ public static final a f77137m = new a(null); /* renamed from: a reason: collision with root package name */ public XhsActivity f77138a; /* renamed from: b reason: collision with root package name */ public wp0.e f77139b; /* renamed from: c reason: collision with root package name */ public dx2.b<bh0.b> f77140c; /* renamed from: d reason: collision with root package name */ public dx2.b<bh0.a> f77141d; /* renamed from: e reason: collision with root package name */ public TemplateLabelDialog f77142e; /* renamed from: f reason: collision with root package name */ public final ArrayList<TemplateLabelModel> f77143f = new ArrayList<>(); /* renamed from: g reason: collision with root package name */ public VideoTemplate f77144g; /* renamed from: h reason: collision with root package name */ public com.xingin.capa.v2.feature.post.flow.a f77145h; /* renamed from: i reason: collision with root package name */ public z f77146i; /* renamed from: j reason: collision with root package name */ public long f77147j; /* renamed from: k reason: collision with root package name */ public final Lazy f77148k = LazyKt__LazyJVMKt.lazy(new n(this)); /* renamed from: l reason: collision with root package name */ public final Lazy f77149l = LazyKt__LazyJVMKt.lazy(new o(this)); @Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\b\n\u0002\b\u0005\b\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0005\u0010\u0006R\u0014\u0010\u0003\u001a\u00020\u00028\u0006XT¢\u0006\u0006\n\u0004\b\u0003\u0010\u0004¨\u0006\u0007"}, d2 = {"Lfi0/e0$a;", "", "", "TITLE_LIMIT_MAX", "I", "<init>", "()V", "capa_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class a { public a() { } public /* synthetic */ a(DefaultConstructorMarker defaultConstructorMarker) { this(); } } @Metadata(k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: TemplateUploadController.kt */ public /* synthetic */ class b { /* renamed from: a reason: collision with root package name */ public static final /* synthetic */ int[] f77150a; static { int[] iArr = new int[Lifecycle.Event.values().length]; iArr[Lifecycle.Event.ON_RESUME.ordinal()] = 1; iArr[Lifecycle.Event.ON_STOP.ordinal()] = 2; f77150a = iArr; } } @Metadata(bv = {}, d1 = {"\u0000'\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\r\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J(\u0010\t\u001a\u00020\b2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u0004H\u0016J(\u0010\u000b\u001a\u00020\b2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\n\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u0004H\u0016J\u0010\u0010\r\u001a\u00020\b2\u0006\u0010\u0003\u001a\u00020\fH\u0016¨\u0006\u000e"}, d2 = {"fi0/e0$c", "Landroid/text/TextWatcher;", "", "s", "", "start", AnimatedPasterJsonConfig.CONFIG_COUNT, "after", "", "beforeTextChanged", "before", "onTextChanged", "Landroid/text/Editable;", "afterTextChanged", "capa_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class c implements TextWatcher { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77151a; public c(e0 e0Var) { this.f77151a = e0Var; } public void afterTextChanged(Editable editable) { Intrinsics.checkNotNullParameter(editable, "s"); VideoTemplate videoTemplate = null; j0.w((j0) this.f77151a.getPresenter(), tg2.f.f133395a.c(editable.toString()) / 2, 0, 2, null); VideoTemplate videoTemplate2 = this.f77151a.f77144g; if (videoTemplate2 == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); } else { videoTemplate = videoTemplate2; } videoTemplate.setCn_name(editable.toString()); } public void beforeTextChanged(CharSequence charSequence, int i10, int i14, int i15) { Intrinsics.checkNotNullParameter(charSequence, "s"); } public void onTextChanged(CharSequence charSequence, int i10, int i14, int i15) { Intrinsics.checkNotNullParameter(charSequence, "s"); } } @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: TemplateUploadController.kt */ public static final class d extends Lambda implements Function0<Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77152a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public d(e0 e0Var) { super(0); this.f77152a = e0Var; } @Override // kotlin.jvm.functions.Function0 public final void invoke() { this.f77152a.k2(); } } @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: TemplateUploadController.kt */ public static final class e extends Lambda implements Function0<Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77153a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public e(e0 e0Var) { super(0); this.f77153a = e0Var; } @Override // kotlin.jvm.functions.Function0 public final void invoke() { this.f77153a.g2(); } } @Metadata(bv = {}, d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lcom/xingin/capa/v2/feature/template/model/TemplateLabelModel;", "label", "", "a", "(Lcom/xingin/capa/v2/feature/template/model/TemplateLabelModel;)V"}, k = 3, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class f extends Lambda implements Function1<TemplateLabelModel, Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77154a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public f(e0 e0Var) { super(1); this.f77154a = e0Var; } public final void a(TemplateLabelModel templateLabelModel) { Intrinsics.checkNotNullParameter(templateLabelModel, "label"); this.f77154a.l2(templateLabelModel); } /* 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 /* bridge */ /* synthetic */ Unit invoke(TemplateLabelModel templateLabelModel) { a(templateLabelModel); return Unit.INSTANCE; } } @Metadata(bv = {}, d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\u0004"}, d2 = {"fi0/e0$g", "Lhi0/j$b;", "", "start", "capa_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class g implements j.b { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77155a; public g(e0 e0Var) { this.f77155a = e0Var; } @Override // hi0.j.b public void start() { this.f77155a.n2(); } } @Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0004\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Loi0/k0;", "kotlin.jvm.PlatformType", AdvanceSetting.NETWORK_TYPE, "", "a", "(Loi0/k0;)V"}, k = 3, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class h extends Lambda implements Function1<k0, Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77156a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public h(e0 e0Var) { super(1); this.f77156a = e0Var; } public final void a(k0 k0Var) { String d14 = ri0.a.d(this.f77156a.G1(), 2); if (d14 != null) { e0 e0Var = this.f77156a; ((j0) e0Var.getPresenter()).C(d14); ((j0) e0Var.getPresenter()).z(true); uo0.e.P(e0Var.G1(), false, false, false, null, 30, null); } } /* 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 /* bridge */ /* synthetic */ Unit invoke(k0 k0Var) { a(k0Var); return Unit.INSTANCE; } } @Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0004\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lv60/d;", "kotlin.jvm.PlatformType", AdvanceSetting.NETWORK_TYPE, "", "a", "(Lv60/d;)V"}, k = 3, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class i extends Lambda implements Function1<v60.d, Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77157a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public i(e0 e0Var) { super(1); this.f77157a = e0Var; } public final void a(v60.d dVar) { String d14 = ri0.a.d(this.f77157a.G1(), 1); if (d14 != null) { this.f77157a.K1(d14); } this.f77157a.m2(); } /* 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 /* bridge */ /* synthetic */ Unit invoke(v60.d dVar) { a(dVar); return Unit.INSTANCE; } } @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: TemplateUploadController.kt */ public static final class j extends Lambda implements Function0<Unit> { /* renamed from: a reason: collision with root package name */ public static final j f77158a = new j(); public j() { super(0); } @Override // kotlin.jvm.functions.Function0 public final void invoke() { uo0.e.P(null, false, false, false, null, 31, null); } } @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"fi0/e0$k", "Lci0/f$c;", "capa_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class k implements f.c { } @Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u00012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", AdvanceSetting.NETWORK_TYPE, "", "Lcom/xingin/capa/v2/feature/template/model/TemplateLabelModel;", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: TemplateUploadController.kt */ public static final class l extends Lambda implements Function1<List<? extends TemplateLabelModel>, Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77159a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public l(e0 e0Var) { super(1); this.f77159a = e0Var; } /* 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 /* bridge */ /* synthetic */ Unit invoke(List<? extends TemplateLabelModel> list) { invoke((List<TemplateLabelModel>) list); return Unit.INSTANCE; } public final void invoke(List<TemplateLabelModel> list) { Intrinsics.checkNotNullParameter(list, AdvanceSetting.NETWORK_TYPE); VideoTemplate videoTemplate = this.f77159a.f77144g; VideoTemplate videoTemplate2 = null; if (videoTemplate == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate = null; } videoTemplate.getLabels().clear(); VideoTemplate videoTemplate3 = this.f77159a.f77144g; if (videoTemplate3 == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); } else { videoTemplate2 = videoTemplate3; } videoTemplate2.getLabels().addAll(list); this.f77159a.x1(); } } @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: TemplateUploadController.kt */ public static final class m extends Lambda implements Function0<Unit> { /* renamed from: a reason: collision with root package name */ public static final m f77160a = new m(); public m() { super(0); } @Override // kotlin.jvm.functions.Function0 public final void invoke() { } } @Metadata(bv = {}, d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Lii0/c;", "a", "()Lii0/c;"}, k = 3, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class n extends Lambda implements Function0<ii0.c> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77161a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public n(e0 e0Var) { super(0); this.f77161a = e0Var; } /* renamed from: a */ public final ii0.c invoke() { return new ii0.c(this.f77161a); } } @Metadata(bv = {}, d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Lhi0/j;", "a", "()Lhi0/j;"}, k = 3, mv = {1, 6, 0}) /* compiled from: TemplateUploadController.kt */ public static final class o extends Lambda implements Function0<hi0.j> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e0 f77162a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public o(e0 e0Var) { super(0); this.f77162a = e0Var; } /* renamed from: a */ public final hi0.j invoke() { return new hi0.j(this.f77162a.G1()); } } public static final void A1(Throwable th3) { s.b("TemplateUploadController", th3.getLocalizedMessage(), th3); } public static final void N1(Throwable th3) { s.f(th3); } public static final void O1(e0 e0Var, Unit unit) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); boolean z14 = !((j0) e0Var.getPresenter()).k(); ((j0) e0Var.getPresenter()).D(z14); x50.a.f152450a.i("template_upload_protocol_status", z14); } public static final void P1(Throwable th3) { s.f(th3); } public static final void Q1(e0 e0Var, Unit unit) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); Routers.build("https://www.xiaohongshu.com/apps/vincent/ditto?id=capa_lgsq_CreatorServicePlatformAgreement&naviHidden=yes&utm_source=social&useNativeChannel=yes&fullscreen=true").open(e0Var.getActivity()); } public static final void R1(Throwable th3) { s.f(th3); } public static final void S1(e0 e0Var, Unit unit) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); Routers.build("https://www.xiaohongshu.com/apps/vincent/ditto?id=capa_lgsq_cover&naviHidden=yes&utm_source=social&useNativeChannel=yes&fullscreen=true").open(e0Var.getActivity()); } public static final void T1(Throwable th3) { s.f(th3); } public static final void U1(e0 e0Var, Unit unit) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); Routers.build("https://www.xiaohongshu.com/apps/vincent/ditto?id=capa_lgsq_cover&naviHidden=yes&utm_source=social&useNativeChannel=yes&fullscreen=true").open(e0Var.getActivity()); } public static final void V1(Throwable th3) { s.f(th3); } public static final void W1(e0 e0Var, Unit unit) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); e0Var.g2(); } public static final void X1(Throwable th3) { s.f(th3); } public static final void Y1(e0 e0Var, Unit unit) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); e0Var.o2(); } public static final void Z1(Throwable th3) { s.f(th3); } public static final void a2(e0 e0Var, Unit unit) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); yo0.k.L(e0Var.getActivity(), 1, 0, 4, null); } public static final void b2(Throwable th3) { s.f(th3); } public static final void c2(e0 e0Var, Unit unit) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); yo0.k.L(e0Var.getActivity(), 2, 0, 4, null); } public static final void e2(e0 e0Var, String str) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); s.c("VideoCoverLoader", "load video cover success: " + str); Intrinsics.checkNotNullExpressionValue(str, AdvanceSetting.NETWORK_TYPE); e0Var.K1(str); e0Var.m2(); } public static final void f2(Throwable th3) { s.d("VideoCoverLoader", "generate video cover failed", th3); } public static final void h2(e0 e0Var, int i10) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); if (i10 == R$id.widgets_save_to_draft) { uo0.l.f138212a.j(true); uo0.e.P(e0Var.G1(), false, false, false, null, 28, null); wp0.e.x(e0Var.G1(), false, 1, null); e0Var.getActivity().finish(); } else if (i10 == R$id.widgets_continue_cancel) { m0.q0(m0.f12248a, "template_post", "template_segment_choose", 0, 4, null); yo0.k.U(e0Var.getActivity(), 0, 1, 2, null); e0Var.getActivity().finish(); } } public static final void z1(e0 e0Var, Lifecycle.Event event) { Intrinsics.checkNotNullParameter(e0Var, "this$0"); int i10 = event == null ? -1 : b.f77150a[event.ordinal()]; if (i10 == 1) { e0Var.f77147j = System.currentTimeMillis(); ij0.b.f91245a.v(); } else if (i10 == 2) { long currentTimeMillis = System.currentTimeMillis() - e0Var.f77147j; if (currentTimeMillis > 0) { ij0.b.f91245a.u(currentTimeMillis); } } } public final boolean B1() { CapaVideoModel videoInfo; String coverImgUrl; IVideoEditor n14 = G1().n(); if (!(n14 == null || (videoInfo = n14.getVideoInfo()) == null || (coverImgUrl = videoInfo.getCoverImgUrl()) == null)) { if (coverImgUrl.length() > 0) { return true; } } return false; } public final boolean C1() { VideoTemplate videoTemplate = this.f77144g; if (videoTemplate == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate = null; } String coverPath = videoTemplate.getTemplateIcon().getCoverPath(); return !(coverPath == null || coverPath.length() == 0); } public final boolean D1() { VideoTemplate videoTemplate = this.f77144g; if (videoTemplate == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate = null; } return !videoTemplate.getLabels().isEmpty(); } public final boolean E1() { VideoTemplate videoTemplate = this.f77144g; if (videoTemplate == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate = null; } return !(videoTemplate.getCn_name().length() == 0); } public final ii0.c F1() { return (ii0.c) this.f77148k.getValue(); } public final wp0.e G1() { wp0.e eVar = this.f77139b; if (eVar != null) { return eVar; } Intrinsics.throwUninitializedPropertyAccessException("session"); return null; } public final hi0.j H1() { return (hi0.j) this.f77149l.getValue(); } public final dx2.b<bh0.b> I1() { dx2.b<bh0.b> bVar = this.f77140c; if (bVar != null) { return bVar; } Intrinsics.throwUninitializedPropertyAccessException("videoPlayerInEvent"); return null; } public final void K1(String str) { ri0.a.a(G1(), str); IVideoEditor n14 = G1().n(); CapaVideoModel capaVideoModel = null; CapaVideoModel videoInfo = n14 != null ? n14.getVideoInfo() : null; if (videoInfo != null) { videoInfo.setVideoCoverPath(str); } IVideoEditor n15 = G1().n(); if (n15 != null) { capaVideoModel = n15.getVideoInfo(); } if (capaVideoModel != null) { capaVideoModel.setClientEncode(false); } uo0.e.P(G1(), false, false, false, null, 30, null); } /* JADX WARNING: Removed duplicated region for block: B:23:0x0079 */ /* JADX WARNING: Removed duplicated region for block: B:26:0x0089 */ /* JADX WARNING: Removed duplicated region for block: B:27:0x008b */ /* JADX WARNING: Removed duplicated region for block: B:29:0x008e */ /* JADX WARNING: Removed duplicated region for block: B:35:0x00ab */ /* JADX WARNING: Removed duplicated region for block: B:38:0x00ba */ /* JADX WARNING: Removed duplicated region for block: B:47:0x00f8 */ /* JADX WARNING: Removed duplicated region for block: B:48:0x00fc */ /* JADX WARNING: Removed duplicated region for block: B:56:0x0113 */ /* JADX WARNING: Removed duplicated region for block: B:57:0x0126 */ public final void L1() { Unit unit; long j14; VideoTemplate videoTemplate; VideoTemplate videoTemplate2; VideoTemplate videoTemplate3; String coverPath; CapaVideoModel videoInfo; long j15; long j16; VideoTemplate J2; IVideoEditor n14 = G1().n(); VideoTemplate videoTemplate4 = null; if (n14 == null || (J2 = zp0.a.J(n14)) == null) { unit = null; } else { this.f77144g = J2; unit = Unit.INSTANCE; } if (unit == null) { getActivity().finish(); } if (this.f77144g != null) { uo0.e.P(G1(), false, false, false, null, 30, null); z zVar = this.f77146i; if (zVar != null) { j15 = MathKt__MathJVMKt.roundToLong(((float) zVar.i()) / 1000.0f); j16 = 1000; } else { IVideoEditor n15 = G1().n(); if (n15 == null || (videoInfo = n15.getVideoInfo()) == null) { j14 = 0; I1().a(new b.a(0, j14)); videoTemplate = this.f77144g; if (videoTemplate == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate = null; } if (videoTemplate.getCn_name().length() <= 0) { EditText l14 = ((j0) getPresenter()).l(); VideoTemplate videoTemplate5 = this.f77144g; if (videoTemplate5 == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate5 = null; } l14.setText(videoTemplate5.getCn_name()); } videoTemplate2 = this.f77144g; if (videoTemplate2 == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate2 = null; } if (!videoTemplate2.getLabels().isEmpty()) { VideoTemplate videoTemplate6 = this.f77144g; if (videoTemplate6 == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate6 = null; } Iterator<T> it3 = videoTemplate6.getLabels().iterator(); while (it3.hasNext()) { ((j0) getPresenter()).g(it3.next()); } } ((j0) getPresenter()).D(x50.a.f152450a.b("template_upload_protocol_status", false)); d2(); videoTemplate3 = this.f77144g; if (videoTemplate3 != null) { Intrinsics.throwUninitializedPropertyAccessException("template"); } else { videoTemplate4 = videoTemplate3; } coverPath = videoTemplate4.getTemplateIcon().getCoverPath(); if (coverPath != null || coverPath.length() == 0) { ((j0) getPresenter()).C(coverPath); ((j0) getPresenter()).z(true); } else { ((j0) getPresenter()).z(false); } F1().d(); } j15 = MathKt__MathJVMKt.roundToLong(videoInfo.getVideoDuration()); j16 = (long) 1000; } j14 = j15 * j16; I1().a(new b.a(0, j14)); videoTemplate = this.f77144g; if (videoTemplate == null) { } if (videoTemplate.getCn_name().length() <= 0) { } videoTemplate2 = this.f77144g; if (videoTemplate2 == null) { } if (!videoTemplate2.getLabels().isEmpty()) { } ((j0) getPresenter()).D(x50.a.f152450a.b("template_upload_protocol_status", false)); d2(); videoTemplate3 = this.f77144g; if (videoTemplate3 != null) { } coverPath = videoTemplate4.getTemplateIcon().getCoverPath(); if (coverPath != null || coverPath.length() == 0) { } F1().d(); } } public final void d2() { EditableVideo2 editableVideo; CapaVideoModel videoInfo; CapaVideoCoverBean coverBean; CapaVideoModel videoInfo2; CapaVideoCoverBean coverBean2; IVideoEditor n14 = G1().n(); String coverPath = (n14 == null || (videoInfo2 = n14.getVideoInfo()) == null || (coverBean2 = videoInfo2.getCoverBean()) == null) ? null : coverBean2.getCoverPath(); if (coverPath == null || !new File(coverPath).exists()) { IVideoEditor n15 = G1().n(); long ts3 = (n15 == null || (videoInfo = n15.getVideoInfo()) == null || (coverBean = videoInfo.getCoverBean()) == null) ? 0 : coverBean.getTs(); IVideoEditor n16 = G1().n(); if (n16 != null && (editableVideo = n16.getEditableVideo()) != null && editableVideo.getVideoWidth() != 0 && editableVideo.getVideoHeight() != 0) { a0 u14 = v80.e.g(v80.e.f139723a, y.f119509a.f(editableVideo), ts3, false, 0, 12, null).B(mi2.a.P()).u(gw2.a.a()); Intrinsics.checkNotNullExpressionValue(u14, "VideoCoverLoader.load(vi…dSchedulers.mainThread())"); Object d14 = u14.d(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(d14, "this.`as`(AutoDispose.autoDisposable(provider))"); ((b0) d14).a(new w(this), m.f77177a); return; } return; } K1(coverPath); m2(); } public final void g2() { p90.b.f(getActivity(), true, new j(this)).show(); } public final XhsActivity getActivity() { XhsActivity xhsActivity = this.f77138a; if (xhsActivity != null) { return xhsActivity; } Intrinsics.throwUninitializedPropertyAccessException("activity"); return null; } public void i2() { this.f77143f.clear(); w1(); } public final void initListener() { ControllerExtensionsKt.a(this, getActivity(), true, new e(this)); Object n14 = ((j0) getPresenter()).i().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n14, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n14).a(new y(this), q.f77181a); Object n15 = ((j0) getPresenter()).E().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n15, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n15).a(new b0(this), p.f77180a); Object n16 = ((j0) getPresenter()).f().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n16, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n16).a(new x(this), v.f77186a); Object n17 = ((j0) getPresenter()).h().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n17, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n17).a(new c0(this), l.f77176a); Object n18 = ((j0) getPresenter()).j().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n18, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n18).a(new d0(this), t.f77184a); Object n19 = ((j0) getPresenter()).r().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n19, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n19).a(new z(this), r.f77182a); ((j0) getPresenter()).l().setFilters(new ni0.s[]{new ni0.s()}); ((j0) getPresenter()).l().addTextChangedListener(new c(this)); Object n24 = ((j0) getPresenter()).F().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n24, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n24).a(new k(this), o.f77179a); Object n25 = ((j0) getPresenter()).q().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n25, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n25).a(new a0(this), n.f77178a); ((j0) getPresenter()).A(new d(this)); ((j0) getPresenter()).B(new f(this)); H1().n0(new g(this)); ej2.a aVar = ej2.a.f72257b; r W0 = aVar.b(k0.class).W0(gw2.a.a()); Intrinsics.checkNotNullExpressionValue(W0, "CommonBus.toObservable(T…dSchedulers.mainThread())"); Object n26 = W0.n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n26, "this.`as`(AutoDispose.autoDisposable(provider))"); bj2.h.b((com.uber.autodispose.y) n26, new h(this)); r W02 = aVar.b(v60.d.class).W0(gw2.a.a()); Intrinsics.checkNotNullExpressionValue(W02, "CommonBus.toObservable(C…dSchedulers.mainThread())"); Object n27 = W02.n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n27, "this.`as`(AutoDispose.autoDisposable(provider))"); bj2.h.b((com.uber.autodispose.y) n27, new i(this)); } public void j2(List<TemplateLabelModel> list) { Intrinsics.checkNotNullParameter(list, "labelList"); this.f77143f.clear(); if (list.isEmpty()) { w1(); } else { this.f77143f.addAll(list); } } public final void k2() { if (this.f77143f.isEmpty()) { al2.e.g(x0.d(R$string.bkp)); return; } VideoTemplate videoTemplate = this.f77144g; VideoTemplate videoTemplate2 = null; if (videoTemplate == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate = null; } if (videoTemplate.getLabels().size() >= 5) { al2.e.g(x0.d(R$string.bko)); return; } TemplateLabelDialog templateLabelDialog = new TemplateLabelDialog(getActivity(), new k()); this.f77142e = templateLabelDialog; templateLabelDialog.l(new l(this)); TemplateLabelDialog templateLabelDialog2 = this.f77142e; if (templateLabelDialog2 != null) { templateLabelDialog2.k(m.f77160a); } TemplateLabelDialog templateLabelDialog3 = this.f77142e; if (templateLabelDialog3 != null) { templateLabelDialog3.m(this.f77143f); } TemplateLabelDialog templateLabelDialog4 = this.f77142e; if (templateLabelDialog4 != null) { VideoTemplate videoTemplate3 = this.f77144g; if (videoTemplate3 == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); } else { videoTemplate2 = videoTemplate3; } templateLabelDialog4.n(videoTemplate2.getLabels()); } TemplateLabelDialog templateLabelDialog5 = this.f77142e; if (templateLabelDialog5 != null) { templateLabelDialog5.show(); } } public final void l2(TemplateLabelModel templateLabelModel) { VideoTemplate videoTemplate = this.f77144g; VideoTemplate videoTemplate2 = null; if (videoTemplate == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate = null; } T t14 = null; for (T t15 : videoTemplate.getLabels()) { if (t15.getId() == templateLabelModel.getId()) { t14 = t15; } } if (t14 != null) { VideoTemplate videoTemplate3 = this.f77144g; if (videoTemplate3 == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); } else { videoTemplate2 = videoTemplate3; } videoTemplate2.getLabels().remove(t14); } } public final void m2() { CapaVideoModel videoInfo; IVideoEditor n14 = G1().n(); String coverImgUrl = (n14 == null || (videoInfo = n14.getVideoInfo()) == null) ? null : videoInfo.getCoverImgUrl(); boolean f14 = ol0.b.f(G1()); if (coverImgUrl != null) { if (coverImgUrl.length() > 0) { ((j0) getPresenter()).x(coverImgUrl, f14); } } } public final void n2() { h60.c.f85022a.j(); p.f91386a.T(u.TEMPLATE_POST, true); Bundle bundle = new Bundle(); bundle.putString("userId", b1.f94179a.S0().getUserid()); bundle.putBoolean("template_lib_is_show", false); bundle.putString("template_user_page_from_source", w.CAPA_COMPOSE_PAGE.getSource()); yo0.k.X(getActivity(), bundle); } public final void o2() { if (!E1()) { al2.e.g(x0.d(R$string.f47352capa_template_publish_name_invalid_tips)); } else if (!D1()) { al2.e.g(x0.d(R$string.bkz)); } else if (!B1()) { al2.e.g(x0.d(R$string.bkx)); } else if (!C1()) { al2.e.g(x0.d(R$string.bky)); } else if (!((j0) getPresenter()).k()) { al2.e.g(x0.d(R$string.f47353capa_template_publish_protocol_valid_tips)); } else if (!com.xingin.utils.core.f.t(CapaApplication.INSTANCE.getApplication())) { al2.e.f(R$string.bf7); uo0.e.P(G1(), true, true, false, null, 24, null); } else { ij0.b.f91245a.t(); H1().r0(getActivity()); } } @Override // tu0.b @SuppressLint({"ClickableViewAccessibility"}) public void onAttach(Bundle bundle) { EditableVideo2 editableVideo; super.onAttach(bundle); IVideoEditor n14 = G1().n(); if (!(n14 == null || (editableVideo = n14.getEditableVideo()) == null)) { this.f77146i = y.f119509a.f(editableVideo).G(); } y1(); initListener(); L1(); if (CapaAbConfig.INSTANCE.isAutoSaveEnable()) { Looper mainLooper = Looper.getMainLooper(); Intrinsics.checkNotNullExpressionValue(mainLooper, "getMainLooper()"); this.f77145h = new com.xingin.capa.v2.feature.post.flow.a(mainLooper, j.f77158a); } } @Override // tu0.b public void onDetach() { TemplateLabelDialog templateLabelDialog; super.onDetach(); TemplateLabelDialog templateLabelDialog2 = this.f77142e; boolean z14 = true; if (templateLabelDialog2 == null || !templateLabelDialog2.isShowing()) { z14 = false; } if (z14 && (templateLabelDialog = this.f77142e) != null) { templateLabelDialog.dismiss(); } com.xingin.capa.v2.feature.post.flow.a aVar = this.f77145h; if (aVar != null) { aVar.b(); } H1().n0(null); uo0.e.P(G1(), false, false, false, null, 30, null); } public final void w1() { TemplateLabelModel templateLabelModel = new TemplateLabelModel(3, "推荐"); TemplateLabelModel templateLabelModel2 = new TemplateLabelModel(1, "更多"); this.f77143f.add(templateLabelModel); this.f77143f.add(templateLabelModel2); } public final void x1() { ((j0) getPresenter()).s(); ((j0) getPresenter()).e(); VideoTemplate videoTemplate = this.f77144g; if (videoTemplate == null) { Intrinsics.throwUninitializedPropertyAccessException("template"); videoTemplate = null; } Iterator<T> it3 = videoTemplate.getLabels().iterator(); while (it3.hasNext()) { ((j0) getPresenter()).g(it3.next()); } } public final void y1() { Object n14 = getActivity().lifecycle().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n14, "this.`as`(AutoDispose.autoDisposable(provider))"); ((com.uber.autodispose.y) n14).a(new u(this), s.f77183a); } }