xiaomianao666

小程序:歌词适配

Dec 11th, 2023
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@歌词适配@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5q2M6K+N6YCC6YWNIiwiYXV0aG9yIjoiVGhvbWFz5ZayIiwidXJsIjoiaGlrZXI6Ly9lbXB0eT9wPWZ5cGFnZSIsInZlcnNpb24iOjIwMjMxMTA2LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6Im11c2ljIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nLCB7fSkpLnJ1bGUpO1xuZCA9IFtdO1xuaVRhZyA9IHN0b3JhZ2UwLmdldE15VmFyKHBsYXRmb3JtICsgXCJfaVRhZ1wiKTtcbmlmIChpVGFnID09IFwiXCIpXG4gICAgaVRhZyA9IHt9LFxuICAgICQucmVxdWlyZShwbGF0Zm9ybSArICc/cnVsZT3mrYzor43pgILphY0nKS5pVGFnKCk7XG50aWQgPSBnZXRNeVZhcigndGlkJywgJ+aOqOiNkCcpO1xudHJyID0gT2JqZWN0LmtleXMoaVRhZ1t0aWRdKTtcbnRpaSA9IGdldE15VmFyKCd0aWknLCAnMCcpO1xuaWYgKE1ZX1BBR0UgPT0gMSkge1xuICAgIE9iamVjdC5rZXlzKGlUYWcpLm1hcCgobmFtZSwgaWkpID0+IHtcbiAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiB0aWQgPT0gbmFtZSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWQpID0+IHtcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigndGlkJywgdGlkKTtcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWknKTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcbiAgICAgICAgICAgIH0sIG5hbWUpLFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xuICAgICAgICB9KTtcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXG4gICAgfSwge1xuICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXG4gICAgfSk7XG4gICAgZC5wdXNoKHtcbiAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cImNvbG9yOiNmZjY2MDFcIj48Yj7liIfmjaLmjqXlj6M8L2I+PC9zcGFuPicsXG4gICAgICAgIHVybDogJChwbGF0Zm9ybXMuc2xpY2UoMCwgOCkubWFwKHRpdGxlID0+IHtcbiAgICAgICAgICAgIGlmICh0aXRsZSA9PSBwbGF0Zm9ybSlcbiAgICAgICAgICAgICAgICB0aXRsZSA9IFJpY2goU3Ryb25nKENvbG9yKHRpdGxlKSkpO1xuICAgICAgICAgICAgcmV0dXJuIHRpdGxlXG4gICAgICAgIH0pLCAyLCAn6YCJ5oup5o6l5Y+j5bmz5Y+wJykuc2VsZWN0KCgpID0+IHtcbiAgICAgICAgICAgIGlmICghaW5wdXQubWF0Y2goL17igJjigJjigJnigJkvKSkge1xuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdwbGF0Zm9ybScsIGlucHV0KTtcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKC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gICAgIHRpdGxlOiAn8J+UjScsXG4gICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDliIbkuqvpk77mjqUnLFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKHNfcGxhdGZvcm0pID0+IHtcbiAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkpIHtcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc19wbGF0Zm9ybScsIHNfcGxhdGZvcm0pO1xuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywgaW5wdXQpO1xuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDMnKTtcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3Q0Jyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFwiaGlrZXI6Ly9wYWdlL3NlYXJjaCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cD1meXBhZ2UmcnVsZT3mrYzor43pgILphY1cIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/msqHmnInmkJzntKLlhbPplK7or41+JztcbiAgICAgICAgfSwgcGxhdGZvcm0pLFxuICAgICAgICBjb2xfdHlwZTogXCJpbnB1dFwiLFxuICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgaWQ6IGlkICsgXCI6c2VhcmNoMVwiLFxuICAgICAgICAgICAgcGFnZVRpdGxlOiBcIumrmOe6p+aQnOe0olwiLFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihcInNfdDJcIiksXG4gICAgICAgICAgICBvbkNoYW5nZTogXCJwdXRNeVZhcignc190MicsIGlucHV0KVwiXG4gICAgICAgIH1cbiAgICB9KTtcblxuICAgIGQucHVzaCh7XG4gICAgICAgIHRpdGxlOiAn5oiR55qE5pS26JePJyxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9jb2xsZWN0aW9uP3J1bGU95q2M6K+N6YCC6YWNJyxcbiAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjEnLFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXG4gICAgfSwge1xuICAgICAgICB0aXRsZTogJ+WOhuWPsuiusOW9lScsXG4gICAgICAgIHVybDogJ2hpa2VyOi8vaGlzdG9yeT9ydWxlPeatjOivjemAgumFjScsXG4gICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb24zJyxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xuICAgIH0sIHtcbiAgICAgICAgdGl0bGU6ICfpq5jnuqfmkJzntKInLFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xuICAgICAgICAgICAgY2xlYXJNeVZhcignc19wbGF0Zm9ybScpO1xuICAgICAgICAgICAgY2xlYXJNeVZhcignc190MycpO1xuICAgICAgICAgICAgY2xlYXJNeVZhcignc190NCcpO1xuICAgICAgICAgICAgcmV0dXJuIFwiaGlrZXI6Ly9wYWdlL3NlYXJjaCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cD1meXBhZ2UmcnVsZT3mrYzor43pgILphY1cIjtcbiAgICAgICAgfSksXG4gICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb24yJyxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xuICAgIH0pO1xuICAgIGQucHVzaCh7XG4gICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxiPjxmb250IGNvbG9yPSNmZjY2MDE+JyArIHRpZCArICc8L2ZvbnQ+PC9iPicsXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxuICAgICAgICBle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YWRlcnMgPSB7XFxuICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUEsXFxuICAgICAgICAgICAgXFxcIkNvbm5lY3Rpb25cXFwiOiBcXFwiS2VlcC1BbGl2ZVxcXCIsXFxuICAgICAgICAgICAgXFxcIkFjY2VwdC1FbmNvZGluZ1xcXCI6IFxcXCJnemlwXFxcIlxcbiAgICAgICAgfVxcblxcblxcblxcbiAgICAgICAgLyog6K+35rGCYm9keSAgICAgIHN0cui9rGJ5dGUgIOWGjXppcOWOi+e8qVxcblxcbiAgICAgICAgemxpYi5jb21wcmVzcyhoZXgpO1xcblxcbiAgICAgICAgYkFyciA9IGhleC5nZXRCeXRlcygpO1xcbiAgICAgICAgZnVuY3Rpb24gYihiQXJyKSB7Ly8g5Y6L57ypXFxuICAgICAgICAgICAgICAgIGRlZmxhdGVyID0gbmV3IERlZmxhdGVyKCk7XFxuICAgICAgICAgICAgICAgIGRlZmxhdGVyLnJlc2V0KCk7XFxuICAgICAgICAgICAgICAgIGRlZmxhdGVyLnNldElucHV0KGJBcnIpO1xcbiAgICAgICAgICAgICAgICBkZWZsYXRlci5maW5pc2goKTtcXG4gICAgICAgICAgICAgICAgYnl0ZUFycmF5T3V0cHV0U3RyZWFtID0gbmV3IEJ5dGVBcnJheU91dHB1dFN0cmVhbShiQXJyLmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQgPSBcXFwiZXhhbXBsZSBzdHJpbmdcXFwiO1xcbiAgICAgICAgYkFycjIgPSBBcnJheXMuY29weU9mKFN0cmluZyh0ZXh0KS5nZXRCeXRlcygpLCAxMDI0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCFkZWZsYXRlci5maW5pc2hlZCgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQXJyYXlPdXRwdXRTdHJlYW0ud3JpdGUoYkFycjIsIDAsIGRlZmxhdGVyLmRlZmxhdGUoYkFycjIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiQXJyMyA9IGJ5dGVBcnJheU91dHB1dFN0cmVhbS50b0J5dGVBcnJheSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQXJyYXlPdXRwdXRTdHJlYW0uY2xvc2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheU91dHB1dFN0cmVhbS5jbG9zZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUyKSB7fVxcbiAgICAgICAgICAgICAgICBkZWZsYXRlci5lbmQoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGJBcnIzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICovXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICAvKuivt+axguWQjjog6L+U5Zue5YaF5a656Kej5Y6LXFxuXFxuXFxuICAgICAgICByZXMgPSB6bGliLmRlY29tcHJlc3MocmVzLmNvbnRlbnQpLmRlY29kZShcXFwidXRmLThcXFwiKTtcXG5cXG5cXG4gICAgICAgIGZ1bmN0aW9uIEIoYkFycjMpIHsvLyDop6PljotcXG4gICAgICAgICAgICAgICAgaW5mbGF0ZXIgPSBuZXcgSW5mbGF0ZXIoKTtcXG4gICAgICAgICAgICAgICAgaW5mbGF0ZXIuc2V0SW5wdXQoYkFycjMpO1xcbiAgICAgICAgICAgICAgICBieXRlQXJyYXlPdXRwdXRTdHJlYW0gPSBuZXcgQnl0ZUFycmF5T3V0cHV0U3RyZWFtKGJBcnIzLmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQgPSBcXFwiZXhhbXBsZSBzdHJpbmdcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJBcnIyID0gQXJyYXlzLmNvcHlPZihTdHJpbmcodGV4dCkuZ2V0Qnl0ZXMoKSwgMTAyNCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCFpbmZsYXRlci5maW5pc2hlZCgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheU91dHB1dFN0cmVhbS53cml0ZShiQXJyMiwgMCwgaW5mbGF0ZXIuaW5mbGF0ZShiQXJyMikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBiQXJyID0gYnl0ZUFycmF5T3V0cHV0U3RyZWFtLnRvQnl0ZUFycmF5KCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5T3V0cHV0U3RyZWFtLmNsb3NlKCk7XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5T3V0cHV0U3RyZWFtLmNsb3NlKCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUyKSB7fVxcbiAgICAgICAgICAgICAgICBpbmZsYXRlci5lbmQoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGJBcnI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgKi9cXG5cXG5cXG5cXG4gICAgICAgIGZ1bmN0aW9uIHN0clRvQnl0ZXMoc3RyKSB7XFxuICAgICAgICAgICAgY29uc3QgdWludDhBcnJheSA9IG5ldyBVaW50OEFycmF5KHN0ci5sZW5ndGgpO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc3RyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIHVpbnQ4QXJyYXlbaV0gPSBzdHIuY2hhckNvZGVBdChpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHVpbnQ4QXJyYXk7XFxuICAgICAgICB9O1xcblxcbiAgICAgICAgZnVuY3Rpb24gYnl0ZXNUb1N0cih1aW50OEFycmF5KSB7XFxuICAgICAgICAgICAgbGV0IHN0ciA9ICcnO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdWludDhBcnJheS5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBzdHIgKz0gU3RyaW5nLmZyb21DaGFyQ29kZSh1aW50OEFycmF5W2ldKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHN0cjtcXG4gICAgICAgIH07XFxuICAgICAgICByYW5nZSA9IHQgPT4gQXJyYXkuZnJvbShuZXcgQXJyYXkodCkua2V5cygpKTtcXG4gICAgICAgIExvbmcgPSB0ID0+IHtcXG4gICAgICAgICAgICBjb25zdCByID0gQmlnSW50KHQpO1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIHRvU3RyaW5nOiAoKSA9PiByLnRvU3RyaW5nKCksXFxuICAgICAgICAgICAgICAgIGlzTmVnYXRpdmU6ICgpID0+IHIgPCAwLFxcbiAgICAgICAgICAgICAgICBub3Q6ICgpID0+IExvbmcofnIpLFxcbiAgICAgICAgICAgICAgICBsb3c6IE51bWJlcihyKSxcXG4gICAgICAgICAgICAgICAgb3I6IHQgPT4gTG9uZyhyIHwgQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgeG9yOiB0ID0+IExvbmcociBeIEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgIGFuZDogdCA9PiBMb25nKHIgJiBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICBlcXVhb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FxzKj4vZ2ksICdcXFxcbicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFxyL2csICdcXFxccicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFxmL2csICdcXFxcZicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFx0L2csICdcXFxcdCcpXFxuICAgICAgICAucmVwbGFjZSgvJihsdHxndHxuYnNwfGFtcHxxdW90KTsvZ2ksICgkMCwgJDEpID0+ICh7XFxuICAgICAgICAgICAgJ2x0JzogJzwnLFxcbiAgICAgICAgICAgICdndCc6ICc+JyxcXG4gICAgICAgICAgICAnbmJzcCc6ICcgJyxcXG4gICAgICAgICAgICAnYW1wJzogJyYnLFxcbiAgICAgICAgICAgICdxdW90JzogJ1xcXCInXFxuICAgICAgICB9WyQxLnRvTG93ZXJDYXNlKCldKSlcXG4gICAgICAgIC5yZXBsYWNlKC88XFxcXC8/ZW1bXj5dKj4vZ2ksICcnKTtcXG59XFxuY29uc3QgUiA9IHggPT4ge1xcbiAgICB0ID0gXFxcIlxcXCI7XFxuICAgIGZvciAoaSA9IDA7IGkgPCB4OyBpKyspIHQgKz0gXFxcIjEyMzQ1Njc4OTBhYmNkZWZcXFwiIFtNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiAxNildO1xcbiAgICByZXR1cm4gdFxcbn1cXG5jb25zdCBTaXplID0gc2l6ZSA9PiB7XFxuICAgIGlmICghc2l6ZSkgcmV0dXJuICcnO1xcbiAgICB1bml0cyA9IFsnQicsICdLQicsICdNQicsICdHQicsICdUQicsICdQQicsICdFQicsICdaQicsICdZQiddO1xcbiAgICBsZXQgaSA9IDA7XFxuICAgIHdoaWxlIChzaXplID49IDEwMjQpIHtcXG4gICAgICAgIHNpemUgLz0gMTAyNDtcXG4gICAgICAgIGkrKztcXG4gICAgfVxcbiAgICBzaXplID0gaSA/IHNpemUudG9GaXhlZCgyKSA6IHNpemU7XFxuICAgIHJldHVybiBgJHtzaXplfSAke3VuaXRzW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0vZ2ksICc0ODAnKTtcXG4gICAgICAgIF8uY29udGVudCA9IF8uY29udGVudCArICcnO1xcbiAgICAgICAgXy56eWlkID0gXy56eWlkICsgJyc7XFxuICAgICAgICBpZiAoIV8uZGVzYykgXy5kZXNjID0gdGhpc19wbGF0Zm9ybTtcXG4gICAgICAgIF8uY29sX3R5cGUgPSAnY2FyZF9waWNfMyc7XFxuICAgIH1cXG4gICAgdDEgPSBOdW1iZXIoXy5jb250ZW50LnJlcGxhY2UoL14oXFxcXGQ/XFxcXEQpKyQvLCAnMCcpKSA8IDIgPyAwIDogMTtcXG4gICAgXy5leHRyYSA9IHtcXG4gICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICBjbHM6IGlkICsgJzphZGRsaXN0JyxcXG4gICAgICAgIGxvbmdDbGljazogW1xcbiAgICAgICAgICAgIC8qe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4piFIOWIhuS6q+mTvuaOpSDimIVcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChhLCBiLCBjKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLmNvcHl1cmwoYSwgYiwgYyk7XFxuICAgICAgICAgICAgfSwgXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZClcXG4gICAgICAgIH0sICovXFxuICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDmlLbol49cXFwiICsgKHQxID8gJ+atjOWNlScgOiAn5Y2V5puyJykgKyBcXFwiIOKYhVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0MSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikubG9nRGF0YShfLCB0MSk7XFxuICAgICAgICAgICAgICAgIH0sIHQxLCBfKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvKiwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDmibnph4/mlLbol48g4piFXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh0MSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImFkZGxpc3Q/cnVsZT10Z3jpn7PkuZBcXFwiKSh0MSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICB9LCB0MSk7XFxuICAgICAgICAgICAgICAgIH0sIHQxKVxcbiAgICAgICAgICAgIH0qL1xcbiAgICAgICAgXVxcbiAgICB9O1xcbiAgICBpZiAocjMpIHtcXG4gICAgICAgIF8udXJsID0gcjM7XFxuICAgICAgICBfLmV4dHJhLmxvbmdDbGljay51bnNoaWZ0KHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDkuIvovb3mrYzmm7Ig4piFXFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygobmFtZXMsIHVybHMpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQobmFtZXMsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKG5hbWVzLCB1cmxzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpID0gbmFtZXMuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybHNbaV07XFxuICAgICAgICAgICAgICAgIH0sIG5hbWVzLCB1cmxzKTtcXG4gICAgICAgICAgICB9LCByMy5uYW1lcywgcjMudXJscylcXG4gICAgICAgIH0pO1xcbi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XFxcIumAieaLqee7hFxcXCIpLnNlbGVjdCgoenksIHp1LCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5paw57uEXFxcIikge1xcbiAgICAgICAgICAgICAgICBpZiAoIXp1LmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXmlrDnu4TlkI3np7BcXFwiKS5pbnB1dCgoenksIHp1LCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkubWF0Y2goL15cXFxcZCt8XlxcXFxzKijmlrDnu4QpP1xcXFxzKiQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+e7hOWQjeS4jeiDveS4uuepuiAmIOacgOWJjemdouS4jeiDveaYr+aVsOWtlyAmIOS5n+S4jeiDveWPq+aWsOe7hFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMywgJ+ivt+mAieaLqeaWsOe7hOS9jee9ricpLnNlbGVjdCgoenksIGlucHV0MiwgbmV3RGF0YXMsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0RhdGEgPSBBcnJheS5pc0FycmF5KG5ld0RhdGFzKSA/IG5ld0RhdGFzIDogW25ld0RhdGFzXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmnIDlkI7pnaJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpbnB1dDJdID0gbmV3RGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSBpbiB6eSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baW5wdXQyXSA9IG5ld0RhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShuZXdEYXRhcykpIGJhY2sodHJ1ZSksIHRvYXN0KCfmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHp5LCBpbnB1dCwgbmV3RGF0YSwgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgenksIHp1LCBuZXdEYXRhLCBzaSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5YiG57uE5ZCN56ew6YeN5aSN5LqGflxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgenkgPSB6eVtpbnB1dF07XFxuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobmV3RGF0YSkpIHtcXG4gICAgICAgICAgICAgICAgenkgPSB6eS5jb25jYXQobmV3RGF0YSk7XFxuICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KCfmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGlucHV0KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgenUgPSB6eS5tYXAoaXQgPT4gaXQudGl0bGUpO1xcbiAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHp5LCB6dSwgaW5wdXQyLCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuacgOWQjumdolxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHp5LnB1c2gobmV3RGF0YSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMCwgbmV3RGF0YSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGlucHV0Mik7XFxuICAgICAgICAgICAgfSwgenksIHp1LCBpbnB1dCwgbmV3RGF0YSwgc2kpO1xcbiAgICAgICAgfSwgenksIHp1LCBuZXdEYXRhLCBzaSk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNldERhdGE6IGZ1bmN0aW9uKHNpLCB6eTIsIGtleSkge1xcbiAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgaWYgKGtleSkge1xcbiAgICAgICAgICAgIHp5W2tleV0gPSB6eTI7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHp5ID0genkyO1xcbiAgICAgICAgfVxcbiAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2ksIHp5KTtcXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/miJDlip9cXFwiO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBjb3B5dXJsOiBmdW5jdGlvbihzaSwgenlpZCkge1xcbiAgICAgICAgY3VybCA9IFxcXCJodHRwczovL3d3dy5rdXdvLmNuL1xcXCJcXG4gICAgICAgIGlmIChTdHJpbmcoenlpZCkudHJpbSgpLm1hdGNoKC9eXFxcXGQrJC8pKSB7XFxuICAgICAgICAgICAgaWYgKHNpID09ICcxJylcXG4gICAgICAgICAgICAgICAgY3VybCArPSBcXFwicGxheV9kZXRhaWwvXFxcIjtcXG4gICAgICAgICAgICBlbHNlIGlmIChzaSA9PSAyKVxcbiAgICAgICAgICAgICAgICBjdXJsICs9IFxcXCJhbGJ1bV9kZXRhaWwvXFxcIjtcXG4gICAgICAgICAgICBlbHNlIGlmIChzaSA9PSAzKVxcbiAgICAgICAgICAgICAgICBjdXJsICs9IFxcXCJtdnBsYXkvXFxcIjtcXG4gICAgICAgICAgICBlbHNlIGlmIChzaSA9PSA0KVxcbiAgICAgICAgICAgICAgICBjdXJsICs9IFxcXCJwbGF5bGlzdF9kZXRhaWwvXFxcIjtcXG4gICAgICAgICAgICBlbHNlIGlmIChzaSA9PSA1KVxcbiAgICAgICAgICAgICAgICBjdXJsICs9IFxcXCJzaW5nZXJfZGV0YWlsL1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgY3VybCArIHp5aWQ7XFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJ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gICAgICAgIHRpdGxlOiBfLnRpdGxlLFxcbiAgICAgICAgICAgICAgICBpbWc6IF8uaGVhZFBpY1VybCB8fCBfLmZyb250UGljVXJsLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICB6eWlkOiBfLnRvcElkXFxuICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicXFfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyLCBpc3VybCkge1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhSAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vdS55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2dcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHsgLy8g5LiL6L29XFxuICAgICAgICAgICAgICAgICAgICB2YXIgYm9keSA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21tOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0OiAnMTknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdjogJzE4NTknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlOiAnbXVzaWMucGZfc29uZ19kZXRhaWxfc3ZyJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnZ2V0X3NvbmdfZGV0YWlsX3lxcScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb25nX21pZDogdDFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHUsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICB9KS5yZXEuZGF0YS50cmFja19pbmZvO1xcbiAgICAgICAgICAgICAgICAgICAgZiA9IF8uZmlsZTtcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV8xMjhtcDMgIT0gMClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSArIFNpemUoZi5zaXplXzEyOG1wMykpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV8zMjBtcDMgIT0gMClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUoZi5zaXplXzMyMG1wMykpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV9mbGFjICE9IDApXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10gKyBTaXplKGYuc2l6ZV9mbGFjKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5zaXplX2hpcmVzICE9IDApXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbNF0gKyBTaXplKGYuc2l6ZV9oaXJlcykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh0cywgdDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v55uu5YmN5Y+q5pSv5oyB6K+V5ZCsflxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIGluIHRzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC5tYXRjaCh0c1tpXSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQyID0gW1xcXCJtcDNcXFwiLCBcXFwiaHFcXFwiLCBcXFwic3FcXFwiLCBcXFwiaHJcXFwiXVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcImdjc3A/cnVsZT3mrYzor43pgILphY1cXFwiKS5sYXp5KFxcXCJxcVxcXCIsIHQxLCB0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB0cy5zbGljZSgxLCA1KSwgdDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHUgKz0gYD9kYXRhPXtcXFwicmVxXzBcXFwiOntcXFwibW9kdWxlXFxcIjpcXFwidmtleS5HZXRWa2V5U2VydmVyXFxcIixcXFwibWV0aG9kXFxcIjpcXFwiQ2dpR2V0VmtleVxcXCIsXFxcInBhcmFtXFxcIjp7XFxcImd1aWRcXFwiOlxcXCIwXFxcIixcXFwicGxhdGZvcm1cXFwiOlxcXCIyMFxcXCIsXFxcImZpbGVuYW1lXFxcIjpbXFxcIk01MDAke3QxK3QxfS5tcDNcXFwiXSxcXFwic29uZ21pZFxcXCI6W1xcXCIke3QxfVxcXCJdfX19YDtcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHUpLnJlcV8wLmRhdGE7XFxuXFxuXFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICBpZiAoKHUgPSBfLm1pZHVybGluZm9bMF0ucHVybCkgJiYgdSAhPSBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IF8uc2lwWzBdICsgdTtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gJC5yZXF1aXJlKFxcXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImh0dHBzOi8vYXBpcy5qeGN4aW4uY24vYXBpL3FxbXVzaWM/dXJsPWh0dHBzOi8veS5xcS5jb20vbi9yeXFxL3NvbmdEZXRhaWwvXFxcIiArIHQxKS51cmw7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbHJjID0gJC5yZXF1aXJlKFxcXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImh0dHA6Ly9jLnkucXEuY29tL2x5cmljL2ZjZ2ktYmluL2ZjZ19xdWVyeV9seXJpY19uZXcuZmNnP2Zvcm1hdD1qc29uJnNvbmdtaWQ9XFxcIiArIHQxKS5seXJpYztcXG4gICAgICAgICAgICAgICAgICAgIGxyYyA9IGJhc2U2NERlY29kZShscmMpO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6Ly9jLnkucXEuY29tL3NwbGNsb3VkL2ZjZ2ktYmluL2ZjZ19nZXRfZGlzc19ieV90YWcuZmNnP2Zvcm1hdD1qc29uJmNhdGVnb3J5SWQ9XFxcIiArIHQxICsgXFxcIiZzaW49XFxcIiArICgoTVlfUEFHRSAtIDEpICogMzApICsgXFxcIiZlaW49XFxcIiArICgoTVlfUEFHRSAqIDMwKSAtIDEpO1xcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ3FxP3J1bGU95q2M6K+N6YCC6YWNJykuYWpheCh1cmwpLmRhdGEubGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5kaXNzbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWd1cmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImh0dHA6Ly9jLnkucXEuY29tL3F6b25lL2ZjZy1iaW4vZmNnX3VjY19nZXRjZGluZm9fYnlpZHNfY3AuZmNnP2Zvcm1hdD1qc29uJnR5cGU9MSZkaXNzdGlkPVxcXCIgKyB0MS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Jlc3VsdChkKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgaXNVKSB7XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgX18gPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogKF8pID0+IHRydWUsXFxuICAgICAgICAgICAgICAgIHBhaWQ6IChfKSA9PiBfLnBheS5wYXlfcGxheSA9PSAnMScsXFxuICAgICAgICAgICAgICAgIGZyZWU6IChfKSA9PiBfLnBheS5wYXlfcGxheSA9PSAnMCdcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3VybCA9IChzdHlwZSkgPT4gJC5yZXF1aXJlKFxcXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImh0dHA6Ly91Ni55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2dcXFwiLCB7XFxuICAgICAgICAgICAgICAgIFxcXCJib2R5XFxcIjogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlcVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibW9kdWxlXFxcIjogXFxcIm11c2ljLnNlYXJjaC5TZWFyY2hDZ2lTZXJ2aWNlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIkRvU2VhcmNoRm9yUVFNdXNpY0xpdGVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInF1ZXJ5XFxcIjoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF90eXBlXFxcIjogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJudW1fcGVyX3BhZ2VcXFwiOiAzMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhZ2VfbnVtXFxcIjogTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIFxcXCJtZXRob2RcXFwiOiBcXFwiUE9TVFxcXCJcXG4gICAgICAgICAgICB9KS5yZXEuZGF0YS5ib2R5O1xcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBzdXJsKDApLml0ZW1fc29uZy5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5zaW5nZXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogYGh0dHBzOi8veS5ndGltZy5jbi9tdXNpYy9waG90b19uZXcvVDAwMlIzMDB4MzAwTTAwMCR7Xy5hbGJ1bW1pZHx8KF8uYWxidW0/Xy5hbGJ1bS5taWQ6XFxcIlxcXCIpfS5qcGdgLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnBheS5wYXlfcGxheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5taWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIHN1cmwoMykuaXRlbV9zb25nbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uZGlzc25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmxvZ28sXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmRpc3NpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICB2YXIgYm9keSA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21tOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0OiAnMTknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdjogJzE4NTknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlOiAnbXVzaWMucGZfc29uZ19kZXRhaWxfc3ZyJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnZ2V0X3NvbmdfZGV0YWlsX3lxcScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb25nX21pZDoga2V5d29yZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImh0dHBzOi8vdS55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2dcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogYm9keSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICAgICAgfSkucmVxLmRhdGEudHJhY2tfaW5mbztcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLnNpbmdlci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGBodHRwczovL3kuZ3RpbWcuY24vbXVzaWMvcGhvdG9fbmV3L1QwMDJSMzAweDMwME0wMDAke18uYWxidW0/Xy5hbGJ1bS5taWQ6XFxcIlxcXCJ9LmpwZ2AsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy5wYXkucGF5cGxheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLm1pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJodHRwOi8vYy55LnFxLmNvbS9xem9uZS9mY2ctYmluL2ZjZ191Y2NfZ2V0Y2RpbmZvX2J5aWRzX2NwLmZjZz9mb3JtYXQ9anNvbiZ0eXBlPTEmZGlzc3RpZD1cXFwiICsga2V5d29yZCkuY2RsaXN0WzBdO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKF8uZGlzc25hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5sb2dvLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzdGlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgYWpheDogZnVuY3Rpb24odXJsLCBoZWFkKSB7XFxuICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaCh1cmwsIE9iamVjdC5hc3NpZ24oe1xcbiAgICAgICAgICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3kucXEuY29tL1xcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIk1vemlsbGEvNS4wIChjb21wYXRpYmxlOyBNU0lFIDkuMDsgV2luZG93cyBOVCA2LjE7IFdPVzY0OyBUcmlkZW50LzUuMClcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgaGVhZCB8fCB7fSkpKTtcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKRo1RHWOaUtuiXj1wiLFwicGF0aFwiOlwiY29sbGVjdGlvblwiLFwicnVsZVwiOlwianM6XFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG5sZXQgY19wbGF0Zm9ybSA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7XFxuICAgIHJldHVybiBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHBsYXRmb3JtLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwbGF0Zm9ybSkgPT4ge1xcbiAgICAgICAgICAgIGlmICghcGxhdGZvcm0ubWF0Y2goL17igJjigJjigJnigJkvKSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignY19wbGF0Zm9ybScsIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignY190MicpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBwbGF0Zm9ybSksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgIH0pO1xcbn0pO1xcbmQucHVzaCh7XFxuICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxufSk7XFxuaWYgKHNpID09ICcwJykge1xcbiAgICBzd2l0Y2ggKGNfcGxhdGZvcm0pIHtcXG4gICAgICAgIGNhc2UgJzVzJzpcXG4gICAgICAgICAgICBjdGFiID0gW1xcXCJsaWJcXFwiLCBcXFwieWNcXFwiLCBcXFwiZmNcXFwiLCBcXFwiYnpcXFwiXTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ215JzpcXG4gICAgICAgICAgICBjdGFiID0gW1xcXCJsaWJcXFwiLCBcXFwid3lcXFwiLCBcXFwia3dcXFwiLCBcXFwibWdcXFwiXTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ3F0JzpcXG4gICAgICAgICAgICBjdGFiID0gcXRzO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICBjdGFiID0gW1xcXCJsa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gICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpCBcXFwiICsgbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaTliIbnu4QgXFxcIiArIG5hbWUgKyBcXFwiIOWQl++8n1xcXFxu5q2k5pON5L2c5LiN5Y+v6YCG77yM6LCo5oWO6YCJ5oup44CCXFxcIikuY29uZmlybSgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgenlbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5omT5byA5Li65LqM57qnXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IycpLnJ1bGUoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtuYW1lXS5tYXAoXyA9PiBFeHRyYShfKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS/ruaUueWQjeensFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeaWsOeahOe7hOWQjVxcXCIpLmlucHV0KChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIGluIHp5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBuYW1lKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpbnB1dF0gPSB6eVtpXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2ldID0genlbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuabtOaUueaOkuW6j1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgenUuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHNpLCB6dSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIG9mIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25bbmFtZV0gPSB6eVtuYW1lXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignaWknLCB6dS5pbmRleE9mKGkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwi5pyA5ZCO6Z2iXFxcIiA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltuYW1lXSA9IHp5W25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2lpJywgenUubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIG5hbWUpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG57uE5ZCI5bm2XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUsIDMsICfpgInmi6nopoHlkIjlubbnmoTliIbnu4QnKS5zZWxlY3QoKHNpLCB6dSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIG9mIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2ldID0genlbaV0uY29uY2F0KHp5W25hbWVdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignaWknLCB6dS5pbmRleE9mKGkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXS5maWx0ZXIoKGl0ZW0sIGluZGV4LCBzZWxmKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGYuZmluZEluZGV4KG9iaiA9PiBvYmoudXJsID09PSBpdGVtLnVybCkgPT09IGluZGV4O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8qLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIhuS6qyBcXFwiICsgbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSBzaGFyZVBhc3RlKGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShfKSksICfkupHliarotLTmnb82Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL+S6keWPo+S7pO+8jOWkjeWItuaVtOadoeWPo+S7pOaJk+W8gOi9r+S7tuWNs+WPr+WvvOWFpVxcXFxuXFxcIiArIHVybCArIFxcXCJAaW1wb3J0PWpzOiQucmVxdWlyZShcXFxcXFxcImNvbGxlY3Rpb24zP3J1bGU9dGd46Z+z5LmQXFxcXFxcXCIpKFxcXFxcXFwiXFxcIiArIHNpICsgXFxcIlxcXFxcXFwiLEpTT04ucGFyc2UoZmV0Y2goaW5wdXQucmVwbGFjZSgnL3h4eHh4eCcsJy9hcGkvZ2V0Q29udGVudCcpKSkuZGF0YSxcXFxcXFxcIlxcXCIgKyBuYW1lICsgXFxcIlxcXFxcXFwiLDEpXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIhuS6q+Wksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgIF1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSk7XFxuXFxuXFxuXFxuXFxuXFxuXFxuc3dpdGNoIChjX3QyKSB7XFxuICAgIGNhc2UgJ2ZyZWUnOlxcbiAgICAgICAgY190MiA9ICcwJ1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgJ3BhaWQnOlxcbiAgICAgICAgY190MiA9ICcxJ1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgJ3NvbmdzJzpcXG4gICAgICAgIGNfdDIgPSAnMidcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICdob3RzJzpcXG4gICAgICAgIGNfdDIgPSAnMydcXG4gICAgICAgIGJyZWFrO1xcbn1cXG5pZiAoSlNPTi5zdHJpbmdpZnkoenUpID09ICdbXFxcIuWFqOmDqFxcXCJdJyAmJiB6eVtcXFwi5YWo6YOoXFxcIl0ubGVuZ3RoID09IDApIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnIl+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpXFxuICAgIH0pO1xcbn0gZWxzZSB7XFxuICAgIGlmICh6eVt6dVt0aV1dLmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgZGVsZXRlIHp5W3p1W3RpXV07XFxuICAgICAgICBjbGVhck15VmFyKCd0aScpO1xcbiAgICAgICAgJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBpaSA9IDA7XFxuICAgICAgICB6eVt6dVt0aV1dLm1hcCgoXywgaSkgPT4ge1xcbiAgICAgICAgICAgIGlmICgoKGNfcGxhdGZvcm0gPT0gJ2xpYicgfHwgY19wbGF0Zm9ybSA9PSBfLmRlc2MpICYmIChjX3QyID09ICdsaWInIHx8IGNfdDIgPT0gXy5jb250ZW50KSkgfHwgKGNfcGxhdGZvcm0gPT0gJ2xpYicgJiYgKChjX3QyID09IF8uY29udGVudCkgfHwgKGNfdDIgPT0gJzAnICYmIF8uY29udGVudCAhPSAnMScpKSkpIHtcXG4gICAgICAgICAgICAgICAgXy5leHRyYSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgJzphZGRsaXN0JyxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIGtleSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLkv67mlLnlkI3np7BcXFwiLCBcXFwi5L+u5pS55bCB6Z2iXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vLCBcXFwi5L+u5pS56ZO+5o6lXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgMSwgJ+mAieaLqeimgeS/ruaUueeahOWPguaVsCcpLnNlbGVjdCgoc2ksIGtleSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt0eXBlLCB0ZXh0XSA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIuS/ruaUueWQjeensFxcXCI6IFsndGl0bGUnLCAn6K+36L6T5YWl5paw55qE5ZCN56ewJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCLkv67mlLnlsIHpnaJcXFwiOiBbXy5pbWcgPyAnaW1nJyA6ICdwaWMnLCAn6K+36L6T5YWl5q2j56Gu55qE5bCB6Z2i5Zyw5Z2AJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCLkv67mlLnpk77mjqVcXFwiOiBbJ3VybCcsICflnKh75ZCO6Z2iIOWbnui9pijmjaLooYwp5Yeg5LiL5bCx6KGMJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9W2lucHV0XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lID0gX1t0eXBlXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChuYW1lLCB0ZXh0KS5pbnB1dCgoc2ksIGtleSwgdHlwZSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSB6eS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoX1t0eXBlXSA9PSBuYW1lKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX1t0eXBlXSA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIHR5cGUsIG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dVt0aV0sIF8pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWPmOabtFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgenUsIGtleSwgaSwgenlpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLmm7TmlLnmjpLluo9cXFwiLCBcXFwi5YiH5o2i5YiG57uEXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vLCBcXFwi5om56YeP5o2i57uEXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgMSwgJ+mAieaLqeimgeWPmOabtOeahOS6i+S7ticpLnNlbGVjdCgoc2ksIHp1LCBrZXksIGksIHp5aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+abtOaUueaOkuW6jyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKVtrZXldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenUgPSB6eS5tYXAoXyA9PiBfLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSB6eVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp1LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDEsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHNpLCBrZXksIHp5LCB6dSwgZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgaW4genUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHp1W2ldID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uLnB1c2goZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbi5wdXNoKHp5W2ldKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLmnIDlkI7pnaJcXFwiID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIHp5LCB6dSwgZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5YiH5o2i5YiG57uEJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlpID0genUuaW5kZXhPZihrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenUuc3BsaWNlKGlpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdCgn5paw57uEJyksIDMsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHNpLCBrZXksIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlba2V5XS5tYXAoKF8sIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSAhPSBpKSBqc29uLnB1c2goXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgZGF0YSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlba2V5XSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCfmlrDnu4QnID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5paw57uE5ZCN56ewXFxcIikuaW5wdXQoKHNpLCB6eSwgZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0LnRyaW0oKS5tYXRjaCgvXlxcXFxkK3xeXFxcXHMqKOaWsOe7hCk/XFxcXHMqJC8pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nu4TlkI3kuI3og73kuLrnqbogJiDmnIDliY3pnaLkuI3og73mmK/mlbDlrZdcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaW5wdXRdID0gW2RhdGFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenksIGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpbnB1dF0ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5om56YeP5o2i57uEJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLnJ1bGUoKHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiYWRkbGlzdD9ydWxlPXRneOmfs+S5kFxcXCIpKHNpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBrZXksIGksIHp5aWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIHp1W3RpXSwgaSwgXy56eWlkKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgLyp7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliIbkuqtcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChfLCBzaSwga2V5LCB6eWlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFwi5YiG5Lqr6ZO+5o6lXFxcIiwgXFxcIuWIhuS6q+WPo+S7pFxcXCIsIFxcXCLmibnph4/liIbkuqtcXFwiXSwgMSwgJ+mAieaLqeimgeWPmOabtOeahOS6i+S7ticpLnNlbGVjdCgoXywgc2ksIGtleSwgenlpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WIhuS6q+mTvuaOpSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLmNvcHl1cmwoc2ksIHp5aWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfliIbkuqvlj6Pku6QnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly/kupHlj6Pku6TvvIzlpI3liLbmlbTmnaHlj6Pku6TmiZPlvIDova/ku7bljbPlj6/lr7zlhaVcXFxcblxcXCIgKyBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoXykpICsgXFxcIkBpbXBvcnQ9anM6JC5yZXF1aXJlKFxcXFxcXFwiY29sbGVjdGlvbjM/cnVsZT10Z3jpn7PkuZBcXFxcXFxcIikoXFxcXFxcXCJcXFwiICsgc2kgKyBcXFwiXFxcXFxcXCIsaW5wdXQsXFxcXFxcXCJcXFwiICsgXy50aXRsZSArIFxcXCJcXFxcXFxcIilcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfmibnph4/liIbkuqsnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKChzaSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJhZGRsaXN0P3J1bGU9dGd46Z+z5LmQXFxcIikoc2ksIDEsIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgXywgc2ksIGtleSwgenlpZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgXywgc2ksIHp1W3RpXSwgXy56eWlkKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIGtleSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruWumuWIoOmZpFxcXCIgKyBuYW1lICsgXFxcIuWQl++8n1xcXCIpLmNvbmZpcm0oKHNpLCBrZXksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenUgPSB6eS5tYXAoXyA9PiBfLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgbmFtZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1W3RpXSwgXy50aXRsZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgXy51cmwgPSBMYXp5KF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQpO1xcbiAgICAgICAgICAgICAgICBpZiAoTnVtYmVyKF8uY29udGVudC5yZXBsYWNlKC9eXFxcXEQrJC8sICcwJykpIDwgMikgXy5leHRyYS5sb25nQ2xpY2sudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDkuIvovb3mrYzmm7Ig4piFXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkLCAxKSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlpKys7XFxuICAgICAgICAgICAgICAgIGQucHVzaChfKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmICghaWkpIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwifn5+5LuA5LmI6YO95rKh5pyJfn5+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdH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AgW1xcXCJrd1xcXCIsIC9rdXdvXFxcXC5jbi9pLCAvXFxcXC9wbGF5bGlzdChfZGV0YWlsKT9cXFxcLyhcXFxcZCspL2ksIC9cXFxcLyh5aW55dWV8cGxheV9kZXRhaWwpXFxcXC8oXFxcXGQrKS9pXSxcXG4gICAgICAgICAgICBbXFxcIm1nXFxcIiwgL21pZ3VcXFxcLmNuL2ksIC9cXFxcL3BsYXlsaXN0XFxcXC8oLippZD0pPyhcXFxcZCspL2ksIC9cXFxcL3NvbmdcXFxcLyguKmlkPSk/KFthLXowLTldKykvaV0sXFxuICAgICAgICAgICAgLy8gW1xcXCJrZ1xcXCIsIC4uLl1cXG4gICAgICAgICAgICBbXFxcIjVzXFxcIiwgLzVzaW5nXFxcXC4vaSwgLy4qKHNvbmdsaXN0LippZD0pKFthLXowLTldKykvaSwgLy4qKFxcXFw/c29uZy4qPz18XFxcXC8pKFthLXowLTldKykoXFxcXCZzb25nLio/PXxcXFxcLykoW2EtejAtOV0rKS9pXSxcXG4gICAgICAgIF07XFxuICAgICAgICBmb3IgKFtwbGF0Zm9ybSwgcmVnMSwgcmVnMiwgcmVnM10gb2YgcmVncykge1xcbiAgICAgICAgICAgIGlmIChzX3QyLm1hdGNoKHJlZzEpKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBzX3BsYXRmb3JtID0gcGxhdGZvcm07XFxuICAgICAgICAgICAgICAgICAgICBpZiAobWF0ID0gc190Mi5tYXRjaChyZWcyKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNfdDEgPSAnMSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVnaWQgPSBtYXRbMl07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdCA9IHNfdDIubWF0Y2gocmVnMykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzX3QxID0gJzAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkID0gbWF0WzJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwbGF0Zm9ybSA9PSAnNXMnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWdpZC5tYXRjaCgvXFxcXEQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkID0gbWF0WzRdICsgJyMnICsgcmVnaWQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkICs9ICcjJyArIG1hdFs0XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge31cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgc190MiA9IHJlZ2lkXFxuICAgIH0gZWxzZSBpZiAoc190Mi50cmltKCkpIHtcXG4gICAgICAgIGxldCBpaSA9IGhpc3RvcnkuaW5kZXhPZihzX3QyKTtcXG4gICAgICAgIGlmIChpaSA+IC0xKSB7XFxuICAgICAgICAgICAgaGlzdG9yeS5zcGxpY2UoaWksIDEpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID4gMjApIHtcXG4gICAgICAgICAgICBoaXN0b3J5LnNwbGljZShoaXN0b3J5Lmxlbmd0aCAtIDEsIDEpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaGlzdG9yeS51bnNoaWZ0KHNfdDIpO1xcbiAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIGhpc3RvcnkpO1xcbiAgICB9XFxuXFxuXFxuXFxuICAgIGQgPSBbe1xcbiAgICAgICAgY29sX3R5cGU6ICdwaWNfMV9mdWxsJyxcXG4gICAgICAgIHRpdGxlOiAnMCcsXFxuICAgICAgICBpbWc6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vd2Vpc3lyL2ltZy9Ub3BJbWcwLnBuZ1xcXCIsXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKF8pID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5iYWNrKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gYmFjayhmYWxzZSksICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL2NvbGxlY3Rpb24jbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU95q2M6K+N6YCC6YWNXFxcIjtcXG4gICAgICAgIH0sIE1ZX1BBUkFNUyksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHBhZ2VUaXRsZTogXFxcIlRHWOaUtuiXj1xcXCIsXFxuICAgICAgICAgICAgYmFjazogMVxcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLmkJzntKJcXFwiICsgKHNfdDEgPT09ICcwJyA/IFxcXCLljZXmm7JcXFwiIDogXFxcIuatjOWNlVxcXCIpKSxcXG4gICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc190MSkgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdzX3QxJywgc190MSk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgc190MSA9PT0gJzAnID8gJzEnIDogJzAnKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl9zbWFsbF8zXFxcIixcXG4gICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25feGl1dGFuXFxcIlxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLmiJHnmoTmlLbol49cXFwiKSxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vY29sbGVjdGlvbj9ydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2Rvd25sb2FkXFxcIlxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLljoblj7LorrDlvZVcXFwiKSxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vaGlzdG9yeT9ydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2hpc1xcXCJcXG4gICAgfV07XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/CflI0nLFxcbiAgICAgICAgZGVzYzogJ+aQnOe0ouWFs+mUruivjSAvIOWIhuS6q+mTvuaOpScsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKHNfcGxhdGZvcm0pID0+IHtcXG4gICAgICAgICAgICBzX3QyID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgIGlmIChzX3QyICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywgc190Mik7XFxuICAgICAgICAgICAgICAgIGlmIChzX3BsYXRmb3JtID09ICdsaWInKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBnZXRJdGVtKCdzX3BsYXRmb3JtJywgJ2t3JykpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6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Bjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICB9KTtcXG4gICAgaWYgKHNfdDEgPT0gJzAnKSB7XFxuICAgICAgICBzd2l0Y2ggKHNfcGxhdGZvcm0pIHtcXG4gICAgICAgICAgICBjYXNlICdsaWInOlxcbiAgICAgICAgICAgICAgICBzX3QzID0gZ2V0TXlWYXIoJ3NfdDMnLCAna3cnKTtcXG4gICAgICAgICAgICAgICAgdGFicyA9IFsna3cnXTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnNXMnOlxcbiAgICAgICAgICAgICAgICB0YWJzID0gWydsaWInLCAneWMnLCAnZmMnLCAnYnonXTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnbXknOlxcbiAgICAgICAgICAgICAgICBzX3Q0ID0gZ2V0TXlWYXIoJ3NfdDQnLCAnMScpID09ICcxJztcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhDb2xvcihzX3Q0ID8gJ+aWsCcgOiAn5penJywgJzMzOTljYycpKSksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNfdDQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190NCcsIHNfdDQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc190NCA/ICcwJyA6ICcxJyksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBzX3QzID0gZ2V0TXlWYXIoJ3NfdDMnLCAnd3knKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFzX3QzLm1hdGNoKC93eXxrd3xtZy8pICYmIHNfdDQpXFxuICAgICAgICAgICAgICAgICAgICBzX3QzID0gJ3d5JztcXG4gICAgICAgICAgICAgICAgdGFicyA9IFtcXFwid3lcXFwiLCBcXFwia3dcXFwiLCBcXFwibWdcXFwiLCBcXFwiMXRcXFwiLCBcXFwiZGJcXFwiLCBcXFwiNXlcXFwiLCBcXFwiNWZcXFwiXS5zbGljZSgwLCBzX3Q0ID8gMyA6IDcpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdxdCc6XFxuICAgICAgICAgICAgICAgIHNfdDMgPSBnZXRNeVZhcignc190MycsICdiZCcpO1xcbiAgICAgICAgICAgICAgICB0YWJzID0gcXRzLnNsaWNlKDEpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICB0YWJzID0gWydsaWInLCAncGFpZCcsICdmcmVlJ107XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgdGFicyA9IFsnbGliJ107XFxuICAgIH1cXG4gICAgdGFicy5tYXAobmFtZSA9PiB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBzX3QzID09IG5hbWUgPyBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpIDogbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MycsIHRpZCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBuYW1lKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgIH0sIHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgfSk7XFxuICAgIExvYWRpbmcoKTtcXG4gICAgaWYgKGlzVSkge1xcbiAgICAgICAgaWYgKCFyZWdpZCkgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIumTvuaOpeagvOW8j+acquaUtuW9lVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZWxzZSBzX3QzID0gXFxcInVybFxcXCI7XFxuICAgIH1cXG59IGVsc2UgZCA9IFtdO1xcblxcblxcblxcbmlmIChzX3BsYXRmb3JtICE9IFxcXCJsaWJcXFwiICYmICEvXlxcXFxzKiQvLnRlc3Qoc190MikpIHtcXG4gICAgaWYgKHNfdDIudHJpbSgpICYmICghaXNVIHx8IGlzUCkpIHtcXG4gICAgICAgIGlmIChpc1UpXFxuICAgICAgICAgICAgc2V0UGFnZVRpdGxlKCfpq5jnuqfmkJzntKIgLSAnICsgc19wbGF0Zm9ybSArIChzX3QxID09ICcxJyA/ICfmrYzljZUnIDogJ+WNleabsicpKTtcXG4gICAgICAgIGVsc2VcXG4gICAgICAgICAgICBzZXRQYWdlVGl0bGUoJ+mrmOe6p+aQnOe0oiAtICcgKyBzX3QyICsgJyMnICsgTVlfUEFHRSk7XF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XFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaEhpc3RvcnlcXFwiLFxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgaWYgKGhpc3RvcnkubGVuZ3RoID09PSAwKSBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBlbHNlIGhpc3RvcnkubWFwKChrZXksIGkpID0+IHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGtleSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHNfcGxhdGZvcm0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSAnbGliJykgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBnZXRJdGVtKCdzX3BsYXRmb3JtJywgJ2t3JykpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGtleSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LCBzX3BsYXRmb3JtLCBrZXkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6a2V5OlxcXCIgKyBrZXksXFxuICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6Zmk5YWz6ZSu6K+NOlxcXCIgKyBrZXksXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoaXN0b3J5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWkgPSBoaXN0b3J5LmluZGV4T2Yoa2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIGhpc3RvcnkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oaWQgKyBcXFwiOmtleTpcXFwiICsga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGlzdG9yeS5sZW5ndGggPT09IDApIGFkZEl0ZW1BZnRlcihpZCArIFxcXCI6c2VhcmNoSGlzdG9yeVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCI6a2V5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpZCwga2V5KVxcbiAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9KTtcXG4gICAgUmVzb3UgPSAoaWQsIHNfcGxhdGZvcm0sIHBsYXRmb3JtLCByZXNvdSkgPT4ge1xcbiAgICAgICAgRCA9IFtdO1xcbiAgICAgICAgcmVzb3UubWFwKG5hbWUgPT4ge1xcbiAgICAgICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNfcGxhdGZvcm0sIHBsYXRmb3JtLCBrZXl3b3JkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSAnbGliJykgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBwbGF0Zm9ybSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgc19wbGF0Zm9ybSwgcGxhdGZvcm0sIG5hbWUpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyAnOnJlc291OmtleSdcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXR1cm4gRDtcXG4gICAgfTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6I2ZmNjYwMVxcXCI+PGI+5aSn5a626YO95Zyo5pCcPC9iPjwvc3Bhbj4nLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpZCwgc19wbGF0Zm9ybSwgcGxhdGZvcm0sIFJlc291KSA9PiB7XFxuICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKGlkICsgJzpyZXNvdTprZXknKTtcXG4gICAgICAgICAgICBzcmVjID0gW107XFxuICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL3NlYXJjaHJlYy5rdXdvLmNuL3NyZWMucz9zZWFyY2hyZWNhcGk9MCZpZD0wXFxcIikpLmFic2xpc3QubWFwKGFibGlzdCA9PiB7XFxuICAgICAgICAgICAgICAgIGFibGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAg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BgW3tcXFwiaWRcXFwiOiR7dDF9fV1gXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBhID0gXy5zb25nc1swXTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbdHNbMV0gKyBTaXplKGEubCA/IGEubC5zaXplIDogYS5tLnNpemUpXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLmgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKGEuaC5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoYS5zcSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUoYS5zcS5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoYS5ocilcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1s0XSArIFNpemUoYS5oci5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHRzLCB0MSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSBpbiB0cykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQubWF0Y2godHNbaV0pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXZlbCA9IFtcXFwic3RhbmRhcmRcXFwiLCBcXFwiZXhoaWdoXFxcIiwgXFxcImxvc3NsZXNzXFxcIiwgXFxcImhpcmVzXFxcIl1baV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0MiA9IFtcXFwibXAzXFxcIiwgXFxcImhxXFxcIiwgXFxcInNxXFxcIiwgXFxcImhyXFxcIl1baV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHA6Ly9ubS5meWFwaS5zaXRlL3NvbmcvdXJsL3YxP2lkPVxcXCIgKyB0MSArIFxcXCImbGV2ZWw9XFxcIiArIGxldmVsICsgXFxcIiZub0Nvb2tpZT10cnVlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheCh1cmwpLmRhdGFbMF0udXJsO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVybCA9ICQucmVxdWlyZShcXFwiZ2NzcD9ydWxlPeatjOivjemAgumFjVxcXCIpLmxhenkoXFxcInd5eVxcXCIsIHQxLCB0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB0cy5zbGljZSgxLCA1KSwgYS5pZCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8g5q2M6K+NXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBscmMgPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcImh0dHBzOi8vbXVzaWMuMTYzLmNvbS93ZWFwaS9zb25nL2x5cmljXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0MSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsdjogLTEsXFxuICAgICAgICAgICAgICAgICAgICAgICAga3Y6IC0xLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR2OiAtMVxcbiAgICAgICAgICAgICAgICAgICAgfSkubHJjLmx5cmljO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKChhLmZlZSA9PSAwIHx8IGEuZmVlID09IDgpICYmIChfLnByaXZpbGVnZXNbMF0uc3QgPiAtMSkpXFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSBgaHR0cDovL211c2ljLjE2My5jb20vc29uZy9tZWRpYS9vdXRlci91cmw/aWQ9JHt0MX0ubXAzYDtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9tdXNpYy5kb2dnZWQuY24vYXBpLnBocFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiYm9keVxcXCI6IFxcXCJ0eXBlcz11cmwmaWQ9XFxcIiArIHQxICsgXFxcIiZzb3VyY2U9bmV0ZWFzZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJQT1NUXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSkpLnVybDtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyBcXFwiI2lzTXVzaWM9dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvL+mmlumhtVxcbiAgICAgICAgICAgICAgICBpZiAoIXQxLm1hdGNoKC9cXFxcPy8pKSB0MSA9IFxcXCJ0b3AvcGxheWxpc3Q/Y2F0PVxcXCIgKyB0MSArIFxcXCImXFxcIjtcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KHQxKTtcXG4gICAgICAgICAgICAgICAgKF8ucmVzdWx0IHx8IF8ucGxheWxpc3RzKS5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsIHx8IF8ucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSlcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwiaHR0cHM6Ly9tdXNpYy4xNjMuY29tL2FwaS92Ni9wbGF5bGlzdC9kZXRhaWw/bGltaXQ9OTk5OTkmaWQ9XFxcIiArIHQxICsgXFxcIiZuPTk5OTk5XFxcIikucGxheWxpc3QudHJhY2tzO1xcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBfID0gW107XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5hci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICBpbWc6IF8uYWwucGljVXJsLFxcbiA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lOiBzdHlwZSxcXG4gICAgICAgICAgICAgICAgc3RyYXRlZ3k6IDUsXFxuICAgICAgICAgICAgICAgIHF1ZXJ5Q29ycmVjdDogdHJ1ZVxcbiAgICAgICAgICAgIH0pLnJlc3VsdDtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgc3VybCgxKS5zb25ncy5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5hci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmFsLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogKChfLmZlZSA9PSAwIHx8IF8uZmVlID09IDgpICYmIChfLnByaXZpbGVnZSA/IChfLnByaXZpbGVnZS5zdCA+IC0xKSA6IDEpKSA/IDAgOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gc3VybCgxMDAwKS5wbGF5bGlzdHM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVID09PSAxKSByZXR1cm4gbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCJodHRwczovL211c2ljLjE2My5jb20vd2VhcGkvdjMvc29uZy9kZXRhaWxcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYzogYFt7XFxcImlkXFxcIjoke2tleXdvcmR9fV1gXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGEgPSBfLnNvbmdzWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBhLm5hbWUgKyAnIC0gJyArIGEuYXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBhLmFsLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAoKGEuZmVlID09IDAgfHwgYS5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlc1swXS5zdCA+IC0xKSkgPyAwIDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBhLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImh0dHBzOi8vbXVzaWMuMTYzLmNvbS9hcGkvdjYvcGxheWxpc3QvZGV0YWlsP2lkPVxcXCIgKyBrZXl3b3JkKS5wbGF5bGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnbXknXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG4gICAgYWpheDogZnVuY3Rpb24odXJpKSB7XFxuICAgICAgICBpZiAoIXVyaS5tYXRjaCgvaHR0cHM/OlxcXFwvXFxcXC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AgICAgICAgICBpbWc6IF8uaW1ndXJsLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICB6eWlkOiBfLnJhbmtpZCxcXG4gICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJrZ19pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDor6bmg4VcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFt7XFxuICAgICAgICAgICAgICAgICAgICBoYXNoOiB0MVxcbiAgICAgICAgICAgICAgICB9XSlbMF07XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gXy5yZWxhdGVfZ29vZHMubWFwKChfLCBpKSA9PiB0c1tpICsgMV0gKyBTaXplKF8uaW5mby5maWxlc2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh0cywgdDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v55uu5YmN5Y+q5pSv5oyB6K+V5ZCsflxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIGluIHRzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC5tYXRjaCh0c1tpXSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQyID0gW1xcXCJtcDNcXFwiLCBcXFwiaHFcXFwiLCBcXFwic3FcXFwiLCBcXFwiaHJcXFwiXVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcImdjc3A/cnVsZT3mrYzor43pgILphY1cXFwiKS5sYXp5KFxcXCJrdWdvdVxcXCIsIHQxLCB0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB0cy5zbGljZSgxLCA1KSwgdDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHVybCA9IGBodHRwczovL3d3d2FwaS5rdWdvdS5jb20veXkvaW5kZXgucGhwP3I9cGxheSUyRmdldGRhdGEmaGFzaD0ke3QxfSZhbGJ1bV9pZD0ke18ucmVjb21tZW5kX2FsYnVtX2lkfSZtaWQ9JHtSKDMyKX0mcGxhdGlkPTRgO1xcbiAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaCh1cmwpKS5kYXRhO1xcbiAgICAgICAgICAgICAgICBscmMgPSBfLmx5cmljcztcXG4gICAgICAgICAgICAgICAgaWYgKF8ucHJpdmlsZWdlID09IDAgfHwgXy5wcml2aWxlZ2UgPT0gOClcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IF8ucGxheV91cmwgfHwgXy5wbGF5X2JhY2t1cF91cmw7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vYXBpLnhpbmd6aGlnZS5jb20vQVBJL0t1Z291X0dOX25ldy8/bmFtZT1cXFwiICsgXy5zb25nX25hbWUgKyBcXFwiIFxcXCIgKyBfLmF1dGhvcl9uYW1lICsgXFxcIiZuPTFcXFwiKSkuZGF0YS5zcmM7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g6aaW6aG1XFxuICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwOi8vd3d3Mi5rdWdvdS5rdWdvdS5jb20veXVla3Uvdjkvc3BlY2lhbC9nZXRTcGVjaWFsP2lzX2FqYXg9MSZjZG49Y2RuJnQ9JnBhZ2VzaXplPTMwJmM9XFxcIiArIHQxICsgXFxcIiZwPVxcXCIgKyBNWV9QQUdFO1xcbiAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKHVybCkpLnNwZWNpYWxfZGIubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc3BlY2lhbG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc3BlY2lhbGlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IGV4ZWN1dGVXZWJSdWxlKGBodHRwOi8vd3d3Mi5rdWdvdS5rdWdvdS5jb20veXVla3Uvdjkvc3BlY2lhbC9zaW5nbGUvJHt0MX0tNS05OTk5OS5odG1sP2pzb249dHJ1ZWAsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShnbG9iYWwuZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KEpTT04ucGFyc2UoXykpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgXyA9IFtdO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKGBodHRwOi8vbW9iaWxlY2RuYmoua3Vnb3UuY29tL2FwaS92My9yYW5rL3Nvbmc/cGFnZXNpemU9MzAmcGFnZT0ke01ZX1BBR0V9JnJhbmtpZD0ke3QxfWApKS5kYXRhLmluZm87XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgdGl0bGU6IChfLmZpbGVuYW1lIHx8IF8ubmFtZSkuc3BsaXQoJyAtICcpLnJldmVyc2UoKS5qb2luKCcgLSAnKSxcXG4gICAgICAgICAgICBpbWc6IF8uYWxidW1fc2l6YWJsZV9jb3ZlciB8fCBfLmluZm8uaW1hZ2UsXFxuICAgICAgICAgICAgY29udGVudDogKF8ucHJpdmlsZWdlID09IDAgfHwg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ICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWxidW1fc2l6YWJsZV9jb3ZlciB8fCBfLmluZm8uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogKF8ucHJpdmlsZWdlID09IDAgfHwgXy5wcml2aWxlZ2UgPT0gOCkgPyAwIDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmhhc2hcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICBzdXJsKCdzcGVjaWFsJykubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc3BlY2lhbG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc3BlY2lhbGlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuICAgIGFqYXg6IGZ1bmN0aW9uKHJlc291cmNlKSB7XFxuICAgICAgICByZXNvdXJjZSA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwicmVsYXRlXFxcIjogMSxcXG4gICAgICAgICAgICBcXFwidXNlcmlkXFxcIjogXFxcIjI2MjY0MzE1MzZcXFwiLFxcbiAgICAgICAgICAgIFxcXCJ2aXBcXFwiOiAxLFxcbiAgICAgICAgICAgIFxcXCJ0b2tlblxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcHBpZFxcXCI6IDEwMDEsXFxuICAgICAgICAgICAgXFxcImJlaGF2aW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IFxcXCJiYW5nL2JhbmcvYmFuZ01lbnU/XFxcIikubWFwKF8gPT4ge1xcbiAgICAgICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW18ubmFtZV0gPSBfLmxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IF8ucGljLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICB6eWlkOiBfLnNvdXJjZWlkXFxuICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwia3dfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g5q2M5puy6K+m5oOFXFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJodHRwOi8vbS5rdXdvLmNuL25ld2g1L3NpbmdsZXMvc29uZ2luZm9hbmRscmM/bXVzaWNJZD1cXFwiICsgdDEgKyBcXFwiJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGYgPSBfLnNvbmdpbmZvLmZvcm1hdHM7XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbdHNbMF0gKyBcXFwiYWFjXFxcIiwgdHNbMV0gKyBcXFwibXAzXFxcIl07XFxuICAgICAgICAgICAgICAgICAgICAvKlxcbiAgICAgICAgICAgICAgICAgICAgaWYoZi5tYXRjaCgvSElSRkxBQy9pKSkvLyBoclxcbiAgICAgICAgICAgICAgICAgICAgaWYoZi5tYXRjaCgvQUxGTEFDL2kpKS8vIHNxXFxuICAgICAgICAgICAgICAgICAgICBpZihmLm1hdGNoKC9NUDNIL2kpKS8vIGhxXFxuICAgICAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYubWF0Y2goLyhBTHxISVIpRkxBQy9pKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFxcXCJmbGFjXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdDIgPSBpbnB1dC5zcGxpdCgn44CRJylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcSA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5kZXModDEsIHQyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBmZXRjaChcXFwiaHR0cDovL21vYmkua3V3by5jbi9tb2JpLnM/Zj1rdXdvJnE9XFxcIiArIHEsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwib2todHRwLzMuMTAuMFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLm1hdGNoKC91cmw9KFxcXFxTKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAkLnJlcXVpcmUoXFxcImdjc3A/cnVsZT3mrYzor43pgILphY1cXFwiKS5sYXp5KFxcXCJrdXdvXFxcIiwgdDEsIHQyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHQxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGxyYyA9IF8ubHJjbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IE1hdGguZmxvb3IoXy50aW1lIC8gNjApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAoXy50aW1lICUgNjApLnRvRml4ZWQoMyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGBbJHttLnRvU3RyaW5nKCkucGFkU3RhcnQoMiwgJzAnKX06JHtzLnBhZFN0YXJ0KDYsICcwJyl9XWAgKyBfLmxpbmVMeXJpY1xcbiAgICAgICAgICAgICAgICAgICAgfSkuam9pbignXFxcXG4nKTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gJC5yZXF1aXJlKFxcXCJrdz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgocGNhcGkucmVwbGFjZSgvKGFwaVxcXFwvKS8sICckMXYxLycpICsgXFxcIm11c2ljL3BsYXlVcmw/bWlkPVxcXCIgKyB0MSArIFxcXCImdHlwZT1tdXNpYyZcXFwiKS51cmw7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKHZpcCkge1xcbiAgICAgICAgICAgICAgICAgICAgcSA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5kZXModDEpO1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gZmV0Y2goXFxcImh0dHA6Ly9tb2JpLmt1d28uY24vbW9iaS5zP2Y9a3V3byZxPVxcXCIgKyBxLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJva2h0dHAvMy4xMC4wXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLm1hdGNoKC91cmw9KFxcXFxTKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOmmlumhtVxcbiAgICAgICAgICAgICAgICBpZiAoIXQxLm1hdGNoKCdpZD1yY20nKSB8fCBNWV9QQUdFID09PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJrdz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgocGNhcGkgKyB0MSArIFxcXCImcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgKF8uZGF0YSB8fCBfLmxpc3QpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHBjYXBpICsgXFxcInBsYXlsaXN0L3BsYXlMaXN0SW5mbz9waWQ9XFxcIiArIHQxICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIik7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHBjYXBpICsgXFxcImJhbmcvYmFuZy9tdXNpY0xpc3Q/YmFuZ0lkPVxcXCIgKyB0MSArIFxcXCImcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIF8ubXVzaWNMaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogKF8uc29uZ05hbWUgfHwgXy5uYW1lKSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgaW1nOiBfLnBpYyB8fCBfLmltZyB8fCBmZXRjaCgnaHR0cDovL2FydGlzdHBpY3NlcnZlci5rdXdvLmNuL3BpYy53ZWI/dHlwZT1yaWRfcGljJnBpY3R5cGU9dXJsJnNpemU9NTAwJnJpZD0nICsgXy5pZCksXFxuICAgICAgICAgICAgY29udGVudDogXy5pc0xpc3RlbkZlZSA9PSB0cnVlID8gMSA6IDAsXFxuICAgICAgICAgICAgenlpZDogXy5pZCB8fCBfLnJp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BuPVxcXCIgKyAoTVlfUEFHRSAtIDEpICsgXFxcIiZybj0zMCZhbGw9XFxcIiArIGtleXdvcmQ7XFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKHVybCkucmVwbGFjZSgvJy9nLCAnXFxcIicpKS5hYnNsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByaWQgPSBfLk1VU0lDUklELnNwbGl0KCdfJylbMV0gKyAnJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5TT05HTkFNRSArICcgLSAnICsgXy5BUlRJU1QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy53ZWJfYWxidW1waWNfc2hvcnQgPyBcXFwiaHR0cDovL2ltZzEua3djZG4ua3V3by5jbi9zdGFyL2FsYnVtY292ZXIvXFxcIiArIF8ud2ViX2FsYnVtcGljX3Nob3J0LnJlcGxhY2UoL14xMjAvLCAnNTAwJykgOiBmZXRjaCgnaHR0cDovL2FydGlzdHBpY3NlcnZlci5rdXdvLmNuL3BpYy53ZWI/dHlwZT1yaWRfcGljJnBpY3R5cGU9dXJsJnNpemU9NTAwJnJpZD0nICsgcmlkKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy50cGF5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiByaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIHN1cmwoJ1BsYXlMaXN0JykubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJodHRwOi8vbS5rdXdvLmNuL25ld2g1L3NpbmdsZXMvc29uZ2luZm9hbmRscmM/bXVzaWNJZD1cXFwiICsga2V5d29yZCArIFxcXCImXFxcIikuc29uZ2luZm87XFxuICAgICAgICAgICAgICAgICAgICBfXyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpY1xcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJrdz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgocGNhcGkucmVwbGFjZSgvKGFwaVxcXFwvKS8sICckMXYxLycpICsgXFxcIm11c2ljL3BsYXlVcmw/bWlkPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZ0eXBlPW11c2ljJlxcXCIpLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfXy5jb250ZW50ID0gMDtcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKHZpcCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF9fLmNvbnRlbnQgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgX18uenlpZCA9IGtleXdvcmQ7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYShfXywgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHBjYXBpICsgXFxcInBsYXlsaXN0L3BsYXlMaXN0SW5mbz9waWQ9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBuPTEmcm49MSZcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG5cXG5cXG4gICAgYWpheDogZnVuY3Rpb24odXJsKSB7XFxuICAgICAgICBDb29raWUgPSBKU09OLnBhcnNlKGZldGNoUEMoJ2h0dHBzOi8vd3d3Lmt1d28uY24vZmF2aWNvbi5pY28/dj0xJywge1xcbiAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KSkuaGVhZGVyc1snc2V0LWNvb2tpZSddO1xcbiAgICAgICAgQ29va2llID0gU3RyaW5nKENvb2tpZSkucmVwbGFjZSgvOy4qLywgJycpO1xcbiAgICAgICAgW2UsIHRdID0gQ29va2llLnNwbGl0KCc9Jyk7XFxuICAgICAgICB0ID0gdW5lc2NhcGUodCk7XFxuICAgICAgICBmb3IgKHZhciBuID0gXFxcIlxcXCIsIGkgPSAwOyBpIDwgZS5sZW5ndGg7IGkrKykgbiArPSBlLmNoYXJDb2RlQXQoaSkudG9TdHJpbmcoKTtcXG4gICAgICAgIG4gPSBTdHJpbmcobik7XFxuICAgICAgICB2YXIgciA9IE1hdGguZmxvb3Iobi5sZW5ndGggLyA1KSxcXG4gICAgICAgICAgICBvID0gcGFyc2VJbnQobi5jaGFyQXQocikgKyBuLmNoYXJBdCgyICogcikgKyBuLmNoYXJBdCgzICogcikgKyBuLmNoYXJBdCg0ICogcikgKyBuLmNoYXJBdCg1ICogcikpLFxcbiAgICAgICAgICAgIGwgPSBNYXRoLmNlaWwoZS5sZW5ndGggLyAyKSxcXG4gICAgICAgICAgICBjID0gTWF0aC5wb3coMiwgMzEpIC0gMTtcXG4gICAgICAgIHZhciBkID0gTWF0aC5yb3VuZCgxZTkgKiBNYXRoLnJhbmRvbSgpKSAlIDFlODtcXG4gICAgICAgIGZvciAobiArPSBkOyBuLmxlbmd0aCA+IDEwOylcXG4gICAgICAgICAgICBuID0gKHBhcnNlSW50KG4uc3Vic3RyaW5nKDAsIDEwKSkgKyBwYXJzZUludChuLnN1YnN0cmluZygxMCwgbi5sZW5ndGgpKSkudG9TdHJpbmcoKTtcXG4gICAgICAgIG4gPSAobyAqIG4gKyBsKSAlIGM7XFxuICAgICAgICB2YXIgaCA9IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGYgPSBcXFwiXFxcIjtcXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0Lmxlbmd0aDsgaSsrKVxcbiAgICAgICAgICAgIGYgKz0gKGggPSBwYXJzZUludCh0LmNoYXJDb2RlQXQoaSkgXiBNYXRoLmZsb29yKG4gLyBjICogMjU1KSkpIDwgMTYgPyBcXFwiMFxcXCIgKyBoLnRvU3RyaW5nKDE2KSA6IGgudG9TdHJpbmcoMTYpLFxcbiAgICAgICAgICAgIG4gPSAobyAqIG4gKyBsKSAlIGM7XFxuICAgICAgICBmb3IgKGQgPSBkLnRvU3RyaW5nKDE2KTsgZC5sZW5ndGggPCA4OylcXG4gICAgICAgICAgICBkID0gXFxcIjBcXFwiICsgZDtcXG4gICAgICAgIFNlY3JldCA9IGYgKyBkO1xcbiAgICAgICAgdXJsICs9IGBodHRwc1N0YXR1cz0xJnJlcUlkPSR7Uig4KX0tJHtSKDQpfS0ke1IoNCl9LSR7Uig0KX0tJHtSKDEyKX0mcGxhdD13ZWJfd3d3JmZyb209YDtcXG4gICAgICAgIGdldGRhdGEgPSAoYWpheGVycikgPT4ge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfID0gSlNPTi5wYXJzZShmZXRjaFBDKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8va3V3by5jbi8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb29raWUnOiBDb29raWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlY3JldCc6IFNlY3JldFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFqYXhlcnIgPCAyID8gZ2V0ZGF0YShhamF4ZXJyICsgMSkgOiBcXFwiXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gZ2V0ZGF0YSgwKTtcXG4gICAgfSxcXG5cXG5cXG5cXG5cXG5cXG4gICAgLyoqXFxuICAgICAqIOmFt+aIkeebtOmTvuino+aekOWKoOWvhueul+azlVxcbiAgICAgKiDkuI3nn6XpgZPog73nlKjlpJrkuYXvvIzlhYjnlKjnnYDlkKdcXG4gICAgICovXFxuICAgIGRlczogZnVuY3Rpb24ocmlkLCBmb3JtYXQpIHtcXG4gICAgICAgIHJldHVybiBleGVjdXRlV2ViUnVsZShcXFwiXFxcIiwgJC50b1N0cmluZygodCkgPT4ge1xcbiAgICAgICAgICAgIGNvbnN0IEJ1ZmZlciA9IHtcXG4gICAgICAgICAgICAgICAgZnJvbTogdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByID0gdC5sZW5ndGg7XFxuICAgICAgICAgICAgICAgICAgICBlID0gbmV3IFVpbnQ4QXJyYXkocik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKG4gPSAwOyBuIDwgcjsgbisrKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVbbl0gPSB0LmNoYXJDb2RlQXQobik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJhbmdlID0gdCA9PiBBcnJheS5mcm9tKG5ldyBBcnJheSh0KS5rZXlzKCkpO1xcbiAgICAgICAgICAgIExvbmcgPSB0ID0+IHtcXG4gICAgICAgICAgICAgICAgY29uc3QgciA9IEJpZ0ludCh0KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHRvU3RyaW5nOiAoKSA9PiByLnRvU3RyaW5nKCksXFxuICAgICAgICAgICAgICAgICAgICBpc05lZ2F0aXZlOiAoKSA9PiByIDwgMCxcXG4gICAgICAgICAgICAgICAgICAgIG5vdDogKCkgPT4gTG9uZyh+ciksXFxuICAgICAgICAgICAgICAgICAgICBsb3c6IE51bWJlcihyKSxcXG4gICAgICAgICAgICAgICAgICAgIG9yOiB0ID0+IExvbmcociB8IEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgICAgICB4b3I6IHQgPT4gTG9uZyhyIF4gQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgICAgIGFuZDogdCA9PiBMb25nKHIgJiBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICAgICAgZXF1YWxzOiB0ID0+IHIgPT09IEJpZ0ludCh0KSxcXG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0TGVmdDogdCA9PiBMb25nKHIgPDwgQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0UmlnaHQ6IHQgPT4gTG9uZyhyID4+IEJpZ0ludCh0KSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgTG9uZ0FycmF5ID0gdCA9PiB0Lm1hcCh0ID0+IExvbmcodCkpO1xcblxcblxcbiAgICAgICAgICAgIGFycmF5RSA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDMxLCAwLCAxLCAyLCAzLCA0LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDMsIDQsIDUsIDYsIDcsIDgsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgNywgOCwgOSwgMTAsIDExLCAxMiwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAxMSwgMTIsIDEzLCAxNCwgMTUsIDE2LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDE1LCAxNiwgMTcsIDE4LCAxOSwgMjAsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMTksIDIwLCAyMSwgMjIsIDIzLCAyNCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyMywgMjQsIDI1LCAyNiwgMjcsIDI4LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDI3LCAyOCwgMjksIDMwLCAzMSwgMzAsIC0xLCAtMVxcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgYXJyYXlJUCA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDU3LCA0OSwgNDEsIDMzLCAyNSwgMTcsIDksIDEsXFxuICAgICAgICAgICAgICAgIDU5LCA1MSwgNDMsIDM1LCAyNywgMTksIDExLCAzLFxcbiAgICAgICAgICAgICAgICA2MSwgNTMsIDQ1LCAzNywgMjksIDIxLCAxMywgNSxcXG4gICAgICAgICAgICAgICAgNjMsIDU1LCA0NywgMzksIDMxLCAyMywgMTUsIDcsXFxuICAgICAgICAgICAgICAgIDU2LCA0OCwgNDAsIDMyLCAyNCwgMTYsIDgsIDAsXFxuICAgICAgICAgICAgICAgIDU4LCA1MCwgNDIsIDM0LCAyNiwgMTgsIDEwLCAyLFxcbiAgICAgICAgICAgICAgICA2MCwgNTIsIDQ0LCAzNiwgMjgsIDIwLCAxMiwgNCxcXG4gICAgICAgICAgICAgICAgNjIsIDU0LCA0NiwgMzgsIDMwLCAyMiwgMTQsIDZcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5SVBfMSA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDM5LCA3LCA0NywgMTUsIDU1LCAyMywgNjMsIDMxLFxcbiAgICAgICAgICAgICAgICAzOCwgNiwgNDYsIDE0LCA1NCwgMjIsIDYyLCAzMCxcXG4gICAgICAgICAgICAgICAgMzcsIDUsIDQ1LCAxMywgNTMsIDIxLCA2MSwgMjksXFxuICAgICAgICAgICAgICAgIDM2LCA0LCA0NCwgMTIsIDUyLCAyMCwgNjAsIDI4LFxcbiAgICAgICAgICAgICAgICAzNSwgMywgNDMsIDExLCA1MSwgMTksIDU5LCAyNyxcXG4gICAgICAgICAgICAgICAgMzQsIDIsIDQyLCAxMCwgNTAsIDE4LCA1OCwgMjYsXFxuICAgICAgICAgICAgICAgIDMzLCAxLCA0MSwgOSwgNDksIDE3LCA1NywgMjUsXFxuICAgICAgICAgICAgICAgIDMyLCAwLCA0MCwgOCwgNDgsIDE2LCA1NiwgMjRcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5THMgPSBbXFxuICAgICAgICAgICAgICAgIDEsIDEsIDIsIDIsIDIsIDIsIDIsIDIsXFxuICAgICAgICAgICAgICAgIDEsIDIsIDIsIDIsIDIsIDIsIDIsIDFcXG4gICAgICAgICAgICBdXFxuICAgICAgICAgICAgYXJyYXlMc01hc2sgPSBMb25nQXJyYXkoWzAsIDEwNDg1NzcsIDMxNDU3MzFdKVxcbiAgICAgICAgICAgIGFycmF5TWFzayA9IHJhbmdlKDY0KS5tYXAodCA9PiBNYXRoLnBvdygyLCB0KSlcXG4gICAgICAgICAgICBhcnJheU1hc2tbNjNdICo9IC0xXFxuICAgICAgICAgICAgYXJyYXlQID0gTG9uZ0FycmF5KFtcXG4gICAgICAgICAgICAgICAgMTUsIDYsIDE5LCAyMCwgMjgsIDExLCAyNywgMTYsXFxuICAgICAgICAgICAgICAgIDAsIDE0LCAyMiwgMjUsIDQsIDE3LCAzMCwgOSxcXG4gICAgICAgICAgICAgICAgMSwgNywgMjMsIDEzLCAzMSwgMjYsIDIsIDgsXFxuICAgICAgICAgICAgICAgIDE4LCAxMiwgMjksIDUsIDIxLCAxMCwgMywgMjRcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5UENfMSA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDU2LCA0OCwgNDAsIDMyLCAyNCwgMTYsIDgsIDAsXFxuICAgICAgICAgICAgICAgIDU3LCA0OSwgNDEsIDMzLCAyNSwgMTcsIDksIDEsXFxuICAgICAgICAgICAgICAgIDU4LCA1MCwgNDIsIDM0LCAyNiwgMTgsIDEwLCAyLFxcbiAgICAgICAgICAgICAgICA1OSwgNTEsIDQzLCAzNSwgNjIsIDU0LCA0NiwgMzgsXFxuICAgICAgICAgICAgICAgIDMwLCAyMiwgMTQsIDYsIDYxLCA1MywgNDUsIDM3LFxcbiAgICAgICAgICAgICAgICAyOSwgMjEsIDEzLCA1LCA2MCwgNTIsIDQ0LCAzNixcXG4gICAgICAgICAgICAgICAgMjgsIDIwLCAxMiwgNCwgMjcsIDE5LCAxMSwgM1xcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgYXJyYXlQQ18yID0gTG9uZ0FycmF5KFtcXG4gICAgICAgICAgICAgICAgMTMsIDE2LCAxMCwgMjMsIDAsIDQsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMiwgMjcsIDE0LCA1LCAyMCwgOSwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyMiwgMTgsIDExLCAzLCAyNSwgNywgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAxNSwgNiwgMjYsIDE5LCAxMiwgMSwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICA0MCwgNTEsIDMwLCAzNiwgNDYsIDU0LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDI5LCAzOSwgNTAsIDQ0LCAzMiwgNDcsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgNDMsIDQ4LCAzOCwgNTUsIDMzLCA1MiwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICA0NSwgNDEsIDQ5LCAzNSwgMjgsIDMxLCAtMSwgLTFcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIG1hdHJpeE5TQm94ID0gW1xcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxNCwgNCwgMywgMTUsIDIsIDEzLCA1LCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDE0LCA2LCA5LCAxMSwgMiwgMCwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEsIDEwLCAxMiwgMTUsIDYsIDksIDEwLFxcbiAgICAgICAgICAgICAgICAgICAgMSwgOCwgMTIsIDcsIDgsIDExLCA3LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgMCwgMTUsIDEwLCA1LCAxNCwgNCwgOSwgMTAsXFxuICAgICAgICAgICAgICAgICAgICA3LCA4LCAxMiwgMywgMTMsIDEsIDMsIDYsXFxuICAgICAgICAgICAgICAgICAgICAxNSwgMTIsIDYsIDExLCAyLCA5LCA1LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMiwgMTEsIDE0LCAxLCA3LCA4LCAxM1xcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxNSwgMCwgOSwgNSwgNiwgMTAsIDEyLCA5LFxcbiAgICAgICAgICAgICAgICAgICAgOCwgNywgMiwgMTIsIDMsIDEzLCA1LCAyLFxcbiAgICAgICAgICAgICAgICAgICAgMSwgMTQsIDcsIDgsIDExLCA0LCAwLCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDExLCAxMywgNiwgNCwgMSwgMTAsIDE1LFxcbiAgICAgICAgICAgICAgICAgICAgMywgMTMsIDEyLCAxMSwgMTUsIDMsIDYsIDAsXFxuICAgICAgICAgICAgICAgICAgICA0LCAxMCwgMSwgNywgOCwgNCwgMTEsIDE0LFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDgsIDAsIDYsIDIsIDE1LCA5LCA1LFxcbiAgICAgICAgICAgICAgICAgICAgNywgMSwgMTAsIDEyLCAxNCwgMiwgNSwgOVxcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxMCwgMTMsIDEsIDExLCA2LCA4LCAxMSwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDksIDQsIDEyLCAyLCAxNSwgMywgMiwgMTQsXFxuICAgICAgICAgICAgICAgICAgICAwLCA2LCAxMywgMSwgMywgMTUsIDQsIDEwLFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDksIDcsIDEyLCA1LCAwLCA4LCA3LFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDEsIDIsIDQsIDMsIDYsIDEyLCAxMSxcXG4gICAgICAgICAgICAgICAgICAgIDAsIDEzLCA1LCAxNCwgNiwgOCwgMTUsIDIsXFxuICAgICAgICAgICAgICAgICAgICA3LCAxMCwgOCwgMTUsIDQsIDksIDExLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgOSwgMCwgMTQsIDMsIDEwLCA3LCAxLCAxMlxcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICA3LCAxMCwgMSwgMTUsIDAsIDEyLCAxMSwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCA5LCA4LCAzLCA5LCA3LCA0LCA4LFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDYsIDIsIDEsIDYsIDExLCAxMiwgMixcXG4gICAgICAgICAgICAgICAgICAgIDMsIDAsIDUsIDE0LCAxMCwgMTMsIDE1LCA0LFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDMsIDQsIDksIDYsIDEwLCAxLCAxMixcXG4gICAgICAgICAgICAgICAgICAgIDExLCAwLCAyLCA1LCAwLCAxMywgMTQsIDIsXFxuICAgICAgICAgICAgICAgICAgICA4LCAxNSwgNywgNCwgMTUsIDEsIDEwLCA3LFxcbiAgICAgICAgICAgICAgICAgICAgNSwgNiwgMTIsIDExLCAzLCA4LCA5LCAxNFxcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAyLCA0LCA4LCAxNSwgNywgMTAsIDEzLCA2LFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMSwgMywgMTIsIDExLCA3LCAxNCwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDEyLCAyLCA1LCA5LCAxMCwgMTMsIDAsIDMsXFxuICAgICAgICAgICAgICAgICAgICAxLCAxMSwgMTUsIDUsIDYsIDgsIDksIDE0LFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDExLCA1LCA2LCA0LCAxLCAzLCAxMCxcXG4gICAgICAgICAgICAgICAgICAgIDIsIDEyLCAxNSwgMCwgMTMsIDIsIDgsIDUsXFxuICAgICAgICAgICAgICAgICAgICAxMSwgOCwgMCwgMTUsIDcsIDE0LCA5LCA0LFxcbiAgICAgICAgICAgICAgICAgICAgMTIsIDcsIDEwLCA5LCAxLCAxMywgNiwgM1xcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxMiwgOSwgMCwgNywgOSwgMiwgMTQsIDEsXFxuICAgICAgICAgICAgICAgICAgICAxMCwgMTUsIDMsIDQsIDYsIDEyLCA1LCAxMSxcXG4gICAgICAgICAgICAgICAgICAgIDEsIDE0LCAxMywgMCwgMiwgOCwgNywgMTMsXFxuICAgICAgICAgICAgICAgICAgICAxNSwgNSwgNCwgMTAsIDgsIDMsIDExLCA2LFxcbiAgICAgICAgICAgICAgICAgICAgMTAsIDQsIDYsIDExLCA3LCA5LCAwLCA2LFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMiwgMTMsIDEsIDksIDE1LCAzLCA4LFxcbiAgICAgICAgICAgICAgICAgICAgMTUsIDMsIDEsIDE0LCAxMiwgNSwgMTEsIDAsXFxuICAgICAgICAgICAgICAgICAgICAyLCAxMiwgMTQsIDcsIDUsIDEwLCA4LCAxM1xcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICA0LCAxLCAzLCAxMCwgMTUsIDEyLCA1LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgMiwgMTEsIDksIDYsIDgsIDcsIDYsIDksXFxuICAgICAgICAgICAgICAgICAgICAxMSwgNCwgMTIsIDE1LCAwLCAzLCAxMCwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCAxMywgNywgOCwgMTMsIDE0LCAxLCAyLFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDYsIDE0LCA5LCA0LCAxLCAyLCAxNCxcXG4gICAgICAgICAgICAgICAgICAgIDExLCAxMywgNSwgMCwgMSwgMTAsIDgsIDMsXFxuICAgICAgICAgICAgICAgICAgICAwLCAxMSwgMywgNSwgOSwgNCwgMTUsIDIsXFxuICAgICAgICAgICAgICAgICAgICA3LCA4LCAxMiwgMTUsIDEwLCA3LCA2LCAxMlxcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxMywgNywgMTAsIDAsIDYsIDksIDUsIDE1LFxcbiAgICAgICAgICAgICAgICAgICAgOCwgNCwgMywgMTAsIDExLCAxNCwgMTIsIDUsXFxuICAgICAgICAgICAgICAgICAgICAyLCAxMSwgOSwgNiwgMTUsIDEyLCAwLCAzLFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMSwgMTQsIDEzLCAxLCAyLCA3LCA4LFxcbiAgICAgICAgICAgICAgICAgICAgMSwgMiwgMTIsIDE1LCAxMCwgNCwgMCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCAxNCwgNiwgOSwgNywgOCwgOSwgNixcXG4gICAgICAgICAgICAgICAgICAgIDE1LCAxLCA1LCAxMiwgMywgMTAsIDE0LCA1LFxcbiAgICAgICAgICAgICAgICAgICAgOCwgNywgMTEsIDAsIDQsIDEzLCAyLCAxMVxcbiAgICAgICAgICAgICAgICBdXFxuICAgICAgICAgICAgXVxcbiAgICAgICAgICAgIGJpdFRyYW5zZm9ybSA9ICh0LCByLCBlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBuID0gTG9uZygwKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJhbmdlKHIpLmZvckVhY2gociA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB0W3JdLmlzTmVnYXRpdmUoKSB8fCBlLmFuZChhcnJheU1hc2tbdFtyXS5sb3ddKS5lcXVhbHMoMCkgfHwgKG4gPSBuLm9yKGFycmF5TWFza1tyXSkpXFxuICAgICAgICAgICAgICAgIH0pLCBuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIERFUzY0ID0gKHQsIHIpID0+IHtcXG4gICAgICAgICAgICAgICAgZSA9IFtdLFxcbiAgICAgICAgICAgICAgICAgICAgbiA9IFtdO1xcbiAgICAgICAgICAgICAgICBmID0gYml0VHJhbnNmb3JtKGFycmF5SVAsIDY0LCByKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIG5bMF0gPSBmLmFuZCg0Mjk0OTY3Mjk1KSxcXG4gICAgICAgICAgICAgICAgICAgIG5bMV0gPSBmLmFuZCgtNDI5NDk2NzI5Nikuc2hpZnRSaWdodCgzMiksXFxuICAgICAgICAgICAgICAgICAgICByYW5nZSgxNikuZm9yRWFjaChyID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZiA9IExvbmcoMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IExvbmcoblsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBiaXRUcmFuc2Zvcm0oYXJyYXlFLCA2NCwgaSkueG9yKHRbcl0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5nZSg4KS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVt0XSA9IGkuc2hpZnRSaWdodCg4ICogdCkuYW5kKDI1NSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlKDgpLnJldmVyc2UoKS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IGYuc2hpZnRMZWZ0KDQpLm9yKG1hdHJpeE5TQm94W3RdW2VbdF1dKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGJpdFRyYW5zZm9ybShhcnJheVAsIDMyLCBmKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IExvbmcoblswXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5bMF0gPSBMb25nKG5bMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuWzFdID0gby54b3IoaSlcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgbi5yZXZlcnNlKCksXFxuICAgICAgICAgICAgICAgICAgICBmID0gblsxXS5zaGlmdExlZnQoMzIpLmFuZCgtNDI5NDk2NzI5Nikub3IoblswXS5hbmQoNDI5NDk2NzI5NSkpLFxcbiAgICAgICAgICAgICAgICAgICAgZiA9IGJpdFRyYW5zZm9ybShhcnJheUlQXzEsIDY0LCBmKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzdWJLZXlzID0gKHQsIHIpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IG4gPSBiaXRUcmFuc2Zvcm0oYXJyYXlQQ18xLCA1NiwgdCk7XFxuICAgICAgICAgICAgICAgIHJhbmdlKDE2KS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbiA9IG4uYW5kKGFycmF5THNNYXNrW2FycmF5THNbdF1dKS5zaGlmdExlZnQoMjggLSBhcnJheUxzW3RdKS5vcihuLmFuZChhcnJheUxzTWFza1thcnJheUxzW3RdXS5ub3QoKSkuc2hpZnRSaWdodChhcnJheUxzW3RdKSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgclt0XSA9IGJpdFRyYW5zZm9ybShhcnJheVBDXzIsIDY0LCBuKVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBiID0gZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICBjb25zdCByID0gQnVmZmVyLmZyb20oXFxcInlsenN4a3dtXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBuID0gTG9uZygwKTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UoOCkuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIG4gPSBMb25nKHJbdF0pLnNoaWZ0TGVmdCg4ICogdCkub3IobilcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IG8gPSBNYXRoLmZsb29yKHQubGVuZ3RoIC8gOCksXFxuICAgICAgICAgICAgICAgICAgICBpID0gcmFuZ2UoMTYpLm1hcCgoKSA9PiBMb25nKDApKTtcXG4gICAgICAgICAgICAgICAgc3ViS2V5cyhuLCBpKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgZiA9IHJhbmdlKG8pLm1hcCgoKSA9PiBMb25nKDApKTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UobykuZm9yRWFjaChyID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlKDgpLmZvckVhY2goZSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZltyXSA9IExvbmcodFtlICsgOCAqIHJdKS5zaGlmdExlZnQoOCAqIGUpLm9yKGZbcl0pXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgY29uc3QgcyA9IFtdO1xcbiAgICAgICAgICAgICAgICByYW5nZShvKS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc1t0XSA9IERFUzY0KGksIGZbdF0pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjb25zdCB1ID0gdC5zbGljZSg4ICogbyk7XFxuICAgICAgICAgICAgICAgIGxldCBoID0gTG9uZygwKTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UodC5sZW5ndGggJSA4KS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaCA9IExvbmcodVt0XSkuc2hpZnRMZWZ0KDggKiB0KS5vcihoKVxcbiAgICAgICAgICAgICAgICB9KSwgc1tvXSA9IERFUzY0KGksIGgpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBhID0gW107XFxuICAgICAgICAgICAgICAgIGxldCBjID0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UYWdbXFxcIuaOqOiNkFxcXCJdW1xcXCLpppbpobXmjqjojZBcXFwiXSA9IFxcXCJob21lL3NvbmdsaXN0XFxcIjtcXG4gICAgICAgIGlUYWdbXFxcIuaOqOiNkFxcXCJdW1xcXCLnva7pobbng63pl6hcXFwiXSA9IFxcXCJwbGF5bGlzdC9saXN0P2NvbHVtbklkPTM4MTk5NTg4XFxcIjtcXG4gICAgICAgICQucmVxdWlyZSgnbWc/cnVsZT3mrYzor43pgILphY0nKS5hamF4KFxcXCJwbGF5bGlzdC9hbGxUYWdcXFwiKS50YWdzLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpVGFnW18udGFnTmFtZV0gPSB7fTtcXG4gICAgICAgICAgICBfLnRhZ3MubWFwKF9fID0+XFxuICAgICAgICAgICAgICAgIGlUYWdbXy50YWdOYW1lXVtfXy50YWdOYW1lXSA9IGlUYWdbXFxcIuaOqOiNkFxcXCJdW1xcXCLmnIDmlrDmrYzljZVcXFwiXSArIF9fLnRhZ0lkXFxuICAgICAgICAgICAgKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl0gPSB7fTtcXG4gICAgICAgICQucmVxdWlyZSgnbWc/cnVsZT3mrYzor43pgILphY0nKS5hamF4KFxcXCJiaWxsYm9hcmQvdHJlZVxcXCIpLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoIS/kuZDCt+amnC8udGVzdChfLmNvbHVtblRpdGxlKSkge1xcbiAgICAgICAgICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXVtfLmNvbHVtblRpdGxlXSA9IF8uYmlsbEJvYXJkVm9zLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLmNvbHVtblRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8uY29sdW1uU21hbGxQaWMsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wYXRoTmFtZVxcbiAgICAgICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwibWdfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g5q2M5puy6K+m5oOFXFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vYy5tdXNpY2FwcC5taWd1LmNuL01JR1VNMi4wL3YxLjAvY29udGVudC9yZXNvdXJjZWluZm8uZG8/cmVzb3VyY2VUeXBlPTImcmVzb3VyY2VJZD1cXFwiICsgdDEpKS5yZXNvdXJjZVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGYgPSBfLmNvZGVSYXRlO1xcbiAgICAgICAgICAgICAgICAgICAgdCA9IF8ubmV3UmF0ZUZvcm1hdHM7XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbdHNbMV0gKyBTaXplKHRbMF0uYW5kcm9pZFNpemUgfHwgdFswXS5zaXplKV07XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5IUSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUodFsxXS5hbmRyb2lkU2l6ZSB8fCB0WzFdLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLlNRKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdICsgU2l6ZSh0WzJdLmFuZHJvaWRTaXplIHx8IHRbMl0uc2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuWlEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbNF0gKyBTaXplKHRbM10uYW5kcm9pZFNpemUgfHwgdFsyXS5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5aM0QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbNV0gKyBTaXplKF8uejNkQ29kZS5hbmRyb2lkU2l6ZSB8fCBfLnozZENvZGUuc2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh0cywgdDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgaW4gdHMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0Lm1hdGNoKHRzW2ldKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IE51bWJlcihpKSArIDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJC5yZXF1aXJlKFxcXCJnY3NwP3J1bGU95q2M6K+N6YCC6YWNXFxcIikubGF6eShcXFwibWd1XFxcIiwgdDEsIHQyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vaHR0cHM6JyArICQucmVxdWlyZShcXFwibWc/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KGBwbGF5L2F1dGgvZ2V0U29uZ1BsYXlJbmZvP3R5cGU9JHt0eXBlfSZjb3B5cmlnaHRJZD0ke3QxfWApLnBsYXlVcmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB0cy5zbGljZSgxKSwgdDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBscmMgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL211c2ljLm1pZ3UuY24vdjMvYXBpL211c2ljL2F1ZGlvUGxheWVyL2dldEx5cmljP2NvcHlyaWdodElkPVxcXCIgKyB0MSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL2FwcC5jLm5mLm1pZ3UuY24vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pKS5seXJpYztcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuXFxuXFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6JyArICQucmVxdWlyZShcXFwibWc/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KGBwbGF5L2F1dGgvZ2V0U29uZ1BsYXlJbmZvP3R5cGU9MSZjb3B5cmlnaHRJZD0ke3QxfWApLnBsYXlVcmw7XFxuICAgICAgICAgICAgICAgIC8vICQucmVxdWlyZShcXFwibWc/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KGBodHRwczovL2FwaXMuanhjeGluLmNuL2FwaS9taWd1bXVzaWM/aWQ9JHt0MX0mdHlwZT1qc29uYCkudXJsO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOmmlumhtVxcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKCdtZz9ydWxlPeatjOivjemAgumFjScpLmFqYXgodXJpKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFfKSBfID0ge1xcbiAgICAgICAgICAgICAgICAgICAgaXRlbXM6IFtdXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIChfLml0ZW1zIHx8IF9bMF0uaXRlbXMpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgfHwgXy50aXRsZSB8fCBfLnBsYXlMaXN0TmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcgfHwgXy5pbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkIHx8IF8ucGxheUxpc3RJZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHQyID0gJC5yZXF1aXJlKFxcXCJtZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoYHBsYXlsaXN0L2luZm8/c29uZ0xpc3RJZD0ke3QxfWApLmNvbnRlbnRDb3VudDtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm1nP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChgcGxheWxpc3Qvc29uZ3NJbmZvP3BhbHlsaXN0SWQ9JHt0MX1gLCB0Mik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBfID0ge1xcbiAgICAgICAgICAgICAgICAgICAgaXRlbXM6IFtdXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwibWc/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KGBiaWxsYm9hcmQvaG9tZT9wYXRoTmFtZT0ke3QxfWApLnNvbmdzO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIF8uaXRlbXMubWFwKF8gPT4ge1xcbiAgICAgICAgICAgIGlmIChfLmZ1bGxTb25nKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAoXy5zaW5nZXJzID8gJyAtICcgKyBfLnNpbmdlcnMubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJykgOiAnJyksXFxuICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOicgKyBfLm1lZGl1bVBpYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogXy5mdWxsU29uZy52aXBGbGFnLFxcbiAgICAgICAgICAgICAgICB6eWlkOiBfLmNvcHlyaWdodElkXFxuICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSxcXG5cXG5cXG5cXG5cXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgaXNVKSB7XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgX18gPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogKF8pID0+IHRydWUsXFxuICAgICAgICAgICAgICAgIHBhaWQ6IChfKSA9PiBfLmZ1bGxTb25nLnZpcEZsYWcgPT0gJzEnLFxcbiAgICAgICAgICAgICAgICBmcmVlOiAoXykgPT4gXy5mdWxsU29uZy52aXBGbGFnID09ICcwJ1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgc3VybCA9IChzdHlwZSkgPT4gJC5yZXF1aXJlKFxcXCJtZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcInNlYXJjaC9zb25nXFxcIiArIHN0eXBlICsgXFxcIj90ZXh0PVxcXCIgKyBrZXl3b3JkKS5pdGVtcztcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgc3VybCgnJykubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmZ1bGxTb25nICYmIF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLnNpbmdlcnMgPyAnIC0gJyArIF8uc2luZ2Vycy5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6ICcnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8ubWVkaXVtUGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLmZ1bGxTb25nLnZpcEZsYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uY29weXJpZ2h0SWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIHN1cmwoJ0xpc3QnKS5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9jLm11c2ljYXBwLm1pZ3UuY24vTUlHVU0yLjAvdjEuMC9jb250ZW50L3Jlc291cmNlaW5mby5kbz9yZXNvdXJjZVR5cGU9MiZyZXNvdXJjZUlkPVxcXCIgKyBrZXl3b3JkKSkucmVzb3VyY2VbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ05hbWUgKyAnIC0gJyArIF8uc2luZ2VyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5hbGJ1bUltZ3NbMF0uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8udmlwVHlwZSA/IDEgOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uY29weXJpZ2h0SWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm1nP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChgcGxheWxpc3QvaW5mbz9zb25nTGlzdElkPSR7a2V5d29yZH1gKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5wbGF5TGlzdE5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wbGF5TGlzdElkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG5cXG5cXG4gICAgYWpheDogZnVuY3Rpb24odXJpLCBzaXplKSB7XFxuICAgICAgICB1cmkgPSBTdHJpbmcodXJpKTtcXG4gICAgICAgIGlmICh1cmkubWF0Y2goL3BsYXlsaXN0XFxcXC8obGlzdHxzb25nc0luZm8pfGJpbGxib2FyZFxcXFwvaG9tZXxzZWFyY2hcXFxcL3NvbmcvKSAmJiAhdXJpLm1hdGNoKCdjb2x1bW5JZD0zODE5OTU4OCcpKVxcbiAgICAgICAgICAgIHVyaSArPSBcXFwiJnBhZ2VOdW09XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnBhZ2VTaXplPVxcXCIgKyAoc2l6ZSB8fCAzMCk7XFxuICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9tLm11c2ljLm1pZ3UuY24vbWlndW11c2ljL2g1L1xcXCIgKyB1cmksIHtcXG4gICAgICAgICAgICBcXFwiaGVh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AgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCI1c19pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmrYzmm7Lor6bmg4VcXG4gICAgICAgICAgICAgICAgW3QxLCB0eXBlXSA9IHQxLnNwbGl0KCcjJyk7XFxuICAgICAgICAgICAgICAgIHVyaSA9IGBzb25nL2dldFNvbmdVcmw/c29uZ2lkPSR7dDF9JnNvbmd0eXBlPSR7dHlwZX1gO1xcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCI1cz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgodXJpKTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLmxxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKFxcXCLjgJBMUeOAkVxcXCIgKyBTaXplKF8ubHFzaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXy5ocXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaChcXFwi44CQSFHjgJFcXFwiICsgU2l6ZShfLmhxc2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8uc3F1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2goXFxcIuOAkFNR44CRXFxcIiArIFNpemUoXy5zcXNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgobHF1cmwsIGhxdXJsLCBzcXVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC5tYXRjaCgn44CQTFHjgJEnKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gbHF1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaW5wdXQubWF0Y2goJ+OAkEhR44CRJykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IGhxdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGlucHV0Lm1hdGNoKCfjgJBTUeOAkScpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBzcXVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIF8ubHF1cmwsIF8uaHF1cmwsIF8uc3F1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICB0eXBlID0ge1xcbiAgICAgICAgICAgICAgICAgICAgeWM6IDEsXFxuICAgICAgICAgICAgICAgICAgICBmYzogMixcXG4gICAgICAgICAgICAgICAgICAgIGJ6OiAzXFxuICAgICAgICAgICAgICAgIH1bdHlwZV07XFxuICAgICAgICAgICAgICAgIHVybCA9IGBodHRwOi8vc2VydmljZS41c2luZy5rdWdvdS5jb20vc29uZy9kZXRhaWw/c29uZ0lkPSR7dDF9JnNvbmdUeXBlPSR7dHlwZX1gO1xcbiAgICAgICAgICAgICAgICBscmMgPSBKU09OLnBhcnNlKGZldGNoUEModXJsKSkuZGF0YS5seXJpY3MucmVwbGFjZSgvPGJyXFxcXC8/Pi9naSwgXFxcIlxcXFxuXFxcIik7XFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB1cmwgPSBfLmxxdXJsIHx8IF8uaHF1cmwgfHwgXy5zcXVybDtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvL+mmlumhtVxcbiAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKFxcXCJodHRwOi8vNXNpbmcua3Vnb3UuY29tL2dkL2dkTGlzdD8mdGFnTmFtZT1cXFwiICsgdDEgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UpO1xcbiAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJi5hbGJ1bVxcXCIpO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcIi5qeF9uYW1lJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaW1nID0gcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwxJiZzb25nbGlzdGlkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogenlpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdXJpID0gXFxcInNvbmcvZ2V0c29uZ2xpc3Rzb25nP2lkPVxcXCIgKyB0MTtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIjVzP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheCh1cmkpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgXyA9IFtdO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIHVyaSA9IFxcXCJyYW5rL2RldGFpbD9wYWdlc2l6ZT0zMCZwYWdlaW5kZXg9XFxcIiArIE1ZX1BBR0UgKyBcXFwiJmlkPVxcXCIgKyB0MTtcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwiNXM/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHVyaSkuc29uZ3M7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgaWYgKF8uU1QgPT0gdW5kZWZpbmVkIHx8IF8uU1QgPiAwKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBfLlNOICsgJyAtICcgKyBfLnVzZXIuTk4sXFxuICAgICAgICAgICAgICAgIGltZzogXy51c2VyLkksXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8uU0ssXFxuICAgICAgICAgICAgICAgIHp5aWQ6IF8uSUQgKyAnIycgKyBfLlNLXFxuICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgaXNVKSB7XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgZmlsdGVyID0ge1xcbiAgICAgICAgICAgICAgICBsaWI6IDAsXFxuICAgICAgICAgICAgICAgIHljOiAxLFxcbiAgICAgICAgICAgICAgICBmYzogMixcXG4gICAgICAgICAgICAgICAgYno6IDNcXG4gICAgICAgICAgICB9W2lzVV07XFxuICAgICAgICAgICAgc3VybCA9IChzdHlwZSkgPT4gSlNPTi5wYXJzZShmZXRjaFBDKFxcXCJodHRwOi8vc2VhcmNoLjVzaW5nLmt1Z291LmNvbS9ob21lL2pzb24/a2V5d29yZD1cXFwiICsga2V5d29yZCArIFxcXCImc29ydD0xJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiJmZpbHRlcj1cXFwiICsgZmlsdGVyICsgXFxcIiZ0eXBlPVxcXCIgKyBzdHlwZSkpLmxpc3Q7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIHN1cmwoJzAnKS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihfLCBKU09OLnBhcnNlKGZldGNoUEMoYGh0dHA6Ly9zZXJ2aWNlLjVzaW5nLmt1Z291LmNvbS9zb25nL2RldGFpbD9zb25nSWQ9JHtfLnNvbmdJZH0mc29uZ1R5cGU9JHtfLnR5cGV9YCkpLmRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ05hbWUgKyAnIC0gJyArIF8ubmlja05hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy50eXBlRW5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ0lkICsgJyMnICsgXy50eXBlRW5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIHN1cmwoJzEnKS5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpY3R1cmVVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdMaXN0SWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgW3QxLCB0Ml0gPSBrZXl3b3JkLnNwbGl0KCcjJyk7XFxuICAgICAgICAgICAgICAgICAgICB0MyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB5YzogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmYzogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICBiejogM1xcbiAgICAgICAgICAgICAgICAgICAgfVt0Ml07XFxuICAgICAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaFBDKGBodHRwOi8vc2VydmljZS41c2luZy5rdWdvdS5jb20vc29uZy9kZXRhaWw/c29uZ0lkPSR7dDF9JnNvbmdUeXBlPSR7dDN9YCkpLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ05hbWUgKyAnIC0gJyArIF8ubmlja05hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHQyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGtleXdvcmRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIHVyaSA9IFxcXCJzb25nL2dldHNvbmdsaXN0P2lkPVxcXCIgKyBrZXl3b3JkO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwiNXM/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHVyaSk7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uVCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uUCB8fCBfLnVzZXIubCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uSURcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs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3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhVxcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFt0c1swXSArIDk2LCB0c1sxXSArIDEyOCwgdHNbMl0gKyAzMjAsIHRzWzNdICsgMjAwMF07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdDIgPSBpbnB1dC5zcGxpdCgn44CRJylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJC5yZXF1aXJlKFxcXCJteT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImxpbmtcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0MSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eTogdDJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB0MSk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgbHJjID0gJC5yZXF1aXJlKFxcXCJteT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImx5cmljXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHQxXFxuICAgICAgICAgICAgICAgIH0pLmxyYztcXG4gICAgICAgICAgICAgICAgdXJscyA9IFtdO1xcbiAgICAgICAgICAgICAgICBmb3IgKHF1YWxpdHkgb2YgWzk2LCAxMjgsIDMyMCwgMjAwMF0pXFxuICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goJC5yZXF1aXJlKFxcXCJteT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImxpbmtcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHk6IHF1YWxpdHkgKyAnJ1xcbiAgICAgICAgICAgICAgICAgICAgfSkgKyAnI2lzTXVzaWM9dHJ1ZSMnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IHVybHMsXFxuICAgICAgICAgICAgICAgICAgICBuYW1lczogWyfmtYHnlYUnLCAn5qCH5YeGJywgJ+mrmOWTgScsICfml6DmjZ8nXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvL+mmlumhtVxcbiAgICAgICAgICAgICAgICBpZiAoIXQxLm1hdGNoKC9cXFxcPy8pKSB0MSA9IFxcXCJ0b3AvcGxheWxpc3Q/Y2F0PVxcXCIgKyB0MSArIFxcXCImXFxcIjtcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KHQxKTtcXG4gICAgICAgICAgICAgICAgKF8ucmVzdWx0IHx8IF8ucGxheWxpc3RzKS5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsIHx8IF8ucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSlcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm15P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwic2VhcmNoL3BsYXlsaXN0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiZFxcXCIgKyB0MVxcbiAgICAgICAgICAgICAgICAgICAgfSkubGlzdDtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IFtdO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIF8ubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAoXy5hcnRpc3QgPyAnIC0gJyArIF8uYXJ0aXN0Lm1hcChfID0+IF8ubmFtZSkuam9pbignJicpIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGltZzogXy5waWMgfHwgXy5hbGJ1bS5waWMsXFxuICAgICAgICAgICAgY29udGVudDogJ3d5JyxcXG4gICAgICAgICAgICB6eWlkOiBfLmhhc2ggfHwgXy5pZFxcbiAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBzdHlwZSwgaXNOZXcpIHtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgc3R5cGUgPSBzdHlwZSB8fCAnd3knO1xcbiAgICAgICAgICAgICAgICBzdHlwZTIgPSB7XFxuICAgICAgICAgICAgICAgICAgICAnd3knOiAnWVFEJyxcXG4gICAgICAgICAgICAgICAgICAgICdrdyc6ICdZUUInLFxcbiAgICAgICAgICAgICAgICAgICAgJ21nJzogaXNOZXcgPyAnWVFNJyA6ICdtaWd1JyxcXG4gICAgICAgICAgICAgICAgICAgICcxdCc6ICcxdGluZycsXFxuICAgICAgICAgICAgICAgICAgICAnZGInOiAnZG91YmFuJyxcXG4gICAgICAgICAgICAgICAgICAgICc1eSc6ICd3dXNpbmd5YycsXFxuICAgICAgICAgICAgICAgICAgICAnNWYnOiAnd3VzaW5nZmMnXFxuICAgICAgICAgICAgICAgIH1bc3R5cGVdO1xcblxcbiAgICAgICAgICAgICAgICBpZiAoaXNOZXcpIHtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm15P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheCgnc2VhcmNoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHN0eXBlMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IE1ZX1BBR0UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdjogJ2JldGEnXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIChfLmxpc3QgfHwgW10pLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgKF8uYXJ0aXN0ID8gJyAtICcgKyBfLmFydGlzdC5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljIHx8IF8uYWxidW0ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHN0eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaGFzaCB8fCBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gXFxcInRleHQ9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnR5cGU9XFxcIiArIHN0eXBlMjtcXG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSAkLnJlcXVpcmUoXFxcIm15P3J1bGU95q2M6K+N6YCC6YWNXFxcIikub2xkX2VuY29kZShib2R5KTtcXG4gICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly9hcGkyLmxpdW1pbmd5ZS5jbi9tL2FwaS9zZWFyY2hcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ09yaWdpbic6ICdodHRwczovL3Rvb2wubGl1bWluZ3llLmNuJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogYm9keSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IFxcXCJQT1NUXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEubGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gTGF6eSgnbXknLCBfLmlkKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybHMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnVybF9tNGEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaChfLnVybF9tNGEgKyAnI2lzTXVzaWM9dHJ1ZSMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0c1swXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsXzEyOClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKF8udXJsXzEyOCArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRzWzFdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy51cmxfMzIwKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfMzIwICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2godHNbMl0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnVybF9mbGFjKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfZmxhYyArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRzWzNdKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXIgfHwgXy5waWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHN0eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiB1cmxzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogbmFtZXMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGx5cmljOiBfLmxyY1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2VhcmNoKDEsIGtleXdvcmQsIDEpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcblxcblxcblxcblxcbiAgICBhamF4OiBmdW5jdGlvbihwYXRoLCBib2R5KSB7XFxuICAgICAgICB1cmwgPSBcXFwiaHR0cHM6Ly9hcGkubGl1bWluZ3llLmNuL20vYXBpL1xcXCIgKyBwYXRoO1xcbiAgICAgICAgYm9keS5fdCA9IERhdGUubm93KCkgKyAnJ1xcbiAgICAgICAgYm9keS50b2tlbiA9ICQucmVxdWlyZShcXFwibXk/cnVsZT3mrYzor43pgILphY1cXFwiKS5uZXdfdG9rZW4oYm9keSk7XFxuICAgICAgICBpZiAoYm9keS5xdWFsaXR5ICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgIHVyaSA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgIGZvciAoa2V5IGluIGJvZHkpXFxuICAgICAgICAgICAgICAgIHVyaSArPSAnJicgKyBrZXkgKyAnPScgKyBib2R5W2tleV07XFxuICAgICAgICAgICAgdXJpID0gU3RyaW5nKHVyaSkucmVwbGFjZSgvXiYvLCAnPycpO1xcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyB1cmk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQSxcXG4gICAgICAgICAgICAgICAgICAgICdPcmlnaW4nOiAnaHR0cHM6Ly90b29sLmxpdW1pbmd5ZS5jbicsXFxuICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeShib2R5KSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiBcXFwiUE9TVFxcXCJcXG4gICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbmV3X3Rva2VuOiBmdW5jdGlvbihib2R5KSB7XFxuICAgICAgICBbdCwgZSwgQXNdID0gW1xcbiAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgXFxcIjIwMjMwMzI3LlxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJ5R3o0bjlYRTl4WXkyT2o1VWI3RTZ1OWE1cDVhSVdaWWU1M09ycTV3RTVVZ25qYldxMDQxMFdUdm1MQk8xWjJOXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInBXOGpnL21rZTZjTzFGNENUdWFpc3doWmZRR3pNeXE1TkpSTFBWSXZEeGxBNz1FM1lyU1VvSDBiMkJYS245dGQrXFxcIlxcbiAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICBcXFwiMjAyMjEyMjIuXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIkgyaHV1d1hmOHdOOUN4NUszbEVRa2RnNFZUQ0pxSWI0NDBRUVg5NU9ReWUxRDA5MjI5MkJJNnJnakZnSzltY3hcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiUXNWbXQ0cnBxUEZKeVdjZzFZL1NSQXVMTVRlZEIzNzVYWk5EbE9HeGo2YjJ2YW45PUM4VWhIS0Urd2lmSWtvejBcXFwiXFxuICAgICAgICAgICAgXVxcbiAgICAgICAgXVswXTtcXG4gICAgICAgIHZhciBhLCBiLCBjLCBkLFxcbiAgICAgICAgICAgIHYgPSAwLFxcbiAgICAgICAgICAgIHRrID0gXFxcIlxcXCI7XFxuICAgICAgICBlID0gZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KGJvZHkpKS5zcGxpdChcXFwiXFxcIilcXG4gICAgICAgICAgICAubWFwKCh0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0LmNoYXJDb2RlQXQoMCkgXiBlLmNoYXJDb2RlQXQoTWF0aC5mbG9vcihpICUgNjQpKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICBpID0gZS5sZW5ndGggJSAzXFxuICAgICAgICBkbyB7XFxuICAgICAgICAgICAgYSA9IGVbdisrXVxcbiAgICAgICAgICAgIGIgPSBlW3YrK11cXG4gICAgICAgICAgICBjID0gZVt2KytdXFxuICAgICAgICAgICAgZCA9IGEgPDwgMTYgfCBiIDw8IDggfCBjXFxuICAgICAgICAgICAgYSA9IGQgPj4gMTggJiA2M1xcbiAgICAgICAgICAgIGIgPSBkID4+IDEyICYgNjNcXG4gICAgICAgICAgICBjID0gZCA+PiA2ICYgNjNcXG4gICAgICAgICAgICBkID0gZCAmIDYzXFxuICAgICAgICAgICAgdGsgKz0gQXMuY2hhckF0KGEpICsgQXMuY2hhckF0KGIpICsgQXMuY2hhckF0KGMpICsgQXMuY2hhckF0KGQpXFxuICAgICAgICB9IHdoaWxlICh2IDwgZS5sZW5ndGgpXFxuICAgICAgICByZXR1cm4gdCArIG1kNShpID09IDAgPyB0ayA6IHRrLnNsaWNlKDAsIGkgLSAzKSArICc9PT0nLnNsaWNlKGkgfHwgMykpXFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIG9sZF9lbmNvZGU6IGZ1bmN0aW9uKGUpIHtcXG4gICAgICAgIHZhciBwID0gbWQ1KFxcXCI8RzZzWCxMa35eMjpZJTRaXFxcIik7XFxuICAgICAgICB2YXIgYSA9IG1kNShwLnN1YnN0cigxNiwgMzIpKTtcXG4gICAgICAgIHZhciB0ID0gbmV3IERhdGUoKS5nZXRUaW1lKCkgLyAxMDAwICsgODY0MDAgPj4gMDtcXG4gICAgICAgIHZhciB0ID0gdCArIG1kNShlICsgYSkuc3Vic3RyKDAsIDE2KSArIGU7XFxuICAgICAgICB2YXIgRSA9IGUgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciBSNCA9IFIoNCk7XFxuICAgICAgICBmb3IgKGkgaW4gdCkge1xcbiAgICAgICAgICAgIGkgPSB0LmNoYXJDb2RlQXQoaSlcXG4gICAgICAgICAgICBpZiAoaSA8IDEyOCkge1xcbiAgICAgICAgICAgICAgICBlICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoaSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBlICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoaSA+PiAxMiB8IDIyNClcXG4gICAgICAgICAgICAgICAgZSArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGkgPj4gNiAmIDYzIHwgMTI4KVxcbiAgICAgICAgICAgICAgICBlICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoaSAmIDYzIHwgMTI4KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHZhciBhID0gbWQ1KHAuc3Vic3RyKDAsIDE2KSk7XFxuICAgICAgICB2YXIgYSA9IGEgKyBtZDUoYSArIFI0KTtcXG4gICAgICAgIHAgPSBbXTtcXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCAyNTY7IGkrKykgcFtpXSA9IGk7XFxuICAgICAgICBJID0gYiA9IGMgPSB0ID0gMDtcXG4gICAgICAgIGZvciAoaSBpbiBwKSB7XFxuICAgICAgICAgICAgSSA9IChJICsgcFtpXSArIGFbaSAlIDY0XS5jaGFyQ29kZUF0KCkpICUgMjU2XFxuICAgICAgICAgICAgWCA9IHBbaV1cXG4gICAgICAgICAgICBwW2ldID0gcFtJXVxcbiAgICAgICAgICAgIHBbSV0gPSBYXFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGkgaW4gZSkge1xcbiAgICAgICAgICAgIEkgPSBOdW1iZXIoaSkgKyAxO1xcbiAgICAgICAgICAgIFggPSBwW0ldO1xcbiAgICAgICAgICAgIGIgPSAoYiArIFgpICUgMjU2O1xcbiAgICAgICAgICAgIHBbSV0gPSBwW2JdO1xcbiAgICAgICAgICAgIHBbYl0gPSBYO1xcbiAgICAgICAgICAgIEUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShcXG4gICAgICAgICAgICAgICAgZVtpXS5jaGFyQ29kZUF0KCkgXlxcbiAgICAgICAgICAgICAgICBwWyhwW0ldICsgcFtiXSkgJSAyNTZdXFxuICAgICAgICAgICAgKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciBaID0gXFxcIkFCQ0RFRkdISUpLTE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CcpfToke3MucGFkU3RhcnQoNiwgJzAnKX1dYCArIGxpbmVMeXJpY1xcbiAgICB9KS5qb2luKCdcXFxcbicpO1xcbn1cXG5cXG5xaWFucWlhbiA9ICh1cmksIGpzb24pID0+IHtcXG4gICAganNvbi5hcHBpZCA9IFxcXCIxNjA3MzM2MFxcXCI7XFxuICAgIGpzb24udGltZXN0YW1wID0gTWF0aC5mbG9vcihEYXRlLm5vdygpIC8gMWUzKTtcXG4gICAgYm9keSA9IE9iamVjdC5rZXlzKGpzb24pLnNvcnQoKVxcbiAgICAgICAgLm1hcChrZXkgPT4ga2V5ICsgJz0nICsganNvbltrZXldKS5qb2luKCcmJyk7XFxuICAgIGJvZHkgKz0gXFxcIiZzaWduPVxcXCIgKyBtZDUoYm9keSArIFxcXCIwYjUwYjAyZmQwZDczYTljNGM4YzNhNzgxYzMwODQ1ZlxcXCIpO1xcbiAgICB1ID0gYGh0dHBzOi8vbXVzaWMuOTFxLmNvbS92MS8ke3VyaX0/YCArIGJvZHk7XFxuICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHUpKS5kYXRhO1xcbn1cXG5cXG5cXG5cXG4kLmV4cG9ydHMgPSB7XFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIHBsYXRmb3JtMikge1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtMikpIHtcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3p6JzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8venoxMjMuY29tJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHBvc3QodSArICcvYWpheC8nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IFxcXCJhY3Q9c2VhcmNoJmtleT1cXFwiICsga2V5d29yZCArIFxcXCImbGFuZz0mcGFnZT1cXFwiICsgTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubW5hbWUgKyAnIC0gJyArIF8uc25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogdSArIF8ucGljLnJlcGxhY2UoL1xcXFw/LiovLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICd6eicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWQgKyAnI3p6J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzF0JzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKGBodHRwczovL3NvLjF0aW5nLmNvbS9zb25nL2pzb24/cT0ke2tleXdvcmR9JnBhZ2U9JHtNWV9QQUdFfSZzaXplPTMwYCkpLnJlc3VsdHMubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nX25hbWUgKyAnIC0gJyArIF8uc2luZ2VyX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOicgKyBfLmFsYnVtX2NvdmVyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnMXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdfaWQgKyAnIzF0J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzVuZCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwOi8vbS41bmQuY29tL3NvL3NfXFxcIiArIGtleXdvcmQpLCBcXFwiYm9keSYmLmxpc3Qtc29uZyYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi5zb25nJiZUZXh0XFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcIi5hcnRpc3QmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICc1bmQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSYmaHJlZlxcXCIpLnJlcGxhY2UoLy4qXFxcXC98XFxcXC4uKi9nLCAnJykgKyAnIzVuZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnYmxtJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKGBodHRwczovL2JsYWNrYmxtLmJhaWxlbWkuY29tL2luZGV4LnBocC9kYW5jZS9zZWFyY2g/a2V5PSR7a2V5d29yZH0mcGFnZT0ke01ZX1BBR0V9YCkpLmRhbmNlbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IF8uZG93bnVybCB8fCBfLnBsYXl1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwgJiYgXy5uYW1lKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyAoXy5zaW5nZXIgfHwgXy51cF91c2VyKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlciB8fCBfLnVwX3VzZXJfbG9nbyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdibG0nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25naWQgKyAnI2JsbSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICc5dCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChgaHR0cDovL25ldy45c2t5LmNvbS9hcGkvd2VpYm8vY29udGVudC9zZWFyY2g/Y29udGVudD0ke2tleXdvcmR9YCkpLmRhdGEuc29uZ19saXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9eTiQvaS50ZXN0KF8uaXNfc3RhdGlvbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL25ldy45c2t5LmNvbS9hcGkvc29uZy9kZXRhaWw/aWQ9XFxcIiArIF8uc29uZ19pZCArIFxcXCImaXNfbG9naW49TlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaCh1KSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nX25hbWUgKyAnIC0gJyArIF8ubXVzaWNpYW5fbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uZGlzY19pbWdfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICc5dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25nX2lkICsgJyM5dCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXy5zb25nX3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY191cmwgfHwgTHJjKF8uZGVzaWduX25vdGVzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2xpYic6XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdiZCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcWlhbnFpYW4oXFxcInNlYXJjaFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd29yZDoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZU5vOiBNWV9QQUdFXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkudHlwZVRyYWNrLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFfLmlzVmlwKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRsZSArICcgLSAnICsgXy5hcnRpc3QubWFwKF8gPT4gXy5hcnRpc3RUeXBlTmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdiZCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkICsgJyNiZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5o6l5Y+j6ZSZ6K+vflxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuayoeacieWPr+S7peaQnOe0ouatjOWNleeahOaOpeWPo35cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIFt0MSwgcGxhdGZvcm0sIHR5cGVdID0gdDEuc3BsaXQoJyMnKTtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ3p6JzpcXG4gICAgICAgICAgICAgICAgdSA9ICdodHRwczovL3p6MTIzLmNvbSc7XFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKHBvc3QodSArICcvYWpheC8nLCB7XFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFwiYWN0PXNvbmdpbmZvJmlkPVxcXCIgKyB0MSArIFxcXCImbGFuZz1cXFwiXFxuICAgICAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgICAgICAgICB1cmwgPSB1ICsgXy5tcDM7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZShyZXF1ZXN0KHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZmVyZXI6IHVcXG4gICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IF8ubHJjLnJlcGxhY2UoL1xcXFxyL2csICcnKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgY2FzZSAnMXQnOlxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vd3d3LjF0aW5nLmNvbVxcXCI7XFxuICAgICAgICAgICAgICAgIHBhdGggPSBleGVjdXRlV2ViUnVsZShgaHR0cHM6Ly9oNS4xdGluZy5jb20vc29uZy9gICsgdDEsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdfc29uZ19tZXRhLnNvbmdfcGF0aDtcXG4gICAgICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHVybCA9IHUgKyBcXFwiL2FwaS9hdWRpbz9cXFwiICsgcGF0aDtcXG4gICAgICAgICAgICAgICAgaGVhZCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZlcmVyOiB1XFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoKHVybCwgaGVhZCkpLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCwgaGVhZCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbHJjID0gdSArIFxcXCIvdG91Y2gvYXBpL2x5cmljL1xcXCIgKyB0MTtcXG4gICAgICAgICAgICAgICAgbHJjID0gSlNPTi5wYXJzZShmZXRjaChscmMpKS5seXJpY19jb250ZW50O1xcbiAgICAgICAgICAgICAgICBpZiAoIWxyYy5tYXRjaCgvXFxcXFtcXFxcZCs6XFxcXGQrLykpXFxuICAgICAgICAgICAgICAgICAgICBscmMgPSBMcmMobHJjKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlcjogdVxcbiAgICAgICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICc1bmQnOlxcbiAgICAgICAgICAgICAgICBpdGVtID0gZmV0Y2goYGh0dHA6Ly9tLjVuZC5jb20vdGluZy8ke3QxfS5odG1sYCk7XFxuICAgICAgICAgICAgICAgIGV2YWwoaXRlbS5tYXRjaCgvbXAzID0gLio/Oy8pWzBdKTtcXG4gICAgICAgICAgICAgICAgdXJsID0gJ2h0dHA6Ly9tcGdlLjVuZC5jb20vJyArIG1wMztcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybCA9IEpTT04ucGFyc2UoZmV0Y2godXJsKSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBscmMgPSBwZGZoKGl0ZW0sIFxcXCIjbHJjY29udCYmSHRtbFxcXCIpLnJlcGxhY2UoLzxcXFxcIS0tLio/LS0+fDxiclxcXFwvPz4vZ2ksICdcXFxcbicpXFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICdibG0nOlxcbiAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8vYmxhY2tibG0uYmFpbGVtaS5jb20vaW5kZXgucGhwL2RhbmNlL3BsYXkvaWQvJyArIHQxO1xcbiAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaCh1KSk7XFxuICAgICAgICAgICAgICAgIHVybCA9IF8uZG93bnVybCB8fCBfLnBsYXl1cmw7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICc5dCc6XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL25ldy45c2t5LmNvbS9hcGkvc29uZy9kZXRhaWw/aWQ9XFxcIiArIHQxICsgXFxcIiZpc19sb2dpbj1OXFxcIjtcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2godSkpLmRhdGE7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBfLnNvbmdfdXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW18uc29uZ191cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY191cmwgfHwgTHJjKF8uZGVzaWduX25vdGVzKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgY2FzZSAnYmQnOlxcbiAgICAgICAgICAgICAgICBfID0gcWlhbnFpYW4oXFxcInNvbmcvdHJhY2tsaW5rXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgVFNJRDogdDFcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBfLnBhdGgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXy5wYXRoICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBscmM6IF8ubHlyaWNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgfVxcbiAgICB9XFxufVwifV0iLCJpY29uIjoiaHR0cDovL21tYml6LnFwaWMuY24vbW1iaXpfcG5nLzVzN0oyOFU5R0hWaWNEN2d1dnliYXNlODZIaEhDMTJvT0RidHJzZ0s3Q3hyajVRcEw2Z0tueWliZVpEd0VLSVZLVU90UG9IY3hwZndhMHBvbloxaWE1bmxBLzA/d3hfZm10PXBuZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment