package sc;

import ca.canadapost.core.data.model.CommonErrorResponseException;
import ca.canadapost.core.data.model.ResultWrapper;
import ca.canadapost.module.homepickup.api.IHomePickupApi;
import dn.l;
import g9.s;
import g9.w;
import ha.f;
import ha.g;
import java.util.concurrent.TimeUnit;
import km.t;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.p0;
import kotlin.jvm.internal.v;
import or.u;
import uq.z;

/* loaded from: classes4.dex */
public final class d {

    /* renamed from: a, reason: collision with root package name */
    public static final a f35599a = new a(null);

    /* loaded from: classes4.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(k kVar) {
            this();
        }
    }

    /* loaded from: classes4.dex */
    static final class b extends v implements l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ t f35600p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        b(t tVar) {
            super(1);
            this.f35600p = tVar;
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final ResultWrapper.Error invoke(or.t response) {
            kotlin.jvm.internal.t.g(response, "response");
            return g.a(response, this.f35600p, p0.b(CommonErrorResponseException.class));
        }
    }

    public final IHomePickupApi a(ha.c httpClientBuilderFactory, w tokenInjectInterceptor, s authenticator, jr.a loggingInterceptor, f9.a firebaseAppCheckInterceptor, t moshi) {
        kotlin.jvm.internal.t.g(httpClientBuilderFactory, "httpClientBuilderFactory");
        kotlin.jvm.internal.t.g(tokenInjectInterceptor, "tokenInjectInterceptor");
        kotlin.jvm.internal.t.g(authenticator, "authenticator");
        kotlin.jvm.internal.t.g(loggingInterceptor, "loggingInterceptor");
        kotlin.jvm.internal.t.g(firebaseAppCheckInterceptor, "firebaseAppCheckInterceptor");
        kotlin.jvm.internal.t.g(moshi, "moshi");
        u.b b10 = new u.b().c("https://www.canadapost-postescanada.ca/mgw/").b(qr.a.g(moshi));
        z.a a10 = httpClientBuilderFactory.a();
        TimeUnit timeUnit = TimeUnit.SECONDS;
        Object b11 = b10.g(a10.e(20L, timeUnit).N(20L, timeUnit).P(20L, timeUnit).a(tokenInjectInterceptor).a(firebaseAppCheckInterceptor).c(authenticator).a(loggingInterceptor).d()).a(new f(new b(moshi))).e().b(IHomePickupApi.class);
        kotlin.jvm.internal.t.f(b11, "create(...)");
        return (IHomePickupApi) b11;
    }
}
