package com.ikea.shared;

import android.content.Context;
import android.text.TextUtils;
import com.ikea.shared.config.model.Config;
import com.ikea.shared.config.model.Country;
import com.ikea.shared.config.model.Currency;
import com.ikea.shared.config.model.KillSwitchConfig;
import com.ikea.shared.config.model.Language;
import com.ikea.shared.config.model.Languages;
import com.ikea.shared.config.model.Region;
import com.ikea.shared.config.model.RegionList;
import com.ikea.shared.config.model.UrlElement;
import com.ikea.shared.config.model.Urls;
import com.ikea.shared.stores.model.StoreRef;
import com.ikea.shared.util.Persistable;
import com.ikea.shared.util.UiUtil;
import java.util.Iterator;
import java.util.List;

public class AppConfigData
  implements Persistable
{
  private boolean isFirstTimeUser = true;
  private Country mConfig;
  private String mCountryCode;
  private String mCountryName;
  private StoreRef mFavStore;
  private String mFontName;
  private KillSwitchConfig mKillSwithConfig;
  private String mLanguageCode;
  private String mLanguageName;
  private Region mRegion;
  private String mRegionCode;
  private String mRegionName;

  private Language getLanguages()
  {
    Country localCountry = this.mConfig;
    Object localObject = null;
    if (localCountry != null)
    {
      List localList = this.mConfig.getLanguages().getLanguage();
      localObject = null;
      if (localList != null)
      {
        boolean bool1 = localList.isEmpty();
        localObject = null;
        if (!bool1)
        {
          Iterator localIterator = localList.iterator();
          Language localLanguage;
          do
          {
            boolean bool2 = localIterator.hasNext();
            localObject = null;
            if (!bool2)
              break;
            localLanguage = (Language)localIterator.next();
          }
          while ((this.mLanguageCode == null) || (!this.mLanguageCode.equals(localLanguage.getValue())));
          localObject = localLanguage;
        }
      }
    }
    return localObject;
  }

  public String getCalendar()
  {
    if ((this.mConfig != null) && (this.mConfig.getLanguages() != null))
    {
      List localList = this.mConfig.getLanguages().getLanguage();
      if ((localList != null) && (!localList.isEmpty()))
      {
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext())
        {
          Language localLanguage = (Language)localIterator.next();
          if (this.mLanguageCode.equals(localLanguage.getValue()))
            return localLanguage.getmCalendar();
        }
      }
    }
    return "G";
  }

  public Country getConfig()
  {
    return this.mConfig;
  }

  public String getCountryCode()
  {
    return this.mCountryCode;
  }

  public String getCountryName()
  {
    return this.mCountryName;
  }

  public Currency getCurrency()
  {
    if ((this.mConfig != null) && (this.mConfig.getLanguages() != null))
    {
      List localList = this.mConfig.getLanguages().getLanguage();
      if ((localList != null) && (!localList.isEmpty()))
      {
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext())
        {
          Language localLanguage = (Language)localIterator.next();
          if (this.mLanguageCode.equals(localLanguage.getValue()))
            return localLanguage.getCurrency();
        }
      }
    }
    return null;
  }

  public Currency getCurrencyForLanguages()
  {
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      return localLanguage.getCurrency();
    return null;
  }

  public String getFamilyCardUrl()
  {
    String str = "";
    Language localLanguage = getLanguages();
    if (localLanguage != null)
    {
      str = localLanguage.getMobileFamilyCardUrl();
      if (str.isEmpty())
        str = localLanguage.getFullSiteFamilyCardUrl();
    }
    return str;
  }

  public StoreRef getFavStore()
  {
    return this.mFavStore;
  }

  public String getFontName()
  {
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      this.mFontName = localLanguage.getFontName();
    return this.mFontName;
  }

  public String getFullsiteLoginUrl()
  {
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      return localLanguage.getFullsiteLoginUrl();
    return "";
  }

  public String getId()
  {
    return AppConfigData.class.getSimpleName();
  }

  public String getInformationUrl(String paramString)
  {
    String str = "";
    Language localLanguage = getLanguages();
    if ((localLanguage != null) && (localLanguage.getUrls() != null) && (localLanguage.getUrls().getUrls() != null) && (!localLanguage.getUrls().getUrls().isEmpty()))
    {
      List localList = localLanguage.getUrls().getUrls();
      if (localList != null)
      {
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext())
        {
          UrlElement localUrlElement = (UrlElement)localIterator.next();
          if (localUrlElement.getTpe().equalsIgnoreCase(paramString))
            str = localUrlElement.getValue();
        }
      }
    }
    return str;
  }

  public KillSwitchConfig getKillSwitchConfig()
  {
    if (this.mKillSwithConfig == null)
      this.mKillSwithConfig = new KillSwitchConfig();
    return this.mKillSwithConfig;
  }

  public String getLanguageCode()
  {
    return this.mLanguageCode;
  }

  public String getLanguageName()
  {
    return this.mLanguageName;
  }

  public String getNamePresentationString()
  {
    String str = "";
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      str = localLanguage.getmNamePresentation();
    return str;
  }

  public String getNewLogoUrl(Context paramContext)
  {
    String str = "";
    Language localLanguage = getLanguages();
    if (localLanguage != null)
    {
      if (UiUtil.isTablet(paramContext))
        str = localLanguage.getNewLargeLogoUrl();
    }
    else
      return str;
    return localLanguage.getNewLogoUrl();
  }

  public String getNewLowerPriceLogoUrl()
  {
    String str = "";
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      str = localLanguage.getLowerPriceUrl();
    return str;
  }

  public String getPasswordRecoveryUri()
  {
    String str = "";
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      str = localLanguage.getPassRecoveryUri();
    return str;
  }

  public Region getRegion()
  {
    return this.mRegion;
  }

  public String getRegionCode()
  {
    return this.mRegionCode;
  }

  public String getRegionName()
  {
    return this.mRegionName;
  }

  public String getRegistrationSubDomain()
  {
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      return localLanguage.getRegistrationSubDomain();
    return "";
  }

  public String getSignUpUriForIkeaAccount()
  {
    String str = "";
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      str = localLanguage.getProfileUrl();
    return str;
  }

  public String getUpgradeToFamilyUri()
  {
    String str = "";
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      str = localLanguage.getUpgradeFamilyUrl();
    return str;
  }

  public boolean isDisclaimerPIPBold()
  {
    Language localLanguage = getLanguages();
    boolean bool = false;
    if (localLanguage != null)
      bool = localLanguage.isDisclaimerPIPBold();
    return bool;
  }

  public boolean isFamilyCardDisabled()
  {
    if (this.mConfig != null)
      return this.mConfig.isFamilyCardDisabled();
    return false;
  }

  public boolean isFirstTimeUser()
  {
    return this.isFirstTimeUser;
  }

  public boolean isIRWSupported()
  {
    Language localLanguage = getLanguages();
    boolean bool1 = false;
    if (localLanguage != null)
    {
      String str = localLanguage.getIrwNonIrw();
      bool1 = false;
      if (str != null)
      {
        boolean bool2 = "IRW".equalsIgnoreCase(localLanguage.getIrwNonIrw());
        bool1 = false;
        if (bool2)
          bool1 = true;
      }
    }
    return bool1;
  }

  public boolean isMemberFull()
  {
    Country localCountry = this.mConfig;
    boolean bool1 = false;
    boolean bool2 = false;
    if (localCountry != null)
    {
      bool1 = this.mConfig.isFamilyCardDisabled();
      bool2 = this.mConfig.isMemberCardLight();
    }
    Language localLanguage = getLanguages();
    int i = 0;
    if (localLanguage != null)
    {
      String str = localLanguage.getIrwNonIrw();
      i = 0;
      if (str != null)
      {
        boolean bool3 = "IRW".equalsIgnoreCase(localLanguage.getIrwNonIrw());
        i = 0;
        if (bool3)
          i = 1;
      }
    }
    return (i != 0) && (!bool1) && (!bool2);
  }

  public boolean isMemberLight()
  {
    Country localCountry = this.mConfig;
    boolean bool1 = false;
    boolean bool2 = false;
    if (localCountry != null)
    {
      bool1 = this.mConfig.isFamilyCardDisabled();
      bool2 = this.mConfig.isMemberCardLight();
    }
    Language localLanguage = getLanguages();
    int i = 0;
    if (localLanguage != null)
    {
      String str = localLanguage.getIrwNonIrw();
      i = 0;
      if (str != null)
      {
        boolean bool3 = "IRW".equalsIgnoreCase(localLanguage.getIrwNonIrw());
        i = 0;
        if (bool3)
          i = 1;
      }
    }
    return (i != 0) && (!bool1) && (bool2);
  }

  public boolean isODBConnectionEnable()
  {
    boolean bool = true;
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      bool = localLanguage.isOdbConnectionEnable();
    return bool;
  }

  public boolean isShowFoodComparisionPrice()
  {
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      return localLanguage.isShowFoodComparisionPrice();
    return false;
  }

  public boolean isShowPerPiecePrice()
  {
    Language localLanguage = getLanguages();
    if (localLanguage != null)
      return localLanguage.isShowPerPiecePrice();
    return false;
  }

  public void resetConfigData(Config paramConfig)
  {
    if ((paramConfig != null) && (!TextUtils.isEmpty(this.mLanguageCode)) && (!TextUtils.isEmpty(this.mCountryCode)))
    {
      List localList1 = paramConfig.getCountry();
      List localList2 = null;
      if (localList1 != null)
      {
        boolean bool = localList1.isEmpty();
        localList2 = null;
        if (!bool)
        {
          Iterator localIterator2 = localList1.iterator();
          while (localIterator2.hasNext())
          {
            Country localCountry = (Country)localIterator2.next();
            if ((!TextUtils.isEmpty(localCountry.getCountrycode())) && (localCountry.getCountrycode().equals(this.mCountryCode)))
            {
              if (localCountry.getRegions() != null)
                localList2 = localCountry.getRegions().getRegions();
              this.mConfig = localCountry;
            }
          }
        }
      }
      if ((localList2 != null) && (!localList2.isEmpty()))
      {
        Iterator localIterator1 = localList2.iterator();
        while (localIterator1.hasNext())
        {
          Region localRegion = (Region)localIterator1.next();
          if ((!TextUtils.isEmpty(localRegion.getValue())) && (localRegion.getValue().equals(this.mRegionCode)))
            this.mRegion = localRegion;
        }
      }
    }
  }

  public void setConfig(Country paramCountry)
  {
    this.mConfig = paramCountry;
  }

  public void setCountryCode(String paramString)
  {
    this.mCountryCode = paramString;
  }

  public void setCountryName(String paramString)
  {
    this.mCountryName = paramString;
  }

  public void setFavStore(StoreRef paramStoreRef)
  {
    this.mFavStore = paramStoreRef;
  }

  public void setFirstTimeUser(boolean paramBoolean)
  {
    this.isFirstTimeUser = paramBoolean;
  }

  public void setFontName(String paramString)
  {
    this.mFontName = paramString;
  }

  public void setKillSwithConfig(KillSwitchConfig paramKillSwitchConfig)
  {
    this.mKillSwithConfig = paramKillSwitchConfig;
  }

  public void setLanguageCode(String paramString)
  {
    this.mLanguageCode = paramString;
  }

  public void setLanguageName(String paramString)
  {
    this.mLanguageName = paramString;
  }

  public void setRegion(Region paramRegion)
  {
    this.mRegion = paramRegion;
  }

  public void setRegionCode(String paramString)
  {
    this.mRegionCode = paramString;
  }

  public void setRegionName(String paramString)
  {
    this.mRegionName = paramString;
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.ikea.shared.AppConfigData
 * JD-Core Version:    0.6.2
 */