package com.l7tech.external.assertions.gatewaymanagement.server;

import com.l7tech.gateway.common.security.rbac.OperationType;
import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.policy.Policy;
import com.l7tech.wsdl.Wsdl;
import com.l7tech.xml.soap.SoapVersion;
import javax.wsdl.WSDLException;

class c3 implements be {
   private PublishedService a;
   final c2 this$1;
   private static final String b;

   c3(c2 var1) {
      this.this$1 = var1;
   }

   private PublishedService a() throws ResourceFactory.ResourceNotFoundException {
      PublishedService var1 = this.a;
      if (var1 == null) {
         var1 = this.this$1.this$0.selectEntity(this.this$1.val$selectorMap);
         this.this$1.this$0.checkPermitted(OperationType.READ, null, var1);
         this.a = var1;
      }

      return var1;
   }

   @Override
   public Policy resolve() throws ResourceFactory.ResourceNotFoundException {
      return this.a().getPolicy();
   }

   @Override
   public Wsdl resolveWsdl() throws ResourceFactory.ResourceNotFoundException {
      try {
         return this.a().parsedWsdl();
      } catch (WSDLException var2) {
         throw new ResourceFactory.ResourceAccessException(b);
      }
   }

   @Override
   public SoapVersion resolveSoapVersion() throws ResourceFactory.ResourceNotFoundException {
      return this.a().getSoapVersion();
   }

   static {
      String var10002 = a(5, a("UncXc\\V<WF}C"));
      byte var10001 = -1;
      b = var10002;
   }

   private static char[] a(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 55);
      }

      return var10000;
   }

   private static String a(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 25;
            case 1 -> 5;
            case 2 -> 16;
            case 3 -> 60;
            case 4 -> 10;
            case 5 -> 48;
            default -> 55;
         });
      }

      return new String(var10001).intern();
   }
}
