Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f

以下内容为反编译后的 AdvertInsertionFragment.java 源代码,内容仅作参考


package by.kufar.adinsert.ui.adinsertion;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Spannable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ViewAnimator;
import androidx.autofill.HintConstants;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import androidx.core.os.BundleKt;
import androidx.core.view.ViewGroupKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.graphics.result.ActivityResult;
import androidx.graphics.result.ActivityResultCallback;
import androidx.graphics.result.ActivityResultLauncher;
import androidx.graphics.result.contract.ActivityResultContracts;
import androidx.lifecycle.HasDefaultViewModelProviderFactory;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.navigation.compose.DialogNavigator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import by.kufar.adinsert.R$id;
import by.kufar.adinsert.R$layout;
import by.kufar.adinsert.R$string;
import by.kufar.adinsert.backend.entity.LimitErrorInfo;
import by.kufar.adinsert.ui.adinsertion.AdvertInsertVM;
import by.kufar.adinsert.ui.adinsertion.adapter.AdvertInsertController;
import by.kufar.adinsert.ui.adinsertion.data.entity.ParamCheckedValue;
import by.kufar.adinsert.ui.category.CategoryActivity;
import by.kufar.adinsert.ui.category.data.CategoryEntity;
import by.kufar.adinsert.ui.category.data.ParentEntity;
import by.kufar.adinsert.ui.imageviewer.ImageViewerActivity;
import by.kufar.adinsert.ui.success.InsertSuccessActivity;
import by.kufar.core.android.fragment.BaseFragment;
import by.kufar.mediator.api.realtmap.GeoObjectResult;
import by.kufar.mediator.widget.PromotePackagesWidget;
import by.kufar.photopicker.ui.PhotoPickerActivity;
import by.kufar.re.ui.data.CheckedValue;
import by.kufar.re.ui.widget.bottomsheet.BaseBottomSheetFragment;
import by.kufar.re.ui.widget.bottomsheet.BottomSheetCheckboxesButtonsFragment;
import by.kufar.re.ui.widget.bottomsheet.BottomSheetRadioButtonsFragment;
import by.kufar.re.ui.widget.dialog.AlertKufarDialogFragment;
import by.kufar.re.ui.widget.error.ErrorView;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import by.kufar.sharedmodels.entity.LocalizedValue;
import by.kufar.sharedmodels.entity.SpanContent;
import by.kufar.taxonomy.backend.entity.ParameterValueItem;
import com.google.android.material.snackbar.Snackbar;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import com.tapjoy.TJAdUnitConstants;
import com.tapjoy.TapjoyConstants;
import d0.d;
import db.SelectedValue;
import db.h0;
import db.s0;
import f0.a;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import k6.d;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.o0;
import kotlin.reflect.KProperty;
import m0.a;
import m0.c;
import p0.SuggestionValue;
import xn.b;
import ym.LimitPackageType;

@Metadata(d1 = {"\u0000Þ\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\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\u0002\b\u000f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\r\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\t\n\u0002\b\u000e\n\u0002\u0018\u0002\n\u0002\b\u000e\u0018\u0000 ã\u00012\u00020\u00012\u00020\u0002:\u0002ä\u0001B\t¢\u0006\u0006\bá\u0001\u0010â\u0001J\u0012\u0010\u0006\u001a\u00020\u00052\b\u0010\u0004\u001a\u0004\u0018\u00010\u0003H\u0002J\u0012\u0010\u0007\u001a\u00020\u00052\b\u0010\u0004\u001a\u0004\u0018\u00010\u0003H\u0002J\u0012\u0010\b\u001a\u00020\u00052\b\u0010\u0004\u001a\u0004\u0018\u00010\u0003H\u0002J\u0012\u0010\t\u001a\u00020\u00052\b\u0010\u0004\u001a\u0004\u0018\u00010\u0003H\u0002J\u0012\u0010\n\u001a\u00020\u00052\b\u0010\u0004\u001a\u0004\u0018\u00010\u0003H\u0002J\b\u0010\u000b\u001a\u00020\u0005H\u0002J\u0010\u0010\u000e\u001a\u00020\u00052\u0006\u0010\r\u001a\u00020\fH\u0002J\b\u0010\u000f\u001a\u00020\u0005H\u0002J\u0018\u0010\u0014\u001a\u00020\u00052\u0006\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u0013\u001a\u00020\u0012H\u0002J\u0010\u0010\u0016\u001a\u00020\u00052\u0006\u0010\u0007\u001a\u00020\u0015H\u0002J\u0010\u0010\u0018\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u0017H\u0002J\u0010\u0010\u001b\u001a\u00020\u00052\u0006\u0010\u001a\u001a\u00020\u0019H\u0002J\u0010\u0010\u001e\u001a\u00020\u00052\u0006\u0010\u001d\u001a\u00020\u001cH\u0002J\b\u0010\u001f\u001a\u00020\u0005H\u0002J\u0012\u0010\"\u001a\u00020\u00052\b\u0010!\u001a\u0004\u0018\u00010 H\u0016J&\u0010(\u001a\u0004\u0018\u00010'2\u0006\u0010$\u001a\u00020#2\b\u0010&\u001a\u0004\u0018\u00010%2\b\u0010!\u001a\u0004\u0018\u00010 H\u0016J\u001a\u0010*\u001a\u00020\u00052\u0006\u0010)\u001a\u00020'2\b\u0010!\u001a\u0004\u0018\u00010 H\u0016J\b\u0010+\u001a\u00020\u0005H\u0016J\b\u0010,\u001a\u00020\u0005H\u0016J\u0010\u0010.\u001a\u00020\u00052\u0006\u0010-\u001a\u00020\u0012H\u0016J\u0010\u0010/\u001a\u00020\u00052\u0006\u0010\u0011\u001a\u00020\u0010H\u0016J\u0010\u00100\u001a\u00020\u00052\u0006\u0010\u0011\u001a\u00020\u0010H\u0016J\u0010\u00101\u001a\u00020\u00052\u0006\u0010\u0011\u001a\u00020\u0010H\u0016J\u0010\u00102\u001a\u00020\u00052\u0006\u0010\u0011\u001a\u00020\u0010H\u0016J\u0010\u00103\u001a\u00020\u00052\u0006\u0010\u0011\u001a\u00020\u0010H\u0016J\u0018\u00106\u001a\u00020\u00052\u0006\u00104\u001a\u00020\u00122\u0006\u00105\u001a\u00020\u0012H\u0016J\u0018\u0010;\u001a\u00020\u00052\u0006\u00108\u001a\u0002072\u0006\u0010:\u001a\u000209H\u0016J\u0010\u0010>\u001a\u00020\u00052\u0006\u0010=\u001a\u00020<H\u0016J\u001e\u0010D\u001a\u00020\u00052\f\u0010A\u001a\b\u0012\u0004\u0012\u00020@0?2\u0006\u0010C\u001a\u00020BH\u0016J\u0010\u0010F\u001a\u00020\u00052\u0006\u0010E\u001a\u00020\u0019H\u0016J\u0010\u0010G\u001a\u00020\u00052\u0006\u0010=\u001a\u00020<H\u0016J\u0010\u0010G\u001a\u00020\u00052\u0006\u0010=\u001a\u00020HH\u0016J\u0010\u0010G\u001a\u00020\u00052\u0006\u0010=\u001a\u00020IH\u0016J\u0010\u0010J\u001a\u00020\u00052\u0006\u0010=\u001a\u00020HH\u0016J\u0010\u0010K\u001a\u00020\u00052\u0006\u0010=\u001a\u00020IH\u0016J\u0010\u0010N\u001a\u00020\u00052\u0006\u0010M\u001a\u00020LH\u0016J\u0010\u0010O\u001a\u00020\u00052\u0006\u0010M\u001a\u00020LH\u0016J\u0010\u0010R\u001a\u00020\u00052\u0006\u0010Q\u001a\u00020PH\u0016J\u0010\u0010S\u001a\u00020\u00052\u0006\u0010Q\u001a\u00020PH\u0016J\u0018\u0010V\u001a\u00020\u00052\u0006\u0010T\u001a\u00020\u00192\u0006\u0010C\u001a\u00020UH\u0016J\b\u0010W\u001a\u00020\u0005H\u0016J\u0018\u0010\\\u001a\u00020\u00052\u0006\u0010Y\u001a\u00020X2\u0006\u0010[\u001a\u00020ZH\u0016J\b\u0010]\u001a\u00020\u0005H\u0016J\b\u0010^\u001a\u00020\u0005H\u0016J\"\u0010a\u001a\u00020\u00052\b\u0010_\u001a\u0004\u0018\u00010X2\u0006\u0010\u0013\u001a\u00020\u00122\u0006\u0010C\u001a\u00020`H\u0016J\b\u0010b\u001a\u00020\u0005H\u0016J\u001a\u0010c\u001a\u00020\u00052\u0006\u0010C\u001a\u00020`2\b\u0010[\u001a\u0004\u0018\u00010XH\u0016J\u001a\u0010c\u001a\u00020\u00052\u0006\u0010C\u001a\u00020d2\b\u0010[\u001a\u0004\u0018\u00010XH\u0016J\u0010\u0010g\u001a\u00020\u00052\u0006\u0010f\u001a\u00020eH\u0016J\u0010\u0010h\u001a\u00020\u00052\u0006\u0010T\u001a\u00020\u0019H\u0016J\b\u0010i\u001a\u00020\u0005H\u0016J\b\u0010j\u001a\u00020\u0005H\u0016J\u0010\u0010l\u001a\u00020\u00052\u0006\u0010k\u001a\u00020XH\u0016J\u0010\u0010o\u001a\u00020\u00052\u0006\u0010n\u001a\u00020mH\u0016J\u0012\u0010o\u001a\u00020\u00052\b\u0010p\u001a\u0004\u0018\u00010XH\u0016J\b\u0010q\u001a\u00020\u0005H\u0016J\b\u0010r\u001a\u00020\u0005H\u0016J\u001e\u0010s\u001a\u00020\u00052\f\u0010A\u001a\b\u0012\u0004\u0012\u00020@0?2\u0006\u0010C\u001a\u00020BH\u0016J\u0010\u0010v\u001a\u00020\u00052\u0006\u0010u\u001a\u00020tH\u0016J\u0010\u0010y\u001a\u00020\u00052\u0006\u0010x\u001a\u00020wH\u0016R#\u0010{\u001a\u00020z8\u0006@\u0006X\u0087.¢\u0006\u0013\n\u0004\b{\u0010|\u001a\u0004\b}\u0010~\"\u0005\b\u007f\u0010\u0080\u0001R*\u0010\u0082\u0001\u001a\u00030\u0081\u00018\u0006@\u0006X\u0087.¢\u0006\u0018\n\u0006\b\u0082\u0001\u0010\u0083\u0001\u001a\u0006\b\u0084\u0001\u0010\u0085\u0001\"\u0006\b\u0086\u0001\u0010\u0087\u0001R*\u0010\u0089\u0001\u001a\u00030\u0088\u00018\u0006@\u0006X\u0087.¢\u0006\u0018\n\u0006\b\u0089\u0001\u0010\u008a\u0001\u001a\u0006\b\u008b\u0001\u0010\u008c\u0001\"\u0006\b\u008d\u0001\u0010\u008e\u0001R*\u0010\u0090\u0001\u001a\u00030\u008f\u00018\u0006@\u0006X\u0087.¢\u0006\u0018\n\u0006\b\u0090\u0001\u0010\u0091\u0001\u001a\u0006\b\u0092\u0001\u0010\u0093\u0001\"\u0006\b\u0094\u0001\u0010\u0095\u0001R*\u0010\u0097\u0001\u001a\u00030\u0096\u00018\u0006@\u0006X\u0087.¢\u0006\u0018\n\u0006\b\u0097\u0001\u0010\u0098\u0001\u001a\u0006\b\u0099\u0001\u0010\u009a\u0001\"\u0006\b\u009b\u0001\u0010\u009c\u0001R!\u0010¢\u0001\u001a\u00030\u009d\u00018BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b\u009e\u0001\u0010\u009f\u0001\u001a\u0006\b \u0001\u0010¡\u0001R \u0010¦\u0001\u001a\u00020'8BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b£\u0001\u0010\u009f\u0001\u001a\u0006\b¤\u0001\u0010¥\u0001R \u0010©\u0001\u001a\u00020'8BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b§\u0001\u0010\u009f\u0001\u001a\u0006\b¨\u0001\u0010¥\u0001R!\u0010®\u0001\u001a\u00030ª\u00018BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b«\u0001\u0010\u009f\u0001\u001a\u0006\b¬\u0001\u0010\u00ad\u0001R!\u0010³\u0001\u001a\u00030¯\u00018BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b°\u0001\u0010\u009f\u0001\u001a\u0006\b±\u0001\u0010²\u0001R\"\u0010·\u0001\u001a\u0004\u0018\u00010'8BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b´\u0001\u0010µ\u0001\u001a\u0006\b¶\u0001\u0010¥\u0001R\u001c\u0010¹\u0001\u001a\u0005\u0018\u00010¸\u00018\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b¹\u0001\u0010º\u0001R!\u0010¿\u0001\u001a\u00030»\u00018BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b¼\u0001\u0010µ\u0001\u001a\u0006\b½\u0001\u0010¾\u0001R\u001a\u0010Á\u0001\u001a\u00030À\u00018\u0002@\u0002X\u0082.¢\u0006\b\n\u0006\bÁ\u0001\u0010Â\u0001R!\u0010Ç\u0001\u001a\u00030Ã\u00018BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\bÄ\u0001\u0010\u009f\u0001\u001a\u0006\bÅ\u0001\u0010Æ\u0001R#\u0010Ì\u0001\u001a\u0005\u0018\u00010È\u00018BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\bÉ\u0001\u0010µ\u0001\u001a\u0006\bÊ\u0001\u0010Ë\u0001R \u0010Î\u0001\u001a\u00020\u00198BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\bÍ\u0001\u0010µ\u0001\u001a\u0006\bÎ\u0001\u0010Ï\u0001R#\u0010Ò\u0001\u001a\u0005\u0018\u00010È\u00018BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\bÐ\u0001\u0010µ\u0001\u001a\u0006\bÑ\u0001\u0010Ë\u0001R \u0010Ô\u0001\u001a\u00020\u00198BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\bÓ\u0001\u0010µ\u0001\u001a\u0006\bÔ\u0001\u0010Ï\u0001R \u0010Ö\u0001\u001a\u00020\u00198BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\bÕ\u0001\u0010µ\u0001\u001a\u0006\bÖ\u0001\u0010Ï\u0001R'\u0010Ù\u0001\u001a\u0012\u0012\r\u0012\u000b Ø\u0001*\u0004\u0018\u00010\u00030\u00030×\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\bÙ\u0001\u0010Ú\u0001R'\u0010Û\u0001\u001a\u0012\u0012\r\u0012\u000b Ø\u0001*\u0004\u0018\u00010\u00030\u00030×\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\bÛ\u0001\u0010Ú\u0001R'\u0010Ü\u0001\u001a\u0012\u0012\r\u0012\u000b Ø\u0001*\u0004\u0018\u00010\u00030\u00030×\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\bÜ\u0001\u0010Ú\u0001R'\u0010Ý\u0001\u001a\u0012\u0012\r\u0012\u000b Ø\u0001*\u0004\u0018\u00010\u00030\u00030×\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\bÝ\u0001\u0010Ú\u0001R'\u0010Þ\u0001\u001a\u0012\u0012\r\u0012\u000b Ø\u0001*\u0004\u0018\u00010\u00030\u00030×\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\bÞ\u0001\u0010Ú\u0001R'\u0010ß\u0001\u001a\u0012\u0012\r\u0012\u000b Ø\u0001*\u0004\u0018\u00010\u00030\u00030×\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\bß\u0001\u0010Ú\u0001R'\u0010à\u0001\u001a\u0012\u0012\r\u0012\u000b Ø\u0001*\u0004\u0018\u00010\u00030\u00030×\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\bà\u0001\u0010Ú\u0001¨\u0006å\u0001"}, d2 = {"Lby/kufar/adinsert/ui/adinsertion/AdvertInsertionFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "Lby/kufar/adinsert/ui/adinsertion/adapter/AdvertInsertController$a;", "Landroid/content/Intent;", "data", "", "chooseCategory", "chooseLocation", "chooseAddress", "loadPhotos", "changeUploadedPhoto", "setUpViewModel", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$f;", "state", "showState", "setUpBinding", "Lm0/c$b;", "image", "", "position", "openImage", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$c;", "openChooseLocation", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$b;", "openChooseAddress", "", "isShow", "showApplyProgress", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$d;", "success", "finishSuccess", "dismissBottomSheetDialog", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "onInject", "onResume", "maxCount", "onImageAddClick", "onDeleteClick", "onCancelClick", "onRetryCLick", "onErrorClick", "onImageClick", TypedValues.TransitionType.S_FROM, "to", "onMoveImage", "Lby/kufar/taxonomy/backend/entity/ParameterValueItem;", "parameterValueItem", "Lxn/b$f;", "currency", "onCurrencySelected", "Lm0/a$y;", "selectItem", "onSelectClick", "", "Lby/kufar/adinsert/ui/adinsertion/data/entity/ParamCheckedValue;", TJAdUnitConstants.String.USAGE_TRACKER_VALUES, "Lxn/b;", "parameterValue", "onChipsChanged", "isFree", "isFreePriceChanged", "onClearClick", "Lm0/a$z;", "Lm0/a$d;", "onSelectExternalClick", "onCategoryClick", "Lm0/a$r;", "location", "onLocationClick", "onLocationClear", "Lm0/a$a;", "address", "onAddressClick", "onAddressClear", "isChecked", "Lxn/b$a;", "onCheckedChanged", "onAddedPhone", "", "title", "", MimeTypes.BASE_TYPE_TEXT, "showHelperText", "onUserAgreementClick", "onPolicyClick", HintConstants.AUTOFILL_HINT_PHONE, "Lxn/b$h;", "onChangedPhone", "onApplyButtonClick", "onChangedText", "Lxn/b$c;", "Lym/a;", "limitPackage", "onPackageSelected", "onInstallmentChanged", "onInstallmentLinkClicked", "onInstallmentDescriptionClick", "url", "onLinkClicked", "Lby/kufar/mediator/widget/PromotePackagesWidget$b;", "promotePackage", "onSelectPackage", "productID", "onHowToAdd3dPhotoClick", "onShowExampleClick", "onCheckboxesChanged", "Lby/kufar/sharedmodels/entity/SpanContent;", TJAdUnitConstants.String.VIDEO_INFO, "onInfoClick", "Lp0/a;", "suggestion", "onSuggestionClick", "Landroidx/lifecycle/ViewModelProvider$Factory;", "viewModelProvider", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getViewModelProvider", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "setViewModelProvider", "(Landroidx/lifecycle/ViewModelProvider$Factory;)V", "Lcb/b;", "mediator", "Lcb/b;", "getMediator", "()Lcb/b;", "setMediator", "(Lcb/b;)V", "Lb6/c;", "appLocale", "Lb6/c;", "getAppLocale", "()Lb6/c;", "setAppLocale", "(Lb6/c;)V", "Lc0/a;", "tracker", "Lc0/a;", "getTracker", "()Lc0/a;", "setTracker", "(Lc0/a;)V", "Lw5/b;", "appPreferences", "Lw5/b;", "getAppPreferences", "()Lw5/b;", "setAppPreferences", "(Lw5/b;)V", "Landroid/widget/ViewAnimator;", "animator$delegate", "Li6/c;", "getAnimator", "()Landroid/widget/ViewAnimator;", "animator", "progressForeground$delegate", "getProgressForeground", "()Landroid/view/View;", "progressForeground", "retry$delegate", "getRetry", TapjoyConstants.TJC_RETRY, "Lby/kufar/re/ui/widget/error/ErrorView;", "error$delegate", "getError", "()Lby/kufar/re/ui/widget/error/ErrorView;", "error", "Landroid/widget/Button;", "myOrders$delegate", "getMyOrders", "()Landroid/widget/Button;", "myOrders", "toolbarProgress$delegate", "Ld80/j;", "getToolbarProgress", "toolbarProgress", "Lq0/a;", "fillAccountInfoDialog", "Lq0/a;", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM;", "viewModel$delegate", "getViewModel", "()Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM;", "viewModel", "Lby/kufar/adinsert/ui/adinsertion/adapter/AdvertInsertController;", "advertInsertController", "Lby/kufar/adinsert/ui/adinsertion/adapter/AdvertInsertController;", "Landroidx/recyclerview/widget/RecyclerView;", "advertInsertRecycler$delegate", "getAdvertInsertRecycler", "()Landroidx/recyclerview/widget/RecyclerView;", "advertInsertRecycler", "", "advertId$delegate", "getAdvertId", "()Ljava/lang/Long;", "advertId", "isForInstallment$delegate", "isForInstallment", "()Z", "listID$delegate", "getListID", "listID", "isEdit$delegate", "isEdit", "isPromotePackagesVisible$delegate", "isPromotePackagesVisible", "Landroidx/activity/result/ActivityResultLauncher;", "kotlin.jvm.PlatformType", "categoryResult", "Landroidx/activity/result/ActivityResultLauncher;", "loginResult", "verificationResult", "choosePhotoResult", "uploadPhotoResult", "locationResult", "addressResult", "<init>", "()V", "Companion", "a", "feature-advert-insertion_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class AdvertInsertionFragment extends BaseFragment implements AdvertInsertController.a {
    private static final String BUY_PACKET_URL = "https://1ji6.short.gy/tOXtno";
    private static final String KEY_ADVERT_ID = "KEY_ADVERT_ID";
    public static final String KEY_CHOSEN_AREA = "KEY_CHOSEN_AREA";
    public static final String KEY_CHOSEN_REGION = "KEY_CHOSEN_REGION";
    public static final String KEY_GEO_OBJECT = "KEY_GEO_OBJECT";
    private static final String KEY_IS_FOR_INSTALLMENT = "KEY_FOR_INSTALLMENT";
    private static final String KEY_IS_PROMOTE_PACKAGES_VISIBLE = "KEY_IS_PROMOTE_PACKAGES_VISIBLE";
    public static final String KEY_LIST_ID = "KEY_LIST_ID";
    private static final String PHOTO_3D_EXAMPLE = "https://3d.cappasity.com/u/cappasity/cb1ee979-4869-4443-add8-ac05a06fc465";
    private static final String TAG_DIALOG_BOTTOM_SHEET = "TAG_DIALOG_BOTTOMSHEET";
    private final ActivityResultLauncher<Intent> addressResult;

    private final d80.j advertId;
    private AdvertInsertController advertInsertController;

    private final i6.c advertInsertRecycler;
    public b6.c appLocale;
    public w5.b appPreferences;
    private final ActivityResultLauncher<Intent> categoryResult;
    private final ActivityResultLauncher<Intent> choosePhotoResult;
    private q0.a fillAccountInfoDialog;

    private final d80.j isEdit;

    private final d80.j isForInstallment;

    private final d80.j isPromotePackagesVisible;

    private final d80.j listID;
    private final ActivityResultLauncher<Intent> locationResult;
    private final ActivityResultLauncher<Intent> loginResult;
    public cb.b mediator;

    private final d80.j toolbarProgress;
    public c0.a tracker;
    private final ActivityResultLauncher<Intent> uploadPhotoResult;
    private final ActivityResultLauncher<Intent> verificationResult;

    private final d80.j viewModel;
    public ViewModelProvider.Factory viewModelProvider;
    static final KProperty<Object>[] $$delegatedProperties = {o0.i(new kotlin.jvm.internal.g0(AdvertInsertionFragment.class, "animator", "getAnimator()Landroid/widget/ViewAnimator;", 0)), o0.i(new kotlin.jvm.internal.g0(AdvertInsertionFragment.class, "progressForeground", "getProgressForeground()Landroid/view/View;", 0)), o0.i(new kotlin.jvm.internal.g0(AdvertInsertionFragment.class, TapjoyConstants.TJC_RETRY, "getRetry()Landroid/view/View;", 0)), o0.i(new kotlin.jvm.internal.g0(AdvertInsertionFragment.class, "error", "getError()Lby/kufar/re/ui/widget/error/ErrorView;", 0)), o0.i(new kotlin.jvm.internal.g0(AdvertInsertionFragment.class, "myOrders", "getMyOrders()Landroid/widget/Button;", 0)), o0.i(new kotlin.jvm.internal.g0(AdvertInsertionFragment.class, "advertInsertRecycler", "getAdvertInsertRecycler()Landroidx/recyclerview/widget/RecyclerView;", 0))};

    public static final Companion INSTANCE = new Companion(null);

    private final i6.c animator = bindView(R$id.f2593c);

    private final i6.c progressForeground = bindView(R$id.f2624x);

    private final i6.c retry = bindView(R$id.R);

    private final i6.c error = bindView(R$id.f2622v);

    private final i6.c myOrders = bindView(R$id.H);

    @Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u000e\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0017\u0010\u0018J1\u0010\t\u001a\u00020\b2\b\u0010\u0003\u001a\u0004\u0018\u00010\u00022\u0006\u0010\u0005\u001a\u00020\u00042\b\u0010\u0006\u001a\u0004\u0018\u00010\u00022\u0006\u0010\u0007\u001a\u00020\u0004¢\u0006\u0004\b\t\u0010\nR\u0014\u0010\f\u001a\u00020\u000b8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\f\u0010\rR\u0014\u0010\u000e\u001a\u00020\u000b8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u000e\u0010\rR\u0014\u0010\u000f\u001a\u00020\u000b8\u0006X\u0086T¢\u0006\u0006\n\u0004\b\u000f\u0010\rR\u0014\u0010\u0010\u001a\u00020\u000b8\u0006X\u0086T¢\u0006\u0006\n\u0004\b\u0010\u0010\rR\u0014\u0010\u0011\u001a\u00020\u000b8\u0006X\u0086T¢\u0006\u0006\n\u0004\b\u0011\u0010\rR\u0014\u0010\u0012\u001a\u00020\u000b8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0012\u0010\rR\u0014\u0010\u0013\u001a\u00020\u000b8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0013\u0010\rR\u0014\u0010\u0014\u001a\u00020\u000b8\u0006X\u0086T¢\u0006\u0006\n\u0004\b\u0014\u0010\rR\u0014\u0010\u0015\u001a\u00020\u000b8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0015\u0010\rR\u0014\u0010\u0016\u001a\u00020\u000b8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0016\u0010\r¨\u0006\u0019"}, d2 = {"Lby/kufar/adinsert/ui/adinsertion/AdvertInsertionFragment$a;", "", "", "advertId", "", "isForInstallment", "listID", "isPromotePackagesVisible", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertionFragment;", "a", "(Ljava/lang/Long;ZLjava/lang/Long;Z)Lby/kufar/adinsert/ui/adinsertion/AdvertInsertionFragment;", "", "BUY_PACKET_URL", "Ljava/lang/String;", AdvertInsertionFragment.KEY_ADVERT_ID, "KEY_CHOSEN_AREA", "KEY_CHOSEN_REGION", "KEY_GEO_OBJECT", "KEY_IS_FOR_INSTALLMENT", AdvertInsertionFragment.KEY_IS_PROMOTE_PACKAGES_VISIBLE, AdvertInsertionFragment.KEY_LIST_ID, "PHOTO_3D_EXAMPLE", "TAG_DIALOG_BOTTOM_SHEET", "<init>", "()V", "feature-advert-insertion_googleRelease"}, k = 1, mv = {1, 9, 0})
    public static final class Companion {
        public Companion() {
        }

        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public final AdvertInsertionFragment a(Long advertId, boolean isForInstallment, Long listID, boolean isPromotePackagesVisible) {
            AdvertInsertionFragment advertInsertionFragment = new AdvertInsertionFragment();
            advertInsertionFragment.setArguments(BundleKt.bundleOf(d80.u.a(AdvertInsertionFragment.KEY_ADVERT_ID, advertId), d80.u.a(AdvertInsertionFragment.KEY_LIST_ID, listID), d80.u.a(AdvertInsertionFragment.KEY_IS_FOR_INSTALLMENT, Boolean.valueOf(isForInstallment)), d80.u.a(AdvertInsertionFragment.KEY_IS_PROMOTE_PACKAGES_VISIBLE, Boolean.valueOf(isPromotePackagesVisible))));
            return advertInsertionFragment;
        }
    }

    @Metadata(d1 = {"\u0000\u0004\n\u0002\b\u0004\u0010\u0003\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"T", "invoke", "()Ljava/lang/Object;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
    public static final class a0 extends kotlin.jvm.internal.u implements Function0<Long> {
        public a0() {
            super(0);
        }

        @Override
        public final Long invoke() {
            Bundle arguments = AdvertInsertionFragment.this.getArguments();
            if (arguments != null) {
                kotlin.jvm.internal.s.g(arguments);
                return s5.b.a(arguments, AdvertInsertionFragment.KEY_LIST_ID);
            }
            return null;
        }
    }

    @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, 9, 0}, xi = 48)
    public static final class b extends kotlin.jvm.internal.u implements Function0<Unit> {

        public final c.Default f2966e;

        public b(c.Default r22) {
            super(0);
            this.f2966e = r22;
        }

        @Override
        public Unit invoke() {
            invoke2();
            return Unit.f82492a;
        }

        public final void invoke2() {
            AdvertInsertionFragment.this.getViewModel().removeImage(this.f2966e);
        }
    }

    @Metadata(d1 = {"\u0000\u0004\n\u0002\b\u0004\u0010\u0003\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"T", "invoke", "()Ljava/lang/Object;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
    public static final class b0 extends kotlin.jvm.internal.u implements Function0<Boolean> {
        public b0() {
            super(0);
        }

        @Override
        public final Boolean invoke() {
            boolean z11;
            if (AdvertInsertionFragment.this.getAdvertId() != null) {
                z11 = true;
            } else {
                z11 = false;
            }
            return Boolean.valueOf(z11);
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\n¢\u0006\u0002\b\u0004"}, d2 = {"<anonymous>", "", "it", "", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
    public static final class c extends kotlin.jvm.internal.u implements Function1<String, Unit> {
        public c() {
            super(1);
        }

        @Override
        public Unit invoke(String str) {
            invoke2(str);
            return Unit.f82492a;
        }

        public final void invoke2(String it) {
            kotlin.jvm.internal.s.j(it, "it");
            AdvertInsertionFragment.this.onLinkClicked(it);
        }
    }

    @Metadata(d1 = {"\u0000\u0004\n\u0002\b\u0004\u0010\u0003\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"T", "invoke", "()Ljava/lang/Object;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
    public static final class c0 extends kotlin.jvm.internal.u implements Function0<Boolean> {
        public c0() {
            super(0);
        }

        @Override
        public final Boolean invoke() {
            boolean z11;
            Bundle arguments = AdvertInsertionFragment.this.getArguments();
            if (arguments != null) {
                z11 = arguments.getBoolean(AdvertInsertionFragment.KEY_IS_PROMOTE_PACKAGES_VISIBLE);
            } else {
                z11 = true;
            }
            return Boolean.valueOf(z11);
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\b\u0010\u0001\u001a\u0004\u0018\u00010\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/content/DialogInterface;", "dialogInterface", "Landroid/view/View;", "<anonymous parameter 1>", "", "a", "(Landroid/content/DialogInterface;Landroid/view/View;)V"}, k = 3, mv = {1, 9, 0})
    public static final class d extends kotlin.jvm.internal.u implements Function2<DialogInterface, View, Unit> {

        public static final d f2970d = new d();

        public d() {
            super(2);
        }

        public final void a(DialogInterface dialogInterface, View view) {
            kotlin.jvm.internal.s.j(view, "<anonymous parameter 1>");
            if (dialogInterface != null) {
                dialogInterface.dismiss();
            }
        }

        @Override
        public Unit mo1invoke(DialogInterface dialogInterface, View view) {
            a(dialogInterface, view);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/fragment/app/Fragment;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$5"}, k = 3, mv = {1, 9, 0}, xi = 48)
    public static final class d0 extends kotlin.jvm.internal.u implements Function0<Fragment> {

        public final Fragment f2971d;

        public d0(Fragment fragment) {
            super(0);
            this.f2971d = fragment;
        }

        @Override
        public final Fragment invoke() {
            return this.f2971d;
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\n\u0010\u0001\u001a\u0006\u0012\u0002\b\u00030\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lby/kufar/re/ui/data/CheckedValue;", "checkedValue", "", "a", "(Lby/kufar/re/ui/data/CheckedValue;)V"}, k = 3, mv = {1, 9, 0})
    public static final class e extends kotlin.jvm.internal.u implements Function1<CheckedValue<?>, Unit> {

        public final xn.b f2972d;

        public final AdvertInsertionFragment f2973e;

        public e(xn.b bVar, AdvertInsertionFragment advertInsertionFragment) {
            super(1);
            this.f2972d = bVar;
            this.f2973e = advertInsertionFragment;
        }

        public final void a(CheckedValue<?> checkedValue) {
            kotlin.jvm.internal.s.j(checkedValue, "checkedValue");
            ParameterValueItem a11 = j0.a.a(this.f2972d, checkedValue);
            if (a11 != null) {
                this.f2973e.getViewModel().selectValue(b.Single.w((b.Single) this.f2972d, null, a11, null, 5, null));
            }
        }

        @Override
        public Unit invoke(CheckedValue<?> checkedValue) {
            a(checkedValue);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelStoreOwner;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$owner$4"}, k = 3, mv = {1, 9, 0}, xi = 48)
    public static final class e0 extends kotlin.jvm.internal.u implements Function0<ViewModelStoreOwner> {

        public final Function0 f2974d;

        public e0(Function0 function0) {
            super(0);
            this.f2974d = function0;
        }

        @Override
        public final ViewModelStoreOwner invoke() {
            return (ViewModelStoreOwner) this.f2974d.invoke();
        }
    }

    @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\u0010\u0010\u0002\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00040\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "it", "", "Lby/kufar/re/ui/data/CheckedValue;", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
    public static final class f extends kotlin.jvm.internal.u implements Function1<List<? extends CheckedValue<?>>, Unit> {

        public final xn.b f2975d;

        public final AdvertInsertionFragment f2976e;

        public f(xn.b bVar, AdvertInsertionFragment advertInsertionFragment) {
            super(1);
            this.f2975d = bVar;
            this.f2976e = advertInsertionFragment;
        }

        @Override
        public Unit invoke(List<? extends CheckedValue<?>> list) {
            invoke2(list);
            return Unit.f82492a;
        }

        public final void invoke2(List<? extends CheckedValue<?>> it) {
            kotlin.jvm.internal.s.j(it, "it");
            Set<ParameterValueItem> b11 = j0.a.b((b.List) this.f2975d, it);
            if (!b11.isEmpty()) {
                this.f2976e.getViewModel().selectValue(b.List.w((b.List) this.f2975d, null, b11, null, null, 13, null));
            } else {
                this.f2976e.getViewModel().selectValue(this.f2975d.b());
            }
        }
    }

    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelStore;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$6"}, k = 3, mv = {1, 9, 0}, xi = 48)
    public static final class f0 extends kotlin.jvm.internal.u implements Function0<ViewModelStore> {

        public final d80.j f2977d;

        public f0(d80.j jVar) {
            super(0);
            this.f2977d = jVar;
        }

        @Override
        public final ViewModelStore invoke() {
            ViewModelStore viewModelStore = FragmentViewModelLazyKt.m4200access$viewModels$lambda1(this.f2977d).getViewModelStore();
            kotlin.jvm.internal.s.i(viewModelStore, "owner.viewModelStore");
            return viewModelStore;
        }
    }

    @Metadata(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 = {"Ldb/m0;", "it", "", "a", "(Ldb/m0;)V"}, k = 3, mv = {1, 9, 0})
    public static final class g extends kotlin.jvm.internal.u implements Function1<SelectedValue, Unit> {

        public final a.SelectExternal f2979e;

        public g(a.SelectExternal selectExternal) {
            super(1);
            this.f2979e = selectExternal;
        }

        public final void a(SelectedValue it) {
            kotlin.jvm.internal.s.j(it, "it");
            AdvertInsertionFragment.this.getViewModel().selectValue(b.SingleExternal.x(this.f2979e.getParameterValue(), null, new ParameterValueItem(it.getValue(), it.getLabel(), null, 4, null), null, null, 13, null));
        }

        @Override
        public Unit invoke(SelectedValue selectedValue) {
            a(selectedValue);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/viewmodel/CreationExtras;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$7"}, k = 3, mv = {1, 9, 0}, xi = 48)
    public static final class g0 extends kotlin.jvm.internal.u implements Function0<CreationExtras> {

        public final Function0 f2980d;

        public final d80.j f2981e;

        public g0(Function0 function0, d80.j jVar) {
            super(0);
            this.f2980d = function0;
            this.f2981e = jVar;
        }

        @Override
        public final CreationExtras invoke() {
            CreationExtras creationExtras;
            Function0 function0 = this.f2980d;
            if (function0 != null && (creationExtras = (CreationExtras) function0.invoke()) != null) {
                return creationExtras;
            }
            ViewModelStoreOwner m4200access$viewModels$lambda1 = FragmentViewModelLazyKt.m4200access$viewModels$lambda1(this.f2981e);
            HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = m4200access$viewModels$lambda1 instanceof HasDefaultViewModelProviderFactory ? (HasDefaultViewModelProviderFactory) m4200access$viewModels$lambda1 : null;
            CreationExtras defaultViewModelCreationExtras = hasDefaultViewModelProviderFactory != null ? hasDefaultViewModelProviderFactory.getDefaultViewModelCreationExtras() : null;
            return defaultViewModelCreationExtras == null ? CreationExtras.Empty.INSTANCE : defaultViewModelCreationExtras;
        }
    }

    @Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
    public static final class h implements Observer, kotlin.jvm.internal.m {

        public final Function1 f2982b;

        public h(Function1 function) {
            kotlin.jvm.internal.s.j(function, "function");
            this.f2982b = function;
        }

        public final boolean equals(Object obj) {
            if (!(obj instanceof Observer) || !(obj instanceof kotlin.jvm.internal.m)) {
                return false;
            }
            return kotlin.jvm.internal.s.e(getFunctionDelegate(), ((kotlin.jvm.internal.m) obj).getFunctionDelegate());
        }

        @Override
        public final d80.f<?> getFunctionDelegate() {
            return this.f2982b;
        }

        public final int hashCode() {
            return getFunctionDelegate().hashCode();
        }

        @Override
        public final void onChanged(Object obj) {
            this.f2982b.invoke(obj);
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelProvider$Factory;", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
    public static final class h0 extends kotlin.jvm.internal.u implements Function0<ViewModelProvider.Factory> {
        public h0() {
            super(0);
        }

        @Override
        public final ViewModelProvider.Factory invoke() {
            return AdvertInsertionFragment.this.getViewModelProvider();
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001e\u0010\u0003\u001a\u001a\u0012\u0006\u0012\u0004\u0018\u00010\u0001 \u0002*\f\u0012\u0006\u0012\u0004\u0018\u00010\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class i extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends String>, Unit> {
        public i() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<String> aVar) {
            View view;
            Snackbar m11;
            String a11 = aVar.a();
            if (a11 != null && (view = AdvertInsertionFragment.this.getView()) != null && (m11 = ek.b.m(ek.b.f75340a, view, a11, -1, null, 0, null, 56, null)) != null) {
                m11.W();
            }
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends String> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\u0010\u0004\u001a\u00020\u00012\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class j extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Unit>, Unit> {
        public j() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<Unit> aVar) {
            Context context;
            if (aVar.a() == null || (context = AdvertInsertionFragment.this.getContext()) == null) {
                return;
            }
            AdvertInsertionFragment.this.verificationResult.launch(h0.a.a(AdvertInsertionFragment.this.getMediator().p(), context, null, 2, null));
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends Unit> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$e;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class k extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends AdvertInsertVM.LimitsError>, Unit> {

        @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\b\u0010\u0001\u001a\u0004\u0018\u00010\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/content/DialogInterface;", DialogNavigator.NAME, "Landroid/view/View;", "<anonymous parameter 1>", "", "a", "(Landroid/content/DialogInterface;Landroid/view/View;)V"}, k = 3, mv = {1, 9, 0})
        public static final class a extends kotlin.jvm.internal.u implements Function2<DialogInterface, View, Unit> {

            public final AdvertInsertionFragment f2987d;

            public final Context f2988e;

            public final String f2989f;

            public a(AdvertInsertionFragment advertInsertionFragment, Context context, String str) {
                super(2);
                this.f2987d = advertInsertionFragment;
                this.f2988e = context;
                this.f2989f = str;
            }

            public final void a(DialogInterface dialogInterface, View view) {
                kotlin.jvm.internal.s.j(view, "<anonymous parameter 1>");
                this.f2987d.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, this.f2988e, this.f2989f, false, null, false, false, 60, null));
                if (dialogInterface != null) {
                    dialogInterface.dismiss();
                }
            }

            @Override
            public Unit mo1invoke(DialogInterface dialogInterface, View view) {
                a(dialogInterface, view);
                return Unit.f82492a;
            }
        }

        public k() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<AdvertInsertVM.LimitsError> aVar) {
            Context context;
            String string;
            String string2;
            String string3;
            String str;
            LocalizedValue button;
            LocalizedValue description;
            LocalizedValue title;
            AdvertInsertVM.LimitsError a11 = aVar.a();
            if (a11 == null || (context = AdvertInsertionFragment.this.getContext()) == null) {
                return;
            }
            LimitErrorInfo limitsErrorInfo = a11.getLimitsErrorInfo();
            if (limitsErrorInfo == null || (title = limitsErrorInfo.getTitle()) == null || (string = s5.i.b(title, AdvertInsertionFragment.this.getAppLocale())) == null) {
                string = AdvertInsertionFragment.this.getString(R$string.f2677x);
                kotlin.jvm.internal.s.i(string, "getString(...)");
            }
            String str2 = string;
            LimitErrorInfo limitsErrorInfo2 = a11.getLimitsErrorInfo();
            if (limitsErrorInfo2 == null || (description = limitsErrorInfo2.getDescription()) == null || (string2 = s5.i.b(description, AdvertInsertionFragment.this.getAppLocale())) == null) {
                string2 = AdvertInsertionFragment.this.getString(R$string.f2678y);
                kotlin.jvm.internal.s.i(string2, "getString(...)");
            }
            String str3 = string2;
            LimitErrorInfo limitsErrorInfo3 = a11.getLimitsErrorInfo();
            if (limitsErrorInfo3 == null || (button = limitsErrorInfo3.getButton()) == null || (string3 = s5.i.b(button, AdvertInsertionFragment.this.getAppLocale())) == null) {
                string3 = AdvertInsertionFragment.this.getString(R$string.f2676w);
                kotlin.jvm.internal.s.i(string3, "getString(...)");
            }
            String str4 = string3;
            LimitErrorInfo limitsErrorInfo4 = a11.getLimitsErrorInfo();
            if (limitsErrorInfo4 == null || (str = limitsErrorInfo4.getFormUrl()) == null) {
                str = AdvertInsertionFragment.BUY_PACKET_URL;
            }
            AlertKufarDialogFragment.Companion.b(AlertKufarDialogFragment.INSTANCE, str2, str3, str4, null, false, false, 56, null).setPositiveClickListener(new a(AdvertInsertionFragment.this, context, str)).show(AdvertInsertionFragment.this.getChildFragmentManager(), (String) null);
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends AdvertInsertVM.LimitsError> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\u0010\u0004\u001a\u00020\u00012\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class l extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Unit>, Unit> {
        public l() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<Unit> aVar) {
            FragmentActivity activity = AdvertInsertionFragment.this.getActivity();
            if (activity != null) {
                activity.finish();
            }
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends Unit> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0012\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\u0010\u0006\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"", "Ld0/d$a;", "fields", "", "invoke", "(Ljava/util/List;)V", "<anonymous>"}, k = 3, mv = {1, 9, 0})
    public static final class m extends kotlin.jvm.internal.u implements Function1<List<? extends d.MandatoryAccountField>, Unit> {

        @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, 9, 0}, xi = 48)
        public static final class a extends kotlin.jvm.internal.u implements Function0<Unit> {

            public final AdvertInsertionFragment f2992d;

            public a(AdvertInsertionFragment advertInsertionFragment) {
                super(0);
                this.f2992d = advertInsertionFragment;
            }

            @Override
            public Unit invoke() {
                invoke2();
                return Unit.f82492a;
            }

            public final void invoke2() {
                this.f2992d.getViewModel().onCancelFillAccountInfo();
            }
        }

        public m() {
            super(1);
        }

        @Override
        public Unit invoke(List<? extends d.MandatoryAccountField> list) {
            invoke2((List<d.MandatoryAccountField>) list);
            return Unit.f82492a;
        }

        public final void invoke2(List<d.MandatoryAccountField> list) {
            Context context;
            q0.a aVar = AdvertInsertionFragment.this.fillAccountInfoDialog;
            if (aVar != null) {
                aVar.a();
            }
            if (list == null || (context = AdvertInsertionFragment.this.getContext()) == null) {
                return;
            }
            AdvertInsertionFragment advertInsertionFragment = AdvertInsertionFragment.this;
            advertInsertionFragment.fillAccountInfoDialog = new q0.a(context, advertInsertionFragment.getMediator(), AdvertInsertionFragment.this.getAppLocale(), list);
            q0.a aVar2 = AdvertInsertionFragment.this.fillAccountInfoDialog;
            if (aVar2 != null) {
                aVar2.f(new a(AdvertInsertionFragment.this));
            }
        }
    }

    @Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
    public class n extends kotlin.jvm.internal.p implements Function1<AdvertInsertVM.f, Unit> {
        public n(Object obj) {
            super(1, obj, AdvertInsertionFragment.class, "showState", "showState(Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$State;)V", 0);
        }

        public final void a(AdvertInsertVM.f p02) {
            kotlin.jvm.internal.s.j(p02, "p0");
            ((AdvertInsertionFragment) this.receiver).showState(p02);
        }

        @Override
        public Unit invoke(AdvertInsertVM.f fVar) {
            a(fVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0007\u001a\u00020\u000622\u0010\u0005\u001a.\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00030\u0001 \u0004*\u0016\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00030\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0007\u0010\b"}, d2 = {"Lby/kufar/core/android/arch/a;", "Lkotlin/Pair;", "Lm0/c$b;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class o extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Pair<? extends c.Default, ? extends Integer>>, Unit> {
        public o() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<Pair<c.Default, Integer>> aVar) {
            Pair<c.Default, Integer> a11 = aVar.a();
            if (a11 != null) {
                AdvertInsertionFragment.this.openImage(a11.c(), a11.d().intValue());
            }
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends Pair<? extends c.Default, ? extends Integer>> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$c;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class p extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends AdvertInsertVM.ChooseLocation>, Unit> {
        public p() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<AdvertInsertVM.ChooseLocation> aVar) {
            AdvertInsertVM.ChooseLocation a11 = aVar.a();
            if (a11 != null) {
                AdvertInsertionFragment.this.openChooseLocation(a11);
            }
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends AdvertInsertVM.ChooseLocation> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$b;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class q extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends AdvertInsertVM.ChooseAddress>, Unit> {
        public q() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<AdvertInsertVM.ChooseAddress> aVar) {
            AdvertInsertVM.ChooseAddress a11 = aVar.a();
            if (a11 != null) {
                AdvertInsertionFragment.this.openChooseAddress(a11);
            }
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends AdvertInsertVM.ChooseAddress> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
    public class r extends kotlin.jvm.internal.p implements Function1<Boolean, Unit> {
        public r(Object obj) {
            super(1, obj, AdvertInsertionFragment.class, "showApplyProgress", "showApplyProgress(Z)V", 0);
        }

        public final void a(boolean z11) {
            ((AdvertInsertionFragment) this.receiver).showApplyProgress(z11);
        }

        @Override
        public Unit invoke(Boolean bool) {
            a(bool.booleanValue());
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class s extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Integer>, Unit> {

        @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, 9, 0}, xi = 48)
        public static final class a extends kotlin.jvm.internal.u implements Function0<Unit> {

            public final AdvertInsertionFragment f2997d;

            public final int f2998e;

            public a(AdvertInsertionFragment advertInsertionFragment, int i11) {
                super(0);
                this.f2997d = advertInsertionFragment;
                this.f2998e = i11;
            }

            @Override
            public Unit invoke() {
                invoke2();
                return Unit.f82492a;
            }

            public final void invoke2() {
                this.f2997d.getAdvertInsertRecycler().smoothScrollToPosition(this.f2998e);
            }
        }

        public s() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<Integer> aVar) {
            int intValue;
            Integer a11 = aVar.a();
            if (a11 != null && (intValue = a11.intValue()) != -1) {
                try {
                    a6.b.c(200L, null, new a(AdvertInsertionFragment.this, intValue), 2, null);
                } catch (Exception e11) {
                    wc0.a.INSTANCE.d(e11);
                }
            }
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends Integer> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "Lby/kufar/adinsert/ui/adinsertion/AdvertInsertVM$d;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class t extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends AdvertInsertVM.InsertSuccess>, Unit> {
        public t() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<AdvertInsertVM.InsertSuccess> aVar) {
            AdvertInsertVM.InsertSuccess a11 = aVar.a();
            if (a11 != null) {
                AdvertInsertionFragment.this.finishSuccess(a11);
            }
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends AdvertInsertVM.InsertSuccess> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class u extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Throwable>, Unit> {
        public u() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<? extends Throwable> aVar) {
            View view;
            Snackbar n11;
            Throwable a11 = aVar.a();
            if (a11 == null || (view = AdvertInsertionFragment.this.getView()) == null) {
                return;
            }
            if (a11 instanceof g0.d) {
                n11 = ek.b.m(ek.b.f75340a, view, AdvertInsertionFragment.this.getString(R$string.O), -1, null, 0, null, 56, null);
            } else {
                n11 = ek.b.n(ek.b.f75340a, view, a11, -1, null, 0, null, 56, null);
            }
            if (n11 != null) {
                n11.W();
            }
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends Throwable> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\u0010\u0004\u001a\u00020\u00012\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
    public static final class v extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Unit>, Unit> {
        public v() {
            super(1);
        }

        public final void a(by.kufar.core.android.arch.a<Unit> aVar) {
            Context context;
            if (aVar.a() == null || (context = AdvertInsertionFragment.this.getContext()) == null) {
                return;
            }
            AdvertInsertionFragment.this.loginResult.launch(AdvertInsertionFragment.this.getMediator().F().a(context));
        }

        @Override
        public Unit invoke(by.kufar.core.android.arch.a<? extends Unit> aVar) {
            a(aVar);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\b\u0010\u0001\u001a\u0004\u0018\u00010\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/content/DialogInterface;", "dialogInterface", "Landroid/view/View;", "<anonymous parameter 1>", "", "a", "(Landroid/content/DialogInterface;Landroid/view/View;)V"}, k = 3, mv = {1, 9, 0})
    public static final class w extends kotlin.jvm.internal.u implements Function2<DialogInterface, View, Unit> {

        public static final w f3002d = new w();

        public w() {
            super(2);
        }

        public final void a(DialogInterface dialogInterface, View view) {
            kotlin.jvm.internal.s.j(view, "<anonymous parameter 1>");
            if (dialogInterface != null) {
                dialogInterface.dismiss();
            }
        }

        @Override
        public Unit mo1invoke(DialogInterface dialogInterface, View view) {
            a(dialogInterface, view);
            return Unit.f82492a;
        }
    }

    @Metadata(d1 = {"\u0000\u0004\n\u0002\b\u0004\u0010\u0003\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"T", "invoke", "()Ljava/lang/Object;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
    public static final class x extends kotlin.jvm.internal.u implements Function0<View> {
        public x() {
            super(0);
        }

        @Override
        public final View invoke() {
            FragmentActivity activity = AdvertInsertionFragment.this.getActivity();
            if (activity != null) {
                return activity.findViewById(R$id.f2610k0);
            }
            return null;
        }
    }

    @Metadata(d1 = {"\u0000\u0004\n\u0002\b\u0004\u0010\u0003\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"T", "invoke", "()Ljava/lang/Object;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
    public static final class y extends kotlin.jvm.internal.u implements Function0<Long> {
        public y() {
            super(0);
        }

        @Override
        public final Long invoke() {
            Bundle arguments = AdvertInsertionFragment.this.getArguments();
            if (arguments != null) {
                kotlin.jvm.internal.s.g(arguments);
                return s5.b.a(arguments, AdvertInsertionFragment.KEY_ADVERT_ID);
            }
            return null;
        }
    }

    @Metadata(d1 = {"\u0000\u0004\n\u0002\b\u0004\u0010\u0003\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"T", "invoke", "()Ljava/lang/Object;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
    public static final class z extends kotlin.jvm.internal.u implements Function0<Boolean> {
        public z() {
            super(0);
        }

        @Override
        public final Boolean invoke() {
            boolean z11;
            Bundle arguments = AdvertInsertionFragment.this.getArguments();
            if (arguments != null) {
                z11 = arguments.getBoolean(AdvertInsertionFragment.KEY_IS_FOR_INSTALLMENT);
            } else {
                z11 = false;
            }
            return Boolean.valueOf(z11);
        }
    }

    public AdvertInsertionFragment() {
        d80.m mVar = d80.m.f73493d;
        this.toolbarProgress = d80.k.a(mVar, new x());
        h0 h0Var = new h0();
        d80.j a11 = d80.k.a(mVar, new e0(new d0(this)));
        this.viewModel = FragmentViewModelLazyKt.createViewModelLazy(this, o0.b(AdvertInsertVM.class), new f0(a11), new g0(null, a11), h0Var);
        this.advertInsertRecycler = bindView(R$id.Q);
        this.advertId = d80.k.a(mVar, new y());
        this.isForInstallment = d80.k.a(mVar, new z());
        this.listID = d80.k.a(mVar, new a0());
        this.isEdit = d80.k.a(mVar, new b0());
        this.isPromotePackagesVisible = d80.k.a(mVar, new c0());
        ActivityResultLauncher<Intent> registerForActivityResult = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                AdvertInsertionFragment.categoryResult$lambda$6(AdvertInsertionFragment.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.s.i(registerForActivityResult, "registerForActivityResult(...)");
        this.categoryResult = registerForActivityResult;
        ActivityResultLauncher<Intent> registerForActivityResult2 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                AdvertInsertionFragment.loginResult$lambda$7(AdvertInsertionFragment.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.s.i(registerForActivityResult2, "registerForActivityResult(...)");
        this.loginResult = registerForActivityResult2;
        ActivityResultLauncher<Intent> registerForActivityResult3 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                AdvertInsertionFragment.verificationResult$lambda$8(AdvertInsertionFragment.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.s.i(registerForActivityResult3, "registerForActivityResult(...)");
        this.verificationResult = registerForActivityResult3;
        ActivityResultLauncher<Intent> registerForActivityResult4 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                AdvertInsertionFragment.choosePhotoResult$lambda$9(AdvertInsertionFragment.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.s.i(registerForActivityResult4, "registerForActivityResult(...)");
        this.choosePhotoResult = registerForActivityResult4;
        ActivityResultLauncher<Intent> registerForActivityResult5 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                AdvertInsertionFragment.uploadPhotoResult$lambda$10(AdvertInsertionFragment.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.s.i(registerForActivityResult5, "registerForActivityResult(...)");
        this.uploadPhotoResult = registerForActivityResult5;
        ActivityResultLauncher<Intent> registerForActivityResult6 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                AdvertInsertionFragment.locationResult$lambda$11(AdvertInsertionFragment.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.s.i(registerForActivityResult6, "registerForActivityResult(...)");
        this.locationResult = registerForActivityResult6;
        ActivityResultLauncher<Intent> registerForActivityResult7 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                AdvertInsertionFragment.addressResult$lambda$12(AdvertInsertionFragment.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.s.i(registerForActivityResult7, "registerForActivityResult(...)");
        this.addressResult = registerForActivityResult7;
    }

    public static final void addressResult$lambda$12(AdvertInsertionFragment this$0, ActivityResult result) {
        kotlin.jvm.internal.s.j(this$0, "this$0");
        kotlin.jvm.internal.s.j(result, "result");
        if (result.getResultCode() == -1) {
            this$0.chooseAddress(result.getData());
        }
    }

    public static final void categoryResult$lambda$6(AdvertInsertionFragment this$0, ActivityResult result) {
        kotlin.jvm.internal.s.j(this$0, "this$0");
        kotlin.jvm.internal.s.j(result, "result");
        if (result.getResultCode() == -1) {
            this$0.chooseCategory(result.getData());
        }
    }

    private final void changeUploadedPhoto(Intent data) {
        Integer num;
        Integer num2 = null;
        if (data != null) {
            num = Integer.valueOf(data.getIntExtra(ImageViewerActivity.KEY_IMAGE_VIEWER_RESULT, 0));
        } else {
            num = null;
        }
        if (data != null) {
            num2 = Integer.valueOf(data.getIntExtra(ImageViewerActivity.KEY_LIST_ITEM_POSITION, -1));
        }
        if (num2 != null && num2.intValue() != -1) {
            if (num != null && num.intValue() == 1) {
                getViewModel().removeImage(num2.intValue());
                return;
            }
            if (num != null && num.intValue() == 2) {
                getViewModel().makeMain(num2.intValue());
                View view = getView();
                if (view != null) {
                    view.postDelayed(new Runnable() {
                        @Override
                        public final void run() {
                            AdvertInsertionFragment.changeUploadedPhoto$lambda$13(AdvertInsertionFragment.this);
                        }
                    }, 200L);
                }
            }
        }
    }

    public static final void changeUploadedPhoto$lambda$13(AdvertInsertionFragment this$0) {
        RecyclerView recyclerView;
        kotlin.jvm.internal.s.j(this$0, "this$0");
        View view = this$0.getView();
        if (view != null && (recyclerView = (RecyclerView) view.findViewById(R$id.D)) != null) {
            recyclerView.smoothScrollToPosition(0);
        }
    }

    private final void chooseAddress(Intent data) {
        GeoObjectResult geoObjectResult;
        if (data != null) {
            geoObjectResult = (GeoObjectResult) data.getParcelableExtra("KEY_GEO_OBJECT");
        } else {
            geoObjectResult = null;
        }
        getViewModel().chooseAddress(geoObjectResult);
    }

    private final void chooseCategory(Intent data) {
        ParentEntity parentEntity;
        CategoryEntity categoryEntity = null;
        if (data != null) {
            parentEntity = (ParentEntity) data.getParcelableExtra(CategoryActivity.KEY_SELECTED_PARENT);
        } else {
            parentEntity = null;
        }
        if (data != null) {
            categoryEntity = (CategoryEntity) data.getParcelableExtra(CategoryActivity.KEY_SELECTED_CATEGORY);
        }
        if (parentEntity != null && categoryEntity != null) {
            getViewModel().selectCategory(Integer.valueOf((int) parentEntity.getValue()), Integer.valueOf((int) categoryEntity.getValue()));
        }
    }

    private final void chooseLocation(Intent data) {
        String str;
        String str2 = null;
        if (data != null) {
            str = data.getStringExtra("KEY_CHOSEN_REGION");
        } else {
            str = null;
        }
        if (data != null) {
            str2 = data.getStringExtra("KEY_CHOSEN_AREA");
        }
        if (str != null && str2 != null) {
            getViewModel().chooseLocation(str, str2);
        }
    }

    public static final void choosePhotoResult$lambda$9(AdvertInsertionFragment this$0, ActivityResult result) {
        kotlin.jvm.internal.s.j(this$0, "this$0");
        kotlin.jvm.internal.s.j(result, "result");
        if (result.getResultCode() == -1) {
            this$0.loadPhotos(result.getData());
        }
    }

    private final void dismissBottomSheetDialog() {
        BaseBottomSheetFragment baseBottomSheetFragment;
        Fragment findFragmentByTag = getChildFragmentManager().findFragmentByTag(TAG_DIALOG_BOTTOM_SHEET);
        if (findFragmentByTag instanceof BaseBottomSheetFragment) {
            baseBottomSheetFragment = (BaseBottomSheetFragment) findFragmentByTag;
        } else {
            baseBottomSheetFragment = null;
        }
        if (baseBottomSheetFragment != null) {
            baseBottomSheetFragment.dismiss();
        }
    }

    public final void finishSuccess(AdvertInsertVM.InsertSuccess success) {
        s0.a aVar;
        an.a aVar2;
        Context context = getContext();
        if (context == null) {
            FragmentActivity activity = getActivity();
            if (activity != null) {
                activity.finish();
                return;
            }
            return;
        }
        Long adId = success.getAdId();
        Long category = success.getCategory();
        boolean isDeliveryEnabled = success.getIsDeliveryEnabled();
        long similarAdsCount = success.getSimilarAdsCount();
        String packageID = success.getPackageID();
        if (isEdit()) {
            aVar = s0.a.f73656c;
        } else {
            aVar = s0.a.f73655b;
        }
        s0.a aVar3 = aVar;
        if (success.getLimitPackage() != null) {
            startActivity(getMediator().r().b(context, adId, category, success.getLimitPackage()));
        } else if (packageID != null && adId != null) {
            startActivity(getMediator().P().f(context, adId.longValue(), packageID, aVar3, isDeliveryEnabled, similarAdsCount));
        } else if (success.getPromotePackage() != null && adId != null) {
            startActivity(getMediator().P().c(context, success.getPromotePackage().getType().toString(), adId.longValue(), category));
        } else {
            Long listID = getListID();
            if ((listID == null || listID.longValue() != 0) && isPromotePackagesVisible()) {
                if (isEdit()) {
                    aVar2 = an.a.f749c;
                } else {
                    aVar2 = an.a.f751e;
                }
                startActivity(getMediator().P().e(context, aVar2, getListID(), adId, category, aVar3, isDeliveryEnabled, similarAdsCount));
            } else {
                InsertSuccessActivity.Companion companion = InsertSuccessActivity.INSTANCE;
                String subject = success.getSubject();
                if (subject == null) {
                    subject = "";
                }
                startActivity(companion.a(context, subject, isEdit()));
            }
        }
        FragmentActivity activity2 = getActivity();
        if (activity2 != null) {
            activity2.finish();
        }
    }

    public final Long getAdvertId() {
        return (Long) this.advertId.getValue();
    }

    public final RecyclerView getAdvertInsertRecycler() {
        return (RecyclerView) this.advertInsertRecycler.getValue(this, $$delegatedProperties[5]);
    }

    private final ViewAnimator getAnimator() {
        return (ViewAnimator) this.animator.getValue(this, $$delegatedProperties[0]);
    }

    private final ErrorView getError() {
        return (ErrorView) this.error.getValue(this, $$delegatedProperties[3]);
    }

    private final Long getListID() {
        return (Long) this.listID.getValue();
    }

    private final Button getMyOrders() {
        return (Button) this.myOrders.getValue(this, $$delegatedProperties[4]);
    }

    private final View getProgressForeground() {
        return (View) this.progressForeground.getValue(this, $$delegatedProperties[1]);
    }

    private final View getRetry() {
        return (View) this.retry.getValue(this, $$delegatedProperties[2]);
    }

    private final View getToolbarProgress() {
        return (View) this.toolbarProgress.getValue();
    }

    public final AdvertInsertVM getViewModel() {
        return (AdvertInsertVM) this.viewModel.getValue();
    }

    private final boolean isEdit() {
        return ((Boolean) this.isEdit.getValue()).booleanValue();
    }

    private final boolean isForInstallment() {
        return ((Boolean) this.isForInstallment.getValue()).booleanValue();
    }

    private final boolean isPromotePackagesVisible() {
        return ((Boolean) this.isPromotePackagesVisible.getValue()).booleanValue();
    }

    private final void loadPhotos(Intent data) {
        if (data != null) {
            List<Uri> b11 = PhotoPickerActivity.INSTANCE.b(data);
            if (!b11.isEmpty()) {
                getViewModel().loadImages(b11);
            }
        }
    }

    public static final void locationResult$lambda$11(AdvertInsertionFragment this$0, ActivityResult result) {
        kotlin.jvm.internal.s.j(this$0, "this$0");
        kotlin.jvm.internal.s.j(result, "result");
        if (result.getResultCode() == -1) {
            this$0.chooseLocation(result.getData());
        }
    }

    public static final void loginResult$lambda$7(AdvertInsertionFragment this$0, ActivityResult result) {
        FragmentActivity activity;
        kotlin.jvm.internal.s.j(this$0, "this$0");
        kotlin.jvm.internal.s.j(result, "result");
        if (result.getResultCode() != -1 && (activity = this$0.getActivity()) != null) {
            activity.finish();
        }
    }

    public final void openChooseAddress(AdvertInsertVM.ChooseAddress chooseAddress) {
        Context context = getContext();
        if (context == null) {
            return;
        }
        this.addressResult.launch(getMediator().k().b(context, chooseAddress.getAddress()));
    }

    public final void openChooseLocation(AdvertInsertVM.ChooseLocation chooseLocation) {
        Context context = getContext();
        if (context == null) {
            return;
        }
        this.locationResult.launch(getMediator().E().a(context, chooseLocation.getTitle(), chooseLocation.c(), chooseLocation.getChosenRegion(), chooseLocation.getChosenArea()));
    }

    public final void openImage(c.Default image, int position) {
        c.Default.a.Success success;
        Context context = getContext();
        if (context == null) {
            return;
        }
        c.Default.a state = image.getState();
        if (state instanceof c.Default.a.Success) {
            success = (c.Default.a.Success) state;
        } else {
            success = null;
        }
        if (success != null) {
            this.uploadPhotoResult.launch(ImageViewerActivity.INSTANCE.a(context, k6.d.f81734a.b(success.getId(), d.a.f81743h, success.getMediaStorage(), success.getPath()), position));
        }
    }

    private final void setUpBinding() {
        this.advertInsertController = new AdvertInsertController(this, getAppPreferences());
        getAdvertInsertRecycler().setLayoutManager(new LinearLayoutManager(requireContext()));
        RecyclerView advertInsertRecycler = getAdvertInsertRecycler();
        AdvertInsertController advertInsertController = this.advertInsertController;
        if (advertInsertController == null) {
            kotlin.jvm.internal.s.B("advertInsertController");
            advertInsertController = null;
        }
        advertInsertRecycler.setAdapter(advertInsertController.getAdapter());
        getRetry().setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AdvertInsertionFragment.setUpBinding$lambda$14(AdvertInsertionFragment.this, view);
            }
        });
        getMyOrders().setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AdvertInsertionFragment.setUpBinding$lambda$15(AdvertInsertionFragment.this, view);
            }
        });
    }

    public static final void setUpBinding$lambda$14(AdvertInsertionFragment this$0, View view) {
        kotlin.jvm.internal.s.j(this$0, "this$0");
        this$0.getViewModel().setUp(this$0.getAdvertId(), this$0.isForInstallment(), this$0.isPromotePackagesVisible());
    }

    public static final void setUpBinding$lambda$15(AdvertInsertionFragment this$0, View view) {
        kotlin.jvm.internal.s.j(this$0, "this$0");
        Context context = this$0.getContext();
        if (context == null) {
            return;
        }
        this$0.startActivity(this$0.getMediator().U().a(context));
    }

    private final void setUpViewModel() {
        getViewModel().getState().observe(getViewLifecycleOwner(), new h(new n(this)));
        getViewModel().getOpenImage().observe(getViewLifecycleOwner(), new h(new o()));
        getViewModel().getOpenChooseLocation().observe(getViewLifecycleOwner(), new h(new p()));
        getViewModel().getOpenChooseAddress().observe(getViewLifecycleOwner(), new h(new q()));
        getViewModel().getProgress().observe(getViewLifecycleOwner(), new h(new r(this)));
        getViewModel().getScrollToPosition().observe(getViewLifecycleOwner(), new h(new s()));
        getViewModel().getSuccess().observe(getViewLifecycleOwner(), new h(new t()));
        getViewModel().getSnackError().observe(getViewLifecycleOwner(), new h(new u()));
        getViewModel().getLogin().observe(getViewLifecycleOwner(), new h(new v()));
        getViewModel().getSnackErrorText().observe(getViewLifecycleOwner(), new h(new i()));
        getViewModel().getPhoneVerification().observe(getViewLifecycleOwner(), new h(new j()));
        getViewModel().getLimitsError().observe(getViewLifecycleOwner(), new h(new k()));
        getViewModel().getFinish().observe(getViewLifecycleOwner(), new h(new l()));
        getViewModel().getFillAccountInfoDialog().observe(getViewLifecycleOwner(), new h(new m()));
        getViewModel().setUp(getAdvertId(), isForInstallment(), isPromotePackagesVisible());
    }

    public final void showApplyProgress(boolean isShow) {
        if (isShow) {
            View toolbarProgress = getToolbarProgress();
            if (toolbarProgress != null) {
                toolbarProgress.setVisibility(0);
            }
            getProgressForeground().setVisibility(0);
            return;
        }
        View toolbarProgress2 = getToolbarProgress();
        if (toolbarProgress2 != null) {
            s5.q.k(toolbarProgress2, null, null, 3, null);
        }
        getProgressForeground().setVisibility(8);
    }

    public final void showState(AdvertInsertVM.f state) {
        boolean z11;
        boolean z12;
        boolean z13;
        boolean z14;
        int i11 = -1;
        if (state instanceof AdvertInsertVM.f.Data) {
            ViewAnimator animator = getAnimator();
            int i12 = R$id.f2615o;
            Iterator<View> it = ViewGroupKt.getChildren(animator).iterator();
            int i13 = 0;
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                View next = it.next();
                if (i13 < 0) {
                    e80.t.x();
                }
                if (next.getId() == i12) {
                    z14 = true;
                } else {
                    z14 = false;
                }
                if (z14) {
                    i11 = i13;
                    break;
                }
                i13++;
            }
            if (animator.getDisplayedChild() != i11) {
                if (i11 >= 0) {
                    animator.setDisplayedChild(i11);
                } else {
                    throw new IllegalArgumentException("View with ID " + i12 + " not found.");
                }
            }
            AdvertInsertController advertInsertController = this.advertInsertController;
            if (advertInsertController == null) {
                kotlin.jvm.internal.s.B("advertInsertController");
                advertInsertController = null;
            }
            advertInsertController.setData(((AdvertInsertVM.f.Data) state).a());
            return;
        }
        if (state instanceof AdvertInsertVM.f.d) {
            ViewAnimator animator2 = getAnimator();
            int i14 = R$id.O;
            Iterator<View> it2 = ViewGroupKt.getChildren(animator2).iterator();
            int i15 = 0;
            while (true) {
                if (!it2.hasNext()) {
                    break;
                }
                View next2 = it2.next();
                if (i15 < 0) {
                    e80.t.x();
                }
                if (next2.getId() == i14) {
                    z13 = true;
                } else {
                    z13 = false;
                }
                if (z13) {
                    i11 = i15;
                    break;
                }
                i15++;
            }
            if (animator2.getDisplayedChild() != i11) {
                if (i11 >= 0) {
                    animator2.setDisplayedChild(i11);
                    return;
                }
                throw new IllegalArgumentException("View with ID " + i14 + " not found.");
            }
            return;
        }
        if (state instanceof AdvertInsertVM.f.Error) {
            AdvertInsertVM.f.Error error = (AdvertInsertVM.f.Error) state;
            wc0.a.INSTANCE.d(error.getError());
            ViewAnimator animator3 = getAnimator();
            int i16 = R$id.f2622v;
            Iterator<View> it3 = ViewGroupKt.getChildren(animator3).iterator();
            int i17 = 0;
            while (true) {
                if (!it3.hasNext()) {
                    break;
                }
                View next3 = it3.next();
                if (i17 < 0) {
                    e80.t.x();
                }
                if (next3.getId() == i16) {
                    z12 = true;
                } else {
                    z12 = false;
                }
                if (z12) {
                    i11 = i17;
                    break;
                }
                i17++;
            }
            if (animator3.getDisplayedChild() != i11) {
                if (i11 >= 0) {
                    animator3.setDisplayedChild(i11);
                } else {
                    throw new IllegalArgumentException("View with ID " + i16 + " not found.");
                }
            }
            getError().setupError(error.getError());
            return;
        }
        if (state instanceof AdvertInsertVM.f.a) {
            wc0.a.INSTANCE.a("Order exists", new Object[0]);
            ViewAnimator animator4 = getAnimator();
            int i18 = R$id.f2597e;
            Iterator<View> it4 = ViewGroupKt.getChildren(animator4).iterator();
            int i19 = 0;
            while (true) {
                if (!it4.hasNext()) {
                    break;
                }
                View next4 = it4.next();
                if (i19 < 0) {
                    e80.t.x();
                }
                if (next4.getId() == i18) {
                    z11 = true;
                } else {
                    z11 = false;
                }
                if (z11) {
                    i11 = i19;
                    break;
                }
                i19++;
            }
            if (animator4.getDisplayedChild() != i11) {
                if (i11 >= 0) {
                    animator4.setDisplayedChild(i11);
                    return;
                }
                throw new IllegalArgumentException("View with ID " + i18 + " not found.");
            }
        }
    }

    public static final void uploadPhotoResult$lambda$10(AdvertInsertionFragment this$0, ActivityResult result) {
        kotlin.jvm.internal.s.j(this$0, "this$0");
        kotlin.jvm.internal.s.j(result, "result");
        if (result.getResultCode() == -1) {
            this$0.changeUploadedPhoto(result.getData());
        }
    }

    public static final void verificationResult$lambda$8(AdvertInsertionFragment this$0, ActivityResult result) {
        kotlin.jvm.internal.s.j(this$0, "this$0");
        kotlin.jvm.internal.s.j(result, "result");
        if (result.getResultCode() == -1) {
            this$0.getViewModel().setUp(this$0.getAdvertId(), this$0.isForInstallment(), false);
            return;
        }
        FragmentActivity activity = this$0.getActivity();
        if (activity != null) {
            activity.finish();
        }
    }

    public final b6.c getAppLocale() {
        b6.c cVar = this.appLocale;
        if (cVar != null) {
            return cVar;
        }
        kotlin.jvm.internal.s.B("appLocale");
        return null;
    }

    public final w5.b getAppPreferences() {
        w5.b bVar = this.appPreferences;
        if (bVar != null) {
            return bVar;
        }
        kotlin.jvm.internal.s.B("appPreferences");
        return null;
    }

    public final cb.b getMediator() {
        cb.b bVar = this.mediator;
        if (bVar != null) {
            return bVar;
        }
        kotlin.jvm.internal.s.B("mediator");
        return null;
    }

    public final c0.a getTracker() {
        c0.a aVar = this.tracker;
        if (aVar != null) {
            return aVar;
        }
        kotlin.jvm.internal.s.B("tracker");
        return null;
    }

    public final ViewModelProvider.Factory getViewModelProvider() {
        ViewModelProvider.Factory factory = this.viewModelProvider;
        if (factory != null) {
            return factory;
        }
        kotlin.jvm.internal.s.B("viewModelProvider");
        return null;
    }

    @Override
    public void isFreePriceChanged(boolean isFree) {
        getViewModel().changePrice(isFree);
    }

    @Override
    public void onAddedPhone() {
        getViewModel().addPhone();
    }

    @Override
    public void onAddressClear(a.Address address) {
        kotlin.jvm.internal.s.j(address, "address");
        getViewModel().clearValue(address.getParameterValue());
    }

    @Override
    public void onAddressClick(a.Address address) {
        kotlin.jvm.internal.s.j(address, "address");
        getViewModel().openChooseAddress();
    }

    @Override
    public void onApplyButtonClick() {
        showApplyProgress(true);
        a6.d.f263a.i(getView());
        getViewModel().applyAdvert();
    }

    @Override
    public void onCancelClick(c.Default image) {
        kotlin.jvm.internal.s.j(image, "image");
        getViewModel().removeImage(image);
    }

    @Override
    public void onCategoryClick(a.Category selectItem) {
        long j11;
        String str;
        kotlin.jvm.internal.s.j(selectItem, "selectItem");
        Context context = getContext();
        if (context != null) {
            List<ParameterValueItem> k11 = selectItem.getParameterValue().k();
            ArrayList arrayList = new ArrayList();
            for (ParameterValueItem parameterValueItem : k11) {
                h0.a aVar = h0.a.f77665a;
                Long r11 = a90.q.r(parameterValueItem.getValue());
                if (r11 != null) {
                    j11 = r11.longValue();
                } else {
                    j11 = 0;
                }
                Integer b11 = aVar.b(j11);
                LocalizedValue labels = parameterValueItem.getLabels();
                ParentEntity parentEntity = null;
                if (labels != null) {
                    str = s5.i.b(labels, getAppLocale());
                } else {
                    str = null;
                }
                Long r12 = a90.q.r(parameterValueItem.getValue());
                if (str != null && r12 != null) {
                    parentEntity = new ParentEntity(r12.longValue(), str, b11);
                }
                if (parentEntity != null) {
                    arrayList.add(parentEntity);
                }
            }
            this.categoryResult.launch(CategoryActivity.INSTANCE.a(context, arrayList));
        }
    }

    @Override
    public void onChangedPhone(String phone, int position, b.Text parameterValue) {
        kotlin.jvm.internal.s.j(parameterValue, "parameterValue");
        getViewModel().changePhone(phone, position, parameterValue);
    }

    @Override
    public void onChangedText(b.Text parameterValue, String text) {
        kotlin.jvm.internal.s.j(parameterValue, "parameterValue");
        getViewModel().changeText(parameterValue, text);
    }

    @Override
    public void onCheckboxesChanged(List<ParamCheckedValue> values, xn.b parameterValue) {
        kotlin.jvm.internal.s.j(values, "values");
        kotlin.jvm.internal.s.j(parameterValue, "parameterValue");
        ArrayList arrayList = new ArrayList();
        for (Object obj : values) {
            if (((ParamCheckedValue) obj).getIsChecked()) {
                arrayList.add(obj);
            }
        }
        if (arrayList.isEmpty()) {
            getViewModel().selectValue(parameterValue.b());
        } else if (parameterValue instanceof b.List) {
            b.List list = (b.List) parameterValue;
            getViewModel().selectValue(b.List.w(list, null, j0.a.b(list, arrayList), null, null, 13, null));
        }
    }

    @Override
    public void onCheckedChanged(boolean isChecked, b.Bool parameterValue) {
        kotlin.jvm.internal.s.j(parameterValue, "parameterValue");
        getViewModel().selectValue(parameterValue.y(isChecked));
    }

    @Override
    public void onChipsChanged(List<ParamCheckedValue> values, xn.b parameterValue) {
        kotlin.jvm.internal.s.j(values, "values");
        kotlin.jvm.internal.s.j(parameterValue, "parameterValue");
        ArrayList arrayList = new ArrayList();
        for (Object obj : values) {
            if (((ParamCheckedValue) obj).getIsChecked()) {
                arrayList.add(obj);
            }
        }
        if (arrayList.isEmpty()) {
            getViewModel().selectValue(parameterValue.b());
            return;
        }
        if (parameterValue instanceof b.Single) {
            getViewModel().selectValue(b.Single.w((b.Single) parameterValue, null, j0.a.a(parameterValue, (CheckedValue) e80.b0.s0(arrayList)), null, 5, null));
        } else if (parameterValue instanceof b.List) {
            b.List list = (b.List) parameterValue;
            getViewModel().selectValue(b.List.w(list, null, j0.a.b(list, arrayList), null, null, 13, null));
        }
    }

    @Override
    public void onClearClick(a.Select selectItem) {
        kotlin.jvm.internal.s.j(selectItem, "selectItem");
        getViewModel().clearValue(selectItem.getParameterValue());
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (savedInstanceState != null) {
            dismissBottomSheetDialog();
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        kotlin.jvm.internal.s.j(inflater, "inflater");
        return inflater.inflate(R$layout.f2633g, container, false);
    }

    @Override
    public void onCurrencySelected(ParameterValueItem parameterValueItem, b.Single currency) {
        kotlin.jvm.internal.s.j(parameterValueItem, "parameterValueItem");
        kotlin.jvm.internal.s.j(currency, "currency");
        getViewModel().selectValue(b.Single.w(currency, null, parameterValueItem, null, 5, null));
    }

    @Override
    public void onDeleteClick(c.Default image) {
        kotlin.jvm.internal.s.j(image, "image");
        getViewModel().removeImage(image);
    }

    @Override
    public void onErrorClick(c.Default image) {
        kotlin.jvm.internal.s.j(image, "image");
        ek.b bVar = ek.b.f75340a;
        View view = getView();
        h0.b bVar2 = h0.b.f77668a;
        Context context = getContext();
        c.Default.a state = image.getState();
        kotlin.jvm.internal.s.h(state, "null cannot be cast to non-null type by.kufar.adinsert.ui.adinsertion.data.entity.AdvertInsertImage.Default.State.Error");
        Snackbar m11 = ek.b.m(bVar, view, bVar2.a(context, ((c.Default.a.C1313a) state).getError()), 0, getString(R$string.Q), 0, new b(image), 16, null);
        if (m11 != null) {
            m11.W();
        }
    }

    @Override
    public void onHowToAdd3dPhotoClick() {
        WebViewActivity.Companion companion = WebViewActivity.INSTANCE;
        Context requireContext = requireContext();
        kotlin.jvm.internal.s.i(requireContext, "requireContext(...)");
        startActivity(WebViewActivity.Companion.b(companion, requireContext, k6.g.f81786a.j(), false, null, false, false, 60, null));
    }

    @Override
    public void onImageAddClick(int maxCount) {
        Context context = getContext();
        if (context == null) {
            return;
        }
        this.choosePhotoResult.launch(PhotoPickerActivity.INSTANCE.a(context, maxCount));
    }

    @Override
    public void onImageClick(c.Default image) {
        kotlin.jvm.internal.s.j(image, "image");
        getViewModel().openImage(image);
    }

    @Override
    public void onInfoClick(SpanContent info) {
        kotlin.jvm.internal.s.j(info, "info");
        AlertKufarDialogFragment.Companion companion = AlertKufarDialogFragment.INSTANCE;
        Spannable c11 = o5.d.c(o5.d.f87043a, info, false, null, new c(), 6, null);
        String string = getString(R$string.R);
        kotlin.jvm.internal.s.i(string, "getString(...)");
        AlertKufarDialogFragment.Companion.b(companion, "", c11, string, null, false, false, 56, null).setPositiveClickListener(d.f2970d).show(getChildFragmentManager(), (String) null);
    }

    @Override
    public void onInject() {
        super.onInject();
        a.InterfaceC0952a a11 = f0.i.a();
        Object obj = m5.a.d(this).get(f0.b.class);
        if (obj != null) {
            a11.a((f0.b) obj).a(this);
            return;
        }
        throw new NullPointerException("null cannot be cast to non-null type by.kufar.adinsert.di.AdvertInsertionDependencies");
    }

    @Override
    public void onInstallmentChanged(boolean isChecked) {
        getViewModel().changeHalva(isChecked);
    }

    @Override
    public void onInstallmentDescriptionClick() {
        Context context = getContext();
        if (context != null) {
            getTracker().b();
            context.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://rassrochka.kufar.by/sellers?utm_source=Android&utm_medium=link_AI&utm_campaign=ProdInstallment&utm_content=Seller", false, null, false, false, 60, null));
        }
    }

    public void onInstallmentLinkClicked() {
        Context context = getContext();
        if (context != null) {
            context.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://support.kufar.by/hc/ru/articles/360000418629?utm_source=Android&utm_medium=LinkInstallmentAIAE&utm_campaign=ProdInstalAI062020", false, null, false, false, 60, null));
        }
    }

    @Override
    public void onLinkClicked(String url) {
        kotlin.jvm.internal.s.j(url, "url");
        Context context = getContext();
        if (context != null) {
            context.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, url, false, null, false, false, 60, null));
        }
    }

    @Override
    public void onLocationClear(a.Location location) {
        kotlin.jvm.internal.s.j(location, "location");
        getViewModel().clearValue(location.getParameterValue());
    }

    @Override
    public void onLocationClick(a.Location location) {
        kotlin.jvm.internal.s.j(location, "location");
        getViewModel().openChooseLocation();
    }

    @Override
    public void onMoveImage(int from, int to2) {
        getViewModel().moveImage(from, to2);
    }

    @Override
    public void onPackageSelected(LimitPackageType limitPackage) {
        kotlin.jvm.internal.s.j(limitPackage, "limitPackage");
        getViewModel().setLimitPackage(limitPackage);
    }

    @Override
    public void onPolicyClick() {
        Context context = getContext();
        if (context != null) {
            getTracker().d();
            context.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://www.kufar.by/android_policy.htm", false, null, false, false, 60, null));
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        getViewModel().onResume();
    }

    @Override
    public void onRetryCLick(c.Default image) {
        kotlin.jvm.internal.s.j(image, "image");
        getViewModel().retry(image);
    }

    @Override
    public void onSelectClick(a.Select selectItem) {
        kotlin.jvm.internal.s.j(selectItem, "selectItem");
        xn.b parameterValue = selectItem.getParameterValue();
        if (parameterValue instanceof b.Single) {
            BottomSheetRadioButtonsFragment.Companion.b(BottomSheetRadioButtonsFragment.INSTANCE, j0.a.g(parameterValue, getAppLocale()), j0.a.d((b.Single) parameterValue, getAppLocale()), selectItem.getIsSearchEnabled(), null, 8, null).onSelectValue(new e(parameterValue, this)).show(getChildFragmentManager(), (String) null);
        } else if (parameterValue instanceof b.List) {
            BottomSheetCheckboxesButtonsFragment.Companion.b(BottomSheetCheckboxesButtonsFragment.INSTANCE, j0.a.g(parameterValue, getAppLocale()), j0.a.c((b.List) parameterValue, getAppLocale()), null, 4, null).onSelectedValues(new f(parameterValue, this)).show(getChildFragmentManager(), (String) null);
        }
    }

    @Override
    public void onSelectExternalClick(a.SelectExternal selectItem) {
        kotlin.jvm.internal.s.j(selectItem, "selectItem");
        String externalValuesUrl = selectItem.getParameterValue().getExternalValuesUrl();
        if (externalValuesUrl != null) {
            getMediator().c().a(selectItem.getLabel(), externalValuesUrl, new g(selectItem)).show(getChildFragmentManager(), TAG_DIALOG_BOTTOM_SHEET);
        }
    }

    @Override
    public void onSelectPackage(PromotePackagesWidget.PromotePackage promotePackage) {
        kotlin.jvm.internal.s.j(promotePackage, "promotePackage");
        getViewModel().setPromotePackage(promotePackage);
    }

    @Override
    public void onShowExampleClick() {
        db.d G = getMediator().G();
        Context requireContext = requireContext();
        kotlin.jvm.internal.s.i(requireContext, "requireContext(...)");
        startActivity(G.a(requireContext, PHOTO_3D_EXAMPLE));
    }

    @Override
    public void onSuggestionClick(SuggestionValue suggestion) {
        kotlin.jvm.internal.s.j(suggestion, "suggestion");
        getViewModel().selectCategory(suggestion.getParentId(), suggestion.getCategoryId());
    }

    @Override
    public void onUserAgreementClick() {
        Context context = getContext();
        if (context != null) {
            getTracker().f();
            context.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://www.kufar.by/Пользовательское_соглашение.htm", false, null, false, false, 60, null));
        }
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        kotlin.jvm.internal.s.j(view, "view");
        super.onViewCreated(view, savedInstanceState);
        setUpBinding();
        setUpViewModel();
    }

    public final void setAppLocale(b6.c cVar) {
        kotlin.jvm.internal.s.j(cVar, "<set-?>");
        this.appLocale = cVar;
    }

    public final void setAppPreferences(w5.b bVar) {
        kotlin.jvm.internal.s.j(bVar, "<set-?>");
        this.appPreferences = bVar;
    }

    public final void setMediator(cb.b bVar) {
        kotlin.jvm.internal.s.j(bVar, "<set-?>");
        this.mediator = bVar;
    }

    public final void setTracker(c0.a aVar) {
        kotlin.jvm.internal.s.j(aVar, "<set-?>");
        this.tracker = aVar;
    }

    public final void setViewModelProvider(ViewModelProvider.Factory factory) {
        kotlin.jvm.internal.s.j(factory, "<set-?>");
        this.viewModelProvider = factory;
    }

    @Override
    public void showHelperText(String title, CharSequence text) {
        kotlin.jvm.internal.s.j(title, "title");
        kotlin.jvm.internal.s.j(text, "text");
        AlertKufarDialogFragment.Companion companion = AlertKufarDialogFragment.INSTANCE;
        String string = getString(R$string.R);
        kotlin.jvm.internal.s.i(string, "getString(...)");
        AlertKufarDialogFragment.Companion.b(companion, title, text, string, null, false, false, 56, null).setPositiveClickListener(w.f3002d).show(getChildFragmentManager(), (String) null);
    }

    @Override
    public void onChangedText(b.Number parameterValue, String text) {
        kotlin.jvm.internal.s.j(parameterValue, "parameterValue");
        getViewModel().changeText(parameterValue, text);
    }

    @Override
    public void onClearClick(a.SelectExternal selectItem) {
        kotlin.jvm.internal.s.j(selectItem, "selectItem");
        getViewModel().clearValue(selectItem.getParameterValue());
    }

    @Override
    public void onSelectPackage(String productID) {
        getViewModel().setPackageProductID(productID);
    }

    @Override
    public void onClearClick(a.Category selectItem) {
        kotlin.jvm.internal.s.j(selectItem, "selectItem");
        getViewModel().clearValue(selectItem.getParameterValue());
    }
}