/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.encass.EncapsulatedAssertionConfig
 *  com.l7tech.util.Either
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.context.ApplicationListener
 */
package com.l7tech.server.policy.assertion;

import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.encass.EncapsulatedAssertionConfig;
import com.l7tech.server.event.EntityInvalidationEvent;
import com.l7tech.server.policy.assertion.ServerEncapsulatedAssertion;
import com.l7tech.util.Either;
import java.util.logging.Level;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

class q
implements ApplicationListener {
    final Either val$configOrError;
    final ServerEncapsulatedAssertion this$0;
    private static final String[] a;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    q(ServerEncapsulatedAssertion serverEncapsulatedAssertion, Either either) {
        this.this$0 = serverEncapsulatedAssertion;
        this.val$configOrError = either;
    }

    public void onApplicationEvent(ApplicationEvent applicationEvent) {
        EntityInvalidationEvent entityInvalidationEvent;
        if (applicationEvent instanceof EntityInvalidationEvent && (entityInvalidationEvent = (EntityInvalidationEvent)applicationEvent).getEntityClass().equals(EncapsulatedAssertionConfig.class)) {
            if (this.val$configOrError.isLeft()) {
                String[] stringArray = a;
                this.this$0.logger.log(Level.FINE, stringArray[0]);
                this.this$0.a(this.this$0.b());
            } else {
                Goid goid = ((EncapsulatedAssertionConfig)this.val$configOrError.right()).getGoid();
                for (Goid goid2 : entityInvalidationEvent.getEntityIds()) {
                    if (!goid2.equals((Object)goid)) continue;
                    this.this$0.logger.log(Level.FINE, a[1] + String.valueOf(goid));
                    this.this$0.a(this.this$0.b());
                    break;
                }
            }
        }
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "GB\u0006~\u0011P8oX\u0015;\bOljY\u0013\u007f\\E\"eW\u0002h\tL-rS\u0016;\u001dS?cD\u0006r\u0013NleY\u001c}\u0015G0TS\u001et\u001dD%hQR~\u0012C-vE\u0007w\u001dT)b\u0016\u0013h\u000fE>r_\u001du\\C#hP\u001b|\\F#t\u0016=R8\u0000";
        int n3 = "GB\u0006~\u0011P8oX\u0015;\bOljY\u0013\u007f\\E\"eW\u0002h\tL-rS\u0016;\u001dS?cD\u0006r\u0013NleY\u001c}\u0015G0TS\u001et\u001dD%hQR~\u0012C-vE\u0007w\u001dT)b\u0016\u0013h\u000fE>r_\u001du\\C#hP\u001b|\\F#t\u0016=R8\u0000".length();
        int n4 = 48;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = q.a(90, q.a(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                a = stringArray;
                return;
            }
            n4 = string.charAt(n5);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x16);
        }
        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 -> 92;
                    case 1 -> 108;
                    case 2 -> 40;
                    case 3 -> 65;
                    case 4 -> 38;
                    case 5 -> 122;
                    default -> 22;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

