package com.revenuecat.purchases.common.networking;

import W.b;
import androidx.media3.extractor.text.ttml.TtmlNode;
import g5.a;
import i5.g;
import j5.c;
import j5.d;
import k5.A;
import k5.P;
import k5.S;
import k5.a0;
import kotlin.jvm.internal.o;
import w4.InterfaceC3141c;

/* JADX INFO: loaded from: classes3.dex */
@InterfaceC3141c
public final class WebBillingPurchaseOption$$serializer implements A {
    public static final WebBillingPurchaseOption$$serializer INSTANCE;
    private static final /* synthetic */ S descriptor;

    static {
        WebBillingPurchaseOption$$serializer webBillingPurchaseOption$$serializer = new WebBillingPurchaseOption$$serializer();
        INSTANCE = webBillingPurchaseOption$$serializer;
        S s6 = new S("com.revenuecat.purchases.common.networking.WebBillingPurchaseOption", webBillingPurchaseOption$$serializer, 4);
        s6.k("base_price", true);
        s6.k(TtmlNode.RUBY_BASE, true);
        s6.k("trial", true);
        s6.k("intro_price", true);
        descriptor = s6;
    }

    private WebBillingPurchaseOption$$serializer() {
    }

    @Override // k5.A
    public a[] childSerializers() {
        a aVarH0 = b.h0(WebBillingPrice$$serializer.INSTANCE);
        WebBillingPhase$$serializer webBillingPhase$$serializer = WebBillingPhase$$serializer.INSTANCE;
        return new a[]{aVarH0, b.h0(webBillingPhase$$serializer), b.h0(webBillingPhase$$serializer), b.h0(webBillingPhase$$serializer)};
    }

    @Override // g5.a
    public WebBillingPurchaseOption deserialize(c decoder) {
        o.h(decoder, "decoder");
        g descriptor2 = getDescriptor();
        j5.a aVarB = decoder.b(descriptor2);
        int i6 = 0;
        WebBillingPrice webBillingPrice = null;
        WebBillingPhase webBillingPhase = null;
        WebBillingPhase webBillingPhase2 = null;
        WebBillingPhase webBillingPhase3 = null;
        boolean z6 = true;
        while (z6) {
            int iK = aVarB.k(descriptor2);
            if (iK == -1) {
                z6 = false;
            } else if (iK == 0) {
                webBillingPrice = (WebBillingPrice) aVarB.r(descriptor2, 0, WebBillingPrice$$serializer.INSTANCE, webBillingPrice);
                i6 |= 1;
            } else if (iK == 1) {
                webBillingPhase = (WebBillingPhase) aVarB.r(descriptor2, 1, WebBillingPhase$$serializer.INSTANCE, webBillingPhase);
                i6 |= 2;
            } else if (iK == 2) {
                webBillingPhase2 = (WebBillingPhase) aVarB.r(descriptor2, 2, WebBillingPhase$$serializer.INSTANCE, webBillingPhase2);
                i6 |= 4;
            } else {
                if (iK != 3) {
                    throw new g5.g(iK);
                }
                webBillingPhase3 = (WebBillingPhase) aVarB.r(descriptor2, 3, WebBillingPhase$$serializer.INSTANCE, webBillingPhase3);
                i6 |= 8;
            }
        }
        aVarB.c(descriptor2);
        return new WebBillingPurchaseOption(i6, webBillingPrice, webBillingPhase, webBillingPhase2, webBillingPhase3, (a0) null);
    }

    @Override // g5.a
    public g getDescriptor() {
        return descriptor;
    }

    @Override // g5.a
    public void serialize(d encoder, WebBillingPurchaseOption value) {
        o.h(encoder, "encoder");
        o.h(value, "value");
        g descriptor2 = getDescriptor();
        j5.b bVarB = encoder.b(descriptor2);
        WebBillingPurchaseOption.write$Self$purchases_defaultsBc8Release(value, bVarB, descriptor2);
        bVarB.c(descriptor2);
    }

    @Override // k5.A
    public a[] typeParametersSerializers() {
        return P.f20015b;
    }
}
