/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.policy.variable.Syntax
 *  com.l7tech.util.Either
 *  com.l7tech.util.NameValuePair
 */
package com.l7tech.server.policy.assertion;

import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.policy.variable.Syntax;
import com.l7tech.server.policy.assertion.ae;
import com.l7tech.server.policy.variable.ExpandVariables;
import com.l7tech.util.Either;
import com.l7tech.util.NameValuePair;
import java.util.Map;
import java.util.regex.Pattern;

final class ad {
    final Either<Pattern, String> a;
    final String b;

    private ad(NameValuePair nameValuePair) {
        this.a = ad.a((String)nameValuePair.left);
        this.b = (String)nameValuePair.right;
    }

    private static Either<Pattern, String> a(String string) {
        if (Syntax.getReferencedNames((String)string).length > 0) {
            return Either.right((Object)string);
        }
        return Either.left((Object)Pattern.compile(string, 40));
    }

    private Pattern a(Map<String, ?> map, Audit audit) {
        if (this.a.isLeft()) {
            return (Pattern)this.a.left();
        }
        String string = (String)this.a.right();
        String string2 = ExpandVariables.process(string, map, audit, new ae(this));
        return Pattern.compile(string2, 40);
    }
}

