xiaomianao666

小程序:歌词适配

Jun 19th, 2024
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@歌词适配@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5q2M6K+N6YCC6YWNIiwiYXV0aG9yIjoiVGhvbWFz5ZayIiwidXJsIjoiaGlrZXI6Ly9lbXB0eT9wPWZ5cGFnZSIsInZlcnNpb24iOjIwMjQwNjA3LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6JC5yZXF1aXJlKCdob21lP3J1bGU95q2M6K+N6YCC6YWNJyk7Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHk/cz0qKiIsImdyb3VwIjoiI+mfs+S5kCIsInNlYXJjaEZpbmQiOiJqczpcbnNldFJlc3VsdChbe1xuICAgIHRpdGxlOiBcIuaQnOe0oiA9PiBcIiArIE1ZX0tFWVdPUkQsXG4gICAgZGVzYzogJ+mAmui/h1wi6auY57qn5pCc57SiXCLpobXpnaLmkJzntKInLFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc190MikgPT4ge1xuICAgICAgICBpZiAoZ2V0TXlWYXIoJ3NfcGxhdGZvcm0nLCAnbGliJykgPT0gJ2xpYicpXG4gICAgICAgICAgICBwdXRNeVZhcignc19wbGF0Zm9ybScsIGdldEl0ZW0oJ3NfcGxhdGZvcm0nLCAna3cnKSk7XG4gICAgICAgIHB1dE15VmFyKCdzX3QyJywgc190Mik7XG4gICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJj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piFIOaJuemHj+aUtuiXjyDimIVcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChjbHNJZCwgc2kpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDAsXFxuICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IGZpbmRJdGVtc0J5Q2xzKGNsc0lkKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9fY2F0Y2gvSW1wb3J0LnR4dFxcXCIsIEpTT04uc3RyaW5naWZ5KGpzb24pKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvcmVseTIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU95q2M6K+N6YCC6YWNXFxcIjtcXG4gICAgICAgICAgICB9LCBpZCArICc6YWRkbGlzdCcsIHQxKVxcbiAgICAgICAgfV1cXG4gICAgfTtcXG4gICAgaWYgKF8uZGVzYy5tYXRjaCgvcXF8d3l8a2d8a3d8bWd8NXMvKSAmJiBfLmNvbnRlbnQgIT0gMykge1xcbiAgICAgICAgXy5leHRyYS5sb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLinKkg5aSN5Yi26ZO+5o6lIOKcqVxcXCIsXFxuICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGEsIGIsIGMpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuY29weXVybChhLCBiLCBjKTtcXG4gICAgICAgICAgICB9LCBfLmRlc2MsIF8uY29udGVudCwgXy56eWlkKVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG5cXG4gICAgaWYgKHIzKSB7XFxuICAgICAgICByNCA9ICQocjMubmFtZXMsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKG5hbWVzLCB1cmxzKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGkgPSBuYW1lcy5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybHNbaV07XFxuICAgICAgICB9LCByMy5uYW1lcywgcjMudXJscyk7XFxuICAgICAgICBpZiAocjEgPT0gMikge1xcbiAgICAgICAgICAgIF8udXJsID0gcjQ7XFxuICAgICAgICAgICAgXy5leHRyYS51cmwgPSByMztcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgXy51cmwgPSByMztcXG4gICAgICAgICAgICBfLmV4dHJhLnVybCA9IHI0O1xcbiAgICAgICAgfVxcbiAgICAgICAgXy5leHRyYS5sb25nQ2xpY2sudW5zaGlmdCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLimIUg5LiL6L295q2M5puyIOKYhVxcXCIsXFxuICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKG5hbWVzLCB1cmxzKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKG5hbWVzLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChuYW1lcywgdXJscykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaSA9IG5hbWVzLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmxzW2ldO1xcbiAgICAgICAgICAgICAgICB9LCBuYW1lcywgdXJscyk7XFxuICAgICAgICAgICAgfSwgcjMubmFtZXMsIHIzLnVybHMpXFxuICAgICAgICB9KTtcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIF8udXJsID0gTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkLCByMSA9PSAyKTtcXG4gICAgICAgIGlmICghdDEpIHtcXG4gICAgICAgICAgICBfLmV4dHJhLnVybCA9IExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCwgcjEgIT0gMik7XFxuICAgICAgICAgICAgXy5leHRyYS5sb25nQ2xpY2sudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4piFIOS4i+i9veatjOabsiDimIVcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICB9LCBMYXp5KF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQsIDEpKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIF8uY29sX3R5cGUgPSAnY2FyZF9waWNfMyc7XFxuICAgIGlmIChyMikgcmV0dXJuIF87XFxuICAgIGQucHVzaChfKTtcXG59XFxuXFxuXFxuXFxuJC5leHBvcnRzID0ge1xcblxcblxcblxcbiAgICBsb2dEYXRhOiBmdW5jdGlvbihuZXdEYXRhLCBzaSwgbmFtZSkge1xcbiAgICAgICAgaWYgKG5ld0RhdGEuenlpZCA9PT0gXFxcInVuZGVmaW5lZFxcXCIpXFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeaUr+aMgeaUtuiXj35cXFwiO1xcblxcbiAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgaWYgKHp5ID09PSBcXFwiXFxcIikgenkgPSB7XFxuICAgICAgICAgICAgXFxcIuWFqOmDqFxcXCI6IFtdXFxuICAgICAgICB9LCBzdG9yYWdlMC5zZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSwgenkpO1xcbiAgICAgICAgbGV0IHp1ID0gT2JqZWN0LmtleXMoenkpO1xcblxcblxcbiAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmlrDnu4RcXFwiKSwgMywgXFxcIumAieaLqee7hFxcXCIpLnNlbGVjdCgoenksIHp1LCBuZXdEYXRhLCBzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5paw57uEXFxcIikge1xcbiAgICAgICAgICAgICAgICBpZiAoIXp1LmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobmFtZSwgXFxcIuivt+i+k+WFpeaWsOe7hOWQjeensFxcXCIpLmlucHV0KCh6eSwgenUsIG5ld0RhdGEsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0LnRyaW0oKS5tYXRjaCgvXlxcXFxkK3xeXFxcXHMqKOaWsOe7hCk/XFxcXHMqJC8pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v57uE5ZCN5LiN6IO95Li656m6ICYg5pyA5YmN6Z2i5LiN6IO95piv5pWw5a2XICYg5Lmf5LiN6IO95Y+r5paw57uEXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAzLCAn6K+36YCJ5oup5paw57uE5L2N572uJykuc2VsZWN0KCh6eSwgaW5wdXQyLCBuZXdEYXRhcywgc2kpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld0RhdGEgPSBBcnJheS5pc0FycmF5KG5ld0RhdGFzKSA/IG5ld0RhdGFzIDogW25ld0RhdGFzXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmnIDlkI7pnaJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpbnB1dDJdID0gbmV3RGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpIGluIHp5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpbnB1dDJdID0gbmV3RGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpXSA9IHp5W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG5ld0RhdGFzKSkgYmFjayh0cnVlKSwgdG9hc3QoJ+aIkOWKnycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgenksIGlucHV0LCBuZXdEYXRhLCBzaSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCB6eSwgenUsIG5ld0RhdGEsIHNpLCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liIbnu4TlkI3np7Dph43lpI3kuoZ+XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB6eSA9IHp5W2lucHV0XTtcXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShuZXdEYXRhKSkge1xcbiAgICAgICAgICAgICAgICB6eSA9IHp5LmNvbmNhdChuZXdEYXRhKTtcXG4gICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgdG9hc3QoJ+aIkOWKnycpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSwgaW5wdXQpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB6dSA9IHp5Lm1hcChpdCA9PiBpdC50aXRsZSk7XFxuICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMiwgJ+ivt+mAieaLqei1hOa6kOS9jee9ricpLnNlbGVjdCgoenksIHp1LCBpbnB1dDIsIG5ld0RhdGEsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5pyA5ZCO6Z2iXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgenkucHVzaChuZXdEYXRhKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpID0genUuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMCwgbmV3RGF0YSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGlucHV0Mik7XFxuICAgICAgICAgICAgfSwgenksIHp1LCBpbnB1dCwgbmV3RGF0YSwgc2kpO1xcbiAgICAgICAgfSwgenksIHp1LCBuZXdEYXRhLCBzaSk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNldERhdGE6IGZ1bmN0aW9uKHNpLCB6eTIsIGtleSkge1xcbiAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgaWYgKGtleSkge1xcbiAgICAgICAgICAgIHp5W2tleV0gPSB6eTI7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHp5ID0genkyO1xcbiAgICAgICAgfVxcbiAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2ksIHp5KTtcXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/miJDlip9cXFwiO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBjb3B5dXJsOiBmdW5jdGlvbihBLCBCLCBDKSB7XFxuICAgICAgICBzd2l0Y2ggKEEpIHtcXG4gICAgICAgICAgICBjYXNlICdxcSc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoQikge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vaS55LnFxLmNvbS9uMi9tL3NoYXJlL2RldGFpbHMvdGFvZ2UuaHRtbD9pZD0nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vaS55LnFxLmNvbS92OC9wbGF5c29uZy5odG1sP3NvbmdtaWQ9JyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnd3knOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL3kubXVzaWMuMTYzLmNvbS9tL3BsYXlsaXN0P2lkPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly95Lm11c2ljLjE2My5jb20vbS9zb25nP2lkPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ2tnJzpcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChCKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQy5tYXRjaCgvXy8pKSByZXR1cm4gXFxcInRvYXN0Oi8v5LiN5pSv5oyBZ2NpZOmTvuaOpeWIhuS6q1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vbS5rdWdvdS5jb20vd2VpYm8vP3NoYXJlX3R5cGU9c3BlY2lhbCZpZD0nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vbS5rdWdvdS5jb20vd2VpYm8vP2hhc2g9JyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAna3cnOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ua3V3by5jbi9uZXdoNWFwcC9wbGF5bGlzdF9kZXRhaWwvJyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ua3V3by5jbi9uZXdoNWFwcC9wbGF5X2RldGFpbC8nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdtZyc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoQikge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vbS5tdXNpYy5taWd1LmNuL3YzL211c2ljL3BsYXlsaXN0LycgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9tLm11c2ljLm1pZ3UuY24vdjMvbXVzaWMvc29uZy8nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICc1cyc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoQikge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHA6Ly81c2luZy5rdWdvdS5jb20vdG9waWMvc2hhcmUvc29uZ2xpc3QvIy8/aWQ9JyArIEM7XFxuICAgICAgICAgICAgICA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dyb3VwTmFtZV0ucHVzaChFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF9fLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogX18uaGVhZFBpY1VybCB8fCBfXy5mcm9udFBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF9fLnRvcElkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxLCAxKSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicXFfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBsZXQgbGlzdCwgXywgdTtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDor6bmg4UgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwczovL3UueS5xcS5jb20vY2dpLWJpbi9tdXNpY3UuZmNnXFxcIjtcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgodSwge1xcbiAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbW06IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Q6ICcxOScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN2OiAnMTg1OSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGU6ICdtdXNpYy5wZl9zb25nX2RldGFpbF9zdnInLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdnZXRfc29uZ19kZXRhaWxfeXFxJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvbmdfbWlkOiB0MVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICB9KS5yZXEuZGF0YS50cmFja19pbmZvO1xcbiAgICAgICAgICAgICAgICBsZXQgZiA9IF8uZmlsZTtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5LiL6L29XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV8xMjhtcDMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0gKyBTaXplKGYuc2l6ZV8xMjhtcDMpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLnNpemVfMzIwbXAzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdICsgU2l6ZShmLnNpemVfMzIwbXAzKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5zaXplX2ZsYWMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10gKyBTaXplKGYuc2l6ZV9mbGFjKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5zaXplX2hpcmVzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzRdICsgU2l6ZShmLnNpemVfaGlyZXMpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJkb3duXFxcIiwgXFxcInFxXFxcIiwgdDEsIGksIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBfKTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgdmFyIHVybCwgaWksIGxyYztcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZltcXFwic2l6ZV9oaXJlc1xcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJxcVxcXCIsIHQxLCAzLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmW1xcXCJzaXplX2ZsYWNcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwicXFcXFwiLCB0MSwgMiwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZltcXFwiMzIwbXAzXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInFxXFxcIiwgdDEsIDEsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5wYXkucGF5X3BsYXkgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJxcVxcXCIsIHQxLCAwLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ICs9IGA/ZGF0YT17XFxcInJlcV8wXFxcIjp7XFxcIm1vZHVsZVxcXCI6XFxcInZrZXkuR2V0VmtleVNlcnZlclxcXCIsXFxcIm1ldGhvZFxcXCI6XFxcIkNnaUdldFZrZXlcXFwiLFxcXCJwYXJhbVxcXCI6e1xcXCJndWlkXFxcIjpcXFwiMFxcXCIsXFxcInBsYXRmb3JtXFxcIjpcXFwiMjBcXFwiLFxcXCJmaWxlbmFtZVxcXCI6W1xcXCJNNTAwJHt0MSt0MX0ubXAzXFxcIl0sXFxcInNvbmdtaWRcXFwiOltcXFwiJHt0MX1cXFwiXX19fWA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fID0gYWpheCh1KS5yZXFfMC5kYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBfXy5taWR1cmxpbmZvWzBdLnB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwgJiYgdXJsICE9IFxcXCJcXFwiKSB1cmwgPSBfXy5zaXBbMF0gKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghdXJsKSByZXR1cm4gXFxcInRvYXN0Oi8v5peg5rOV6Kej5p6QXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5q2M6K+NXFxuICAgICAgICAgICAgICAgIGlmICghbHJjKSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBsVHlwZSBvZiBbXFxcIm5ld1xcXCIsIFxcXCJ5cXFcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IGFqYXgoXFxcImh0dHA6Ly9jLnkucXEuY29tL2x5cmljL2ZjZ2ktYmluL2ZjZ19xdWVyeV9seXJpY19cXFwiICsgbFR5cGUgKyBcXFwiLmZjZz9mb3JtYXQ9anNvbiZub2Jhc2U2ND0xJnNvbmdtaWQ9XFxcIiArIHQxKS5seXJpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFscmMubWF0Y2goL1xcXFxbXFxcXGQrXFxcXDpcXFxcZCsvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gTHJjKGxyYywgXy5pbnRlcnZhbCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChscmMpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwczovL2MueS5xcS5jb20vc3BsY2xvdWQvZmNnaS1iaW4vZmNnX2dldF9kaXNzX2J5X3RhZy5mY2c/Zm9ybWF0PWpzb24mY2F0ZWdvcnlJZD1cXFwiICsgdDEgKyBcXFwiJnNpbj1cXFwiICsgKChNWV9QQUdFIC0gMSkgKiAzMCkgKyBcXFwiJmVpbj1cXFwiICsgKChNWV9QQUdFICogMzApIC0gMSk7XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHUpLmRhdGE7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBfLmxpc3Q7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uZGlzc25hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uZGlzc2lkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIF8uc3VtIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vYy55LnFxLmNvbS9xem9uZS9mY2ctYmluL2ZjZ191Y2NfZ2V0Y2RpbmZvX2J5aWRzX2NwLmZjZz9mb3JtYXQ9anNvbiZ0eXBlPTEmdXRmOD0xJmRpc3N0aWQ9XFxcIiArIHQxO1xcbiAgICAgICAgICAgICAgICBfID0gYWpheCh1KS5jZGxpc3RbMF0uc29uZ2xpc3Q7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwczovL3UueS5xcS5jb20vY2dpLWJpbi9tdXNpY3UuZmNnP2dfdGs9NTM4MSZkYXRhPVxcXCIgKyBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiZGV0YWlsXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJtb2R1bGVcXFwiOiBcXFwibXVzaWNUb3BsaXN0LlRvcGxpc3RJbmZvU2VydmVyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIkdldERldGFpbFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidG9wSWRcXFwiOiArdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJvZmZzZXRcXFwiOiAoTVlfUEFHRSAtIDEpICogMzAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJudW1cXFwiOiAzMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBlcmlvZFxcXCI6IFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiY29tbVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImN0XFxcIjogMjQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjdlxcXCI6IDBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICA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gPT0gJzEnLFxcbiAgICAgICAgICAgICAgICBmcmVlOiAoXykgPT4gXy5wYXkucGF5X3BsYXkgPT0gJzAnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBzdXJsID0gKHN0eXBlKSA9PiBhamF4KFxcXCJodHRwOi8vdTYueS5xcS5jb20vY2dpLWJpbi9tdXNpY3UuZmNnXFxcIiwge1xcbiAgICAgICAgICAgICAgICBcXFwiYm9keVxcXCI6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJyZXFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1vZHVsZVxcXCI6IFxcXCJtdXNpYy5zZWFyY2guU2VhcmNoQ2dpU2VydmljZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJEb1NlYXJjaEZvclFRTXVzaWNMaXRlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1cXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJxdWVyeVxcXCI6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hfdHlwZVxcXCI6IHN0eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibnVtX3Blcl9wYWdlXFxcIjogMzAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYWdlX251bVxcXCI6IE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIlBPU1RcXFwiXFxuICAgICAgICAgICAgfSkucmVxLmRhdGE7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsKDApO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYm9keS5pdGVtX3Nvbmc7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5zaW5nZXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogKGFsYnVtaWQgPSBfLmFsYnVtbWlkIHx8IChfLmFsYnVtID8gXy5hbGJ1bS5taWQgOiBcXFwiXFxcIikpICE9IFxcXCJcXFwiID8gYGh0dHBzOi8veS5ndGltZy5jbi9tdXNpYy9waG90b19uZXcvVDAwMlIzMDB4MzAwTTAwMCR7YWxidW1pZH0uanBnYCA6IFxcXCJoaWtlcjovL2ltYWdlcy9ydWxlX3R5cGVfYXVkaW9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnBheS5wYXlfcGxheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5taWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybCgzKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLmJvZHkuaXRlbV9zb25nbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLmRpc3NuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5sb2dvLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXy5tZXRhLnN1bSB8fCAoKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGgpO1xcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChcXFwiaHR0cHM6Ly91LnkucXEuY29tL2NnaS1iaW4vbXVzaWN1LmZjZ1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW06IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0OiAnMTknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Y6ICcxODU5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZTogJ211c2ljLnBmX3NvbmdfZGV0YWlsX3N2cicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdnZXRfc29uZ19kZXRhaWxfeXFxJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29uZ19taWQ6IGtleXdvcmRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICB9KS5yZXEuZGF0YS50cmFja19pbmZvO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIF8uc2luZ2VyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogKGFsYnVtaWQgPSBfLmFsYnVtbWlkIHx8IChfLmFsYnVtID8gXy5hbGJ1bS5taWQgOiBcXFwiXFxcIikpICE9IFxcXCJcXFwiID8gYGh0dHBzOi8veS5ndGltZy5jbi9tdXNpYy9waG90b19uZXcvVDAwMlIzMDB4MzAwTTAwMCR7YWxidW1pZH0uanBnYCA6IFxcXCJoaWtlcjovL2ltYWdlcy9ydWxlX3R5cGVfYXVkaW9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8ucGF5LnBheXBsYXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5taWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJodHRwOi8vYy55LnFxLmNvbS9xem9uZS9mY2ctYmluL2ZjZ191Y2NfZ2V0Y2RpbmZvX2J5aWRzX2NwLmZjZz9mb3JtYXQ9anNvbiZ0eXBlPTEmdXRmOD0xJmRpc3N0aWQ9XFxcIiArIGtleXdvcmQpLmNkbGlzdFswXTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogUmljaChfLmRpc3NuYW1lKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ubG9nbyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uZGlzc3RpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIDA7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHJlZnJlc2hfbG9naW46IGZ1bmN0aW9uKGNvb2tpZSwgcnVuKSB7XFxuICAgICAgICBsZXQgYm9keSwgYywgQyA9IFN0cmluZyhjb29raWUpLnRyaW0oKTtcXG4gICAgICAgIGMgPSBDLnNwbGl0KC9xbV9rZXlzdD0vaSk7XFxuICAgICAgICBsZXQga2V5ID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgIGMgPSBDLnNwbGl0KC91aW49L2kpO1xcbiAgICAgICAgbGV0IHVpbiA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICBpZiAoa2V5LnN0YXJ0c1dpdGgoJ1dfWCcpKSB7XFxuICAgICAgICAgICAgYm9keSA9IHtcXG4gICAgICAgICAgICAgICAgXFxcImNvbW1cXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiZlBlcnNvbmFsaXR5XFxcIjogXFxcIjBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInRtZUxvZ2luVHlwZVxcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0bWVMb2dpbk1ldGhvZFxcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImF1dGhzdFxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImN0XFxcIjogXFxcIjExXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjdlxcXCI6IFxcXCIxMjA4MDAwOFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidlxcXCI6IFxcXCIxMjA4MDAwOFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidG1lQXBwSURcXFwiOiBcXFwicXFtdXNpY1xcXCJcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgXFxcInJlcTFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibW9kdWxlXFxcIjogXFxcIm11c2ljLmxvZ2luLkxvZ2luU2VydmVyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJtZXRob2RcXFwiOiBcXFwiTG9naW5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb2RlXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm9wZW5pZFxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJyZWZyZXNoX3Rva2VuXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInN0cl9tdXNpY2lkXFxcIjogdWluLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJtdXNpY2tleVxcXCI6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwidW5pb25pZFxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJyZWZyZXNoX2tleVxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJsb2dpbk1vZGVcXFwiOiAyXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGJvZHkgPSB7XFxuICAgICAgICAgICAgICAgICdyZXExJzoge1xcbiAgICAgICAgICAgICAgICAgICAgJ21vZHVsZSc6ICdRUUNvbm5lY3RMb2dpbi5Mb2dpblNlcnZlcicsXFxuICAgICAgICAgICAgICAgICAgICAnbWV0aG9kJzogJ1FRTG9naW4nLFxcbiAgICAgICAgICAgICAgICAgICAgJ3BhcmFtJzoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdleHBpcmVkX2luJzogNzc3NjAwMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXVzaWNpZCc6IHVpbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXVzaWNrZXknOiBrZXlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGJvZHkgPSBKU09OLnN0cmluZ2lmeShib2R5KTtcXG4gICAgICAgIGxldCB1cmwgPSBcXFwiaHR0cHM6Ly91LnkucXEuY29tL2NnaS1iaW4vbXVzaWNzLmZjZz9zaWduPXp6YVxcXCIgKyBSKDE2KSArIG1kNSgnQ0pCUEFDclJ1Tnk3JyArIGJvZHkpO1xcbiAgICAgICAgbGV0IF8gPSBKU09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gICAgaW1nOiAnaHR0cDovL21tYml6LnFwaWMuY24vbW1iaXpfcG5nLzVzN0oyOFU5R0hWaWNEN2d1dnliYXNlODZIaEhDMTJvT0RidHJzZ0s3Q3hyajVRcEw2Z0tueWliZVpEd0VLSVZLVU90UG9IY3hwZndhMHBvbloxaWE1bmxBLzA/d3hfZm10PXBuZycsXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4piF5omT5byA5LqM57qn4piFXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMnKS5ydWxlKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W25hbWVdLm1hcChfID0+IEV4dHJhKF8pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiVEdY5pS26JePIC0g6I635Y+W6ZSZ6K+vXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IChzaSA9PSAnMCcgPyAn5q2M5puyJyA6ICfmrYzljZUnKSArIFxcXCLliIbnu4Qg44CMXFxcIiArIG5hbWUgKyBcXFwi44CNIOS4jeWtmOWcqO+8n1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5L+u5pS5XFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCB6dSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLkv67mlLnlkI3np7BcXFwiLCBcXFwi5pu05pS55o6S5bqPXFxcIiwgXFxcIuWIhue7hOWQiOW5tlxcXCIsIF0sIDEsICfpgInmi6nopoHlj5jmm7TnmoTkuovku7YnKS5zZWxlY3QoKHNpLCB6dSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5L+u5pS55ZCN56ewJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5paw55qE57uE5ZCNXFxcIikuaW5wdXQoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0Lm1hdGNoKC9eXFxcXHMqKOaWsOe7hHzmnIDlkI7pnaIpP1xcXFxzKiQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+e7hOWQjeS4jeiDveS4uuepuu+8jOS5n+S4jeiDveiuvue9ruS4uifmlrDnu4QnLyfmnIDlkI7pnaInXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgaW4genkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gbmFtZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpbnB1dF0gPSB6eVtpXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpXSA9IHp5W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5pu05pS55o6S5bqPJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSB6dS5pbmRleE9mKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenUuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMiwgJ+ivt+mAieaLqei1hOa6kOS9jee9ricpLnNlbGVjdCgoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSBvZiB6dSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltuYW1lXSA9IHp5W25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpJywgenUuaW5kZXhPZihpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpXSA9IHp5W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwi5pyA5ZCO6Z2iXFxcIiA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW25hbWVdID0genlbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd0aScsIHp1Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfliIbnu4TlkIjlubYnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dSwgMywgJ+mAieaLqeimgeWQiOW5tueahOWIhue7hCcpLnNlbGVjdCgoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSBvZiB6dSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaV0gPSB6eVtpXS5jb25jYXQoenlbbmFtZV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpJywgenUuaW5kZXhPZihpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpXSA9IHp5W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIG5hbWUpO1xcbiAgICAgICAgICAgICAgICB9LCBzaSwgenUsIG5hbWUpXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaXRjaDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlbbmFtZV1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuZ2V0U2hhcmUoanNvbiwgZmFsc2UsIGpzb24uZGF0YS5sZW5ndGgpO1xcbiAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6Zmk5YiG57uEIFxcXCIgKyBuYW1lICsgXFxcIiDlkJfvvJ9cXFxcbuatpOaTjeS9nOS4jeWPr+mAhu+8jOiwqOaFjumAieaLqeOAglxcXCIpLmNvbmZpcm0oKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXR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cIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnIl+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpXFxuICAgIH0pO1xcbn0gZWxzZSB7XFxuICAgIGlmICh6eVt6dVt0aV1dLmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgZGVsZXRlIHp5W3p1W3RpXV07XFxuICAgICAgICBjbGVhck15VmFyKCd0aScpO1xcbiAgICAgICAgJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBsZXQgaWkgPSAwO1xcbiAgICAgICAgenlbenVbdGldXS5tYXAoKF8sIGkpID0+IHtcXG4gICAgICAgICAgICBpZiAoKChjX3BsYXRmb3JtID09ICdsaWInIHx8IGNfcGxhdGZvcm0gPT0gXy5kZXNjKSAmJiAoY190MiA9PSAnbGliJyB8fCBjX3QyID09IF8uY29udGVudCkpIHx8IChjX3BsYXRmb3JtID09ICdsaWInICYmICgoY190MiA9PSBfLmNvbnRlbnQpIHx8IChjX3QyID09ICcwJyAmJiBfLmNvbnRlbnQgIT0gJzEnKSkpKSB7XFxuICAgICAgICAgICAgICAgIF8uZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArICc6YWRkbGlzdCcsXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5L+u5pS5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCB6dSwga2V5LCBpLCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIuS/ruaUueWQjeensFxcXCIsIFxcXCLmm7TmlLnmjpLluo9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCLkv67mlLnlsIHpnaJcXFwiLCBcXFwi5YiH5o2i5YiG57uEXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKlxcXCLmibnph4/mjaLnu4RcXFwiKi9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDIsICfpgInmi6nopoHlj5jmm7TnmoTkuovku7YnKS5zZWxlY3QoKHNpLCB6dSwga2V5LCBpLCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfkv67mlLnlkI3np7AnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfkv67mlLnlsIHpnaInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3R5cGUsIHRleHRdID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCLkv67mlLnlkI3np7BcXFwiOiBbJ3RpdGxlJywgJ+ivt+i+k+WFpeaWsOeahOWQjeensCddLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCLkv67mlLnlsIHpnaJcXFwiOiBbXy5pbWcgPyAnaW1nJyA6ICdwaWMnLCAn6K+36L6T5YWl5q2j56Gu55qE5bCB6Z2i5Zyw5Z2AJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1baW5wdXRdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoX1t0eXBlXSwgdGV4dCkuaW5wdXQoKHNpLCBrZXksIGksIHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSAndGl0bGUnICYmIGlucHV0Lm1hdGNoKC9eXFxcXHMq5pyA5ZCO6Z2iXFxcXHMqJC8pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6LWE5rqQ5ZCN5LiN6IO96K6+572u5oiQJ+acgOWQjumdoidcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKVtrZXldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2ldW3R5cGVdID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgaSwgdHlwZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5pu05pS55o6S5bqPJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKVtrZXldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp1ID0genkubWFwKF8gPT4gXy50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IHp5W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenUuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMiwgJ+ivt+mAieaLqei1hOa6kOS9jee9ricpLnNlbGVjdCgoc2ksIGtleSwgenksIHp1LCBkYXRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpIGluIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh6dVtpXSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbi5wdXNoKGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24ucHVzaCh6eVtpXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwi5pyA5ZCO6Z2iXFxcIiA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uLnB1c2goZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5LCB6eSwgenUsIGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WIh+aNouWIhue7hCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWkgPSB6dS5pbmRleE9mKGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaWksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KCfmlrDnu4QnKSwgMywgJ+ivt+mAieaLqei1hOa6kOS9jee9ricpLnNlbGVjdCgoc2ksIGtleSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSwganNvbiA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2tleV0ubWFwKChfLCBpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgIT0gaSkganNvbi5wdXNoKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGRhdGEgPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2tleV0gPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgn5paw57uEJyA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeaWsOe7hOWQjeensFxcXCIpLmlucHV0KChzaSwgenksIGRhdGEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC5tYXRjaCgvXlxcXFxzKijmlrDnu4R85pyA5ZCO6Z2iKT9cXFxccyokLykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+e7hOWQjeS4jeiDveS4uuepuu+8jOS5n+S4jeiDveiuvue9ruS4uifmlrDnu4QnLyfmnIDlkI7pnaInXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2lucHV0XSA9IFtkYXRhXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp5LCBkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaW5wdXRdLnB1c2goZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+aJuemHj+aNoue7hCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKChzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImFkZGxpc3Q/cnVsZT10Z3jpn7PkuZBcXFwiKShzaSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwga2V5LCBpLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCB6dVt0aV0sIGksIF8pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKF8sIHNpLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2k6IHNpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IF8udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogW19dXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5nZXRTaGFyZShqc29uLCBmYWxzZSwgMSwgc2kgPT0gXFxcIjBcXFwiID8gXFxcIuatjOabslxcXCIgOiBcXFwi5q2M5Y2VXFxcIiwgXy50aXRsZSwgW1xcXCLmibnph4/liIbkuqtcXFwiLCAvKlxcXCLlrpjmlrnpk77mjqVcXFwiKi8gXSwgc2ksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8sIHNpLCB6dVt0aV0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBrZXksIGksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaRcXFwiICsgbmFtZSArIFxcXCLlkJfvvJ9cXFwiKS5jb25maXJtKChzaSwga2V5LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIGkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dVt0aV0sIGksIF8udGl0bGUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgXVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChfLmRlc2MubWF0Y2goL3FxfHd5fGtnfGt3fG1nfDVzLykgJiYgXy5jb250ZW50ICE9IDMpIF8uZXh0cmEubG9uZ0NsaWNrLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLinKkg5aSN5Yi26ZO+5o6lIOKcqVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoYSwgYiwgYykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLmNvcHl1cmwoYSwgYiwgYyk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBfLmRlc2MsIF8uY29udGVudCwgXy56eWlkKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKE51bWJlcihfLmNvbnRlbnQucmVwbGFjZSgvXihcXFxcZCpcXFxcRCtcXFxcZCopKyQvLCAnMCcpKSA8IDIpIF8uZXh0cmEubG9uZ0NsaWNrLnVuc2hpZnQoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLimIUg5LiL6L295q2M5puyIOKYhVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCwgMSkpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoIV8udXJsKSBfLnVybCA9IExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCk7XFxuICAgICAgICAgICAgICAgIF8uY29sX3R5cGUgPSAnY2FyZF9waWNfMyc7XFxuICAgICAgICAgICAgICAgIGQucHVzaChfKTtcXG4gICAgICAgICAgICAgICAgaWkrKztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmICghaWkpIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwifn5+5LuA5LmI6YO95rKh5pyJfn5+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pGj6auY57qn5pCc57SiXCIsXCJwYXRoXCI6XCJzZWFyY2hcIixcInJ1bGVcIjpcImpzOlxcbmV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScsIHt9KSkucnVsZSk7XFxubGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgW10pO1xcbmxldCBzX3BsYXRmb3JtID0gZ2V0TXlWYXIoJ3NfcGxhdGZvcm0nLCAnbGliJylcXG5sZXQgc190MSA9IGdldE15VmFyKCdzX3QxJywgZ2V0SXRlbSgnc190MScsICcwJykpXFxubGV0IHNfdDIgPSBnZXRNeVZhcignc190MicsICcnKTtcXG5sZXQgc190MyA9IGdldE15VmFyKCdzX3QzJywgJ2xpYicpO1xcbmxldCBzX3Q0LCB0YWJzLCByZWdpZCwgaXNfZG93bixcXG4gICAgaXNVID0gL2h0dHBzPzpcXFxcL1xcXFwvLy50ZXN0KHNfdDIpLFxcbiAgICBpc1AgPSBNWV9QQUdFID09IDE7XFxuXFxuXFxuXFxuaWYgKHNfdDEgPT0gJzAnKSB7XFxuICAgIHN3aXRjaCAoc19wbGF0Zm9ybSkge1xcbiAgICAgICAgY2FzZSAnbGliJzpcXG4gICAgICAgICAgICBzX3QzID0gZ2V0TXlWYXIoJ3NfdDMnLCAna3cnKTtcXG4gICAgICAgICAgICB0YWJzID0gWydrdycsICdrZyddO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSAnNXMnOlxcbiAgICAgICAgICAgIHRhYnMgPSBbJ2xpYicsICd5YycsICdmYycsICdieiddO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSAnbXknOlxcbiAgICAgICAgICAgIHNfdDQgPSBnZXRNeVZhcignc190NCcsICcxJykgPT0gJzEnO1xcbiAgICAgICAgICAgIHNfdDMgPSBnZXRNeVZhcignc190MycsICd3eScpO1xcbiAgICAgICAgICAgIGlmICghc190My5tYXRjaCgvd3l8a3d8bWcvKSAmJiBzX3Q0KVxcbiAgICAgICAgICAgICAgICBzX3QzID0gJ3d5JztcXG4gICAgICAgICAgICB0YWJzID0gW1xcXCJ3eVxcXCIsIFxcXCJrd1xcXCIsIFxcXCJtZ1xcXCIsIFxcXCIxdFxcXCIsIFxcXCJkYlxcXCIsIFxcXCI1eVxcXCIsIFxcXCI1ZlxcXCJdLnNsaWNlKDAsIHNfdDQgPyAzIDogNyk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICdxdCc6XFxuICAgICAgICAgICAgc190MyA9IGdldE15VmFyKCdzX3QzJywgJ2JkJyk7XFxuICAgICAgICAgICAgdGFicyA9IHF0cy5zbGljZSgxKTtcXG4gICAgICAgICAgIC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pLCAvXFxcXC9zb25nXFxcXC8oLippZD0pPyhbYS16MC05XSspL2ldLFxcbiAgICAgICAgICAgIFtcXFwiNXNcXFwiLCAvNXNpbmdcXFxcLi9pLCAvLiooc29uZ2xpc3QuKmlkPSkoW2EtejAtOV0rKS9pLCAvLiooXFxcXD9zb25nLio/PXxcXFxcLykoW2EtejAtOV0rKShcXFxcJnNvbmcuKj89fFxcXFwvKShbYS16MC05XSspL2ldLFxcbiAgICAgICAgICAgIFtcXFwia2dcXFwiLCAva3Vnb3VcXFxcLi9pLCAvKFxcXFwvc3BlY2lhbFxcXFwvc2luZ2xlXFxcXC98c2hhcmVfdHlwZT1zcGVjaWFsJmlkPXxnbG9iYWxfc3BlY2lhbGlkPXxnbG9iYWxfY29sbGVjdGlvbl9pZD18XlteKFxcXFwvc2hhcmUpXStbJlxcXFw/XWlkPSkoW14mXSspL2ksIC8oaGFzaD0pKFthLXowLTldKykvaV0sXFxuICAgICAgICBdO1xcbiAgICAgICAgZm9yIChbcGxhdGZvcm0sIHJlZzEsIHJlZzIsIHJlZzNdIG9mIHJlZ3MpIHtcXG4gICAgICAgICAgICBpZiAoc190Mi5tYXRjaChyZWcxKSkge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgc19wbGF0Zm9ybSA9IHBsYXRmb3JtO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlZzIgJiYgKG1hdCA9IHNfdDIubWF0Y2gocmVnMikpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc190MSA9ICcxJztcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWdpZCA9IG1hdFszXSB8fCBtYXRbMl07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlZzMgJiYgKG1hdCA9IHNfdDIubWF0Y2gocmVnMykpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc190MSA9ICcwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWdpZCA9IG1hdFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocGxhdGZvcm0gPT0gJzVzJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVnaWQubWF0Y2goL1xcXFxELykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpZCA9IG1hdFs0XSArICcjJyArIHJlZ2lkO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpZCArPSAnIycgKyBtYXRbNF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHt9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGlmICghcmVnaWQpIHsgLy8g5q2j5YiZ5pyq5Yy56YWNXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgW3NfcGxhdGZvcm0sIHNfdDEsIHJlZ2lkXSA9IEpTT04ucGFyc2UoZXhlY3V0ZVdlYlJ1bGUoc190Mi5yZXBsYWNlKC9eW1xcXFxzXFxcXFNdKj8oaHR0cFteXFxcXG5dKylbXFxcXHNcXFxcU10qL2ksIFxcXCIkMVxcXCIpLCAkLnRvU3RyaW5nKChyZWdzLCBwbGF0Zm9ybSwgc190MSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlzUmVnID0gKHJlZywgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3aW5kb3cubG9jYXRpb24uaHJlZi5tYXRjaChyZWcpW2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKG1hdEVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbXFxcInFxXFxcIiwgXFxcIjFcXFwiLCBpc1JlZyhyZWdzWzBdWzJdLCAyKSB8fCBmaXJzdFBhZ2VEYXRhLnRhb2dlRGF0YS5pZF07XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBocFBhcmFtID0gZGF0YUZyb21TbWFydHlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGlzS2dwZSkge31cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY2lhbGlkID0gcGhwUGFyYW0uc3BlY2lhbGlkIHx8IHBocFBhcmFtLmdsb2JhbF9jb2xsZWN0aW9uX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3BlY2lhbGlkKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbXFxcImtnXFxcIiwgXFxcIjFcXFwiLCBzcGVjaWFsaWRdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnVuID0gW1xcXCJrZ1xcXCIsIFxcXCIwXFxcIiwgaXNSZWcocmVnc1s1XVszXSwgMikgfHwgcGhwUGFyYW0uaGFzaF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7IC8vIOWlveWDj+aYr+i/meagt+aLvOeahCjlpKfmpoJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobGlzdGlkID0gaXNSZWcoL2xpc3RpZD0oXFxcXGQrKS9pLCAxKSkgJiYgKHVpZCA9IGlzUmVnKC91aWQ9KFxcXFxkKykvaSwgMSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnVuID0gW1xcXCJrZ1xcXCIsIFxcXCIxXFxcIiwgXFxcImNvbGxlY3Rpb25fM19cXFwiICsgdWlkICsgXFxcIl9cXFwiICsgbGlzdGlkICsgXFxcIl8wXFxcIl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBocFBhcmFtID0gKHdpbmRvdy4kb3V0cHV0ID8gd2luZG93LiRvdXRwdXQuaW5mbyA6IG5EYXRhKS5saXN0aW5mbztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbXFxcImtnXFxcIiwgXFxcIjFcXFwiLCBwaHBQYXJhbS5zcGVjaWFsaWQgfHwgcGhwUGFyYW0uZ2xvYmFsX2NvbGxlY3Rpb25faWRdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbcGxhdGZvcm0sIHNfdDEsIFxcXCJcXFwiXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShSdW4pO1xcbiAgICAgICAgICAgICAgICB9LCByZWdzLCBwbGF0Zm9ybSwgc190MSksIHtcXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ10sXFxuICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiA4MDAwXFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICB9IGNhdGNoICh3ZWJFcnIpIHt9XFxuICAgICAgICAgICAgaWYgKCFyZWdpZCAmJiBzX3BsYXRmb3JtID09IFxcXCJrZ1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBrZ19ocmVmID0gSlNPTi5wYXJzZShmZXRjaChzX3QyLnJlcGxhY2UoL15bXFxcXHNcXFxcU10qPyhodHRwW15cXFxcbl0rKVtcXFxcc1xcXFxTXSovaSwgXFxcIiQxXFxcIiksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5oZWFkZXJzLmxvY2F0aW9uWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hdCA9IGtnX2hyZWYubWF0Y2gocmVnc1s1XVsyXSkgfHwga2dfaHJlZi5tYXRjaChyZWdzWzVdWzNdKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNfdDEgPSBcXFwiMVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdCA9IGtnX2hyZWYubWF0Y2gocmVnc1s1XVszXSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzX3QxID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmVnaWQgPSBtYXRbMl07XFxuICAgICAgICAgICAgICAgIH0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+y6K6w5b2VXFxcIiksXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2hpc3Rvcnk/cnVsZT3mrYzor43pgILphY1cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uX3NtYWxsXzNcXFwiLFxcbiAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9oaXNcXFwiXFxuICAgIH1dO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5SNJyxcXG4gICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDliIbkuqvpk77mjqUnLFxcbiAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChzX3BsYXRmb3JtKSA9PiB7XFxuICAgICAgICAgICAgc190MiA9IGlucHV0LnRyaW0oKTtcXG4gICAgICAgICAgICBpZiAoc190MiAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIHNfdDIpO1xcbiAgICAgICAgICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSAnbGliJylcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgZ2V0SXRlbSgnc19wbGF0Zm9ybScsICdrdycpKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgc19wbGF0Zm9ybSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjpzZWFyY2hcXFwiLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcInNfdDJcXFwiKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdzX3QyJyxpbnB1dClcXFwiLFxcbiAgICAgICAgICAgIC8qIOS4jeWlveeUqFxcbiAgICAgICAgICAgICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0ID0gU3RyaW5nKGlucHV0KS50cmltKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihcXFwic190MlxcXCIpICE9IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhpZCArICc6Y21kOmtleScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ICYmIGlucHV0ICE9IFxcXCJcXFwiICYmICEvaHR0cHM/OlxcXFwvXFxcXC8vLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbXNlYXJjaGNkbi5rdWdvdS5jb20vbmV3L2FwcC9pL3NlYXJjaC5waHA/Y21kPTMwMiZrZXl3b3JkPVxcXCIgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gSlNPTi5wYXJzZShmZXRjaCh1KSkuZGF0YVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5rZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkK1xcXCI6c2VhcmNoXFxcIikuZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmRlZmF1bHRWYWx1ZSA9IGtleTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaWQsIF8ua2V5d29yZCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArICc6Y21kOmtleSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihpZCArICc6c2VhcmNoJywgZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpZClcXG4gICAgICAgICAgKi9cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICB9KTtcXG4gICAgcGxhdGZvcm1zLm1hcChwbGF0Zm9ybSA9PiB7XFxuICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSBwbGF0Zm9ybSlcXG4gICAgICAgICAgICBwbGF0Zm9ybSA9IFJpY2goU3Ryb25nKENvbG9yKHBsYXRmb3JtKSkpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogcGxhdGZvcm0sXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwbGF0Zm9ybSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoIXBsYXRmb3JtLm1hdGNoKC9e4oCY4oCY4oCZ4oCZLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc19wbGF0Zm9ybScsIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDQnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHBsYXRmb3JtKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICB9KTtcXG4gICAgaWYgKHNfdDEgPT0gJzAnICYmIHNfcGxhdGZvcm0gPT0gJ215Jykge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3Ioc190NCA/ICfmlrAnIDogJ+aXpycsICcjMzM5OWNjJykpKSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNfdDQpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDQnLCBzX3Q0KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHNfdDQgPyAnMCcgOiAnMScpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIHRhYnMubWFwKG5hbWUgPT4ge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogc190MyA9PSBuYW1lID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgcHV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dGxlKCfpq5jnuqfmkJzntKIgLSAnICsgc190MiArICcjJyArIE1ZX1BBR0UpO1xcbiAgICAgICAgaWYgKGlzUCAmJiAhaXNVICYmIHNfdDEgPT0gJzAnKSB7XFxuICAgICAgICAgICAgaXNfZG93biA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGlzX2Rvd24gPyAnPGI+8J+TpSDkuIvovb08L2I+JyA6ICc8Yj7wn461IOaSreaUvjwvYj4nLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvJyArIChpc19kb3duID8gMjIgOiA0MCkgKyAnLnBuZycsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpc19kb3duID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMSc7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUsIGltZyA9ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvJztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc19kb3duKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAnPGI+8J+OtSDmkq3mlL48L2I+JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWcgKz0gJzQwJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAnPGI+8J+TpSDkuIvovb08L2I+JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWcgKz0gJzIyJztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGltZyArPSAnLnBuZyc7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc2VhcmNoX2Rvd24nLCBpc19kb3duID8gJzAnIDogJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQgKyAnOnlpeWFuJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IGZpbmRJdGVtc0J5Q2xzKGlkICsgJzphZGRsaXN0JykgfHwgW107XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhX3VybCA9IGl0LnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaXQuZXh0cmEudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0LmV4dHJhLnVybCA9IGV4dHJhX3VybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGl0LmV4dHJhLmlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBpdC5leHRyYSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9pY29uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpZCArICc6eWl5YW4nXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAoaXNQKSB7XFxuICAgICAgICAgICAgLy8gaXNfZG93biA9IGZldGNoKCdodHRwczovL3YxLmhpdG9rb3RvLmNuLz9lbmNvZGU9dGV4dCcpO1xcbiAgICAgICAgICAgIGlzX2Rvd24gPSBmZXRjaCgnaHR0cHM6Ly90ZW5hcGkuY24vdjIveWl5YW4nKTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJzxiPvCfk5ogJyArIGlzX2Rvd24gKyAnPC9iPicsXFxuICAgICAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb240JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlzX2Rvd24gPSBmZXRjaCgnaHR0cHM6Ly90ZW5hcGkuY24vdjIveWl5YW4nKTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJzxiPvCfk5ogJyArIGlzX2Rvd24gKyAnPC9iPicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWkjeWItjogXFxcIiArIGlzX2Rvd24sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpc19kb3duKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaWQgKyBcXFwiOnNlYXJjaF9kb3duXFxcIiksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9pY29uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6c2VhcmNoX2Rvd25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5aSN5Yi2OiBcXFwiICsgaXNfZG93bixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgdFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlzX2Rvd24pXFxuICAgICAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaXNQIHx8IGdldE15VmFyKCdzZWFyY2hfcGFnZScsICcwJykgPT0gJzAnIHx8IHNfcGxhdGZvcm0ubWF0Y2goL215fHF0LykpIHtcXG4gICAgICAgICAgICBsZXQgcGFnZVNpemUgPSBzX3BsYXRmb3JtID09IFxcXCI1c1xcXCIgPyAoc190MSA9PSAnMCcgPyAxMCA6IDE1KSA6IDMwO1xcbiAgICAgICAgICAgIGxldCB0b3RhbCA9ICQucmVxdWlyZShzX3BsYXRmb3JtICsgXFxcIj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNlYXJjaChzX3QxLCBzX3QyLCBzX3QzLCBzX3Q0KTtcXG4gICAgICAgICAgICBpZiAodG90YWwgPCBNWV9QQUdFICogcGFnZVNpemUpIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaF9wYWdlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArICfmiJHmmK/mnInlupXnur/nmoQnLmZvbnRjb2xvcignR3JheScpLnNtYWxsKCksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfVxcbn0gZWxzZSBpZiAoaXNQICYmICFpc1UpIHtcXG4gICAgc2V0UGFnZVRpdGxlKCfpq5jnuqfmkJzntKInKTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNmZjY2MDFcXFwiPjxiPuWOhuWPsuaQnOe0ojwvYj48L3NwYW4+JyxcXG4gICAgICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2ZpbmRcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCLnoa7lrprmuIXpmaTlhajpg6jmkJzntKLorrDlvZXvvJ9cXFwiKS5jb25maXJtKChpZCkgPT4ge1xcbiAgICAgICAgICAgIGNsZWFySXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIpO1xcbiAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhpZCArIFxcXCI6a2V5XFxcIik7XFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkICsgXFxcIjpzZWFyY2hIaXN0b3J5XFxcIiwge1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0sIGlkKSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjpzZWFyY2hIaXN0b3J5XFxcIixcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGlmIChoaXN0b3J5Lmxlbmd0aCA9PT0gMCkgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZWxzZSBoaXN0b3J5Lm1hcCgoa2V5LCBpLCBpZCkgPT4ge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZToga2V5LFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoc19wbGF0Zm9ybSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICh0cnVlKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSAnbGliJykgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBnZXRJdGVtKCdzX3BsYXRmb3JtJywgJ2t3JykpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgIC8vIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKFxcXCJnY3NwMTk5OTpzZWFyY2hcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhLmRlZmF1bHRWYWx1ZSA9IGtleTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LCBzX3BsYXRmb3JtLCBrZXkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6a2V5OlxcXCIgKyBrZXksXFxuICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6Zmk5YWz6ZSu6K+NOlxcXCIgKyBrZXksXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoaXN0b3J5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWkgPSBoaXN0b3J5LmluZGV4T2Yoa2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIGhpc3RvcnkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oaWQgKyBcXFwiOmtleTpcXFwiICsga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGlzdG9yeS5sZW5ndGggPT09IDApIGFkZEl0ZW1BZnRlcihpZCArIFxcXCI6c2VhcmNoSGlzdG9yeVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCI6a2V5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpZCwga2V5KVxcbiAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9KTtcXG4gICAgUmVzb3UgPSAoaWQsIHNfcGxhdGZvcm0sIHBsYXRmb3JtLCByZXNvdSkgPT4ge1xcbiAgICAgICAgbGV0IEQgPSBbXTtcXG4gICAgICAgIHJlc291Lm1hcChuYW1lID0+IHtcXG4gICAgICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzX3BsYXRmb3JtLCBwbGF0Zm9ybSwga2V5d29yZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNfcGxhdGZvcm0gPT0gJ2xpYicpIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QxJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywga2V5d29yZCk7XFxuICAgICAgICAgICAgICAgICAgICAvLyBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBzX3BsYXRmb3JtLCBwbGF0Zm9ybSwgbmFtZSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArICc6cmVzb3U6a2V5J1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBEO1xcbiAgICB9O1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojZmY2NjAxXFxcIj48Yj7lpKflrrbpg73lnKjmkJw8L2I+PC9zcGFuPicsXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGlkLCBzX3BsYXRmb3JtLCBwbGF0Zm9ybSwgUmVzb3UpID0+IHtcXG4gICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoaWQgKyAnOnJlc291OmtleScpO1xcbiAgICAgICAgICAgIGxldCBzcmVjO1xcbiAgICAgICAgICAgIGlmIChwbGF0Zm9ybSAhPSAna2cnKSB7XFxuICAgICAgICAgICAgICAgIHNyZWMgPSBbXTtcXG4gICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL3NlYXJjaHJlYy5rdXdvLmNuL3NyZWMucz9zZWFyY2hyZWNhcGk9MCZpZD0wXFxcIikpLmFic2xpc3QubWFwKGFibGlzdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBhYmxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNyZWMucHVzaChfLndvcmQpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIE1ZX1BBR0UgPSAxO1xcbiAgICAgICAgICAgICAgICBzcmVjID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLnNlYXJjaChcXFwiMFxcXCIsIFxcXCJcXFwiLCBcXFwibGliXFxcIiwgXFxcInNyZWNcXFwiKS5tYXAoXyA9PiBfLk9yaVNvbmdOYW1lKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkICsgJzpyZXNvdScsIFJlc291KGlkLCBzX3BsYXRmb3JtLCBwbGF0Zm9ybSwgc3JlYykpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCwgc19wbGF0Zm9ybSwgc190MywgUmVzb3UpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgcGljX3VybDogXFxcImhpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9jb21pY3NcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogaWQgKyBcXFwiOnJlc291XFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgbGV0IHNyZWMgPSBzdG9yYWdlMC5nZXRNeVZhcihzX3QzICsgXF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TdWIgPSAkLnJlcXVpcmUoJ3d5P3J1bGU95q2M6K+N6YCC6YWNJykuYWpheDMoXFxcIi9hcGkvcGxheWxpc3QvY2F0YWxvZ3VlL3YxXFxcIiwge30pLnN1YjtcXG4gICAgICAgIFN1Yi5tYXAoXyA9PlxcbiAgICAgICAgICAgIGlUYWdbQXJyW18uY2F0ZWdvcnldXVtfLm5hbWVdID0gXy5uYW1lXFxuICAgICAgICApO1xcbiAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl0gPSB7fTtcXG4gICAgICAgIGlmIChydW4pIHJldHVybiB0cnVlO1xcbiAgICAgICAgLypcXG4gICAgICAgICAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bXFxcIuWFqOmDqFxcXCJdID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgoXFxcInRvcGxpc3Q/XFxcIikubGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgKi9cXG4gICAgICAgICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4MyhcXFwiL2FwaS90b3BsaXN0L2RldGFpbC92MlxcXCIpLmRhdGEubWFwKF8gPT4ge1xcbiAgICAgICAgICAgIGlmIChfLmxpc3QgJiYgXy5saXN0Lmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICBsZXQgbmFtZSA9IF8ubmFtZS5yZXBsYWNlKC/mppzljZU/LywgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXVtuYW1lXSA9IFtdO1xcbiAgICAgICAgICAgICAgICBfLmxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8uaWQgIT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW25hbWVdLnB1c2goRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInd5X2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0Mikge1xcbiAgICAgICAgbGV0IGxpc3QsIF87XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIi92My9zb25nL2RldGFpbFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGM6IGBbe1xcXCJpZFxcXCI6JHt0MX19XWBcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGxldCBhID0gXy5zb25nc1swXTtcXG4gICAgICAgICAgICAgICAgbGV0IGlzRnJlZU11c2ljID0gKGEuZmVlID09IDAgfHwgYS5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlc1swXS5zdCA+IC0xKTtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5LiL6L29XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IFt0c1sxXSArIFNpemUoYS5sID8gYS5sLnNpemUgOiBhLm0uc2l6ZSldO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGEuaClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUoYS5oLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLnNxKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdICsgU2l6ZShhLnNxLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLmhyKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzRdICsgU2l6ZShhLmhyLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgYSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJkb3duXFxcIiwgXFxcInd5XFxcIiwgdDEsIGksIGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBhKTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgdmFyIHVybCwgaWksIGxyYztcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5ocikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwid3lcXFwiLCB0MSwgMywgYSwgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5zcSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwid3lcXFwiLCB0MSwgMiwgYSwgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpaWkgPSBpaSA+IDAgPyAxIDogMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0ZyZWVNdXNpYykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXJsID0gYGh0dHA6Ly9tdXNpYy4xNjMuY29tL3NvbmcvbWVkaWEvb3V0ZXIvdXJsP2lkPSR7dDF9Lm1wM2A7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDMoXFxcIi9hcGkvc29uZy9lbmhhbmNlL3BsYXllci91cmwvdjFcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWRzOiBgWyR7dDF9XWAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWw6IGlpaSA+IDAgPyBcXFwiZXhoaWdoXFxcIiA6IFxcXCJzdGFuZGFyZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jb2RlVHlwZTogXFxcImZsYWNcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5kYXRhWzBdLnVybC5zcGxpdChcXFwiP1xcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChhLmggJiYgaWkgPT0gMSkgfHwgaWlpID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInd5XFxcIiwgdDEsIGlpaSwgYSwgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlpaSAtPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKGlpaSA+IC0xKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybCkgcmV0dXJuIFxcXCJ0b2FzdDovL+aXoOazleino+aekFxcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICBpZiAoIWxyYykge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIi9zb25nL2x5cmljXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGx2OiAtMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga3Y6IC0xLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0djogLTFcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KS5scmMubHlyaWM7XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArIFxcXCIjaXNNdXNpYz10cnVlI1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8v6aaW6aG1XFxuICAgICAgICAgICAgICAgIC8vIGlmICghdDEubWF0Y2goL1xcXFw/LykpIHQxID0gXFxcInRvcC9wbGF5bGlzdD9jYXQ9XFxcIiArIHQxICsgXFxcIiZcXFwiO1xcbiAgICAgICAgICAgICAgICAvLyBfID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgodDEpO1xcbiAgICAgICAgICAgICAgICBpZiAodDEgPT0gXFxcInBlcnNvbmFsaXplZD9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgzKFxcXCIvYXBpL3BlcnNvbmFsaXplZC9wbGF5bGlzdFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsaW1pdDogMTJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBDb29raWU6IFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoJ3d5P3J1bGU95q2M6K+N6YCC6YWNJykuYWpheDIoXFxcIi9wbGF5bGlzdC9saXN0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdDogdDEgfHwgXFxcIuWFqOmDqFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6IFxcXCJob3RcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0OiAzMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQ6IChNWV9QQUdFIC0gMSkgKiAzMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b3RhbDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjc3JmX3Rva2VuOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBfLnJlc3VsdCB8fCBfLnBsYXlsaXN0cztcXG4gICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsIHx8IF8ucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAvLyBpZiAodDEgPT0gXFxcInBlcnNvbmFsaXplZD9cXFwiKSByZXR1cm4gMDtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIF8udG90YWwgfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSlcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwiZ2QvdjYvXFxcIiArIHQxLCA5O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Z2Uuc3QgPiAtMSkgOiAxKSkgPyAxIDogMFxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgbGV0IHN1cmwgPSAoc3R5cGUpID0+IF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIi9zZWFyY2gvZ2V0XFxcIiwge1xcbiAgICAgICAgICAgICAgICBzOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICBsaW1pdDogMzAsXFxuICAgICAgICAgICAgICAgIG9mZnNldDogKE1ZX1BBR0UgLSAxKSAqIDMwLFxcbiAgICAgICAgICAgICAgICB0eXBlOiBzdHlwZSxcXG4gICAgICAgICAgICAgICAgc3RyYXRlZ3k6IDUsXFxuICAgICAgICAgICAgICAgIHF1ZXJ5Q29ycmVjdDogdHJ1ZVxcbiAgICAgICAgICAgIH0pLnJlc3VsdDtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHN1cmwoMSkuc29uZ3M7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVID09PSAxKSByZXR1cm4gbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLmFyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWwucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAoKF8uZmVlID09IDAgfHwgXy5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlID8gKF8ucHJpdmlsZWdlLnN0ID4gLTEpIDogMSkpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gc3VybCgxMDAwKS5wbGF5bGlzdHM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVID09PSAxKSByZXR1cm4gbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLnNvbmdDb3VudCB8fCBfLnBsYXlsaXN0Q291bnQgfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwid3k/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4MihcXFwiL3YzL3NvbmcvZGV0YWlsXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGM6IGBbe1xcXCJpZFxcXCI6JHtrZXl3b3JkfX1dYFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYSA9IF8uc29uZ3NbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGEubmFtZSArICcgLSAnICsgYS5hci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGEuYWwucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICgoYS5mZWUgPT0gMCB8fCBhLmZlZSA9PSA4KSAmJiAoXy5wcml2aWxlZ2VzWzBdLnN0ID4gLTEpKSA/IDAgOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGEuaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwiZ2QvdjYvXFxcIiArIGtleXdvcmQsIDApLnBsYXlsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAvKiBNeUZyZWVNUDMg5q2M5Y2V6Kej5p6Q5bSp5LqG77yM5LiN5pi+56S6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICdteSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAwO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBhamF4OiBmdW5jdGlvbihwYXRoLCBuKSB7XFxuICAgICAgICBpZiAocGF0aC5tYXRjaCgvXmdkXFxcXC92NlxcXFwvLykpIHtcXG4gICAgICAgICAgICBwYXRoID0gcGF0aC5yZXBsYWNlKC9eZ2QoXFxcXC92NlxcXFwvKShcXFxcZCspLywgXFxcImh0dHBzOi8vbXVzaWMuMTYzLmNvbS9hcGkkMXBsYXlsaXN0L2RldGFpbD9pZD0kMiZuPVxcXCIpICsgbjtcXG4gICAgICAgIH0gZWxzZSBpZiAo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1xcbiAgICAgICAgbGV0IHBhcmFtcyA9IFtwYXRoLCBKU09OLnN0cmluZ2lmeShqc29uIHx8IHt9KV07XFxuICAgICAgICBwYXJhbXMucHVzaChtZDUoXFxuICAgICAgICAgICAgXFxcIm5vYm9keVxcXCIgK1xcbiAgICAgICAgICAgIHBhcmFtcy5qb2luKFxcXCJ1c2VcXFwiKSArXFxuICAgICAgICAgICAgXFxcIm1kNWZvcmVuY3J5cHRcXFwiXFxuICAgICAgICApKTtcXG4gICAgICAgIHJldHVybiBKU09OLnBhcnNlKHBvc3RQQyhwYXRoLnJlcGxhY2UoXFxcIi9cXFwiLCBcXFwiaHR0cHM6Ly9pbnRlcmZhY2UubXVzaWMuMTYzLmNvbS9lXFxcIiksIHtcXG4gICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgIHBhcmFtczogQ3J5cHRvVXRpbC5BRVMuZW5jcnlwdChcXG4gICAgICAgICAgICAgICAgICAgIHBhcmFtcy5qb2luKFxcXCItMzZjZDQ3OWI2YjUtXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBDcnlwdG9VdGlsLkRhdGEucGFyc2VVVEY4KFxcXCJlODJja2VuaDhkaWNoZW44XFxcIiksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtb2RlOiBcXFwiQUVTL0VDQi9QS0NTN1BhZGRpbmdcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICApLnRvSGV4KClcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGhlYWRlcnM6IE9iamVjdC5hc3NpZ24oaGVhZGVycywgaGVhZCB8fCB7fSlcXG4gICAgICAgIH0pKTtcXG4gICAgfSxcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLinbhrZ1wiLFwicGF0aFwiOlwia2dcIixcInJ1bGVcIjpcImV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYW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5oOFXFxuICAgICAgICAgICAgICAgIGxldCByZWxhdGVfZ29vZHMgPSAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChbe1xcbiAgICAgICAgICAgICAgICAgICAgaGFzaDogdDFcXG4gICAgICAgICAgICAgICAgfV0pWzBdLnJlbGF0ZV9nb29kcy5zbGljZSgwLCA0KTtcXG4gICAgICAgICAgICAgICAgXyA9IHJlbGF0ZV9nb29kc1swXTtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5LiL6L29XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IHJlbGF0ZV9nb29kcy5tYXAoKF8sIGkpID0+IHRzW2kgKyAxXSArIFNpemUoXy5pbmZvLmZpbGVzaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgdDEsIHJlbGF0ZV9nb29kcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJkb3duXFxcIiwgXFxcImtnXFxcIiwgdDEsIGksIHJlbGF0ZV9nb29kcyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgdDEsIHJlbGF0ZV9nb29kcyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHZhciB1cmwsIGlpLCBscmM7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0MyAmJiBpaSA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWxhdGVfZ29vZHNbM10pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImtnXFxcIiwgdDEsIDMsIHJlbGF0ZV9nb29kcywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbGF0ZV9nb29kc1syXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia2dcXFwiLCB0MSwgMiwgcmVsYXRlX2dvb2RzLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDMgJiYgaWkgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRlX2dvb2RzWzFdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrZ1xcXCIsIHQxLCAxLCByZWxhdGVfZ29vZHMsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5wcml2aWxlZ2UgPT0gMCB8fCBfLnByaXZpbGVnZSA9PSA4KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVybCA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybCh0MSwgJzEyOCcsIF8uYWxidW1faWQsIF8uYWxidW1fYXVkaW9faWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL20ua3Vnb3UuY29tL2FwcC9pL2dldFNvbmdJbmZvLnBocD9jbWQ9cGxheUluZm8maGFzaD1cXFwiICsgdDEpKS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia2dcXFwiLCB0MSwgMCwgcmVsYXRlX2dvb2RzLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBcXFwidG9hc3Q6Ly/ml6Dms5Xop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcblxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBcXFwiaHR0cDovL2tyY3Mua3Vnb3UuY29tL3NlYXJjaD92ZXI9MSZtYW49eWVzJmNsaWVudD1tb2JpJmtleXdvcmQ9JmR1cmF0aW9uPSZoYXNoPVxcXCIgKyB0MSArIFxcXCImYWxidW1fYXVkaW9faWQ9XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgX18gPSBKU09OLnBhcnNlKGZldGNoKHUpKS5jYW5kaWRhdGVzWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfXyAmJiBfXy5pZCAmJiBfXy5hY2Nlc3NrZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbHlyaWNzLmt1Z291LmNvbS9kb3dubG9hZD92ZXI9MSZjbGllbnQ9cGMmaWQ9XFxcIiArIF9fLmlkICsgXFxcIiZhY2Nlc3NrZXk9XFxcIiArIF9fLmFjY2Vzc2tleSArIFxcXCImZm10PWxyYyZjaGFyc2V0PXV0ZjhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBiYXNlNjREZWNvZGUoSlNPTi5wYXJzZShmZXRjaCh1KSkuY29udGVudCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGxyYyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDpppbpobVcXG4gICAgICAgICAgICAgICAgbGlzdCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly93d3cyLmt1Z291Lmt1Z291LmNvbS95dWVrdS92OS9zcGVjaWFsL2dldFNwZWNpYWw/aXNfYWpheD0xJmNkbj1jZG4mdD01JnBhZ2VzaXplPTMwJmM9XFxcIiArIHQxICsgXFxcIiZwPVxcXCIgKyBNWV9QQUdFKSkuc3BlY2lhbF9kYjtcXG4gICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zcGVjaWFsbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zcGVjaWFsaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGg7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgaWYgKHQxLm1hdGNoKC9fLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSB3ZWJTaWduKFxcXCJodHRwczovL21vYmlsZXMua3Vnb3UuY29tL2FwaS92NS9zcGVjaWFsL3NvbmdfdjJcXFwiLCBbJ2dsb2JhbF9zcGVjaWFsaWQ9JyArIHQxLCAnc3BlY2lhbGlkPScgKyB0MSwgXSk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5pbmZvO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBleGVjdXRlV2ViUnVsZShgaHR0cDovL3d3dzIua3Vnb3Uua3Vnb3UuY29tL3l1ZWt1L3Y5L3NwZWNpYWwvc2luZ2xlLyR7dDF9LTUtOTk5OTkuaHRtbD9qc29uPXRydWVgLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGdsb2JhbC5kYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IEpTT04ucGFyc2UoXyk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgbGlzdCA9IFtdO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChsaXN0Lmxlbmd0aClcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChsaXN0KTtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IFtdO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKGBodHRwOi8vbW9iaWxlY2RuYmoua3Vnb3UuY29tL2FwaS92My9yYW5rL3Nvbmc/cGFnZXNpemU9MzAmcGFnZT0ke01ZX1BBR0V9JnJhbmtpZD0ke3QxfWApKS5kYXRhLmluZm87XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHQyKSByZXR1cm4gXztcXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIF8ubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgIHRpdGxlOiAoXy5maWxlbmFtZSB8fCBfLm5hbWUpLnNwbGl0KCcgLSAnKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgaW1nOiBfLmFsYnVtX3NpemFibGVfY292ZXIgfHwgKF8uaW5mbyA/IF8uaW5mby5pbWFnZSA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBjb250ZW50OiAoXy5wcml2aWxlZ2UgPT0gMCB8fCBfLnByaXZpbGVnZSA9PSA4KSA/IDAgOiAxLFxcbiAgICAgICAgICAgIHp5aWQ6IF8uaGFzaFxcbiAgICAgICAgfSwgMSkpO1xcbi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F0Zm9ybV0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVSA9PSAnZnJlZScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcInYzXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHJldHVybiBfLmxpc3RzWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsaXN0ID0gc3VybCgnc29uZycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsMihcXFwidjNcXFwiLCBcXFwicGxhdGZvcm09V2ViRmlsdGVyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAnc3JlYycpIHJldHVybiBfLmxpc3RzO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KF8ubGlzdHMpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX1tpc1VdKF8pKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAoXy5maWxlbmFtZSB8fCBfLm5hbWUpLnNwbGl0KCcgLSAnKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5hbGJ1bV9zaXphYmxlX2NvdmVyIHx8IChfLmluZm8gPyBfLmluZm8uaW1hZ2UgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IChfLnByaXZpbGVnZSA9PSAwIHx8IF8ucHJpdmlsZWdlID09IDgpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaGFzaFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIC8vIGxpc3QgPSBzdXJsKCdzcGVjaWFsJyk7XFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcInYxXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdHM7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zcGVjaWFsbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsIHx8IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zcGVjaWFsaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXy50b3RhbCB8fCAoKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGgpO1xcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICBoYXNoOiBrZXl3b3JkXFxuICAgICAgICAgICAgICAgICAgICB9XSlbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChfLmZpbGVuYW1lIHx8IF8ubmFtZSkuc3BsaXQoJyAtICcpLnJldmVyc2UoKS5qb2luKCcgLSAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWxidW1fc2l6YWJsZV9jb3ZlciB8fCAoXy5pbmZvID8gXy5pbmZvLmltYWdlIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IChfLnByaXZpbGVnZSA9PSAwIHx8IF8ucHJpdmlsZWdlID09IDgpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5oYXNoICsgXFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSB3ZWJTaWduKFxcXCJodHRwczovL21vYmlsZXMua3Vnb3UuY29tL2FwaS92NS9zcGVjaWFsL2luZm9fdjJcXFwiLCBbXFxcInNwZWNpYWxpZD1cXFwiICsga2V5d29yZCwgXFxcImdsb2JhbF9zcGVjaWFsaWQ9XFxcIiArIGtleXdvcmRdKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zcGVjaWFsbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogKF8uc3BlY2lhbGlkIHx8IF8uZ2xvYmFsX3NwZWNpYWxpZCkgKyBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIDA7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGFqYXg6IGZ1bmN0aW9uKHJlc291cmNlKSB7XFxuICAgICAgICBsZXQgYm9keSA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwicmVsYXRlXFxcIjogMSxcXG4gICAgICAgICAgICBcXFwidXNlcmlkXFxcIjogXFxcIjI2MjY0MzE1MzZcXFwiLFxcbiAgICAgICAgICAgIFxcXCJ2aXBcXFwiOiAxLFxcbiAgICAgICAgICAgIFxcXCJ0b2tlblxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcHBpZFxcXCI6IDEwMDEsXFxuICAgICAgICAgICAgXFxcImJlaGF2aW9yXFxcIjogXFxcInBsYXlcXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcmVhX2NvZGVcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgXFxcImNsaWVudHZlclxcXCI6IFxcXCI4OTkwXFxcIixcXG4gICAgICAgICAgICBcXFwibmVlZF9oYXNoX29mZnNldFxcXCI6IDEsXFxuICAgICAgICAgICAgXFxcInJlc291cmNlXFxcIjogcmVzb3VyY2UubWFwKF8gPT4gKHtcXG4gICAgICAgICAgICA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JjMzc2YTlkNFxcXCI7XFxuICAgICAgICB2YXIgYXBwaWQgPSBhcHBpZCB8fCBcXFwiMTAwNVxcXCI7XFxuICAgICAgICB2YXIgc2lnbmtleSA9IHNpZ25rZXkgfHwgXFxcIk9JbHdpZWtzMjhkazJrMDkybGtzaTJVSWtwXFxcIjtcXG4gICAgICAgIHZhciBwYXJhbXMgPSBbXFxuICAgICAgICAgICAgJ3F1YWxpdHk9JyArIHF1YWxpdHksXFxuICAgICAgICAgICAgJ2hhc2g9JyArIGhhc2gsXFxuICAgICAgICAgICAgJ21pZD0nICsgbWlkLFxcbiAgICAgICAgICAgICdhcHBpZD0nICsgYXBwaWQsXFxuICAgICAgICAgICAgJ3VzZXJpZD0nICsgdXNlcmlkLFxcbiAgICAgICAgICAgICdrZXk9JyArIG1kNShoYXNoICsgXFxcIjU3YWUxMmViNjg5MDIyM2UzNTVjY2ZjYjc0ZWRmNzBkXFxcIiArIGFwcGlkICsgbWlkICsgdXNlcmlkKSxcXG4gICAgICAgICAgICAnYWxidW1faWQ9JyArIGFsYnVtX2lkLFxcbiAgICAgICAgICAgICdhbGJ1bV9hdWRpb19pZD0nICsgYWxidW1fYXVkaW9faWQsXFxuICAgICAgICAgICAgJ2NsaWVudHRpbWU9JyArIE1hdGguZmxvb3IoZGF0ZSAvIDEwMDApLFxcbiAgICAgICAgICAgICdvcGVuX3RpbWU9JyArICQuZGF0ZUZvcm1hdChkYXRlLCAneXl5eU1NZGQnKSxcXG4gICAgICAgICAgICAndG9rZW49JyArIHRva2VuLFxcbiAgICAgICAgICAgICdhcmVhX2NvZGU9MScsXFxuICAgICAgICAgICAgJ21vZHVsZT0nLFxcbiAgICAgICAgICAgICdzc2FfZmxhZz1pc19mcm9tdHJhY2snLFxcbiAgICAgICAgICAgICdjbGllbnR2ZXI9MTA1MTgnLCAvLzEyMDI5XFxuICAgICAgICAgICAgJ3ZpcFR5cGU9NicsXFxuICAgICAgICAgICAgJ3B0eXBlPTAnLFxcbiAgICAgICA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xcbiAgICAgICAgICAgICd1c2VyaWQ9JyArIHVzZXJpZCxcXG4gICAgICAgICAgICAndG9rZW49JyArIHRva2VuLFxcbiAgICAgICAgICAgICdjbGllbnR0aW1lPScgKyBNYXRoLmZsb29yKGRhdGUgLyAxMDAwKSxcXG4gICAgICAgICAgICAnYXBwaWQ9MzExNicsXFxuICAgICAgICAgICAgJ2NsaWVudHZlcj0xMDUxOCcsXFxuICAgICAgICAgICAgJ21pZD0nICsgbWlkLFxcbiAgICAgICAgICAgICd1dWlkPScgKyBSKDMyKSxcXG4gICAgICAgICAgICAnZGZpZD0tJ1xcbiAgICAgICAgXTtcXG4gICAgICAgIGxldCBqeGxpc3QsIHJlcSA9IEpTT04ucGFyc2UocG9zdChcXFwiaHR0cHM6Ly9nYXRld2F5Lmt1Z291LmNvbS92Mi9yZXBvcnQvbGlzdGVuX3Nvbmc/XFxcIiArIGdldFBhcmFtcyhwYXJhbXMsIHNpZ25rZXksIGJvZHkpLCB7XFxuICAgICAgICAgICAgYm9keSxcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIkFuZHJvaWQ3MTItQW5kcm9pZFBob25lLTEwNTE4LTE4LTAtTmV0TXVzaWMtd2lmaVxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJLRy1USGFzaFxcXCI6IFxcXCIzZTVlYzZiXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIktHLVJlY1xcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIktHLVJDXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwieC1yb3V0ZXJcXFwiOiBcXFwieW91dGgua3Vnb3UuY29tXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pKTtcXG4gICAgICAgIGlmIChyZXEuc3RhdHVzID09IDEpIHtcXG4gICAgICAgICAgICBpZiAoaXNqeCkge1xcbiAgICAgICAgICAgICAgICBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3Rfa2cnLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgIC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShfLnRpdGxlICsgXy51cmwpID09IFxcXCJjODc3YWU3MmI5N2JjMjY3MjBhZDhiMWEzOTM2MmQ0N1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy50aW1lID0gZGF0ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5zaWduaW4gPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gX1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF9rZycsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nrb7liLDmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nrb7liLDmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSBpZiAocmVxLmVycm9yX2NvZGUgPT0gMTMwMDEyKSB7IC8vIOetvuWIsOi/h+S6hu+8nyAgICAgIFxcbiAgICAgICAgICAgIGlmIChpc2p4KSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9rZycsIFtdKVxcbiAgICAgICAgICAgICAgICAgICAgLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImM4NzdhZTcyYjk3YmMyNjcyMGFkOGIxYTM5MzYyZDQ3XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnRpbWUgPSBkYXRlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X2tnJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOWksei0pe+8muS7iuWkqeW3sue7j+etvuWIsOi/h+S6hu+8n1xcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOWksei0pe+8muS7iuWkqeW3sue7j+etvuWIsOi/h+S6hu+8n1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v562+5Yiw5aSx6LSl77yaXFxcIiArIHJlcS5lcnJvcl9tc2c7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIC8vIEdldF9LZ19OZXdfVG9rZW5cXG4gICAgcmVmcmVzaF90b2tlbjogZnVuY3Rpb24odXNlcmlkLCB0b2tlbiwgYXBwaWQsIHNpZ25rZXkpIHtcXG4gICAgICAgIHZhciBhcHBpZCA9IGFwcGlkIHx8IFxcXCIxMDA1XFxcIjtcXG4gICAgICAgIHZhciBzaWdua2V5ID0gc2lnbmtleSB8fCBcXFwiT0lsd2lla3MyOGRrMmswOTJsa3NpMlVJa3BcXFwiO1xcbiAgICAgICAgW2Flc19rZXksIGFl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gICAgIGxldCBib2R5ID0gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgIHAzLFxcbiAgICAgICAgICAgIGNsaWVudHRpbWVfbXMsXFxuICAgICAgICAgICAgdDE6IFxcXCIwXFxcIixcXG4gICAgICAgICAgICB0MjogXFxcIjBcXFwiLFxcbiAgICAgICAgICAgIHVzZXJpZCxcXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgLy8gdXVpZFxcbiAgICAgICAgbGV0IHBhcmFtcyA9IFtcXG4gICAgICAgICAgICBcXFwiZGZpZD0tXFxcIixcXG4gICAgICAgICAgICBcXFwiYXBwaWQ9XFxcIiArIGFwcGlkLFxcbiAgICAgICAgICAgIFxcXCJtaWQ9XFxcIiArIFIoMzIsIFxcXCIxMjM0NTY3ODkwXFxcIiksXFxuICAgICAgICAgICAgXFxcImNsaWVudHZlcj0xMDU5N1xcXCIsXFxuICAgICAgICAgICAgXFxcImNsaWVudHRpbWU9XFxcIiArIGNsaWVudHRpbWUsXFxuICAgICAgICBdO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShwb3N0KFxcXCJodHRwOi8vbG9naW4udXNlci5rdWdvdS5jb20vdjQvbG9naW5fYnlfdG9rZW4vP1xcXCIgKyBnZXRQYXJhbXMocGFyYW1zLCBzaWdua2V5LCBib2R5KSwge1xcbiAgICAgICAgICAgICAgICBib2R5LFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJBbmRyb2lkODAwLTEwNzAtMTA1OTctNDYtMC1MT0dJTi13aWZpXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJLRy1USGFzaFxcXCI6IFxcXCIzZTVlYzZiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJLRy1SZWNcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgICAgICA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GFyQ29kZUF0KGkpLnRvU3RyaW5nKCk7XFxuICAgICAgICBuID0gU3RyaW5nKG4pO1xcbiAgICAgICAgdmFyIHIgPSBNYXRoLmZsb29yKG4ubGVuZ3RoIC8gNSksXFxuICAgICAgICAgICAgbyA9IHBhcnNlSW50KG4uY2hhckF0KHIpICsgbi5jaGFyQXQoMiAqIHIpICsgbi5jaGFyQXQoMyAqIHIpICsgbi5jaGFyQXQoNCAqIHIpICsgbi5jaGFyQXQoNSAqIHIpKSxcXG4gICAgICAgICAgICBsID0gTWF0aC5jZWlsKGUubGVuZ3RoIC8gMiksXFxuICAgICAgICAgICAgYyA9IE1hdGgucG93KDIsIDMxKSAtIDE7XFxuICAgICAgICB2YXIgZCA9IE1hdGgucm91bmQoMWU5ICogTWF0aC5yYW5kb20oKSkgJSAxZTg7XFxuICAgICAgICBmb3IgKG4gKz0gZDsgbi5sZW5ndGggPiAxMDspXFxuICAgICAgICAgICAgbiA9IChwYXJzZUludChuLnN1YnN0cmluZygwLCAxMCkpICsgcGFyc2VJbnQobi5zdWJzdHJpbmcoMTAsIG4ubGVuZ3RoKSkpLnRvU3RyaW5nKCk7XFxuICAgICAgICBuID0gKG8gKiBuICsgbCkgJSBjO1xcbiAgICAgICAgdmFyIGggPSBcXFwiXFxcIixcXG4gICAgICAgICAgICBmID0gXFxcIlxcXCI7XFxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdC5sZW5ndGg7IGkrKylcXG4gICAgICAgICAgICBmICs9IChoID0gcGFyc2VJbnQodC5jaGFyQ29kZUF0KGkpIF4gTWF0aC5mbG9vcihuIC8gYyAqIDI1NSkpKSA8IDE2ID8gXFxcIjBcXFwiICsgaC50b1N0cmluZygxNikgOiBoLnRvU3RyaW5nKDE2KSxcXG4gICAgICAgICAgICBuID0gKG8gKiBuICsgbCkgJSBjO1xcbiAgICAgICAgZm9yIChkID0gZC50b1N0cmluZygxNik7IGQubGVuZ3RoIDwgODspXFxuICAgICAgICAgICAgZCA9IFxcXCIwXFxcIiArIGQ7XFxuICAgICAgICBsZXQgU2VjcmV0ID0gZiArIGQ7XFxuICAgICAgICBwdXRNeVZhcigna3dfQ29va2llJywgQ29va2llKTtcXG4gICAgICAgIHB1dE15VmFyKCdrd19TZWNyZXQnLCBTZWNyZXQpO1xcbiAgICAgICAgcHV0TXlWYXIoJ2t3X1B1dFRpbWUnLCBuZXcgRGF0ZSgpLmdldFRpbWUoKSArIDNlNSk7XFxuICAgIH1cXG4gICAgdXJsICs9IGBodHRwc1N0YXR1cz0xJnJlcUlkPSR7Uig4KX0tJHtSKDQpfS0ke1IoNCl9LSR7Uig0KX0tJHtSKDEyKX0mcGxhdD13ZWJfd3d3JmZyb209YDtcXG4gICAgbGV0IGdldGRhdGEgPSAoYWpheGVycikgPT4ge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaFBDKHVybCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL2t1d28uY24vJyxcXG4gICAgICAgICAgICAgICAgICAgICdDb29raWUnOiBnZXRNeVZhcigna3dfQ29va2llJyksXFxuICAgICAgICAgICAgICAgICAgICAnU2VjcmV0JzogZ2V0TXlWYXIoJ2t3X1NlY3JldCcpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgIHJldHVybiBhamF4ZXJyIDwgMiA/IGdldGRhdGEoYWpheGVyciArIDEpIDogXFxcIlxcXCI7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgcmV0dXJuIGdldGRhdGEoMCk7XFxufVxcbiQuZXhwb3J0cyA9IHtcXG4gICAgaVRhZzogZnVuY3Rpb24oKSB7XFxuICAgICAgICBpVGFnW1xcXCLmjqjojZBcXFwiXSA9IHt9O1xcbiAgICAgICAga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yA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogXy5waWMsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgIHp5aWQ6IF8uc291cmNlaWRcXG4gICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJrd19pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIsIHQzKSB7XFxuICAgICAgICBsZXQgbGlzdCwgXztcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDor6bmg4VcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly9kYXRhY2VudGVyLmt1d28uY24vZC5jP2Nta2V5PXBsaXN0X3BsMjAxMiZmdD1tdXNpYyZyZXNlbmM9dXRmOCZpZHM9XFxcIiArIHQxKSlbMF07XFxuICAgICAgICAgICAgICAgIGxldCBSZWcgPSAoaykgPT4gcmVnID0gXy5OX01JTkZPLm1hdGNoKG5ldyBSZWdFeHAoJ2JpdHJhdGU6JyArIGsgKyAnLGZvcm1hdDpbXixdKyxzaXplOihbXjtdKyknKSk7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOS4i+i9vVxcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpID0gMTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGsgb2YgWzEyOCwgMzIwLCAyMDAwLCA0MDAwXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChSZWcoaykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbaV0gKyByZWdbMV0ucmVwbGFjZSgvXFxcXHMqbWIvaSwgXFxcIiBNQlxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSsrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJkb3duXFxcIiwgXFxcImt3XFxcIiwgdDEsIGksIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBfKTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgdmFyIHVybCwgaWksIGxyYztcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFJlZyg0MDAwKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia3dcXFwiLCB0MSwgMywgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFJlZygyMDAwKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia3dcXFwiLCB0MSwgMiwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFJlZygzMjApKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrd1xcXCIsIHQxLCAxLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udHBheSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImt3XFxcIiwgdDEsIDAsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVybCA9IGFqYXgocGNhcGkucmVwbGFjZSgvKGFwaVxcXFwvKS8sICckMXYxLycpICsgXFxcIm11c2ljL3BsYXlVcmw/bWlkPVxcXCIgKyB0MSArIFxcXCImdHlwZT1tdXNpYyZcXFwiKS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IGZldGNoKFxcXCJodHRwczovL2FudGlzZXJ2ZXIua3V3by5jbi9hbnRpLnM/dHlwZT1jb252ZXJ0X3VybCZmb3JtYXQ9bXAzJnJpZD1cXFwiICsgdDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybCkgcmV0dXJuIFxcXCJ0b2FzdDovL+aXoOazleino+aekFxcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICBpZiAoIWxyYykge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBhamF4KFxcXCJodHRwOi8vbS5rdXdvLmNuL25ld2g1L3NpbmdsZXMvc29uZ2luZm9hbmRscmM/bXVzaWNJZD1cXFwiICsgdDEgKyBcXFwiJlxcXCIpLmxyY2xpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcyA9ICgoXy50aW1lIC0gMCkgJSA2MCkudG9GaXhlZCgzKS5wYWRTdGFydCg2LCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbSA9ICgoXy50aW1lIC0gcykgLyA2MCkudG9GaXhlZCgwKS5wYWRTdGFydCgyLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYFske219OiR7c31dYCArIF8ubGluZUx5cmljXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkuam9pbignXFxcXG4nKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g6aaW6aG1XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHBjYXBpICsgdDEgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IF8uZGF0YSB8fCBfLmxpc3Q7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgocGNhcGkgKyBcXFwicGxheWxpc3QvcGxheUxpc3RJbmZvP3BpZD1cXFwiICsgdDEgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBfID0gYWpheChwY2FwaSArIFxcXCJiYW5nL2JhbmcvbXVzaWNMaXN0P2JhbmdJZD1cXFwiICsgdDEgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodDIpIHJldHVybiBfLm11c2ljTGlzdDtcXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIF8ubXVzaWNMaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogKF8uc29uZ05hbWUgfHwgXy5uYW1lKSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgaW1nOiBfLnBpYyB8fCBfLmltZyB8fCBmZXRjaCgnaHR0cDovL2FydGlzdHBpY3NlcnZlci5rdXdvLmNuL3BpYy53ZWI/dHlwZT1yaWRfcGljJnBpY3R5cGU9dXJsJnNpemU9NTAwJnJpZD0nICsgXy5pZCksXFxuICAgICAgICAgICAgY29udGVudDogXy5pc0xpc3RlbkZlZSA9PSB0cnVlID8gMSA6IDAsXFxuICAgICAgICAgICAgenlpZDogXy5pZCB8fCBfLnJpZFxcbiAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBpc1UsIHJ1bikge1xcbiAgICAgICAgbGV0IF87XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgbGV0IGxpc3QsIF9fID0ge1xcbiAgICAgICAgICAgICAgICBsaWI6IChfKSA9PiB0cnVlLFxcbiAgICAgICAgICAgICAgICBwYWlkOiAoXykgPT4gXy50cGF5ID09ICcxJyxcXG4gICAgICAgICAgICAgICAgZnJlZTogKF8pID0+IF8udHBheSA9PSAnMCdcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIC8vIHN1cmwgPSAoc3R5cGUpID0+IGFqYXgocGNhcGkgKyBcXFwic2VhcmNoL3NlYXJjaFxcXCIgKyBzdHlwZSArIFxcXCJCeWtleVdvcmQ/a2V5PVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIikubGlzdDtcXG4gICAgICAgICAgICBsZXQgc3VybDIgPSAoZnQsIHZpcHZlcikgPT4gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL3NlYXJjaC5rdXdvLmNuL3Iucz9jbGllbnQ9a3QmYWxsPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwbj1cXFwiICsgKE1ZX1BBR0UgLSAxKSArIFxcXCImcm49MzAmdWlkPTAmdmVyPWt3cGxheWVyaGRfYXJfOC41LjQuNSZmdD1cXFwiICsgZnQgKyBcXFwiJmNsdXN0ZXI9MCZzdHJhdGVneT0yMDEyJmVuY29kaW5nPXV0ZjgmcmZvcm1hdD1qc29uJnZlcm1lcmdlPTEmbW9iaT0xXFxcIiArIHZpcHZlcikpO1xcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICAvLyBzdXJsKCdNdXNpYycpLm1hcCgpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVSA9PSAnZnJlZScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwyKFxcXCJtdXNpY1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcIm11c2ljXFxcIiwgXFxcIiZ2aXB2ZXI9MVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYWJzbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBfIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIV8uU09OR05BTUUubWF0Y2goJ+eJh+autScpKSByZXR1cm4gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbWcsIHJpZCA9IF8uTVVTSUNSSUQuc3BsaXQoJ18nKVsxXSArICcnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ud2ViX2FsYnVtcGljX3Nob3J0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gXFxcImh0dHBzOi8vaW1nMi5rdXdvLmNuL3N0YXIvYWxidW1jb3Zlci9cXFwiICsgXy53ZWJfYWxidW1waWNfc2hvcnQucmVwbGFjZSgvXjEyMC8sICc1MDAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gZmV0Y2goJ2h0dHA6Ly9hcnRpc3RwaWNzZXJ2ZXIua3V3by5jbi9waWMud2ViP3R5cGU9cmlkX3BpYyZwaWN0eXBlPXVybCZzaXplPTUwMCZyaWQ9JyArIHJpZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1nID09IFxcXCJOT19QSUNcXFwiICYmIF8ud2ViX2FydGlzdHBpY19zaG9ydCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwOi8vaW1nMS5rdXdvLmNuL3N0YXIvc3RhcmhlYWRzL1xcXCIgKyBfLndlYl9hcnRpc3RwaWNfc2hvcnQucmVwbGFjZSgvXjEyMC8sICc1MDAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5TT05HTkFNRSArICcgLSAnICsgXy5BUlRJU1QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy50cGF5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHJpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIC8vIHN1cmwoJ1BsYXlMaXN0JykubWFwKCk7XFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcInBsYXlsaXN0XFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYWJzbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ucGxheWxpc3RpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLlRPVEFMIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwOi8vZGF0YWNlbnRlci5rdXdvLmNuL2QuYz9jbWtleT1wbGlzdF9wbDIwMTImZnQ9bXVzaWMmcmVzZW5jPXV0ZjgmaWRzPVxcXCIgKyBrZXl3b3JkKSlbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogZmV0Y2goJ2h0dHA6Ly9hcnRpc3RwaWNzZXJ2ZXIua3V3by5jbi9waWMud2ViP3R5cGU9cmlkX3BpYyZwaWN0eXBlPXVybCZzaXplPTUwMCZyaWQ9JyArIF8uaWQpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8udHBheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChwY2FwaSArIFxcXCJwbGF5bGlzdC9wbGF5TGlzdEluZm8/cGlkPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwbj0xJnJuPTEmXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGRlczogZnVuY3Rpb24odCkge1xcbiAgICAgICAgcmV0dXJuIGV4ZWN1dGVXZWJSdWxlKFxcXCJcXFwiLCAkLnRvU3RyaW5nKCh0KSA9PiB7XFxuICAgICAgICAgICAgY29uc3QgQnVmZmVyID0ge1xcbiAgICAgICAgICAgICAgICBmcm9tOiB0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHIgPSB0Lmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgICAgIGUgPSBuZXcgVWludDhBcnJheShyKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobiA9IDA7IG4gPCByOyBuKyspXFxuICAgICAgICAgICAgICAgICAgICAgICAgZVtuXSA9IHQuY2hhckNvZGVBdChuKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmFuZ2UgPSB0ID0+IEFycmF5LmZyb20obmV3IEFycmF5KHQpLmtleXMoKSk7XFxuICAgICAgICAgICAgTG9uZyA9IHQgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25zdCByID0gQmlnSW50KHQpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdG9TdHJpbmc6ICgpID0+IHIudG9TdHJpbmcoKSxcXG4gICAgICAgICAgICAgICAgICAgIGlzTmVnYXRpdmU6ICgpID0+IHIgPCAwLFxcbiAgICAgICAgICAgICAgICAgICAgbm90OiAoKSA9PiBMb25nKH5yKSxcXG4gICAgICAgICAgICAgICAgICAgIGxvdzogTnVtYmVyKHIpLFxcbiAgICAgICAgICAgICAgICAgICAgb3I6IHQgPT4gTG9uZyhyIHwgQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgICAgIHhvcjogdCA9PiBMb25nKHIgXiBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICAgICAgYW5kOiB0ID0+IExvbmcociAmIEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgICAgICBlcXVhbHM6IHQgPT4gciA9PT0gQmlnSW50KHQpLFxcbiAgICAgICAgICAgICAgICAgICAgc2hpZnRMZWZ0OiB0ID0+IExvbmcociA8PCBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICAgICAgc2hpZnRSaWdodDogdCA9PiBMb25nKHIgPj4gQmlnSW50KHQpKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBMb25nQXJyYXkgPSB0ID0+IHQubWFwKHQgPT4gTG9uZyh0KSk7XFxuXFxuXFxuICAgICAgICAgICAgYXJyYXlFID0gTG9uZ0FycmF5KFtcXG4gICAgICAgICAgICAgICAgMzEsIDAsIDEsIDIsIDMsIDQsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMywgNCwgNSwgNiwgNywgOCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICA3LCA4LCA5LCAxMCwgMTEsIDEyLCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDExLCAxMiwgMTMsIDE0LCAxNSwgMTYsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMTUsIDE2LCAxNywgMTgsIDE5LCAyMCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAxOSwgMjAsIDIxLCAyMiwgMjMsIDI0LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgI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NCwgMiwgNDIsIDEwLCA1MCwgMTgsIDU4LCAyNixcXG4gICAgICAgICAgICAgICAgMzMsIDEsIDQxLCA5LCA0OSwgMTcsIDU3LCAyNSxcXG4gICAgICAgICAgICAgICAgMzIsIDAsIDQwLCA4LCA0OCwgMTYsIDU2LCAyNFxcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgYXJyYXlMcyA9IFtcXG4gICAgICAgICAgICAgICAgMSwgMSwgMiwgMiwgMiwgMiwgMiwgMixcXG4gICAgICAgICAgICAgICAgMSwgMiwgMiwgMiwgMiwgMiwgMiwgMVxcbiAgICAgICAgICAgIF1cXG4gICAgICAgICAgICBhcnJheUxzTWFzayA9IExvbmdBcnJheShbMCwgMTA0ODU3NywgMzE0NTczMV0pXFxuICAgICAgICAgICAgYXJyYXlNYXNrID0gcmFuZ2UoNjQpLm1hcCh0ID0+IE1hdGgucG93KDIsIHQpKVxcbiAgICAgICAgICAgIGFycmF5TWFza1s2M10gKj0gLTFcXG4gICAgICAgICAgICBhcnJheVAgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICAxNSwgNiwgMTksIDIwLCAyOCwgMTEsIDI3LCAxNixcXG4gICAgICAgICAgICAgICAgMCwgMTQsIDIyLCAyNSwgNCwgMTcsIDMwLCA5LFxcbiAgICAgICAgICAgICAgICAxLCA3LCAyMywgMTMsIDMxLCAyNiwgMiwgOCxcXG4gICAgICAgICAgICAgICAgMTgsIDEyLCAyOSwgNSwgMjEsIDEwLCAzLCAyNFxcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgYXJyYXlQQ18xID0gTG9uZ0FycmF5KFtcXG4gICAgICAgICAgICAgICAgNTYsIDQ4LCA0MCwgMzIsIDI0LCAxNiwgOCwgMCxcXG4gICAgICAgICAgICAgICAgNTcsIDQ5LCA0MSwgMzMsIDI1LCAxNywgOSwgMSxcXG4gICAgICAgICAgICAgICAgNTgsIDUwLCA0MiwgMzQsIDI2LCAxOCwgMTAsIDIsXFxuICAgICAgICAgICAgICAgIDU5LCA1MSwgNDMsIDM1LCA2MiwgNTQsIDQ2LCAzOCxcXG4gICAgICAgICAgICAgICAgMzAsIDIyLCAxNCwgNiwgNjEsIDUzLCA0NSwgMzcsXFxuICAgICAgICAgICAgICAgIDI5LCAyMSwgMTMsIDUsIDYwLCA1MiwgNDQsIDM2LFxcbiAgICAgICAgICAgICAgICAyOCwgMjAsIDEyLCA0LCAyNywgMTksIDExLCAzXFxuICAgICAgICAgICAgXSlcXG4gICAgICAgICAgICBhcnJheVBDXzIgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICAxMywgMTYsIDEwLCAyMywgMCwgNCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyLCAyNywgMTQsIDUsIDIwLCA5LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDIyLCAxOCwgMTEsIDMsIDI1LCA3LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDE1LCA2LCAyNiwgMTksIDEyLCAxLCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDQwLCA1MSwgMzAsIDM2LCA0NiwgNTQsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMjksIDM5LCA1MCwgNDQsIDMyLCA0NywgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICA0MywgNDgsIDM4LCA1NSwgMzMsIDUyLCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDQ1LCA0MSwgNDksIDM1LCAyOCwgMzEsIC0xLCAtMVxcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgbWF0cml4TlNCb3ggPSBbXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDE0LCA0LCAzLCAxNSwgMiwgMTMsIDUsIDMsXFxuICAgICAgICAgICAgICAgICAgICAxMywgMTQsIDYsIDksIDExLCAyLCAwLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMSwgMTAsIDEyLCAxNSwgNiwgOSwgMTAsXFxuICAgICAgICAgICAgICAgICAgICAxLCA4LCAxMiwgNywgOCwgMTEsIDcsIDAsXFxuICAgICAgICAgICAgICAgICAgICAwLCAxNSwgMTAsIDUsIDE0LCA0LCA5LCAxMCxcXG4gICAgICAgICAgICAgICAgICAgIDcsIDgsIDEyLCAzLCAxMywgMSwgMywgNixcXG4gICAgICAgICAgICAgICAgICAgIDE1LCAxMiwgNiwgMTEsIDIsIDksIDUsIDAsXFxuICAgICAgICAgICAgICAgICAgICA0LCAyLCAxMSwgMTQsIDEsIDcsIDgsIDEzXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDE1LCAwLCA5LCA1LCA2LCAxMCwgMTIsIDksXFxuICAgICAgICAgICAgICAgICAgICA4LCA3LCAyLCAxMiwgMywgMTMsIDUsIDIsXFxuICAgICAgICAgICAgICAgICAgICAxLCAxNCwgNywgOCwgMTEsIDQsIDAsIDMsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgMTEsIDEzLCA2LCA0LCAxLCAxMCwgMTUsXFxuICAgICAgICAgICAgICAgICAgICAzLCAxMywgMTIsIDExLCAxNSwgMywgNiwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEwLCAxLCA3LCA4LCA0LCAxMSwgMTQsXFxuICAgICAgICAgICAgICAgICAgICAxMywgOCwgMCwgNiwgMiwgMTUsIDksIDUsXFxuICAgICAgICAgICAgICAgICAgICA3LCAxLCAxMCwgMTIsIDE0LCAyLCA1LCA5XFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDEwLCAxMywgMSwgMTEsIDYsIDgsIDExLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgOSwgNCwgMTIsIDIsIDE1LCAzLCAyLCAxNCxcXG4gICAgICAgICAgICAgICAgICAgIDAsIDYsIDEzLCAxLCAzLCAxNSwgNCwgMTAsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgOSwgNywgMTIsIDUsIDAsIDgsIDcsXFxuICAgICAgICAgICAgICAgICAgICAxMywgMSwgMiwgNCwgMywgNiwgMTIsIDExLFxcbiAgICAgICAgICAgICAgICAgICAgMCwgMTMsIDUsIDE0LCA2LCA4LCAxNSwgMixcXG4gICAgICAgICAgICAgICAgICAgIDcsIDEwLCA4LCAxNSwgNCwgOSwgMTEsIDUsXFxuICAgICAgICAgICAgICAgICAgICA5LCAwLCAxNCwgMywgMTAsIDcsIDEsIDEyXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDcsIDEwLCAxLCAxNSwgMCwgMTIsIDExLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDksIDgsIDMsIDksIDcsIDQsIDgsXFxuICAgICAgICAgICAgICAgICAgICAxMywgNiwgMiwgMSwgNiwgMTEsIDEyLCAyLFxcbiAgICAgICAgICAgICAgICAgICAgMywgMCwgNSwgMTQsIDEwLCAxMywgMTUsIDQsXFxuICAgICAgICAgICAgICAgICAgICAxMywgMywgNCwgOSwgNiwgMTAsIDEsIDEyLFxcbiAgICAgICAgICAgICAgICAgICAgMTEsIDAsIDIsIDUsIDAsIDEzLCAxNCwgMixcXG4gICAgICAgICAgICAgICAgICAgIDgsIDE1LCA3LCA0LCAxNSwgMSwgMTAsIDcsXFxuICAgICAgICAgICAgICAgICAgICA1LCA2LCAxMiwgMTEsIDMsIDgsIDksIDE0XFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDIsIDQsIDgsIDE1LCA3LCAxMCwgMTMsIDYsXFxuICAgICAgICAgICAgICAgICAgICA0LCAxLCAzLCAxMiwgMTEsIDcsIDE0LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgMTIsIDIsIDUsIDksIDEwLCAxMywgMCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDEsIDExLCAxNSwgNSwgNiwgOCwgOSwgMTQsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgMTEsIDUsIDYsIDQsIDEsIDMsIDEwLFxcbiAgICAgICAgICAgICAgICAgICAgMiwgMTIsIDE1LCAwLCAxMywgMiwgOCwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDExLCA4LCAwLCAxNSwgNywgMTQsIDksIDQsXFxuICAgICAgICAgICAgICAgICAgICAxMiwgNywgMTAsIDksIDEsIDEzLCA2LCAzXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDEyLCA5LCAwLCA3LCA5LCAyLCAxNCwgMSxcXG4gICAgICAgICAgICAgICAgICAgIDEwLCAxNSwgMywgNCwgNiwgMTIsIDUsIDExLFxcbiAgICAgICAgICAgICAgICAgICAgMSwgMTQsIDEzLCAwLCAyLCA4LCA3LCAxMyxcXG4gICAgICAgICAgICAgICAgICAgIDE1LCA1LCA0LCAxMCwgOCwgMywgMTEsIDYsXFxuICAgICAgICAgICAgICAgICAgICAxMCwgNCwgNiwgMTEsIDcsIDksIDAsIDYsXFxuICAgICAgICAgICAgICAgICAgICA0LCAyLCAxMywgMSwgOSwgMTUsIDMsIDgsXFxuICAgICAgICAgICAgICAgICAgICAxNSwgMywgMSwgMTQsIDEyLCA1LCAxMSwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDIsIDEyLCAxNCwgNywgNSwgMTAsIDgsIDEzXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEsIDMsIDEwLCAxNSwgMTIsIDUsIDAsXFxuICAgICAgICAgICAgICAgICAgICAyLCAxMSwgOSwgNiwgOCwgNywgNiwgOSxcXG4gICAgICAgICAgICAgICAgICAgIDExLCA0LCAxMiwgMTUsIDAsIDMsIDEwLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDEzLCA3LCA4LCAxMywgMTQsIDEsIDIsXFxuICAgICAgICAgICAgICAgICAgICAxMywgNiwgMTQsIDksIDQsIDEsIDIsIDE0LFxcbiAgICAgICAgICAgICAgICAgICAgMTEsIDEzLCA1LCAwLCAxLCAxMCwgOCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDAsIDExLCAzLCA1LCA5LCA0LCAxNSwgMixcXG4gICAgICAgICAgICAgICAgICAgIDcsIDgsIDEyLCAxNSwgMTAsIDcsIDYsIDEyXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDEzLCA3LCAxMCwgMCwgNiwgOSwgNSwgMTUsXFxuICAgICAgICAgICAgICAgICAgICA4LCA0LCAzLCAxMCwgMTEsIDE0LCAxMiwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDIsIDExLCA5LCA2LCAxNSwgMTIsIDAsIDMsXFxuICAgICAgICAgICAgICAgICAgICA0LCAxLCAxNCwgMTMsIDEsIDIsIDcsIDgsXFxuICAgICAgICAgICAgICAgICAgICAxLCAyLCAxMiwgMTUsIDEwLCA0LCAwLCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDE0LCA2LCA5LCA3LCA4LCA5LCA2LFxcbiAgICAgICAgICAgICAgICAgICAgMTUsIDEsIDUsIDEyLCAzLCAxMCwgMTQsIDUsXFxuICAgICAgICAgICAgICAgICAgICA4LCA3LCAxMSwgMCwgNCwgMTMsIDIsIDExXFxuICAgICAgICAgICAgICAgIF1cXG4gICAgICAgICAgICBdXFxuICAgICAgICAgICAgYml0VHJhbnNmb3JtID0gKHQsIHIsIGUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IG4gPSBMb25nKDApO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcmFuZ2UocikuZm9yRWFjaChyID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHRbcl0uaXNOZWdhdGl2ZSgpIHx8IGUuYW5kKGFycmF5TWFza1t0W3JdLmxvd10pLmVxdWFscygwKSB8fCAobiA9IG4ub3IoYXJyYXlNYXNrW3JdKSlcXG4gICAgICAgICAgICAgICAgfSksIG5cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgREVTNjQgPSAodCwgcikgPT4ge1xcbiAgICAgICAgICAgICAgICBlID0gW10sXFxuICAgICAgICAgICAgICAgICAgICBuID0gW107XFxuICAgICAgICAgICAgICAgIGYgPSBiaXRUcmFuc2Zvcm0oYXJyYXlJUCwgNjQsIHIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gblswXSA9IGYuYW5kKDQyOTQ5NjcyOTUpLFxcbiAgICAgICAgICAgICAgICAgICAgblsxXSA9IGYuYW5kKC00Mjk0OTY3Mjk2KS5zaGlmdFJpZ2h0KDMyKSxcXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlKDE2KS5mb3JFYWNoKHIgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmID0gTG9uZygwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gTG9uZyhuWzFdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGJpdFRyYW5zZm9ybShhcnJheUUsIDY0LCBpKS54b3IodFtyXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlKDgpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlW3RdID0gaS5zaGlmdFJpZ2h0KDggKiB0KS5hbmQoMjU1KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2UoOCkucmV2ZXJzZSgpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gZi5zaGlmdExlZnQoNCkub3IobWF0cml4TlNCb3hbdF1bZVt0XV0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gYml0VHJhbnNmb3JtKGFycmF5UCwgMzIsIGYpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gTG9uZyhuWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgblswXSA9IExvbmcoblsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5bMV0gPSBvLnhvcihpKVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBuLnJldmVyc2UoKSxcXG4gICAgICAgICAgICAgICAgICAgIGYgPSBuWzFdLnNoaWZ0TGVmdCgzMikuYW5kKC00Mjk0OTY3Mjk2KS5vcihuWzBdLmFuZCg0Mjk0OTY3Mjk1KSksXFxuICAgICAgICAgICAgICAgICAgICBmID0gYml0VHJhbnNmb3JtKGFycmF5SVBfMSwgNjQsIGYpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHN1YktleXMgPSAodCwgcikgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgbiA9IGJpdFRyYW5zZm9ybShhcnJheVBDXzEsIDU2LCB0KTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UoMTYpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBuID0gbi5hbmQoYXJyYXlMc01hc2tbYXJyYXlMc1t0XV0pLnNoaWZ0TGVmdCgyOCAtIGFycmF5THNbdF0pLm9yKG4uYW5kKGFycmF5THNNYXNrW2FycmF5THNbdF1dLm5vdCgpKS5zaGlmdFJpZ2h0KGFycmF5THNbdF0pKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByW3RdID0gYml0VHJhbnNmb3JtKGFycmF5UENfMiwgNjQsIG4pXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGIgPSBmdW5jdGlvbih0KSB7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHIgPSBCdWZmZXIuZnJvbShcXFwieWx6c3hrd21cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IG4gPSBMb25nKDApO1xcbiAgICAgICAgICAgICAgICByYW5nZSg4KS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbiA9IExvbmcoclt0XSkuc2hpZnRMZWZ0KDggKiB0KS5vcihuKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgY29uc3QgbyA9IE1hdGguZmxvb3IodC5sZW5ndGggLyA4KSxcXG4gICAgICAgICAgICAgICAgICAgIGkgPSByYW5nZSgxNikubWFwKCgpID0+IExvbmcoMCkpO1xcbiAgICAgICAgICAgICAgICBzdWJLZXlzKG4sIGkpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBmID0gcmFuZ2UobykubWFwKCgpID0+IExvbmcoMCkpO1xcbiAgICAgICAgICAgICAgICByYW5nZShvKS5mb3JFYWNoKHIgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2UoOCkuZm9yRWFjaChlID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmW3JdID0gTG9uZyh0W2UgKyA4ICogcl0pLnNoaWZ0TGVmdCg4ICogZSkub3IoZltyXSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjb25zdCBzID0gW107XFxuICAgICAgICAgICAgICAgIHJhbmdlKG8pLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzW3RdID0gREVTNjQoaSwgZlt0XSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHUgPSB0LnNsaWNlKDggKiBvKTtcXG4gICAgICAgICAgICAgICAgbGV0IGggPSBMb25nKDApO1xcbiAgICAgICAgICAgICAgICByYW5nZSh0Lmxlbmd0aCAlIDgpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBoID0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YWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0Mikge1xcbiAgICAgICAgbGV0IGxpc3QsIF87XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm1nP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIjJcXFwiLCB0MSwgXFxcImNvcHlyaWdodElkXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBmID0gXy5jb2RlUmF0ZTtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5LiL6L29XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHQgPSBfLm5ld1JhdGVGb3JtYXRzO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuUFEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0gKyBTaXplKHRbMF0uc2l6ZSB8fCB0WzBdLmFuZHJvaWRTaXplIHx8IHRbMF0uaW9zU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuSFEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKHRbMV0uc2l6ZSB8fCB0WzFdLmFuZHJvaWRTaXplIHx8IHRbMV0uaW9zU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuU1EpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10gKyBTaXplKHRbMl0uc2l6ZSB8fCB0WzJdLmFuZHJvaWRTaXplIHx8IHRbMl0uaW9zU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuWlEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbNF0gKyBTaXplKHRbM10uc2l6ZSB8fCB0WzNdLmFuZHJvaWRTaXplIHx8IHRbM10uaW9zU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIHQxLCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBhcnIuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwibWdcXFwiLCB0MSwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgdDEsIF8pO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB2YXIgdXJsLCBpaSwgbHJjID0gXy5scmNVcmw7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYuWlEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcIm1nXFxcIiwgdDEsIDMsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYuU1EpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcIm1nXFxcIiwgdDEsIDIsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCcyOiAnICsgaWkgKyAnOicgKyB1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYuSFEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcIm1nXFxcIiwgdDEsIDEsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy52aXBUeXBlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwibWdcXFwiLCB0MSwgMCwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX18gPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL20ubXVzaWMubWlndS5jbi9taWd1L3JlbW90aW5nL2Ntc19kZXRhaWxfdGFnP2NwaWQ9XFxcIiArIHQxLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaGVhZGVyc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL20ubXVzaWMubWlndS5jbi92My9cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBfXy5seXJpY0xyYyB8fCBscmM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IF9fLmxpc1FxIHx8IF9fLmxpc3RlblVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBcXFwidG9hc3Q6Ly/ml6Dms5Xop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcblxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9tdXNpYy5taWd1LmNuL3YzL2FwaS9tdXNpYy9hdWRpb1BsYXllci9nZXRMeXJpYz9jb3B5cmlnaHRJZD1cXFwiICsgdDEsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL2FwcC5jLm5mLm1pZ3UuY24vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmx5cmljO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDpppbpobVcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgodXJpKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IF8uaXRlbXMgfHwgX1swXS5pdGVtcztcXG4gICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lIHx8IF8udGl0bGUgfHwgXy5wbGF5TGlzdE5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nIHx8IF8uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZCB8fCBfLnBsYXlMaXN0SWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXy50b3RhbCB8fCAoKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGgpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsZW4gPSBhamF4KGBwbGF5bGlzdC9pbmZvP3NvbmdMaXN0SWQ9JHt0MX1gKS5jb250ZW50Q291bnQ7XFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChgcGxheWxpc3Qvc29uZ3NJbmZvP3BhbHlsaXN0SWQ9JHt0MX1gLCBsZW4pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgXyA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGl0ZW1zOiBbXVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KGBiaWxsYm9hcmQvaG9tZT9wYXRoTmFtZT0ke3QxfWApLnNvbmdzO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0MikgcmV0dXJuIF8uaXRlbXM7XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLml0ZW1zLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5mdWxsU29uZykgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgKF8uc2luZ2VycyA/ICcgLSAnICsgXy5zaW5nZXJzLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpIDogJycpLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdodHRwczonICsgXy5tZWRpdW1QaWMsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8uZnVsbFNvbmcudmlwRmxhZyxcXG4gICAgICAgICAgICAgICAgenlpZDogXy5jb3B5cmlnaHRJZFxcbiAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIGlzVSkge1xcbiAgICAgICAgbGV0IF87XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgbGV0IGxpc3QsIF9fID0ge1xcbiAgICAgICAgICAgICAgICBsaWI6IChfKSA9PiB0cnVlLFxcbiAgICAgICAgICAgICAgICBwYWlkOiAoXykgPT4gXy5mdWxsU29uZy52aXBGbGFnID09ICcxJyxcXG4gICAgICAgICAgICAgICAgZnJlZTogKF8pID0+IF8uZnVsbFNvbmcudmlwRmxhZyA9PSAnMCdcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGxldCBzdXJsID0gKHN0eXBlLCBlcnJpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWpheChcXFwic2VhcmNoL1xcXCIgKyBzdHlwZSArIFxcXCI/dGV4dD1cXFwiICsga2V5d29yZCk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycmkgPCAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN1cmwoc3R5cGUsIGVycmkgKyAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybCgnc29uZycsIDApO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uaXRlbXM7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uZnVsbFNvbmcgJiYgX19baXNVXShfKSkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgKF8uc2luZ2VycyA/ICcgLSAnICsgXy5zaW5nZXJzLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpIDogJycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczonICsgXy5tZWRpdW1QaWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8uZnVsbFNvbmcudmlwRmxhZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5jb3B5cmlnaHRJZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsKCdzb25nTGlzdCcsIDApO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uaXRlbXM7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIF8udG90YWwgfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwibWc/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4MihcXFwiMlxcXCIsIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdOYW1lICsgJyAtICcgKyBfLnNpbmdlcixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWxidW1JbWdzWzBdLmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnZpcFR5cGUgPyAxIDogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmNvcHlyaWdodElkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChgcGxheWxpc3QvaW5mbz9zb25nTGlzdElkPSR7a2V5d29yZH1gKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5wbGF5TGlzdE5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wbGF5TGlzdElkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gMDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgYWpheDogYWpheCxcXG4gICAgYWpheDI6IGZ1bmN0aW9uKHJlc291cmNlVHlwZSwgcmVzb3VyY2VJZCwgY29weXJpZ2h0SWQpIHsgLy8gYy5tdXNpY2FwcC5taWd1LmNuXFxuIC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IsIFxcXCJISVAtSE9QXFxcIl1cXG4gICAgICAgICAgICAubWFwKG5hbWUgPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBudWxsLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICB6eWlkOiBuYW1lXFxuICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcIjVzX2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0Mikge1xcbiAgICAgICAgbGV0IGxpc3QsIF87XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g5q2M5puy6K+m5oOFXFxuICAgICAgICAgICAgICAgIFt0MSwgdHlwZV0gPSB0MS5zcGxpdCgnIycpO1xcbiAgICAgICAgICAgICAgICBsZXQgZ2V0TXVzaWNJbmZvID0gdVR5cGUgPT4gYWpheChgc29uZy8ke3VUeXBlfT9zb25naWQ9JHt0MX0mc29uZ3R5cGU9JHt0eXBlfWApO1xcbiAgICAgICAgICAgICAgICBfID0gZ2V0TXVzaWNJbmZvKFxcXCJnZXRTb25nVXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBhcnIgPSBbXTtcXG4gICAgICAgICAgICAgICAgbGV0IGFycjIgPSBbXTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXy5scXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSArIFNpemUoXy5scXNpemUpKSwgYXJyMi5wdXNoKF8ubHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8uaHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKF8uaHFzaXplKSksIGFycjIucHVzaChfLmhxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLnNxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdICsgU2l6ZShfLnNxc2l6ZSkpLCBhcnIyLnB1c2goXy5zcXVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgYXJyMikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBhcnIuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyBhcnIyW2ldO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCBhcnIyKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgdmFyIHR5cGUyID0ge1xcbiAgICAgICAgICAgICAgICAgICAgeWM6IDEsXFxuICAgICAgICAgICAgICAgICAgICBmYzogMixcXG4gICAgICAgICAgICAgICAgICAgIGJ6OiAzXFxuICAgICAgICAgICAgICAgIH1bdHlwZV07XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBgaHR0cDovL3NlcnZpY2UuNXNpbmcua3Vnb3UuY29tL3NvbmcvZGV0YWlsP3NvbmdJZD0ke3QxfSZzb25nVHlwZT0ke3R5cGUyfWA7XFxuICAgICAgICAgICAgICAgIHZhciBpaSwgbHJjID0gSlNPTi5wYXJzZShmZXRjaFBDKHVybCkpLmRhdGEubHlyaWNzO1xcbiAgICAgICAgICAgICAgICBpZiAoIWxyYykgbHJjID0gZ2V0TXVzaWNJbmZvKFxcXCJuZXdnZXRcXFwiKS5keW5hbWljV29yZHM7XFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlpID0gZ2V0SXRlbSgncGxheV9wbGF0Zm9ybScsICcwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzMnOlxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uc3F1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdKSwgYXJyMi5wdXNoKF8uc3F1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmhxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSksIGFycjIucHVzaChfLmhxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5scXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0pLCBhcnIyLnB1c2goXy5scXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5ocXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0pLCBhcnIyLnB1c2goXy5ocXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ubHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzFdKSwgYXJyMi5wdXNoKF8ubHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnNxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSksIGFycjIucHVzaChfLnNxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ubHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzFdKSwgYXJyMi5wdXNoKF8ubHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmhxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSksIGFycjIucHVzaChfLmhxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5zcXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10pLCBhcnIyLnB1c2goXy5zcXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzOiBhcnIsXFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBhcnIyLm1hcCh1ID0+IHUgKyAnI2lzTXVzaWM9dHJ1ZSMnKSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBTdHJpbmcobHJjKS5yZXBsYWNlKC88YnJcXFxcLz8+L2dpLCBcXFwiXFxcXG5cXFwiKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8v6aaW6aG1XFxuICAgICAgICAgICAgICAgIGxldCBodG1sID0gZmV0Y2goXFxcImh0dHA6Ly81c2luZy5rdWdvdS5jb20vZ2QvZ2RMaXN0PyZ0YWdOYW1lPVxcXCIgKyB0MSArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSk7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiYuYWxidW1cXFwiKTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCIuanhfbmFtZSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGltZyA9IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgenlpZCA9IHBkZmgoaXRlbSwgXFxcImEsMSYmc29uZ2xpc3RpZFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHp5aWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAoTVlfUEFHRSAtIDEpICogMTYgKyBsaXN0Lmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChcXFwic29uZy9nZXRzb25nbGlzdHNvbmc/aWQ9XFxcIiArIHQxKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIF8gPSBbXTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBpZiAodDEgPT0gXFxcImxpc3QyNVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICB1cmkgPSBcXFwic29uZ2xpc3QvaG90c3VwcG9ydHJhbmtsaXN0P3BhZ2U9XFxcIjtcXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodDEgPT0gXFxcInljXFxcIiB8fCB0MSA9PSBcXFwiZmNcXFwiIHx8IHQxID09IFxcXCJsaXN0MjNcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgdXJpID0gXFxcInJhbmsvZGV0YWlsP2lkPVxcXCIgKyB0MSArIFxcXCImcGFnZWluZGV4PVxcXCI7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIHVyaSA9IFxcXCJyYW5rL3N0eWxlcmFuaz9zdHlsZT1cXFwiICsgdDEgKyBcXFwiJnBhZ2VpbmRleD1cXFwiO1xcbiAgICAgICAgICAgICAgICBfID0gYWpheCh1cmkgKyBNWV9QQUdFICsgXFxcIiZwYWdlU2l6ZT0zMFxcXCIpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0MikgcmV0dXJuIF8uc29uZ3MgfHwgXztcXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIChfLnNvbmdzIHx8IF8pLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5TVCA9PSB1bmRlZmluZWQgfHwgXy5TVCA+IDApIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IChfLnNvbmdOYW1lIHx8IF8uU04pICsgJyAtICcgKyAoXy5uaWNrbmFtZSB8fCBfLnVzZXIuTk4pLFxcbiAgICAgICAgICAgICAgICBpbWc6IF8uaW1hZ2UgfHwgKF8udXNlciA/IF8udXNlci5JIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBfLnNvbmdLaW5kIHx8IF8uU0ssXFxuICAgICAgICAgICAgICAgIHp5aWQ6IChfLnNvbmdJZCB8fCBfLklEKSArICcjJyArIChfLnNvbmdLaW5kIHx8IF8uU0spXFxuICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgaXNVKSB7XFxuICAgICAgICBsZXQgXztcXG4gICAgICAgIGlmIChpc1UgIT0gXFxcInVybFxcXCIpIHtcXG4gICAgICAgICAgICBsZXQgbGlzdCwgZmlsdGVyID0ge1xcbiAgICAgICAgICAgICAgICBsaWI6IDAsXFxuICAgICAgICAgICAgICAgIHljOiAxLFxcbiAgICAgICAgICAgICAgICBmYzogMixcXG4gICAgICAgICAgICAgICAgYno6IDNcXG4gICAgICAgICAgICB9W2lzVV07XFxuICAgICAgICAgICAgbGV0IHN1cmwgPSAoc3R5cGUpID0+IEpTT04ucGFyc2UoZmV0Y2hQQyhcXFwiaHR0cDovL3NlYXJjaC41c2luZy5rdWdvdS5jb20vaG9tZS9qc29uP2tleXdvcmQ9XFxcIiArIGtleXdvcmQgKyBcXFwiJnNvcnQ9MSZwYWdlPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZmaWx0ZXI9XFxcIiArIGZpbHRlciArIFxcXCImdHlwZT1cXFwiICsgc3R5cGUpKTtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwoJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLmxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihfLCBKU09OLnBhcnNlKGZldGNoUEMoYGh0dHA6Ly9zZXJ2aWNlLjVzaW5nLmt1Z291LmNvbS9zb25nL2RldGFpbD9zb25nSWQ9JHtfLnNvbmdJZH0mc29uZ1R5cGU9JHtfLnR5cGV9YCkpLmRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ05hbWUgKyAnIC0gJyArIF8ubmlja05hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy50eXBlRW5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ0lkICsgJyMnICsgXy50eXBlRW5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybCgnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5waWN0dXJlVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25nTGlzdElkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIF8ucGFnZUluZm8udG90YWxDb3VudDtcXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgW3QxLCB0Ml0gPSBrZXl3b3JkLnNwbGl0KCcjJyk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdDMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgeWM6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmM6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgYno6IDNcXG4gICAgICAgICAgICAgICAgICAgIH1bdDJdO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2hQQyhgaHR0cDovL3NlcnZpY2UuNXNpbmcua3Vnb3UuY29tL3NvbmcvZGV0YWlsP3NvbmdJZD0ke3QxfSZzb25nVHlwZT0ke3QzfWApKS5kYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdOYW1lICsgJyAtICcgKyBfLm5pY2tOYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiB0MixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBrZXl3b3JkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChcXFwic29uZy9nZXRzb25nbGlzdD9pZD1cXFwiICsga2V5d29yZCk7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uVCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uUCB8fCBfLnVzZXIubCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uSURcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAwO1xcbiAgICAgICAgfVxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p28bXlcIixcInBhdGhcIjpcIm15XCIsXCJydWxlXCI6XCJldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nKSkucnVsZSk7XFxuY29uc3QgdGhpc19wbGF0Zm9ybSA9IFxcXCJteVxcXCI7XFxuXFxuZnVuY3Rpb24gYWpheChwYXRoLCBib2R5LCBob3N0KSB7XFxuICAgIGxldCB1cmwgPSAoaG9zdCB8fCBcXFwiaHR0cHM6Ly9hcGlcXFwiKSArIFxcXCIubGl1bWluZ3llLmNuL20vYXBpL1xcXCIgKyBwYXRoO1xcbiAgICBpZiAoIWhvc3QpIHtcXG4gICAgICAgIGJvZHkuX3QgPSBEYXRlLm5vdygpICsgJydcXG4gICAgICAgIGJvZHkudG9rZW4gPSAkLnJlcXVpcmUoXFxcIm15P3J1bGU95q2M6K+N6YCC6YWNXFxcIikubmV3X3Rva2VuKGJvZHkpO1xcbiAgICAgICAgaWYgKGJvZHkucXVhbGl0eSAhPSB1bmRlZmluZWQpXFxuICAgICAgICAgICAgcmV0dXJuIGJ1aWxkVXJsKHVybCwgYm9keSk7XFxuICAgICAgICBib2R5ID0gSlNPTi5zdHJpbmdpZnkoYm9keSk7XFxuICAgIH1cXG4gICAgbGV0IF8gPSBKU09OLnBhcnNlKHBvc3QodXJsLCB7XFxuICAgICAgICBib2R5OiBib2R5LFxcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBLFxcbiAgICAgICAgICAgICdPcmlnaW4nOiAnaHR0cHM6Ly90b29sLmxpdW1pbmd5ZS5jbicsXFxuICAgICAgICB9XFxuICAgIH0pKTtcXG4gICAgXy5kYXRhLmNvZGUgPSBfLmNvZGU7XFxuICAgIF8uZGF0YS5tc2cgPSBfLm1zZztcXG4gICAgcmV0dXJuIF8uZGF0YTtcXG59XFxuJC5leHBvcnRzID0ge1xcblxcbiAgICBpVGFnOiBmdW5jdGlvbigpIHtcXG4gICAgICAgIC8qIOS4jeiDveino+aekHd55q2M5Y2V5LqGXFxuICAgICAgICAgICAgICAgICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5pVGFnKDEpO1xcbiAgICAgICAgICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXVtcXFwi5YWo6YOoXFxcIl0gPSAkLnJlcXVpcmUoJ3d5P3J1bGU95q2M6K+N6YCC6YWNJykuYWpheChcXFwidG9wbGlzdD9cXFwiKS5saXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICAqL1xcbiAgICAgICAgbGV0IGFyciA9IFxcXCJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWiNcXFwiLnNwbGl0KFxcXCJcXFwiKTtcXG4gICAgICAgIGFyci51bnNoaWZ0KFxcXCLmjqjojZBcXFwiKTtcXG4gICAgICAgIGFyci5tYXAoKHQsIGkpID0+IHtcXG4gICAgICAgICAgICBpVGFnW3RdID0ge307XFxuICAgICAgICAgICAgaVRhZ1t0XVtcXFwiTXlGcmVlTVAzXFxcIl0gPSBTdHJpbmcoaSk7XFxuICAgICAgICB9KVxcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcIm15X2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0Mikge1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhVxcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSBbdHNbMF0gKyA5NiwgdHNbMV0gKyAxMjgsIHRzWzJdICsgMzIwLCB0c1szXSArIDIwMDBdO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh0MSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHQyID0gaW5wdXQuc3BsaXQoJ+OAkScpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IGFqYXgoXFxcImxpbmtcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0MSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eTogdDJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB0MSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGlpLCBscmMgPSBhamF4KFxcXCJseXJpY1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiB0MVxcbiAgICAgICAgICAgICAgICB9KS5scmM7XFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlpID0gZ2V0SXRlbSgncGxheV9wbGF0Zm9ybScsICcwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzMnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9IFsyMDAwLCAzMjAsIDEyOCwgOTZdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gWzMyMCwgMTI4LCA5NiwgMjAwMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIgPSBbMTI4LCAzMjAsIDIwMDAsIDk2XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gWzk2LCAxMjgsIDMyMCwgMjAwMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIG5hbWVzID0gW107XFxuICAgICAgICAgICAgICAgIHZhciB1cmxzID0gYXJyLm1hcCgocXVhbGl0eSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZXNbaV0gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgOTY6IHRzWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDEyODogdHNbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgMzIwOiB0c1syXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAyMDAwOiB0c1szXVxcbiAgICAgICAgICAgICAgICAgICAgfVtxdWFsaXR5XTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhamF4KFxcXCJsaW5rXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0MSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5OiBxdWFsaXR5ICsgJydcXG4gICAgICAgICAgICAgICAgICAgIH0pICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiB1cmxzLFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IG5hbWVzLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8v6aaW6aG1XFxuICAgICAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQxLm1hdGNoKC9cXFxcPy8pKSB0MSA9IFxcXCJ0b3AvcGxheWxpc3Q/Y2F0PVxcXCIgKyB0MSArIFxcXCImXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoJ3d5P3J1bGU95q2M6K+N6YCC6YWNJykuYWpheCh0MSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoXy5yZXN1bHQgfHwgXy5wbGF5bGlzdHMpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCB8fCBfLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgoXFxcImFydGlzdC9saXN0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgaW5pdGlhbDogdDEsXFxuICAgICAgICAgICAgICAgICAgICBwYWdlOiBNWV9QQUdFXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0IHx8IFtdO1xcbiAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljIHx8ICdoaWtlcjovL2ltYWdlcy9ydWxlX3R5cGVfYXVkaW8nLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMywgLy8gMlxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAoTVlfUEFHRSAtIDEpICogOTAgKyBsaXN0Lmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoXFxcInNlYXJjaC9wbGF5bGlzdFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcImRcXFwiICsgdDFcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBfID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3Q6IFtdXFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChcXFwiYXJ0aXN0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0MVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIF8gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdDogW11cXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYodDIpcmV0dXJuIF8ubGlzdDtcXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIF8ubGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLmFydGlzdCA/ICcgLSAnICsgXy5hcnRpc3QubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJykgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgaW1nOiBfLnBpYyB8fCAoXy5hbGJ1bSAmJiBfLmFsYnVtLnBpYyA/IF8uYWxidW0ucGljIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6ICd3eScsXFxuICAgICAgICAgICAgenlpZDogXy5oYXNoIHx8IF8uaWRcXG4gICAgICAgIH0sIDEpKTtcXG4gICAgICAgIGlmIChfLmxpc3QubGVuZ3RoID09IDAgJiYgXy5uYW1lKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogXy5kZXNjcmlwdGlvbixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgc3R5cGUsIGlzTmV3KSB7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgIGxldCBzdHlwZSA9IHN0eXBlIHx8ICd3eSc7XFxuICAgICAgICAgICAgICAgIGxldCBzdHlwZTIgPSB7XFxuICAgICAgICAgICAgICAgICAgICAnd3knOiAnWVFEJyxcXG4gICAgICAgICAgICAgICAgICAgICdrdyc6ICdZUUInLFxcbiAgICAgICAgICAgICAgICAgICAgJ21nJzogaXNOZXcgPyAnWVFNJyA6ICdtaWd1JyxcXG4gICAgICAgICAgICAgICAgICAgICcxdCc6ICcxdGluZycsXFxuICAgICAgICAgICAgICAgICAgICAnZGInOiAnZG91YmFuJyxcXG4gICAgICAgICAgICAgICAgICAgICc1eSc6ICd3dXNpbmd5YycsXFxuICAgICAgICAgICAgICAgICAgICAnNWYnOiAnd3VzaW5nZmMnXFxuICAgICAgICAgICAgICAgIH1bc3R5cGVdO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QsIGJvZHksIF8sIHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc05ldykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KCdzZWFyY2gnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHN0eXBlMixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dDoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogTVlfUEFHRSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdjogJ2JldGEnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdCB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLmFydGlzdCA/ICcgLSAnICsgXy5hcnRpc3QubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJykgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5waWMgfHwgXy5hbGJ1bS5waWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHN0eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmhhc2ggfHwgXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSBcXFwidGV4dD1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSArIFxcXCImdHlwZT1cXFwiICsgc3R5cGUyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSAkLnJlcXVpcmUoXFxcIm15P3J1bGU95q2M6K+N6YCC6YWNXFxcIikub2xkX2VuY29kZShib2R5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gYWpheCgnc2VhcmNoJywgYm9keSwgXFxcImh0dHA6Ly9hcGkyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdCB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTGF6eSgnbXknLCBfLmlkKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnVybF9tNGEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfbTRhICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRzWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsXzEyOClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaChfLnVybF8xMjggKyAnI2lzTXVzaWM9dHJ1ZSMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2godHNbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy51cmxfMzIwKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKF8udXJsXzMyMCArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0c1syXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnVybF9mbGFjKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKF8udXJsX2ZsYWMgKyAnI2lzTXVzaWM9dHJ1ZSMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2godHNbM10pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLmFydGlzdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlciB8fCBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHN0eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogdXJscyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBuYW1lcyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGx5cmljOiBfLmxyY1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0Lmxlbmd0aCA9PSAwICYmIF8uY29kZSA9PSA0MDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5tc2csXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IF8uY29kZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIue9kee7nOW8guW4uO+8jOaQnOe0ouWksei0pVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogZS50b1N0cmluZygpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLnNlYXJjaCgxLCBrZXl3b3JkLCAxKS5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbmV3X3Rva2VuOiBmdW5jdGlvbihib2R5KSB7XFxuICAgICAgICBbdCwgZSwgQXNdID0gW1xcbiAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgXFxcIjIwMjMwMzI3LlxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJ5R3o0bjlYRTl4WXkyT2o1VWI3RTZ1OWE1cDVhSVdaWWU1M09ycTV3RTVVZ25qYldxMDQxMFdUdm1MQk8xWjJOXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInBXOGpnL21rZTZjTzFGNENUdWFpc3doWmZRR3pNeXE1TkpSTFBWSXZEeGxBNz1FM1lyU1VvSDBiMkJYS245dGQrXFxcIlxcbiAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICBcXFwiMjAyMjEyMjIuXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIkgyaHV1d1hmOHdOOUN4NUszbEVRa2RnNFZUQ0pxSWI0NDBRUVg5NU9ReWUxRDA5MjI5MkJJNnJnakZnSzltY3hcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiUXNWbXQ0cnBxUEZKeVdjZzFZL1NSQXVMTVRlZEIzNzVYWk5EbE9HeGo2YjJ2YW45PUM4VWhIS0Urd2lmSWtvejBcXFwiXFxuICAgICAgICAgICAgXVxcbiAgICAgICAgXVswXTtcXG4gICAgICAgIHZhciBhLCBiLCBjLCBkLFxcbiAgICAgICAgICAgIHYgPSAwLFxcbiAgICAgICAgICAgIHRrID0gXFxcIlxcXCI7XFxuICAgICAgICB2YXIgZSA9IGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeShib2R5KSkuc3BsaXQoXFxcIlxcXCIpXFxuICAgICAgICAgICAgLm1hcCgodCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICByZ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ICAgdmFyIFI0ID0gUig0KTtcXG4gICAgICAgIGZvciAobGV0IGkgaW4gdCkge1xcbiAgICAgICAgICAgIGkgPSB0LmNoYXJDb2RlQXQoaSlcXG4gICAgICAgICAgICBpZiAoaSA8IDEyOCkge1xcbiAgICAgICAgICAgICAgICBlICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoaSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBlICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoaSA+PiAxMiB8IDIyNClcXG4gICAgICAgICAgICAgICAgZSArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGkgPj4gNiAmIDYzIHwgMTI4KVxcbiAgICAgICAgICAgICAgICBlICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoaSAmIDYzIHwgMTI4KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHZhciBhID0gbWQ1KHAuc3Vic3RyKDAsIDE2KSk7XFxuICAgICAgICB2YXIgYSA9IGEgKyBtZDUoYSArIFI0KTtcXG4gICAgICAgIHZhciBwID0gW107XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDI1NjsgaSsrKSBwW2ldID0gaTtcXG4gICAgICAgIHZhciBJID0gYiA9IGMgPSB0ID0gMDtcXG4gICAgICAgIGZvciAobGV0IGkgaW4gcCkge1xcbiAgICAgICAgICAgIEkgPSAoSSArIHBbaV0gKyBhW2kgJSA2NF0uY2hhckNvZGVBdCgpKSAlIDI1NlxcbiAgICAgICAgICAgIFggPSBwW2ldXFxuICAgICAgICAgICAgcFtpXSA9IHBbSV1cXG4gICAgICAgICAgICBwW0ldID0gWFxcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChsZXQgaSBpbiBlKSB7XFxuICAgICAgICAgICAgSSA9IE51bWJlcihpKSArIDE7XFxuICAgICAgICAgICAgWCA9IHBbSV07XFxuICAgICAgICAgICAgYiA9IChiICsgWCkgJSAyNTY7XFxuIC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A9IE1hdGguZmxvb3IoRGF0ZS5ub3coKSAvIDFlMyk7XFxuICAgIGxldCBib2R5ID0gT2JqZWN0LmtleXMoanNvbikuc29ydCgpXFxuICAgICAgICAubWFwKGtleSA9PiBrZXkgKyAnPScgKyBqc29uW2tleV0pLmpvaW4oJyYnKTtcXG4gICAgYm9keSArPSBcXFwiJnNpZ249XFxcIiArIG1kNShib2R5ICsgXFxcIjBiNTBiMDJmZDBkNzNhOWM0YzhjM2E3ODFjMzA4NDVmXFxcIik7XFxuICAgIGxldCB1ID0gYGh0dHBzOi8vbXVzaWMuOTFxLmNvbS92MS8ke3VyaX0/YCArIGJvZHk7XFxuICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHUpKS5kYXRhO1xcbn1cXG5cXG5mdW5jdGlvbiBzZWFyY2gocGxhdGZvcm0sIGtleXdvcmQsIHBsYXRmb3JtMiwgcnVuKSB7XFxuICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgY2FzZSAnMCc6XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0yKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICd6eic6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8venoxMjMuY29tJztcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBKU09OLnBhcnNlKHBvc3QodSArICcvYWpheC8nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcImFjdD1zZWFyY2gma2V5PVxcXCIgKyBrZXl3b3JkICsgXFxcIiZsYW5nPSZwYWdlPVxcXCIgKyBNWV9QQUdFXFxuICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IF8gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQgPSBfLmlkICsgJyN6eic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGF6eSgnenonLCB6eWlkLCAwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5tbmFtZSArICcgLSAnICsgXy5zbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYy5yZXBsYWNlKC9cXFxcPy4qLywgJycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnenonLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2JkJzpcXG4gICAgICAgICAgICAgICAgICAgIHFpYW5xaWFuKFxcXCJzZWFyY2hcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgd29yZDoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlTm86IE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgICAgIH0pLnR5cGVUcmFjay5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFfLmlzVmlwKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnRpdGxlICsgJyAtICcgKyBfLmFydGlzdC5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2JkJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZCArICcjYmQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAna3onOiAvLyDkurrmnLrpqozor4FcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vaGF5cWJoZ3Iuc2xpZGVyLmt6L1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IEpTT04ucGFyc2UoZmV0Y2godSArIFxcXCJ2a19hdXRoLnBocD9xPVxcXCIgKyBrZXl3b3JkKSlbXFxcImF1ZGlvc1xcXCJdW1xcXCJcXFwiXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBfIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gKF8udXJsLm1hdGNoKC9odHRwcz86LykgPyBcXFwiXFxcIiA6IHUpICsgXy51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0X2FydC5zcGxpdCgnIC0gJykucmV2ZXJzZSgpLmpvaW4oJyAtICcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2t6JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAna3onLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy56eWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnbmknOlxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkgaHRtID0gXFxcIi0xLmh0bVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBlbHNlIGh0bSA9IFxcXCItMS1cXFwiICsgTVlfUEFHRSArIFxcXCIuaHRtXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGtleXdvcmQgPSBlbmNvZGVVUklDb21wb25lbnQoa2V5d29yZCkucmVwbGFjZSgvLS9nLCAnXzJkJykucmVwbGFjZSgvJS9nLCAnXycpO1xcbiAgICAgICAgICAgICAgICAgICAgaHRtbCA9IGZldGNoQ29kZUJ5V2ViVmlldyhcXFwiaHR0cHM6Ly93d3cuaGlmaW5pLmNvbS9zZWFyY2gtXFxcIiArIGtleXdvcmQgKyBodG0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmxvY2tSdWxlcyc6IFsnLmpzJywgJy5jc3MnLCAnLnBuZycsICcuaWNvJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dDogNTAwMFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShodG1sLCBcXFwiYm9keSYmbGkubWVkaWFbZGF0YS10aWRdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocGRmaChpdGVtLCBcXFwiYSwyJiZUZXh0XFxcIikgIT0gXFxcIueJueS+m1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZCA9IHBkZmgoaXRlbSwgXFxcImEsMSYmaHJlZlxcXCIpLnJlcGxhY2UoL1xcXFxEL2csICcnKSArICcjbmknO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGF6eSgnbmknLCB6eWlkLCAwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcImEsMSYmVGV4dFxcXCIpLnNwbGl0KFxcXCLjgItcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5zcGxpdChcXFwi44CKXFxcIikucmV2ZXJzZSgpLmpvaW4oJyAtICcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL3d3dy5oaWZpbmkuY29tL1xcXCIgKyBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ25pJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdnMyc6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly93d3cuZ2dnbXVzaWMuY29tL1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICBrZXl3b3JkID0gZW5jb2RlVVJJQ29tcG9uZW50KGtleXdvcmQpLnJlcGxhY2UoLy0vZywgJ18yZCcpLnJlcGxhY2UoLyUvZywgJ18nKTtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBmZXRjaENvZGVCeVdlYlZpZXcodSArIFxcXCJzZWFyY2gtXFxcIiArIGtleXdvcmQgKyBcXFwiLTEuaHRtXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdibG9ja1J1bGVzJzogWycuanMnLCAnLmNzcycsICcucG5nJywgJy5pY28nXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiA1MDAwXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZsaS5jYXJkW2RhdGEtdGlkXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZCA9IHBkZmgoaXRlbSwgXFxcImEsMCYmaHJlZlxcXCIpLnJlcGxhY2UoL1xcXFxEL2csICcnKSArICcjZzMnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxhenkoJ2czJywgenlpZCwgMCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUuc3BsaXQoXFxcIiAtIFxcXCIpLnJldmVyc2UoKS5qb2luKCcgLSAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiB1ICsgcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2czJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdieic6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHBzOi8vZGViZW56aS5jb20vP3M9XFxcIiArIGtleXdvcmQpLCBcXFwiYm9keSYmaDIuZW50cnktdGl0bGVcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZCA9IHBkZmgoaXRlbSwgXFxcImEsMCYmaHJlZlxcXCIpLnJlcGxhY2UoL1xcXFxEL2csICcnKSArICcjYnonO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGF6eSgnYnonLCB6eWlkLCAwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL3BpYy5ybWIuYmRzdGF0aWMuY29tL2JqaC8zOWI5NjRiMmIwODdhMDVjMzlhNTZhMmUzOGMwNDAxOTMzOC5qcGVnJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdieicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnc3QnOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goYGh0dHA6Ly93d3cuc29uZ3Rhc3RlLmNvL2RhbmNlL3NlYXJjaD9rZXk9JHtrZXl3b3JkfSZwYWdlPSR7TVlfUEFHRX1gKSwgXFxcImJvZHkmJi5tbGlzdCYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQgPSBwZGZoKGl0ZW0sIFxcXCIudGQzJiZhJiZocmVmXFxcIikucmVwbGFjZSgvLipcXFxcLy8sICcnKSArICcjc3QnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxhenkoJ3N0JywgenlpZCwgMCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi50ZDMmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLnJlcGxhY2UoJ3BpY2RhdGEnLCAnYXR0YWNobWVudCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnc3QnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2JsbSc6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaChgaHR0cHM6Ly9ibGFja2JsbS5iYWlsZW1pLmNvbS9pbmRleC5waHAvZGFuY2Uvc2VhcmNoP2tleT0ke2tleXdvcmR9JnBhZ2U9JHtNWV9QQUdFfWApKS5kYW5jZWxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBfIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBfLmRvd251cmwgfHwgXy5wbGF5dXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsICYmIF8ubmFtZSkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyAoXy5zaW5nZXIgfHwgXy51cF91c2VyKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVyIHx8IF8udXBfdXNlcl9sb2dvLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnYmxtJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25naWQgKyAnI2JsbSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZnAnOlxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwczovL3d3dy5mYW5ncGkubmV0L3MvXFxcIiArIGtleXdvcmQpLCBcXFwiYm9keSYmW2NsYXNzPXJvd11cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiZGl2LDEmJlRleHRcXFwiKSArICcgLSAnICsgcGRmaChpdGVtLCBcXFwiZGl2LDImJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdmcCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2ZwJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcImEsMCYmaHJlZlxcXCIpLnJlcGxhY2UoL1xcXFxEL2csICcnKSArICcjZnAnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnaHQnOlxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwOi8vbS5odHF5eS5jb20vc2VhcmNoL3Jlc3VsdD9pZD1cXFwiICsga2V5d29yZCksIFxcXCJib2R5JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSArICcgLSAnICsgcGRmaChpdGVtLCBcXFwiZW0sMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpICsgJzBAaGVhZGVycz17XFxcInJlZmVyZXJcXFwiOlxcXCJodHRwOi8vbS5odHF5eS5jb21cXFwifScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnaHQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiLnBsYXkmJmRhdGEtaWRcXFwiKSArICcjaHQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnMXQnOlxcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChgaHR0cHM6Ly9zby4xdGluZy5jb20vc29uZy9qc29uP3E9JHtrZXl3b3JkfSZwYWdlPSR7TVlfUEFHRX0mc2l6ZT0zMGApKS5yZXN1bHRzLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nX25hbWUgKyAnIC0gJyArIF8uc2luZ2VyX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8uYWxidW1fY292ZXIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJzF0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdfaWQgKyAnIzF0J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgcjEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICc5dCc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChgaHR0cDovL25ldy45c2t5LmNvbS9hcGkvd2VpYm8vY29udGVudC9zZWFyY2g/Y29udGVudD0ke2tleXdvcmR9YCkpLmRhdGEuc29uZ19saXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9eTiQvaS50ZXN0KF8uaXNfc3RhdGlvbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL25ldy45c2t5LmNvbS9hcGkvc29uZy9kZXRhaWw/aWQ9XFxcIiArIF8uc29uZ19pZCArIFxcXCImaXNfbG9naW49TlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaCh1KSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nX25hbWUgKyAnIC0gJyArIF8ubXVzaWNpYW5fbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uZGlzY19pbWdfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICc5dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25nX2lkICsgJyM5dCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW18uc29uZ191cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmM6IF8ubHlyaWNfdXJsIHx8IExyYyhfLmRlc2lnbl9ub3RlcylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAna3knOlxcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShwb3N0KCdodHRwOi8vYXBpLmt1YWl5aW4xMjMubmV0L3Evc2VhcmNoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IFxcXCJxPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZjbGllbnRfdj0yLjcuMSZwYWdlPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZwbGF0Zm9ybT1BbmRyb2lkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjbGllbnQtdlxcXCI6IFxcXCIyLjcuMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJkZXZpY2UtaWRcXFwiOiBSKDE2KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBsYXRmb3JtXFxcIjogXFxcIkFuZHJvaWRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJva2h0dHAvMy4xNC40XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvbm5lY3Rpb25cXFwiOiBcXFwiS2VlcC1BbGl2ZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb250ZW50LVR5cGVcXFwiOiBcXFwiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLm11c2ljX2xpc3Qucm93cy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8udXNlcl9pbmZvLm5pY2tuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlcixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAna3knLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uenlpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXy5wbGF5X3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGx5cmljOiBfLmxyY191cmxcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICc1bmQnOlxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwOi8vbS41bmQuY29tL3NvL3NfXFxcIiArIGtleXdvcmQpLCBcXFwiYm9keSYmLmxpc3Qtc29uZyYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLnNvbmcmJlRleHRcXFwiKSArICcgLSAnICsgcGRmaChpdGVtLCBcXFwiLmFydGlzdCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJzVuZCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCJhJiZocmVmXFxcIikucmVwbGFjZSgvLipcXFxcL3xcXFxcLi4qL2csICcnKSArICcjNW5kJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2JpdSc6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChcXFwiaHR0cHM6Ly9iaXUubW9lL2luZGV4LnBocD9tPSZjPVNvbmcmYT1zZWFyY2gmZGF0YT1cXFwiICsga2V5d29yZCArIFxcXCImcD1cXFwiICsgTVlfUEFHRSksIFxcXCJib2R5JiZ0Ym9keSYmdHJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYml1X3NpZCA9IHBkZmgoaXRlbSwgXFxcImEsMCYmaHJlZlxcXCIpLnJlcGxhY2UoL1xcXFxEKy8sIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJkh0bWxcXFwiKS5yZXBsYWNlKC9cXFxccyo8c3BhbltcXFxcc1xcXFxTXSsvaSwgXFxcIlxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCJhLDEmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9iaXUubW9lL1Nvbmcvc2hvd0NvdmVyL3NpZC9cXFwiICsgYml1X3NpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2JpdScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGJpdV9zaWQgKyAnI2JpdSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnbXVzJzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwczovL3NreW11cy5vcmcvdHJhY2tzL1xcXCIgKyBrZXl3b3JkICsgXFxcIi9cXFwiICsgTVlfUEFHRSksIFxcXCJib2R5JiYuZi10YWJsZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIuYXJ0aXN0LW5hbWUmJlRleHRcXFwiKSArICcgLSAnICsgcGRmaChpdGVtLCBcXFwiLnRyYWNrLW5hbWUmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLnJlcGxhY2UoL14oLispLywgJ2h0dHBzOiQxJykgfHwgJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdtdXMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ211cycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6ICd1bmRlZmluZWQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtcXFwiaHR0cHM6XFxcIiArIHBkZmgoaXRlbSwgXFxcIi5tcDMmJmhyZWZcXFwiKSArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnamFtJzpcXG4gICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vc29scmNsb3VkLmphbWVuZG8uY29tL3NvbHIvamFtY29tP3d0PWpzb24mcm93cz0zMCZxPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZzdGFydD1cXFwiICsgKChNWV9QQUdFIC0gMSkgKiAzMCkpKS5yZXNwb25zZS5kb2NzLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6Ly9wcm9kLTEuc3RvcmFnZS5qYW1lbmRvLmNvbS9kb3dubG9hZC90cmFjay9cXFwiICsgXy5pZCArIFxcXCIvbXAzNVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLnJlcGxhY2UoXy5hcnRpc3RfbmFtZSArICcgLSAnLCAnJykgKyAnIC0gJyArIF8uYXJ0aXN0X25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOi8vdXNlcmNvbnRlbnQuamFtZW5kby5jb20vP3R5cGU9YWxidW0maWQ9XFxcIiArIF8uYWxidW1faWQucmVwbGFjZSgvXFxcXEQvZywgJycpICsgXFxcIiZ3aWR0aD01MDAmdHJhY2tpZD1cXFwiICsgXy5pZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2phbScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6ICd1bmRlZmluZWQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnanVpJzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBldmFsKHBvc3QoJ2h0dHBzOi8vbmV3Lm15ZnJlZW1wM2p1aWNlcy5jYy9hcGkvYXBpX3NlYXJjaC5waHA/Y2FsbGJhY2s9cWlhbnFpYW4nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcInE9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB1ID0gXFxcImh0dHBzOi8vbnBsYXkuaWRtcDNzLmNvbS9zdHJlYW0vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBvID0gXFxcIkFCQ0RFRkdISktNTlBRUlNUVVZXWFlaYWJjZGVmZ2hqa21ucHFyc3R1dnh5ejEyM1xcXCI7XFxuXFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBqdWlfZCh0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGUgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PSB0KSByZXR1cm4gb1swXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHQgPCAwICYmICh0ICo9IC0xLCBlICs9IFxcXCItXFxcIik7IDAgPCB0OykgdmFsID0gcGFyc2VJbnQodCAlIDQ4KSwgdCA9IHBhcnNlSW50KHQgLyA0OCksIGUgKz0gb1t2YWxdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBsaXN0W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZXR0eUlkID0ganVpX2QoXy5vd25lcl9pZCkgKyBcXFwiOlxcXCIgKyBqdWlfZChfLmlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnRpdGxlICsgJyAtICcgKyBfLmFydGlzdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2p1aScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnanVpJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wcmV0dHlJZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdSArIHByZXR0eUlkICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICd5Myc6XFxuICAgICAgICAgICAgICAgICAgICAkc29uZ19kYXRhID0gW107XFxuICAgICAgICAgICAgICAgICAgICBzb25nX2xpc3QgPSAoaSwgaWkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gJHNvbmdfZGF0YVtpXS5zcGxpdChcXFwifHxcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gaXRlbS5zcGxpdChcXFwifFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoX1s0XSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHA6Ly90aW5nNi55eW1wMy5uZXQ6ODIvXFxcIiArIFN0cmluZyhfWzRdKS5yZXBsYWNlKCcud21hJywgJy5tcDMnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogX1sxXSArICcgLSAnICsgX1szXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgneTMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAneTMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ucHJldHR5SWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2hQQyhcXFwiaHR0cDovL3d3dy55eW1wMy5jb20vcC9nZXRzZXIuYXNweD9rZXk9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICczNjUnOlxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICQzNjVfU2VhcmNoUmVzdWx0KHQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBkZmEoXFxcIjxib2R5PlxcXCIgKyB0ICsgXFxcIjwvYm9keT5cXFwiLCBcXFwiYm9keSYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGV2YWwoXFxcIiQzNjVfXFxcIiArIGZldGNoKFxcXCJodHRwOi8vaGl0Lnl1ZTM2NS5jb20vc2VhcmNoLmFzcD9ybmQ9XFxcIiArIE1hdGgucmFuZG9tKCkgKyBcXFwiJmtleXdvcmRzPVxcXCIgKyBlc2NhcGUoa2V5d29yZCkgKyBcXFwiJnQ9MVxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdXNpY0lkID0gcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvLipcXFxcL3xcXFxcLi4qL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHA6Ly85Ni5pZXJnZS5jbi9cXFwiICsgcGFyc2VJbnQoTXVzaWNJZCAvIDMwMDAwKSArIFxcXCIvXFxcIiArIHBhcnNlSW50KE11c2ljSWQgLyAyMDAwKSArIFxcXCIvXFxcIiArIE11c2ljSWQgKyBcXFwiLm1wM1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIubmFtZSYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCIuc2luZ2VyJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnMzY1JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnMzY1JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6ICd1bmRlZmluZWQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGoxJzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL3d3dy56enpkai5jb21cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2hQQyh1ICsgXFxcIi9tdXNpYy9zZWFyY2gtXFxcIiArIGtleXdvcmQgKyBcXFwiP2NhdF9pZD0wJnBhZ2U9XFxcIiArIE1ZX1BBR0UpLCBcXFwiYm9keSYmdGJvZHkmJnRyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubWF0Y2goL2FsdD1cXFwiKC4rPylcXFwiLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogdSArIGl0ZW0ubWF0Y2goL3NyYz1cXFwiKC4rPylcXFwiLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC9kYXRhLWlkPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGoxJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajInOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2hQQyhcXFwiaHR0cHM6Ly93d3cuZGp1dS5jb20vc2VhcmNoP211c2ljbmFtZT1cXFwiICsga2V5d29yZCArIFxcXCImbGlzdD0yJmNpZD0wJnBhZ2U9XFxcIiArIE1ZX1BBR0UpLCBcXFwiYm9keSYmLmxpc3RfbXVzaWNsaXN0JiZ0cltjbGFzc11cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5tYXRjaCgvdGl0bGU9XFxcIiguKz8pXFxcIi8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJodHRwczpcXFwiICsgaXRlbS5tYXRjaCgvc3JjPVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqMicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL3ZhbHVlPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGoyJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajMnOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vd3d3LmxhbGFkai5jb21cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2hQQyh1ICsgXFxcIi9zZWFyY2g/c2VhcmNoPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJi5saXN0X211c2ljbGlzdCYmdHJbY2xhc3NdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi50MSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBpdGVtLm1hdGNoKC9zcmM9XFxcIiguKz8pXFxcIi8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGozJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvdmFsdWU9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqNCc6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKFxcXCJodHRwczovL20uYWhhZGouY29tL3NlYXJjaC8/a2V5PVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFICsgXFxcIi5odG1sXFxcIiksIFxcXCJib2R5JiYueWlueXVlX2xpc3QmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gcGRmaChpdGVtLCBcXFwiaDMmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6Ly9zdC45Mmt1LmNvbS96d2NzL1xcXCIgKyB0aXRsZSArIFxcXCIubXA0XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNkajQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1swXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqNSc6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8vd3d3LmRqLm5ldC8nO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IHBvc3QodSArICdzZWFyY2gucGhwP21vZD1tdXNpYyZmb3JtaGFzaD04Yzk2NGU4YSZzcmNodHh0PScgKyBlbmNvZGVTdHIoa2V5d29yZCwgJ0dCSycpICsgJyZzZWFyY2hzdWJtaXQ9eWVzJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICd0ZXh0L2h0bWw7IGNoYXJzZXQ9Z2JrJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSB1ICsgSlNPTi5wYXJzZShfKS5oZWFkZXJzLmxvY2F0aW9uWzBdICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2godXJsKSwgXFxcImJvZHkmJi5tdXNpYy1saXN0JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDEmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiB1ICsgcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKS5yZXBsYWNlKFxcXCImc2l6ZT1zbWFsbFxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqNScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcImEsMSYmaHJlZlxcXCIpLm1hdGNoKC9pZD0oXFxcXGQrKS8pWzFdICsgJyNkajUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqNic6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gJ2h0dHA6Ly93d3cuMzZkai5jb20vZS9zZWFyY2gvJztcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBwb3N0KHUgKyAnaW5kZXgucGhwJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3NpZDogJzEsMiwzLDQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlib2FyZDoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VibWl0OiAnJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdzogJ3RpdGxlJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcGlkOiAnMSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB1ICs9IEpTT04ucGFyc2UoXykuaGVhZGVycy5sb2NhdGlvblswXSArIFxcXCImcGFnZT1cXFwiICsgKE1ZX1BBR0UgLSAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKHUpLCBcXFwiYm9keSYmI3BsYXlsaXN0JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2RqNicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo2JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvdmFsdWU9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajYnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqNyc6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8vd3d3LjdpZGouY29tL2Uvc2VhcmNoLydcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBwb3N0KHUgKyAnaW5kZXgucGhwJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5Ym9hcmQ6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3c6ICd0aXRsZSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB1ICs9IEpTT04ucGFyc2UoXykuaGVhZGVycy5sb2NhdGlvblswXSArIFxcXCImcGFnZT1cXFwiICsgKE1ZX1BBR0UgLSAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKHUpLCBcXFwiYm9keSYmbGlbZGF0YS1pZF1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdkajcnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqNycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL2RhdGEtaWQ9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajcnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqOCc6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8vd3d3LmRqdTguY29tLyc7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtID0gZmV0Y2hQQyh1ICsgJ2tleS9tbF8nICsgZW5jb2RlU3RyKGtleXdvcmQsICdHQksnKSArICdfJyArIE1ZX1BBR0UgKyAnLmh0bWwnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ3RleHQvaHRtbDsgY2hhcnNldD1nYjIzMTInLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAncmVmZXJlcic6IHVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGl0ZW0sIFxcXCJib2R5JiYjZGpvdXImJmxpW29ubW91c2VvdmVyXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2RqOCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo4JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvdmFsdWU9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajgnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqOSc6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8vd3d3LmRqeXl5LmNvbS9zZWFyY2gucGhwP2FjPWRqJmtleT0nICsga2V5d29yZCArICcmcGFnZXM9JyArIE1ZX1BBR0U7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKHUpLCBcXFwiYm9keSYmbGlbZGF0YS1pZF0gXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnZGo5JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC9kYXRhLWlkPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGo5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaOpeWPo+mUmeivr35cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmsqHmnInlj6/ku6XmkJzntKLmrYzljZXnmoTmjqXlj6N+XFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgIH1cXG59XFxuXFxuZnVuY3Rpb24gbGF6eShwbGF0Zm9ybSwgdDEsIHQyLCB0Mykge1xcbiAgICBbdDEsIHBsYXRmb3JtLCB0eXBlXSA9IHQxLnNwbGl0KCcjJyk7XFxuICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgY2FzZSAnenonOlxcbiAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly96ejEyMy5jb20nO1xcbiAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKHBvc3QodSArICcvYWpheC8nLCB7XFxuICAgICAgICAgICAgICAgIGJvZHk6IFxcXCJhY3Q9c29uZ2luZm8maWQ9XFxcIiArIHQxICsgXFxcIiZsYW5nPVxcXCJcXG4gICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgICAgICB1cmwgPSBfLm1wMztcXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKHUpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogXy5scmMucmVwbGFjZSgvXFxcXHIvZywgJycpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdiZCc6XFxuICAgICAgICAgICAgXyA9IHFpYW5xaWFuKFxcXCJzb25nL3RyYWNrbGlua1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgVFNJRDogdDFcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgXy5wYXRoKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW18ucGF0aCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBscmM6IF8ubHlyaWNcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ25pJzpcXG4gICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vd3d3LmhpZmluaS5jb20vXFxcIjtcXG4gICAgICAgICAgICBpdGVtID0gcGRmaChmZXRjaCh1ICsgYHRocmVhZC0ke3QxfS5odG1gKSwgXFxcImRpdi5tZXNzYWdlLmJyZWFrLWFsbCYmSHRtbFxcXCIpO1xcbiAgICAgICAgICAgIHVybCA9IHUgKyBpdGVtLm1hdGNoKC91cmw6XFxcXHMqW1xcXCInXShbXlxcXCInXSspLylbMV07XFxuICAgICAgICAgICAgaWYgKHQzKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBscmMgPSBpdGVtLnJlcGxhY2UoL15bXFxcXHNcXFxcU10rPzxcXFxcL2g1Pnw8aDVbXj5dKj5bXFxcXHNcXFxcU10rL2dpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogTHJjKGxyYylcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2czJzpcXG4gICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly93d3cuZ2dnbXVzaWMuY29tL1xcXCI7XFxuICAgICAgICAgICAgaXRlbSA9IHBkZmgoZmV0Y2godSArIFxcXCJ0aHJlYWQtXFxcIiArIHQxICsgXFxcIi5odG1cXFwiKSwgXFxcImRpdi5tZXNzYWdlLmJyZWFrLWFsbCYmSHRtbFxcXCIpO1xcbiAgICAgICAgICAgIGV2YWwoXFxcInVybD1cXFwiICsgaXRlbS5tYXRjaCgvdXJsOlxcXFxzKihbXlxcXFxuLF0rKS8pWzFdLnJlcGxhY2UoXFxcImJhc2U2NF9kZWNvZGVcXFwiLCBcXFwiYmFzZTY0RGVjb2RlXFxcIikpO1xcbiAgICAgICAgICAgIGlmICghdXJsLm1hdGNoKC9odHRwLykpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdSArIHVybFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IGl0ZW0uc3BsaXQoXFxcIjwvaDU+XFxcIilbMV0uc3BsaXQoXFxcIjxoNVxcXCIpWzBdO1xcbiAgICAgICAgICAgIGlmIChscmMubWF0Y2goL1xcXFxbXFxcXGQrOlxcXFxkKy8pKVxcbiAgICAgICAgICAgICAgICBscmMgPSBscmMucmVwbGFjZSgvKFxcXFxzKjxcXFxcLz9wPikrL2dpLCBcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgIGxyYyA9IExyYyhscmMpO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogW3tcXG4gICAgICAgICAgICAgICAgICAgIHJlZmVyZXI6IHVcXG4gICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2J6JzpcXG4gICAgICAgICAgICBpdGVtID0gZmV0Y2goXFxcImh0dHBzOi8vZGViZW56aS5jb20vdS9cXFwiICsgdDEgKyBcXFwiL1xcXCIpO1xcbiAgICAgICAgICAgIHVybCA9IHBkZmgoaXRlbSwgXFxcImF1ZGlvJiZzcmNcXFwiKTtcXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IHBkZmgoaXRlbSwgXFxcIi5lbnRyeS1jb250ZW50JiZIdG1sXFxcIikuc3BsaXQoXFxcIjxzdHJvbmc+5q2M6K+N77yaPC9zdHJvbmc+XFxcIilbMV07XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogTHJjKGxyYylcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ3N0JzpcXG4gICAgICAgICAgICBpdGVtID0gZmV0Y2hQQyhcXFwiaHR0cDovL3d3dy5zb25ndGFzdGUuY28vc29uZy9cXFwiICsgdDEpO1xcbiAgICAgICAgICAgIHVybCA9IHBkZmgoaXRlbSwgXFxcInNvdXJjZSwwJiZzcmNcXFwiKTtcXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGV2YWwoU3RyaW5nKGl0ZW0ubWF0Y2goL2xyYyA9IGBbXFxcXHNcXFxcU10qP2A7LylbMF0pKTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBMcmMobHJjKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnYmxtJzpcXG4gICAgICAgICAgICB1ID0gJ2h0dHBzOi8vYmxhY2tibG0uYmFpbGVtaS5jb20vaW5kZXgucGhwL2RhbmNlL3BsYXkvaWQvJyArIHQxO1xcbiAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKHUpKTtcXG4gICAgICAgICAgICB1cmwgPSBfLmRvd251cmwgfHwgXy5wbGF5dXJsO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2ZwJzpcXG4gICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL3d3dy5mYW5ncGkubmV0L2FwaS9wbGF5X3VybD9pZD1cXFwiICsgdDEgKyBcXFwiJmpzb249MVxcXCIpKS5kYXRhLnVybDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogXFxcImh0dHBzOi8vd3d3LmZhbmdwaS5uZXQvZG93bmxvYWQvbHJjL1xcXCIgKyB0MVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnaHQnOlxcbiAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL20uaHRxeXkuY29tL3BsYXkvXFxcIiArIHQxO1xcbiAgICAgICAgICAgIGNvZGUgPSBleGVjdXRlV2ViUnVsZSh1LCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGU7XFxuICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHVybCA9IFxcXCJodHRwOi8vZjUuaHRxeXkuY29tL3BsYXk5L1xcXCIgKyB0MSArIFxcXCIvbXAzL1xcXCIgKyBjb2RlO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IFt7XFxuICAgICAgICAgICAgICAgICAgICByZWZlcmVyOiB1XFxuICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICcxdCc6XFxuICAgICAgICAgICAgdSA9IFxcXCJodHRwczovL3d3dy4xdGluZy5jb21cXFwiO1xcbiAgICAgICAgICAgIHBhdGggPSBleGVjdXRlV2ViUnVsZShgaHR0cHM6Ly9oNS4xdGluZy5jb20vc29uZy9gICsgdDEsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZ19zb25nX21ldGEuc29uZ19wYXRoO1xcbiAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB1cmwgPSB1ICsgXFxcIi9hcGkvYXVkaW8/XFxcIiArIHBhdGg7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCwgaGVhZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlcjogdVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UodSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwsIHUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBscmMgPSB1ICsgXFxcIi90b3VjaC9hcGkvbHlyaWMvXFxcIiArIHQxO1xcbiAgICAgICAgICAgIGxyYyA9IEpTT04ucGFyc2UoZmV0Y2gobHJjKSkubHlyaWNfY29udGVudDtcXG4gICAgICAgICAgICBpZiAoIWxyYy5tYXRjaCgvXFxcXFtcXFxcZCs6XFxcXGQrLykpXFxuICAgICAgICAgICAgICAgIGxyYyA9IExyYyhscmMpO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogW3tcXG4gICAgICAgICAgICAgICAgICAgIHJlZmVyZXI6IHVcXG4gICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJzl0JzpcXG4gICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly9uZXcuOXNreS5jb20vYXBpL3NvbmcvZGV0YWlsP2lkPVxcXCIgKyB0MSArIFxcXCImaXNfbG9naW49TlxcXCI7XFxuICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2godSkpLmRhdGE7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIF8uc29uZ191cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbXy5zb25nX3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBscmM6IF8ubHlyaWNfdXJsIHx8IExyYyhfLmRlc2lnbl9ub3RlcylcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJzVuZCc6XFxuICAgICAgICAgICAgaXRlbSA9IGZldGNoKGBodHRwOi8vbS41bmQuY29tL3RpbmcvJHt0MX0uaHRtbGApO1xcbiAgICAgICAgICAgIGV2YWwoaXRlbS5tYXRjaCgvbXAzID0gLio/Oy8pWzBdKTtcXG4gICAgICAgICAgICB1cmwgPSAnaHR0cDovL21wZ2UuNW5kLmNvbS8nICsgbXAzO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBscmMgPSBwZGZoKGl0ZW0sIFxcXCIjbHJjY29udCYmSHRtbFxcXCIpLnJlcGxhY2UoLzxcXFxcIS0tLio/LS0+fDxiclxcXFwvPz4vZ2ksICdcXFxcbicpXFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdiaXUnOlxcbiAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vYml1Lm1vZS9Tb25nL3BsYXlTSUQvc2lkL1xcXCIgKyB0MSkpLnVybGluZm8udXJsO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBscmMgPSBwZGZoKGZldGNoKFxcXCJodHRwczovL2JpdS5tb2Uvc1xcXCIgKyB0MSksIFxcXCIuYW0tcG9wdXAtYmQmJkh0bWxcXFwiKS5yZXBsYWNlKC88KGJ1dHRvbikuKj9cXFxcMT58PFxcXFwvP2JyXFxcXC8/Pi9naSwgXFxcIlxcXFxuXFxcIik7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdkajEnOlxcbiAgICAgICAgICAgIGl0ZW0gPSBmZXRjaFBDKFxcXCJodHRwOi8vd3d3Lnp6emRqLmNvbS9tdXNpYy9pbmZvLVxcXCIgKyB0MSk7XFxuICAgICAgICAgICAgdXJsID0gcGRmaChpdGVtLCBcXFwiYXVkaW8mJnNyY1xcXCIpO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqMic6XFxuICAgICAgICAgICAgdXJpID0gSlNPTi5wYXJzZShmZXRjaFBDKFxcXCJodHRwczovL3d3dy5kanV1LmNvbS93YXAvcGxheS9wbGF5P2lkPVxcXCIgKyB0MSkpLmRhdGEubGlzdGVudXJsO1xcbiAgICAgICAgICAgIHVybCA9IGBodHRwOi8vbXA0LmRqdXUuY29tLyR7dXJpfS5tNGFgO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqMyc6XFxuICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZShmZXRjaFBDKFxcXCJodHRwOi8vd3d3LmxhbGFkai5jb20vaW5kZXgvaW5kZXgvZ2V0X2Nvb2tpZVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogYHNvbmdfbGlzdD10aGluazpbe1xcXCJpZFxcXCI6XFxcIiR7dDF9XFxcIn1dO2BcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pKS5kYXRhWzBdLnBhdGg7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGo0JzpcXG4gICAgICAgICAgICB1cmkgPSBleGVjdXRlV2ViUnVsZShcXFwiaHR0cHM6Ly93d3cuYWhhZGouY29tL211c2ljL1xcXCIgKyB0MSArIFxcXCIuaHRtbFxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZGFuY2VGaWxlUGF0aDtcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXJsID0gYGh0dHBzOi8vc3QuOTJrdS5jb20vYCArIHVyaTtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzBdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHVybCArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdkajUnOlxcbiAgICAgICAgICAgIF8gPSBwb3N0KCdodHRwczovL20uZGoubmV0L3RlbXBsYXRlL3poemhfZHptdXNpYy9hamF4Lz9hY3Rpb249Z2V0dXJsJywge1xcbiAgICAgICAgICAgICAgICBib2R5OiBcXFwiaWQ9XFxcIiArIHQxXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXJsID0gXFxcImh0dHBzOi8vZGpuZXQuc3JjLmRqLm5ldDo0NDMxL1xcXCIgKyBKU09OLnBhcnNlKF8pLmRhdGFbMF0uc3JjO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqNic6XFxuICAgICAgICAgICAgdXJpID0gZXhlY3V0ZVdlYlJ1bGUoXFxcImh0dHA6Ly93d3cuMzZkai5jb20vcGxheS9cXFwiICsgdDEgKyBcXFwiLmh0bWxcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGluZm8ucGxheXVybDtcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbycsICcvZS8nXVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHVybCA9IGBodHRwOi8vdG4xLjcyZGphcHAuY246ODM5OS9gICsgdXJpO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqNyc6XFxuICAgICAgICAgICAgdXJsID0gZXhlY3V0ZVdlYlJ1bGUoXFxcImh0dHBzOi8vd3d3LjdpZGouY29tL2RqL1xcXCIgKyB0MSArIFxcXCIuaHRtbFxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcGxheXVybDtcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGo4JzpcXG4gICAgICAgICAgICB1ID0gJ2h0dHBzOi8vd3d3LmRqdTguY29tJztcXG4gICAgICAgICAgICBpdGVtID0gdSArICcvaWsvei8/JyArIGV4ZWN1dGVXZWJSdWxlKHUgKyAnL2Rpc2NvLycgKyB0MSArICcvJywgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBmdXJsO1xcbiAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpdGVtID0gZmV0Y2hDb2RlQnlXZWJWaWV3KGl0ZW0sIHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXJsID0gcGRmaChpdGVtLCBcXFwiYXVkaW8mJnNyY1xcXCIpO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqOSc6XFxuICAgICAgICAgICAgdXJsID0gZXhlY3V0ZVdlYlJ1bGUoJ2h0dHBzOi8vbS5kanl5eS5jb20vcGxheS8nICsgdDEgKyAnLmh0bWwnLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBsYXl1cmw7XFxuICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgfVxcbn1cXG4kLmV4cG9ydHMgPSB7XFxuICAgIHNlYXJjaCxcXG4gICAgbGF6eVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKRoueoi+W6j+mmlumhtVwiLFwicGF0aFwiOlwiaG9tZVwiLFwicnVsZVwiOlwianM6XFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG5hZGRMaXN0ZW5lcignb25SZWZyZXNoJywgJC50b1N0cmluZygoKSA9PiB7XFxuICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbn0pKVxcbnRyeSB7XFxuICAgIGQgPSBbXTtcXG4gICAgaVRhZyA9IHN0b3JhZ2UwLmdldE15VmFyKHBsYXRmb3JtICsgXFxcIl9pVGFnXFxcIik7XFxuICAgIGlmIChpVGFnID09IFxcXCJcXFwiKVxcbiAgICAgICAgaVRhZyA9IHt9LFxcbiAgICAgICAgJC5yZXF1aXJlKHBsYXRmb3JtICsgJz9ydWxlPeatjOivjemAgumFjScpLmlUYWcoKTtcXG4gICAgbGV0IHRpZCA9IGdldE15VmFyKCd0aWQnLCAn5o6o6I2QJyk7XFxuICAgIGxldCB0cnIgPSBPYmplY3Qua2V5cyhpVGFnW3RpZF0pO1xcbiAgICBsZXQgdGlpID0gZ2V0TXlWYXIoJ3RpaScsICcwJyk7XFxuICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICQucmVxdWlyZSgnbm90aWNlP3J1bGU95q2M6K+N6YCC6YWNJykoKTtcXG4gICAgICAgIE9iamVjdC5rZXlzKGlUYWcpLm1hcCgobmFtZSwgaWkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlkID09IG5hbWUgPyBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpIDogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpZCcsIHRpZCk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWknKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogQ29sb3IoXFxcIjxiPuWIh+aNouaOpeWPozwvYj5cXFwiLCBcXFwiI2ZmNjYwMVxcXCIpLFxcbiAgICAgICAgICAgIHVybDogJChwbGF0Zm9ybXMuc2xpY2UoMCwgOCkubWFwKHRpdGxlID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKHRpdGxlID09IHBsYXRmb3JtKVxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBSaWNoKFN0cm9uZyhDb2xvcih0aXRsZSkpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRpdGxlXFxuICAgICAgICAgICAgfSksIDIsICfpgInmi6nmjqXlj6PlubPlj7AnKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoIWlucHV0Lm1hdGNoKC9e4oCY4oCY4oCZ4oCZLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdwbGF0Zm9ybScsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcigndGlkJyk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWknKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ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nva4nKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ/CflI0nLFxcbiAgICAgICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDliIbkuqvpk77mjqUnLFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoc19wbGF0Zm9ybSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQudHJpbSgpKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc19wbGF0Zm9ybScsIHNfcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3BsYXRmb3JtJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc190MycpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3Q0Jyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3NlYXJjaCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cD1meXBhZ2UmcnVsZT3mrYzor43pgILphY1cXFwiO1xcbiAgICAgICAgICAgIH0sIHBsYXRmb3JtKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaDFcXFwiLFxcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IFxcXCLpq5jnuqfmkJzntKJcXFwiLFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJzX3QyXFxcIiksXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ3NfdDInLCBpbnB1dClcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5oiR55qE5pS26JePJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2NvbGxlY3Rpb24/cnVsZT3mrYzor43pgILphY0nLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb24xJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6ICfljoblj7LorrDlvZUnLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vaGlzdG9yeT9ydWxlPeatjOivjemAgumFjScsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjMnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJ+mrmOe6p+aQnOe0oicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc19wbGF0Zm9ybScpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDQnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2Uvc2VhcmNoI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wPWZ5cGFnZSZydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjInLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFJpY2goQ29sb3IoJzxiPicgKyB0aWQgKyAnPC9iPicsICcjZmY2NjAxJykpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICB0cnIubWFwKChuYW1lLCBpaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aWkgPT0gaWkgPyBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpIDogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpaScsIHRpaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCBpaSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBMb2FkaW5nKCk7XFxuICAgIH1cXG4gICAgdXJpID0gaVRhZ1t0aWRdW3Ryclt0aWldXTtcXG4gICAgaWYgKCFBcnJheS5pc0FycmF5KHVyaSkpIHtcXG4gICAgICAgIGlmIChNWV9QQUdFID09IDEgfHwgZ2V0TXlWYXIoJ2hvbWVfcGFnZScsICcwJykgPT0gJzAnKSB7XFxuICAgICAgICAgICAgbGV0IHBhZ2VTaXplID0gcGxhdGZvcm0gPT0gXFxcIm15XFxcIiA/IDkwIDogKHBsYXRmb3JtID09IFxcXCI1c1xcXCIgPyAxNiA6IDMwKTtcXG4gICAgICAgICAgICBsZXQgdG90YWwgPSAkLnJlcXVpcmUocGxhdGZvcm0gKyBcXFwiP3J1bGU95q2M6K+N6YCC6YWNXFxcIikubGF6eSgxLCB1cmkpO1xcbiAgICAgICAgICAgIGlmICh0b3RhbCA8IE1ZX1BBR0UgKiBwYWdlU2l6ZSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignaG9tZV9wYWdlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArICfmiJHmmK/mnInlupXnur/nmoQnLmZvbnRjb2xvcignR3JheScpLnNtYWxsKCksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdob21lX3BhZ2UnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSBkID0gZC5jb25jYXQodXJpKTtcXG59IGNhdGNoIChmZXRjaF9lcnJvcikge1xcbiAgICAvLyBlcnJvcihmZXRjaF9lcnJvcik7XFxuICAgIGQgPSBbe1xcbiAgICAgICAgdGl0bGU6IFxcXCLnvZHnu5zlvILluLggLyDmjqXlj6PltKnmuoPkuoZcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuaNouS4quaOpeWPo+eci+eci+OAglxcXCIsXFxuICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9XTtcXG4gICAgcGxhdGZvcm1zLnNsaWNlKDEsIDgpXFxuICAgICAgICAuZmlsdGVyKHRpdGxlID0+IHRpdGxlICE9IHBsYXRmb3JtKVxcbiAgICAgICAgLm1hcCh0aXRsZSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fMl9yb3VuZCcsXFxuICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aXRsZS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gICAgICAgICAgICAgIHRpdGxlOiAnW+mFt+eLl+amguW/teeJiF0g5ZCs5q2M6aKG5Lya5ZGYJyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+avj+aXpeWQrOatjOWNs+WPr+mihuWPljHml6Xphbfni5fmpoLlv7XniYhWSVAnLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbWF0ID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvXFxcIihcXFxcZCspXFxcIiwgXFxcIihbXlxcXCJdKylcXFwiLCBcXFwiXFxcXGQqXFxcIiwgXFxcIihbXlxcXCJdKilcXFwiLyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLkxpdGVfU2lnbmluKG1hdFsxXSwgbWF0WzJdLCBtYXRbM10sIHRydWUpO1xcbiAgICAgICAgICAgICAgICB9LCBrZ19saXRlKSxcXG4gICAgICAgICAgICAgICAgY2FuY2VsOiAkLnRvU3RyaW5nKChqeGxpc3QsIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIF8udGltZSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgXy5zaWduaW4gPSAxO1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0W2ldID0gXztcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF9rZycsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LuK5pel5LiN5YaN5o+Q56S677yM6K+35Zyo6K6+572u6aG15omL5Yqo562+5YiwXFxcIlxcbiAgICAgICAgICAgICAgICB9LCBrZ19saXN0MSwga2dfaXRlbTIsIGtnX2xpdGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUxJywgJzAnKTsgLy8g5LuK5aSp5bey57uP562+5Yiw6L+H5LqGXFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBwdXRNeVZhcigndXBkYXRlMScsICcwJyk7IC8vIOayoeacieamguW/teeJiOino+aekCAvIOS4jeaPkOekulxcbiAgICB9XFxuICAgIGlmIChnZXRNeVZhcigndXBkYXRlMicsIGdldEl0ZW0oJ3VwZGF0ZTInLCAnMCcpKSA9PSAnMScgJiYgKCFrZ19saXRlIHx8ICQuZGF0ZUZvcm1hdChrZ19saXRlLnRpbWUsICd5eXl5TU1kZCcpID09IHRpbWUpKSB7XFxuICAgICAgICBsZXQgcXFfbGl0ZSA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9xcScsIFtdKVxcbiAgICAgICAgICAgIC5maW5kKF8gPT4gbWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImUyYzFhNGJmOGQ1OGQxNzAzYTVlODEwOWUxZjkwY2MwXFxcIik7XFxuICAgICAgICBpZiAocXFfbGl0ZSkge1xcbiAgICAgICAgICAgIGlmICgkLmRhdGVGb3JtYXQocXFfbGl0ZS50aW1lICsgNS4zZTgsICd5eXl5TU1kZCcpIDwgdGltZSkge1xcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnW1FR6Z+z5LmQXSDliLfmlrBjb29raWUnLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+avj+S4g+WkqemcgOimgeWIt+aWsOS4gOasoWNvb2tpZScsXFxuICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvb2tpZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL0Nvb2tpZTogXFxcIihbXlxcXCJdKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMicsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5yZWZyZXNoX2xvZ2luKGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBxcV9saXRlKSxcXG4gICAgICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8udGltZSArPSA4LjZlNztcXG4gICAgICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9xcScsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QudW5zaGlmdChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBtZDUob2JqLnRpdGxlICsgb2JqLnVybCkgPT09IG1kNShvLnRpdGxlICsgby51cmwpKSA9PT0gaW5kZXg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X3FxJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXR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ICAgICAgICBpZiAoSykge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdqeF9vcGVuJywgb3Blbik7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5r+A5rS75a+G5YyZXFxcIikuaW5wdXQoKG9wZW4pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20xJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfb3BlbicsIG9wZW4pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5r+A5rS75aSx6LSlXFxcIjtcXG4gICAgICAgICAgICB9LCBvcGVuKTtcXG4gICAgICAgIH1cXG4gICAgfSwganhfczEsIGp4X29wZW4gPyAnMCcgOiAnMScpLFxcbiAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfb3BlbiA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojZmY2NjAxXFxcIj48Yj7lkK/nlKjkuIvovb08L2I+PC9zcGFuPicsXFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSywgZG93bikgPT4ge1xcbiAgICAgICAgaWYgKEspIHtcXG4gICAgICAgICAgICBwdXRNeVZhcignanhfZG93bicsIGRvd24pO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpea/gOa0u+WvhuWMmVxcXCIpLmlucHV0KChkb3duKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IGdldE15VmFyKCdqeF9tMScpKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczEnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X2Rvd24nLCBkb3duKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+a/gOa0u+Wksei0pVxcXCI7XFxuICAgICAgICAgICAgfSwgZG93bik7XFxuICAgICAgICB9XFxuICAgIH0sIGp4X3MxLCBqeF9kb3duID8gJzAnIDogJzEnKSxcXG4gICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X2Rvd24gPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzMnXFxufSk7XFxuW1xcXCLpooTop4hcXFwiLCBcXFwi5Z+65pysXFxcIiwgXFxcIumfs+i0qFxcXCIsIFxcXCLop6PmnpBcXFwiLCBcXFwi5ouT5bGVXFxcIl0ubWFwKG5hbWUgPT4ge1xcbiAgICBsZXQgaSA9IGp4X3RpZCA9PSBuYW1lXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoaSA/IENvbG9yKG5hbWUpIDogbmFtZSkpLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWQsIHRpaSwgZmVnKSA9PiB7XFxuICAgICAgICAgICAgaWYgKHRpaSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfdGlkJywgdGlkKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgbmFtZSwgIWksICFqeF9zMiksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfNSdcXG4gICAgfSk7XFxufSk7XFxuc3dpdGNoIChqeF90aWQpIHtcXG4gICAgY2FzZSAn6aKE6KeIJzpcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZyhnZXRNeVZhcignanhfdGl0bGUnKSksXFxuICAgICAgICAgICAgZGVzYzogW1xcXCJtcDNcXFwiLCBcXFwiaHFcXFwiLCBcXFwic3FcXFwiLCBcXFwiaHJcXFwiLCAvKiBcXFwienFcXFwiKi8gXS5tYXAodCA9PiBnZXRNeVZhcihcXFwianhfXFxcIiArIHQpICE9IFxcXCJcXFwiID8gJ+KYhScgOiAn4piGJykuam9pbihcXFwiXFxcIiksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogZ2V0TXlWYXIoJ2p4X2ltZycpIHx8ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgpXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKCdqeF9kZXNjJykgKyAn5LioJyArIGdldE15VmFyKCdqeF91cmwnKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoJ2p4X2NvbnRlbnQnLCAnXFxcXG5cXFxcblxcXFxuXFxcXG5cXFxcbicpLnJlcGxhY2UoL1xcXFxuL2csICc8YnI+JyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5L2/55So5p2D6ZmQJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKEspID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKEspIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20xJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczEnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6aqM6K+B5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBqeF9zMSksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MxID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uXzJfcm91bmQnLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn57yW6L6R5p2D6ZmQJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKEspID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKEspIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20yJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczInLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6aqM6K+B5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBqeF9zMiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MyID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uXzJfcm91bmQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfln7rmnKwnOlxcbiAgICAgICAgW1xcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5rqQ5qCH6K+GJywgJ3VybCddLFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5rqQ5ZCN56ewJywgJ3RpdGxlJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDlm77moIcnLCAnaW1nJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDliIbnu4QnLCAnZGVzYyddLFxcbiAgICAgICAgICAgIFsn6YCJ5aGr77yM5rqQ5rOo6YeKJywgJ2NvbnRlbnQnXVxcbiAgICAgICAgXS5tYXAoW2EsIGJdID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBkZXNjOiBhLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcImp4X1xcXCIgKyBiKSxcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcImp4XyR7Yn1cXFwiLCBpbnB1dClgLFxcbiAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgJ+mfs+i0qCc6XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyfpgInloavvvIzmoIflh4bpn7PotKjjgILkvovvvJp0Mj1cXFwiMTI4a1xcXCInLCAnbXAzJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzpq5jlk4Hpn7PotKjjgILkvovvvJp0Mj1cXFwiMzIwa1xcXCInLCAnaHEnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOaXoOaNn+mfs+i0qOOAguS+i++8mnQyPVxcXCIyMDAwa1xcXCInLCAnc3EnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOmrmOWTgeaXoOaNn+OAguS+i++8mnQyPVxcXCI0MDAwa1xcXCInLCAnaHInXSxcXG4gICAgICAgICAgICAvLyBbJ+mAieWhq++8jOeri+S9k+aXoOaNn+OAguS+i++8mnQyPVxcXCIyMDAwMGtcXFwiJywgJ3pxJ11cXG4gICAgICAgIF0ubWFwKFthLCBiXSA9PiB7XFxuICAgICAgICAgICAgbGV0IF8gPSB7XFxuICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoanhfczIgfHwganhfczMpIHtcXG4gICAgICAgICAgICAgICAgXy5kZWZhdWx0VmFsdWUgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIGdldE15VmFyKFxcXCJqeF9cXFwiICsgYikpO1xcbiAgICAgICAgICAgICAgICBfLm9uQ2hhbmdlID0gJC50b1N0cmluZygobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0LnRyaW0oKSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKG5hbWUsIGdldFByaXZhdGVKUyhpbnB1dC50cmltKCkpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIobmFtZSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBcXFwianhfXFxcIiArIGIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIF8uZGVmYXVsdFZhbHVlID0gXFxcIuayoeacieadg+mZkO+8jOivt+ino+mUgeOAglxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgZGVzYzogYSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBfXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfop6PmnpAnOlxcbiAgICAgICAgbGV0IF8gPSB7XFxuICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlLFxcbiAgICAgICAgICAgIHR5cGU6IFxcXCJ0ZXh0YXJlYVxcXCIsXFxuICAgICAgICAgICAgaGVpZ2h0OiA3XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoanhfczIgfHwganhfczMpIHtcXG4gICAgICAgICAgICBfLmRlZmF1bHRWYWx1ZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgZ2V0TXlWYXIoXFxcImp4X2ppZXhpXFxcIikpO1xcbiAgICAgICAgICAgIF8ub25DaGFuZ2UgPSAkLnRvU3RyaW5nKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKG5hbWUsIGdldFByaXZhdGVKUyhpbnB1dC50cmltKCkpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKG5hbWUsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIFxcXCJqeF9qaWV4aVxcXCIpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBfLmRlZmF1bHRWYWx1ZSA9IFxcXCLmsqHmnInmnYPpmZDvvIzor7fop6PplIHjgIJcXFwiXFxuICAgICAgICB9XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGRlc2M6ICflj5jph4/vvJpfICYgdDEgJiBtdXNpY0l0ZW1cXFxcblxcXFxu6K+05piO77ya5Y+v5Lul5LuO6Z+z6LSo6YKj6YeM5Lyg5Y+Y6YeP6L+H5p2lKOS+izogdDIp77yM6YW354uX55qEbXVzaWNJdGVt5piv5pWw57uE44CCXFxcXG5cXFxcbuWumuS5iXVybOWwseihjO+8jOekuuS+i++8mlxcXFxudXJpID0gYGh0dHBzOi8vYmFpZHUuY29tP2E9JHt0MX0mYj0ke3QyfWA7XFxcXG51cmwgPSBKU09OLnBhcnNlKGZldGNoKHVyaSkpLnVybDsnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgIGV4dHJhOiBfXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmi5PlsZUnOlxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+Whq+WGmeWvhuWMmeWQju+8jOWPr+S7peWvuemfs+a6kOWBmuS4gOS6m+mZkOWItuOAgicsXFxuICAgICAgICAgICAgZGVzYzogJ+WvhuWMmeaXoOazlei/veWbnu+8jOWhq+iusOW+l+S9j+eahO+8gScsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn57yW6L6R5rqQ55qE6ZmQ5Yi2JyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5Y+v5Lul55yL77yM5Y+v5Lul57yW6L6RKOWkp+eIseaXoOeWhiknLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSykgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoSykgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMicsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20yJywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pu05pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBqeF9zMiksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChqeF9zMiA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICflj6/ku6XnnIvvvIzkuI3og73nvJbovpEo6Ziy5q2i5LqM5pS5KScsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLMSwgSzIpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdqeF9tMicpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IGlucHV0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMicsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoSzEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi5pON5L2c57G75Z6L77ya5pu05pS55a+G5YyZXFxcXG7or7fovpPlhaXljp/lr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20yJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gaW5wdXQyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMicsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMicsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4bmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ljp/lr4bljJnpqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoSzIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi5pON5L2c57G75Z6L77ya5p2D6ZmQ6ZmN57qnXFxcXG7or7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20yJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+G5YyZ6ZSZ6K+v77yM6ZmN57qn5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBqeF9zMywgIWp4X3MyKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MyID8gNjMgOiBqeF9zMyA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfkuI3og73nnIvvvIzkuI3og73nvJbovpEo6IO955So5bCx6KGMKScsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLMSwgSzIpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdqeF9tMicpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IGlucHV0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzInKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMicsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoSzEgJiYgSzIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi5pON5L2c57G75Z6L77ya5pu05pS55a+G5YyZXFxcXG7or7fovpPlhaXljp/lr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20yJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gaW5wdXQyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMicsICcyJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMicsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4bmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ljp/lr4bljJnpqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczInLCAnMicpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sICFqeF9zMywgIWp4X3MyKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MyID8gNjMgOiBqeF9zMyA/IDYzIDogNTUpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn5L2/55So5rqQ55qE6ZmQ5Yi2JyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9jb2RlJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5rKh5pyJ6aqM6K+BKOS4jeaQnuiKseeahCknLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSykgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoSykgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTEnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20xJywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6aqM6K+B5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBqeF9zMSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChqeF9zMSA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmv4DmtLvpqozor4Eo6aqM6K+B5LiA5LiLKScsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignanhfbTEnKSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fnoa7orqTlr4bljJlcXFwiKS5pbnB1dCgoaW5wdXQyKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBpbnB1dDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfbTEnLCBtZDUoaW5wdXQpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4bmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4blpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEspIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLmk43kvZznsbvlnovvvJrmm7TmlLnlr4bljJlcXFxcbuivt+i+k+WFpeWOn+WvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTEnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+356Gu6K6k5a+G5YyZXFxcIikuaW5wdXQoKGlucHV0MikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBpbnB1dDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MxJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20xJywgbWQ1KGlucHV0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4blpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WOn+WvhuWMmemqjOivgeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGp4X3MxKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MxID8gNjMgOiA1NSkgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+aXtuaViOmqjOivgSjnrYnlvoXlrozlloQpJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS82My5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbn1cXG5kLnB1c2goe1xcbiAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IoJ+S/neWtmOW5tumAgOWHuicpKSksXFxuICAgIGRlc2M6ICfkuIr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1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCB7fSk7XFxuICAgICAgICBsZXQgenUgPSBPYmplY3Qua2V5cyh6eSk7XFxuICAgICAgICBpZiAoenUubGVuZ3RoID09IDApIHJldHVybiBcXFwidG9hc3Q6Ly/msqHmnInpgInkuK3op6PmnpBcXFwiO1xcbiAgICAgICAgbGV0IHQxLCB0MiwganNvbiA9IHt9O1xcbiAgICAgICAgaWYgKHp1Lmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgbGV0IF8gPSB6eVt6dVswXV07XFxuICAgICAgICAgICAgaWYgKF8ubTEgJiYgXy5tMSAhPSBcXFwiXFxcIiAmJiBTdHJpbmcoXy5tMSkubGVuZ3RoID09IDMyKSB7XFxuICAgICAgICAgICAgICAgIF8uczEgPSBcXFwiMVxcXCI7XFxuICAgICAgICAgICAgICAgIF8ub3BlbiA9IFxcXCIwXFxcIjtcXG4gICAgICAgICAgICAgICAgXy5kb3duID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoXy5tMiAmJiBfLm0yICE9IFxcXCJcXFwiICYmIFN0cmluZyhfLm0yKS5sZW5ndGggPT0gMzIgJiYgXy5zMiA9PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgXy5zMiA9IFxcXCIyXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAganNvbltfLnR5cGVdID0gW19dO1xcbiAgICAgICAgICAgIGxldCB0MSA9IF8udHlwZTtcXG4gICAgICAgICAgICBsZXQgdDIgPSBfLnRpdGxlO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgb2YgenUpIHtcXG4gICAgICAgICAgICAgICAgbGV0IF8gPSB6eVtrZXldO1xcbiAgICAgICAgICAgICAgICBpZiAoIWpzb25bXy50eXBlXSkge1xcbiAgICAgICAgICAgICAgICAgICAganNvbltfLnR5cGVdID0gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKF8ubTEgJiYgXy5tMSAhPSBcXFwiXFxcIiAmJiBTdHJpbmcoXy5tMSkubGVuZ3RoID09IDMyKSB7XFxuICAgICAgICAgICAgICAgICAgICBfLnMxID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgXy5kb3duID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChfLm0yICYmIF8ubTIgIT0gXFxcIlxcXCIgJiYgU3RyaW5nKF8ubTIpLmxlbmd0aCA9PSAzMiAmJiBfLnMyID09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgXy5zMiA9IFxcXCIyXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBqc29uW18udHlwZV0ucHVzaChfKTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5nZXRTaGFyZShqc29uLCB0cnVlLCB6dS5sZW5ndGgsIHQxLCB0Mik7XFxuICAgIH0pXFxufSk7XFxubGV0IGp4X3BsYXRmb3JtID0gZ2V0TXlWYXIoJ2p4X3BsYXRmb3JtJywgJ2xpYicpO1xcbnBsYXRmb3JtcyA9IHBsYXRmb3Jtcy5zbGljZSgwLCA2KS5jb25jYXQoXFxcInF0XFxcIik7XFxucGxhdGZvcm1zLm1hcChwbGF0Zm9ybSA9PiB7XFxuICAgIGxldCBwbGF0Zm9ybTI7XFxuICAgIGlmIChqeF9wbGF0Zm9ybSA9PSBwbGF0Zm9ybSlcX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gICAgICAgICAgICAgICAgICAgaWYgKHBsYXRmb3JtID09ICdsaWInKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF0Zm9ybXMgPSBbJ3FxJywgJ3d5JywgJ2tnJywgJ2t3JywgJ21nJywgJ3F0J107XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF0Zm9ybXMgPSBbcGxhdGZvcm1dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHBsYXRmb3JtIG9mIHBsYXRmb3Jtcykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oJ2p4bGlzdF8nICsgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgfSwgcGxhdGZvcm0pXFxuICAgICAgICAgICAgfV1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSk7XFxubGV0IGp4bGlzdCA9IFtdO1xcbmlmIChqeF9wbGF0Zm9ybSA9PSBcXFwibGliXFxcIikge1xcbiAgICBwbGF0Zm9ybXMuc2xpY2UoMSkubWFwKHBsYXRmb3JtID0+IHtcXG4gICAgICAgIGp4bGlzdCA9IGp4bGlzdC5jb25jYXQoc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0XycgKyBwbGF0Zm9ybSwgW10pKTtcXG4gICAgfSk7XFxufSBlbHNlIHtcXG4gICAganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0XycgKyBqeF9wbGF0Zm9ybSwgW10pO1xcbn1cXG5pZiAoanhsaXN0Lmxlbmd0aCA9PSAwKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IoXFxcIuayoeacieino+aekFxcXCIpKSksXFxuICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59IGVsc2Uge1xcbiAgICBqeGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgbGV0IGQxLCBkMiwgaSA9IE9iamVjdC5rZXlzKHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pKS5pbmRleE9mKG1kNShfLnR5cGUgKyAnOicgKyBfLnRpdGxlICsgJzonICsgXy51cmwpKSA9PSAtMTtcXG4gICAgICAgIGQxID0gW1xcXCJtcDNcXFwiLCBcXFwiaHFcXFwiLCBcXFwic3FcXFwiLCBcXFwiaHJcXFwiXS5tYXAodCA9PiBfW3RdID8gJ+KYhScgOiAn4piGJykuam9pbihcXFwiXFxcIik7XFxuICAgICAgICBkMiA9IFxcXCLlkK/nlKjkuIvovb1cXFwiXFxuICAgICAgICBpZiAoXy5kb3duID09ICcxJykge1xcbiAgICAgICAgICAgIGQxID0gQ29sb3IoZDEsIFxcXCIjMkU1RDhFXFxcIik7XFxuICAgICAgICAgICAgZDIgPSBcXFwi56aB55So5LiL6L29XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZyhpID8gXy50aXRsZSA6IENvbG9yKF8udGl0bGUpKSxcXG4gICAgICAgICAgICBkZXNjOiBkMSxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLliIbkuqtcXFwiLCBcXFwi57yW6L6RXFxcIiwgXFxcIuWIoOmZpFxcXCIsIFxcXCLnp7vliqhcXFwiXS5jb25jYXQoW2kgPyAn6YCJ5Lit6Kej5p6QJyA6ICflj5bmtojpgInkuK0nLCBkMl0pLCAyLCAn6YCJ5oup5omp5bGV5pON5L2cJykuc2VsZWN0KCh0eXBlLCB0aXRsZSwgdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBqc29uLCBqeGxpc3QyLCBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3RfJyArIHR5cGUsIFtdKTtcXG4gICAgICAgICAgICAgICAgbGV0IHp1ID0ganhsaXN0Lm1hcChfID0+IG1kNShfLnR5cGUgKyAnOicgKyBfLnRpdGxlICsgJzonICsgXy51cmwpKTtcXG4gICAgICAgICAgICAgICAgbGV0IG0gPSBtZDUodHlwZSArICc6JyArIHRpdGxlICsgJzonICsgdXJsKTtcXG4gICAgICAgICAgICAgICAgbGV0IGkgPSB6dS5pbmRleE9mKG0pO1xcbiAgICAgICAgICAgICAgICBsZXQgXyA9IGp4bGlzdFtpXTtcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5YiG5LqrJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5tMSAmJiBfLm0xICE9IFxcXCJcXFwiICYmIFN0cmluZyhfLm0xKS5sZW5ndGggPT0gMzIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5zMSA9IFxcXCIxXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLmRvd24gPSBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLm0yICYmIF8ubTIgIT0gXFxcIlxcXCIgJiYgU3RyaW5nKF8ubTIpLmxlbmd0aCA9PSAzMiAmJiBfLnMyID09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnMyID0gXFxcIjJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAganNvblt0eXBlXSA9IFtfXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLmdldFNoYXJlKGpzb24sIHRydWUsIDEsIHR5cGUsIHRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+e8lui+kSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgW1xcXCJ0eXBlXFxcIiwgXFxcIm9wZW5cXFwiLCBcXFwiZG93blxcXCIsIFxcXCJpbWdcXFwiLCBcXFwidGl0bGVcXFwiLCBcXFwiZGVzY1xcXCIsIFxcXCJ1cmxcXFwiLCBcXFwiY29udGVudFxcXCIsIFxcXCJtcDNcXFwiLCBcXFwiaHFcXFwiLCBcXFwic3FcXFwiLCBcXFwiaHJcXFwiLCBcXFwienFcXFwiLCBcXFwiamlleGlcXFwiLCBcXFwiczFcXFwiLCBcXFwibTFcXFwiLCBcXFwiczJcXFwiLCBcXFwibTJcXFwiLCBcXFwidGltZVxcXCIsIFxcXCJ0aWRcXFwiLCBcXFwidWlkXFxcIl0ubWFwKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdqeF8nICsgdClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfdWlkJywgbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoXykubWFwKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfJyArIHQsIF9bdF0gfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3J1bGVFZGl0I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wYWdlVGl0bGU96KeE5YiZ57yW6L6RJnJ1bGU95q2M6K+N6YCC6YWNJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WIoOmZpCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruWumuWIoOmZpFxcXCIgKyBfLnR5cGUgKyBcXFwi6Kej5p6Q4oCcXFxcIiArIF8udGl0bGUgKyAn4oCd5ZCX77yfXFxcXG7mraTmk43kvZzkuI3lj6/pgIbvvIzor7fosKjmhY7pgInmi6njgIInKS5jb25maXJtKCh0eXBlLCBqeGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0XycgKyB0eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwganhsaXN0LCBpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+enu+WKqCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6dSA9IGp4bGlzdC5tYXAoXyA9PiBfLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAyLCAn6K+36YCJ5oup56e75Yqo5L2N572uJykuc2VsZWN0KCh0eXBlLCBqeGxpc3QsIF8sIHp1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0genUuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IC0xKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0LnB1c2goXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdC5zcGxpY2UoaSwgMCwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImp4bGlzdF9cXFwiICsgdHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGp4bGlzdCwgXywgenUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YCJ5Lit6Kej5p6QJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MlttXSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCBqeGxpc3QyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICflj5bmtojpgInkuK0nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDIgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwianhsaXN0MlxcXCIsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUganhsaXN0MlttXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwianhsaXN0MlxcXCIsIGp4bGlzdDIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WQr+eUqOS4i+i9vSc6XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnpoHnlKjkuIvovb0nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnMxID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLmRvd24gPSBfLmRvd24gPT0gJzEnID8gJzAnIDogJzEnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoXy5kb3duID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpea/gOa0u+WvhuWMmVxcXCIpLmlucHV0KChqeGxpc3QsIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IF8ubTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnMxID0gJzAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9ICcxJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3RbaV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgXy50eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8v5r+A5rS75oiQ5Yqf77yM5qyi6L+O5L2/55SoJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr4bljJnplJnor6/vvIzml6Dms5XlkK/nlKhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBqeGxpc3QsIGksIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uZG93biA9ICcwJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3RbaV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBfLnR5cGUsIF8udGl0bGUsIF8udXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBfLmltZyB8fCAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoKVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBfLnR5cGUgKyAn5LioJyArIChfLmRlc2MgfHwgJ+acquefpScpICsgJ+S4qCcgKyBfLnVybCxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHR5cGUsIHRpdGxlLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwgW10pO1xcbiAgICAgICAgICAgICAgICBsZXQgenUgPSBqeGxpc3QubWFwKF8gPT4gbWQ1KF8udHlwZSArICc6JyArIF8udGl0bGUgKyAnOicgKyBfLnVybCkpO1xcbiAgICAgICAgICAgICAgICBsZXQgbSA9IG1kNSh0eXBlICsgJzonICsgdGl0bGUgKyAnOicgKyB1cmwpO1xcbiAgICAgICAgICAgICAgICBsZXQgaSA9IHp1LmluZGV4T2YobSk7XFxuICAgICAgICAgICAgICAgIGxldCBqeF9vcGVuID0gKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLnMxID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9IF8ub3BlbiA9PSAnMScgPyAnMCcgOiAnMSc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKF8ub3BlbiA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpea/gOa0u+WvhuWMmVxcXCIpLmlucHV0KChqeGxpc3QsIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gXy5tMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5zMSA9ICcwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9ICcxJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdFtpXSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3RfJyArIF8udHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly/mv4DmtLvmiJDlip/vvIzmrKLov47kvb/nlKgnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr4bljJnplJnor6/vvIzml6Dms5XlkK/nlKhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGp4bGlzdCwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9ICcwJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAganhsaXN0W2ldID0gXztcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIGp4X29wZW4oanhsaXN0W2ldKTtcXG4gICAgICAgICAgICB9LCBfLnR5cGUsIF8udGl0bGUsIF8udXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKF8ub3BlbiA9PSAnMScgPyA1NSA6IDYzKSAr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gXFxcIjBcXFwiICYmIGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgX1txdWFsaXR5XSkgJiYgIWFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgX1tRdWFsaXR5XSkpO1xcbiAgICAgICAgbGV0IGlzUGxhecKgID0gdVR5cGUgPT0gXFxcIm9wZW5cXFwiICYmIHF1YWxpdHkgIT0gXFxcIm1wM1xcXCI7XFxuICAgICAgICBpZiAoanhsaXN0Lmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgaWYgKGlzUGxheSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFtmYWxzZSwgbHJjLCBpaSAtIDFdO1xcbiAgICAgICAgICAgIGVsc2UgaWYgKHVUeXBlID09IFxcXCJkb3duXFxcIiB8fCBqeGxpc3QyLmxlbmd0aCA9PSAwKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gW1xcXCJ0b2FzdDovL+ayoeacieWPr+eUqOeahFxcXCIgKyAodVR5cGUgPT0gXFxcIm9wZW5cXFwiID8gXFxcIuivleWQrFxcXCIgOiBcXFwi5LiL6L29XFxcIikgKyBcXFwi6Kej5p6QXFxcIiwgbHJjLCBpaV07XFxuICAgICAgICB9XFxuICAgICAgICBpZiAocGxhdGZvcm0gIT0gXFxcInF0XFxcIikge1xcbiAgICAgICAgICAgIGZvciAobGV0IF8gb2YganhsaXN0KSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bcXVhbGl0eV0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bXFxcImppZXhpXFxcIl0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodXJsICYmIFN0cmluZyh1cmwpLmxlbmd0aCA+IDE5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFt1cmwsIGxyYywgaWldO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChqeEVycm9yKSB7XFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coZXJyb3IoanhFcnJvcikpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHF1YWxpdHkgPT0gXFxcIm1wM1xcXCIpIHsgLy8g6LCD55So5YW25a6D6Kej5p6Q5o6l5Y+jXFxuICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgbGF6eSxcXG4gICAgICAgICAgICAgICAgc2VhcmNoXFxuICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwicXQ/cnVsZT3mrYzor43pgILphY1cXFwiKTtcXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShtdXNpY0l0ZW0pKSB7XFxuICAgICAgICAgICAgICAgIG11c2ljSXRlbSA9IG11c2ljSXRlbVswXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHNvbmdOYW1lID0gKG11c2ljSXRlbS5zb25nTmFtZSB8fCBtdXNpY0l0ZW0ubmFtZSkuc3BsaXQoJyAtICcpO1xcbiAgICAgICAgICAgIHNvbmdOYW1lID0gc29uZ05hbWVbMV0gfHwgc29uZ05hbWVbMF07XFxuICAgICAgICAgICAgbGV0IHNvbmdBcnRpc3QgPSBtdXNpY0l0ZW0uYXJ0aXN0IHx8IG11c2ljSXRlbS5zaW5nZXJuYW1lIHx8IG11c2ljSXRlbS5zaW5nZXIgfHwgbXVzaWNJdGVtLmFyO1xcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHNvbmdBcnRpc3QpKSB7XFxuICAgICAgICAgICAgICAgIC8vIHNvbmdBcnRpc3QgPSBzb25nQXJ0aXN0Lm1hcChfPT5fLm5hbWUpLmpvaW4oXFxcIiZcXFwiKTtcXG4gICAgICAgICAgICAgICAgc29uZ0FydGlzdCA9IHNvbmdBcnRpc3RbMF0ubmFtZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgTVlfUEFHRSA9IDE7XFxuICAgICAgICAgICAgZm9yIChsZXQgXyBvZiBqeGxpc3QyKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bcXVhbGl0eV0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bXFxcImppZXhpXFxcIl0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodXJsICYmIFN0cmluZyh1cmwpLmxlbmd0aCA+IDE5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFt1cmwsIGxyYywgaWldO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChqeEVycm9yKSB7XFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coZXJyb3IoanhFcnJvcikpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGlzUGxheSkgcmV0dXJuIFtmYWxzZSwgbHJjLCBpaV07XFxuICAgICAgICByZXR1cm4gW1xcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXCIsIGxyYywgaWldO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBnZXRTaGFyZShqc29uLCBpc0p4LCBsZW4sIHQxLCB0MiwgYXJyLCBzaSwga2V5KSB7XFxuICAgICAgICBsZXQgdGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICByZXR1cm4gJChnZXRQYXN0ZXMoKS5jb25jYXQoXFxcIue6r+aWh+acrFxcXCIpLmNvbmNhdChhcnIgfHwgW10pLCAyLCAn6YCJ5oup5YiG5Lqr5qC85byPJykuc2VsZWN0KCh0ZXh0LCBpc0p4LCBsZW4sIHQxLCB0Miwgc2ksIGtleSkgPT4ge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5om56YeP5YiG5LqrXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaXRjaDogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV1cXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvX2NhdGNoL0ltcG9ydC50eHRcXFwiLCBKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9yZWx5MiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT3mrYzor43pgILphY1cXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5a6Y5pa56ZO+5o6lXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjsgLy/ov5jmsqHlhpkgICAgXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGRlc2MsIHR5cGUsIHJlbHksIGdyb3VwO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgIT0gXFxcIue6r+aWh+acrFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRleHQgPSBzaGFyZVBhc3RlKHRleHQsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIGdyb3VwID0gXFxcIlBhc3RlXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGdyb3VwID0gXFxcIlRleHRcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAoaXNKeCkge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFxcXCLop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgcmVseSA9IFxcXCIxXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSBcXFwi5pS26JePXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIHJlbHkgPSBcXFwiMlxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGxlbiA9PSAxICYmIHQxICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICAgICAgZGVzYyA9IHQxICsgdHlwZSArIFxcXCLjgIxcXFwiICsgdDIgKyBcXFwi44CNXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlc2MgPSBcXFwi5YWx44CMXFxcIiArIGxlbiArIFxcXCLjgI3mnaFcXFwiICsgdHlwZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdqeGxpc3QyJyk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8v5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TXlWYXIoXFxcImp4X3VybFxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBjb250ZW50OiBnZXRNeVZhcihcXFwianhfY29udGVudFxcXCIsIFxcXCJcXFwiKSxcXG5cXG4gICAgICAgICAgICBtcDM6IGdldE15VmFyKFxcXCJqeF9tcDNcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgaHE6IGdldE15VmFyKFxcXCJqeF9ocVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBzcTogZ2V0TXlWYXIoXFxcImp4X3NxXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGhyOiBnZXRNeVZhcihcXFwianhfaHJcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgenE6IGdldE15VmFyKFxcXCJqeF96cVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBqaWV4aTogZ2V0TXlWYXIoXFxcImp4X2ppZXhpXFxcIiwgXFxcIlxcXCIpLFxcblxcbiAgICAgICAgICAgIHMxOiBnZXRNeVZhcihcXFwianhfczFcXFwiLCBcXFwiMFxcXCIpLFxcbiAgICAgICAgICAgIG0xOiBnZXRNeVZhcihcXFwianhfbTFcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgczI6IGdldE15VmFyKFxcXCJqeF9zMlxcXCIsIFxcXCIwXFxcIiksXFxuICAgICAgICAgICAgbTI6IGdldE15VmFyKFxcXCJqeF9tMlxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICB0aW1lOiBuZXcgRGF0ZSgpLmdldFRpbWUoKVxcbiAgICAgICAgfTtcXG4gICAgICAgIGlmIChfLnRpdGxlICE9IFxcXCJcXFwiICYmIF8udXJsICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgdCBpbiBfKSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4XycgKyB0KTtcXG4gICAgICAgICAgICAgICAgaWYgKF9bdF0gPT0gXFxcIlxcXCIgfHwgX1t0XSA9PSBcXFwiVmZhbmFocy95MGlaeGNTTDBQSkFjUT09XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIF9bdF07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF8nICsgXy50eXBlLCBbXSk7XFxuICAgICAgICAgICAgbGV0IHVpZHMgPSBqeGxpc3QubWFwKF9fID0+IG1kNShfXy50eXBlICsgJzonICsgX18udGl0bGUgKyAnOicgKyBfXy51cmwpKTtcXG4gICAgICAgICAgICBsZXQgaSA9IHVpZHMuaW5kZXhPZihnZXRNeVZhcignanhfdWlkJywgJy0xJykpO1xcbiAgICAgICAgICAgIGlmIChpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdC5wdXNoKF8pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdC5zcGxpY2UoaSwgMSwgXyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4X3RpZCcpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4X3VpZCcpO1xcbiAgICAgICAgICAgIGp4bGlzdCA9IGp4bGlzdC5maWx0ZXIoKG9iaiwgaW5kZXgsIGFycikgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gYXJyLmZpbmRJbmRleChvID0+IG1kNShvYmoudGl0bGUgKyBvYmoudXJsKSA9PT0gbWQ1KG8udGl0bGUgKyBvLnVybCkpID09PSBpbmRleDtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3RfJyArIF8udHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgJ3RvYXN0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lxcbiAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL3VzZXJpZD0vaSk7XFxuICAgICAgICAgICAgICAgIGMwID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgYyA9IEMxLnNwbGl0KC90b2tlbj0vaSk7XFxuICAgICAgICAgICAgICAgIGMxID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgaWYgKCFjMCB8fCAhYzEpIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICBnZXRrZ2ppZXhpKFxcXCLphbfni5fpn7PkuZBcXFwiLCBcXFwiaHR0cHM6Ly93d3cua3Vnb3UuY29tXFxcIiwgYzAsIGMxLCBcXFwiXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdrZzInOlxcbiAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL3VzZXJpZD0vaSk7XFxuICAgICAgICAgICAgICAgIGMwID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgYyA9IEMxLnNwbGl0KC90b2tlbj0vaSk7XFxuICAgICAgICAgICAgICAgIGMxID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgYyA9IEMyLnNwbGl0KC9hcHBpZD0vaSk7XFxuICAgICAgICAgICAgICAgIGMyID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgaWYgKCFjMCB8fCAhYzEpIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAobWQ1KGMyKSAhPSBcXFwiNzhjNjBjMzVlNTkwYmVlOGUxNGJhZTQ0YmRlNTEyNzdcXFwiKSByZXR1cm4gXFxcInRvYXN0Oi8vc2lnbmtleemUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgIGdldGtnamlleGkoXFxcIumFt+eLl+amguW/teeJiFxcXCIsIFxcXCJodHRwczovL2dhdGV3YXkua3Vnb3UuY29tXFxcIiwgYzAsIGMxLCBcXFwiMzExNlxcXCIsIGMyKTtcXG4gICAgICAgICAgICAgICAgXy5zaWduaW4gPSAwO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdrdyc6XFxuICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogXFxcIumFt+aIkemfs+S5kFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogXFxcImh0dHA6Ly9tb2JpLmt1d28uY25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm1wM1xcXCI6IFxcXCJSWGxuWk55WUlVYjEzTXVrSWs5UlRRPT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImhxXFxcIjogXFxcIlZNK3BhVEZ1cHMxYWVTb24rejBoMmc9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwic3FcXFwiOiBcXFwiUEdBbkNRQ2p1Slh6YmlhK3ArMEh0UT09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJoclxcXCI6IFxcXCJ0cTFwWDRUL1kxM3ZUZUEzWmZLWG5WWDJwMm9iUDh0SW1jWEVpOUR5UUhFPVxcXCIsXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoIUMwKSByZXR1cm4gXFxcInRvYXN0Oi8vY29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgXy5qaWV4aSA9IGdldFByaXZhdGVKUyhDMCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ2t3Mic6XFxuICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogXFxcIuazoueCuemfs+S5kFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogXFxcImh0dHBzOi8vYmQtYXBpLmt1d28uY25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm1wM1xcXCI6IFxcXCJsb3E2ZW5vQXZKa2FnTEE4NlNFaUhDQjZWak1wcnZIVDhMRnZ1Z2J1ZnFRPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiaHFcXFwiOiBcXFwiZWsvYm1VMDl2WERxUExIclRIRGp2U0I2VmpNcHJ2SFQ4TEZ2dWdidWZxUT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInNxXFxcIjogXFxcIlB3NFZaQnlBQVFvdmlQN3Fab0tVdWlUeVFkbGRqbCs5OEdETlc4V3ZpcHM9XFxcIixcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGMgPSBDMC5zcGxpdCgvdWlkPS9pKTtcXG4gICAgICAgICAgICAgICAgYzAgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdCgvO3wmfFxcXFxuL2kpWzBdO1xcbiAgICAgICAgICAgICAgICBjID0gQzEuc3BsaXQoL3Rva2VuPS9pKTtcXG4gICAgICAgICAgICAgICAgYzEgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdCgvO3wmfFxcXFxuL2kpWzBdO1xcbiAgICAgICAgICAgICAgICBjID0gQzIuc3BsaXQoL2RldklkPS9pKTtcXG4gICAgICAgICAgICAgICAgYzIgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdCgvO3wmfFxcXFxuL2kpWzBdO1xcbiAgICAgICAgICAgICAgICBpZiAoIWMwIHx8ICFjMSB8fCAhYzIpIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICBfLmppZXhpID0gZ2V0UHJpdmF0ZUpTKGB1cmwgPSBKU09OLnBhcnNlKGZldGNoKF8udXJsICsgXFxcIi9hcGkvc2VydmljZS9tdXNpYy9kb3dubG9hZEluZm8vXFxcIiArIHQxICsgXFxcIj9pc012PTAmZm9ybWF0PVxcXCIgKyB0MyArIFxcXCImYnI9XFxcIiArIHQyICsgXFxcIiZsZXZlbD1cXFwiLCB7XFxuICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgJ1VzZXItQWdlbnQnOiAnb2todHRwLzMuMTAuMCcsXFxuICAgICAgICAnY2hhbm5lbCc6ICdxcScsXFxuICAgICAgICAncGxhdCc6ICdhcicsXFxuICAgICAgICAnbmV0JzogJ3dpZmknLFxcbiAgICAgICAgJ3Zlcic6ICczLjEuMicsXFxuICAgICAgICAndWlkJzogJyR7YzB9JyxcXG4gICAgICAgICd0b2tlbic6ICcke2MxfScsXFxuICAgICAgICAnZGV2SWQnOiAnJHtjMn0nXFxuICAgIH1cXG59KSkuZGF0YS51cmw7YCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ21nJzpcXG4gICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihfLCB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBcXFwi5ZKq5ZKV6Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBcXFwiaHR0cHM6Ly9tLm11c2ljLm1pZ3UuY25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm1wM1xcXCI6IFxcXCJoUzNkcllrcDdPSTF4S09jMkJrZnFRPT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImhxXFxcIjogXFxcIlB3WHJ2dnptMDRmdG9DblVXa3BKRnc9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwic3FcXFwiOiBcXFwiNS9tSzlUY1oxaThoL1k5ejFOSGh6dz09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJoclxcXCI6IFxcXCJ3NWxRbnlYVmFoSnNZR2VVZStwTnV3PT1cXFwiLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYyA9IEMwLnNwbGl0KC9TRVNTSU9OPS9pKTtcXG4gICAgICAgICAgICAgICAgYzAgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdCgvO3wmfFxcXFxuL2kpWzBdO1xcbiAgICAgICAgICAgICAgICBpZiAoIWMwKSByZXR1cm4gXFxcInRvYXN0Oi8vY29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgXy5qaWV4aSA9IGdldFByaXZhdGVKUyhgaGVhZGVycyA9IHtcXG4gICAgaGVhZGVyczoge1xcbiAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBfLnVybCArIFxcXCIvdjQvXFxcIixcXG4gICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBLFxcbiAgICAgICAgXFxcIkJ5XFxcIjogbWQ1KE1PQklMRV9VQSksXFxuICAgICAgICBcXFwiQ29va2llXFxcIjogXFxcIlNFU1NJT049JHtjMH1cXFwiXFxuICAgIH1cXG59O1xcbnUgPSBfLnVybCArIFxcXCIvbWlndW11c2ljL2g1L3BsYXkvYXV0aC9nZXRTb25nUGxheUluZm8/dHlwZT1cXFwiICsgdDIgKyBcXFwiJmNvcHlyaWdodElkPVxcXCIgKyB0MTtcXG51cmwgPSBcXFwiaHR0cHM6XFxcIiArIEpTT04ucGFyc2UoZmV0Y2godSwgaGVhZGVycykpLmRhdGEucGxheVVybDtgKTtcXG4gICAgICAgICAg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cImp4bGlzdF9cXFwiICsga2V5LCBbXSk7XFxuICAgICAgICBpbmRleDMgPSBqeGxpc3QubGVuZ3RoO1xcbiAgICAgICAganhsaXN0ID0ganNvbltrZXldLmNvbmNhdChqeGxpc3QpO1xcbiAgICAgICAganhsaXN0ID0ganhsaXN0LmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxuICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiAoKG9iai50aXRsZSArIG9iai51cmwpID09PSAoby50aXRsZSArIG8udXJsKSkgJiYgKChvYmoudGltZSA+IG8udGltZSkgfHwgKG9iai50aW1lID09PSBvLnRpbWUpKSkgPT09IGluZGV4O1xcbiAgICAgICAgfSk7XFxuICAgICAgICBpbmRleDIgKz0ganhsaXN0Lmxlbmd0aCAtIGluZGV4MztcXG4gICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImp4bGlzdF9cXFwiICsga2V5LCBqeGxpc3QpO1xcbiAgICB9XFxufVxcbnRvYXN0KFxcXCLop6PmnpDlr7zlhaXmiJDlip/vvIzmlrDlop4gXFxcIiArIGluZGV4MiArIFxcXCIg77yM6KaG55uWIFxcXCIgKyAoaW5kZXggLSBpbmRleDIpKTtcXG5iYWNrKGZhbHNlKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKRqeaUtuiXj+WvvOWFpVwiLFwicGF0aFwiOlwicmVseTJcIixcInJ1bGVcIjpcImpzOlxcbmV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScsIHt9KSkucnVsZSk7XFxubGV0IF8gPSBKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL19jYXRjaC9JbXBvcnQudHh0XFxcIikpO1xcbnNldFBhZ2VUaXRsZSgn5om56YeP5pON5L2c77ya5pS26JePJyArIFtcXFwi5a+85YWlXFxcIiwgXFxc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mV3RGF0YXMgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL19jYXRjaC9JbXBvcnQudHh0XFxcIikpLmRhdGE7XFxuICAgICAgICBuZXdEYXRhcyA9IGFkZGxpc3QubWFwKGkgPT4ge1xcbiAgICAgICAgICAgIGxldCBfID0gbmV3RGF0YXNbaV07XFxuICAgICAgICAgICAgZGVsZXRlIF8uZXh0cmE7XFxuICAgICAgICAgICAgZGVsZXRlIF8uY29sX3R5cGU7XFxuICAgICAgICAgICAgcmV0dXJuIF87XFxuICAgICAgICB9KTtcXG4gICAgICAgIGNsZWFyTXlWYXIoJ2FkZGxpc3QnKTtcXG4gICAgICAgIGNsZWFyTXlWYXIoJ2FkZHBpdGNoJyk7XFxuICAgICAgICBpZiAodHlwZSA9PT0gMClcXG4gICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5sb2dEYXRhKG5ld0RhdGFzLCBzaSwgbmFtZSB8fCBcXFwiXFxcIik7XFxuICAgICAgICBlbHNlIGlmICh0eXBlID09PSAxKVxcbiAgICAgICAgICAgIHJldHVybiAkKG5hbWUgfHwgXFxcIlxcXCIsIFxcXCLnoa7lrprliIbnu4TlkI3np7BcXFwiKS5pbnB1dCgoc2ksIG5ld0RhdGFzKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogMCxcXG4gICAgICAgICAgICAgICAgICAgIHBpdGNoOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgc2k6IHNpLFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICBkYXRhOiBuZXdEYXRhc1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuZ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cXFwiaHR0cHM6Ly93d3IubGFuem91aS5jb20vYjAzcjM3OWhjXFxcIiwgXFxcImdjc3BcXFwiKTtcXG4gICAgICAgICAgICAvKlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3RydWUnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICovXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHVybCA9IGZhbHNlO1xcbiAgICAgICAgICAgIHYgPSB2ZXJzaW9uICsgMTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh2ZXJzaW9uIDwgdikge1xcbiAgICAgICAgICAgIGYgPSBcXFwicmVkXFxcIjtcXG4gICAgICAgICAgICB0ID0gXFxcIuajgOa1i+WIsOaWsOeJiOabtOaWsO+8jOeCueWHu+S6huino+ivpuaDheOAglxcXCI7XFxuICAgICAgICAgICAgVCA9IFxcXCLmm7TmlrDlhoXlrrlcXFwiO1xcbiAgICAgICAgICAgIGlmICh1cCA9PSAnJykge1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbSgndXBkYXRlMCcsICcxJykgPT0gJzEnKSBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5pu05paw5o+Q56S6JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICfmo4DmtYvliLDkvaDnmoTop4TliJnniYjmnKzlsI/kuo7mnI3liqHlmajniYjmnKzvvIzmmK/lkKbnq4vljbPmm7TmlrDvvJ8nLFxcbiAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoZGEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gJC5yZXF1aXJlKFxcXCJsYW56b3U/cnVsZT3mrYzor43pgILphY1cXFwiKS5vbmVfdXJsKGRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJcXFxcdTZkNzdcXFxcdTk2MTRcXFxcdTg5YzZcXFxcdTc1NGNcXFxcdWZmZTVob21lX3J1bGVfdXJsXFxcXHVmZmU1XFxcIiArIGdldFBhdGgoZik7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHVybCA9ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikucnVsZSgodXAsIHZlcnNpb24pID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGFuem91P3J1bGU95q2M6K+N6YCC6YWNXFxcIikub25lX2luZm8odXAsIFxcXCJnY3NwXFxcIiwgdmVyc2lvbik7XFxuICAgICAgICAgICAgfSwgdXJsIHx8IHVwLCB2ZXJzaW9uKTtcXG4gICAgICAgICAgICBhcnIucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn56iL5bqP6K6+572uJyxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvaW5zdGFsbCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMjbm9SZWZyZXNoIz9wYWdlVGl0bGU956iL5bqP6K6+572uJztcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnMScpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGlmICghdCkge1xcbiAgICAgICAgVCA9IFxcXCLnqIvluo/orr7nva5cXFwiO1xcbiAgICAgICAgdXJsID0gXFxcImhpa2VyOi8vcGFnZS9pbnN0YWxsI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjXFxcIjtcXG4gICAgICAgIGxldCBob3VyID0gbmV3IERhdGUoKS5nZXRIb3VycygpO1xcbiAgICAgICAgaWYgKGhvdXIgPCA1KSB7XFxuICAgICAgICAgICAgdCA9IFxcXCLmt7HlpJzvvIznjrDlnKjnmoTlpJzvvIznhqzlvpflj6rmmK/ov5jmnKrmlLnlj5jnmoTkuaDmg69cXFwiO1xcbiAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTEpIHtcXG4gICAgICAgICAgICB0ID0gXFxcIuaXqeWuie+8jOa4heaZqOeGueW+rueahOmYs+WFie+8jCDmmK/kvaDlnKjlvq7nrJHlkJdcXFwiO1xcbiAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTQpIHtcXG4gICAgICAgICAgICB0ID0gXFxcIuWNiOWlve+8jOS8tOmaj+edgOeGn+aCieeahOS5kOabsu+8jOiBhuWQrOedgOWKqOS6uueahOaXi+W+i1xcXCI7XFxuICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxOSkge1xcbiAgICAgICAgICAgIHQgPSBcXFwi5aSV5pqu77yM5Ly85riF6aOO6YaJ5pma6Zye77yM5LiN57uP5oSP6Ze055uI56yR5Zue55y4XFxcIjtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdCA9IFxcXCLlpJzmmZrvvIzkuIDkuKrlronpnZnnmoTop5LokL3vvIzpnZnpnZnlnLDogYblkKzlpJzmm7JcXFwiO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOK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ZWxvcGVyLmxhbnpvdWcuY29tXFxcIjtcXG4gICAgICAgICAgICB9IGNhdGNoIChlcnIxKSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoaHRtbC5tYXRjaCgvdmFsdWVcXFxcOyhbXFxcXHNcXFxcU10rPylcXFxcJFxcXFwoL2kpWzFdKTtcXG4gICAgICAgICAgICAgICAgZXZhbCgnYm9keT0nICsgaHRtbC5tYXRjaCgvW1xcXFxzXFxcXFNdKmRhdGEgOihbXFxcXHNcXFxcU10qP1xcXFx9KSxcXFxccysvKVsxXSk7XFxuICAgICAgICAgICAgICAgIHUgPSBTdHJpbmcodXJsKS5yZXBsYWNlKC9cXFxcLmNvbS4qLywgXFxcIi5jb20vYWpheG0ucGhwXFxcIik7XFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKHBvc3QodSwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZC5oZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgYm9keVxcbiAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIHBhdGggPSBfLnVybDtcXG4gICAgICAgICAgICAgICAgaG9zdCA9IF8uZG9tO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHUgPSBob3N0ICsgXFxcIi9maWxlL1xcXCIgKyBwYXRoO1xcbiAgICAgICAgayA9IEpTT04ucGFyc2UoZmV0Y2godSwge1xcbiAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb247XFxuICAgICAgICBrID0gQXJyYXkuaXNBcnJheShrKSA/IGtbMF0gOiBrO1xcbiAgICAgICAgaWYgKHJ1bikgcmV0dXJuIGs7XFxuICAgICAgICBsZXQgZiA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0X3J1bGUuan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AgICBjb2xfdHlwZTogXFxcImJpZ19iaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi5tZG8mJkh0bWxcXFwiKS5yZXBsYWNlKC8oPFxcXFwvc3Bhbj4pP1xcXFxzKjxzcGFuPi9naSwgXFxcIjxicj5cXFwiKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIjxiPuKAnOKAnOehruWumuabtOaWsOKAneKAnTwvYj5cXFwiLmJpZygpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKCh1cmwsIHB3ZCwgaXRlbSwgaXNMb29rKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignUnVsZV9ub3VwZGF0ZScpID09ICcxJyAmJiAhaXNMb29rKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICBvbmVfdXJsXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9sYW56b3U/cnVsZT3mrYzor43pgILphY1cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IEsgPSBvbmVfdXJsKHVybCwgcHdkLCAxLCAwLCBpdGVtKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwsIHB3ZCwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwuc3BsaXQoXFxcIj9cXFwiKVswXSwgcHdkLCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoSykge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGYgPSBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9fZmlsZVNlbGVjdF9ydWxlLmpzb25cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKEssIGYpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJcXFxcdTZkNzdcXFxcdTk2MTRcXFxcdTg5YzZcXFxcdTc1NGNcXFxcdWZmZTVob21lX3J1bGVfdXJsXFxcXHVmZmU1XFxcIiArIGdldFBhdGgoZik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6I635Y+W5LiL6L296ZO+5o6l5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIHVybCwgcHdkLCBpdGVtLCAhIWlzTG9vayksXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICA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AgICAgICAgICAgICAgbGV0IGQ7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2JhY2snKSA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdiYWNrJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUoJ+WIt+aWsGNvb2tpZScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBfID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X3FxJywgW10pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maW5kKF8gPT4gbWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImUyYzFhNGJmOGQ1OGQxNzAzYTVlODEwOWUxZjkwY2MwXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ+avj+S4g+WkqemcgOimgeWIt+aWsOS4gOasoScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICdjb29raWUg6ZyA6KaB5YyF5ZCrIHFtX2tleXN0IOWSjCB1aW4nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHQ6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCd2aXBydWxlX2MwJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogYHB1dE15VmFyKFxcXCJ2aXBydWxlX2MwXFxcIiwgaW5wdXQpO2AsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS7juino+aekOiOt+WPllxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25fc2VhcmNoNlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvb2tpZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5zaWduaW4gPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWUgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF8uamlleGkpLm1hdGNoKC9Db29raWU6IFxcXCIoW15cXFwiXSspLylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MwJywgY29va2llKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ato+WcqOiwg+eUqOino+aekOWPguaVsCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuWlveWDj+i/mOayoeWIsOWIt+aWsOaXtumXtO+8jOehruWumuiOt+WPluWQl++8n1xcXCIpLmNvbmZpcm0oKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tpZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL0Nvb2tpZTogXFxcIihbXlxcXCJdKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MwJywgY29va2llKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5q2j5Zyo6LCD55So6Kej5p6Q5Y+C5pWwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgXylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/msqHmnIlRUemfs+S5kOeahOino+aekFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgXylcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuehruWumuWIt+aWsFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25fbWVudTZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fMl9yb3VuZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29va2llID0gU3RyaW5nKGdldE15VmFyKCd2aXBydWxlX2MwJykpLnRyaW0oKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUgJiYgY29va2llICE9IFxcXCJcXFwiICYmIGNvb2tpZS5tYXRjaChcXFwicW1fa2V5c3Q9XFxcIikgJiYgY29va2llLm1hdGNoKFxcXCJ1aW49XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJpID0gJC5yZXF1aXJlKFxcXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLnJlZnJlc2hfbG9naW4oY29va2llLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh1cmkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLnJ1bGUoKFtxbV9rZXlzdCwgdWluXSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvb2tpZSA9IGBxbV9rZXlzdD0ke3FtX2tleXN0fTsgdWluPSR7dWlufTtgXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUoJ+WIt+aWsOaIkOWKnycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnY29va2ll5Yi35paw5oiQ5YqfJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJzxicj48aDYgc3R5bGU9XFxcInRleHQtYWxpZ246IGNlbnRlcjtcXFwiPicgKyBjb29raWUgKyBcXFwiPC9oNj5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5aSN5Yi2Y29va2llXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKGNvb2tpZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2JhY2snLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJhY2sodHJ1ZSksIFxcXCJjb3B5Oi8vXFxcIiArIGNvb2tpZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgY29va2llKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9jbG91ZDZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fMl9yb3VuZFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlr7zlhaXov5vop6PmnpBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoa2V5LCB1aW4pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdiYWNrJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MwJywga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MxJywgdWluKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RWRpdDIoXFxcInFxXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGtleSwgdWluKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9kb3dubG9hZDZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fMl9yb3VuZFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vY29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgXyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6ICfliLfmlrDmiJDlip8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ1vphbfni5fmpoLlv7XniYhdIOWQrOatjOmihuS8muWRmCc6XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLnJ1bGUoKHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5ZCs5q2M6aKG5Lya5ZGYJyk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgXyA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9rZycsIFtdKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5maW5kKF8gPT4gbWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImM4NzdhZTcyYjk3YmMyNjcyMGFkOGIxYTM5MzYyZDQ3XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ+avj+WkqeWPquiDvemihuWPluS4gOasoScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XTtcXG4gICAgICAgICAgICAgICAgICAgIFsndXNlcmlkJywgJ3Rva2VuJywgJ3NpZ25rZXknXS5tYXAoKHQsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiB0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHQ6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCd2aXBydWxlX2MnICsgaSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogYHB1dE15VmFyKFxcXCJ2aXBydWxlX2Mke2l9XFxcIiwgaW5wdXQpO2AsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS7juino+aekOiOt+WPllxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9zZWFyY2g2XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fMl9yb3VuZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnNpZ25pbiA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1hdCA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL1xcXCIoW15cXFwiXSspXFxcIiwgXFxcIiguKylcXFwiLCBcXFwiMzExNlxcXCIsIFxcXCIoLispXFxcIi8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MwJywgbWF0WzFdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMScsIG1hdFsyXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzInLCBtYXRbM10pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ato+WcqOiwg+eUqOino+aekOWPguaVsCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLku4rlpKnlpb3lg4/lt7Lnu4/nrb7liLDov4fkuobvvIznoa7lrprojrflj5blkJfvvJ9cXFwiKS5jb25maXJtKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtYXQgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF8uamlleGkpLm1hdGNoKC9cXFwiKFteXFxcIl0rKVxcXCIsIFxcXCIoLispXFxcIiwgXFxcIjMxMTZcXFwiLCBcXFwiKC4rKVxcXCIvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBtYXRbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMScsIG1hdFsyXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MyJywgbWF0WzNdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ato+WcqOiwg+eUqOino+aekOWPguaVsCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgXylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/msqHmnInmpoLlv7XniYjnmoTop6PmnpBcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBfKVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi56Gu5a6a6aKG5Y+WXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX21lbnU2XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fMl9yb3VuZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVzZXJpZCA9IGdldE15VmFyKCd2aXBydWxlX2MwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b2tlbiA9IGdldE15VmFyKCd2aXBydWxlX2MxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzaWdua2V5ID0gZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzInKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShzaWdua2V5KSA9PSBcXFwiNzhjNjBjMzVlNTkwYmVlOGUxNGJhZTQ0YmRlNTEyNzdcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdDEgPSAkLmRhdGVGb3JtYXQobmV3IERhdGUoKS5nZXRUaW1lKCksICd5eXl5TU1kZCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHQyID0gJC5kYXRlRm9ybWF0KF8udGltZSwgJ3l5eXlNTWRkJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF0ID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvXFxcIihbXlxcXCJdKylcXFwiLCBcXFwiKC4rKVxcXCIsIFxcXCIzMTE2XFxcIiwgXFxcIiguKylcXFwiLyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF0eCA9IHVzZXJpZCA9PSBtYXRbMV0gJiYgdG9rZW4gPT0gbWF0WzJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hdHggJiYgdDEgPCB0MiAmJiBfLnNpZ25pbiA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S7iuWkqeW3sue7j+etvuWIsOi/h+S6hic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuTGl0ZV9TaWduaW4oXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9rZW4sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpZ25rZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hdHhcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL3NpZ25rZXnplJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgXyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICA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Mjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjXFxcIikucnVsZSgodHlwZSkgPT4ge1xcbiAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG4gICAgICAgIGxldCBsaW5lID0gKCkgPT4gZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBkID0gW107XFxuXFxuXFxuXFxuICAgICAgICBsaW5lKCk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+572R56uZ5o6o6I2QPC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9hdWRpbycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+c2xpZGVyLmt6PC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vaGF5cWJoZ3Iuc2xpZGVyLmt6LyNub0hpc3RvcnkjJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS8xMC5wbmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mn6DkuZA8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAnaHR0cDovLzQzLjE0MC4yNDUuMjQzOjEwODAvbXVzaWMvI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuWFremfszwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICdodHRwczovL2ZsYWMubGlmZS8jbm9IaXN0b3J5IycsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5p6c5qC4PC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vbXVzaWMuZ2h4aS5jb20vI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcblxcblxcblxcbiAgICAgICAgbGluZSgpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPkxYIE11c2ljPC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdodHRwczovL2RvY3MubHhtdXNpYy50b3AvI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vZG9jcy5seG11c2ljLnRvcC9sb2dvLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5YWt6Z+zPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLngrnlh7vnoa7lrprot7PovaznvZHlnYBcXFxcblxcXCIgKyB1cmwpLmNvbmZpcm0oKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9LCBcXFwiaHR0cHM6Ly93d3cuc2l4eWluLmNvbS83NjQ1Lmh0bWxcXFwiKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS8xMC5wbmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mopPmvoQ8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIueCueWHu+ehruWumui3s+i9rOe9keWdgFxcXFxu5o+Q5Y+W56CB77yabHhtdXNpY1xcXCIpLmNvbmZpcm0oKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9LCBcXFwiaHR0cHM6Ly93d3AubGFuem91cS5jb20vYjAyZnE5dzhkXFxcIiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+aUt1bjwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vbHhtdXNpYy5pa3Vuc2hhcmUuY29tOjk3NjMvc2NyaXB0P2tleT1pa3Vuc291cmNlXFxcIiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5oyl5p2v5YqdPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLngrnlh7vnoa7lrprlpI3liLbpk77mjqVcXFxcblxcXCIgKyB1cmwpLmNvbmZpcm0oKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9LCBcXFwiaHR0cHM6Ly9taXJyb3IuZ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c29uXFxcIiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5L2c6ICFPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLngrnlh7vnoa7lrprlpI3liLbpk77mjqVcXFxcblxcXCIgKyB1cmwpLmNvbmZpcm0oKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9LCBcXFwiaHR0cHM6Ly9naXRlZS5jb20vVGhvbWFzWW91L211c2ljZnJlZS9yYXcvbWFzdGVyL2Rpc3QvcGx1Z2lucy5qc29uXFxcIiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6YCf5oKmPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLngrnlh7vnoa7lrprlpI3liLbpk77mjqVcXFxcblxcXCIgKyB1cmwpLmNvbmZpcm0oKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJ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otKg8L2I+Jy5zbWFsbCgpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb25fbWVudTYnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHBsYXlfcGxhdGZvcm0gPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKTtcXG4gICAgICAgIHRzLnNsaWNlKDEsIDUpLm1hcCgodGl0bGUsIGkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogU3Ryb25nKHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGkgPT0gcGxheV9wbGF0Zm9ybSA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgncGxheV9wbGF0Zm9ybScsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgU3RyaW5nKGkpKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuXFxuXFxuXFxuICAgICAgICBsaW5lKCk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5by556qX5o+Q56S6PC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS80MS5wbmcnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHUwID0gZ2V0SXRlbSgndXBkYXRlMCcsICcxJykgPT0gJzEnO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuWwj+eoi+W6j+abtOaWsDwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHUwKSA9PiB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3VwZGF0ZTAnLCB1MCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB1MCA/ICcwJyA6ICcxJyksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKHUwID8gNTUgOiA2MykgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHUxID0gZ2V0SXRlbSgndXBkYXRlMScsICcxJykgPT0gJzEnO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuamguW/teeJiOetvuWIsDwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHUxKSA9PiB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3VwZGF0ZTEnLCB1MSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB1MSA/ICcwJyA6ICcxJyksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKHUxID8gNTUgOiA2MykgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHUyID0gZ2V0SXRlbSgndXBkYXRlMicsICcwJykgPT0gJzEnO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPnFx6Z+z5LmQ5Yi35pawPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodTIpID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgndXBkYXRlMicsIHUyKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHUyID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAodTIgPyA1NSA6IDYzKSArICcuc3ZnJ1xcbiAgICAgICAgfSk7XFxuXFxuXFxuXFxuICAgICAgICBsaW5lKCk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6buY6K6k5Li76aG1PC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS80Mi5wbmcnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHBsYXRmb3JtID0gZ2V0SXRlbSgncGxhdGZvcm0nLCAna3cnKTtcXG4gICAgICAgIHBsYXRmb3Jtcy5zbGljZSgwLCA4KS5tYXAodGl0bGUgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSA9PSBwbGF0Zm9ybSA/IFJpY2goU3Ryb25nKENvbG9yKHRpdGxlKSkpIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF80JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aXRsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgncGxhdGZvcm0nLCB0aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCB0aXRsZSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcblxcblxcblxcbiAgICAgICAgbGluZSgpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPum7mOiupOaQnOe0ojwvYj4nLnNtYWxsKCksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vNDMucG5nJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBzX3BsYXRmb3JtID0gZ2V0SXRlbSgnc19wbGF0Zm9ybScsICdrdycp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3FxJzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsnY29va2ll5pyJ5pWI5pyfN+Wkqe+8jOW3suaUr+aMgeWIt+aWsGNvb2tpZScsICflvLnnqpfmj5DnpLrpu5jorqTlhbPpl63vvIzor7fmiYvliqjlvIDlkK8nLCBbJ3FtX2tleXN0JywgJ3VpbiddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICd3eSc6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ3dlYXBp5bey5pS55oiQZWFwaScsICflupTor6XmiYDmnInpn7PotKjpg73og73ojrflj5bkuoYnLCBbJ01VU0lDX1UnXV07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAna2cnOlxcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gWyflj6/ku6XmipPnvZHpobXnq6/nmoRjb29raWUnLCAn44CAJywgWyd1c2VyaWQnLCAndG9rZW4nXV07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAna2cyJzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsn5bey5pSv5oyB5q+P5aSp562+5Yiw6aKG5Lya5ZGYJywgJ3NpZ25rZXnlhbPplK7or41MblQ2eHAnLCBbJ3VzZXJpZCcsICd0b2tlbicsICdzaWdua2V5J11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2t3JzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsn6Ieq5bex5YaZanPojrflj5YnLCAnaHR0cHM6Ly9naXRodWIuY29tL3loc2owOTE5L211c2ljX2FwaS9ibG9iL21haW4vbGliL2FwaS9rdXdvL21vZHVsZS9zb25nLmRhcnQnLCBbJ3JpZOS8oOWPguS4uu+8mnQxXFxcXG5icuS8oOWPguS4uu+8mnQyXFxcXG5kZXPosIPnlKjvvJokLnJlcXVpcmUoXFxcImt3P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuZGVzKHN0cik7J11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2t3Mic6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ+S7jkFQUOaKk+WMhScsICfjgIAnLCBbJ3VpZCcsICd0b2tlbicsICdkZXZpZCddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdtZyc6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ+S7jue9kemhteeZu+W9lScsICfjgIAnLCBbJ1NFU1NJT04nXV07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAn5L2c6ICFJzpcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9ICd0b2FzdDovL+mCouWViu+8jOS9nOiAheS4jeaDs+aUtuWIsOW+i+W4iOWHve+8jOaaguS4jeaUr+aMgSc7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHR5cGUgIT0gJ+S9nOiAhScpIHtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAzOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3ZpcHJ1bGVfYycgKyBpKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB1cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjXFxcIikucnVsZSgodHlwZSwgW3RpdGxlLCBkZXNjLCBjb29raWVzXSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfV07XFxuICAgICAgICAgICAgICAgICAgICBjb29raWVzLm1hcCgodCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IHQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogdHlwZSA9PSAna3cnID8gNyA6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCd2aXBydWxlX2MnICsgaSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogYHB1dE15VmFyKFxcXCJ2aXBydWxlX2Mke2l9XFxcIiwgaW5wdXQpO2AsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOehruWumuWvvOWFpeKAneKAnVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgodHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldEVkaXQyKHR5cGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHR5cGUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9LCB0eXBlLCBhcnIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgfSwgcCksXFxuICAgIH0pO1xcbn1cXG5zZXRSZXN1bHQoZCk7XCJ9XSIsImljb24iOiJodHRwOi8vbW1iaXoucXBpYy5jbi9tbWJpel9wbmcvNXM3SjI4VTlHSFZpY0Q3Z3V2eWJhc2U4NkhoSEMxMm9PRGJ0cnNnSzdDeHJqNVFwTDZnS255aWJlWkR3RUtJVktVT3RQb0hjeHBmd2EwcG9uWjFpYTVubEEvMD93eF9mbXQ9cG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment