/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.AdminAuditRecord
 *  com.l7tech.gateway.common.audit.AuditRecord
 *  com.l7tech.gateway.common.audit.AuditRecordUtils
 *  com.l7tech.gateway.common.audit.MessageSummaryAuditRecord
 *  com.l7tech.gateway.common.audit.SystemAuditRecord
 */
package com.l7tech.server.policy.variable;

import com.l7tech.gateway.common.audit.AdminAuditRecord;
import com.l7tech.gateway.common.audit.AuditRecord;
import com.l7tech.gateway.common.audit.AuditRecordUtils;
import com.l7tech.gateway.common.audit.MessageSummaryAuditRecord;
import com.l7tech.gateway.common.audit.SystemAuditRecord;
import com.l7tech.server.policy.variable.ExpandVariables;
import com.l7tech.server.policy.variable.aq;

class b
implements aq<AuditRecord> {
    private static final String a = b.a(95, b.a("t\u0010\u0011SRD|"));

    b() {
    }

    @Override
    public ExpandVariables.Selector.Selection getFieldValue(AuditRecord auditRecord, String string) {
        String string2 = auditRecord instanceof MessageSummaryAuditRecord ? AuditRecordUtils.TYPE_MESSAGE : (auditRecord instanceof SystemAuditRecord ? AuditRecordUtils.TYPE_SYSTEM : (auditRecord instanceof AdminAuditRecord ? AuditRecordUtils.TYPE_ADMIN : a));
        return new ExpandVariables.Selector.Selection(string2);
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x4D);
        }
        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 -> 94;
                    case 1 -> 33;
                    case 2 -> 37;
                    case 3 -> 98;
                    case 4 -> 98;
                    case 5 -> 108;
                    default -> 77;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

