花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 l.java 源代码,内容仅作参考
package com.caverock.androidsvg;
import android.graphics.Matrix;
import android.support.v4.media.session.PlaybackStateCompat;
import android.util.Log;
import android.util.Xml;
import androidx.core.internal.view.SupportMenu;
import androidx.core.view.InputDeviceCompat;
import com.caverock.androidsvg.c;
import com.caverock.androidsvg.g;
import com.caverock.androidsvg.i;
import com.gaoding.foundations.scanner.e.a;
import com.ss.android.socialbase.downloader.constants.DownloadConstants;
import com.ss.android.socialbase.downloader.setting.DownloadSettingKeys;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.zip.GZIPInputStream;
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 l {
private static final String j = "SVGParser";
private static final String k = "http://www.w3.org/2000/svg";
private static final String l = "http://www.w3.org/1999/xlink";
private static final String m = "http://www.w3.org/TR/SVG11/feature#";
private static final String n = "xml-stylesheet";
public static final String o = "type";
public static final String p = "alternate";
public static final String q = "href";
public static final String r = "media";
public static final String s = "all";
public static final String t = "no";
public static final int u = 4096;
private static final String v = "none";
private static final String w = "currentColor";
private static final String x = "|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|";
private static final String y = "|visible|hidden|collapse|";
private int f3175d;
private com.caverock.androidsvg.i a = null;
private i.j0 b = null;
private boolean c = false;
private boolean f3176e = false;
private h f3177f = null;
private StringBuilder f3178g = null;
private boolean f3179h = false;
private StringBuilder f3180i = null;
public static class a {
static final int[] a;
static final int[] b;
static {
int[] iArr = new int[g.values().length];
b = iArr;
try {
iArr[g.x.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
b[g.y.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
b[g.width.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
b[g.height.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
b[g.version.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
b[g.href.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
b[g.preserveAspectRatio.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
b[g.d.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
b[g.pathLength.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
b[g.rx.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
b[g.ry.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
b[g.cx.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
b[g.cy.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
b[g.r.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
b[g.x1.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
b[g.y1.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
b[g.x2.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
b[g.y2.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
b[g.dx.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
b[g.dy.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
b[g.requiredFeatures.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
try {
b[g.requiredExtensions.ordinal()] = 22;
} catch (NoSuchFieldError unused22) {
}
try {
b[g.systemLanguage.ordinal()] = 23;
} catch (NoSuchFieldError unused23) {
}
try {
b[g.requiredFormats.ordinal()] = 24;
} catch (NoSuchFieldError unused24) {
}
try {
b[g.requiredFonts.ordinal()] = 25;
} catch (NoSuchFieldError unused25) {
}
try {
b[g.refX.ordinal()] = 26;
} catch (NoSuchFieldError unused26) {
}
try {
b[g.refY.ordinal()] = 27;
} catch (NoSuchFieldError unused27) {
}
try {
b[g.markerWidth.ordinal()] = 28;
} catch (NoSuchFieldError unused28) {
}
try {
b[g.markerHeight.ordinal()] = 29;
} catch (NoSuchFieldError unused29) {
}
try {
b[g.markerUnits.ordinal()] = 30;
} catch (NoSuchFieldError unused30) {
}
try {
b[g.orient.ordinal()] = 31;
} catch (NoSuchFieldError unused31) {
}
try {
b[g.gradientUnits.ordinal()] = 32;
} catch (NoSuchFieldError unused32) {
}
try {
b[g.gradientTransform.ordinal()] = 33;
} catch (NoSuchFieldError unused33) {
}
try {
b[g.spreadMethod.ordinal()] = 34;
} catch (NoSuchFieldError unused34) {
}
try {
b[g.fx.ordinal()] = 35;
} catch (NoSuchFieldError unused35) {
}
try {
b[g.fy.ordinal()] = 36;
} catch (NoSuchFieldError unused36) {
}
try {
b[g.offset.ordinal()] = 37;
} catch (NoSuchFieldError unused37) {
}
try {
b[g.clipPathUnits.ordinal()] = 38;
} catch (NoSuchFieldError unused38) {
}
try {
b[g.startOffset.ordinal()] = 39;
} catch (NoSuchFieldError unused39) {
}
try {
b[g.patternUnits.ordinal()] = 40;
} catch (NoSuchFieldError unused40) {
}
try {
b[g.patternContentUnits.ordinal()] = 41;
} catch (NoSuchFieldError unused41) {
}
try {
b[g.patternTransform.ordinal()] = 42;
} catch (NoSuchFieldError unused42) {
}
try {
b[g.maskUnits.ordinal()] = 43;
} catch (NoSuchFieldError unused43) {
}
try {
b[g.maskContentUnits.ordinal()] = 44;
} catch (NoSuchFieldError unused44) {
}
try {
b[g.style.ordinal()] = 45;
} catch (NoSuchFieldError unused45) {
}
try {
b[g.CLASS.ordinal()] = 46;
} catch (NoSuchFieldError unused46) {
}
try {
b[g.fill.ordinal()] = 47;
} catch (NoSuchFieldError unused47) {
}
try {
b[g.fill_rule.ordinal()] = 48;
} catch (NoSuchFieldError unused48) {
}
try {
b[g.fill_opacity.ordinal()] = 49;
} catch (NoSuchFieldError unused49) {
}
try {
b[g.stroke.ordinal()] = 50;
} catch (NoSuchFieldError unused50) {
}
try {
b[g.stroke_opacity.ordinal()] = 51;
} catch (NoSuchFieldError unused51) {
}
try {
b[g.stroke_width.ordinal()] = 52;
} catch (NoSuchFieldError unused52) {
}
try {
b[g.stroke_linecap.ordinal()] = 53;
} catch (NoSuchFieldError unused53) {
}
try {
b[g.stroke_linejoin.ordinal()] = 54;
} catch (NoSuchFieldError unused54) {
}
try {
b[g.stroke_miterlimit.ordinal()] = 55;
} catch (NoSuchFieldError unused55) {
}
try {
b[g.stroke_dasharray.ordinal()] = 56;
} catch (NoSuchFieldError unused56) {
}
try {
b[g.stroke_dashoffset.ordinal()] = 57;
} catch (NoSuchFieldError unused57) {
}
try {
b[g.opacity.ordinal()] = 58;
} catch (NoSuchFieldError unused58) {
}
try {
b[g.color.ordinal()] = 59;
} catch (NoSuchFieldError unused59) {
}
try {
b[g.font.ordinal()] = 60;
} catch (NoSuchFieldError unused60) {
}
try {
b[g.font_family.ordinal()] = 61;
} catch (NoSuchFieldError unused61) {
}
try {
b[g.font_size.ordinal()] = 62;
} catch (NoSuchFieldError unused62) {
}
try {
b[g.font_weight.ordinal()] = 63;
} catch (NoSuchFieldError unused63) {
}
try {
b[g.font_style.ordinal()] = 64;
} catch (NoSuchFieldError unused64) {
}
try {
b[g.text_decoration.ordinal()] = 65;
} catch (NoSuchFieldError unused65) {
}
try {
b[g.direction.ordinal()] = 66;
} catch (NoSuchFieldError unused66) {
}
try {
b[g.text_anchor.ordinal()] = 67;
} catch (NoSuchFieldError unused67) {
}
try {
b[g.overflow.ordinal()] = 68;
} catch (NoSuchFieldError unused68) {
}
try {
b[g.marker.ordinal()] = 69;
} catch (NoSuchFieldError unused69) {
}
try {
b[g.marker_start.ordinal()] = 70;
} catch (NoSuchFieldError unused70) {
}
try {
b[g.marker_mid.ordinal()] = 71;
} catch (NoSuchFieldError unused71) {
}
try {
b[g.marker_end.ordinal()] = 72;
} catch (NoSuchFieldError unused72) {
}
try {
b[g.display.ordinal()] = 73;
} catch (NoSuchFieldError unused73) {
}
try {
b[g.visibility.ordinal()] = 74;
} catch (NoSuchFieldError unused74) {
}
try {
b[g.stop_color.ordinal()] = 75;
} catch (NoSuchFieldError unused75) {
}
try {
b[g.stop_opacity.ordinal()] = 76;
} catch (NoSuchFieldError unused76) {
}
try {
b[g.clip.ordinal()] = 77;
} catch (NoSuchFieldError unused77) {
}
try {
b[g.clip_path.ordinal()] = 78;
} catch (NoSuchFieldError unused78) {
}
try {
b[g.clip_rule.ordinal()] = 79;
} catch (NoSuchFieldError unused79) {
}
try {
b[g.mask.ordinal()] = 80;
} catch (NoSuchFieldError unused80) {
}
try {
b[g.solid_color.ordinal()] = 81;
} catch (NoSuchFieldError unused81) {
}
try {
b[g.solid_opacity.ordinal()] = 82;
} catch (NoSuchFieldError unused82) {
}
try {
b[g.viewport_fill.ordinal()] = 83;
} catch (NoSuchFieldError unused83) {
}
try {
b[g.viewport_fill_opacity.ordinal()] = 84;
} catch (NoSuchFieldError unused84) {
}
try {
b[g.vector_effect.ordinal()] = 85;
} catch (NoSuchFieldError unused85) {
}
try {
b[g.image_rendering.ordinal()] = 86;
} catch (NoSuchFieldError unused86) {
}
try {
b[g.viewBox.ordinal()] = 87;
} catch (NoSuchFieldError unused87) {
}
try {
b[g.type.ordinal()] = 88;
} catch (NoSuchFieldError unused88) {
}
try {
b[g.media.ordinal()] = 89;
} catch (NoSuchFieldError unused89) {
}
int[] iArr2 = new int[h.values().length];
a = iArr2;
try {
iArr2[h.svg.ordinal()] = 1;
} catch (NoSuchFieldError unused90) {
}
try {
a[h.g.ordinal()] = 2;
} catch (NoSuchFieldError unused91) {
}
try {
a[h.a.ordinal()] = 3;
} catch (NoSuchFieldError unused92) {
}
try {
a[h.defs.ordinal()] = 4;
} catch (NoSuchFieldError unused93) {
}
try {
a[h.use.ordinal()] = 5;
} catch (NoSuchFieldError unused94) {
}
try {
a[h.path.ordinal()] = 6;
} catch (NoSuchFieldError unused95) {
}
try {
a[h.rect.ordinal()] = 7;
} catch (NoSuchFieldError unused96) {
}
try {
a[h.circle.ordinal()] = 8;
} catch (NoSuchFieldError unused97) {
}
try {
a[h.ellipse.ordinal()] = 9;
} catch (NoSuchFieldError unused98) {
}
try {
a[h.line.ordinal()] = 10;
} catch (NoSuchFieldError unused99) {
}
try {
a[h.polyline.ordinal()] = 11;
} catch (NoSuchFieldError unused100) {
}
try {
a[h.polygon.ordinal()] = 12;
} catch (NoSuchFieldError unused101) {
}
try {
a[h.text.ordinal()] = 13;
} catch (NoSuchFieldError unused102) {
}
try {
a[h.tspan.ordinal()] = 14;
} catch (NoSuchFieldError unused103) {
}
try {
a[h.tref.ordinal()] = 15;
} catch (NoSuchFieldError unused104) {
}
try {
a[h.SWITCH.ordinal()] = 16;
} catch (NoSuchFieldError unused105) {
}
try {
a[h.symbol.ordinal()] = 17;
} catch (NoSuchFieldError unused106) {
}
try {
a[h.marker.ordinal()] = 18;
} catch (NoSuchFieldError unused107) {
}
try {
a[h.linearGradient.ordinal()] = 19;
} catch (NoSuchFieldError unused108) {
}
try {
a[h.radialGradient.ordinal()] = 20;
} catch (NoSuchFieldError unused109) {
}
try {
a[h.stop.ordinal()] = 21;
} catch (NoSuchFieldError unused110) {
}
try {
a[h.title.ordinal()] = 22;
} catch (NoSuchFieldError unused111) {
}
try {
a[h.desc.ordinal()] = 23;
} catch (NoSuchFieldError unused112) {
}
try {
a[h.clipPath.ordinal()] = 24;
} catch (NoSuchFieldError unused113) {
}
try {
a[h.textPath.ordinal()] = 25;
} catch (NoSuchFieldError unused114) {
}
try {
a[h.pattern.ordinal()] = 26;
} catch (NoSuchFieldError unused115) {
}
try {
a[h.image.ordinal()] = 27;
} catch (NoSuchFieldError unused116) {
}
try {
a[h.view.ordinal()] = 28;
} catch (NoSuchFieldError unused117) {
}
try {
a[h.mask.ordinal()] = 29;
} catch (NoSuchFieldError unused118) {
}
try {
a[h.style.ordinal()] = 30;
} catch (NoSuchFieldError unused119) {
}
try {
a[h.solidColor.ordinal()] = 31;
} catch (NoSuchFieldError unused120) {
}
}
}
public static class b {
private static final Map<String, g.a> a;
static {
HashMap hashMap = new HashMap(10);
a = hashMap;
hashMap.put("none", g.a.none);
a.put("xMinYMin", g.a.xMinYMin);
a.put("xMidYMin", g.a.xMidYMin);
a.put("xMaxYMin", g.a.xMaxYMin);
a.put("xMinYMid", g.a.xMinYMid);
a.put("xMidYMid", g.a.xMidYMid);
a.put("xMaxYMid", g.a.xMaxYMid);
a.put("xMinYMax", g.a.xMinYMax);
a.put("xMidYMax", g.a.xMidYMax);
a.put("xMaxYMax", g.a.xMaxYMax);
}
private b() {
}
static g.a a(String str) {
return a.get(str);
}
}
public static class c {
private static final Map<String, Integer> a;
static {
HashMap hashMap = new HashMap(47);
a = hashMap;
hashMap.put("aliceblue", -984833);
a.put("antiquewhite", -332841);
a.put("aqua", -16711681);
a.put("aquamarine", -8388652);
a.put("azure", -983041);
a.put("beige", -657956);
a.put("bisque", -6972);
a.put("black", -16777216);
a.put("blanchedalmond", -5171);
a.put("blue", -16776961);
a.put("blueviolet", -7722014);
a.put("brown", -5952982);
a.put("burlywood", -2180985);
a.put("cadetblue", -10510688);
a.put("chartreuse", -8388864);
a.put("chocolate", -2987746);
a.put("coral", -32944);
a.put("cornflowerblue", -10185235);
a.put("cornsilk", -1828);
a.put("crimson", -2354116);
a.put("cyan", -16711681);
a.put("darkblue", -16777077);
a.put("darkcyan", -16741493);
a.put("darkgoldenrod", -4684277);
a.put("darkgray", -5658199);
a.put("darkgreen", -16751616);
a.put("darkgrey", -5658199);
a.put("darkkhaki", -4343957);
a.put("darkmagenta", -7667573);
a.put("darkolivegreen", -11179217);
a.put("darkorange", -29696);
a.put("darkorchid", -6737204);
a.put("darkred", -7667712);
a.put("darksalmon", -1468806);
a.put("darkseagreen", -7357297);
a.put("darkslateblue", -12042869);
a.put("darkslategray", -13676721);
a.put("darkslategrey", -13676721);
a.put("darkturquoise", -16724271);
a.put("darkviolet", -7077677);
a.put("deeppink", -60269);
a.put("deepskyblue", -16728065);
a.put("dimgray", -9868951);
a.put("dimgrey", -9868951);
a.put("dodgerblue", -14774017);
a.put("firebrick", -5103070);
a.put("floralwhite", -1296);
a.put("forestgreen", -14513374);
a.put("fuchsia", -65281);
a.put("gainsboro", -2302756);
a.put("ghostwhite", -460545);
a.put("gold", -10496);
a.put("goldenrod", -2448096);
a.put("gray", -8355712);
a.put("green", -16744448);
a.put("greenyellow", -5374161);
a.put("grey", -8355712);
a.put("honeydew", -983056);
a.put("hotpink", -38476);
a.put("indianred", -3318692);
a.put("indigo", -11861886);
a.put("ivory", -16);
a.put("khaki", -989556);
a.put("lavender", -1644806);
a.put("lavenderblush", -3851);
a.put("lawngreen", -8586240);
a.put("lemonchiffon", -1331);
a.put("lightblue", -5383962);
a.put("lightcoral", -1015680);
a.put("lightcyan", -2031617);
a.put("lightgoldenrodyellow", -329006);
a.put("lightgray", -2894893);
a.put("lightgreen", -7278960);
a.put("lightgrey", -2894893);
a.put("lightpink", -18751);
a.put("lightsalmon", -24454);
a.put("lightseagreen", -14634326);
a.put("lightskyblue", -7876870);
a.put("lightslategray", -8943463);
a.put("lightslategrey", -8943463);
a.put("lightsteelblue", -5192482);
a.put("lightyellow", -32);
a.put("lime", Integer.valueOf((int) a.C0190a.c));
a.put("limegreen", -13447886);
a.put("linen", -331546);
a.put("magenta", -65281);
a.put("maroon", -8388608);
a.put("mediumaquamarine", -10039894);
a.put("mediumblue", -16777011);
a.put("mediumorchid", -4565549);
a.put("mediumpurple", -7114533);
a.put("mediumseagreen", -12799119);
a.put("mediumslateblue", -8689426);
a.put("mediumspringgreen", -16713062);
a.put("mediumturquoise", -12004916);
a.put("mediumvioletred", -3730043);
a.put("midnightblue", -15132304);
a.put("mintcream", -655366);
a.put("mistyrose", -6943);
a.put("moccasin", -6987);
a.put("navajowhite", -8531);
a.put("navy", -16777088);
a.put("oldlace", -133658);
a.put("olive", -8355840);
a.put("olivedrab", -9728477);
a.put("orange", -23296);
a.put("orangered", -47872);
a.put("orchid", -2461482);
a.put("palegoldenrod", -1120086);
a.put("palegreen", -6751336);
a.put("paleturquoise", -5247250);
a.put("palevioletred", -2396013);
a.put("papayawhip", -4139);
a.put("peachpuff", -9543);
a.put("peru", -3308225);
a.put("pink", -16181);
a.put("plum", -2252579);
a.put("powderblue", -5185306);
a.put("purple", -8388480);
a.put("rebeccapurple", -10079335);
a.put("red", Integer.valueOf((int) SupportMenu.CATEGORY_MASK));
a.put("rosybrown", -4419697);
a.put("royalblue", -12490271);
a.put("saddlebrown", -7650029);
a.put("salmon", -360334);
a.put("sandybrown", -744352);
a.put("seagreen", -13726889);
a.put("seashell", -2578);
a.put("sienna", -6270419);
a.put("silver", -4144960);
a.put("skyblue", -7876885);
a.put("slateblue", -9807155);
a.put("slategray", -9404272);
a.put("slategrey", -9404272);
a.put("snow", -1286);
a.put("springgreen", -16711809);
a.put("steelblue", -12156236);
a.put("tan", -2968436);
a.put("teal", -16744320);
a.put("thistle", -2572328);
a.put("tomato", -40121);
a.put("turquoise", -12525360);
a.put("violet", -1146130);
a.put("wheat", -663885);
a.put("white", -1);
a.put("whitesmoke", -657931);
a.put("yellow", Integer.valueOf((int) InputDeviceCompat.SOURCE_ANY));
a.put("yellowgreen", -6632142);
a.put("transparent", 0);
}
private c() {
}
static Integer a(String str) {
return a.get(str);
}
}
public static class d {
private static final Map<String, i.p> a;
static {
HashMap hashMap = new HashMap(9);
a = hashMap;
hashMap.put("xx-small", new i.p(0.694f, i.d1.pt));
a.put("x-small", new i.p(0.833f, i.d1.pt));
a.put("small", new i.p(10.0f, i.d1.pt));
a.put("medium", new i.p(12.0f, i.d1.pt));
a.put("large", new i.p(14.4f, i.d1.pt));
a.put("x-large", new i.p(17.3f, i.d1.pt));
a.put("xx-large", new i.p(20.7f, i.d1.pt));
a.put("smaller", new i.p(83.33f, i.d1.percent));
a.put("larger", new i.p(120.0f, i.d1.percent));
}
private d() {
}
static i.p a(String str) {
return a.get(str);
}
}
public static class e {
private static final Map<String, Integer> a;
static {
HashMap hashMap = new HashMap(13);
a = hashMap;
hashMap.put("normal", 400);
a.put(com.google.android.exoplayer2.text.y.d.k0, 700);
a.put("bolder", 1);
a.put("lighter", -1);
a.put("100", 100);
a.put("200", 200);
a.put("300", 300);
a.put("400", 400);
a.put("500", 500);
a.put("600", 600);
a.put("700", 700);
a.put("800", 800);
a.put("900", 900);
}
private e() {
}
static Integer a(String str) {
return a.get(str);
}
}
public class f extends DefaultHandler2 {
private f() {
}
@Override
public void characters(char[] cArr, int i2, int i3) throws SAXException {
l.this.d1(new String(cArr, i2, i3));
}
@Override
public void endDocument() throws SAXException {
l.this.p();
}
@Override
public void endElement(String str, String str2, String str3) throws SAXException {
l.this.q(str, str2, str3);
}
@Override
public void processingInstruction(String str, String str2) throws SAXException {
l.this.s(str, l.this.y0(new i(str2)));
}
@Override
public void startDocument() throws SAXException {
l.this.X0();
}
@Override
public void startElement(String str, String str2, String str3, Attributes attributes) throws SAXException {
l.this.Y0(str, str2, str3, attributes);
}
f(l lVar, a aVar) {
this();
}
}
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,
type,
vector_effect,
version,
viewBox,
width,
x,
y,
x1,
y1,
x2,
y2,
viewport_fill,
viewport_fill_opacity,
visibility,
UNSUPPORTED;
private static final Map<String, g> Y1 = new HashMap();
static {
g[] values;
for (g gVar : values()) {
if (gVar == CLASS) {
Y1.put("class", gVar);
} else if (gVar != UNSUPPORTED) {
Y1.put(gVar.name().replace('_', '-'), gVar);
}
}
}
public static g a(String str) {
g gVar = Y1.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,
view,
UNSUPPORTED;
private static final Map<String, h> G = new HashMap();
static {
h[] values;
for (h hVar : values()) {
if (hVar == SWITCH) {
G.put("switch", hVar);
} else if (hVar != UNSUPPORTED) {
G.put(hVar.name(), hVar);
}
}
}
public static h a(String str) {
h hVar = G.get(str);
return hVar != null ? hVar : UNSUPPORTED;
}
}
public static class i {
String a;
int c;
int b = 0;
private com.caverock.androidsvg.f f3193d = new com.caverock.androidsvg.f();
public i(String str) {
this.c = 0;
String trim = str.trim();
this.a = trim;
this.c = trim.length();
}
public void A() {
while (true) {
int i2 = this.b;
if (i2 >= this.c || !k(this.a.charAt(i2))) {
return;
}
this.b++;
}
}
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.a.charAt(i4);
}
return -1;
}
String b() {
int i2 = this.b;
while (!h() && !k(this.a.charAt(this.b))) {
this.b++;
}
String substring = this.a.substring(i2, this.b);
this.b = i2;
return substring;
}
Boolean c(Object obj) {
if (obj == null) {
return null;
}
z();
return m();
}
float d(float f2) {
if (Float.isNaN(f2)) {
return Float.NaN;
}
z();
return n();
}
float e(Boolean bool) {
if (bool == null) {
return Float.NaN;
}
z();
return n();
}
public boolean f(char c) {
int i2 = this.b;
boolean z = i2 < this.c && this.a.charAt(i2) == c;
if (z) {
this.b++;
}
return z;
}
public boolean g(String str) {
int length = str.length();
int i2 = this.b;
boolean z = i2 <= this.c - length && this.a.substring(i2, i2 + length).equals(str);
if (z) {
this.b += length;
}
return z;
}
public boolean h() {
return this.b == this.c;
}
boolean i() {
int i2 = this.b;
if (i2 == this.c) {
return false;
}
char charAt = this.a.charAt(i2);
return (charAt >= 'a' && charAt <= 'z') || (charAt >= 'A' && charAt <= 'Z');
}
public boolean j(int i2) {
return i2 == 10 || i2 == 13;
}
public boolean k(int i2) {
return i2 == 32 || i2 == 10 || i2 == 13 || i2 == 9;
}
public Integer l() {
int i2 = this.b;
if (i2 == this.c) {
return null;
}
String str = this.a;
this.b = i2 + 1;
return Integer.valueOf(str.charAt(i2));
}
Boolean m() {
int i2 = this.b;
if (i2 == this.c) {
return null;
}
char charAt = this.a.charAt(i2);
if (charAt == '0' || charAt == '1') {
this.b++;
return Boolean.valueOf(charAt == '1');
}
return null;
}
float n() {
float b = this.f3193d.b(this.a, this.b, this.c);
if (!Float.isNaN(b)) {
this.b = this.f3193d.a();
}
return b;
}
String o() {
if (h()) {
return null;
}
int i2 = this.b;
int charAt = this.a.charAt(i2);
while (true) {
if ((charAt < 97 || charAt > 122) && (charAt < 65 || charAt > 90)) {
break;
}
charAt = a();
}
int i3 = this.b;
while (k(charAt)) {
charAt = a();
}
if (charAt == 40) {
this.b++;
return this.a.substring(i2, i3);
}
this.b = i2;
return null;
}
i.p p() {
float n = n();
if (Float.isNaN(n)) {
return null;
}
i.d1 v = v();
if (v == null) {
return new i.p(n, i.d1.px);
}
return new i.p(n, v);
}
public String q() {
if (h()) {
return null;
}
int i2 = this.b;
char charAt = this.a.charAt(i2);
if (charAt == '\'' || charAt == '\"') {
int a = a();
while (a != -1 && a != charAt) {
a = a();
}
if (a == -1) {
this.b = i2;
return null;
}
int i3 = this.b + 1;
this.b = i3;
return this.a.substring(i2 + 1, i3 - 1);
}
return null;
}
public String r() {
return t(' ', false);
}
String s(char c) {
return t(c, false);
}
String t(char c, boolean z) {
if (h()) {
return null;
}
char charAt = this.a.charAt(this.b);
if ((z || !k(charAt)) && charAt != c) {
int i2 = this.b;
int a = a();
while (a != -1 && a != c && (z || !k(a))) {
a = a();
}
return this.a.substring(i2, this.b);
}
return null;
}
String u(char c) {
return t(c, true);
}
i.d1 v() {
if (h()) {
return null;
}
if (this.a.charAt(this.b) == '%') {
this.b++;
return i.d1.percent;
}
int i2 = this.b;
if (i2 > this.c - 2) {
return null;
}
try {
i.d1 valueOf = i.d1.valueOf(this.a.substring(i2, i2 + 2).toLowerCase(Locale.US));
this.b += 2;
return valueOf;
} catch (IllegalArgumentException unused) {
return null;
}
}
public String w() {
if (h()) {
return null;
}
int i2 = this.b;
char charAt = this.a.charAt(i2);
if ((charAt >= 'A' && charAt <= 'Z') || (charAt >= 'a' && charAt <= 'z')) {
int a = a();
while (true) {
if ((a < 65 || a > 90) && (a < 97 || a > 122)) {
break;
}
a = a();
}
return this.a.substring(i2, this.b);
}
this.b = i2;
return null;
}
float x() {
z();
float b = this.f3193d.b(this.a, this.b, this.c);
if (!Float.isNaN(b)) {
this.b = this.f3193d.a();
}
return b;
}
String y() {
if (h()) {
return null;
}
int i2 = this.b;
this.b = this.c;
return this.a.substring(i2);
}
public boolean z() {
A();
int i2 = this.b;
if (i2 != this.c && this.a.charAt(i2) == ',') {
this.b++;
A();
return true;
}
return false;
}
}
public class j implements Attributes {
private XmlPullParser a;
public j(XmlPullParser xmlPullParser) {
this.a = xmlPullParser;
}
@Override
public int getIndex(String str) {
return -1;
}
@Override
public int getIndex(String str, String str2) {
return -1;
}
@Override
public int getLength() {
return this.a.getAttributeCount();
}
@Override
public String getLocalName(int i2) {
return this.a.getAttributeName(i2);
}
@Override
public String getQName(int i2) {
String attributeName = this.a.getAttributeName(i2);
if (this.a.getAttributePrefix(i2) != null) {
return this.a.getAttributePrefix(i2) + ':' + attributeName;
}
return attributeName;
}
@Override
public String getType(int i2) {
return null;
}
@Override
public String getType(String str) {
return null;
}
@Override
public String getType(String str, String str2) {
return null;
}
@Override
public String getURI(int i2) {
return this.a.getAttributeNamespace(i2);
}
@Override
public String getValue(int i2) {
return this.a.getAttributeValue(i2);
}
@Override
public String getValue(String str) {
return null;
}
@Override
public String getValue(String str, String str2) {
return null;
}
}
private static Set<String> A0(String str) {
i iVar = new i(str);
HashSet hashSet = new HashSet();
while (!iVar.h()) {
String r2 = iVar.r();
if (r2.startsWith(m)) {
hashSet.add(r2.substring(35));
} else {
hashSet.add("UNSUPPORTED");
}
iVar.A();
}
return hashSet;
}
private void B(i.d dVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
switch (a.b[g.a(attributes.getLocalName(i2)).ordinal()]) {
case 12:
dVar.o = p0(trim);
break;
case 13:
dVar.p = p0(trim);
break;
case 14:
i.p p0 = p0(trim);
dVar.q = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <circle> element. r cannot be negative");
}
break;
}
}
}
private static Set<String> B0(String str) {
i iVar = new i(str);
HashSet hashSet = new HashSet();
while (!iVar.h()) {
hashSet.add(iVar.r());
iVar.A();
}
return hashSet;
}
private void C(i.e eVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
if (a.b[g.a(attributes.getLocalName(i2)).ordinal()] == 38) {
if ("objectBoundingBox".equals(trim)) {
eVar.p = Boolean.FALSE;
} else if ("userSpaceOnUse".equals(trim)) {
eVar.p = Boolean.TRUE;
} else {
throw new SVGParseException("Invalid value for attribute clipPathUnits");
}
}
}
}
private static i.p[] C0(String str) {
i.p p2;
i iVar = new i(str);
iVar.A();
if (iVar.h() || (p2 = iVar.p()) == null || p2.g()) {
return null;
}
float a2 = p2.a();
ArrayList arrayList = new ArrayList();
arrayList.add(p2);
while (!iVar.h()) {
iVar.z();
i.p p3 = iVar.p();
if (p3 == null || p3.g()) {
return null;
}
arrayList.add(p3);
a2 += p3.a();
}
if (a2 == 0.0f) {
return null;
}
return (i.p[]) arrayList.toArray(new i.p[arrayList.size()]);
}
private void D(i.g0 g0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
switch (a.b[g.a(attributes.getLocalName(i2)).ordinal()]) {
case 21:
g0Var.e(A0(trim));
break;
case 22:
g0Var.k(trim);
break;
case 23:
g0Var.g(G0(trim));
break;
case 24:
g0Var.h(B0(trim));
break;
case 25:
List<String> j0 = j0(trim);
g0Var.c(j0 != null ? new HashSet(j0) : new HashSet(0));
break;
}
}
}
private static i.e0.c D0(String str) {
if ("butt".equals(str)) {
return i.e0.c.Butt;
}
if ("round".equals(str)) {
return i.e0.c.Round;
}
if ("square".equals(str)) {
return i.e0.c.Square;
}
return null;
}
private void E(i.l0 l0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String qName = attributes.getQName(i2);
if (!qName.equals("id") && !qName.equals("xml:id")) {
if (qName.equals("xml:space")) {
String trim = attributes.getValue(i2).trim();
if (DownloadSettingKeys.BugFix.DEFAULT.equals(trim)) {
l0Var.f3136d = Boolean.FALSE;
return;
} else if ("preserve".equals(trim)) {
l0Var.f3136d = Boolean.TRUE;
return;
} else {
throw new SVGParseException("Invalid value for \"xml:space\" attribute: " + trim);
}
}
} else {
l0Var.c = attributes.getValue(i2).trim();
return;
}
}
}
private static i.e0.d E0(String str) {
if ("miter".equals(str)) {
return i.e0.d.Miter;
}
if ("round".equals(str)) {
return i.e0.d.Round;
}
if ("bevel".equals(str)) {
return i.e0.d.Bevel;
}
return null;
}
private void F(i.C0129i c0129i, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
switch (a.b[g.a(attributes.getLocalName(i2)).ordinal()]) {
case 10:
i.p p0 = p0(trim);
c0129i.q = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <ellipse> element. rx cannot be negative");
}
break;
case 11:
i.p p02 = p0(trim);
c0129i.r = p02;
if (p02.g()) {
throw new SVGParseException("Invalid <ellipse> element. ry cannot be negative");
}
break;
case 12:
c0129i.o = p0(trim);
break;
case 13:
c0129i.p = p0(trim);
break;
}
}
}
private static void F0(i.l0 l0Var, String str) {
i iVar = new i(str.replaceAll("/\\*.*?\\*/", ""));
while (true) {
String s2 = iVar.s(':');
iVar.A();
if (!iVar.f(':')) {
return;
}
iVar.A();
String u2 = iVar.u(';');
if (u2 == null) {
return;
}
iVar.A();
if (iVar.h() || iVar.f(';')) {
if (l0Var.f3138f == null) {
l0Var.f3138f = new i.e0();
}
T0(l0Var.f3138f, s2, u2);
iVar.A();
}
}
}
private void G(i.j jVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 != 6) {
switch (i3) {
case 32:
if ("objectBoundingBox".equals(trim)) {
jVar.f3133i = Boolean.FALSE;
continue;
} else if ("userSpaceOnUse".equals(trim)) {
jVar.f3133i = Boolean.TRUE;
break;
} else {
throw new SVGParseException("Invalid value for attribute gradientUnits");
}
case 33:
jVar.j = K0(trim);
continue;
case 34:
try {
jVar.k = i.k.valueOf(trim);
continue;
} catch (IllegalArgumentException unused) {
throw new SVGParseException("Invalid spreadMethod attribute. \"" + trim + "\" is not a valid value.");
}
}
} else if ("".equals(attributes.getURI(i2)) || l.equals(attributes.getURI(i2))) {
jVar.l = trim;
}
}
}
private static Set<String> G0(String str) {
i iVar = new i(str);
HashSet hashSet = new HashSet();
while (!iVar.h()) {
String r2 = iVar.r();
int indexOf = r2.indexOf(45);
if (indexOf != -1) {
r2 = r2.substring(0, indexOf);
}
hashSet.add(new Locale(r2, "", "").getLanguage());
iVar.A();
}
return hashSet;
}
private void H(i.o oVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 1) {
oVar.q = p0(trim);
} else if (i3 == 2) {
oVar.r = p0(trim);
} else if (i3 == 3) {
i.p p0 = p0(trim);
oVar.s = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <use> element. width cannot be negative");
}
} else if (i3 == 4) {
i.p p02 = p0(trim);
oVar.t = p02;
if (p02.g()) {
throw new SVGParseException("Invalid <use> element. height cannot be negative");
}
} else if (i3 != 6) {
if (i3 == 7) {
x0(oVar, trim);
}
} else if ("".equals(attributes.getURI(i2)) || l.equals(attributes.getURI(i2))) {
oVar.p = trim;
}
}
}
private static i.e0.f H0(String str) {
char c2;
int hashCode = str.hashCode();
if (hashCode == -1074341483) {
if (str.equals("middle")) {
c2 = 1;
}
c2 = 65535;
} else if (hashCode != 100571) {
if (hashCode == 109757538 && str.equals("start")) {
c2 = 0;
}
c2 = 65535;
} else {
if (str.equals(com.google.android.exoplayer2.text.y.d.p0)) {
c2 = 2;
}
c2 = 65535;
}
if (c2 != 0) {
if (c2 != 1) {
if (c2 != 2) {
return null;
}
return i.e0.f.End;
}
return i.e0.f.Middle;
}
return i.e0.f.Start;
}
private void I(i.q qVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
switch (a.b[g.a(attributes.getLocalName(i2)).ordinal()]) {
case 15:
qVar.o = p0(trim);
break;
case 16:
qVar.p = p0(trim);
break;
case 17:
qVar.q = p0(trim);
break;
case 18:
qVar.r = p0(trim);
break;
}
}
}
private static i.e0.g I0(String str) {
char c2;
switch (str.hashCode()) {
case -1171789332:
if (str.equals("line-through")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case -1026963764:
if (str.equals(com.google.android.exoplayer2.text.y.d.h0)) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 3387192:
if (str.equals("none")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case 93826908:
if (str.equals("blink")) {
c2 = 4;
break;
}
c2 = 65535;
break;
case 529818312:
if (str.equals("overline")) {
c2 = 2;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
if (c2 != 0) {
if (c2 != 1) {
if (c2 != 2) {
if (c2 != 3) {
if (c2 != 4) {
return null;
}
return i.e0.g.Blink;
}
return i.e0.g.LineThrough;
}
return i.e0.g.Overline;
}
return i.e0.g.Underline;
}
return i.e0.g.None;
}
private void J(i.m0 m0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
switch (a.b[g.a(attributes.getLocalName(i2)).ordinal()]) {
case 15:
m0Var.m = p0(trim);
break;
case 16:
m0Var.n = p0(trim);
break;
case 17:
m0Var.o = p0(trim);
break;
case 18:
m0Var.p = p0(trim);
break;
}
}
}
private static i.e0.h J0(String str) {
char c2;
int hashCode = str.hashCode();
if (hashCode != 107498) {
if (hashCode == 113258 && str.equals("rtl")) {
c2 = 1;
}
c2 = 65535;
} else {
if (str.equals("ltr")) {
c2 = 0;
}
c2 = 65535;
}
if (c2 != 0) {
if (c2 != 1) {
return null;
}
return i.e0.h.RTL;
}
return i.e0.h.LTR;
}
private void K(i.r rVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
switch (a.b[g.a(attributes.getLocalName(i2)).ordinal()]) {
case 26:
rVar.r = p0(trim);
break;
case 27:
rVar.s = p0(trim);
break;
case 28:
i.p p0 = p0(trim);
rVar.t = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <marker> element. markerWidth cannot be negative");
}
break;
case 29:
i.p p02 = p0(trim);
rVar.u = p02;
if (p02.g()) {
throw new SVGParseException("Invalid <marker> element. markerHeight cannot be negative");
}
break;
case 30:
if ("strokeWidth".equals(trim)) {
rVar.q = false;
break;
} else if ("userSpaceOnUse".equals(trim)) {
rVar.q = true;
break;
} else {
throw new SVGParseException("Invalid value for attribute markerUnits");
}
case 31:
if ("auto".equals(trim)) {
rVar.v = Float.valueOf(Float.NaN);
break;
} else {
rVar.v = Float.valueOf(g0(trim));
break;
}
}
}
}
private Matrix K0(String str) throws SVGParseException {
Matrix matrix = new Matrix();
i iVar = new i(str);
iVar.A();
while (!iVar.h()) {
String o2 = iVar.o();
if (o2 != null) {
char c2 = 65535;
switch (o2.hashCode()) {
case -1081239615:
if (o2.equals("matrix")) {
c2 = 0;
break;
}
break;
case -925180581:
if (o2.equals("rotate")) {
c2 = 3;
break;
}
break;
case 109250890:
if (o2.equals("scale")) {
c2 = 2;
break;
}
break;
case 109493390:
if (o2.equals("skewX")) {
c2 = 4;
break;
}
break;
case 109493391:
if (o2.equals("skewY")) {
c2 = 5;
break;
}
break;
case 1052832078:
if (o2.equals("translate")) {
c2 = 1;
break;
}
break;
}
if (c2 == 0) {
iVar.A();
float n2 = iVar.n();
iVar.z();
float n3 = iVar.n();
iVar.z();
float n4 = iVar.n();
iVar.z();
float n5 = iVar.n();
iVar.z();
float n6 = iVar.n();
iVar.z();
float n7 = iVar.n();
iVar.A();
if (!Float.isNaN(n7) && iVar.f(')')) {
Matrix matrix2 = new Matrix();
matrix2.setValues(new float[]{n2, n4, n6, n3, n5, n7, 0.0f, 0.0f, 1.0f});
matrix.preConcat(matrix2);
} else {
throw new SVGParseException("Invalid transform list: " + str);
}
} else if (c2 == 1) {
iVar.A();
float n8 = iVar.n();
float x2 = iVar.x();
iVar.A();
if (!Float.isNaN(n8) && iVar.f(')')) {
if (Float.isNaN(x2)) {
matrix.preTranslate(n8, 0.0f);
} else {
matrix.preTranslate(n8, x2);
}
} else {
throw new SVGParseException("Invalid transform list: " + str);
}
} else if (c2 == 2) {
iVar.A();
float n9 = iVar.n();
float x3 = iVar.x();
iVar.A();
if (!Float.isNaN(n9) && iVar.f(')')) {
if (Float.isNaN(x3)) {
matrix.preScale(n9, n9);
} else {
matrix.preScale(n9, x3);
}
} else {
throw new SVGParseException("Invalid transform list: " + str);
}
} else if (c2 == 3) {
iVar.A();
float n10 = iVar.n();
float x4 = iVar.x();
float x5 = iVar.x();
iVar.A();
if (!Float.isNaN(n10) && iVar.f(')')) {
if (Float.isNaN(x4)) {
matrix.preRotate(n10);
} else if (!Float.isNaN(x5)) {
matrix.preRotate(n10, x4, x5);
} else {
throw new SVGParseException("Invalid transform list: " + str);
}
} else {
throw new SVGParseException("Invalid transform list: " + str);
}
} else if (c2 == 4) {
iVar.A();
float n11 = iVar.n();
iVar.A();
if (!Float.isNaN(n11) && iVar.f(')')) {
matrix.preSkew((float) Math.tan(Math.toRadians(n11)), 0.0f);
} else {
throw new SVGParseException("Invalid transform list: " + str);
}
} else if (c2 == 5) {
iVar.A();
float n12 = iVar.n();
iVar.A();
if (!Float.isNaN(n12) && iVar.f(')')) {
matrix.preSkew(0.0f, (float) Math.tan(Math.toRadians(n12)));
} else {
throw new SVGParseException("Invalid transform list: " + str);
}
} else {
throw new SVGParseException("Invalid transform list fn: " + o2 + ")");
}
if (iVar.h()) {
return matrix;
}
iVar.z();
} else {
throw new SVGParseException("Bad transform function encountered in transform list: " + str);
}
}
return matrix;
}
private void L(i.s sVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 1) {
sVar.q = p0(trim);
} else if (i3 == 2) {
sVar.r = p0(trim);
} else if (i3 == 3) {
i.p p0 = p0(trim);
sVar.s = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <mask> element. width cannot be negative");
}
} else if (i3 == 4) {
i.p p02 = p0(trim);
sVar.t = p02;
if (p02.g()) {
throw new SVGParseException("Invalid <mask> element. height cannot be negative");
}
} else if (i3 != 43) {
if (i3 != 44) {
continue;
} else if ("objectBoundingBox".equals(trim)) {
sVar.p = Boolean.FALSE;
} else if ("userSpaceOnUse".equals(trim)) {
sVar.p = Boolean.TRUE;
} else {
throw new SVGParseException("Invalid value for attribute maskContentUnits");
}
} else if ("objectBoundingBox".equals(trim)) {
sVar.o = Boolean.FALSE;
} else if ("userSpaceOnUse".equals(trim)) {
sVar.o = Boolean.TRUE;
} else {
throw new SVGParseException("Invalid value for attribute maskUnits");
}
}
}
private void L0(InputStream inputStream) throws SVGParseException {
Log.d(j, "Falling back to SAX parser");
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(this, null);
xMLReader.setContentHandler(fVar);
xMLReader.setProperty("http://xml.org/sax/properties/lexical-handler", fVar);
xMLReader.parse(new InputSource(inputStream));
} catch (IOException e2) {
throw new SVGParseException("Stream error", e2);
} catch (ParserConfigurationException e3) {
throw new SVGParseException("XML parser problem", e3);
} catch (SAXException e4) {
throw new SVGParseException("SVG parse error", e4);
}
}
private void M(i.v vVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 8) {
vVar.o = v0(trim);
} else if (i3 != 9) {
continue;
} else {
Float valueOf = Float.valueOf(g0(trim));
vVar.p = valueOf;
if (valueOf.floatValue() < 0.0f) {
throw new SVGParseException("Invalid <path> element. pathLength cannot be negative");
}
}
}
}
private void M0(InputStream inputStream, boolean z) throws SVGParseException {
try {
try {
XmlPullParser newPullParser = Xml.newPullParser();
j jVar = new j(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) {
X0();
} else if (eventType == 8) {
Log.d(j, "PROC INSTR: " + newPullParser.getText());
i iVar = new i(newPullParser.getText());
s(iVar.r(), y0(iVar));
} else if (eventType != 10) {
if (eventType == 2) {
String name = newPullParser.getName();
if (newPullParser.getPrefix() != null) {
name = newPullParser.getPrefix() + ':' + name;
}
Y0(newPullParser.getNamespace(), newPullParser.getName(), name, jVar);
} else if (eventType == 3) {
String name2 = newPullParser.getName();
if (newPullParser.getPrefix() != null) {
name2 = newPullParser.getPrefix() + ':' + name2;
}
q(newPullParser.getNamespace(), newPullParser.getName(), name2);
} else if (eventType == 4) {
int[] iArr = new int[2];
f1(newPullParser.getTextCharacters(iArr), iArr[0], iArr[1]);
} else if (eventType == 5) {
d1(newPullParser.getText());
}
} else if (z && this.a.z() == null && newPullParser.getText().contains("<!ENTITY ")) {
try {
Log.d(j, "Switching to SAX parser to process entities");
inputStream.reset();
L0(inputStream);
return;
} catch (IOException unused) {
Log.w(j, "Detected internal entity definitions, but could not parse them.");
return;
}
}
}
p();
} catch (IOException e2) {
throw new SVGParseException("Stream error", e2);
}
} catch (XmlPullParserException e3) {
throw new SVGParseException("XML parser problem", e3);
}
}
private void N(i.y yVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 1) {
yVar.t = p0(trim);
} else if (i3 == 2) {
yVar.u = p0(trim);
} else if (i3 == 3) {
i.p p0 = p0(trim);
yVar.v = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <pattern> element. width cannot be negative");
}
} else if (i3 == 4) {
i.p p02 = p0(trim);
yVar.w = p02;
if (p02.g()) {
throw new SVGParseException("Invalid <pattern> element. height cannot be negative");
}
} else if (i3 != 6) {
switch (i3) {
case 40:
if ("objectBoundingBox".equals(trim)) {
yVar.q = Boolean.FALSE;
continue;
} else if ("userSpaceOnUse".equals(trim)) {
yVar.q = Boolean.TRUE;
break;
} else {
throw new SVGParseException("Invalid value for attribute patternUnits");
}
case 41:
if ("objectBoundingBox".equals(trim)) {
yVar.r = Boolean.FALSE;
continue;
} else if ("userSpaceOnUse".equals(trim)) {
yVar.r = Boolean.TRUE;
break;
} else {
throw new SVGParseException("Invalid value for attribute patternContentUnits");
}
case 42:
yVar.s = K0(trim);
continue;
}
} else if ("".equals(attributes.getURI(i2)) || l.equals(attributes.getURI(i2))) {
yVar.x = trim;
}
}
}
private static i.e0.EnumC0128i N0(String str) {
char c2;
int hashCode = str.hashCode();
if (hashCode != 3387192) {
if (hashCode == 1629199934 && str.equals("non-scaling-stroke")) {
c2 = 1;
}
c2 = 65535;
} else {
if (str.equals("none")) {
c2 = 0;
}
c2 = 65535;
}
if (c2 != 0) {
if (c2 != 1) {
return null;
}
return i.e0.EnumC0128i.NonScalingStroke;
}
return i.e0.EnumC0128i.None;
}
private void O(i.z zVar, Attributes attributes, String str) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
if (g.a(attributes.getLocalName(i2)) == g.points) {
i iVar = new i(attributes.getValue(i2));
ArrayList<Float> arrayList = new ArrayList();
iVar.A();
while (!iVar.h()) {
float n2 = iVar.n();
if (!Float.isNaN(n2)) {
iVar.z();
float n3 = iVar.n();
if (!Float.isNaN(n3)) {
iVar.z();
arrayList.add(Float.valueOf(n2));
arrayList.add(Float.valueOf(n3));
} else {
throw new SVGParseException("Invalid <" + str + "> points attribute. There should be an even number of coordinates.");
}
} else {
throw new SVGParseException("Invalid <" + str + "> points attribute. Non-coordinate content found in list.");
}
}
zVar.o = new float[arrayList.size()];
int i3 = 0;
for (Float f2 : arrayList) {
zVar.o[i3] = f2.floatValue();
i3++;
}
}
}
}
private static i.b O0(String str) throws SVGParseException {
i iVar = new i(str);
iVar.A();
float n2 = iVar.n();
iVar.z();
float n3 = iVar.n();
iVar.z();
float n4 = iVar.n();
iVar.z();
float n5 = iVar.n();
if (Float.isNaN(n2) || Float.isNaN(n3) || Float.isNaN(n4) || Float.isNaN(n5)) {
throw new SVGParseException("Invalid viewBox definition - should have four numbers");
}
if (n4 >= 0.0f) {
if (n5 >= 0.0f) {
return new i.b(n2, n3, n4, n5);
}
throw new SVGParseException("Invalid viewBox. height cannot be negative");
}
throw new SVGParseException("Invalid viewBox. width cannot be negative");
}
private void P(i.q0 q0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 35) {
q0Var.p = p0(trim);
} else if (i3 != 36) {
switch (i3) {
case 12:
q0Var.m = p0(trim);
continue;
case 13:
q0Var.n = p0(trim);
continue;
case 14:
i.p p0 = p0(trim);
q0Var.o = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <radialGradient> element. r cannot be negative");
}
continue;
}
} else {
q0Var.q = p0(trim);
}
}
}
private void P0(Attributes attributes) throws SVGParseException {
l("<path>", new Object[0]);
if (this.b != null) {
i.v vVar = new i.v();
vVar.a = this.a;
vVar.b = this.b;
E(vVar, attributes);
T(vVar, attributes);
X(vVar, attributes);
D(vVar, attributes);
M(vVar, attributes);
this.b.j(vVar);
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void Q(i.b0 b0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 1) {
b0Var.o = p0(trim);
} else if (i3 == 2) {
b0Var.p = p0(trim);
} else if (i3 == 3) {
i.p p0 = p0(trim);
b0Var.q = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <rect> element. width cannot be negative");
}
} else if (i3 == 4) {
i.p p02 = p0(trim);
b0Var.r = p02;
if (p02.g()) {
throw new SVGParseException("Invalid <rect> element. height cannot be negative");
}
} else if (i3 == 10) {
i.p p03 = p0(trim);
b0Var.s = p03;
if (p03.g()) {
throw new SVGParseException("Invalid <rect> element. rx cannot be negative");
}
} else if (i3 != 11) {
continue;
} else {
i.p p04 = p0(trim);
b0Var.t = p04;
if (p04.g()) {
throw new SVGParseException("Invalid <rect> element. ry cannot be negative");
}
}
}
}
private void Q0(Attributes attributes) throws SVGParseException {
l("<pattern>", new Object[0]);
if (this.b != null) {
i.y yVar = new i.y();
yVar.a = this.a;
yVar.b = this.b;
E(yVar, attributes);
T(yVar, attributes);
D(yVar, attributes);
Z(yVar, attributes);
N(yVar, attributes);
this.b.j(yVar);
this.b = yVar;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void R(i.f0 f0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 1) {
f0Var.q = p0(trim);
} else if (i3 == 2) {
f0Var.r = p0(trim);
} else if (i3 == 3) {
i.p p0 = p0(trim);
f0Var.s = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <svg> element. width cannot be negative");
}
} else if (i3 == 4) {
i.p p02 = p0(trim);
f0Var.t = p02;
if (p02.g()) {
throw new SVGParseException("Invalid <svg> element. height cannot be negative");
}
} else if (i3 == 5) {
f0Var.u = trim;
}
}
}
private void R0(Attributes attributes) throws SVGParseException {
l("<polygon>", new Object[0]);
if (this.b != null) {
i.z a0Var = new i.a0();
a0Var.a = this.a;
a0Var.b = this.b;
E(a0Var, attributes);
T(a0Var, attributes);
X(a0Var, attributes);
D(a0Var, attributes);
O(a0Var, attributes, "polygon");
this.b.j(a0Var);
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void S(i.d0 d0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
if (a.b[g.a(attributes.getLocalName(i2)).ordinal()] == 37) {
d0Var.f3109h = o0(trim);
}
}
}
private void S0(Attributes attributes) throws SVGParseException {
l("<polyline>", new Object[0]);
if (this.b != null) {
i.z zVar = new i.z();
zVar.a = this.a;
zVar.b = this.b;
E(zVar, attributes);
T(zVar, attributes);
X(zVar, attributes);
D(zVar, attributes);
O(zVar, attributes, "polyline");
this.b.j(zVar);
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void T(i.l0 l0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
if (trim.length() != 0) {
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 45) {
F0(l0Var, trim);
} else if (i3 != 46) {
if (l0Var.f3137e == null) {
l0Var.f3137e = new i.e0();
}
T0(l0Var.f3137e, attributes.getLocalName(i2), attributes.getValue(i2).trim());
} else {
l0Var.f3139g = com.caverock.androidsvg.c.f(trim);
}
}
}
}
public static void T0(i.e0 e0Var, String str, String str2) {
if (str2.length() == 0 || str2.equals("inherit")) {
return;
}
try {
switch (a.b[g.a(str).ordinal()]) {
case 47:
i.o0 u0 = u0(str2);
e0Var.b = u0;
if (u0 != null) {
e0Var.a |= 1;
return;
}
return;
case 48:
i.e0.a f0 = f0(str2);
e0Var.c = f0;
if (f0 != null) {
e0Var.a |= 2;
return;
}
return;
case 49:
Float s0 = s0(str2);
e0Var.f3116d = s0;
if (s0 != null) {
e0Var.a |= 4;
return;
}
return;
case 50:
i.o0 u02 = u0(str2);
e0Var.f3117e = u02;
if (u02 != null) {
e0Var.a |= 8;
return;
}
return;
case 51:
Float s02 = s0(str2);
e0Var.f3118f = s02;
if (s02 != null) {
e0Var.a |= 16;
return;
}
return;
case 52:
e0Var.f3119g = p0(str2);
e0Var.a |= 32;
break;
case 53:
i.e0.c D0 = D0(str2);
e0Var.f3120h = D0;
if (D0 != null) {
e0Var.a |= 64;
return;
}
return;
case 54:
i.e0.d E0 = E0(str2);
e0Var.f3121i = E0;
if (E0 != null) {
e0Var.a |= 128;
return;
}
return;
case 55:
e0Var.j = Float.valueOf(g0(str2));
e0Var.a |= 256;
break;
case 56:
if ("none".equals(str2)) {
e0Var.k = null;
e0Var.a |= 512;
return;
}
i.p[] C0 = C0(str2);
e0Var.k = C0;
if (C0 != null) {
e0Var.a |= 512;
return;
}
return;
case 57:
e0Var.l = p0(str2);
e0Var.a |= 1024;
break;
case 58:
e0Var.m = s0(str2);
e0Var.a |= 2048;
return;
case 59:
e0Var.n = c0(str2);
e0Var.a |= 4096;
break;
case 60:
i0(e0Var, str2);
return;
case 61:
List<String> j0 = j0(str2);
e0Var.o = j0;
if (j0 != null) {
e0Var.a |= PlaybackStateCompat.ACTION_PLAY_FROM_URI;
return;
}
return;
case 62:
i.p k0 = k0(str2);
e0Var.p = k0;
if (k0 != null) {
e0Var.a |= 16384;
return;
}
return;
case 63:
Integer m0 = m0(str2);
e0Var.q = m0;
if (m0 != null) {
e0Var.a |= PlaybackStateCompat.ACTION_PREPARE_FROM_MEDIA_ID;
return;
}
return;
case 64:
i.e0.b l0 = l0(str2);
e0Var.r = l0;
if (l0 != null) {
e0Var.a |= PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH;
return;
}
return;
case 65:
i.e0.g I0 = I0(str2);
e0Var.s = I0;
if (I0 != null) {
e0Var.a |= PlaybackStateCompat.ACTION_PREPARE_FROM_URI;
return;
}
return;
case 66:
i.e0.h J0 = J0(str2);
e0Var.t = J0;
if (J0 != null) {
e0Var.a |= 68719476736L;
return;
}
return;
case 67:
i.e0.f H0 = H0(str2);
e0Var.u = H0;
if (H0 != null) {
e0Var.a |= PlaybackStateCompat.ACTION_SET_REPEAT_MODE;
return;
}
return;
case 68:
Boolean t0 = t0(str2);
e0Var.v = t0;
if (t0 != null) {
e0Var.a |= PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE_ENABLED;
return;
}
return;
case 69:
String n0 = n0(str2, str);
e0Var.x = n0;
e0Var.y = n0;
e0Var.z = n0;
e0Var.a |= 14680064;
return;
case 70:
e0Var.x = n0(str2, str);
e0Var.a |= PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE;
return;
case 71:
e0Var.y = n0(str2, str);
e0Var.a |= PlaybackStateCompat.ACTION_SET_PLAYBACK_SPEED;
return;
case 72:
e0Var.z = n0(str2, str);
e0Var.a |= 8388608;
return;
case 73:
if (str2.indexOf(124) < 0) {
if (x.contains('|' + str2 + '|')) {
e0Var.A = Boolean.valueOf(!str2.equals("none"));
e0Var.a |= 16777216;
return;
}
return;
}
return;
case 74:
if (str2.indexOf(124) < 0) {
if (y.contains('|' + str2 + '|')) {
e0Var.B = Boolean.valueOf(str2.equals("visible"));
e0Var.a |= 33554432;
return;
}
return;
}
return;
case 75:
if (str2.equals(w)) {
e0Var.C = i.g.a();
} else {
try {
e0Var.C = c0(str2);
} catch (SVGParseException e2) {
Log.w(j, e2.getMessage());
return;
}
}
e0Var.a |= 67108864;
return;
case 76:
e0Var.D = s0(str2);
e0Var.a |= 134217728;
return;
case 77:
i.c b0 = b0(str2);
e0Var.w = b0;
if (b0 != null) {
e0Var.a |= 1048576;
return;
}
return;
case 78:
e0Var.E = n0(str2, str);
e0Var.a |= 268435456;
return;
case 79:
e0Var.F = f0(str2);
e0Var.a |= 536870912;
return;
case 80:
e0Var.G = n0(str2, str);
e0Var.a |= DownloadConstants.GB;
return;
case 81:
if (str2.equals(w)) {
e0Var.H = i.g.a();
} else {
try {
e0Var.H = c0(str2);
} catch (SVGParseException e3) {
Log.w(j, e3.getMessage());
return;
}
}
e0Var.a |= 2147483648L;
return;
case 82:
e0Var.I = s0(str2);
e0Var.a |= 4294967296L;
return;
case 83:
if (str2.equals(w)) {
e0Var.J = i.g.a();
} else {
try {
e0Var.J = c0(str2);
} catch (SVGParseException e4) {
Log.w(j, e4.getMessage());
return;
}
}
e0Var.a |= 8589934592L;
return;
case 84:
e0Var.K = s0(str2);
e0Var.a |= 17179869184L;
return;
case 85:
i.e0.EnumC0128i N0 = N0(str2);
e0Var.L = N0;
if (N0 != null) {
e0Var.a |= 34359738368L;
return;
}
return;
case 86:
i.e0.e z0 = z0(str2);
e0Var.M = z0;
if (z0 != null) {
e0Var.a |= 137438953472L;
return;
}
return;
default:
}
} catch (SVGParseException unused) {
}
}
private void U(i.u0 u0Var, Attributes attributes) {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
if (a.b[g.a(attributes.getLocalName(i2)).ordinal()] == 6 && ("".equals(attributes.getURI(i2)) || l.equals(attributes.getURI(i2)))) {
u0Var.o = trim;
}
}
}
private void U0(Attributes attributes) throws SVGParseException {
l("<radialGradient>", new Object[0]);
if (this.b != null) {
i.q0 q0Var = new i.q0();
q0Var.a = this.a;
q0Var.b = this.b;
E(q0Var, attributes);
T(q0Var, attributes);
G(q0Var, attributes);
P(q0Var, attributes);
this.b.j(q0Var);
this.b = q0Var;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void V(i.z0 z0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 != 6) {
if (i3 == 39) {
z0Var.p = p0(trim);
}
} else if ("".equals(attributes.getURI(i2)) || l.equals(attributes.getURI(i2))) {
z0Var.o = trim;
}
}
}
private void V0(Attributes attributes) throws SVGParseException {
l("<rect>", new Object[0]);
if (this.b != null) {
i.b0 b0Var = new i.b0();
b0Var.a = this.a;
b0Var.b = this.b;
E(b0Var, attributes);
T(b0Var, attributes);
X(b0Var, attributes);
D(b0Var, attributes);
Q(b0Var, attributes);
this.b.j(b0Var);
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void W(i.a1 a1Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 1) {
a1Var.o = q0(trim);
} else if (i3 == 2) {
a1Var.p = q0(trim);
} else if (i3 == 19) {
a1Var.q = q0(trim);
} else if (i3 == 20) {
a1Var.r = q0(trim);
}
}
}
private void W0(Attributes attributes) throws SVGParseException {
l("<solidColor>", new Object[0]);
if (this.b != null) {
i.c0 c0Var = new i.c0();
c0Var.a = this.a;
c0Var.b = this.b;
E(c0Var, attributes);
T(c0Var, attributes);
this.b.j(c0Var);
this.b = c0Var;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void X(i.n nVar, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
if (g.a(attributes.getLocalName(i2)) == g.transform) {
nVar.m(K0(attributes.getValue(i2)));
}
}
}
public void X0() {
this.a = new com.caverock.androidsvg.i();
}
private void Y(i.e1 e1Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 1) {
e1Var.q = p0(trim);
} else if (i3 == 2) {
e1Var.r = p0(trim);
} else if (i3 == 3) {
i.p p0 = p0(trim);
e1Var.s = p0;
if (p0.g()) {
throw new SVGParseException("Invalid <use> element. width cannot be negative");
}
} else if (i3 != 4) {
if (i3 == 6 && ("".equals(attributes.getURI(i2)) || l.equals(attributes.getURI(i2)))) {
e1Var.p = trim;
}
} else {
i.p p02 = p0(trim);
e1Var.t = p02;
if (p02.g()) {
throw new SVGParseException("Invalid <use> element. height cannot be negative");
}
}
}
}
public void Y0(String str, String str2, String str3, Attributes attributes) throws SVGParseException {
if (this.c) {
this.f3175d++;
} else if (k.equals(str) || "".equals(str)) {
if (str2.length() <= 0) {
str2 = str3;
}
h a2 = h.a(str2);
switch (a.a[a2.ordinal()]) {
case 1:
b1(attributes);
return;
case 2:
case 3:
r(attributes);
return;
case 4:
m(attributes);
return;
case 5:
j1(attributes);
return;
case 6:
P0(attributes);
return;
case 7:
V0(attributes);
return;
case 8:
i(attributes);
return;
case 9:
o(attributes);
return;
case 10:
w(attributes);
return;
case 11:
S0(attributes);
return;
case 12:
R0(attributes);
return;
case 13:
e1(attributes);
return;
case 14:
i1(attributes);
return;
case 15:
h1(attributes);
return;
case 16:
l1(attributes);
return;
case 17:
c1(attributes);
return;
case 18:
y(attributes);
return;
case 19:
x(attributes);
return;
case 20:
U0(attributes);
return;
case 21:
Z0(attributes);
return;
case 22:
case 23:
this.f3176e = true;
this.f3177f = a2;
return;
case 24:
k(attributes);
return;
case 25:
g1(attributes);
return;
case 26:
Q0(attributes);
return;
case 27:
v(attributes);
return;
case 28:
k1(attributes);
return;
case 29:
z(attributes);
return;
case 30:
a1(attributes);
return;
case 31:
W0(attributes);
return;
default:
this.c = true;
this.f3175d = 1;
return;
}
}
}
private void Z(i.r0 r0Var, Attributes attributes) throws SVGParseException {
for (int i2 = 0; i2 < attributes.getLength(); i2++) {
String trim = attributes.getValue(i2).trim();
int i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 7) {
x0(r0Var, trim);
} else if (i3 == 87) {
r0Var.p = O0(trim);
}
}
}
private void Z0(Attributes attributes) throws SVGParseException {
l("<stop>", new Object[0]);
i.j0 j0Var = this.b;
if (j0Var != null) {
if (j0Var instanceof i.j) {
i.d0 d0Var = new i.d0();
d0Var.a = this.a;
d0Var.b = this.b;
E(d0Var, attributes);
T(d0Var, attributes);
S(d0Var, attributes);
this.b.j(d0Var);
this.b = d0Var;
return;
}
throw new SVGParseException("Invalid document. <stop> elements are only valid inside <linearGradient> or <radialGradient> elements.");
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void a0(String str) {
this.a.a(new com.caverock.androidsvg.c(c.f.screen, c.u.Document).d(str));
}
private void a1(Attributes attributes) throws SVGParseException {
l("<style>", new Object[0]);
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 i3 = a.b[g.a(attributes.getLocalName(i2)).ordinal()];
if (i3 == 88) {
z = trim.equals("text/css");
} else if (i3 == 89) {
str = trim;
}
}
if (z && com.caverock.androidsvg.c.b(str, c.f.screen)) {
this.f3179h = true;
return;
}
this.c = true;
this.f3175d = 1;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static i.c b0(String str) {
if (!"auto".equals(str) && str.startsWith("rect(")) {
i iVar = new i(str.substring(5));
iVar.A();
i.p r0 = r0(iVar);
iVar.z();
i.p r02 = r0(iVar);
iVar.z();
i.p r03 = r0(iVar);
iVar.z();
i.p r04 = r0(iVar);
iVar.A();
if (iVar.f(')') || iVar.h()) {
return new i.c(r0, r02, r03, r04);
}
return null;
}
return null;
}
private void b1(Attributes attributes) throws SVGParseException {
l("<svg>", new Object[0]);
i.f0 f0Var = new i.f0();
f0Var.a = this.a;
f0Var.b = this.b;
E(f0Var, attributes);
T(f0Var, attributes);
D(f0Var, attributes);
Z(f0Var, attributes);
R(f0Var, attributes);
i.j0 j0Var = this.b;
if (j0Var == null) {
this.a.Z(f0Var);
} else {
j0Var.j(f0Var);
}
this.b = f0Var;
}
private static i.f c0(String str) throws SVGParseException {
if (str.charAt(0) == '#') {
com.caverock.androidsvg.d b2 = com.caverock.androidsvg.d.b(str, 1, str.length());
if (b2 != null) {
int a2 = b2.a();
if (a2 == 4) {
int d2 = b2.d();
int i2 = d2 & 3840;
int i3 = d2 & 240;
int i4 = d2 & 15;
return new i.f(i4 | (i2 << 8) | (-16777216) | (i2 << 12) | (i3 << 8) | (i3 << 4) | (i4 << 4));
} else if (a2 == 5) {
int d3 = b2.d();
int i5 = 61440 & d3;
int i6 = d3 & 3840;
int i7 = d3 & 240;
int i8 = d3 & 15;
return new i.f((i8 << 24) | (i8 << 28) | (i5 << 8) | (i5 << 4) | (i6 << 4) | i6 | i7 | (i7 >> 4));
} else if (a2 != 7) {
if (a2 == 9) {
return new i.f((b2.d() >>> 8) | (b2.d() << 24));
}
throw new SVGParseException("Bad hex colour value: " + str);
} else {
return new i.f(b2.d() | (-16777216));
}
}
throw new SVGParseException("Bad hex colour value: " + str);
}
String lowerCase = str.toLowerCase(Locale.US);
boolean startsWith = lowerCase.startsWith("rgba(");
if (!startsWith && !lowerCase.startsWith("rgb(")) {
boolean startsWith2 = lowerCase.startsWith("hsla(");
if (!startsWith2 && !lowerCase.startsWith("hsl(")) {
return d0(lowerCase);
}
i iVar = new i(str.substring(startsWith2 ? 5 : 4));
iVar.A();
float n2 = iVar.n();
float d4 = iVar.d(n2);
if (!Float.isNaN(d4)) {
iVar.f('%');
}
float d5 = iVar.d(d4);
if (!Float.isNaN(d5)) {
iVar.f('%');
}
if (startsWith2) {
float d6 = iVar.d(d5);
iVar.A();
if (!Float.isNaN(d6) && iVar.f(')')) {
return new i.f((j(d6 * 256.0f) << 24) | t(n2, d4, d5));
}
throw new SVGParseException("Bad hsla() colour value: " + str);
}
iVar.A();
if (!Float.isNaN(d5) && iVar.f(')')) {
return new i.f(t(n2, d4, d5) | (-16777216));
}
throw new SVGParseException("Bad hsl() colour value: " + str);
}
i iVar2 = new i(str.substring(startsWith ? 5 : 4));
iVar2.A();
float n3 = iVar2.n();
if (!Float.isNaN(n3) && iVar2.f('%')) {
n3 = (n3 * 256.0f) / 100.0f;
}
float d7 = iVar2.d(n3);
if (!Float.isNaN(d7) && iVar2.f('%')) {
d7 = (d7 * 256.0f) / 100.0f;
}
float d8 = iVar2.d(d7);
if (!Float.isNaN(d8) && iVar2.f('%')) {
d8 = (d8 * 256.0f) / 100.0f;
}
if (startsWith) {
float d9 = iVar2.d(d8);
iVar2.A();
if (!Float.isNaN(d9) && iVar2.f(')')) {
return new i.f((j(d9 * 256.0f) << 24) | (j(n3) << 16) | (j(d7) << 8) | j(d8));
}
throw new SVGParseException("Bad rgba() colour value: " + str);
}
iVar2.A();
if (!Float.isNaN(d8) && iVar2.f(')')) {
return new i.f((j(n3) << 16) | (-16777216) | (j(d7) << 8) | j(d8));
}
throw new SVGParseException("Bad rgb() colour value: " + str);
}
private void c1(Attributes attributes) throws SVGParseException {
l("<symbol>", new Object[0]);
if (this.b != null) {
i.r0 t0Var = new i.t0();
t0Var.a = this.a;
t0Var.b = this.b;
E(t0Var, attributes);
T(t0Var, attributes);
D(t0Var, attributes);
Z(t0Var, attributes);
this.b.j(t0Var);
this.b = t0Var;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static i.f d0(String str) throws SVGParseException {
Integer a2 = c.a(str);
if (a2 != null) {
return new i.f(a2.intValue());
}
throw new SVGParseException("Invalid colour keyword: " + str);
}
public void d1(String str) throws SVGParseException {
if (this.c) {
return;
}
if (this.f3176e) {
if (this.f3178g == null) {
this.f3178g = new StringBuilder(str.length());
}
this.f3178g.append(str);
} else if (this.f3179h) {
if (this.f3180i == null) {
this.f3180i = new StringBuilder(str.length());
}
this.f3180i.append(str);
} else if (this.b instanceof i.y0) {
h(str);
}
}
private static i.o0 e0(String str) {
char c2;
int hashCode = str.hashCode();
if (hashCode != 3387192) {
if (hashCode == 1442907498 && str.equals(w)) {
c2 = 1;
}
c2 = 65535;
} else {
if (str.equals("none")) {
c2 = 0;
}
c2 = 65535;
}
if (c2 != 0) {
if (c2 != 1) {
try {
return c0(str);
} catch (SVGParseException unused) {
return null;
}
}
return i.g.a();
}
return i.f.c;
}
private void e1(Attributes attributes) throws SVGParseException {
l("<text>", new Object[0]);
if (this.b != null) {
i.w0 w0Var = new i.w0();
w0Var.a = this.a;
w0Var.b = this.b;
E(w0Var, attributes);
T(w0Var, attributes);
X(w0Var, attributes);
D(w0Var, attributes);
W(w0Var, attributes);
this.b.j(w0Var);
this.b = w0Var;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static i.e0.a f0(String str) {
if ("nonzero".equals(str)) {
return i.e0.a.NonZero;
}
if ("evenodd".equals(str)) {
return i.e0.a.EvenOdd;
}
return null;
}
private void f1(char[] cArr, int i2, int i3) throws SVGParseException {
if (this.c) {
return;
}
if (this.f3176e) {
if (this.f3178g == null) {
this.f3178g = new StringBuilder(i3);
}
this.f3178g.append(cArr, i2, i3);
} else if (this.f3179h) {
if (this.f3180i == null) {
this.f3180i = new StringBuilder(i3);
}
this.f3180i.append(cArr, i2, i3);
} else if (this.b instanceof i.y0) {
h(new String(cArr, i2, i3));
}
}
private static float g0(String str) throws SVGParseException {
int length = str.length();
if (length != 0) {
return h0(str, 0, length);
}
throw new SVGParseException("Invalid float value (empty string)");
}
private void g1(Attributes attributes) throws SVGParseException {
l("<textPath>", new Object[0]);
if (this.b != null) {
i.z0 z0Var = new i.z0();
z0Var.a = this.a;
z0Var.b = this.b;
E(z0Var, attributes);
T(z0Var, attributes);
D(z0Var, attributes);
V(z0Var, attributes);
this.b.j(z0Var);
this.b = z0Var;
i.j0 j0Var = z0Var.b;
if (j0Var instanceof i.b1) {
z0Var.l((i.b1) j0Var);
return;
} else {
z0Var.l(((i.x0) j0Var).d());
return;
}
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void h(String str) throws SVGParseException {
i.h0 h0Var = (i.h0) this.b;
int size = h0Var.f3130i.size();
i.n0 n0Var = size == 0 ? null : h0Var.f3130i.get(size - 1);
if (n0Var instanceof i.c1) {
StringBuilder sb = new StringBuilder();
i.c1 c1Var = (i.c1) n0Var;
sb.append(c1Var.c);
sb.append(str);
c1Var.c = sb.toString();
return;
}
this.b.j(new i.c1(str));
}
private static float h0(String str, int i2, int i3) throws SVGParseException {
float b2 = new com.caverock.androidsvg.f().b(str, i2, i3);
if (Float.isNaN(b2)) {
throw new SVGParseException("Invalid float value: " + str);
}
return b2;
}
private void h1(Attributes attributes) throws SVGParseException {
l("<tref>", new Object[0]);
i.j0 j0Var = this.b;
if (j0Var != null) {
if (j0Var instanceof i.y0) {
i.u0 u0Var = new i.u0();
u0Var.a = this.a;
u0Var.b = this.b;
E(u0Var, attributes);
T(u0Var, attributes);
D(u0Var, attributes);
U(u0Var, attributes);
this.b.j(u0Var);
i.j0 j0Var2 = u0Var.b;
if (j0Var2 instanceof i.b1) {
u0Var.l((i.b1) j0Var2);
return;
} else {
u0Var.l(((i.x0) j0Var2).d());
return;
}
}
throw new SVGParseException("Invalid document. <tref> elements are only valid inside <text> or <tspan> elements.");
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void i(Attributes attributes) throws SVGParseException {
l("<circle>", new Object[0]);
if (this.b != null) {
i.d dVar = new i.d();
dVar.a = this.a;
dVar.b = this.b;
E(dVar, attributes);
T(dVar, attributes);
X(dVar, attributes);
D(dVar, attributes);
B(dVar, attributes);
this.b.j(dVar);
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static void i0(i.e0 e0Var, String str) {
String s2;
if ("|caption|icon|menu|message-box|small-caption|status-bar|".contains('|' + str + '|')) {
i iVar = new i(str);
Integer num = null;
i.e0.b bVar = null;
String str2 = null;
while (true) {
s2 = iVar.s('/');
iVar.A();
if (s2 != null) {
if (num != null && bVar != null) {
break;
} else if (!s2.equals("normal") && (num != null || (num = e.a(s2)) == null)) {
if (bVar != null || (bVar = l0(s2)) == null) {
if (str2 != null || !s2.equals("small-caps")) {
break;
}
str2 = s2;
}
}
} else {
return;
}
}
i.p k0 = k0(s2);
if (iVar.f('/')) {
iVar.A();
String r2 = iVar.r();
if (r2 != null) {
try {
p0(r2);
} catch (SVGParseException unused) {
return;
}
}
iVar.A();
}
e0Var.o = j0(iVar.y());
e0Var.p = k0;
e0Var.q = Integer.valueOf(num == null ? 400 : num.intValue());
if (bVar == null) {
bVar = i.e0.b.Normal;
}
e0Var.r = bVar;
e0Var.a |= 122880;
}
}
private void i1(Attributes attributes) throws SVGParseException {
l("<tspan>", new Object[0]);
i.j0 j0Var = this.b;
if (j0Var != null) {
if (j0Var instanceof i.y0) {
i.v0 v0Var = new i.v0();
v0Var.a = this.a;
v0Var.b = this.b;
E(v0Var, attributes);
T(v0Var, attributes);
D(v0Var, attributes);
W(v0Var, attributes);
this.b.j(v0Var);
this.b = v0Var;
i.j0 j0Var2 = v0Var.b;
if (j0Var2 instanceof i.b1) {
v0Var.l((i.b1) j0Var2);
return;
} else {
v0Var.l(((i.x0) j0Var2).d());
return;
}
}
throw new SVGParseException("Invalid document. <tspan> elements are only valid inside <text> or other <tspan> elements.");
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static int j(float f2) {
if (f2 < 0.0f) {
return 0;
}
if (f2 > 255.0f) {
return 255;
}
return Math.round(f2);
}
private static List<String> j0(String str) {
i iVar = new i(str);
ArrayList arrayList = null;
do {
String q2 = iVar.q();
if (q2 == null) {
q2 = iVar.u(',');
}
if (q2 == null) {
break;
}
if (arrayList == null) {
arrayList = new ArrayList();
}
arrayList.add(q2);
iVar.z();
} while (!iVar.h());
return arrayList;
}
private void j1(Attributes attributes) throws SVGParseException {
l("<use>", new Object[0]);
if (this.b != null) {
i.e1 e1Var = new i.e1();
e1Var.a = this.a;
e1Var.b = this.b;
E(e1Var, attributes);
T(e1Var, attributes);
X(e1Var, attributes);
D(e1Var, attributes);
Y(e1Var, attributes);
this.b.j(e1Var);
this.b = e1Var;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void k(Attributes attributes) throws SVGParseException {
l("<clipPath>", new Object[0]);
if (this.b != null) {
i.e eVar = new i.e();
eVar.a = this.a;
eVar.b = this.b;
E(eVar, attributes);
T(eVar, attributes);
X(eVar, attributes);
D(eVar, attributes);
C(eVar, attributes);
this.b.j(eVar);
this.b = eVar;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static i.p k0(String str) {
try {
i.p a2 = d.a(str);
return a2 == null ? p0(str) : a2;
} catch (SVGParseException unused) {
return null;
}
}
private void k1(Attributes attributes) throws SVGParseException {
l("<view>", new Object[0]);
if (this.b != null) {
i.r0 f1Var = new i.f1();
f1Var.a = this.a;
f1Var.b = this.b;
E(f1Var, attributes);
D(f1Var, attributes);
Z(f1Var, attributes);
this.b.j(f1Var);
this.b = f1Var;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void l(String str, Object... objArr) {
}
private static i.e0.b l0(String str) {
char c2;
int hashCode = str.hashCode();
if (hashCode == -1657669071) {
if (str.equals("oblique")) {
c2 = 2;
}
c2 = 65535;
} else if (hashCode != -1178781136) {
if (hashCode == -1039745817 && str.equals("normal")) {
c2 = 1;
}
c2 = 65535;
} else {
if (str.equals(com.google.android.exoplayer2.text.y.d.j0)) {
c2 = 0;
}
c2 = 65535;
}
if (c2 != 0) {
if (c2 != 1) {
if (c2 != 2) {
return null;
}
return i.e0.b.Oblique;
}
return i.e0.b.Normal;
}
return i.e0.b.Italic;
}
private void l1(Attributes attributes) throws SVGParseException {
l("<switch>", new Object[0]);
if (this.b != null) {
i.s0 s0Var = new i.s0();
s0Var.a = this.a;
s0Var.b = this.b;
E(s0Var, attributes);
T(s0Var, attributes);
X(s0Var, attributes);
D(s0Var, attributes);
this.b.j(s0Var);
this.b = s0Var;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private void m(Attributes attributes) throws SVGParseException {
l("<defs>", new Object[0]);
if (this.b != null) {
i.h hVar = new i.h();
hVar.a = this.a;
hVar.b = this.b;
E(hVar, attributes);
T(hVar, attributes);
X(hVar, attributes);
this.b.j(hVar);
this.b = hVar;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static Integer m0(String str) {
return e.a(str);
}
private void n(i.n0 n0Var, String str) {
Log.d(j, str + n0Var);
if (n0Var instanceof i.h0) {
String str2 = str + " ";
for (i.n0 n0Var2 : ((i.h0) n0Var).f3130i) {
n(n0Var2, str2);
}
}
}
private static String n0(String str, String str2) {
if (!str.equals("none") && str.startsWith("url(")) {
if (str.endsWith(")")) {
return str.substring(4, str.length() - 1).trim();
}
return str.substring(4).trim();
}
return null;
}
private void o(Attributes attributes) throws SVGParseException {
l("<ellipse>", new Object[0]);
if (this.b != null) {
i.C0129i c0129i = new i.C0129i();
c0129i.a = this.a;
c0129i.b = this.b;
E(c0129i, attributes);
T(c0129i, attributes);
X(c0129i, attributes);
D(c0129i, attributes);
F(c0129i, attributes);
this.b.j(c0129i);
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private Float o0(String str) throws SVGParseException {
if (str.length() != 0) {
int length = str.length();
boolean z = true;
if (str.charAt(str.length() - 1) == '%') {
length--;
} else {
z = false;
}
try {
float h0 = h0(str, 0, length);
float f2 = 100.0f;
if (z) {
h0 /= 100.0f;
}
if (h0 < 0.0f) {
f2 = 0.0f;
} else if (h0 <= 100.0f) {
f2 = h0;
}
return Float.valueOf(f2);
} catch (NumberFormatException e2) {
throw new SVGParseException("Invalid offset value in <stop>: " + str, e2);
}
}
throw new SVGParseException("Invalid offset value in <stop> (empty string)");
}
public void p() {
}
public static i.p p0(String str) throws SVGParseException {
if (str.length() != 0) {
int length = str.length();
i.d1 d1Var = i.d1.px;
char charAt = str.charAt(length - 1);
if (charAt == '%') {
length--;
d1Var = i.d1.percent;
} else if (length > 2 && Character.isLetter(charAt) && Character.isLetter(str.charAt(length - 2))) {
length -= 2;
try {
d1Var = i.d1.valueOf(str.substring(length).toLowerCase(Locale.US));
} catch (IllegalArgumentException unused) {
throw new SVGParseException("Invalid length unit specifier: " + str);
}
}
try {
return new i.p(h0(str, 0, length), d1Var);
} catch (NumberFormatException e2) {
throw new SVGParseException("Invalid length value: " + str, e2);
}
}
throw new SVGParseException("Invalid length value (empty string)");
}
public void q(String str, String str2, String str3) throws SVGParseException {
if (this.c) {
int i2 = this.f3175d - 1;
this.f3175d = i2;
if (i2 == 0) {
this.c = false;
return;
}
}
if (k.equals(str) || "".equals(str)) {
if (str2.length() <= 0) {
str2 = str3;
}
int i3 = a.a[h.a(str2).ordinal()];
if (i3 != 1 && i3 != 2 && i3 != 4 && i3 != 5 && i3 != 13 && i3 != 14) {
switch (i3) {
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 31:
break;
case 22:
case 23:
this.f3176e = false;
StringBuilder sb = this.f3178g;
if (sb != null) {
h hVar = this.f3177f;
if (hVar == h.title) {
this.a.a0(sb.toString());
} else if (hVar == h.desc) {
this.a.Q(sb.toString());
}
this.f3178g.setLength(0);
return;
}
return;
case 30:
StringBuilder sb2 = this.f3180i;
if (sb2 != null) {
this.f3179h = false;
a0(sb2.toString());
this.f3180i.setLength(0);
return;
}
return;
default:
return;
}
}
this.b = ((i.n0) this.b).b;
}
}
private static List<i.p> q0(String str) throws SVGParseException {
if (str.length() != 0) {
ArrayList arrayList = new ArrayList(1);
i iVar = new i(str);
iVar.A();
while (!iVar.h()) {
float n2 = iVar.n();
if (!Float.isNaN(n2)) {
i.d1 v2 = iVar.v();
if (v2 == null) {
v2 = i.d1.px;
}
arrayList.add(new i.p(n2, v2));
iVar.z();
} else {
throw new SVGParseException("Invalid length list value: " + iVar.b());
}
}
return arrayList;
}
throw new SVGParseException("Invalid length list (empty string)");
}
private void r(Attributes attributes) throws SVGParseException {
l("<g>", new Object[0]);
if (this.b != null) {
i.m mVar = new i.m();
mVar.a = this.a;
mVar.b = this.b;
E(mVar, attributes);
T(mVar, attributes);
X(mVar, attributes);
D(mVar, attributes);
this.b.j(mVar);
this.b = mVar;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static i.p r0(i iVar) {
if (iVar.g("auto")) {
return new i.p(0.0f);
}
return iVar.p();
}
public void s(String str, Map<String, String> map) {
String str2;
String b2;
if (!str.equals(n) || com.caverock.androidsvg.i.s() == null) {
return;
}
if (map.get("type") == null || "text/css".equals(map.get("type"))) {
if ((map.get(p) != null && !t.equals(map.get(p))) || (str2 = map.get(q)) == null || (b2 = com.caverock.androidsvg.i.s().b(str2)) == null) {
return;
}
String str3 = map.get("media");
if (str3 != null && !"all".equals(str3.trim())) {
b2 = "@media " + str3 + " { " + b2 + "}";
}
a0(b2);
}
}
private static Float s0(String str) {
try {
float g0 = g0(str);
if (g0 < 0.0f) {
g0 = 0.0f;
} else if (g0 > 1.0f) {
g0 = 1.0f;
}
return Float.valueOf(g0);
} catch (SVGParseException unused) {
return null;
}
}
private static int t(float f2, float f3, float f4) {
int i2 = (f2 > 0.0f ? 1 : (f2 == 0.0f ? 0 : -1));
float f5 = f2 % 360.0f;
if (i2 < 0) {
f5 += 360.0f;
}
float f6 = f5 / 60.0f;
float f7 = f3 / 100.0f;
float f8 = f4 / 100.0f;
if (f7 < 0.0f) {
f7 = 0.0f;
} else if (f7 > 1.0f) {
f7 = 1.0f;
}
float f9 = f8 >= 0.0f ? f8 > 1.0f ? 1.0f : f8 : 0.0f;
float f10 = f9 <= 0.5f ? (f7 + 1.0f) * f9 : (f9 + f7) - (f7 * f9);
float f11 = (f9 * 2.0f) - f10;
return j(u(f11, f10, f6 - 2.0f) * 256.0f) | (j(u(f11, f10, f6 + 2.0f) * 256.0f) << 16) | (j(u(f11, f10, f6) * 256.0f) << 8);
}
private static Boolean t0(String str) {
char c2;
switch (str.hashCode()) {
case -1217487446:
if (str.equals("hidden")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case -907680051:
if (str.equals("scroll")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case 3005871:
if (str.equals("auto")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 466743410:
if (str.equals("visible")) {
c2 = 0;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
if (c2 == 0 || c2 == 1) {
return Boolean.TRUE;
}
if (c2 == 2 || c2 == 3) {
return Boolean.FALSE;
}
return null;
}
private static float u(float f2, float f3, float f4) {
float f5;
if (f4 < 0.0f) {
f4 += 6.0f;
}
if (f4 >= 6.0f) {
f4 -= 6.0f;
}
if (f4 < 1.0f) {
f5 = (f3 - f2) * f4;
} else if (f4 < 3.0f) {
return f3;
} else {
if (f4 >= 4.0f) {
return f2;
}
f5 = (f3 - f2) * (4.0f - f4);
}
return f5 + f2;
}
private static i.o0 u0(String str) {
if (str.startsWith("url(")) {
int indexOf = str.indexOf(")");
if (indexOf != -1) {
String trim = str.substring(4, indexOf).trim();
String trim2 = str.substring(indexOf + 1).trim();
return new i.u(trim, trim2.length() > 0 ? e0(trim2) : null);
}
return new i.u(str.substring(4).trim(), null);
}
return e0(str);
}
private void v(Attributes attributes) throws SVGParseException {
l("<image>", new Object[0]);
if (this.b != null) {
i.o oVar = new i.o();
oVar.a = this.a;
oVar.b = this.b;
E(oVar, attributes);
T(oVar, attributes);
X(oVar, attributes);
D(oVar, attributes);
H(oVar, attributes);
this.b.j(oVar);
this.b = oVar;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static i.w v0(String str) {
float d2;
float d3;
float f2;
float f3;
i iVar = new i(str);
i.w wVar = new i.w();
if (iVar.h()) {
return wVar;
}
int intValue = iVar.l().intValue();
int i2 = 109;
if (intValue != 77 && intValue != 109) {
return wVar;
}
int i3 = intValue;
float f4 = 0.0f;
float f5 = 0.0f;
float f6 = 0.0f;
float f7 = 0.0f;
float f8 = 0.0f;
float f9 = 0.0f;
while (true) {
iVar.A();
switch (i3) {
case 65:
case 97:
float n2 = iVar.n();
float d4 = iVar.d(n2);
float d5 = iVar.d(d4);
Boolean c2 = iVar.c(Float.valueOf(d5));
Boolean c3 = iVar.c(c2);
float e2 = iVar.e(c3);
float d6 = iVar.d(e2);
if (!Float.isNaN(d6) && n2 >= 0.0f && d4 >= 0.0f) {
if (i3 == 97) {
e2 += f4;
d6 += f6;
}
wVar.d(n2, d4, d5, c2.booleanValue(), c3.booleanValue(), e2, d6);
f4 = e2;
f5 = f4;
f6 = d6;
f7 = f6;
break;
}
break;
case 67:
case 99:
float n3 = iVar.n();
float d7 = iVar.d(n3);
float d8 = iVar.d(d7);
float d9 = iVar.d(d8);
d2 = iVar.d(d9);
d3 = iVar.d(d2);
if (Float.isNaN(d3)) {
Log.e(j, "Bad path coords for " + ((char) i3) + " path segment");
return wVar;
}
if (i3 == 99) {
d2 += f4;
d3 += f6;
n3 += f4;
d7 += f6;
d8 += f4;
d9 += f6;
}
f2 = d8;
f3 = d9;
wVar.c(n3, d7, f2, f3, d2, d3);
f5 = f2;
f4 = d2;
f7 = f3;
f6 = d3;
break;
case 72:
case 104:
float n4 = iVar.n();
if (Float.isNaN(n4)) {
Log.e(j, "Bad path coords for " + ((char) i3) + " path segment");
return wVar;
}
if (i3 == 104) {
n4 += f4;
}
f4 = n4;
wVar.e(f4, f6);
f5 = f4;
break;
case 76:
case 108:
float n5 = iVar.n();
float d10 = iVar.d(n5);
if (Float.isNaN(d10)) {
Log.e(j, "Bad path coords for " + ((char) i3) + " path segment");
return wVar;
}
if (i3 == 108) {
n5 += f4;
d10 += f6;
}
f4 = n5;
f6 = d10;
wVar.e(f4, f6);
f5 = f4;
f7 = f6;
break;
case 77:
case 109:
float n6 = iVar.n();
float d11 = iVar.d(n6);
if (Float.isNaN(d11)) {
Log.e(j, "Bad path coords for " + ((char) i3) + " path segment");
return wVar;
}
if (i3 == i2 && !wVar.i()) {
n6 += f4;
d11 += f6;
}
f4 = n6;
f6 = d11;
wVar.b(f4, f6);
f5 = f4;
f8 = f5;
f7 = f6;
f9 = f7;
i3 = i3 != i2 ? 76 : 108;
break;
case 81:
case 113:
f5 = iVar.n();
f7 = iVar.d(f5);
float d12 = iVar.d(f7);
float d13 = iVar.d(d12);
if (Float.isNaN(d13)) {
Log.e(j, "Bad path coords for " + ((char) i3) + " path segment");
return wVar;
}
if (i3 == 113) {
d12 += f4;
d13 += f6;
f5 += f4;
f7 += f6;
}
f4 = d12;
f6 = d13;
wVar.a(f5, f7, f4, f6);
break;
case 83:
case 115:
float f10 = (f4 * 2.0f) - f5;
float f11 = (2.0f * f6) - f7;
float n7 = iVar.n();
float d14 = iVar.d(n7);
d2 = iVar.d(d14);
d3 = iVar.d(d2);
if (Float.isNaN(d3)) {
Log.e(j, "Bad path coords for " + ((char) i3) + " path segment");
return wVar;
}
if (i3 == 115) {
d2 += f4;
d3 += f6;
n7 += f4;
d14 += f6;
}
f2 = n7;
f3 = d14;
wVar.c(f10, f11, f2, f3, d2, d3);
f5 = f2;
f4 = d2;
f7 = f3;
f6 = d3;
break;
case 84:
case 116:
f5 = (f4 * 2.0f) - f5;
f7 = (2.0f * f6) - f7;
float n8 = iVar.n();
float d15 = iVar.d(n8);
if (Float.isNaN(d15)) {
Log.e(j, "Bad path coords for " + ((char) i3) + " path segment");
return wVar;
}
if (i3 == 116) {
n8 += f4;
d15 += f6;
}
f4 = n8;
f6 = d15;
wVar.a(f5, f7, f4, f6);
break;
case 86:
case 118:
float n9 = iVar.n();
if (Float.isNaN(n9)) {
Log.e(j, "Bad path coords for " + ((char) i3) + " path segment");
return wVar;
}
if (i3 == 118) {
n9 += f6;
}
f6 = n9;
wVar.e(f4, f6);
f7 = f6;
break;
case 90:
case 122:
wVar.close();
f4 = f8;
f5 = f4;
f6 = f9;
f7 = f6;
break;
default:
return wVar;
}
iVar.z();
if (iVar.h()) {
return wVar;
}
if (iVar.i()) {
i3 = iVar.l().intValue();
}
i2 = 109;
}
}
private void w(Attributes attributes) throws SVGParseException {
l("<line>", new Object[0]);
if (this.b != null) {
i.q qVar = new i.q();
qVar.a = this.a;
qVar.b = this.b;
E(qVar, attributes);
T(qVar, attributes);
X(qVar, attributes);
D(qVar, attributes);
I(qVar, attributes);
this.b.j(qVar);
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
public static com.caverock.androidsvg.g w0(String str) throws SVGParseException {
i iVar = new i(str);
iVar.A();
String r2 = iVar.r();
if ("defer".equals(r2)) {
iVar.A();
r2 = iVar.r();
}
g.a a2 = b.a(r2);
g.b bVar = null;
iVar.A();
if (!iVar.h()) {
String r3 = iVar.r();
char c2 = 65535;
int hashCode = r3.hashCode();
if (hashCode != 3347527) {
if (hashCode == 109526418 && r3.equals("slice")) {
c2 = 1;
}
} else if (r3.equals("meet")) {
c2 = 0;
}
if (c2 == 0) {
bVar = g.b.meet;
} else if (c2 == 1) {
bVar = g.b.slice;
} else {
throw new SVGParseException("Invalid preserveAspectRatio definition: " + str);
}
}
return new com.caverock.androidsvg.g(a2, bVar);
}
private void x(Attributes attributes) throws SVGParseException {
l("<linearGradient>", new Object[0]);
if (this.b != null) {
i.m0 m0Var = new i.m0();
m0Var.a = this.a;
m0Var.b = this.b;
E(m0Var, attributes);
T(m0Var, attributes);
G(m0Var, attributes);
J(m0Var, attributes);
this.b.j(m0Var);
this.b = m0Var;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static void x0(i.p0 p0Var, String str) throws SVGParseException {
p0Var.o = w0(str);
}
private void y(Attributes attributes) throws SVGParseException {
l("<marker>", new Object[0]);
if (this.b != null) {
i.r rVar = new i.r();
rVar.a = this.a;
rVar.b = this.b;
E(rVar, attributes);
T(rVar, attributes);
D(rVar, attributes);
Z(rVar, attributes);
K(rVar, attributes);
this.b.j(rVar);
this.b = rVar;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
public Map<String, String> y0(i iVar) {
HashMap hashMap = new HashMap();
iVar.A();
String s2 = iVar.s('=');
while (s2 != null) {
iVar.f('=');
hashMap.put(s2, iVar.q());
iVar.A();
s2 = iVar.s('=');
}
return hashMap;
}
private void z(Attributes attributes) throws SVGParseException {
l("<mask>", new Object[0]);
if (this.b != null) {
i.s sVar = new i.s();
sVar.a = this.a;
sVar.b = this.b;
E(sVar, attributes);
T(sVar, attributes);
D(sVar, attributes);
L(sVar, attributes);
this.b.j(sVar);
this.b = sVar;
return;
}
throw new SVGParseException("Invalid document. Root element must be <svg>");
}
private static i.e0.e z0(String str) {
char c2;
int hashCode = str.hashCode();
if (hashCode == -933002398) {
if (str.equals("optimizeQuality")) {
c2 = 1;
}
c2 = 65535;
} else if (hashCode != 3005871) {
if (hashCode == 362741610 && str.equals("optimizeSpeed")) {
c2 = 2;
}
c2 = 65535;
} else {
if (str.equals("auto")) {
c2 = 0;
}
c2 = 65535;
}
if (c2 != 0) {
if (c2 != 1) {
if (c2 != 2) {
return null;
}
return i.e0.e.optimizeSpeed;
}
return i.e0.e.optimizeQuality;
}
return i.e0.e.auto;
}
public com.caverock.androidsvg.i A(InputStream inputStream, boolean z) throws SVGParseException {
if (!inputStream.markSupported()) {
inputStream = new BufferedInputStream(inputStream);
}
try {
inputStream.mark(3);
int read = inputStream.read() + (inputStream.read() << 8);
inputStream.reset();
if (read == 35615) {
inputStream = new BufferedInputStream(new GZIPInputStream(inputStream));
}
} catch (IOException unused) {
}
try {
inputStream.mark(4096);
M0(inputStream, z);
return this.a;
} finally {
try {
inputStream.close();
} catch (IOException unused2) {
Log.e(j, "Exception thrown closing input stream");
}
}
}
}