package com.l7tech.server.transport.jms2;

import com.l7tech.gateway.common.transport.jms.JmsAcknowledgementType;
import com.l7tech.gateway.common.transport.jms.JmsConnection;
import com.l7tech.gateway.common.transport.jms.JmsEndpoint;
import com.l7tech.gateway.common.transport.jms.JmsReplyType;
import com.l7tech.objectmodel.Goid;
import com.l7tech.policy.JmsDynamicProperties;
import com.l7tech.server.transport.jms.JmsConfigException;
import com.l7tech.server.transport.jms.JmsPropertyMapper;
import com.l7tech.server.transport.jms.JmsUtil;
import java.util.Properties;
import javax.jms.Destination;
import javax.jms.IllegalStateException;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.naming.Context;
import javax.naming.NamingException;
import org.springframework.context.ApplicationContext;

public class JmsEndpointConfig {
   private final JmsConnection a;
   private final JmsEndpoint b;
   private final JmsPropertyMapper c;
   private Boolean d;
   private Boolean e;
   private final ApplicationContext f;
   private final String g;
   private JmsEndpointConfig.JmsEndpointKey h;
   private boolean i = true;
   private static final String[] j;

   public JmsEndpointConfig(JmsConnection var1, JmsEndpoint var2, JmsPropertyMapper var3, ApplicationContext var4) {
      this(var1, var2, var3, var4, new JmsDynamicProperties());
   }

   public JmsEndpointConfig(JmsConnection var1, JmsEndpoint var2, JmsPropertyMapper var3, ApplicationContext var4, JmsDynamicProperties var5) {
      this.e = var2.isTemplate() || var1.isTemplate();
      if (this.e) {
         JmsConnection var6 = new JmsConnection(var1, false);
         JmsEndpoint var7 = new JmsEndpoint(var2, false);
         this.a(var6, var7, var5);
         this.a = new JmsConnection(var6, true);
         this.b = new JmsEndpoint(var7, true);
      } else {
         this.a = new JmsConnection(var1, true);
         this.b = new JmsEndpoint(var2, true);
      }

      this.c = var3;
      this.f = var4;
      StringBuilder var8 = new StringBuilder(this.getEndpoint().getName())
         .append(",")
         .append(this.getConnection().getJndiUrl())
         .append("/")
         .append(this.getEndpoint().getDestinationName());
      this.g = var8.toString();
   }

   public boolean isEvictOnExpired() {
      return this.i;
   }

   public void setEvictOnExpired(boolean var1) {
      this.i = var1;
   }

   public ApplicationContext getApplicationContext() {
      return this.f;
   }

   public JmsConnection getConnection() {
      return this.a;
   }

   public JmsEndpoint getEndpoint() {
      return this.b;
   }

   public JmsReplyType getReplyType() {
      return this.b.getReplyType();
   }

   public JmsPropertyMapper getPropertyMapper() {
      return this.c;
   }

   Destination a(Message var1, Context var2) throws JMSException, NamingException {
      try {
         if (JmsReplyType.NO_REPLY.equals(this.getReplyType())) {
            return null;
         }
      } catch (JMSException var4) {
         throw a(var4);
      }

      try {
         if (JmsReplyType.AUTOMATIC.equals(this.getReplyType())) {
            return var1.getJMSReplyTo();
         }
      } catch (JMSException var5) {
         throw a(var5);
      }

      if (JmsReplyType.REPLY_TO_OTHER.equals(this.getReplyType())) {
         String var6 = this.b.getReplyToQueueName();
         return JmsUtil.cast(var2.lookup(var6), Destination.class);
      } else {
         String var3 = j[2] + this.getReplyType().toString();
         throw new IllegalStateException(var3);
      }
   }

   public String getDisplayName() {
      return this.g;
   }

   public JmsEndpointConfig.JmsEndpointKey getJmsEndpointKey() {
      if (this.h == null) {
         this.h = new JmsEndpointConfig.JmsEndpointKey(this.b, this.a);
      }

      return this.h;
   }

   public boolean isTransactional() {
      if (this.d == null) {
         this.d = this.b.getAcknowledgementType() == JmsAcknowledgementType.ON_COMPLETION;
      }

      return this.d;
   }

   public boolean isDynamic() {
      return this.e;
   }

   public boolean isQueue() {
      return this.b.isQueue();
   }

   public void validate() throws JmsConfigException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 0
      // 001: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.a Lcom/l7tech/gateway/common/transport/jms/JmsConnection;
      // 004: invokevirtual com/l7tech/gateway/common/transport/jms/JmsConnection.getInitialContextFactoryClassname ()Ljava/lang/String;
      // 007: ifnull 020
      // 00a: ldc ""
      // 00c: aload 0
      // 00d: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.a Lcom/l7tech/gateway/common/transport/jms/JmsConnection;
      // 010: invokevirtual com/l7tech/gateway/common/transport/jms/JmsConnection.getInitialContextFactoryClassname ()Ljava/lang/String;
      // 013: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 016: ifeq 032
      // 019: goto 020
      // 01c: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 01f: athrow
      // 020: new com/l7tech/server/transport/jms/JmsConfigException
      // 023: dup
      // 024: getstatic com/l7tech/server/transport/jms2/JmsEndpointConfig.j [Ljava/lang/String;
      // 027: bipush 9
      // 029: aaload
      // 02a: invokespecial com/l7tech/server/transport/jms/JmsConfigException.<init> (Ljava/lang/String;)V
      // 02d: athrow
      // 02e: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 031: athrow
      // 032: aload 0
      // 033: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.a Lcom/l7tech/gateway/common/transport/jms/JmsConnection;
      // 036: invokevirtual com/l7tech/gateway/common/transport/jms/JmsConnection.getJndiUrl ()Ljava/lang/String;
      // 039: ifnull 052
      // 03c: ldc ""
      // 03e: aload 0
      // 03f: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.a Lcom/l7tech/gateway/common/transport/jms/JmsConnection;
      // 042: invokevirtual com/l7tech/gateway/common/transport/jms/JmsConnection.getJndiUrl ()Ljava/lang/String;
      // 045: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 048: ifeq 063
      // 04b: goto 052
      // 04e: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 051: athrow
      // 052: new com/l7tech/server/transport/jms/JmsConfigException
      // 055: dup
      // 056: getstatic com/l7tech/server/transport/jms2/JmsEndpointConfig.j [Ljava/lang/String;
      // 059: bipush 4
      // 05a: aaload
      // 05b: invokespecial com/l7tech/server/transport/jms/JmsConfigException.<init> (Ljava/lang/String;)V
      // 05e: athrow
      // 05f: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 062: athrow
      // 063: aload 0
      // 064: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.a Lcom/l7tech/gateway/common/transport/jms/JmsConnection;
      // 067: invokevirtual com/l7tech/gateway/common/transport/jms/JmsConnection.getQueueFactoryUrl ()Ljava/lang/String;
      // 06a: ifnull 083
      // 06d: ldc ""
      // 06f: aload 0
      // 070: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.a Lcom/l7tech/gateway/common/transport/jms/JmsConnection;
      // 073: invokevirtual com/l7tech/gateway/common/transport/jms/JmsConnection.getQueueFactoryUrl ()Ljava/lang/String;
      // 076: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 079: ifeq 095
      // 07c: goto 083
      // 07f: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 082: athrow
      // 083: new com/l7tech/server/transport/jms/JmsConfigException
      // 086: dup
      // 087: getstatic com/l7tech/server/transport/jms2/JmsEndpointConfig.j [Ljava/lang/String;
      // 08a: bipush 7
      // 08c: aaload
      // 08d: invokespecial com/l7tech/server/transport/jms/JmsConfigException.<init> (Ljava/lang/String;)V
      // 090: athrow
      // 091: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 094: athrow
      // 095: aload 0
      // 096: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.b Lcom/l7tech/gateway/common/transport/jms/JmsEndpoint;
      // 099: invokevirtual com/l7tech/gateway/common/transport/jms/JmsEndpoint.getReplyType ()Lcom/l7tech/gateway/common/transport/jms/JmsReplyType;
      // 09c: getstatic com/l7tech/gateway/common/transport/jms/JmsReplyType.REPLY_TO_OTHER Lcom/l7tech/gateway/common/transport/jms/JmsReplyType;
      // 09f: if_acmpne 0da
      // 0a2: aload 0
      // 0a3: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.b Lcom/l7tech/gateway/common/transport/jms/JmsEndpoint;
      // 0a6: invokevirtual com/l7tech/gateway/common/transport/jms/JmsEndpoint.getReplyToQueueName ()Ljava/lang/String;
      // 0a9: ifnull 0c9
      // 0ac: goto 0b3
      // 0af: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0b2: athrow
      // 0b3: ldc ""
      // 0b5: aload 0
      // 0b6: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.b Lcom/l7tech/gateway/common/transport/jms/JmsEndpoint;
      // 0b9: invokevirtual com/l7tech/gateway/common/transport/jms/JmsEndpoint.getReplyToQueueName ()Ljava/lang/String;
      // 0bc: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 0bf: ifeq 0da
      // 0c2: goto 0c9
      // 0c5: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0c8: athrow
      // 0c9: new com/l7tech/server/transport/jms/JmsConfigException
      // 0cc: dup
      // 0cd: getstatic com/l7tech/server/transport/jms2/JmsEndpointConfig.j [Ljava/lang/String;
      // 0d0: bipush 1
      // 0d1: aaload
      // 0d2: invokespecial com/l7tech/server/transport/jms/JmsConfigException.<init> (Ljava/lang/String;)V
      // 0d5: athrow
      // 0d6: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0d9: athrow
      // 0da: aload 0
      // 0db: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.b Lcom/l7tech/gateway/common/transport/jms/JmsEndpoint;
      // 0de: invokevirtual com/l7tech/gateway/common/transport/jms/JmsEndpoint.getDestinationName ()Ljava/lang/String;
      // 0e1: ifnull 0fa
      // 0e4: ldc ""
      // 0e6: aload 0
      // 0e7: getfield com/l7tech/server/transport/jms2/JmsEndpointConfig.b Lcom/l7tech/gateway/common/transport/jms/JmsEndpoint;
      // 0ea: invokevirtual com/l7tech/gateway/common/transport/jms/JmsEndpoint.getDestinationName ()Ljava/lang/String;
      // 0ed: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 0f0: ifeq 10b
      // 0f3: goto 0fa
      // 0f6: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0f9: athrow
      // 0fa: new com/l7tech/server/transport/jms/JmsConfigException
      // 0fd: dup
      // 0fe: getstatic com/l7tech/server/transport/jms2/JmsEndpointConfig.j [Ljava/lang/String;
      // 101: bipush 3
      // 102: aaload
      // 103: invokespecial com/l7tech/server/transport/jms/JmsConfigException.<init> (Ljava/lang/String;)V
      // 106: athrow
      // 107: invokestatic com/l7tech/server/transport/jms2/JmsEndpointConfig.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 10a: athrow
      // 10b: return
      // try (0 -> 10): 11 com/l7tech/server/transport/jms/JmsConfigException
      // try (4 -> 20): 20 com/l7tech/server/transport/jms/JmsConfigException
      // try (22 -> 32): 33 com/l7tech/server/transport/jms/JmsConfigException
      // try (26 -> 42): 42 com/l7tech/server/transport/jms/JmsConfigException
      // try (44 -> 54): 55 com/l7tech/server/transport/jms/JmsConfigException
      // try (48 -> 64): 64 com/l7tech/server/transport/jms/JmsConfigException
      // try (66 -> 75): 76 com/l7tech/server/transport/jms/JmsConfigException
      // try (71 -> 84): 85 com/l7tech/server/transport/jms/JmsConfigException
      // try (78 -> 94): 94 com/l7tech/server/transport/jms/JmsConfigException
      // try (96 -> 106): 107 com/l7tech/server/transport/jms/JmsConfigException
      // try (100 -> 116): 116 com/l7tech/server/transport/jms/JmsConfigException
   }

   private void a(JmsConnection var1, JmsEndpoint var2, JmsDynamicProperties var3) {
      if (var1.getInitialContextFactoryClassname() == null || "".equals(var1.getInitialContextFactoryClassname())) {
         var1.setInitialContextFactoryClassname(var3.getIcfName());
      }

      if (var1.getJndiUrl() == null || "".equals(var1.getJndiUrl())) {
         var1.setJndiUrl(var3.getJndiUrl());
      }

      Properties var4 = var1.properties();
      boolean var5 = false;
      String[] var8 = j;
      String var6 = (String)var4.get(var8[0]);
      if (var6 != null && "".equals(var6)) {
         var4.setProperty(var8[8], var3.getJndiUserName());
         var5 = true;
      }

      var8 = j;
      String var7 = (String)var4.get(var8[6]);
      if (var7 != null && "".equals(var7)) {
         var4.setProperty(var8[5], var3.getJndiPassword());
         var5 = true;
      }

      if (var5) {
         var1.properties(var4);
      }

      if (var1.getQueueFactoryUrl() == null || "".equals(var1.getQueueFactoryUrl())) {
         var1.setQueueFactoryUrl(var3.getQcfName());
      }

      if (var2.getReplyToQueueName() == null || "".equals(var2.getReplyToQueueName())) {
         var2.setReplyToQueueName(var3.getReplytoQName());
      }

      if (var2.getDestinationName() == null || "".equals(var2.getDestinationName())) {
         var2.setDestinationName(var3.getDestQName());
      }

      if (var2.getUsername() != null && "".equals(var2.getUsername())) {
         var2.setUsername(var3.getDestUserName());
      }

      if (var2.getPassword() != null && "".equals(var2.getPassword())) {
         var2.setPassword(var3.getDestPassword());
      }
   }

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

   static {
      String[] var5 = new String[10];
      int var3 = 0;
      String var2 = "j\u0014;c\"v\u0019m\u001c#e\"k\u001dc\u0000?kxaVp\u0007$loq\ba\u0019\u001aR\u0010=nu8\foU<wim\u001d \u001c>\"~}\tu\u001c?gh\u0015U\u001b&lco\u0016 ? q^}\bl\f\u0019{|}X\"D\u0010>vev\u0019t\u001c\"l,i\re\u0000(\"by\u0015eU$q,j\u001dq\u0000$pi|\u0014J;\tK,M*LU$q,j\u001dq\u0000$pi| j\u0014;c\"v\u0019m\u001c#e\"k\u001dc\u0000?kxaVc\u0007(fiv\fi\u0014!q j\u0014;c\"v\u0019m\u001c#e\"k\u001dc\u0000?kxaVc\u0007(fiv\fi\u0014!q)Q\u0000(wi8\u001bo\u001b#gol\u0011o\u001bmdm{\fo\u00074\"by\u0015eU$q,j\u001dq\u0000$pi|";
      int var4 = "j\u0014;c\"v\u0019m\u001c#e\"k\u001dc\u0000?kxaVp\u0007$loq\ba\u0019\u001aR\u0010=nu8\foU<wim\u001d \u001c>\"~}\tu\u001c?gh\u0015U\u001b&lco\u0016 ? q^}\bl\f\u0019{|}X\"D\u0010>vev\u0019t\u001c\"l,i\re\u0000(\"by\u0015eU$q,j\u001dq\u0000$pi|\u0014J;\tK,M*LU$q,j\u001dq\u0000$pi| j\u0014;c\"v\u0019m\u001c#e\"k\u001dc\u0000?kxaVc\u0007(fiv\fi\u0014!q j\u0014;c\"v\u0019m\u001c#e\"k\u001dc\u0000?kxaVc\u0007(fiv\fi\u0014!q)Q\u0000(wi8\u001bo\u001b#gol\u0011o\u001bmdm{\fo\u00074\"by\u0015eU$q,j\u001dq\u0000$pi|"
         .length();
      char var1 = 30;
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 23;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var8 = a(var10000, a(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     j = var5;
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var8;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = "\nt[\u0003B\u0016y\r|C\u0005B\u000b}\u0003`_\u000b\u0018\u00016\u0010gD\f\u000f\u0011h\u0001y.){D\u0016\u0005\u0019t@vB\f\u0018\u001d`\u00145K\u0003\u000f\fw\u0012l\r\u0001\u0000\u0019k\u00135C\u0003\u0001\u001d8\tf\r\u0010\t\tm\tgH\u0006";
                  var4 = "\nt[\u0003B\u0016y\r|C\u0005B\u000b}\u0003`_\u000b\u0018\u00016\u0010gD\f\u000f\u0011h\u0001y.){D\u0016\u0005\u0019t@vB\f\u0018\u001d`\u00145K\u0003\u000f\fw\u0012l\r\u0001\u0000\u0019k\u00135C\u0003\u0001\u001d8\tf\r\u0010\t\tm\tgH\u0006"
                     .length();
                  var1 = 30;
                  var7 = -1;
            }

            var10000 = 119;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

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

      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 -> 23;
            case 1 -> 98;
            case 2 -> 90;
            case 3 -> 21;
            case 4 -> 27;
            case 5 -> 15;
            default -> 111;
         });
      }

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

   public static class JmsEndpointKey {
      private final Goid a;
      private final int b;
      private final Goid c;
      private final int d;
      private final String e;
      private final String f;
      private final String g;
      private final String h;
      private final String i;
      private static final String j;

      private JmsEndpointKey(JmsEndpoint var1, JmsConnection var2) {
         this.a = var1.getGoid();
         this.b = var1.getVersion();
         this.c = var2.getGoid();
         this.d = var2.getVersion();
         if (!var1.isTemplate() && !var2.isTemplate()) {
            this.e = null;
            this.f = null;
            this.g = null;
            this.h = null;
            this.i = null;
         } else {
            this.e = var2.getInitialContextFactoryClassname();
            this.f = var2.getJndiUrl();
            this.g = var2.getQueueFactoryUrl();
            this.h = var1.getDestinationName();
            this.i = var1.getReplyToQueueName();
         }
      }

      @Override
      public boolean equals(Object var1) {
         if (this == var1) {
            return true;
         }

         if (var1 != null && this.getClass() == var1.getClass()) {
            JmsEndpointConfig.JmsEndpointKey var2 = (JmsEndpointConfig.JmsEndpointKey)var1;
            if (this.c != null ? this.c.equals(var2.c) : var2.c == null) {
               if (this.d != var2.d) {
                  return false;
               }

               if (this.a != null ? this.a.equals(var2.a) : var2.a == null) {
                  if (this.b != var2.b) {
                     return false;
                  }

                  if (this.h != null ? this.h.equals(var2.h) : var2.h == null) {
                     if (this.e != null ? this.e.equals(var2.e) : var2.e == null) {
                        if (this.f != null ? this.f.equals(var2.f) : var2.f == null) {
                           if (this.g != null ? this.g.equals(var2.g) : var2.g == null) {
                              return this.i != null ? this.i.equals(var2.i) : var2.i == null;
                           } else {
                              return false;
                           }
                        } else {
                           return false;
                        }
                     } else {
                        return false;
                     }
                  } else {
                     return false;
                  }
               } else {
                  return false;
               }
            } else {
               return false;
            }
         } else {
            return false;
         }
      }

      @Override
      public int hashCode() {
         int var1 = this.a.hashCode();
         var1 = 31 * var1 + this.b;
         var1 = 31 * var1 + this.c.hashCode();
         var1 = 31 * var1 + this.d;
         var1 = 31 * var1 + (this.e != null ? this.e.hashCode() : 0);
         var1 = 31 * var1 + (this.f != null ? this.f.hashCode() : 0);
         var1 = 31 * var1 + (this.g != null ? this.g.hashCode() : 0);
         var1 = 31 * var1 + (this.h != null ? this.h.hashCode() : 0);
         return 31 * var1 + (this.i != null ? this.i.hashCode() : 0);
      }

      @Override
      public String toString() {
         StringBuilder var1 = new StringBuilder();
         var1.append(j);
         var1.append(this.a);
         var1.append(',');
         var1.append(this.b);
         var1.append('-');
         var1.append(this.c);
         var1.append(',');
         var1.append(this.d);
         if (this.e != null) {
            var1.append("-");
            var1.append(this.e);
            var1.append(',');
            var1.append(this.f);
            var1.append(',');
            var1.append(this.g);
            var1.append(',');
            var1.append(this.h);
            var1.append(',');
            var1.append(this.i);
         }

         var1.append("]");
         return var1.toString();
      }

      static {
         String var10002 = a(5, a("4F\u0001X\u0011x;\u0011B\u001ci4y2%"));
         byte var10001 = -1;
         j = var10002;
      }

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

         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 -> 123;
               case 1 -> 46;
               case 2 -> 119;
               case 3 -> 24;
               case 4 -> 122;
               case 5 -> 25;
               default -> 78;
            });
         }

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