package com.bytedance.sdk.openadsdk.lb;

import android.text.TextUtils;
import com.bytedance.sdk.openadsdk.FilterWord;
import com.bytedance.sdk.openadsdk.core.model.lse;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public class vt {
    private JSONObject dsz;
    private String duv;
    private int fhx;
    private int irt;
    private String ku;
    private lse onz;
    private FilterWord qhl;
    private String vt;
    public static FilterWord fm = new FilterWord("", "");
    public static int ro = 1;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    public static int f7451lb = 2;
    public static int yz = 3;
    public static int jnr = 4;
    private final Set<lb> ajl = new HashSet();
    private final Set<ro> wsy = new HashSet();
    private final Set<yz> wu = new HashSet();

    /* JADX INFO: renamed from: ef, reason: collision with root package name */
    private final Set<fm> f7452ef = new HashSet();

    public interface fm {
        void fm(List<FilterWord> list);
    }

    public interface lb {
        void fm(FilterWord filterWord);
    }

    public interface ro {
        void fm(int i10);
    }

    public interface yz {
        void fm(String str);
    }

    private void vt() {
        Iterator<lb> it = this.ajl.iterator();
        while (it.hasNext()) {
            it.next().fm(this.qhl);
        }
    }

    public void ajl() {
        Iterator<ro> it = this.wsy.iterator();
        while (it.hasNext()) {
            it.next().fm(jnr);
        }
    }

    public boolean ef() {
        return this.fhx < this.irt;
    }

    public void fm(int i10, int i11) {
        this.fhx = i10;
        this.irt = i11;
    }

    public void jnr() {
        Iterator<ro> it = this.wsy.iterator();
        while (it.hasNext()) {
            it.next().fm(f7451lb);
        }
    }

    public boolean lb() {
        FilterWord filterWord = this.qhl;
        return (filterWord == null || filterWord.equals(fm)) ? false : true;
    }

    public FilterWord ro() {
        return this.qhl;
    }

    public String wsy() {
        return this.duv;
    }

    public int wu() {
        return this.fhx;
    }

    public void yz() {
        lse lseVar;
        if (!lb() && !TextUtils.isEmpty(this.duv)) {
            this.qhl = new FilterWord("0:00", this.duv);
        }
        ArrayList arrayList = new ArrayList();
        arrayList.add(this.qhl);
        if (!TextUtils.isEmpty(this.vt)) {
            if (TextUtils.isEmpty(this.duv)) {
                com.bytedance.sdk.openadsdk.lb.ro.fm().fm(this.vt, arrayList, this.ku);
            } else {
                if (this.dsz == null && (lseVar = this.onz) != null) {
                    this.dsz = lseVar.dsz(true);
                }
                com.bytedance.sdk.openadsdk.lb.ro.fm().fm(this.vt, arrayList, this.dsz, this.duv, this.ku);
            }
        }
        Iterator<ro> it = this.wsy.iterator();
        while (it.hasNext()) {
            it.next().fm(ro);
        }
        fm(fm);
        lb("");
    }

    public void fm(lse lseVar) {
        this.onz = lseVar;
    }

    public void lb(String str) {
        this.duv = str;
        Iterator<yz> it = this.wu.iterator();
        while (it.hasNext()) {
            it.next().fm(this.duv);
        }
    }

    public void ro(String str) {
        this.ku = str;
    }

    public void fm(String str) {
        this.vt = str;
    }

    public void fm() {
        this.ajl.clear();
        this.wsy.clear();
        this.wu.clear();
        this.f7452ef.clear();
    }

    public void fm(FilterWord filterWord) {
        this.qhl = filterWord;
        vt();
    }

    public void fm(lb lbVar) {
        this.ajl.add(lbVar);
    }

    public void fm(ro roVar) {
        this.wsy.add(roVar);
    }

    public void fm(yz yzVar) {
        this.wu.add(yzVar);
    }

    public void fm(fm fmVar) {
        this.f7452ef.add(fmVar);
    }

    public void fm(List<FilterWord> list) {
        Iterator<fm> it = this.f7452ef.iterator();
        while (it.hasNext()) {
            it.next().fm(list);
        }
    }
}
