/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.InvalidLicenseException
 *  com.l7tech.gateway.common.LicenseException
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.gateway.common.audit.SystemMessages
 *  com.l7tech.gateway.common.custom.CustomAssertionsRegistrar
 *  com.l7tech.gateway.common.licensing.CompositeLicense
 *  com.l7tech.gateway.common.licensing.FeatureLicense
 *  com.l7tech.gateway.common.licensing.FeatureSetExpander
 *  com.l7tech.gateway.common.licensing.LicenseDocument
 *  com.l7tech.gateway.common.licensing.LicenseInstallationException
 *  com.l7tech.gateway.common.licensing.LicenseRemovalException
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.policy.assertion.Assertion
 *  com.l7tech.policy.assertion.CustomAssertionHolder
 *  com.l7tech.util.Background
 *  com.l7tech.util.BuildInfo
 *  com.l7tech.util.DateUtils
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.Functions$Unary
 *  org.apache.commons.lang3.ObjectUtils
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.beans.factory.annotation.Autowired
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.context.ApplicationEventPublisher
 *  org.springframework.context.ApplicationEventPublisherAware
 *  org.springframework.context.ApplicationListener
 *  org.springframework.context.Lifecycle
 *  org.springframework.context.Phased
 *  org.springframework.context.support.ApplicationObjectSupport
 *  org.springframework.transaction.annotation.Transactional
 */
package com.l7tech.server.licensing;

import com.l7tech.gateway.common.InvalidLicenseException;
import com.l7tech.gateway.common.LicenseException;
import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.gateway.common.audit.SystemMessages;
import com.l7tech.gateway.common.custom.CustomAssertionsRegistrar;
import com.l7tech.gateway.common.licensing.CompositeLicense;
import com.l7tech.gateway.common.licensing.FeatureLicense;
import com.l7tech.gateway.common.licensing.FeatureSetExpander;
import com.l7tech.gateway.common.licensing.LicenseDocument;
import com.l7tech.gateway.common.licensing.LicenseInstallationException;
import com.l7tech.gateway.common.licensing.LicenseRemovalException;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.CustomAssertionHolder;
import com.l7tech.server.event.EntityInvalidationEvent;
import com.l7tech.server.event.system.LicenseChangeEvent;
import com.l7tech.server.event.system.LicenseEvent;
import com.l7tech.server.licensing.FeatureLicenseFactory;
import com.l7tech.server.licensing.LicenseDocumentManager;
import com.l7tech.server.licensing.UpdatableCompositeLicenseManager;
import com.l7tech.server.licensing.a;
import com.l7tech.server.licensing.d;
import com.l7tech.util.Background;
import com.l7tech.util.BuildInfo;
import com.l7tech.util.DateUtils;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.Functions;
import java.io.ByteArrayInputStream;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.ObjectUtils;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.context.ApplicationListener;
import org.springframework.context.Lifecycle;
import org.springframework.context.Phased;
import org.springframework.context.support.ApplicationObjectSupport;
import org.springframework.transaction.annotation.Transactional;

public abstract class AbstractCompositeLicenseManager
extends ApplicationObjectSupport
implements UpdatableCompositeLicenseManager,
Lifecycle,
Phased,
ApplicationListener<EntityInvalidationEvent>,
ApplicationEventPublisherAware {
    private static final X509Certificate[] a;
    public static final int PHASE = -10000;
    private static final long b = 21600000L;
    private static final long c = 300000L;
    private static final long d = 259200000L;
    private static final String e;
    private static final String f;
    private static final String g;
    private static final String h;
    private final Logger i;
    private final Lock j = new ReentrantLock();
    private final AtomicLong k = new AtomicLong(-1L);
    private final AtomicLong l = new AtomicLong(-1L);
    private final a m = new a(this);
    private final AtomicReference<CompositeLicense> n = new AtomicReference<Object>(null);
    private final List<LicenseEvent> o = new ArrayList<LicenseEvent>();
    private ApplicationEventPublisher p;
    private volatile boolean q = false;
    private volatile boolean r = false;
    @Autowired
    private FeatureLicenseFactory s;
    @Autowired
    private LicenseDocumentManager t;
    private CustomAssertionsRegistrar u;
    private static final String[] w;

    protected AbstractCompositeLicenseManager(Logger logger) {
        this.i = logger;
    }

    @Override
    public CompositeLicense getCurrentCompositeLicense() {
        this.j.lock();
        try {
            this.a();
            CompositeLicense compositeLicense = this.n.get();
            return compositeLicense;
        }
        finally {
            this.j.unlock();
        }
    }

    @Override
    public FeatureLicense createFeatureLicense(LicenseDocument licenseDocument) throws InvalidLicenseException {
        return this.s.newInstance(licenseDocument, a);
    }

    @Override
    public void validateLicense(FeatureLicense featureLicense) throws InvalidLicenseException {
        this.a(featureLicense);
        this.b(featureLicense);
        this.c(featureLicense);
        this.d(featureLicense);
    }

    @Override
    @Transactional
    public void installLicense(FeatureLicense featureLicense) throws LicenseInstallationException {
        this.j.lock();
        try {
            this.t.saveWithImmediateFlush(featureLicense.getLicenseDocument());
            this.c();
            this.a(w[4], (AuditDetailMessage)SystemMessages.LICENSE_INSTALLED, Long.toString(featureLicense.getId()));
        }
        catch (SaveException saveException) {
            throw new LicenseInstallationException(ExceptionUtils.getMessage((Throwable)saveException), (Throwable)saveException);
        }
        finally {
            this.j.unlock();
        }
    }

    @Override
    public void uninstallLicense(LicenseDocument licenseDocument) throws LicenseRemovalException {
        this.j.lock();
        try {
            this.t.delete((PersistentEntity)licenseDocument);
            this.c();
            this.a(w[25], (AuditDetailMessage)SystemMessages.LICENSE_REMOVED, new String[0]);
        }
        catch (DeleteException deleteException) {
            throw new LicenseRemovalException(ExceptionUtils.getMessage((Throwable)deleteException), (Throwable)deleteException);
        }
        finally {
            this.j.unlock();
        }
    }

    private void a(FeatureLicense featureLicense) throws InvalidLicenseException {
        try {
            if (!featureLicense.hasTrustedIssuer()) {
                throw new InvalidLicenseException(w[18] + featureLicense.getId() + w[17]);
            }
        }
        catch (InvalidLicenseException invalidLicenseException) {
            throw AbstractCompositeLicenseManager.a((Exception)((Object)invalidLicenseException));
        }
    }

    private void b(FeatureLicense featureLicense) throws InvalidLicenseException {
        if (!featureLicense.isLicensePeriodStartBefore(System.currentTimeMillis())) {
            String string = DateUtils.makeRelativeDateMessage((Date)featureLicense.getStartDate(), (boolean)false);
            String string2 = String.valueOf(featureLicense.getStartDate());
            long l2 = featureLicense.getId();
            String[] stringArray = w;
            throw new InvalidLicenseException(stringArray[8] + l2 + stringArray[1] + string2 + stringArray[26] + string + stringArray[11]);
        }
    }

    private void c(FeatureLicense featureLicense) throws InvalidLicenseException {
        if (!featureLicense.isLicensePeriodExpiryAfter(System.currentTimeMillis())) {
            String string = DateUtils.makeRelativeDateMessage((Date)featureLicense.getExpiryDate(), (boolean)false);
            String string2 = String.valueOf(featureLicense.getExpiryDate());
            long l2 = featureLicense.getId();
            String[] stringArray = w;
            throw new InvalidLicenseException(stringArray[18] + l2 + stringArray[7] + string2 + stringArray[6] + string + stringArray[3]);
        }
    }

    private void d(FeatureLicense featureLicense) throws InvalidLicenseException {
        block7: {
            block6: {
                try {
                    try {
                        try {
                            if (!featureLicense.isProductEnabled(e) && !featureLicense.isProductEnabled(f)) break block6;
                        }
                        catch (InvalidLicenseException invalidLicenseException) {
                            throw AbstractCompositeLicenseManager.a((Exception)((Object)invalidLicenseException));
                        }
                        if (featureLicense.isVersionEnabled(g, h)) break block7;
                    }
                    catch (InvalidLicenseException invalidLicenseException) {
                        throw AbstractCompositeLicenseManager.a((Exception)((Object)invalidLicenseException));
                    }
                    if (featureLicense.isFutureVersionEnabled(g, h)) break block7;
                }
                catch (InvalidLicenseException invalidLicenseException) {
                    throw AbstractCompositeLicenseManager.a((Exception)((Object)invalidLicenseException));
                }
            }
            String string = h;
            String string2 = g;
            String string3 = e;
            long l2 = featureLicense.getId();
            String[] stringArray = w;
            throw new InvalidLicenseException(stringArray[18] + l2 + stringArray[12] + string3 + " " + string2 + "." + string + stringArray[3]);
        }
    }

    public boolean isAssertionEnabled(Assertion assertion) {
        boolean bl2;
        block9: {
            Object object;
            String[] stringArray = w;
            Functions.Unary unary = (Functions.Unary)assertion.meta().get(stringArray[19]);
            if (assertion instanceof CustomAssertionHolder) {
                object = (CustomAssertionHolder)assertion;
                try {
                    CustomAssertionHolder customAssertionHolder = this.getCustomAssertionsRegistrar().getAssertion(object.getCustomAssertion().getClass().getName());
                    object.setRegisteredCustomFeatureSetName(customAssertionHolder.getRegisteredCustomFeatureSetName());
                }
                catch (Exception exception) {
                    stringArray = w;
                    this.i.log(Level.WARNING, stringArray[10] + exception.getMessage(), ExceptionUtils.getDebugException((Throwable)exception));
                }
            }
            object = assertion.getFeatureSetName();
            bl2 = this.isFeatureEnabled((String)object);
            try {
                if (!bl2 || unary == null) break block9;
            }
            catch (Exception exception) {
                throw AbstractCompositeLicenseManager.a(exception);
            }
            Set set = (Set)unary.call((Object)assertion);
            if (set != null) {
                CompositeLicense compositeLicense = this.n.get();
                for (String string : set) {
                    try {
                        if (compositeLicense != null && compositeLicense.isFeatureEnabled(string)) continue;
                    }
                    catch (Exception exception) {
                        throw AbstractCompositeLicenseManager.a(exception);
                    }
                    bl2 = false;
                    this.i.log(Level.INFO, w[9], new String[]{object, string});
                    break;
                }
            }
        }
        return bl2;
    }

    public void requireFeature(String string) throws LicenseException {
        try {
            if (!this.isFeatureEnabled(string)) {
                throw new LicenseException(w[16] + string + ".");
            }
        }
        catch (LicenseException licenseException) {
            throw AbstractCompositeLicenseManager.a((Exception)((Object)licenseException));
        }
    }

    public boolean isFeatureEnabled(String string) {
        if (null == string) {
            return false;
        }
        this.a();
        CompositeLicense compositeLicense = this.n.get();
        return compositeLicense != null && compositeLicense.isFeatureEnabled(string);
    }

    private void a() {
        if (System.currentTimeMillis() - this.k.get() < 21600000L) {
            return;
        }
        boolean bl2 = false;
        try {
            if (this.n.get() != null) {
                bl2 = this.j.tryLock();
            } else {
                bl2 = true;
                this.j.lock();
            }
            if (!bl2) {
                return;
            }
            this.c();
            this.k.set(System.currentTimeMillis());
        }
        finally {
            if (bl2) {
                this.j.unlock();
            }
        }
    }

    public void onApplicationEvent(EntityInvalidationEvent entityInvalidationEvent) {
        if (LicenseDocument.class.equals(entityInvalidationEvent.getEntityClass())) {
            this.b();
        }
    }

    private void b() {
        this.j.lock();
        try {
            this.k.set(-1L);
        }
        finally {
            this.j.unlock();
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Could not resolve type clashes
     * Loose catch block
     */
    private void c() {
        block44: {
            this.j.lock();
            try {
                HashMap<Long, LicenseDocument> hashMap;
                HashMap<Long, LicenseDocument> hashMap2;
                HashMap<Long, LicenseDocument> hashMap3;
                ArrayList<LicenseDocument> arrayList;
                block46: {
                    block45: {
                        String[] stringArray;
                        Collection collection;
                        block43: {
                            try {
                                collection = this.t.findAll();
                            }
                            catch (FindException findException) {
                                block42: {
                                    block41: {
                                        if (null == this.n.get()) break block41;
                                        try {
                                            block47: {
                                                if (System.currentTimeMillis() - this.l.get() >= 259200000L) break block41;
                                                break block47;
                                                catch (FindException findException2) {
                                                    throw AbstractCompositeLicenseManager.a((Exception)((Object)findException2));
                                                }
                                            }
                                            this.a(w[24], (AuditDetailMessage)SystemMessages.LICENSE_DB_ERROR_RETRY, new String[0]);
                                            break block42;
                                        }
                                        catch (FindException findException3) {
                                            throw AbstractCompositeLicenseManager.a((Exception)((Object)findException3));
                                        }
                                    }
                                    String[] stringArray2 = w;
                                    this.a(stringArray2[14], (AuditDetailMessage)SystemMessages.LICENSE_DB_ERROR_GAVEUP, new String[0]);
                                    this.a((CompositeLicense)null);
                                }
                                this.m.schedule(300000L);
                                this.j.unlock();
                                return;
                            }
                            try {
                                if (!collection.isEmpty()) break block43;
                                this.a(w[2], (AuditDetailMessage)SystemMessages.LICENSE_NO_LICENSE, new String[0]);
                                this.a((CompositeLicense)null);
                                break block44;
                            }
                            catch (FindException findException) {
                                throw AbstractCompositeLicenseManager.a((Exception)((Object)findException));
                            }
                        }
                        ArrayList<FeatureLicense> arrayList2 = new ArrayList<FeatureLicense>();
                        arrayList = new ArrayList<LicenseDocument>();
                        hashMap3 = new HashMap<Long, LicenseDocument>();
                        hashMap2 = new HashMap<Long, LicenseDocument>();
                        hashMap = new HashMap<Long, LicenseDocument>();
                        for (LicenseDocument licenseDocument : collection) {
                            try {
                                FeatureLicense featureLicense = this.createFeatureLicense(licenseDocument);
                                arrayList2.add(featureLicense);
                            }
                            catch (InvalidLicenseException invalidLicenseException) {
                                try {
                                    if (this.i.isLoggable(Level.FINE)) {
                                        this.i.log(Level.FINE, ExceptionUtils.getMessage((Throwable)invalidLicenseException), ExceptionUtils.getDebugException((Throwable)invalidLicenseException));
                                    }
                                }
                                catch (FindException findException) {
                                    throw AbstractCompositeLicenseManager.a((Exception)((Object)findException));
                                }
                                stringArray = w;
                                this.a(stringArray[23], (AuditDetailMessage)SystemMessages.LICENSE_INVALID, new String[0]);
                                arrayList.add(licenseDocument);
                            }
                        }
                        for (LicenseDocument licenseDocument : arrayList2) {
                            try {
                                this.c((FeatureLicense)licenseDocument);
                            }
                            catch (InvalidLicenseException invalidLicenseException) {
                                try {
                                    if (this.i.isLoggable(Level.FINE)) {
                                        this.i.log(Level.FINE, ExceptionUtils.getMessage((Throwable)invalidLicenseException), ExceptionUtils.getDebugException((Throwable)invalidLicenseException));
                                    }
                                }
                                catch (FindException findException) {
                                    throw AbstractCompositeLicenseManager.a((Exception)((Object)findException));
                                }
                                stringArray = w;
                                this.a(stringArray[27], (AuditDetailMessage)SystemMessages.LICENSE_EXPIRED, Long.toString(licenseDocument.getId()));
                                hashMap.put(licenseDocument.getId(), licenseDocument);
                                continue;
                            }
                            try {
                                this.b((FeatureLicense)licenseDocument);
                            }
                            catch (InvalidLicenseException invalidLicenseException) {
                                try {
                                    if (this.i.isLoggable(Level.FINE)) {
                                        this.i.log(Level.FINE, ExceptionUtils.getMessage((Throwable)invalidLicenseException), ExceptionUtils.getDebugException((Throwable)invalidLicenseException));
                                    }
                                }
                                catch (FindException findException) {
                                    throw AbstractCompositeLicenseManager.a((Exception)((Object)findException));
                                }
                                stringArray = w;
                                this.a(stringArray[28], (AuditDetailMessage)SystemMessages.LICENSE_NOT_YET_VALID, Long.toString(licenseDocument.getId()));
                                hashMap2.put(licenseDocument.getId(), licenseDocument);
                                continue;
                            }
                            try {
                                this.a((FeatureLicense)licenseDocument);
                            }
                            catch (InvalidLicenseException invalidLicenseException) {
                                try {
                                    if (this.i.isLoggable(Level.FINE)) {
                                        this.i.log(Level.FINE, ExceptionUtils.getMessage((Throwable)invalidLicenseException), ExceptionUtils.getDebugException((Throwable)invalidLicenseException));
                                    }
                                }
                                catch (FindException findException) {
                                    throw AbstractCompositeLicenseManager.a((Exception)((Object)findException));
                                }
                                stringArray = w;
                                this.a(stringArray[28], (AuditDetailMessage)SystemMessages.LICENSE_INVALID_ISSUER, Long.toString(licenseDocument.getId()));
                                hashMap2.put(licenseDocument.getId(), licenseDocument);
                                continue;
                            }
                            try {
                                this.d((FeatureLicense)licenseDocument);
                            }
                            catch (InvalidLicenseException invalidLicenseException) {
                                try {
                                    if (this.i.isLoggable(Level.FINE)) {
                                        this.i.log(Level.FINE, ExceptionUtils.getMessage((Throwable)invalidLicenseException), ExceptionUtils.getDebugException((Throwable)invalidLicenseException));
                                    }
                                }
                                catch (FindException findException) {
                                    throw AbstractCompositeLicenseManager.a((Exception)((Object)findException));
                                }
                                stringArray = w;
                                this.a(stringArray[28], (AuditDetailMessage)SystemMessages.LICENSE_INVALID_PRODUCT, Long.toString(licenseDocument.getId()));
                                hashMap2.put(licenseDocument.getId(), licenseDocument);
                                continue;
                            }
                            hashMap3.put(licenseDocument.getId(), licenseDocument);
                        }
                        try {
                            if (!hashMap3.isEmpty()) break block45;
                            this.a(w[15], (AuditDetailMessage)SystemMessages.LICENSE_NO_LICENSE, new String[0]);
                            break block46;
                        }
                        catch (FindException findException) {
                            throw AbstractCompositeLicenseManager.a((Exception)((Object)findException));
                        }
                    }
                    this.a(w[22], (AuditDetailMessage)SystemMessages.LICENSE_FOUND, new String[0]);
                }
                CompositeLicense compositeLicense = new CompositeLicense(hashMap3, hashMap2, hashMap, arrayList, this.getFeatureSetExpander());
                this.a(compositeLicense);
            }
            finally {
                this.j.unlock();
            }
        }
    }

    private void a(@Nullable CompositeLicense compositeLicense) {
        this.j.lock();
        try {
            CompositeLicense compositeLicense2 = this.n.get();
            if (this.r && ObjectUtils.equals((Object)compositeLicense2, (Object)compositeLicense)) {
                return;
            }
            this.n.set(compositeLicense);
            this.l.set(System.currentTimeMillis());
            this.r = true;
            this.b(w[21], (AuditDetailMessage)SystemMessages.LICENSE_UPDATED, new String[0]);
        }
        finally {
            this.j.unlock();
        }
    }

    private void a(String string, AuditDetailMessage auditDetailMessage, String ... stringArray) {
        String string2 = this.a(auditDetailMessage.getMessage(), stringArray);
        this.a(new LicenseEvent((Object)this, auditDetailMessage.getLevel(), string, string2));
    }

    private void b(String string, AuditDetailMessage auditDetailMessage, String ... stringArray) {
        String string2 = this.a(auditDetailMessage.getMessage(), stringArray);
        this.a(new LicenseChangeEvent((Object)this, auditDetailMessage.getLevel(), string, string2));
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private void a(LicenseEvent licenseEvent) {
        if (!this.isRunning()) {
            List<LicenseEvent> list = this.o;
            synchronized (list) {
                this.o.add(licenseEvent);
            }
        } else {
            Background.scheduleOneShot((TimerTask)new d(this, licenseEvent), (long)0L);
        }
    }

    private String a(String string, String[] stringArray) {
        return stringArray.length == 0 ? string : MessageFormat.format(string, stringArray);
    }

    protected abstract FeatureSetExpander getFeatureSetExpander();

    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.p = applicationEventPublisher;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public void start() {
        this.q = true;
        List<LicenseEvent> list = this.o;
        synchronized (list) {
            for (ApplicationEvent applicationEvent : this.o) {
                this.p.publishEvent(applicationEvent);
            }
            this.o.clear();
        }
    }

    public void stop() {
        this.m.close();
        this.q = false;
    }

    public boolean isRunning() {
        return this.q;
    }

    public int getPhase() {
        return -10000;
    }

    private static X509Certificate[] d() {
        try {
            String[] stringArray = w;
            CertificateFactory certificateFactory = CertificateFactory.getInstance(stringArray[13]);
            byte[] byArray = stringArray[20].getBytes();
            Certificate certificate = certificateFactory.generateCertificate(new ByteArrayInputStream(byArray));
            return new X509Certificate[]{(X509Certificate)certificate};
        }
        catch (Exception exception) {
            Logger.getLogger(AbstractCompositeLicenseManager.class.getName()).log(Level.SEVERE, w[0], exception);
            return null;
        }
    }

    public CustomAssertionsRegistrar getCustomAssertionsRegistrar() {
        if (this.u == null) {
            this.u = (CustomAssertionsRegistrar)this.getApplicationContext().getBean(w[5], CustomAssertionsRegistrar.class);
        }
        return this.u;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[29];
                var3_1 = 0;
                var2_2 = "egv\u0000m7sDf7\u0001n<5Ynb\u0010dr'B|d\u0016d6sYzd\u0017d sSle\u0016h4:Shc\u0007)!z\u001e$\u0010`dBo='\u0010pr\u0016!$2\\`sX!06Sfz\u0007rr%Qe~\u0006!==\u0010\n~f7\u000eh16^zr\u0002\u0019'\u0011|`t\u0007o!6\u0010`y\u0011u3?\\ls\u0018S|d\u0016n?\u0012Czr\u0010u;<^[r\u0005h!'Bhe\u0002\u0010!\u0019\u0010av\u0011!7+@`e\u0007ehsUqg\u000bs77\u0010fyB\b|`t\u0007o!6\u0010Aqzd\u0007s&:_g7E&)cM.0N!; \u0010m~\u0011`0?Um7\u0006t7sDf7\u0017o>:Sly\u0011d6sVlv\u0016t 6\u0010.0\u00190/t\u0017'6egv\u0000m7sDf7\u0005d&sS|d\u0016n?sVlv\u0016t 6\u0010zr\u0016!<2]l7\u0004s=>\u0010{r\u0005h!'BheX!\u0002\u0019'8\u0010mx\u0007rr=_}7\u0005s3=D)v\u0001b7 C)c\r!&;Yz7\u0014d  YfyBn4sDa~\u0011!\"!_mb\u0001ur{\u0005h'\"R8\tw`a\u000bo5sEy\n~f7\u000eh16^zr8darBr\"6S`q\u000bd6sVlv\u0016t 6\u0010`dBo='\u0010zb\u0012q=!DlsBn<sDa~\u0011!\u00152Dl`\u0003xhs,\u0010~v\u0011!<<D)d\u000bf<6T)u\u001b!3sD{b\u0011u77\u0010e~\u0001d< U)~\u0011r'6B'\b|`t\u0007o!6\u0010\u0011Vlv\u0016t 6clc$`1'_{n\u042d\u001d$:O,\u0010\u0016w@YBB\u0017\u0001d@Q+B\u0013\u0007u$:O,\u007fY}@^!7\u0016\u0010sHs#B\u0010\u0016}=&\nv%\u0017aP])n\b\u001aX\u007ft,@\u0003\u0016uKF#v\u001d\u0007umZ r\u0015\u0012\u0001\\R!i\u001f\u0006dNQW[\n\u001aW\u0003Y\u001bC\u0007\tgGx\u0000lk R;s\u0012[\n\u001eHNS#V\u00104~_U#L\u0006\u0017\u0000qg;3\u0004&S;B\u0005U`\t]h@,m19qlQ\u00151%\u001ddH\"hL80GGC'5\u001f9rhQ\u00151+\u001ddH\"/k\u000b$~]RVL8\u0011QDS\ty\u001a\u0007qkU\u0005O\u0004\u0011qfC$D*;U^A\u001bH\u00160W_P4kX2w<a\u0000Fk=Q^A\u0018L\u00004GOp;E\u0004\u0002aMR\u00158\u001f2gG{\u0000o\u001c?yL.\u000f[??ZSO+v54uaZ#1\u0015\u0010cxP1H0`:MF'C\u0013\u0002eHVVH\u0010\u0017WH`\u0005f\u0017\u0019qf^ @\u001aej| !x\u0018=@&B\u0013I>\t\u0003^Y'xf\u001c{Qm\u000fre>_\u007fn\u00065\u0010#Ak\u001dTE\u0000\u0001JFfMp\b5}Dy\rJ\u0011\t\u0005}R\u0012@\u001d\u0017G0S2Q\u0018\u001b_L$\u0000Y\u0004e\u0007mS5U<\u0017~~T77e!\u0001o_ G#\u0007ACv \u000b\u00054e8P\u0018f+xfl ,7\u00102_lV:W\u00184uQEWck\u001efOv\u0000g\u0015bvPd\u0013D0%{~B\u0014N\u0004\"_~&:F\u001e<`^f#J\u0002Y\u0003os E\u0007\u0003\u007fCp%T<!JP&\u0012C$\u0011cE{3n\u0019)w[<\u0004I\u0004!}g&\u0018P\u0000\u0000\tDQ\u0003m%)yne\u0005w\u0017\u0006HlC#6`\u0017v\u0003PQ[\u0018\u0019\u0004>r\t*\u001d>iY \u00134\u001c)J8e!R\u0010:\\\u007f !U\u0005kdJM/J\u001e\u0019cK_\u0004Cb#`Mv+L\u001e7`mM\u0013N7 \u0003gph88\u000bE^g4B\u001a\u001a\u001fe{\by8\u0011r^Y6o7|V\\z,952I]\\6{&\u0012\u0004\\u-.:6zLT#v\u0017\u0012q]V,C58Aa|\u000bFXjG9U#P\u0003\u0015qHX!@\u0003\u0016qLB&S'#\bg{ s\u0019eJ;&S5\u00006\u007f;p\u0016*9xj~c\u0013c\u0001\u001awKZ/79\u0010{\u007fy7We5:Kz\u000b8\n=Fn{/.78]BU,H#\u001eh|T\bc\u001d0bxp747:EBg\u0014b&\u001bbsB)U\u001a\u0007\tJ\\7P4\u0001\u0007f`P*\u00198A1\u001dRw\u0016dzJt\u0011c\u001b\"tp@&6& V&E%O\u001e\u001dj@t-F'\u0011vMe(ycx\\GxZS}\u0015\\Qy\u0007r&\u000bw_^0B\u001e*x\"NP\u000b%kw\u007fa\u000fT6\u0018}pz\u00131\u00137@{&Vwf\u0011\u0006&<\u001ah9+gCx7W\u0006$^K[!O\u0005<qx~\u0018B8?Q0{\u000f5%\u001cDBf\u0011RcY\b]n&w\u0010xBE.%{y\u0018\u0005ZE7y\"\u0004D9V&S\u0005\u0006z[s\u000fG`jx1P\u0001E\u00070QH\\UJ3ercn\u0010N:\u0016\t}!\u0007l\u0010dU\u0003t:.\u000b?\u001b[p\u0015X3gv:&VNb+rNGTc3\"D_nM4\u0010\u001cR}b\u0001@on:$:O,\u007f\u0016~M7!D\u0000\u0007yO^!@\u0006\u0016\u001d$:O,\u0007eys\u0003u77\u0010|`t\u0007o!6\u0018z>Bg=&^m\u000fyga\u0003m;7\u0010e~\u0001d< U\bblc\u0010x;=W\u000f|`t\u0007o!6\u0010{r\u000fn$6T\u0002\u0010!";
                var4_3 = "egv\u0000m7sDf7\u0001n<5Ynb\u0010dr'B|d\u0016d6sYzd\u0017d sSle\u0016h4:Shc\u0007)!z\u001e$\u0010`dBo='\u0010pr\u0016!$2\\`sX!06Sfz\u0007rr%Qe~\u0006!==\u0010\n~f7\u000eh16^zr\u0002\u0019'\u0011|`t\u0007o!6\u0010`y\u0011u3?\\ls\u0018S|d\u0016n?\u0012Czr\u0010u;<^[r\u0005h!'Bhe\u0002\u0010!\u0019\u0010av\u0011!7+@`e\u0007ehsUqg\u000bs77\u0010fyB\b|`t\u0007o!6\u0010Aqzd\u0007s&:_g7E&)cM.0N!; \u0010m~\u0011`0?Um7\u0006t7sDf7\u0017o>:Sly\u0011d6sVlv\u0016t 6\u0010.0\u00190/t\u0017'6egv\u0000m7sDf7\u0005d&sS|d\u0016n?sVlv\u0016t 6\u0010zr\u0016!<2]l7\u0004s=>\u0010{r\u0005h!'BheX!\u0002\u0019'8\u0010mx\u0007rr=_}7\u0005s3=D)v\u0001b7 C)c\r!&;Yz7\u0014d  YfyBn4sDa~\u0011!\"!_mb\u0001ur{\u0005h'\"R8\tw`a\u000bo5sEy\n~f7\u000eh16^zr8darBr\"6S`q\u000bd6sVlv\u0016t 6\u0010`dBo='\u0010zb\u0012q=!DlsBn<sDa~\u0011!\u00152Dl`\u0003xhs,\u0010~v\u0011!<<D)d\u000bf<6T)u\u001b!3sD{b\u0011u77\u0010e~\u0001d< U)~\u0011r'6B'\b|`t\u0007o!6\u0010\u0011Vlv\u0016t 6clc$`1'_{n\u042d\u001d$:O,\u0010\u0016w@YBB\u0017\u0001d@Q+B\u0013\u0007u$:O,\u007fY}@^!7\u0016\u0010sHs#B\u0010\u0016}=&\nv%\u0017aP])n\b\u001aX\u007ft,@\u0003\u0016uKF#v\u001d\u0007umZ r\u0015\u0012\u0001\\R!i\u001f\u0006dNQW[\n\u001aW\u0003Y\u001bC\u0007\tgGx\u0000lk R;s\u0012[\n\u001eHNS#V\u00104~_U#L\u0006\u0017\u0000qg;3\u0004&S;B\u0005U`\t]h@,m19qlQ\u00151%\u001ddH\"hL80GGC'5\u001f9rhQ\u00151+\u001ddH\"/k\u000b$~]RVL8\u0011QDS\ty\u001a\u0007qkU\u0005O\u0004\u0011qfC$D*;U^A\u001bH\u00160W_P4kX2w<a\u0000Fk=Q^A\u0018L\u00004GOp;E\u0004\u0002aMR\u00158\u001f2gG{\u0000o\u001c?yL.\u000f[??ZSO+v54uaZ#1\u0015\u0010cxP1H0`:MF'C\u0013\u0002eHVVH\u0010\u0017WH`\u0005f\u0017\u0019qf^ @\u001aej| !x\u0018=@&B\u0013I>\t\u0003^Y'xf\u001c{Qm\u000fre>_\u007fn\u00065\u0010#Ak\u001dTE\u0000\u0001JFfMp\b5}Dy\rJ\u0011\t\u0005}R\u0012@\u001d\u0017G0S2Q\u0018\u001b_L$\u0000Y\u0004e\u0007mS5U<\u0017~~T77e!\u0001o_ G#\u0007ACv \u000b\u00054e8P\u0018f+xfl ,7\u00102_lV:W\u00184uQEWck\u001efOv\u0000g\u0015bvPd\u0013D0%{~B\u0014N\u0004\"_~&:F\u001e<`^f#J\u0002Y\u0003os E\u0007\u0003\u007fCp%T<!JP&\u0012C$\u0011cE{3n\u0019)w[<\u0004I\u0004!}g&\u0018P\u0000\u0000\tDQ\u0003m%)yne\u0005w\u0017\u0006HlC#6`\u0017v\u0003PQ[\u0018\u0019\u0004>r\t*\u001d>iY \u00134\u001c)J8e!R\u0010:\\\u007f !U\u0005kdJM/J\u001e\u0019cK_\u0004Cb#`Mv+L\u001e7`mM\u0013N7 \u0003gph88\u000bE^g4B\u001a\u001a\u001fe{\by8\u0011r^Y6o7|V\\z,952I]\\6{&\u0012\u0004\\u-.:6zLT#v\u0017\u0012q]V,C58Aa|\u000bFXjG9U#P\u0003\u0015qHX!@\u0003\u0016qLB&S'#\bg{ s\u0019eJ;&S5\u00006\u007f;p\u0016*9xj~c\u0013c\u0001\u001awKZ/79\u0010{\u007fy7We5:Kz\u000b8\n=Fn{/.78]BU,H#\u001eh|T\bc\u001d0bxp747:EBg\u0014b&\u001bbsB)U\u001a\u0007\tJ\\7P4\u0001\u0007f`P*\u00198A1\u001dRw\u0016dzJt\u0011c\u001b\"tp@&6& V&E%O\u001e\u001dj@t-F'\u0011vMe(ycx\\GxZS}\u0015\\Qy\u0007r&\u000bw_^0B\u001e*x\"NP\u000b%kw\u007fa\u000fT6\u0018}pz\u00131\u00137@{&Vwf\u0011\u0006&<\u001ah9+gCx7W\u0006$^K[!O\u0005<qx~\u0018B8?Q0{\u000f5%\u001cDBf\u0011RcY\b]n&w\u0010xBE.%{y\u0018\u0005ZE7y\"\u0004D9V&S\u0005\u0006z[s\u000fG`jx1P\u0001E\u00070QH\\UJ3ercn\u0010N:\u0016\t}!\u0007l\u0010dU\u0003t:.\u000b?\u001b[p\u0015X3gv:&VNb+rNGTc3\"D_nM4\u0010\u001cR}b\u0001@on:$:O,\u007f\u0016~M7!D\u0000\u0007yO^!@\u0006\u0016\u001d$:O,\u0007eys\u0003u77\u0010|`t\u0007o!6\u0018z>Bg=&^m\u000fyga\u0003m;7\u0010e~\u0001d< U\bblc\u0010x;=W\u000f|`t\u0007o!6\u0010{r\u000fn$6T\u0002\u0010!".length();
                var1_4 = 50;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 45;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = AbstractCompositeLicenseManager.a(v0, AbstractCompositeLicenseManager.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "9=+G?{{\\)2M(pl\u0019\u000f5+-O!w{\\)2M(pl\u0019";
                    var4_3 = "9=+G?{{\\)2M(pl\u0019\u000f5+-O!w{\\)2M(pl\u0019".length();
                    var1_4 = 15;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 97;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = AbstractCompositeLicenseManager.a(v0, AbstractCompositeLicenseManager.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        AbstractCompositeLicenseManager.w = var5;
        AbstractCompositeLicenseManager.a = AbstractCompositeLicenseManager.d();
        AbstractCompositeLicenseManager.e = BuildInfo.getProductName();
        AbstractCompositeLicenseManager.f = BuildInfo.getLegacyProductName();
        AbstractCompositeLicenseManager.g = BuildInfo.getProductVersionMajor();
        AbstractCompositeLicenseManager.h = BuildInfo.getProductVersionMinor();
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x7E);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 29;
                    case 1 -> 36;
                    case 2 -> 58;
                    case 3 -> 79;
                    case 4 -> 44;
                    case 5 -> 127;
                    default -> 126;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

