Decompiled source of ItemSpawnerEnhanced v1.3.0

plugins\ItemSpawnerEnhanced\ItemSpawnerEnhanced.ChineseSearch.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using ItemSpawnerEnhanced.Api;
using Microsoft.CodeAnalysis;
using TinyPinyin;
using TinyPinyin.Data;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ItemSpawnerEnhanced.ChineseSearch")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0+868a403036ec2b476d1ba1a4dba1c5a0bb24d6c5")]
[assembly: AssemblyProduct("ItemSpawnerEnhanced.ChineseSearch")]
[assembly: AssemblyTitle("ItemSpawnerEnhanced.ChineseSearch")]
[assembly: AssemblyVersion("1.3.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ItemSpawnerEnhanced.ChineseSearch
{
	internal sealed class ChinesePinyinAliasProvider : ISearchAliasProvider
	{
		public string Id => "builtin.chinese-pinyin";

		public bool SupportsLanguage(string languageCode)
		{
			if (!languageCode.Equals("zh-Hans", StringComparison.OrdinalIgnoreCase))
			{
				return languageCode.Equals("zh-Hant", StringComparison.OrdinalIgnoreCase);
			}
			return true;
		}

		public static void WarmUp()
		{
			PinyinHelper.GetPinyin("预热");
			PinyinHelper.GetPinyin("预热", string.Empty);
			PinyinHelper.GetPinyinInitials("预热", string.Empty);
		}

		public IEnumerable<string> GetAliases(SearchAliasContext context)
		{
			if (!string.IsNullOrWhiteSpace(context.DisplayName))
			{
				string spaced = PinyinHelper.GetPinyin(context.DisplayName).ToLowerInvariant();
				string compact = PinyinHelper.GetPinyin(context.DisplayName, string.Empty).ToLowerInvariant();
				string initials = PinyinHelper.GetPinyinInitials(context.DisplayName, string.Empty).ToLowerInvariant();
				if (!string.Equals(spaced, context.DisplayName, StringComparison.OrdinalIgnoreCase))
				{
					yield return spaced;
				}
				if (!string.Equals(compact, spaced, StringComparison.OrdinalIgnoreCase))
				{
					yield return compact;
				}
				if (!string.IsNullOrWhiteSpace(initials))
				{
					yield return initials;
				}
			}
		}
	}
	[BepInPlugin("com.github.lllei.ItemSpawnerEnhanced.ChineseSearch", "ItemSpawnerEnhanced Chinese Search", "1.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public sealed class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "com.github.lllei.ItemSpawnerEnhanced.ChineseSearch";

		public const string PluginName = "ItemSpawnerEnhanced Chinese Search";

		private IDisposable? _providerRegistration;

		private void Awake()
		{
			try
			{
				ChinesePinyinAliasProvider.WarmUp();
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"TinyPinyin warm-up failed; aliases will initialize on first use: {arg}");
			}
			_providerRegistration = SearchAliasRegistry.Register((ISearchAliasProvider)(object)new ChinesePinyinAliasProvider());
			((BaseUnityPlugin)this).Logger.LogInfo((object)"ItemSpawnerEnhanced Chinese Search 1.3.0 loaded.");
		}

		private void OnDestroy()
		{
			_providerRegistration?.Dispose();
		}
	}
	internal static class BuildInfo
	{
		internal const string Version = "1.3.0";
	}
}
namespace TinyPinyin
{
	internal static class Engine
	{
		public static string[] PinyinFromDict(string wordInDict, List<IPinyinDict> pinyinDictSet)
		{
			if (pinyinDictSet != null)
			{
				foreach (IPinyinDict item in pinyinDictSet)
				{
					if (item != null && item.Words() != null && item.Words().Contains(wordInDict))
					{
						return item.ToPinyin(wordInDict);
					}
				}
			}
			throw new ArgumentException("No pinyin dict contains word: " + wordInDict);
		}

		public static string ToPinyin(string inputStr, string trie, List<IPinyinDict> pinyinDictList, string separator)
		{
			if (inputStr == null || inputStr.Length == 0)
			{
				return inputStr;
			}
			if (trie == null)
			{
				StringBuilder stringBuilder = new StringBuilder();
				for (int i = 0; i < inputStr.Length; i++)
				{
					stringBuilder.Append(PinyinHelper.GetPinyin(inputStr[i]));
					if (i != inputStr.Length - 1)
					{
						stringBuilder.Append(separator);
					}
				}
				return stringBuilder.ToString();
			}
			return null;
		}
	}
	internal interface IPinyinDict
	{
		string[] ToPinyin(string word);

		List<string> Words();
	}
	internal abstract class PinyinDict : IPinyinDict
	{
		public abstract Dictionary<string, string[]> Mapping();

		public string[] ToPinyin(string word)
		{
			Dictionary<string, string[]> dictionary = Mapping();
			if (dictionary == null)
			{
				return null;
			}
			if (dictionary.TryGetValue(word, out var value))
			{
				return value;
			}
			return null;
		}

		public List<string> Words()
		{
			return Mapping()?.Keys.Select((string key) => key).ToList();
		}
	}
	internal static class PinyinHelper
	{
		public static bool IsChinese(char c)
		{
			if (PinyinData.MIN_VALUE > c || c > PinyinData.MAX_VALUE || GetPinyinCode(c) <= 0)
			{
				return PinyinData.CHAR_12295 == c;
			}
			return true;
		}

		public static string GetPinyin(char c)
		{
			if (IsChinese(c))
			{
				if (c == PinyinData.CHAR_12295)
				{
					return PinyinData.PINYIN_12295;
				}
				return PinyinData.PINYIN_TABLE[GetPinyinCode(c)];
			}
			return c.ToString();
		}

		public static string GetPinyin(string str, string separator = " ")
		{
			return Engine.ToPinyin(str, null, null, separator);
		}

		public static string GetPinyinInitials(string str, string separator = "")
		{
			string pinyin = GetPinyin(str, "|");
			return string.Join(separator, (from x in pinyin.Split('|')
				select (string.IsNullOrWhiteSpace(x) || x.Length <= 0) ? x : x.Substring(0, 1)).ToArray());
		}

		private static int GetPinyinCode(char c)
		{
			int num = c - PinyinData.MIN_VALUE;
			if (0 <= num && num < PinyinData.PINYIN_CODE_1_OFFSET)
			{
				return decodeIndex(PinyinCode1.PINYIN_CODE_PADDING, PinyinCode1.PINYIN_CODE, num);
			}
			if (PinyinData.PINYIN_CODE_1_OFFSET <= num && num < PinyinData.PINYIN_CODE_2_OFFSET)
			{
				return decodeIndex(PinyinCode2.PINYIN_CODE_PADDING, PinyinCode2.PINYIN_CODE, num - PinyinData.PINYIN_CODE_1_OFFSET);
			}
			return decodeIndex(PinyinCode3.PINYIN_CODE_PADDING, PinyinCode3.PINYIN_CODE, num - PinyinData.PINYIN_CODE_2_OFFSET);
		}

		private static short decodeIndex(byte[] paddings, byte[] indexes, int offset)
		{
			int num = offset / 8;
			int num2 = offset % 8;
			short num3 = (short)(indexes[offset] & 0xFF);
			if ((paddings[num] & PinyinData.BIT_MASKS[num2]) != 0)
			{
				num3 |= PinyinData.PADDING_MASK;
			}
			return num3;
		}
	}
}
namespace TinyPinyin.Data
{
	internal static class PinyinCode1
	{
		public static byte[] PINYIN_CODE_PADDING = new byte[875]
		{
			177, 79, 200, 37, 169, 41, 96, 13, 134, 58,
			2, 134, 67, 33, 184, 128, 16, 79, 211, 92,
			75, 40, 54, 206, 19, 34, 241, 102, 32, 39,
			53, 25, 201, 37, 194, 233, 28, 47, 168, 151,
			133, 170, 159, 151, 26, 160, 0, 204, 151, 176,
			3, 116, 69, 64, 36, 15, 103, 74, 178, 194,
			31, 81, 68, 50, 154, 196, 73, 21, 145, 176,
			40, 124, 41, 118, 173, 84, 223, 152, 167, 37,
			218, 134, 12, 253, 48, 228, 242, 232, 2, 220,
			89, 192, 136, 66, 156, 160, 153, 96, 12, 40,
			128, 151, 49, 26, 223, 65, 240, 131, 96, 69,
			20, 170, 80, 34, 146, 163, 28, 34, 64, 80,
			202, 4, 65, 65, 0, 0, 96, 129, 24, 65,
			74, 66, 9, 4, 192, 1, 136, 5, 16, 20,
			71, 34, 9, 17, 48, 128, 40, 52, 194, 242,
			128, 131, 128, 41, 192, 62, 148, 35, 141, 141,
			1, 9, 16, 48, 24, 16, 144, 45, 231, 185,
			29, 8, 169, 105, 87, 155, 161, 252, 152, 154,
			78, 100, 248, 142, 19, 89, 252, 210, 2, 21,
			93, 3, 226, 16, 23, 198, 12, 80, 30, 73,
			1, 130, 10, 209, 98, 47, 153, 142, 12, 136,
			140, 112, 112, 89, 135, 173, 172, 38, 10, 128,
			2, 201, 12, 65, 67, 153, 115, 4, 12, 203,
			129, 118, 114, 248, 32, 67, 169, 57, 26, 21,
			118, 144, 159, 16, 143, 38, 93, 12, 166, 43,
			104, 84, 78, 70, 32, 232, 192, 8, 97, 1,
			22, 153, 114, 24, 135, 204, 72, 230, 10, 92,
			139, 200, 168, 129, 16, 69, 40, 64, 210, 12,
			5, 57, 131, 142, 77, 34, 28, 209, 82, 231,
			236, 153, 159, 155, 24, 0, 59, 32, 9, 72,
			233, 81, 34, 66, 2, 24, 144, 132, 169, 33,
			192, 176, 192, 160, 2, 147, 74, 74, 210, 41,
			4, 34, 129, 130, 136, 152, 65, 10, 192, 88,
			183, 197, 86, 122, 0, 112, 160, 18, 228, 208,
			131, 56, 161, 128, 240, 80, 72, 56, 210, 216,
			51, 170, 39, 204, 233, 50, 16, 103, 186, 32,
			16, 132, 168, 69, 76, 40, 0, 66, 86, 228,
			97, 177, 178, 134, 243, 32, 10, 126, 188, 46,
			1, 37, 196, 205, 107, 76, 10, 72, 147, 253,
			87, 6, 0, 26, 71, 65, 9, 50, 210, 199,
			207, 2, 195, 250, 217, 96, 251, 0, 93, 53,
			160, 90, 40, 16, 160, 13, 76, 7, 167, 129,
			32, 210, 17, 163, 225, 99, 225, 114, 67, 8,
			77, 69, 236, 125, 133, 218, 186, 167, 179, 130,
			42, 5, 26, 35, 84, 15, 22, 140, 20, 159,
			130, 142, 157, 46, 1, 67, 136, 107, 106, 208,
			137, 176, 14, 218, 82, 131, 64, 225, 144, 75,
			25, 2, 29, 8, 174, 162, 42, 76, 152, 226,
			48, 2, 100, 128, 220, 164, 187, 126, 9, 230,
			188, 77, 19, 27, 130, 1, 157, 102, 82, 129,
			212, 93, 165, 121, 196, 180, 192, 69, 66, 136,
			237, 37, 37, 153, 67, 150, 177, 61, 184, 10,
			91, 0, 13, 137, 0, 0, 1, 53, 86, 145,
			18, 33, 191, 99, 64, 127, 5, 73, 34, 114,
			2, 193, 251, 0, 132, 219, 38, 70, 69, 216,
			39, 32, 128, 64, 64, 121, 254, 64, 51, 7,
			203, 162, 5, 162, 6, 236, 49, 8, 93, 97,
			135, 53, 245, 87, 140, 14, 14, 225, 144, 96,
			142, 81, 147, 139, 28, 22, 120, 195, 88, 208,
			2, 163, 225, 22, 37, 205, 97, 88, 0, 136,
			34, 24, 121, 209, 44, 0, 28, 199, 152, 139,
			18, 36, 7, 221, 96, 155, 237, 106, 2, 192,
			50, 168, 115, 66, 54, 65, 192, 139, 4, 68,
			92, 41, 57, 83, 160, 6, 32, 91, 0, 195,
			136, 246, 2, 1, 65, 168, 39, 4, 241, 220,
			144, 147, 176, 24, 35, 77, 66, 249, 46, 193,
			128, 242, 17, 81, 24, 0, 104, 10, 32, 162,
			120, 98, 136, 8, 75, 244, 72, 194, 6, 110,
			36, 67, 14, 182, 96, 1, 25, 225, 41, 145,
			200, 82, 68, 43, 130, 72, 50, 122, 249, 180,
			35, 16, 94, 197, 136, 115, 82, 181, 131, 133,
			46, 85, 181, 46, 16, 1, 41, 176, 244, 132,
			16, 236, 36, 82, 0, 129, 139, 72, 226, 80,
			36, 72, 22, 15, 132, 202, 186, 32, 100, 49,
			52, 129, 72, 129, 16, 33, 20, 1, 42, 98,
			81, 29, 227, 73, 80, 209, 70, 222, 47, 181,
			8, 136, 75, 209, 33, 63, 84, 167, 137, 32,
			250, 182, 11, 233, 131, 80, 165, 180, 62, 236,
			29, 62, 31, 23, 215, 65, 7, 13, 34, 24,
			68, 194, 177, 219, 131, 27, 200, 112, 47, 137,
			21, 7, 57, 24, 15, 228, 6, 98, 173, 182,
			92, 162, 66, 25, 24, 85, 13, 34, 117, 233,
			12, 98, 46, 120, 6, 36, 216, 111, 26, 0,
			226, 146, 49, 3, 47, 22, 171, 150, 144, 36,
			168, 216, 71, 151, 7, 190, 96, 33, 28, 58,
			56, 164, 164, 176, 77, 48, 2, 0, 160, 24,
			149, 254, 136, 67, 33, 228, 24, 66, 32, 104,
			77, 95, 77, 23, 52
		};

		public static byte[] PINYIN_CODE = new byte[7000]
		{
			104, 68, 147, 250, 33, 86, 0, 78, 127, 24,
			33, 86, 129, 21, 111, 197, 92, 40, 40, 139,
			255, 241, 39, 39, 3, 19, 103, 49, 70, 49,
			37, 69, 3, 172, 69, 110, 172, 100, 19, 25,
			41, 138, 96, 99, 253, 134, 129, 134, 87, 105,
			43, 32, 175, 143, 136, 0, 78, 58, 80, 136,
			136, 169, 139, 244, 90, 104, 104, 207, 0, 138,
			138, 75, 192, 104, 0, 133, 84, 124, 121, 82,
			166, 134, 246, 236, 254, 121, 104, 37, 37, 104,
			106, 0, 199, 138, 250, 103, 85, 88, 92, 69,
			0, 0, 41, 0, 39, 129, 209, 130, 0, 39,
			0, 0, 188, 181, 0, 17, 85, 100, 90, 30,
			206, 93, 0, 0, 0, 0, 252, 133, 107, 93,
			181, 175, 104, 141, 166, 0, 111, 132, 39, 39,
			80, 41, 111, 158, 111, 114, 121, 250, 84, 136,
			49, 54, 98, 98, 99, 90, 99, 250, 99, 129,
			70, 79, 146, 57, 133, 111, 104, 32, 118, 205,
			0, 88, 136, 68, 172, 118, 136, 103, 0, 20,
			110, 90, 58, 171, 76, 80, 12, 12, 129, 0,
			79, 104, 37, 12, 166, 68, 120, 135, 249, 40,
			6, 127, 135, 134, 19, 13, 49, 88, 24, 182,
			0, 25, 144, 39, 57, 127, 90, 87, 87, 30,
			119, 69, 12, 252, 93, 96, 63, 57, 176, 104,
			34, 33, 22, 33, 104, 205, 194, 12, 130, 34,
			101, 252, 134, 241, 78, 84, 131, 130, 102, 87,
			25, 12, 79, 86, 63, 84, 134, 250, 238, 111,
			66, 75, 81, 104, 91, 146, 104, 129, 2, 84,
			129, 90, 82, 94, 135, 11, 36, 90, 60, 134,
			110, 128, 126, 111, 53, 114, 24, 80, 43, 35,
			99, 87, 33, 33, 182, 25, 98, 91, 80, 136,
			38, 96, 210, 20, 102, 216, 216, 90, 8, 95,
			176, 135, 37, 4, 49, 13, 49, 130, 241, 104,
			49, 2, 132, 65, 112, 188, 58, 136, 21, 4,
			14, 34, 48, 80, 63, 136, 151, 110, 101, 64,
			126, 115, 14, 75, 35, 111, 104, 88, 151, 101,
			222, 69, 216, 96, 139, 109, 76, 252, 0, 143,
			0, 238, 123, 115, 165, 88, 96, 101, 7, 82,
			201, 130, 207, 19, 129, 118, 128, 107, 5, 66,
			133, 48, 104, 39, 92, 37, 75, 145, 133, 92,
			162, 104, 38, 154, 106, 169, 106, 39, 196, 136,
			95, 110, 3, 180, 204, 80, 182, 70, 30, 38,
			98, 100, 135, 104, 17, 131, 86, 130, 116, 184,
			0, 133, 131, 27, 254, 155, 31, 222, 224, 135,
			84, 120, 137, 37, 131, 55, 40, 0, 184, 139,
			41, 68, 37, 75, 20, 208, 114, 15, 73, 111,
			85, 51, 77, 3, 95, 157, 153, 84, 142, 104,
			90, 164, 147, 254, 169, 109, 127, 136, 87, 24,
			234, 52, 90, 85, 169, 197, 246, 10, 111, 49,
			86, 91, 94, 111, 64, 35, 40, 0, 100, 172,
			169, 162, 49, 131, 94, 90, 115, 139, 89, 234,
			131, 16, 64, 85, 87, 99, 3, 11, 111, 91,
			14, 38, 33, 133, 19, 117, 102, 53, 170, 78,
			162, 25, 145, 96, 105, 11, 65, 41, 41, 194,
			60, 59, 141, 45, 92, 240, 60, 120, 104, 250,
			64, 93, 136, 134, 95, 33, 134, 84, 133, 151,
			140, 145, 139, 252, 216, 182, 143, 83, 183, 50,
			168, 127, 70, 144, 12, 84, 139, 207, 23, 131,
			125, 103, 133, 30, 1, 0, 107, 37, 252, 100,
			227, 134, 46, 130, 134, 80, 111, 19, 21, 64,
			80, 242, 100, 87, 60, 83, 77, 90, 35, 38,
			145, 63, 151, 30, 68, 11, 103, 125, 102, 126,
			3, 100, 110, 131, 95, 124, 31, 90, 14, 133,
			145, 197, 129, 104, 90, 98, 49, 73, 27, 131,
			232, 70, 70, 11, 115, 179, 134, 80, 86, 33,
			158, 51, 38, 52, 86, 90, 112, 15, 169, 17,
			114, 101, 187, 9, 65, 60, 114, 134, 85, 32,
			252, 141, 25, 41, 24, 11, 89, 109, 102, 57,
			56, 79, 82, 19, 130, 57, 116, 60, 0, 18,
			41, 228, 117, 167, 53, 109, 119, 145, 240, 50,
			5, 43, 111, 125, 147, 33, 253, 253, 38, 30,
			112, 127, 1, 100, 63, 85, 179, 11, 243, 135,
			171, 180, 189, 252, 87, 3, 107, 70, 139, 88,
			32, 254, 137, 73, 150, 249, 85, 165, 33, 106,
			173, 250, 62, 32, 80, 127, 83, 126, 43, 67,
			58, 133, 138, 29, 86, 87, 141, 77, 133, 131,
			69, 175, 20, 102, 87, 52, 87, 132, 200, 103,
			135, 130, 254, 241, 87, 135, 2, 23, 104, 142,
			224, 32, 104, 59, 136, 96, 155, 131, 41, 58,
			133, 30, 116, 0, 18, 3, 17, 58, 40, 31,
			163, 216, 135, 252, 195, 84, 214, 2, 216, 33,
			174, 167, 184, 157, 10, 72, 16, 117, 133, 49,
			110, 114, 0, 36, 169, 63, 80, 178, 41, 32,
			9, 41, 126, 169, 183, 117, 228, 60, 100, 167,
			209, 80, 84, 114, 117, 112, 93, 39, 128, 93,
			87, 106, 74, 148, 74, 197, 71, 33, 80, 74,
			80, 135, 71, 49, 100, 100, 39, 39, 59, 252,
			71, 86, 191, 91, 71, 7, 136, 169, 157, 17,
			79, 212, 5, 172, 111, 6, 100, 177, 85, 0,
			163, 100, 65, 105, 92, 19, 250, 139, 65, 144,
			0, 101, 131, 40, 129, 104, 129, 32, 137, 191,
			8, 212, 112, 191, 94, 8, 27, 137, 27, 116,
			103, 137, 191, 135, 191, 101, 95, 197, 196, 15,
			106, 90, 145, 142, 224, 104, 196, 39, 105, 195,
			134, 149, 112, 201, 152, 0, 90, 90, 196, 19,
			70, 58, 94, 87, 19, 121, 39, 141, 121, 157,
			103, 168, 235, 90, 200, 70, 87, 174, 86, 131,
			136, 41, 193, 33, 250, 102, 142, 50, 136, 172,
			1, 66, 176, 70, 93, 131, 106, 50, 2, 169,
			25, 201, 142, 53, 49, 76, 135, 175, 175, 222,
			85, 72, 129, 83, 83, 83, 87, 139, 41, 0,
			87, 0, 0, 90, 87, 246, 87, 144, 125, 144,
			93, 62, 246, 4, 93, 155, 71, 5, 41, 129,
			59, 112, 112, 119, 60, 66, 60, 12, 12, 44,
			86, 255, 104, 129, 145, 252, 54, 41, 81, 129,
			58, 92, 122, 78, 141, 169, 113, 174, 177, 120,
			94, 44, 90, 41, 4, 139, 32, 200, 176, 134,
			235, 17, 134, 134, 10, 169, 32, 17, 32, 136,
			103, 98, 60, 44, 158, 153, 76, 80, 133, 42,
			5, 30, 48, 148, 134, 107, 48, 107, 144, 76,
			129, 64, 136, 179, 183, 120, 112, 55, 97, 148,
			161, 252, 30, 43, 103, 131, 55, 169, 64, 85,
			248, 32, 250, 44, 144, 94, 78, 20, 129, 76,
			1, 100, 143, 131, 129, 20, 100, 139, 128, 38,
			131, 76, 73, 84, 103, 90, 38, 131, 96, 124,
			144, 44, 140, 32, 72, 180, 169, 89, 32, 243,
			152, 133, 103, 254, 141, 122, 124, 143, 171, 139,
			241, 177, 107, 133, 107, 131, 131, 60, 128, 129,
			131, 104, 131, 133, 32, 52, 203, 169, 136, 169,
			99, 5, 8, 100, 130, 84, 188, 174, 136, 150,
			90, 133, 70, 136, 226, 134, 4, 34, 104, 136,
			203, 169, 136, 165, 165, 140, 152, 101, 76, 89,
			204, 157, 134, 174, 115, 39, 148, 136, 114, 20,
			200, 38, 164, 109, 109, 197, 148, 98, 140, 1,
			180, 21, 195, 162, 166, 144, 197, 70, 95, 95,
			145, 84, 104, 98, 82, 38, 165, 205, 180, 243,
			39, 129, 0, 253, 133, 5, 88, 104, 254, 83,
			140, 69, 139, 58, 90, 188, 98, 98, 184, 169,
			35, 9, 5, 10, 34, 114, 138, 10, 101, 84,
			114, 0, 0, 92, 92, 10, 49, 0, 93, 240,
			139, 61, 96, 249, 3, 237, 90, 100, 56, 138,
			2, 14, 122, 11, 210, 38, 84, 138, 104, 115,
			132, 146, 132, 157, 121, 86, 4, 83, 107, 255,
			25, 157, 85, 121, 111, 107, 158, 126, 58, 158,
			171, 171, 53, 72, 138, 4, 85, 241, 4, 104,
			3, 100, 15, 216, 4, 39, 91, 252, 217, 22,
			147, 38, 84, 126, 8, 39, 85, 78, 122, 90,
			78, 11, 147, 143, 90, 58, 188, 208, 58, 129,
			20, 43, 21, 157, 15, 21, 126, 143, 180, 110,
			180, 85, 103, 83, 90, 134, 134, 80, 4, 2,
			133, 191, 106, 80, 34, 129, 6, 181, 39, 140,
			90, 95, 135, 6, 84, 129, 77, 1, 85, 0,
			33, 112, 77, 68, 169, 129, 3, 169, 99, 99,
			100, 35, 133, 124, 236, 0, 148, 99, 133, 27,
			236, 64, 169, 35, 120, 68, 149, 55, 85, 112,
			27, 112, 88, 100, 169, 141, 30, 65, 41, 138,
			0, 5, 107, 100, 49, 169, 33, 163, 169, 100,
			100, 112, 49, 49, 175, 3, 4, 4, 0, 167,
			72, 87, 139, 24, 24, 24, 24, 24, 2, 57,
			110, 30, 129, 110, 45, 83, 40, 104, 6, 82,
			21, 39, 41, 141, 4, 40, 15, 95, 130, 235,
			51, 129, 111, 51, 67, 19, 49, 152, 102, 139,
			176, 103, 61, 152, 133, 133, 128, 6, 68, 148,
			58, 38, 39, 110, 3, 247, 103, 114, 49, 59,
			38, 166, 66, 129, 0, 119, 199, 111, 190, 38,
			96, 96, 102, 144, 115, 129, 66, 54, 69, 201,
			120, 169, 71, 88, 124, 115, 103, 184, 1, 187,
			232, 97, 104, 142, 40, 175, 74, 106, 85, 14,
			0, 0, 134, 248, 89, 6, 75, 86, 77, 112,
			68, 113, 47, 250, 121, 133, 106, 84, 84, 34,
			206, 47, 85, 45, 71, 81, 120, 232, 84, 95,
			99, 142, 184, 77, 96, 193, 57, 250, 37, 84,
			95, 90, 133, 119, 38, 38, 206, 74, 186, 104,
			57, 232, 169, 11, 112, 109, 0, 253, 84, 77,
			39, 5, 239, 81, 216, 204, 176, 8, 110, 63,
			135, 39, 135, 126, 176, 104, 250, 246, 144, 103,
			48, 80, 95, 115, 210, 86, 238, 104, 89, 37,
			121, 201, 56, 4, 139, 93, 115, 75, 76, 248,
			237, 17, 90, 14, 115, 115, 115, 111, 138, 109,
			90, 56, 135, 76, 143, 102, 143, 151, 21, 178,
			70, 222, 124, 49, 87, 128, 250, 80, 77, 106,
			124, 85, 104, 174, 144, 199, 196, 133, 102, 129,
			135, 96, 43, 117, 89, 148, 126, 154, 123, 61,
			87, 77, 96, 94, 109, 100, 165, 104, 2, 245,
			37, 69, 119, 93, 76, 76, 110, 116, 110, 63,
			234, 88, 2, 98, 157, 99, 56, 89, 14, 126,
			0, 122, 0, 155, 76, 0, 129, 224, 204, 108,
			114, 112, 178, 248, 190, 96, 77, 38, 34, 169,
			206, 147, 115, 153, 89, 87, 165, 11, 129, 124,
			172, 6, 196, 166, 54, 89, 21, 112, 118, 99,
			48, 96, 110, 100, 102, 102, 7, 112, 56, 46,
			104, 2, 130, 71, 87, 105, 169, 85, 60, 151,
			202, 35, 84, 119, 99, 71, 250, 63, 0, 187,
			0, 100, 71, 0, 165, 172, 56, 119, 124, 0,
			101, 129, 151, 83, 87, 106, 121, 250, 40, 80,
			42, 33, 80, 169, 253, 3, 134, 108, 217, 111,
			65, 162, 30, 85, 75, 121, 2, 135, 225, 149,
			143, 143, 33, 63, 118, 175, 1, 89, 88, 74,
			84, 81, 53, 134, 121, 250, 250, 61, 58, 58,
			78, 144, 14, 53, 47, 115, 99, 250, 129, 85,
			172, 87, 241, 30, 161, 120, 1, 103, 233, 129,
			27, 139, 220, 109, 183, 100, 63, 5, 59, 20,
			68, 164, 89, 0, 60, 38, 64, 3, 138, 58,
			143, 109, 80, 208, 32, 111, 129, 161, 134, 120,
			112, 67, 135, 31, 155, 11, 111, 106, 117, 102,
			83, 197, 121, 114, 43, 126, 124, 124, 85, 115,
			129, 158, 134, 80, 30, 95, 125, 72, 220, 96,
			172, 111, 25, 38, 254, 100, 58, 239, 39, 169,
			108, 124, 80, 198, 107, 239, 0, 158, 85, 111,
			134, 179, 153, 26, 128, 64, 102, 115, 1, 94,
			253, 27, 109, 52, 119, 90, 2, 56, 187, 30,
			111, 148, 56, 25, 36, 17, 51, 100, 129, 236,
			84, 252, 39, 96, 144, 134, 183, 82, 76, 49,
			38, 114, 56, 130, 111, 56, 0, 220, 115, 0,
			23, 215, 96, 206, 64, 2, 0, 69, 14, 5,
			5, 171, 53, 129, 203, 51, 51, 59, 63, 250,
			133, 39, 133, 144, 59, 24, 26, 130, 0, 89,
			243, 179, 91, 102, 89, 121, 126, 109, 232, 87,
			120, 33, 95, 247, 61, 187, 187, 121, 167, 72,
			91, 60, 103, 13, 107, 0, 133, 196, 89, 122,
			188, 8, 151, 240, 165, 89, 129, 136, 34, 158,
			149, 89, 49, 114, 90, 173, 254, 85, 95, 32,
			58, 116, 98, 84, 150, 235, 38, 158, 24, 117,
			51, 58, 111, 74, 37, 133, 103, 85, 250, 114,
			171, 95, 62, 126, 106, 249, 141, 0, 98, 220,
			180, 49, 100, 107, 56, 126, 231, 135, 135, 224,
			126, 126, 250, 77, 119, 104, 39, 133, 112, 2,
			109, 97, 155, 111, 239, 60, 91, 91, 75, 59,
			0, 23, 241, 241, 106, 149, 222, 63, 112, 57,
			128, 17, 114, 86, 100, 76, 241, 40, 129, 135,
			114, 64, 33, 0, 0, 22, 64, 180, 126, 10,
			110, 220, 106, 121, 203, 125, 129, 169, 177, 0,
			209, 89, 203, 100, 169, 180, 178, 203, 58, 36,
			245, 241, 88, 128, 203, 85, 76, 153, 100, 32,
			107, 9, 65, 161, 57, 89, 133, 47, 124, 128,
			139, 220, 89, 22, 169, 32, 31, 169, 104, 183,
			209, 117, 52, 85, 0, 131, 115, 136, 163, 220,
			209, 0, 0, 80, 126, 106, 3, 49, 221, 131,
			126, 91, 106, 208, 72, 72, 75, 146, 112, 137,
			242, 114, 49, 121, 126, 112, 77, 109, 159, 49,
			80, 71, 80, 182, 109, 142, 14, 176, 102, 109,
			58, 109, 71, 110, 109, 106, 127, 249, 111, 112,
			112, 182, 5, 111, 1, 109, 45, 80, 112, 5,
			153, 249, 112, 112, 77, 71, 71, 71, 72, 185,
			126, 104, 112, 181, 181, 71, 99, 71, 68, 38,
			100, 180, 0, 99, 116, 80, 96, 111, 84, 107,
			241, 104, 63, 252, 252, 131, 143, 59, 251, 0,
			0, 157, 33, 250, 220, 203, 129, 130, 133, 133,
			8, 98, 70, 0, 86, 142, 150, 75, 84, 86,
			12, 59, 145, 123, 151, 150, 14, 92, 63, 136,
			129, 155, 63, 136, 131, 59, 169, 6, 84, 86,
			141, 247, 235, 60, 159, 4, 59, 133, 75, 93,
			246, 65, 76, 216, 58, 241, 137, 101, 88, 5,
			177, 3, 205, 148, 101, 97, 6, 38, 35, 176,
			136, 90, 121, 133, 45, 161, 178, 178, 180, 5,
			0, 237, 0, 92, 69, 129, 148, 180, 48, 38,
			167, 92, 106, 120, 74, 128, 90, 106, 102, 76,
			76, 107, 30, 101, 106, 82, 101, 112, 67, 90,
			149, 33, 40, 77, 0, 65, 119, 99, 154, 56,
			0, 59, 144, 0, 210, 3, 92, 87, 124, 9,
			238, 6, 104, 106, 112, 95, 45, 28, 99, 2,
			240, 84, 6, 109, 142, 130, 63, 188, 164, 96,
			37, 32, 135, 129, 174, 174, 249, 37, 0, 21,
			39, 98, 109, 137, 103, 217, 63, 111, 21, 84,
			140, 54, 241, 37, 78, 139, 182, 132, 151, 134,
			70, 57, 59, 3, 23, 41, 13, 145, 133, 76,
			104, 133, 104, 238, 129, 142, 250, 26, 139, 216,
			153, 148, 60, 159, 216, 131, 74, 135, 94, 111,
			77, 240, 102, 71, 168, 0, 99, 252, 0, 3,
			36, 76, 210, 71, 37, 106, 127, 14, 171, 109,
			67, 139, 120, 10, 10, 111, 63, 191, 134, 18,
			77, 99, 145, 145, 111, 125, 77, 102, 100, 10,
			129, 193, 33, 72, 75, 3, 87, 134, 134, 131,
			118, 94, 43, 131, 0, 167, 94, 125, 168, 73,
			78, 96, 129, 129, 155, 107, 57, 37, 109, 144,
			52, 52, 39, 196, 57, 82, 37, 71, 60, 254,
			134, 169, 240, 9, 23, 118, 74, 65, 84, 37,
			98, 96, 131, 2, 100, 100, 145, 65, 112, 81,
			90, 177, 0, 164, 33, 240, 13, 36, 180, 180,
			232, 252, 193, 203, 139, 45, 41, 179, 38, 189,
			16, 136, 27, 41, 63, 127, 145, 109, 65, 36,
			133, 129, 109, 253, 135, 63, 33, 205, 53, 100,
			57, 123, 250, 253, 172, 0, 141, 254, 123, 95,
			32, 32, 6, 249, 155, 70, 83, 6, 203, 75,
			75, 150, 149, 38, 76, 76, 59, 62, 205, 86,
			125, 59, 56, 103, 41, 0, 5, 253, 129, 254,
			149, 104, 241, 14, 65, 132, 103, 109, 97, 59,
			163, 139, 123, 59, 9, 252, 96, 163, 196, 115,
			144, 99, 60, 114, 18, 0, 167, 157, 180, 100,
			59, 80, 123, 178, 178, 19, 169, 175, 9, 32,
			98, 100, 167, 6, 0, 39, 12, 0, 140, 140,
			38, 104, 188, 254, 136, 140, 121, 121, 159, 104,
			121, 95, 159, 40, 190, 150, 40, 104, 133, 102,
			41, 88, 87, 11, 0, 15, 54, 7, 176, 90,
			151, 86, 93, 0, 210, 86, 158, 85, 77, 112,
			191, 52, 76, 76, 103, 1, 0, 101, 101, 250,
			195, 195, 106, 128, 36, 56, 120, 65, 58, 90,
			104, 102, 101, 113, 95, 39, 12, 58, 70, 100,
			14, 104, 154, 130, 76, 0, 157, 114, 130, 6,
			79, 171, 124, 63, 100, 237, 140, 250, 207, 87,
			90, 86, 65, 0, 158, 146, 124, 250, 144, 35,
			12, 104, 132, 61, 140, 12, 85, 125, 85, 66,
			54, 13, 65, 5, 35, 82, 235, 5, 84, 5,
			132, 171, 76, 114, 132, 39, 86, 128, 11, 171,
			35, 229, 226, 68, 207, 252, 131, 57, 138, 208,
			30, 114, 87, 83, 129, 48, 17, 85, 79, 119,
			140, 90, 187, 58, 12, 90, 136, 100, 90, 81,
			134, 233, 72, 129, 150, 134, 102, 135, 114, 198,
			238, 38, 113, 140, 223, 100, 206, 91, 86, 14,
			111, 75, 87, 112, 84, 84, 111, 107, 72, 6,
			216, 135, 135, 128, 56, 207, 112, 70, 96, 133,
			77, 193, 203, 250, 14, 37, 255, 77, 115, 95,
			82, 132, 216, 8, 205, 90, 176, 144, 144, 39,
			8, 32, 101, 252, 134, 102, 49, 92, 80, 144,
			139, 32, 245, 12, 102, 69, 132, 41, 129, 92,
			33, 160, 140, 133, 101, 165, 131, 131, 104, 217,
			133, 129, 129, 87, 118, 106, 142, 154, 100, 201,
			174, 238, 100, 110, 100, 30, 87, 106, 38, 107,
			5, 144, 50, 80, 119, 76, 179, 99, 10, 133,
			181, 246, 87, 34, 169, 37, 90, 190, 0, 56,
			205, 80, 148, 162, 47, 68, 218, 150, 208, 111,
			206, 238, 54, 140, 37, 133, 112, 63, 140, 77,
			245, 73, 87, 197, 84, 100, 84, 85, 100, 111,
			49, 111, 76, 169, 87, 139, 4, 45, 250, 87,
			141, 70, 33, 180, 2, 77, 77, 179, 197, 49,
			248, 139, 247, 23, 176, 78, 16, 89, 41, 250,
			126, 90, 83, 19, 59, 85, 0, 134, 65, 216,
			5, 136, 127, 136, 252, 65, 92, 121, 78, 162,
			14, 106, 40, 47, 90, 136, 182, 100, 163, 159,
			106, 99, 0, 169, 65, 87, 0, 122, 107, 32,
			37, 68, 101, 102, 84, 208, 47, 130, 70, 95,
			111, 80, 64, 16, 193, 58, 18, 0, 0, 84,
			252, 46, 191, 90, 134, 73, 85, 134, 193, 125,
			197, 3, 107, 96, 0, 80, 193, 112, 131, 3,
			64, 90, 75, 171, 191, 8, 49, 242, 80, 76,
			138, 121, 5, 0, 10, 95, 70, 107, 146, 102,
			241, 85, 112, 107, 15, 17, 38, 177, 193, 235,
			5, 187, 101, 158, 0, 130, 26, 131, 112, 30,
			109, 201, 107, 129, 52, 219, 87, 61, 236, 164,
			219, 10, 2, 241, 245, 104, 243, 111, 167, 96,
			189, 104, 127, 146, 109, 216, 169, 63, 107, 100,
			135, 139, 33, 27, 112, 213, 165, 203, 129, 121,
			121, 5, 213, 253, 0, 14, 102, 84, 254, 75,
			126, 191, 87, 87, 203, 173, 171, 122, 107, 62,
			133, 95, 0, 122, 85, 126, 10, 85, 100, 32,
			133, 193, 83, 83, 87, 104, 80, 32, 83, 39,
			14, 32, 54, 253, 171, 124, 0, 219, 70, 104,
			24, 2, 218, 222, 187, 66, 40, 135, 48, 111,
			245, 0, 95, 207, 100, 58, 107, 24, 219, 0,
			107, 197, 0, 187, 37, 92, 216, 72, 177, 112,
			163, 100, 45, 176, 133, 218, 163, 87, 107, 45,
			43, 5, 196, 169, 181, 100, 136, 163, 144, 134,
			141, 141, 151, 114, 144, 144, 54, 55, 90, 11,
			144, 89, 91, 195, 49, 58, 10, 129, 102, 226,
			97, 0, 32, 111, 181, 55, 210, 199, 49, 131,
			41, 32, 99, 144, 216, 90, 144, 169, 97, 20,
			17, 207, 220, 220, 107, 181, 197, 222, 15, 57,
			107, 125, 2, 111, 40, 3, 71, 50, 78, 16,
			102, 119, 104, 136, 142, 196, 104, 59, 119, 145,
			105, 135, 68, 78, 104, 10, 39, 39, 39, 37,
			148, 96, 39, 110, 124, 104, 66, 39, 87, 100,
			37, 7, 100, 89, 116, 124, 10, 111, 100, 89,
			130, 37, 36, 15, 125, 196, 152, 156, 18, 52,
			23, 117, 129, 112, 129, 106, 196, 152, 1, 115,
			131, 131, 90, 222, 19, 124, 193, 0, 112, 111,
			39, 222, 135, 222, 133, 111, 10, 156, 222, 0,
			203, 30, 139, 103, 0, 121, 84, 173, 39, 222,
			125, 37, 80, 90, 156, 126, 173, 142, 124, 104,
			104, 10, 0, 39, 10, 87, 54, 74, 49, 98,
			60, 184, 74, 40, 247, 87, 139, 90, 35, 148,
			132, 132, 139, 80, 150, 98, 41, 74, 60, 89,
			129, 34, 80, 80, 80, 91, 131, 41, 36, 33,
			33, 112, 91, 33, 173, 87, 87, 0, 79, 79,
			110, 173, 173, 102, 190, 79, 79, 79, 91, 102,
			76, 158, 134, 138, 93, 102, 93, 93, 93, 93,
			39, 106, 38, 147, 216, 135, 80, 219, 139, 241,
			29, 85, 14, 139, 134, 65, 4, 64, 134, 84,
			66, 39, 39, 246, 129, 90, 36, 85, 216, 126,
			85, 0, 189, 77, 179, 246, 64, 85, 41, 90,
			71, 184, 184, 85, 29, 184, 139, 90, 139, 141,
			173, 141, 41, 85, 35, 74, 216, 32, 76, 87,
			169, 77, 0, 0, 178, 104, 250, 12, 84, 112,
			37, 111, 41, 54, 250, 0, 113, 8, 102, 4,
			99, 84, 134, 77, 129, 252, 86, 78, 250, 28,
			252, 250, 30, 134, 4, 94, 87, 5, 163, 60,
			6, 125, 151, 101, 139, 94, 148, 101, 97, 20,
			169, 66, 4, 100, 90, 94, 130, 176, 75, 238,
			110, 57, 157, 113, 4, 121, 247, 200, 3, 66,
			176, 38, 0, 70, 0, 158, 94, 191, 69, 97,
			104, 0, 115, 148, 183, 77, 90, 98, 67, 180,
			164, 80, 92, 5, 69, 104, 205, 39, 3, 80,
			121, 133, 196, 169, 129, 69, 158, 110, 0, 86,
			169, 102, 133, 132, 181, 133, 77, 77, 111, 103,
			21, 254, 7, 87, 87, 210, 169, 110, 87, 119,
			60, 37, 37, 71, 99, 142, 114, 86, 106, 84,
			164, 145, 165, 162, 87, 6, 151, 39, 39, 57,
			0, 122, 139, 162, 250, 200, 159, 159, 147, 102,
			53, 99, 99, 94, 182, 182, 168, 141, 76, 37,
			109, 106, 70, 112, 132, 80, 102, 241, 100, 50,
			134, 13, 147, 141, 70, 126, 102, 106, 144, 120,
			125, 111, 80, 101, 87, 3, 75, 64, 104, 133,
			39, 116, 102, 77, 136, 145, 184, 100, 193, 93,
			129, 129, 124, 68, 38, 193, 252, 84, 111, 145,
			163, 134, 100, 100, 80, 145, 30, 54, 15, 148,
			0, 111, 250, 179, 71, 74, 85, 82, 25, 59,
			15, 134, 2, 177, 84, 50, 254, 144, 80, 13,
			65, 55, 252, 109, 220, 55, 129, 0, 0, 50,
			145, 132, 173, 0, 32, 63, 28, 68, 71, 179,
			127, 126, 126, 5, 26, 4, 253, 149, 149, 60,
			60, 85, 111, 20, 178, 88, 29, 20, 0, 133,
			100, 165, 126, 175, 173, 173, 135, 62, 76, 150,
			133, 107, 102, 254, 102, 141, 126, 104, 97, 210,
			103, 103, 104, 77, 87, 129, 90, 148, 54, 63,
			5, 149, 0, 104, 15, 60, 176, 115, 111, 113,
			106, 0, 134, 169, 54, 178, 178, 65, 107, 85,
			139, 32, 107, 158, 100, 80, 210, 5, 34, 52,
			181, 65, 65, 220, 100, 100, 100, 210, 100, 43,
			107, 43, 135, 125, 136, 98, 34, 34, 174, 100,
			151, 254, 139, 100, 0, 84, 0, 0, 30, 3,
			3, 129, 104, 49, 6, 133, 128, 88, 104, 135,
			98, 140, 0, 98, 135, 90, 115, 14, 39, 21,
			68, 43, 83, 220, 39, 86, 233, 133, 85, 121,
			58, 80, 127, 60, 57, 187, 238, 233, 67, 90,
			171, 133, 135, 20, 133, 63, 203, 104, 104, 246,
			251, 140, 17, 43, 57, 131, 46, 254, 131, 39,
			7, 85, 9, 57, 107, 40, 246, 127, 30, 78,
			57, 80, 33, 30, 250, 120, 109, 191, 72, 120,
			131, 95, 196, 80, 83, 90, 104, 9, 246, 0,
			100, 235, 125, 60, 196, 130, 63, 126, 134, 28,
			189, 205, 16, 109, 120, 205, 9, 127, 137, 32,
			90, 133, 121, 83, 44, 14, 14, 0, 196, 254,
			58, 86, 195, 9, 40, 199, 41, 134, 87, 163,
			93, 246, 217, 131, 19, 19, 92, 93, 102, 124,
			110, 110, 129, 106, 241, 68, 120, 106, 140, 203,
			1, 14, 0, 75, 44, 107, 99, 7, 134, 95,
			180, 84, 0, 153, 107, 63, 237, 65, 99, 198,
			99, 48, 90, 69, 236, 85, 88, 104, 133, 66,
			133, 94, 72, 151, 89, 71, 107, 153, 236, 68,
			110, 21, 19, 37, 162, 14, 129, 3, 41, 146,
			109, 75, 50, 41, 1, 111, 111, 198, 51, 27,
			88, 85, 138, 115, 126, 177, 30, 171, 164, 51,
			131, 248, 1, 138, 138, 0, 5, 160, 179, 106,
			173, 57, 180, 104, 41, 32, 71, 49, 91, 198,
			33, 84, 85, 106, 0, 104, 14, 253, 90, 175,
			175, 173, 180, 0, 107, 87, 68, 109, 169, 68,
			106, 98, 100, 68, 63, 247, 131, 126, 207, 126,
			100, 217, 144, 15, 104, 250, 224, 86, 139, 100,
			104, 118, 14, 104, 104, 80, 24, 39, 80, 39,
			39, 100, 66, 106, 121, 90, 119, 84, 73, 38,
			253, 6, 37, 63, 127, 141, 61, 90, 63, 196,
			87, 121, 34, 226, 136, 131, 104, 196, 5, 78,
			34, 21, 96, 136, 66, 127, 132, 253, 13, 58,
			253, 14, 14, 35, 58, 131, 101, 0, 82, 14,
			152, 0, 17, 89, 58, 157, 253, 119, 196, 160,
			78, 141, 129, 129, 107, 59, 180, 180, 72, 126,
			133, 126, 126, 104, 104, 104, 104, 128, 128, 32,
			92, 127, 69, 100, 100, 111, 38, 23, 16, 66,
			18, 240, 109, 243, 127, 107, 38, 38, 143, 75,
			129, 236, 134, 104, 79, 35, 14, 63, 176, 90,
			79, 132, 51, 79, 136, 57, 85, 98, 117, 101,
			123, 184, 120, 79, 37, 133, 95, 136, 71, 49,
			0, 162, 49, 61, 234, 85, 0, 250, 33, 133,
			49, 135, 162, 111, 90, 134, 131, 38, 130, 15,
			125, 90, 98, 80, 236, 102, 80, 85, 132, 243,
			38, 61, 132, 133, 17, 61, 39, 35, 133, 80,
			133, 126, 193, 178, 88, 10, 4, 91, 91, 14,
			104, 166, 12, 60, 68, 92, 129, 12, 12, 32,
			59, 62, 62, 93, 250, 57, 54, 133, 79, 190,
			85, 83, 107, 65, 200, 200, 134, 39, 84, 129,
			84, 85, 103, 110, 78, 145, 134, 155, 111, 15,
			133, 38, 53, 36, 58, 74, 252, 217, 127, 93,
			223, 79, 87, 91, 146, 121, 144, 86, 123, 58,
			50, 84, 232, 33, 44, 139, 104, 10, 34, 200,
			241, 151, 122, 101, 152, 8, 226, 210, 132, 233,
			21, 67, 121, 121, 139, 56, 171, 49, 135, 63,
			57, 104, 71, 110, 90, 129, 240, 92, 112, 216,
			104, 90, 85, 14, 110, 255, 96, 145, 19, 125,
			95, 41, 241, 85, 85, 59, 0, 145, 74, 0,
			0, 104, 38, 213, 98, 39, 85, 165, 118, 157,
			204, 133, 90, 171, 66, 125, 67, 114, 151, 107,
			118, 85, 89, 41, 23, 121, 3, 101, 126, 126,
			38, 130, 104, 93, 104, 175, 126, 144, 95, 38,
			88, 229, 117, 79, 148, 70, 65, 100, 5, 85,
			251, 113, 240, 149, 61, 126, 77, 0, 69, 100,
			144, 27, 210, 114, 190, 109, 109, 140, 190, 159,
			254, 113, 111, 111, 134, 85, 129, 175, 64, 112,
			114, 255, 64, 21, 104, 252, 126, 85, 11, 189,
			104, 118, 50, 5, 37, 158, 84, 84, 110, 169,
			172, 124, 49, 104, 113, 169, 221, 210, 77, 6,
			96, 252, 84, 200, 49, 85, 11, 61, 53, 33,
			194, 169, 129, 105, 105, 92, 60, 250, 151, 65,
			182, 85, 145, 159, 216, 1, 40, 75, 109, 32,
			136, 78, 112, 135, 129, 175, 111, 128, 115, 5,
			100, 64, 64, 220, 79, 47, 121, 127, 85, 33,
			91, 80, 126, 77, 19, 145, 131, 109, 65, 139,
			24, 37, 61, 11, 255, 24, 58, 105, 76, 210,
			114, 88, 141, 67, 125, 46, 2, 11, 92, 27,
			15, 127, 145, 64, 254, 40, 11, 96, 80, 96,
			252, 80, 111, 111, 14, 96, 124, 200, 14, 104,
			197, 109, 144, 59, 106, 77, 36, 204, 251, 148,
			111, 2, 255, 100, 228, 93, 114, 145, 23, 168,
			86, 0, 158, 158, 6, 100, 114, 52, 52, 250,
			102, 50, 125, 0, 102, 139, 44, 57, 90, 144,
			132, 109, 26, 55, 37, 20, 144, 112, 90, 127,
			109, 101, 169, 26, 61, 106, 48, 95, 252, 58,
			125, 114, 37, 201, 0, 35, 49, 243, 203, 205,
			109, 38, 24, 24, 24, 53, 200, 216, 127, 69,
			5, 45, 189, 105, 6, 119, 138, 126, 144, 171,
			232, 50, 135, 106, 184, 33, 80, 72, 189, 252,
			129, 109, 1, 146, 63, 133, 184, 140, 250, 250,
			111, 246, 173, 145, 110, 44, 133, 69, 37, 250,
			4, 240, 11, 17, 46, 133, 123, 38, 171, 246,
			158, 126, 254, 37, 106, 106, 85, 85, 58, 59,
			76, 74, 74, 52, 141, 27, 89, 83, 86, 165,
			165, 39, 112, 250, 87, 200, 136, 173, 84, 24,
			141, 40, 87, 59, 38, 241, 104, 41, 87, 210,
			58, 59, 136, 50, 112, 133, 80, 124, 70, 0,
			0, 4, 26, 149, 90, 107, 5, 191, 104, 175,
			27, 142, 123, 194, 163, 2, 175, 100, 103, 86,
			38, 111, 106, 57, 195, 2, 195, 74, 250, 203,
			163, 194, 40, 133, 228, 228, 100, 101, 20, 133,
			92, 157, 110, 90, 177, 199, 37, 0, 32, 195,
			163, 123, 96, 9, 32, 129, 139, 124, 35, 104,
			171, 208, 196, 60, 141, 94, 94, 140, 96, 113,
			84, 131, 95, 41, 15, 85, 37, 83, 134, 96,
			131, 253, 128, 253, 126, 70, 250, 130, 67, 23,
			130, 129, 39, 145, 129, 158, 92, 62, 126, 44,
			96, 131, 134, 111, 131, 100, 180, 85, 126, 85,
			85, 47, 57, 4, 121, 121, 121, 77, 39, 169,
			191, 121, 169, 84, 56, 15, 65, 137, 33, 104,
			104, 32, 121, 85, 100, 40, 40, 23, 124, 3,
			166, 249, 6, 56, 13, 90, 0, 116, 75, 127,
			66, 146, 111, 153, 112, 37, 30, 38, 102, 152,
			84, 75, 252, 133, 30, 160, 194, 26, 101, 223,
			8, 35, 10, 85, 252, 8, 130, 111, 90, 5,
			85, 241, 133, 144, 77, 75, 128, 37, 129, 100,
			157, 15, 34, 139, 81, 121, 113, 141, 6, 0,
			131, 132, 114, 78, 206, 104, 41, 137, 248, 70,
			71, 146, 129, 248, 90, 237, 6, 5, 120, 72,
			152, 182, 253, 0, 121, 10, 19, 133, 240, 59,
			249, 241, 58, 102, 131, 124, 101, 10, 115, 216,
			104, 63, 38, 241, 115, 203, 203, 36, 99, 40,
			4, 200, 41, 130, 90, 124, 136, 58, 31, 205,
			217, 161, 90, 237, 8, 234, 175, 206, 104, 252,
			139, 75, 6, 75, 75, 5, 139, 143, 235, 128,
			7, 7, 63, 216, 139, 160, 178, 131, 251, 109,
			163, 222, 20, 120, 252, 117, 160, 39, 134, 132,
			221, 100, 100, 5, 44, 74, 117, 147, 38, 90,
			27, 126, 245, 138, 39, 206, 20, 38, 103, 133,
			160, 76, 76, 133, 255, 3, 224, 131, 96, 133,
			154, 70, 17, 66, 174, 124, 184, 67, 76, 141,
			0, 139, 133, 181, 99, 83, 57, 90, 210, 59,
			133, 132, 129, 126, 87, 0, 2, 75, 228, 55,
			20, 99, 64, 131, 37, 56, 56, 150, 193, 178,
			139, 240, 131, 104, 68, 32, 228, 78, 90, 30,
			87, 133, 84, 142, 138, 69, 159, 128, 71, 143,
			248, 184, 6, 112, 34, 220, 140, 35, 41, 103,
			141, 21, 124, 21, 142, 104, 125, 184, 51, 75,
			165, 55, 9, 131, 124, 60, 0, 78, 0, 240,
			35, 174, 200, 194, 90, 7, 139, 60, 83, 2,
			140, 113, 145, 36, 45, 134, 71, 12, 206, 217,
			228, 147, 83, 85, 87, 37, 65, 26, 182, 1,
			94, 76, 40, 66, 248, 63, 127, 108, 129, 61,
			251, 250, 234, 41, 252, 176, 103, 99, 141, 132,
			172, 103, 104, 128, 32, 68, 185, 23, 59, 35,
			19, 134, 64, 151, 73, 100, 55, 146, 139, 65,
			252, 149, 7, 40, 134, 180, 104, 0, 0, 133,
			58, 0, 32, 26, 105, 240, 112, 228, 131, 132,
			138, 131, 111, 100, 158, 208, 119, 16, 241, 80,
			23, 146, 96, 198, 64, 220, 30, 39, 145, 131,
			104, 47, 118, 15, 101, 124, 100, 117, 3, 95,
			99, 83, 148, 42, 129, 64, 161, 161, 37, 144,
			138, 138, 71, 134, 126, 99, 39, 48, 35, 90,
			112, 252, 103, 30, 124, 11, 102, 0, 0, 163,
			81, 0, 32, 96, 179, 145, 99, 133, 101, 0,
			109, 6, 40, 42, 126, 55, 55, 20, 41, 15,
			9, 55, 26, 148, 102, 60, 133, 226, 90, 131,
			51, 3, 95, 87, 48, 25, 135, 199, 77, 45,
			228, 32, 57, 134, 60, 235, 8, 56, 169, 61,
			121, 133, 76, 86, 252, 81, 253, 36, 131, 77,
			90, 228, 5, 30, 124, 96, 84, 79, 35, 100,
			35, 41, 7, 102, 18, 51, 59, 30, 32, 56,
			173, 39, 44, 109, 19, 87, 43, 63, 250, 0,
			125, 171, 37, 38, 105, 180, 183, 179, 145, 92,
			121, 124, 44, 60, 122, 53, 207, 203, 132, 107,
			107, 133, 5, 133, 38, 189, 32, 152, 41, 56,
			72, 128, 203, 203, 129, 32, 150, 16, 132, 106,
			101, 252, 173, 129, 107, 141, 244, 244, 165, 75,
			87, 18, 158, 117, 104, 87, 37, 37, 22, 210,
			118, 49, 112, 125, 56, 150, 217, 175, 132, 126,
			140, 133, 129, 26, 58, 58, 35, 20, 35, 141,
			89, 173, 12, 90, 254, 20, 55, 143, 139, 75,
			249, 0, 75, 217, 0, 90, 180, 133, 52, 57,
			112, 254, 137, 131, 93, 109, 167, 160, 180, 32,
			143, 120, 249, 47, 129, 59, 27, 26, 1, 136,
			124, 134, 0, 155, 58, 90, 96, 241, 20, 5,
			139, 103, 0, 0, 51, 196, 129, 58, 143, 60,
			92, 163, 22, 139, 103, 17, 103, 103, 216, 128,
			129, 18, 222, 96, 133, 134, 160, 203, 131, 90,
			174, 59, 7, 51, 180, 185, 10, 133, 235, 101,
			167, 22, 41, 117, 217, 87, 142, 128, 185, 161,
			112, 107, 180, 178, 252, 252, 117, 252, 163, 24,
			107, 193, 9, 32, 0, 52, 90, 35, 183, 142,
			196, 169, 117, 181, 59, 148, 169, 65, 76, 59,
			133, 141, 163, 169, 209, 133, 107, 107, 250, 91,
			247, 247, 40, 147, 110, 92, 92, 100, 93, 8,
			84, 132, 20, 65, 152, 200, 84, 102, 96, 27,
			89, 196, 41, 96, 63, 95, 133, 200, 36, 138,
			37, 76, 111, 38, 5, 7, 95, 133, 76, 171,
			220, 14, 33, 65, 76, 104, 93, 24, 148, 100,
			75, 250, 71, 89, 76, 133, 136, 101, 86, 127,
			41, 2, 254, 2, 132, 63, 131, 90, 41, 173,
			4, 93, 85, 133, 0, 254, 143, 104, 171, 14,
			169, 97, 89, 81, 97, 250, 250, 125, 18, 141,
			125, 164, 85, 8, 8, 163, 111, 163, 80, 71,
			38, 173, 130, 121, 90, 130, 111, 131, 133, 83,
			66, 71, 135, 38, 106, 90, 253, 126, 4, 143,
			126, 73, 143, 49, 91, 143, 143, 0, 175, 143,
			41, 73, 136, 84, 90, 113, 84, 39, 238, 110,
			0, 236, 250, 126, 191, 184, 238, 241, 177, 90,
			84, 96, 136, 136, 216, 147, 128, 104, 177, 34,
			131, 0, 104, 250, 133, 83, 243, 83, 126, 104,
			54, 111, 84, 129, 129, 129, 128, 14, 58, 138,
			133, 119, 90, 66, 98, 95, 91, 161, 93, 112,
			58, 63, 95, 32, 39, 157, 101, 39, 79, 200,
			200, 74, 46, 84, 114, 11, 4, 120, 8, 134,
			159, 38, 121, 84, 114, 107, 33, 96, 201, 127,
			86, 0, 121, 104, 85, 91, 100, 120, 84, 59,
			37, 139, 101, 117, 19, 92, 107, 96, 238, 131,
			176, 46, 114, 193, 151, 203, 15, 95, 127, 128,
			145, 39, 39, 111, 85, 67, 191, 216, 33, 81,
			70, 2, 19, 4, 135, 178, 87, 157, 66, 34,
			39, 125, 125, 96, 158, 95, 133, 135, 133, 135,
			33, 69, 119, 100, 92, 88, 31, 89, 103, 114,
			126, 112, 112, 142, 78, 87, 159, 135, 85, 38,
			38, 21, 129, 129, 84, 112, 126, 114, 36, 78,
			65, 143, 149, 135, 249, 136, 85, 32, 104, 85,
			1, 250, 136, 107, 131, 104, 133, 3, 78, 175,
			172, 33, 79, 89, 117, 0, 96, 99, 104, 86,
			114, 126, 90, 200, 158, 115, 107, 72, 80, 41,
			1, 191, 208, 131, 227, 3, 101, 46, 102, 56,
			249, 201, 133, 144, 95, 82, 33, 250, 114, 100,
			169, 2, 129, 107, 194, 117, 90, 114, 205, 203,
			49, 216, 127, 126, 10, 112, 96, 43, 173, 87,
			58, 136, 244, 175, 74, 85, 104, 129, 157, 57,
			103, 103, 169, 59, 69, 89, 85, 0, 128, 114,
			104, 88, 92, 28, 133, 10, 136, 0, 2, 103,
			17, 41, 195, 98, 102, 249, 169, 36, 157, 67,
			0, 100, 128, 180, 85, 15, 178, 209, 183, 181,
			31, 60, 100, 41, 113, 113, 4, 103, 99, 138,
			121, 115, 41, 26, 26, 38, 189, 29, 29, 64,
			149, 24, 95, 126, 106, 255, 86, 241, 113, 110,
			18, 240, 8, 90, 176, 85, 4, 0, 229, 66,
			48, 131, 164, 164, 140, 201, 125, 79, 74, 34,
			129, 250, 107, 145, 79, 69, 164, 0, 195, 178,
			205, 62, 80, 203, 12, 124, 136, 41, 0, 136,
			12, 6, 247, 76, 76, 60, 169, 3, 129, 138,
			14, 94, 68, 48, 30, 0, 115, 5, 252, 111,
			93, 84, 30, 32, 98, 83, 84, 144, 169, 92,
			23, 54, 12, 34, 129, 63, 127, 190, 38, 104,
			102, 100, 72, 104, 250, 41, 94, 66, 0, 0,
			0, 162, 32, 190, 101, 187, 198, 49, 112, 113,
			85, 11, 134, 70, 95, 102, 87, 41, 46, 233,
			41, 122, 91, 40, 136, 40, 50, 8, 50, 129,
			113, 114, 101, 129, 191, 241, 14, 79, 4, 84,
			86, 104, 90, 208, 85, 121, 99, 71, 98, 131,
			102, 175, 19, 77, 193, 128, 109, 133, 145, 114,
			0, 71, 41, 119, 0, 169, 180, 131, 37, 50,
			253, 87, 208, 89, 87, 153, 246, 58, 85, 133,
			104, 89, 130, 130, 101, 10, 203, 104, 103, 25,
			39, 220, 14, 75, 104, 176, 19, 216, 161, 115,
			8, 83, 134, 57, 48, 101, 90, 20, 204, 93,
			250, 8, 16, 191, 128, 50, 129, 86, 110, 37,
			139, 75, 151, 208, 222, 109, 63, 133, 124, 30,
			58, 102, 0, 138, 5, 90, 131, 20, 76, 148,
			207, 136, 14, 177, 31, 124, 49, 136, 238, 39,
			104, 30, 102, 37, 138, 39, 133, 177, 193, 0,
			15, 124, 0, 16, 126, 133, 178, 70, 180, 0,
			169, 163, 109, 41, 98, 44, 250, 131, 250, 169,
			38, 88, 131, 169, 52, 103, 145, 19, 12, 89,
			20, 12, 19, 144, 40, 104, 48, 95, 136, 131,
			149, 80, 80, 111, 82, 100, 147, 165, 126, 169,
			0, 101, 115, 98, 133, 38, 96, 116, 181, 82,
			134, 118, 107, 61, 106, 80, 157, 17, 3, 3,
			140, 104, 143, 153, 133, 2, 69, 25, 25, 124,
			134, 138, 97, 76, 141, 111, 117, 0, 107, 0,
			0, 126, 99, 10, 131, 59, 250, 254, 122, 107,
			132, 140, 98, 56, 56, 131, 11, 68, 160, 136,
			20, 12, 90, 19, 69, 141, 85, 164, 177, 87,
			250, 81, 142, 93, 51, 172, 3, 68, 110, 193,
			9, 178, 240, 140, 63, 96, 71, 119, 5, 102,
			14, 63, 112, 144, 133, 12, 11, 99, 131, 124,
			78, 228, 130, 66, 129, 89, 184, 156, 34, 28,
			86, 50, 195, 84, 169, 169, 71, 28, 107, 56,
			139, 64, 90, 159, 143, 41, 32, 83, 80, 136,
			169, 19, 0, 0, 61, 133, 162, 171, 131, 143,
			176, 169, 250, 19, 182, 49, 252, 197, 250, 250,
			23, 108, 32, 61, 85, 234, 9, 248, 127, 145,
			37, 119, 129, 169, 240, 111, 111, 102, 127, 70,
			60, 94, 79, 63, 85, 83, 37, 126, 250, 112,
			100, 111, 5, 104, 28, 12, 45, 168, 250, 143,
			90, 148, 162, 146, 146, 128, 105, 86, 86, 36,
			2, 220, 78, 109, 180, 114, 134, 104, 40, 139,
			139, 37, 151, 172, 253, 133, 141, 99, 139, 11,
			133, 143, 144, 18, 240, 68, 41, 32, 0, 0,
			131, 107, 85, 72, 252, 0, 158, 0, 183, 133,
			0, 0, 0, 0, 240, 32, 0, 75, 28, 76,
			103, 90, 80, 80, 73, 130, 145, 131, 104, 37,
			85, 100, 100, 43, 126, 46, 111, 115, 124, 83,
			15, 14, 102, 128, 95, 21, 101, 161, 100, 12,
			127, 158, 134, 158, 49, 87, 90, 75, 129, 131
		};
	}
	internal static class PinyinCode2
	{
		public static byte[] PINYIN_CODE_PADDING = new byte[875]
		{
			128, 246, 161, 5, 7, 104, 160, 33, 238, 10,
			249, 237, 47, 84, 4, 100, 17, 69, 72, 130,
			1, 130, 75, 32, 241, 216, 3, 90, 242, 67,
			177, 93, 36, 246, 6, 0, 112, 249, 113, 65,
			8, 163, 225, 0, 210, 4, 48, 4, 72, 134,
			138, 68, 234, 193, 77, 2, 33, 56, 161, 199,
			34, 232, 109, 212, 162, 76, 68, 79, 40, 185,
			135, 215, 208, 52, 4, 200, 103, 40, 14, 10,
			0, 182, 145, 32, 207, 24, 167, 0, 18, 181,
			26, 127, 37, 23, 40, 43, 62, 50, 44, 195,
			130, 191, 9, 170, 102, 4, 162, 67, 222, 113,
			67, 130, 48, 144, 27, 75, 168, 165, 41, 253,
			130, 148, 91, 236, 144, 5, 7, 144, 195, 161,
			128, 56, 40, 7, 251, 166, 13, 71, 243, 86,
			194, 112, 48, 2, 201, 20, 168, 34, 107, 110,
			46, 248, 229, 105, 47, 197, 41, 2, 170, 2,
			95, 243, 202, 100, 228, 66, 128, 215, 78, 71,
			206, 127, 123, 8, 108, 120, 200, 133, 142, 12,
			36, 147, 0, 17, 186, 34, 22, 46, 98, 218,
			180, 36, 166, 177, 171, 60, 153, 3, 48, 65,
			67, 114, 51, 4, 204, 130, 178, 97, 6, 126,
			128, 17, 0, 171, 10, 132, 154, 79, 128, 144,
			18, 23, 99, 22, 129, 232, 6, 198, 118, 69,
			65, 0, 27, 23, 44, 182, 13, 234, 252, 127,
			188, 132, 169, 224, 136, 180, 91, 17, 128, 34,
			244, 87, 21, 80, 12, 63, 210, 207, 93, 48,
			110, 62, 199, 28, 130, 185, 45, 162, 62, 186,
			164, 102, 134, 183, 99, 15, 139, 136, 40, 184,
			70, 40, 166, 133, 60, 12, 196, 65, 2, 9,
			39, 197, 71, 65, 3, 16, 102, 129, 50, 65,
			34, 227, 208, 96, 33, 200, 103, 79, 206, 141,
			16, 148, 71, 168, 247, 197, 140, 53, 3, 1,
			224, 46, 248, 0, 45, 90, 30, 128, 38, 162,
			66, 17, 134, 248, 100, 128, 189, 203, 17, 202,
			97, 158, 12, 75, 226, 4, 16, 17, 19, 113,
			93, 182, 217, 124, 42, 98, 146, 240, 216, 114,
			12, 0, 70, 46, 174, 193, 46, 212, 4, 82,
			64, 32, 0, 152, 66, 230, 156, 243, 19, 27,
			112, 136, 200, 66, 8, 16, 48, 5, 34, 8,
			192, 3, 120, 138, 41, 65, 26, 152, 181, 84,
			156, 201, 90, 65, 128, 221, 226, 197, 210, 64,
			88, 246, 193, 128, 68, 60, 2, 44, 240, 3,
			0, 6, 0, 64, 130, 12, 1, 106, 44, 54,
			149, 9, 76, 4, 3, 210, 13, 14, 208, 39,
			231, 116, 99, 18, 94, 27, 112, 172, 149, 6,
			96, 6, 152, 10, 225, 120, 4, 80, 154, 30,
			73, 49, 64, 64, 197, 188, 5, 137, 38, 4,
			8, 122, 132, 219, 8, 128, 17, 12, 196, 100,
			98, 28, 212, 4, 102, 12, 192, 148, 96, 22,
			87, 8, 142, 24, 115, 22, 5, 16, 24, 77,
			16, 140, 9, 69, 48, 33, 162, 32, 239, 245,
			202, 199, 237, 240, 154, 10, 34, 168, 94, 191,
			156, 212, 42, 120, 183, 159, 57, 201, 192, 192,
			111, 230, 26, 49, 244, 56, 6, 206, 192, 105,
			7, 134, 210, 139, 153, 42, 3, 185, 91, 51,
			141, 54, 34, 14, 223, 27, 3, 72, 35, 96,
			6, 103, 22, 3, 38, 162, 126, 66, 23, 48,
			72, 64, 8, 186, 112, 134, 40, 3, 238, 47,
			144, 8, 148, 135, 4, 68, 25, 183, 83, 68,
			34, 208, 24, 129, 10, 64, 161, 11, 82, 18,
			9, 0, 109, 128, 4, 97, 7, 55, 113, 224,
			168, 199, 53, 97, 145, 0, 219, 182, 144, 32,
			32, 46, 147, 208, 172, 24, 48, 73, 168, 92,
			223, 200, 50, 37, 74, 109, 107, 30, 166, 2,
			152, 148, 119, 150, 144, 189, 215, 96, 20, 152,
			186, 21, 8, 236, 209, 212, 140, 216, 168, 161,
			27, 30, 13, 249, 183, 254, 192, 75, 176, 181,
			236, 124, 81, 51, 26, 64, 15, 6, 91, 232,
			5, 90, 57, 50, 219, 242, 99, 36, 132, 122,
			53, 90, 122, 139, 20, 5, 25, 4, 219, 160,
			20, 188, 93, 26, 16, 16, 119, 12, 200, 16,
			164, 35, 89, 159, 55, 87, 160, 2, 21, 127,
			152, 172, 13, 40, 80, 33, 96, 26, 49, 32,
			8, 81, 7, 145, 83, 65, 192, 48, 16, 156,
			176, 255, 39, 240, 147, 12, 24, 29, 227, 31,
			204, 146, 51, 121, 32, 161, 73, 166, 200, 160,
			19, 51, 14, 2, 34, 64, 104, 32, 234, 160,
			221, 21, 228, 248, 66, 0, 104, 154, 192, 202,
			13, 73, 12, 89, 210, 164, 4, 24, 111, 219,
			121, 31, 244, 76, 128, 152, 64, 178, 130, 129,
			65, 16, 32, 204, 20, 49, 120, 233, 188, 133,
			202, 144, 163, 172, 200, 55, 5, 166, 120, 6,
			144, 2, 5, 56, 134, 11, 0, 39, 179, 137,
			160, 130, 9, 168, 204, 98, 116, 138, 228, 32,
			29, 217, 16, 120, 7, 73, 8, 2, 133, 104,
			48, 160, 115, 16, 64, 93, 20, 240, 123, 182,
			65, 156, 11, 224, 7, 81, 145, 92, 115, 75,
			32, 119, 56, 153, 82
		};

		public static byte[] PINYIN_CODE = new byte[7000]
		{
			205, 191, 41, 121, 121, 171, 168, 68, 208, 111,
			110, 193, 50, 96, 96, 107, 131, 242, 67, 129,
			134, 103, 41, 47, 111, 50, 80, 193, 63, 129,
			134, 144, 3, 107, 16, 118, 179, 166, 0, 107,
			245, 0, 92, 59, 163, 114, 111, 36, 184, 139,
			0, 0, 0, 90, 130, 104, 126, 90, 228, 196,
			164, 15, 102, 131, 139, 57, 102, 131, 9, 30,
			112, 144, 201, 52, 130, 102, 134, 125, 93, 85,
			124, 252, 187, 55, 112, 90, 15, 39, 133, 53,
			114, 68, 177, 15, 60, 6, 125, 49, 38, 57,
			148, 85, 102, 250, 147, 95, 55, 235, 61, 96,
			98, 65, 225, 129, 48, 101, 45, 253, 30, 252,
			123, 193, 95, 94, 95, 143, 75, 254, 101, 65,
			130, 131, 149, 0, 178, 18, 136, 0, 85, 250,
			171, 126, 109, 252, 109, 92, 92, 72, 122, 250,
			28, 53, 13, 110, 121, 132, 121, 124, 158, 104,
			104, 95, 146, 107, 107, 26, 189, 135, 63, 140,
			166, 164, 36, 49, 169, 94, 1, 45, 83, 69,
			105, 129, 56, 167, 180, 172, 196, 179, 34, 52,
			148, 41, 60, 16, 180, 138, 41, 124, 41, 127,
			194, 203, 219, 101, 66, 240, 136, 30, 85, 5,
			118, 131, 49, 0, 0, 253, 0, 107, 80, 91,
			133, 254, 149, 49, 249, 41, 122, 158, 131, 150,
			113, 126, 85, 98, 65, 82, 93, 203, 84, 254,
			10, 175, 177, 254, 87, 20, 83, 126, 75, 165,
			114, 47, 73, 37, 60, 195, 139, 37, 52, 141,
			141, 59, 126, 129, 228, 88, 75, 222, 19, 136,
			69, 123, 86, 2, 8, 118, 28, 102, 177, 165,
			95, 41, 0, 0, 0, 0, 129, 71, 0, 180,
			0, 0, 112, 57, 41, 132, 59, 175, 224, 106,
			85, 54, 32, 149, 96, 37, 93, 139, 149, 104,
			0, 249, 100, 167, 87, 126, 59, 129, 54, 20,
			14, 68, 41, 137, 107, 129, 130, 130, 1, 129,
			131, 253, 60, 104, 16, 50, 35, 175, 169, 30,
			195, 106, 61, 58, 197, 250, 0, 18, 128, 129,
			252, 196, 222, 104, 95, 131, 106, 80, 1, 100,
			250, 196, 128, 107, 46, 129, 158, 247, 62, 41,
			0, 197, 110, 133, 106, 252, 167, 167, 22, 180,
			0, 52, 184, 199, 126, 232, 184, 133, 95, 72,
			112, 169, 85, 136, 51, 171, 0, 41, 0, 136,
			180, 100, 169, 136, 36, 134, 77, 52, 123, 220,
			111, 178, 162, 0, 87, 0, 139, 89, 176, 107,
			131, 106, 110, 107, 88, 224, 20, 32, 163, 139,
			45, 35, 80, 49, 5, 4, 0, 0, 111, 183,
			169, 117, 181, 59, 141, 0, 163, 163, 136, 167,
			169, 6, 209, 111, 176, 0, 252, 48, 124, 91,
			111, 111, 252, 232, 95, 34, 41, 250, 144, 104,
			141, 85, 95, 86, 111, 155, 164, 156, 48, 85,
			81, 104, 250, 121, 38, 0, 156, 145, 156, 145,
			43, 30, 0, 106, 91, 90, 111, 252, 89, 104,
			96, 84, 59, 135, 232, 121, 64, 124, 95, 239,
			85, 89, 121, 35, 0, 171, 41, 104, 145, 111,
			47, 124, 133, 132, 48, 21, 84, 250, 21, 21,
			77, 139, 252, 38, 27, 38, 27, 134, 54, 54,
			169, 55, 111, 169, 107, 57, 57, 49, 131, 129,
			203, 203, 102, 203, 51, 101, 65, 38, 57, 33,
			95, 98, 41, 24, 141, 243, 251, 3, 52, 1,
			114, 171, 104, 89, 133, 103, 24, 127, 58, 129,
			103, 0, 114, 81, 40, 18, 64, 135, 33, 106,
			66, 51, 126, 52, 104, 58, 72, 132, 171, 18,
			72, 131, 131, 41, 232, 73, 136, 106, 1, 104,
			30, 148, 148, 102, 98, 65, 126, 126, 102, 6,
			129, 104, 232, 126, 73, 104, 89, 84, 105, 205,
			193, 193, 2, 151, 72, 111, 14, 14, 14, 241,
			241, 14, 32, 191, 0, 0, 241, 0, 130, 126,
			23, 205, 75, 98, 80, 15, 87, 139, 205, 114,
			3, 71, 0, 59, 238, 139, 76, 53, 14, 24,
			0, 191, 54, 41, 111, 75, 115, 131, 57, 24,
			184, 205, 169, 69, 15, 33, 249, 180, 126, 26,
			126, 195, 180, 4, 67, 39, 63, 200, 141, 190,
			250, 244, 207, 250, 60, 87, 43, 86, 14, 212,
			0, 90, 37, 70, 1, 250, 106, 85, 111, 101,
			3, 99, 148, 1, 99, 70, 58, 184, 1, 101,
			114, 114, 46, 46, 132, 19, 109, 59, 46, 166,
			216, 74, 83, 107, 68, 133, 3, 18, 120, 197,
			52, 126, 66, 112, 30, 143, 43, 78, 83, 57,
			85, 75, 190, 3, 250, 32, 234, 112, 252, 84,
			84, 98, 49, 17, 100, 132, 38, 84, 0, 0,
			60, 133, 38, 252, 196, 102, 79, 1, 136, 19,
			142, 119, 58, 5, 129, 15, 15, 93, 81, 134,
			84, 93, 141, 121, 0, 250, 86, 95, 95, 0,
			104, 83, 114, 112, 113, 100, 37, 36, 58, 110,
			75, 121, 128, 250, 205, 16, 193, 57, 197, 84,
			39, 65, 14, 30, 133, 238, 235, 141, 115, 101,
			177, 193, 120, 87, 232, 169, 182, 25, 87, 80,
			121, 203, 193, 41, 139, 117, 75, 75, 76, 115,
			169, 196, 104, 90, 85, 110, 65, 133, 128, 102,
			126, 100, 49, 157, 137, 139, 90, 3, 104, 130,
			134, 5, 20, 126, 196, 12, 143, 41, 166, 110,
			102, 119, 93, 82, 191, 49, 121, 246, 48, 83,
			133, 52, 222, 37, 176, 237, 20, 250, 49, 216,
			139, 113, 136, 38, 167, 96, 97, 90, 235, 200,
			58, 101, 129, 109, 105, 13, 97, 178, 180, 58,
			183, 90, 247, 120, 136, 106, 135, 134, 104, 126,
			126, 149, 37, 106, 80, 120, 131, 101, 174, 49,
			129, 80, 92, 90, 22, 144, 133, 106, 84, 85,
			147, 136, 132, 183, 0, 3, 70, 104, 204, 167,
			104, 196, 5, 135, 247, 80, 89, 90, 119, 95,
			52, 157, 61, 255, 139, 80, 135, 17, 246, 98,
			93, 133, 106, 124, 201, 128, 76, 251, 234, 84,
			4, 177, 104, 130, 136, 252, 132, 133, 131, 39,
			143, 27, 0, 126, 129, 177, 32, 127, 121, 224,
			98, 135, 174, 3, 80, 129, 142, 112, 9, 190,
			143, 110, 85, 20, 71, 124, 119, 104, 249, 107,
			163, 114, 164, 112, 169, 99, 90, 84, 169, 46,
			87, 104, 111, 69, 165, 111, 135, 130, 39, 82,
			193, 54, 37, 238, 87, 37, 71, 159, 245, 220,
			112, 136, 89, 35, 217, 71, 109, 89, 87, 68,
			77, 52, 74, 140, 28, 64, 169, 46, 49, 167,
			46, 61, 72, 165, 162, 171, 80, 83, 114, 124,
			63, 0, 20, 131, 127, 27, 90, 105, 92, 40,
			44, 99, 47, 127, 103, 151, 78, 112, 75, 70,
			115, 83, 139, 93, 172, 127, 57, 143, 65, 255,
			61, 140, 144, 85, 89, 250, 102, 109, 112, 175,
			60, 135, 240, 114, 33, 41, 250, 84, 38, 180,
			210, 139, 61, 49, 167, 133, 240, 85, 50, 65,
			241, 58, 111, 216, 111, 180, 93, 196, 136, 176,
			182, 106, 53, 4, 123, 111, 217, 37, 243, 46,
			121, 112, 162, 127, 1, 100, 252, 65, 198, 133,
			106, 196, 12, 112, 81, 11, 85, 1, 112, 148,
			129, 35, 112, 27, 180, 144, 72, 0, 131, 197,
			241, 85, 111, 112, 37, 37, 16, 124, 136, 131,
			227, 111, 3, 68, 4, 72, 87, 124, 20, 83,
			83, 63, 80, 81, 17, 90, 27, 80, 96, 94,
			100, 119, 96, 196, 148, 191, 107, 100, 110, 119,
			198, 92, 193, 116, 127, 207, 158, 39, 77, 234,
			193, 171, 250, 250, 193, 65, 50, 80, 24, 72,
			197, 95, 203, 95, 129, 239, 131, 131, 121, 87,
			88, 104, 106, 126, 39, 134, 131, 125, 59, 111,
			14, 200, 39, 71, 38, 109, 139, 134, 0, 3,
			133, 0, 106, 60, 178, 128, 112, 208, 8, 110,
			5, 45, 172, 32, 100, 46, 220, 144, 78, 39,
			189, 107, 161, 158, 0, 131, 95, 179, 107, 92,
			0, 0, 247, 135, 107, 60, 112, 56, 112, 171,
			102, 195, 142, 38, 148, 58, 57, 76, 177, 101,
			26, 201, 124, 39, 104, 182, 187, 249, 80, 169,
			23, 84, 85, 81, 253, 27, 39, 52, 104, 131,
			51, 114, 94, 106, 15, 127, 52, 52, 216, 57,
			39, 17, 80, 235, 41, 41, 236, 82, 25, 199,
			115, 65, 114, 125, 85, 144, 63, 133, 107, 90,
			134, 122, 96, 144, 61, 63, 54, 14, 133, 126,
			108, 106, 95, 178, 133, 100, 35, 189, 107, 46,
			184, 163, 181, 89, 18, 59, 111, 94, 121, 14,
			16, 133, 132, 152, 37, 33, 63, 196, 5, 180,
			121, 121, 110, 32, 83, 109, 108, 189, 1, 111,
			243, 129, 99, 133, 250, 85, 129, 180, 184, 178,
			135, 109, 49, 179, 133, 92, 253, 169, 100, 26,
			133, 49, 46, 72, 232, 63, 103, 85, 196, 60,
			203, 33, 112, 171, 163, 76, 169, 252, 87, 96,
			104, 189, 144, 190, 146, 183, 240, 41, 127, 127,
			39, 95, 124, 160, 131, 100, 44, 173, 53, 64,
			101, 132, 49, 107, 119, 94, 41, 105, 107, 89,
			0, 0, 95, 171, 133, 80, 241, 111, 133, 247,
			88, 126, 134, 84, 233, 129, 235, 80, 89, 252,
			252, 85, 180, 85, 55, 75, 125, 200, 20, 52,
			173, 131, 134, 104, 63, 78, 58, 59, 34, 98,
			158, 0, 34, 71, 136, 22, 116, 14, 32, 32,
			32, 41, 69, 249, 175, 80, 27, 27, 37, 137,
			37, 122, 133, 165, 35, 93, 54, 118, 49, 41,
			240, 112, 114, 177, 119, 90, 114, 115, 87, 131,
			32, 85, 5, 180, 163, 0, 111, 175, 200, 119,
			59, 124, 120, 90, 111, 169, 39, 97, 176, 189,
			144, 109, 155, 24, 171, 65, 103, 5, 124, 171,
			32, 189, 58, 58, 104, 54, 241, 139, 57, 0,
			129, 143, 171, 224, 109, 135, 86, 27, 129, 54,
			126, 41, 57, 50, 68, 27, 136, 162, 18, 171,
			196, 39, 41, 196, 222, 107, 107, 195, 135, 250,
			14, 129, 114, 17, 149, 83, 61, 106, 106, 74,
			48, 128, 136, 163, 142, 2, 249, 143, 80, 18,
			102, 252, 92, 18, 160, 85, 0, 18, 131, 74,
			183, 183, 184, 169, 110, 101, 180, 49, 134, 107,
			72, 79, 126, 90, 235, 37, 16, 32, 199, 177,
			131, 249, 27, 37, 102, 18, 128, 87, 180, 0,
			112, 107, 15, 169, 136, 89, 107, 54, 80, 90,
			123, 114, 136, 178, 162, 74, 83, 121, 162, 0,
			0, 107, 196, 129, 171, 131, 107, 86, 175, 104,
			131, 113, 32, 57, 9, 131, 163, 83, 45, 112,
			143, 87, 35, 167, 163, 49, 4, 109, 252, 82,
			105, 6, 100, 114, 0, 22, 117, 181, 100, 169,
			196, 58, 59, 59, 133, 32, 0, 114, 6, 136,
			163, 163, 209, 78, 181, 5, 87, 100, 93, 100,
			111, 128, 16, 199, 106, 62, 126, 89, 89, 0,
			119, 176, 119, 139, 138, 124, 90, 38, 143, 116,
			116, 24, 101, 250, 134, 86, 223, 107, 81, 247,
			104, 180, 45, 241, 144, 235, 100, 144, 236, 205,
			34, 173, 107, 146, 75, 106, 91, 133, 106, 91,
			80, 253, 15, 56, 86, 132, 136, 148, 128, 90,
			6, 76, 76, 176, 143, 96, 139, 59, 237, 137,
			237, 58, 58, 19, 101, 69, 112, 136, 124, 65,
			80, 39, 171, 38, 246, 0, 121, 48, 163, 68,
			133, 95, 92, 5, 174, 124, 101, 89, 94, 87,
			106, 84, 135, 102, 39, 80, 69, 69, 116, 144,
			119, 183, 86, 136, 96, 132, 247, 100, 126, 106,
			129, 126, 147, 0, 83, 34, 103, 126, 0, 60,
			135, 11, 0, 85, 90, 137, 35, 249, 136, 143,
			68, 78, 111, 240, 164, 32, 121, 87, 38, 15,
			121, 0, 41, 164, 98, 98, 141, 89, 85, 100,
			112, 140, 4, 63, 90, 250, 84, 0, 0, 112,
			100, 124, 194, 139, 60, 11, 86, 175, 159, 127,
			46, 85, 53, 84, 119, 139, 90, 113, 133, 49,
			87, 246, 2, 53, 85, 2, 91, 143, 100, 100,
			104, 141, 111, 94, 8, 241, 100, 0, 38, 33,
			34, 0, 0, 0, 0, 36, 115, 158, 134, 73,
			99, 126, 87, 171, 96, 92, 125, 133, 131, 14,
			107, 136, 80, 72, 65, 85, 227, 227, 32, 100,
			137, 137, 111, 193, 30, 84, 103, 91, 2, 16,
			193, 124, 95, 128, 80, 83, 3, 54, 101, 174,
			136, 0, 95, 103, 10, 121, 114, 86, 0, 0,
			15, 80, 73, 60, 34, 32, 114, 20, 125, 90,
			85, 84, 85, 114, 115, 115, 85, 114, 93, 207,
			147, 0, 102, 98, 201, 171, 107, 81, 15, 0,
			0, 253, 177, 85, 14, 16, 49, 180, 131, 41,
			104, 179, 87, 54, 104, 63, 141, 145, 114, 121,
			104, 133, 5, 80, 173, 112, 232, 11, 137, 189,
			0, 33, 52, 123, 131, 85, 85, 85, 104, 89,
			38, 125, 32, 103, 252, 8, 100, 87, 254, 150,
			62, 75, 37, 133, 86, 49, 173, 111, 175, 69,
			34, 86, 83, 100, 98, 163, 193, 60, 104, 136,
			194, 0, 0, 107, 111, 104, 97, 163, 58, 119,
			24, 54, 85, 6, 49, 171, 126, 136, 90, 176,
			80, 104, 90, 128, 126, 0, 0, 163, 17, 87,
			147, 98, 135, 40, 60, 102, 115, 163, 16, 15,
			169, 203, 10, 21, 63, 184, 5, 98, 157, 48,
			0, 169, 180, 141, 173, 100, 85, 90, 178, 100,
			0, 9, 113, 163, 49, 141, 69, 105, 0, 35,
			196, 60, 163, 136, 163, 176, 52, 111, 137, 163,
			233, 132, 237, 128, 112, 2, 80, 0, 141, 141,
			90, 103, 6, 67, 103, 102, 147, 45, 80, 235,
			43, 148, 118, 118, 253, 67, 253, 242, 8, 235,
			34, 131, 234, 72, 109, 70, 70, 15, 67, 9,
			20, 9, 110, 0, 72, 99, 37, 223, 37, 245,
			138, 204, 57, 205, 165, 12, 190, 84, 191, 205,
			12, 84, 100, 82, 11, 49, 131, 102, 110, 102,
			38, 205, 63, 252, 5, 5, 144, 62, 85, 190,
			150, 252, 84, 102, 85, 169, 169, 248, 129, 94,
			133, 12, 5, 20, 72, 139, 130, 131, 87, 242,
			148, 139, 147, 41, 85, 11, 183, 134, 187, 24,
			80, 169, 75, 69, 27, 132, 85, 169, 72, 174,
			241, 243, 10, 85, 40, 80, 158, 40, 5, 5,
			6, 83, 3, 20, 31, 47, 3, 134, 140, 106,
			187, 110, 146, 20, 120, 99, 112, 124, 140, 114,
			157, 223, 63, 1, 134, 114, 11, 241, 139, 216,
			38, 237, 86, 75, 121, 176, 85, 241, 216, 38,
			110, 101, 113, 139, 58, 20, 102, 87, 222, 124,
			117, 133, 115, 128, 129, 124, 32, 57, 15, 40,
			69, 165, 72, 86, 39, 155, 132, 111, 55, 111,
			14, 190, 85, 140, 169, 86, 106, 53, 164, 11,
			133, 100, 30, 169, 133, 87, 136, 112, 85, 102,
			6, 250, 216, 16, 106, 169, 174, 131, 253, 159,
			100, 109, 145, 196, 33, 104, 133, 132, 99, 195,
			23, 51, 35, 174, 0, 183, 121, 145, 121, 80,
			87, 83, 112, 92, 136, 191, 80, 112, 87, 72,
			99, 210, 90, 130, 120, 15, 110, 110, 193, 30,
			102, 55, 20, 201, 122, 112, 51, 187, 112, 57,
			111, 39, 114, 0, 104, 131, 44, 114, 189, 136,
			132, 203, 127, 32, 5, 5, 114, 53, 12, 141,
			14, 14, 125, 21, 175, 111, 69, 102, 173, 48,
			89, 40, 0, 85, 96, 140, 72, 126, 155, 87,
			90, 57, 87, 98, 222, 15, 128, 225, 195, 174,
			210, 106, 40, 180, 57, 87, 196, 9, 124, 210,
			183, 87, 250, 4, 96, 198, 144, 184, 180, 111,
			52, 79, 3, 91, 68, 166, 6, 129, 119, 63,
			43, 93, 138, 111, 250, 111, 101, 187, 119, 84,
			90, 200, 134, 99, 18, 15, 13, 113, 141, 114,
			141, 78, 131, 193, 58, 241, 80, 124, 87, 253,
			176, 57, 104, 3, 246, 65, 90, 96, 85, 20,
			48, 101, 130, 34, 247, 48, 148, 8, 38, 37,
			104, 147, 130, 200, 32, 177, 14, 131, 131, 141,
			82, 178, 135, 133, 131, 169, 106, 87, 135, 100,
			100, 94, 101, 95, 183, 52, 136, 0, 149, 98,
			10, 80, 88, 102, 86, 118, 107, 39, 95, 8,
			238, 0, 59, 107, 127, 81, 77, 37, 64, 84,
			84, 37, 142, 193, 11, 68, 87, 47, 112, 96,
			100, 3, 5, 164, 169, 94, 90, 177, 99, 85,
			176, 169, 135, 171, 56, 56, 0, 78, 65, 19,
			126, 53, 200, 111, 139, 36, 162, 81, 38, 80,
			65, 41, 143, 238, 37, 121, 250, 77, 159, 33,
			250, 13, 78, 180, 49, 105, 100, 66, 11, 175,
			0, 241, 233, 253, 143, 0, 82, 0, 2, 72,
			134, 127, 111, 191, 193, 46, 96, 64, 92, 57,
			16, 200, 131, 80, 18, 124, 90, 43, 131, 139,
			101, 171, 5, 86, 73, 112, 103, 210, 121, 107,
			111, 125, 19, 27, 177, 0, 15, 56, 102, 81,
			84, 135, 135, 107, 187, 61, 177, 60, 169, 164,
			107, 65, 253, 55, 141, 128, 102, 2, 18, 71,
			33, 159, 139, 49, 135, 104, 53, 49, 250, 169,
			107, 56, 3, 96, 5, 171, 189, 127, 106, 0,
			107, 80, 180, 84, 62, 0, 123, 98, 4, 59,
			175, 173, 2, 52, 125, 107, 249, 136, 83, 135,
			177, 129, 0, 136, 2, 14, 24, 4, 119, 59,
			133, 108, 59, 126, 124, 27, 54, 65, 0, 111,
			135, 90, 18, 41, 81, 149, 163, 85, 129, 96,
			18, 128, 92, 167, 72, 169, 133, 16, 169, 117,
			2, 129, 107, 54, 161, 178, 180, 169, 117, 163,
			107, 196, 88, 85, 105, 60, 117, 124, 103, 10,
			67, 237, 121, 133, 243, 8, 9, 169, 76, 0,
			132, 252, 8, 239, 84, 58, 82, 232, 0, 0,
			0, 121, 176, 104, 246, 48, 0, 140, 33, 38,
			0, 59, 195, 21, 45, 246, 15, 135, 131, 0,
			48, 107, 250, 87, 179, 63, 232, 195, 139, 13,
			175, 123, 84, 241, 58, 82, 107, 100, 93, 57,
			37, 65, 65, 112, 33, 38, 1, 37, 32, 32,
			19, 38, 52, 37, 109, 43, 180, 90, 109, 13,
			0, 222, 65, 110, 130, 37, 124, 65, 90, 208,
			65, 246, 68, 122, 68, 5, 116, 195, 14, 250,
			177, 98, 177, 33, 205, 114, 83, 90, 99, 65,
			134, 134, 5, 80, 90, 65, 205, 0, 235, 132,
			76, 56, 208, 177, 12, 131, 41, 205, 205, 27,
			0, 92, 14, 56, 133, 185, 250, 185, 235, 0,
			83, 122, 111, 111, 205, 142, 104, 177, 35, 67,
			40, 122, 59, 47, 129, 78, 132, 37, 33, 74,
			167, 129, 30, 177, 67, 72, 175, 132, 132, 40,
			20, 67, 67, 241, 220, 58, 41, 41, 133, 104,
			44, 207, 68, 14, 134, 173, 100, 96, 138, 135,
			86, 32, 95, 230, 169, 101, 36, 110, 6, 134,
			141, 85, 86, 53, 14, 104, 169, 145, 44, 87,
			136, 237, 241, 93, 148, 48, 90, 250, 58, 131,
			82, 133, 63, 139, 129, 85, 139, 65, 130, 96,
			124, 19, 220, 132, 109, 136, 5, 39, 69, 104,
			134, 80, 126, 76, 101, 38, 133, 117, 99, 193,
			71, 136, 89, 69, 71, 190, 241, 89, 53, 249,
			169, 133, 55, 76, 84, 30, 165, 40, 124, 87,
			104, 240, 127, 105, 59, 85, 187, 175, 38, 129,
			65, 3, 38, 14, 14, 200, 102, 74, 77, 80,
			111, 53, 99, 136, 85, 58, 37, 134, 129, 111,
			120, 87, 161, 101, 37, 71, 111, 103, 81, 124,
			153, 130, 106, 104, 179, 26, 141, 38, 85, 105,
			104, 81, 129, 44, 8, 167, 177, 31, 40, 230,
			65, 56, 17, 59, 127, 16, 37, 51, 183, 104,
			145, 40, 127, 125, 51, 56, 6, 66, 179, 179,
			203, 135, 106, 107, 125, 90, 173, 178, 254, 177,
			165, 87, 85, 58, 106, 115, 2, 8, 87, 105,
			104, 224, 111, 80, 104, 109, 241, 167, 169, 41,
			58, 175, 65, 175, 162, 17, 129, 38, 101, 96,
			134, 132, 0, 169, 128, 162, 129, 65, 87, 107,
			106, 4, 109, 59, 65, 183, 181, 181, 20, 0,
			107, 247, 82, 62, 82, 7, 7, 255, 14, 119,
			119, 191, 61, 233, 134, 125, 107, 48, 176, 95,
			203, 129, 133, 240, 95, 2, 77, 114, 112, 14,
			78, 40, 252, 85, 2, 137, 114, 125, 114, 120,
			53, 114, 89, 103, 247, 114, 133, 2, 92, 125,
			169, 243, 115, 133, 241, 93, 237, 135, 142, 3,
			54, 6, 124, 102, 142, 142, 135, 124, 102, 126,
			72, 200, 250, 107, 111, 11, 128, 134, 239, 115,
			107, 115, 104, 20, 78, 115, 4, 126, 100, 131,
			115, 111, 158, 83, 92, 60, 235, 90, 3, 38,
			60, 180, 126, 195, 180, 135, 95, 131, 235, 105,
			3, 180, 95, 135, 59, 3, 102, 169, 205, 68,
			93, 95, 190, 190, 133, 250, 78, 65, 88, 75,
			91, 85, 235, 87, 75, 200, 201, 38, 39, 114,
			197, 235, 84, 198, 58, 193, 191, 145, 87, 152,
			39, 101, 132, 102, 37, 128, 56, 131, 157, 139,
			37, 104, 38, 193, 203, 136, 131, 131, 197, 63,
			112, 67, 104, 144, 144, 34, 124, 96, 19, 196,
			178, 54, 69, 196, 67, 104, 80, 201, 96, 38,
			157, 140, 204, 131, 66, 101, 100, 203, 134, 188,
			129, 132, 193, 56, 34, 112, 124, 63, 37, 55,
			140, 77, 78, 87, 85, 159, 162, 131, 32, 65,
			127, 78, 176, 39, 2, 174, 99, 136, 132, 169,
			162, 54, 140, 46, 54, 72, 241, 241, 205, 127,
			216, 180, 95, 134, 23, 135, 111, 127, 187, 86,
			92, 126, 108, 0, 46, 131, 193, 72, 120, 96,
			64, 158, 95, 19, 191, 95, 82, 81, 198, 40,
			158, 196, 82, 152, 59, 36, 148, 51, 86, 2,
			191, 201, 189, 46, 120, 127, 104, 66, 152, 203,
			47, 49, 179, 38, 189, 243, 37, 129, 195, 124,
			20, 244, 85, 254, 249, 136, 62, 37, 47, 173,
			35, 87, 145, 103, 95, 69, 84, 175, 158, 131,
			103, 2, 126, 126, 131, 102, 128, 139, 80, 40,
			129, 222, 98, 102, 128, 195, 197, 18, 197, 169,
			106, 141, 96, 197, 128, 180, 195, 178, 105, 189,
			85, 41, 60, 145, 136, 191, 135, 175, 111, 48,
			27, 141, 39, 104, 37, 133, 120, 37, 107, 139,
			135, 133, 55, 73, 2, 133, 123, 128, 7, 39,
			68, 250, 129, 144, 93, 84, 75, 153, 253, 85,
			83, 157, 59, 187, 30, 58, 141, 169, 90, 200,
			228, 122, 146, 133, 250, 145, 134, 86, 77, 99,
			241, 129, 100, 54, 139, 35, 75, 235, 100, 0,
			87, 82, 203, 124, 4, 111, 148, 75, 75, 63,
			125, 131, 77, 90, 205, 136, 161, 15, 226, 246,
			240, 176, 237, 166, 247, 20, 247, 37, 115, 2,
			169, 178, 69, 0, 169, 157, 41, 150, 5, 136,
			157, 107, 77, 210, 130, 180, 80, 2, 183, 149,
			92, 100, 70, 240, 85, 0, 119, 48, 86, 254,
			0, 80, 254, 0, 150, 89, 6, 32, 164, 119,
			111, 89, 86, 190, 178, 0, 35, 35, 83, 177,
			107, 190, 6, 100, 55, 159, 111, 0, 0, 180,
			36, 131, 0, 50, 143, 150, 240, 100, 141, 151,
			29, 250, 145, 1, 175, 142, 20, 68, 200, 66,
			131, 115, 177, 2, 54, 6, 176, 11, 106, 74,
			84, 250, 182, 78, 65, 94, 11, 250, 36, 18,
			100, 67, 68, 135, 75, 134, 107, 15, 148, 14,
			80, 48, 131, 73, 86, 59, 64, 210, 240, 131,
			63, 59, 30, 0, 250, 0, 87, 96, 6, 6,
			187, 100, 217, 52, 77, 48, 177, 49, 60, 9,
			122, 241, 80, 25, 167, 55, 65, 86, 85, 171,
			235, 80, 114, 74, 129, 148, 161, 0, 1, 108,
			139, 32, 250, 5, 240, 180, 180, 145, 253, 36,
			106, 167, 16, 250, 203, 250, 53, 145, 1, 47,
			0, 129, 32, 165, 4, 123, 62, 131, 85, 175,
			68, 65, 125, 235, 115, 254, 63, 169, 131, 133,
			85, 127, 254, 75, 131, 111, 141, 115, 128, 125,
			167, 148, 41, 129, 6, 59, 83, 132, 241, 241,
			111, 245, 250, 2, 148, 131, 111, 18, 195, 237,
			144, 20, 0, 199, 22, 87, 157, 167, 167, 133,
			169, 169, 83, 6, 237, 107, 169, 178, 178, 203,
			20, 45, 105, 163, 117, 100, 39, 39, 169, 13,
			35, 113, 49, 250, 57, 187, 90, 102, 87, 133,
			250, 133, 13, 41, 39, 0, 104, 39, 110, 133,
			66, 90, 90, 196, 147, 133, 53, 193, 151, 4,
			121, 136, 37, 54, 48, 31, 196, 184, 111, 88,
			84, 66, 243, 136, 107, 86, 133, 129, 95, 131,
			95, 46, 135, 131, 92, 159, 63, 60, 128, 61,
			250, 102, 105, 149, 176, 180, 19, 135, 60, 133,
			180, 32, 11, 129, 126, 110, 85, 106, 144, 128,
			131, 90, 112, 84, 87, 101, 64, 104, 193, 49,
			63, 0, 143, 131, 109, 129, 95, 60, 38, 187,
			57, 0, 96, 250, 111, 85, 129, 49, 32, 96,
			126, 54, 169, 224, 216, 60, 169, 9, 113, 64,
			117, 167, 16, 111, 111, 169, 90, 0, 115, 71,
			94, 49, 12, 71, 144, 30, 93, 104, 87, 19,
			217, 3, 3, 134, 86, 114, 114, 148, 198, 133,
			136, 14, 133, 111, 196, 153, 8, 241, 216, 169,
			110, 147, 241, 6, 176, 203, 37, 217, 0, 101,
			151, 133, 133, 41, 139, 144, 58, 129, 37, 69,
			133, 128, 115, 106, 144, 133, 134, 12, 72, 104,
			136, 126, 224, 90, 85, 147, 164, 90, 120, 46,
			184, 159, 93, 136, 64, 37, 71, 34, 46, 99,
			182, 180, 102, 151, 12, 142, 9, 7, 129, 133,
			133, 159, 168, 240, 148, 19, 40, 149, 111, 52,
			0, 0, 104, 85, 15, 129, 90, 14, 228, 134,
			134, 145, 95, 37, 60, 81, 171, 144, 111, 129,
			95, 131, 133, 60, 130, 129, 95, 95, 102, 15,
			54, 0, 129, 146, 205, 32, 194, 133, 129, 180,
			52, 129, 107, 81, 3, 27, 0, 104, 125, 255,
			129, 54, 89, 249, 133, 143, 69, 0, 184, 54,
			224, 27, 126, 9, 228, 111, 0, 129, 73, 81,
			37, 128, 100, 184, 16, 0, 9, 141, 169, 117,
			97, 76, 138, 2, 85, 2, 151, 111, 28, 136,
			102, 43, 142, 71, 165, 255, 125, 102, 15, 10,
			102, 19, 111, 136, 133, 254, 66, 84, 107, 102,
			133, 43, 102, 66, 133, 44, 137, 89, 37, 152,
			52, 83, 58, 153, 148, 141, 95, 52, 0, 158,
			71, 0, 106, 83, 76, 99, 111, 139, 2, 102,
			102, 66, 173, 111, 65, 66, 139, 173, 85, 84,
			158, 44, 139, 0, 156, 178, 37, 53, 243, 119,
			52, 254, 2, 71, 119, 119, 255, 169, 41, 39,
			90, 252, 41, 119, 250, 252, 100, 39, 41, 198,
			139, 126, 136, 176, 178, 19, 136, 136, 127, 104,
			49, 142, 119, 69, 50, 136, 66, 104, 41, 136,
			4, 134, 246, 73, 34, 139, 29, 62, 54, 123,
			136, 145, 136, 136, 136, 166, 240, 111, 38, 93,
			190, 136, 0, 72, 129, 89, 6, 53, 129, 131,
			128, 55, 99, 141, 112, 121, 94, 89, 28, 241,
			14, 131, 104, 70, 32, 38, 86, 63, 136, 206,
			38, 102, 169, 255, 200, 10, 66, 49, 90, 27,
			12, 82, 56, 144, 63, 176, 120, 226, 90, 101,
			83, 130, 96, 83, 39, 191, 247, 0, 131, 2,
			178, 0, 15, 183, 107, 4, 38, 106, 102, 87,
			14, 2, 103, 62, 133, 135, 5, 55, 17, 82,
			157, 136, 69, 129, 56, 113, 27, 134, 152, 162,
			14, 31, 59, 132, 27, 90, 114, 71, 233, 169,
			164, 139, 105, 131, 112, 69, 86, 133, 37, 53,
			39, 136, 151, 89, 34, 68, 130, 100, 95, 155,
			93, 40, 157, 94, 114, 0, 252, 89, 131, 249,
			162, 146, 14, 14, 14, 96, 38, 104, 111, 131,
			128, 102, 38, 132, 1, 30, 135, 180, 20, 129,
			175, 53, 142, 90, 124, 102, 151, 252, 252, 142,
			45, 105, 112, 27, 139, 20, 120, 255, 75, 183,
			58, 89, 21, 131, 0, 15, 55, 88, 87, 246,
			131, 38, 121, 39, 136, 113, 46, 90, 84, 70,
			48, 129, 134, 125, 92, 193, 83, 43, 139, 242,
			87, 136, 119, 255, 120, 3, 198, 252, 0, 158,
			0, 179, 114, 115, 60, 113, 40, 95, 85, 21,
			132, 101, 220, 252, 89, 52, 100, 236, 72, 169,
			14, 143, 41, 31, 38, 136, 253, 178, 163, 131,
			21, 169, 126, 14, 63, 49, 100, 240, 28, 52,
			234, 243, 71, 111, 199, 139, 120, 85, 109, 104,
			121, 32, 152, 51, 246, 119, 129, 107, 52, 179,
			124, 180, 217, 56, 52, 0, 56, 166, 73, 172,
			89, 20, 196, 31, 59, 173, 58, 65, 90, 131,
			200, 158, 57, 254, 62, 125, 55, 165, 117, 89,
			180, 39, 117, 0, 234, 250, 234, 93, 139, 72,
			180, 100, 20, 59, 23, 148, 101, 252, 171, 21,
			135, 162, 0, 163, 158, 111, 113, 114, 131, 58,
			64, 196, 40, 129, 0, 250, 63, 139, 135, 83,
			51, 135, 252, 160, 63, 180, 180, 131, 75, 107,
			111, 162, 178, 0, 171, 163, 252, 113, 134, 4,
			171, 15, 73, 148, 169, 31, 183, 107, 113, 143,
			95, 196, 63, 83, 37, 129, 37, 229, 90, 167,
			87, 144, 216, 54, 127, 252, 0, 14, 8, 84,
			30, 146, 16, 86, 14, 53, 106, 169, 38, 58,
			0, 6, 169, 93, 139, 247, 203, 51, 126, 135,
			169, 52, 66, 169, 85, 52, 119, 69, 144, 27,
			113, 135, 175, 140, 7, 0, 86, 197, 4, 0,
			172, 87, 90, 172, 24, 136, 169, 113, 180, 139,
			250, 53, 7, 33, 175, 145, 136, 109, 0, 24,
			24, 60, 15, 16, 197, 120, 95, 145, 121, 131,
			117, 48, 169, 90, 90, 228, 11, 102, 94, 95,
			60, 3, 0, 26, 140, 60, 196, 24, 86, 119,
			146, 132, 203, 24, 24, 228, 38, 172, 132, 155,
			20, 124, 41, 145, 131, 228, 72, 220, 169, 151,
			63, 220, 66, 163, 196, 196, 138, 85, 100, 132,
			138, 110, 129, 30, 135, 98, 113, 119, 111, 115,
			78, 12, 81, 81, 3, 206, 144, 70, 223, 89,
			134, 41, 46, 241, 106, 30, 119, 133, 129, 86,
			114, 12, 58, 135, 52, 84, 56, 53, 138, 124,
			6, 135, 90, 133, 250, 144, 40, 119, 124, 167,
			85, 90, 90, 37, 11, 136, 4, 176, 136, 34,
			93, 101, 90, 75, 131, 57, 41, 39, 134, 87,
			147, 137, 8, 139, 233, 41, 149, 157, 136, 12,
			118, 90, 134, 136, 40, 103, 7, 141, 157, 121,
			48, 99, 99, 61, 90, 153, 133, 5, 92, 183,
			96, 13, 87, 90, 97, 69, 15, 66, 106, 167,
			90, 5, 95, 111, 67, 69, 49, 132, 88, 126,
			141, 133, 131, 140, 38, 197, 131, 184, 37, 3,
			41, 9, 69, 89, 78, 0, 99, 94, 64, 94,
			90, 119, 85, 90, 68, 54, 74, 159, 90, 136,
			121, 133, 100, 137, 87, 129, 95, 0, 145, 175,
			76, 169, 184, 172, 40, 5, 34, 250, 250, 142,
			250, 78, 252, 87, 40, 80, 250, 61, 78, 94,
			79, 13, 141, 23, 109, 53, 182, 177, 250, 126,
			11, 47, 176, 197, 250, 134, 59, 145, 108, 146,
			104, 144, 92, 172, 135, 85, 19, 200, 111, 145,
			83, 184, 95, 0, 33, 0, 95, 88, 131, 148,
			87, 18, 197, 129, 73, 134, 63, 200, 198, 112,
			90, 10, 49, 3, 15, 124, 99, 145, 197, 80,
			90, 80, 111, 101, 198, 134, 171, 145, 15, 114,
			106, 64, 103, 133, 114, 37, 32, 57, 130, 112,
			145, 95, 38, 0, 99, 0, 107, 135, 104, 141,
			216, 9, 102, 235, 135, 131, 55, 5, 45, 114,
			86, 43, 85, 15, 61, 90, 114, 131, 95, 17,
			121, 116, 63, 87, 52, 131, 145, 61, 125, 23,
			14, 87, 51, 169, 56, 106, 85, 145, 167, 139,
			252, 189, 133, 184, 203, 243, 171, 196, 96, 145,
			129, 32, 54, 83, 43, 13, 104, 26, 204, 135,
			253, 127, 87, 85, 0, 94, 8, 96, 126, 254,
			123, 151, 133, 32, 24, 175, 111, 83, 173, 47,
			150, 131, 10, 32, 19, 94, 126, 122, 148, 85,
			253, 0, 56, 38, 126, 85, 27, 131, 132, 124,
			254, 49, 134, 133, 20, 32, 104, 210, 54, 104,
			31, 95, 129, 18, 252, 131, 249, 98, 148, 250,
			240, 169, 203, 167, 90, 148, 157, 110, 95, 167,
			87, 32, 0, 180, 32, 107, 23, 88, 87, 149,
			148, 183, 85, 60, 163, 167, 171, 196, 138, 111,
			119, 135, 87, 115, 113, 129, 78, 157, 129, 12,
			80, 114, 119, 46, 241, 30, 94, 206, 12, 145,
			182, 86, 133, 81, 84, 136, 131, 223, 41, 87,
			93, 90, 90, 171, 147, 37, 85, 133, 134, 135,
			8, 90, 41, 34, 104, 136, 57, 9, 15, 134,
			153, 10, 67, 113, 126, 129, 96, 132, 183, 141,
			133, 69, 99, 89, 140, 94, 85, 54, 61, 129,
			64, 129, 95, 176, 106, 95, 250, 85, 47, 33,
			108, 38, 80, 197, 40, 13, 40, 61, 177, 5,
			145, 126, 78, 184, 141, 144, 148, 88, 131, 197,
			163, 64, 198, 129, 114, 126, 49, 76, 73, 15,
			87, 101, 141, 124, 63, 184, 15, 200, 112, 135,
			90, 17, 131, 87, 53, 95, 32, 169, 104, 131,
			18, 243, 189, 167, 107, 56, 204, 26, 90, 173,
			32, 123, 132, 252, 254, 124, 133, 148, 89, 90,
			94, 89, 6, 89, 6, 20, 246, 120, 0, 94,
			107, 107, 1, 86, 105, 150, 59, 0, 1, 82,
			107, 167, 59, 180, 105, 79, 94, 79, 79, 112,
			0, 183, 90, 196, 82, 102, 136, 139, 191, 102,
			200, 94, 6, 103, 64, 140, 90, 175, 100, 128,
			149, 103, 143, 111, 133, 3, 82, 163, 41, 49,
			241, 187, 177, 6, 82, 169, 34, 80, 14, 129,
			123, 69, 177, 129, 140, 196, 128, 183, 241, 129,
			129, 181, 101, 199, 253, 57, 193, 101, 110, 110,
			86, 6, 95, 101, 102, 253, 118, 95, 176, 104,
			136, 63, 94, 253, 104, 87, 15, 7, 7, 252,
			124, 56, 87, 104, 101, 253, 87, 111, 99, 134,
			60, 112, 85, 83, 32, 86, 32, 171, 167, 99,
			225, 253, 32, 111, 100, 104, 39, 82, 86, 119,
			38, 38, 53, 90, 86, 239, 104, 161, 104, 241,
			176, 177, 133, 4, 85, 90, 88, 85, 85, 250,
			254, 126, 126, 41, 27, 119, 132, 125, 53, 85,
			61, 30, 38, 136, 131, 96, 39, 242, 145, 78,
			126, 120, 115, 115, 112, 5, 243, 104, 171, 4,
			0, 175, 239, 254, 5, 83, 104, 126, 96, 60,
			102, 165, 0, 147, 191, 129, 250, 101, 101, 101,
			67, 67, 80, 42, 18, 80, 207, 139, 167, 68,
			144, 99, 34, 114, 114, 233, 241, 38, 49, 4,
			130, 139, 128, 41, 165, 182, 129, 60, 232, 179,
			225, 132, 236, 120, 179, 129, 165, 128, 110, 203,
			123, 80, 129, 68, 103, 56, 50, 0, 114, 38,
			58, 58, 119, 99, 133, 0, 220, 58, 131, 35,
			176, 132, 110, 76, 173, 178, 133, 222, 66, 80,
			99, 67, 109, 0, 171, 114, 38, 174, 245, 136,
			139, 14, 63, 109, 81, 95, 246, 49, 0, 0,
			68, 111, 49, 158, 171, 158, 49, 171, 82, 158,
			171, 171, 49, 5, 38, 50, 68, 158, 220, 133,
			58, 222, 0, 129, 68, 68, 178, 111, 111, 128,
			49, 52, 104, 52, 49, 128, 128, 16, 104, 167,
			129, 3, 149, 26, 96, 63, 124, 125, 104, 12,
			89, 17, 135, 112, 72, 94, 15, 93, 30, 83,
			33, 102, 133, 0, 90, 85, 8, 238, 236, 131,
			84, 142, 110, 206, 4, 149, 8, 100, 111, 81,
			102, 135, 241, 252, 85, 85, 85, 149, 136, 58,
			37, 134, 127, 90, 37, 80, 135, 67, 58, 85,
			6, 20, 4, 65, 11, 103, 58, 144, 153, 133,
			216, 246, 144, 90, 236, 131, 87, 151, 238, 130,
			38, 133, 10, 205, 4, 121, 148, 104, 106, 95,
			101, 178, 70, 143, 180, 136, 226, 100, 236, 154,
			104, 106, 111, 96, 70, 133, 133, 93, 93, 80,
			3, 92, 242, 214, 144, 0, 37, 66, 133, 53,
			193, 90, 53, 90, 203, 188, 129, 90, 0, 155,
			22, 118, 250, 210, 196, 224, 181, 78, 20, 81,
			78, 3, 133, 136, 110, 118, 55, 174, 32, 68,
			193, 46, 37, 90, 0, 140, 51, 94, 91, 75,
			237, 37, 212, 90, 71, 75, 219, 210, 241, 102,
			183, 169, 171, 127, 53, 134, 172, 46, 241, 16,
			182, 242, 109, 140, 45, 58, 65, 212, 136, 134,
			161, 103, 1, 12, 37, 47, 90, 90, 139, 85,
			253, 78, 70, 241, 109, 145, 68, 84, 193, 18,
			139, 133, 50, 103, 232, 63, 3, 92, 210, 41,
			44, 208, 114, 134, 16, 77, 23, 71, 102, 131,
			80, 133, 111, 130, 73, 14, 33, 90, 87, 216,
			197, 76, 63, 73, 9, 252, 184, 76, 40, 60,
			52, 141, 96, 104, 20, 173, 129, 241, 90, 95,
			184, 18, 0, 33, 180, 109, 236, 42, 16, 132,
			90, 60, 203, 85, 139, 184, 133, 107, 184, 133,
			97, 46, 175, 69, 240, 216, 42, 173, 53, 107,
			89, 63, 83, 133, 133, 32, 121, 53, 20, 91,
			54, 86, 107, 32, 103, 58, 155, 224, 74, 171,
			11, 109, 141, 41, 104, 140, 161, 171, 26, 74,
			102, 250, 53, 18, 98, 210, 128, 118, 87, 16,
			92, 156, 161, 100, 180, 121, 115, 183, 4, 118,
			181, 216, 115, 36, 252, 83, 106, 118, 175, 106,
			144, 133, 220, 40, 129, 95, 40, 197, 220, 133,
			133, 96, 131, 67, 133, 94, 58, 131, 138, 87,
			111, 30, 102, 111, 39, 85, 85, 138, 111, 111,
			92, 139, 138, 91, 35, 35, 35, 138, 39, 59,
			41, 39, 65, 58, 249, 249, 105, 122, 65, 43,
			47, 86, 84, 135, 60, 43, 32, 104, 0, 233,
			58, 83, 8, 43, 113, 84, 8, 14, 180, 134,
			131, 25, 176, 136, 120, 76, 20, 87, 96, 43,
			130, 180, 119, 236, 85, 0, 90, 119, 87, 169,
			34, 111, 164, 68, 0, 80, 20, 195, 217, 139,
			125, 40, 145, 15, 191, 67, 0, 9, 30, 104,
			51, 25, 26, 179, 57, 0, 102, 39, 0, 59,
			253, 180, 104, 134, 131, 128, 195, 250, 180, 180,
			32, 45, 98, 172, 131, 131, 27, 100, 90, 246,
			100, 100, 26, 26, 104, 166, 68, 133, 2, 207,
			66, 133, 134, 240, 78, 104, 31, 197, 196, 93,
			252, 111, 111, 34, 93, 72, 86, 250, 190, 144,
			126, 54, 133, 88, 14, 90, 74, 80, 84, 133,
			250, 32, 81, 252, 12, 89, 152, 134, 180, 136,
			129, 0, 250, 100, 86, 6, 19, 91, 129, 122,
			122, 84, 84, 141, 101, 133, 114, 0, 5, 41,
			191, 99, 85, 13, 113, 49, 106, 110, 15, 104,
			0, 80, 169, 241, 77, 87, 33, 25, 136, 52,
			104, 112, 8, 176, 58, 66, 63, 198, 1, 169,
			10, 148, 205, 238, 10, 101, 200, 104, 104, 139,
			244, 21, 153, 136, 216, 20, 19, 32, 3, 102,
			87, 12, 119, 107, 124, 70, 139, 67, 220, 93,
			121, 246, 193, 90, 38, 102, 14, 80, 90, 143,
			191, 83, 255, 191, 191, 6, 144, 203, 144, 63,
			38, 101, 136, 178, 0, 219, 0, 97, 107, 2,
			96, 201, 169, 15, 106, 98, 252, 31, 36, 111,
			94, 144, 174, 84, 76, 158, 27, 131, 48, 101,
			106, 190, 30, 133, 133, 90, 111, 136, 144, 132,
			126, 106, 30, 82, 15, 17, 39, 190, 69, 134,
			0, 136, 98, 124, 154, 5, 92, 56, 136, 92,
			43, 26, 136, 80, 3, 40, 38, 12, 131, 64,
			125, 246, 169, 135, 165, 15, 140, 56, 130, 10,
			14, 27, 254, 126, 129, 59, 0, 15, 127, 107,
			183, 107, 252, 135, 55, 106, 188, 119, 135, 102,
			72, 80, 41, 71, 90, 12, 106, 115, 14, 21,
			114, 63, 71, 54, 54, 37, 36, 84, 17, 85,
			99, 169, 249, 136, 203, 169, 140, 129, 76, 3,
			30, 56, 36, 87, 139, 193, 195, 92, 136, 35,
			91, 142, 100, 68, 110, 55, 105, 112, 110, 55,
			130, 79, 110, 223, 34, 87, 164, 90, 77, 203,
			81, 134, 208, 205, 145, 162, 171, 39, 83, 71,
			87, 128, 110, 107, 107, 0, 46, 190, 190, 48,
			111, 136, 63, 4, 70, 131, 146, 102, 161, 180,
			139, 80, 142, 220, 159, 115, 249, 116, 95, 109,
			90, 182, 33, 40, 50, 45, 126, 194, 23, 6,
			169, 71, 20, 112, 10, 0, 140, 85, 0, 63,
			134, 249, 59, 135, 128, 58, 99, 122, 102, 176,
			85, 135, 3, 79, 13, 135, 100, 147, 131, 175,
			59, 41, 65, 60, 121, 129, 115, 53, 61, 46,
			11, 33, 124, 85, 162, 250, 195, 246, 80, 58,
			30, 124, 100, 104, 66, 250, 78, 27, 207, 0,
			75, 138, 67, 183, 0, 0, 195, 0, 0, 68,
			107, 107, 107, 89, 22, 3, 148, 88, 78, 111,
			111, 90, 171, 96, 96, 208, 120, 83, 46, 89,
			111, 242, 191, 3, 77, 183, 107, 128, 103, 132,
			78, 151, 151, 139, 10, 16, 85, 90, 3, 4,
			131, 90, 184, 184, 239, 87, 119, 119, 120, 100,
			71, 136, 144, 88, 37, 96, 251, 136, 196, 125,
			37, 249, 96, 70, 135, 252, 80, 20, 80, 233,
			129, 121, 118, 130, 73, 102, 142, 49, 5, 80,
			87, 158, 68, 127, 85, 39, 250, 163, 145, 102,
			112, 193, 114, 41, 63, 139, 105, 0, 2, 32,
			144, 158, 0, 132, 179, 80, 234, 0, 51, 106,
			39, 46, 39, 114, 131, 164, 226, 195, 115, 6,
			53, 112, 169, 139, 85, 9, 41, 95, 71, 177,
			128, 131, 252, 147, 247, 55, 112, 41, 111, 155
		};
	}
	internal static class PinyinCode3
	{
		public static byte[] PINYIN_CODE_PADDING = new byte[875]
		{
			176, 9, 83, 102, 151, 4, 40, 15, 197, 134,
			34, 208, 132, 7, 1, 50, 66, 128, 4, 45,
			104, 73, 121, 252, 179, 147, 135, 146, 136, 110,
			52, 222, 137, 42, 137, 128, 202, 46, 52, 188,
			148, 25, 143, 53, 9, 143, 186, 1, 104, 1,
			128, 3, 140, 76, 112, 150, 114, 97, 11, 206,
			76, 152, 80, 208, 19, 140, 225, 33, 1, 59,
			226, 34, 169, 11, 219, 193, 172, 131, 48, 70,
			244, 154, 216, 192, 106, 173, 222, 189, 32, 194,
			242, 107, 155, 33, 31, 12, 78, 113, 59, 136,
			234, 35, 20, 200, 27, 14, 55, 187, 162, 0,
			16, 67, 169, 209, 97, 184, 60, 75, 157, 12,
			233, 125, 130, 194, 230, 145, 11, 53, 36, 96,
			33, 8, 50, 235, 129, 12, 136, 52, 98, 194,
			226, 192, 56, 85, 192, 58, 20, 37, 11, 4,
			198, 46, 44, 211, 11, 64, 192, 209, 126, 4,
			131, 74, 72, 104, 130, 80, 5, 142, 213, 230,
			51, 196, 190, 230, 151, 235, 159, 222, 129, 40,
			159, 184, 79, 66, 168, 98, 36, 119, 24, 217,
			92, 28, 233, 89, 144, 234, 146, 168, 163, 100,
			21, 23, 118, 160, 98, 244, 75, 204, 96, 12,
			248, 34, 177, 237, 5, 138, 103, 41, 110, 154,
			26, 109, 17, 247, 66, 89, 226, 215, 166, 24,
			93, 182, 178, 147, 199, 7, 111, 69, 46, 36,
			40, 4, 1, 208, 62, 15, 66, 153, 162, 1,
			50, 0, 37, 212, 88, 180, 5, 50, 128, 166,
			103, 219, 36, 148, 11, 101, 185, 239, 204, 82,
			89, 69, 24, 56, 153, 197, 4, 253, 103, 227,
			35, 79, 128, 15, 71, 207, 232, 225, 14, 192,
			233, 64, 72, 4, 137, 42, 10, 194, 106, 165,
			12, 0, 23, 181, 177, 144, 84, 172, 16, 52,
			145, 68, 34, 2, 38, 48, 138, 220, 205, 136,
			1, 36, 81, 202, 181, 129, 37, 8, 48, 119,
			130, 231, 110, 86, 4, 96, 67, 213, 59, 134,
			64, 98, 128, 154, 112, 125, 19, 72, 236, 10,
			33, 0, 18, 1, 108, 236, 105, 50, 28, 208,
			99, 168, 15, 246, 83, 183, 19, 1, 203, 69,
			205, 15, 165, 50, 167, 122, 97, 79, 45, 96,
			102, 13, 164, 84, 163, 198, 162, 10, 154, 4,
			148, 146, 161, 84, 105, 222, 118, 193, 108, 178,
			16, 82, 161, 218, 154, 227, 38, 224, 25, 105,
			89, 99, 94, 202, 138, 138, 201, 22, 42, 111,
			144, 100, 16, 5, 220, 193, 112, 132, 136, 163,
			83, 160, 65, 92, 222, 71, 85, 66, 97, 226,
			97, 32, 53, 238, 110, 60, 108, 12, 216, 143,
			112, 23, 240, 215, 169, 48, 170, 68, 64, 196,
			145, 134, 40, 40, 3, 100, 2, 209, 164, 181,
			74, 64, 66, 214, 3, 106, 123, 162, 46, 111,
			23, 10, 186, 130, 16, 80, 40, 49, 8, 112,
			66, 156, 48, 137, 34, 162, 164, 128, 84, 42,
			33, 20, 1, 8, 21, 164, 140, 37, 67, 137,
			96, 33, 5, 44, 19, 135, 48, 149, 94, 203,
			210, 41, 11, 17, 203, 0, 162, 17, 74, 20,
			136, 8, 164, 200, 0, 128, 66, 144, 76, 128,
			39, 1, 1, 192, 151, 202, 61, 11, 33, 136,
			96, 78, 7, 25, 32, 219, 164, 2, 125, 226,
			56, 26, 3, 66, 41, 241, 108, 51, 193, 252,
			190, 137, 229, 150, 151, 7, 39, 154, 63, 34,
			74, 178, 48, 167, 36, 192, 241, 64, 39, 86,
			137, 29, 131, 20, 0, 0, 38, 33, 96, 41,
			151, 203, 161, 10, 232, 50, 236, 2, 42, 68,
			32, 25, 194, 83, 218, 156, 123, 236, 106, 23,
			3, 0, 57, 32, 20, 230, 8, 158, 252, 3,
			18, 153, 176, 62, 20, 40, 105, 27, 178, 176,
			50, 95, 2, 136, 117, 128, 177, 79, 62, 89,
			198, 174, 128, 167, 218, 64, 40, 147, 151, 53,
			181, 145, 202, 79, 213, 8, 33, 20, 89, 130,
			200, 41, 118, 63, 241, 89, 145, 237, 120, 7,
			145, 113, 228, 20, 109, 128, 111, 37, 243, 173,
			160, 179, 220, 186, 89, 225, 230, 156, 11, 112,
			56, 141, 216, 94, 33, 32, 152, 0, 28, 64,
			52, 168, 193, 226, 217, 7, 68, 6, 16, 2,
			131, 12, 192, 173, 64, 23, 105, 41, 137, 24,
			133, 136, 9, 42, 207, 68, 128, 190, 56, 12,
			212, 64, 8, 200, 176, 18, 186, 56, 74, 74,
			217, 203, 128, 53, 122, 153, 29, 21, 78, 80,
			96, 152, 1, 6, 209, 240, 96, 49, 1, 14,
			47, 73, 33, 174, 72, 8, 196, 208, 66, 167,
			96, 122, 244, 119, 12, 39, 13, 80, 181, 20,
			6, 41, 228, 140, 32, 16, 209, 130, 149, 128,
			207, 161, 78, 139, 108, 202, 187, 12, 185, 123,
			233, 67, 6, 23, 84, 226, 252, 20, 193, 7,
			24, 242, 228, 144, 17, 34, 65, 17, 0, 99,
			8, 192, 20, 2, 129, 37, 232, 160, 119, 104,
			73, 130, 58, 42, 132, 225, 147, 255, 240, 51,
			245, 40, 64, 29, 113, 80, 180, 69, 196, 27,
			66, 33, 49, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0
		};

		public static byte[] PINYIN_CODE = new byte[7000]
		{
			235, 249, 249, 206, 48, 85, 86, 114, 132, 131,
			129, 21, 25, 79, 196, 114, 55, 131, 201, 0,
			95, 177, 85, 102, 164, 15, 82, 92, 55, 39,
			60, 183, 17, 56, 87, 11, 102, 107, 14, 145,
			108, 0, 94, 27, 0, 163, 0, 129, 169, 24,
			164, 111, 0, 107, 203, 66, 94, 84, 69, 136,
			240, 3, 171, 49, 85, 246, 3, 135, 46, 134,
			80, 73, 26, 111, 104, 129, 173, 14, 180, 95,
			21, 127, 183, 253, 189, 100, 168, 129, 16, 108,
			112, 63, 52, 180, 35, 33, 63, 199, 98, 189,
			20, 63, 55, 129, 28, 96, 111, 121, 5, 196,
			179, 51, 134, 23, 247, 132, 196, 49, 219, 126,
			142, 106, 131, 217, 41, 106, 158, 36, 121, 30,
			152, 252, 187, 25, 120, 253, 71, 171, 175, 152,
			2, 14, 169, 80, 129, 252, 38, 83, 195, 232,
			32, 65, 98, 133, 19, 19, 167, 111, 254, 41,
			122, 131, 188, 114, 10, 110, 4, 180, 10, 126,
			77, 64, 85, 141, 149, 82, 17, 86, 158, 47,
			19, 99, 95, 90, 141, 59, 84, 69, 49, 89,
			85, 109, 81, 34, 250, 131, 114, 55, 176, 111,
			86, 82, 129, 119, 49, 62, 167, 96, 114, 111,
			85, 114, 20, 114, 2, 80, 126, 80, 129, 48,
			88, 181, 199, 104, 168, 132, 24, 37, 253, 171,
			148, 112, 56, 64, 60, 97, 14, 126, 55, 171,
			83, 68, 89, 102, 90, 41, 131, 147, 119, 22,
			91, 98, 102, 7, 51, 41, 98, 74, 245, 80,
			214, 40, 188, 17, 243, 58, 250, 119, 36, 131,
			80, 216, 107, 95, 49, 89, 250, 82, 131, 95,
			158, 134, 15, 63, 196, 163, 135, 118, 198, 2,
			255, 87, 0, 232, 87, 52, 184, 104, 95, 90,
			169, 104, 161, 167, 133, 63, 133, 241, 63, 102,
			203, 124, 16, 83, 51, 59, 73, 2, 254, 80,
			177, 126, 41, 95, 114, 0, 169, 136, 136, 2,
			175, 119, 96, 36, 162, 128, 75, 84, 19, 19,
			250, 118, 180, 52, 73, 190, 114, 245, 111, 98,
			129, 137, 96, 203, 0, 52, 137, 0, 220, 20,
			9, 104, 87, 111, 139, 171, 171, 106, 253, 107,
			178, 70, 80, 113, 176, 4, 102, 83, 196, 163,
			158, 163, 129, 59, 0, 167, 167, 69, 87, 133,
			80, 158, 126, 123, 169, 129, 196, 167, 123, 183,
			129, 210, 180, 131, 0, 0, 167, 5, 89, 104,
			181, 194, 17, 121, 121, 180, 230, 184, 133, 89,
			252, 41, 121, 95, 55, 90, 95, 95, 180, 121,
			111, 114, 133, 139, 109, 10, 100, 126, 126, 158,
			8, 85, 41, 39, 3, 66, 129, 3, 68, 39,
			0, 63, 129, 35, 111, 93, 144, 119, 126, 195,
			96, 54, 86, 31, 39, 104, 187, 88, 84, 77,
			233, 38, 252, 81, 81, 19, 9, 241, 113, 113,
			142, 250, 8, 106, 250, 24, 112, 141, 126, 252,
			250, 134, 99, 114, 205, 79, 86, 86, 113, 100,
			119, 90, 8, 134, 90, 38, 71, 10, 87, 216,
			62, 3, 110, 124, 246, 38, 110, 115, 112, 139,
			169, 90, 8, 124, 101, 241, 20, 87, 136, 66,
			17, 19, 102, 8, 4, 35, 67, 176, 102, 58,
			102, 107, 169, 37, 4, 204, 96, 48, 126, 126,
			190, 90, 101, 76, 174, 136, 104, 87, 160, 133,
			169, 104, 246, 129, 110, 35, 104, 79, 203, 2,
			255, 107, 100, 133, 189, 0, 129, 130, 210, 49,
			250, 92, 174, 3, 34, 109, 130, 73, 35, 7,
			77, 112, 41, 96, 87, 37, 131, 90, 87, 129,
			84, 90, 169, 164, 14, 41, 112, 110, 134, 58,
			100, 68, 65, 73, 126, 83, 133, 50, 85, 139,
			196, 250, 250, 111, 142, 161, 195, 253, 49, 85,
			182, 169, 67, 66, 61, 159, 93, 112, 111, 9,
			85, 241, 80, 75, 104, 112, 52, 5, 252, 19,
			216, 1, 80, 172, 109, 78, 70, 77, 8, 143,
			79, 24, 101, 107, 109, 32, 0, 161, 148, 129,
			90, 68, 188, 95, 197, 111, 134, 39, 96, 125,
			100, 15, 16, 80, 90, 112, 193, 80, 90, 18,
			90, 110, 110, 191, 86, 107, 39, 39, 60, 136,
			145, 64, 90, 112, 158, 195, 161, 72, 121, 3,
			67, 169, 103, 114, 139, 208, 179, 46, 15, 107,
			132, 74, 164, 236, 49, 85, 85, 85, 112, 82,
			171, 51, 8, 15, 15, 129, 84, 94, 112, 0,
			104, 14, 122, 60, 104, 72, 207, 115, 121, 85,
			187, 201, 104, 81, 107, 63, 111, 25, 0, 0,
			189, 0, 33, 39, 26, 38, 63, 5, 180, 80,
			133, 60, 36, 243, 4, 241, 111, 131, 183, 179,
			0, 134, 106, 132, 43, 81, 133, 78, 129, 129,
			187, 187, 109, 173, 191, 85, 49, 169, 189, 89,
			0, 127, 190, 88, 203, 144, 49, 3, 62, 133,
			240, 240, 133, 4, 17, 173, 235, 107, 85, 129,
			139, 125, 85, 165, 141, 141, 126, 106, 32, 133,
			32, 10, 89, 84, 39, 98, 49, 0, 37, 59,
			169, 90, 32, 104, 136, 56, 32, 250, 144, 88,
			35, 183, 0, 107, 31, 169, 120, 96, 171, 136,
			120, 90, 190, 90, 250, 15, 131, 195, 114, 17,
			128, 143, 134, 18, 115, 199, 83, 167, 134, 161,
			196, 169, 46, 169, 3, 220, 180, 72, 89, 136,
			178, 169, 178, 87, 103, 241, 9, 102, 140, 107,
			0, 85, 24, 4, 5, 72, 24, 189, 4, 134,
			136, 124, 97, 125, 229, 238, 229, 91, 134, 203,
			80, 199, 199, 39, 92, 100, 145, 112, 0, 176,
			96, 41, 87, 69, 178, 134, 87, 99, 121, 80,
			60, 39, 80, 60, 142, 118, 4, 104, 104, 21,
			93, 111, 16, 30, 104, 32, 36, 90, 108, 86,
			43, 134, 206, 134, 58, 14, 134, 134, 90, 250,
			90, 8, 133, 12, 0, 135, 142, 112, 193, 31,
			5, 219, 126, 8, 130, 75, 176, 57, 10, 237,
			102, 151, 14, 34, 59, 139, 115, 97, 94, 131,
			104, 233, 20, 63, 76, 90, 108, 133, 133, 8,
			235, 104, 191, 0, 206, 152, 96, 32, 4, 11,
			111, 85, 0, 20, 0, 90, 104, 38, 153, 12,
			132, 130, 54, 203, 134, 80, 96, 17, 136, 107,
			106, 23, 174, 0, 0, 140, 59, 0, 159, 149,
			219, 41, 130, 159, 37, 169, 140, 37, 248, 96,
			104, 111, 36, 177, 3, 7, 129, 104, 21, 140,
			46, 30, 7, 169, 171, 171, 153, 131, 89, 59,
			14, 108, 61, 112, 176, 38, 33, 40, 76, 16,
			172, 33, 238, 238, 85, 112, 183, 109, 100, 72,
			64, 133, 139, 250, 129, 133, 103, 149, 0, 64,
			39, 90, 39, 90, 15, 67, 159, 73, 94, 94,
			115, 112, 10, 10, 90, 111, 72, 100, 126, 11,
			41, 184, 0, 0, 114, 57, 101, 56, 123, 15,
			112, 17, 207, 137, 56, 8, 74, 38, 25, 219,
			107, 134, 252, 123, 153, 171, 163, 169, 129, 39,
			184, 104, 67, 90, 87, 80, 16, 26, 129, 253,
			28, 10, 88, 0, 249, 131, 139, 131, 149, 129,
			58, 115, 83, 20, 88, 91, 17, 10, 189, 163,
			5, 76, 126, 26, 54, 224, 32, 171, 14, 135,
			59, 41, 59, 14, 163, 249, 17, 133, 0, 41,
			76, 39, 7, 90, 20, 36, 162, 178, 85, 87,
			163, 129, 57, 0, 117, 39, 131, 235, 104, 0,
			99, 85, 85, 102, 87, 59, 0, 0, 90, 6,
			115, 129, 129, 131, 105, 15, 100, 107, 141, 242,
			191, 196, 196, 199, 39, 49, 126, 183, 141, 203,
			66, 171, 102, 133, 142, 85, 32, 80, 85, 65,
			111, 163, 77, 72, 0, 236, 129, 201, 246, 101,
			4, 126, 135, 105, 62, 131, 183, 4, 131, 80,
			141, 4, 183, 163, 37, 63, 105, 131, 105, 100,
			107, 196, 39, 32, 163, 141, 129, 85, 63, 65,
			111, 101, 135, 4, 133, 138, 135, 51, 141, 133,
			34, 129, 102, 58, 149, 63, 33, 122, 5, 96,
			133, 134, 107, 100, 41, 134, 124, 3, 92, 52,
			216, 129, 180, 133, 136, 14, 92, 121, 33, 100,
			133, 97, 41, 85, 104, 169, 141, 85, 100, 85,
			100, 100, 68, 90, 3, 3, 133, 119, 129, 83,
			98, 66, 119, 30, 61, 95, 134, 104, 12, 98,
			106, 32, 250, 75, 129, 98, 106, 77, 86, 99,
			102, 50, 37, 106, 91, 141, 89, 211, 36, 110,
			133, 93, 84, 91, 34, 35, 87, 22, 142, 95,
			104, 104, 52, 38, 115, 37, 115, 95, 131, 136,
			132, 101, 144, 144, 126, 102, 90, 131, 67, 176,
			63, 101, 169, 210, 235, 135, 93, 39, 139, 5,
			124, 75, 104, 4, 128, 246, 14, 93, 41, 6,
			56, 147, 61, 136, 48, 129, 109, 95, 98, 104,
			125, 115, 39, 30, 133, 39, 117, 30, 101, 107,
			5, 126, 134, 122, 92, 88, 126, 37, 40, 69,
			196, 126, 201, 77, 126, 100, 93, 103, 80, 13,
			66, 38, 167, 136, 157, 154, 84, 111, 63, 129,
			133, 12, 52, 164, 77, 157, 81, 39, 68, 58,
			11, 32, 110, 118, 254, 0, 42, 3, 111, 89,
			37, 134, 87, 84, 84, 95, 50, 249, 126, 136,
			48, 131, 48, 72, 0, 33, 46, 134, 148, 4,
			49, 89, 54, 79, 96, 85, 38, 57, 104, 206,
			106, 66, 241, 47, 32, 36, 142, 129, 250, 59,
			45, 80, 139, 1, 131, 132, 120, 146, 252, 143,
			172, 131, 136, 114, 182, 37, 16, 123, 242, 111,
			67, 95, 242, 39, 96, 39, 127, 122, 77, 134,
			63, 90, 90, 249, 68, 131, 250, 111, 144, 43,
			85, 126, 106, 3, 87, 208, 36, 87, 136, 101,
			100, 118, 96, 96, 228, 250, 204, 103, 80, 0,
			63, 146, 32, 131, 20, 0, 125, 128, 96, 107,
			196, 89, 196, 85, 253, 36, 230, 49, 52, 9,
			38, 252, 39, 132, 112, 90, 97, 61, 102, 102,
			121, 111, 16, 49, 1, 169, 203, 203, 33, 129,
			202, 131, 120, 124, 171, 179, 24, 232, 105, 85,
			143, 5, 5, 135, 129, 104, 121, 132, 189, 34,
			112, 122, 32, 95, 123, 27, 85, 35, 74, 132,
			210, 163, 77, 107, 141, 129, 150, 133, 20, 126,
			139, 84, 131, 124, 39, 254, 59, 122, 249, 38,
			96, 119, 126, 59, 54, 252, 129, 133, 136, 171,
			225, 104, 2, 126, 241, 126, 122, 104, 104, 32,
			9, 225, 252, 141, 57, 121, 135, 114, 216, 107,
			131, 111, 131, 126, 72, 129, 96, 117, 167, 37,
			80, 32, 169, 104, 15, 129, 100, 77, 40, 80,
			40, 102, 32, 9, 106, 163, 36, 128, 129, 124,
			117, 104, 59, 126, 100, 72, 100, 129, 68, 90,
			12, 129, 134, 119, 61, 9, 32, 250, 75, 98,
			104, 98, 129, 12, 132, 126, 232, 139, 99, 211,
			95, 77, 182, 93, 50, 87, 35, 84, 141, 132,
			102, 115, 246, 147, 39, 93, 124, 52, 131, 63,
			135, 48, 4, 128, 14, 104, 104, 157, 167, 39,
			103, 39, 134, 126, 37, 136, 37, 122, 58, 101,
			5, 107, 98, 104, 132, 92, 88, 30, 127, 95,
			135, 134, 84, 111, 254, 84, 95, 110, 126, 157,
			48, 50, 78, 1, 136, 146, 228, 72, 143, 85,
			148, 80, 111, 36, 37, 66, 32, 172, 142, 54,
			59, 37, 104, 204, 36, 67, 125, 131, 90, 97,
			103, 80, 77, 111, 96, 32, 144, 3, 100, 63,
			196, 242, 95, 203, 59, 52, 90, 102, 9, 39,
			252, 196, 135, 189, 129, 131, 202, 59, 131, 254,
			163, 249, 141, 100, 252, 126, 36, 102, 252, 119,
			99, 141, 119, 112, 119, 250, 85, 128, 173, 112,
			72, 178, 71, 132, 250, 38, 87, 62, 78, 14,
			41, 87, 87, 133, 133, 100, 100, 39, 41, 126,
			74, 104, 74, 104, 131, 6, 120, 77, 51, 88,
			124, 131, 149, 92, 4, 90, 85, 18, 114, 111,
			136, 130, 86, 85, 121, 81, 124, 18, 63, 145,
			86, 104, 133, 10, 31, 112, 241, 206, 241, 101,
			76, 110, 66, 203, 49, 94, 124, 159, 115, 115,
			203, 3, 191, 169, 216, 14, 111, 130, 72, 191,
			241, 85, 77, 139, 203, 41, 59, 124, 4, 11,
			131, 112, 90, 23, 100, 62, 104, 113, 78, 245,
			128, 83, 59, 105, 120, 133, 80, 136, 39, 14,
			144, 80, 107, 242, 15, 188, 57, 38, 157, 85,
			67, 104, 38, 191, 115, 14, 180, 175, 126, 92,
			242, 144, 130, 95, 121, 133, 92, 118, 131, 107,
			98, 131, 35, 18, 18, 3, 35, 43, 118, 135,
			162, 117, 49, 36, 33, 65, 238, 99, 87, 188,
			131, 54, 90, 58, 49, 49, 133, 129, 127, 72,
			135, 93, 47, 114, 10, 116, 162, 87, 25, 129,
			38, 2, 139, 90, 101, 23, 120, 173, 80, 7,
			36, 139, 133, 141, 16, 114, 123, 59, 117, 100,
			0, 32, 78, 107, 135, 93, 87, 118, 14, 72,
			41, 100, 0, 96, 178, 93, 118, 11, 131, 90,
			112, 100, 23, 120, 87, 7, 127, 128, 133, 83,
			59, 245, 15, 101, 136, 105, 80, 131, 14, 39,
			67, 107, 157, 57, 191, 85, 115, 104, 121, 133,
			130, 126, 144, 175, 180, 118, 144, 92, 135, 3,
			131, 162, 35, 90, 72, 129, 41, 33, 48, 14,
			135, 99, 238, 58, 162, 87, 141, 90, 139, 23,
			120, 100, 117, 114, 123, 32, 107, 93, 38, 85,
			35, 208, 93, 85, 37, 115, 37, 129, 86, 60,
			146, 146, 169, 138, 90, 128, 93, 250, 32, 2,
			0, 87, 48, 141, 0, 38, 48, 36, 36, 67,
			139, 34, 63, 27, 126, 136, 113, 4, 134, 38,
			41, 103, 97, 144, 66, 76, 174, 93, 56, 51,
			85, 128, 52, 106, 139, 131, 6, 60, 47, 53,
			180, 4, 59, 3, 144, 64, 4, 38, 125, 254,
			254, 102, 119, 113, 0, 117, 117, 147, 233, 10,
			153, 115, 75, 141, 90, 36, 131, 84, 133, 57,
			113, 233, 250, 113, 253, 75, 58, 104, 217, 176,
			193, 6, 67, 153, 75, 130, 48, 237, 251, 136,
			139, 67, 133, 90, 235, 139, 32, 20, 216, 139,
			169, 98, 104, 129, 57, 87, 133, 76, 41, 5,
			154, 138, 107, 2, 158, 88, 38, 180, 13, 133,
			130, 66, 23, 131, 56, 254, 14, 87, 76, 129,
			139, 129, 41, 71, 41, 92, 220, 89, 20, 97,
			7, 204, 41, 172, 109, 133, 40, 89, 0, 57,
			131, 250, 83, 80, 47, 134, 129, 220, 139, 139,
			182, 180, 168, 123, 139, 38, 78, 5, 64, 20,
			147, 255, 250, 51, 145, 23, 145, 235, 133, 132,
			65, 133, 111, 76, 75, 46, 109, 134, 63, 124,
			36, 42, 131, 103, 60, 139, 90, 147, 67, 242,
			16, 228, 64, 30, 73, 131, 60, 55, 85, 57,
			253, 126, 65, 64, 129, 220, 235, 177, 126, 14,
			39, 180, 173, 51, 60, 57, 52, 85, 158, 129,
			133, 253, 63, 189, 145, 171, 13, 119, 217, 17,
			73, 139, 62, 29, 87, 83, 41, 134, 75, 20,
			51, 147, 141, 141, 175, 57, 254, 254, 249, 173,
			75, 52, 157, 119, 57, 14, 14, 136, 139, 41,
			254, 75, 40, 129, 84, 113, 217, 175, 174, 133,
			169, 133, 32, 41, 73, 80, 178, 175, 87, 80,
			148, 163, 90, 9, 90, 220, 57, 4, 134, 52,
			148, 85, 158, 141, 175, 37, 100, 58, 0, 4,
			64, 76, 76, 100, 164, 0, 183, 2, 129, 139,
			60, 0, 0, 100, 0, 146, 4, 179, 165, 76,
			133, 0, 64, 60, 0, 111, 35, 99, 107, 142,
			80, 113, 91, 63, 96, 83, 12, 32, 253, 41,
			74, 36, 57, 77, 206, 250, 191, 18, 12, 252,
			139, 119, 121, 4, 125, 63, 176, 57, 5, 131,
			83, 157, 4, 240, 11, 102, 102, 237, 136, 15,
			77, 6, 135, 133, 102, 148, 104, 1, 39, 246,
			80, 2, 139, 133, 106, 180, 144, 5, 135, 116,
			133, 139, 172, 111, 34, 110, 124, 114, 129, 78,
			90, 1, 135, 216, 176, 129, 126, 172, 144, 126,
			79, 47, 109, 145, 104, 240, 252, 108, 217, 246,
			105, 11, 182, 234, 172, 18, 16, 129, 101, 87,
			43, 50, 46, 96, 110, 119, 41, 90, 144, 90,
			81, 12, 126, 111, 81, 61, 102, 131, 86, 112,
			180, 138, 34, 139, 80, 127, 0, 35, 133, 126,
			249, 165, 86, 83, 175, 96, 27, 145, 124, 104,
			129, 74, 80, 111, 87, 119, 167, 238, 169, 169,
			180, 175, 35, 99, 107, 96, 57, 12, 139, 77,
			182, 18, 119, 102, 148, 180, 135, 133, 104, 121,
			131, 169, 102, 1, 39, 116, 133, 133, 135, 5,
			180, 133, 129, 90, 172, 217, 11, 126, 108, 79,
			172, 47, 144, 50, 90, 129, 81, 41, 238, 112,
			86, 126, 180, 129, 175, 91, 102, 48, 48, 241,
			149, 15, 161, 161, 48, 97, 8, 15, 15, 15,
			0, 15, 8, 48, 15, 15, 36, 17, 224, 224,
			131, 47, 47, 0, 13, 15, 15, 0, 0, 173,
			56, 32, 93, 252, 111, 111, 250, 98, 104, 109,
			188, 250, 115, 79, 0, 142, 107, 64, 114, 135,
			113, 99, 83, 84, 57, 77, 111, 130, 0, 135,
			112, 80, 171, 38, 35, 216, 66, 133, 104, 137,
			130, 36, 57, 80, 63, 247, 79, 67, 120, 61,
			41, 75, 0, 136, 126, 69, 110, 196, 13, 129,
			207, 104, 134, 141, 174, 98, 73, 50, 39, 61,
			236, 120, 216, 75, 137, 96, 98, 21, 110, 89,
			3, 70, 136, 3, 63, 63, 71, 136, 64, 71,
			104, 129, 69, 106, 84, 39, 37, 52, 119, 7,
			87, 171, 56, 126, 169, 0, 149, 12, 55, 141,
			13, 124, 57, 180, 110, 135, 135, 111, 47, 158,
			80, 64, 104, 56, 112, 183, 14, 228, 111, 59,
			54, 75, 54, 100, 43, 38, 64, 111, 39, 131,
			110, 114, 77, 15, 109, 77, 86, 125, 3, 60,
			56, 80, 0, 104, 101, 102, 41, 177, 98, 57,
			63, 38, 112, 52, 57, 252, 0, 102, 105, 127,
			5, 39, 27, 52, 52, 119, 129, 75, 133, 179,
			38, 55, 175, 150, 10, 252, 96, 111, 104, 84,
			173, 139, 39, 14, 102, 188, 90, 54, 124, 126,
			62, 80, 198, 15, 15, 161, 169, 112, 110, 183,
			169, 104, 68, 62, 250, 109, 32, 112, 111, 190,
			17, 2, 0, 157, 90, 146, 18, 84, 92, 212,
			0, 37, 9, 112, 54, 128, 90, 9, 84, 139,
			110, 112, 58, 3, 14, 241, 19, 34, 11, 76,

plugins\ItemSpawnerEnhanced\ItemSpawnerEnhanced.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using ItemSpawnerEnhanced.Api;
using ItemSpawnerEnhanced.Core;
using ItemSpawnerEnhanced.Localization;
using ItemSpawnerEnhanced.UI;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Photon.Pun;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.UI;
using Zorro.Core;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ItemSpawnerEnhanced")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0+868a403036ec2b476d1ba1a4dba1c5a0bb24d6c5")]
[assembly: AssemblyProduct("ItemSpawnerEnhanced")]
[assembly: AssemblyTitle("ItemSpawnerEnhanced")]
[assembly: AssemblyVersion("1.3.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ItemSpawnerEnhanced
{
	internal sealed class FavoriteStore
	{
		private readonly ConfigEntry<string> _entry;

		private readonly ManualLogSource _logger;

		private HashSet<string> _itemNames;

		public FavoriteStore(ConfigEntry<string> entry, ManualLogSource logger)
		{
			_entry = entry;
			_logger = logger;
			_itemNames = Deserialize(entry.Value);
		}

		public bool IsFavorite(string itemName)
		{
			return _itemNames.Contains(itemName);
		}

		public bool TryToggle(string itemName, out bool isFavorite)
		{
			HashSet<string> hashSet = new HashSet<string>(_itemNames, StringComparer.Ordinal);
			isFavorite = !hashSet.Remove(itemName);
			if (isFavorite)
			{
				hashSet.Add(itemName);
			}
			string value = FavoriteItemCodec.Serialize(hashSet);
			string value2 = _entry.Value;
			try
			{
				_entry.Value = value;
			}
			catch (Exception arg)
			{
				try
				{
					_entry.Value = value2;
				}
				catch
				{
				}
				isFavorite = _itemNames.Contains(itemName);
				_logger.LogError((object)$"Failed to save favorite items: {arg}");
				return false;
			}
			_itemNames = hashSet;
			return true;
		}

		private HashSet<string> Deserialize(string serialized)
		{
			try
			{
				return FavoriteItemCodec.Deserialize(serialized);
			}
			catch (Exception ex)
			{
				_logger.LogWarning((object)("Favorite item configuration is invalid and will be ignored: " + ex.Message));
				return new HashSet<string>(StringComparer.Ordinal);
			}
		}
	}
	internal sealed class GameItemCatalog
	{
		private readonly ManualLogSource _logger;

		private readonly Func<bool> _showAllItems;

		private readonly Func<string, bool> _isFavorite;

		private SearchIndex<GameItemRecord> _index = new SearchIndex<GameItemRecord>(Array.Empty<(GameItemRecord, IEnumerable<SearchAliasValue>)>());

		private Item[] _sourceItems = Array.Empty<Item>();

		private bool _sourceShowAllItems;

		public IReadOnlyList<GameItemRecord> Items { get; private set; } = Array.Empty<GameItemRecord>();

		public GameItemCatalog(ManualLogSource logger, Func<bool> showAllItems, Func<string, bool> isFavorite)
		{
			_logger = logger;
			_showAllItems = showAllItems;
			_isFavorite = isFavorite;
		}

		public bool IsCurrent()
		{
			if (((DatabaseAsset<ItemDatabase, Item>)(object)SingletonAsset<ItemDatabase>.Instance).Objects.Where((Item item) => (Object)(object)item != (Object)null).ToArray().SequenceEqual(_sourceItems))
			{
				return _showAllItems() == _sourceShowAllItems;
			}
			return false;
		}

		public void RebuildItems()
		{
			IEnumerator enumerator = RebuildItemsIncrementally(double.MaxValue);
			while (enumerator.MoveNext())
			{
			}
		}

		public IEnumerator RebuildItemsIncrementally(double timeBudgetMilliseconds)
		{
			if (timeBudgetMilliseconds <= 0.0)
			{
				throw new ArgumentOutOfRangeException("timeBudgetMilliseconds");
			}
			Item[] sourceItems = ((DatabaseAsset<ItemDatabase, Item>)(object)SingletonAsset<ItemDatabase>.Instance).Objects.Where((Item item) => (Object)(object)item != (Object)null).ToArray();
			bool showAllItems = _showAllItems();
			List<GameItemRecord> items = new List<GameItemRecord>(sourceItems.Length);
			long timestamp = Stopwatch.GetTimestamp();
			for (int index = 0; index < sourceItems.Length; index++)
			{
				Item val = sourceItems[index];
				if (VanillaItemVisibility.IsVisible(((Object)val).name, showAllItems, _isFavorite(((Object)val).name)))
				{
					string fallback = val.UIData?.itemName ?? ((Object)val).name;
					items.Add(new GameItemRecord(val, SafeLocalizedName(val, fallback), ItemCategoryResolver.Resolve(val)));
				}
				if (index + 1 < sourceItems.Length && ElapsedMilliseconds(timestamp) >= timeBudgetMilliseconds)
				{
					yield return null;
					timestamp = Stopwatch.GetTimestamp();
				}
			}
			Items = items.ToArray();
			_sourceItems = sourceItems;
			_sourceShowAllItems = showAllItems;
			_index = new SearchIndex<GameItemRecord>(Array.Empty<(GameItemRecord, IEnumerable<SearchAliasValue>)>());
		}

		public IEnumerator RebuildSearchIndexIncrementally(double timeBudgetMilliseconds)
		{
			if (timeBudgetMilliseconds <= 0.0)
			{
				throw new ArgumentOutOfRangeException("timeBudgetMilliseconds");
			}
			string languageCode = GameLanguage.CurrentCode;
			IReadOnlyList<ISearchAliasProvider> readOnlyList = SearchAliasRegistry.Snapshot();
			List<ISearchAliasProvider> activeProviders = new List<ISearchAliasProvider>(readOnlyList.Count);
			foreach (ISearchAliasProvider item2 in readOnlyList)
			{
				try
				{
					if (item2.SupportsLanguage(languageCode))
					{
						activeProviders.Add(item2);
					}
				}
				catch (Exception arg)
				{
					_logger.LogError((object)$"Search alias provider '{item2.Id}' failed while checking language '{languageCode}': {arg}");
				}
			}
			SearchIndex<GameItemRecord>.Builder indexBuilder = new SearchIndex<GameItemRecord>.Builder();
			long timestamp = Stopwatch.GetTimestamp();
			for (int itemIndex = 0; itemIndex < Items.Count; itemIndex++)
			{
				GameItemRecord gameItemRecord = Items[itemIndex];
				Item item = gameItemRecord.Item;
				string text = item.UIData?.itemName ?? ((Object)item).name;
				string text2 = SafeEnglishName(text);
				SearchAliasContext context = new SearchAliasContext(((Object)item).name, text, gameItemRecord.DisplayName, text2, languageCode);
				List<SearchAliasValue> list = new List<SearchAliasValue>
				{
					new SearchAliasValue(gameItemRecord.DisplayName, SearchAliasPriority.Display),
					new SearchAliasValue(text2, SearchAliasPriority.English),
					new SearchAliasValue(((Object)item).name, SearchAliasPriority.Internal),
					new SearchAliasValue(text, SearchAliasPriority.Internal)
				};
				foreach (ISearchAliasProvider item3 in activeProviders)
				{
					try
					{
						list.AddRange(from alias in item3.GetAliases(context)
							where !string.IsNullOrWhiteSpace(alias)
							select new SearchAliasValue(alias, SearchAliasPriority.Provider));
					}
					catch (Exception arg2)
					{
						_logger.LogError((object)$"Search alias provider '{item3.Id}' failed for '{((Object)item).name}': {arg2}");
					}
				}
				indexBuilder.Add(gameItemRecord, list);
				if (itemIndex + 1 < Items.Count && ElapsedMilliseconds(timestamp) >= timeBudgetMilliseconds)
				{
					yield return null;
					timestamp = Stopwatch.GetTimestamp();
				}
			}
			_index = indexBuilder.Build();
		}

		public IReadOnlyList<GameItemRecord> Search(string query)
		{
			return _index.Search(query);
		}

		private static string SafeLocalizedName(Item item, string fallback)
		{
			try
			{
				string name = item.GetName();
				return IsUsable(name) ? name : fallback;
			}
			catch
			{
				return fallback;
			}
		}

		private static string SafeEnglishName(string rawName)
		{
			try
			{
				string text = LocalizedText.GetText(LocalizedText.GetNameIndex(rawName), (Language)0);
				return IsUsable(text) ? text : rawName;
			}
			catch
			{
				return rawName;
			}
		}

		private static bool IsUsable(string? value)
		{
			if (!string.IsNullOrWhiteSpace(value))
			{
				return !value.StartsWith("LOC:", StringComparison.OrdinalIgnoreCase);
			}
			return false;
		}

		private static double ElapsedMilliseconds(long started)
		{
			return (double)(Stopwatch.GetTimestamp() - started) * 1000.0 / (double)Stopwatch.Frequency;
		}
	}
	internal sealed class GameItemRecord
	{
		public Item Item { get; }

		public string DisplayName { get; }

		public ItemFilterTag Tags { get; }

		public GameItemRecord(Item item, string displayName, ItemFilterTag tags)
		{
			Item = item;
			DisplayName = displayName;
			Tags = tags;
		}
	}
	internal sealed class ItemBrowserSession
	{
		public ItemFilterTag SelectedTags { get; set; }
	}
	internal static class ItemCategoryResolver
	{
		public static ItemFilterTag Resolve(Item item)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			ItemFilterTag itemFilterTag = VanillaItemCategories.Resolve(((Object)item).name);
			if (((Enum)item.itemTags).HasFlag((Enum)(object)(ItemTags)1))
			{
				itemFilterTag |= ItemFilterTag.Mystical;
			}
			bool flag = ((Component)item).GetComponentsInChildren<Action_Consume>(true).Length != 0;
			bool flag2 = ((Component)item).GetComponentsInChildren<Action_ModifyStatus>(true).Any((Action_ModifyStatus action) => (int)action.statusType == 1);
			bool flag3 = ((Component)item).GetComponentsInChildren<Action_RestoreHunger>(true).Length != 0;
			bool flag4 = ((Enum)item.itemTags).HasFlag((Enum)(object)(ItemTags)2) || ((Enum)item.itemTags).HasFlag((Enum)(object)(ItemTags)4) || ((Enum)item.itemTags).HasFlag((Enum)(object)(ItemTags)8);
			itemFilterTag = ItemCategoryPolicy.ApplyConsumptionTags(itemFilterTag, flag, flag4 || flag3 || (flag && flag2));
			itemFilterTag = ItemCategoryPolicy.NormalizeConsumableTag(itemFilterTag);
			itemFilterTag = ItemCategoryPolicy.NormalizeEquipmentTag(itemFilterTag);
			if (itemFilterTag == ItemFilterTag.None)
			{
				itemFilterTag = ItemFilterTag.Other;
			}
			return itemFilterTag;
		}
	}
	internal sealed class ItemSpawnerController : IDisposable
	{
		private readonly ManualLogSource _logger;

		private readonly ModConfig _settings;

		private readonly FavoriteStore _favorites;

		private readonly ItemSpawnerInput _input;

		private readonly ItemBrowserSession _browserSession = new ItemBrowserSession();

		private ItemSpawnerWindow? _window;

		public ItemSpawnerController(ModConfig settings, ManualLogSource logger)
		{
			_logger = logger;
			_settings = settings;
			_favorites = new FavoriteStore(settings.FavoriteItemNamesEntry, logger);
			_input = new ItemSpawnerInput(settings, logger);
		}

		public void Attach()
		{
			if ((Object)(object)_window != (Object)null)
			{
				return;
			}
			try
			{
				_window = ItemSpawnerWindow.Create(_logger, _settings, _favorites, _browserSession);
			}
			catch (Exception arg)
			{
				_logger.LogError((object)$"Failed to create item spawner UI: {arg}");
			}
		}

		public void Tick()
		{
			ItemSpawnerInputSnapshot input = _input.ReadSnapshot();
			if ((Object)(object)_window == (Object)null)
			{
				return;
			}
			if (input.ControllerToggle)
			{
				if (_window.IsOpen || CanOpenWithController())
				{
					_window.ToggleWindow(WindowInputSource.Controller);
				}
			}
			else if (input.KeyboardToggle)
			{
				_window.ToggleWindow(WindowInputSource.Keyboard);
			}
			else if (_window.IsOpen)
			{
				_window.HandleControllerInput(input);
			}
		}

		public void Dispose()
		{
			if ((Object)(object)_window != (Object)null)
			{
				_window.Shutdown();
				Object.Destroy((Object)(object)((Component)_window).gameObject);
			}
			_window = null;
			_input.Dispose();
		}

		private static bool CanOpenWithController()
		{
			GUIManager instance = GUIManager.instance;
			if (Time.timeScale > 0f && (Object)(object)instance != (Object)null && !instance.windowBlockingInput)
			{
				return !instance.wheelActive;
			}
			return false;
		}
	}
	internal readonly struct ItemSpawnerInputSnapshot
	{
		public bool KeyboardToggle { get; }

		public bool ControllerToggle { get; }

		public Vector2 Navigation { get; }

		public bool ConfirmPressed { get; }

		public bool ConfirmHeld { get; }

		public bool ConfirmReleased { get; }

		public bool CancelPressed { get; }

		public bool FavoritePressed { get; }

		public bool PreviousTargetPressed { get; }

		public bool NextTargetPressed { get; }

		public bool MouseActivity { get; }

		public bool ControllerActivity
		{
			get
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				if (!ControllerToggle)
				{
					Vector2 navigation = Navigation;
					if (!(((Vector2)(ref navigation)).sqrMagnitude >= 0.25f) && !ConfirmPressed && !CancelPressed && !FavoritePressed && !PreviousTargetPressed)
					{
						return NextTargetPressed;
					}
				}
				return true;
			}
		}

		public ItemSpawnerInputSnapshot(bool keyboardToggle, bool controllerToggle, Vector2 navigation, bool confirmPressed, bool confirmHeld, bool confirmReleased, bool cancelPressed, bool favoritePressed, bool previousTargetPressed, bool nextTargetPressed, bool mouseActivity)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			KeyboardToggle = keyboardToggle;
			ControllerToggle = controllerToggle;
			Navigation = navigation;
			ConfirmPressed = confirmPressed;
			ConfirmHeld = confirmHeld;
			ConfirmReleased = confirmReleased;
			CancelPressed = cancelPressed;
			FavoritePressed = favoritePressed;
			PreviousTargetPressed = previousTargetPressed;
			NextTargetPressed = nextTargetPressed;
			MouseActivity = mouseActivity;
		}
	}
	internal sealed class ItemSpawnerInput : IDisposable
	{
		private readonly ModConfig _config;

		private readonly ManualLogSource _logger;

		private InputAction? _controllerToggleAction;

		private string _bindingSignature = string.Empty;

		public ItemSpawnerInput(ModConfig config, ManualLogSource logger)
		{
			_config = config;
			_logger = logger;
		}

		public ItemSpawnerInputSnapshot ReadSnapshot()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			EnsureActions();
			Gamepad current = Gamepad.current;
			Mouse current2 = Mouse.current;
			Vector2 navigation = ((current == null) ? Vector2.zero : Vector2.ClampMagnitude(((InputControl<Vector2>)(object)current.leftStick).ReadValue() + ((InputControl<Vector2>)(object)current.dpad).ReadValue(), 1f));
			int num;
			if (current2 != null)
			{
				Vector2 val = ((InputControl<Vector2>)(object)((Pointer)current2).delta).ReadValue();
				if (!(((Vector2)(ref val)).sqrMagnitude > 0.25f) && !current2.leftButton.wasPressedThisFrame && !current2.rightButton.wasPressedThisFrame && !current2.middleButton.wasPressedThisFrame)
				{
					val = ((InputControl<Vector2>)(object)current2.scroll).ReadValue();
					num = ((((Vector2)(ref val)).sqrMagnitude > 0.01f) ? 1 : 0);
				}
				else
				{
					num = 1;
				}
			}
			else
			{
				num = 0;
			}
			bool mouseActivity = (byte)num != 0;
			KeyCode toggleKey = _config.ToggleKey;
			bool keyboardToggle = (int)toggleKey != 0 && Input.GetKeyDown(toggleKey);
			InputAction? controllerToggleAction = _controllerToggleAction;
			return new ItemSpawnerInputSnapshot(keyboardToggle, controllerToggleAction != null && controllerToggleAction.WasPressedThisFrame(), navigation, current != null && current.buttonSouth.wasPressedThisFrame, current != null && current.buttonSouth.isPressed, current != null && current.buttonSouth.wasReleasedThisFrame, Input.GetKeyDown((KeyCode)27) || (current != null && current.buttonEast.wasPressedThisFrame), current != null && current.buttonWest.wasPressedThisFrame, current != null && current.leftShoulder.wasPressedThisFrame, current != null && current.rightShoulder.wasPressedThisFrame, mouseActivity);
		}

		public void Dispose()
		{
			DisposeAction();
			_bindingSignature = string.Empty;
		}

		private void EnsureActions()
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			string text = ControllerBindingRules.NormalizeBindingPath(_config.ControllerChordModifierPath.Value);
			string text2 = ControllerBindingRules.NormalizeBindingPath(_config.ControllerTogglePath.Value);
			string text3 = text + "\n" + text2;
			if (text3 == _bindingSignature)
			{
				return;
			}
			DisposeAction();
			_bindingSignature = text3;
			if (text2.Length == 0)
			{
				return;
			}
			try
			{
				_controllerToggleAction = new InputAction("ItemSpawnerEnhanced Controller Toggle", (InputActionType)1, (string)null, (string)null, (string)null, (string)null);
				if (text.Length == 0)
				{
					InputActionSetupExtensions.AddBinding(_controllerToggleAction, text2, (string)null, (string)null, (string)null);
				}
				else
				{
					CompositeSyntax val = InputActionSetupExtensions.AddCompositeBinding(_controllerToggleAction, "OneModifier", (string)null, (string)null);
					val = ((CompositeSyntax)(ref val)).With("modifier", text, (string)null, (string)null);
					((CompositeSyntax)(ref val)).With("binding", text2, (string)null, (string)null);
				}
				_controllerToggleAction.Enable();
			}
			catch (Exception ex)
			{
				DisposeAction();
				_logger.LogWarning((object)("Controller window binding is invalid and has been disabled: " + ex.Message));
			}
		}

		private void DisposeAction()
		{
			if (_controllerToggleAction != null)
			{
				_controllerToggleAction.Disable();
				_controllerToggleAction.Dispose();
				_controllerToggleAction = null;
			}
		}
	}
	internal sealed class ModConfig
	{
		private static readonly string[] ControllerPathOptions = new string[18]
		{
			"<Gamepad>/select", "<Gamepad>/start", "<Gamepad>/leftShoulder", "<Gamepad>/rightShoulder", "<Gamepad>/buttonSouth", "<Gamepad>/buttonEast", "<Gamepad>/buttonWest", "<Gamepad>/buttonNorth", "<Gamepad>/leftTrigger", "<Gamepad>/rightTrigger",
			"<Gamepad>/leftStickPress", "<Gamepad>/rightStickPress", "<Gamepad>/dpad/up", "<Gamepad>/dpad/down", "<Gamepad>/dpad/left", "<Gamepad>/dpad/right", "None", ""
		};

		private readonly ConfigEntry<KeyCode> _toggleKey;

		private readonly ConfigEntry<bool> _showAllItems;

		private readonly ConfigEntry<bool> _singleTagSelection;

		private readonly ConfigEntry<TagMatchMode> _tagMatchMode;

		private readonly ConfigEntry<string> _favoriteItemNames;

		public KeyCode ToggleKey => _toggleKey.Value;

		public ConfigEntry<string> ControllerChordModifierPath { get; }

		public ConfigEntry<string> ControllerTogglePath { get; }

		public bool ShowAllItems => _showAllItems.Value;

		public bool SingleTagSelection => _singleTagSelection.Value;

		public TagMatchMode TagMatchMode => _tagMatchMode.Value;

		public ConfigEntry<bool> SingleTagSelectionEntry => _singleTagSelection;

		public ConfigEntry<TagMatchMode> TagMatchModeEntry => _tagMatchMode;

		public ConfigEntry<string> FavoriteItemNamesEntry => _favoriteItemNames;

		public ModConfig(ConfigFile config)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			_toggleKey = config.Bind<KeyCode>("General", "ToggleKey", (KeyCode)286, "The keyboard key used to open and close the item spawner.");
			ControllerChordModifierPath = config.Bind<string>("Controls", "ControllerChordModifierPath", "<Gamepad>/select", new ConfigDescription("Controller button held as the optional modifier for the item spawner shortcut. Default: <Gamepad>/select (Xbox View / PlayStation Share). Leave empty or set to None for a single-button shortcut.", (AcceptableValueBase)(object)new AcceptableValueList<string>(ControllerPathOptions), Array.Empty<object>()));
			ControllerTogglePath = config.Bind<string>("Controls", "ControllerTogglePath", "<Gamepad>/rightTrigger", new ConfigDescription("Controller button pressed with the optional modifier to open or close the item spawner. Default: <Gamepad>/rightTrigger (Xbox RT / PlayStation R2). Leave empty or set to None to disable.", (AcceptableValueBase)(object)new AcceptableValueList<string>(ControllerPathOptions), Array.Empty<object>()));
			_showAllItems = config.Bind<bool>("Catalog", "ShowAllItems", false, "Show every item prefab registered by PEAK, including unused, test, cheat, and internal duplicate items.");
			_singleTagSelection = config.Bind<bool>("Filtering", "SingleTagSelection", true, "Allow only one selected filter tag at a time. Selecting another tag clears the current selection.");
			_tagMatchMode = config.Bind<TagMatchMode>("Filtering", "TagMatchMode", TagMatchMode.And, "How selected tags are combined. And requires every selected tag; Or requires any selected tag.");
			_favoriteItemNames = config.Bind<string>("Favorites", "ItemNames", "[]", "Favorite item prefab names stored as a JSON array. Manage these in the item spawner UI.");
		}
	}
	internal static class PatchInstaller
	{
		public static bool Install(Harmony harmony, ManualLogSource logger)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			try
			{
				MethodInfo methodInfo = AccessTools.Method(typeof(GUIManager), "Start", (Type[])null, (Type[])null);
				MethodInfo methodInfo2 = AccessTools.Method(typeof(PatchCallbacks), "GuiManagerStartPostfix", (Type[])null, (Type[])null);
				if (methodInfo == null || methodInfo2 == null)
				{
					return false;
				}
				harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				return true;
			}
			catch (Exception arg)
			{
				logger.LogError((object)$"Failed to patch GUIManager.Start: {arg}");
				return false;
			}
		}
	}
	internal static class PatchCallbacks
	{
		public static void GuiManagerStartPostfix()
		{
			Plugin.Instance?.Attach();
		}
	}
	internal sealed class PlayerTargetService
	{
		private static readonly MethodInfo? SpawnItemMethod = AccessTools.Method(typeof(CharacterItems), "SpawnItemInHand", new Type[1] { typeof(string) }, (Type[])null);

		private readonly ManualLogSource _logger;

		public PlayerTargetService(ManualLogSource logger)
		{
			_logger = logger;
		}

		public PlayerTargetSnapshot Capture()
		{
			Character[] playerCharacters = GetPlayerCharacters();
			Character specCharacter = MainCameraMovement.specCharacter;
			List<PlayerTarget> list = new List<PlayerTarget>(playerCharacters.Length);
			TargetCandidate[] array = new TargetCandidate[playerCharacters.Length];
			for (int i = 0; i < playerCharacters.Length; i++)
			{
				Character val = playerCharacters[i];
				int actorId = GetActorId(val);
				bool canReceiveItem = CanReceiveItem(val);
				bool isLocal = (Object)(object)val == (Object)(object)Character.localCharacter;
				bool isSpectated = (Object)(object)val == (Object)(object)specCharacter;
				bool isSelectable = IsSelectable(actorId, canReceiveItem);
				array[i] = new TargetCandidate(actorId, isLocal, isSpectated, isSelectable, canReceiveItem);
				if (actorId > 0)
				{
					list.Add(new PlayerTarget(actorId, val.characterName, isLocal, isSpectated, isSelectable));
				}
			}
			PlayerTarget[] targets = list.OrderByDescending((PlayerTarget target) => target.IsLocal).ThenBy<PlayerTarget, string>((PlayerTarget target) => target.Name, StringComparer.OrdinalIgnoreCase).ToArray();
			return new PlayerTargetSnapshot(playerCharacters, array, targets);
		}

		public bool TrySpawn(Item item, int? manualActorId, out string errorKey)
		{
			if (!PhotonNetwork.IsConnected)
			{
				errorKey = "notConnected";
				return false;
			}
			Character val = Capture().Resolve(manualActorId);
			if ((Object)(object)val == (Object)null)
			{
				errorKey = "noTarget";
				return false;
			}
			try
			{
				if (SpawnItemMethod == null)
				{
					throw new MissingMethodException(typeof(CharacterItems).FullName, "SpawnItemInHand");
				}
				SpawnItemMethod.Invoke(val.refs.items, new object[1] { ((Object)item).name });
				_logger.LogInfo((object)("Spawned '" + ((Object)item).name + "' for '" + val.characterName + "'."));
				errorKey = string.Empty;
				return true;
			}
			catch (Exception arg)
			{
				_logger.LogError((object)$"Failed to spawn '{((Object)item).name}': {arg}");
				errorKey = "spawnFailed";
				return false;
			}
		}

		private static bool IsPlayerCharacter(Character? character)
		{
			if ((Object)(object)character != (Object)null)
			{
				return !character.isBot;
			}
			return false;
		}

		private static Character[] GetPlayerCharacters()
		{
			return PlayerHandler.GetAllPlayerCharacters().Where(IsPlayerCharacter).ToArray();
		}

		private static bool CanReceiveItem(Character? character)
		{
			if (IsPlayerCharacter(character) && character.refs != null)
			{
				return (Object)(object)character.refs.items != (Object)null;
			}
			return false;
		}

		private static bool IsSelectable(int actorId, bool canReceiveItem)
		{
			return actorId > 0 && canReceiveItem;
		}

		private static int GetActorId(Character character)
		{
			try
			{
				PhotonView photonView = ((MonoBehaviourPun)character).photonView;
				return (photonView != null) ? photonView.OwnerActorNr : (-1);
			}
			catch
			{
				return -1;
			}
		}
	}
	internal sealed class PlayerTargetSnapshot
	{
		private readonly Character[] _characters;

		private readonly TargetCandidate[] _candidates;

		public IReadOnlyList<PlayerTarget> Targets { get; }

		public PlayerTargetSnapshot(Character[] characters, TargetCandidate[] candidates, IReadOnlyList<PlayerTarget> targets)
		{
			_characters = characters;
			_candidates = candidates;
			Targets = targets;
		}

		public Character? Resolve(int? manualActorId)
		{
			int? num = TargetResolver.ResolveIndex(_candidates, manualActorId);
			if (!num.HasValue)
			{
				return null;
			}
			return _characters[num.Value];
		}
	}
	internal readonly struct PlayerTarget
	{
		public int ActorId { get; }

		public string Name { get; }

		public bool IsLocal { get; }

		public bool IsSpectated { get; }

		public bool IsSelectable { get; }

		public PlayerTarget(int actorId, string name, bool isLocal, bool isSpectated, bool isSelectable)
		{
			ActorId = actorId;
			Name = name;
			IsLocal = isLocal;
			IsSpectated = isSpectated;
			IsSelectable = isSelectable;
		}
	}
	[BepInPlugin("com.github.lllei.ItemSpawnerEnhanced", "ItemSpawnerEnhanced", "1.3.0")]
	public sealed class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "com.github.lllei.ItemSpawnerEnhanced";

		public const string PluginName = "ItemSpawnerEnhanced";

		private Harmony? _harmony;

		private ItemSpawnerController? _controller;

		internal static Plugin? Instance { get; private set; }

		private void Awake()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			Instance = this;
			ModConfig settings = new ModConfig(((BaseUnityPlugin)this).Config);
			_controller = new ItemSpawnerController(settings, ((BaseUnityPlugin)this).Logger);
			_harmony = new Harmony("com.github.lllei.ItemSpawnerEnhanced");
			if (!PatchInstaller.Install(_harmony, ((BaseUnityPlugin)this).Logger))
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"Item spawner UI is disabled because GUIManager.Start could not be patched.");
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)"ItemSpawnerEnhanced 1.3.0 loaded for PEAK 2.1.a baseline.");
		}

		private void Update()
		{
			_controller?.Tick();
		}

		internal void Attach()
		{
			_controller?.Attach();
		}

		private void OnDestroy()
		{
			_controller?.Dispose();
			Harmony? harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			RuntimeUiAssets.Release();
			Instance = null;
		}
	}
	internal static class BuildInfo
	{
		internal const string Version = "1.3.0";
	}
}
namespace ItemSpawnerEnhanced.UI
{
	internal sealed class ControlInteractionState : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
	{
		public bool Focused { get; private set; }

		public bool Hovered { get; private set; }

		public bool Pressed { get; private set; }

		public event Action? Changed;

		public void SetFocused(bool focused)
		{
			if (Focused != focused)
			{
				Focused = focused;
				this.Changed?.Invoke();
			}
		}

		public void SetControllerPressed(bool pressed)
		{
			if (Pressed != pressed)
			{
				Pressed = pressed;
				this.Changed?.Invoke();
			}
		}

		public void OnPointerEnter(PointerEventData eventData)
		{
			Hovered = true;
			this.Changed?.Invoke();
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			Hovered = false;
			Pressed = false;
			this.Changed?.Invoke();
		}

		public void OnPointerDown(PointerEventData eventData)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			if ((int)eventData.button == 0)
			{
				Pressed = true;
				this.Changed?.Invoke();
			}
		}

		public void OnPointerUp(PointerEventData eventData)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			if ((int)eventData.button == 0)
			{
				Pressed = false;
				this.Changed?.Invoke();
				if ((Object)(object)EventSystem.current != (Object)null && (Object)(object)EventSystem.current.currentSelectedGameObject == (Object)(object)((Component)this).gameObject)
				{
					EventSystem.current.SetSelectedGameObject((GameObject)null);
				}
			}
		}

		private void OnDisable()
		{
			Focused = false;
			Hovered = false;
			Pressed = false;
			this.Changed?.Invoke();
		}
	}
	internal sealed class ActionButtonVisual
	{
		private readonly Button _button;

		private readonly Image _background;

		private readonly Graphic _foreground;

		private readonly Image _focusFrame;

		private readonly ControlInteractionState _interaction;

		private bool _enabled = true;

		public Button Button => _button;

		public bool Enabled => _enabled;

		public ActionButtonVisual(Button button, Image background, Graphic foreground)
		{
			_button = button;
			_background = background;
			_foreground = foreground;
			_focusFrame = RuntimeUiFactory.CreateFocusFrame(((Component)button).transform);
			_interaction = ((Component)button).gameObject.AddComponent<ControlInteractionState>();
			_interaction.Changed += Render;
			((Selectable)_button).transition = (Transition)0;
			Render();
		}

		public void SetEnabled(bool enabled)
		{
			_enabled = enabled;
			((Selectable)_button).interactable = enabled;
			Render();
		}

		public void SetFocused(bool focused)
		{
			_interaction.SetFocused(focused && _enabled);
		}

		public void SetControllerPressed(bool pressed)
		{
			_interaction.SetControllerPressed(pressed && _enabled);
		}

		private void Render()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			ControlVisualState controlVisualState = ControllerVisualState.ForAction(_enabled, _interaction.Focused, _interaction.Hovered, _interaction.Pressed);
			((Graphic)_background).color = RuntimeUiFactory.ResolvePalette(controlVisualState.Background);
			_foreground.color = (Color)(_enabled ? RuntimeUiFactory.ResolvePalette(controlVisualState.Foreground) : new Color(RuntimeUiFactory.TextMuted.r, RuntimeUiFactory.TextMuted.g, RuntimeUiFactory.TextMuted.b, 0.35f));
			((Component)_focusFrame).gameObject.SetActive(controlVisualState.ShowFocus);
		}
	}
	internal sealed class ControllerFocusCoordinator
	{
		private const float NavigationDeadZone = 0.55f;

		private const float InitialRepeatDelay = 0.35f;

		private const float RepeatInterval = 0.1f;

		private readonly ItemSpawnerView _view;

		private readonly Action _close;

		private ControllerFocusLocation _focus;

		private ControllerFocusLocation _lastFocus;

		private ControllerFocusLocation _lastTagFocus;

		private ControllerFocusLocation _lastItemFocus;

		private ControllerNavigationDirection? _heldDirection;

		private float _nextNavigationAt;

		private TagToggle? _pressedTag;

		private ItemTile? _pressedTile;

		private bool _tagClearPressed;

		private bool _controllerMode;

		private bool _windowOpen;

		public ControllerFocusCoordinator(ItemSpawnerView view, Action close)
		{
			_view = view;
			_close = close;
		}

		public void OpenWithController()
		{
			_windowOpen = true;
			_controllerMode = true;
			_heldDirection = null;
			ClearEventSystemSelection();
			RestoreFocus(preferFirstItem: true);
		}

		public void OpenWithoutController()
		{
			_windowOpen = true;
			_controllerMode = false;
			_heldDirection = null;
			ClearFocusVisual(_focus);
		}

		public void Close()
		{
			ReleasePressedControl();
			if (_view.TargetDropdown.Dropdown.IsExpanded)
			{
				_view.TargetDropdown.Dropdown.Hide();
			}
			_view.TargetDropdown.SetExpanded(expanded: false);
			ClearFocusVisual(_focus);
			ClearDropdownOptionFocus();
			_view.HideTooltip();
			_windowOpen = false;
			_controllerMode = false;
			_heldDirection = null;
			if ((Object)(object)EventSystem.current != (Object)null && (Object)(object)EventSystem.current.currentSelectedGameObject != (Object)null && EventSystem.current.currentSelectedGameObject.transform.IsChildOf(_view.Root.transform))
			{
				EventSystem.current.SetSelectedGameObject((GameObject)null);
			}
		}

		public void Tick(ItemSpawnerInputSnapshot input)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			if (!_windowOpen)
			{
				return;
			}
			SyncDropdownState();
			if (input.MouseActivity)
			{
				SetControllerMode(controllerMode: false);
			}
			if (input.ControllerActivity)
			{
				SetControllerMode(controllerMode: true);
			}
			ValidateFocus();
			if (input.CancelPressed)
			{
				if (_view.TargetDropdown.Expanded)
				{
					CollapseDropdown();
				}
				else
				{
					_close();
				}
			}
			else
			{
				if (!_controllerMode)
				{
					return;
				}
				if (input.ConfirmPressed)
				{
					ClearEventSystemSelection();
				}
				ControllerNavigationDirection? direction = ReadDirection(input.Navigation);
				if (ShouldNavigate(direction))
				{
					Move(direction.Value);
				}
				if (!_view.TargetDropdown.Expanded)
				{
					if (input.PreviousTargetPressed)
					{
						SwitchRegion(-1);
					}
					if (input.NextTargetPressed)
					{
						SwitchRegion(1);
					}
					if (input.FavoritePressed)
					{
						ToggleFocusedFavorite();
					}
				}
				if (input.ConfirmPressed)
				{
					ActivateFocusedControl();
				}
				if (input.ConfirmReleased || !input.ConfirmHeld)
				{
					ReleasePressedControl();
				}
			}
		}

		private void SetControllerMode(bool controllerMode)
		{
			if (_controllerMode != controllerMode)
			{
				_controllerMode = controllerMode;
				if (controllerMode)
				{
					ClearEventSystemSelection();
					RestoreFocus(preferFirstItem: false);
					return;
				}
				ReleasePressedControl();
				ClearFocusVisual(_focus);
				ClearDropdownOptionFocus();
				_view.HideTooltip();
			}
		}

		private void RestoreFocus(bool preferFirstItem)
		{
			if (_focus.Kind != ControllerFocusKind.None)
			{
				ApplyFocus(_focus, remember: false);
				return;
			}
			if (!preferFirstItem && _lastFocus.Kind != ControllerFocusKind.None)
			{
				ApplyFocus(_lastFocus, remember: false);
				return;
			}
			IReadOnlyList<ItemTile> visibleTiles = _view.VisibleTiles;
			ApplyFocus((visibleTiles.Count > 0) ? ControllerFocusLocation.ForItem(0, ((Object)visibleTiles[0].Record.Item).name) : ControllerFocusLocation.PendingFirstItem(), remember: false);
		}

		private void ValidateFocus()
		{
			if (!_controllerMode)
			{
				return;
			}
			switch (_focus.Kind)
			{
			case ControllerFocusKind.Item:
			{
				IReadOnlyList<ItemTile> visibleTiles = _view.VisibleTiles;
				if (visibleTiles.Count == 0)
				{
					ClearFocusVisual(_focus);
					_view.HideTooltip();
					break;
				}
				int num = FindFocusedItemIndex(visibleTiles);
				if (num >= 0)
				{
					if (num != _focus.Index)
					{
						_focus = ControllerFocusLocation.ForItem(num, _focus.ItemName);
					}
				}
				else
				{
					int index = ControllerNavigation.ResolveFallbackIndex(_focus.Index, visibleTiles.Count);
					ApplyFocus(ControllerFocusLocation.ForItem(index, ((Object)visibleTiles[index].Record.Item).name), remember: true);
				}
				break;
			}
			case ControllerFocusKind.ClearTags:
				if (!_view.TagClear.Enabled)
				{
					ApplyFocus(ControllerFocusLocation.ForTag(_view.TagToggles.Count - 1), remember: true);
				}
				break;
			case ControllerFocusKind.DropdownOption:
				if (!_view.TargetDropdown.Expanded)
				{
					ApplyFocus(ControllerFocusLocation.Target(), remember: true);
				}
				break;
			case ControllerFocusKind.None:
				RestoreFocus(preferFirstItem: true);
				break;
			case ControllerFocusKind.Target:
			case ControllerFocusKind.Tag:
				break;
			}
		}

		private bool ShouldNavigate(ControllerNavigationDirection? direction)
		{
			if (!direction.HasValue)
			{
				_heldDirection = null;
				return false;
			}
			float unscaledTime = Time.unscaledTime;
			if (_heldDirection != direction)
			{
				_heldDirection = direction;
				_nextNavigationAt = unscaledTime + 0.35f;
				return true;
			}
			if (unscaledTime < _nextNavigationAt)
			{
				return false;
			}
			_nextNavigationAt = unscaledTime + 0.1f;
			return true;
		}

		private void Move(ControllerNavigationDirection direction)
		{
			if (_view.TargetDropdown.Expanded)
			{
				switch (direction)
				{
				case ControllerNavigationDirection.Up:
					MoveDropdownOption(-1);
					break;
				case ControllerNavigationDirection.Down:
					MoveDropdownOption(1);
					break;
				}
				return;
			}
			switch (_focus.Kind)
			{
			case ControllerFocusKind.Target:
				if (direction == ControllerNavigationDirection.Down)
				{
					FocusNearestTag(GetHorizontalCenter(((Component)_view.TargetDropdown.Dropdown).transform));
				}
				break;
			case ControllerFocusKind.Tag:
				MoveFromTag(direction);
				break;
			case ControllerFocusKind.ClearTags:
				MoveFromClearTags(direction);
				break;
			case ControllerFocusKind.Item:
				MoveFromItem(direction);
				break;
			default:
				RestoreFocus(preferFirstItem: true);
				break;
			}
		}

		private void MoveFromTag(ControllerNavigationDirection direction)
		{
			int num = Math.Clamp(_focus.Index, 0, _view.TagToggles.Count - 1);
			switch (direction)
			{
			case ControllerNavigationDirection.Left:
				if (num > 0)
				{
					ApplyFocus(ControllerFocusLocation.ForTag(num - 1), remember: true);
				}
				break;
			case ControllerNavigationDirection.Right:
				if (num + 1 < _view.TagToggles.Count)
				{
					ApplyFocus(ControllerFocusLocation.ForTag(num + 1), remember: true);
				}
				else if (_view.TagClear.Enabled)
				{
					ApplyFocus(ControllerFocusLocation.ClearTags(), remember: true);
				}
				break;
			case ControllerNavigationDirection.Up:
				ApplyFocus(ControllerFocusLocation.Target(), remember: true);
				break;
			case ControllerNavigationDirection.Down:
				FocusNearestItem(GetHorizontalCenter(((Component)_view.TagToggles[num].Toggle).transform));
				break;
			}
		}

		private void MoveFromClearTags(ControllerNavigationDirection direction)
		{
			switch (direction)
			{
			case ControllerNavigationDirection.Left:
				ApplyFocus(ControllerFocusLocation.ForTag(_view.TagToggles.Count - 1), remember: true);
				break;
			case ControllerNavigationDirection.Up:
				ApplyFocus(ControllerFocusLocation.Target(), remember: true);
				break;
			case ControllerNavigationDirection.Down:
				FocusNearestItem(GetHorizontalCenter(((Component)_view.TagClear.Button).transform));
				break;
			case ControllerNavigationDirection.Right:
				break;
			}
		}

		private void MoveFromItem(ControllerNavigationDirection direction)
		{
			IReadOnlyList<ItemTile> visibleTiles = _view.VisibleTiles;
			int num = FindFocusedItemIndex(visibleTiles);
			if (num < 0)
			{
				return;
			}
			int num2 = CalculateColumnCount();
			if (direction == ControllerNavigationDirection.Up && num < num2)
			{
				FocusNearestTag(GetHorizontalCenter((Transform)(object)visibleTiles[num].RectTransform));
				return;
			}
			int num3 = ControllerNavigation.MoveInGrid(num, visibleTiles.Count, num2, direction);
			if (num3 != num)
			{
				ApplyFocus(ControllerFocusLocation.ForItem(num3, ((Object)visibleTiles[num3].Record.Item).name), remember: true);
			}
		}

		private void FocusNearestTag(float horizontalPosition)
		{
			List<float> list = _view.TagToggles.Select((TagToggle tag) => GetHorizontalCenter(((Component)tag.Toggle).transform)).ToList();
			if (_view.TagClear.Enabled)
			{
				list.Add(GetHorizontalCenter(((Component)_view.TagClear.Button).transform));
			}
			int num = ControllerNavigation.FindNearest(horizontalPosition, list);
			if (num >= 0)
			{
				ApplyFocus((num < _view.TagToggles.Count) ? ControllerFocusLocation.ForTag(num) : ControllerFocusLocation.ClearTags(), remember: true);
			}
		}

		private void FocusNearestItem(float horizontalPosition)
		{
			IReadOnlyList<ItemTile> visibleTiles = _view.VisibleTiles;
			if (visibleTiles.Count != 0)
			{
				int count = Math.Min(CalculateColumnCount(), visibleTiles.Count);
				float[] candidates = (from tile in visibleTiles.Take(count)
					select GetHorizontalCenter((Transform)(object)tile.RectTransform)).ToArray();
				int index = ControllerNavigation.FindNearest(horizontalPosition, candidates);
				ApplyFocus(ControllerFocusLocation.ForItem(index, ((Object)visibleTiles[index].Record.Item).name), remember: true);
			}
		}

		private void ActivateFocusedControl()
		{
			switch (_focus.Kind)
			{
			case ControllerFocusKind.Target:
				ExpandDropdown();
				break;
			case ControllerFocusKind.Tag:
				if (_focus.Index >= 0 && _focus.Index < _view.TagToggles.Count)
				{
					TagToggle tagToggle = _view.TagToggles[_focus.Index];
					tagToggle.SetControllerPressed(pressed: true);
					_pressedTag = tagToggle;
					tagToggle.Toggle.isOn = !tagToggle.Toggle.isOn;
				}
				break;
			case ControllerFocusKind.ClearTags:
				if (_view.TagClear.Enabled)
				{
					_view.TagClear.SetControllerPressed(pressed: true);
					_tagClearPressed = true;
					((UnityEvent)_view.TagClear.Button.onClick).Invoke();
					ValidateFocus();
				}
				break;
			case ControllerFocusKind.Item:
			{
				ItemTile itemTile = ResolveFocusedItem();
				if (itemTile != null && itemTile.CanSpawn)
				{
					itemTile.BeginControllerSubmit();
					_pressedTile = itemTile;
				}
				break;
			}
			case ControllerFocusKind.DropdownOption:
				SelectDropdownOption();
				break;
			}
		}

		private void ReleasePressedControl()
		{
			if (_pressedTag != null)
			{
				_pressedTag.SetControllerPressed(pressed: false);
			}
			if (_tagClearPressed)
			{
				_view.TagClear.SetControllerPressed(pressed: false);
			}
			if (_pressedTile != null && (Object)(object)_pressedTile.GameObject != (Object)null)
			{
				_pressedTile.EndControllerSubmit();
			}
			_pressedTag = null;
			_pressedTile = null;
			_tagClearPressed = false;
		}

		private void ToggleFocusedFavorite()
		{
			ItemTile? itemTile = ResolveFocusedItem();
			if (itemTile != null && itemTile.TryToggleFavorite())
			{
				ValidateFocus();
			}
		}

		private void SwitchRegion(int direction)
		{
			bool[] availableRegions = new bool[3]
			{
				_view.TargetDropdown.Enabled,
				_view.TagToggles.Count > 0,
				_view.VisibleTiles.Count > 0
			};
			int num;
			switch (_focus.Kind)
			{
			case ControllerFocusKind.Target:
			case ControllerFocusKind.DropdownOption:
				num = 0;
				break;
			case ControllerFocusKind.Tag:
			case ControllerFocusKind.ClearTags:
				num = 1;
				break;
			case ControllerFocusKind.Item:
				num = 2;
				break;
			default:
				num = 2;
				break;
			}
			int num2 = num;
			int num3 = ControllerNavigation.MoveRegion(num2, direction, availableRegions);
			if (num3 >= 0 && num3 != num2)
			{
				switch (num3)
				{
				case 0:
					ApplyFocus(ControllerFocusLocation.Target(), remember: true);
					break;
				case 1:
					RestoreTagRegionFocus();
					break;
				case 2:
					RestoreItemRegionFocus();
					break;
				}
			}
		}

		private void RestoreTagRegionFocus()
		{
			if (_lastTagFocus.Kind == ControllerFocusKind.ClearTags && _view.TagClear.Enabled)
			{
				ApplyFocus(_lastTagFocus, remember: true);
				return;
			}
			int index = ((_lastTagFocus.Kind == ControllerFocusKind.Tag) ? Math.Clamp(_lastTagFocus.Index, 0, _view.TagToggles.Count - 1) : 0);
			ApplyFocus(ControllerFocusLocation.ForTag(index), remember: true);
		}

		private void RestoreItemRegionFocus()
		{
			IReadOnlyList<ItemTile> visibleTiles = _view.VisibleTiles;
			if (visibleTiles.Count != 0)
			{
				int num = FindItemIndex(visibleTiles, _lastItemFocus);
				if (num < 0)
				{
					num = ControllerNavigation.ResolveFallbackIndex(_lastItemFocus.Index, visibleTiles.Count);
				}
				ApplyFocus(ControllerFocusLocation.ForItem(num, ((Object)visibleTiles[num].Record.Item).name), remember: true);
			}
		}

		private void ExpandDropdown()
		{
			TMP_Dropdown dropdown = _view.TargetDropdown.Dropdown;
			if (((UIBehaviour)dropdown).IsActive() && ((Selectable)dropdown).IsInteractable())
			{
				dropdown.Show();
				if ((Object)(object)EventSystem.current != (Object)null)
				{
					EventSystem.current.SetSelectedGameObject((GameObject)null);
				}
				Canvas.ForceUpdateCanvases();
				_view.TargetDropdown.SetExpanded(dropdown.IsExpanded);
				if (dropdown.IsExpanded)
				{
					int index = Math.Clamp(dropdown.value, 0, Math.Max(0, dropdown.options.Count - 1));
					ApplyFocus(ControllerFocusLocation.DropdownOption(index), remember: false);
				}
			}
		}

		private void CollapseDropdown()
		{
			_view.TargetDropdown.Dropdown.Hide();
			_view.TargetDropdown.SetExpanded(expanded: false);
			ClearDropdownOptionFocus();
			if ((Object)(object)EventSystem.current != (Object)null)
			{
				EventSystem.current.SetSelectedGameObject((GameObject)null);
			}
			ApplyFocus(ControllerFocusLocation.Target(), remember: true);
		}

		private void MoveDropdownOption(int delta)
		{
			IReadOnlyList<DropdownOptionVisual> visibleOptions = _view.TargetDropdown.GetVisibleOptions();
			if (visibleOptions.Count != 0)
			{
				int num = Math.Clamp(_focus.Index + delta, 0, visibleOptions.Count - 1);
				if (num != _focus.Index)
				{
					ApplyFocus(ControllerFocusLocation.DropdownOption(num), remember: false);
				}
			}
		}

		private void SelectDropdownOption()
		{
			TMP_Dropdown dropdown = _view.TargetDropdown.Dropdown;
			if (_focus.Index >= 0 && _focus.Index < dropdown.options.Count)
			{
				dropdown.value = _focus.Index;
			}
			CollapseDropdown();
		}

		private void SyncDropdownState()
		{
			bool isExpanded = _view.TargetDropdown.Dropdown.IsExpanded;
			if (isExpanded != _view.TargetDropdown.Expanded)
			{
				_view.TargetDropdown.SetExpanded(isExpanded);
				if (!isExpanded && _focus.Kind == ControllerFocusKind.DropdownOption)
				{
					ApplyFocus(ControllerFocusLocation.Target(), remember: true);
				}
			}
		}

		private void ApplyFocus(ControllerFocusLocation next, bool remember)
		{
			ReleasePressedControl();
			ClearFocusVisual(_focus);
			ClearDropdownOptionFocus();
			_view.HideTooltip();
			_focus = next;
			ControllerFocusKind kind = next.Kind;
			if ((uint)(kind - 2) <= 1u)
			{
				_lastTagFocus = next;
			}
			else if (next.Kind == ControllerFocusKind.Item)
			{
				_lastItemFocus = next;
			}
			if (remember && next.Kind != ControllerFocusKind.DropdownOption)
			{
				_lastFocus = next;
			}
			if (_controllerMode)
			{
				SetFocusVisual(next);
			}
		}

		private void SetFocusVisual(ControllerFocusLocation location)
		{
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			switch (location.Kind)
			{
			case ControllerFocusKind.Target:
				_view.TargetDropdown.SetFocused(focused: true);
				break;
			case ControllerFocusKind.Tag:
				if (location.Index >= 0 && location.Index < _view.TagToggles.Count)
				{
					_view.TagToggles[location.Index].SetFocused(focused: true);
				}
				break;
			case ControllerFocusKind.ClearTags:
				if (_view.TagClear.Enabled)
				{
					_view.TagClear.SetFocused(focused: true);
				}
				break;
			case ControllerFocusKind.Item:
			{
				ItemTile itemTile = ResolveFocusedItem();
				if (itemTile != null)
				{
					itemTile.SetFocused(focused: true);
					EnsureItemVisible(itemTile);
					if (itemTile.HasTruncatedName())
					{
						_view.ShowControllerTooltip(itemTile);
					}
				}
				break;
			}
			case ControllerFocusKind.DropdownOption:
			{
				IReadOnlyList<DropdownOptionVisual> visibleOptions = _view.TargetDropdown.GetVisibleOptions();
				if (location.Index >= 0 && location.Index < visibleOptions.Count)
				{
					visibleOptions[location.Index].SetFocused(focused: true);
					ScrollRect componentInParent = ((Component)visibleOptions[location.Index]).GetComponentInParent<ScrollRect>();
					if ((Object)(object)componentInParent != (Object)null)
					{
						EnsureVisible(componentInParent, (RectTransform)((Component)visibleOptions[location.Index]).transform);
					}
				}
				break;
			}
			}
		}

		private void ClearFocusVisual(ControllerFocusLocation location)
		{
			switch (location.Kind)
			{
			case ControllerFocusKind.Target:
				_view.TargetDropdown.SetFocused(focused: false);
				break;
			case ControllerFocusKind.Tag:
				if (location.Index >= 0 && location.Index < _view.TagToggles.Count)
				{
					_view.TagToggles[location.Index].SetFocused(focused: false);
				}
				break;
			case ControllerFocusKind.ClearTags:
				_view.TagClear.SetFocused(focused: false);
				break;
			case ControllerFocusKind.Item:
				ResolveFocusedItem()?.SetFocused(focused: false);
				break;
			}
		}

		private void ClearDropdownOptionFocus()
		{
			foreach (DropdownOptionVisual visibleOption in _view.TargetDropdown.GetVisibleOptions())
			{
				visibleOption.SetFocused(focused: false);
			}
		}

		private ItemTile? ResolveFocusedItem()
		{
			IReadOnlyList<ItemTile> visibleTiles = _view.VisibleTiles;
			int num = FindFocusedItemIndex(visibleTiles);
			if (num < 0)
			{
				return null;
			}
			return visibleTiles[num];
		}

		private int FindFocusedItemIndex(IReadOnlyList<ItemTile> tiles)
		{
			return FindItemIndex(tiles, _focus);
		}

		private static int FindItemIndex(IReadOnlyList<ItemTile> tiles, ControllerFocusLocation location)
		{
			if (!string.IsNullOrEmpty(location.ItemName))
			{
				if (location.Index >= 0 && location.Index < tiles.Count && string.Equals(((Object)tiles[location.Index].Record.Item).name, location.ItemName, StringComparison.Ordinal))
				{
					return location.Index;
				}
				for (int i = 0; i < tiles.Count; i++)
				{
					if (string.Equals(((Object)tiles[i].Record.Item).name, location.ItemName, StringComparison.Ordinal))
					{
						return i;
					}
				}
			}
			return -1;
		}

		private int CalculateColumnCount()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			Canvas.ForceUpdateCanvases();
			GridLayoutGroup component = ((Component)_view.ItemContent).GetComponent<GridLayoutGroup>();
			Rect rect = _view.ItemContent.rect;
			float num = ((Rect)(ref rect)).width - (float)((LayoutGroup)component).padding.horizontal;
			return Math.Max(1, Mathf.FloorToInt((num + component.spacing.x) / (component.cellSize.x + component.spacing.x)));
		}

		private void EnsureItemVisible(ItemTile tile)
		{
			EnsureVisible(_view.ItemScroll, tile.RectTransform);
		}

		private static void EnsureVisible(ScrollRect scroll, RectTransform target)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			Canvas.ForceUpdateCanvases();
			RectTransform viewport = scroll.viewport;
			RectTransform content = scroll.content;
			Bounds val = RectTransformUtility.CalculateRelativeRectTransformBounds((Transform)(object)viewport, (Transform)(object)target);
			float num = content.anchoredPosition.y;
			float y = ((Bounds)(ref val)).min.y;
			Rect rect = viewport.rect;
			if (y < ((Rect)(ref rect)).yMin)
			{
				float num2 = num;
				rect = viewport.rect;
				num = num2 + (((Rect)(ref rect)).yMin - ((Bounds)(ref val)).min.y);
			}
			else
			{
				float y2 = ((Bounds)(ref val)).max.y;
				rect = viewport.rect;
				if (y2 > ((Rect)(ref rect)).yMax)
				{
					float num3 = num;
					float y3 = ((Bounds)(ref val)).max.y;
					rect = viewport.rect;
					num = num3 - (y3 - ((Rect)(ref rect)).yMax);
				}
			}
			rect = content.rect;
			float height = ((Rect)(ref rect)).height;
			rect = viewport.rect;
			float num4 = Math.Max(0f, height - ((Rect)(ref rect)).height);
			content.anchoredPosition = new Vector2(content.anchoredPosition.x, Mathf.Clamp(num, 0f, num4));
		}

		private static float GetHorizontalCenter(Transform transform)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
			if (val == null)
			{
				return transform.position.x;
			}
			Vector3[] array = (Vector3[])(object)new Vector3[4];
			val.GetWorldCorners(array);
			return (array[0].x + array[2].x) * 0.5f;
		}

		private static ControllerNavigationDirection? ReadDirection(Vector2 navigation)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (((Vector2)(ref navigation)).sqrMagnitude < 0.3025f)
			{
				return null;
			}
			if (Mathf.Abs(navigation.x) > Mathf.Abs(navigation.y))
			{
				return (!(navigation.x < 0f)) ? ControllerNavigationDirection.Right : ControllerNavigationDirection.Left;
			}
			return (navigation.y < 0f) ? ControllerNavigationDirection.Down : ControllerNavigationDirection.Up;
		}

		private void ClearEventSystemSelection()
		{
			if (!((Object)(object)EventSystem.current == (Object)null) && !((Object)(object)EventSystem.current.currentSelectedGameObject == (Object)null) && EventSystem.current.currentSelectedGameObject.transform.IsChildOf(_view.Root.transform))
			{
				EventSystem.current.SetSelectedGameObject((GameObject)null);
			}
		}
	}
	internal enum ControllerFocusKind
	{
		None,
		Target,
		Tag,
		ClearTags,
		Item,
		DropdownOption
	}
	internal readonly struct ControllerFocusLocation
	{
		public ControllerFocusKind Kind { get; }

		public int Index { get; }

		public string? ItemName { get; }

		private ControllerFocusLocation(ControllerFocusKind kind, int index, string? itemName)
		{
			Kind = kind;
			Index = index;
			ItemName = itemName;
		}

		public static ControllerFocusLocation Target()
		{
			return new ControllerFocusLocation(ControllerFocusKind.Target, 0, null);
		}

		public static ControllerFocusLocation ForTag(int index)
		{
			return new ControllerFocusLocation(ControllerFocusKind.Tag, index, null);
		}

		public static ControllerFocusLocation ClearTags()
		{
			return new ControllerFocusLocation(ControllerFocusKind.ClearTags, 0, null);
		}

		public static ControllerFocusLocation ForItem(int index, string? itemName)
		{
			return new ControllerFocusLocation(ControllerFocusKind.Item, index, itemName);
		}

		public static ControllerFocusLocation PendingFirstItem()
		{
			return ForItem(0, null);
		}

		public static ControllerFocusLocation DropdownOption(int index)
		{
			return new ControllerFocusLocation(ControllerFocusKind.DropdownOption, index, null);
		}
	}
	internal static class ItemBrowserControlFactory
	{
		public static TagToggle CreateTagToggle(Transform parent, TMP_FontAsset font, ItemFilterTag tag)
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = RuntimeUiFactory.CreateRect(tag.ToString(), parent, typeof(Image), typeof(Toggle), typeof(LayoutElement));
			LayoutElement component = ((Component)val).GetComponent<LayoutElement>();
			component.minHeight = 52f;
			component.flexibleWidth = 1f;
			Image component2 = ((Component)val).GetComponent<Image>();
			RuntimeUiFactory.ApplyRoundedCorners(component2);
			Toggle component3 = ((Component)val).GetComponent<Toggle>();
			((Selectable)component3).targetGraphic = (Graphic)(object)component2;
			component3.graphic = null;
			TextMeshProUGUI val2 = RuntimeUiFactory.CreateText("Label", (Transform)(object)val, font, 17f, RuntimeUiFactory.TextPrimary, (TextAlignmentOptions)514);
			((TMP_Text)val2).maxVisibleLines = 2;
			RawImage val3 = null;
			if (tag == ItemFilterTag.Favorite)
			{
				RectTransform obj = RuntimeUiFactory.CreateRect("Heart", (Transform)(object)val, typeof(RawImage));
				obj.anchorMin = new Vector2(0f, 0.5f);
				obj.anchorMax = new Vector2(0f, 0.5f);
				obj.pivot = new Vector2(0f, 0.5f);
				obj.anchoredPosition = new Vector2(11f, 0f);
				obj.sizeDelta = new Vector2(18f, 18f);
				val3 = ((Component)obj).GetComponent<RawImage>();
				val3.texture = (Texture)(object)RuntimeUiAssets.HeartTexture;
				((Graphic)val3).color = RuntimeUiFactory.TextPrimary;
				((Graphic)val3).raycastTarget = false;
				RuntimeUiFactory.Stretch(((TMP_Text)val2).rectTransform, 28f, 5f, 2f, 2f);
			}
			else
			{
				RuntimeUiFactory.Stretch(((TMP_Text)val2).rectTransform, 5f, 5f, 2f, 2f);
			}
			TagToggle tagToggle = new TagToggle(tag, component3, component2, (TMP_Text)(object)val2, val3);
			tagToggle.SetActive(active: false);
			return tagToggle;
		}

		public static ItemNameTooltip CreateItemTooltip(RectTransform parent, TMP_FontAsset font)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = RuntimeUiFactory.CreateRect("ItemTooltip", (Transform)(object)parent, typeof(Image));
			val.anchorMin = new Vector2(0.5f, 0.5f);
			val.anchorMax = new Vector2(0.5f, 0.5f);
			val.pivot = new Vector2(0f, 1f);
			Image component = ((Component)val).GetComponent<Image>();
			RuntimeUiFactory.ApplyRoundedCorners(component);
			((Graphic)component).color = new Color(0.27f, 0.29f, 0.3f, 0.98f);
			((Graphic)component).raycastTarget = false;
			TextMeshProUGUI val2 = RuntimeUiFactory.CreateText("Label", (Transform)(object)val, font, 20f, RuntimeUiFactory.TextPrimary, (TextAlignmentOptions)4097);
			((TMP_Text)val2).overflowMode = (TextOverflowModes)0;
			RuntimeUiFactory.Stretch(((TMP_Text)val2).rectTransform, 12f, 12f, 8f, 8f);
			ItemNameTooltip itemNameTooltip = ((Component)parent).gameObject.AddComponent<ItemNameTooltip>();
			itemNameTooltip.Configure(parent, val, val2);
			return itemNameTooltip;
		}

		public static ItemTile CreateItemTile(Transform parent, TMP_FontAsset font, GameItemRecord record, UnityAction onClick, UnityAction onFavorite, bool isFavorite, ItemNameTooltip tooltip)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = RuntimeUiFactory.CreateRect(((Object)record.Item).name, parent, typeof(Image), typeof(Button));
			Image component = ((Component)val).GetComponent<Image>();
			RuntimeUiFactory.ApplyRoundedCorners(component);
			((Graphic)component).color = RuntimeUiFactory.Surface;
			Button component2 = ((Component)val).GetComponent<Button>();
			((Selectable)component2).targetGraphic = (Graphic)(object)component;
			((Selectable)component2).colors = RuntimeUiFactory.CreateButtonColors();
			ItemSpawnTrigger itemSpawnTrigger = ((Component)val).gameObject.AddComponent<ItemSpawnTrigger>();
			itemSpawnTrigger.Configure(component2, onClick);
			RectTransform obj = RuntimeUiFactory.CreateRect("Icon", (Transform)(object)val, typeof(RawImage));
			obj.anchorMin = new Vector2(0.5f, 1f);
			obj.anchorMax = new Vector2(0.5f, 1f);
			obj.pivot = new Vector2(0.5f, 1f);
			obj.anchoredPosition = new Vector2(0f, -10f);
			obj.sizeDelta = new Vector2(96f, 96f);
			RawImage component3 = ((Component)obj).GetComponent<RawImage>();
			component3.texture = (Texture)(object)record.Item.UIData?.icon;
			((Graphic)component3).raycastTarget = false;
			TextMeshProUGUI val2 = RuntimeUiFactory.CreateText("Name", (Transform)(object)val, font, 19f, RuntimeUiFactory.TextPrimary, (TextAlignmentOptions)514);
			((TMP_Text)val2).text = record.DisplayName;
			((TMP_Text)val2).maxVisibleLines = 2;
			((TMP_Text)val2).rectTransform.anchorMin = new Vector2(0f, 0f);
			((TMP_Text)val2).rectTransform.anchorMax = new Vector2(1f, 0f);
			((TMP_Text)val2).rectTransform.pivot = new Vector2(0.5f, 0f);
			((TMP_Text)val2).rectTransform.anchoredPosition = new Vector2(0f, 6f);
			((TMP_Text)val2).rectTransform.sizeDelta = new Vector2(-14f, 38f);
			RectTransform val3 = RuntimeUiFactory.CreateRect("Favorite", (Transform)(object)val);
			val3.anchorMin = new Vector2(1f, 1f);
			val3.anchorMax = new Vector2(1f, 1f);
			val3.pivot = new Vector2(1f, 1f);
			val3.anchoredPosition = new Vector2(-6f, -6f);
			val3.sizeDelta = new Vector2(32f, 32f);
			RectTransform obj2 = RuntimeUiFactory.CreateRect("Heart", (Transform)(object)val3, typeof(RawImage));
			RuntimeUiFactory.Stretch(obj2, 3f, 3f, 3f, 3f);
			RawImage component4 = ((Component)obj2).GetComponent<RawImage>();
			component4.texture = (Texture)(object)RuntimeUiAssets.HeartTexture;
			((Graphic)component4).color = RuntimeUiFactory.Favorite;
			((Graphic)component4).raycastTarget = false;
			((Component)val3).gameObject.SetActive(isFavorite);
			ItemFavoriteTrigger itemFavoriteTrigger = ((Component)val).gameObject.AddComponent<ItemFavoriteTrigger>();
			itemFavoriteTrigger.Configure(onFavorite);
			((Component)val).gameObject.AddComponent<ItemNameTooltipTrigger>().Configure(tooltip, record.DisplayName);
			return new ItemTile(record, ((Component)val).gameObject, component2, component, (TMP_Text)(object)val2, component3, ((Component)val3).gameObject, itemFavoriteTrigger, itemSpawnTrigger);
		}
	}
	internal sealed class ItemBrowserController
	{
		private const double CatalogWorkBudgetMilliseconds = 1.25;

		private const double TileWorkBudgetMilliseconds = 1.25;

		private const int MaximumItemsPerFrame = 2;

		private const double SearchIndexWorkBudgetMilliseconds = 1.25;

		private readonly ManualLogSource _logger;

		private readonly ModConfig _settings;

		private readonly FavoriteStore _favorites;

		private readonly ItemBrowserSession _session;

		private readonly ItemSpawnerView _view;

		private readonly PlayerTargetController _targetController;

		private readonly Func<string, string> _localize;

		private readonly GameItemCatalog _catalog;

		private readonly RefreshState _refresh = new RefreshState();

		private int _aliasProviderVersion;

		private float _nextRebuildAttempt;

		public bool IsRebuilding => _refresh.IsRebuilding;

		public bool HasPendingRefresh => _refresh.Pending != RefreshRequirement.None;

		public bool HasPendingCatalogRefresh => (_refresh.Pending & RefreshRequirement.Catalog) != 0;

		public bool AliasProvidersChanged => _aliasProviderVersion != SearchAliasRegistry.Version;

		public ItemBrowserController(ManualLogSource logger, ModConfig settings, FavoriteStore favorites, ItemBrowserSession session, ItemSpawnerView view, PlayerTargetController targetController, Func<string, string> localize)
		{
			_logger = logger;
			_settings = settings;
			_favorites = favorites;
			_session = session;
			_view = view;
			_targetController = targetController;
			_localize = localize;
			_catalog = new GameItemCatalog(logger, () => settings.ShowAllItems, favorites.IsFavorite);
		}

		public bool CanAttemptRebuild(float currentTime)
		{
			return currentTime >= _nextRebuildAttempt;
		}

		public bool IsCatalogCurrent()
		{
			return _catalog.IsCurrent();
		}

		public void InitializeView()
		{
			if (_settings.SingleTagSelection)
			{
				_session.SelectedTags = ItemTagSelection.NormalizeSingle(_session.SelectedTags);
			}
			_view.SetSelectedTags(_session.SelectedTags);
		}

		public void RequestRefresh(RefreshRequirement requirement)
		{
			_refresh.Request(requirement);
		}

		public void AbortRebuild()
		{
			_refresh.Abort();
		}

		public IEnumerator RebuildRequiredIncrementally()
		{
			_view.SetFavoriteEnabled(enabled: false);
			_view.SetStatus("...", isError: false);
			if ((_refresh.Pending & RefreshRequirement.Catalog) != RefreshRequirement.None)
			{
				_refresh.Begin(RebuildPhase.Catalog);
				yield return RebuildCatalogIncrementally();
				if ((_refresh.Pending & RefreshRequirement.Catalog) != RefreshRequirement.None)
				{
					CompleteRebuild(failed: true);
					yield break;
				}
				yield return null;
				if (_targetController.Refresh(force: true))
				{
					RefreshStatus();
				}
			}
			if ((_refresh.Pending & RefreshRequirement.SearchIndex) != RefreshRequirement.None)
			{
				_refresh.Begin(RebuildPhase.SearchIndex);
				yield return RebuildSearchIndexIncrementally();
				if ((_refresh.Pending & RefreshRequirement.SearchIndex) != RefreshRequirement.None)
				{
					CompleteRebuild(failed: true);
					yield break;
				}
			}
			CompleteRebuild(failed: false);
			ApplySearch(_view.SearchText);
		}

		public void ApplySearch(string query)
		{
			if (!IsRebuilding && (_refresh.Pending & RefreshRequirement.SearchIndex) == 0)
			{
				IReadOnlyList<GameItemRecord> results = (from record in _catalog.Search(query)
					where ItemFilterMatcher.Matches(record.Tags, _favorites.IsFavorite(((Object)record.Item).name), _session.SelectedTags, _settings.TagMatchMode)
					select record).ToArray();
				_view.ShowSearchResults(results);
				RefreshStatus();
			}
		}

		public void SetTag(ItemFilterTag tag, bool selected)
		{
			_session.SelectedTags = ItemTagSelection.Update(_session.SelectedTags, tag, selected, _settings.SingleTagSelection);
			_view.SetSelectedTags(_session.SelectedTags);
			ApplySearch(_view.SearchText);
		}

		public void ApplyTagSelectionMode()
		{
			if (_settings.SingleTagSelection)
			{
				ItemFilterTag itemFilterTag = ItemTagSelection.NormalizeSingle(_session.SelectedTags);
				if (itemFilterTag != _session.SelectedTags)
				{
					_session.SelectedTags = itemFilterTag;
					_view.SetSelectedTags(itemFilterTag);
					ApplySearch(_view.SearchText);
				}
			}
		}

		public void ClearTags()
		{
			if (_session.SelectedTags != ItemFilterTag.None)
			{
				_session.SelectedTags = ItemFilterTag.None;
				_view.SetSelectedTags(ItemFilterTag.None);
				ApplySearch(_view.SearchText);
			}
		}

		public void RefreshStatus()
		{
			if (IsRebuilding)
			{
				_view.SetStatus("...", isError: false);
			}
			else if (!_targetController.CanSpawn && _view.VisibleItemCount > 0)
			{
				SetStatus(_targetController.ErrorKey, isError: true);
			}
			else
			{
				SetStatus((_view.VisibleItemCount == 0) ? "noItems" : string.Empty, isError: false);
			}
		}

		private IEnumerator RebuildCatalogIncrementally()
		{
			_view.ClearItems();
			IEnumerator rebuildItems = _catalog.RebuildItemsIncrementally(1.25);
			while (true)
			{
				bool flag;
				try
				{
					flag = rebuildItems.MoveNext();
				}
				catch (Exception arg)
				{
					_logger.LogError((object)$"Failed to rebuild the item catalog: {arg}");
					yield break;
				}
				if (!flag)
				{
					break;
				}
				yield return rebuildItems.Current;
			}
			Stopwatch tileBatch = Stopwatch.StartNew();
			int num = 0;
			for (int index = 0; index < _catalog.Items.Count; index++)
			{
				GameItemRecord captured;
				GameItemRecord gameItemRecord = (captured = _catalog.Items[index]);
				try
				{
					_view.AddItem(gameItemRecord, (UnityAction)delegate
					{
						Spawn(captured);
					}, (UnityAction)delegate
					{
						ToggleFavorite(captured);
					}, _favorites.IsFavorite(((Object)gameItemRecord.Item).name));
				}
				catch (Exception arg2)
				{
					_logger.LogError((object)$"Failed to create the item tile for '{((Object)gameItemRecord.Item).name}': {arg2}");
				}
				num++;
				if (index + 1 < _catalog.Items.Count && (num >= 2 || tileBatch.Elapsed.TotalMilliseconds >= 1.25))
				{
					yield return null;
					tileBatch.Restart();
					num = 0;
				}
			}
			_refresh.Complete(RebuildPhase.Catalog);
		}

		private IEnumerator RebuildSearchIndexIncrementally()
		{
			int providerVersion = SearchAliasRegistry.Version;
			IEnumerator rebuild = _catalog.RebuildSearchIndexIncrementally(1.25);
			while (true)
			{
				bool flag;
				try
				{
					flag = rebuild.MoveNext();
				}
				catch (Exception arg)
				{
					_logger.LogError((object)$"Failed to build the item search index: {arg}");
					yield break;
				}
				if (!flag)
				{
					break;
				}
				yield return rebuild.Current;
			}
			_refresh.Complete(RebuildPhase.SearchIndex);
			_aliasProviderVersion = providerVersion;
		}

		private void CompleteRebuild(bool failed)
		{
			_refresh.Finish();
			_nextRebuildAttempt = (failed ? (Time.unscaledTime + 2f) : 0f);
			_view.SetFavoriteEnabled(!failed);
			if (failed)
			{
				_view.SetStatus("...", isError: true);
			}
		}

		private void ToggleFavorite(GameItemRecord record)
		{
			if (!_favorites.TryToggle(((Object)record.Item).name, out var isFavorite))
			{
				SetStatus("favoriteSaveFailed", isError: true);
				return;
			}
			_view.SetFavorite(record, isFavorite);
			if (!isFavorite && !_settings.ShowAllItems && VanillaItemVisibility.IsDefaultHidden(((Object)record.Item).name))
			{
				RequestRefresh(RefreshRequirement.Catalog);
			}
			else
			{
				ApplySearch(_view.SearchText);
			}
		}

		private void Spawn(GameItemRecord record)
		{
			if (_targetController.TrySpawn(record.Item, out string errorKey))
			{
				SetStatus(string.Empty, isError: false);
			}
			else
			{
				SetStatus(errorKey, isError: true);
			}
		}

		private void SetStatus(string key, bool isError)
		{
			_view.SetStatus(string.IsNullOrEmpty(key) ? string.Empty : _localize(key), isError);
		}
	}
	internal sealed class ItemFavoriteTrigger : MonoBehaviour, IPointerClickHandler, IEventSystemHandler
	{
		private UnityAction? _onFavorite;

		public bool InteractionEnabled { get; set; }

		public void Configure(UnityAction onFavorite)
		{
			_onFavorite = onFavorite;
		}

		public bool TryInvoke()
		{
			if (!InteractionEnabled)
			{
				return false;
			}
			UnityAction? onFavorite = _onFavorite;
			if (onFavorite != null)
			{
				onFavorite.Invoke();
			}
			return _onFavorite != null;
		}

		public void OnPointerClick(PointerEventData eventData)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			if ((int)eventData.button == 1)
			{
				TryInvoke();
			}
		}
	}
	internal sealed class ItemNameTooltip : MonoBehaviour
	{
		private const float ShowDelaySeconds = 0.2f;

		private const float MaxTextWidth = 380f;

		private const float HorizontalPadding = 24f;

		private const float VerticalPadding = 16f;

		private const float PointerOffset = 18f;

		private const float EdgeMargin = 8f;

		private RectTransform _bounds;

		private RectTransform _visual;

		private TextMeshProUGUI _label;

		private object? _owner;

		private RectTransform? _anchor;

		private string _text = string.Empty;

		private Vector2 _screenPosition;

		private float _showAt;

		private bool _visible;

		public void Configure(RectTransform bounds, RectTransform visual, TextMeshProUGUI label)
		{
			_bounds = bounds;
			_visual = visual;
			_label = label;
			((Component)_visual).gameObject.SetActive(false);
		}

		public void Begin(ItemNameTooltipTrigger owner, string text, Vector2 screenPosition)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			_owner = owner;
			_text = text;
			_screenPosition = screenPosition;
			_anchor = null;
			_showAt = Time.unscaledTime + 0.2f;
			_visible = false;
			((Component)_visual).gameObject.SetActive(false);
		}

		public void BeginAnchored(object owner, string text, RectTransform anchor)
		{
			_owner = owner;
			_text = text;
			_anchor = anchor;
			_showAt = Time.unscaledTime + 0.2f;
			_visible = false;
			((Component)_visual).gameObject.SetActive(false);
		}

		public void Move(ItemNameTooltipTrigger owner, Vector2 screenPosition)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			if (_owner == owner)
			{
				_screenPosition = screenPosition;
				if (_visible)
				{
					PositionVisual();
				}
			}
		}

		public void End(ItemNameTooltipTrigger owner)
		{
			if (_owner == owner)
			{
				Hide();
			}
		}

		public void Hide()
		{
			_owner = null;
			_anchor = null;
			_text = string.Empty;
			_visible = false;
			if ((Object)(object)_visual != (Object)null)
			{
				((Component)_visual).gameObject.SetActive(false);
			}
		}

		private void Update()
		{
			if (_owner != null && !_visible && !(Time.unscaledTime < _showAt))
			{
				Show();
			}
		}

		private void Show()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			if (!string.IsNullOrWhiteSpace(_text))
			{
				((TMP_Text)_label).text = _text;
				Vector2 preferredValues = ((TMP_Text)_label).GetPreferredValues(_text, 380f, 0f);
				float num = Mathf.Min(380f, Mathf.Ceil(preferredValues.x));
				preferredValues = ((TMP_Text)_label).GetPreferredValues(_text, num, 0f);
				_visual.sizeDelta = new Vector2(num + 24f, Mathf.Ceil(preferredValues.y) + 16f);
				((Transform)_visual).SetAsLastSibling();
				((Component)_visual).gameObject.SetActive(true);
				_visible = true;
				if ((Object)(object)_anchor != (Object)null)
				{
					PositionAnchoredVisual();
				}
				else
				{
					PositionVisual();
				}
			}
		}

		private void PositionVisual()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = default(Vector2);
			if (RectTransformUtility.ScreenPointToLocalPointInRectangle(_bounds, _screenPosition, (Camera)null, ref val))
			{
				Rect rect = _bounds.rect;
				Vector2 sizeDelta = _visual.sizeDelta;
				float num = val.x + 18f;
				float num2 = val.y - 18f;
				if (num + sizeDelta.x > ((Rect)(ref rect)).xMax - 8f)
				{
					num = val.x - sizeDelta.x - 18f;
				}
				if (num2 - sizeDelta.y < ((Rect)(ref rect)).yMin + 8f)
				{
					num2 = val.y + sizeDelta.y + 18f;
				}
				num = Mathf.Clamp(num, ((Rect)(ref rect)).xMin + 8f, ((Rect)(ref rect)).xMax - sizeDelta.x - 8f);
				num2 = Mathf.Clamp(num2, ((Rect)(ref rect)).yMin + sizeDelta.y + 8f, ((Rect)(ref rect)).yMax - 8f);
				_visual.anchoredPosition = new Vector2(num, num2);
			}
		}

		private void PositionAnchoredVisual()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_anchor == (Object)null))
			{
				Vector3[] array = (Vector3[])(object)new Vector3[4];
				_anchor.GetWorldCorners(array);
				for (int i = 0; i < array.Length; i++)
				{
					array[i] = ((Transform)_bounds).InverseTransformPoint(array[i]);
				}
				Rect rect = _bounds.rect;
				Vector2 sizeDelta = _visual.sizeDelta;
				float x = array[0].x;
				float x2 = array[2].x;
				float y = array[0].y;
				float y2 = array[2].y;
				float num = (x + x2 - sizeDelta.x) * 0.5f;
				float num2 = y2 + 18f + sizeDelta.y;
				if (num2 > ((Rect)(ref rect)).yMax - 8f)
				{
					num2 = y - 18f;
				}
				num = Mathf.Clamp(num, ((Rect)(ref rect)).xMin + 8f, ((Rect)(ref rect)).xMax - sizeDelta.x - 8f);
				num2 = Mathf.Clamp(num2, ((Rect)(ref rect)).yMin + sizeDelta.y + 8f, ((Rect)(ref rect)).yMax - 8f);
				_visual.anchoredPosition = new Vector2(num, num2);
			}
		}

		private void OnDisable()
		{
			Hide();
		}
	}
	internal sealed class ItemNameTooltipTrigger : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerMoveHandler, IPointerExitHandler
	{
		private ItemNameTooltip _tooltip;

		private string _text = string.Empty;

		public void Configure(ItemNameTooltip tooltip, string text)
		{
			_tooltip = tooltip;
			_text = text;
		}

		public void SetText(string text)
		{
			_text = text;
		}

		public void OnPointerEnter(PointerEventData eventData)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			_tooltip.Begin(this, _text, eventData.position);
		}

		public void OnPointerMove(PointerEventData eventData)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			_tooltip.Move(this, eventData.position);
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			_tooltip.End(this);
		}

		private void OnDisable()
		{
			if ((Object)(object)_tooltip != (Object)null)
			{
				_tooltip.End(this);
			}
		}
	}
	internal sealed class ItemSpawnerView
	{
		private readonly TMP_FontAsset _font;

		private readonly CanvasGroup _canvasGroup;

		private readonly TMP_InputField _search;

		private readonly TargetDropdownVisual _targetDropdown;

		private readonly TextMeshProUGUI _title;

		private readonly TextMeshProUGUI _status;

		private readonly RectTransform _itemContent;

		private readonly Button _close;

		private readonly Button _searchClear;

		private readonly ActionButtonVisual _tagClear;

		private readonly ItemNameTooltipTrigger _tagClearTooltip;

		private readonly ItemNameTooltip _tooltip;

		private readonly IReadOnlyList<TagToggle> _tagToggles;

		private readonly ScrollRect _itemScroll;

		private readonly List<ItemTile> _tiles = new List<ItemTile>();

		private readonly List<ItemTile> _visibleTiles = new List<ItemTile>();

		private readonly Dictionary<GameItemRecord, ItemTile> _tileByRecord = new Dictionary<GameItemRecord, ItemTile>();

		private bool? _spawnEnabled;

		private int _visibleItemCount;

		public GameObject Root { get; }

		public Selectable SearchSelectable => (Selectable)(object)_search;

		public string SearchText => _search.text;

		public int VisibleItemCount => _visibleItemCount;

		internal TargetDropdownVisual TargetDropdown => _targetDropdown;

		internal IReadOnlyList<TagToggle> TagToggles => _tagToggles;

		internal ActionButtonVisual TagClear => _tagClear;

		internal ScrollRect ItemScroll => _itemScroll;

		internal RectTransform ItemContent => _itemContent;

		internal IReadOnlyList<ItemTile> VisibleTiles => _visibleTiles;

		private ItemSpawnerView(GameObject root, TMP_FontAsset font, CanvasGroup canvasGroup, TextMeshProUGUI title, TMP_InputField search, TargetDropdownVisual targetDropdown, TextMeshProUGUI status, RectTransform itemContent, Button close, Button searchClear, ActionButtonVisual tagClear, ItemNameTooltipTrigger tagClearTooltip, ItemNameTooltip tooltip, IReadOnlyList<TagToggle> tagToggles, ScrollRect itemScroll)
		{
			Root = root;
			_font = font;
			_canvasGroup = canvasGroup;
			_title = title;
			_search = search;
			_targetDropdown = targetDropdown;
			_status = status;
			_itemContent = itemContent;
			_close = close;
			_searchClear = searchClear;
			_tagClear = tagClear;
			_tagClearTooltip = tagClearTooltip;
			_tooltip = tooltip;
			_tagToggles = tagToggles;
			_itemScroll = itemScroll;
		}

		internal void ShowControllerTooltip(ItemTile tile)
		{
			_tooltip.BeginAnchored(tile, tile.Record.DisplayName, tile.RectTransform);
		}

		internal void HideTooltip()
		{
			_tooltip.Hide();
		}

		public static ItemSpawnerView Create()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ItemSpawnerEnhancedUI", new Type[5]
			{
				typeof(RectTransform),
				typeof(Canvas),
				typeof(CanvasScaler),
				typeof(CanvasGroup),
				typeof(GraphicRaycaster)
			});
			try
			{
				RectTransform component = val.GetComponent<RectTransform>();
				RuntimeUiFactory.Stretch(component);
				Canvas component2 = val.GetComponent<Canvas>();
				component2.renderMode = (RenderMode)0;
				component2.sortingOrder = 250;
				CanvasScaler component3 = val.GetComponent<CanvasScaler>();
				component3.uiScaleMode = (ScaleMode)1;
				component3.referenceResolution = new Vector2(1920f, 1080f);
				component3.screenMatchMode = (ScreenMatchMode)0;
				component3.matchWidthOrHeight = 0.5f;
				ItemSpawnerViewReferences itemSpawnerViewReferences = ItemSpawnerViewBuilder.Build(component);
				return new ItemSpawnerView(val, itemSpawnerViewReferences.Font, val.GetComponent<CanvasGroup>(), itemSpawnerViewReferences.Title, itemSpawnerViewReferences.Search, itemSpawnerViewReferences.TargetDropdown, itemSpawnerViewReferences.Status, itemSpawnerViewReferences.ItemContent, itemSpawnerViewReferences.Close, itemSpawnerViewReferences.SearchClear, itemSpawnerViewReferences.TagClear, itemSpawnerViewReferences.TagClearTooltip, itemSpawnerViewReferences.Tooltip, itemSpawnerViewReferences.TagToggles, itemSpawnerViewReferences.ItemScroll);
			}
			catch
			{
				val.SetActive(false);
				Object.Destroy((Object)(object)val);
				throw;
			}
		}

		public void Bind(UnityAction close, UnityAction<string> searchChanged, UnityAction<int> targetChanged, Action<ItemFilterTag, bool> tagChanged, UnityAction clearTags)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			((UnityEvent)_close.onClick).AddListener(close);
			((UnityEvent<string>)(object)_search.onValueChanged).AddListener((UnityAction<string>)delegate(string query)
			{
				UpdateSearchClearButton();
				searchChanged.Invoke(query);
			});
			((UnityEvent)_searchClear.onClick).AddListener((UnityAction)delegate
			{
				_search.SetTextWithoutNotify(string.Empty);
				UpdateSearchClearButton();
				searchChanged.Invoke(string.Empty);
				_search.ActivateInputField();
			});
			((UnityEvent)_tagClear.Button.onClick).AddListener((UnityAction)delegate
			{
				_tooltip.Hide();
				clearTags.Invoke();
			});
			((UnityEvent<int>)(object)_targetDropdown.Dropdown.onValueChanged).AddListener(targetChanged);
			foreach (TagToggle tagToggle in _tagToggles)
			{
				TagToggle captured = tagToggle;
				((UnityEvent<bool>)(object)captured.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool selected)
				{
					captured.SetActive(selected);
					tagChanged(captured.Tag, selected);
					UpdateTagClearButton();
				});
			}
		}

		public void SetLocalizedChrome(string title, string searchPlaceholder, string clearTagsTooltip, Func<ItemFilterTag, string> tagLabel)
		{
			((TMP_Text)_title).text = title;
			Graphic placeholder = _search.placeholder;
			TMP_Text val = (TMP_Text)(object)((placeholder is TMP_Text) ? placeholder : null);
			if (val != null)
			{
				val.text = searchPlaceholder;
			}
			_tagClearTooltip.SetText(clearTagsTooltip);
			foreach (TagToggle tagToggle in _tagToggles)
			{
				string text = tagLabel(tagToggle.Tag);
				tagToggle.Label.text = text;
			}
		}

		public void ActivateSearch()
		{
			_search.ActivateInputField();
		}

		public void DeactivateSearch()
		{
			_search.DeactivateInputField(false);
		}

		public void SetVisible(bool visible)
		{
			_canvasGroup.alpha = (visible ? 1 : 0);
			_canvasGroup.interactable = visible;
			_canvasGroup.blocksRaycasts = visible;
		}

		public void ClearItems()
		{
			_tooltip.Hide();
			foreach (ItemTile tile in _tiles)
			{
				tile.GameObject.SetActive(false);
				Object.Destroy((Object)(object)tile.GameObject);
			}
			_tiles.Clear();
			_visibleTiles.Clear();
			_tileByRecord.Clear();
			_visibleItemCount = 0;
			_spawnEnabled = null;
		}

		public void AddItem(GameItemRecord record, UnityAction spawn, UnityAction toggleFavorite, bool isFavorite)
		{
			ItemTile itemTile = ItemBrowserControlFactory.CreateItemTile((Transform)(object)_itemContent, _font, record, spawn, toggleFavorite, isFavorite, _tooltip);
			itemTile.SetSpawnEnabled(enabled: false);
			_tiles.Add(itemTile);
			_visibleTiles.Add(itemTile);
			_tileByRecord.Add(record, itemTile);
			_visibleItemCount++;
		}

		public void SetFavorite(GameItemRecord record, bool isFavorite)
		{
			if (_tileByRecord.TryGetValue(record, out ItemTile value))
			{
				value.SetFavorite(isFavorite);
			}
		}

		public void SetFavoriteEnabled(bool enabled)
		{
			foreach (ItemTile tile in _tiles)
			{
				tile.FavoriteTrigger.InteractionEnabled = enabled;
			}
		}

		public void SetSelectedTags(ItemFilterTag selectedTags)
		{
			foreach (TagToggle tagToggle in _tagToggles)
			{
				bool flag = (selectedTags & tagToggle.Tag) != 0;
				tagToggle.Toggle.SetIsOnWithoutNotify(flag);
				tagToggle.SetActive(flag);
			}
			UpdateTagClearButton();
		}

		private void UpdateSearchClearButton()
		{
			((Component)_searchClear).gameObject.SetActive(!string.IsNullOrEmpty(_search.text));
		}

		private void UpdateTagClearButton()
		{
			bool enabled = _tagToggles.Any((TagToggle tagToggle) => tagToggle.Toggle.isOn);
			_tagClear.SetEnabled(enabled);
		}

		public void ShowSearchResults(IReadOnlyList<GameItemRecord> results)
		{
			_tooltip.Hide();
			HashSet<GameItemRecord> hashSet = new HashSet<GameItemRecord>(results);
			foreach (ItemTile tile in _tiles)
			{
				bool flag = hashSet.Contains(tile.Record);
				if (tile.GameObject.activeSelf != flag)
				{
					tile.GameObject.SetActive(flag);
				}
			}
			int num = 0;
			_visibleTiles.Clear();
			for (int i = 0; i < results.Count; i++)
			{
				if (_tileByRecord.TryGetValue(results[i], out ItemTile value))
				{
					if (value.GameObject.transform.GetSiblingIndex() != i)
					{
						value.GameObject.transform.SetSiblingIndex(i);
					}
					_visibleTiles.Add(value);
					num++;
				}
			}
			_visibleItemCount = num;
		}

		public void SetTargets(IReadOnlyList<string> labels, int selectedIndex)
		{
			TMP_Dropdown dropdown = _targetDropdown.Dropdown;
			dropdown.ClearOptions();
			dropdown.AddOptions(((IEnumerable<string>)labels).Select((Func<string, OptionData>)((string label) => new OptionData(label))).ToList());
			dropdown.SetValueWithoutNotify(Math.Max(0, selectedIndex));
			dropdown.RefreshShownValue();
			_targetDropdown.SetEnabled(labels.Count > 0);
		}

		public void SetSpawnEnabled(bool enabled, bool force = false)
		{
			if (!force && _spawnEnabled == enabled)
			{
				return;
			}
			_spawnEnabled = enabled;
			foreach (ItemTile tile in _tiles)
			{
				tile.SetSpawnEnabled(enabled);
			}
		}

		public void SetStatus(string text, bool isError)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			((TMP_Text)_status).text = text;
			((Graphic)_status).color = (isError ? RuntimeUiFactory.Error : RuntimeUiFactory.TextMuted);
		}
	}
	internal static class ItemSpawnerViewBuilder
	{
		public static ItemSpawnerViewReferences Build(RectTransform root)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Unknown result type (might be due to invalid IL or missing references)
			//IL_040f: Expected O, but got Unknown
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: Unknown result type (might be due to invalid IL or missing references)
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_0491: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_051f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_0551: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			//IL_057a: Unknown result type (might be due to invalid IL or missing references)
			TMP_FontAsset font = ResolveFont();
			RectTransform obj = RuntimeUiFactory.CreateRect("Dim", (Transform)(object)root, typeof(Image));
			RuntimeUiFactory.Stretch(obj);
			((Graphic)((Component)obj).G