APKPure.apk(点击下载) / i.java


package e.i.a;

import android.graphics.Matrix;
import android.support.v4.media.session.PlaybackStateCompat;
import android.util.Xml;
import com.caverock.androidsvg.SVGParseException;
import com.tencent.raft.codegenmeta.utils.Constants;
import com.yalantis.ucrop.R;
import com.yalantis.ucrop.view.CropImageView;
import e.i.a.b;
import e.i.a.e;
import e.i.a.g;
import i.v.b.m;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.ext.DefaultHandler2;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class i {

    /* renamed from: a  reason: collision with root package name */
    public g f8822a = null;
    public g.i0 b = null;
    public boolean c = false;
    public int d;

    /* renamed from: e  reason: collision with root package name */
    public boolean f8823e = false;

    /* renamed from: f  reason: collision with root package name */
    public h f8824f = null;

    /* renamed from: g  reason: collision with root package name */
    public StringBuilder f8825g = null;

    /* renamed from: h  reason: collision with root package name */
    public boolean f8826h = false;

    /* renamed from: i  reason: collision with root package name */
    public StringBuilder f8827i = null;

    public static class b {

        /* renamed from: a  reason: collision with root package name */
        public static final Map<String, e.a> f8828a;

        static {
            HashMap hashMap = new HashMap(10);
            f8828a = hashMap;
            hashMap.put("none", e.a.none);
            hashMap.put("xMinYMin", e.a.xMinYMin);
            hashMap.put("xMidYMin", e.a.xMidYMin);
            hashMap.put("xMaxYMin", e.a.xMaxYMin);
            hashMap.put("xMinYMid", e.a.xMinYMid);
            hashMap.put("xMidYMid", e.a.xMidYMid);
            hashMap.put("xMaxYMid", e.a.xMaxYMid);
            hashMap.put("xMinYMax", e.a.xMinYMax);
            hashMap.put("xMidYMax", e.a.xMidYMax);
            hashMap.put("xMaxYMax", e.a.xMaxYMax);
        }
    }

    public static class c {

        /* renamed from: a  reason: collision with root package name */
        public static final Map<String, Integer> f8829a;

        static {
            HashMap hashMap = new HashMap(47);
            f8829a = hashMap;
            hashMap.put("aliceblue", -984833);
            hashMap.put("antiquewhite", -332841);
            hashMap.put("aqua", -16711681);
            e.d.a.a.a.q0(-8388652, hashMap, "aquamarine", -983041, "azure", -657956, "beige", -6972, "bisque");
            e.d.a.a.a.q0(-16777216, hashMap, "black", -5171, "blanchedalmond", -16776961, "blue", -7722014, "blueviolet");
            e.d.a.a.a.q0(-5952982, hashMap, "brown", -2180985, "burlywood", -10510688, "cadetblue", -8388864, "chartreuse");
            e.d.a.a.a.q0(-2987746, hashMap, "chocolate", -32944, "coral", -10185235, "cornflowerblue", -1828, "cornsilk");
            hashMap.put("crimson", -2354116);
            hashMap.put("cyan", -16711681);
            hashMap.put("darkblue", -16777077);
            hashMap.put("darkcyan", -16741493);
            hashMap.put("darkgoldenrod", -4684277);
            hashMap.put("darkgray", -5658199);
            hashMap.put("darkgreen", -16751616);
            hashMap.put("darkgrey", -5658199);
            hashMap.put("darkkhaki", -4343957);
            e.d.a.a.a.q0(-7667573, hashMap, "darkmagenta", -11179217, "darkolivegreen", -29696, "darkorange", -6737204, "darkorchid");
            e.d.a.a.a.q0(-7667712, hashMap, "darkred", -1468806, "darksalmon", -7357297, "darkseagreen", -12042869, "darkslateblue");
            hashMap.put("darkslategray", -13676721);
            hashMap.put("darkslategrey", -13676721);
            hashMap.put("darkturquoise", -16724271);
            hashMap.put("darkviolet", -7077677);
            hashMap.put("deeppink", -60269);
            hashMap.put("deepskyblue", -16728065);
            hashMap.put("dimgray", -9868951);
            hashMap.put("dimgrey", -9868951);
            e.d.a.a.a.q0(-14774017, hashMap, "dodgerblue", -5103070, "firebrick", -1296, "floralwhite", -14513374, "forestgreen");
            hashMap.put("fuchsia", -65281);
            hashMap.put("gainsboro", -2302756);
            hashMap.put("ghostwhite", -460545);
            hashMap.put("gold", -10496);
            hashMap.put("goldenrod", -2448096);
            hashMap.put("gray", -8355712);
            hashMap.put("green", -16744448);
            hashMap.put("greenyellow", -5374161);
            hashMap.put("grey", -8355712);
            e.d.a.a.a.q0(-983056, hashMap, "honeydew", -38476, "hotpink", -3318692, "indianred", -11861886, "indigo");
            e.d.a.a.a.q0(-16, hashMap, "ivory", -989556, "khaki", -1644806, "lavender", -3851, "lavenderblush");
            e.d.a.a.a.q0(-8586240, hashMap, "lawngreen", -1331, "lemonchiffon", -5383962, "lightblue", -1015680, "lightcoral");
            hashMap.put("lightcyan", -2031617);
            hashMap.put("lightgoldenrodyellow", -329006);
            hashMap.put("lightgray", -2894893);
            hashMap.put("lightgreen", -7278960);
            hashMap.put("lightgrey", -2894893);
            hashMap.put("lightpink", -18751);
            hashMap.put("lightsalmon", -24454);
            hashMap.put("lightseagreen", -14634326);
            hashMap.put("lightskyblue", -7876870);
            hashMap.put("lightslategray", -8943463);
            hashMap.put("lightslategrey", -8943463);
            hashMap.put("lightsteelblue", -5192482);
            hashMap.put("lightyellow", -32);
            hashMap.put("lime", -16711936);
            hashMap.put("limegreen", -13447886);
            hashMap.put("linen", -331546);
            hashMap.put("magenta", -65281);
            hashMap.put("maroon", -8388608);
            hashMap.put("mediumaquamarine", -10039894);
            e.d.a.a.a.q0(-16777011, hashMap, "mediumblue", -4565549, "mediumorchid", -7114533, "mediumpurple", -12799119, "mediumseagreen");
            e.d.a.a.a.q0(-8689426, hashMap, "mediumslateblue", -16713062, "mediumspringgreen", -12004916, "mediumturquoise", -3730043, "mediumvioletred");
            e.d.a.a.a.q0(-15132304, hashMap, "midnightblue", -655366, "mintcream", -6943, "mistyrose", -6987, "moccasin");
            e.d.a.a.a.q0(-8531, hashMap, "navajowhite", -16777088, "navy", -133658, "oldlace", -8355840, "olive");
            e.d.a.a.a.q0(-9728477, hashMap, "olivedrab", -23296, "orange", -47872, "orangered", -2461482, "orchid");
            e.d.a.a.a.q0(-1120086, hashMap, "palegoldenrod", -6751336, "palegreen", -5247250, "paleturquoise", -2396013, "palevioletred");
            e.d.a.a.a.q0(-4139, hashMap, "papayawhip", -9543, "peachpuff", -3308225, "peru", -16181, "pink");
            e.d.a.a.a.q0(-2252579, hashMap, "plum", -5185306, "powderblue", -8388480, "purple", -10079335, "rebeccapurple");
            e.d.a.a.a.q0(-65536, hashMap, "red", -4419697, "rosybrown", -12490271, "royalblue", -7650029, "saddlebrown");
            e.d.a.a.a.q0(-360334, hashMap, "salmon", -744352, "sandybrown", -13726889, "seagreen", -2578, "seashell");
            e.d.a.a.a.q0(-6270419, hashMap, "sienna", -4144960, "silver", -7876885, "skyblue", -9807155, "slateblue");
            hashMap.put("slategray", -9404272);
            hashMap.put("slategrey", -9404272);
            hashMap.put("snow", -1286);
            hashMap.put("springgreen", -16711809);
            e.d.a.a.a.q0(-12156236, hashMap, "steelblue", -2968436, "tan", -16744320, "teal", -2572328, "thistle");
            e.d.a.a.a.q0(-40121, hashMap, "tomato", -12525360, "turquoise", -1146130, "violet", -663885, "wheat");
            e.d.a.a.a.q0(-1, hashMap, "white", -657931, "whitesmoke", -256, "yellow", -6632142, "yellowgreen");
            hashMap.put("transparent", 0);
        }
    }

    public static class d {

        /* renamed from: a  reason: collision with root package name */
        public static final Map<String, g.o> f8830a;

        static {
            HashMap hashMap = new HashMap(9);
            f8830a = hashMap;
            g.c1 c1Var = g.c1.pt;
            hashMap.put("xx-small", new g.o(0.694f, c1Var));
            hashMap.put("x-small", new g.o(0.833f, c1Var));
            hashMap.put("small", new g.o(10.0f, c1Var));
            hashMap.put("medium", new g.o(12.0f, c1Var));
            hashMap.put("large", new g.o(14.4f, c1Var));
            hashMap.put("x-large", new g.o(17.3f, c1Var));
            hashMap.put("xx-large", new g.o(20.7f, c1Var));
            g.c1 c1Var2 = g.c1.percent;
            hashMap.put("smaller", new g.o(83.33f, c1Var2));
            hashMap.put("larger", new g.o(120.0f, c1Var2));
        }
    }

    public static class e {

        /* renamed from: a  reason: collision with root package name */
        public static final Map<String, Integer> f8831a;

        static {
            HashMap hashMap = new HashMap(13);
            f8831a = hashMap;
            hashMap.put("normal", 400);
            hashMap.put("bold", 700);
            e.d.a.a.a.q0(1, hashMap, "bolder", -1, "lighter", 100, "100", m.d.DEFAULT_DRAG_ANIMATION_DURATION, "200");
            hashMap.put("300", 300);
            hashMap.put("400", 400);
            hashMap.put("500", Integer.valueOf((int) CropImageView.DEFAULT_IMAGE_TO_CROP_BOUNDS_ANIM_DURATION));
            hashMap.put("600", 600);
            hashMap.put("700", 700);
            hashMap.put("800", 800);
            hashMap.put("900", 900);
        }
    }

    public class f extends DefaultHandler2 {
        public f(a aVar) {
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void characters(char[] cArr, int i2, int i3) throws SAXException {
            i.this.L(new String(cArr, i2, i3));
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void endDocument() throws SAXException {
            Objects.requireNonNull(i.this);
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void endElement(String str, String str2, String str3) throws SAXException {
            i.this.c(str, str2, str3);
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void processingInstruction(String str, String str2) throws SAXException {
            i.this.E(new C0181i(str2));
            Objects.requireNonNull(i.this);
            str.equals("xml-stylesheet");
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void startDocument() throws SAXException {
            i iVar = i.this;
            Objects.requireNonNull(iVar);
            iVar.f8822a = new g();
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void startElement(String str, String str2, String str3, Attributes attributes) throws SAXException {
            i.this.J(str, str2, str3, attributes);
        }
    }

    public enum g {
        CLASS,
        clip,
        clip_path,
        clipPathUnits,
        clip_rule,
        color,
        cx,
        cy,
        direction,
        dx,
        dy,
        fx,
        fy,
        d,
        display,
        fill,
        fill_rule,
        fill_opacity,
        font,
        font_family,
        font_size,
        font_weight,
        font_style,
        gradientTransform,
        gradientUnits,
        height,
        href,
        image_rendering,
        marker,
        marker_start,
        marker_mid,
        marker_end,
        markerHeight,
        markerUnits,
        markerWidth,
        mask,
        maskContentUnits,
        maskUnits,
        media,
        offset,
        opacity,
        orient,
        overflow,
        pathLength,
        patternContentUnits,
        patternTransform,
        patternUnits,
        points,
        preserveAspectRatio,
        r,
        refX,
        refY,
        requiredFeatures,
        requiredExtensions,
        requiredFormats,
        requiredFonts,
        rx,
        ry,
        solid_color,
        solid_opacity,
        spreadMethod,
        startOffset,
        stop_color,
        stop_opacity,
        stroke,
        stroke_dasharray,
        stroke_dashoffset,
        stroke_linecap,
        stroke_linejoin,
        stroke_miterlimit,
        stroke_opacity,
        stroke_width,
        style,
        systemLanguage,
        text_anchor,
        text_decoration,
        transform,
        E0,
        vector_effect,
        G0,
        viewBox,
        width,
        x,
        y,
        x1,
        y1,
        x2,
        y2,
        viewport_fill,
        viewport_fill_opacity,
        visibility,
        UNSUPPORTED;
        
        public static final Map<String, g> T0 = new HashMap();

        /* access modifiers changed from: public */
        static {
            g[] values = values();
            for (int i2 = 0; i2 < 92; i2++) {
                g gVar = values[i2];
                if (gVar == CLASS) {
                    T0.put(Constants.Service.CLASS, gVar);
                } else if (gVar != UNSUPPORTED) {
                    T0.put(gVar.name().replace('_', '-'), gVar);
                }
            }
        }

        public static g a(String str) {
            g gVar = T0.get(str);
            return gVar != null ? gVar : UNSUPPORTED;
        }
    }

    public enum h {
        svg,
        a,
        circle,
        clipPath,
        defs,
        desc,
        ellipse,
        g,
        image,
        line,
        linearGradient,
        marker,
        mask,
        path,
        pattern,
        polygon,
        polyline,
        radialGradient,
        rect,
        solidColor,
        stop,
        style,
        SWITCH,
        symbol,
        text,
        textPath,
        title,
        tref,
        tspan,
        use,
        J,
        UNSUPPORTED;
        
        public static final Map<String, h> L = new HashMap();

        /* access modifiers changed from: public */
        static {
            h[] values = values();
            for (int i2 = 0; i2 < 32; i2++) {
                h hVar = values[i2];
                if (hVar == SWITCH) {
                    L.put("switch", hVar);
                } else if (hVar != UNSUPPORTED) {
                    L.put(hVar.name(), hVar);
                }
            }
        }
    }

    /* renamed from: e.i.a.i$i  reason: collision with other inner class name */
    public static class C0181i {

        /* renamed from: a  reason: collision with root package name */
        public String f8865a;
        public int b = 0;
        public int c = 0;
        public d d = new d();

        public C0181i(String str) {
            String trim = str.trim();
            this.f8865a = trim;
            this.c = trim.length();
        }

        public int a() {
            int i2 = this.b;
            int i3 = this.c;
            if (i2 == i3) {
                return -1;
            }
            int i4 = i2 + 1;
            this.b = i4;
            if (i4 < i3) {
                return this.f8865a.charAt(i4);
            }
            return -1;
        }

        public Boolean b(Object obj) {
            if (obj == null) {
                return null;
            }
            q();
            int i2 = this.b;
            if (i2 == this.c) {
                return null;
            }
            char charAt = this.f8865a.charAt(i2);
            if (charAt != '0' && charAt != '1') {
                return null;
            }
            boolean z = true;
            this.b++;
            if (charAt != '1') {
                z = false;
            }
            return Boolean.valueOf(z);
        }

        public float c(float f2) {
            if (Float.isNaN(f2)) {
                return Float.NaN;
            }
            q();
            return i();
        }

        public boolean d(char c2) {
            int i2 = this.b;
            boolean z = i2 < this.c && this.f8865a.charAt(i2) == c2;
            if (z) {
                this.b++;
            }
            return z;
        }

        public boolean e(String str) {
            int length = str.length();
            int i2 = this.b;
            boolean z = i2 <= this.c - length && this.f8865a.substring(i2, i2 + length).equals(str);
            if (z) {
                this.b += length;
            }
            return z;
        }

        public boolean f() {
            return this.b == this.c;
        }

        public boolean g(int i2) {
            return i2 == 32 || i2 == 10 || i2 == 13 || i2 == 9;
        }

        public Integer h() {
            int i2 = this.b;
            if (i2 == this.c) {
                return null;
            }
            String str = this.f8865a;
            this.b = i2 + 1;
            return Integer.valueOf(str.charAt(i2));
        }

        public float i() {
            float a2 = this.d.a(this.f8865a, this.b, this.c);
            if (!Float.isNaN(a2)) {
                this.b = this.d.f8656a;
            }
            return a2;
        }

        public g.o j() {
            float i2 = i();
            if (Float.isNaN(i2)) {
                return null;
            }
            g.c1 o2 = o();
            return o2 == null ? new g.o(i2, g.c1.px) : new g.o(i2, o2);
        }

        public String k() {
            int a2;
            if (f()) {
                return null;
            }
            int i2 = this.b;
            char charAt = this.f8865a.charAt(i2);
            if (charAt != '\'' && charAt != '\"') {
                return null;
            }
            do {
                a2 = a();
                if (a2 == -1) {
                    break;
                }
            } while (a2 != charAt);
            if (a2 == -1) {
                this.b = i2;
                return null;
            }
            int i3 = this.b + 1;
            this.b = i3;
            return this.f8865a.substring(i2 + 1, i3 - 1);
        }

        public String l() {
            return n(' ', false);
        }

        public String m(char c2) {
            return n(c2, false);
        }

        public String n(char c2, boolean z) {
            if (f()) {
                return null;
            }
            char charAt = this.f8865a.charAt(this.b);
            if ((!z && g(charAt)) || charAt == c2) {
                return null;
            }
            int i2 = this.b;
            while (true) {
                int a2 = a();
                if (a2 == -1 || a2 == c2 || (!z && g(a2))) {
                }
            }
            return this.f8865a.substring(i2, this.b);
        }

        public g.c1 o() {
            if (f()) {
                return null;
            }
            if (this.f8865a.charAt(this.b) == '%') {
                this.b++;
                return g.c1.percent;
            }
            int i2 = this.b;
            if (i2 > this.c - 2) {
                return null;
            }
            try {
                g.c1 valueOf = g.c1.valueOf(this.f8865a.substring(i2, i2 + 2).toLowerCase(Locale.US));
                this.b += 2;
                return valueOf;
            } catch (IllegalArgumentException unused) {
                return null;
            }
        }

        public float p() {
            q();
            float a2 = this.d.a(this.f8865a, this.b, this.c);
            if (!Float.isNaN(a2)) {
                this.b = this.d.f8656a;
            }
            return a2;
        }

        public boolean q() {
            r();
            int i2 = this.b;
            if (i2 == this.c || this.f8865a.charAt(i2) != ',') {
                return false;
            }
            this.b++;
            r();
            return true;
        }

        public void r() {
            while (true) {
                int i2 = this.b;
                if (i2 < this.c && g(this.f8865a.charAt(i2))) {
                    this.b++;
                } else {
                    return;
                }
            }
        }
    }

    public class j implements Attributes {

        /* renamed from: a  reason: collision with root package name */
        public XmlPullParser f8866a;

        public j(i iVar, XmlPullParser xmlPullParser) {
            this.f8866a = xmlPullParser;
        }

        public int getIndex(String str) {
            return -1;
        }

        public int getIndex(String str, String str2) {
            return -1;
        }

        public int getLength() {
            return this.f8866a.getAttributeCount();
        }

        public String getLocalName(int i2) {
            return this.f8866a.getAttributeName(i2);
        }

        public String getQName(int i2) {
            String attributeName = this.f8866a.getAttributeName(i2);
            if (this.f8866a.getAttributePrefix(i2) == null) {
                return attributeName;
            }
            return this.f8866a.getAttributePrefix(i2) + ':' + attributeName;
        }

        @Override // org.xml.sax.Attributes
        public String getType(int i2) {
            return null;
        }

        @Override // org.xml.sax.Attributes
        public String getType(String str) {
            return null;
        }

        public String getType(String str, String str2) {
            return null;
        }

        public String getURI(int i2) {
            return this.f8866a.getAttributeNamespace(i2);
        }

        @Override // org.xml.sax.Attributes
        public String getValue(int i2) {
            return this.f8866a.getAttributeValue(i2);
        }

        @Override // org.xml.sax.Attributes
        public String getValue(String str) {
            return null;
        }

        public String getValue(String str, String str2) {
            return null;
        }
    }

    public static g.o A(C0181i iVar) {
        return iVar.e("auto") ? new g.o(CropImageView.DEFAULT_ASPECT_RATIO) : iVar.j();
    }

    public static Float B(String str) {
        try {
            float t2 = t(str);
            if (t2 < CropImageView.DEFAULT_ASPECT_RATIO) {
                t2 = CropImageView.DEFAULT_ASPECT_RATIO;
            } else if (t2 > 1.0f) {
                t2 = 1.0f;
            }
            return Float.valueOf(t2);
        } catch (SVGParseException unused) {
            return null;
        }
    }

    public static g.n0 C(String str) {
        if (!str.startsWith("url(")) {
            return r(str);
        }
        int indexOf = str.indexOf(")");
        g.n0 n0Var = null;
        if (indexOf == -1) {
            return new g.t(str.substring(4).trim(), null);
        }
        String trim = str.substring(4, indexOf).trim();
        String trim2 = str.substring(indexOf + 1).trim();
        if (trim2.length() > 0) {
            n0Var = r(trim2);
        }
        return new g.t(trim, n0Var);
    }

    public static void D(g.o0 o0Var, String str) throws SVGParseException {
        C0181i iVar = new C0181i(str);
        iVar.r();
        String l2 = iVar.l();
        if ("defer".equals(l2)) {
            iVar.r();
            l2 = iVar.l();
        }
        e.a aVar = b.f8828a.get(l2);
        e.b bVar = null;
        iVar.r();
        if (!iVar.f()) {
            String l3 = iVar.l();
            l3.hashCode();
            if (l3.equals("meet")) {
                bVar = e.b.meet;
            } else if (l3.equals("slice")) {
                bVar = e.b.slice;
            } else {
                throw new SVGParseException(e.d.a.a.a.H("Invalid preserveAspectRatio definition: ", str));
            }
        }
        o0Var.f8759n = new e(aVar, bVar);
    }

    /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARNING: Code restructure failed: missing block: B:129:0x0237, code lost:
        if (r15.equals("optimizeQuality") == false) goto L_0x0239;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:229:0x040a, code lost:
        if (r15.equals("line-through") == false) goto L_0x040c;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:257:0x0461, code lost:
        if (r15.equals("middle") == false) goto L_0x0463;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:297:0x04f7, code lost:
        if (r15.equals("hidden") == false) goto L_0x04f9;
     */
    /* JADX WARNING: Removed duplicated region for block: B:132:0x023c  */
    /* JADX WARNING: Removed duplicated region for block: B:136:0x0247  */
    /* JADX WARNING: Removed duplicated region for block: B:139:0x024d  */
    /* JADX WARNING: Removed duplicated region for block: B:260:0x0466  */
    /* JADX WARNING: Removed duplicated region for block: B:264:0x0471  */
    /* JADX WARNING: Removed duplicated region for block: B:267:0x0477  */
    /* JADX WARNING: Removed duplicated region for block: B:357:? A[RETURN, SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:365:? A[RETURN, SYNTHETIC] */
    public static void I(g.d0 d0Var, String str, String str2) {
        long j2;
        long j3;
        long j4;
        long j5;
        g.o oVar;
        g.o j6;
        g.f fVar = g.f.b;
        if (str2.length() != 0 && !str2.equals("inherit")) {
            int ordinal = g.a(str).ordinal();
            g.b bVar = null;
            g.d0.d dVar = null;
            g.d0.c cVar = null;
            r3 = null;
            r3 = null;
            r3 = null;
            r3 = null;
            r3 = null;
            g.o[] oVarArr = null;
            g.d0.e eVar = null;
            g.o oVar2 = null;
            String str3 = null;
            g.d0.EnumC0178g gVar = null;
            g.d0.f fVar2 = null;
            g.d0.i iVar = null;
            Boolean bool = null;
            g.d0.h hVar = null;
            bVar = null;
            bVar = null;
            if (ordinal == 1) {
                if (!"auto".equals(str2) && str2.startsWith("rect(")) {
                    C0181i iVar2 = new C0181i(str2.substring(5));
                    iVar2.r();
                    g.o A = A(iVar2);
                    iVar2.q();
                    g.o A2 = A(iVar2);
                    iVar2.q();
                    g.o A3 = A(iVar2);
                    iVar2.q();
                    g.o A4 = A(iVar2);
                    iVar2.r();
                    if (iVar2.d(')') || iVar2.f()) {
                        bVar = new g.b(A, A2, A3, A4);
                    }
                }
                d0Var.x = bVar;
                if (bVar != null) {
                    j2 = d0Var.b;
                    j3 = PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED;
                } else {
                    return;
                }
            } else if (ordinal == 2) {
                d0Var.J = x(str2);
                j2 = d0Var.b;
                j3 = 268435456;
            } else if (ordinal != 4) {
                if (ordinal == 5) {
                    d0Var.f8699o = q(str2);
                    j4 = d0Var.b;
                    j5 = PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM;
                } else if (ordinal == 8) {
                    if (str2.equals("ltr")) {
                        hVar = g.d0.h.LTR;
                    } else if (str2.equals("rtl")) {
                        hVar = g.d0.h.RTL;
                    }
                    d0Var.u = hVar;
                    if (hVar != null) {
                        j2 = d0Var.b;
                        j3 = 68719476736L;
                    } else {
                        return;
                    }
                } else if (ordinal == 35) {
                    d0Var.L = x(str2);
                    j2 = d0Var.b;
                    j3 = 1073741824;
                } else if (ordinal != 40) {
                    char c2 = 0;
                    if (ordinal == 42) {
                        switch (str2.hashCode()) {
                            case -1217487446:
                                break;
                            case -907680051:
                                if (str2.equals("scroll")) {
                                    c2 = 1;
                                    break;
                                }
                                c2 = 65535;
                                break;
                            case 3005871:
                                if (str2.equals("auto")) {
                                    c2 = 2;
                                    break;
                                }
                                c2 = 65535;
                                break;
                            case 466743410:
                                if (str2.equals("visible")) {
                                    c2 = 3;
                                    break;
                                }
                                c2 = 65535;
                                break;
                            default:
                                c2 = 65535;
                                break;
                        }
                        if (c2 == 0 || c2 == 1) {
                            bool = Boolean.FALSE;
                        } else if (c2 == 2 || c2 == 3) {
                            bool = Boolean.TRUE;
                        }
                        d0Var.w = bool;
                        if (bool != null) {
                            j2 = d0Var.b;
                            j3 = PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE_ENABLED;
                        } else {
                            return;
                        }
                    } else if (ordinal == 78) {
                        if (str2.equals("none")) {
                            iVar = g.d0.i.None;
                        } else if (str2.equals("non-scaling-stroke")) {
                            iVar = g.d0.i.NonScalingStroke;
                        }
                        d0Var.Q = iVar;
                        if (iVar != null) {
                            j2 = d0Var.b;
                            j3 = 34359738368L;
                        } else {
                            return;
                        }
                    } else if (ordinal == 58) {
                        if (str2.equals("currentColor")) {
                            d0Var.M = fVar;
                        } else {
                            d0Var.M = q(str2);
                        }
                        j2 = d0Var.b;
                        j3 = 2147483648L;
                    } else if (ordinal == 59) {
                        d0Var.N = B(str2);
                        j2 = d0Var.b;
                        j3 = 4294967296L;
                    } else if (ordinal == 74) {
                        int hashCode = str2.hashCode();
                        if (hashCode != -1074341483) {
                            if (hashCode != 100571) {
                                if (hashCode == 109757538 && str2.equals("start")) {
                                    c2 = 2;
                                    if (c2 == 0) {
                                        fVar2 = g.d0.f.Middle;
                                    } else if (c2 == 1) {
                                        fVar2 = g.d0.f.End;
                                    } else if (c2 == 2) {
                                        fVar2 = g.d0.f.Start;
                                    }
                                    d0Var.v = fVar2;
                                    if (fVar2 != null) {
                                        j2 = d0Var.b;
                                        j3 = PlaybackStateCompat.ACTION_SET_REPEAT_MODE;
                                    } else {
                                        return;
                                    }
                                }
                            } else if (str2.equals("end")) {
                                c2 = 1;
                                if (c2 == 0) {
                                }
                                d0Var.v = fVar2;
                                if (fVar2 != null) {
                                }
                            }
                        }
                        c2 = 65535;
                        if (c2 == 0) {
                        }
                        d0Var.v = fVar2;
                        if (fVar2 != null) {
                        }
                    } else if (ordinal != 75) {
                        switch (ordinal) {
                            case 14:
                                if (str2.indexOf(R.styleable.AppCompatTheme_windowMinWidthMajor) < 0) {
                                    if ("|inline|block|list-item|run-in|compact|marker|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|none|".contains('|' + str2 + '|')) {
                                        d0Var.B = Boolean.valueOf(!str2.equals("none"));
                                        j2 = d0Var.b;
                                        j3 = 16777216;
                                        break;
                                    } else {
                                        return;
                                    }
                                } else {
                                    return;
                                }
                            case 15:
                                g.n0 C = C(str2);
                                d0Var.c = C;
                                if (C != null) {
                                    j2 = d0Var.b;
                                    j3 = 1;
                                    break;
                                } else {
                                    return;
                                }
                            case 16:
                                g.d0.a s2 = s(str2);
                                d0Var.d = s2;
                                if (s2 != null) {
                                    j2 = d0Var.b;
                                    j3 = 2;
                                    break;
                                } else {
                                    return;
                                }
                            case 17:
                                Float B = B(str2);
                                d0Var.f8689e = B;
                                if (B != null) {
                                    j2 = d0Var.b;
                                    j3 = 4;
                                    break;
                                } else {
                                    return;
                                }
                            case 18:
                                if ("|caption|icon|menu|message-box|small-caption|status-bar|".contains('|' + str2 + '|')) {
                                    C0181i iVar3 = new C0181i(str2);
                                    Integer num = null;
                                    g.d0.b bVar2 = null;
                                    String str4 = null;
                                    while (true) {
                                        String m2 = iVar3.m('/');
                                        iVar3.r();
                                        if (m2 != null) {
                                            if (num == null || bVar2 == null) {
                                                if (!m2.equals("normal") && ((num != null || (num = e.f8831a.get(m2)) == null) && (bVar2 != null || (bVar2 = w(m2)) == null))) {
                                                    if (str4 == null && m2.equals("small-caps")) {
                                                        str4 = m2;
                                                    }
                                                }
                                            }
                                            try {
                                                oVar = d.f8830a.get(m2);
                                                if (oVar == null) {
                                                    oVar = y(m2);
                                                }
                                            } catch (SVGParseException unused) {
                                                oVar = null;
                                            }
                                            if (iVar3.d('/')) {
                                                iVar3.r();
                                                String l2 = iVar3.l();
                                                if (l2 != null) {
                                                    try {
                                                        y(l2);
                                                    } catch (SVGParseException unused2) {
                                                        return;
                                                    }
                                                }
                                                iVar3.r();
                                            }
                                            if (!iVar3.f()) {
                                                int i2 = iVar3.b;
                                                iVar3.b = iVar3.c;
                                                str3 = iVar3.f8865a.substring(i2);
                                            }
                                            d0Var.f8700p = v(str3);
                                            d0Var.f8701q = oVar;
                                            d0Var.f8702r = Integer.valueOf(num == null ? 400 : num.intValue());
                                            if (bVar2 == null) {
                                                bVar2 = g.d0.b.Normal;
                                            }
                                            d0Var.f8703s = bVar2;
                                            d0Var.b |= 122880;
                                            return;
                                        }
                                        return;
                                    }
                                }
                                return;
                            case 19:
                                List<String> v = v(str2);
                                d0Var.f8700p = v;
                                if (v != null) {
                                    j2 = d0Var.b;
                                    j3 = PlaybackStateCompat.ACTION_PLAY_FROM_URI;
                                    break;
                                } else {
                                    return;
                                }
                            case 20:
                                try {
                                    g.o oVar3 = d.f8830a.get(str2);
                                    if (oVar3 == null) {
                                        oVar3 = y(str2);
                                    }
                                    oVar2 = oVar3;
                                } catch (SVGParseException unused3) {
                                }
                                d0Var.f8701q = oVar2;
                                if (oVar2 != null) {
                                    j2 = d0Var.b;
                                    j3 = PlaybackStateCompat.ACTION_PREPARE;
                                    break;
                                } else {
                                    return;
                                }
                            case 21:
                                Integer num2 = e.f8831a.get(str2);
                                d0Var.f8702r = num2;
                                if (num2 != null) {
                                    j2 = d0Var.b;
                                    j3 = PlaybackStateCompat.ACTION_PREPARE_FROM_MEDIA_ID;
                                    break;
                                } else {
                                    return;
                                }
                            case 22:
                                g.d0.b w = w(str2);
                                d0Var.f8703s = w;
                                if (w != null) {
                                    j2 = d0Var.b;
                                    j3 = PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH;
                                    break;
                                } else {
                                    return;
                                }
                            default:
                                switch (ordinal) {
                                    case 27:
                                        int hashCode2 = str2.hashCode();
                                        if (hashCode2 == -933002398) {
                                            break;
                                        } else if (hashCode2 != 3005871) {
                                            if (hashCode2 == 362741610 && str2.equals("optimizeSpeed")) {
                                                c2 = 2;
                                                if (c2 == 0) {
                                                    eVar = g.d0.e.optimizeQuality;
                                                } else if (c2 == 1) {
                                                    eVar = g.d0.e.auto;
                                                } else if (c2 == 2) {
                                                    eVar = g.d0.e.optimizeSpeed;
                                                }
                                                d0Var.R = eVar;
                                                if (eVar != null) {
                                                    j2 = d0Var.b;
                                                    j3 = 137438953472L;
                                                    break;
                                                } else {
                                                    return;
                                                }
                                            }
                                        } else if (str2.equals("auto")) {
                                            c2 = 1;
                                            if (c2 == 0) {
                                            }
                                            d0Var.R = eVar;
                                            if (eVar != null) {
                                            }
                                        }
                                        c2 = 65535;
                                        if (c2 == 0) {
                                        }
                                        d0Var.R = eVar;
                                        if (eVar != null) {
                                        }
                                    case 28:
                                        String x = x(str2);
                                        d0Var.y = x;
                                        d0Var.z = x;
                                        d0Var.A = x;
                                        j2 = d0Var.b;
                                        j3 = 14680064;
                                        break;
                                    case 29:
                                        d0Var.y = x(str2);
                                        j2 = d0Var.b;
                                        j3 = PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE;
                                        break;
                                    case R.styleable.AppCompatTheme_actionModeTheme:
                                        d0Var.z = x(str2);
                                        j2 = d0Var.b;
                                        j3 = 4194304;
                                        break;
                                    case R.styleable.AppCompatTheme_actionModeWebSearchDrawable:
                                        d0Var.A = x(str2);
                                        j2 = d0Var.b;
                                        j3 = 8388608;
                                        break;
                                    default:
                                        switch (ordinal) {
                                            case R.styleable.AppCompatTheme_dialogPreferredPadding:
                                                if (str2.equals("currentColor")) {
                                                    d0Var.H = fVar;
                                                } else {
                                                    try {
                                                        d0Var.H = q(str2);
                                                    } catch (SVGParseException e2) {
                                                        e2.getMessage();
                                                        return;
                                                    }
                                                }
                                                j2 = d0Var.b;
                                                j3 = 67108864;
                                                break;
                                            case R.styleable.AppCompatTheme_dialogTheme:
                                                d0Var.I = B(str2);
                                                j2 = d0Var.b;
                                                j3 = 134217728;
                                                break;
                                            case R.styleable.AppCompatTheme_dividerHorizontal:
                                                g.n0 C2 = C(str2);
                                                d0Var.f8690f = C2;
                                                if (C2 != null) {
                                                    j2 = d0Var.b;
                                                    j3 = 8;
                                                    break;
                                                } else {
                                                    return;
                                                }
                                            case R.styleable.AppCompatTheme_dividerVertical:
                                                j3 = 512;
                                                if ("none".equals(str2)) {
                                                    d0Var.f8696l = null;
                                                } else {
                                                    C0181i iVar4 = new C0181i(str2);
                                                    iVar4.r();
                                                    if (!iVar4.f() && (j6 = iVar4.j()) != null && !j6.i()) {
                                                        float f2 = j6.b;
                                                        ArrayList arrayList = new ArrayList();
                                                        arrayList.add(j6);
                                                        while (true) {
                                                            if (!iVar4.f()) {
                                                                iVar4.q();
                                                                g.o j7 = iVar4.j();
                                                                if (j7 != null && !j7.i()) {
                                                                    arrayList.add(j7);
                                                                    f2 += j7.b;
                                                                }
                                                            } else if (f2 != CropImageView.DEFAULT_ASPECT_RATIO) {
                                                                oVarArr = (g.o[]) arrayList.toArray(new g.o[arrayList.size()]);
                                                            }
                                                        }
                                                    }
                                                    d0Var.f8696l = oVarArr;
                                                    if (oVarArr == null) {
                                                        return;
                                                    }
                                                }
                                                j2 = d0Var.b;
                                                break;
                                            case 66:
                                                d0Var.f8697m = y(str2);
                                                j4 = d0Var.b;
                                                j5 = PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID;
                                                break;
                                            case R.styleable.AppCompatTheme_dropdownListPreferredItemHeight:
                                                if ("butt".equals(str2)) {
                                                    cVar = g.d0.c.Butt;
                                                } else if ("round".equals(str2)) {
                                                    cVar = g.d0.c.Round;
                                                } else if ("square".equals(str2)) {
                                                    cVar = g.d0.c.Square;
                                                }
                                                d0Var.f8693i = cVar;
                                                if (cVar != null) {
                                                    j2 = d0Var.b;
                                                    j3 = 64;
                                                    break;
                                                } else {
                                                    return;
                                                }
                                            case R.styleable.AppCompatTheme_editTextBackground:
                                                if ("miter".equals(str2)) {
                                                    dVar = g.d0.d.Miter;
                                                } else if ("round".equals(str2)) {
                                                    dVar = g.d0.d.Round;
                                                } else if ("bevel".equals(str2)) {
                                                    dVar = g.d0.d.Bevel;
                                                }
                                                d0Var.f8694j = dVar;
                                                if (dVar != null) {
                                                    j2 = d0Var.b;
                                                    j3 = 128;
                                                    break;
                                                } else {
                                                    return;
                                                }
                                            case 69:
                                                d0Var.f8695k = Float.valueOf(t(str2));
                                                j4 = d0Var.b;
                                                j5 = 256;
                                                break;
                                            case R.styleable.AppCompatTheme_editTextStyle:
                                                Float B2 = B(str2);
                                                d0Var.f8691g = B2;
                                                if (B2 != null) {
                                                    j2 = d0Var.b;
                                                    j3 = 16;
                                                    break;
                                                } else {
                                                    return;
                                                }
                                            case R.styleable.AppCompatTheme_homeAsUpIndicator:
                                                d0Var.f8692h = y(str2);
                                                j4 = d0Var.b;
                                                j5 = 32;
                                                break;
                                            default:
                                                switch (ordinal) {
                                                    case R.styleable.AppCompatTheme_panelMenuListWidth:
                                                        if (str2.equals("currentColor")) {
                                                            d0Var.O = fVar;
                                                        } else {
                                                            d0Var.O = q(str2);
                                                        }
                                                        j2 = d0Var.b;
                                                        j3 = 8589934592L;
                                                        break;
                                                    case R.styleable.AppCompatTheme_popupMenuStyle:
                                                        d0Var.P = B(str2);
                                                        j2 = d0Var.b;
                                                        j3 = 17179869184L;
                                                        break;
                                                    case 90:
                                                        if (str2.indexOf(R.styleable.AppCompatTheme_windowMinWidthMajor) < 0) {
                                                            if ("|visible|hidden|collapse|".contains('|' + str2 + '|')) {
                                                                d0Var.C = Boolean.valueOf(str2.equals("visible"));
                                                                j2 = d0Var.b;
                                                                j3 = 33554432;
                                                                break;
                                                            } else {
                                                                return;
                                                            }
                                                        } else {
                                                            return;
                                                        }
                                                    default:
                                                        return;
                                                }
                                        }
                                }
                        }
                    } else {
                        switch (str2.hashCode()) {
                            case -1171789332:
                                break;
                            case -1026963764:
                                if (str2.equals("underline")) {
                                    c2 = 1;
                                    break;
                                }
                                c2 = 65535;
                                break;
                            case 3387192:
                                if (str2.equals("none")) {
                                    c2 = 2;
                                    break;
                                }
                                c2 = 65535;
                                break;
                            case 93826908:
                                if (str2.equals("blink")) {
                                    c2 = 3;
                                    break;
                                }
                                c2 = 65535;
                                break;
                            case 529818312:
                                if (str2.equals("overline")) {
                                    c2 = 4;
                                    break;
                                }
                                c2 = 65535;
                                break;
                            default:
                                c2 = 65535;
                                break;
                        }
                        if (c2 == 0) {
                            gVar = g.d0.EnumC0178g.LineThrough;
                        } else if (c2 == 1) {
                            gVar = g.d0.EnumC0178g.Underline;
                        } else if (c2 == 2) {
                            gVar = g.d0.EnumC0178g.None;
                        } else if (c2 == 3) {
                            gVar = g.d0.EnumC0178g.Blink;
                        } else if (c2 == 4) {
                            gVar = g.d0.EnumC0178g.Overline;
                        }
                        d0Var.f8704t = gVar;
                        if (gVar != null) {
                            j2 = d0Var.b;
                            j3 = PlaybackStateCompat.ACTION_PREPARE_FROM_URI;
                        } else {
                            return;
                        }
                    }
                } else {
                    d0Var.f8698n = B(str2);
                    j2 = d0Var.b;
                    j3 = PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH;
                }
                d0Var.b = j4 | j5;
                return;
            } else {
                d0Var.K = s(str2);
                j2 = d0Var.b;
                j3 = 536870912;
            }
            d0Var.b = j2 | j3;
        }
    }

    public static int b(float f2) {
        if (f2 < CropImageView.DEFAULT_ASPECT_RATIO) {
            return 0;
        }
        if (f2 > 255.0f) {
            return 255;
        }
        return Math.round(f2);
    }

    public static int d(float f2, float f3, float f4) {
        float f5 = CropImageView.DEFAULT_ASPECT_RATIO;
        int i2 = (f2 > CropImageView.DEFAULT_ASPECT_RATIO ? 1 : (f2 == CropImageView.DEFAULT_ASPECT_RATIO ? 0 : -1));
        float f6 = f2 % 360.0f;
        if (i2 < 0) {
            f6 += 360.0f;
        }
        float f7 = f6 / 60.0f;
        float f8 = f3 / 100.0f;
        float f9 = f4 / 100.0f;
        if (f8 < CropImageView.DEFAULT_ASPECT_RATIO) {
            f8 = CropImageView.DEFAULT_ASPECT_RATIO;
        } else if (f8 > 1.0f) {
            f8 = 1.0f;
        }
        if (f9 >= CropImageView.DEFAULT_ASPECT_RATIO) {
            f5 = f9 > 1.0f ? 1.0f : f9;
        }
        float f10 = f5 <= 0.5f ? (f8 + 1.0f) * f5 : (f5 + f8) - (f8 * f5);
        float f11 = (f5 * 2.0f) - f10;
        return b(e(f11, f10, f7 - 2.0f) * 256.0f) | (b(e(f11, f10, f7 + 2.0f) * 256.0f) << 16) | (b(e(f11, f10, f7) * 256.0f) << 8);
    }

    public static float e(float f2, float f3, float f4) {
        if (f4 < CropImageView.DEFAULT_ASPECT_RATIO) {
            f4 += 6.0f;
        }
        if (f4 >= 6.0f) {
            f4 -= 6.0f;
        }
        return f4 < 1.0f ? e.d.a.a.a.a(f3, f2, f4, f2) : f4 < 3.0f ? f3 : f4 < 4.0f ? e.d.a.a.a.a(4.0f, f4, f3 - f2, f2) : f2;
    }

    public static g.e q(String str) throws SVGParseException {
        int i2;
        long j2;
        int i3 = 4;
        if (str.charAt(0) == '#') {
            int length = str.length();
            c cVar = null;
            if (1 < length) {
                long j3 = 0;
                int i4 = 1;
                while (true) {
                    if (i4 >= length) {
                        break;
                    }
                    char charAt = str.charAt(i4);
                    if (charAt < '0' || charAt > '9') {
                        if (charAt < 'A' || charAt > 'F') {
                            if (charAt < 'a' || charAt > 'f') {
                                break;
                            }
                            j2 = j3 * 16;
                            i2 = charAt - 'a';
                        } else {
                            j2 = j3 * 16;
                            i2 = charAt - 'A';
                        }
                        j3 = j2 + ((long) i2) + 10;
                    } else {
                        j3 = (j3 * 16) + ((long) (charAt - '0'));
                    }
                    if (j3 > 4294967295L) {
                        break;
                    }
                    i4++;
                }
                if (i4 != 1) {
                    cVar = new c(j3, i4);
                }
            }
            if (cVar != null) {
                int i5 = cVar.f8655a;
                if (i5 == 4) {
                    int i6 = (int) cVar.b;
                    int i7 = i6 & 3840;
                    int i8 = i6 & 240;
                    int i9 = i6 & 15;
                    return new g.e(i9 | (i7 << 8) | -16777216 | (i7 << 12) | (i8 << 8) | (i8 << 4) | (i9 << 4));
                } else if (i5 == 5) {
                    int i10 = (int) cVar.b;
                    int i11 = 61440 & i10;
                    int i12 = i10 & 3840;
                    int i13 = i10 & 240;
                    int i14 = i10 & 15;
                    return new g.e((i14 << 24) | (i14 << 28) | (i11 << 8) | (i11 << 4) | (i12 << 4) | i12 | i13 | (i13 >> 4));
                } else if (i5 == 7) {
                    return new g.e(((int) cVar.b) | -16777216);
                } else {
                    if (i5 == 9) {
                        int i15 = (int) cVar.b;
                        return new g.e((i15 << 24) | (i15 >>> 8));
                    }
                    throw new SVGParseException(e.d.a.a.a.H("Bad hex colour value: ", str));
                }
            } else {
                throw new SVGParseException(e.d.a.a.a.H("Bad hex colour value: ", str));
            }
        } else {
            String lowerCase = str.toLowerCase(Locale.US);
            boolean startsWith = lowerCase.startsWith("rgba(");
            if (startsWith || lowerCase.startsWith("rgb(")) {
                if (startsWith) {
                    i3 = 5;
                }
                C0181i iVar = new C0181i(str.substring(i3));
                iVar.r();
                float i16 = iVar.i();
                if (!Float.isNaN(i16) && iVar.d('%')) {
                    i16 = (i16 * 256.0f) / 100.0f;
                }
                float c2 = iVar.c(i16);
                if (!Float.isNaN(c2) && iVar.d('%')) {
                    c2 = (c2 * 256.0f) / 100.0f;
                }
                float c3 = iVar.c(c2);
                if (!Float.isNaN(c3) && iVar.d('%')) {
                    c3 = (c3 * 256.0f) / 100.0f;
                }
                if (startsWith) {
                    float c4 = iVar.c(c3);
                    iVar.r();
                    if (!Float.isNaN(c4) && iVar.d(')')) {
                        return new g.e((b(c4 * 256.0f) << 24) | (b(i16) << 16) | (b(c2) << 8) | b(c3));
                    }
                    throw new SVGParseException(e.d.a.a.a.H("Bad rgba() colour value: ", str));
                }
                iVar.r();
                if (!Float.isNaN(c3) && iVar.d(')')) {
                    return new g.e((b(i16) << 16) | -16777216 | (b(c2) << 8) | b(c3));
                }
                throw new SVGParseException(e.d.a.a.a.H("Bad rgb() colour value: ", str));
            }
            boolean startsWith2 = lowerCase.startsWith("hsla(");
            if (startsWith2 || lowerCase.startsWith("hsl(")) {
                if (startsWith2) {
                    i3 = 5;
                }
                C0181i iVar2 = new C0181i(str.substring(i3));
                iVar2.r();
                float i17 = iVar2.i();
                float c5 = iVar2.c(i17);
                if (!Float.isNaN(c5)) {
                    iVar2.d('%');
                }
                float c6 = iVar2.c(c5);
                if (!Float.isNaN(c6)) {
                    iVar2.d('%');
                }
                if (startsWith2) {
                    float c7 = iVar2.c(c6);
                    iVar2.r();
                    if (!Float.isNaN(c7) && iVar2.d(')')) {
                        return new g.e((b(c7 * 256.0f) << 24) | d(i17, c5, c6));
                    }
                    throw new SVGParseException(e.d.a.a.a.H("Bad hsla() colour value: ", str));
                }
                iVar2.r();
                if (!Float.isNaN(c6) && iVar2.d(')')) {
                    return new g.e(d(i17, c5, c6) | -16777216);
                }
                throw new SVGParseException(e.d.a.a.a.H("Bad hsl() colour value: ", str));
            }
            Integer num = c.f8829a.get(lowerCase);
            if (num != null) {
                return new g.e(num.intValue());
            }
            throw new SVGParseException(e.d.a.a.a.H("Invalid colour keyword: ", lowerCase));
        }
    }

    public static g.n0 r(String str) {
        if (str.equals("none")) {
            return g.e.d;
        }
        if (str.equals("currentColor")) {
            return g.f.b;
        }
        try {
            return q(str);
        } catch (SVGParseException unused) {
            return null;
        }
    }

    public static g.d0.a s(String str) {
        if ("nonzero".equals(str)) {
            return g.d0.a.NonZero;
        }
        if ("evenodd".equals(str)) {
            return g.d0.a.EvenOdd;
        }
        return null;
    }

    public static float t(String str) throws SVGParseException {
        int length = str.length();
        if (length != 0) {
            return u(str, 0, length);
        }
        throw new SVGParseException("Invalid float value (empty string)");
    }

    public static float u(String str, int i2, int i3) throws SVGParseException {
        float a2 = new d().a(str, i2, i3);
        if (!Float.isNaN(a2)) {
            return a2;
        }
        throw new SVGParseException(e.d.a.a.a.H("Invalid float value: ", str));
    }

    public static List<String> v(String str) {
        C0181i iVar = new C0181i(str);
        ArrayList arrayList = null;
        do {
            String k2 = iVar.k();
            if (k2 == null) {
                k2 = iVar.n(',', true);
            }
            if (k2 == null) {
                break;
            }
            if (arrayList == null) {
                arrayList = new ArrayList();
            }
            arrayList.add(k2);
            iVar.q();
        } while (!iVar.f());
        return arrayList;
    }

    public static g.d0.b w(String str) {
        char c2 = 65535;
        switch (str.hashCode()) {
            case -1657669071:
                if (str.equals("oblique")) {
                    c2 = 0;
                    break;
                }
                break;
            case -1178781136:
                if (str.equals("italic")) {
                    c2 = 1;
                    break;
                }
                break;
            case -1039745817:
                if (str.equals("normal")) {
                    c2 = 2;
                    break;
                }
                break;
        }
        switch (c2) {
            case 0:
                return g.d0.b.Oblique;
            case 1:
                return g.d0.b.Italic;
            case 2:
                return g.d0.b.Normal;
            default:
                return null;
        }
    }

    public static String x(String str) {
        if (str.equals("none") || !str.startsWith("url(")) {
            return null;
        }
        return (str.endsWith(")") ? str.substring(4, str.length() - 1) : str.substring(4)).trim();
    }

    public static g.o y(String str) throws SVGParseException {
        if (str.length() != 0) {
            int length = str.length();
            g.c1 c1Var = g.c1.px;
            char charAt = str.charAt(length - 1);
            if (charAt == '%') {
                length--;
                c1Var = g.c1.percent;
            } else if (length > 2 && Character.isLetter(charAt) && Character.isLetter(str.charAt(length - 2))) {
                length -= 2;
                try {
                    c1Var = g.c1.valueOf(str.substring(length).toLowerCase(Locale.US));
                } catch (IllegalArgumentException unused) {
                    throw new SVGParseException(e.d.a.a.a.H("Invalid length unit specifier: ", str));
                }
            }
            try {
                return new g.o(u(str, 0, length), c1Var);
            } catch (NumberFormatException e2) {
                throw new SVGParseException(e.d.a.a.a.H("Invalid length value: ", str), e2);
            }
        } else {
            throw new SVGParseException("Invalid length value (empty string)");
        }
    }

    public static List<g.o> z(String str) throws SVGParseException {
        if (str.length() != 0) {
            ArrayList arrayList = new ArrayList(1);
            C0181i iVar = new C0181i(str);
            iVar.r();
            while (!iVar.f()) {
                float i2 = iVar.i();
                if (Float.isNaN(i2)) {
                    StringBuilder Z = e.d.a.a.a.Z("Invalid length list value: ");
                    int i3 = iVar.b;
                    while (!iVar.f() && !iVar.g(iVar.f8865a.charAt(iVar.b))) {
                        iVar.b++;
                    }
                    String substring = iVar.f8865a.substring(i3, iVar.b);
                    iVar.b = i3;
                    Z.append(substring);
                    throw new SVGParseException(Z.toString());
                }
                g.c1 o2 = iVar.o();
                if (o2 == null) {
                    o2 = g.c1.px;
                }
                arrayList.add(new g.o(i2, o2));
                iVar.q();
            }
            return arrayList;
        }
        throw new SVGParseException("Invalid length list (empty string)");
    }

    public final Map<String, String> E(C0181i iVar) {
        HashMap hashMap = new HashMap();
        iVar.r();
        while (true) {
            String m2 = iVar.m('=');
            if (m2 == null) {
                return hashMap;
            }
            iVar.d('=');
            hashMap.put(m2, iVar.k());
            iVar.r();
        }
    }

    public final Matrix F(String str) throws SVGParseException {
        Matrix matrix = new Matrix();
        C0181i iVar = new C0181i(str);
        iVar.r();
        while (!iVar.f()) {
            String str2 = null;
            if (!iVar.f()) {
                int i2 = iVar.b;
                int charAt = iVar.f8865a.charAt(i2);
                while (true) {
                    if ((charAt < 97 || charAt > 122) && (charAt < 65 || charAt > 90)) {
                        int i3 = iVar.b;
                    } else {
                        charAt = iVar.a();
                    }
                }
                int i32 = iVar.b;
                while (iVar.g(charAt)) {
                    charAt = iVar.a();
                }
                if (charAt == 40) {
                    iVar.b++;
                    str2 = iVar.f8865a.substring(i2, i32);
                } else {
                    iVar.b = i2;
                }
            }
            if (str2 != null) {
                char c2 = 65535;
                switch (str2.hashCode()) {
                    case -1081239615:
                        if (str2.equals("matrix")) {
                            c2 = 0;
                            break;
                        }
                        break;
                    case -925180581:
                        if (str2.equals("rotate")) {
                            c2 = 1;
                            break;
                        }
                        break;
                    case 109250890:
                        if (str2.equals("scale")) {
                            c2 = 2;
                            break;
                        }
                        break;
                    case 109493390:
                        if (str2.equals("skewX")) {
                            c2 = 3;
                            break;
                        }
                        break;
                    case 109493391:
                        if (str2.equals("skewY")) {
                            c2 = 4;
                            break;
                        }
                        break;
                    case 1052832078:
                        if (str2.equals("translate")) {
                            c2 = 5;
                            break;
                        }
                        break;
                }
                switch (c2) {
                    case 0:
                        iVar.r();
                        float i4 = iVar.i();
                        iVar.q();
                        float i5 = iVar.i();
                        iVar.q();
                        float i6 = iVar.i();
                        iVar.q();
                        float i7 = iVar.i();
                        iVar.q();
                        float i8 = iVar.i();
                        iVar.q();
                        float i9 = iVar.i();
                        iVar.r();
                        if (!Float.isNaN(i9) && iVar.d(')')) {
                            Matrix matrix2 = new Matrix();
                            matrix2.setValues(new float[]{i4, i6, i8, i5, i7, i9, 0.0f, 0.0f, 1.0f});
                            matrix.preConcat(matrix2);
                            break;
                        } else {
                            throw new SVGParseException(e.d.a.a.a.H("Invalid transform list: ", str));
                        }
                    case 1:
                        iVar.r();
                        float i10 = iVar.i();
                        float p2 = iVar.p();
                        float p3 = iVar.p();
                        iVar.r();
                        if (Float.isNaN(i10) || !iVar.d(')')) {
                            throw new SVGParseException(e.d.a.a.a.H("Invalid transform list: ", str));
                        } else if (Float.isNaN(p2)) {
                            matrix.preRotate(i10);
                            break;
                        } else if (!Float.isNaN(p3)) {
                            matrix.preRotate(i10, p2, p3);
                            break;
                        } else {
                            throw new SVGParseException(e.d.a.a.a.H("Invalid transform list: ", str));
                        }
                    case 2:
                        iVar.r();
                        float i11 = iVar.i();
                        float p4 = iVar.p();
                        iVar.r();
                        if (!Float.isNaN(i11) && iVar.d(')')) {
                            if (!Float.isNaN(p4)) {
                                matrix.preScale(i11, p4);
                                break;
                            } else {
                                matrix.preScale(i11, i11);
                                break;
                            }
                        } else {
                            throw new SVGParseException(e.d.a.a.a.H("Invalid transform list: ", str));
                        }
                        break;
                    case 3:
                        iVar.r();
                        float i12 = iVar.i();
                        iVar.r();
                        if (!Float.isNaN(i12) && iVar.d(')')) {
                            matrix.preSkew((float) Math.tan(Math.toRadians((double) i12)), CropImageView.DEFAULT_ASPECT_RATIO);
                            break;
                        } else {
                            throw new SVGParseException(e.d.a.a.a.H("Invalid transform list: ", str));
                        }
                        break;
                    case 4:
                        iVar.r();
                        float i13 = iVar.i();
                        iVar.r();
                        if (!Float.isNaN(i13) && iVar.d(')')) {
                            matrix.preSkew(CropImageView.DEFAULT_ASPECT_RATIO, (float) Math.tan(Math.toRadians((double) i13)));
                            break;
                        } else {
                            throw new SVGParseException(e.d.a.a.a.H("Invalid transform list: ", str));
                        }
                        break;
                    case 5:
                        iVar.r();
                        float i14 = iVar.i();
                        float p5 = iVar.p();
                        iVar.r();
                        if (!Float.isNaN(i14) && iVar.d(')')) {
                            if (!Float.isNaN(p5)) {
                                matrix.preTranslate(i14, p5);
                                break;
                            } else {
                                matrix.preTranslate(i14, CropImageView.DEFAULT_ASPECT_RATIO);
                                break;
                            }
                        } else {
                            throw new SVGParseException(e.d.a.a.a.H("Invalid transform list: ", str));
                        }
                        break;
                    default:
                        throw new SVGParseException(e.d.a.a.a.J("Invalid transform list fn: ", str2, ")"));
                }
                if (iVar.f()) {
                    return matrix;
                }
                iVar.q();
            } else {
                throw new SVGParseException(e.d.a.a.a.H("Bad transform function encountered in transform list: ", str));
            }
        }
        return matrix;
    }

    public final void G(InputStream inputStream) throws SVGParseException {
        try {
            SAXParserFactory newInstance = SAXParserFactory.newInstance();
            newInstance.setFeature("http://xml.org/sax/features/external-general-entities", false);
            newInstance.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
            XMLReader xMLReader = newInstance.newSAXParser().getXMLReader();
            f fVar = new f(null);
            xMLReader.setContentHandler(fVar);
            xMLReader.setProperty("http://xml.org/sax/properties/lexical-handler", fVar);
            xMLReader.parse(new InputSource(inputStream));
        } catch (ParserConfigurationException e2) {
            throw new SVGParseException("XML parser problem", e2);
        } catch (SAXException e3) {
            throw new SVGParseException("SVG parse error", e3);
        } catch (IOException e4) {
            throw new SVGParseException("Stream error", e4);
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:42:0x00f4, code lost:
        r9 = move-exception;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:44:0x00fd, code lost:
        throw new com.caverock.androidsvg.SVGParseException("XML parser problem", r9);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:57:?, code lost:
        return;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Removed duplicated region for block: B:42:0x00f4 A[ExcHandler: XmlPullParserException (r9v1 'e' org.xmlpull.v1.XmlPullParserException A[CUSTOM_DECLARE]), Splitter:B:0:0x0000] */
    public final void H(InputStream inputStream, boolean z) throws SVGParseException {
        try {
            XmlPullParser newPullParser = Xml.newPullParser();
            j jVar = new j(this, newPullParser);
            newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-docdecl", false);
            newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", true);
            newPullParser.setInput(inputStream, null);
            for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.nextToken()) {
                if (eventType == 0) {
                    this.f8822a = new g();
                } else if (eventType == 8) {
                    newPullParser.getText();
                    C0181i iVar = new C0181i(newPullParser.getText());
                    String l2 = iVar.l();
                    E(iVar);
                    l2.equals("xml-stylesheet");
                } else if (eventType != 10) {
                    if (eventType == 2) {
                        String name = newPullParser.getName();
                        if (newPullParser.getPrefix() != null) {
                            name = newPullParser.getPrefix() + ':' + name;
                        }
                        J(newPullParser.getNamespace(), newPullParser.getName(), name, jVar);
                    } else if (eventType == 3) {
                        String name2 = newPullParser.getName();
                        if (newPullParser.getPrefix() != null) {
                            name2 = newPullParser.getPrefix() + ':' + name2;
                        }
                        c(newPullParser.getNamespace(), newPullParser.getName(), name2);
                    } else if (eventType == 4) {
                        int[] iArr = new int[2];
                        M(newPullParser.getTextCharacters(iArr), iArr[0], iArr[1]);
                    } else if (eventType == 5) {
                        L(newPullParser.getText());
                    }
                } else if (z && this.f8822a.f8668a == null && newPullParser.getText().contains("<!ENTITY ")) {
                    inputStream.reset();
                    G(inputStream);
                    return;
                }
            }
        } catch (XmlPullParserException e2) {
        } catch (IOException e3) {
            throw new SVGParseException("Stream error", e3);
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:584:0x00e6, code lost:
        continue;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:607:0x0428, code lost:
        continue;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:634:0x05ea, code lost:
        continue;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:663:0x0947, code lost:
        continue;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:703:0x0c60, code lost:
        continue;
     */
    /* JADX WARNING: Removed duplicated region for block: B:384:0x0847  */
    /* JADX WARNING: Removed duplicated region for block: B:649:0x0879 A[SYNTHETIC] */
    public final void J(String str, String str2, String str3, Attributes attributes) throws SVGParseException {
        Boolean bool;
        boolean z;
        char charAt;
        float f2;
        float f3;
        float f4;
        float f5;
        float f6;
        float f7;
        float f8;
        float f9;
        float f10;
        float f11;
        float f12;
        float f13;
        boolean z2;
        Attributes attributes2 = attributes;
        Boolean bool2 = Boolean.TRUE;
        Boolean bool3 = Boolean.FALSE;
        if (this.c) {
            this.d++;
        } else if ("http://www.w3.org/2000/svg".equals(str) || "".equals(str)) {
            h hVar = h.L.get(str2.length() > 0 ? str2 : str3);
            if (hVar == null) {
                hVar = h.UNSUPPORTED;
            }
            int ordinal = hVar.ordinal();
            float f14 = CropImageView.DEFAULT_ASPECT_RATIO;
            int i2 = 0;
            switch (ordinal) {
                case 0:
                    g.e0 e0Var = new g.e0();
                    e0Var.f8752a = this.f8822a;
                    e0Var.b = this.b;
                    i(e0Var, attributes2);
                    l(e0Var, attributes2);
                    h(e0Var, attributes2);
                    o(e0Var, attributes2);
                    for (int i3 = 0; i3 < attributes.getLength(); i3++) {
                        String trim = attributes2.getValue(i3).trim();
                        int ordinal2 = g.a(attributes2.getLocalName(i3)).ordinal();
                        if (ordinal2 == 25) {
                            g.o y = y(trim);
                            e0Var.f8721s = y;
                            if (y.i()) {
                                throw new SVGParseException("Invalid <svg> element. height cannot be negative");
                            }
                        } else if (ordinal2 != 79) {
                            switch (ordinal2) {
                                case R.styleable.AppCompatTheme_listPreferredItemHeightSmall:
                                    g.o y2 = y(trim);
                                    e0Var.f8720r = y2;
                                    if (!y2.i()) {
                                        continue;
                                    } else {
                                        throw new SVGParseException("Invalid <svg> element. width cannot be negative");
                                    }
                                case R.styleable.AppCompatTheme_listPreferredItemPaddingEnd:
                                    e0Var.f8718p = y(trim);
                                    continue;
                                case 83:
                                    e0Var.f8719q = y(trim);
                                    continue;
                            }
                        } else {
                            continue;
                        }
                    }
                    g.i0 i0Var = this.b;
                    if (i0Var == null) {
                        this.f8822a.f8668a = e0Var;
                    } else {
                        i0Var.c(e0Var);
                    }
                    this.b = e0Var;
                    return;
                case 1:
                case 7:
                    if (this.b != null) {
                        g.l lVar = new g.l();
                        lVar.f8752a = this.f8822a;
                        lVar.b = this.b;
                        i(lVar, attributes2);
                        l(lVar, attributes2);
                        n(lVar, attributes2);
                        h(lVar, attributes2);
                        this.b.c(lVar);
                        this.b = lVar;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 2:
                    g.i0 i0Var2 = this.b;
                    if (i0Var2 != null) {
                        g.c cVar = new g.c();
                        cVar.f8752a = this.f8822a;
                        cVar.b = i0Var2;
                        i(cVar, attributes2);
                        l(cVar, attributes2);
                        n(cVar, attributes2);
                        h(cVar, attributes2);
                        for (int i4 = 0; i4 < attributes.getLength(); i4++) {
                            String trim2 = attributes2.getValue(i4).trim();
                            int ordinal3 = g.a(attributes2.getLocalName(i4)).ordinal();
                            if (ordinal3 == 6) {
                                cVar.f8677o = y(trim2);
                            } else if (ordinal3 == 7) {
                                cVar.f8678p = y(trim2);
                            } else if (ordinal3 != 49) {
                                continue;
                            } else {
                                g.o y3 = y(trim2);
                                cVar.f8679q = y3;
                                if (y3.i()) {
                                    throw new SVGParseException("Invalid <circle> element. r cannot be negative");
                                }
                            }
                        }
                        this.b.c(cVar);
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 3:
                    if (this.b != null) {
                        g.d dVar = new g.d();
                        dVar.f8752a = this.f8822a;
                        dVar.b = this.b;
                        i(dVar, attributes2);
                        l(dVar, attributes2);
                        n(dVar, attributes2);
                        h(dVar, attributes2);
                        for (int i5 = 0; i5 < attributes.getLength(); i5++) {
                            String trim3 = attributes2.getValue(i5).trim();
                            if (g.a(attributes2.getLocalName(i5)).ordinal() == 3) {
                                if ("objectBoundingBox".equals(trim3)) {
                                    bool = bool3;
                                } else if ("userSpaceOnUse".equals(trim3)) {
                                    bool = bool2;
                                } else {
                                    throw new SVGParseException("Invalid value for attribute clipPathUnits");
                                }
                                dVar.f8688o = bool;
                            }
                        }
                        this.b.c(dVar);
                        this.b = dVar;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 4:
                    if (this.b != null) {
                        g.C0179g gVar = new g.C0179g();
                        gVar.f8752a = this.f8822a;
                        gVar.b = this.b;
                        i(gVar, attributes2);
                        l(gVar, attributes2);
                        n(gVar, attributes2);
                        this.b.c(gVar);
                        this.b = gVar;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 5:
                case 26:
                    this.f8823e = true;
                    this.f8824f = hVar;
                    return;
                case 6:
                    g.i0 i0Var3 = this.b;
                    if (i0Var3 != null) {
                        g.h hVar2 = new g.h();
                        hVar2.f8752a = this.f8822a;
                        hVar2.b = i0Var3;
                        i(hVar2, attributes2);
                        l(hVar2, attributes2);
                        n(hVar2, attributes2);
                        h(hVar2, attributes2);
                        for (int i6 = 0; i6 < attributes.getLength(); i6++) {
                            String trim4 = attributes2.getValue(i6).trim();
                            int ordinal4 = g.a(attributes2.getLocalName(i6)).ordinal();
                            if (ordinal4 == 6) {
                                hVar2.f8727o = y(trim4);
                            } else if (ordinal4 == 7) {
                                hVar2.f8728p = y(trim4);
                            } else if (ordinal4 == 56) {
                                g.o y4 = y(trim4);
                                hVar2.f8729q = y4;
                                if (y4.i()) {
                                    throw new SVGParseException("Invalid <ellipse> element. rx cannot be negative");
                                }
                            } else if (ordinal4 != 57) {
                                continue;
                            } else {
                                g.o y5 = y(trim4);
                                hVar2.f8730r = y5;
                                if (y5.i()) {
                                    throw new SVGParseException("Invalid <ellipse> element. ry cannot be negative");
                                }
                            }
                        }
                        this.b.c(hVar2);
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 8:
                    f(attributes2);
                    return;
                case 9:
                    g.i0 i0Var4 = this.b;
                    if (i0Var4 != null) {
                        g.p pVar = new g.p();
                        pVar.f8752a = this.f8822a;
                        pVar.b = i0Var4;
                        i(pVar, attributes2);
                        l(pVar, attributes2);
                        n(pVar, attributes2);
                        h(pVar, attributes2);
                        for (int i7 = 0; i7 < attributes.getLength(); i7++) {
                            String trim5 = attributes2.getValue(i7).trim();
                            switch (g.a(attributes2.getLocalName(i7)).ordinal()) {
                                case R.styleable.AppCompatTheme_listPreferredItemPaddingRight:
                                    pVar.f8760o = y(trim5);
                                    break;
                                case R.styleable.AppCompatTheme_listPreferredItemPaddingStart:
                                    pVar.f8761p = y(trim5);
                                    break;
                                case R.styleable.AppCompatTheme_panelBackground:
                                    pVar.f8762q = y(trim5);
                                    break;
                                case R.styleable.AppCompatTheme_panelMenuListTheme:
                                    pVar.f8763r = y(trim5);
                                    break;
                            }
                        }
                        this.b.c(pVar);
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 10:
                    if (this.b != null) {
                        g.l0 l0Var = new g.l0();
                        l0Var.f8752a = this.f8822a;
                        l0Var.b = this.b;
                        i(l0Var, attributes2);
                        l(l0Var, attributes2);
                        j(l0Var, attributes2);
                        for (int i8 = 0; i8 < attributes.getLength(); i8++) {
                            String trim6 = attributes2.getValue(i8).trim();
                            switch (g.a(attributes2.getLocalName(i8)).ordinal()) {
                                case R.styleable.AppCompatTheme_listPreferredItemPaddingRight:
                                    l0Var.f8748m = y(trim6);
                                    break;
                                case R.styleable.AppCompatTheme_listPreferredItemPaddingStart:
                                    l0Var.f8749n = y(trim6);
                                    break;
                                case R.styleable.AppCompatTheme_panelBackground:
                                    l0Var.f8750o = y(trim6);
                                    break;
                                case R.styleable.AppCompatTheme_panelMenuListTheme:
                                    l0Var.f8751p = y(trim6);
                                    break;
                            }
                        }
                        this.b.c(l0Var);
                        this.b = l0Var;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 11:
                    if (this.b != null) {
                        g.q qVar = new g.q();
                        qVar.f8752a = this.f8822a;
                        qVar.b = this.b;
                        i(qVar, attributes2);
                        l(qVar, attributes2);
                        h(qVar, attributes2);
                        o(qVar, attributes2);
                        for (int i9 = 0; i9 < attributes.getLength(); i9++) {
                            String trim7 = attributes2.getValue(i9).trim();
                            int ordinal5 = g.a(attributes2.getLocalName(i9)).ordinal();
                            if (ordinal5 == 41) {
                                qVar.u = Float.valueOf("auto".equals(trim7) ? Float.NaN : t(trim7));
                            } else if (ordinal5 == 50) {
                                qVar.f8770q = y(trim7);
                            } else if (ordinal5 != 51) {
                                switch (ordinal5) {
                                    case 32:
                                        g.o y6 = y(trim7);
                                        qVar.f8773t = y6;
                                        if (!y6.i()) {
                                            continue;
                                        } else {
                                            throw new SVGParseException("Invalid <marker> element. markerHeight cannot be negative");
                                        }
                                    case R.styleable.AppCompatTheme_actionOverflowMenuStyle:
                                        if ("strokeWidth".equals(trim7)) {
                                            z = false;
                                        } else if ("userSpaceOnUse".equals(trim7)) {
                                            z = true;
                                        } else {
                                            throw new SVGParseException("Invalid value for attribute markerUnits");
                                        }
                                        qVar.f8769p = z;
                                        continue;
                                    case R.styleable.AppCompatTheme_activityChooserViewStyle:
                                        g.o y7 = y(trim7);
                                        qVar.f8772s = y7;
                                        if (!y7.i()) {
                                            continue;
                                        } else {
                                            throw new SVGParseException("Invalid <marker> element. markerWidth cannot be negative");
                                        }
                                }
                            } else {
                                qVar.f8771r = y(trim7);
                            }
                        }
                        this.b.c(qVar);
                        this.b = qVar;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 12:
                    g(attributes2);
                    return;
                case 13:
                    g.i0 i0Var5 = this.b;
                    if (i0Var5 != null) {
                        g.u uVar = new g.u();
                        uVar.f8752a = this.f8822a;
                        uVar.b = i0Var5;
                        i(uVar, attributes2);
                        l(uVar, attributes2);
                        n(uVar, attributes2);
                        h(uVar, attributes2);
                        int i10 = 0;
                        while (i10 < attributes.getLength()) {
                            String trim8 = attributes2.getValue(i10).trim();
                            int ordinal6 = g.a(attributes2.getLocalName(i10)).ordinal();
                            if (ordinal6 == 13) {
                                C0181i iVar = new C0181i(trim8);
                                g.v vVar = new g.v();
                                if (!iVar.f()) {
                                    int intValue = iVar.h().intValue();
                                    int i11 = R.styleable.AppCompatTheme_textAppearanceSmallPopupMenu;
                                    if (intValue == 77 || intValue == 109) {
                                        float f15 = CropImageView.DEFAULT_ASPECT_RATIO;
                                        float f16 = CropImageView.DEFAULT_ASPECT_RATIO;
                                        float f17 = CropImageView.DEFAULT_ASPECT_RATIO;
                                        float f18 = CropImageView.DEFAULT_ASPECT_RATIO;
                                        int i12 = intValue;
                                        float f19 = CropImageView.DEFAULT_ASPECT_RATIO;
                                        float f20 = CropImageView.DEFAULT_ASPECT_RATIO;
                                        while (true) {
                                            iVar.r();
                                            switch (i12) {
                                                case R.styleable.AppCompatTheme_dividerVertical:
                                                case R.styleable.AppCompatTheme_selectableItemBackground:
                                                    float i13 = iVar.i();
                                                    float c2 = iVar.c(i13);
                                                    float c3 = iVar.c(c2);
                                                    Boolean b2 = iVar.b(Float.valueOf(c3));
                                                    Boolean b3 = iVar.b(b2);
                                                    if (b3 == null) {
                                                        f3 = Float.NaN;
                                                    } else {
                                                        iVar.q();
                                                        f3 = iVar.i();
                                                    }
                                                    float c4 = iVar.c(f3);
                                                    if (Float.isNaN(c4)) {
                                                        break;
                                                    } else if (i13 >= CropImageView.DEFAULT_ASPECT_RATIO && c2 >= CropImageView.DEFAULT_ASPECT_RATIO) {
                                                        if (i12 == 97) {
                                                            f3 += f15;
                                                            c4 += f17;
                                                        }
                                                        vVar.d(i13, c2, c3, b2.booleanValue(), b3.booleanValue(), f3, c4);
                                                        f15 = f3;
                                                        f16 = f15;
                                                        f2 = c4;
                                                        f17 = f2;
                                                        f18 = f17;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                            break;
                                                        } else {
                                                            int i14 = iVar.b;
                                                            if (i14 != iVar.c && (((charAt = iVar.f8865a.charAt(i14)) >= 'a' && charAt <= 'z') || (charAt >= 'A' && charAt <= 'Z'))) {
                                                                i12 = iVar.h().intValue();
                                                            }
                                                            i11 = R.styleable.AppCompatTheme_textAppearanceSmallPopupMenu;
                                                        }
                                                    }
                                                    break;
                                                case R.styleable.AppCompatTheme_dropdownListPreferredItemHeight:
                                                case 99:
                                                    float i15 = iVar.i();
                                                    f12 = iVar.c(i15);
                                                    f11 = iVar.c(f12);
                                                    float c5 = iVar.c(f11);
                                                    float c6 = iVar.c(c5);
                                                    float c7 = iVar.c(c6);
                                                    if (Float.isNaN(c7)) {
                                                        break;
                                                    } else {
                                                        if (i12 == 99) {
                                                            c6 += f15;
                                                            c7 += f17;
                                                            i15 += f15;
                                                            f12 += f17;
                                                            f11 += f15;
                                                            c5 += f17;
                                                        }
                                                        f13 = i15;
                                                        f10 = c5;
                                                        f9 = c6;
                                                        f8 = c7;
                                                        vVar.c(f13, f12, f11, f10, f9, f8);
                                                        f6 = f11;
                                                        f7 = f10;
                                                        f5 = f9;
                                                        f4 = f8;
                                                        f15 = f5;
                                                        f17 = f4;
                                                        f18 = f7;
                                                        f16 = f6;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                        }
                                                    }
                                                    break;
                                                case R.styleable.AppCompatTheme_imageButtonStyle:
                                                case R.styleable.AppCompatTheme_textAppearanceListItemSecondary:
                                                    float i16 = iVar.i();
                                                    if (Float.isNaN(i16)) {
                                                        break;
                                                    } else {
                                                        if (i12 == 104) {
                                                            i16 += f15;
                                                        }
                                                        vVar.e(i16, f17);
                                                        f6 = i16;
                                                        f5 = f6;
                                                        f7 = f18;
                                                        f4 = f17;
                                                        f15 = f5;
                                                        f17 = f4;
                                                        f18 = f7;
                                                        f16 = f6;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                        }
                                                    }
                                                    break;
                                                case R.styleable.AppCompatTheme_listDividerAlertDialog:
                                                case R.styleable.AppCompatTheme_textAppearanceSearchResultTitle:
                                                    float i17 = iVar.i();
                                                    float c8 = iVar.c(i17);
                                                    if (Float.isNaN(c8)) {
                                                        break;
                                                    } else {
                                                        if (i12 == 108) {
                                                            i17 += f15;
                                                            c8 += f17;
                                                        }
                                                        f15 = i17;
                                                        f2 = c8;
                                                        vVar.e(f15, f2);
                                                        f16 = f15;
                                                        f17 = f2;
                                                        f18 = f17;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                        }
                                                    }
                                                    break;
                                                case R.styleable.AppCompatTheme_listMenuViewStyle:
                                                case R.styleable.AppCompatTheme_textAppearanceSmallPopupMenu:
                                                    float i18 = iVar.i();
                                                    float c9 = iVar.c(i18);
                                                    if (Float.isNaN(c9)) {
                                                        break;
                                                    } else {
                                                        if (i12 == i11) {
                                                            if (!(vVar.b == 0)) {
                                                                i18 += f15;
                                                                c9 += f17;
                                                            }
                                                        }
                                                        f17 = c9;
                                                        vVar.b(i18, f17);
                                                        i12 = i12 == i11 ? R.styleable.AppCompatTheme_textAppearanceSearchResultTitle : 76;
                                                        f6 = i18;
                                                        f19 = f6;
                                                        f18 = f17;
                                                        f20 = f18;
                                                        f5 = f6;
                                                        f7 = f18;
                                                        f4 = f17;
                                                        f15 = f5;
                                                        f17 = f4;
                                                        f18 = f7;
                                                        f16 = f6;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                        }
                                                    }
                                                    break;
                                                case R.styleable.AppCompatTheme_listPreferredItemHeightSmall:
                                                case R.styleable.AppCompatTheme_toolbarStyle:
                                                    float i19 = iVar.i();
                                                    float c10 = iVar.c(i19);
                                                    f5 = iVar.c(c10);
                                                    f4 = iVar.c(f5);
                                                    if (Float.isNaN(f4)) {
                                                        break;
                                                    } else {
                                                        if (i12 == 113) {
                                                            f5 += f15;
                                                            f4 += f17;
                                                            i19 += f15;
                                                            c10 += f17;
                                                        }
                                                        f6 = i19;
                                                        f7 = c10;
                                                        vVar.a(f6, f7, f5, f4);
                                                        f15 = f5;
                                                        f17 = f4;
                                                        f18 = f7;
                                                        f16 = f6;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 83:
                                                case R.styleable.AppCompatTheme_tooltipFrameBackground:
                                                    float f21 = (f15 * 2.0f) - f16;
                                                    float f22 = (2.0f * f17) - f18;
                                                    f11 = iVar.i();
                                                    float c11 = iVar.c(f11);
                                                    float c12 = iVar.c(c11);
                                                    float c13 = iVar.c(c12);
                                                    if (Float.isNaN(c13)) {
                                                        break;
                                                    } else {
                                                        if (i12 == 115) {
                                                            c12 += f15;
                                                            c13 += f17;
                                                            f11 += f15;
                                                            c11 += f17;
                                                        }
                                                        f13 = f21;
                                                        f10 = c11;
                                                        f9 = c12;
                                                        f8 = c13;
                                                        f12 = f22;
                                                        vVar.c(f13, f12, f11, f10, f9, f8);
                                                        f6 = f11;
                                                        f7 = f10;
                                                        f5 = f9;
                                                        f4 = f8;
                                                        f15 = f5;
                                                        f17 = f4;
                                                        f18 = f7;
                                                        f16 = f6;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                        }
                                                    }
                                                    break;
                                                case R.styleable.AppCompatTheme_listPreferredItemPaddingRight:
                                                case R.styleable.AppCompatTheme_viewInflaterClass:
                                                    f6 = (f15 * 2.0f) - f16;
                                                    f7 = (2.0f * f17) - f18;
                                                    f5 = iVar.i();
                                                    f4 = iVar.c(f5);
                                                    if (Float.isNaN(f4)) {
                                                        break;
                                                    } else {
                                                        if (i12 == 116) {
                                                            f5 += f15;
                                                            f4 += f17;
                                                        }
                                                        vVar.a(f6, f7, f5, f4);
                                                        f15 = f5;
                                                        f17 = f4;
                                                        f18 = f7;
                                                        f16 = f6;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                        }
                                                    }
                                                    break;
                                                case R.styleable.AppCompatTheme_panelBackground:
                                                case R.styleable.AppCompatTheme_windowActionBarOverlay:
                                                    f2 = iVar.i();
                                                    if (Float.isNaN(f2)) {
                                                        break;
                                                    } else {
                                                        if (i12 == 118) {
                                                            f2 += f17;
                                                        }
                                                        vVar.e(f15, f2);
                                                        f17 = f2;
                                                        f18 = f17;
                                                        iVar.q();
                                                        if (!iVar.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 90:
                                                case R.styleable.AppCompatTheme_windowFixedWidthMajor:
                                                    vVar.f((byte) 8);
                                                    f15 = f19;
                                                    f16 = f15;
                                                    f2 = f20;
                                                    f17 = f2;
                                                    f18 = f17;
                                                    iVar.q();
                                                    if (!iVar.f()) {
                                                    }
                                                    break;
                                            }
                                        }
                                    }
                                }
                                uVar.f8781o = vVar;
                            } else if (ordinal6 == 43) {
                                Float valueOf = Float.valueOf(t(trim8));
                                uVar.f8782p = valueOf;
                                if (valueOf.floatValue() < f14) {
                                    throw new SVGParseException("Invalid <path> element. pathLength cannot be negative");
                                }
                            }
                            i10++;
                            attributes2 = attributes;
                            f14 = CropImageView.DEFAULT_ASPECT_RATIO;
                        }
                        this.b.c(uVar);
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 14:
                    if (this.b != null) {
                        g.x xVar = new g.x();
                        xVar.f8752a = this.f8822a;
                        xVar.b = this.b;
                        i(xVar, attributes2);
                        l(xVar, attributes2);
                        h(xVar, attributes2);
                        o(xVar, attributes2);
                        while (i2 < attributes.getLength()) {
                            String trim9 = attributes2.getValue(i2).trim();
                            int ordinal7 = g.a(attributes2.getLocalName(i2)).ordinal();
                            if (ordinal7 == 25) {
                                g.o y8 = y(trim9);
                                xVar.v = y8;
                                if (y8.i()) {
                                    throw new SVGParseException("Invalid <pattern> element. height cannot be negative");
                                }
                            } else if (ordinal7 != 26) {
                                switch (ordinal7) {
                                    case R.styleable.AppCompatTheme_buttonBarPositiveButtonStyle:
                                        if ("objectBoundingBox".equals(trim9)) {
                                            xVar.f8787q = bool3;
                                            continue;
                                        } else if ("userSpaceOnUse".equals(trim9)) {
                                            xVar.f8787q = bool2;
                                            break;
                                        } else {
                                            throw new SVGParseException("Invalid value for attribute patternContentUnits");
                                        }
                                    case R.styleable.AppCompatTheme_buttonBarStyle:
                                        xVar.f8788r = F(trim9);
                                        continue;
                                    case R.styleable.AppCompatTheme_buttonStyle:
                                        if ("objectBoundingBox".equals(trim9)) {
                                            xVar.f8786p = bool3;
                                            continue;
                                        } else if ("userSpaceOnUse".equals(trim9)) {
                                            xVar.f8786p = bool2;
                                            break;
                                        } else {
                                            throw new SVGParseException("Invalid value for attribute patternUnits");
                                        }
                                    default:
                                        switch (ordinal7) {
                                            case R.styleable.AppCompatTheme_listPreferredItemHeightSmall:
                                                g.o y9 = y(trim9);
                                                xVar.u = y9;
                                                if (!y9.i()) {
                                                    continue;
                                                } else {
                                                    throw new SVGParseException("Invalid <pattern> element. width cannot be negative");
                                                }
                                            case R.styleable.AppCompatTheme_listPreferredItemPaddingEnd:
                                                xVar.f8789s = y(trim9);
                                                continue;
                                            case 83:
                                                xVar.f8790t = y(trim9);
                                                continue;
                                                continue;
                                        }
                                }
                            } else if ("".equals(attributes2.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes2.getURI(i2))) {
                                xVar.w = trim9;
                            }
                            i2++;
                        }
                        this.b.c(xVar);
                        this.b = xVar;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 15:
                    g.i0 i0Var6 = this.b;
                    if (i0Var6 != null) {
                        g.y zVar = new g.z();
                        zVar.f8752a = this.f8822a;
                        zVar.b = i0Var6;
                        i(zVar, attributes2);
                        l(zVar, attributes2);
                        n(zVar, attributes2);
                        h(zVar, attributes2);
                        k(zVar, attributes2, "polygon");
                        this.b.c(zVar);
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 16:
                    g.i0 i0Var7 = this.b;
                    if (i0Var7 != null) {
                        g.y yVar = new g.y();
                        yVar.f8752a = this.f8822a;
                        yVar.b = i0Var7;
                        i(yVar, attributes2);
                        l(yVar, attributes2);
                        n(yVar, attributes2);
                        h(yVar, attributes2);
                        k(yVar, attributes2, "polyline");
                        this.b.c(yVar);
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 17:
                    if (this.b != null) {
                        g.p0 p0Var = new g.p0();
                        p0Var.f8752a = this.f8822a;
                        p0Var.b = this.b;
                        i(p0Var, attributes2);
                        l(p0Var, attributes2);
                        j(p0Var, attributes2);
                        while (i2 < attributes.getLength()) {
                            String trim10 = attributes2.getValue(i2).trim();
                            int ordinal8 = g.a(attributes2.getLocalName(i2)).ordinal();
                            if (ordinal8 == 6) {
                                p0Var.f8764m = y(trim10);
                            } else if (ordinal8 == 7) {
                                p0Var.f8765n = y(trim10);
                            } else if (ordinal8 == 11) {
                                p0Var.f8767p = y(trim10);
                            } else if (ordinal8 == 12) {
                                p0Var.f8768q = y(trim10);
                            } else if (ordinal8 != 49) {
                                continue;
                            } else {
                                g.o y10 = y(trim10);
                                p0Var.f8766o = y10;
                                if (y10.i()) {
                                    throw new SVGParseException("Invalid <radialGradient> element. r cannot be negative");
                                }
                            }
                            i2++;
                        }
                        this.b.c(p0Var);
                        this.b = p0Var;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 18:
                    g.i0 i0Var8 = this.b;
                    if (i0Var8 != null) {
                        g.a0 a0Var = new g.a0();
                        a0Var.f8752a = this.f8822a;
                        a0Var.b = i0Var8;
                        i(a0Var, attributes2);
                        l(a0Var, attributes2);
                        n(a0Var, attributes2);
                        h(a0Var, attributes2);
                        while (i2 < attributes.getLength()) {
                            String trim11 = attributes2.getValue(i2).trim();
                            int ordinal9 = g.a(attributes2.getLocalName(i2)).ordinal();
                            if (ordinal9 == 25) {
                                g.o y11 = y(trim11);
                                a0Var.f8673r = y11;
                                if (y11.i()) {
                                    throw new SVGParseException("Invalid <rect> element. height cannot be negative");
                                }
                            } else if (ordinal9 == 56) {
                                g.o y12 = y(trim11);
                                a0Var.f8674s = y12;
                                if (y12.i()) {
                                    throw new SVGParseException("Invalid <rect> element. rx cannot be negative");
                                }
                            } else if (ordinal9 != 57) {
                                switch (ordinal9) {
                                    case R.styleable.AppCompatTheme_listPreferredItemHeightSmall:
                                        g.o y13 = y(trim11);
                                        a0Var.f8672q = y13;
                                        if (!y13.i()) {
                                            continue;
                                        } else {
                                            throw new SVGParseException("Invalid <rect> element. width cannot be negative");
                                        }
                                    case R.styleable.AppCompatTheme_listPreferredItemPaddingEnd:
                                        a0Var.f8670o = y(trim11);
                                        continue;
                                    case 83:
                                        a0Var.f8671p = y(trim11);
                                        continue;
                                }
                            } else {
                                g.o y14 = y(trim11);
                                a0Var.f8675t = y14;
                                if (y14.i()) {
                                    throw new SVGParseException("Invalid <rect> element. ry cannot be negative");
                                }
                            }
                            i2++;
                        }
                        this.b.c(a0Var);
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 19:
                    g.i0 i0Var9 = this.b;
                    if (i0Var9 != null) {
                        g.b0 b0Var = new g.b0();
                        b0Var.f8752a = this.f8822a;
                        b0Var.b = i0Var9;
                        i(b0Var, attributes2);
                        l(b0Var, attributes2);
                        this.b.c(b0Var);
                        this.b = b0Var;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 20:
                    g.i0 i0Var10 = this.b;
                    if (i0Var10 == null) {
                        throw new SVGParseException("Invalid document. Root element must be <svg>");
                    } else if (i0Var10 instanceof g.i) {
                        g.c0 c0Var = new g.c0();
                        c0Var.f8752a = this.f8822a;
                        c0Var.b = i0Var10;
                        i(c0Var, attributes2);
                        l(c0Var, attributes2);
                        for (int i20 = 0; i20 < attributes.getLength(); i20++) {
                            String trim12 = attributes2.getValue(i20).trim();
                            if (g.a(attributes2.getLocalName(i20)).ordinal() == 39) {
                                if (trim12.length() != 0) {
                                    int length = trim12.length();
                                    if (trim12.charAt(trim12.length() - 1) == '%') {
                                        length--;
                                        z2 = true;
                                    } else {
                                        z2 = false;
                                    }
                                    try {
                                        float u = u(trim12, 0, length);
                                        float f23 = 100.0f;
                                        if (z2) {
                                            u /= 100.0f;
                                        }
                                        if (u < CropImageView.DEFAULT_ASPECT_RATIO) {
                                            f23 = CropImageView.DEFAULT_ASPECT_RATIO;
                                        } else if (u <= 100.0f) {
                                            f23 = u;
                                        }
                                        c0Var.f8680h = Float.valueOf(f23);
                                    } catch (NumberFormatException e2) {
                                        throw new SVGParseException(e.d.a.a.a.H("Invalid offset value in <stop>: ", trim12), e2);
                                    }
                                } else {
                                    throw new SVGParseException("Invalid offset value in <stop> (empty string)");
                                }
                            }
                        }
                        this.b.c(c0Var);
                        this.b = c0Var;
                        return;
                    } else {
                        throw new SVGParseException("Invalid document. <stop> elements are only valid inside <linearGradient> or <radialGradient> elements.");
                    }
                case 21:
                    K(attributes2);
                    return;
                case 22:
                    if (this.b != null) {
                        g.r0 r0Var = new g.r0();
                        r0Var.f8752a = this.f8822a;
                        r0Var.b = this.b;
                        i(r0Var, attributes2);
                        l(r0Var, attributes2);
                        n(r0Var, attributes2);
                        h(r0Var, attributes2);
                        this.b.c(r0Var);
                        this.b = r0Var;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 23:
                    if (this.b != null) {
                        g.q0 s0Var = new g.s0();
                        s0Var.f8752a = this.f8822a;
                        s0Var.b = this.b;
                        i(s0Var, attributes2);
                        l(s0Var, attributes2);
                        h(s0Var, attributes2);
                        o(s0Var, attributes2);
                        this.b.c(s0Var);
                        this.b = s0Var;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 24:
                    if (this.b != null) {
                        g.v0 v0Var = new g.v0();
                        v0Var.f8752a = this.f8822a;
                        v0Var.b = this.b;
                        i(v0Var, attributes2);
                        l(v0Var, attributes2);
                        n(v0Var, attributes2);
                        h(v0Var, attributes2);
                        m(v0Var, attributes2);
                        this.b.c(v0Var);
                        this.b = v0Var;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 25:
                    if (this.b != null) {
                        g.y0 y0Var = new g.y0();
                        y0Var.f8752a = this.f8822a;
                        y0Var.b = this.b;
                        i(y0Var, attributes2);
                        l(y0Var, attributes2);
                        h(y0Var, attributes2);
                        while (i2 < attributes.getLength()) {
                            String trim13 = attributes2.getValue(i2).trim();
                            int ordinal10 = g.a(attributes2.getLocalName(i2)).ordinal();
                            if (ordinal10 != 26) {
                                if (ordinal10 == 61) {
                                    y0Var.f8793o = y(trim13);
                                }
                            } else if ("".equals(attributes2.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes2.getURI(i2))) {
                                y0Var.f8792n = trim13;
                            }
                            i2++;
                        }
                        this.b.c(y0Var);
                        this.b = y0Var;
                        g.i0 i0Var11 = y0Var.b;
                        y0Var.f8794p = i0Var11 instanceof g.a1 ? (g.a1) i0Var11 : ((g.w0) i0Var11).g();
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case 27:
                    g.i0 i0Var12 = this.b;
                    if (i0Var12 == null) {
                        throw new SVGParseException("Invalid document. Root element must be <svg>");
                    } else if (i0Var12 instanceof g.x0) {
                        g.t0 t0Var = new g.t0();
                        t0Var.f8752a = this.f8822a;
                        t0Var.b = this.b;
                        i(t0Var, attributes2);
                        l(t0Var, attributes2);
                        h(t0Var, attributes2);
                        while (i2 < attributes.getLength()) {
                            String trim14 = attributes2.getValue(i2).trim();
                            if (g.a(attributes2.getLocalName(i2)).ordinal() == 26 && ("".equals(attributes2.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes2.getURI(i2)))) {
                                t0Var.f8779n = trim14;
                            }
                            i2++;
                        }
                        this.b.c(t0Var);
                        g.i0 i0Var13 = t0Var.b;
                        t0Var.f8780o = i0Var13 instanceof g.a1 ? (g.a1) i0Var13 : ((g.w0) i0Var13).g();
                        return;
                    } else {
                        throw new SVGParseException("Invalid document. <tref> elements are only valid inside <text> or <tspan> elements.");
                    }
                case 28:
                    g.i0 i0Var14 = this.b;
                    if (i0Var14 == null) {
                        throw new SVGParseException("Invalid document. Root element must be <svg>");
                    } else if (i0Var14 instanceof g.x0) {
                        g.u0 u0Var = new g.u0();
                        u0Var.f8752a = this.f8822a;
                        u0Var.b = this.b;
                        i(u0Var, attributes2);
                        l(u0Var, attributes2);
                        h(u0Var, attributes2);
                        m(u0Var, attributes2);
                        this.b.c(u0Var);
                        this.b = u0Var;
                        g.i0 i0Var15 = u0Var.b;
                        u0Var.f8783r = i0Var15 instanceof g.a1 ? (g.a1) i0Var15 : ((g.w0) i0Var15).g();
                        return;
                    } else {
                        throw new SVGParseException("Invalid document. <tspan> elements are only valid inside <text> or other <tspan> elements.");
                    }
                case 29:
                    if (this.b != null) {
                        g.d1 d1Var = new g.d1();
                        d1Var.f8752a = this.f8822a;
                        d1Var.b = this.b;
                        i(d1Var, attributes2);
                        l(d1Var, attributes2);
                        n(d1Var, attributes2);
                        h(d1Var, attributes2);
                        while (i2 < attributes.getLength()) {
                            String trim15 = attributes2.getValue(i2).trim();
                            int ordinal11 = g.a(attributes2.getLocalName(i2)).ordinal();
                            if (ordinal11 == 25) {
                                g.o y15 = y(trim15);
                                d1Var.f8717s = y15;
                                if (y15.i()) {
                                    throw new SVGParseException("Invalid <use> element. height cannot be negative");
                                }
                            } else if (ordinal11 != 26) {
                                switch (ordinal11) {
                                    case R.styleable.AppCompatTheme_listPreferredItemHeightSmall:
                                        g.o y16 = y(trim15);
                                        d1Var.f8716r = y16;
                                        if (!y16.i()) {
                                            continue;
                                        } else {
                                            throw new SVGParseException("Invalid <use> element. width cannot be negative");
                                        }
                                    case R.styleable.AppCompatTheme_listPreferredItemPaddingEnd:
                                        d1Var.f8714p = y(trim15);
                                        continue;
                                    case 83:
                                        d1Var.f8715q = y(trim15);
                                        continue;
                                }
                            } else if ("".equals(attributes2.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes2.getURI(i2))) {
                                d1Var.f8713o = trim15;
                            }
                            i2++;
                        }
                        this.b.c(d1Var);
                        this.b = d1Var;
                        return;
                    }
                    throw new SVGParseException("Invalid document. Root element must be <svg>");
                case R.styleable.AppCompatTheme_actionModeTheme:
                    N(attributes2);
                    return;
                default:
                    this.c = true;
                    this.d = 1;
                    return;
            }
        }
    }

    public final void K(Attributes attributes) throws SVGParseException {
        if (this.b != null) {
            String str = "all";
            boolean z = true;
            for (int i2 = 0; i2 < attributes.getLength(); i2++) {
                String trim = attributes.getValue(i2).trim();
                int ordinal = g.a(attributes.getLocalName(i2)).ordinal();
                if (ordinal == 38) {
                    str = trim;
                } else if (ordinal == 77) {
                    z = trim.equals("text/css");
                }
            }
            if (z) {
                b.f fVar = b.f.screen;
                b.d dVar = new b.d(str);
                dVar.r();
                if (b.b(b.d(dVar), fVar)) {
                    this.f8826h = true;
                    return;
                }
            }
            this.c = true;
            this.d = 1;
            return;
        }
        throw new SVGParseException("Invalid document. Root element must be <svg>");
    }

    public final void L(String str) throws SVGParseException {
        StringBuilder sb;
        if (!this.c) {
            if (this.f8823e) {
                if (this.f8825g == null) {
                    this.f8825g = new StringBuilder(str.length());
                }
                sb = this.f8825g;
            } else if (this.f8826h) {
                if (this.f8827i == null) {
                    this.f8827i = new StringBuilder(str.length());
                }
                sb = this.f8827i;
            } else if (this.b instanceof g.x0) {
                a(str);
                return;
            } else {
                return;
            }
            sb.append(str);
        }
    }

    public final void M(char[] cArr, int i2, int i3) throws SVGParseException {
        StringBuilder sb;
        if (!this.c) {
            if (this.f8823e) {
                if (this.f8825g == null) {
                    this.f8825g = new StringBuilder(i3);
                }
                sb = this.f8825g;
            } else if (this.f8826h) {
                if (this.f8827i == null) {
                    this.f8827i = new StringBuilder(i3);
                }
                sb = this.f8827i;
            } else if (this.b instanceof g.x0) {
                a(new String(cArr, i2, i3));
                return;
            } else {
                return;
            }
            sb.append(cArr, i2, i3);
        }
    }

    public final void N(Attributes attributes) throws SVGParseException {
        if (this.b != null) {
            g.q0 e1Var = new g.e1();
            e1Var.f8752a = this.f8822a;
            e1Var.b = this.b;
            i(e1Var, attributes);
            h(e1Var, attributes);
            o(e1Var, attributes);
            this.b.c(e1Var);
            this.b = e1Var;
            return;
        }
        throw new SVGParseException("Invalid document. Root element must be <svg>");
    }

    public final void a(String str) throws SVGParseException {
        g.g0 g0Var = (g.g0) this.b;
        int size = g0Var.f8722i.size();
        g.m0 m0Var = size == 0 ? null : g0Var.f8722i.get(size - 1);
        if (m0Var instanceof g.b1) {
            g.b1 b1Var = (g.b1) m0Var;
            b1Var.c = e.d.a.a.a.U(new StringBuilder(), b1Var.c, str);
            return;
        }
        this.b.c(new g.b1(str));
    }

    public final void c(String str, String str2, String str3) throws SVGParseException {
        if (this.c) {
            int i2 = this.d - 1;
            this.d = i2;
            if (i2 == 0) {
                this.c = false;
                return;
            }
        }
        if ("http://www.w3.org/2000/svg".equals(str) || "".equals(str)) {
            if (str2.length() <= 0) {
                str2 = str3;
            }
            h hVar = h.L.get(str2);
            if (hVar == null) {
                hVar = h.UNSUPPORTED;
            }
            switch (hVar.ordinal()) {
                case 0:
                case 3:
                case 4:
                case 7:
                case 8:
                case 10:
                case 11:
                case 12:
                case 14:
                case 17:
                case 19:
                case 20:
                case 22:
                case 23:
                case 24:
                case 25:
                case 28:
                case 29:
                case R.styleable.AppCompatTheme_actionModeTheme:
                    this.b = ((g.m0) this.b).b;
                    return;
                case 1:
                case 2:
                case 6:
                case 9:
                case 13:
                case 15:
                case 16:
                case 18:
                case 27:
                default:
                    return;
                case 5:
                case 26:
                    this.f8823e = false;
                    StringBuilder sb = this.f8825g;
                    if (sb != null) {
                        h hVar2 = this.f8824f;
                        if (hVar2 == h.title) {
                            g gVar = this.f8822a;
                            sb.toString();
                            Objects.requireNonNull(gVar);
                        } else if (hVar2 == h.desc) {
                            g gVar2 = this.f8822a;
                            sb.toString();
                            Objects.requireNonNull(gVar2);
                        }
                        this.f8825g.setLength(0);
                        return;
                    }
                    return;
                case 21:
                    StringBuilder sb2 = this.f8827i;
                    if (sb2 != null) {
                        this.f8826h = false;
                        p(sb2.toString());
                        this.f8827i.setLength(0);
                        return;
                    }
                    return;
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:42:0x0096, code lost:
        continue;
     */
    public final void f(Attributes attributes) throws SVGParseException {
        if (this.b != null) {
            g.n nVar = new g.n();
            nVar.f8752a = this.f8822a;
            nVar.b = this.b;
            i(nVar, attributes);
            l(nVar, attributes);
            n(nVar, attributes);
            h(nVar, attributes);
            for (int i2 = 0; i2 < attributes.getLength(); i2++) {
                String trim = attributes.getValue(i2).trim();
                int ordinal = g.a(attributes.getLocalName(i2)).ordinal();
                if (ordinal == 25) {
                    g.o y = y(trim);
                    nVar.f8757s = y;
                    if (y.i()) {
                        throw new SVGParseException("Invalid <use> element. height cannot be negative");
                    }
                } else if (ordinal != 26) {
                    if (ordinal != 48) {
                        switch (ordinal) {
                            case R.styleable.AppCompatTheme_listPreferredItemHeightSmall:
                                g.o y2 = y(trim);
                                nVar.f8756r = y2;
                                if (!y2.i()) {
                                    continue;
                                } else {
                                    throw new SVGParseException("Invalid <use> element. width cannot be negative");
                                }
                            case R.styleable.AppCompatTheme_listPreferredItemPaddingEnd:
                                nVar.f8754p = y(trim);
                                continue;
                            case 83:
                                nVar.f8755q = y(trim);
                                continue;
                        }
                    } else {
                        D(nVar, trim);
                    }
                } else if ("".equals(attributes.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i2))) {
                    nVar.f8753o = trim;
                }
            }
            this.b.c(nVar);
            this.b = nVar;
            return;
        }
        throw new SVGParseException("Invalid document. Root element must be <svg>");
    }

    /* JADX WARNING: Code restructure failed: missing block: B:53:0x00a6, code lost:
        continue;
     */
    public final void g(Attributes attributes) throws SVGParseException {
        if (this.b != null) {
            g.r rVar = new g.r();
            rVar.f8752a = this.f8822a;
            rVar.b = this.b;
            i(rVar, attributes);
            l(rVar, attributes);
            h(rVar, attributes);
            Boolean bool = Boolean.TRUE;
            Boolean bool2 = Boolean.FALSE;
            for (int i2 = 0; i2 < attributes.getLength(); i2++) {
                String trim = attributes.getValue(i2).trim();
                int ordinal = g.a(attributes.getLocalName(i2)).ordinal();
                if (ordinal == 25) {
                    g.o y = y(trim);
                    rVar.f8778q = y;
                    if (y.i()) {
                        throw new SVGParseException("Invalid <mask> element. height cannot be negative");
                    }
                } else if (ordinal != 36) {
                    if (ordinal != 37) {
                        switch (ordinal) {
                            case R.styleable.AppCompatTheme_listPreferredItemHeightSmall:
                                g.o y2 = y(trim);
                                rVar.f8777p = y2;
                                if (!y2.i()) {
                                    continue;
                                } else {
                                    throw new SVGParseException("Invalid <mask> element. width cannot be negative");
                                }
                            case R.styleable.AppCompatTheme_listPreferredItemPaddingEnd:
                            case 83:
                                y(trim);
                                continue;
                        }
                    } else if ("objectBoundingBox".equals(trim)) {
                        rVar.f8775n = bool2;
                    } else if ("userSpaceOnUse".equals(trim)) {
                        rVar.f8775n = bool;
                    } else {
                        throw new SVGParseException("Invalid value for attribute maskUnits");
                    }
                } else if ("objectBoundingBox".equals(trim)) {
                    rVar.f8776o = bool2;
                } else if ("userSpaceOnUse".equals(trim)) {
                    rVar.f8776o = bool;
                } else {
                    throw new SVGParseException("Invalid value for attribute maskContentUnits");
                }
            }
            this.b.c(rVar);
            this.b = rVar;
            return;
        }
        throw new SVGParseException("Invalid document. Root element must be <svg>");
    }

    public final void h(g.f0 f0Var, Attributes attributes) throws SVGParseException {
        Set<String> hashSet;
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int ordinal = g.a(attributes.getLocalName(i2)).ordinal();
            if (ordinal != 73) {
                switch (ordinal) {
                    case R.styleable.AppCompatTheme_colorButtonNormal:
                        C0181i iVar = new C0181i(trim);
                        HashSet hashSet2 = new HashSet();
                        while (!iVar.f()) {
                            String l2 = iVar.l();
                            hashSet2.add(l2.startsWith("http://www.w3.org/TR/SVG11/feature#") ? l2.substring(35) : "UNSUPPORTED");
                            iVar.r();
                        }
                        f0Var.h(hashSet2);
                        continue;
                    case R.styleable.AppCompatTheme_colorControlActivated:
                        f0Var.i(trim);
                        continue;
                    case R.styleable.AppCompatTheme_colorControlHighlight:
                        C0181i iVar2 = new C0181i(trim);
                        HashSet hashSet3 = new HashSet();
                        while (!iVar2.f()) {
                            hashSet3.add(iVar2.l());
                            iVar2.r();
                        }
                        f0Var.d(hashSet3);
                        continue;
                    case R.styleable.AppCompatTheme_colorControlNormal:
                        if (v(trim) == null) {
                            hashSet = new HashSet<>(0);
                        }
                        f0Var.f(hashSet);
                        continue;
                }
            } else {
                C0181i iVar3 = new C0181i(trim);
                HashSet hashSet4 = new HashSet();
                while (!iVar3.f()) {
                    String l3 = iVar3.l();
                    int indexOf = l3.indexOf(45);
                    if (indexOf != -1) {
                        l3 = l3.substring(0, indexOf);
                    }
                    hashSet4.add(new Locale(l3, "", "").getLanguage());
                    iVar3.r();
                }
                f0Var.k(hashSet4);
            }
        }
    }

    public final void i(g.k0 k0Var, Attributes attributes) throws SVGParseException {
        Boolean bool;
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String qName = attributes.getQName(i2);
            if (qName.equals("id") || qName.equals("xml:id")) {
                k0Var.c = attributes.getValue(i2).trim();
                return;
            } else if (qName.equals("xml:space")) {
                String trim = attributes.getValue(i2).trim();
                if ("default".equals(trim)) {
                    bool = Boolean.FALSE;
                } else if ("preserve".equals(trim)) {
                    bool = Boolean.TRUE;
                } else {
                    throw new SVGParseException(e.d.a.a.a.H("Invalid value for \"xml:space\" attribute: ", trim));
                }
                k0Var.d = bool;
                return;
            }
        }
    }

    public final void j(g.i iVar, Attributes attributes) throws SVGParseException {
        Boolean bool;
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int ordinal = g.a(attributes.getLocalName(i2)).ordinal();
            if (ordinal == 23) {
                iVar.f8738j = F(trim);
            } else if (ordinal == 24) {
                if ("objectBoundingBox".equals(trim)) {
                    bool = Boolean.FALSE;
                } else if ("userSpaceOnUse".equals(trim)) {
                    bool = Boolean.TRUE;
                } else {
                    throw new SVGParseException("Invalid value for attribute gradientUnits");
                }
                iVar.f8737i = bool;
            } else if (ordinal != 26) {
                if (ordinal == 60) {
                    try {
                        iVar.f8739k = g.j.valueOf(trim);
                    } catch (IllegalArgumentException unused) {
                        throw new SVGParseException(e.d.a.a.a.J("Invalid spreadMethod attribute. \"", trim, "\" is not a valid value."));
                    }
                }
            } else if ("".equals(attributes.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i2))) {
                iVar.f8740l = trim;
            }
        }
    }

    public final void k(g.y yVar, Attributes attributes, String str) throws SVGParseException {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            if (g.a(attributes.getLocalName(i2)) == g.points) {
                C0181i iVar = new C0181i(attributes.getValue(i2));
                ArrayList arrayList = new ArrayList();
                iVar.r();
                while (!iVar.f()) {
                    float i3 = iVar.i();
                    if (!Float.isNaN(i3)) {
                        iVar.q();
                        float i4 = iVar.i();
                        if (!Float.isNaN(i4)) {
                            iVar.q();
                            arrayList.add(Float.valueOf(i3));
                            arrayList.add(Float.valueOf(i4));
                        } else {
                            throw new SVGParseException(e.d.a.a.a.J("Invalid <", str, "> points attribute. There should be an even number of coordinates."));
                        }
                    } else {
                        throw new SVGParseException(e.d.a.a.a.J("Invalid <", str, "> points attribute. Non-coordinate content found in list."));
                    }
                }
                yVar.f8791o = new float[arrayList.size()];
                Iterator it = arrayList.iterator();
                int i5 = 0;
                while (it.hasNext()) {
                    yVar.f8791o[i5] = ((Float) it.next()).floatValue();
                    i5++;
                }
            }
        }
    }

    public final void l(g.k0 k0Var, Attributes attributes) throws SVGParseException {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            if (trim.length() != 0) {
                int ordinal = g.a(attributes.getLocalName(i2)).ordinal();
                if (ordinal == 0) {
                    b.d dVar = new b.d(trim);
                    ArrayList arrayList = null;
                    while (!dVar.f()) {
                        String l2 = dVar.l();
                        if (l2 != null) {
                            if (arrayList == null) {
                                arrayList = new ArrayList();
                            }
                            arrayList.add(l2);
                            dVar.r();
                        }
                    }
                    k0Var.f8746g = arrayList;
                } else if (ordinal != 72) {
                    if (k0Var.f8744e == null) {
                        k0Var.f8744e = new g.d0();
                    }
                    I(k0Var.f8744e, attributes.getLocalName(i2), attributes.getValue(i2).trim());
                } else {
                    C0181i iVar = new C0181i(trim.replaceAll("/\\*.*?\\*/", ""));
                    while (true) {
                        String m2 = iVar.m(':');
                        iVar.r();
                        if (!iVar.d(':')) {
                            break;
                        }
                        iVar.r();
                        String n2 = iVar.n(';', true);
                        if (n2 == null) {
                            break;
                        }
                        iVar.r();
                        if (iVar.f() || iVar.d(';')) {
                            if (k0Var.f8745f == null) {
                                k0Var.f8745f = new g.d0();
                            }
                            I(k0Var.f8745f, m2, n2);
                            iVar.r();
                        }
                    }
                }
            }
        }
    }

    public final void m(g.z0 z0Var, Attributes attributes) throws SVGParseException {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int ordinal = g.a(attributes.getLocalName(i2)).ordinal();
            if (ordinal == 9) {
                z0Var.f8797p = z(trim);
            } else if (ordinal == 10) {
                z0Var.f8798q = z(trim);
            } else if (ordinal == 82) {
                z0Var.f8795n = z(trim);
            } else if (ordinal == 83) {
                z0Var.f8796o = z(trim);
            }
        }
    }

    public final void n(g.m mVar, Attributes attributes) throws SVGParseException {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            if (g.a(attributes.getLocalName(i2)) == g.transform) {
                mVar.j(F(attributes.getValue(i2)));
            }
        }
    }

    public final void o(g.q0 q0Var, Attributes attributes) throws SVGParseException {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int ordinal = g.a(attributes.getLocalName(i2)).ordinal();
            if (ordinal == 48) {
                D(q0Var, trim);
            } else if (ordinal != 80) {
                continue;
            } else {
                C0181i iVar = new C0181i(trim);
                iVar.r();
                float i3 = iVar.i();
                iVar.q();
                float i4 = iVar.i();
                iVar.q();
                float i5 = iVar.i();
                iVar.q();
                float i6 = iVar.i();
                if (Float.isNaN(i3) || Float.isNaN(i4) || Float.isNaN(i5) || Float.isNaN(i6)) {
                    throw new SVGParseException("Invalid viewBox definition - should have four numbers");
                } else if (i5 < CropImageView.DEFAULT_ASPECT_RATIO) {
                    throw new SVGParseException("Invalid viewBox. width cannot be negative");
                } else if (i6 >= CropImageView.DEFAULT_ASPECT_RATIO) {
                    q0Var.f8774o = new g.a(i3, i4, i5, i6);
                } else {
                    throw new SVGParseException("Invalid viewBox. height cannot be negative");
                }
            }
        }
    }

    public final void p(String str) {
        b bVar = new b(b.f.screen, b.u.Document);
        g gVar = this.f8822a;
        b.d dVar = new b.d(str);
        dVar.r();
        gVar.b.b(bVar.f(dVar));
    }
}