PhotoRoom v4.8.2版本的 MD5 值为:c40a01bb3380c0f75c0cb6ac6760f295
以下内容为反编译后的 l.java 源代码,内容仅作参考
package op;
import an.a;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.view.r0;
import androidx.core.view.s1;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.f0;
import androidx.fragment.app.q0;
import androidx.lifecycle.b1;
import androidx.lifecycle.g1;
import androidx.lifecycle.h1;
import androidx.lifecycle.k0;
import bu.j1;
import com.appboy.Constants;
import com.photoroom.features.edit_mask.ui.EditMaskActivity;
import com.photoroom.features.edit_project.ui.EditProjectActivity;
import com.photoroom.features.help_center.ui.HelpCenterActivity;
import com.photoroom.features.home.ui.HomeActivity;
import com.photoroom.models.RemoteTemplateCategory;
import com.photoroom.models.User;
import com.sun.jna.Function;
import java.util.ArrayList;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.c0;
import kotlin.jvm.internal.o0;
import kotlin.jvm.internal.t0;
import op.o;
import px.b0;
import px.f1;
import px.m0;
import px.z;
import vm.n1;
import w7.e0;
@g1.n
@t0
@Metadata(d1 = {"\u0000º\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\r\b\u0007\u0018\u00002\u00020\u00012\u00020\u0002:\u0001dB\u0007¢\u0006\u0004\bb\u0010cJ\u000e\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0003J\b\u0010\u0007\u001a\u00020\u0003H\u0016J$\u0010\u000f\u001a\u00020\u000e2\u0006\u0010\t\u001a\u00020\b2\b\u0010\u000b\u001a\u0004\u0018\u00010\n2\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0016J\u001a\u0010\u0011\u001a\u00020\u00052\u0006\u0010\u0010\u001a\u00020\u000e2\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0016J\b\u0010\u0012\u001a\u00020\u0005H\u0016J\u0006\u0010\u0013\u001a\u00020\u0005J\u0010\u0010\u0016\u001a\u00020\u00052\b\u0010\u0015\u001a\u0004\u0018\u00010\u0014J\u000e\u0010\u0019\u001a\u00020\u00052\u0006\u0010\u0018\u001a\u00020\u0017J\u0006\u0010\u001a\u001a\u00020\u0003J\u000e\u0010\u001b\u001a\u00020\u00052\u0006\u0010\u0018\u001a\u00020\u0017J\u0006\u0010\u001c\u001a\u00020\u0005J\u0010\u0010\u001e\u001a\u00020\u00052\u0006\u0010\u001d\u001a\u00020\u0003H\u0002J\b\u0010\u001f\u001a\u00020\u0005H\u0002J\b\u0010 \u001a\u00020\u0005H\u0002J\b\u0010!\u001a\u00020\u0005H\u0002J\u0010\u0010$\u001a\u00020\u00052\u0006\u0010#\u001a\u00020\"H\u0002J\u0010\u0010&\u001a\u00020\u00052\u0006\u0010%\u001a\u00020\u000eH\u0002J.\u0010,\u001a\u00020\u00032\u0006\u0010\u0018\u001a\u00020\u00172\u0006\u0010'\u001a\u00020\u000e2\b\u0010)\u001a\u0004\u0018\u00010(2\n\b\u0002\u0010+\u001a\u0004\u0018\u00010*H\u0002J\b\u0010-\u001a\u00020\u0005H\u0002R\u0018\u00101\u001a\u0004\u0018\u00010.8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b/\u00100R\u001b\u00107\u001a\u0002028BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b3\u00104\u001a\u0004\b5\u00106R\u0016\u0010;\u001a\u0002088\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b9\u0010:R\u0014\u0010?\u001a\u00020<8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b=\u0010>R\u0018\u0010C\u001a\u0004\u0018\u00010@8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bA\u0010BR\u0018\u0010G\u001a\u0004\u0018\u00010D8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bE\u0010FR&\u0010L\u001a\u0012\u0012\u0004\u0012\u0002080Hj\b\u0012\u0004\u0012\u000208`I8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bJ\u0010KR]\u0010V\u001aK\u0012\u0013\u0012\u00110N¢\u0006\f\bO\u0012\b\bP\u0012\u0004\b\b(Q\u0012\u0013\u0012\u00110\u0017¢\u0006\f\bO\u0012\b\bP\u0012\u0004\b\b(\u0018\u0012\u0013\u0012\u00110\u0003¢\u0006\f\bO\u0012\b\bP\u0012\u0004\b\b(R\u0012\u0004\u0012\u00020\u00050Mj\u0002`S8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bT\u0010URv\u0010[\u001ad\u0012\u0013\u0012\u00110\u0017¢\u0006\f\bO\u0012\b\bP\u0012\u0004\b\b(\u0018\u0012\u0013\u0012\u00110\u000e¢\u0006\f\bO\u0012\b\bP\u0012\u0004\b\b('\u0012\u0015\u0012\u0013\u0018\u00010(¢\u0006\f\bO\u0012\b\bP\u0012\u0004\b\b()\u0012\u0015\u0012\u0013\u0018\u00010*¢\u0006\f\bO\u0012\b\bP\u0012\u0004\b\b(+\u0012\u0004\u0012\u00020\u00030Wj\u0002`X8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bY\u0010ZR\u0013\u0010^\u001a\u0004\u0018\u00010\u000e8F¢\u0006\u0006\u001a\u0004\b\\\u0010]R\u0014\u0010a\u001a\u00020.8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b_\u0010`¨\u0006e"}, d2 = {"Lop/l;", "Landroidx/fragment/app/Fragment;", "Lsu/a;", "", "isVisible", "Lpx/f1;", "c0", "V", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "onDestroy", "P", "Lan/a;", "backgroundRemoverArtifact", "b0", "Lct/c;", "template", "K", "L", "X", "a0", "shouldApplyLongDelay", "Z", "W", "M", "N", "Lcom/photoroom/models/RemoteTemplateCategory;", "category", "O", "sharedView", "Q", "cardView", "Landroid/graphics/Bitmap;", "templateBitmap", "Landroid/graphics/Rect;", "bounds", "Y", "R", "Lvm/n1;", Constants.APPBOY_PUSH_PRIORITY_KEY, "Lvm/n1;", "_binding", "Lop/o;", "q", "Lpx/x;", "U", "()Lop/o;", "viewModel", "Lop/l$a;", "r", "Lop/l$a;", "currentScreen", "Lop/f;", Constants.APPBOY_PUSH_SUMMARY_TEXT_KEY, "Lop/f;", "categoriesFragment", "Lop/j;", Constants.APPBOY_PUSH_TITLE_KEY, "Lop/j;", "categoryDetailsFragment", "Lop/m;", "u", "Lop/m;", "searchFragment", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "v", "Ljava/util/ArrayList;", "screenStack", "Lkotlin/Function3;", "Ldu/a;", "Lpx/i0;", "name", "categoryCell", "isAttached", "Lcom/photoroom/features/home/tab_create/data/cell/OnTemplateDisplayUpdated;", "w", "Lhy/q;", "onTemplateDisplayUpdated", "Lkotlin/Function4;", "Lcom/photoroom/features/home/tab_create/data/cell/OnTemplateSelected;", "x", "Lhy/r;", "onTemplateSelected", "T", "()Landroid/view/View;", "previewView", "S", "()Lvm/n1;", "binding", "<init>", "()V", Constants.APPBOY_PUSH_CONTENT_KEY, "app_release"}, k = 1, mv = {1, 9, 0})
public final class l extends Fragment implements su.a {
private n1 f62880p;
private final px.x f62881q;
private a f62882r;
private final op.f f62883s;
private op.j f62884t;
private op.m f62885u;
private ArrayList f62886v;
private final hy.q f62887w;
private final hy.r f62888x;
public static final class a {
public static final a f62889b = new a("CATEGORIES", 0);
public static final a f62890c = new a("CATEGORY_DETAILS", 1);
public static final a f62891d = new a("SEARCH", 2);
private static final a[] f62892e;
private static final wx.a f62893f;
static {
a[] a11 = a();
f62892e = a11;
f62893f = wx.b.a(a11);
}
private a(String str, int i11) {
}
private static final a[] a() {
return new a[]{f62889b, f62890c, f62891d};
}
public static a valueOf(String str) {
return (a) Enum.valueOf(a.class, str);
}
public static a[] values() {
return (a[]) f62892e.clone();
}
}
public class b {
public static final int[] f62894a;
static {
int[] iArr = new int[a.values().length];
try {
iArr[a.f62890c.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[a.f62891d.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[a.f62889b.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
f62894a = iArr;
}
}
public static final class c extends kotlin.jvm.internal.v implements hy.l {
c() {
super(1);
}
public final void a(EditMaskActivity.b result) {
kotlin.jvm.internal.t.i(result, "result");
if ((result instanceof EditMaskActivity.b.C0484b ? (EditMaskActivity.b.C0484b) result : null) != null) {
EditMaskActivity.b.C0484b c0484b = (EditMaskActivity.b.C0484b) result;
l.this.U().h4(new a.b(c0484b.a(), c0484b.a().g()));
}
}
@Override
public Object invoke(Object obj) {
a((EditMaskActivity.b) obj);
return f1.f64673a;
}
}
public static final class d extends kotlin.jvm.internal.v implements hy.a {
d() {
super(0);
}
@Override
public Object invoke() {
m14996invoke();
return f1.f64673a;
}
public final void m14996invoke() {
l.this.Z(true);
}
}
public static final class e extends kotlin.jvm.internal.v implements hy.l {
e() {
super(1);
}
public final void a(gm.b bVar) {
if (!(bVar instanceof o.a)) {
if (bVar instanceof o.c) {
l.this.O(((o.c) bVar).a());
return;
}
return;
}
op.m mVar = l.this.f62885u;
if (mVar != null) {
mVar.Q(((o.a) bVar).a());
}
}
@Override
public Object invoke(Object obj) {
a((gm.b) obj);
return f1.f64673a;
}
}
static final class f extends kotlin.jvm.internal.v implements hy.q {
public static final class a extends kotlin.jvm.internal.v implements hy.l {
final l f62899g;
final ct.c f62900h;
public class C1977a {
public static final int[] f62901a;
static {
int[] iArr = new int[a.values().length];
try {
iArr[a.f62889b.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[a.f62890c.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[a.f62891d.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
f62901a = iArr;
}
}
a(l lVar, ct.c cVar) {
super(1);
this.f62899g = lVar;
this.f62900h = cVar;
}
public final void b(Object obj) {
op.m mVar;
Throwable e11 = m0.e(obj);
if (e11 != null) {
t50.a.f72680a.c(e11);
return;
}
int i11 = C1977a.f62901a[this.f62899g.f62882r.ordinal()];
if (i11 != 2) {
if (i11 == 3 && (mVar = this.f62899g.f62885u) != null) {
mVar.N(this.f62900h);
return;
}
return;
}
op.j jVar = this.f62899g.f62884t;
if (jVar != null) {
jVar.T(this.f62900h);
}
}
@Override
public Object invoke(Object obj) {
b(((m0) obj).j());
return f1.f64673a;
}
}
f() {
super(3);
}
public final void a(du.a aVar, ct.c template, boolean z11) {
kotlin.jvm.internal.t.i(aVar, "<anonymous parameter 0>");
kotlin.jvm.internal.t.i(template, "template");
if (l.this.f62882r == a.f62889b) {
return;
}
l.this.U().W3(template, z11, l.this.f62882r == a.f62890c, new a(l.this, template));
}
@Override
public Object invoke(Object obj, Object obj2, Object obj3) {
a((du.a) obj, (ct.c) obj2, ((Boolean) obj3).booleanValue());
return f1.f64673a;
}
}
static final class g extends kotlin.jvm.internal.v implements hy.r {
g() {
super(4);
}
@Override
public final Boolean invoke(ct.c template, View templateCardView, Bitmap bitmap, Rect rect) {
kotlin.jvm.internal.t.i(template, "template");
kotlin.jvm.internal.t.i(templateCardView, "templateCardView");
boolean z11 = false;
if (template.n()) {
androidx.fragment.app.s activity = l.this.getActivity();
HomeActivity homeActivity = activity instanceof HomeActivity ? (HomeActivity) activity : null;
if (homeActivity != null) {
homeActivity.G1();
}
} else if (!template.l()) {
z11 = l.this.Y(template, templateCardView, bitmap, rect);
} else if (l.this.U().v4()) {
z11 = l.this.Y(template, templateCardView, bitmap, rect);
} else {
androidx.fragment.app.s activity2 = l.this.getActivity();
HomeActivity homeActivity2 = activity2 instanceof HomeActivity ? (HomeActivity) activity2 : null;
if (homeActivity2 != null) {
HomeActivity.Z0(homeActivity2, false, null, template, null, false, 27, null);
}
}
return Boolean.valueOf(z11);
}
}
static final class h extends kotlin.jvm.internal.v implements hy.a {
h() {
super(0);
}
@Override
public final Boolean invoke() {
return Boolean.valueOf(l.this.U().v4());
}
}
static final class i extends kotlin.jvm.internal.v implements hy.a {
i() {
super(0);
}
@Override
public Object invoke() {
m14997invoke();
return f1.f64673a;
}
public final void m14997invoke() {
w7.e.K1(w7.f.a(), null, 1, null);
androidx.fragment.app.s activity = l.this.getActivity();
HomeActivity homeActivity = activity instanceof HomeActivity ? (HomeActivity) activity : null;
if (homeActivity != null) {
HomeActivity.Z0(homeActivity, false, null, null, null, false, 31, null);
}
}
}
static final class j extends kotlin.jvm.internal.v implements hy.a {
j() {
super(0);
}
@Override
public Object invoke() {
m14998invoke();
return f1.f64673a;
}
public final void m14998invoke() {
l.this.b0(null);
}
}
static final class k extends kotlin.jvm.internal.v implements hy.l {
k() {
super(1);
}
public final void a(View searchView) {
kotlin.jvm.internal.t.i(searchView, "searchView");
l.this.Q(searchView);
}
@Override
public Object invoke(Object obj) {
a((View) obj);
return f1.f64673a;
}
}
static final class C1978l extends kotlin.jvm.internal.v implements hy.l {
C1978l() {
super(1);
}
@Override
public Object invoke(Object obj) {
invoke((String) obj);
return f1.f64673a;
}
public final void invoke(String str) {
kotlin.jvm.internal.t.f(str);
if (str.length() > 0) {
if (!l.this.L()) {
l.this.U().R3(true);
}
User.INSTANCE.getIdentifier().removeObservers(l.this.getViewLifecycleOwner());
}
}
}
static final class m extends kotlin.jvm.internal.v implements hy.l {
m() {
super(1);
}
public final void a(s1 insets) {
kotlin.jvm.internal.t.i(insets, "insets");
List<Fragment> y02 = l.this.getChildFragmentManager().y0();
kotlin.jvm.internal.t.h(y02, "getFragments(...)");
for (Fragment fragment : y02) {
View view = fragment.getView();
if (view != null) {
r0.g(view, insets);
}
}
}
@Override
public Object invoke(Object obj) {
a((s1) obj);
return f1.f64673a;
}
}
class n extends kotlin.jvm.internal.q implements hy.a {
n(Object obj) {
super(0, obj, l.class, "editCutout", "editCutout()V", 0);
}
@Override
public Object invoke() {
m14999invoke();
return f1.f64673a;
}
public final void m14999invoke() {
((l) this.receiver).R();
}
}
static final class o extends kotlin.jvm.internal.v implements hy.l {
o() {
super(1);
}
public final void a(RemoteTemplateCategory category) {
op.m mVar;
kotlin.jvm.internal.t.i(category, "category");
if (l.this.f62882r == a.f62891d && (mVar = l.this.f62885u) != null) {
mVar.H();
}
l.this.O(category);
}
@Override
public Object invoke(Object obj) {
a((RemoteTemplateCategory) obj);
return f1.f64673a;
}
}
static final class p extends kotlin.jvm.internal.v implements hy.l {
public class a {
public static final int[] f62911a;
static {
int[] iArr = new int[lp.a.values().length];
try {
iArr[lp.a.f57408e.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[lp.a.f57409f.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[lp.a.f57410g.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
iArr[lp.a.f57411h.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
iArr[lp.a.f57412i.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
f62911a = iArr;
}
}
p() {
super(1);
}
public final void a(lp.a tool) {
kotlin.jvm.internal.t.i(tool, "tool");
int i11 = a.f62911a[tool.ordinal()];
if (i11 == 1) {
androidx.fragment.app.s activity = l.this.getActivity();
HomeActivity homeActivity = activity instanceof HomeActivity ? (HomeActivity) activity : null;
if (homeActivity != null) {
HomeActivity.Z0(homeActivity, false, null, null, tool, false, 23, null);
}
} else if (i11 == 2 || i11 == 3 || i11 == 4) {
androidx.fragment.app.s activity2 = l.this.getActivity();
HomeActivity homeActivity2 = activity2 instanceof HomeActivity ? (HomeActivity) activity2 : null;
if (homeActivity2 != null) {
HomeActivity.Z0(homeActivity2, false, null, null, tool, false, 23, null);
}
} else if (i11 != 5) {
} else {
androidx.fragment.app.s activity3 = l.this.getActivity();
HomeActivity homeActivity3 = activity3 instanceof HomeActivity ? (HomeActivity) activity3 : null;
if (homeActivity3 != null) {
HomeActivity.Z0(homeActivity3, false, null, null, tool, false, 23, null);
}
}
}
@Override
public Object invoke(Object obj) {
a((lp.a) obj);
return f1.f64673a;
}
}
static final class q extends kotlin.jvm.internal.v implements hy.a {
q() {
super(0);
}
@Override
public Object invoke() {
m15000invoke();
return f1.f64673a;
}
public final void m15000invoke() {
l.this.P();
}
}
static final class r extends kotlin.jvm.internal.v implements hy.p {
r() {
super(2);
}
public final void a(ct.c template, Bitmap preview) {
Intent b11;
kotlin.jvm.internal.t.i(template, "template");
kotlin.jvm.internal.t.i(preview, "preview");
Context context = l.this.getContext();
if (context == null) {
return;
}
b11 = EditProjectActivity.f34387x.b(context, es.m.f43337b, template, (r29 & 8) != 0 ? null : null, (r29 & 16) != 0 ? null : preview, (r29 & 32) != 0 ? null : null, (r29 & 64) != 0 ? null : null, (r29 & 128) != 0, (r29 & Function.MAX_NARGS) != 0 ? false : false, (r29 & 512) != 0 ? false : false, (r29 & 1024) != 0 ? false : false, (r29 & 2048) != 0 ? null : e0.e.f78769e);
context.startActivity(b11);
}
@Override
public Object invoke(Object obj, Object obj2) {
a((ct.c) obj, (Bitmap) obj2);
return f1.f64673a;
}
}
static final class s extends kotlin.jvm.internal.v implements hy.a {
s() {
super(0);
}
@Override
public Object invoke() {
m15001invoke();
return f1.f64673a;
}
public final void m15001invoke() {
l.this.startActivity(new Intent(l.this.getActivity(), HelpCenterActivity.class));
}
}
static final class t extends kotlin.jvm.internal.v implements hy.a {
t() {
super(0);
}
@Override
public Object invoke() {
m15002invoke();
return f1.f64673a;
}
public final void m15002invoke() {
Intent data = new Intent("android.intent.action.VIEW").setData(Uri.parse("https://www.instagram.com/photoroom/"));
kotlin.jvm.internal.t.h(data, "setData(...)");
l.this.startActivity(data);
}
}
static final class u extends kotlin.jvm.internal.v implements hy.a {
u() {
super(0);
}
@Override
public Object invoke() {
m15003invoke();
return f1.f64673a;
}
public final void m15003invoke() {
androidx.fragment.app.s activity = l.this.getActivity();
HomeActivity homeActivity = activity instanceof HomeActivity ? (HomeActivity) activity : null;
if (homeActivity != null) {
homeActivity.d1(au.i.f12420t);
}
}
}
public static final class v implements k0, kotlin.jvm.internal.n {
private final hy.l f62917b;
v(hy.l function) {
kotlin.jvm.internal.t.i(function, "function");
this.f62917b = function;
}
@Override
public final void a(Object obj) {
this.f62917b.invoke(obj);
}
@Override
public final px.r b() {
return this.f62917b;
}
public final boolean equals(Object obj) {
if ((obj instanceof k0) && (obj instanceof kotlin.jvm.internal.n)) {
return kotlin.jvm.internal.t.d(b(), ((kotlin.jvm.internal.n) obj).b());
}
return false;
}
public final int hashCode() {
return b().hashCode();
}
}
public static final class w extends kotlin.jvm.internal.v implements hy.a {
final Fragment f62918g;
public w(Fragment fragment) {
super(0);
this.f62918g = fragment;
}
@Override
public final androidx.fragment.app.s invoke() {
androidx.fragment.app.s requireActivity = this.f62918g.requireActivity();
kotlin.jvm.internal.t.h(requireActivity, "requireActivity()");
return requireActivity;
}
}
public static final class x extends kotlin.jvm.internal.v implements hy.a {
final Fragment f62919g;
final s40.a f62920h;
final hy.a f62921i;
final hy.a f62922j;
final hy.a f62923k;
public x(Fragment fragment, s40.a aVar, hy.a aVar2, hy.a aVar3, hy.a aVar4) {
super(0);
this.f62919g = fragment;
this.f62920h = aVar;
this.f62921i = aVar2;
this.f62922j = aVar3;
this.f62923k = aVar4;
}
@Override
public final b1 invoke() {
m4.a defaultViewModelCreationExtras;
b1 a11;
Fragment fragment = this.f62919g;
s40.a aVar = this.f62920h;
hy.a aVar2 = this.f62921i;
hy.a aVar3 = this.f62922j;
hy.a aVar4 = this.f62923k;
g1 viewModelStore = ((h1) aVar2.invoke()).getViewModelStore();
if (aVar3 == null || (defaultViewModelCreationExtras = (m4.a) aVar3.invoke()) == null) {
defaultViewModelCreationExtras = fragment.getDefaultViewModelCreationExtras();
kotlin.jvm.internal.t.h(defaultViewModelCreationExtras, "this.defaultViewModelCreationExtras");
}
a11 = c40.a.a(o0.b(op.o.class), viewModelStore, (r16 & 4) != 0 ? null : null, defaultViewModelCreationExtras, (r16 & 16) != 0 ? null : aVar, x30.a.a(fragment), (r16 & 64) != 0 ? null : aVar4);
return a11;
}
}
public l() {
px.x b11;
b11 = z.b(b0.f64658d, new x(this, null, new w(this), null, null));
this.f62881q = b11;
this.f62882r = a.f62889b;
this.f62883s = op.f.E.a();
this.f62886v = new ArrayList();
this.f62887w = new f();
this.f62888x = new g();
}
private final void M() {
this.f62886v.clear();
f0 childFragmentManager = getChildFragmentManager();
kotlin.jvm.internal.t.h(childFragmentManager, "getChildFragmentManager(...)");
q0 p11 = childFragmentManager.p();
kotlin.jvm.internal.t.h(p11, "beginTransaction()");
List<Fragment> y02 = getChildFragmentManager().y0();
kotlin.jvm.internal.t.h(y02, "getFragments(...)");
for (Fragment fragment : y02) {
p11.s(fragment);
}
p11.k();
}
private final void N() {
f0 childFragmentManager = getChildFragmentManager();
kotlin.jvm.internal.t.h(childFragmentManager, "getChildFragmentManager(...)");
q0 p11 = childFragmentManager.p();
kotlin.jvm.internal.t.h(p11, "beginTransaction()");
p11.w(true);
getChildFragmentManager().g1();
p11.c(em.g.A6, this.f62883s, "home_create_categories_fragment");
this.f62882r = a.f62889b;
p11.k();
}
public final void O(RemoteTemplateCategory remoteTemplateCategory) {
U().s3();
boolean v42 = U().v4();
op.j a11 = op.j.f62849y.a();
a11.V(this.f62887w);
a11.W(this.f62888x);
a11.I(remoteTemplateCategory, v42);
this.f62884t = a11;
this.f62883s.X(false);
f0 childFragmentManager = getChildFragmentManager();
kotlin.jvm.internal.t.h(childFragmentManager, "getChildFragmentManager(...)");
q0 p11 = childFragmentManager.p();
kotlin.jvm.internal.t.h(p11, "beginTransaction()");
p11.w(true);
p11.c(em.g.A6, a11, "home_create_category_details_fragment");
if (this.f62882r == a.f62889b) {
p11.q(this.f62883s);
}
p11.h("home_create_category_details_fragment");
a aVar = a.f62890c;
this.f62882r = aVar;
this.f62886v.add(aVar);
p11.k();
op.f.U(this.f62883s, 0L, null, 3, null);
}
public final void Q(View view) {
U().s3();
op.m a11 = op.m.f62924w.a();
a11.P(U());
this.f62885u = a11;
this.f62883s.X(true);
f0 childFragmentManager = getChildFragmentManager();
kotlin.jvm.internal.t.h(childFragmentManager, "getChildFragmentManager(...)");
q0 p11 = childFragmentManager.p();
kotlin.jvm.internal.t.h(p11, "beginTransaction()");
p11.w(true);
p11.g(view, "search_layout");
p11.c(em.g.A6, a11, "home_create_search_fragment");
if (this.f62882r == a.f62889b) {
p11.q(this.f62883s);
}
p11.h("home_create_search_fragment");
a aVar = a.f62891d;
this.f62882r = aVar;
this.f62886v.add(aVar);
p11.k();
op.f.U(this.f62883s, 0L, null, 3, null);
}
public final void R() {
com.photoroom.models.d F3 = U().F3();
if (F3 != null) {
EditMaskActivity.a aVar = EditMaskActivity.f34187j;
Context requireContext = requireContext();
kotlin.jvm.internal.t.h(requireContext, "requireContext(...)");
startActivity(aVar.a(requireContext, F3, new c()));
}
}
private final n1 S() {
n1 n1Var = this.f62880p;
kotlin.jvm.internal.t.f(n1Var);
return n1Var;
}
public final op.o U() {
return (op.o) this.f62881q.getValue();
}
private final void W() {
U().J3().observe(getViewLifecycleOwner(), new v(new e()));
}
public final boolean Y(ct.c cVar, View view, Bitmap bitmap, Rect rect) {
Intent b11;
androidx.fragment.app.s activity = getActivity();
if (activity == null) {
return false;
}
if (!cVar.U()) {
K(cVar);
}
cVar.k0(U().v4());
if (cVar.S() || cVar.J() != null) {
U().V3(cVar);
}
if (cVar.U()) {
U().U3(cVar);
}
b11 = EditProjectActivity.f34387x.b(activity, cVar.E(), cVar, (r29 & 8) != 0 ? null : U().F3(), (r29 & 16) != 0 ? null : bitmap, (r29 & 32) != 0 ? null : rect, (r29 & 64) != 0 ? null : null, (r29 & 128) != 0, (r29 & Function.MAX_NARGS) != 0 ? false : true, (r29 & 512) != 0 ? false : false, (r29 & 1024) != 0 ? false : false, (r29 & 2048) != 0 ? null : cVar.U() ? e0.e.f78770f : U().v4() ? e0.e.f78768d : e0.e.f78767c);
startActivity(b11, ActivityOptions.makeSceneTransitionAnimation(activity, Pair.create(view, getString(em.l.f42496ec))).toBundle());
return true;
}
public final void Z(boolean z11) {
Object F0;
this.f62883s.X(z11);
kotlin.collections.z.O(this.f62886v);
F0 = c0.F0(this.f62886v);
a aVar = (a) F0;
if (aVar == null) {
aVar = a.f62889b;
}
this.f62882r = aVar;
getChildFragmentManager().g1();
if (this.f62882r == a.f62889b) {
this.f62883s.h0(z11);
}
}
public final void K(ct.c template) {
kotlin.jvm.internal.t.i(template, "template");
Context context = getContext();
if (context == null || template.S() || template.J() != null) {
return;
}
U().o3(context, template);
}
public final boolean L() {
HomeActivity.a aVar = HomeActivity.f35133u;
String a11 = aVar.a();
if (a11 != null) {
U().T3(a11);
aVar.g(null);
return true;
}
return false;
}
public final void P() {
HomeActivity homeActivity;
if (iu.c.i(iu.c.f51740b, iu.d.H, false, 2, null) && !au.d.f12341b.A()) {
androidx.fragment.app.s activity = getActivity();
homeActivity = activity instanceof HomeActivity ? (HomeActivity) activity : null;
if (homeActivity != null) {
homeActivity.d1(au.i.f12420t);
return;
}
return;
}
U().s3();
androidx.fragment.app.s activity2 = getActivity();
homeActivity = activity2 instanceof HomeActivity ? (HomeActivity) activity2 : null;
if (homeActivity != null) {
homeActivity.w1(U().F3());
}
}
public final View T() {
return U().w3();
}
public boolean V() {
int i11 = b.f62894a[this.f62882r.ordinal()];
if (i11 == 1) {
Z(false);
return true;
} else if (i11 != 2) {
if (U().F3() != null) {
b0(null);
return true;
}
return false;
} else {
op.m mVar = this.f62885u;
if (mVar != null) {
mVar.L(new d());
}
return true;
}
}
public final void X(ct.c template) {
Intent b11;
kotlin.jvm.internal.t.i(template, "template");
Context context = getContext();
if (context == null) {
return;
}
b11 = EditProjectActivity.f34387x.b(context, es.m.f43337b, template, (r29 & 8) != 0 ? null : U().F3(), (r29 & 16) != 0 ? null : null, (r29 & 32) != 0 ? null : null, (r29 & 64) != 0 ? null : null, (r29 & 128) != 0, (r29 & Function.MAX_NARGS) != 0 ? false : false, (r29 & 512) != 0 ? false : false, (r29 & 1024) != 0 ? false : false, (r29 & 2048) != 0 ? null : U().v4() ? e0.e.f78768d : e0.e.f78767c);
startActivity(b11);
}
public final void a0() {
int i11 = b.f62894a[this.f62882r.ordinal()];
if (i11 == 1) {
op.j jVar = this.f62884t;
if (jVar != null) {
jVar.U();
}
} else if (i11 != 2) {
if (i11 != 3) {
return;
}
this.f62883s.Y();
} else {
op.m mVar = this.f62885u;
if (mVar != null) {
mVar.O();
}
}
}
public final void b0(an.a aVar) {
U().h4(aVar);
}
public final void c0(boolean z11) {
this.f62883s.n0(z11);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
kotlin.jvm.internal.t.i(inflater, "inflater");
this.f62880p = n1.c(inflater, viewGroup, false);
ConstraintLayout root = S().getRoot();
kotlin.jvm.internal.t.h(root, "getRoot(...)");
return root;
}
@Override
public void onDestroy() {
super.onDestroy();
this.f62880p = null;
}
@Override
public void onViewCreated(View view, Bundle bundle) {
an.a f12;
kotlin.jvm.internal.t.i(view, "view");
super.onViewCreated(view, bundle);
j1.e(view, new m());
U().s4(this.f62888x);
U().r4(this.f62887w);
U().k4(new n(this));
U().j4(new o());
U().q4(new p());
U().o4(new q());
U().p4(new r());
U().m4(new s());
U().n4(new t());
U().l4(new u());
U().M3();
this.f62883s.e0(this.f62888x);
this.f62883s.d0(this.f62887w);
this.f62883s.g0(new h());
this.f62883s.c0(new i());
this.f62883s.a0(new j());
this.f62883s.b0(new k());
W();
M();
N();
androidx.fragment.app.s activity = getActivity();
HomeActivity homeActivity = activity instanceof HomeActivity ? (HomeActivity) activity : null;
if (homeActivity != null && (f12 = homeActivity.f1()) != null) {
b0(f12);
}
User.INSTANCE.getIdentifier().observe(getViewLifecycleOwner(), new v(new C1978l()));
}
}