导航菜单

页面标题

页面副标题

Mint v5.7.3 - a.java 源代码

正在查看: Mint v5.7.3 应用的 a.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package sf;

import android.content.Context;
import io.piano.android.composer.model.Data;
import io.piano.android.composer.model.ErrorMessage;
import io.piano.android.composer.model.ExperienceResponse;
import io.piano.android.composer.model.events.ShowTemplate;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.collections.a0;
import kotlin.collections.l0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Lambda;
import kotlin.v;
import okhttp3.HttpUrl;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.HttpException;
import retrofit2.Response;
import vf.Event;

@Metadata(d1 = {"\u0000\u008a\u0001\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u001e\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\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010!\n\u0002\b\u0007\u0018\u0000 @2\u00020\u0001:\u0002#\tB9\b\u0000\u0012\u0006\u0010!\u001a\u00020\u001e\u0012\u0006\u0010%\u001a\u00020\"\u0012\u0006\u0010(\u001a\u00020&\u0012\u0006\u0010+\u001a\u00020)\u0012\u0006\u0010-\u001a\u00020\u000b\u0012\u0006\u00100\u001a\u00020.¢\u0006\u0004\b>\u0010?J\u001f\u0010\u0004\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u00028\u00000\u0003H\u0002¢\u0006\u0004\b\u0004\u0010\u0005J\u000e\u0010\t\u001a\u00020\b2\u0006\u0010\u0007\u001a\u00020\u0006J\u0016\u0010\r\u001a\u00020\u00002\u000e\u0010\f\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u000b0\nJ\u0010\u0010\u000f\u001a\u00020\u00002\b\u0010\u000e\u001a\u0004\u0018\u00010\u000bJ,\u0010\u0019\u001a\u00020\u00182\u0006\u0010\u0011\u001a\u00020\u00102\u0014\u0010\u0015\u001a\u0010\u0012\f\u0012\n\u0012\u0006\b\u0001\u0012\u00020\u00140\u00130\u00122\u0006\u0010\u0017\u001a\u00020\u0016J=\u0010\u001c\u001a\u00020\u00182\u0006\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u001b\u001a\u00020\u001a2\u0014\u0010\u0015\u001a\u0010\u0012\f\u0012\n\u0012\u0006\b\u0001\u0012\u00020\u00140\u00130\u00122\u0006\u0010\u0017\u001a\u00020\u0016H\u0000¢\u0006\u0004\b\u001c\u0010\u001dR\u0014\u0010!\u001a\u00020\u001e8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001f\u0010 R\u0014\u0010%\u001a\u00020\"8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b#\u0010$R\u0014\u0010(\u001a\u00020&8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\t\u0010'R\u0014\u0010+\u001a\u00020)8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0004\u0010*R\u0014\u0010-\u001a\u00020\u000b8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\r\u0010,R\u0014\u00100\u001a\u00020.8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0019\u0010/R#\u00107\u001a\n 2*\u0004\u0018\u000101018BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b3\u00104\u001a\u0004\b5\u00106R\u001e\u0010\f\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u000b0\n8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b5\u00108R\u0018\u0010\u000e\u001a\u0004\u0018\u00010\u000b8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u001c\u0010,R\u0018\u00109\u001a\u0004\u0018\u00010\u000b8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u000f\u0010,R\u001a\u0010=\u001a\b\u0012\u0004\u0012\u00020\u00060:8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b;\u0010<¨\u0006A"}, d2 = {"Lsf/a;", "", "T", "Lretrofit2/Response;", "d", "(Lretrofit2/Response;)Ljava/lang/Object;", "Lsf/k;", "interceptor", "", "c", "Lkotlin/Function0;", "", "browserIdProvider", "e", "userToken", "j", "Lvf/c;", "request", "", "Luf/a;", "Lwf/a;", "eventTypeListeners", "Luf/b;", "exceptionListener", "Lug/a0;", "f", "Lio/piano/android/composer/model/ExperienceResponse;", "response", "i", "(Lvf/c;Lio/piano/android/composer/model/ExperienceResponse;Ljava/util/Collection;Luf/b;)V", "Lsf/b;", "a", "Lsf/b;", "composerApi", "Lsf/l;", "b", "Lsf/l;", "generalApi", "Lsf/m;", "Lsf/m;", "httpHelper", "Lsf/q;", "Lsf/q;", "prefsStorage", "Ljava/lang/String;", "aid", "Lsf/a$c;", "Lsf/a$c;", "endpoint", "Lokhttp3/HttpUrl;", "kotlin.jvm.PlatformType", "g", "Lug/i;", "h", "()Lokhttp3/HttpUrl;", "templateUrl", "Lfh/a;", "gaClientId", "", "k", "Ljava/util/List;", "experienceInterceptors", "<init>", "(Lsf/b;Lsf/l;Lsf/m;Lsf/q;Ljava/lang/String;Lsf/a$c;)V", "l", "composer_release"}, k = 1, mv = {1, 6, 0})
public final class a {

    public static final Companion INSTANCE = new Companion(null);
    private static final Map<String, String> m;
    private static final C0082a n;

    private final b composerApi;

    private final l generalApi;

    private final m httpHelper;

    private final q prefsStorage;

    private final String aid;

    private final c endpoint;

    private final Lazy templateUrl;

    private fh.a<String> browserIdProvider;

    private String userToken;

    private String gaClientId;

    private final List<k> experienceInterceptors;

    @Metadata(d1 = {"\u0000'\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J$\u0010\b\u001a\u00020\u00072\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00020\u00032\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00020\u0005H\u0016J\u001e\u0010\u000b\u001a\u00020\u00072\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00020\u00032\u0006\u0010\n\u001a\u00020\tH\u0016¨\u0006\f"}, d2 = {"sf/a$a", "Lretrofit2/Callback;", "Lokhttp3/ResponseBody;", "Lretrofit2/Call;", "call", "Lretrofit2/Response;", "response", "Lug/a0;", "onResponse", "", "t", "onFailure", "composer_release"}, k = 1, mv = {1, 6, 0})
    public static final class C0082a implements Callback<ResponseBody> {
        C0082a() {
        }

        @Override
        public void onFailure(Call<ResponseBody> call, Throwable t) {
            kotlin.jvm.internal.m.g(call, "call");
            kotlin.jvm.internal.m.g(t, "t");
        }

        @Override
        public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
            kotlin.jvm.internal.m.g(call, "call");
            kotlin.jvm.internal.m.g(response, "response");
        }
    }

    @Metadata(d1 = {"\u0000/\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000f\n\u0002\b\u0005*\u0001\u001a\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u001d\u0010\u0015J\"\u0010\t\u001a\u00020\b2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\b\b\u0002\u0010\u0007\u001a\u00020\u0006H\u0007J\b\u0010\u000b\u001a\u00020\nH\u0007R\u0014\u0010\f\u001a\u00020\u00048\u0000X\u0080T¢\u0006\u0006\n\u0004\b\f\u0010\rR\u0014\u0010\u000e\u001a\u00020\u00048\u0000X\u0080T¢\u0006\u0006\n\u0004\b\u000e\u0010\rR\u0014\u0010\u000f\u001a\u00020\u00048\u0000X\u0080T¢\u0006\u0006\n\u0004\b\u000f\u0010\rR\u0014\u0010\u0010\u001a\u00020\u00048\u0000X\u0080T¢\u0006\u0006\n\u0004\b\u0010\u0010\rR\u0014\u0010\u0011\u001a\u00020\u00048\u0000X\u0080T¢\u0006\u0006\n\u0004\b\u0011\u0010\rR\u0014\u0010\u0012\u001a\u00020\u00048\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0012\u0010\rR\u001a\u0010\u0013\u001a\u00020\u00048\u0006X\u0086T¢\u0006\f\n\u0004\b\u0013\u0010\r\u0012\u0004\b\u0014\u0010\u0015R\u001a\u0010\u0016\u001a\u00020\u00048\u0006X\u0086T¢\u0006\f\n\u0004\b\u0016\u0010\r\u0012\u0004\b\u0017\u0010\u0015R\u001a\u0010\u0018\u001a\u00020\u00048\u0006X\u0086T¢\u0006\f\n\u0004\b\u0018\u0010\r\u0012\u0004\b\u0019\u0010\u0015R\u0014\u0010\u001b\u001a\u00020\u001a8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001b\u0010\u001c¨\u0006\u001e"}, d2 = {"Lsf/a$b;", "", "Landroid/content/Context;", "context", "", "aid", "Lsf/a$c;", "endpoint", "Lug/a0;", "b", "Lsf/a;", "a", "EVENT_GROUP_CLICK", "Ljava/lang/String;", "EVENT_GROUP_CLOSE", "EVENT_GROUP_INIT", "EVENT_TYPE_EXTERNAL_EVENT", "EVENT_TYPE_EXTERNAL_LINK", "URL_TEMPLATE", "USER_PROVIDER_JANRAIN", "getUSER_PROVIDER_JANRAIN$annotations", "()V", "USER_PROVIDER_PIANO_ID", "getUSER_PROVIDER_PIANO_ID$annotations", "USER_PROVIDER_TINYPASS_ACCOUNTS", "getUSER_PROVIDER_TINYPASS_ACCOUNTS$annotations", "sf/a$a", "emptyCallback", "Lsf/a$a;", "<init>", "composer_release"}, k = 1, mv = {1, 6, 0})
    public static final class Companion {
        private Companion() {
        }

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

        public final a a() {
            return h.INSTANCE.a().getComposer();
        }

        public final void b(Context context, String aid, c endpoint) {
            kotlin.jvm.internal.m.g(context, "context");
            kotlin.jvm.internal.m.g(aid, "aid");
            kotlin.jvm.internal.m.g(endpoint, "endpoint");
            h.INSTANCE.b(context, aid, endpoint);
        }
    }

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0002\b\u0004\u0018\u0000 \f2\u00020\u0001:\u0001\u0003B\u0017\u0012\u0006\u0010\u0007\u001a\u00020\t\u0012\u0006\u0010\b\u001a\u00020\t¢\u0006\u0004\b\n\u0010\u000bR\u001a\u0010\u0007\u001a\u00020\u00028\u0000X\u0080\u0004¢\u0006\f\n\u0004\b\u0003\u0010\u0004\u001a\u0004\b\u0005\u0010\u0006R\u001a\u0010\b\u001a\u00020\u00028\u0000X\u0080\u0004¢\u0006\f\n\u0004\b\u0005\u0010\u0004\u001a\u0004\b\u0003\u0010\u0006¨\u0006\r"}, d2 = {"Lsf/a$c;", "", "Lokhttp3/HttpUrl;", "a", "Lokhttp3/HttpUrl;", "b", "()Lokhttp3/HttpUrl;", "composerHost", "apiHost", "", "<init>", "(Ljava/lang/String;Ljava/lang/String;)V", "c", "composer_release"}, k = 1, mv = {1, 6, 0})
    public static final class c {
        public static final c d = new c("https://c2.sandbox.piano.io", "https://sandbox.piano.io");
        public static final c e = new c("https://c2.piano.io", "https://buy.piano.io");
        public static final c f = new c("https://c2-au.piano.io", "https://buy-au.piano.io");
        public static final c g = new c("https://c2-ap.piano.io", "https://buy-ap.piano.io");
        public static final c h = new c("https://c2-eu.piano.io", "https://buy-eu.piano.io");

        private final HttpUrl composerHost;

        private final HttpUrl apiHost;

        public c(String composerHost, String apiHost) {
            kotlin.jvm.internal.m.g(composerHost, "composerHost");
            kotlin.jvm.internal.m.g(apiHost, "apiHost");
            HttpUrl httpUrl = HttpUrl.get(composerHost);
            kotlin.jvm.internal.m.f(httpUrl, "get(composerHost)");
            this.composerHost = httpUrl;
            HttpUrl httpUrl2 = HttpUrl.get(apiHost);
            kotlin.jvm.internal.m.f(httpUrl2, "get(apiHost)");
            this.apiHost = httpUrl2;
        }

        public final HttpUrl getApiHost() {
            return this.apiHost;
        }

        public final HttpUrl getComposerHost() {
            return this.composerHost;
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0001\n\u0000\u0010\u0000\u001a\u0004\u0018\u00010\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
    static final class d extends Lambda implements fh.a {
        public static final d a = new d();

        d() {
            super(0);
        }

        @Override
        public final Void invoke() {
            return null;
        }
    }

    @Metadata(d1 = {"\u0000+\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u0001J0\u0010\t\u001a\u00020\b2\u0012\u0010\u0005\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u00042\u0012\u0010\u0007\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u0006H\u0016J$\u0010\f\u001a\u00020\b2\u0012\u0010\u0005\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u00042\u0006\u0010\u000b\u001a\u00020\nH\u0016¨\u0006\r"}, d2 = {"sf/a$e", "Lretrofit2/Callback;", "Lio/piano/android/composer/model/Data;", "Lio/piano/android/composer/model/ExperienceResponse;", "Lretrofit2/Call;", "call", "Lretrofit2/Response;", "response", "Lug/a0;", "onResponse", "", "t", "onFailure", "composer_release"}, k = 1, mv = {1, 6, 0})
    public static final class e implements Callback<Data<ExperienceResponse>> {
        final vf.c b;
        final Collection<uf.a<? extends wf.a>> c;
        final uf.b d;

        @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\r\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lio/piano/android/composer/model/ErrorMessage;", "it", "", "a", "(Lio/piano/android/composer/model/ErrorMessage;)Ljava/lang/CharSequence;"}, k = 3, mv = {1, 6, 0})
        static final class C0084a extends Lambda implements fh.l<ErrorMessage, CharSequence> {
            public static final C0084a a = new C0084a();

            C0084a() {
                super(1);
            }

            @Override
            public final CharSequence invoke(ErrorMessage it) {
                kotlin.jvm.internal.m.g(it, "it");
                return it.message;
            }
        }

        e(vf.c cVar, Collection<? extends uf.a<? extends wf.a>> collection, uf.b bVar) {
            this.b = cVar;
            this.c = collection;
            this.d = bVar;
        }

        @Override
        public void onFailure(Call<Data<ExperienceResponse>> call, Throwable t) {
            kotlin.jvm.internal.m.g(call, "call");
            kotlin.jvm.internal.m.g(t, "t");
            this.d.a(t instanceof sf.c ? (sf.c) t : new sf.c(t));
        }

        @Override
        public void onResponse(Call<Data<ExperienceResponse>> call, Response<Data<ExperienceResponse>> response) {
            Object b;
            Data data;
            String c0;
            kotlin.jvm.internal.m.g(call, "call");
            kotlin.jvm.internal.m.g(response, "response");
            a aVar = a.this;
            vf.c cVar = this.b;
            Collection<uf.a<? extends wf.a>> collection = this.c;
            uf.b bVar = this.d;
            try {
                Result.a aVar2 = Result.b;
                data = (Data) aVar.d(response);
            } catch (Throwable th2) {
                Result.a aVar3 = Result.b;
                b = Result.b(kotlin.r.a(th2));
            }
            if (!data.b().isEmpty()) {
                c0 = a0.c0(data.b(), "\n", null, null, 0, null, C0084a.a, 30, null);
                throw new sf.c(c0);
            }
            aVar.i(cVar, (ExperienceResponse) data.a(), collection, bVar);
            b = Result.b(kotlin.a0.a);
            uf.b bVar2 = this.d;
            Throwable d = Result.d(b);
            if (d != null) {
                bVar2.a(d instanceof sf.c ? (sf.c) d : new sf.c(d));
            }
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lokhttp3/HttpUrl;", "kotlin.jvm.PlatformType", "a", "()Lokhttp3/HttpUrl;"}, k = 3, mv = {1, 6, 0})
    static final class f extends Lambda implements fh.a<HttpUrl> {
        f() {
            super(0);
        }

        @Override
        public final HttpUrl invoke() {
            return a.this.endpoint.getApiHost().newBuilder().addPathSegments("checkout/template/show").build();
        }
    }

    static {
        Map<String, String> f2;
        f2 = l0.f(v.a("source", "CX"));
        m = f2;
        n = new C0082a();
    }

    public a(b composerApi, l generalApi, m httpHelper, q prefsStorage, String aid, c endpoint) {
        Lazy a;
        List<k> q;
        kotlin.jvm.internal.m.g(composerApi, "composerApi");
        kotlin.jvm.internal.m.g(generalApi, "generalApi");
        kotlin.jvm.internal.m.g(httpHelper, "httpHelper");
        kotlin.jvm.internal.m.g(prefsStorage, "prefsStorage");
        kotlin.jvm.internal.m.g(aid, "aid");
        kotlin.jvm.internal.m.g(endpoint, "endpoint");
        this.composerApi = composerApi;
        this.generalApi = generalApi;
        this.httpHelper = httpHelper;
        this.prefsStorage = prefsStorage;
        this.aid = aid;
        this.endpoint = endpoint;
        a = kotlin.k.a(new f());
        this.templateUrl = a;
        this.browserIdProvider = d.a;
        q = kotlin.collections.s.q(httpHelper);
        this.experienceInterceptors = q;
        if (!(aid.length() > 0)) {
            throw new IllegalArgumentException("AID can't be empty".toString());
        }
    }

    public final <T> T d(Response<T> response) {
        if (!response.isSuccessful()) {
            throw new sf.c(new HttpException(response));
        }
        T body = response.body();
        if (body != null) {
            return body;
        }
        throw new sf.c();
    }

    public static final a g() {
        return INSTANCE.a();
    }

    private final HttpUrl h() {
        return (HttpUrl) this.templateUrl.getValue();
    }

    public final boolean c(k interceptor) {
        kotlin.jvm.internal.m.g(interceptor, "interceptor");
        return this.experienceInterceptors.add(interceptor);
    }

    public final a e(fh.a<String> browserIdProvider) {
        kotlin.jvm.internal.m.g(browserIdProvider, "browserIdProvider");
        this.browserIdProvider = browserIdProvider;
        return this;
    }

    public final void f(vf.c request, Collection<? extends uf.a<? extends wf.a>> eventTypeListeners, uf.b exceptionListener) {
        kotlin.jvm.internal.m.g(request, "request");
        kotlin.jvm.internal.m.g(eventTypeListeners, "eventTypeListeners");
        kotlin.jvm.internal.m.g(exceptionListener, "exceptionListener");
        Iterator<T> it = this.experienceInterceptors.iterator();
        while (it.hasNext()) {
            ((k) it.next()).b(request);
        }
        this.composerApi.a(this.httpHelper.d(request, this.aid, this.browserIdProvider, this.userToken)).enqueue(new e(request, eventTypeListeners, exceptionListener));
    }

    public final void i(vf.c request, ExperienceResponse response, Collection<? extends uf.a<? extends wf.a>> eventTypeListeners, uf.b exceptionListener) {
        Object b;
        kotlin.jvm.internal.m.g(request, "request");
        kotlin.jvm.internal.m.g(response, "response");
        kotlin.jvm.internal.m.g(eventTypeListeners, "eventTypeListeners");
        kotlin.jvm.internal.m.g(exceptionListener, "exceptionListener");
        Iterator<T> it = this.experienceInterceptors.iterator();
        while (it.hasNext()) {
            ((k) it.next()).a(request, response);
        }
        if (eventTypeListeners.isEmpty()) {
            return;
        }
        Iterator<T> it2 = response.result.a().iterator();
        while (it2.hasNext()) {
            Event<ShowTemplate> event = (Event) it2.next();
            ShowTemplate showTemplate = event.eventData;
            if (showTemplate instanceof ShowTemplate) {
                HttpUrl.Builder newBuilder = h().newBuilder();
                for (Map.Entry<String, String> entry : this.httpHelper.c(event, request, this.aid, this.userToken, this.gaClientId).entrySet()) {
                    newBuilder.addQueryParameter(entry.getKey(), entry.getValue());
                }
                showTemplate = ShowTemplate.b(event.eventData, null, null, null, null, null, false, newBuilder.build().getUrl(), 63, null);
            }
            Event b2 = Event.b(event, null, null, showTemplate, 3, null);
            Iterator<T> it3 = eventTypeListeners.iterator();
            while (it3.hasNext()) {
                uf.a aVar = (uf.a) it3.next();
                if (aVar.a(event)) {
                    try {
                        Result.a aVar2 = Result.b;
                        aVar.b(b2);
                        b = Result.b(kotlin.a0.a);
                    } catch (Throwable th2) {
                        Result.a aVar3 = Result.b;
                        b = Result.b(kotlin.r.a(th2));
                    }
                    Throwable d2 = Result.d(b);
                    if (d2 != null) {
                        exceptionListener.a(d2 instanceof sf.c ? (sf.c) d2 : new sf.c(d2));
                    }
                }
            }
        }
    }

    public final a j(String userToken) {
        this.userToken = userToken;
        return this;
    }
}