package ue0; import com.xingin.capa.v2.feature.ordernote.post.poster.OrderNotePostService; import com.xingin.capa.v2.feature.post.flow.report.models.ReportCommonModel; import com.xingin.capa.v2.utils.s; import dw2.r; import fz1.b; import java.util.List; import kotlin.Lazy; import kotlin.LazyKt__LazyJVMKt; import kotlin.Metadata; import kotlin.collections.CollectionsKt___CollectionsKt; import kotlin.jvm.functions.Function0; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Lambda; import okhttp3.ResponseBody; import te0.h; import te0.j; @Metadata(bv = {}, d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\b\bÆ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0013\u0010\u0014J\u0014\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00050\u00042\u0006\u0010\u0003\u001a\u00020\u0002J\u0010\u0010\b\u001a\u00020\u00072\u0006\u0010\u0003\u001a\u00020\u0002H\u0002J\u0010\u0010\f\u001a\u00020\u000b2\u0006\u0010\n\u001a\u00020\tH\u0002R\u001b\u0010\u0012\u001a\u00020\r8BX\u0002¢\u0006\f\n\u0004\b\u000e\u0010\u000f\u001a\u0004\b\u0010\u0010\u0011¨\u0006\u0015"}, d2 = {"Lue0/c;", "", "Lqf0/a;", "postSession", "Ldw2/r;", "Lokhttp3/ResponseBody;", "c", "Lte0/j;", "a", "Lcom/xingin/capa/v2/feature/post/flow/report/models/ReportCommonModel;", "reportCommonModel", "Lte0/b;", "b", "Lcom/xingin/capa/v2/feature/ordernote/post/poster/OrderNotePostService;", "orderNoteService$delegate", "Lkotlin/Lazy;", "d", "()Lcom/xingin/capa/v2/feature/ordernote/post/poster/OrderNotePostService;", "orderNoteService", "<init>", "()V", "capa_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: OrderNotePoster.kt */ public final class c { /* renamed from: a reason: collision with root package name */ public static final c f137025a = new c(); /* renamed from: b reason: collision with root package name */ public static final Lazy f137026b = LazyKt__LazyJVMKt.lazy(a.f137027a); @Metadata(bv = {}, d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Lcom/xingin/capa/v2/feature/ordernote/post/poster/OrderNotePostService;", "a", "()Lcom/xingin/capa/v2/feature/ordernote/post/poster/OrderNotePostService;"}, k = 3, mv = {1, 6, 0}) /* compiled from: OrderNotePoster.kt */ public static final class a extends Lambda implements Function0<OrderNotePostService> { /* renamed from: a reason: collision with root package name */ public static final a f137027a = new a(); public a() { super(0); } /* renamed from: a */ public final OrderNotePostService invoke() { return (OrderNotePostService) b.f80449a.d(OrderNotePostService.class); } } public final j a(qf0.a aVar) { j jVar = new j(null, b(aVar.w().getReportCommonModel()), null, 5, null); if (aVar.U()) { jVar.a(a.f137023a.a(aVar.w().getReportImageModel())); } else if (aVar.g0()) { jVar.b(b.f137024a.a(aVar.w().getReportVideoModel())); } return jVar; } public final te0.b b(ReportCommonModel reportCommonModel) { String str; String str2; String c14; List<ReportCommonModel.a> productReviews = reportCommonModel.getProductReviews(); ReportCommonModel.a aVar = productReviews != null ? (ReportCommonModel.a) CollectionsKt___CollectionsKt.firstOrNull((List) productReviews) : null; if (aVar == null) { IllegalArgumentException illegalArgumentException = new IllegalArgumentException("product reviews must not be empty in order note"); s.f(illegalArgumentException); if (g20.a.c()) { throw illegalArgumentException; } } String type = reportCommonModel.getType(); String title = reportCommonModel.getTitle(); String desc = reportCommonModel.getDesc(); int d14 = aVar != null ? aVar.d() : 0; String str3 = ""; if (aVar == null || (str = aVar.a()) == null) { str = str3; } if (aVar == null || (str2 = aVar.b()) == null) { str2 = str3; } if (!(aVar == null || (c14 = aVar.c()) == null)) { str3 = c14; } return new te0.b(type, title, desc, d14, new h(str, str2, str3)); } public final r<ResponseBody> c(qf0.a aVar) { Intrinsics.checkNotNullParameter(aVar, "postSession"); return d().createReview("https://www.xiaohongshu.com/api/store/review/v1/create_review", a(aVar)); } public final OrderNotePostService d() { return (OrderNotePostService) f137026b.getValue(); } }