导航菜单

页面标题

页面副标题

Namma Yatri v3.3.7 - MobilityCommonBridge.java 源代码

正在查看: Namma Yatri v3.3.7 应用的 MobilityCommonBridge.java JAVA 源代码文件

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


package in.juspay.mobility.common;

import F7.c;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.DatePickerDialog;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentSender;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.icu.util.Calendar;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationManager;
import android.media.AudioAttributes;
import android.media.MediaPlayer;
import android.media.RingtoneManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.Vibrator;
import android.provider.ContactsContract;
import android.provider.MediaStore;
import android.provider.Settings;
import android.speech.SpeechRecognizer;
import android.util.Base64;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.LinearInterpolator;
import android.view.inputmethod.InputMethodManager;
import android.webkit.ConsoleMessage;
import android.webkit.JavascriptInterface;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.NumberPicker;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import androidx.core.app.m;
import androidx.core.content.FileProvider;
import com.airbnb.lottie.LottieAnimationView;
import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationSettingsRequest;
import com.google.android.gms.maps.model.ButtCap;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.Dash;
import com.google.android.gms.maps.model.Dot;
import com.google.android.gms.maps.model.Gap;
import com.google.android.gms.maps.model.GroundOverlayOptions;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.MapStyleOptions;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.PatternItem;
import com.google.android.gms.maps.model.PolylineOptions;
import com.google.android.gms.tasks.CancellationTokenSource;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.reactnativecommunity.clipboard.ClipboardModule;
import com.swmansion.reanimated.layoutReanimation.Snapshot;
import in.juspay.hyper.bridge.HyperBridge;
import in.juspay.hyper.constants.LogCategory;
import in.juspay.hyper.constants.LogSubCategory;
import in.juspay.hyper.core.BridgeComponents;
import in.juspay.hyper.core.ExecutorManager;
import in.juspay.hyper.core.JsCallback;
import in.juspay.hyper.core.JuspayLogger;
import in.juspay.hypersdk.data.KeyValueStore;
import in.juspay.mobility.common.GeoCoderHelper;
import in.juspay.mobility.common.MobilityCommonBridge;
import in.juspay.mobility.common.ShakeDetector;
import in.juspay.mobility.common.cropImage.CropImage;
import in.juspay.mobility.common.services.MobilityCallAPI;
import in.juspay.mobility.common.utils.CipherUtil;
import in.juspay.mobility.common.utils.Utils;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Queue;
import java.util.TimeZone;
import java.util.Timer;
import java.util.TimerTask;
import java.util.UUID;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import s.d;
import ta.AbstractC1187b;
import ta.AbstractC1190e;
import va.AbstractC1267b;
import va.AbstractC1269d;
import wa.C1289b;
import wa.C1291d;

public class MobilityCommonBridge extends HyperBridge {
    public static final int BACKGROUND_LOCATION_REQ_CODE = 190;
    protected static final String CURRENT_LOCATION = "ny_ic_customer_current_location";
    private static final String CURRENT_LOCATION_LATLON = "Current Location";
    private static final int DATEPICKER_SPINNER_COUNT = 3;
    private static final String HOTSPOTS = "hotspots";
    private static final int IMAGE_CAPTURE_REQ_CODE = 101;
    private static final int IMAGE_PERMISSION_REQ_CODE = 4997;
    private static final String LOCATE_ON_MAP = "LocateOnMap";
    protected static final String LOCATION_IS_FAR = "LocationIsFar";
    public static final int LOCATION_PERMISSION_REQ_CODE = 1;
    protected static final int LOCATION_RESOLUTION_REQUEST_CODE = 21345;
    private static final int PICK_CONTACT_PERMISSION_REQUEST_CODE = 1993;
    private static final int PICK_CONTACT_REQUEST_CODE = 191;
    public static final int REQUEST_CALL = 8;
    private static final int REQUEST_CODE_NOTIFICATION_PERMISSION = 10;
    public static final int REQUEST_CONTACTS = 7;
    public static final int REQUEST_MICROPHONE = 9;
    protected static final int STORAGE_PERMISSION = 67;
    protected static Boolean editLocation = Boolean.FALSE;
    private static String storeContactsCallBack = null;
    protected String CALLBACK;
    protected String DTUTILS;
    protected String LOCATION;
    protected String LOG_TAG;
    protected String MAPS;
    protected String NOTIFICATION;
    protected String OTHERS;
    protected String OVERRIDE;
    protected String UTILS;
    private Sensor accelerometer;
    protected int animationDuration;
    private LottieAnimationView animationView;
    protected AppType app;
    private android.media.MediaPlayer audioPlayer;
    protected BridgeComponents bridgeComponents;
    private final UICallBacks callBack;
    private final Queue<String> callbackQueue;
    CancellationTokenSource cancellationTokenSource;
    protected HashMap<String, CircleRippleEffect> circleRipples;
    private final com.google.android.gms.location.e client;
    private Integer debounceAnimateCameraCounter;
    protected String downloadLayout;
    protected float editPickupThreshold;
    private HashMap<String, String> filesCache;
    protected F7.c googleMap;
    protected HashMap<String, F7.c> googleMapInstance;
    protected HashMap<String, H7.e> groundOverlays;
    protected String invoice;
    protected boolean isAnimationNeeded;
    protected String labelId;
    protected int labelTextSize;
    private int lastFocusedEditText;
    private int lastFocusedEditView;
    protected Location lastKnownLocation;
    protected double lastLatitudeValue;
    protected double lastLongitudeValue;
    protected C1291d layer;
    protected JSONObject locateOnMapConfig;
    protected LocateOnMapManager locateOnMapManager;
    private MapRemoteConfig mapRemoteConfig;
    protected MapUpdate mapUpdate;
    protected HashMap<String, H7.h> markers;
    protected HashMap<String, HashMap<String, H7.h>> markersElement;
    private MediaPlayer mediaPlayer;
    protected Method[] methods;
    private ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener;
    private PaymentPage paymentPage;
    protected String phoneNumber;
    private final Hashtable<String, Hashtable<String, PolyLineAnimationTimers>> polylineAnimationTimers;
    protected Hashtable<String, Hashtable<String, PolylineDataPoints>> polylinesByMapInstance;
    protected Receivers receivers;
    private SensorManager sensorManager;
    private ShakeDetector shakeDetector;
    private final SharedPreferences sharedPref;
    private final SharedPreferences.OnSharedPreferenceChangeListener sharedPreferenceChangeListener;
    private SpeechRecognition speechRecognition;
    private SpeechRecognizer speechRecognizer;
    protected String storeCircleOnClickCallback;
    protected String storeDashboardCallBack;
    protected String storeEditLocationCallBack;
    protected String storeHotspotMapCallback;
    private String storeImageUploadCallBack;
    protected String storeLocateOnMapCallBack;
    private String storePickContactCallBack;
    private String storeUploadMultiPartCallBack;
    protected H7.h userPositionMarker;
    protected HashMap<String, H7.h> zoneMarkers;
    protected String zoneName;
    protected float zoom;

    static class AnonymousClass12 {
        static final int[] $SwitchMap$in$juspay$mobility$common$MobilityCommonBridge$AnimationType;

        static {
            int[] iArr = new int[AnimationType.values().length];
            $SwitchMap$in$juspay$mobility$common$MobilityCommonBridge$AnimationType = iArr;
            try {
                iArr[AnimationType.FADE_IN.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                $SwitchMap$in$juspay$mobility$common$MobilityCommonBridge$AnimationType[AnimationType.FADE_OUT.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                $SwitchMap$in$juspay$mobility$common$MobilityCommonBridge$AnimationType[AnimationType.NONE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
        }
    }

    class AnonymousClass2 implements Runnable {
        final double goToNearestPointWithinRadius;
        final MapMode mapMode;
        final JSONObject val$circleConfigJSON;
        final String val$circleId;
        final String val$geoJson;
        final boolean val$goToCurrentLocation;
        final JSONObject val$hotSpotConfig;
        final String val$labelActionImage;
        final String val$labelImage;
        final ImageView val$labelView;
        final String val$lat;
        final String val$locationName;
        final String val$lon;
        final String val$markerCallback;
        final JSONArray val$markerCallbackForTags;
        final LatLng val$markerLatlng;
        final boolean val$navigateToNearestGate;
        final JSONObject val$payload;
        final String val$points;
        final List val$polygonCoordinates;
        final String val$selectedSpotIcon;
        final boolean val$showZoneLabel;
        final JSONObject val$specialZoneMarkerConfig;
        final String val$spotIcon;
        final String val$theme;
        final float val$zoomLevel;

        AnonymousClass2(String str, String str2, JSONObject jSONObject, boolean z, String str3, String str4, JSONArray jSONArray, JSONObject jSONObject2, LatLng latLng, JSONObject jSONObject3, String str5, JSONObject jSONObject4, String str6, List list, boolean z2, String str7, String str8, String str9, String str10, String str11, float f, boolean z3, ImageView imageView, String str12) {
            this.val$points = str;
            this.val$geoJson = str2;
            this.val$hotSpotConfig = jSONObject;
            this.val$showZoneLabel = z;
            this.val$locationName = str3;
            this.val$markerCallback = str4;
            this.val$markerCallbackForTags = jSONArray;
            this.val$payload = jSONObject2;
            this.val$markerLatlng = latLng;
            this.val$circleConfigJSON = jSONObject3;
            this.val$circleId = str5;
            this.val$specialZoneMarkerConfig = jSONObject4;
            this.val$spotIcon = str6;
            this.val$polygonCoordinates = list;
            this.val$goToCurrentLocation = z2;
            this.val$labelActionImage = str7;
            this.val$labelImage = str8;
            this.val$selectedSpotIcon = str9;
            this.val$lat = str10;
            this.val$lon = str11;
            this.val$zoomLevel = f;
            this.val$navigateToNearestGate = z3;
            this.val$labelView = imageView;
            this.val$theme = str12;
            this.mapMode = str.equals("") ? MapMode.NORMAL : str2.equals("") ? MapMode.HOTSPOT : MapMode.SPECIAL_ZONE;
            this.goToNearestPointWithinRadius = jSONObject != null ? jSONObject.optDouble("goToNearestPointWithinRadius", 50.0d) : 50.0d;
        }

        public void lambda$run$0(String str, List list, boolean z, JSONObject jSONObject, boolean z2, String str2, String str3, String str4, String str5, String str6, float f) {
            try {
                JSONArray jSONArray = new JSONArray(str);
                MobilityCommonBridge mobilityCommonBridge = MobilityCommonBridge.this;
                JSONObject nearestPoint = mobilityCommonBridge.getNearestPoint(mobilityCommonBridge.googleMap.j().a.a, MobilityCommonBridge.this.googleMap.j().a.b, jSONArray);
                if (this.mapMode.equals(MapMode.SPECIAL_ZONE)) {
                    MobilityCommonBridge.this.animateToFitPolygon(list, z, nearestPoint.getDouble("lat"), nearestPoint.getDouble("long"), jSONObject.optJSONObject("locateOnMapPadding"));
                    if (z2 && MobilityCommonBridge.this.locateOnMapManager != null) {
                        String optString = nearestPoint.optString("place", "");
                        MobilityCommonBridge mobilityCommonBridge2 = MobilityCommonBridge.this;
                        if (mobilityCommonBridge2.locateOnMapManager.getGateFeature(mobilityCommonBridge2.layer, optString) != null) {
                            MarkerConfig markerConfig = new MarkerConfig();
                            MobilityCommonBridge mobilityCommonBridge3 = MobilityCommonBridge.this;
                            markerConfig.locationName(mobilityCommonBridge3.zoneName, mobilityCommonBridge3.locateOnMapManager.locationName);
                            markerConfig.setLabelActionImage(str2);
                            markerConfig.setLabelImage(str3);
                            MobilityCommonBridge.this.addZoneMarker(nearestPoint.getDouble("lat"), nearestPoint.getDouble("long"), "selectedZoneGate", str4, markerConfig);
                            MobilityCommonBridge.this.changePolygonFocus(optString);
                        }
                    }
                } else if (this.mapMode.equals(MapMode.HOTSPOT) && AbstractC1190e.b(MobilityCommonBridge.this.googleMap.j().a, new LatLng(nearestPoint.getDouble("lat"), nearestPoint.getDouble("long"))) < this.goToNearestPointWithinRadius) {
                    MobilityCommonBridge.this.animateCamera(nearestPoint.getDouble("lat"), nearestPoint.getDouble("long"), 20.0f, ZoomType.NO_ZOOM);
                } else if (!str5.equals("0.0") && !str6.equals("0.0") && !MobilityCommonBridge.editLocation.booleanValue()) {
                    MobilityCommonBridge.this.animateCamera(Double.parseDouble(str5), Double.parseDouble(str6), f, ZoomType.ZOOM);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        public void lambda$run$1(java.lang.String r36, java.util.List r37, boolean r38, java.lang.String r39, android.widget.ImageView r40, java.lang.String r41, java.lang.String r42, org.json.JSONObject r43, java.lang.String r44, java.lang.String r45, java.lang.String r46, com.google.android.gms.maps.model.LatLng r47, org.json.JSONObject r48) {
            throw new UnsupportedOperationException("Method not decompiled: in.juspay.mobility.common.MobilityCommonBridge.AnonymousClass2.lambda$run$1(java.lang.String, java.util.List, boolean, java.lang.String, android.widget.ImageView, java.lang.String, java.lang.String, org.json.JSONObject, java.lang.String, java.lang.String, java.lang.String, com.google.android.gms.maps.model.LatLng, org.json.JSONObject):void");
        }

        @Override
        public void run() {
            try {
                MobilityCommonBridge.this.locateOnMapManager = new LocateOnMapManager();
                MobilityCommonBridge.this.locateOnMapManager.setShowZoneLabel(this.val$showZoneLabel);
                MobilityCommonBridge.this.locateOnMapManager.setLocationName(this.val$locationName);
                MobilityCommonBridge.this.locateOnMapManager.setMarkerCallback(this.val$markerCallback, this.val$markerCallbackForTags);
                MobilityCommonBridge.this.locateOnMapManager.setEnableMapClickListener(this.val$payload.optBoolean("enableMapClickListener", false));
                if (MobilityCommonBridge.this.googleMap != null && MobilityCommonBridge.editLocation.booleanValue()) {
                    MobilityCommonBridge.this.removeAllPolylines("");
                    double b = AbstractC1190e.b(MobilityCommonBridge.this.googleMap.j().a, this.val$markerLatlng);
                    MobilityCommonBridge mobilityCommonBridge = MobilityCommonBridge.this;
                    MobilityCommonBridge.this.updateRippleCircleWithId(this.val$circleId, mobilityCommonBridge.setCircleConfigFromJSON(this.val$circleConfigJSON, b <= ((double) mobilityCommonBridge.editPickupThreshold)), this.val$markerLatlng);
                }
                HashMap<String, H7.h> hashMap = MobilityCommonBridge.this.zoneMarkers;
                if (hashMap != null) {
                    Iterator<Map.Entry<String, H7.h>> it = hashMap.entrySet().iterator();
                    while (it.hasNext()) {
                        it.next().getValue().r(false);
                    }
                }
                C1291d c1291d = MobilityCommonBridge.this.layer;
                if (c1291d != null) {
                    c1291d.e();
                }
                MobilityCommonBridge.this.removeMarker(MobilityCommonBridge.CURRENT_LOCATION);
                JSONArray jSONArray = new JSONArray(this.val$points);
                MobilityCommonBridge.this.drawPolygon(this.val$geoJson, jSONArray, this.val$specialZoneMarkerConfig);
                for (int i = 0; i < jSONArray.length(); i++) {
                    Double d = (Double) jSONArray.getJSONObject(i).get("lat");
                    Double d2 = (Double) jSONArray.getJSONObject(i).get("lng");
                    MobilityCommonBridge.this.addZoneMarker(d.doubleValue(), d2.doubleValue(), d + ":" + d2, this.val$spotIcon);
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
            MobilityCommonBridge.this.googleMap.B(new c.e() {
                public void onCameraMoveStarted(int i2) {
                    H7.h hVar = MobilityCommonBridge.this.zoneMarkers.get("selectedGate");
                    if (hVar != null) {
                        hVar.r(false);
                    }
                }
            });
            F7.c cVar = MobilityCommonBridge.this.googleMap;
            final String str = this.val$points;
            final List list = this.val$polygonCoordinates;
            final boolean z = this.val$goToCurrentLocation;
            final JSONObject jSONObject = this.val$payload;
            final boolean z2 = this.val$showZoneLabel;
            final String str2 = this.val$labelActionImage;
            final String str3 = this.val$labelImage;
            final String str4 = this.val$selectedSpotIcon;
            final String str5 = this.val$lat;
            final String str6 = this.val$lon;
            final float f = this.val$zoomLevel;
            cVar.I(new c.l() {
                public final void a() {
                    MobilityCommonBridge.AnonymousClass2.this.lambda$run$0(str, list, z, jSONObject, z2, str2, str3, str4, str5, str6, f);
                }
            });
            F7.c cVar2 = MobilityCommonBridge.this.googleMap;
            final String str7 = this.val$points;
            final List list2 = this.val$polygonCoordinates;
            final boolean z3 = this.val$navigateToNearestGate;
            final String str8 = this.val$selectedSpotIcon;
            final ImageView imageView = this.val$labelView;
            final String str9 = this.val$locationName;
            final String str10 = this.val$labelImage;
            final JSONObject jSONObject2 = this.val$specialZoneMarkerConfig;
            final String str11 = this.val$theme;
            final String str12 = this.val$lat;
            final String str13 = this.val$lon;
            final LatLng latLng = this.val$markerLatlng;
            final JSONObject jSONObject3 = this.val$circleConfigJSON;
            cVar2.z(new c.c() {
                public final void a() {
                    MobilityCommonBridge.AnonymousClass2.this.lambda$run$1(str7, list2, z3, str8, imageView, str9, str10, jSONObject2, str11, str12, str13, latLng, jSONObject3);
                }
            });
        }
    }

    class AnonymousClass6 extends TimerTask {
        private float drawDone = 0.0f;
        final int val$animateColor;
        final String val$gmapKey;
        final String val$polyLineKey;
        final int val$staticColor;

        AnonymousClass6(String str, String str2, int i, int i2) {
            this.val$gmapKey = str;
            this.val$polyLineKey = str2;
            this.val$animateColor = i;
            this.val$staticColor = i2;
        }

        public void lambda$run$0(String str, String str2, int i, int i2) {
            try {
                PolylineDataPoints polyLineDataByMapInstance = MobilityCommonBridge.this.getPolyLineDataByMapInstance(str, str2);
                H7.j polyLine = MobilityCommonBridge.this.getPolyLine(Boolean.FALSE, polyLineDataByMapInstance);
                H7.j polyLine2 = MobilityCommonBridge.this.getPolyLine(Boolean.TRUE, polyLineDataByMapInstance);
                if (polyLine != null) {
                    List b = polyLine.b();
                    Collections.reverse(b);
                    b.subList(0, (int) (b.size() * (this.drawDone / 100.0f))).clear();
                    if (polyLine.a() != i) {
                        polyLine.e(i);
                    }
                    if (polyLine2 != null) {
                        if (polyLine2.a() != i2) {
                            polyLine2.e(i2);
                        }
                        polyLine2.i(b);
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        public void lambda$run$1(String str, String str2, int i, int i2) {
            try {
                PolylineDataPoints polyLineDataByMapInstance = MobilityCommonBridge.this.getPolyLineDataByMapInstance(str, str2);
                H7.j polyLine = MobilityCommonBridge.this.getPolyLine(Boolean.FALSE, polyLineDataByMapInstance);
                float f = (float) ((this.drawDone - 100.0d) / 100.0d);
                float[] fArr = new float[3];
                float[] fArr2 = new float[3];
                Color.colorToHSV(i, fArr);
                Color.colorToHSV(i2, fArr2);
                float f2 = fArr[0];
                float f3 = f2 + ((fArr2[0] - f2) * f);
                float f4 = fArr[1];
                float f5 = f4 + ((fArr2[1] - f4) * f);
                float f6 = fArr[2];
                int HSVToColor = Color.HSVToColor(new float[]{f3, f5, f6 + ((fArr2[2] - f6) * f)});
                if (polyLine != null && polyLine.a() != HSVToColor) {
                    polyLine.e(HSVToColor);
                }
                polyLineDataByMapInstance.setPolyline(polyLine);
                MobilityCommonBridge.this.setPolyLineDataByMapInstance(str, str2, polyLineDataByMapInstance);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        @Override
        public void run() {
            float f = this.drawDone;
            if (f <= 28.0f) {
                this.drawDone = f + 2.0f;
            } else if (f <= 66.0f) {
                this.drawDone = f + 4.0f;
            } else if (f <= 98.0f) {
                this.drawDone = f + 2.0f;
            } else if (f <= 200.0f) {
                this.drawDone = f + 2.0f;
            } else {
                this.drawDone = 0.0f;
            }
            float f2 = this.drawDone;
            if (f2 >= 0.0f && f2 <= 100.0f) {
                final String str = this.val$gmapKey;
                final String str2 = this.val$polyLineKey;
                final int i = this.val$animateColor;
                final int i2 = this.val$staticColor;
                ExecutorManager.runOnMainThread(new Runnable() {
                    @Override
                    public final void run() {
                        MobilityCommonBridge.AnonymousClass6.this.lambda$run$0(str, str2, i, i2);
                    }
                });
                return;
            }
            if (f2 <= 100.0f || f2 > 200.0f) {
                return;
            }
            final String str3 = this.val$gmapKey;
            final String str4 = this.val$polyLineKey;
            final int i3 = this.val$animateColor;
            final int i4 = this.val$staticColor;
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.AnonymousClass6.this.lambda$run$1(str3, str4, i3, i4);
                }
            });
        }
    }

    class AnonymousClass8 implements Runnable {
        final String val$callback;
        final String val$defaultDate;
        final String val$label;
        final String val$maxDate;

        AnonymousClass8(String str, String str2, String str3, String str4) {
            this.val$label = str;
            this.val$callback = str2;
            this.val$maxDate = str3;
            this.val$defaultDate = str4;
        }

        public void lambda$run$0(String str, DatePicker datePicker, int i, int i2, int i3) {
            if (str != null) {
                MobilityCommonBridge.this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s',%d,%d,%d);", str, "SELECTED", Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3)));
            }
        }

        public void lambda$run$1(String str, DialogInterface dialogInterface) {
            if (str != null) {
                MobilityCommonBridge.this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s', '%s',%d,%d,%d);", str, "CANCELLED", 0, 0, 0));
            }
        }

        public void lambda$run$2(String str, DialogInterface dialogInterface) {
            if (str != null) {
                MobilityCommonBridge.this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s',%d,%d,%d);", str, "DISMISSED", 0, 0, 0));
            }
        }

        @Override
        public void run() {
            int i;
            int i2;
            int i3;
            DatePickerDialog datePickerDialog;
            Calendar calendar = Calendar.getInstance();
            String str = this.val$label;
            str.hashCode();
            if (str.equals("MINIMUM_NEXT_DATE")) {
                calendar.add(6, 1);
            }
            i = calendar.get(1);
            i2 = calendar.get(2);
            i3 = calendar.get(5);
            int i4 = Build.VERSION.SDK_INT <= 24 ? 0 : 3;
            Activity activity = MobilityCommonBridge.this.bridgeComponents.getActivity();
            final String str2 = this.val$callback;
            datePickerDialog = new DatePickerDialog(activity, i4, new DatePickerDialog.OnDateSetListener() {
                @Override
                public final void onDateSet(DatePicker datePicker, int i5, int i6, int i7) {
                    MobilityCommonBridge.AnonymousClass8.this.lambda$run$0(str2, datePicker, i5, i6, i7);
                }
            }, i, i2, i3) {
                final int month = getContext().getResources().getIdentifier("month", "id", LogSubCategory.LifeCycle.ANDROID);
                final String[] monthNumbers = {"Jan (01)", "Feb (02)", "Mar (03)", "April (04)", "May (05)", "June (06)", "July (07)", "Aug (08)", "Sept (09)", "Oct (10)", "Nov (11)", "Dec (12)"};

                @Override
                protected void onCreate(Bundle bundle) {
                    int i5;
                    super.onCreate(bundle);
                    String str3 = AnonymousClass8.this.val$label;
                    str3.hashCode();
                    if (str3.equals("MINIMUM_NEXT_DATE")) {
                        return;
                    }
                    try {
                        if (Build.VERSION.SDK_INT <= 24 || (i5 = this.month) == 0) {
                            return;
                        }
                        NumberPicker numberPicker = (NumberPicker) findViewById(i5);
                        if (numberPicker != null) {
                            numberPicker.setDisplayedValues(this.monthNumbers);
                        }
                        String str4 = AnonymousClass8.this.val$maxDate;
                        if (str4 == null || str4.isEmpty() || AnonymousClass8.this.val$maxDate.equals("-1")) {
                            return;
                        }
                        getDatePicker().setMaxDate(Long.parseLong(AnonymousClass8.this.val$maxDate));
                    } catch (Exception e) {
                        Log.e(MobilityCommonBridge.this.DTUTILS, "Error in Date onCreate : " + e);
                    }
                }

                @Override
                public void onDateChanged(DatePicker datePicker, int i5, int i6, int i7) {
                    int i8;
                    super.onDateChanged(datePicker, i5, i6, i7);
                    String str3 = AnonymousClass8.this.val$label;
                    str3.hashCode();
                    if (str3.equals("MINIMUM_NEXT_DATE")) {
                        return;
                    }
                    try {
                        if (Build.VERSION.SDK_INT <= 24 || (i8 = this.month) == 0) {
                            return;
                        }
                        NumberPicker numberPicker = (NumberPicker) findViewById(i8);
                        if (numberPicker != null) {
                            numberPicker.setDisplayedValues(this.monthNumbers);
                        }
                        String str4 = AnonymousClass8.this.val$maxDate;
                        if (str4 == null || str4.isEmpty() || AnonymousClass8.this.val$maxDate.equals("-1")) {
                            return;
                        }
                        getDatePicker().setMaxDate(Long.parseLong(AnonymousClass8.this.val$maxDate));
                    } catch (Exception e) {
                        Log.e(MobilityCommonBridge.this.DTUTILS, "Error in onDateChanged : " + e);
                    }
                }
            };
            final String str3 = this.val$callback;
            datePickerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public final void onCancel(DialogInterface dialogInterface) {
                    MobilityCommonBridge.AnonymousClass8.this.lambda$run$1(str3, dialogInterface);
                }
            });
            final String str4 = this.val$callback;
            datePickerDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public final void onDismiss(DialogInterface dialogInterface) {
                    MobilityCommonBridge.AnonymousClass8.this.lambda$run$2(str4, dialogInterface);
                }
            });
            String str5 = this.val$label;
            str5.hashCode();
            switch (str5) {
                case "MINIMUM_NEXT_DATE":
                    Calendar calendar2 = Calendar.getInstance();
                    calendar2.set(11, 0);
                    calendar2.set(12, 0);
                    calendar2.set(13, 0);
                    calendar2.set(14, 0);
                    calendar2.add(6, 1);
                    datePickerDialog.getDatePicker().setMinDate(calendar2.getTimeInMillis());
                    break;
                case "MINIMUM_EIGHTEEN_YEARS":
                    Calendar calendar3 = Calendar.getInstance();
                    calendar3.set(5, i3);
                    calendar3.set(2, i2);
                    calendar3.set(1, i - 18);
                    datePickerDialog.getDatePicker().setMaxDate(calendar3.getTimeInMillis());
                    break;
                case "MAXIMUM_PRESENT_DATE":
                    datePickerDialog.getDatePicker().setMaxDate(System.currentTimeMillis() - 1000);
                    break;
            }
            String str6 = this.val$maxDate;
            if (str6 != null && !str6.isEmpty() && !this.val$maxDate.equals("-1")) {
                datePickerDialog.getDatePicker().setMaxDate(Long.parseLong(this.val$maxDate));
            }
            String str7 = this.val$defaultDate;
            if (str7 != null && !str7.isEmpty() && !this.val$defaultDate.equals("-1")) {
                try {
                    long parseLong = Long.parseLong(this.val$defaultDate);
                    Calendar calendar4 = Calendar.getInstance();
                    calendar4.setTimeInMillis(parseLong);
                    datePickerDialog.updateDate(calendar4.get(1), calendar4.get(2), calendar4.get(5));
                } catch (NumberFormatException e) {
                    Log.e(MobilityCommonBridge.this.DTUTILS, "Invalid default date format: " + e);
                }
            }
            int i5 = Build.VERSION.SDK_INT;
            if (i5 > 24) {
                datePickerDialog.setTitle(MobilityCommonBridge.this.bridgeComponents.getContext().getString(R.string.select_date));
            } else {
                datePickerDialog.setTitle("");
            }
            datePickerDialog.show();
            char[] cArr = {'d', 'm', 'y'};
            if (i5 > 24) {
                try {
                    MobilityCommonBridge.this.reOrderSpinners(datePickerDialog, cArr);
                } catch (Exception e2) {
                    Log.e(MobilityCommonBridge.this.DTUTILS, "Error in reOrdering spinners : " + e2);
                }
            }
        }
    }

    public enum AnimationType {
        FADE_IN,
        FADE_OUT,
        NONE
    }

    protected enum AppType {
        CONSUMER,
        PROVIDER
    }

    private static class DatePickerLabels {
        private static final String MAXIMUM_PRESENT_DATE = "MAXIMUM_PRESENT_DATE";
        private static final String MAX_THIRTY_DAYS_FROM_CURRENT_DATE = "MAX_THIRTY_DAYS_FROM_CURRENT_DATE";
        private static final String MINIMUM_EIGHTEEN_YEARS = "MINIMUM_EIGHTEEN_YEARS";
        private static final String MINIMUM_NEXT_DATE = "MINIMUM_NEXT_DATE";
        private static final String MINIMUM_PRESENT_DATE = "MINIMUM_PRESENT_DATE";
        private static final String MIN_EIGHTEEN_MAX_SIXTY_YEARS = "MIN_EIGHTEEN_MAX_SIXTY_YEARS";

        private DatePickerLabels() {
        }
    }

    public static class LocateOnMapManager {
        C1289b focusedGeoJsonFeature = null;
        HashMap<String, C1289b> gatesSpecialZone = new HashMap<>();
        boolean showZoneLabel = false;
        String locationName = null;
        String markerCallback = "";
        boolean enableMapClickListener = false;
        ArrayList<String> markerCallbackTags = new ArrayList<>();

        public C1289b getGateFeature(C1291d c1291d, String str) {
            if (!this.gatesSpecialZone.isEmpty()) {
                return this.gatesSpecialZone.get(str);
            }
            if (c1291d == null) {
                return null;
            }
            for (C1289b c1289b : c1291d.d()) {
                if (!c1289b.d("name").equals("")) {
                    this.gatesSpecialZone.put(c1289b.d("name"), c1289b);
                }
            }
            return this.gatesSpecialZone.get(str);
        }

        public void setEnableMapClickListener(boolean z) {
            this.enableMapClickListener = z;
        }

        public void setFocusedGeoJsonFeature(C1289b c1289b) {
            this.focusedGeoJsonFeature = c1289b;
        }

        public void setLocationName(String str) {
            this.locationName = str;
        }

        public void setMarkerCallback(String str, JSONArray jSONArray) {
            try {
                this.markerCallback = str;
                this.markerCallbackTags = new ArrayList<>();
                for (int i = 0; i < jSONArray.length(); i++) {
                    this.markerCallbackTags.add((String) jSONArray.get(i));
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        public void setShowZoneLabel(boolean z) {
            this.showZoneLabel = z;
        }
    }

    public enum MapMode {
        NORMAL,
        SPECIAL_ZONE,
        HOTSPOT
    }

    public static class MarkerActionImageConfig {
        String background;
        int height;
        String image;
        MarkerEdgeInsets layoutMargin;
        MarkerEdgeInsets layoutPadding;
        String orientation;
        MarkerEdgeInsets padding;
        int width;

        MarkerActionImageConfig(String str, int i, int i2, String str2, String str3, JSONObject jSONObject, JSONObject jSONObject2, JSONObject jSONObject3) {
            this.image = str;
            this.height = i;
            this.width = i2;
            this.orientation = str2;
            this.background = str3;
            this.layoutMargin = MobilityCommonBridge.getMarkerEdgeInsets(jSONObject);
            this.layoutPadding = MobilityCommonBridge.getMarkerEdgeInsets(jSONObject2);
            this.padding = MobilityCommonBridge.getMarkerEdgeInsets(jSONObject3);
        }
    }

    public static class MarkerEdgeInsets {
        int bottom;
        int left;
        int right;
        int top;

        MarkerEdgeInsets(int i, int i2, int i3, int i4) {
            this.left = i;
            this.right = i3;
            this.top = i2;
            this.bottom = i4;
        }
    }

    public static class MarkerImageConfig {
        int height;
        String image;
        int width;

        MarkerImageConfig(String str, int i, int i2) {
            this.image = str;
            this.height = i;
            this.width = i2;
        }
    }

    public enum MarkerType {
        SPECIAL_ZONE_MARKER,
        NORMAL_MARKER,
        NORMAL_MARKER_V2,
        STOP_ICON_MARKER
    }

    protected class PolyLineAnimationTimers {
        Timer polyLineAnimationTimer = null;
        TimerTask polyAnimationTimerTask = null;

        protected PolyLineAnimationTimers() {
        }

        public void intializePolyLineAnimationTimers(Timer timer, TimerTask timerTask) {
            this.polyLineAnimationTimer = timer;
            this.polyAnimationTimerTask = timerTask;
        }
    }

    protected class PolylineDataPoints {
        public H7.j polyline = null;
        public H7.j overlayPolylines = null;

        protected PolylineDataPoints() {
        }

        public void setOverlayPolylines(H7.j jVar) {
            this.overlayPolylines = jVar;
        }

        public void setPolyline(H7.j jVar) {
            this.polyline = jVar;
        }
    }

    protected static class Receivers {
        BridgeComponents bridgeComponents;
        BroadcastReceiver gpsReceiver;
        BroadcastReceiver internetActionReceiver;
        String storeInternetActionCallBack = null;
        String storeLocationCallBack = null;
        BroadcastReceiver timeChangeCallback;

        public Receivers(BridgeComponents bridgeComponents) {
            this.bridgeComponents = bridgeComponents;
        }

        public boolean isNetworkAvailable(Context context) {
            ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            NetworkInfo activeNetworkInfo = connectivityManager != null ? connectivityManager.getActiveNetworkInfo() : null;
            return activeNetworkInfo != null && activeNetworkInfo.isConnected();
        }

        public void callInternetActionCallBack(JsCallback jsCallback, String str) {
            String str2 = this.storeInternetActionCallBack;
            if (str2 != null) {
                jsCallback.addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str2, str));
            }
        }

        public void callLocationCallBack(JsCallback jsCallback, String str) {
            String str2 = this.storeLocationCallBack;
            if (str2 != null) {
                jsCallback.addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str2, str));
            }
        }

        public void deRegister() {
            try {
                Context applicationContext = this.bridgeComponents.getContext().getApplicationContext();
                applicationContext.unregisterReceiver(this.gpsReceiver);
                applicationContext.unregisterReceiver(this.internetActionReceiver);
                applicationContext.unregisterReceiver(this.timeChangeCallback);
            } catch (Exception unused) {
            }
        }

        public void initReceiver() {
            this.gpsReceiver = new BroadcastReceiver() {
                @Override
                public void onReceive(Context context, Intent intent) {
                    if (((LocationManager) context.getSystemService("location")).isProviderEnabled("gps")) {
                        Receivers receivers = Receivers.this;
                        receivers.callLocationCallBack(receivers.bridgeComponents.getJsCallback(), "true");
                    } else {
                        Receivers receivers2 = Receivers.this;
                        receivers2.invokeOnEvent(receivers2.bridgeComponents.getJsCallback(), "onLocationChanged");
                    }
                }
            };
            this.internetActionReceiver = new BroadcastReceiver() {
                @Override
                public void onReceive(Context context, Intent intent) {
                    Receivers receivers = Receivers.this;
                    if (receivers.isNetworkAvailable(receivers.bridgeComponents.getContext())) {
                        Receivers receivers2 = Receivers.this;
                        receivers2.callInternetActionCallBack(receivers2.bridgeComponents.getJsCallback(), "true");
                    } else {
                        Receivers receivers3 = Receivers.this;
                        receivers3.invokeOnEvent(receivers3.bridgeComponents.getJsCallback(), "onInternetChanged");
                    }
                }
            };
            this.timeChangeCallback = new BroadcastReceiver() {
                @Override
                public void onReceive(Context context, Intent intent) {
                    Receivers receivers = Receivers.this;
                    receivers.invokeOnEvent(receivers.bridgeComponents.getJsCallback(), "onTimeChanged");
                }
            };
            if (Build.VERSION.SDK_INT >= 33) {
                com.facebook.react.devsupport.i.a(this.bridgeComponents.getContext(), this.timeChangeCallback, new IntentFilter("android.intent.action.TIME_SET"), 2);
                com.facebook.react.devsupport.i.a(this.bridgeComponents.getContext(), this.gpsReceiver, new IntentFilter("android.location.PROVIDERS_CHANGED"), 2);
                com.facebook.react.devsupport.i.a(this.bridgeComponents.getContext(), this.internetActionReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"), 2);
            } else {
                this.bridgeComponents.getContext().registerReceiver(this.timeChangeCallback, new IntentFilter("android.intent.action.TIME_SET"));
                this.bridgeComponents.getContext().registerReceiver(this.gpsReceiver, new IntentFilter("android.location.PROVIDERS_CHANGED"));
                this.bridgeComponents.getContext().registerReceiver(this.internetActionReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
            }
        }

        protected void invokeOnEvent(JsCallback jsCallback, String str) {
            if (jsCallback != null) {
                jsCallback.addJsToWebView(String.format("window[\"onEvent'\"]('%s',atob('%s'))", str, Base64.encodeToString("{}".getBytes(), 2)));
            }
        }
    }

    public enum Theme {
        DARK,
        LIGHT
    }

    public static class ZoomType {
        public static final String NO_ZOOM = "NO_ZOOM";
        public static final String ZOOM = "ZOOM";
    }

    public MobilityCommonBridge(final BridgeComponents bridgeComponents) {
        super(bridgeComponents);
        this.markers = new HashMap<>();
        this.zoneMarkers = new HashMap<>();
        this.zoneName = "";
        this.zoom = 17.0f;
        this.storeLocateOnMapCallBack = null;
        this.storeHotspotMapCallback = null;
        this.storeCircleOnClickCallback = null;
        this.storeEditLocationCallBack = null;
        this.storeDashboardCallBack = null;
        this.storeImageUploadCallBack = null;
        this.storeUploadMultiPartCallBack = null;
        this.storePickContactCallBack = null;
        this.polylinesByMapInstance = new Hashtable<>();
        this.markersElement = new HashMap<>();
        this.googleMapInstance = new HashMap<>();
        this.MAPS = "MAPS";
        this.LOCATION = "LOCATION";
        this.UTILS = "UTILS";
        this.OTHERS = "OTHERS";
        this.DTUTILS = "DTUTILS";
        this.OVERRIDE = "OVERRIDE";
        this.CALLBACK = "CALLBACK";
        this.NOTIFICATION = "NOTIFICATION";
        this.LOG_TAG = MobilityCommonBridge.class.getSimpleName();
        this.cancellationTokenSource = new CancellationTokenSource();
        this.callbackQueue = new LinkedList();
        this.filesCache = new HashMap<>();
        this.methods = null;
        this.isAnimationNeeded = false;
        this.animationDuration = 400;
        this.locateOnMapConfig = null;
        this.labelTextSize = 30;
        this.labelId = "";
        this.editPickupThreshold = 100.0f;
        this.circleRipples = new HashMap<>();
        this.groundOverlays = new HashMap<>();
        this.mediaPlayer = null;
        this.speechRecognition = null;
        this.mapUpdate = new MapUpdate();
        this.locateOnMapManager = null;
        this.polylineAnimationTimers = new Hashtable<>();
        this.bridgeComponents = bridgeComponents;
        SharedPreferences sharedPreferences = bridgeComponents.getContext().getApplicationContext().getSharedPreferences(bridgeComponents.getSdkName(), 0);
        this.sharedPref = sharedPreferences;
        SharedPreferences.OnSharedPreferenceChangeListener onSharedPreferenceChangeListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
            @Override
            public final void onSharedPreferenceChanged(SharedPreferences sharedPreferences2, String str) {
                MobilityCommonBridge.this.lambda$new$0(bridgeComponents, sharedPreferences2, str);
            }
        };
        this.sharedPreferenceChangeListener = onSharedPreferenceChangeListener;
        sharedPreferences.registerOnSharedPreferenceChangeListener(onSharedPreferenceChangeListener);
        com.google.android.gms.location.e a = com.google.android.gms.location.k.a(bridgeComponents.getContext());
        this.client = a;
        if (isLocationPermissionEnabled()) {
            a.getCurrentLocation(100, this.cancellationTokenSource.getToken()).addOnSuccessListener(new OnSuccessListener() {
                public final void onSuccess(Object obj) {
                    MobilityCommonBridge.this.lambda$new$1((Location) obj);
                }
            });
        }
        Receivers receivers = new Receivers(bridgeComponents);
        this.receivers = receivers;
        receivers.initReceiver();
        UICallBacks uICallBacks = new UICallBacks() {
            @Override
            public final void imageUploadCallBack(String str, String str2, String str3) {
                MobilityCommonBridge.this.callImageUploadCallBack(str, str2, str3);
            }
        };
        this.callBack = uICallBacks;
        Utils.registerCallback(uICallBacks);
        fetchAndUpdateLastKnownLocation();
    }

    private void animateMarkerNew(final String str, final LatLng latLng, final H7.h hVar, final String str2) {
        if (hVar != null) {
            final LatLng a = hVar.a();
            ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
            ofFloat.setDuration(2000L);
            ofFloat.setInterpolator(new LinearInterpolator());
            ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                    MobilityCommonBridge.this.lambda$animateMarkerNew$57(a, latLng, str2, hVar, str, valueAnimator);
                }
            });
            ofFloat.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animator) {
                    super.onAnimationEnd(animator);
                }
            });
            ofFloat.start();
        }
    }

    public void animateToFitPolygon(List<List<LatLng>> list, boolean z, double d, double d2, JSONObject jSONObject) {
        double d3;
        double d4;
        try {
            double optDouble = jSONObject.optDouble("left", 1.0d);
            double optDouble2 = jSONObject.optDouble("top", 1.0d);
            double optDouble3 = jSONObject.optDouble("right", 1.0d);
            double optDouble4 = jSONObject.optDouble("bottom", 1.0d);
            ArrayList arrayList = new ArrayList();
            Iterator<List<LatLng>> it = list.iterator();
            while (it.hasNext()) {
                arrayList.addAll(it.next());
            }
            ArrayList<LatLng> coordinateEndPoint = getCoordinateEndPoint(arrayList);
            if (coordinateEndPoint != null) {
                LatLng latLng = coordinateEndPoint.get(0);
                LatLng latLng2 = coordinateEndPoint.get(1);
                double d5 = latLng2.b - latLng.b;
                double d6 = latLng.a - latLng2.a;
                double d7 = z ? this.lastLatitudeValue : d;
                if (z) {
                    d3 = optDouble3;
                    d4 = this.lastLongitudeValue;
                } else {
                    d3 = optDouble3;
                    d4 = d2;
                }
                double d8 = d6 / 2.0d;
                double d9 = d5 / 2.0d;
                this.googleMap.h(F7.b.b(LatLngBounds.e0().b(new LatLng(d7 - (optDouble4 * d8), d4 - (optDouble * d9))).b(new LatLng(d7 + (d8 * optDouble2), d4 + (d9 * d3))).a(), 0), this.animationDuration, (c.a) null);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void checkAndAnimatePolyline(java.lang.String r18, int r19, java.lang.String r20, int r21, com.google.android.gms.maps.model.PolylineOptions r22, org.json.JSONObject r23, F7.c r24, java.lang.String r25) {
        throw new UnsupportedOperationException("Method not decompiled: in.juspay.mobility.common.MobilityCommonBridge.checkAndAnimatePolyline(java.lang.String, int, java.lang.String, int, com.google.android.gms.maps.model.PolylineOptions, org.json.JSONObject, F7.c, java.lang.String):void");
    }

    private LocationRequest createLocReq() {
        return new LocationRequest.a(100L).d(1000L).i(500L).a();
    }

    private void drawDottedLine(String str, Double d, Double d2, Double d3, Double d4, String str2, String str3) {
        if (this.googleMap != null) {
            PolylineOptions polylineOptions = new PolylineOptions();
            polylineOptions.e0(new LatLng(d.doubleValue(), d2.doubleValue()));
            polylineOptions.e0(new LatLng(d3.doubleValue(), d4.doubleValue()));
            setPolyLineDataByMapInstance(str3, str, setRouteCustomTheme(polylineOptions, Color.parseColor(str2), "DOT", 8, null, this.googleMap, Boolean.FALSE, str, str3));
        }
    }

    private void fetchAndUpdateLastKnownLocation() {
        String keyInNativeSharedPrefKeys = getKeyInNativeSharedPrefKeys("LAST_KNOWN_LAT");
        String keyInNativeSharedPrefKeys2 = getKeyInNativeSharedPrefKeys("LAST_KNOWN_LON");
        this.lastLatitudeValue = !keyInNativeSharedPrefKeys.equals("__failed") ? Double.parseDouble(keyInNativeSharedPrefKeys) : this.lastLatitudeValue;
        this.lastLongitudeValue = !keyInNativeSharedPrefKeys2.equals("__failed") ? Double.parseDouble(keyInNativeSharedPrefKeys2) : this.lastLongitudeValue;
    }

    private ArrayList<LatLng> getCoordinateEndPoint(List<LatLng> list) {
        try {
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            for (int i = 0; i < list.size(); i++) {
                LatLng latLng = list.get(i);
                double d = latLng.a;
                double d2 = latLng.b;
                arrayList.add(Double.valueOf(d));
                arrayList2.add(Double.valueOf(d2));
            }
            double doubleValue = ((Double) Collections.min(arrayList)).doubleValue();
            double doubleValue2 = ((Double) Collections.max(arrayList)).doubleValue();
            double doubleValue3 = ((Double) Collections.min(arrayList2)).doubleValue();
            double doubleValue4 = ((Double) Collections.max(arrayList2)).doubleValue();
            double d3 = (doubleValue4 - doubleValue3) * 0.1d;
            double d4 = doubleValue3 - d3;
            double d5 = doubleValue4 + d3;
            double d6 = doubleValue2 - doubleValue;
            LatLng latLng2 = new LatLng(doubleValue2 + (0.1d * d6), d4);
            LatLng latLng3 = new LatLng(doubleValue - d6, d5);
            ArrayList<LatLng> arrayList3 = new ArrayList<>();
            arrayList3.add(latLng2);
            arrayList3.add(latLng3);
            return arrayList3;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    private Uri getImageUri(Context context, Bitmap bitmap) {
        try {
            bitmap.compress(Bitmap.CompressFormat.PNG, 100, new ByteArrayOutputStream());
            return Uri.parse(MediaStore.Images.Media.insertImage(context.getContentResolver(), bitmap, "ThumbnailImage" + System.currentTimeMillis(), (String) null));
        } catch (Exception unused) {
            return null;
        }
    }

    private String getJsonFromResources(String str) throws IOException {
        InputStream openRawResource;
        StringWriter stringWriter = new StringWriter();
        Context context = this.bridgeComponents.getContext();
        if (context.getResources().getIdentifier(str, "raw", context.getPackageName()) == 0) {
            openRawResource = context.getAssets().open(str + ".json");
            if (openRawResource == null) {
                openRawResource = context.getAssets().open("juspay/" + str + ".json");
            }
        } else {
            openRawResource = context.getResources().openRawResource(context.getResources().getIdentifier(str, "raw", context.getPackageName()));
        }
        char[] cArr = new char[1024];
        try {
            try {
                try {
                    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(openRawResource, StandardCharsets.UTF_8));
                    while (true) {
                        int read = bufferedReader.read(cArr);
                        if (read == -1) {
                            break;
                        }
                        stringWriter.write(cArr, 0, read);
                    }
                    openRawResource.close();
                } catch (Throwable th) {
                    try {
                        openRawResource.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    throw th;
                }
            } catch (Exception e2) {
                e2.printStackTrace();
                openRawResource.close();
            }
        } catch (IOException e3) {
            e3.printStackTrace();
        }
        return stringWriter.toString();
    }

    private void getLastKnownLocationFromClientFallback(final String str, final boolean z) {
        com.google.android.gms.location.e eVar;
        if (!isLocationPermissionEnabled() || this.bridgeComponents.getActivity() == null || (eVar = this.client) == null) {
            return;
        }
        eVar.getLastLocation().addOnSuccessListener(this.bridgeComponents.getActivity(), new OnSuccessListener() {
            public final void onSuccess(Object obj) {
                MobilityCommonBridge.this.lambda$getLastKnownLocationFromClientFallback$5(str, z, (Location) obj);
            }
        }).addOnFailureListener(this.bridgeComponents.getActivity(), new OnFailureListener() {
            public final void onFailure(Exception exc) {
                MobilityCommonBridge.this.lambda$getLastKnownLocationFromClientFallback$6(exc);
            }
        });
    }

    private void getMapAsync(F7.k kVar, final boolean z, final String str, final String str2, final String str3, final float f) {
        if (this.bridgeComponents.getActivity() != null) {
            kVar.u(new F7.g() {
                public final void a(F7.c cVar) {
                    MobilityCommonBridge.this.lambda$getMapAsync$27(str3, str, z, f, str2, cVar);
                }
            });
        }
    }

    public static MarkerEdgeInsets getMarkerEdgeInsets(JSONObject jSONObject) {
        return new MarkerEdgeInsets(jSONObject.optInt("left", -1), jSONObject.optInt("top", -1), jSONObject.optInt("bottom", -1), jSONObject.optInt("right", -1));
    }

    private LatLng getNewLatLng(float f, LatLng latLng, LatLng latLng2) {
        double d = latLng2.a;
        double d2 = latLng.a;
        double d3 = f;
        double d4 = ((d - d2) * d3) + d2;
        double d5 = latLng2.b - latLng.b;
        if (Math.abs(d5) > 180.0d) {
            d5 -= Math.signum(d5) * 360.0d;
        }
        return new LatLng(d4, (d5 * d3) + latLng.b);
    }

    private java.util.List<java.util.List<com.google.android.gms.maps.model.LatLng>> getPolygonCoordinates(java.lang.String r17) {
        throw new UnsupportedOperationException("Method not decompiled: in.juspay.mobility.common.MobilityCommonBridge.getPolygonCoordinates(java.lang.String):java.util.List");
    }

    private Object getSharedPreferenceValue(SharedPreferences sharedPreferences, String str) {
        try {
            String string = sharedPreferences.getString(str, null);
            if (string != null) {
                return string;
            }
        } catch (Exception unused) {
        }
        try {
            int i = sharedPreferences.getInt(str, 0);
            if (sharedPreferences.contains(str)) {
                return Integer.valueOf(i);
            }
        } catch (Exception unused2) {
        }
        try {
            boolean z = sharedPreferences.getBoolean(str, false);
            if (sharedPreferences.contains(str)) {
                return Boolean.valueOf(z);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public static boolean isClassAvailable(String str) {
        try {
            Class.forName(str);
            return true;
        } catch (Exception unused) {
            return false;
        }
    }

    public void lambda$addGroundOverlay$35(String str, GroundOverlayOptions groundOverlayOptions) {
        this.groundOverlays.put(str, this.googleMap.b(groundOverlayOptions));
    }

    public void lambda$addGroundOverlay$36(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            Context context = this.bridgeComponents.getContext();
            final String optString = jSONObject.optString("id", "ground_overlay");
            int optInt = jSONObject.optInt(Snapshot.HEIGHT, 50);
            int optInt2 = jSONObject.optInt(Snapshot.WIDTH, 50);
            String optString2 = jSONObject.optString("imageUrl", "");
            boolean optBoolean = jSONObject.optBoolean("fetchFromView", false);
            String optString3 = jSONObject.optString("viewID", "");
            JSONObject optJSONObject = jSONObject.optJSONObject("center");
            LatLng latLng = new LatLng(this.lastLatitudeValue, this.lastLongitudeValue);
            if (optJSONObject != null) {
                latLng = new LatLng(optJSONObject.optDouble("lat", this.lastLatitudeValue), optJSONObject.optDouble("lng", this.lastLongitudeValue));
            }
            Drawable drawable = (this.bridgeComponents.getActivity() == null || !optBoolean) ? null : ((ImageView) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(optString3))).getDrawable();
            final GroundOverlayOptions z0 = new GroundOverlayOptions().z0(latLng, optInt2, optInt);
            if (drawable != null) {
                z0.w0(H7.c.c(Utils.drawableToBitmap(drawable)));
            } else {
                z0.w0(H7.c.d(context.getResources().getIdentifier(optString2, "drawable", context.getPackageName())));
            }
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$addGroundOverlay$35(optString, z0);
                }
            });
        } catch (JSONException unused) {
            Log.e(this.LOG_TAG, "Error parsing ripple config");
        }
    }

    public void lambda$addRippleCircle$31(java.lang.String r12) {
        throw new UnsupportedOperationException("Method not decompiled: in.juspay.mobility.common.MobilityCommonBridge.lambda$addRippleCircle$31(java.lang.String):void");
    }

    public boolean lambda$addZoneMarker$11(H7.h hVar) {
        animateCamera(hVar.a().a, hVar.a().b, 20.0f, ZoomType.NO_ZOOM);
        LocateOnMapManager locateOnMapManager = this.locateOnMapManager;
        if (locateOnMapManager == null || locateOnMapManager.markerCallback.equals("") || !this.locateOnMapManager.markerCallbackTags.contains(hVar.c())) {
            return true;
        }
        this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s','%s');", this.locateOnMapManager.markerCallback, hVar.c(), Double.valueOf(hVar.a().a), Double.valueOf(hVar.a().b)));
        return true;
    }

    public void lambda$adjustViewWithKeyboard$74(String str) {
        if (this.bridgeComponents.getActivity() != null) {
            if (str.equals("true")) {
                this.bridgeComponents.getActivity().getWindow().setSoftInputMode(16);
            } else {
                this.bridgeComponents.getActivity().getWindow().setSoftInputMode(48);
            }
        }
    }

    public void lambda$animateCamera$18(double d, double d2, String str, float f) {
        try {
            if (this.googleMap != null) {
                LatLng latLng = new LatLng(d, d2);
                if (str.equals(ZoomType.NO_ZOOM)) {
                    this.googleMap.h(F7.b.a(new CameraPosition.a().c(latLng).e(this.googleMap.j().b).b()), this.animationDuration, (c.a) null);
                } else {
                    this.googleMap.h(F7.b.d(latLng, f), this.animationDuration, (c.a) null);
                }
                Log.i(this.MAPS, "Animated Camera");
            }
        } catch (Exception unused) {
            Log.e(this.MAPS, "Error while animating camera");
        }
    }

    public void lambda$animateCameraV2$20(String str, double d, double d2, String str2, float f) {
        try {
            F7.c cVar = this.googleMapInstance.get(str) != null ? this.googleMapInstance.get(str) : this.googleMap;
            if (cVar != null) {
                LatLng latLng = new LatLng(d, d2);
                if (str2.equals(ZoomType.NO_ZOOM)) {
                    cVar.h(F7.b.a(new CameraPosition.a().c(latLng).e(this.googleMap.j().b).b()), this.animationDuration, (c.a) null);
                } else {
                    cVar.h(F7.b.d(latLng, f), this.animationDuration, (c.a) null);
                }
                Log.i(this.MAPS, "Animated Camera v2");
            }
        } catch (Exception unused) {
            Log.e(this.MAPS, "Error while animating camera");
        }
    }

    public void lambda$animateMarkerNew$57(LatLng latLng, LatLng latLng2, String str, H7.h hVar, String str2, ValueAnimator valueAnimator) {
        try {
            LatLng f = AbstractC1190e.f(latLng, latLng2, valueAnimator.getAnimatedFraction());
            float bearingBetweenLocations = bearingBetweenLocations(latLng, latLng2);
            if (bearingBetweenLocations > 1.0d) {
                MarkerConfig markerConfig = new MarkerConfig();
                markerConfig.locationName(str);
                markerConfig.setRotation(bearingBetweenLocations);
                hVar.n(0.0f);
                hVar.k(H7.c.c(getMarkerBitmapFromView(str2, false, MarkerType.NORMAL_MARKER, markerConfig)));
            }
            hVar.m(f);
            hVar.h(0.5f, 0.7f);
            this.markers.put(str2, hVar);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void lambda$animateRippleCircle$32(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            int optInt = jSONObject.optInt("count", 1);
            String optString = jSONObject.optString("prefix", "ripples");
            for (int i = 1; i <= optInt; i++) {
                CircleRippleEffect circleRippleEffect = this.circleRipples.get(optString + "_" + i);
                if (circleRippleEffect != null) {
                    circleRippleEffect.startAnimation();
                }
            }
        } catch (JSONException unused) {
            Log.e(this.LOG_TAG, "Error parsing ripple config");
        }
    }

    public void lambda$clearFocus$75(String str) {
        View findViewById = this.bridgeComponents.getActivity().findViewById(Integer.parseInt(str));
        if (findViewById != null) {
            findViewById.clearFocus();
        }
    }

    public void lambda$clearMap$40() {
        this.googleMap.i();
    }

    public void lambda$contactPermission$82() {
        try {
            contactsStoreCall(getPhoneContacts());
        } catch (Exception e) {
            Log.e(this.UTILS, "Exception in Contact Permission" + e);
        }
    }

    public void lambda$displayBase64Image$78(String str, String str2, int i, String str3, boolean z) {
        LinearLayout linearLayout;
        try {
            if (str.equals("") || str2 == null || this.bridgeComponents.getActivity() == null || (linearLayout = (LinearLayout) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(str2))) == null) {
                return;
            }
            byte[] decode = Base64.decode(str, 0);
            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inSampleSize = i;
            Bitmap decodeByteArray = BitmapFactory.decodeByteArray(decode, 0, decode.length, options);
            ImageView imageView = new ImageView(this.bridgeComponents.getContext());
            imageView.setLayoutParams(new ViewGroup.LayoutParams(linearLayout.getWidth(), linearLayout.getHeight()));
            imageView.setImageBitmap(decodeByteArray);
            imageView.setScaleType(getScaleTypes(str3));
            imageView.setAdjustViewBounds(z);
            imageView.setClipToOutline(true);
            linearLayout.removeAllViews();
            linearLayout.addView(imageView);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void lambda$drawPolygon$10(JSONObject jSONObject, String str, final JSONArray jSONArray) {
        if (this.locateOnMapManager != null) {
            final String optString = jSONObject != null ? jSONObject.optString("labelActionImage", "") : "";
            final String optString2 = jSONObject != null ? jSONObject.optString("labelImage", "") : "";
            final String optString3 = jSONObject != null ? jSONObject.optString("selectedSpotIcon", "ny_ic_selected_zone_pickup_marker_yellow") : "ny_ic_selected_zone_pickup_marker_yellow";
            C1291d c1291d = this.layer;
            if (c1291d != null) {
                c1291d.e();
            }
            if (this.googleMap != null) {
                try {
                    C1291d c1291d2 = new C1291d(this.googleMap, new JSONObject(str));
                    this.layer = c1291d2;
                    c1291d2.f(new AbstractC1269d.a() {
                        @Override
                        public void onFeatureClick(AbstractC1267b abstractC1267b) {
                            try {
                                if (!abstractC1267b.d("name").equals("")) {
                                    MobilityCommonBridge.this.changePolygonFocus(abstractC1267b.d("name"));
                                }
                                if (abstractC1267b.d("name").equals("")) {
                                    return;
                                }
                                String d = abstractC1267b.d("name");
                                for (int i = 0; i < jSONArray.length(); i++) {
                                    MobilityCommonBridge.this.zoneName = (String) jSONArray.getJSONObject(i).get("place");
                                    if (MobilityCommonBridge.this.zoneName.equals(d)) {
                                        Double d2 = (Double) jSONArray.getJSONObject(i).get("lat");
                                        Double d3 = (Double) jSONArray.getJSONObject(i).get("lng");
                                        MobilityCommonBridge mobilityCommonBridge = MobilityCommonBridge.this;
                                        LocateOnMapManager locateOnMapManager = mobilityCommonBridge.locateOnMapManager;
                                        if (locateOnMapManager != null && locateOnMapManager.showZoneLabel) {
                                            H7.h hVar = mobilityCommonBridge.zoneMarkers.get("selectedZoneGate");
                                            if (hVar != null) {
                                                hVar.r(false);
                                            }
                                            MarkerConfig markerConfig = new MarkerConfig();
                                            MobilityCommonBridge mobilityCommonBridge2 = MobilityCommonBridge.this;
                                            markerConfig.locationName(mobilityCommonBridge2.zoneName, mobilityCommonBridge2.locateOnMapManager.locationName);
                                            markerConfig.setLabelActionImage(optString);
                                            markerConfig.setLabelImage(optString2);
                                            MobilityCommonBridge.this.addZoneMarker(d2.doubleValue(), d3.doubleValue(), "selectedZoneGate", optString3, markerConfig);
                                        }
                                        MobilityCommonBridge.this.animateCamera(d2.doubleValue(), d3.doubleValue(), 20.0f, ZoomType.NO_ZOOM);
                                    }
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                    });
                    setPolygonStyle(null);
                    LocateOnMapManager locateOnMapManager = this.locateOnMapManager;
                    if (locateOnMapManager != null && locateOnMapManager.enableMapClickListener) {
                        this.googleMap.H(new c.k() {
                            public final void a(LatLng latLng) {
                                MobilityCommonBridge.this.lambda$drawPolygon$9(latLng);
                            }
                        });
                    }
                    this.layer.h();
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public void lambda$drawPolygon$9(LatLng latLng) {
        LocateOnMapManager locateOnMapManager = this.locateOnMapManager;
        if (locateOnMapManager == null || !locateOnMapManager.showZoneLabel) {
            return;
        }
        H7.h hVar = this.zoneMarkers.get("selectedZoneGate");
        if (hVar != null) {
            hVar.r(false);
        }
        removePolygonFocus(this.locateOnMapManager.focusedGeoJsonFeature);
    }

    public void lambda$drawRoute$44(String str, String str2, String str3, String str4, String str5, boolean z, String str6, int i, String str7) {
        JSONObject jSONObject;
        JSONObject jSONObject2;
        String str8;
        String str9;
        String str10;
        double d;
        double d2;
        String str11;
        String str12;
        JSONArray jSONArray;
        double d3;
        JSONObject jSONObject3;
        if (this.googleMap == null || editLocation.booleanValue()) {
            return;
        }
        setPolyLineDataByMapInstance("DEFAULT", "DEFAULT", new PolylineDataPoints());
        PolylineOptions polylineOptions = new PolylineOptions();
        int parseColor = Color.parseColor(str);
        try {
            JSONArray jSONArray2 = new JSONObject(str2).getJSONArray("points");
            JSONObject jSONObject4 = new JSONObject(str3);
            JSONObject jSONObject5 = new JSONObject(str4);
            JSONObject jSONObject6 = new JSONObject(str5);
            String optString = jSONObject5.optString("pointerIcon", "");
            String optString2 = jSONObject6.optString("pointerIcon", "");
            String optString3 = jSONObject5.optString("markerId", "");
            String optString4 = jSONObject6.optString("markerId", "");
            try {
                if (jSONArray2.length() <= 1) {
                    JSONObject jSONObject7 = (JSONObject) jSONArray2.get(0);
                    double d4 = jSONObject7.getDouble("lng");
                    double d5 = jSONObject7.getDouble("lat");
                    upsertMarker(optString, String.valueOf(d5), String.valueOf(d4), jSONObject4.getInt("vehicleSizeTagIcon"), 0.5f, 0.5f);
                    animateCamera(d5, d4, 20.0f, ZoomType.ZOOM);
                    return;
                }
                JSONObject jSONObject8 = (JSONObject) jSONArray2.get(0);
                JSONObject jSONObject9 = (JSONObject) jSONArray2.get(jSONArray2.length() - 1);
                double d6 = jSONObject8.getDouble("lat");
                double d7 = jSONObject8.getDouble("lng");
                double d8 = jSONObject9.getDouble("lat");
                String str13 = "lat";
                double d9 = jSONObject9.getDouble("lng");
                boolean optBoolean = jSONObject4.optBoolean("autoZoom", true);
                if (d6 == 0.0d || d7 == 0.0d || d8 == 0.0d || d9 == 0.0d || !optBoolean) {
                    jSONObject = jSONObject5;
                    jSONObject2 = jSONObject6;
                    str8 = optString;
                    str9 = optString4;
                    str10 = "vehicleSizeTagIcon";
                    d = d7;
                    d2 = d6;
                    str11 = optString2;
                    str12 = optString3;
                    jSONArray = jSONArray2;
                    d3 = d8;
                    jSONObject3 = jSONObject4;
                } else {
                    str9 = optString4;
                    str10 = "vehicleSizeTagIcon";
                    str11 = optString2;
                    str12 = optString3;
                    d3 = d8;
                    jSONObject2 = jSONObject6;
                    str8 = optString;
                    d = d7;
                    jSONObject = jSONObject5;
                    d2 = d6;
                    jSONArray = jSONArray2;
                    jSONObject3 = jSONObject4;
                    moveCamera(d6, d7, d3, d9, jSONArray);
                }
                if (z) {
                    int length = jSONArray.length() - 1;
                    while (length >= 0) {
                        JSONArray jSONArray3 = jSONArray;
                        JSONObject jSONObject10 = (JSONObject) jSONArray3.get(length);
                        String str14 = str13;
                        polylineOptions.e0(new LatLng(jSONObject10.getDouble(str14), jSONObject10.getDouble("lng")));
                        length--;
                        jSONArray = jSONArray3;
                        str13 = str14;
                    }
                } else {
                    LatLng latLng = new LatLng(d2, d);
                    polylineOptions.e0(new LatLng(d3, d9));
                    polylineOptions.e0(latLng);
                }
                String string = jSONObject.getString("labelImage");
                JSONObject jSONObject11 = jSONObject2;
                String string2 = jSONObject11.getString("labelImage");
                String string3 = jSONObject11.getString("labelActionImage");
                MarkerConfig markerConfig = new MarkerConfig();
                checkAndAnimatePolyline("DEFAULT", parseColor, str6, i, polylineOptions, jSONObject3, this.googleMap, "DEFAULT");
                String str15 = str11;
                if (!str15.equals("")) {
                    LatLng latLng2 = (LatLng) polylineOptions.x0().get(0);
                    markerConfig.locationName(jSONObject11.optString("primaryText", ""), jSONObject11.optString("secondaryText", ""));
                    markerConfig.setLabelImage(string2);
                    markerConfig.setLabelActionImage(string3);
                    this.markers.put(str9, this.googleMap.c(new MarkerOptions().J0("").G0(latLng2).B0(H7.c.c(getMarkerBitmapFromView(str15, false, MarkerType.NORMAL_MARKER, markerConfig)))));
                }
                String str16 = str8;
                if (str16.equals("")) {
                    return;
                }
                LatLng latLng3 = (LatLng) polylineOptions.x0().get(r2.size() - 1);
                H7.j polyLine = getPolyLine(Boolean.FALSE, getPolyLineDataByMapInstance("DEFAULT", "DEFAULT"));
                if (!str7.equals("DRIVER_LOCATION_UPDATE")) {
                    markerConfig.setLabelImage(string);
                    this.markers.put(str12, this.googleMap.c(new MarkerOptions().J0("").G0(latLng3).B0(H7.c.c(getMarkerBitmapFromView(str16, false, MarkerType.NORMAL_MARKER, markerConfig)))));
                    return;
                }
                upsertMarker(str16, String.valueOf(latLng3.a), String.valueOf(latLng3.b), jSONObject3.getInt(str10), 0.5f, 0.5f);
                String str17 = str12;
                H7.h hVar = this.markers.get(str17);
                int size = polyLine.b().size();
                float c = (float) AbstractC1190e.c((LatLng) polyLine.b().get(size - 1), (LatLng) polyLine.b().get(size - 2));
                if (c != 0.0d) {
                    hVar.n(c);
                }
                hVar.h(0.5f, 0.5f);
                this.markers.put(str17, hVar);
            } catch (JSONException e) {
                e = e;
                e.printStackTrace();
            }
        } catch (JSONException e2) {
            e = e2;
        }
    }

    public boolean lambda$drawRouteV2$41(H7.h hVar) {
        if (hVar.c() == null) {
            return false;
        }
        this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", hVar.c(), hVar.d()));
        return true;
    }

    public boolean lambda$drawRouteV2$42(H7.h hVar) {
        if (hVar.c() == null) {
            return false;
        }
        this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", hVar.c(), hVar.d()));
        return true;
    }

    public void lambda$drawRouteV2$43(java.lang.String r80) {
        throw new UnsupportedOperationException("Method not decompiled: in.juspay.mobility.common.MobilityCommonBridge.lambda$drawRouteV2$43(java.lang.String):void");
    }

    public void lambda$enableMyLocation$28(boolean z) {
        if (this.googleMap == null || !isLocationPermissionEnabled()) {
            return;
        }
        this.googleMap.y(z);
    }

    public void lambda$encodeToBase64$77(String str, String str2) {
        try {
            Bitmap decodeStream = BitmapFactory.decodeStream(MobilityCallAPI.getResponseStream(MobilityCallAPI.callAPIConnection(str, MobilityCallAPI.getBaseHeaders(this.bridgeComponents.getContext()), null, "GET", Boolean.FALSE)));
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            decodeStream.compress(Bitmap.CompressFormat.PNG, 90, byteArrayOutputStream);
            while (byteArrayOutputStream.toByteArray().length > 716800) {
                byteArrayOutputStream.reset();
                decodeStream.compress(Bitmap.CompressFormat.JPEG, 90, byteArrayOutputStream);
            }
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format("window.callUICallback('%s','%s','%s')", str2, "SUCCESS", Base64.encodeToString(byteArrayOutputStream.toByteArray(), 0).replace("\n", "")));
        } catch (Exception unused) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format("window.callUICallback('%s','%s','%s')", str2, "FAILED", ""));
        }
    }

    public void lambda$exitLocateOnMap$12() {
        F7.c cVar = this.googleMap;
        if (cVar != null) {
            cVar.A((c.d) null);
            this.googleMap.z((c.c) null);
        }
        HashMap<String, H7.h> hashMap = this.zoneMarkers;
        if (hashMap != null) {
            Iterator<Map.Entry<String, H7.h>> it = hashMap.entrySet().iterator();
            while (it.hasNext()) {
                it.next().getValue().r(false);
            }
        }
        C1291d c1291d = this.layer;
        if (c1291d != null) {
            c1291d.e();
        }
        removeAllCircles();
    }

    public void lambda$fadeInFadeOutMarker$23(String str, AnimationType animationType, int i) {
        final H7.h hVar = this.markers.get(str);
        if (hVar == null) {
            return;
        }
        int i2 = AnonymousClass12.$SwitchMap$in$juspay$mobility$common$MobilityCommonBridge$AnimationType[animationType.ordinal()];
        if (i2 == 1) {
            ObjectAnimator.ofFloat(hVar, "alpha", 0.0f, 1.0f).setDuration(i * 1000).start();
        } else {
            if (i2 != 2) {
                return;
            }
            ObjectAnimator ofFloat = ObjectAnimator.ofFloat(hVar, "alpha", 1.0f, 0.0f);
            ofFloat.addListener(new Animator.AnimatorListener() {
                @Override
                public void onAnimationCancel(Animator animator) {
                }

                @Override
                public void onAnimationEnd(Animator animator) {
                    hVar.r(false);
                }

                @Override
                public void onAnimationRepeat(Animator animator) {
                }

                @Override
                public void onAnimationStart(Animator animator) {
                }
            });
            ofFloat.setDuration(i * 1000).start();
        }
    }

    public void lambda$getLastKnownLocationFromClientFallback$5(String str, boolean z, Location location) {
        if (location != null) {
            double latitude = location.getLatitude();
            Double valueOf = Double.valueOf(latitude);
            double longitude = location.getLongitude();
            Double valueOf2 = Double.valueOf(longitude);
            String uTCTimeStampFromMills = Utils.getUTCTimeStampFromMills(location.getTime());
            this.lastLatitudeValue = latitude;
            this.lastLongitudeValue = longitude;
            this.lastKnownLocation = location;
            setKeysInSharedPrefs("LAST_KNOWN_LAT", String.valueOf(latitude));
            setKeysInSharedPrefs("LAST_KNOWN_LON", String.valueOf(this.lastLongitudeValue));
            setKeysInSharedPrefs("LAST_KNOWN_LOCATION_TS", uTCTimeStampFromMills);
            if (str != null) {
                this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s','%s');", str, valueOf, valueOf2, uTCTimeStampFromMills));
            }
            if (!z || this.googleMap == null) {
                return;
            }
            LatLng latLng = new LatLng(latitude, longitude);
            H7.h hVar = this.userPositionMarker;
            if (hVar == null) {
                upsertMarker(CURRENT_LOCATION, String.valueOf(valueOf), String.valueOf(valueOf2), 160, 0.5f, 0.9f);
            } else {
                if (this.storeLocateOnMapCallBack == null) {
                    hVar.r(true);
                }
                this.userPositionMarker.m(latLng);
            }
            animateCamera(latitude, longitude, 17.0f, ZoomType.ZOOM);
        }
    }

    public void lambda$getLastKnownLocationFromClientFallback$6(Exception exc) {
        Log.e(this.LOCATION, "Last and current position not known");
    }

    public static boolean lambda$getMapAsync$26(H7.h hVar) {
        hVar.e();
        return true;
    }

    public void lambda$getMapAsync$27(String str, String str2, boolean z, float f, String str3, F7.c cVar) {
        this.googleMap = cVar;
        this.googleMapInstance.put(str, cVar);
        System.out.println("Inside getMapAsync " + cVar);
        if (str2.equals(HOTSPOTS)) {
            cVar.x(10.0f);
            cVar.w(19.0f);
        } else {
            cVar.x(7.0f);
            cVar.w(cVar.l());
        }
        cVar.n().f(false);
        cVar.n().e(false);
        if (isLocationPermissionEnabled()) {
            cVar.y(z);
        }
        this.markersElement.put(str, this.markers);
        cVar.K(new c.n() {
            public final boolean b(H7.h hVar) {
                boolean lambda$getMapAsync$26;
                lambda$getMapAsync$26 = MobilityCommonBridge.lambda$getMapAsync$26(hVar);
                return lambda$getMapAsync$26;
            }
        });
        try {
            setMapCustomTheme();
            if (this.lastLatitudeValue != 0.0d && this.lastLongitudeValue != 0.0d) {
                this.googleMap.o(F7.b.d(new LatLng(this.lastLatitudeValue, this.lastLongitudeValue), f));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (str3 != null) {
            String format = String.format("window.callUICallback('%s','%s','%s','%s');", str3, "MAP", "READY", "LOADED");
            Log.e(this.MAPS, format);
            this.bridgeComponents.getJsCallback().addJsToWebView(format);
        }
    }

    public void lambda$goBackPrevWebPage$68(final WebView webView) {
        if (webView == null) {
            return;
        }
        if (webView.canGoBack()) {
            webView.post(new Runnable() {
                @Override
                public final void run() {
                    webView.goBack();
                }
            });
            return;
        }
        String str = this.storeDashboardCallBack;
        if (str != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str, "TRUE"));
        }
    }

    public void lambda$isMockLocation$14(String str, Location location) {
        boolean isFromMockProvider = location != null ? Build.VERSION.SDK_INT <= 30 ? location.isFromMockProvider() : k2.b.a(location) : false;
        if (str != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str, Boolean.valueOf(isFromMockProvider)));
        }
    }

    public void lambda$isMockLocation$15(String str, Exception exc) {
        Log.e(this.LOCATION, "Last and current position not known");
        if (str != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str, Boolean.FALSE));
        }
    }

    public void lambda$loaderText$64(String str, String str2) {
        View inflate = LayoutInflater.from(this.bridgeComponents.getContext()).inflate(R.layout.loader, (ViewGroup) null, false);
        TextView textView = (TextView) inflate.findViewById(R.id.loaderMainText);
        TextView textView2 = (TextView) inflate.findViewById(R.id.loaderSubText);
        textView.setText(str);
        textView2.setText(str2);
    }

    public void lambda$locateOnMap$7(String str, String str2, ImageView imageView, JSONObject jSONObject) {
        double d = this.googleMap.j().a.a;
        double d2 = this.googleMap.j().a.b;
        LatLng latLng = new LatLng(Double.parseDouble(str), Double.parseDouble(str2));
        this.zoneName = "LatLon";
        if (editLocation.booleanValue()) {
            handleEditPickupMarkerListener(this.zoneName, AbstractC1190e.b(this.googleMap.j().a, latLng), latLng, imageView, jSONObject);
        }
        String str3 = this.storeLocateOnMapCallBack;
        if (str3 != null && this.bridgeComponents != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format("window.callUICallback('%s','%s','%s','%s');", str3, this.zoneName, Double.valueOf(d), Double.valueOf(d2)));
        }
        if (this.storeHotspotMapCallback == null || this.bridgeComponents == null) {
            return;
        }
        LatLngBounds latLngBounds = this.googleMap.m().b().e;
        LatLng latLng2 = latLngBounds.a;
        LatLng latLng3 = latLngBounds.b;
        this.bridgeComponents.getJsCallback().addJsToWebView(String.format("window.callUICallback('%s','%s','%s','%s','%s');", this.storeHotspotMapCallback, Double.valueOf(latLng2.a), Double.valueOf(latLng3.a), Double.valueOf(latLng3.b), Double.valueOf(latLng2.b)));
    }

    public void lambda$locateOnMap$8(boolean z, final String str, final String str2, float f, final JSONObject jSONObject) {
        ImageView imageView;
        LatLng latLng;
        boolean z2;
        removeMarker(CURRENT_LOCATION);
        LatLng latLng2 = new LatLng(0.0d, 0.0d);
        if (this.labelId.equals("")) {
            imageView = null;
        } else {
            Activity activity = this.bridgeComponents.getActivity();
            Objects.requireNonNull(activity);
            imageView = (ImageView) activity.findViewById(Integer.parseInt(this.labelId));
        }
        final ImageView imageView2 = imageView;
        try {
            latLng = new LatLng(Double.parseDouble(str), Double.parseDouble(str2));
            z2 = z;
        } catch (Exception e) {
            e.printStackTrace();
            latLng = latLng2;
            z2 = true;
        }
        if (z2) {
            this.googleMap.o(F7.b.d(new LatLng(this.lastLatitudeValue, this.lastLongitudeValue), f));
        } else {
            this.googleMap.o(F7.b.d(latLng, f));
            F7.c cVar = this.googleMap;
            cVar.o(F7.b.g(cVar.j().b + 2.0f));
        }
        if (editLocation.booleanValue() && this.googleMap != null) {
            if (imageView2 != null) {
                imageView2.setVisibility(4);
            }
            double b = AbstractC1190e.b(this.googleMap.j().a, latLng);
            String optString = jSONObject.optString("circleId", "");
            removeAllPolylines("");
            updateRippleCircleWithId(optString, setCircleConfigFromJSON(jSONObject, b <= ((double) this.editPickupThreshold)), latLng);
        }
        F7.c cVar2 = this.googleMap;
        if (cVar2 != null) {
            cVar2.B(new c.e() {
                public void onCameraMoveStarted(int i) {
                    ImageView imageView3 = imageView2;
                    if (imageView3 != null) {
                        imageView3.setVisibility(4);
                    }
                }
            });
            this.googleMap.z(new c.c() {
                public final void a() {
                    MobilityCommonBridge.this.lambda$locateOnMap$7(str, str2, imageView2, jSONObject);
                }
            });
        }
        if (this.lastLatitudeValue != 0.0d && this.lastLongitudeValue != 0.0d && z2) {
            LatLng latLng3 = new LatLng(this.lastLatitudeValue, this.lastLongitudeValue);
            F7.c cVar3 = this.googleMap;
            if (cVar3 != null) {
                cVar3.o(F7.b.d(latLng3, f));
                return;
            }
            return;
        }
        F7.c cVar4 = this.googleMap;
        if (cVar4 != null) {
            cVar4.o(F7.b.d(latLng, f));
            F7.c cVar5 = this.googleMap;
            cVar5.o(F7.b.g(cVar5.j().b + 2.0f));
        }
    }

    public void lambda$moveCamera$53(JSONArray jSONArray, double d, double d2, double d3, double d4) {
        double d5;
        double d6;
        double d7;
        double d8;
        try {
            Log.i(this.MAPS, "json_coordinates" + jSONArray);
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            for (int i = 0; i < jSONArray.length(); i++) {
                try {
                    JSONObject jSONObject = (JSONObject) jSONArray.get(i);
                    double d9 = jSONObject.getDouble("lng");
                    arrayList.add(Double.valueOf(jSONObject.getDouble("lat")));
                    arrayList2.add(Double.valueOf(d9));
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
            Log.i(this.MAPS, "all_latitudes" + arrayList);
            Log.i(this.MAPS, "all_longitudes" + arrayList2);
            double doubleValue = ((Double) Collections.min(arrayList)).doubleValue();
            double doubleValue2 = ((Double) Collections.max(arrayList)).doubleValue();
            double doubleValue3 = ((Double) Collections.min(arrayList2)).doubleValue();
            double doubleValue4 = ((Double) Collections.max(arrayList2)).doubleValue();
            Log.i(this.MAPS, String.valueOf(doubleValue));
            Log.i(this.MAPS, String.valueOf(doubleValue2));
            if (d <= d2) {
                double d10 = doubleValue2 - doubleValue;
                d5 = doubleValue - (1.3d * d10);
                d6 = doubleValue2 + (d10 * 0.1d);
            } else {
                double d11 = doubleValue2 - doubleValue;
                double d12 = doubleValue - (d11 * 1.3d);
                d5 = doubleValue2 + (0.1d * d11);
                d6 = d12;
            }
            if (d3 <= d4) {
                double d13 = (doubleValue4 - doubleValue3) * 0.09d;
                d8 = doubleValue3 - d13;
                d7 = doubleValue4 + d13;
            } else {
                double d14 = (doubleValue4 - doubleValue3) * 0.09d;
                double d15 = doubleValue4 + d14;
                d7 = doubleValue3 - d14;
                d8 = d15;
            }
            Log.i(this.MAPS, "Coordinates Points" + jSONArray);
            if (this.googleMap != null) {
                try {
                    try {
                        LatLngBounds a = LatLngBounds.e0().b(new LatLng(d5, d8)).b(new LatLng(d6, d7)).a();
                        if (jSONArray.length() < 5) {
                            this.googleMap.h(F7.b.b(a, 400), this.animationDuration, (c.a) null);
                        } else {
                            this.googleMap.h(F7.b.b(a, 150), this.animationDuration, (c.a) null);
                        }
                    } catch (Exception e2) {
                        Log.i(this.MAPS, "Exception in Move camera" + e2);
                    }
                } catch (IllegalArgumentException e3) {
                    Log.i(this.MAPS, "Exception in Move camera" + e3);
                    LatLngBounds a2 = LatLngBounds.e0().b(new LatLng(d6, d7)).b(new LatLng(d5, d8)).a();
                    if (jSONArray.length() < 5) {
                        this.googleMap.h(F7.b.b(a2, 400), this.animationDuration, (c.a) null);
                    } else {
                        this.googleMap.h(F7.b.b(a2, 150), this.animationDuration, (c.a) null);
                    }
                }
            }
        } catch (Exception e4) {
            e4.printStackTrace();
        }
    }

    public void lambda$moveCameraV2$54(String str, JSONArray jSONArray, double d, double d2, double d3, double d4) {
        double d5;
        double d6;
        double d7;
        double d8;
        try {
            F7.c cVar = this.googleMapInstance.get(str) != null ? this.googleMapInstance.get(str) : this.googleMap;
            Log.i(this.MAPS, "json_coordinates" + jSONArray);
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            for (int i = 0; i < jSONArray.length(); i++) {
                try {
                    JSONObject jSONObject = (JSONObject) jSONArray.get(i);
                    double d9 = jSONObject.getDouble("lng");
                    arrayList.add(Double.valueOf(jSONObject.getDouble("lat")));
                    arrayList2.add(Double.valueOf(d9));
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
            Log.i(this.MAPS, "all_latitudes" + arrayList);
            Log.i(this.MAPS, "all_longitudes" + arrayList2);
            double doubleValue = ((Double) Collections.min(arrayList)).doubleValue();
            double doubleValue2 = ((Double) Collections.max(arrayList)).doubleValue();
            double doubleValue3 = ((Double) Collections.min(arrayList2)).doubleValue();
            double doubleValue4 = ((Double) Collections.max(arrayList2)).doubleValue();
            Log.i(this.MAPS, String.valueOf(doubleValue));
            Log.i(this.MAPS, String.valueOf(doubleValue2));
            if (d <= d2) {
                double d10 = doubleValue2 - doubleValue;
                d5 = doubleValue - (1.3d * d10);
                d6 = doubleValue2 + (d10 * 0.1d);
            } else {
                double d11 = doubleValue2 - doubleValue;
                double d12 = doubleValue - (d11 * 1.3d);
                d5 = doubleValue2 + (0.1d * d11);
                d6 = d12;
            }
            if (d3 <= d4) {
                double d13 = (doubleValue4 - doubleValue3) * 0.09d;
                d8 = doubleValue3 - d13;
                d7 = doubleValue4 + d13;
            } else {
                double d14 = (doubleValue4 - doubleValue3) * 0.09d;
                double d15 = doubleValue4 + d14;
                d7 = doubleValue3 - d14;
                d8 = d15;
            }
            Log.i(this.MAPS, "Coordinates Points" + jSONArray);
            if (cVar != null) {
                try {
                    LatLngBounds a = LatLngBounds.e0().b(new LatLng(d5, d8)).b(new LatLng(d6, d7)).a();
                    if (jSONArray.length() < 5) {
                        cVar.h(F7.b.b(a, 400), this.animationDuration, (c.a) null);
                    } else {
                        cVar.h(F7.b.b(a, 150), this.animationDuration, (c.a) null);
                    }
                } catch (IllegalArgumentException e2) {
                    Log.i(this.MAPS, "Exception in Move camera" + e2);
                    LatLngBounds a2 = LatLngBounds.e0().b(new LatLng(d6, d7)).b(new LatLng(d5, d8)).a();
                    if (jSONArray.length() < 5) {
                        cVar.h(F7.b.b(a2, 400), this.animationDuration, (c.a) null);
                    } else {
                        cVar.h(F7.b.b(a2, 150), this.animationDuration, (c.a) null);
                    }
                } catch (Exception e3) {
                    Log.i(this.MAPS, "Exception in Move camera" + e3);
                }
            }
        } catch (Exception e4) {
            e4.printStackTrace();
        }
    }

    public void lambda$new$0(BridgeComponents bridgeComponents, SharedPreferences sharedPreferences, String str) {
        Object sharedPreferenceValue;
        JsCallback jsCallback = bridgeComponents.getJsCallback();
        if (jsCallback == null || str == null || (sharedPreferenceValue = getSharedPreferenceValue(sharedPreferences, str)) == null) {
            return;
        }
        jsCallback.addJsToWebView(String.format("window.onSharedPreferenceChanged('%s','%s')", str, sharedPreferenceValue));
    }

    public void lambda$new$1(Location location) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("lat", location.getLatitude());
            jSONObject.put("lon", location.getLongitude());
            this.callbackQueue.add(String.format("window[\"onEvent'\"]('%s','%s')", "onLocationFetch", jSONObject.toString()));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void lambda$onActivityResult$81(Intent intent) {
        Utils.encodeImageToBase64(intent, this.bridgeComponents.getContext(), null);
    }

    public void lambda$onMapUpdate$48() {
        MapUpdate mapUpdate = this.mapUpdate;
        if (mapUpdate.isGestureMovement) {
            mapUpdate.isMapMoved = true;
        }
        mapUpdate.isMapIdle = true;
    }

    public void lambda$onMapUpdate$49(String str, JsCallback jsCallback, MapRemoteConfig mapRemoteConfig) {
        if (str != null && jsCallback != null) {
            jsCallback.addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s');", str));
        }
        this.mapUpdate.mapRecenterHandler.removeCallbacksAndMessages(null);
        this.mapUpdate.mapRecenterHandler.postDelayed(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$onMapUpdate$48();
            }
        }, mapRemoteConfig.recenterDelay);
    }

    public void lambda$onMapUpdate$50(String str, JsCallback jsCallback, int i) {
        if (str != null && jsCallback != null) {
            jsCallback.addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s',%d);", str, Integer.valueOf(i)));
        }
        if (i == 1) {
            MapUpdate mapUpdate = this.mapUpdate;
            mapUpdate.isGestureMovement = true;
            mapUpdate.isMapIdle = false;
        } else {
            this.mapUpdate.isGestureMovement = false;
        }
        this.mapUpdate.mapRecenterHandler.removeCallbacksAndMessages(null);
    }

    public void lambda$onMapUpdate$51(final String str, final MapRemoteConfig mapRemoteConfig, final String str2) {
        try {
            final JsCallback jsCallback = this.bridgeComponents.getJsCallback();
            if (!this.mapUpdate.isIdleListenerActive) {
                this.googleMap.z(new c.c() {
                    public final void a() {
                        MobilityCommonBridge.this.lambda$onMapUpdate$49(str, jsCallback, mapRemoteConfig);
                    }
                });
                this.mapUpdate.isIdleListenerActive = true;
            }
            if (this.mapUpdate.isMoveListenerActive) {
                return;
            }
            this.googleMap.B(new c.e() {
                public final void onCameraMoveStarted(int i) {
                    MobilityCommonBridge.this.lambda$onMapUpdate$50(str2, jsCallback, i);
                }
            });
            this.mapUpdate.isMoveListenerActive = true;
        } catch (Exception e) {
            Log.e(this.LOG_TAG, "Error in onMapUpdate Executor " + e);
        }
    }

    public void lambda$openUrlInApp$65(String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setData(Uri.parse(str));
            intent.setFlags(268435456);
            this.bridgeComponents.getContext().startActivity(intent);
        } catch (ActivityNotFoundException e) {
            toast(this.bridgeComponents.getContext().getString(R.string.no_enabled_browser));
            Log.e(this.UTILS, "Exception occurred while calling WebView", e);
        } catch (Exception e2) {
            Log.e(this.UTILS, "Exception occurred while calling WebView", e2);
        }
    }

    public void lambda$pickContact$83() {
        try {
            this.bridgeComponents.getActivity().startActivityForResult(new Intent("android.intent.action.PICK", ContactsContract.CommonDataKinds.Phone.CONTENT_URI), PICK_CONTACT_REQUEST_CODE, null);
        } catch (Exception e) {
            Log.e(this.UTILS, "Exception in Contact Permission" + e);
        }
    }

    public void lambda$reallocateMapFragment$29(String str, F7.c cVar) {
        this.googleMap = cVar;
        cVar.n().f(false);
        cVar.n().e(false);
        HashMap<String, H7.h> hashMap = this.markersElement.get(str);
        if (hashMap == null) {
            hashMap = new HashMap<>();
        }
        this.markers = hashMap;
    }

    public void lambda$reallocateMapFragment$30(final String str) {
        F7.k j0;
        try {
            if (this.bridgeComponents.getActivity() == null || (j0 = this.bridgeComponents.getActivity().getSupportFragmentManager().j0(Integer.parseInt(str))) == null) {
                return;
            }
            j0.u(new F7.g() {
                public final void a(F7.c cVar) {
                    MobilityCommonBridge.this.lambda$reallocateMapFragment$29(str, cVar);
                }
            });
        } catch (Exception e) {
            Log.e("reallocateMapFragment", "FAILED WHILE REALLOCATING " + e);
        }
    }

    public void lambda$removeAllMarkers$17() {
        try {
            HashMap<String, H7.h> hashMap = this.markers;
            if (hashMap != null) {
                Iterator<Map.Entry<String, H7.h>> it = hashMap.entrySet().iterator();
                while (it.hasNext()) {
                    H7.h value = it.next().getValue();
                    value.r(false);
                    value.f();
                }
                this.markers.clear();
            }
        } catch (Exception e) {
            Log.e(this.MAPS, "RemoveAllMarkers error ", e);
        }
    }

    public void lambda$removeAllPolylines$52(java.lang.String r9) {
        throw new UnsupportedOperationException("Method not decompiled: in.juspay.mobility.common.MobilityCommonBridge.lambda$removeAllPolylines$52(java.lang.String):void");
    }

    public void lambda$removeGroundOverlay$37(String str) {
        try {
            String optString = new JSONObject(str).optString("id", "ground_overlay");
            H7.e eVar = this.groundOverlays.get(optString);
            if (eVar != null) {
                eVar.b();
            }
            this.groundOverlays.remove(optString);
        } catch (JSONException unused) {
            Log.e(this.LOG_TAG, "Error parsing ground Overlay config");
        }
    }

    public void lambda$removeMarker$16(String str) {
        try {
            if (this.markers.containsKey(str)) {
                H7.h hVar = this.markers.get(str);
                hVar.r(false);
                hVar.f();
                this.markers.remove(str);
                Log.i(this.MAPS, "Removed marker " + str);
            }
        } catch (Exception e) {
            Log.e(this.MAPS, "Remove Marker error " + str, e);
        }
    }

    public void lambda$removeRippleCircle$33(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            int optInt = jSONObject.optInt("count", 1);
            String optString = jSONObject.optString("prefix", "ripples");
            for (int i = 1; i <= optInt; i++) {
                String str2 = optString + "_" + i;
                CircleRippleEffect circleRippleEffect = this.circleRipples.get(str2);
                if (circleRippleEffect != null) {
                    circleRippleEffect.remove();
                }
                this.circleRipples.remove(str2);
            }
        } catch (JSONException unused) {
            Log.e(this.LOG_TAG, "Error parsing ripple config");
        }
    }

    public void lambda$renderBase64ImageFile$76(String str, String str2, String str3) {
        LinearLayout linearLayout;
        try {
            if (str.equals("") || str2 == null || this.bridgeComponents.getActivity() == null || (linearLayout = (LinearLayout) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(str2))) == null) {
                return;
            }
            byte[] decode = Base64.decode(str, 0);
            Bitmap decodeByteArray = BitmapFactory.decodeByteArray(decode, 0, decode.length);
            ImageView imageView = new ImageView(this.bridgeComponents.getContext());
            imageView.setLayoutParams(new ViewGroup.LayoutParams(linearLayout.getWidth(), linearLayout.getHeight()));
            imageView.setImageBitmap(decodeByteArray);
            imageView.setScaleType(getScaleTypes(str3));
            imageView.setAdjustViewBounds(true);
            imageView.setClipToOutline(true);
            linearLayout.removeAllViews();
            linearLayout.addView(imageView);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void lambda$requestKeyboardShow$66(String str) {
        try {
            if (this.bridgeComponents.getActivity() != null) {
                int parseInt = Integer.parseInt(str);
                InputMethodManager inputMethodManager = (InputMethodManager) this.bridgeComponents.getActivity().getSystemService("input_method");
                View findViewById = this.bridgeComponents.getActivity().findViewById(parseInt);
                View findViewById2 = this.lastFocusedEditView != -1 ? this.bridgeComponents.getActivity().findViewById(this.lastFocusedEditView) : null;
                if (inputMethodManager != null && findViewById != null) {
                    if (findViewById2 != null && this.lastFocusedEditView != parseInt) {
                        findViewById2.clearFocus();
                    }
                    findViewById.requestFocus();
                    inputMethodManager.showSoftInput(findViewById, 1);
                }
                if (parseInt != this.lastFocusedEditView) {
                    this.lastFocusedEditView = Integer.parseInt(str);
                }
            }
        } catch (Exception e) {
            Log.e(this.UTILS, "Keyboard Exception" + e);
        }
    }

    public void lambda$resolvableLocationSettingsReq$13(Task task) {
        try {
            task.getResult(ApiException.class);
        } catch (ApiException e) {
            if (e.getStatusCode() != 6) {
                return;
            }
            try {
                if (this.bridgeComponents.getActivity() != null) {
                    e.a(this.bridgeComponents.getActivity(), LOCATION_RESOLUTION_REQUEST_CODE);
                }
            } catch (IntentSender.SendIntentException | ClassCastException unused) {
            }
        }
    }

    public void lambda$setMapPadding$25(int i, int i2, int i3, int i4) {
        F7.c cVar = this.googleMap;
        if (cVar != null) {
            cVar.Q(i, i2, i3, i4);
        }
    }

    public void lambda$setupVoiceRecognitionView$87(String str) {
        if (this.speechRecognition == null) {
            Log.i(this.LOG_TAG, "setupVoiceRecognitionView is created");
            this.speechRecognition = new SpeechRecognition(this.bridgeComponents);
        }
        this.speechRecognition.setupSpeechRecognitionView(str);
    }

    public void lambda$shareImageMessage$72(String str, String str2) {
        View view;
        try {
            JSONObject jSONObject = new JSONObject(str);
            if (this.bridgeComponents.getActivity() == null || !jSONObject.has("viewId") || jSONObject.getString("viewId").equals("")) {
                return;
            }
            Intent intent = new Intent();
            Context context = this.bridgeComponents.getContext();
            Activity activity = this.bridgeComponents.getActivity();
            if (jSONObject.has("code") && !jSONObject.getBoolean("isReferral")) {
                view = activity.findViewById(Integer.parseInt(jSONObject.getString("viewId")));
                Bitmap createBitmap = Bitmap.createBitmap(view.getMeasuredWidth(), view.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
                view.draw(new Canvas(createBitmap));
                createBitmap.compress(Bitmap.CompressFormat.JPEG, 100, new ByteArrayOutputStream());
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", new Locale("en", "US"));
                simpleDateFormat.setTimeZone(TimeZone.getTimeZone("IST"));
                String replaceAll = ("IMG_" + simpleDateFormat.format(new Date())).replaceAll("[^a-zA-Z\\d]", "_");
                Uri parse = Uri.parse(MediaStore.Images.Media.insertImage(context.getContentResolver(), createBitmap, replaceAll + "", (String) null));
                intent.setAction("android.intent.action.SEND");
                intent.setType("image/*");
                intent.putExtra("android.intent.extra.STREAM", parse);
                intent.putExtra("android.intent.extra.TEXT", str2);
                intent.setFlags(268435456);
                intent.addFlags(1);
                Intent createChooser = Intent.createChooser(intent, null);
                createChooser.setFlags(268435456);
                this.bridgeComponents.getContext().startActivity(createChooser);
            }
            View inflate = LayoutInflater.from(context).inflate(R.layout.referral_code, (ViewGroup) null, false);
            if (jSONObject.has("code")) {
                ((TextView) inflate.findViewById(R.id.code)).setText(jSONObject.getString("code"));
            }
            ((ImageView) inflate.findViewById(R.id.code_image)).setImageDrawable(((ImageView) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(jSONObject.getString("viewId")))).getDrawable());
            if (jSONObject.has("logoId")) {
                ((ImageView) inflate.findViewById(R.id.referral_logo)).setImageDrawable(((ImageView) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(jSONObject.getString("logoId")))).getDrawable());
            }
            inflate.measure(360, 440);
            inflate.layout(0, 0, inflate.getMeasuredWidth(), inflate.getMeasuredHeight());
            view = inflate;
            Bitmap createBitmap2 = Bitmap.createBitmap(view.getMeasuredWidth(), view.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
            view.draw(new Canvas(createBitmap2));
            createBitmap2.compress(Bitmap.CompressFormat.JPEG, 100, new ByteArrayOutputStream());
            SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", new Locale("en", "US"));
            simpleDateFormat2.setTimeZone(TimeZone.getTimeZone("IST"));
            String replaceAll2 = ("IMG_" + simpleDateFormat2.format(new Date())).replaceAll("[^a-zA-Z\\d]", "_");
            Uri parse2 = Uri.parse(MediaStore.Images.Media.insertImage(context.getContentResolver(), createBitmap2, replaceAll2 + "", (String) null));
            intent.setAction("android.intent.action.SEND");
            intent.setType("image/*");
            intent.putExtra("android.intent.extra.STREAM", parse2);
            intent.putExtra("android.intent.extra.TEXT", str2);
            intent.setFlags(268435456);
            intent.addFlags(1);
            Intent createChooser2 = Intent.createChooser(intent, null);
            createChooser2.setFlags(268435456);
            this.bridgeComponents.getContext().startActivity(createChooser2);
        } catch (Exception e) {
            Toast.makeText(this.bridgeComponents.getContext(), "Something went wrong. Please try again later!", 0).show();
            Log.e("IMAGE_TEXT_SHARE", "Error in sharing the message");
            e.printStackTrace();
        }
    }

    public void lambda$shareTextMessage$71(String str, String str2) {
        Intent intent = new Intent();
        Context context = this.bridgeComponents.getContext();
        intent.setAction("android.intent.action.SEND");
        intent.putExtra("android.intent.extra.TEXT", str);
        intent.putExtra("android.intent.extra.TITLE", str2);
        Bitmap decodeResource = BitmapFactory.decodeResource(context.getResources(), context.getResources().getIdentifier("ic_launcher", "drawable", context.getPackageName()));
        if (decodeResource != null && Build.VERSION.SDK_INT > 28) {
            Uri imageUri = getImageUri(context, decodeResource);
            intent.setClipData(ClipData.newUri(context.getContentResolver(), "ThumbnailImage" + System.currentTimeMillis(), imageUri));
        }
        intent.setFlags(1);
        intent.setType("text/plain");
        Intent createChooser = Intent.createChooser(intent, null);
        createChooser.setFlags(268435456);
        context.startActivity(createChooser);
    }

    public void lambda$showDynamicRouteMarker$88(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            String optString = jSONObject.optString("lat", "9.9");
            String optString2 = jSONObject.optString("lon", "9.9");
            String optString3 = jSONObject.optString("purescriptId", "");
            F7.c cVar = this.googleMapInstance.get(optString3) != null ? this.googleMapInstance.get(optString3) : this.googleMap;
            LatLng latLng = new LatLng(optString.equals("9.9") ? this.lastLatitudeValue : Double.parseDouble(optString), optString2.equals("9.9") ? this.lastLongitudeValue : Double.parseDouble(optString2));
            String optString4 = jSONObject.optString("routeId", "");
            H7.h hVar = this.markers.get(optString4);
            if (hVar != null) {
                hVar.m(latLng);
                return;
            }
            MarkerOptions B0 = new MarkerOptions().G0(latLng).k0(0.5f, 0.5f).L0(2.0f).B0(H7.c.c(getMarkerForBusRouteId(optString4)));
            if (cVar != null) {
                this.markers.put(optString4, cVar.c(B0));
            }
        } catch (Exception e) {
            e.toString();
        }
    }

    public void lambda$showKeyboard$67(String str) {
        try {
            if (this.bridgeComponents.getActivity() != null) {
                int parseInt = Integer.parseInt(str);
                InputMethodManager inputMethodManager = (InputMethodManager) this.bridgeComponents.getActivity().getSystemService("input_method");
                EditText editText = (EditText) this.bridgeComponents.getActivity().findViewById(parseInt);
                EditText editText2 = this.lastFocusedEditText != -1 ? (EditText) this.bridgeComponents.getActivity().findViewById(this.lastFocusedEditText) : null;
                if (inputMethodManager != null && editText != null) {
                    if (editText2 != null && this.lastFocusedEditText != parseInt) {
                        editText2.clearFocus();
                        editText2.setImeOptions(3);
                        editText2.setImeOptions(6);
                    }
                    editText.requestFocus();
                    editText.setImeOptions(3);
                    editText.setImeOptions(6);
                    inputMethodManager.showSoftInput(editText, 1);
                }
                if (parseInt != this.lastFocusedEditText) {
                    this.lastFocusedEditText = Integer.parseInt(str);
                }
            }
        } catch (Exception e) {
            Log.e(this.UTILS, "Keyboard Exception" + e);
        }
    }

    public void lambda$showLocationOnMap$2(String str) {
        if (isLocationPermissionEnabled()) {
            updateLastKnownLocation(null, true, str, true);
        }
    }

    public void lambda$showMap$55(String str, String str2, boolean z, String str3, String str4, float f) {
        if (this.bridgeComponents.getActivity() != null) {
            try {
                if (this.bridgeComponents.getActivity().findViewById(Integer.parseInt(str)) == null) {
                    return;
                }
                JSONObject jSONObject = new JSONObject(str2);
                this.animationDuration = jSONObject.optInt("animationDuration", 400);
                this.locateOnMapConfig = jSONObject.optJSONObject("locateOnMapConfig");
                this.labelTextSize = jSONObject.optInt("labelTextSize", 30);
                F7.k v = F7.k.v();
                androidx.fragment.app.z p = this.bridgeComponents.getActivity().getSupportFragmentManager().p();
                p.b(Integer.parseInt(str), v);
                p.i();
                getMapAsync(v, z, str3, str4, str, f);
            } catch (Exception e) {
                Log.e(this.MAPS, "Error in showMap " + e);
                e.printStackTrace();
            }
        }
    }

    public void lambda$showMarker$21(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            JSONObject optJSONObject = jSONObject.optJSONObject("markerConfig");
            JSONObject optJSONObject2 = optJSONObject.optJSONObject("animationConfig");
            String optString = optJSONObject.optString("markerId", "");
            String optString2 = optJSONObject.optString("pointerIcon", "");
            String optString3 = optJSONObject.optString("rotation", "0");
            String optString4 = jSONObject.optString("purescriptId", "");
            float optDouble = (float) optJSONObject.optDouble("zIndex", 0.0d);
            MarkerConfig markerConfig = new MarkerConfig();
            markerConfig.setMarkerId(optString);
            markerConfig.setPointer(optString2);
            markerConfig.setRotation(Float.parseFloat(optString3));
            markerConfig.setZIndex(optDouble);
            String optString5 = jSONObject.optString("lat", "9.9");
            String optString6 = jSONObject.optString("lng", "9.9");
            int optInt = jSONObject.optInt("markerSize", 160);
            float optDouble2 = (float) jSONObject.optDouble("anchorV", 0.0d);
            float optDouble3 = (float) jSONObject.optDouble("anchorV1", 0.0d);
            markerConfig.setMarkerAnimation(getAnimationType(optJSONObject2.optString("animationType", "NONE")), optJSONObject2.optInt("animationDuration", 0));
            upsertMarkerV2(markerConfig, optString5, optString6, optInt, optDouble2, optDouble3, optString4);
        } catch (Exception e) {
            Log.i(this.MAPS, "Marker creation error -> " + e);
        }
    }

    public void lambda$showNotificationWithURI$73(String str, String str2, Uri uri, String str3, String str4, String str5) {
        toast(str);
        Context context = this.bridgeComponents.getContext();
        JuspayLogger.d(this.OTHERS, str2 + "inside Show Notification");
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setFlags(67108865);
        intent.setDataAndType(uri, str3);
        PendingIntent activity = PendingIntent.getActivity(context, 234567, intent, 67108864);
        int i = Build.VERSION.SDK_INT;
        if (i >= 26) {
            NotificationChannel a = k3.k.a(str4, str2, 4);
            k3.w.a(a, str2);
            NotificationManager notificationManager = (NotificationManager) context.getSystemService(NotificationManager.class);
            k3.z.a(a, RingtoneManager.getDefaultUri(2), new AudioAttributes.Builder().setContentType(4).setUsage(5).build());
            k3.o.a(notificationManager, a);
        }
        m.e eVar = new m.e(context, str4);
        eVar.l(str).x(this.bridgeComponents.getContext().getResources().getIdentifier(i >= 26 ? "ic_launcher_small_icon" : "ic_launcher", i >= 26 ? "drawable" : "mipmap", this.bridgeComponents.getContext().getPackageName())).k(str5).e(true).y(RingtoneManager.getDefaultUri(2)).u(2);
        eVar.j(activity);
        androidx.core.app.p b = androidx.core.app.p.b(context);
        JuspayLogger.d(this.OTHERS, str2 + "notification is Created");
        if (androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.POST_NOTIFICATIONS") != 0) {
            JuspayLogger.d(this.OTHERS, str2 + "Notification permission is not given");
            return;
        }
        b.d(234567, eVar.b());
        JuspayLogger.d(this.OTHERS, str2 + "notification is notified");
    }

    public void lambda$startAudioPlayer$80(String str, android.media.MediaPlayer mediaPlayer) {
        this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str, "COMPLETED"));
    }

    public void lambda$startLottieProcess$69(Throwable th) {
    }

    public void lambda$startLottieProcess$70(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            float parseFloat = Float.parseFloat(jSONObject.getString("minProgress"));
            float parseFloat2 = Float.parseFloat(jSONObject.getString("maxProgress"));
            float optDouble = (float) jSONObject.optDouble("progress", 0.0d);
            if (parseFloat >= parseFloat2) {
                parseFloat = 0.0f;
            }
            String string = jSONObject.getString("scaleType");
            final boolean parseBoolean = Boolean.parseBoolean(jSONObject.getString("repeat"));
            int parseInt = Integer.parseInt(jSONObject.getString("lottieId"));
            float parseFloat3 = Float.parseFloat(jSONObject.getString("speed"));
            String string2 = jSONObject.getString("rawJson");
            boolean optBoolean = jSONObject.optBoolean("forceToUseRemote");
            LottieAnimationView findViewById = this.bridgeComponents.getActivity().findViewById(parseInt);
            this.animationView = findViewById;
            findViewById.i(new Animator.AnimatorListener() {
                @Override
                public void onAnimationCancel(Animator animator) {
                }

                @Override
                public void onAnimationEnd(Animator animator) {
                    if (parseBoolean) {
                        MobilityCommonBridge.this.animationView.G(0.0f, 1.0f);
                    }
                }

                @Override
                public void onAnimationRepeat(Animator animator) {
                }

                @Override
                public void onAnimationStart(Animator animator) {
                }
            });
            if (string2.contains("http")) {
                this.animationView.setFailureListener(new n2.z() {
                    public final void onResult(Object obj) {
                        MobilityCommonBridge.this.lambda$startLottieProcess$69((Throwable) obj);
                    }
                });
                this.animationView.setAnimationFromUrl(string2);
                if (optBoolean) {
                    this.animationView.setCacheComposition(false);
                }
            } else {
                this.animationView.C(getJsonFromResources(string2), (String) null);
            }
            this.animationView.setRepeatCount(parseBoolean ? -1 : 0);
            this.animationView.setSpeed(parseFloat3);
            this.animationView.G(parseFloat, parseFloat2);
            this.animationView.setProgress(optDouble);
            this.animationView.setScaleType(getScaleTypes(string));
            this.animationView.x();
        } catch (Exception unused) {
        }
    }

    public void lambda$startVoiceRecognition$86() {
        SpeechRecognition speechRecognition = this.speechRecognition;
        if (speechRecognition != null) {
            speechRecognition.requestPermissions();
            this.speechRecognition.startListening(this.speechRecognition.setIntent());
        }
    }

    public void lambda$stopVoiceRecognition$85() {
        SpeechRecognition speechRecognition = this.speechRecognition;
        if (speechRecognition != null) {
            speechRecognition.stopListening();
            this.speechRecognition = null;
        }
    }

    public void lambda$timePicker$58(String str, TimePicker timePicker, int i, int i2) {
        if (str != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s', %d, %d,'%s');", str, Integer.valueOf(i), Integer.valueOf(i2), "SELECTED"));
        }
    }

    public void lambda$timePicker$59(String str, DialogInterface dialogInterface) {
        if (str != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s',%d,%d);", str, "CANCELLED", 0, 0));
        }
    }

    public void lambda$timePicker$60(String str, DialogInterface dialogInterface) {
        if (str != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s',%d,%d);", str, "DISMISSED", 0, 0));
        }
    }

    public void lambda$timePicker$61(final String str, String str2) {
        Calendar calendar = Calendar.getInstance();
        int i = calendar.get(11);
        int i2 = calendar.get(12);
        Log.e(this.DTUTILS, "Time picker called");
        TimePickerDialog timePickerDialog = new TimePickerDialog(this.bridgeComponents.getActivity(), new TimePickerDialog.OnTimeSetListener() {
            @Override
            public final void onTimeSet(TimePicker timePicker, int i3, int i4) {
                MobilityCommonBridge.this.lambda$timePicker$58(str, timePicker, i3, i4);
            }
        }, i, i2, false);
        timePickerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
            @Override
            public final void onCancel(DialogInterface dialogInterface) {
                MobilityCommonBridge.this.lambda$timePicker$59(str, dialogInterface);
            }
        });
        timePickerDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                MobilityCommonBridge.this.lambda$timePicker$60(str, dialogInterface);
            }
        });
        if (str2 != null && str2 != "") {
            try {
                long parseLong = Long.parseLong(str2);
                Calendar calendar2 = Calendar.getInstance();
                calendar2.setTimeInMillis(parseLong);
                timePickerDialog.updateTime(calendar2.get(11), calendar2.get(12));
            } catch (NumberFormatException e) {
                Log.e(this.DTUTILS, "Invalid default time format: " + e);
            }
        }
        timePickerDialog.show();
    }

    public static void lambda$toggleLoader$62(View view) {
        System.out.println("LOADER CLICKED");
    }

    public void lambda$toggleLoader$63(boolean z) {
        View inflate;
        if (this.bridgeComponents.getActivity() == null || (inflate = this.bridgeComponents.getActivity().getLayoutInflater().inflate(R.layout.loader, (ViewGroup) null)) == null) {
            return;
        }
        if (!z) {
            inflate.setVisibility(8);
        } else {
            inflate.setVisibility(0);
            inflate.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    MobilityCommonBridge.lambda$toggleLoader$62(view);
                }
            });
        }
    }

    public void lambda$updateGroundOverlay$39(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            final H7.e eVar = this.groundOverlays.get(jSONObject.optString("id", "ground_overlay"));
            JSONObject optJSONObject = jSONObject.optJSONObject("center");
            final LatLng latLng = new LatLng(this.lastLatitudeValue, this.lastLongitudeValue);
            if (optJSONObject != null) {
                latLng = new LatLng(optJSONObject.optDouble("lat", this.lastLatitudeValue), optJSONObject.optDouble("lng", this.lastLongitudeValue));
            }
            if (eVar != null) {
                ExecutorManager.runOnMainThread(new Runnable() {
                    @Override
                    public final void run() {
                        eVar.f(latLng);
                    }
                });
            }
        } catch (JSONException unused) {
            Log.e(this.LOG_TAG, "Error parsing ripple config");
        }
    }

    public void lambda$updateLastKnownLocation$3(String str, boolean z, String str2, boolean z2, Location location) {
        if (location == null) {
            if (z2) {
                getLastKnownLocationFromClientFallback(str, z);
                return;
            } else {
                sendDefaultLocationCallback(str);
                return;
            }
        }
        double latitude = location.getLatitude();
        Double valueOf = Double.valueOf(latitude);
        double longitude = location.getLongitude();
        Double valueOf2 = Double.valueOf(longitude);
        String uTCTimeStampFromMills = Utils.getUTCTimeStampFromMills(location.getTime());
        this.lastLatitudeValue = latitude;
        this.lastLongitudeValue = longitude;
        this.lastKnownLocation = location;
        setKeysInSharedPrefs("LAST_KNOWN_LAT", String.valueOf(latitude));
        setKeysInSharedPrefs("LAST_KNOWN_LON", String.valueOf(this.lastLongitudeValue));
        setKeysInSharedPrefs("LAST_KNOWN_LOCATION_TS", uTCTimeStampFromMills);
        if (str != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s','%s');", str, valueOf, valueOf2, uTCTimeStampFromMills));
        }
        if (!z || this.googleMap == null) {
            return;
        }
        LatLng latLng = new LatLng(latitude, longitude);
        H7.h hVar = this.userPositionMarker;
        if (hVar != null) {
            if (this.storeLocateOnMapCallBack == null) {
                hVar.r(true);
            }
            this.userPositionMarker.m(latLng);
        } else if (!editLocation.booleanValue()) {
            upsertMarker(CURRENT_LOCATION, String.valueOf(valueOf), String.valueOf(valueOf2), 160, 0.5f, 0.9f);
        }
        try {
            animateCamera(latitude, longitude, this.zoom, str2);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void lambda$updateLastKnownLocation$4(boolean z, String str, boolean z2, Exception exc) {
        Log.e(this.LOCATION, "Current position not known");
        if (z) {
            getLastKnownLocationFromClientFallback(str, z2);
        } else {
            sendDefaultLocationCallback(str);
        }
    }

    public void lambda$updateMarker$45(String str) {
        JSONObject jSONObject;
        JSONObject optJSONObject;
        try {
            if (this.googleMap == null || (optJSONObject = (jSONObject = new JSONObject(str)).optJSONObject("position")) == null || optJSONObject.optDouble("lat", 0.0d) == 0.0d || optJSONObject.optDouble("lat", 0.0d) == 0.0d || jSONObject.optString("pointerIcon").equals("")) {
                return;
            }
            removeMarker(jSONObject.optString("pointerIcon", ""));
            LatLng latLng = new LatLng(optJSONObject.optDouble("lat", 0.0d), optJSONObject.optDouble("lng", 0.0d));
            MarkerConfig markerConfig = new MarkerConfig();
            markerConfig.locationName(jSONObject.optString("primaryText", ""), jSONObject.optString("secondaryText", ""));
            markerConfig.setLabelImage(jSONObject.optString("labelImage"));
            markerConfig.setLabelActionImage(jSONObject.optString("labelActionImage"));
            this.markers.put(jSONObject.optString("markerId", ""), this.googleMap.c(new MarkerOptions().J0("").G0(latLng).B0(H7.c.c(getMarkerBitmapFromView(jSONObject.optString("pointerIcon"), !jSONObject.optBoolean("showPointer", false), MarkerType.NORMAL_MARKER, markerConfig)))));
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public boolean lambda$updateMarkerV2$46(H7.h hVar) {
        if (hVar.c() == null) {
            return true;
        }
        String format = String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", hVar.c(), hVar.d());
        JsCallback jsCallback = this.bridgeComponents.getJsCallback();
        if (jsCallback == null) {
            return true;
        }
        jsCallback.addJsToWebView(format);
        return true;
    }

    public void lambda$updateMarkerV2$47(String str) {
        JSONObject jSONObject;
        JSONObject optJSONObject;
        try {
            if (this.googleMap == null || (optJSONObject = (jSONObject = new JSONObject(str)).optJSONObject("position")) == null || optJSONObject.optDouble("lat", 0.0d) == 0.0d || optJSONObject.optDouble("lat", 0.0d) == 0.0d || jSONObject.optString("pointerIcon").equals("")) {
                return;
            }
            removeMarker(jSONObject.optString("pointerIcon", ""));
            LatLng latLng = new LatLng(optJSONObject.optDouble("lat", 0.0d), optJSONObject.optDouble("lng", 0.0d));
            MarkerConfig markerConfig = new MarkerConfig();
            markerConfig.locationName(jSONObject.optString("primaryText", ""), jSONObject.optString("secondaryText", ""));
            markerConfig.setLabelImageConfig(jSONObject.optJSONObject("labelImage"));
            markerConfig.setLabelActionImageConfig(jSONObject.optJSONObject("labelActionImage"));
            markerConfig.setTheme(jSONObject.optString("theme", "LIGHT"));
            markerConfig.setMarkerCallback(jSONObject.optString("markerCallback", ""));
            markerConfig.setLabelMaxWidth(jSONObject.optInt("labelMaxWidth", 300));
            markerConfig.setLabelMaxLines(jSONObject.optInt("labelMaxLines", 1));
            markerConfig.setLabelTextSize(jSONObject.optInt("labelTextSize", 11));
            markerConfig.setShortTitle(jSONObject.optString("shortTitle", ""));
            String optString = jSONObject.optString("pointerIcon", "");
            H7.h c = this.googleMap.c(new MarkerOptions().J0(optString).G0(latLng).B0(H7.c.c(getMarkerBitmapFromView(jSONObject.optString("pointerIcon"), !jSONObject.optBoolean("showPointer", false), MarkerType.NORMAL_MARKER, markerConfig))));
            this.markers.put(optString, c);
            if (c == null || markerConfig.markerCallback.equals("")) {
                return;
            }
            c.p(markerConfig.markerCallback);
            this.googleMap.K(new c.n() {
                public final boolean b(H7.h hVar) {
                    boolean lambda$updateMarkerV2$46;
                    lambda$updateMarkerV2$46 = MobilityCommonBridge.this.lambda$updateMarkerV2$46(hVar);
                    return lambda$updateMarkerV2$46;
                }
            });
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public void lambda$updateRippleCirclePosition$34(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            int optInt = jSONObject.optInt("count", 1);
            String optString = jSONObject.optString("prefix", "ripples");
            JSONObject optJSONObject = jSONObject.optJSONObject("center");
            LatLng latLng = new LatLng(this.lastLatitudeValue, this.lastLongitudeValue);
            if (optJSONObject != null) {
                latLng = new LatLng(optJSONObject.optDouble("lat", this.lastLatitudeValue), optJSONObject.optDouble("lng", this.lastLongitudeValue));
            }
            for (int i = 1; i <= optInt; i++) {
                CircleRippleEffect circleRippleEffect = this.circleRipples.get(optString + "_" + i);
                if (circleRippleEffect != null) {
                    circleRippleEffect.updatePosition(latLng);
                }
            }
        } catch (JSONException unused) {
            Log.e(this.LOG_TAG, "Error parsing ripple config");
        }
    }

    public void lambda$updateRoute$56(String str) {
        float f;
        MapRemoteConfig mapRemoteConfig;
        try {
            JSONObject jSONObject = new JSONObject(str);
            String optString = jSONObject.optString("pureScriptID", "");
            if ((optString.isEmpty() ? this.googleMap : this.googleMapInstance.get(optString)) != null) {
                try {
                    MapRemoteConfig mapRemoteConfig2 = getMapRemoteConfig();
                    try {
                        f = (float) mapRemoteConfig2.zoomLevel;
                    } catch (Exception unused) {
                        f = 20.0f;
                    }
                    float f2 = f;
                    String optString2 = jSONObject.optString("json", "");
                    JSONObject optJSONObject = jSONObject.optJSONObject("destMarkerConfig");
                    String optString3 = optJSONObject != null ? optJSONObject.optString("pointerIcon", "") : "";
                    String optString4 = jSONObject.optString("eta", "");
                    String optString5 = jSONObject.optString("locationName", "");
                    String optString6 = jSONObject.optString("srcMarker", "");
                    String optString7 = jSONObject.optString("specialLocation", "");
                    String optString8 = jSONObject.optString("polylineKey", "DEFAULT");
                    JSONObject optJSONObject2 = optJSONObject != null ? optJSONObject.optJSONObject("actionImage") : null;
                    JSONObject jSONObject2 = new JSONObject(optString7);
                    int optInt = jSONObject2.optInt("dashUnit", 1);
                    int optInt2 = jSONObject2.optInt("gapUnit", 0);
                    boolean optBoolean = jSONObject.optBoolean("autoZoom", true);
                    ArrayList arrayList = new ArrayList();
                    JSONArray jSONArray = new JSONObject(optString2).getJSONArray("points");
                    int length = jSONArray.length() - 1;
                    while (length >= 0) {
                        JSONArray jSONArray2 = jSONArray;
                        JSONObject jSONObject3 = (JSONObject) jSONArray.get(length);
                        arrayList.add(new LatLng(jSONObject3.getDouble("lat"), jSONObject3.getDouble("lng")));
                        length--;
                        optBoolean = optBoolean;
                        jSONArray = jSONArray2;
                        optInt = optInt;
                        optInt2 = optInt2;
                        f2 = f2;
                    }
                    boolean z = optBoolean;
                    int i = optInt;
                    float f3 = f2;
                    int i2 = optInt2;
                    JSONArray jSONArray3 = jSONArray;
                    H7.h hVar = this.markers.get(optString6);
                    if (hVar != null) {
                        hVar.q("Vehicle Icon On Map");
                        hVar.e();
                    }
                    H7.h hVar2 = this.markers.get(optString3);
                    String string = jSONObject2.getString("destSpecialTagIcon");
                    MarkerConfig markerConfig = new MarkerConfig();
                    markerConfig.locationName(optString5);
                    markerConfig.setLabelImage(string);
                    if (optJSONObject2 != null) {
                        markerConfig.setMarkerActionImageConfig(optJSONObject2);
                    }
                    if (hVar2 != null) {
                        hVar2.k(H7.c.c(getMarkerBitmapFromView(optString3, false, MarkerType.NORMAL_MARKER, markerConfig)));
                        hVar2.q("Driver is " + optString4);
                    }
                    PolylineDataPoints polyLineDataByMapInstance = getPolyLineDataByMapInstance(optString, optString8);
                    H7.j polyLine = getPolyLine(Boolean.FALSE, polyLineDataByMapInstance);
                    if (polyLine != null) {
                        polyLine.f(new ButtCap());
                        if (arrayList.size() == 0) {
                            if (hVar2 != null) {
                                animateMarkerNew(optString6, hVar2.a(), hVar, optString4);
                                H7.j polyLine2 = getPolyLine(Boolean.TRUE, polyLineDataByMapInstance);
                                if (polyLine2 != null) {
                                    polyLine2.c();
                                }
                                polyLine.c();
                                if (polyLineDataByMapInstance != null) {
                                    polyLineDataByMapInstance.setPolyline(null);
                                    polyLineDataByMapInstance.setOverlayPolylines(null);
                                }
                                setPolyLineDataByMapInstance(optString, optString8, polyLineDataByMapInstance);
                                if (hVar != null) {
                                    hVar.h(0.5f, 0.0f);
                                }
                                MapUpdate mapUpdate = this.mapUpdate;
                                mapUpdate.isMapMoved = false;
                                mapUpdate.isMapIdle = true;
                                animateCamera(hVar2.a().a, hVar2.a().b, f3, ZoomType.ZOOM);
                                return;
                            }
                            return;
                        }
                        double d = ((LatLng) arrayList.get(0)).a;
                        double d2 = ((LatLng) arrayList.get(0)).b;
                        double d3 = ((LatLng) arrayList.get(arrayList.size() - 1)).a;
                        double d4 = ((LatLng) arrayList.get(arrayList.size() - 1)).b;
                        animateMarkerNew(optString6, (LatLng) arrayList.get(arrayList.size() - 1), hVar, optString4);
                        polyLine.h(Arrays.asList(new Dash(i), new Gap(i2)));
                        polyLine.i(arrayList);
                        if (this.debounceAnimateCameraCounter == null) {
                            mapRemoteConfig = mapRemoteConfig2;
                            this.debounceAnimateCameraCounter = Integer.valueOf(mapRemoteConfig.debounceAnimateCameraCounter);
                        } else {
                            mapRemoteConfig = mapRemoteConfig2;
                        }
                        if (!z || !this.mapUpdate.isMapIdle || (this.debounceAnimateCameraCounter.intValue() > 0 && !this.mapUpdate.isMapMoved)) {
                            this.debounceAnimateCameraCounter = Integer.valueOf(this.debounceAnimateCameraCounter.intValue() - 1);
                            return;
                        }
                        moveCamera(d3, d4, d, d2, jSONArray3);
                        MapUpdate mapUpdate2 = this.mapUpdate;
                        mapUpdate2.isMapMoved = false;
                        mapUpdate2.isMapIdle = true;
                        this.debounceAnimateCameraCounter = Integer.valueOf(mapRemoteConfig.debounceAnimateCameraCounter);
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
        } catch (JSONException e2) {
            throw new RuntimeException(e2);
        }
    }

    public void lambda$upsertMarker$24(String str, String str2, String str3, int i, float f, float f2) {
        F7.c cVar;
        boolean z;
        if (str == null || str2 == null) {
            return;
        }
        try {
            double parseDouble = str.equals("9.9") ? this.lastLatitudeValue : Double.parseDouble(str);
            double parseDouble2 = str.equals("9.9") ? this.lastLatitudeValue : Double.parseDouble(str2);
            LatLng latLng = new LatLng(parseDouble, parseDouble2);
            if (this.markers.containsKey(str3)) {
                H7.h hVar = this.markers.get(str3);
                hVar.m(latLng);
                hVar.j(true);
                hVar.r(true);
                hVar.e();
                hVar.a();
                Log.i(this.MAPS, "Marker position updated for " + str3);
                return;
            }
            MarkerOptions makeMarkerObject = makeMarkerObject(str3, parseDouble, parseDouble2, i, f, f2);
            if (makeMarkerObject == null || (cVar = this.googleMap) == null) {
                return;
            }
            H7.h c = cVar.c(makeMarkerObject);
            this.markers.put(str3, c);
            if (c != null) {
                c.m(latLng);
                if (this.storeLocateOnMapCallBack != null && str3.equals(CURRENT_LOCATION)) {
                    z = false;
                    c.r(z);
                    c.j(true);
                    c.e();
                }
                z = true;
                c.r(z);
                c.j(true);
                c.e();
            }
            if (str3.equals(CURRENT_LOCATION)) {
                this.userPositionMarker = c;
            }
            Log.i(this.MAPS, "New marker created and updated for " + str3);
        } catch (Exception e) {
            Log.i(this.MAPS, "Marker creation error for " + str3, e);
        }
    }

    public void lambda$upsertMarkerLabel$19(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            String optString = jSONObject.optString("title");
            String optString2 = jSONObject.optString("id");
            String optString3 = jSONObject.optString("markerImage");
            String optString4 = jSONObject.optString("actionImage");
            String optString5 = jSONObject.optString("actionCallBack");
            JSONObject optJSONObject = jSONObject.optJSONObject("position");
            MarkerConfig markerConfig = new MarkerConfig();
            markerConfig.locationName(optString);
            markerConfig.setMarkerActionImage(optString4);
            LatLng latLng = optJSONObject != null ? new LatLng(optJSONObject.optDouble("lat", this.lastLatitudeValue), optJSONObject.optDouble("lng", this.lastLongitudeValue)) : null;
            if (this.markers.containsKey(optString2)) {
                H7.h hVar = this.markers.get(optString2);
                if (latLng != null) {
                    hVar.m(latLng);
                }
                hVar.r(true);
                hVar.k(H7.c.c(getMarkerBitmapFromView(null, optString3.equals(""), MarkerType.NORMAL_MARKER, markerConfig)));
                return;
            }
            MarkerOptions markerOptions = new MarkerOptions();
            if (latLng != null) {
                markerOptions.G0(latLng);
            }
            markerOptions.J0("").B0(H7.c.c(getMarkerBitmapFromView(null, optString3.equals(""), MarkerType.NORMAL_MARKER, markerConfig)));
            H7.h c = this.googleMap.c(markerOptions);
            if (!optString5.equals("") && c != null) {
                c.p(optString5);
            }
            this.markers.put(optString2, c);
        } catch (Exception e) {
            Log.e(this.MAPS, "Marker config parse error for " + str, e);
        }
    }

    public void lambda$upsertMarkerV2$22(String str, MarkerConfig markerConfig, String str2, String str3, int i, float f, float f2) {
        MarkerConfig markerConfig2 = markerConfig;
        try {
            F7.c cVar = this.googleMapInstance.get(str);
            String str4 = markerConfig2.markerId.equals("") ? markerConfig2.pointerIcon : markerConfig2.markerId;
            String str5 = markerConfig2.pointerIcon;
            float f3 = markerConfig2.rotation;
            float f4 = markerConfig2.animationType == AnimationType.FADE_IN ? 0.0f : 1.0f;
            float f5 = markerConfig2.zIndex;
            System.out.println("marker ids" + str4);
            if (str2 == null || str3 == null) {
                return;
            }
            double parseDouble = str2.equals("9.9") ? this.lastLatitudeValue : Double.parseDouble(str2);
            double parseDouble2 = str3.equals("9.9") ? this.lastLongitudeValue : Double.parseDouble(str3);
            LatLng latLng = new LatLng(parseDouble, parseDouble2);
            if (this.markers.containsKey(str4)) {
                H7.h hVar = this.markers.get(str4);
                hVar.m(latLng);
                hVar.j(true);
                hVar.r(true);
                hVar.e();
                hVar.a();
                hVar.g(f4);
                hVar.s(f5);
                Log.i(this.MAPS, "Marker position updated for " + str4);
            } else {
                MarkerOptions makeMarkerObject = makeMarkerObject(str5, parseDouble, parseDouble2, i, f, f2);
                if (makeMarkerObject != null && cVar != null) {
                    H7.h c = cVar.c(makeMarkerObject);
                    this.markers.put(str4, c);
                    if (c != null) {
                        c.m(latLng);
                        c.r(true);
                        c.j(true);
                        c.e();
                        c.n(f3);
                        c.g(f4);
                        c.s(f5);
                    }
                    if (str4.equals(CURRENT_LOCATION)) {
                        this.userPositionMarker = c;
                    }
                    Log.i(this.MAPS, "New marker created and updated for " + str4);
                }
                markerConfig2 = markerConfig;
            }
            AnimationType animationType = markerConfig2.animationType;
            if (animationType != AnimationType.NONE) {
                fadeInFadeOutMarker(animationType, str4, markerConfig2.animationDuration);
            }
        } catch (Exception e) {
            Log.i(this.MAPS, "Marker creation error " + e);
        }
    }

    public void lambda$voiceToText$84(String str) {
        if (this.speechRecognition == null) {
            this.speechRecognition = new SpeechRecognition(this.bridgeComponents);
        }
        this.speechRecognition.requestPermissions();
        Intent intent = this.speechRecognition.setIntent();
        this.speechRecognition.setupSpeechRecognition(str);
        this.speechRecognition.startListening(intent);
    }

    private MarkerOptions makeMarkerObject(String str, double d, double d2, int i, float f, float f2) {
        try {
            MarkerOptions k0 = new MarkerOptions().G0(new LatLng(d, d2)).J0(str).k0(f, f2);
            if (!str.equals(LOCATE_ON_MAP)) {
                k0.B0(H7.c.c(constructBitmap(i, str)));
            }
            return k0;
        } catch (Exception e) {
            Log.e(this.MAPS, "MARKER obj creation", e);
            return null;
        }
    }

    public java.lang.Boolean pointInsidePolygon(java.util.List<java.util.List<com.google.android.gms.maps.model.LatLng>> r23, java.lang.Double r24, java.lang.Double r25) {
        throw new UnsupportedOperationException("Method not decompiled: in.juspay.mobility.common.MobilityCommonBridge.pointInsidePolygon(java.util.List, java.lang.Double, java.lang.Double):java.lang.Boolean");
    }

    private int pxToDp(int i) {
        return Math.round(i / (this.bridgeComponents.getContext().getResources().getDisplayMetrics().xdpi / 160.0f));
    }

    public void reOrderSpinners(DatePickerDialog datePickerDialog, char[] cArr) {
        if (datePickerDialog.isShowing()) {
            int identifier = Resources.getSystem().getIdentifier("year", "id", LogSubCategory.LifeCycle.ANDROID);
            int identifier2 = Resources.getSystem().getIdentifier("month", "id", LogSubCategory.LifeCycle.ANDROID);
            int identifier3 = Resources.getSystem().getIdentifier("day", "id", LogSubCategory.LifeCycle.ANDROID);
            int identifier4 = Resources.getSystem().getIdentifier("pickers", "id", LogSubCategory.LifeCycle.ANDROID);
            NumberPicker numberPicker = (NumberPicker) datePickerDialog.findViewById(identifier);
            NumberPicker numberPicker2 = (NumberPicker) datePickerDialog.findViewById(identifier2);
            NumberPicker numberPicker3 = (NumberPicker) datePickerDialog.findViewById(identifier3);
            LinearLayout linearLayout = (LinearLayout) datePickerDialog.findViewById(identifier4);
            linearLayout.removeAllViews();
            for (int i = 0; i < 3; i++) {
                char c = cArr[i];
                if (c == 'd') {
                    linearLayout.addView(numberPicker3);
                    setImeOptions(numberPicker3, i);
                } else if (c == 'm') {
                    linearLayout.addView(numberPicker2);
                    setImeOptions(numberPicker2, i);
                } else {
                    if (c != 'y') {
                        throw new IllegalArgumentException("Invalid DateOrder");
                    }
                    linearLayout.addView(numberPicker);
                    setImeOptions(numberPicker, i);
                }
            }
        }
    }

    private void resolvableLocationSettingsReq() {
        com.google.android.gms.location.k.c(this.bridgeComponents.getContext()).checkLocationSettings(new LocationSettingsRequest.a().a(createLocReq()).c(true).b()).addOnCompleteListener(new OnCompleteListener() {
            public final void onComplete(Task task) {
                MobilityCommonBridge.this.lambda$resolvableLocationSettingsReq$13(task);
            }
        });
    }

    private void sendDefaultLocationCallback(String str) {
        if (str != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s','%s');", str, "0.0", "0.0", Utils.getUTCTimeStampFromMills(System.currentTimeMillis())));
        }
    }

    private void setImeOptions(NumberPicker numberPicker, int i) {
        ((TextView) numberPicker.findViewById(Resources.getSystem().getIdentifier("numberpicker_input", "id", LogSubCategory.LifeCycle.ANDROID))).setImeOptions(i < 2 ? 5 : 6);
    }

    private void setKeyboardVisibilityListener() {
        if (this.bridgeComponents.getActivity() == null || this.onGlobalLayoutListener != null) {
            return;
        }
        try {
            final View rootView = this.bridgeComponents.getActivity().findViewById(android.R.id.content).getRootView();
            this.onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
                private boolean alreadyOpen;
                private final Rect rect = new Rect();

                @Override
                public void onGlobalLayout() {
                    int applyDimension = (int) TypedValue.applyDimension(1, 148, rootView.getResources().getDisplayMetrics());
                    rootView.getWindowVisibleDisplayFrame(this.rect);
                    int height = rootView.getRootView().getHeight();
                    Rect rect = this.rect;
                    boolean z = height - (rect.bottom - rect.top) >= applyDimension;
                    if (z == this.alreadyOpen) {
                        return;
                    }
                    this.alreadyOpen = z;
                    try {
                        MobilityCommonBridge.this.bridgeComponents.getJsCallback().addJsToWebView(String.format("window[\"onEvent'\"]('%s',atob('%s'))", z ? "onKeyboardOpen" : "onKeyboardClose", Base64.encodeToString("{}".getBytes(), 2)));
                    } catch (Exception e) {
                        Log.e("MobilityCommonBridge", "Error in onVisibilityChanged " + e);
                    }
                }
            };
            rootView.getViewTreeObserver().addOnGlobalLayoutListener(this.onGlobalLayoutListener);
        } catch (Exception e) {
            Log.e("MobilityCommonBridge", "Error in setKeyboardVisibilityListener " + e);
        }
    }

    private void setLabelImageAction(View view, MarkerImageConfig markerImageConfig) {
        if (markerImageConfig != null) {
            try {
                if (markerImageConfig.image.equals("")) {
                    return;
                }
                Context context = this.bridgeComponents.getContext();
                ImageView imageView = (ImageView) view.findViewById(R.id.label_image_action);
                if (imageView != null) {
                    imageView.setVisibility(0);
                    imageView.setImageDrawable(context.getResources().getDrawable(context.getResources().getIdentifier(markerImageConfig.image, "drawable", context.getPackageName())));
                    imageView.setLayoutParams(new LinearLayout.LayoutParams((int) TypedValue.applyDimension(1, markerImageConfig.width, context.getResources().getDisplayMetrics()), (int) TypedValue.applyDimension(1, markerImageConfig.height, context.getResources().getDisplayMetrics())));
                }
            } catch (Exception e) {
                Log.e(this.LOG_TAG, "Error in setLabelImageAction ", e);
            }
        }
    }

    private void setMarkerActionImage(MarkerActionImageConfig markerActionImageConfig, String str, View view) {
        int i;
        int i2;
        int i3;
        int i4;
        int i5;
        int i6;
        Context context = this.bridgeComponents.getContext();
        String str2 = markerActionImageConfig.image;
        String str3 = markerActionImageConfig.orientation;
        String str4 = markerActionImageConfig.background;
        int applyDimension = (int) TypedValue.applyDimension(1, markerActionImageConfig.height, context.getResources().getDisplayMetrics());
        int applyDimension2 = (int) TypedValue.applyDimension(1, markerActionImageConfig.width, context.getResources().getDisplayMetrics());
        MarkerEdgeInsets markerEdgeInsets = markerActionImageConfig.layoutMargin;
        MarkerEdgeInsets markerEdgeInsets2 = markerActionImageConfig.padding;
        MarkerEdgeInsets markerEdgeInsets3 = markerActionImageConfig.layoutPadding;
        LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.main_label_layout);
        if (str3.equals("HORIZONTAL")) {
            linearLayout.setOrientation(0);
        } else {
            linearLayout.setOrientation(1);
        }
        int i7 = markerEdgeInsets3.left;
        if (i7 != -1 && (i4 = markerEdgeInsets3.top) != -1 && (i5 = markerEdgeInsets3.right) != -1 && (i6 = markerEdgeInsets3.bottom) != -1) {
            linearLayout.setPadding(i7, i4, i5, i6);
        }
        View findViewById = view.findViewById(R.id.zone_image_and_text);
        if (markerEdgeInsets.left != -1 && markerEdgeInsets.top != -1 && markerEdgeInsets.right != -1 && markerEdgeInsets.bottom != -1) {
            ((LinearLayout.LayoutParams) findViewById.getLayoutParams()).setMargins(markerEdgeInsets.left, markerEdgeInsets.top, markerEdgeInsets.right, markerEdgeInsets.bottom);
        }
        if (!str2.equals("")) {
            ImageView imageView = (ImageView) view.findViewById(R.id.marker_action_image);
            LinearLayout linearLayout2 = (LinearLayout) view.findViewById(R.id.marker_action_image_parent);
            int i8 = markerEdgeInsets2.left;
            if (i8 != -1 && (i = markerEdgeInsets2.top) != -1 && (i2 = markerEdgeInsets2.right) != -1 && (i3 = markerEdgeInsets2.bottom) != -1) {
                imageView.setPadding(i8, i, i2, i3);
            }
            linearLayout2.setVisibility(0);
            if (!str4.equals("")) {
                linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-2, -1));
                linearLayout2.setBackground(context.getResources().getDrawable(context.getResources().getIdentifier(str4, "drawable", context.getPackageName())));
                linearLayout2.setClickable(true);
            }
            if (applyDimension != 0 && applyDimension2 != 0) {
                ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
                layoutParams.height = applyDimension;
                layoutParams.width = applyDimension2;
            }
            imageView.setVisibility(0);
            imageView.setImageDrawable(context.getResources().getDrawable(context.getResources().getIdentifier(str2, "drawable", context.getPackageName())));
        }
        if (str2.equals("") && str.equals("")) {
            view.findViewById(R.id.main_label_layout).setVisibility(8);
        }
    }

    private void setMarkerBackground(String str, View view) {
        Context context = this.bridgeComponents.getContext();
        View findViewById = view.findViewById(R.id.main_label_layout);
        GradientDrawable gradientDrawable = (GradientDrawable) context.getResources().getDrawable(context.getResources().getIdentifier("ic_grey_border", "drawable", context.getPackageName()));
        gradientDrawable.setColor(Color.parseColor(str));
        findViewById.setBackground(gradientDrawable);
    }

    private void setMarkerPointerImage(String str, Boolean bool, MarkerType markerType, View view, MarkerConfig markerConfig) {
        Context context = this.bridgeComponents.getContext();
        float f = markerConfig.rotation;
        int i = markerConfig.markerIconSize;
        ImageView imageView = (ImageView) view.findViewById(R.id.pointer_img);
        imageView.setRotation(f);
        if (str != null) {
            imageView.setImageDrawable(context.getResources().getDrawable(context.getResources().getIdentifier(str, "drawable", context.getPackageName())));
        }
        if (bool.booleanValue()) {
            imageView.setVisibility(4);
        }
        if (markerType.equals(MarkerType.SPECIAL_ZONE_MARKER)) {
            ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
            layoutParams.height = 55;
            layoutParams.width = 55;
            imageView.setLayoutParams(layoutParams);
            return;
        }
        if ((markerType.equals(MarkerType.STOP_ICON_MARKER) || markerType.equals(MarkerType.NORMAL_MARKER_V2)) && i != 0) {
            ViewGroup.LayoutParams layoutParams2 = imageView.getLayoutParams();
            layoutParams2.height = i;
            layoutParams2.width = i;
            imageView.setLayoutParams(layoutParams2);
            return;
        }
        if (str == null || !str.equals(CURRENT_LOCATION)) {
            return;
        }
        ViewGroup.LayoutParams layoutParams3 = imageView.getLayoutParams();
        layoutParams3.height = 160;
        layoutParams3.width = 160;
        imageView.setImportantForAccessibility(2);
        if (Build.VERSION.SDK_INT >= 28) {
            imageView.setAccessibilityHeading(false);
        }
        imageView.setLayoutParams(layoutParams3);
    }

    private void setMarkerText(String str, View view, MarkerConfig markerConfig) {
        try {
            View findViewById = view.findViewById(R.id.zone_image_and_text);
            View findViewById2 = findViewById.findViewById(R.id.label_texts);
            String str2 = markerConfig.primaryText;
            String str3 = markerConfig.shortTitle;
            String str4 = markerConfig.secondaryText;
            androidx.appcompat.widget.B b = (CustomTextView) findViewById2.findViewById(R.id.primary_marker_text);
            androidx.appcompat.widget.B b2 = (CustomTextView) findViewById2.findViewById(R.id.secondary_marker_text);
            if (str2.equals("")) {
                findViewById.setVisibility(8);
            } else {
                if (str3 == null || str3.equals("")) {
                    str3 = str2;
                }
                b.setText(str3);
                int i = markerConfig.labelMaxWidth;
                if (i != 0) {
                    b.setMaxWidth(i);
                }
                if (str4.equals("")) {
                    b.setMaxLines(markerConfig.labelMaxLines);
                }
                b.setTextSize(1, markerConfig.labelTextSize);
                b.setImportantForAccessibility(1);
                b.setContentDescription(str2);
                b.setTextColor(Color.parseColor(str));
            }
            if (str4.equals("")) {
                ViewGroup.LayoutParams layoutParams = findViewById2.getLayoutParams();
                layoutParams.height = -1;
                layoutParams.width = -1;
                findViewById2.setLayoutParams(layoutParams);
                ViewGroup.LayoutParams layoutParams2 = b.getLayoutParams();
                layoutParams2.height = -1;
                layoutParams2.width = -1;
                b.setLayoutParams(layoutParams2);
                return;
            }
            b2.setText(str4);
            b2.setImportantForAccessibility(1);
            b2.setContentDescription(str4);
            b2.setVisibility(0);
            int i2 = markerConfig.labelMaxWidth;
            if (i2 != 0) {
                b2.setMaxWidth(i2);
            }
            b2.setTextColor(Color.parseColor(str));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void setMarkerlabelImage(MarkerImageConfig markerImageConfig, View view) {
        ImageView imageView;
        try {
            Context context = this.bridgeComponents.getContext();
            if (markerImageConfig == null || markerImageConfig.image.equals("") || (imageView = (ImageView) view.findViewById(R.id.zone_image)) == null) {
                return;
            }
            imageView.setVisibility(0);
            imageView.setImageDrawable((BitmapDrawable) context.getResources().getDrawable(context.getResources().getIdentifier(markerImageConfig.image, "drawable", this.bridgeComponents.getContext().getPackageName())));
            imageView.setLayoutParams(new LinearLayout.LayoutParams((int) TypedValue.applyDimension(1, markerImageConfig.width, context.getResources().getDisplayMetrics()), (int) TypedValue.applyDimension(1, markerImageConfig.height, context.getResources().getDisplayMetrics())));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void showLocationOnMap(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$showLocationOnMap$2(str);
            }
        });
    }

    @JavascriptInterface
    public void addGroundOverlay(final String str) {
        ExecutorManager.runOnBackgroundThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$addGroundOverlay$36(str);
            }
        });
    }

    public void addMediaFile(String str, String str2, String str3, String str4, String str5, String str6) {
        addMediaFile(str, str2, str3, str4, str5, str6, false);
    }

    public void addMediaPlayer(String str, String str2) {
        addMediaPlayer(str, str2, false);
    }

    @JavascriptInterface
    public void addRippleCircle(final String str) {
        ExecutorManager.runOnBackgroundThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$addRippleCircle$31(str);
            }
        });
    }

    public void addZoneMarker(double d, double d2, String str, String str2) {
        addZoneMarker(d, d2, str, str2, new MarkerConfig());
    }

    @JavascriptInterface
    public void adjustViewWithKeyboard(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$adjustViewWithKeyboard$74(str);
            }
        });
    }

    @JavascriptInterface
    public void animateCamera(final double d, final double d2, final float f, final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$animateCamera$18(d, d2, str, f);
            }
        });
    }

    public void animateCameraV2(final double d, final double d2, final float f, final String str, final String str2) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$animateCameraV2$20(str2, d, d2, str, f);
            }
        });
    }

    @JavascriptInterface
    public void animateRippleCircle(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$animateRippleCircle$32(str);
            }
        });
    }

    protected float bearingBetweenLocations(LatLng latLng, LatLng latLng2) {
        double d = (latLng.a * 3.14159d) / 180.0d;
        double d2 = (latLng.b * 3.14159d) / 180.0d;
        double d3 = (latLng2.a * 3.14159d) / 180.0d;
        double d4 = ((latLng2.b * 3.14159d) / 180.0d) - d2;
        return (float) ((Math.toDegrees(Math.atan2(Math.sin(d4) * Math.cos(d3), (Math.cos(d) * Math.sin(d3)) - ((Math.sin(d) * Math.cos(d3)) * Math.cos(d4)))) + 360.0d) % 360.0d);
    }

    public void callImageUploadCallBack(String str, String str2, String str3) {
        this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s','%s');", this.storeImageUploadCallBack, str, str2, str3));
    }

    public void callPickContactCallBack(String str, String str2) {
        this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s');", this.storePickContactCallBack, str, str2));
    }

    public void callUploadMultiPartCallBack(String str, String str2) {
        this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s');", this.storeUploadMultiPartCallBack, str, str2));
    }

    public void changePolygonFocus(String str) {
        C1291d c1291d = this.layer;
        if (c1291d == null || this.locateOnMapManager == null) {
            return;
        }
        Iterable<C1289b> d = c1291d.d();
        C1289b c1289b = this.locateOnMapManager.focusedGeoJsonFeature;
        if (c1289b != null) {
            if (c1289b.d("name").equals(str)) {
                return;
            } else {
                removePolygonFocus(c1289b);
            }
        }
        for (C1289b c1289b2 : d) {
            if (c1289b2.d("name").equals(str)) {
                this.locateOnMapManager.setFocusedGeoJsonFeature(c1289b2);
                wa.n nVar = new wa.n();
                nVar.t(3.0f);
                nVar.q(Color.argb(75, 22, 150, 46));
                nVar.r(Color.argb(100, 22, 150, 46));
                c1289b2.p(nVar);
                return;
            }
        }
    }

    @JavascriptInterface
    public void checkAndAskMicrophonePermission() {
        if (androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.RECORD_AUDIO") != 0) {
            try {
                if (this.bridgeComponents.getActivity() != null) {
                    androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.RECORD_AUDIO"}, 9);
                }
            } catch (Exception e) {
                Log.e("MICROPHONE", "Exception in request microphone permission", e);
            }
        }
    }

    @JavascriptInterface
    public void checkAndAskNotificationPermission() {
        if (Build.VERSION.SDK_INT < 33 || androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.POST_NOTIFICATIONS") == 0) {
            return;
        }
        try {
            if (this.bridgeComponents.getActivity() != null) {
                androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.POST_NOTIFICATIONS"}, 10);
            }
        } catch (Exception e) {
            Log.e(this.NOTIFICATION, "Exception in request notification permission", e);
        }
    }

    protected boolean checkAndAskStoragePermission() {
        if (Build.VERSION.SDK_INT >= 30 || ((this.bridgeComponents.getActivity() == null || androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.READ_EXTERNAL_STORAGE") == 0) && androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.WRITE_EXTERNAL_STORAGE") == 0)) {
            return true;
        }
        androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, STORAGE_PERMISSION);
        return false;
    }

    public File checkAndGetFileName(String str) {
        File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), str + ".pdf");
        int i = 1;
        while (file.exists()) {
            JuspayLogger.d(this.UTILS, "file already exists " + file.getName());
            i++;
            file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), str + "_(" + i + ").pdf");
        }
        JuspayLogger.d(this.UTILS, "final File name " + file.getName());
        return file;
    }

    @JavascriptInterface
    public boolean checkIfPointInsidePolygon(String str, double d, double d2) {
        return pointInsidePolygon(getPolygonCoordinates(str), Double.valueOf(d), Double.valueOf(d2)).booleanValue();
    }

    @JavascriptInterface
    public void clearAudioPlayer() {
        android.media.MediaPlayer mediaPlayer = this.audioPlayer;
        if (mediaPlayer != null) {
            mediaPlayer.stop();
            this.audioPlayer = null;
        }
    }

    @JavascriptInterface
    public void clearFocus(final String str) {
        if (this.bridgeComponents.getActivity() != null) {
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$clearFocus$75(str);
                }
            });
        }
    }

    @JavascriptInterface
    public void clearMap() {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$clearMap$40();
            }
        });
        this.circleRipples.clear();
        this.groundOverlays.clear();
    }

    @JavascriptInterface
    public void clearStorageFile(String str) {
        this.bridgeComponents.getContext().getSharedPreferences(str, 0).edit().clear().apply();
    }

    @JavascriptInterface
    public void closeApp() {
        if (this.bridgeComponents.getActivity() != null) {
            this.bridgeComponents.getActivity().finish();
        }
    }

    protected Bitmap constructBitmap(int i, String str) {
        Bitmap bitmap = ((BitmapDrawable) this.bridgeComponents.getContext().getResources().getDrawable(this.bridgeComponents.getContext().getResources().getIdentifier(str, "drawable", this.bridgeComponents.getContext().getPackageName()))).getBitmap();
        float max = i / Math.max(bitmap.getWidth(), bitmap.getHeight());
        int round = Math.round(bitmap.getWidth() * max);
        int round2 = Math.round(bitmap.getHeight() * max);
        Log.i(this.MAPS, "real width and height of " + str + bitmap.getWidth() + " , " + bitmap.getHeight());
        Log.i(this.MAPS, "after width and height of " + str + round + " , " + round2);
        return Bitmap.createScaledBitmap(bitmap, round, round2, false);
    }

    @JavascriptInterface
    public void contactPermission() {
        if (androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.READ_CONTACTS") == 0) {
            ExecutorManager.runOnBackgroundThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$contactPermission$82();
                }
            });
        } else if (this.bridgeComponents.getActivity() != null) {
            androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.READ_CONTACTS"}, 7);
        }
    }

    public void contactsStoreCall(String str) {
        if (storeContactsCallBack != null) {
            this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", storeContactsCallBack, str.replace("\\\"", "\\\\\"").replace("'", "")));
        }
    }

    @JavascriptInterface
    public String convertAudioToBase64(String str) throws IOException {
        File file = new File(str);
        FileInputStream fileInputStream = new FileInputStream(file);
        try {
            byte[] bArr = new byte[(int) file.length()];
            fileInputStream.read(bArr);
            String encodeToString = Base64.encodeToString(bArr, 0);
            fileInputStream.close();
            return encodeToString;
        } catch (Throwable th) {
            try {
                fileInputStream.close();
            } catch (Throwable th2) {
                th.addSuppressed(th2);
            }
            throw th;
        }
    }

    @JavascriptInterface
    public void copyToClipboard(String str) {
        if (this.bridgeComponents.getActivity() != null) {
            ((ClipboardManager) this.bridgeComponents.getActivity().getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("Text", str));
        }
    }

    @JavascriptInterface
    public void currentPosition(String str) {
        Log.i(this.LOCATION, "Fetching Current Position");
        showLocationOnMap(str);
    }

    @JavascriptInterface
    public void datePicker(String str, String str2) {
        datePicker(str, str2, null);
    }

    @JavascriptInterface
    public void displayBase64Image(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            String optString = jSONObject.optString("source", "");
            final String optString2 = jSONObject.optString("id", "");
            final String optString3 = jSONObject.optString("scaleType", "CENTER_CROP");
            final int optInt = jSONObject.optInt("inSampleSize", 1);
            final boolean optBoolean = jSONObject.optBoolean("adjustViewBounds", true);
            if (optString.startsWith("http")) {
                optString = MobilityCallAPI.getInstance(this.bridgeComponents.getContext()).callAPI(optString, MobilityCallAPI.getBaseHeaders(this.bridgeComponents.getContext()), (String) null, "GET", Boolean.FALSE).getResponseBody();
            }
            final String str2 = optString;
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$displayBase64Image$78(str2, optString2, optInt, optString3, optBoolean);
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    protected void dottedLineFromCurrentPosition(String str, Double d, Double d2, Boolean bool, Double d3, String str2, String str3) {
        PolylineDataPoints polyLineDataByMapInstance = getPolyLineDataByMapInstance(str3, str);
        if (this.googleMap == null || !bool.booleanValue()) {
            return;
        }
        if (polyLineDataByMapInstance != null) {
            polyLineDataByMapInstance.polyline.c();
            polyLineDataByMapInstance.setPolyline(null);
            setPolyLineDataByMapInstance(str3, str, polyLineDataByMapInstance);
        }
        if (AbstractC1190e.b(this.googleMap.j().a, new LatLng(this.lastLatitudeValue, this.lastLongitudeValue)) < d3.doubleValue()) {
            drawDottedLine(str, Double.valueOf(this.googleMap.j().a.a), Double.valueOf(this.googleMap.j().a.b), Double.valueOf(this.lastLatitudeValue), Double.valueOf(this.lastLongitudeValue), str2, str3);
        }
    }

    @JavascriptInterface
    public void downloadLayoutAsImage(String str) {
        this.downloadLayout = str;
        if (this.bridgeComponents.getActivity() == null || !checkAndAskStoragePermission()) {
            return;
        }
        Context context = this.bridgeComponents.getContext();
        Activity activity = this.bridgeComponents.getActivity();
        View findViewById = activity.findViewById(Integer.parseInt(str));
        Bitmap createBitmap = Bitmap.createBitmap(findViewById.getWidth(), findViewById.getHeight(), Bitmap.Config.ARGB_8888);
        findViewById.draw(new Canvas(createBitmap));
        File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "QR.png");
        Uri h = FileProvider.h(context, context.getPackageName() + ".provider", file);
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(file);
            createBitmap.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
            fileOutputStream.close();
            this.downloadLayout = null;
            showNotificationWithURI(h, activity.getString(R.string.qr_downloaded), context.getString(R.string.qr_for_your_vpa_is_downloaded), ClipboardModule.MIMETYPE_PNG, "QR", "QR Download");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @JavascriptInterface
    public void drawCircleOnMap(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            updateRippleCircleWithId(jSONObject.optString("circleId", ""), setCircleConfigFromJSON(jSONObject, jSONObject.optBoolean("showPrimaryStrokeColor", true)), new LatLng(jSONObject.optDouble("centerLat", 0.0d), jSONObject.optDouble("centerLon", 0.0d)));
        } catch (JSONException e) {
            Log.i(this.MAPS, "drawCircleOnMap error for ", e);
        }
    }

    @JavascriptInterface
    public void drawPolygon(final String str, final JSONArray jSONArray, final JSONObject jSONObject) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$drawPolygon$10(jSONObject, str, jSONArray);
            }
        });
    }

    @JavascriptInterface
    public void drawRoute(final String str, final String str2, final String str3, final boolean z, final String str4, final String str5, final int i, final String str6, final String str7) {
        onMapUpdate(null, null);
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$drawRoute$44(str3, str, str7, str4, str5, z, str2, i, str6);
            }
        });
    }

    @JavascriptInterface
    public void drawRouteV2(final String str) {
        onMapUpdate(null, null);
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$drawRouteV2$43(str);
            }
        });
    }

    @JavascriptInterface
    public void emptyCallbackQueue() {
        while (!this.callbackQueue.isEmpty()) {
            if (this.bridgeComponents.getJsCallback() != null) {
                this.bridgeComponents.getJsCallback().addJsToWebView(this.callbackQueue.poll());
            }
        }
    }

    @JavascriptInterface
    public void enableMyLocation(final boolean z) {
        try {
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$enableMyLocation$28(z);
                }
            });
        } catch (Exception e) {
            Log.i(this.MAPS, "Enable My Location on GoogleMap error", e);
        }
    }

    @JavascriptInterface
    public void encodeToBase64(final String str, final String str2) {
        ExecutorManager.runOnBackgroundThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$encodeToBase64$77(str, str2);
            }
        });
    }

    @JavascriptInterface
    public void exitLocateOnMap(String str) {
        try {
            this.locateOnMapManager = null;
            this.storeLocateOnMapCallBack = null;
            editLocation = Boolean.FALSE;
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$exitLocateOnMap$12();
                }
            });
        } catch (Exception e) {
            Log.i(this.MAPS, "LocateOnMap Exit Error for ", e);
        }
    }

    @JavascriptInterface
    public void fadeInFadeOutMarker(final AnimationType animationType, final String str, final int i) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$fadeInFadeOutMarker$23(str, animationType, i);
            }
        });
    }

    @JavascriptInterface
    public String fetchFilesFromFolderPath(String str) {
        File[] filesInFolderPath = FileUtils.getFilesInFolderPath(str);
        String[] strArr = filesInFolderPath != null ? new String[filesInFolderPath.length] : new String[0];
        for (int i = 0; i < filesInFolderPath.length; i++) {
            strArr[i] = filesInFolderPath[i].getAbsolutePath();
        }
        return Arrays.toString(strArr);
    }

    @JavascriptInterface
    public String fetchPackageName() {
        return this.bridgeComponents.getContext().getPackageName();
    }

    @JavascriptInterface
    public String getAndroidId() {
        String androidId = DeviceIdentifier.getAndroidId(this.bridgeComponents.getContext());
        return DeviceIdentifier.isValid(androidId) ? androidId : "NO_ANDROID_ID";
    }

    public AnimationType getAnimationType(String str) {
        str.hashCode();
        switch (str) {
            case "FADE_IN":
                return AnimationType.FADE_IN;
            case "NONE":
                return AnimationType.NONE;
            case "FADE_OUT":
                return AnimationType.FADE_OUT;
            default:
                return AnimationType.NONE;
        }
    }

    @JavascriptInterface
    public String getCoordinateFromAddress(String str) {
        GeoCoderHelper.GeoCoordinate geoCoordinateFromAddress = new GeoCoderHelper(this.bridgeComponents.getContext()).getGeoCoordinateFromAddress(str);
        if (geoCoordinateFromAddress == null) {
            return "NO_COORDINATE_FOUND";
        }
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("latitude", geoCoordinateFromAddress.getLatitude());
            jSONObject.put("longitude", geoCoordinateFromAddress.getLongitude());
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return jSONObject.toString();
    }

    @JavascriptInterface
    public String getCurrentLatLong() throws JSONException {
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("lat", this.lastLatitudeValue);
        jSONObject.put("lng", this.lastLongitudeValue);
        Location location = this.lastKnownLocation;
        if (location != null) {
            jSONObject.put("ts", Utils.getUTCTimeStampFromMills(location.getTime()));
        }
        return jSONObject.toString();
    }

    @JavascriptInterface
    public void getCurrentPosition(String str) {
        getCurrentPosition(str, true);
    }

    @JavascriptInterface
    public String getDeviceID() {
        return new DeviceIdentifier().getDeviceId(this.bridgeComponents.getContext());
    }

    @JavascriptInterface
    public String getExtendedPath(String str) throws JSONException {
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        JSONArray jSONArray = new JSONObject(str).getJSONArray("points");
        if (jSONArray.length() <= 1) {
            return str;
        }
        int parseInt = Integer.parseInt(getKeysInSharedPref("POINTS_FACTOR"));
        for (int length = jSONArray.length() - 1; length >= 0; length--) {
            JSONObject jSONObject = (JSONObject) jSONArray.get(length);
            arrayList.add(new LatLng(jSONObject.getDouble("lat"), jSONObject.getDouble("lng")));
        }
        int i = 0;
        for (int i2 = 1; i < arrayList.size() - 1 && i2 <= arrayList.size() - 1; i2++) {
            LatLng latLng = (LatLng) arrayList.get(i);
            LatLng latLng2 = (LatLng) arrayList.get(i2);
            arrayList2.add(latLng);
            int ceil = (int) Math.ceil(AbstractC1190e.b(latLng, latLng2) / parseInt);
            float f = 1.0f / (ceil + 1);
            for (int i3 = 1; i3 <= ceil; i3++) {
                arrayList2.add(getNewLatLng(i3 * f, latLng, latLng2));
            }
            i++;
        }
        arrayList2.add((LatLng) arrayList.get(arrayList.size() - 1));
        JSONObject jSONObject2 = new JSONObject();
        JSONArray jSONArray2 = new JSONArray();
        for (int size = arrayList2.size() - 1; size >= 0; size--) {
            LatLng latLng3 = (LatLng) arrayList2.get(size);
            JSONObject jSONObject3 = new JSONObject();
            jSONObject3.put("lat", latLng3.a);
            jSONObject3.put("lng", latLng3.b);
            jSONArray2.put(jSONObject3);
        }
        jSONObject2.put("points", jSONArray2);
        return jSONObject2.toString();
    }

    @JavascriptInterface
    public String getKeyInNativeSharedPrefKeys(String str) {
        return getKeysInSharedPref(str);
    }

    @JavascriptInterface
    public String getKeysInSharedPref(String str) {
        return this.sharedPref.getString(str, "__failed");
    }

    @JavascriptInterface
    public String getLayoutBounds(String str) throws JSONException {
        int i;
        int i2;
        View findViewById;
        Activity activity = this.bridgeComponents.getActivity();
        if (activity == null || (findViewById = activity.findViewById(Integer.parseInt(str))) == null) {
            i = 0;
            i2 = 0;
        } else {
            i = findViewById.getHeight();
            i2 = findViewById.getWidth();
        }
        JSONObject jSONObject = new JSONObject();
        jSONObject.put(Snapshot.HEIGHT, pxToDp(i));
        jSONObject.put(Snapshot.WIDTH, pxToDp(i2));
        return jSONObject.toString();
    }

    @JavascriptInterface
    public void getLocationName(String str, String str2, String str3, String str4) {
        StringBuilder sb2;
        if (isLocationPermissionEnabled()) {
            updateLastKnownLocation(null, false, ZoomType.ZOOM, true);
            if (str3.equals(CURRENT_LOCATION_LATLON)) {
                str = String.valueOf(this.lastLatitudeValue);
                str2 = String.valueOf(this.lastLongitudeValue);
            }
            try {
                List<Address> fromLocation = new Geocoder(this.bridgeComponents.getActivity(), Locale.getDefault()).getFromLocation(Double.parseDouble(str), Double.parseDouble(str2), 1);
                if (fromLocation == null || fromLocation.size() <= 0) {
                    StringBuilder sb3 = new StringBuilder(str3);
                    Log.e(this.MAPS, "Can't fetch current Address");
                    sb2 = sb3;
                } else {
                    sb2 = new StringBuilder();
                    Address address = fromLocation.get(0);
                    for (int i = 0; i <= address.getMaxAddressLineIndex(); i++) {
                        sb2.append(address.getAddressLine(i));
                        sb2.append(",");
                    }
                    StringBuilder sb4 = new StringBuilder();
                    sb4.append("getLocationName:");
                    sb4.append((Object) sb2);
                }
                if (str4 != null) {
                    String format = String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s','%s');", str4, str, str2, String.valueOf(sb2).replaceAll("'", ""));
                    StringBuilder sb5 = new StringBuilder();
                    sb5.append("getCurrent___Position___inside if");
                    sb5.append(str);
                    sb5.append(str2);
                    this.bridgeComponents.getJsCallback().addJsToWebView(format);
                }
            } catch (Exception e) {
                Log.e(this.MAPS, "Exception occurred in getting Location Name " + e.getMessage());
                e.printStackTrace();
            }
        }
    }

    @JavascriptInterface
    public String getLocationNameSDK(double d, double d2) {
        return new GeoCoderHelper(this.bridgeComponents.getContext()).getLocName(d, d2);
    }

    @JavascriptInterface
    public String getLocationPermissionStatus() {
        return (this.bridgeComponents.getActivity() == null || androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.ACCESS_FINE_LOCATION") != -1) ? "ENABLED" : androidx.core.app.b.j(this.bridgeComponents.getActivity(), "android.permission.ACCESS_FINE_LOCATION") ? "DISABLED" : "DENIED";
    }

    public MapRemoteConfig getMapRemoteConfig() {
        try {
            if (this.mapRemoteConfig == null) {
                this.mapRemoteConfig = new MapRemoteConfig();
                this.mapRemoteConfig.fromJson(getKeyInNativeSharedPrefKeys("MAP_REMOTE_CONFIG"));
            }
        } catch (Exception e) {
            Log.e(this.LOG_TAG, "Error in getMapRemoteConfig", e);
        }
        return this.mapRemoteConfig;
    }

    protected Bitmap getMarkerBitmapFromView(String str, boolean z, MarkerType markerType, MarkerConfig markerConfig) {
        Context context = this.bridgeComponents.getContext();
        Theme theme = markerConfig.theme;
        Theme theme2 = Theme.DARK;
        String str2 = theme.equals(theme2) ? "#FFFFFF" : "#454545";
        String str3 = markerConfig.theme.equals(theme2) ? "#454545" : "#FFFFFF";
        View inflate = ((LayoutInflater) context.getSystemService("layout_inflater")).inflate(context.getResources().getLayout(context.getResources().getIdentifier("marker_label_layout", "layout", context.getPackageName())), (ViewGroup) null);
        try {
            setMarkerBackground(str3, inflate);
            setMarkerText(str2, inflate, markerConfig);
            setMarkerlabelImage(markerConfig.labelImage, inflate);
            setMarkerPointerImage(str, Boolean.valueOf(z), markerType, inflate, markerConfig);
            setMarkerActionImage(markerConfig.markerActionImage, markerConfig.primaryText, inflate);
            setLabelImageAction(inflate, markerConfig.labelActionImage);
        } catch (Exception e) {
            Log.e("getMarkerBitmapFromView", "Exception in rendering Image" + e);
        }
        LinearLayout linearLayout = (LinearLayout) inflate.findViewById(R.id.main_label_layout);
        if (linearLayout != null && !markerConfig.labelActionImage.image.equals("")) {
            linearLayout.setPadding(linearLayout.getPaddingLeft(), linearLayout.getPaddingTop(), 2, linearLayout.getPaddingBottom());
        }
        inflate.measure(0, 0);
        inflate.layout(0, 0, inflate.getMeasuredWidth(), inflate.getMeasuredHeight());
        inflate.buildDrawingCache();
        Bitmap createBitmap = Bitmap.createBitmap(inflate.getMeasuredWidth(), inflate.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(createBitmap);
        canvas.drawColor(-1, PorterDuff.Mode.SRC_IN);
        Drawable background = inflate.getBackground();
        if (background != null) {
            background.draw(canvas);
        }
        inflate.draw(canvas);
        return createBitmap;
    }

    public MarkerConfig getMarkerConfigWithIdAndName(String str, String str2) {
        MarkerConfig markerConfig = new MarkerConfig();
        markerConfig.setMarkerId(str2);
        markerConfig.setPointer(str);
        return markerConfig;
    }

    protected Bitmap getMarkerForBusRouteId(String str) {
        Context context = this.bridgeComponents.getContext();
        View inflate = LayoutInflater.from(context).inflate(context.getResources().getIdentifier("marker_code_layout", "layout", context.getPackageName()), (ViewGroup) null);
        TextView textView = (TextView) inflate.findViewById(R.id.bus_marker_route_id);
        if (textView != null) {
            textView.setText(str);
        }
        inflate.measure(View.MeasureSpec.makeMeasureSpec(0, 0), View.MeasureSpec.makeMeasureSpec(0, 0));
        inflate.layout(0, 0, inflate.getMeasuredWidth(), inflate.getMeasuredHeight());
        Bitmap createBitmap = Bitmap.createBitmap(inflate.getMeasuredWidth(), inflate.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(createBitmap);
        Drawable background = inflate.getBackground();
        if (background != null) {
            background.draw(canvas);
        }
        inflate.draw(canvas);
        return createBitmap;
    }

    public JSONObject getNearestPoint(double d, double d2, JSONArray jSONArray) throws JSONException {
        JSONObject jSONObject = new JSONObject();
        Location location = new Location("point A");
        location.setLatitude(d);
        location.setLongitude(d2);
        Location location2 = new Location("final point");
        double d3 = 1.0E10d;
        for (int i = 0; i < jSONArray.length(); i++) {
            JSONObject jSONObject2 = jSONArray.getJSONObject(i);
            double doubleValue = ((Double) jSONObject2.get("lat")).doubleValue();
            double doubleValue2 = ((Double) jSONObject2.get("lng")).doubleValue();
            Location location3 = new Location("point B");
            location3.setLatitude(doubleValue);
            location3.setLongitude(doubleValue2);
            double distanceTo = location.distanceTo(location3);
            if (distanceTo < d3) {
                this.zoneName = jSONObject2.has("place") ? jSONObject2.getString("place") : "";
                location2 = location3;
                d3 = distanceTo;
            }
        }
        return jSONObject.put("place", this.zoneName).put("lat", location2.getLatitude()).put("long", location2.getLongitude()).put("distance", d3);
    }

    public String getPhoneContacts() throws JSONException {
        ContentResolver contentResolver = this.bridgeComponents.getContext().getContentResolver();
        Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
        JSONArray jSONArray = new JSONArray();
        Cursor query = contentResolver.query(uri, new String[]{"data1", "display_name"}, "in_visible_group = '1'", null, "display_name COLLATE LOCALIZED ASC");
        try {
            if (query.getCount() > 0) {
                while (query.moveToNext()) {
                    String string = query.getString(query.getColumnIndexOrThrow("display_name"));
                    String string2 = query.getString(query.getColumnIndexOrThrow("data1"));
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("name", string);
                    jSONObject.put("number", string2);
                    jSONArray.put(jSONObject);
                }
            }
            query.close();
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("name", "beckn_contacts_flag");
            jSONObject2.put("number", "true");
            jSONArray.put(jSONObject2);
            return jSONArray.toString();
        } catch (Throwable th) {
            if (query != null) {
                try {
                    query.close();
                } catch (Throwable th2) {
                    th.addSuppressed(th2);
                }
            }
            throw th;
        }
    }

    public H7.j getPolyLine(Boolean bool, PolylineDataPoints polylineDataPoints) {
        if (polylineDataPoints != null) {
            return bool.booleanValue() ? polylineDataPoints.overlayPolylines : polylineDataPoints.polyline;
        }
        return null;
    }

    public PolylineDataPoints getPolyLineDataByMapInstance(String str, String str2) {
        Hashtable<String, PolylineDataPoints> hashtable = this.polylinesByMapInstance.get(str);
        if (hashtable != null) {
            return hashtable.get(str2);
        }
        return null;
    }

    public PolyLineAnimationTimers getPolyLineTimer(String str, String str2) {
        Hashtable<String, Hashtable<String, PolyLineAnimationTimers>> hashtable = this.polylineAnimationTimers;
        Hashtable<String, PolyLineAnimationTimers> hashtable2 = hashtable != null ? hashtable.get(str) : null;
        return hashtable2 != null ? hashtable2.get(str2) : new PolyLineAnimationTimers();
    }

    public ImageView.ScaleType getScaleTypes(String str) {
        str.hashCode();
        switch (str) {
            case "MATRIX":
                return ImageView.ScaleType.MATRIX;
            case "CENTER_CROP":
                return ImageView.ScaleType.CENTER_CROP;
            case "FIT_END":
                return ImageView.ScaleType.FIT_END;
            case "FIT_START":
                return ImageView.ScaleType.FIT_START;
            case "CENTER_INSIDE":
                return ImageView.ScaleType.CENTER_INSIDE;
            case "CENTER":
                return ImageView.ScaleType.CENTER;
            case "FIT_XY":
                return ImageView.ScaleType.FIT_XY;
            default:
                return ImageView.ScaleType.FIT_CENTER;
        }
    }

    @JavascriptInterface
    public int getVersionCode() {
        PackageManager packageManager = this.bridgeComponents.getContext().getPackageManager();
        PackageInfo packageInfo = new PackageInfo();
        try {
            packageInfo = packageManager.getPackageInfo(this.bridgeComponents.getContext().getPackageName(), 1);
        } catch (PackageManager.NameNotFoundException e) {
            Log.e(this.OTHERS, "Exception in get version code" + e);
        }
        return packageInfo.versionCode;
    }

    @JavascriptInterface
    public String getVersionName() {
        PackageManager packageManager = this.bridgeComponents.getContext().getPackageManager();
        PackageInfo packageInfo = new PackageInfo();
        try {
            packageInfo = packageManager.getPackageInfo(this.bridgeComponents.getContext().getPackageName(), 1);
        } catch (PackageManager.NameNotFoundException e) {
            Log.e(this.OTHERS, "Exception in get version name" + e);
        }
        return packageInfo.versionName;
    }

    @JavascriptInterface
    public void goBackPrevWebPage(String str) {
        if (this.bridgeComponents.getActivity() != null) {
            final WebView webView = (WebView) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(str));
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$goBackPrevWebPage$68(webView);
                }
            });
        }
    }

    public void handleEditPickupMarkerListener(String str, double d, LatLng latLng, ImageView imageView, JSONObject jSONObject) {
        removeMarker("ny_ic_src_marker");
        removeMarker("ny_ic_dest_marker");
        String optString = jSONObject.optString("primaryStrokeColor", "#00FFFFFF");
        String optString2 = jSONObject.optString("secondaryStrokeColor", "#00FFFFFF");
        String optString3 = jSONObject.optString("circleId", "");
        if (d < this.editPickupThreshold) {
            CircleRippleEffectOptions circleRippleEffectOptions = new CircleRippleEffectOptions();
            circleRippleEffectOptions.fromStrokeColor(optString);
            circleRippleEffectOptions.radius(this.editPickupThreshold);
            updateRippleCircleWithId(optString3, circleRippleEffectOptions, latLng);
            return;
        }
        CircleRippleEffectOptions circleRippleEffectOptions2 = new CircleRippleEffectOptions();
        circleRippleEffectOptions2.fromStrokeColor(optString2);
        circleRippleEffectOptions2.radius(this.editPickupThreshold);
        updateRippleCircleWithId(optString3, circleRippleEffectOptions2, latLng);
        if (imageView != null) {
            this.zoneName += LOCATION_IS_FAR;
            MarkerConfig markerConfig = new MarkerConfig();
            markerConfig.locationName(this.bridgeComponents.getContext().getString(R.string.location_is_too_far), "");
            imageView.setImageBitmap(getMarkerBitmapFromView(null, true, MarkerType.NORMAL_MARKER, markerConfig));
            imageView.setVisibility(0);
        }
    }

    @JavascriptInterface
    public void hideKeyboardOnNavigation(boolean z) {
        if (this.bridgeComponents.getActivity() != null) {
            View currentFocus = this.bridgeComponents.getActivity().getCurrentFocus();
            if (currentFocus == null) {
                currentFocus = new View(this.bridgeComponents.getActivity());
            }
            ((InputMethodManager) this.bridgeComponents.getContext().getSystemService("input_method")).hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
        }
    }

    @JavascriptInterface
    public void horizontalScrollToPos(String str, String str2, int i) {
        int i2;
        int i3;
        if (this.bridgeComponents.getActivity() != null) {
            Activity activity = this.bridgeComponents.getActivity();
            HorizontalScrollView horizontalScrollView = (HorizontalScrollView) activity.findViewById(Integer.parseInt(str));
            View findViewById = activity.findViewById(Integer.parseInt(str2));
            if (findViewById != null) {
                i2 = findViewById.getLeft();
                i3 = findViewById.getTop();
            } else {
                i2 = 0;
                i3 = 0;
            }
            if (horizontalScrollView != null) {
                if (i2 == 0 && i3 == 0) {
                    horizontalScrollView.fullScroll(i);
                } else {
                    horizontalScrollView.scrollTo(i2, i3);
                }
            }
        }
    }

    @JavascriptInterface
    public void initialWebViewSetUp(String str, final String str2) {
        this.storeDashboardCallBack = str;
        final Context context = this.bridgeComponents.getContext();
        final Activity activity = this.bridgeComponents.getActivity();
        if (activity != null) {
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public void run() {
                    WebView webView = (WebView) activity.findViewById(Integer.parseInt(str2));
                    if (webView == null) {
                        return;
                    }
                    webView.setWebChromeClient(new WebChromeClient() {
                        @Override
                        public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
                            if (consoleMessage.message().contains("Write permission denied")) {
                                ((ClipboardManager) context.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("MyLbl", "https://nammayatri.in/link/rider/SJ8D"));
                            }
                            return super.onConsoleMessage(consoleMessage);
                        }
                    });
                    webView.setWebViewClient(new WebViewClient() {
                        @Override
                        public boolean shouldOverrideUrlLoading(WebView webView2, String str3) {
                            if (str3.startsWith("intent://")) {
                                try {
                                    Intent parseUri = Intent.parseUri(str3, 1);
                                    if (parseUri != null && context.getPackageManager().resolveActivity(parseUri, 65536) != null) {
                                        parseUri.addFlags(268435456);
                                        context.startActivity(parseUri);
                                        return true;
                                    }
                                } catch (URISyntaxException e) {
                                    e.printStackTrace();
                                }
                            }
                            if (!str3.startsWith("tg:") && !str3.startsWith("https://www.facebook.com") && !str3.startsWith("https://www.twitter.com/") && !str3.startsWith("https://www.linkedin.com") && !str3.startsWith("https://api.whatsapp.com") && !str3.contains("YATRI.pdf") && !str3.startsWith("https://telegram.me/")) {
                                return false;
                            }
                            try {
                                s.d a = new d.a().a();
                                a.a.setFlags(268435456);
                                a.a(context, Uri.parse(str3));
                                return true;
                            } catch (Exception unused) {
                                Toast.makeText(context, "Looks like there is no app or web browser installed on your device", 0).show();
                                return true;
                            }
                        }
                    });
                }
            });
        }
    }

    @JavascriptInterface
    public void initialiseShakeListener(final String str, String str2) {
        try {
            JSONObject jSONObject = new JSONObject(str2);
            SensorManager sensorManager = (SensorManager) this.bridgeComponents.getContext().getSystemService("sensor");
            this.sensorManager = sensorManager;
            Sensor defaultSensor = sensorManager.getDefaultSensor(1);
            this.accelerometer = defaultSensor;
            this.sensorManager.registerListener(this.shakeDetector, defaultSensor, 2);
            ShakeDetector shakeDetector = new ShakeDetector((float) jSONObject.optDouble("shakeAccelerationThreshold", 5.0d), jSONObject.optInt("consecutiveShakeInterval", 500), jSONObject.optInt("shakeCountResetTime", 3000));
            this.shakeDetector = shakeDetector;
            shakeDetector.setOnShakeListener(new ShakeDetector.OnShakeListener() {
                @Override
                public void onShake(int i) {
                    MobilityCommonBridge.this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str, Integer.valueOf(i)));
                }
            });
        } catch (Exception e) {
            Log.e(this.LOG_TAG, e.getMessage());
        }
    }

    @JavascriptInterface
    public void initiateLocationServiceClient() {
        setKeyboardVisibilityListener();
        if (isLocationPermissionEnabled()) {
            resolvableLocationSettingsReq();
        }
    }

    @JavascriptInterface
    public void initiatePP(String str) {
        PaymentPage paymentPage = new PaymentPage(this.bridgeComponents);
        this.paymentPage = paymentPage;
        paymentPage.initiate(str);
    }

    @JavascriptInterface
    public boolean isCirclePresent(String str) {
        return this.circleRipples.containsKey(str);
    }

    @JavascriptInterface
    public String isCoordOnPath(String str, double d, double d2, int i) throws JSONException {
        ArrayList arrayList;
        boolean z;
        LatLng latLng = new LatLng(d, d2);
        ArrayList arrayList2 = new ArrayList();
        JSONArray jSONArray = new JSONObject(str).getJSONArray("points");
        JSONObject jSONObject = new JSONObject();
        for (int length = jSONArray.length() - 1; length >= 0; length--) {
            JSONObject jSONObject2 = (JSONObject) jSONArray.get(length);
            arrayList2.add(new LatLng(jSONObject2.getDouble("lat"), jSONObject2.getDouble("lng")));
        }
        if (arrayList2.size() == 0) {
            jSONObject.put("points", new JSONArray());
            jSONObject.put("eta", 0);
            jSONObject.put("distance", 0);
            jSONObject.put("isInPath", false);
            return jSONObject.toString();
        }
        int c = AbstractC1187b.c(latLng, arrayList2, AbstractC1187b.a(arrayList2), true, Double.parseDouble(getKeysInSharedPref("ACCURACY_THRESHOLD").equals("__failed") ? "30.0" : getKeysInSharedPref("ACCURACY_THRESHOLD")));
        if (c == -1) {
            jSONObject.put("points", jSONArray);
            jSONObject.put("eta", 0);
            jSONObject.put("distance", 0);
            jSONObject.put("isInPath", false);
        } else {
            if (c == arrayList2.size() - 2) {
                arrayList = arrayList2;
                z = true;
            } else if (c == arrayList2.size() - 1) {
                z = true;
                arrayList = arrayList2;
            } else if (c == 0) {
                arrayList2.clear();
                jSONObject.put("points", new JSONArray());
                jSONObject.put("eta", 0);
                jSONObject.put("distance", 0);
                jSONObject.put("isInPath", true);
            } else {
                arrayList2.subList(c + 2, arrayList2.size()).clear();
                int d3 = (int) AbstractC1190e.d(arrayList2);
                int i2 = d3 / i;
                JSONArray jSONArray2 = new JSONArray();
                int size = arrayList2.size() - 1;
                while (size >= 0) {
                    LatLng latLng2 = (LatLng) arrayList2.get(size);
                    JSONObject jSONObject3 = new JSONObject();
                    jSONObject3.put("lat", latLng2.a);
                    jSONObject3.put("lng", latLng2.b);
                    jSONArray2.put(jSONObject3);
                    size--;
                    arrayList2 = arrayList2;
                }
                jSONObject.put("points", jSONArray2);
                jSONObject.put("eta", i2);
                jSONObject.put("distance", d3);
                jSONObject.put("isInPath", true);
            }
            int d4 = (int) AbstractC1190e.d(arrayList);
            jSONObject.put("points", jSONArray);
            jSONObject.put("eta", d4 / i);
            jSONObject.put("distance", d4);
            jSONObject.put("isInPath", z);
        }
        return jSONObject.toString();
    }

    @JavascriptInterface
    public boolean isFilePresentDeep(String str) {
        InputStream inputStream;
        Context context = this.bridgeComponents.getContext();
        int lastIndexOf = str.lastIndexOf(".");
        if (context.getResources().getIdentifier(lastIndexOf == -1 ? str : str.substring(0, lastIndexOf), "raw", context.getPackageName()) != 0) {
            return true;
        }
        try {
            inputStream = context.getAssets().open(str);
        } catch (Exception unused) {
            inputStream = null;
        }
        if (inputStream == null) {
            try {
                inputStream = context.getAssets().open("juspay/" + str);
            } catch (Exception unused2) {
            }
        }
        return inputStream != null;
    }

    @JavascriptInterface
    public boolean isInternetAvailable() {
        return ((ConnectivityManager) this.bridgeComponents.getContext().getSystemService("connectivity")).getActiveNetworkInfo() != null;
    }

    @JavascriptInterface
    public boolean isLocationEnabled() {
        LocationManager locationManager = (LocationManager) this.bridgeComponents.getContext().getSystemService("location");
        return locationManager != null && androidx.core.location.b.a(locationManager);
    }

    @JavascriptInterface
    public boolean isLocationPermissionEnabled() {
        return androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.ACCESS_FINE_LOCATION") == 0 && androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.ACCESS_COARSE_LOCATION") == 0;
    }

    @JavascriptInterface
    public boolean isMicrophonePermissionEnabled() {
        return androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.RECORD_AUDIO") == 0;
    }

    @JavascriptInterface
    public void isMockLocation(final String str) {
        com.google.android.gms.location.e eVar;
        Activity activity = this.bridgeComponents.getActivity();
        if (!isLocationPermissionEnabled() || (eVar = this.client) == null || activity == null) {
            return;
        }
        eVar.getLastLocation().addOnSuccessListener(activity, new OnSuccessListener() {
            public final void onSuccess(Object obj) {
                MobilityCommonBridge.this.lambda$isMockLocation$14(str, (Location) obj);
            }
        }).addOnFailureListener(activity, new OnFailureListener() {
            public final void onFailure(Exception exc) {
                MobilityCommonBridge.this.lambda$isMockLocation$15(str, exc);
            }
        });
    }

    @JavascriptInterface
    public boolean isNetworkAvailable() {
        ConnectivityManager connectivityManager = (ConnectivityManager) this.bridgeComponents.getContext().getSystemService("connectivity");
        NetworkInfo activeNetworkInfo = connectivityManager != null ? connectivityManager.getActiveNetworkInfo() : null;
        return activeNetworkInfo != null && activeNetworkInfo.isConnected();
    }

    @JavascriptInterface
    public boolean isNetworkTimeEnabled() {
        try {
            String string = Settings.Global.getString(this.bridgeComponents.getContext().getContentResolver(), "auto_time");
            if (string != null) {
                return string.equals("1");
            }
            return true;
        } catch (Exception e) {
            this.bridgeComponents.getTrackerInterface().trackAndLogException(this.LOG_TAG, LogCategory.ACTION, LogSubCategory.Action.USER, this.UTILS, "Exception in isNetworkTimeEnabled", e);
            return true;
        }
    }

    @JavascriptInterface
    public boolean isNotificationPermissionEnabled() {
        return Build.VERSION.SDK_INT < 33 || androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.POST_NOTIFICATIONS") == 0;
    }

    @JavascriptInterface
    public boolean isOverlayPresent(String str) {
        return this.groundOverlays.containsKey(str);
    }

    public boolean isPackageInstalled(String str) {
        PackageManager packageManager = this.bridgeComponents.getContext().getPackageManager();
        if (str != null && !str.isEmpty()) {
            try {
                packageManager.getPackageInfo(str, 0);
                return true;
            } catch (PackageManager.NameNotFoundException unused) {
            }
        }
        return false;
    }

    @JavascriptInterface
    public boolean isServiceRunning(String str) {
        for (ActivityManager.RunningServiceInfo runningServiceInfo : ((ActivityManager) this.bridgeComponents.getContext().getSystemService("activity")).getRunningServices(Integer.MAX_VALUE)) {
            Log.i("SERVICE", runningServiceInfo.service.getClassName());
            if (runningServiceInfo.service.getClassName().equals(str)) {
                return true;
            }
        }
        return false;
    }

    @JavascriptInterface
    public void loadFileInWebView(String str) {
        String readFromFile = this.filesCache.containsKey(str) ? this.filesCache.get(str) : this.bridgeComponents.getFileProviderInterface().readFromFile(this.bridgeComponents.getContext(), str);
        JsCallback jsCallback = this.bridgeComponents.getJsCallback();
        if (jsCallback == null || readFromFile == null) {
            return;
        }
        jsCallback.addJsToWebView(readFromFile);
    }

    @JavascriptInterface
    public void loaderText(final String str, final String str2) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$loaderText$64(str, str2);
            }
        });
    }

    @JavascriptInterface
    public void locateOnMap(final boolean z, final String str, final String str2, final float f, final JSONObject jSONObject) {
        try {
            System.out.println("Inside locateOnMap" + f);
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$locateOnMap$8(z, str, str2, f, jSONObject);
                }
            });
        } catch (Exception e) {
            Log.i(this.MAPS, "LocateOnMap error for ", e);
        }
    }

    @android.webkit.JavascriptInterface
    public void locateOnMapV2(java.lang.String r32) {
        throw new UnsupportedOperationException("Method not decompiled: in.juspay.mobility.common.MobilityCommonBridge.locateOnMapV2(java.lang.String):void");
    }

    @JavascriptInterface
    public void minimizeApp() {
        Intent intent = new Intent("android.intent.action.MAIN");
        intent.addCategory("android.intent.category.HOME");
        intent.setFlags(268435456);
        this.bridgeComponents.getContext().startActivity(intent);
    }

    @JavascriptInterface
    public void moveCamera(final double d, final double d2, final double d3, final double d4, final JSONArray jSONArray) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$moveCamera$53(jSONArray, d, d3, d2, d4);
            }
        });
    }

    public void moveCameraV2(final double d, final double d2, final double d3, final double d4, final JSONArray jSONArray, final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$moveCameraV2$54(str, jSONArray, d, d3, d2, d4);
            }
        });
    }

    @Override
    public boolean onActivityResult(int i, int i2, final Intent intent) {
        if (i != IMAGE_CAPTURE_REQ_CODE) {
            if (i != PICK_CONTACT_REQUEST_CODE) {
                if (i == 203) {
                    if (i2 == -1) {
                        new Thread(new Runnable() {
                            @Override
                            public final void run() {
                                MobilityCommonBridge.this.lambda$onActivityResult$81(intent);
                            }
                        }).start();
                    } else if (i2 == 204) {
                        Log.e(this.OVERRIDE, CropImage.getActivityResult(intent).getError().toString());
                    }
                }
            } else if (i2 == -1) {
                Cursor query = this.bridgeComponents.getContext().getContentResolver().query(intent.getData(), new String[]{"display_name", "data1"}, null, null, null);
                if (query != null) {
                    try {
                        if (query.moveToFirst()) {
                            String string = query.getString(query.getColumnIndexOrThrow("display_name"));
                            String string2 = query.getString(query.getColumnIndexOrThrow("data1"));
                            StringBuilder sb2 = new StringBuilder();
                            sb2.append("Name: ");
                            sb2.append(string);
                            sb2.append(", Phone Number: ");
                            sb2.append(string2);
                            callPickContactCallBack(string, string2);
                        }
                    } catch (Throwable th) {
                        try {
                            query.close();
                        } catch (Throwable th2) {
                            th.addSuppressed(th2);
                        }
                        throw th;
                    }
                }
                if (query != null) {
                    query.close();
                }
            }
        } else if (i2 != -1) {
            MediaPlayer mediaPlayer = this.mediaPlayer;
            if (mediaPlayer != null) {
                mediaPlayer.isUploadPopupOpen = false;
            }
        } else if (this.bridgeComponents.getActivity() != null) {
            MediaPlayer mediaPlayer2 = this.mediaPlayer;
            if (mediaPlayer2 != null) {
                mediaPlayer2.isUploadPopupOpen = false;
            }
            Activity activity = this.bridgeComponents.getActivity();
            Context context = this.bridgeComponents.getContext();
            MediaPlayer mediaPlayer3 = this.mediaPlayer;
            Utils.captureImage(intent, activity, context, mediaPlayer3.showToAspectRatio, mediaPlayer3.height, mediaPlayer3.width);
        }
        return super.onActivityResult(i, i2, intent);
    }

    @JavascriptInterface
    public boolean onBackPressedPP() {
        PaymentPage paymentPage = this.paymentPage;
        return paymentPage != null && paymentPage.onBackPressed();
    }

    @JavascriptInterface
    public void onMapUpdate(final String str, final String str2) {
        try {
            final MapRemoteConfig mapRemoteConfig = getMapRemoteConfig();
            if (mapRemoteConfig.enableMapRecenter && this.app == AppType.CONSUMER) {
                ExecutorManager.runOnMainThread(new Runnable() {
                    @Override
                    public final void run() {
                        MobilityCommonBridge.this.lambda$onMapUpdate$51(str, mapRemoteConfig, str2);
                    }
                });
            }
        } catch (Exception e) {
            Log.e(this.LOG_TAG, "Error in onMapUpdate ", e);
        }
    }

    @Override
    public boolean onRequestPermissionResult(int i, String[] strArr, int[] iArr) {
        if (i == 7) {
            try {
                contactsStoreCall(androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.READ_CONTACTS") == 0 ? getPhoneContacts() : new JSONArray().toString());
            } catch (JSONException e) {
                e.printStackTrace();
            }
        } else if (i != 200) {
            if (i == PICK_CONTACT_PERMISSION_REQUEST_CODE) {
                this.bridgeComponents.getActivity().startActivityForResult(new Intent("android.intent.action.PICK", ContactsContract.CommonDataKinds.Phone.CONTENT_URI), PICK_CONTACT_REQUEST_CODE, null);
            } else if (i == IMAGE_PERMISSION_REQ_CODE) {
                Context context = this.bridgeComponents.getContext();
                if (androidx.core.content.a.checkSelfPermission(context, "android.permission.CAMERA") != 0) {
                    Toast.makeText(context, context.getString(R.string.please_allow_permission_to_capture_the_image), 0).show();
                } else if (this.bridgeComponents.getActivity() != null) {
                    Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
                    String format = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date());
                    KeyValueStore.write(context, this.bridgeComponents.getSdkName(), context.getResources().getString(R.string.TIME_STAMP_FILE_UPLOAD), format);
                    intent.putExtra("output", FileProvider.h(context, context.getPackageName() + ".provider", new File(context.getFilesDir(), "IMG_" + format + ".jpg")));
                    Intent intent2 = new Intent("android.intent.action.GET_CONTENT");
                    intent2.setType("image/*");
                    Intent createChooser = Intent.createChooser(intent, context.getString(R.string.upload_image));
                    createChooser.putExtra("android.intent.extra.INITIAL_INTENTS", new Intent[]{intent2});
                    this.bridgeComponents.getActivity().startActivityForResult(createChooser, IMAGE_CAPTURE_REQ_CODE, null);
                }
            }
        } else if (iArr.length > 0 && iArr[0] != 0) {
            Toast.makeText(this.bridgeComponents.getContext(), "Permission Denied", 0).show();
        }
        return super.onRequestPermissionResult(i, strArr, iArr);
    }

    @JavascriptInterface
    public void openNavigation(double d, double d2, double d3, double d4) {
        try {
            setKeysInSharedPrefs("MAPS_OPENED", "true");
            Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(String.format(Locale.ENGLISH, "google.navigation:q=%f,%f", Double.valueOf(d3), Double.valueOf(d4))));
            intent.setFlags(268435456);
            intent.setPackage("com.google.android.apps.maps");
            this.bridgeComponents.getContext().startActivity(intent);
        } catch (Exception unused) {
            JuspayLogger.d(this.MAPS, "Unable to open navigation");
        }
    }

    @JavascriptInterface
    public void openNavigationWithQuery(double d, double d2, String str, String str2) {
        try {
            setKeysInSharedPrefs("MAPS_OPENED", "true");
            Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(String.format(Locale.ENGLISH, str, Double.valueOf(d), Double.valueOf(d2))));
            intent.setFlags(268435456);
            intent.setPackage(str2);
            this.bridgeComponents.getContext().startActivity(intent);
        } catch (ActivityNotFoundException unused) {
            JuspayLogger.d(this.MAPS, "Trying Fallback");
            openNavigation(0.0d, 0.0d, d, d2);
        } catch (Exception unused2) {
            JuspayLogger.d(this.MAPS, "Unable to open navigation");
        }
    }

    @JavascriptInterface
    public void openUrlInApp(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$openUrlInApp$65(str);
            }
        });
    }

    @JavascriptInterface
    public void pauseAudioPlayer() {
        android.media.MediaPlayer mediaPlayer = this.audioPlayer;
        if (mediaPlayer != null) {
            mediaPlayer.pause();
        }
    }

    @JavascriptInterface
    public void pauseMediaPlayer() {
        if (this.mediaPlayer == null) {
            this.mediaPlayer = new MediaPlayer(this.bridgeComponents);
        }
        this.mediaPlayer.pauseMediaPlayer();
    }

    @JavascriptInterface
    public void performHapticFeedback() {
        Vibrator vibrator = (Vibrator) this.bridgeComponents.getContext().getSystemService("vibrator");
        if (vibrator == null || !vibrator.hasVibrator() || Build.VERSION.SDK_INT < 26) {
            return;
        }
        q6.b.a(vibrator, q6.c.a(50L, -1));
    }

    @JavascriptInterface
    public void pickContact() {
        if (androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.READ_CONTACTS") == 0) {
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$pickContact$83();
                }
            });
        } else if (this.bridgeComponents.getActivity() != null) {
            androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.READ_CONTACTS"}, PICK_CONTACT_PERMISSION_REQUEST_CODE);
        }
    }

    @JavascriptInterface
    public boolean ppInitiateStatus() {
        PaymentPage paymentPage = this.paymentPage;
        if (paymentPage != null) {
            return paymentPage.initiateStatus();
        }
        return false;
    }

    @JavascriptInterface
    public void processPP(String str) {
        PaymentPage paymentPage = this.paymentPage;
        if (paymentPage != null) {
            try {
                paymentPage.process(str);
            } catch (Exception e) {
                Log.e(this.LOG_TAG, e.toString());
            }
        }
    }

    @JavascriptInterface
    public void reallocateMapFragment(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$reallocateMapFragment$30(str);
            }
        });
    }

    @JavascriptInterface
    public void registerShakeListener() {
        this.sensorManager.registerListener(this.shakeDetector, this.accelerometer, 2);
    }

    protected void removeAllCircles() {
        if (this.circleRipples != null) {
            ArrayList arrayList = new ArrayList();
            Iterator<String> it = this.circleRipples.keySet().iterator();
            while (it.hasNext()) {
                arrayList.add(it.next());
            }
            Iterator it2 = arrayList.iterator();
            while (it2.hasNext()) {
                String str = (String) it2.next();
                CircleRippleEffect circleRippleEffect = this.circleRipples.get(str);
                if (circleRippleEffect != null) {
                    circleRippleEffect.remove();
                }
                this.circleRipples.remove(str);
            }
        }
    }

    @JavascriptInterface
    public void removeAllMarkers() {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$removeAllMarkers$17();
            }
        });
    }

    @JavascriptInterface
    public void removeAllPolylines(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$removeAllPolylines$52(str);
            }
        });
    }

    @JavascriptInterface
    public void removeGroundOverlay(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$removeGroundOverlay$37(str);
            }
        });
    }

    @JavascriptInterface
    public void removeMarker(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$removeMarker$16(str);
            }
        });
    }

    @JavascriptInterface
    public void removeMediaPlayer() {
        if (this.mediaPlayer == null) {
            this.mediaPlayer = new MediaPlayer(this.bridgeComponents);
        }
        this.mediaPlayer.removeMediaPlayer();
    }

    @JavascriptInterface
    public void removeOnMapUpdate() {
        try {
            F7.c cVar = this.googleMap;
            if (cVar != null) {
                if (this.mapUpdate.isIdleListenerActive) {
                    cVar.z((c.c) null);
                    this.mapUpdate.isIdleListenerActive = false;
                }
                if (this.mapUpdate.isMoveListenerActive) {
                    this.googleMap.B((c.e) null);
                    this.mapUpdate.isMoveListenerActive = false;
                }
                Log.e(this.LOG_TAG, "MapRecenter Removed");
            }
            this.mapUpdate.mapRecenterHandler.removeCallbacksAndMessages(null);
            MapUpdate mapUpdate = this.mapUpdate;
            mapUpdate.isMapMoved = false;
            mapUpdate.isMapIdle = true;
            mapUpdate.isGestureMovement = false;
        } catch (Exception e) {
            Log.e(this.LOG_TAG, "Error in removeOnMapUpdate " + e);
        }
    }

    public void removePolygonFocus(C1289b c1289b) {
        LocateOnMapManager locateOnMapManager;
        try {
            if (this.layer == null || (locateOnMapManager = this.locateOnMapManager) == null || c1289b == null) {
                return;
            }
            locateOnMapManager.setFocusedGeoJsonFeature(null);
            List asList = Arrays.asList(new Dash(15.0f), new Gap(15.0f));
            wa.n nVar = new wa.n();
            nVar.t(3.0f);
            nVar.q(Color.argb(35, 171, 226, 186));
            nVar.s(asList);
            nVar.r(Color.argb(100, 22, 150, 46));
            c1289b.p(nVar);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @JavascriptInterface
    public void removeRippleCircle(final String str) {
        ExecutorManager.runOnBackgroundThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$removeRippleCircle$33(str);
            }
        });
    }

    @JavascriptInterface
    public void renderBase64Image(String str, String str2, boolean z, String str3) {
        if (str.contains("http")) {
            str = MobilityCallAPI.getInstance(this.bridgeComponents.getContext()).callAPI(str, MobilityCallAPI.getBaseHeaders(this.bridgeComponents.getContext()), (String) null, "GET", Boolean.FALSE).getResponseBody();
        }
        renderBase64ImageFile(str, str2, z, str3);
    }

    @JavascriptInterface
    public void renderBase64ImageFile(final String str, final String str2, boolean z, final String str3) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$renderBase64ImageFile$76(str, str2, str3);
            }
        });
    }

    @JavascriptInterface
    public void requestBackgroundLocation() {
        if (this.bridgeComponents.getActivity() == null || Build.VERSION.SDK_INT < 29) {
            return;
        }
        androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.ACCESS_BACKGROUND_LOCATION"}, BACKGROUND_LOCATION_REQ_CODE);
    }

    @JavascriptInterface
    public void requestKeyboardShow(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$requestKeyboardShow$66(str);
            }
        });
    }

    @JavascriptInterface
    public void requestLocation() {
        if (!isLocationPermissionEnabled()) {
            requestPermission();
        }
        resolvableLocationSettingsReq();
    }

    @JavascriptInterface
    public void requestNotificationPermission() {
        if (this.bridgeComponents.getActivity() == null || Build.VERSION.SDK_INT < 33 || androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.POST_NOTIFICATIONS") == 0) {
            return;
        }
        androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.POST_NOTIFICATIONS"}, 10);
    }

    public void requestPermission() {
        try {
            if (this.bridgeComponents.getActivity() != null) {
                androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.ACCESS_FINE_LOCATION"}, 1);
            }
        } catch (Exception e) {
            Log.e(this.LOCATION, "Exception in request permission", e);
        }
    }

    public boolean requestUninstallPackage(String str) {
        try {
            Intent intent = new Intent("android.intent.action.DELETE");
            intent.setData(Uri.parse("package:" + str));
            intent.addFlags(268435456);
            this.bridgeComponents.getContext().startActivity(intent);
            return true;
        } catch (Exception unused) {
            return false;
        }
    }

    @Override
    public void reset() {
        View findViewById;
        ViewTreeObserver viewTreeObserver;
        Receivers receivers = this.receivers;
        if (receivers != null) {
            receivers.deRegister();
            this.receivers = null;
        }
        this.polylinesByMapInstance = new Hashtable<>();
        this.googleMapInstance = new HashMap<>();
        this.googleMap = null;
        this.animationView = null;
        this.markers = new HashMap<>();
        this.filesCache = new HashMap<>();
        this.zoneMarkers = new HashMap<>();
        this.sharedPref.unregisterOnSharedPreferenceChangeListener(this.sharedPreferenceChangeListener);
        this.layer = null;
        MediaPlayer mediaPlayer = this.mediaPlayer;
        if (mediaPlayer != null) {
            mediaPlayer.audioRecorder = null;
        }
        clearAudioPlayer();
        if (this.onGlobalLayoutListener != null && this.bridgeComponents.getActivity() != null && (findViewById = this.bridgeComponents.getActivity().findViewById(android.R.id.content)) != null && (viewTreeObserver = findViewById.getRootView().getViewTreeObserver()) != null && viewTreeObserver.isAlive()) {
            viewTreeObserver.removeOnGlobalLayoutListener(this.onGlobalLayoutListener);
        }
        terminatePP();
        this.storeLocateOnMapCallBack = null;
        this.storeEditLocationCallBack = null;
        this.storeDashboardCallBack = null;
        this.userPositionMarker = null;
        this.storeImageUploadCallBack = null;
        MediaPlayer mediaPlayer2 = this.mediaPlayer;
        if (mediaPlayer2 != null) {
            mediaPlayer2.audioPlayers = new ArrayList<>();
        }
        Utils.deRegisterCallback(this.callBack);
    }

    @JavascriptInterface
    public void resetFileCache() {
        this.filesCache.clear();
    }

    @JavascriptInterface
    public String rsEncryption(String str) {
        return CipherUtil.getInstance().encryptData(str);
    }

    @JavascriptInterface
    public String saveAudioFile(String str) throws IOException {
        if (this.mediaPlayer == null) {
            this.mediaPlayer = new MediaPlayer(this.bridgeComponents);
        }
        return this.mediaPlayer.saveAudioFile(str);
    }

    @JavascriptInterface
    public void scrollToChildInScrollView(String str) {
        try {
            Activity activity = this.bridgeComponents.getActivity();
            if (activity != null) {
                JSONObject jSONObject = new JSONObject(str);
                String optString = jSONObject.optString("scrollViewId", "");
                String optString2 = jSONObject.optString("childViewId", "");
                String optString3 = jSONObject.optString("index", "");
                ScrollView scrollView = (ScrollView) activity.findViewById(Integer.parseInt(optString));
                View findViewById = activity.findViewById(Integer.parseInt(optString2));
                if (scrollView == null || findViewById == null) {
                    return;
                }
                int top = findViewById.getTop();
                if (top == 0) {
                    top = (Integer.parseInt(optString3) * 200) - 150;
                }
                scrollView.smoothScrollTo(findViewById.getLeft(), top);
            }
        } catch (JSONException e) {
            Log.e("SCROLL_TO_CHILD_VIEW", "Failed with: " + e);
        }
    }

    @JavascriptInterface
    public void scrollToEnd(String str, boolean z) {
        try {
            if (this.bridgeComponents.getActivity() != null) {
                if (z) {
                    ScrollView scrollView = (ScrollView) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(str));
                    if (scrollView != null) {
                        scrollView.fullScroll(130);
                    }
                } else {
                    HorizontalScrollView horizontalScrollView = (HorizontalScrollView) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(str));
                    if (horizontalScrollView != null) {
                        horizontalScrollView.fullScroll(66);
                    }
                }
            }
        } catch (Exception e) {
            Log.e(this.OTHERS, "Error in scroll to Bottom : " + e);
        }
    }

    public CircleRippleEffectOptions setCircleConfigFromJSON(JSONObject jSONObject, boolean z) {
        float optDouble = (float) jSONObject.optDouble("radius", 0.0d);
        String optString = jSONObject.optString(z ? "primaryStrokeColor" : "secondaryStrokeColor", "#FFFFFF");
        int parseColor = Color.parseColor(jSONObject.optString("fillColor", "#FFFFFF"));
        int optInt = jSONObject.optInt("strokeWidth", 0);
        String optString2 = jSONObject.optString("strokePattern", "NORMAL");
        boolean optBoolean = jSONObject.optBoolean("isCircleClickable", false);
        CircleRippleEffectOptions circleRippleEffectOptions = new CircleRippleEffectOptions();
        circleRippleEffectOptions.radius(optDouble);
        circleRippleEffectOptions.strokeWidth(optInt);
        circleRippleEffectOptions.fromStrokeColor(optString);
        circleRippleEffectOptions.fillColor(parseColor);
        circleRippleEffectOptions.strokePattern(optString2);
        circleRippleEffectOptions.isCircleClickable(optBoolean);
        return circleRippleEffectOptions;
    }

    @JavascriptInterface
    public void setEnvInNativeSharedPrefKeys(String str, String str2) {
        setKeysInSharedPrefs(str, str2);
    }

    @JavascriptInterface
    public void setKeysInSharedPrefs(String str, String str2) {
        this.sharedPref.edit().putString(str, str2).apply();
        if (str.equals(this.bridgeComponents.getContext().getString(R.string.LANGUAGE_KEY))) {
            Utils.updateLocaleResource(str2, this.bridgeComponents.getContext());
        }
    }

    public void setMapCustomTheme() {
        try {
            if (this.googleMap.u(MapStyleOptions.e0(this.bridgeComponents.getContext(), R.raw.map_style_retro))) {
                return;
            }
            Log.e(this.MAPS, "Style parsing failed.");
        } catch (Resources.NotFoundException e) {
            Log.e(this.MAPS, "Can't find style. Error: ", e);
        }
    }

    @JavascriptInterface
    public void setMapPadding(final int i, final int i2, final int i3, final int i4) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$setMapPadding$25(i, i2, i3, i4);
            }
        });
    }

    public void setPolyLineDataByMapInstance(String str, String str2, PolylineDataPoints polylineDataPoints) {
        Hashtable<String, PolylineDataPoints> hashtable = this.polylinesByMapInstance.get(str);
        if (hashtable != null) {
            hashtable.put(str2, polylineDataPoints);
            return;
        }
        Hashtable<String, PolylineDataPoints> hashtable2 = new Hashtable<>();
        hashtable2.put(str2, polylineDataPoints);
        this.polylinesByMapInstance.put(str, hashtable2);
    }

    public void setPolygonStyle(C1289b c1289b) {
        try {
            C1291d c1291d = this.layer;
            if (c1291d == null || this.locateOnMapManager == null) {
                return;
            }
            Iterable<C1289b> d = c1291d.d();
            List asList = Arrays.asList(new Dash(12.0f), new Gap(12.0f));
            for (C1289b c1289b2 : d) {
                wa.n nVar = new wa.n();
                nVar.t(3.0f);
                if (c1289b2.d("name").equals("")) {
                    nVar.q(Color.argb(15, 0, 102, 255));
                    nVar.r(-16776961);
                    nVar.s(asList);
                    nVar.p(false);
                } else {
                    if (c1289b2.equals(c1289b)) {
                        nVar.q(Color.argb(75, 22, 150, 46));
                    } else {
                        nVar.q(Color.argb(35, 171, 226, 186));
                        nVar.s(asList);
                    }
                    nVar.p(true);
                    nVar.r(Color.argb(100, 22, 150, 46));
                }
                c1289b2.p(nVar);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void setPolylineAnimationTimers(String str, String str2, PolyLineAnimationTimers polyLineAnimationTimers) {
        Hashtable<String, Hashtable<String, PolyLineAnimationTimers>> hashtable = this.polylineAnimationTimers;
        if (hashtable != null) {
            Hashtable<String, PolyLineAnimationTimers> hashtable2 = hashtable.get(str);
            if (hashtable2 == null) {
                hashtable2 = new Hashtable<>();
            }
            hashtable2.put(str2, polyLineAnimationTimers);
            this.polylineAnimationTimers.put(str, hashtable2);
        }
    }

    public PolylineDataPoints setRouteCustomTheme(PolylineOptions polylineOptions, int i, String str, int i2, JSONObject jSONObject, F7.c cVar, Boolean bool, String str2, String str3) {
        PatternItem dot = new Dot();
        PatternItem gap = new Gap(10.0f);
        polylineOptions.H0(i2);
        List asList = Arrays.asList(gap, dot);
        List singletonList = Collections.singletonList(new Dash(20.0f));
        if (jSONObject != null && jSONObject.has("dashUnit") && jSONObject.has("gapUnit")) {
            singletonList = Arrays.asList(new Dash(jSONObject.optInt("dashUnit", 1)), new Gap(jSONObject.optInt("gapUnit", 0)));
        }
        polylineOptions.p0(i);
        str.hashCode();
        if (str.equals("DOT")) {
            polylineOptions.E0(asList);
        } else if (str.equals("DASH")) {
            polylineOptions.E0(singletonList);
        }
        H7.j e = cVar != null ? cVar.e(polylineOptions) : this.googleMap.e(polylineOptions);
        PolylineDataPoints polyLineDataByMapInstance = getPolyLineDataByMapInstance(str3, str2);
        if (bool.booleanValue()) {
            polyLineDataByMapInstance.setOverlayPolylines(e);
        } else {
            polyLineDataByMapInstance.setPolyline(e);
        }
        return polyLineDataByMapInstance;
    }

    @JavascriptInterface
    public void setupVoiceRecognitionView(final String str) {
        Log.i(this.LOG_TAG, "setupVoiceRecognitionView is getting called");
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$setupVoiceRecognitionView$87(str);
            }
        });
    }

    @JavascriptInterface
    public void shareImageMessage(final String str, String str2, final String str3) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$shareImageMessage$72(str3, str);
            }
        });
    }

    @JavascriptInterface
    public void shareTextMessage(final String str, final String str2) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$shareTextMessage$71(str2, str);
            }
        });
    }

    @JavascriptInterface
    public void showDialer(String str, boolean z) {
        Intent intent = new Intent(z ? "android.intent.action.CALL" : "android.intent.action.DIAL");
        intent.addFlags(268435456);
        intent.setData(Uri.parse("tel:" + str));
        if (!z || androidx.core.content.a.checkSelfPermission(this.bridgeComponents.getContext(), "android.permission.CALL_PHONE") == 0) {
            this.bridgeComponents.getContext().startActivity(intent);
        } else {
            this.phoneNumber = str;
            androidx.core.app.b.g(this.bridgeComponents.getActivity(), new String[]{"android.permission.CALL_PHONE"}, 8);
        }
    }

    @JavascriptInterface
    public void showDynamicRouteMarker(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$showDynamicRouteMarker$88(str);
            }
        });
    }

    @JavascriptInterface
    public void showKeyboard(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$showKeyboard$67(str);
            }
        });
    }

    @JavascriptInterface
    public void showMap(final String str, final boolean z, final String str2, final float f, final String str3, final String str4) {
        try {
            System.out.println("Inside showMap 123");
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$showMap$55(str, str4, z, str2, str3, f);
                }
            });
        } catch (Exception e) {
            Log.e("ADD_MARKER", e.toString());
        }
    }

    @JavascriptInterface
    public void showMarker(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$showMarker$21(str);
            }
        });
    }

    public void showNotificationWithURI(final Uri uri, final String str, final String str2, final String str3, final String str4, final String str5) {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$showNotificationWithURI$73(str, str5, uri, str3, str4, str2);
            }
        });
    }

    @JavascriptInterface
    public void startAudioPlayer(String str, final String str2) {
        int identifier = this.bridgeComponents.getContext().getResources().getIdentifier(str, "raw", this.bridgeComponents.getContext().getPackageName());
        android.media.MediaPlayer mediaPlayer = this.audioPlayer;
        if (mediaPlayer != null) {
            mediaPlayer.stop();
            this.audioPlayer = null;
        }
        try {
            if (identifier != 0) {
                this.audioPlayer = android.media.MediaPlayer.create(this.bridgeComponents.getContext(), Uri.parse("android.resource://" + this.bridgeComponents.getContext().getPackageName() + "/" + identifier));
            } else {
                android.media.MediaPlayer mediaPlayer2 = new android.media.MediaPlayer();
                this.audioPlayer = mediaPlayer2;
                mediaPlayer2.setDataSource(str);
                this.audioPlayer.prepare();
            }
            this.audioPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public final void onPrepared(android.media.MediaPlayer mediaPlayer3) {
                    mediaPlayer3.start();
                }
            });
            this.audioPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                @Override
                public final void onCompletion(android.media.MediaPlayer mediaPlayer3) {
                    MobilityCommonBridge.this.lambda$startAudioPlayer$80(str2, mediaPlayer3);
                }
            });
        } catch (Exception e) {
            Log.e(this.OTHERS, "Error in  startAudioPlayer : " + e);
            e.printStackTrace();
        }
    }

    @JavascriptInterface
    public boolean startAudioRecording(String str) {
        if (this.mediaPlayer == null) {
            this.mediaPlayer = new MediaPlayer(this.bridgeComponents);
        }
        return this.mediaPlayer.startAudioRecording(str);
    }

    @JavascriptInterface
    public void startLottieProcess(final String str) {
        if (this.bridgeComponents.getActivity() != null) {
            ExecutorManager.runOnMainThread(new Runnable() {
                @Override
                public final void run() {
                    MobilityCommonBridge.this.lambda$startLottieProcess$70(str);
                }
            });
        }
    }

    @JavascriptInterface
    public void startServiceForClass(String str) {
        try {
            Log.i("SERVICE", "starting the service for class - " + str);
            this.bridgeComponents.getContext().startService(new Intent(this.bridgeComponents.getContext(), Class.forName(str)));
        } catch (Exception e) {
            Log.i("SERVICE", "Error in starting the service for class - " + str + " " + e);
        }
    }

    @JavascriptInterface
    public void startVoiceRecognition() {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$startVoiceRecognition$86();
            }
        });
    }

    @JavascriptInterface
    public String stopAudioRecording() {
        if (this.mediaPlayer == null) {
            this.mediaPlayer = new MediaPlayer(this.bridgeComponents);
        }
        return this.mediaPlayer.stopAudioRecording();
    }

    @JavascriptInterface
    public void stopServiceForClass(String str) {
        try {
            Log.i("SERVICE", "stopping the service for class - " + str);
            this.bridgeComponents.getContext().stopService(new Intent(this.bridgeComponents.getContext(), Class.forName(str)));
        } catch (Exception e) {
            Log.i("SERVICE", "Error in stopping the service for class - " + str + " " + e);
        }
    }

    @JavascriptInterface
    public void stopVoiceRecognition() {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$stopVoiceRecognition$85();
            }
        });
    }

    @JavascriptInterface
    public void storeCallBackContacts(String str) {
        storeContactsCallBack = str;
    }

    @JavascriptInterface
    public void storeCallBackDriverLocationPermission(String str) {
        this.receivers.storeLocationCallBack = str;
    }

    @JavascriptInterface
    public void storeCallBackImageUpload(String str) {
        this.storeImageUploadCallBack = str;
    }

    @JavascriptInterface
    public void storeCallBackInternetAction(String str) {
        this.receivers.storeInternetActionCallBack = str;
    }

    @JavascriptInterface
    public void storeCallBackLocateOnMap(String str) {
        this.storeLocateOnMapCallBack = str;
    }

    @JavascriptInterface
    public void storeCallBackPickContact(String str) {
        this.storePickContactCallBack = str;
    }

    @JavascriptInterface
    public void storeCallBackUploadMultiPartData(String str) {
        this.storeUploadMultiPartCallBack = str;
    }

    @JavascriptInterface
    public void storeCallbackCircleOnClick(String str) {
        this.storeCircleOnClickCallback = str;
    }

    @JavascriptInterface
    public void storeCallbackHotspotMap(String str) {
        this.storeHotspotMapCallback = str;
    }

    @JavascriptInterface
    public void storeFileInCache(String str) {
        this.filesCache.put(str, this.bridgeComponents.getFileProviderInterface().readFromFile(this.bridgeComponents.getContext(), str));
    }

    @JavascriptInterface
    public void terminatePP() {
        PaymentPage paymentPage = this.paymentPage;
        if (paymentPage != null) {
            paymentPage.terminate();
            this.paymentPage = null;
        }
    }

    @JavascriptInterface
    public void timePicker(String str, String str2) {
        timePicker(str, str2, null);
    }

    @JavascriptInterface
    public void toast(String str) {
        Toast.makeText(this.bridgeComponents.getContext(), str, 0).show();
    }

    @JavascriptInterface
    @Deprecated
    public void toggleLoader(final boolean z) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$toggleLoader$63(z);
            }
        });
    }

    @JavascriptInterface
    public void unregisterShakeListener() {
        this.sensorManager.unregisterListener(this.shakeDetector);
    }

    @JavascriptInterface
    public void updateGroundOverlay(final String str) {
        ExecutorManager.runOnBackgroundThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$updateGroundOverlay$39(str);
            }
        });
    }

    protected void updateLastKnownLocation(final String str, final boolean z, final String str2, final boolean z2) {
        if (isLocationPermissionEnabled()) {
            this.client.getCurrentLocation(100, this.cancellationTokenSource.getToken()).addOnSuccessListener(new OnSuccessListener() {
                public final void onSuccess(Object obj) {
                    MobilityCommonBridge.this.lambda$updateLastKnownLocation$3(str, z, str2, z2, (Location) obj);
                }
            }).addOnFailureListener(new OnFailureListener() {
                public final void onFailure(Exception exc) {
                    MobilityCommonBridge.this.lambda$updateLastKnownLocation$4(z2, str, z, exc);
                }
            });
        }
    }

    @JavascriptInterface
    public void updateMarker(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$updateMarker$45(str);
            }
        });
    }

    @JavascriptInterface
    public void updateMarkerV2(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$updateMarkerV2$47(str);
            }
        });
    }

    @JavascriptInterface
    public void updateRippleCirclePosition(final String str) {
        ExecutorManager.runOnBackgroundThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$updateRippleCirclePosition$34(str);
            }
        });
    }

    protected void updateRippleCircleWithId(String str, CircleRippleEffectOptions circleRippleEffectOptions, LatLng latLng) {
        HashMap<String, CircleRippleEffect> hashMap = this.circleRipples;
        if (hashMap != null) {
            CircleRippleEffect circleRippleEffect = hashMap.get(str);
            if (circleRippleEffect != null) {
                circleRippleEffect.updateCircle(circleRippleEffectOptions);
                return;
            }
            CircleRippleEffect circleRippleEffect2 = new CircleRippleEffect(1, circleRippleEffectOptions);
            circleRippleEffect2.draw(this.googleMap, latLng, this.bridgeComponents, this.storeCircleOnClickCallback);
            this.circleRipples.put(str, circleRippleEffect2);
        }
    }

    @JavascriptInterface
    public void updateRoute(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$updateRoute$56(str);
            }
        });
    }

    @JavascriptInterface
    public void uploadFile(String str, boolean z) {
        try {
            if (this.mediaPlayer == null) {
                this.mediaPlayer = new MediaPlayer(this.bridgeComponents);
            }
            JSONObject jSONObject = new JSONObject(str);
            this.mediaPlayer.uploadFile(jSONObject.optInt("imageAspectHeight", 0), jSONObject.optInt("imageAspectWidth", 0), jSONObject.optBoolean("showAccordingToAspectRatio", false), Boolean.valueOf(z));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @JavascriptInterface
    public void uploadMultiPartData(String str, String str2, String str3, String str4, String str5) {
        try {
            String uuid = UUID.randomUUID().toString();
            HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str2).openConnection();
            httpURLConnection.setRequestMethod("POST");
            httpURLConnection.setDoOutput(true);
            httpURLConnection.setUseCaches(false);
            httpURLConnection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + uuid);
            httpURLConnection.setRequestProperty("token", KeyValueStore.read(this.bridgeComponents.getContext(), this.bridgeComponents.getSdkName(), "REGISTERATION_TOKEN", "__failed"));
            File file = new File(str);
            String name = file.getName();
            DataOutputStream dataOutputStream = new DataOutputStream(httpURLConnection.getOutputStream());
            dataOutputStream.writeBytes("--" + uuid + "\r\n");
            dataOutputStream.writeBytes("Content-Disposition: form-data; name=\"" + str5 + "\"; filename=\"" + name + "\"\r\n");
            if (str3.equals("Image")) {
                dataOutputStream.writeBytes("Content-Type: image/jpeg\r\n");
            } else if (str3.equals("Audio")) {
                dataOutputStream.writeBytes("Content-Type: audio/mpeg\r\n");
            }
            dataOutputStream.writeBytes("\r\n");
            FileInputStream fileInputStream = new FileInputStream(file);
            int min = Math.min(fileInputStream.available(), 1048576);
            byte[] bArr = new byte[min];
            int read = fileInputStream.read(bArr, 0, min);
            while (read > 0) {
                dataOutputStream.write(bArr, 0, min);
                min = Math.min(fileInputStream.available(), 1048576);
                read = fileInputStream.read(bArr, 0, min);
            }
            dataOutputStream.writeBytes("\r\n");
            dataOutputStream.writeBytes("--" + uuid + "\r\n");
            dataOutputStream.writeBytes("Content-Disposition: form-data; name=\"fileType\"\r\n");
            dataOutputStream.writeBytes("Content-Type: application/json\r\n");
            dataOutputStream.writeBytes("\r\n");
            dataOutputStream.writeBytes(str3);
            dataOutputStream.writeBytes("\r\n");
            dataOutputStream.writeBytes("--" + uuid + "\r\n--");
            String str6 = "";
            if (httpURLConnection.getResponseCode() == 200) {
                StringBuilder sb2 = new StringBuilder();
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new BufferedInputStream(httpURLConnection.getInputStream())));
                while (true) {
                    String readLine = bufferedReader.readLine();
                    if (readLine == null) {
                        break;
                    } else {
                        sb2.append(readLine);
                    }
                }
                try {
                    str6 = new JSONObject(sb2.toString()).getString(str4);
                    Toast.makeText(this.bridgeComponents.getContext(), this.bridgeComponents.getContext().getString(R.string.media_upload_success), 0).show();
                } catch (JSONException e) {
                    throw new RuntimeException(e);
                }
            } else {
                Toast.makeText(this.bridgeComponents.getContext(), this.bridgeComponents.getContext().getString(R.string.unable_to_upload_media), 0).show();
            }
            callUploadMultiPartCallBack(str3, str6);
        } catch (Exception e2) {
            Log.e("UPLOAD_MULTI_PART_DATA", "error in Upload file: " + e2);
        }
    }

    @JavascriptInterface
    public void upsertMarker(final String str, final String str2, final String str3, final int i, final float f, final float f2) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$upsertMarker$24(str2, str3, str, i, f, f2);
            }
        });
    }

    @JavascriptInterface
    public void upsertMarkerLabel(final String str) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$upsertMarkerLabel$19(str);
            }
        });
    }

    public void upsertMarkerV2(final MarkerConfig markerConfig, final String str, final String str2, final int i, final float f, final float f2, final String str3) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$upsertMarkerV2$22(str3, markerConfig, str, str2, i, f, f2);
            }
        });
    }

    @JavascriptInterface
    public void voiceToText(final String str) {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$voiceToText$84(str);
            }
        });
    }

    public static class MarkerConfig {
        String markerId = "";
        boolean showPointer = false;
        String pointerIcon = "";
        String primaryText = "";
        String secondaryText = "";
        MarkerImageConfig labelImage = new MarkerImageConfig("", 28, 28);
        MarkerImageConfig labelActionImage = new MarkerImageConfig("", 28, 28);
        MarkerActionImageConfig markerActionImage = new MarkerActionImageConfig("", 28, 28, "HORIZONTAL", "", new JSONObject(), new JSONObject(), new JSONObject());
        Theme theme = Theme.LIGHT;
        String markerCallback = "";
        String shortTitle = "";
        int labelMaxWidth = 300;
        int labelMaxLines = 1;
        int labelTextSize = 11;
        float rotation = 0.0f;
        float zIndex = 0.0f;
        int markerIconSize = 160;
        AnimationType animationType = AnimationType.NONE;
        int animationDuration = 0;

        public void locationName(String str, String str2) {
            this.primaryText = str;
            this.secondaryText = str2;
        }

        public void setLabelActionImage(String str) {
            this.labelActionImage.image = str;
        }

        public void setLabelActionImageConfig(JSONObject jSONObject) {
            if (jSONObject != null) {
                this.labelActionImage.image = jSONObject.optString("image", "");
                this.labelActionImage.height = jSONObject.optInt(Snapshot.HEIGHT, 28);
                this.labelActionImage.width = jSONObject.optInt(Snapshot.WIDTH, 28);
            }
        }

        public void setLabelImage(String str) {
            this.labelImage.image = str;
        }

        public void setLabelImageConfig(JSONObject jSONObject) {
            if (jSONObject != null) {
                this.labelImage.image = jSONObject.optString("image", "");
                this.labelImage.height = jSONObject.optInt(Snapshot.HEIGHT, 28);
                this.labelImage.width = jSONObject.optInt(Snapshot.WIDTH, 28);
            }
        }

        public void setLabelMaxLines(int i) {
            this.labelMaxLines = i;
        }

        public void setLabelMaxWidth(int i) {
            this.labelMaxWidth = i;
        }

        public void setLabelTextSize(int i) {
            if (i != 0) {
                this.labelTextSize = i;
            }
        }

        public void setMarkerActionImage(String str) {
            this.markerActionImage.image = str;
        }

        public void setMarkerActionImageConfig(JSONObject jSONObject) {
            this.markerActionImage.image = jSONObject.optString("image", "");
            this.markerActionImage.height = jSONObject.optInt(Snapshot.HEIGHT, 28);
            this.markerActionImage.width = jSONObject.optInt(Snapshot.WIDTH, 28);
            this.markerActionImage.orientation = jSONObject.optString("orientation", "VERTICAL");
            this.markerActionImage.background = jSONObject.optString("background", "");
            this.markerActionImage.layoutMargin = MobilityCommonBridge.getMarkerEdgeInsets(jSONObject.optJSONObject("layoutMargin"));
            this.markerActionImage.padding = MobilityCommonBridge.getMarkerEdgeInsets(jSONObject.optJSONObject("padding"));
            this.markerActionImage.layoutPadding = MobilityCommonBridge.getMarkerEdgeInsets(jSONObject.optJSONObject("layoutPadding"));
        }

        public void setMarkerAnimation(AnimationType animationType, int i) {
            this.animationType = animationType;
            this.animationDuration = i;
        }

        public void setMarkerCallback(String str) {
            this.markerCallback = str;
        }

        public void setMarkerIconSize(int i) {
            this.markerIconSize = i;
        }

        public void setMarkerId(String str) {
            this.markerId = str;
        }

        public void setPointer(String str) {
            if (str.equals("")) {
                this.showPointer = false;
            }
            this.pointerIcon = str;
        }

        public void setRotation(float f) {
            this.rotation = f;
        }

        public void setShortTitle(String str) {
            this.shortTitle = str;
        }

        public void setTheme(String str) {
            try {
                this.theme = Theme.valueOf(str);
            } catch (Exception unused) {
                this.theme = Theme.LIGHT;
            }
        }

        public void setZIndex(float f) {
            this.zIndex = f;
        }

        public void locationName(String str) {
            this.primaryText = str;
        }
    }

    @JavascriptInterface
    public void addMediaFile(String str, String str2, String str3, String str4, String str5, String str6, boolean z) {
        if (this.mediaPlayer == null) {
            this.mediaPlayer = new MediaPlayer(this.bridgeComponents);
        }
        this.mediaPlayer.addMediaFile(str, str2, str3, str4, str5, str6, Boolean.valueOf(z));
    }

    @JavascriptInterface
    public void addMediaPlayer(String str, String str2, boolean z) {
        if (this.mediaPlayer == null) {
            this.mediaPlayer = new MediaPlayer(this.bridgeComponents);
        }
        this.mediaPlayer.addMediaPlayer(str, str2, z);
    }

    public void addZoneMarker(double d, double d2, String str, String str2, MarkerConfig markerConfig) {
        try {
            MarkerOptions B0 = new MarkerOptions().J0("").G0(new LatLng(d, d2)).B0(H7.c.c(getMarkerBitmapFromView(str2, false, MarkerType.SPECIAL_ZONE_MARKER, markerConfig)));
            if (markerConfig.primaryText.equals("")) {
                B0.k0(0.5f, 0.5f);
            } else {
                B0.k0(B0.q0(), 0.88f);
            }
            H7.h c = this.googleMap.c(B0);
            if (c != null) {
                c.p(str);
                c.e();
                this.zoneMarkers.put(str, c);
            }
            this.googleMap.K(new c.n() {
                public final boolean b(H7.h hVar) {
                    boolean lambda$addZoneMarker$11;
                    lambda$addZoneMarker$11 = MobilityCommonBridge.this.lambda$addZoneMarker$11(hVar);
                    return lambda$addZoneMarker$11;
                }
            });
        } catch (Exception e) {
            e.toString();
        }
    }

    @JavascriptInterface
    public void datePicker(String str, String str2, String str3) {
        datePicker(str, str2, str3, null);
    }

    @JavascriptInterface
    public void getCurrentPosition(String str, boolean z) {
        if (isLocationPermissionEnabled()) {
            updateLastKnownLocation(str, false, ZoomType.ZOOM, z);
        }
    }

    @JavascriptInterface
    public void timePicker(final String str, String str2, final String str3) {
        ExecutorManager.runOnMainThread(new Runnable() {
            @Override
            public final void run() {
                MobilityCommonBridge.this.lambda$timePicker$61(str, str3);
            }
        });
    }

    @JavascriptInterface
    public void datePicker(String str, String str2, String str3, String str4) {
        ExecutorManager.runOnMainThread(new AnonymousClass8(str2, str, str4, str3));
    }

    public static boolean isServiceRunning(Context context, String str) {
        Iterator<ActivityManager.RunningServiceInfo> it = ((ActivityManager) context.getSystemService("activity")).getRunningServices(Integer.MAX_VALUE).iterator();
        while (it.hasNext()) {
            if (it.next().service.getClassName().equals(str)) {
                return true;
            }
        }
        return false;
    }
}