xiaomianao666

小程序:歌词适配

Apr 11th, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@歌词适配@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5q2M6K+N6YCC6YWNIiwiYXV0aG9yIjoiVGhvbWFz5ZayIiwidXJsIjoiaGlrZXI6Ly9lbXB0eT9wPWZ5cGFnZSIsInZlcnNpb24iOjIwMjQwMzE1LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6Im11c2ljIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6JC5yZXF1aXJlKCdob21lP3J1bGU95q2M6K+N6YCC6YWNJyk7Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHk/cz0qKiIsImdyb3VwIjoi4pGr6Z+z5LmQIiwic2VhcmNoRmluZCI6ImpzOlxuc2V0UmVzdWx0KFt7XG4gICAgdGl0bGU6IFwi5pCc57SiID0+IFwiICsgTVlfS0VZV09SRCxcbiAgICBkZXNjOiAn6YCa6L+HXCLpq5jnuqfmkJzntKJcIumhtemdouaQnOe0oicsXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzX3QyKSA9PiB7XG4gICAgICAgIGlmIChnZXRNeVZhcignc19wbGF0Zm9ybScsICdsaWInKSA9PSAnbGliJylcbiAgICAgICAgICAgIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgZ2V0SXRlbSgnc19wbGF0Zm9ybScsICdrdycpKTtcbiAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBzX3QyKTtcbiAgICAgICAgY2xlYXJNeVZhcignc2Vh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gPSBSaWNoKF8udGl0bGUpLnJlcGxhY2UoXFxcIuKAmOKAmOKAmeKAmVxcXCIsICcnKTtcXG4gICAgICAgIF8uaW1nID0gU3RyaW5nKF8uaW1nKS5yZXBsYWNlKC97c2l6ZX0vZ2ksICc0ODAnKTtcXG4gICAgICAgIF8uY29udGVudCA9IF8uY29udGVudCArICcnO1xcbiAgICAgICAgXy56eWlkID0gXy56eWlkICsgJyc7XFxuICAgICAgICBpZiAoIV8uZGVzYykgXy5kZXNjID0gdGhpc19wbGF0Zm9ybTtcXG4gICAgfVxcbiAgICBsZXQgcjQsIHQxID0gTnVtYmVyKF8uY29udGVudC5yZXBsYWNlKC9eKFxcXFxkP1xcXFxEXFxcXGQ/KSskLywgJzAnKSkgPCAyID8gMCA6IDE7XFxuICAgIF8uZXh0cmEgPSB7XFxuICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgY2xzOiBpZCArICc6YWRkbGlzdCcsXFxuICAgICAgICBpZDogW18uZGVzYywgXy56eWlkID09IFxcXCJ1bmRlZmluZWRcXFwiID8gTWF0aC5yYW5kb20oKSA6IF8uenlpZCwgXy5jb250ZW50XS5qb2luKFxcXCIkXFxcIiksXFxuICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLimIUg5pS26JePXFxcIiArICh0MSA/ICfmrYzljZUnIDogJ+WNleabsicpICsgXFxcIiDimIVcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0MSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5sb2dEYXRhKF8sIHQxKTtcXG4gICAgICAgICAgICB9LCB0MSwgXylcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDmibnph4/mlLbol48g4piFXFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygoY2xzSWQsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogMCxcXG4gICAgICAgICAgICAgICAgICAgIHBpdGNoOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgc2k6IHNpLFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkYXRhOiBmaW5kSXRlbXNCeUNscyhjbHNJZClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvX2NhdGNoL0ltcG9ydC50eHRcXFwiLCBKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3JlbHkyI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgICAgICAgICAgfSwgaWQgKyAnOmFkZGxpc3QnLCB0MSlcXG4gICAgICAgIH1dXFxuICAgIH07XFxuICAgIGlmIChfLmRlc2MubWF0Y2goL3FxfHd5fGtnfGt3fG1nfDVzLykgJiYgXy5jb250ZW50ICE9IDMpIHtcXG4gICAgICAgIF8uZXh0cmEubG9uZ0NsaWNrLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4pypIOWkjeWItumTvuaOpSDinKlcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChhLCBiLCBjKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLmNvcHl1cmwoYSwgYiwgYyk7XFxuICAgICAgICAgICAgfSwgXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZClcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuXFxuICAgIGlmIChyMykge1xcbiAgICAgICAgcjQgPSAkKHIzLm5hbWVzLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChuYW1lcywgdXJscykgPT4ge1xcbiAgICAgICAgICAgIGxldCBpID0gbmFtZXMuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmxzW2ldO1xcbiAgICAgICAgfSwgcjMubmFtZXMsIHIzLnVybHMpO1xcbiAgICAgICAgaWYgKHIxID09IDIpIHtcXG4gICAgICAgICAgICBfLnVybCA9IHI0O1xcbiAgICAgICAgICAgIF8uZXh0cmEudXJsID0gcjM7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIF8udXJsID0gcjM7XFxuICAgICAgICAgICAgXy5leHRyYS51cmwgPSByNDtcXG4gICAgICAgIH1cXG4gICAgICAgIF8uZXh0cmEubG9uZ0NsaWNrLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4piFIOS4i+i9veatjOabsiDimIVcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChuYW1lcywgdXJscykgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChuYW1lcywgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgobmFtZXMsIHVybHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGkgPSBuYW1lcy5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgfSwgbmFtZXMsIHVybHMpO1xcbiAgICAgICAgICAgIH0sIHIzLm5hbWVzLCByMy51cmxzKVxcbiAgICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBfLnVybCA9IExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCwgcjEgPT0gMik7XFxuICAgICAgICBpZiAoIXQxKSB7XFxuICAgICAgICAgICAgXy5leHRyYS51cmwgPSBMYXp5KF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQsIHIxICE9IDIpO1xcbiAgICAgICAgICAgIF8uZXh0cmEubG9uZ0NsaWNrLnVuc2hpZnQoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDkuIvovb3mrYzmm7Ig4piFXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkLCAxKSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBfLmNvbF90eXBlID0gJ2NhcmRfcGljXzMnO1xcbiAgICBpZiAocjIpIHJldHVybiBfO1xcbiAgICBkLnB1c2goXyk7XFxufVxcblxcblxcblxcbiQuZXhwb3J0cyA9IHtcXG5cXG5cXG5cXG4gICAgbG9nRGF0YTogZnVuY3Rpb24obmV3RGF0YSwgc2ksIG5hbWUpIHtcXG4gICAgICAgIGlmIChuZXdEYXRhLnp5aWQgPT09IFxcXCJ1bmRlZmluZWRcXFwiKVxcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kuI3mlK/mjIHmlLbol49+XFxcIjtcXG5cXG4gICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgIGlmICh6eSA9PT0gXFxcIlxcXCIpIHp5ID0ge1xcbiAgICAgICAgICAgIFxcXCLlhajpg6hcXFwiOiBbXVxcbiAgICAgICAgfSwgc3RvcmFnZTAuc2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2ksIHp5KTtcXG4gICAgICAgIGxldCB6dSA9IE9iamVjdC5rZXlzKHp5KTtcXG5cXG5cXG4gICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5paw57uEXFxcIiksIDMsIFxcXCLpgInmi6nnu4RcXFwiKS5zZWxlY3QoKHp5LCB6dSwgbmV3RGF0YSwgc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuaWsOe7hFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCF6dS5pbmNsdWRlcyhpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKG5hbWUsIFxcXCLor7fovpPlhaXmlrDnu4TlkI3np7BcXFwiKS5pbnB1dCgoenksIHp1LCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkubWF0Y2goL15cXFxcZCt8XlxcXFxzKijmlrDnu4QpP1xcXFxzKiQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+e7hOWQjeS4jeiDveS4uuepuiAmIOacgOWJjemdouS4jeiDveaYr+aVsOWtlyAmIOS5n+S4jeiDveWPq+aWsOe7hFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMywgJ+ivt+mAieaLqeaWsOe7hOS9jee9ricpLnNlbGVjdCgoenksIGlucHV0MiwgbmV3RGF0YXMsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdEYXRhID0gQXJyYXkuaXNBcnJheShuZXdEYXRhcykgPyBuZXdEYXRhcyA6IFtuZXdEYXRhc107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5pyA5ZCO6Z2iXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaW5wdXQyXSA9IG5ld0RhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB6eSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baW5wdXQyXSA9IG5ld0RhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShuZXdEYXRhcykpIGJhY2sodHJ1ZSksIHRvYXN0KCfmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHp5LCBpbnB1dCwgbmV3RGF0YSwgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgenksIHp1LCBuZXdEYXRhLCBzaSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5YiG57uE5ZCN56ew6YeN5aSN5LqGflxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgenkgPSB6eVtpbnB1dF07XFxuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobmV3RGF0YSkpIHtcXG4gICAgICAgICAgICAgICAgenkgPSB6eS5jb25jYXQobmV3RGF0YSk7XFxuICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KCfmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGlucHV0KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgenUgPSB6eS5tYXAoaXQgPT4gaXQudGl0bGUpO1xcbiAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHp5LCB6dSwgaW5wdXQyLCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuacgOWQjumdolxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHp5LnB1c2gobmV3RGF0YSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IHp1LmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGksIDAsIG5ld0RhdGEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBpbnB1dDIpO1xcbiAgICAgICAgICAgIH0sIHp5LCB6dSwgaW5wdXQsIG5ld0RhdGEsIHNpKTtcXG4gICAgICAgIH0sIHp5LCB6dSwgbmV3RGF0YSwgc2kpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZXREYXRhOiBmdW5jdGlvbihzaSwgenkyLCBrZXkpIHtcXG4gICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgIGlmIChrZXkpIHtcXG4gICAgICAgICAgICB6eVtrZXldID0genkyO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB6eSA9IHp5MjtcXG4gICAgICAgIH1cXG4gICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpLCB6eSk7XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5oiQ5YqfXFxcIjtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgY29weXVybDogZnVuY3Rpb24oQSwgQiwgQykge1xcbiAgICAgICAgc3dpdGNoIChBKSB7XFxuICAgICAgICAgICAgY2FzZSAncXEnOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL2kueS5xcS5jb20vbjIvbS9zaGFyZS9kZXRhaWxzL3Rhb2dlLmh0bWw/aWQ9JyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL2kueS5xcS5jb20vdjgvcGxheXNvbmcuaHRtbD9zb25nbWlkPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ3d5JzpcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChCKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly95Lm11c2ljLjE2My5jb20vbS9wbGF5bGlzdD9pZD0nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8veS5tdXNpYy4xNjMuY29tL20vc29uZz9pZD0nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdrZyc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoQikge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEMubWF0Y2goL18vKSkgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeaUr+aMgWdjaWTpk77mjqXliIbkuqtcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ua3Vnb3UuY29tL3dlaWJvLz9zaGFyZV90eXBlPXNwZWNpYWwmaWQ9JyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ua3Vnb3UuY29tL3dlaWJvLz9oYXNoPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ2t3JzpcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChCKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9tLmt1d28uY24vbmV3aDVhcHAvcGxheWxpc3RfZGV0YWlsLycgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9tLmt1d28uY24vbmV3aDVhcHAvcGxheV9kZXRhaWwvJyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnbWcnOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ubXVzaWMubWlndS5jbi92My9tdXNpYy9wbGF5bGlzdC8nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vbS5tdXNpYy5taWd1LmNuL3YzL211c2ljL3NvbmcvJyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnNXMnOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwOi8vNXNpbmcua3Vnb3UuY29tL3RvcGljL3NoYXJlL3NvbmdsaXN0LyMvP2lkPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICA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AgICAgICAgICAgIHRpdGxlOiBfXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF9fLmhlYWRQaWNVcmwgfHwgX18uZnJvbnRQaWNVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfXy50b3BJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSwgMSkpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInFxX2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0Mikge1xcbiAgICAgICAgbGV0IGxpc3QsIF8sIHU7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly91LnkucXEuY29tL2NnaS1iaW4vbXVzaWN1LmZjZ1xcXCI7XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHUsIHtcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21tOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0OiAnMTknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdjogJzE4NTknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlOiAnbXVzaWMucGZfc29uZ19kZXRhaWxfc3ZyJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnZ2V0X3NvbmdfZGV0YWlsX3lxcScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb25nX21pZDogdDFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSkucmVxLmRhdGEudHJhY2tfaW5mbztcXG4gICAgICAgICAgICAgICAgbGV0IGYgPSBfLmZpbGU7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOS4i+i9vVxcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLnNpemVfMTI4bXAzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzFdICsgU2l6ZShmLnNpemVfMTI4bXAzKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5zaXplXzMyMG1wMylcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUoZi5zaXplXzMyMG1wMykpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV9mbGFjKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdICsgU2l6ZShmLnNpemVfZmxhYykpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV9oaXJlcylcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1s0XSArIFNpemUoZi5zaXplX2hpcmVzKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgdDEsIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwiZG93blxcXCIsIFxcXCJxcVxcXCIsIHQxLCBpLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCB0MSwgXyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHZhciB1cmwsIGlpLCBscmM7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZbXFxcInNpemVfaGlyZXNcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwicXFcXFwiLCB0MSwgMywgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZltcXFwic2l6ZV9mbGFjXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInFxXFxcIiwgdDEsIDIsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZbXFxcIjMyMG1wM1xcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJxcVxcXCIsIHQxLCAxLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ucGF5LnBheV9wbGF5ID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwicXFcXFwiLCB0MSwgMCwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSArPSBgP2RhdGE9e1xcXCJyZXFfMFxcXCI6e1xcXCJtb2R1bGVcXFwiOlxcXCJ2a2V5LkdldFZrZXlTZXJ2ZXJcXFwiLFxcXCJtZXRob2RcXFwiOlxcXCJDZ2lHZXRWa2V5XFxcIixcXFwicGFyYW1cXFwiOntcXFwiZ3VpZFxcXCI6XFxcIjBcXFwiLFxcXCJwbGF0Zm9ybVxcXCI6XFxcIjIwXFxcIixcXFwiZmlsZW5hbWVcXFwiOltcXFwiTTUwMCR7dDErdDF9Lm1wM1xcXCJdLFxcXCJzb25nbWlkXFxcIjpbXFxcIiR7dDF9XFxcIl19fX1gO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfXyA9IGFqYXgodSkucmVxXzAuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gX18ubWlkdXJsaW5mb1swXS5wdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsICYmIHVybCAhPSBcXFwiXFxcIikgdXJsID0gX18uc2lwWzBdICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybCkgcmV0dXJuIFxcXCJ0b2FzdDovL+aXoOazleino+aekFxcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICBpZiAoIWxyYykge1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgbFR5cGUgb2YgW1xcXCJuZXdcXFwiLCBcXFwieXFxXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBhamF4KFxcXCJodHRwOi8vYy55LnFxLmNvbS9seXJpYy9mY2dpLWJpbi9mY2dfcXVlcnlfbHlyaWNfXFxcIiArIGxUeXBlICsgXFxcIi5mY2c/Zm9ybWF0PWpzb24mbm9iYXNlNjQ9MSZzb25nbWlkPVxcXCIgKyB0MSkubHlyaWM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbHJjLm1hdGNoKC9cXFxcW1xcXFxkK1xcXFw6XFxcXGQrLykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IExyYyhscmMsIF8uaW50ZXJ2YWwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobHJjKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly9jLnkucXEuY29tL3NwbGNsb3VkL2ZjZ2ktYmluL2ZjZ19nZXRfZGlzc19ieV90YWcuZmNnP2Zvcm1hdD1qc29uJmNhdGVnb3J5SWQ9XFxcIiArIHQxICsgXFxcIiZzaW49XFxcIiArICgoTVlfUEFHRSAtIDEpICogMzApICsgXFxcIiZlaW49XFxcIiArICgoTVlfUEFHRSAqIDMwKSAtIDEpO1xcbiAgICAgICAgICAgICAgICBfID0gYWpheCh1KS5kYXRhO1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0O1xcbiAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLmRpc3NuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZ3VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmRpc3NpZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfLnN1bSB8fCAoKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGgpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL2MueS5xcS5jb20vcXpvbmUvZmNnLWJpbi9mY2dfdWNjX2dldGNkaW5mb19ieWlkc19jcC5mY2c/Zm9ybWF0PWpzb24mdHlwZT0xJnV0Zjg9MSZkaXNzdGlkPVxcXCIgKyB0MTtcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgodSkuY2RsaXN0WzBdLnNvbmdsaXN0O1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly91LnkucXEuY29tL2NnaS1iaW4vbXVzaWN1LmZjZz9nX3RrPTUzODEmZGF0YT1cXFwiICsgSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImRldGFpbFxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibW9kdWxlXFxcIjogXFxcIm11c2ljVG9wbGlzdC5Ub3BsaXN0SW5mb1NlcnZlclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJHZXREZXRhaWxcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRvcElkXFxcIjogK3QxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwib2Zmc2V0XFxcIjogKE1ZX1BBR0UgLSAxKSAqIDMwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibnVtXFxcIjogMzAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwZXJpb2RcXFwiOiBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNvbW1cXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjdFxcXCI6IDI0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiY3ZcXFwiOiAwXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgodSkuZGV0YWlsLmRhdGEuc29uZ0luZm9MaXN0O1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0MikgcmV0dXJuIF87XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogKF8ubmFtZSB8fCBfLnNvbmduYW1lKSArICcgLSAnICsgXy5zaW5nZXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgaW1nOiAoYWxidW1pZCA9IF8uYWxidW1taWQgfHwgKF8uYWxidW0gPyBfLmFsYnVtLm1pZCA6IFxcXCJcXFwiKSkgIT0gXFxcIlxcXCIgPyBgaHR0cHM6Ly95Lmd0aW1nLmNuL211c2ljL3Bob3RvX25ldy9UMDAyUjMwMHgzMDBNMDAwJHthbGJ1bWlkfS5qcGdgIDogXFxcImhpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9hdWRpb1xcXCIsXFxuICAgICAgICAgICAgY29udGVudDogXy5wYXkucGF5cGxheSxcXG4gICAgICAgICAgICB6eWlkOiBfLm1pZCB8fCBfLnNvbmdtaWRcXG4gICAgICAgIH0sIDEpKTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgaXNVLCBydW4pIHtcXG4gICAgICAgIGxldCBfO1xcbiAgICAgICAgaWYgKGlzVSAhPSBcXFwidXJsXFxcIikge1xcbiAgICAgICAgICAgIGxldCBsaXN0LCBfXyA9IHtcXG4gICAgICAgICAgICAgICAgbGliOiAoXykgPT4gdHJ1ZSxcXG4gICAgICAgICAgICAgICAgcGFpZDogKF8pID0+IF8ucGF5LnBheV9wbGF5ID09ICcxJyxcXG4gICAgICAgICAgICAgICAgZnJlZTogKF8pID0+IF8ucGF5LnBheV9wbGF5ID09ICcwJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgc3VybCA9IChzdHlwZSkgPT4gYWpheChcXFwiaHR0cDovL3U2LnkucXEuY29tL2NnaS1iaW4vbXVzaWN1LmZjZ1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgXFxcImJvZHlcXFwiOiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicmVxXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJtb2R1bGVcXFwiOiBcXFwibXVzaWMuc2VhcmNoLlNlYXJjaENnaVNlcnZpY2VcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJtZXRob2RcXFwiOiBcXFwiRG9TZWFyY2hGb3JRUU11c2ljTGl0ZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicXVlcnlcXFwiOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoX3R5cGVcXFwiOiBzdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm51bV9wZXJfcGFnZVxcXCI6IDMwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFnZV9udW1cXFwiOiBNWV9QQUdFXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJQT1NUXFxcIlxcbiAgICAgICAgICAgIH0pLnJlcS5kYXRhO1xcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybCgwKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLmJvZHkuaXRlbV9zb25nO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX1tpc1VdKF8pKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIF8uc2luZ2VyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IChhbGJ1bWlkID0gXy5hbGJ1bW1pZCB8fCAoXy5hbGJ1bSA/IF8uYWxidW0ubWlkIDogXFxcIlxcXCIpKSAhPSBcXFwiXFxcIiA/IGBodHRwczovL3kuZ3RpbWcuY24vbXVzaWMvcGhvdG9fbmV3L1QwMDJSMzAweDMwME0wMDAke2FsYnVtaWR9LmpwZ2AgOiBcXFwiaGlrZXI6Ly9pbWFnZXMvcnVsZV90eXBlX2F1ZGlvXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy5wYXkucGF5X3BsYXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ubWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwoMyk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5ib2R5Lml0ZW1fc29uZ2xpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5kaXNzbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ubG9nbyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uZGlzc2lkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIF8ubWV0YS5zdW0gfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoXFxcImh0dHBzOi8vdS55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2dcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21tOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdDogJzE5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN2OiAnMTg1OSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGU6ICdtdXNpYy5wZl9zb25nX2RldGFpbF9zdnInLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnZ2V0X3NvbmdfZGV0YWlsX3lxcScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvbmdfbWlkOiBrZXl3b3JkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICAgICAgfSkucmVxLmRhdGEudHJhY2tfaW5mbztcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLnNpbmdlci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IChhbGJ1bWlkID0gXy5hbGJ1bW1pZCB8fCAoXy5hbGJ1bSA/IF8uYWxidW0ubWlkIDogXFxcIlxcXCIpKSAhPSBcXFwiXFxcIiA/IGBodHRwczovL3kuZ3RpbWcuY24vbXVzaWMvcGhvdG9fbmV3L1QwMDJSMzAweDMwME0wMDAke2FsYnVtaWR9LmpwZ2AgOiBcXFwiaGlrZXI6Ly9pbWFnZXMvcnVsZV90eXBlX2F1ZGlvXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnBheS5wYXlwbGF5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ubWlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChcXFwiaHR0cDovL2MueS5xcS5jb20vcXpvbmUvZmNnLWJpbi9mY2dfdWNjX2dldGNkaW5mb19ieWlkc19jcC5mY2c/Zm9ybWF0PWpzb24mdHlwZT0xJnV0Zjg9MSZkaXNzdGlkPVxcXCIgKyBrZXl3b3JkKS5jZGxpc3RbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goXy5kaXNzbmFtZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmxvZ28sXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmRpc3N0aWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAwO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcblxcblxcbiAgICByZWZyZXNoX2xvZ2luOiBmdW5jdGlvbihjb29raWUsIHJ1bikge1xcbiAgICAgICAgbGV0IGJvZHksIGMsIEMgPSBTdHJpbmcoY29va2llKS50cmltKCk7XFxuICAgICAgICBjID0gQy5zcGxpdCgvcW1fa2V5c3Q9L2kpO1xcbiAgICAgICAgbGV0IGtleSA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICBjID0gQy5zcGxpdCgvdWluPS9pKTtcXG4gICAgICAgIGxldCB1aW4gPSAoY1sxXSB8fCBjWzBdKS5zcGxpdChcXFwiO1xcXCIpWzBdO1xcbiAgICAgICAgaWYgKGtleS5zdGFydHNXaXRoKCdXX1gnKSkge1xcbiAgICAgICAgICAgIGJvZHkgPSB7XFxuICAgICAgICAgICAgICAgIFxcXCJjb21tXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImZQZXJzb25hbGl0eVxcXCI6IFxcXCIwXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0bWVMb2dpblR5cGVcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidG1lTG9naW5NZXRob2RcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJhdXRoc3RcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjdFxcXCI6IFxcXCIxMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiY3ZcXFwiOiBcXFwiMTIwODAwMDhcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInZcXFwiOiBcXFwiMTIwODAwMDhcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInRtZUFwcElEXFxcIjogXFxcInFxbXVzaWNcXFwiXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJyZXExXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm1vZHVsZVxcXCI6IFxcXCJtdXNpYy5sb2dpbi5Mb2dpblNlcnZlclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIkxvZ2luXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiY29kZVxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJvcGVuaWRcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzdHJfbXVzaWNpZFxcXCI6IHVpbixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibXVzaWNrZXlcXFwiOiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVuaW9uaWRcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF9rZXlcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibG9naW5Nb2RlXFxcIjogMlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBib2R5ID0ge1xcbiAgICAgICAgICAgICAgICAncmVxMSc6IHtcXG4gICAgICAgICAgICAgICAgICAgICdtb2R1bGUnOiAnUVFDb25uZWN0TG9naW4uTG9naW5TZXJ2ZXInLFxcbiAgICAgICAgICAgICAgICAgICAgJ21ldGhvZCc6ICdRUUxvZ2luJyxcXG4gICAgICAgICAgICAgICAgICAgICdwYXJhbSc6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhwaXJlZF9pbic6IDc3NzYwMDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ211c2ljaWQnOiB1aW4sXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ211c2lja2V5Jzoga2V5XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBib2R5ID0gSlNPTi5zdHJpbmdpZnkoYm9keSk7XFxuICAgICAgICBsZXQgdXJsID0gXFxcImh0dHBzOi8vdS55LnFxLmNvbS9jZ2ktYmluL211c2ljcy5mY2c/c2lnbj16emFcXFwiICsgUigxNikgKyBtZDUoJ0NKQlBBQ3JSdU55NycgKyBib2R5KTtcXG4gICAgICAgIGxldCBfID0gSlNPTi5wYXJzZShwb3N0KHVybCwge1xcbiAgICAgICAgICAgIGJvZHk6IGJvZHlcXG4gICAgICAgIH0pKVsncmVxMSddO1xcbiAgICAgICAgaWYgKF8uY29kZSA9PSAwKSB7XFxuICAgICAgICAgICAga2V5ID0gXy5kYXRhLm11c2lja2V5O1xcbiAgICAgICAgICAgIGlmIChydW4pIHJldHVybiBba2V5LCB1aW5dO1xcbiAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MwJywga2V5KTtcXG4gICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMScsIHVpbik7XFxuICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZSgnamlleGk/cnVsZT3mrYzor43pgILphY0nKS5zZXRFZGl0MihcXFwicXFcXFwiKTtcXG4gICAgICAgIH0gZWxzZSBpZiAoXy5jb2RlID09IDEwMDA2KSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIt+aWsOWkqumikee5geS6hlxcXCI7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liLfmlrDlpLHotKVcXFwiO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKRpFRHWOaUtuiXj1wiLFwicGF0aFwiOlwiY29sbGVjdGlvblwiLFwicnVsZVwiOlwianM6XFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG5sZXQgY19wbGF0Zm9ybSA9IGdldE15VmFyKCdjX3BsYXRmb3JtJywgJ2xpYicpLnRyaW0oKTtcXG5sZXQgc2kgPSBnZXRNeVZhcignc2knLCAnMCcpLnRyaW0oKTtcXG5sZXQgY190MiA9IGdldE15VmFyKCdjX3QyJywgJ2xpYicpLnRyaW0oKTtcXG5sZXQgY190MSA9IHNpID09ICcwJztcXG5kID0gW3tcXG4gICAgdGl0bGU6IGNfdDEgPyBcXFwi5Y2V5puyXFxcIiA6IFxcXCLmrYzljZVcXFwiLFxcbiAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNpKSA9PiB7XFxuICAgICAgICBwdXRNeVZhcignc2knLCBzaSk7XFxuICAgICAgICBjbGVhck15VmFyKCdjX3QyJyk7XFxuICAgICAgICBjbGVhck15VmFyKCd0aScpO1xcbiAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgIH0sIGNfdDEgPyAnMScgOiAnMCcpLFxcbiAgICBjb2xfdHlwZTogXFxcImljb25fNVxcXCIsXFxuICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25feGl1dGFuXFxcIlxcbn0sIHtcXG4gICAgdGl0bGU6IFxcXCLmlLbol49cXFwiLFxcbiAgICB1cmw6IFxcXCJoaWtlcjovL2NvbGxlY3Rpb24/cnVsZT3mrYzor43pgILphY1cXFwiLFxcbiAgICBjb2xfdHlwZTogXFxcImljb25fNVxcXCIsXFxuICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25fZG93bmxvYWRcXFwiXFxufSwge1xcbiAgICB0aXRsZTogXFxcIuWOhuWPslxcXCIsXFxuICAgIHVybDogXFxcImhpa2VyOi8vaGlzdG9yeT9ydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwiaWNvbl81XFxcIixcXG4gICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9oaXNcXFwiXFxufSwge1xcbiAgICB0aXRsZTogXFxcIuaQnOe0olxcXCIsXFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoXykgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcignc19wbGF0Zm9ybScpO1xcbiAgICAgICAgY2xlYXJNeVZhcignc190MycpO1xcbiAgICAgICAgY2xlYXJNeVZhcignc190NCcpO1xcbiAgICAgICAgaWYgKF8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0N4cmo1UXBMNmdLbnlpYmVaRHdFS0lWS1VPdFBvSGN4cGZ3YTBwb25aMWlhNW5sQS8wP3d4X2ZtdD1wbmcnLFxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKYheaJk+W8gOS6jOe6p+KYhVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjJykucnVsZSgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtuYW1lXS5tYXAoXyA9PiBFeHRyYShfKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlRHWOaUtuiXjyAtIOiOt+WPlumUmeivr1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAoc2kgPT0gJzAnID8gJ+atjOabsicgOiAn5q2M5Y2VJykgKyBcXFwi5YiG57uEIOOAjFxcXCIgKyBuYW1lICsgXFxcIuOAjSDkuI3lrZjlnKjvvJ9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS/ruaUuVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFwi5L+u5pS55ZCN56ewXFxcIiwgXFxcIuabtOaUueaOkuW6j1xcXCIsIFxcXCLliIbnu4TlkIjlubZcXFwiLCBdLCAxLCAn6YCJ5oup6KaB5Y+Y5pu055qE5LqL5Lu2Jykuc2VsZWN0KChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+S/ruaUueWQjeensCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeaWsOeahOe7hOWQjVxcXCIpLmlucHV0KChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC5tYXRjaCgvXlxcXFxzKijmlrDnu4R85pyA5ZCO6Z2iKT9cXFxccyokLykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nu4TlkI3kuI3og73kuLrnqbrvvIzkuZ/kuI3og73orr7nva7kuLon5paw57uEJy8n5pyA5ZCO6Z2iJ1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIGluIHp5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IG5hbWUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baW5wdXRdID0genlbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+abtOaUueaOkuW6jyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp1LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHNpLCB6dSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgb2YgenUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25bbmFtZV0gPSB6eVtuYW1lXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd0aScsIHp1LmluZGV4T2YoaSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXFxcIuacgOWQjumdolxcXCIgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltuYW1lXSA9IHp5W25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGknLCB6dS5sZW5ndGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5YiG57uE5ZCI5bm2JzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSB6dS5pbmRleE9mKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenUuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUsIDMsICfpgInmi6nopoHlkIjlubbnmoTliIbnu4QnKS5zZWxlY3QoKHNpLCB6dSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgb2YgenUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2ldID0genlbaV0uY29uY2F0KHp5W25hbWVdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd0aScsIHp1LmluZGV4T2YoaSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliIbkuqtcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2k6IHNpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW25hbWVdXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLmdldFNoYXJlKGpzb24sIGZhbHNlLCBqc29uLmRhdGEubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruWumuWIoOmZpOWIhue7hCBcXFwiICsgbmFtZSArIFxcXCIg5ZCX77yfXFxcXG7mraTmk43kvZzkuI3lj6/pgIbvvIzosKjmhY7pgInmi6njgIJcXFwiKS5jb25maXJtKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgenlbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcigndGknKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgIH1dXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn0pO1xcblxcblxcblxcblxcblxcblxcbnN3aXRjaCAoY190Mikge1xcbiAgICBjYXNlICdmcmVlJzpcXG4gICAgICAgIGNfdDIgPSAnMCdcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICdwYWlkJzpcXG4gICAgICAgIGNfdDIgPSAnMSdcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICdzb25ncyc6XFxuICAgICAgICBjX3QyID0gJzInXFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAnaG90cyc6XFxuICAgICAgICBjX3QyID0gJzMnXFxuICAgICAgICBicmVhaztcXG59XFxuaWYgKEpTT04uc3RyaW5naWZ5KHp1KSA9PSAnW1xcXCLlhajpg6hcXFwiXScgJiYgenlbXFxcIuWFqOmDqFxcXCJdLmxlbmd0aCA9PSAwKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwifn5+5LuA5LmI6YO95rKh5pyJfn5+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKVxcbiAgICB9KTtcXG59IGVsc2Uge1xcbiAgICBpZiAoenlbenVbdGldXS5sZW5ndGggPT09IDApIHtcXG4gICAgICAgIGRlbGV0ZSB6eVt6dVt0aV1dO1xcbiAgICAgICAgY2xlYXJNeVZhcigndGknKTtcXG4gICAgICAgICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgbGV0IGlpID0gMDtcXG4gICAgICAgIHp5W3p1W3RpXV0ubWFwKChfLCBpKSA9PiB7XFxuICAgICAgICAgICAgaWYgKCgoY19wbGF0Zm9ybSA9PSAnbGliJyB8fCBjX3BsYXRmb3JtID09IF8uZGVzYykgJiYgKGNfdDIgPT0gJ2xpYicgfHwgY190MiA9PSBfLmNvbnRlbnQpKSB8fCAoY19wbGF0Zm9ybSA9PSAnbGliJyAmJiAoKGNfdDIgPT0gXy5jb250ZW50KSB8fCAoY190MiA9PSAnMCcgJiYgXy5jb250ZW50ICE9ICcxJykpKSkge1xcbiAgICAgICAgICAgICAgICBfLmV4dHJhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyAnOmFkZGxpc3QnLFxcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS/ruaUuVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgenUsIGtleSwgaSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCLkv67mlLnlkI3np7BcXFwiLCBcXFwi5pu05pS55o6S5bqPXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwi5L+u5pS55bCB6Z2iXFxcIiwgXFxcIuWIh+aNouWIhue7hFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLypcXFwi5om56YeP5o2i57uEXFxcIiovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCAyLCAn6YCJ5oup6KaB5Y+Y5pu055qE5LqL5Lu2Jykuc2VsZWN0KChzaSwgenUsIGtleSwgaSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5L+u5pS55ZCN56ewJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5L+u5pS55bCB6Z2iJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt0eXBlLCB0ZXh0XSA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwi5L+u5pS55ZCN56ewXFxcIjogWyd0aXRsZScsICfor7fovpPlhaXmlrDnmoTlkI3np7AnXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwi5L+u5pS55bCB6Z2iXFxcIjogW18uaW1nID8gJ2ltZycgOiAncGljJywgJ+ivt+i+k+WFpeato+ehrueahOWwgemdouWcsOWdgCddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9W2lucHV0XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKF9bdHlwZV0sIHRleHQpLmlucHV0KChzaSwga2V5LCBpLCB0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gJ3RpdGxlJyAmJiBpbnB1dC5tYXRjaCgvXlxcXFxzKuacgOWQjumdolxcXFxzKiQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+i1hOa6kOWQjeS4jeiDveiuvue9ruaIkCfmnIDlkI7pnaInXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpXVt0eXBlXSA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIGksIHR5cGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+abtOaUueaOkuW6jyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6dSA9IHp5Lm1hcChfID0+IF8udGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSB6eVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp1LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHNpLCBrZXksIHp5LCB6dSwgZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB6dSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoenVbaV0gPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uLnB1c2goenlbaV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXFxcIuacgOWQjumdolxcXCIgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbi5wdXNoKGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgenksIHp1LCBkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfliIfmjaLliIbnu4QnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGlpID0genUuaW5kZXhPZihrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenUuc3BsaWNlKGlpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdCgn5paw57uEJyksIDMsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHNpLCBrZXksIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEsIGpzb24gPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtrZXldLm1hcCgoXywgaWkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpICE9IGkpIGpzb24ucHVzaChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBkYXRhID0gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtrZXldID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ+aWsOe7hCcgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXmlrDnu4TlkI3np7BcXFwiKS5pbnB1dCgoc2ksIHp5LCBkYXRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQubWF0Y2goL15cXFxccyoo5paw57uEfOacgOWQjumdoik/XFxcXHMqJC8pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nu4TlkI3kuI3og73kuLrnqbrvvIzkuZ/kuI3og73orr7nva7kuLon5paw57uEJy8n5pyA5ZCO6Z2iJ1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpbnB1dF0gPSBbZGF0YV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6eSwgZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2lucHV0XS5wdXNoKGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5LCBpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfmibnph4/mjaLnu4QnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikucnVsZSgoc2kpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJhZGRsaXN0P3J1bGU9dGd46Z+z5LmQXFxcIikoc2ksIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIGtleSwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgenVbdGldLCBpLCBfKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChfLCBzaSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpdGNoOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpOiBzaSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBfLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IFtfXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuZ2V0U2hhcmUoanNvbiwgZmFsc2UsIDEsIHNpID09IFxcXCIwXFxcIiA/IFxcXCLmrYzmm7JcXFwiIDogXFxcIuatjOWNlVxcXCIsIF8udGl0bGUsIFtcXFwi5om56YeP5YiG5LqrXFxcIiwgLypcXFwi5a6Y5pa56ZO+5o6lXFxcIiovIF0sIHNpLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfLCBzaSwgenVbdGldKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwga2V5LCBpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6ZmkXFxcIiArIG5hbWUgKyBcXFwi5ZCX77yfXFxcIikuY29uZmlybSgoc2ksIGtleSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKVtrZXldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenVbdGldLCBpLCBfLnRpdGxlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIF1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoXy5kZXNjLm1hdGNoKC9xcXx3eXxrZ3xrd3xtZ3w1cy8pICYmIF8uY29udGVudCAhPSAzKSBfLmV4dHJhLmxvbmdDbGljay5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4pypIOWkjeWItumTvuaOpSDinKlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGEsIGIsIGMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5jb3B5dXJsKGEsIGIsIGMpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZClcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmIChOdW1iZXIoXy5jb250ZW50LnJlcGxhY2UoL14oXFxcXGQqXFxcXEQrXFxcXGQqKSskLywgJzAnKSkgPCAyKSBfLmV4dHJhLmxvbmdDbGljay51bnNoaWZ0KHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4piFIOS4i+i9veatjOabsiDimIVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBMYXp5KF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQsIDEpKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKCFfLnVybCkgXy51cmwgPSBMYXp5KF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQpO1xcbiAgICAgICAgICAgICAgICBfLmNvbF90eXBlID0gJ2NhcmRfcGljXzMnO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EFHRSA9PSAxO1xcblxcblxcblxcbmlmIChzX3QxID09ICcwJykge1xcbiAgICBzd2l0Y2ggKHNfcGxhdGZvcm0pIHtcXG4gICAgICAgIGNhc2UgJ2xpYic6XFxuICAgICAgICAgICAgc190MyA9IGdldE15VmFyKCdzX3QzJywgJ2t3Jyk7XFxuICAgICAgICAgICAgdGFicyA9IFsna3cnLCAna2cnXTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJzVzJzpcXG4gICAgICAgICAgICB0YWJzID0gWydsaWInLCAneWMnLCAnZmMnLCAnYnonXTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ215JzpcXG4gICAgICAgICAgICBzX3Q0ID0gZ2V0TXlWYXIoJ3NfdDQnLCAnMScpID09ICcxJztcXG4gICAgICAgICAgICBzX3QzID0gZ2V0TXlWYXIoJ3NfdDMnLCAnd3knKTtcXG4gICAgICAgICAgICBpZiAoIXNfdDMubWF0Y2goL3d5fGt3fG1nLykgJiYgc190NClcXG4gICAgICAgICAgICAgICAgc190MyA9ICd3eSc7XFxuICAgICAgICAgICAgdGFicyA9IFtcXFwid3lcXFwiLCBcXFwia3dcXFwiLCBcXFwibWdcXFwiLCBcXFwiMXRcXFwiLCBcXFwiZGJcXFwiLCBcXFwiNXlcXFwiLCBcXFwiNWZcXFwiXS5zbGljZSgwLCBzX3Q0ID8gMyA6IDcpO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSAncXQnOlxcbiAgICAgICAgICAgIHNfdDMgPSBnZXRNeVZhcignc190MycsICdiZCcpO1xcbiAgICAgICAgICAgIHRhYnMgPSBxdHMuc2xpY2UoMSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgIGlmIChzX3QzID09ICdrdycgfHwgc190MyA9PSAna2cnKSB7XFxuICAgICAgICAgICAgICAgIHNfdDMgPSAnbGliJztcXG4gICAgICAg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SwgLy4qKFxcXFw/c29uZy4qPz18XFxcXC8pKFthLXowLTldKykoXFxcXCZzb25nLio/PXxcXFxcLykoW2EtejAtOV0rKS9pXSxcXG4gICAgICAgICAgICBbXFxcImtnXFxcIiwgL2t1Z291XFxcXC4vaSwgLyhcXFxcL3NwZWNpYWxcXFxcL3NpbmdsZVxcXFwvfHNoYXJlX3R5cGU9c3BlY2lhbCZpZD18Z2xvYmFsX3NwZWNpYWxpZD18XlteKFxcXFwvc2hhcmUpXStbJlxcXFw/XWlkPSkoW14mXSspL2ksIC8oaGFzaD0pKFthLXowLTldKykvaV0sXFxuICAgICAgICBdO1xcbiAgICAgICAgZm9yIChbcGxhdGZvcm0sIHJlZzEsIHJlZzIsIHJlZzNdIG9mIHJlZ3MpIHtcXG4gICAgICAgICAgICBpZiAoc190Mi5tYXRjaChyZWcxKSkge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgc19wbGF0Zm9ybSA9IHBsYXRmb3JtO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlZzIgJiYgKG1hdCA9IHNfdDIubWF0Y2gocmVnMikpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc190MSA9ICcxJztcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWdpZCA9IG1hdFsyXTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVnMyAmJiAobWF0ID0gc190Mi5tYXRjaChyZWczKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzX3QxID0gJzAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkID0gbWF0WzJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwbGF0Zm9ybSA9PSAnNXMnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWdpZC5tYXRjaCgvXFxcXEQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkID0gbWF0WzRdICsgJyMnICsgcmVnaWQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkICs9ICcjJyArIG1hdFs0XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge31cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKCFyZWdpZCkgeyAvLyDmraPliJnmnKrljLnphY1cXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBbc19wbGF0Zm9ybSwgc190MSwgcmVnaWRdID0gSlNPTi5wYXJzZShleGVjdXRlV2ViUnVsZShzX3QyLnJlcGxhY2UoL15bXFxcXHNcXFxcU10qPyhodHRwW15cXFxcbl0rKVtcXFxcc1xcXFxTXSovaSwgXFxcIiQxXFxcIiksICQudG9TdHJpbmcoKHJlZ3MsIHBsYXRmb3JtLCBzX3QxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaXNSZWcgPSAocmVnLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdpbmRvdy5sb2NhdGlvbi5ocmVmLm1hdGNoKHJlZylbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAobWF0RXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFJ1biA9IFtcXFwicXFcXFwiLCBcXFwiMVxcXCIsIGlzUmVnKHJlZ3NbMF1bMl0sIDIpIHx8IGZpcnN0UGFnZURhdGEudGFvZ2VEYXRhLmlkXTtcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycjEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhwUGFyYW0gPSBkYXRhRnJvbVNtYXJ0eVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoaXNLZ3BlKSB7fVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjaWFsaWQgPSBwaHBQYXJhbS5zcGVjaWFsaWQgfHwgcGhwUGFyYW0uZ2xvYmFsX2NvbGxlY3Rpb25faWQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGVjaWFsaWQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJ1biA9IFtcXFwia2dcXFwiLCBcXFwiMVxcXCIsIHNwZWNpYWxpZF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbXFxcImtnXFxcIiwgXFxcIjBcXFwiLCBpc1JlZyhyZWdzWzVdWzNdLCAyKSB8fCBwaHBQYXJhbS5oYXNoXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycjIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsgLy8g5aW95YOP5piv6L+Z5qC35ou855qEKOWkp+amglxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChsaXN0aWQgPSBpc1JlZygvbGlzdGlkPShcXFxcZCspL2ksIDEpKSAmJiAodWlkID0gaXNSZWcoL3VpZD0oXFxcXGQrKS9pLCAxKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbXFxcImtnXFxcIiwgXFxcIjFcXFwiLCBcXFwiY29sbGVjdGlvbl8zX1xcXCIgKyB1aWQgKyBcXFwiX1xcXCIgKyBsaXN0aWQgKyBcXFwiXzBcXFwiXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhwUGFyYW0gPSAod2luZG93LiRvdXRwdXQgPyB3aW5kb3cuJG91dHB1dC5pbmZvIDogbkRhdGEpLmxpc3RpbmZvO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJ1biA9IFtcXFwia2dcXFwiLCBcXFwiMVxcXCIsIHBocFBhcmFtLnNwZWNpYWxpZCB8fCBwaHBQYXJhbS5nbG9iYWxfY29sbGVjdGlvbl9pZF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycjMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJ1biA9IFtwbGF0Zm9ybSwgc190MSwgXFxcIlxcXCJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KFJ1bik7XFxuICAgICAgICAgICAgICAgIH0sIHJlZ3MsIHBsYXRmb3JtLCBzX3QxKSwge1xcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXSxcXG4gICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDgwMDBcX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1bGU95q2M6K+N6YCC6YWNXFxcIjtcXG4gICAgICAgIH0sIE1ZX1BBUkFNUyksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHBhZ2VUaXRsZTogXFxcIlRHWOaUtuiXj1xcXCIsXFxuICAgICAgICAgICAgYmFjazogMVxcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLmkJzntKJcXFwiICsgKHNfdDEgPT09ICcwJyA/IFxcXCLljZXmm7JcXFwiIDogXFxcIuatjOWNlVxcXCIpKSxcXG4gICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc190MSkgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdzX3QxJywgc190MSk7XFxuICAgICAgICAgICAgLy8gY2xlYXJNeVZhcignc190MycpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgc190MSA9PT0gJzAnID8gJzEnIDogJzAnKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl9zbWFsbF8zXFxcIixcXG4gICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25feGl1dGFuXFxcIlxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLmiJHnmoTmlLbol49cXFwiKSxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vY29sbGVjdGlvbj9ydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2Rvd25sb2FkXFxcIlxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLljoblj7LorrDlvZVcXFwiKSxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vaGlzdG9yeT9ydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2hpc1xcXCJcXG4gICAgfV07XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/CflI0nLFxcbiAgICAgICAgZGVzYzogJ+aQnOe0ouWFs+mUruivjSAvIOWIhuS6q+mTvuaOpScsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKHNfcGxhdGZvcm0pID0+IHtcXG4gICAgICAgICAgICBzX3QyID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgIGlmIChzX3QyICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywgc190Mik7XFxuICAgICAgICAgICAgICAgIGlmIChzX3BsYXRmb3JtID09ICdsaWInKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBnZXRJdGVtKCdzX3BsYXRmb3JtJywgJ2t3JykpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBzX3BsYXRmb3JtKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaFxcXCIsXFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihcXFwic190MlxcXCIpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ3NfdDInLGlucHV0KVxcXCIsXFxuICAgICAgICAgICAgLyog5LiN5aW955SoXFxuICAgICAgICAgICAgJC50b1N0cmluZygoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgPSBTdHJpbmcoaW5wdXQpLnRyaW0oKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKFxcXCJzX3QyXFxcIikgIT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKGlkICsgJzpjbWQ6a2V5Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgJiYgaW5wdXQgIT0gXFxcIlxcXCIgJiYgIS9odHRwcz86XFxcXC9cXFxcLy8udGVzdChpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly9tc2VhcmNoY2RuLmt1Z291LmNvbS9uZXcvYXBwL2kvc2VhcmNoLnBocD9jbWQ9MzAyJmtleXdvcmQ9XFxcIiArIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBKU09OLnBhcnNlKGZldGNoKHUpKS5kYXRhXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLmtleXdvcmQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGlkLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhID0gZmluZEl0ZW0oaWQrXFxcIjpzZWFyY2hcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuZGVmYXVsdFZhbHVlID0ga2V5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpZCwgXy5rZXl3b3JkKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgJzpjbWQ6a2V5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkICsgJzpzZWFyY2gnLCBkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlkKVxcbiAgICAgICAgICAqL1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgIH0pO1xcbiAgICBwbGF0Zm9ybXMubWFwKHBsYXRmb3JtID0+IHtcXG4gICAgICAgIGlmIChzX3BsYXRmb3JtID09IHBsYXRmb3JtKVxcbiAgICAgICAgICAgIHBsYXRmb3JtID0gUmljaChTdHJvbmcoQ29sb3IocGxhdGZvcm0pKSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBwbGF0Zm9ybSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBsYXRmb3JtKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICghcGxhdGZvcm0ubWF0Y2goL17igJjigJjigJnigJkvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc190MycpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc190NCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgcGxhdGZvcm0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgIH0pO1xcbiAgICBpZiAoc190MSA9PSAnMCcgJiYgc19wbGF0Zm9ybSA9PSAnbXknKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhDb2xvcihzX3Q0ID8gJ+aWsCcgOiAn5penJywgJyMzMzk5Y2MnKSkpLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc190NCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc190NCcsIHNfdDQpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgc190NCA/ICcwJyA6ICcxJyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgdGFicy5tYXAobmFtZSA9PiB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBzX3QzID09IG5hbWUgPyBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpIDogbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MycsIHRpZCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBuYW1lKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgIH0sIHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgfSk7XFxuICAgIExvYWRpbmcoKTtcXG4gICAgaWYgKGlzVSkge1xcbiAgICAgICAgaWYgKCFyZWdpZCkgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIumTvuaOpeagvOW8j+acquaUtuW9lVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZWxzZSBzX3QzID0gXFxcInVybFxcXCI7XFxuICAgIH1cXG59IGVsc2UgZCA9IFtdO1xcblxcblxcblxcbmlmIChzX3BsYXRmb3JtICE9IFxcXCJsaWJcXFwiICYmICEvXlxcXFxzKiQvLnRlc3Qoc190MikpIHtcXG4gICAgaWYgKHNfdDIudHJpbSgpICYmICghaXNVIHx8IGlzUCkpIHtcXG4gICAgICAgIGlmIChpc1UpXFxuICAgICAgICAgICAgc2V0UGFnZVRpdGxlKCfpq5jnuqfmkJzntKIgLSAnICsgc19wbGF0Zm9ybSArIChzX3QxID09ICcxJyA/ICfmrYzljZUnIDogJ+WNleabsicpKTtcXG4gICAgICAgIGVsc2VcXG4gICAgICAgICAgICBzZXRQYWdlVGl0bGUoJ+mrmOe6p+aQnOe0oiAtICcgKyBzX3QyICsgJyMnICsgTVlfUEFHRSk7XFxuICAgICAgICBpZiAoaXNQICYmICFpc1UgJiYgc190MSA9PSAnMCcpIHtcXG4gICAgICAgICAgICBpc19kb3duID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMSdcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXNfZG93biA/ICc8Yj7wn5OlIOS4i+i9vTwvYj4nIDogJzxiPvCfjrUg5pKt5pS+PC9iPicsXFxuICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbW9yZS8nICsgKGlzX2Rvd24gPyAyMiA6IDQwKSArICcucG5nJyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlzX2Rvd24gPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJztcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSwgaW1nID0gJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbW9yZS8nO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzX2Rvd24pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICc8Yj7wn461IOaSreaUvjwvYj4nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZyArPSAnNDAnO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICc8Yj7wn5OlIOS4i+i9vTwvYj4nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZyArPSAnMjInO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaW1nICs9ICcucG5nJztcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzZWFyY2hfZG93bicsIGlzX2Rvd24gPyAnMCcgOiAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCArICc6eWl5YW4nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gZmluZEl0ZW1zQnlDbHMoaWQgKyAnOmFkZGxpc3QnKSB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXh0cmFfdXJsID0gaXQudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBpdC5leHRyYS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXQuZXh0cmEudXJsID0gZXh0cmFfdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaXQuZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGl0LmV4dHJhLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2ljb25cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGlkICsgJzp5aXlhbidcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChpc1ApIHtcXG4gICAgICAgICAgICAvLyBpc19kb3duID0gZmV0Y2goJ2h0dHBzOi8vdjEuaGl0b2tvdG8uY24vP2VuY29kZT10ZXh0Jyk7XFxuICAgICAgICAgICAgaXNfZG93biA9IGZldGNoKCdodHRwczovL3RlbmFwaS5jbi92Mi95aXlhbicpO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnPGI+8J+TmiAnICsgaXNfZG93biArICc8L2I+JyxcXG4gICAgICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjQnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaXNfZG93biA9IGZldGNoKCdodHRwczovL3RlbmFwaS5jbi92Mi95aXlhbicpO1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPGI+8J+TmiAnICsgaXNfZG93biArICc8L2I+JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5aSN5Yi2OiBcXFwiICsgaXNfZG93bixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIHRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlzX2Rvd24pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpZCArIFxcXCI6c2VhcmNoX2Rvd25cXFwiKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2ljb25cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjpzZWFyY2hfZG93blxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlpI3liLY6IFxcXCIgKyBpc19kb3duLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXNfZG93bilcXG4gICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChpc1AgfHwgZ2V0TXlWYXIoJ3NlYXJjaF9wYWdlJywgJzAnKSA9PSAnMCcgfHwgc19wbGF0Zm9ybS5tYXRjaCgvbXl8cXQvKSkge1xcbiAgICAgICAgICAgIGxldCBwYWdlU2l6ZSA9IHNfcGxhdGZvcm0gPT0gXFxcIjVzXFxcIiA/IChzX3QxID09ICcwJyA/IDEwIDogMTUpIDogMzA7XFxuICAgICAgICAgICAgbGV0IHRvdGFsID0gJC5yZXF1aXJlKHNfcGxhdGZvcm0gKyBcXFwiP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2VhcmNoKHNfdDEsIHNfdDIsIHNfdDMsIHNfdDQpO1xcbiAgICAgICAgICAgIGlmICh0b3RhbCA8IE1ZX1BBR0UgKiBwYWdlU2l6ZSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc2VhcmNoX3BhZ2UnLCAnMScpO1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgJ+aIkeaYr+acieW6lee6v+eahCcuZm9udGNvbG9yKCdHcmF5Jykuc21hbGwoKSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9XFxufSBlbHNlIGlmIChpc1AgJiYgIWlzVSkge1xcbiAgICBzZXRQYWdlVGl0bGUoJ+mrmOe6p+aQnOe0oicpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6I2ZmNjYwMVxcXCI+PGI+5Y6G5Y+y5pCc57SiPC9iPjwvc3Bhbj4nLFxcbiAgICAgICAgcGljX3VybDogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25fZmluZFxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICB1cmw6ICQoXFxcIuehruWum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S5iOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBlbHNlIGhpc3RvcnkubWFwKChrZXksIGksIGlkKSA9PiB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBrZXksXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChzX3BsYXRmb3JtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKHRydWUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzX3BsYXRmb3JtID09ICdsaWInKSBwdXRNeVZhcignc19wbGF0Zm9ybScsIGdldEl0ZW0oJ3NfcGxhdGZvcm0nLCAna3cnKSk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgLy8gY2xlYXJNeVZhcignc190MycpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhID0gZmluZEl0ZW0oXFxcImdjc3AxOTk5OnNlYXJjaFxcXCIpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmEuZGVmYXVsdFZhbHVlID0ga2V5O1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJhXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgIH0sIHNfcGxhdGZvcm0sIGtleSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjprZXk6XFxcIiArIGtleSxcXG4gICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCI6a2V5XFxcIixcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaTlhbPplK7or406XFxcIiArIGtleSxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpZCwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgW10pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpaSA9IGhpc3RvcnkuaW5kZXhPZihrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpc3Rvcnkuc3BsaWNlKGlpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgaGlzdG9yeSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCArIFxcXCI6a2V5OlxcXCIgKyBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoaXN0b3J5Lmxlbmd0aCA9PT0gMCkgYWRkSXRlbUFmdGVyKGlkICsgXFxcIjpzZWFyY2hIaXN0b3J5XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGlkLCBrZXkpXFxuICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH0pO1xcbiAgICBSZXNvdSA9IChpZCwgc19wbGF0Zm9ybSwgcGxhdGZvcm0sIHJlc291KSA9PiB7XFxuICAgICAgICBsZXQgRCA9IFtdO1xcbiAgICAgICAgcmVzb3UubWFwKG5hbWUgPT4ge1xcbiAgICAgICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNfcGxhdGZvcm0sIHBsYXRmb3JtLCBrZXl3b3JkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSAnbGliJykgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBwbGF0Zm9ybSk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDEnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBrZXl3b3JkKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHNfcGxhdGZvcm0sIHBsYXRmb3JtLCBuYW1lKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgJzpyZXNvdTprZXknXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIEQ7XFxuICAgIH07XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNmZjY2MDFcXFwiPjxiPuWkp+WutumDveWcqOaQnDwvYj48L3NwYW4+JyxcXG4gICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaWQsIHNfcGxhdGZvcm0sIHBsYXRmb3JtLCBSZXNvdSkgPT4ge1xcbiAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhpZCArICc6cmVzb3U6a2V5Jyk7XFxuICAgICAgICAgICAgbGV0IHNyZWM7XFxuICAgICAgICAgICAgaWYgKHBsYXRmb3JtICE9ICdrZycpIHtcXG4gICAgICAgICAgICA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YW1lXSA9IF8ubmFtZVxcbiAgICAgICAgKTtcXG4gICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdID0ge307XFxuICAgICAgICBpZiAocnVuKSByZXR1cm4gdHJ1ZTtcXG4gICAgICAgIC8qXFxuICAgICAgICAgICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW1xcXCLlhajpg6hcXFwiXSA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KFxcXCJ0b3BsaXN0P1xcXCIpLmxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgICovXFxuICAgICAgICAkLnJlcXVpcmUoJ3d5P3J1bGU95q2M6K+N6YCC6YWNJykuYWpheDMoXFxcIi9hcGkvdG9wbGlzdC9kZXRhaWwvdjJcXFwiKS5kYXRhLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5saXN0ICYmIF8ubGlzdC5sZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBfLm5hbWUucmVwbGFjZSgv5qac5Y2VPy8sIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bbmFtZV0gPSBbXTtcXG4gICAgICAgICAgICAgICAgXy5saXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLmlkICE9IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXVtuYW1lXS5wdXNoKEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVyVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJ3eV9pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIGxldCBsaXN0LCBfO1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhVxcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIvdjMvc29uZy9kZXRhaWxcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBjOiBgW3tcXFwiaWRcXFwiOiR7dDF9fV1gXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBsZXQgYSA9IF8uc29uZ3NbMF07XFxuICAgICAgICAgICAgICAgIGxldCBpc0ZyZWVNdXNpYyA9IChhLmZlZSA9PSAwIHx8IGEuZmVlID09IDgpICYmIChfLnByaXZpbGVnZXNbMF0uc3QgPiAtMSk7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOS4i+i9vVxcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSBbdHNbMV0gKyBTaXplKGEubCA/IGEubC5zaXplIDogYS5tLnNpemUpXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLmgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKGEuaC5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoYS5zcSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUoYS5zcS5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoYS5ocilcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1s0XSArIFNpemUoYS5oci5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgdDEsIGEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwiZG93blxcXCIsIFxcXCJ3eVxcXCIsIHQxLCBpLCBhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCB0MSwgYSk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHZhciB1cmwsIGlpLCBscmM7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuaHIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInd5XFxcIiwgdDEsIDMsIGEsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuc3EpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInd5XFxcIiwgdDEsIDIsIGEsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWlpID0gaWkgPiAwID8gMSA6IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNGcmVlTXVzaWMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVybCA9IGBodHRwOi8vbXVzaWMuMTYzLmNvbS9zb25nL21lZGlhL291dGVyL3VybD9pZD0ke3QxfS5tcDNgO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgzKFxcXCIvYXBpL3NvbmcvZW5oYW5jZS9wbGF5ZXIvdXJsL3YxXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkczogYFske3QxfV1gLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsOiBpaWkgPiAwID8gXFxcImV4aGlnaFxcXCIgOiBcXFwic3RhbmRhcmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kZVR5cGU6IFxcXCJmbGFjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuZGF0YVswXS51cmwuc3BsaXQoXFxcIj9cXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoYS5oICYmIGlpID09IDEpIHx8IGlpaSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJ3eVxcXCIsIHQxLCBpaWksIGEsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpaWkgLT0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChpaWkgPiAtMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBcXFwidG9hc3Q6Ly/ml6Dms5Xop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcblxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIvc29uZy9seXJpY1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsdjogLTEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGt2OiAtMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHY6IC0xXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkubHJjLmx5cmljO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyBcXFwiI2lzTXVzaWM9dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvL+mmlumhtVxcbiAgICAgICAgICAgICAgICBpZiAoIXQxLm1hdGNoKC9cXFxcPy8pKSB0MSA9IFxcXCJ0b3AvcGxheWxpc3Q/Y2F0PVxcXCIgKyB0MSArIFxcXCImXFxcIjtcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KHQxKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IF8ucmVzdWx0IHx8IF8ucGxheWxpc3RzO1xcbiAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwgfHwgXy5waWNVcmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIGlmICh0MSA9PSBcXFwicGVyc29uYWxpemVkP1xcXCIpIHJldHVybiAwO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXy50b3RhbCB8fCAoKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGgpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKVxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwid3k/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJnZC92Ni9cXFwiICsgdDEsIDk5OTk5KS5wbGF5bGlzdC50cmFja3M7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBbXTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodDIpIHJldHVybiBfO1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5hci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICBpbWc6IF8uYWwucGljVXJsLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6ICgoXy5mZWUgPT0gMCB8fCBfLmZlZSA9PSA4KSAmJiAoXy5wcml2aWxlZ2UgPyAoXy5wcml2aWxlZ2Uuc3QgPiAtMSkgOiAxKSkgPyAwIDogMSxcXG4gICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICB9LCAxKSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIGlzVSkge1xcbiAgICAgICAgbGV0IF87XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgbGV0IGxpc3QsIF9fID0ge1xcbiAgICAgICAgICAgICAgICBsaWI6IChfKSA9PiB0cnVlLFxcbiAgICAgICAgICAgICAgICBwYWlkOiAoXykgPT4gKChfLmZlZSA9PSAwIHx8IF8uZmVlID09IDgpICYmIChfLnByaXZpbGVnZSA/IChfLnByaXZpbGVnZS5zdCA+IC0xKSA6IDEpKSA/IDAgOiAxLFxcbiAgICAgICAgICAgICAgICBmcmVlOiAoXykgPT4gKChfLmZlZSA9PSAwIHx8IF8uZmVlID09IDgpICYmIChfLnByaXZpbGVnZSA/IChfLnByaXZpbGVnZS5zdCA+IC0xKSA6IDEpKSA/IDEgOiAwXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBsZXQgc3VybCA9IChzdHlwZSkgPT4gXyA9ICQucmVxdWlyZShcXFwid3k/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4MihcXFwiL3NlYXJjaC9nZXRcXFwiLCB7XFxuICAgICAgICAgICAgICAgIHM6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgIGxpbWl0OiAzMCxcXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAoTVlfUEFHRSAtIDEpICogMzAsXFxuICAgICAgICAgICAgICAgIHR5cGU6IHN0eXBlLFxcbiAgICAgICAgICAgICAgICBzdHJhdGVneTogNSxcXG4gICAgICAgICAgICAgICAgcXVlcnlDb3JyZWN0OiB0cnVlXFxuICAgICAgICAgICAgfSkucmVzdWx0O1xcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gc3VybCgxKS5zb25ncztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1UgPT09IDEpIHJldHVybiBsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX1tpc1VdKF8pKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIF8uYXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5hbC5waWNVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICgoXy5mZWUgPT0gMCB8fCBfLmZlZSA9PSA4KSAmJiAoXy5wcml2aWxlZ2UgPyAoXy5wcml2aWxlZ2Uuc3QgPiAtMSkgOiAxKSkgPyAwIDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBzdXJsKDEwMDApLnBsYXlsaXN0cztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1UgPT09IDEpIHJldHVybiBsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIF8uc29uZ0NvdW50IHx8IF8ucGxheWxpc3RDb3VudCB8fCAoKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGgpO1xcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIvdjMvc29uZy9kZXRhaWxcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYzogYFt7XFxcImlkXFxcIjoke2tleXdvcmR9fV1gXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBhID0gXy5zb25nc1swXTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYS5uYW1lICsgJyAtICcgKyBhLmFyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogYS5hbC5waWNVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogKChhLmZlZSA9PSAwIHx8IGEuZmVlID09IDgpICYmIChfLnByaXZpbGVnZXNbMF0uc3QgPiAtMSkpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogYS5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwid3k/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJnZC92Ni9cXFwiICsga2V5d29yZCwgMCkucGxheWxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIC8qIE15RnJlZU1QMyDmrYzljZXop6PmnpDltKnkuobvvIzkuI3mmL7npLpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ215J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICovXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIDA7XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIGFqYXg6IGZ1bmN0aW9uKHBhdGgsIG4pIHtcXG4gICAgICAgIGlmIChwYXRoLm1hdGNoKC9eZ2RcXFxcL3Y2XFxcXC8vKSkge1xcbiAgICAgICAgICAgIHBhdGggPSBwYXRoLnJlcGxhY2UoL15nZChcXFxcL3Y2XFxcXC8pKFxcXFxkKykvLCBcXFwiaHR0cHM6Ly9tdXNpYy4xNjMuY29tL2FwaSQxcGxheWxpc3QvZGV0YWlsP2lkPSQyJm49XFxcIikgKyBuO1xcbiAgICAgICAgfSBlbHNlIGlmICghcGF0aC5tYXRjaCgvXmh0dHBzPzpcXFxcL1xcXFwvLykpIHtcXG4gICAgICAgICAgICB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AgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IHJlbGF0ZV9nb29kcy5tYXAoKF8sIGkpID0+IHRzW2kgKyAxXSArIFNpemUoXy5pbmZvLmZpbGVzaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgdDEsIHJlbGF0ZV9nb29kcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJkb3duXFxcIiwgXFxcImtnXFxcIiwgdDEsIGksIHJlbGF0ZV9nb29kcyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgdDEsIHJlbGF0ZV9nb29kcyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHZhciB1cmwsIGlpLCBscmM7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0MyAmJiBpaSA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWxhdGVfZ29vZHNbM10pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImtnXFxcIiwgdDEsIDMsIHJlbGF0ZV9nb29kcywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbGF0ZV9nb29kc1syXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia2dcXFwiLCB0MSwgMiwgcmVsYXRlX2dvb2RzLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDMgJiYgaWkgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRlX2dvb2RzWzFdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrZ1xcXCIsIHQxLCAxLCByZWxhdGVfZ29vZHMsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5wcml2aWxlZ2UgPT0gMCB8fCBfLnByaXZpbGVnZSA9PSA4KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVybCA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybCh0MSwgJzEyOCcsIF8uYWxidW1faWQsIF8uYWxidW1fYXVkaW9faWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL20ua3Vnb3UuY29tL2FwcC9pL2dldFNvbmdJbmZvLnBocD9jbWQ9cGxheUluZm8maGFzaD1cXFwiICsgdDEpKS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia2dcXFwiLCB0MSwgMCwgcmVsYXRlX2dvb2RzLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBcXFwidG9hc3Q6Ly/ml6Dms5Xop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcblxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBcXFwiaHR0cDovL2tyY3Mua3Vnb3UuY29tL3NlYXJjaD92ZXI9MSZtYW49eWVzJmNsaWVudD1tb2JpJmtleXdvcmQ9JmR1cmF0aW9uPSZoYXNoPVxcXCIgKyB0MSArIFxcXCImYWxidW1fYXVkaW9faWQ9XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgX18gPSBKU09OLnBhcnNlKGZldGNoKHUpKS5jYW5kaWRhdGVzWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfXyAmJiBfXy5pZCAmJiBfXy5hY2Nlc3NrZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbHlyaWNzLmt1Z291LmNvbS9kb3dubG9hZD92ZXI9MSZjbGllbnQ9cGMmaWQ9XFxcIiArIF9fLmlkICsgXFxcIiZhY2Nlc3NrZXk9XFxcIiArIF9fLmFjY2Vzc2tleSArIFxcXCImZm10PWxyYyZjaGFyc2V0PXV0ZjhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBiYXNlNjREZWNvZGUoSlNPTi5wYXJzZShmZXRjaCh1KSkuY29udGVudCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGxyYyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDpppbpobVcXG4gICAgICAgICAgICAgICAgbGlzdCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly93d3cyLmt1Z291Lmt1Z291LmNvbS95dWVrdS92OS9zcGVjaWFsL2dldFNwZWNpYWw/aXNfYWpheD0xJmNkbj1jZG4mdD01JnBhZ2VzaXplPTMwJmM9XFxcIiArIHQxICsgXFxcIiZwPVxcXCIgKyBNWV9QQUdFKSkuc3BlY2lhbF9kYjtcXG4gICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zcGVjaWFsbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zcGVjaWFsaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGg7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgaWYgKHQxLm1hdGNoKC9fLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSB3ZWJTaWduKFxcXCJodHRwczovL21vYmlsZXMua3Vnb3UuY29tL2FwaS92NS9zcGVjaWFsL3NvbmdfdjJcXFwiLCBbJ2dsb2JhbF9zcGVjaWFsaWQ9JyArIHQxLCAnc3BlY2lhbGlkPScgKyB0MSwgXSk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5pbmZvO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBleGVjdXRlV2ViUnVsZShgaHR0cDovL3d3dzIua3Vnb3Uua3Vnb3UuY29tL3l1ZWt1L3Y5L3NwZWNpYWwvc2luZ2xlLyR7dDF9LTUtOTk5OTkuaHRtbD9qc29uPXRydWVgLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGdsb2JhbC5kYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IEpTT04ucGFyc2UoXyk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgbGlzdCA9IFtdO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChsaXN0Lmxlbmd0aClcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChsaXN0KTtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgIC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4gPT0gJ3J1bicpIHJldHVybiBfLmxpc3RzWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsaXN0ID0gc3VybCgnc29uZycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsMihcXFwidjNcXFwiLCBcXFwicGxhdGZvcm09V2ViRmlsdGVyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAnc3JlYycpIHJldHVybiBfLmxpc3RzO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KF8ubGlzdHMpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX1tpc1VdKF8pKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAoXy5maWxlbmFtZSB8fCBfLm5hbWUpLnNwbGl0KCcgLSAnKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5hbGJ1bV9zaXphYmxlX2NvdmVyIHx8IChfLmluZm8gPyBfLmluZm8uaW1hZ2UgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IChfLnByaXZpbGVnZSA9PSAwIHx8IF8ucHJpdmlsZWdlID09IDgpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaGFzaFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIC8vIGxpc3QgPSBzdXJsKCdzcGVjaWFsJyk7XFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcInYxXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdHM7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zcGVjaWFsbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsIHx8IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zcGVjaWFsaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXy50b3RhbCB8fCAoKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGgpO1xcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICBoYXNoOiBrZXl3b3JkXFxuICAgICAgICAgICAgICAgICAgICB9XSlbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChfLmZpbGVuYW1lIHx8IF8ubmFtZSkuc3BsaXQoJyAtICcpLnJldmVyc2UoKS5qb2luKCcgLSAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWxidW1fc2l6YWJsZV9jb3ZlciB8fCAoXy5pbmZvID8gXy5pbmZvLmltYWdlIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IChfLnByaXZpbGVnZSA9PSAwIHx8IF8ucHJpdmlsZWdlID09IDgpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5oYXNoICsgXFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSB3ZWJTaWduKFxcXCJodHRwczovL21vYmlsZXMua3Vnb3UuY29tL2FwaS92NS9zcGVjaWFsL2luZm9fdjJcXFwiLCBbXFxcInNwZWNpYWxpZD1cXFwiICsga2V5d29yZCwgXFxcImdsb2JhbF9zcGVjaWFsaWQ9XFxcIiArIGtleXdvcmRdKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zcGVjaWFsbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogKF8uc3BlY2lhbGlkIHx8IF8uZ2xvYmFsX3NwZWNpYWxpZCkgKyBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIDA7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGFqYXg6IGZ1bmN0aW9uKHJlc291cmNlKSB7XFxuICAgICAgICBsZXQgYm9keSA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwicmVsYXRlXFxcIjogMSxcXG4gICAgICAgICAgICBcXFwidXNlcmlkXFxcIjogXFxcIjI2MjY0MzE1MzZcXFwiLFxcbiAgICAgICAgICAgIFxcXCJ2aXBcXFwiOiAxLFxcbiAgICAgICAgICAgIFxcXCJ0b2tlblxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcHBpZFxcXCI6IDEwMDEsXFxuICAgICAgICAgICAgXFxcImJlaGF2aW9yXFxcIjogXFxcInBsYXlcXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcmVhX2NvZGVcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgXFxcImNsaWVudHZlclxcXCI6IFxcXCI4OTkwXFxcIixcXG4gICAgICAgICAgICBcXFwibmVlZF9oYXNoX29mZnNldFxcXCI6IDEsXFxuICAgICAgICAgICAgXFxcInJlc291cmNlXFxcIjogcmVzb3VyY2UubWFwKF8gPT4gKHtcXG4gICAgICAgICAgICAgICAgXFxcImlkXFxcIjogMCxcXG4gICAgICAgICAgICAgICAgXFxcInR5cGVcXFwiOiBcXFwiYXVkaW9cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiaGFzaFxcXCI6IF8uaGFzaCB8fCBfLkZpbGVIYXNoXFxuICAgICAgICAgICAgfSkpXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBKU09OLnBhcnNlKHBvc3QoXFxcImh0dHA6Ly9tZWRpYS5zdG9yZS5rdWdvdS5jb20vdjEvZ2V0X3Jlc19wcml2aWxlZ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gJ21pZD0nICsgbWlkLFxcbiAgICAgICAgICAgICdhcHBpZD0nICsgYXBwaWQsXFxuICAgICAgICAgICAgJ3VzZXJpZD0nICsgdXNlcmlkLFxcbiAgICAgICAgICAgICdrZXk9JyArIG1kNShoYXNoICsgXFxcIjU3YWUxMmViNjg5MDIyM2UzNTVjY2ZjYjc0ZWRmNzBkXFxcIiArIGFwcGlkICsgbWlkICsgdXNlcmlkKSxcXG4gICAgICAgICAgICAnYWxidW1faWQ9JyArIGFsYnVtX2lkLFxcbiAgICAgICAgICAgICdhbGJ1bV9hdWRpb19pZD0nICsgYWxidW1fYXVkaW9faWQsXFxuICAgICAgICAgICAgJ2NsaWVudHRpbWU9JyArIE1hdGguZmxvb3IoZGF0ZSAvIDEwMDApLFxcbiAgICAgICAgICAgICdvcGVuX3RpbWU9JyArICQuZGF0ZUZvcm1hdChkYXRlLCAneXl5eU1NZGQnKSxcXG4gICAgICAgICAgICAndG9rZW49JyArIHRva2VuLFxcbiAgICAgICAgICAgICdhcmVhX2NvZGU9MScsXFxuICAgICAgICAgICAgJ21vZHVsZT0nLFxcbiAgICAgICAgICAgICdzc2FfZmxhZz1pc19mcm9tdHJhY2snLFxcbiAgICAgICAgICAgICdjbGllbnR2ZXI9MTA1MTgnLCAvLzEyMDI5XFxuICAgICAgICAgICAgJ3ZpcFR5cGU9NicsXFxuICAgICAgICAgICAgJ3B0eXBlPTAnLFxcbiAgICAgICAgICAgICdhdXRoPScsXFxuICAgICAgICAgICAgJ210eXBlPTAnLFxcbiAgICAgICAgICAgICdiZWhhdmlvcj1wbGF5JyxcXG4gICAgICAgICAgICAncGlkPTInLFxcbiAgICAgICAgICAgICdkZmlkPS0nLFxcbiAgICAgICAgICAgICdwaWR2ZXJzaW9uPTMwMDEnLFxcbiAgICAgICAgICAgICdzZWNyZXQ9JyArIFIoMzIpLFxcbiAgICAgICAgICAgIC8vICdiZWhhdmlvcj1wbGF5JyxcXG4gICAgICAgICAgICAvLyAndmVyc2lvbj05Mj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gICAgICAgXFxcIngtcm91dGVyXFxcIjogXFxcInlvdXRoLmt1Z291LmNvbVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSk7XFxuICAgICAgICBpZiAocmVxLnN0YXR1cyA9PSAxKSB7XFxuICAgICAgICAgICAgaWYgKGlzangpIHtcXG4gICAgICAgICAgICAgICAganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X2tnJywgW10pXFxuICAgICAgICAgICAgICAgICAgICAubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZDUoXy50aXRsZSArIF8udXJsKSA9PSBcXFwiYzg3N2FlNzJiOTdiYzI2NzIwYWQ4YjFhMzkzNjJkNDdcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8udGltZSA9IGRhdGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uc2lnbmluID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3Rfa2cnLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v562+5Yiw5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v562+5Yiw5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2UgaWYgKHJlcS5lcnJvcl9jb2RlID09IDEzMDAxMikgeyAvLyDnrb7liLDov4fkuobvvJ8gICAgICBcXG4gICAgICAgICAgICBpZiAoaXNqeCkge1xcbiAgICAgICAgICAgICAgICBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3Rfa2cnLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgIC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShfLnRpdGxlICsgXy51cmwpID09IFxcXCJjODc3YWU3MmI5N2JjMjY3MjBhZDhiMWEzOTM2MmQ0N1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy50aW1lID0gZGF0ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5zaWduaW4gPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gX1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF9rZycsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nrb7liLDlpLHotKXvvJrku4rlpKnlt7Lnu4/nrb7liLDov4fkuobvvJ9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nrb7liLDlpLHotKXvvJrku4rlpKnlt7Lnu4/nrb7liLDov4fkuobvvJ9cXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOWksei0pe+8mlxcXCIgKyByZXEuZXJyb3JfbXNnO1xcbiAgICAgICAgfVxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p25a3dcIixcInBhdGhcIjpcImt3XCIsXCJydWxlXCI6XCJldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2V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XCJjbGFzc2lmeS9wbGF5bGlzdC9nZXRSY21QbGF5TGlzdD9vcmRlcj1ob3RcXFwiO1xcbiAgICAgICAgYWpheChwY2FwaSArIFxcXCJwbGF5bGlzdC9nZXRUYWdMaXN0P1xcXCIpLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5kYXRhLmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICBfLm5hbWUgPSBfLm5hbWUucmVwbGFjZSgn5rWB5rS+JywgJycpO1xcbiAgICAgICAgICAgICAgICBpVGFnW18ubmFtZV0gPSB7fTtcXG4gICAgICAgICAgICAgICAgXy5kYXRhLm1hcChfXyA9PlxcbiAgICAgICAgICAgICAgICAgICAgaVRhZ1tfLm5hbWVdW19fLm5hbWVdID0gXFxcImNsYXNzaWZ5L3BsYXlsaXN0L2dldFRhZ1BsYXlMaXN0P2lkPVxcXCIgKyBfXy5pZFxcbiAgICAgICAgICAgICAgICApO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl0gPSB7fTtcXG4gICAgICAgIGFqYXgocGNhcGkgKyBcXFwiYmFuZy9iYW5nL2JhbmdNZW51P1xcXCIpLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXVtfLm5hbWVdID0gXy5saXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgenlpZDogXy5zb3VyY2VpZFxcbiAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcImt3X2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0MiwgdDMpIHtcXG4gICAgICAgIGxldCBsaXN0LCBfO1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhVxcbiAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL2RhdGFjZW50ZXIua3V3by5jbi9kLmM/Y21rZXk9cGxpc3RfcGwyMDEyJmZ0PW11c2ljJnJlc2VuYz11dGY4Jmlkcz1cXFwiICsgdDEpKVswXTtcXG4gICAgICAgICAgICAgICAgbGV0IFJlZyA9IChrKSA9PiByZWcgPSBfLk5fTUlORk8ubWF0Y2gobmV3IFJlZ0V4cCgnYml0cmF0ZTonICsgayArICcsZm9ybWF0OlteLF0rLHNpemU6KFteO10rKScpKTtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5LiL6L29XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgayBvZiBbMTI4LCAzMjAsIDIwMDAsIDQwMDBdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFJlZyhrKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1tpXSArIHJlZ1sxXS5yZXBsYWNlKC9cXFxccyptYi9pLCBcXFwiIE1CXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpKys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIHQxLCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBhcnIuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwia3dcXFwiLCB0MSwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgdDEsIF8pO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB2YXIgdXJsLCBpaSwgbHJjO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlpID0gZ2V0SXRlbSgncGxheV9wbGF0Zm9ybScsICcwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzMnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDMgJiYgaWkgPT0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoUmVnKDQwMDApKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrd1xcXCIsIHQxLCAzLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDMgJiYgaWkgPT0gMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoUmVnKDIwMDApKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrd1xcXCIsIHQxLCAyLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDMgJiYgaWkgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoUmVnKDMyMCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImt3XFxcIiwgdDEsIDEsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy50cGF5ID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia3dcXFwiLCB0MSwgMCwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXJsID0gYWpheChwY2FwaS5yZXBsYWNlKC8oYXBpXFxcXC8pLywgJyQxdjEvJykgKyBcXFwibXVzaWMvcGxheVVybD9taWQ9XFxcIiArIHQxICsgXFxcIiZ0eXBlPW11c2ljJlxcXCIpLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gZmV0Y2goXFxcImh0dHBzOi8vYW50aXNlcnZlci5rdXdvLmNuL2FudGkucz90eXBlPWNvbnZlcnRfdXJsJmZvcm1hdD1tcDMmcmlkPVxcXCIgKyB0MSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghdXJsKSByZXR1cm4gXFxcInRvYXN0Oi8v5peg5rOV6Kej5p6QXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5q2M6K+NXFxuICAgICAgICAgICAgICAgIGlmICghbHJjKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IGFqYXgoXFxcImh0dHA6Ly9tLmt1d28uY24vbmV3aDUvc2luZ2xlcy9zb25naW5mb2FuZGxyYz9tdXNpY0lkPVxcXCIgKyB0MSArIFxcXCImXFxcIikubHJjbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzID0gKChfLnRpbWUgLSAwKSAlIDYwKS50b0ZpeGVkKDMpLnBhZFN0YXJ0KDYsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtID0gKChfLnRpbWUgLSBzKSAvIDYwKS50b0ZpeGVkKDApLnBhZFN0YXJ0KDIsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBgWyR7bX06JHtzfV1gICsgXy5saW5lTHlyaWNcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCdcXFxcbicpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDpppbpobVcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgocGNhcGkgKyB0MSArIFxcXCImcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gXy5kYXRhIHx8IF8ubGlzdDtcXG4gICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIF8udG90YWwgfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBfID0gYWpheChwY2FwaSArIFxcXCJwbGF5bGlzdC9wbGF5TGlzdEluZm8/cGlkPVxcXCIgKyB0MSArIFxcXCImcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHBjYXBpICsgXFxcImJhbmcvYmFuZy9tdXNpY0xpc3Q/YmFuZ0lkPVxcXCIgKyB0MSArIFxcXCImcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0MikgcmV0dXJuIF8ubXVzaWNMaXN0O1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tdXNpY0xpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgIHRpdGxlOiAoXy5zb25nTmFtZSB8fCBfLm5hbWUpICsgJyAtICcgKyBfLmFydGlzdCxcXG4gICAgICAgICAgICBpbWc6IF8ucGljIHx8IF8uaW1nIHx8IGZldGNoKCdodHRwOi8vYXJ0aXN0cGljc2VydmVyLmt1d28uY24vcGljLndlYj90eXBlPXJpZF9waWMmcGljdHlwZT11cmwmc2l6ZT01MDAmcmlkPScgKyBfL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ZW5jb2Rpbmc9dXRmOCZyZm9ybWF0PWpzb24mdmVybWVyZ2U9MSZtb2JpPTFcXFwiICsgdmlwdmVyKSk7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIC8vIHN1cmwoJ011c2ljJykubWFwKCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVID09ICdmcmVlJylcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcIm11c2ljXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsMihcXFwibXVzaWNcXFwiLCBcXFwiJnZpcHZlcj0xXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5hYnNsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IF8gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX1tpc1VdKF8pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghXy5TT05HTkFNRS5tYXRjaCgn54mH5q61JykpIHJldHVybiBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGltZywgcmlkID0gXy5NVVNJQ1JJRC5zcGxpdCgnXycpWzFdICsgJyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy53ZWJfYWxidW1waWNfc2hvcnQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcgPSBcXFwiaHR0cHM6Ly9pbWcyLmt1d28uY24vc3Rhci9hbGJ1bWNvdmVyL1xcXCIgKyBfLndlYl9hbGJ1bXBpY19zaG9ydC5yZXBsYWNlKC9eMTIwLywgJzUwMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcgPSBmZXRjaCgnaHR0cDovL2FydGlzdHBpY3NlcnZlci5rdXdvLmNuL3BpYy53ZWI/dHlwZT1yaWRfcGljJnBpY3R5cGU9dXJsJnNpemU9NTAwJnJpZD0nICsgcmlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbWcgPT0gXFxcIk5PX1BJQ1xcXCIgJiYgXy53ZWJfYXJ0aXN0cGljX3Nob3J0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gXFxcImh0dHA6Ly9pbWcxLmt1d28uY24vc3Rhci9zdGFyaGVhZHMvXFxcIiArIF8ud2ViX2FydGlzdHBpY19zaG9ydC5yZXBsYWNlKC9eMTIwLywgJzUwMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLlNPTkdOQU1FICsgJyAtICcgKyBfLkFSVElTVCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnRwYXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgLy8gc3VybCgnUGxheUxpc3QnKS5tYXAoKTtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsMihcXFwicGxheWxpc3RcXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5hYnNsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wbGF5bGlzdGlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIF8uVE9UQUwgfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly9kYXRhY2VudGVyLmt1d28uY24vZC5jP2Nta2V5PXBsaXN0X3BsMjAxMiZmdD1tdXNpYyZyZXNlbmM9dXRmOCZpZHM9XFxcIiArIGtleXdvcmQpKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRsZSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBmZXRjaCgnaHR0cDovL2FydGlzdHBpY3NlcnZlci5rdXdvLmNuL3BpYy53ZWI/dHlwZT1yaWRfcGljJnBpY3R5cGU9dXJsJnNpemU9NTAwJnJpZD0nICsgXy5pZCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy50cGF5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KHBjYXBpICsgXFxcInBsYXlsaXN0L3BsYXlMaXN0SW5mbz9waWQ9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBuPTEmcm49MSZcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgZGVzOiBmdW5jdGlvbih0KSB7XFxuICAgICAgICByZXR1cm4gZXhlY3V0ZVdlYlJ1bGUoXFxcIlxcXCIsICQudG9TdHJpbmcoKHQpID0+IHtcXG4gICAgICAgICAgICBjb25zdCBCdWZmZXIgPSB7XFxuICAgICAgICAgICAgICAgIGZyb206IHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgciA9IHQubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICAgICAgZSA9IG5ldyBVaW50OEFycmF5KHIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChuID0gMDsgbiA8IHI7IG4rKylcXG4gICAgICAgICAgICAgICAgICAgICAgICBlW25dID0gdC5jaGFyQ29kZUF0KG4pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByYW5nZSA9IHQgPT4gQXJyYXkuZnJvbShuZXcgQXJyYXkodCkua2V5cygpKTtcXG4gICAgICAgICAgICBMb25nID0gdCA9PiB7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHIgPSBCaWdJbnQodCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICB0b1N0cmluZzogKCkgPT4gci50b1N0cmluZygpLFxcbiAgICAgICAgICAgICAgICAgICAgaXNOZWdhdGl2ZTogKCkgPT4gciA8IDAsXFxuICAgICAgICAgICAgICAgICAgICBub3Q6ICgpID0+IExvbmcofnIpLFxcbiAgICAgICAgICAgICAgICAgICAgbG93OiBOdW1iZXIociksXFxuICAgICAgICAgICAgICAgICAgICBvcjogdCA9PiBMb25nKHIgfCBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICAgICAgeG9yOiB0ID0+IExvbmcociBeIEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgICAgICBhbmQ6IHQgPT4gTG9uZyhyICYgQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgICAgIGVxdWFsczogdCA9PiByID09PSBCaWdJbnQodCksXFxuICAgICAgICAgICAgICAgICAgICBzaGlmdExlZnQ6IHQgPT4gTG9uZyhyIDw8IEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgICAgICBzaGlmdFJpZ2h0OiB0ID0+IExvbmcociA+PiBCaWdJbnQodCkpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIExvbmdBcnJheSA9IHQgPT4gdC5tYXAodCA9PiBMb25nKHQpKTtcXG5cXG5cXG4gICAgICAgICAgICBhcnJheUUgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICAzMSwgMCwgMSwgMiwgMywgNCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAzLCA0LCA1LCA2LCA3LCA4LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDcsIDgsIDksIDEwLCAxMSwgMTIsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMTEsIDEyLCAxMywgMTQsIDE1LCAxNiwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAxNSwgMTYsIDE3LCAxOCwgMTksIDIwLCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDE5LCAyMCwgMjEsIDIyLCAyMywgMjQsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMjMsIDI0LCAyNSwgMjYsIDI3LCAyOCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyNywgMjgsIDI5LCAzMCwgMzEsIDMwLCAtMSwgLTFcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5SVAgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICA1NywgNDksIDQxLCAzMywgMjUsIDE3LCA5LCAxLFxcbiAgICAgICAgICAgICAgICA1OSwgNTEsIDQzLCAzNSwgMjcsIDE5LCAxMSwgMyxcXG4gICAgICAgICAgICAgICAgNjEsIDUzL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gICAgICAgICAgXVxcbiAgICAgICAgICAgIGFycmF5THNNYXNrID0gTG9uZ0FycmF5KFswLCAxMDQ4NTc3LCAzMTQ1NzMxXSlcXG4gICAgICAgICAgICBhcnJheU1hc2sgPSByYW5nZSg2NCkubWFwKHQgPT4gTWF0aC5wb3coMiwgdCkpXFxuICAgICAgICAgICAgYXJyYXlNYXNrWzYzXSAqPSAtMVxcbiAgICAgICAgICAgIGFycmF5UCA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDE1LCA2LCAxOSwgMjAsIDI4LCAxMSwgMjcsIDE2LFxcbiAgICAgICAgICAgICAgICAwLCAxNCwgMjIsIDI1LCA0LCAxNywgMzAsIDksXFxuICAgICAgICAgICAgICAgIDEsIDcsIDIzLCAxMywgMzEsIDI2LCAyLCA4LFxcbiAgICAgICAgICAgICAgICAxOCwgMTIsIDI5LCA1LCAyMSwgMTAsIDMsIDI0XFxuICAgICAgICAgICAgXSlcXG4gICAgICAgICAgICBhcnJheVBDXzEgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICA1NiwgNDgsIDQwLCAzMiwgMjQsIDE2LCA4LCAwLFxcbiAgICAgICAgICAgICAgICA1NywgNDksIDQxLCAzMywgMjUsIDE3LCA5LCAxLFxcbiAgICAgICAgICAgICAgICA1OCwgNTAsIDQyLCAzNCwgMjYsIDE4LCAxMCwgMixcXG4gICAgICAgICAgICAgICAgNTksIDUxLCA0MywgMzUsIDYyLCA1NCwgNDYsIDM4LFxcbiAgICAgICAgICAgICAgICAzMCwgMjIsIDE0LCA2LCA2MSwgNTMsIDQ1LCAzNyxcXG4gICAgICAgICAgICAgICAgMjksIDIxLCAxMywgNSwgNjAsIDUyLCA0NCwgMzYsXFxuICAgICAgICAgICAgICAgIDI4LCAyMCwgMTIsIDQsIDI3LCAxOSwgMTEsIDNcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5UENfMiA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDEzLCAxNiwgMTAsIDIzLCAwLCA0LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDIsIDI3LCAxNCwgNSwgMjAsIDksIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMjIsIDE4LCAxMSwgMywgMjUsIDcsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMTUsIDYsIDI2LCAxOSwgMTIsIDEsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgNDAsIDUxLCAzMCwgMzYsIDQ2LCA1NCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyOSwgMzksIDUwLCA0NCwgMzIsIDQ3LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDQzLCA0OCwgMzgsIDU1LCAzMywgNTIsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgNDUsIDQxLCA0OSwgMzUsIDI4LCAzMSwgLTEsIC0xXFxuICAgICAgICAgICAgXSlcXG4gICAgICAgICAgICBtYXRyaXhOU0JveCA9IFtcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTQsIDQsIDMsIDE1LCAyLCAxMywgNSwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCAxNCwgNiwgOSwgMTEsIDIsIDAsIDUsXFxuICAgICAgICAgICAgICAgICAgICA0LCAxLCAxMCwgMTIsIDE1LCA2LCA5LCAxMCxcXG4gICAgICAgICAgICAgICAgICAgIDEsIDgsIDEyLCA3LCA4LCAxMSwgNywgMCxcXG4gICAgICAgICAgICAgICAgICAgIDAsIDE1LCAxMCwgNSwgMTQsIDQsIDksIDEwLFxcbiAgICAgICAgICAgICAgICAgICAgNywgOCwgMTIsIDMsIDEzLCAxLCAzLCA2LFxcbiAgICAgICAgICAgICAgICAgICAgMTUsIDEyLCA2LCAxMSwgMiwgOSwgNSwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDQsIDIsIDExLCAxNCwgMSwgNywgOCwgMTNcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTUsIDAsIDksIDUsIDYsIDEwLCAxMiwgOSxcXG4gICAgICAgICAgICAgICAgICAgIDgsIDcsIDIsIDEyLCAzLCAxMywgNSwgMixcXG4gICAgICAgICAgICAgICAgICAgIDEsIDE0LCA3LCA4LCAxMSwgNCwgMCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCAxMSwgMTMsIDYsIDQsIDEsIDEwLCAxNSxcXG4gICAgICAgICAgICAgICAgICAgIDMsIDEzLCAxMiwgMTEsIDE1LCAzLCA2LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMTAsIDEsIDcsIDgsIDQsIDExLCAxNCxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCA4LCAwLCA2LCAyLCAxNSwgOSwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDcsIDEsIDEwLCAxMiwgMTQsIDIsIDUsIDlcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTAsIDEzLCAxLCAxMSwgNiwgOCwgMTEsIDUsXFxuICAgICAgICAgICAgICAgICAgICA5LCA0LCAxMiwgMiwgMTUsIDMsIDIsIDE0LFxcbiAgICAgICAgICAgICAgICAgICAgMCwgNiwgMTMsIDEsIDMsIDE1LCA0LCAxMCxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCA5LCA3LCAxMiwgNSwgMCwgOCwgNyxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCAxLCAyLCA0LCAzLCA2LCAxMiwgMTEsXFxuICAgICAgICAgICAgICAgICAgICAwLCAxMywgNSwgMTQsIDYsIDgsIDE1LCAyLFxcbiAgICAgICAgICAgICAgICAgICAgNywgMTAsIDgsIDE1LCA0LCA5LCAxMSwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDksIDAsIDE0LCAzLCAxMCwgNywgMSwgMTJcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgNywgMTAsIDEsIDE1LCAwLCAxMiwgMTEsIDUsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgOSwgOCwgMywgOSwgNywgNCwgOCxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCA2LCAyLCAxLCA2LCAxMSwgMTIsIDIsXFxuICAgICAgICAgICAgICAgICAgICAzLCAwLCA1LCAxNCwgMTAsIDEzLCAxNSwgNCxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCAzLCA0LCA5LCA2LCAxMCwgMSwgMTIsXFxuICAgICAgICAgICAgICAgICAgICAxMSwgMCwgMiwgNSwgMCwgMTMsIDE0LCAyLFxcbiAgICAgICAgICAgICAgICAgICAgOCwgMTUsIDcsIDQsIDE1LCAxLCAxMCwgNyxcXG4gICAgICAgICAgICAgICAgICAgIDUsIDYsIDEyLCAxMSwgMywgOCwgOSwgMTRcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMiwgNCwgOCwgMTUsIDcsIDEwLCAxMywgNixcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEsIDMsIDEyLCAxMSwgNywgMTQsIDAsXFxuICAgICAgICAgICAgICAgICAgICAxMiwgMiwgNSwgOSwgMTAsIDEzLCAwLCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMSwgMTEsIDE1LCA1LCA2LCA4LCA5LCAxNCxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCAxMSwgNSwgNiwgNCwgMSwgMywgMTAsXFxuICAgICAgICAgICAgICAgICAgICAyLCAxMiwgMTUsIDAsIDEzLCAyLCA4LCA1LFxcbiAgICAgICAgICAgICAgICAgICAgMTEsIDgsIDAsIDE1LCA3LCAxNCwgOSwgNCxcXG4gICAgICAgICAgICAgICAgICAgIDEyLCA3LCAxMCwgOSwgMSwgMTMsIDYsIDNcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTIsIDksIDAsIDcsIDksIDIsIDE0LCAxLFxcbiAgICAgICAgICAgICAgICAgICAgMTAsIDE1LCAzLCA0LCA2LCAxMiwgNSwgMTEsXFxuICAgICAgICAgICAgICAgICAgICAxLCAxNCwgMTMsIDAsIDIsIDgsIDcsIDEzLFxcbiAgICAgICAgICAgICAgICAgICAgMTUsIDUsIDQsIDEwLCA4LCAzLCAxMSwgNixcXG4gICAgICAgICAgICAgICAgICAgIDEwLCA0LCA2LCAxMSwgNywgOSwgMCwgNixcXG4gICAgICAgICAgICAgICAgICAgIDQsIDIsIDEzLCAxLCA5LCAxNSwgMywgOCxcXG4gICAgICAgICAgICAgICAgICAgIDE1LCAzLCAxLCAxNCwgMTIsIDUsIDExLCAwLFxcbiAgICAgICAgICAgICAgICAgICAgMiwgMTIsIDE0LCA3LCA1LCAxMCwgOCwgMTNcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgNCwgMSwgMywgMTAsIDE1LCAxMiwgNSwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDIsIDExLCA5LCA2LCA4LCA3LCA2LCA5LFxcbiAgICAgICAgICAgICAgICAgICAgMTEsIDQsIDEyLCAxNSwgMCwgMywgMTAsIDUsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgMTMsIDcsIDgsIDEzLCAxNCwgMSwgMixcXG4gICAgICAgICAgICAgICAgICAgIDEzLCA2LCAxNCwgOSwgNCwgMSwgMiwgMTQsXFxuICAgICAgICAgICAgICAgICAgICAxMSwgMTMsIDUsIDAsIDEsIDEwLCA4LCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMCwgMTEsIDMsIDUsIDksIDQsIDE1LCAyLFxcbiAgICAgICAgICAgICAgICAgICAgNywgOCwgMTIsIDE1LCAxMCwgNywgNiwgMTJcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTMsIDcsIDEwLCAwLCA2LCA5LCA1LCAxNSxcXG4gICAgICAgICAgICAgICAgICAgIDgsIDQsIDMsIDEwLCAxMSwgMTQsIDEyLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgMiwgMTEsIDksIDYsIDE1LCAxMiwgMCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEsIDE0LCAxMywgMSwgMiwgNywgOCxcXG4gICAgICAgICAgICAgICAgICAgIDEsIDIsIDEyLCAxNSwgMTAsIDQsIDAsIDMsXFxuICAgICAgICAgICAgICAgICAgICAxMywgMTQsIDYsIDksIDcsIDgsIDksIDYsXFxuICAgICAgICAgICAgICAgICAgICAxNSwgMSwgNSwgMTIsIDMsIDEwLCAxNCwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDgsIDcsIDExLCAwLCA0LCAxMywgMiwgMTFcXG4gICAgICAgICAgICAgICAgXVxcbiAgICAgICAgICAgIF1cXG4gICAgICAgICAgICBiaXRUcmFuc2Zvcm0gPSAodCwgciwgZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgbiA9IExvbmcoMCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiByYW5nZShyKS5mb3JFYWNoKHIgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdFtyXS5pc05lZ2F0aXZlKCkgfHwgZS5hbmQoYXJyYXlNYXNrW3Rbcl0ubG93XSkuZXF1YWxzKDApIHx8IChuID0gbi5vcihhcnJheU1hc2tbcl0pKVxcbiAgICAgICAgICAgICAgICB9KSwgblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBERVM2NCA9ICh0LCByKSA9PiB7XFxuICAgICAgICAgICAgICAgIGUgPSBbXSxcXG4gICAgICAgICAgICAgICAgICAgIG4gPSBbXTtcXG4gICAgICAgICAgICAgICAgZiA9IGJpdFRyYW5zZm9ybShhcnJheUlQLCA2NCwgcik7XFxuICAgICAgICAgICAgICAgIHJldHVybiBuWzBdID0gZi5hbmQoNDI5NDk2NzI5NSksXFxuICAgICAgICAgICAgICAgICAgICBuWzFdID0gZi5hbmQoLTQyOTQ5NjcyOTYpLnNoaWZ0UmlnaHQoMzIpLFxcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2UoMTYpLmZvckVhY2gociA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGYgPSBMb25nKDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBMb25nKG5bMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gYml0VHJhbnNmb3JtKGFycmF5RSwgNjQsIGkpLnhvcih0W3JdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2UoOCkuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVbdF0gPSBpLnNoaWZ0UmlnaHQoOCAqIHQpLmFuZCgyNTUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5nZSg4KS5yZXZlcnNlKCkuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBmLnNoaWZ0TGVmdCg0KS5vcihtYXRyaXhOU0JveFt0XVtlW3RdXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBiaXRUcmFuc2Zvcm0oYXJyYXlQLCAzMiwgZiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSBMb25nKG5bMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuWzBdID0gTG9uZyhuWzFdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgblsxXSA9IG8ueG9yKGkpXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIG4ucmV2ZXJzZSgpLFxcbiAgICAgICAgICAgICAgICAgICAgZiA9IG5bMV0uc2hpZnRMZWZ0KDMyKS5hbmQoLTQyOTQ5NjcyOTYpLm9yKG5bMF0uYW5kKDQyOTQ5NjcyOTUpKSxcXG4gICAgICAgICAgICAgICAgICAgIGYgPSBiaXRUcmFuc2Zvcm0oYXJyYXlJUF8xLCA2NCwgZilcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3ViS2V5cyA9ICh0LCByKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBuID0gYml0VHJhbnNmb3JtKGFycmF5UENfMSwgNTYsIHQpO1xcbiAgICAgICAgICAgICAgICByYW5nZSgxNikuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIG4gPSBuLmFuZChhcnJheUxzTWFza1thcnJheUxzW3RdXSkuc2hpZnRMZWZ0KDI4IC0gYXJyYXlMc1t0XSkub3Iobi5hbmQoYXJyYXlMc01hc2tbYXJyYXlMc1t0XV0ubm90KCkpLnNoaWZ0UmlnaHQoYXJyYXlMc1t0XSkpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJbdF0gPSBiaXRUcmFuc2Zvcm0oYXJyYXlQQ18yLCA2NCwgbilcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYiA9IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgY29uc3QgciA9IEJ1ZmZlci5mcm9tKFxcXCJ5bHpzeGt3bVxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgbiA9IExvbmcoMCk7XFxuICAgICAgICAgICAgICAgIHJhbmdlKDgpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBuID0gTG9uZyhyW3RdKS5zaGlmdExlZnQoOCAqIHQpLm9yKG4pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjb25zdCBvID0gTWF0aC5mbG9vcih0Lmxlbmd0aCAvIDgpLFxcbiAgICAgICAgICAgICAgICAgICAgaSA9IHJhbmdlKDE2KS5tYXAoKCkgPT4gTG9uZygwKSk7XFxuICAgICAgICAgICAgICAgIHN1YktleXMobiwgaSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IGYgPSByYW5nZShvKS5tYXAoKCkgPT4gTG9uZygwKSk7XFxuICAgICAgICAgICAgICAgIHJhbmdlKG8pLmZvckVhY2gociA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByYW5nZSg4KS5mb3JFYWNoKGUgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZbcl0gPSBMb25nKHRbZSArIDggKiByXSkuc2hpZnRMZWZ0KDggKiBlKS5vcihmW3JdKVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHMgPSBbXTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UobykuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNbdF0gPSBERVM2NChpLCBmW3RdKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgY29uc3QgdSA9IHQuc2xpY2UoOCAqIG8pO1xcbiAgICAgICAgICAgICAgICBsZXQgaCA9IExvbmcoMCk7XFxuICAgICAgICAgICAgICAgIHJhbmdlKHQubGVuZ3RoICUgOCkuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGggPSBMb25nKHVbdF0pLnNoaWZ0TGVmdCg4ICogdCkub3IoaClcXG4gICAgICAgICAgICAgICAgfSksIHNbb10gPSBERVM2NChpLCBoKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgYSA9IFtdO1xcbiAgICAgICAgICAgICAgICBsZXQgYyA9IDA7XFxuICAgICAgICAgICAgICAgIHJldHVybiBzLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgIC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xuICAgICAgICAgICAgXy50YWdzLm1hcChfXyA9PlxcbiAgICAgICAgICAgICAgICBpVGFnW18udGFnTmFtZV1bX18udGFnTmFtZV0gPSBpVGFnW1xcXCLmjqjojZBcXFwiXVtcXFwi5pyA5paw5q2M5Y2VXFxcIl0gKyBfXy50YWdJZFxcbiAgICAgICAgICAgICk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdID0ge307XFxuICAgICAgICBhamF4KFxcXCJiaWxsYm9hcmQvdHJlZVxcXCIpLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoIS/kuZDCt+amnC8udGVzdChfLmNvbHVtblRpdGxlKSkge1xcbiAgICAgICAgICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXVtfLmNvbHVtblRpdGxlXSA9IF8uYmlsbEJvYXJkVm9zLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLmNvbHVtblRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8uY29sdW1uU21hbGxQaWMsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wYXRoTmFtZVxcbiAgICAgICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwibWdfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBsZXQgbGlzdCwgXztcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDor6bmg4VcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwibWc/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4MihcXFwiMlxcXCIsIHQxLCBcXFwiY29weXJpZ2h0SWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IGYgPSBfLmNvZGVSYXRlO1xcblxcbiAgICAgICAgICAgICAgICAvLyDkuIvovb1cXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gW107XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdCA9IF8ubmV3UmF0ZUZvcm1hdHM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5QUSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSArIFNpemUodFswXS5zaXplIHx8IHRbMF0uYW5kcm9pZFNpemUgfHwgdFswXS5pb3NTaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5IUSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUodFsxXS5zaXplIHx8IHRbMV0uYW5kcm9pZFNpemUgfHwgdFsxXS5pb3NTaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5TUSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUodFsyXS5zaXplIHx8IHRbMl0uYW5kcm9pZFNpemUgfHwgdFsyXS5pb3NTaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5aUSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1s0XSArIFNpemUodFszXS5zaXplIHx8IHRbM10uYW5kcm9pZFNpemUgfHwgdFszXS5pb3NTaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgdDEsIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwiZG93blxcXCIsIFxcXCJtZ1xcXCIsIHQxLCBpLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCB0MSwgXyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHZhciB1cmwsIGlpLCBscmMgPSBfLmxyY1VybDtcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5aUSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwibWdcXFwiLCB0MSwgMywgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJzE6ICcgKyBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLlNRKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJtZ1xcXCIsIHQxLCAyLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnMjogJyArIGlpICsgJzonICsgdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLkhRKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJtZ1xcXCIsIHQxLCAxLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udmlwVHlwZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcIm1nXFxcIiwgdDEsIDAsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9tLm11c2ljLm1pZ3UuY24vbWlndS9yZW1vdGluZy9jbXNfZGV0YWlsX3RhZz9jcGlkPVxcXCIgKyB0MSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly9tLm11c2ljLm1pZ3UuY24vdjMvXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gX18ubHlyaWNMcmMgfHwgbHJjO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBfXy5saXNRcSB8fCBfXy5saXN0ZW5Vcmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghdXJsKSByZXR1cm4gXFxcInRvYXN0Oi8v5peg5rOV6Kej5p6QXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5q2M6K+NXFxuICAgICAgICAgICAgICAgIGlmICghbHJjKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vbXVzaWMubWlndS5jbi92My9hcGkvbXVzaWMvYXVkaW9QbGF5ZXIvZ2V0THlyaWM/Y29weXJpZ2h0SWQ9XFxcIiArIHQxLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly9hcHAuYy5uZi5taWd1LmNuL1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5seXJpYztcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g6aaW6aG1XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHVyaSk7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBfLml0ZW1zIHx8IF9bMF0uaXRlbXM7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSB8fCBfLnRpdGxlIHx8IF8ucGxheUxpc3ROYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyB8fCBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWQgfHwgXy5wbGF5TGlzdElkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIF8udG90YWwgfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGVuID0gYWpheChgcGxheWxpc3QvaW5mbz9zb25nTGlzdElkPSR7dDF9YCkuY29udGVudENvdW50O1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoYHBsYXlsaXN0L3NvbmdzSW5mbz9wYWx5bGlzdElkPSR7dDF9YCwgbGVuKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIF8gPSB7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtczogW11cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBfID0gYWpheChgYmlsbGJvYXJkL2hvbWU/cGF0aE5hbWU9JHt0MX1gKS5zb25ncztcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodDIpIHJldHVybiBfLml0ZW1zO1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5pdGVtcy5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgaWYgKF8uZnVsbFNvbmcpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLnNpbmdlcnMgPyAnIC0gJyArIF8uc2luZ2Vycy5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6ICcnKSxcXG4gICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8ubWVkaXVtUGljLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBfLmZ1bGxTb25nLnZpcEZsYWcsXFxuICAgICAgICAgICAgICAgIHp5aWQ6IF8uY29weXJpZ2h0SWRcXG4gICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBpc1UpIHtcXG4gICAgICAgIGxldCBfO1xcbiAgICAgICAgaWYgKGlzVSAhPSBcXFwidXJsXFxcIikge1xcbiAgICAgICAgICAgIGxldCBsaXN0LCBfXyA9IHtcXG4gICAgICAgICAgICAgICAgbGliOiAoXykgPT4gdHJ1ZSxcXG4gICAgICAgICAgICAgICAgcGFpZDogKF8pID0+IF8uZnVsbFNvbmcudmlwRmxhZyA9PSAnMScsXFxuICAgICAgICAgICAgICAgIGZyZWU6IChfKSA9PiBfLmZ1bGxTb25nLnZpcEZsYWcgPT0gJzAnXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBsZXQgc3VybCA9IChzdHlwZSwgZXJyaSkgPT4ge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFqYXgoXFxcInNlYXJjaC9cXFwiICsgc3R5cGUgKyBcXFwiP3RleHQ9XFxcIiArIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJpIDwgMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdXJsKHN0eXBlLCBlcnJpICsgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwoJ3NvbmcnLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLml0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmZ1bGxTb25nICYmIF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLnNpbmdlcnMgPyAnIC0gJyArIF8uc2luZ2Vycy5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6ICcnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8ubWVkaXVtUGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLmZ1bGxTb25nLnZpcEZsYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uY29weXJpZ2h0SWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybCgnc29uZ0xpc3QnLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLml0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm1nP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIjJcXFwiLCBrZXl3b3JkKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5zaW5nZXIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmFsYnVtSW1nc1swXS5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy52aXBUeXBlID8gMSA6IDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5jb3B5cmlnaHRJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoYHBsYXlsaXN0L2luZm8/c29uZ0xpc3RJZD0ke2tleXdvcmR9YCk7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ucGxheUxpc3ROYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ucGxheUxpc3RJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIDA7XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIGFqYXg6IGFqYXgsXFxuICAgIGFqYXgyOiBmdW5jdGlvbihyZXNvdXJjZVR5cGUsIHJlc291cmNlSWQsIGNvcHlyaWdodElkKSB7IC8vIGMubXVzaWNhcHAubWlndS5jblxcbiAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly9hcHAuYy5uZi5taWd1LmNuL01JR1VNMi4wL3YxLjAvY29udGVudC9yZXNvdXJjZWluZm8uZG8/bmVlZFNpbXBsZT0wMSZyZXNvdXJjZVR5cGU9XFxcIiArIHJlc291cmNlVHlwZSArIFxc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XCIpLm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgIHQyID0gcGRmaChpdCwgXFxcImEmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgaVRhZ1t0MV1bdDJdID0gdDI7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXSA9IHt9O1xcbiAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bXFxcIuWFqOmDqFxcXCJdID0gYWpheChcXFwicmFuay9saXN0XFxcIilcXG4gICAgICAgICAgICAubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IF8ucGhvdG9CaWcgfHwgXy5waG90byxcXG4gICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW1xcXCLliIbljLpcXFwiXSA9IFtcXFwi5Y+k6aOOXFxcIiwgXFxcIua1geihjFxcXCIsIFxcXCLmrKfnvo5cXFwiLCBcXFwi5pel6K+tXFxcIiwgXFxcIuawkeiwo1xcXCIsIFxcXCLliqjmvKsv5ri45oiPXFxcIiwgXFxcIuaRh+a7mlxcXCIsIFxcXCLlvbHop4ZcXFwiLCBcXFwi55S15a2QXFxcIiwgXFxcIuawkeaXj1xcXCIsIFxcXCLlub/mkq3liadcXFwiLCBcXFwiSElQLUhPUFxcXCJdXFxuICAgICAgICAgICAgLm1hcChuYW1lID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogbnVsbCxcXG4gICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgenlpZDogbmFtZVxcbiAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCI1c19pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIGxldCBsaXN0LCBfO1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOatjOabsuivpuaDhVxcbiAgICAgICAgICAgICAgICBbdDEsIHR5cGVdID0gdDEuc3BsaXQoJyMnKTtcXG4gICAgICAgICAgICAgICAgbGV0IGdldE11c2ljSW5mbyA9IHVUeXBlID0+IGFqYXgoYHNvbmcvJHt1VHlwZX0/c29uZ2lkPSR7dDF9JnNvbmd0eXBlPSR7dHlwZX1gKTtcXG4gICAgICAgICAgICAgICAgXyA9IGdldE11c2ljSW5mbyhcXFwiZ2V0U29uZ1VybFxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyID0gW107XFxuICAgICAgICAgICAgICAgIGxldCBhcnIyID0gW107XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8ubHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0gKyBTaXplKF8ubHFzaXplKSksIGFycjIucHVzaChfLmxxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLmhxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdICsgU2l6ZShfLmhxc2l6ZSkpLCBhcnIyLnB1c2goXy5ocXVybCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXy5zcXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUoXy5zcXNpemUpKSwgYXJyMi5wdXNoKF8uc3F1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIGFycjIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgYXJyMltpXTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgYXJyMik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8g5q2M6K+NXFxuICAgICAgICAgICAgICAgIHZhciB0eXBlMiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHljOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgZmM6IDIsXFxuICAgICAgICAgICAgICAgICAgICBiejogM1xcbiAgICAgICAgICAgICAgICB9W3R5cGVdO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gYGh0dHA6Ly9zZXJ2aWNlLjVzaW5nLmt1Z291LmNvbS9zb25nL2RldGFpbD9zb25nSWQ9JHt0MX0mc29uZ1R5cGU9JHt0eXBlMn1gO1xcbiAgICAgICAgICAgICAgICB2YXIgaWksIGxyYyA9IEpTT04ucGFyc2UoZmV0Y2hQQyh1cmwpKS5kYXRhLmx5cmljcztcXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIGxyYyA9IGdldE11c2ljSW5mbyhcXFwibmV3Z2V0XFxcIikuZHluYW1pY1dvcmRzO1xcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnNxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSksIGFycjIucHVzaChfLnNxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5ocXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0pLCBhcnIyLnB1c2goXy5ocXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ubHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzFdKSwgYXJyMi5wdXNoKF8ubHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uaHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdKSwgYXJyMi5wdXNoKF8uaHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmxxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSksIGFycjIucHVzaChfLmxxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5zcXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10pLCBhcnIyLnB1c2goXy5zcXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmxxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSksIGFycjIucHVzaChfLmxxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5ocXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0pLCBhcnIyLnB1c2goXy5ocXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uc3F1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdKSwgYXJyMi5wdXNoKF8uc3F1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lczogYXJyLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsczogYXJyMi5tYXAodSA9PiB1ICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogU3RyaW5nKGxyYykucmVwbGFjZSgvPGJyXFxcXC8/Pi9naSwgXFxcIlxcXFxuXFxcIilcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvL+mmlumhtVxcbiAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKFxcXCJodHRwOi8vNXNpbmcua3Vnb3UuY29tL2dkL2dkTGlzdD8mdGFnTmFtZT1cXFwiICsgdDEgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UpO1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShodG1sLCBcXFwiYm9keSYmLmFsYnVtXFxcIik7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdGVtLCBcXFwiLmp4X25hbWUmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbWcgPSBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHp5aWQgPSBwZGZoKGl0ZW0sIFxcXCJhLDEmJnNvbmdsaXN0aWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiB6eWlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gKE1ZX1BBR0UgLSAxKSAqIDE2ICsgbGlzdC5sZW5ndGg7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoXFxcInNvbmcvZ2V0c29uZ2xpc3Rzb25nP2lkPVxcXCIgKyB0MSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBfID0gW107XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgaWYgKHQxID09IFxcXCJsaXN0MjVcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgdXJpID0gXFxcInNvbmdsaXN0L2hvdHN1cHBvcnRyYW5rbGlzdD9wYWdlPVxcXCI7XFxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHQxID09IFxcXCJ5Y1xcXCIgfHwgdDEgPT0gXFxcImZjXFxcIiB8fCB0MSA9PSBcXFwibGlzdDIzXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHVyaSA9IFxcXCJyYW5rL2RldGFpbD9pZD1cXFwiICsgdDEgKyBcXFwiJnBhZ2VpbmRleD1cXFwiO1xcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICB1cmkgPSBcXFwicmFuay9zdHlsZXJhbms/c3R5bGU9XFxcIiArIHQxICsgXFxcIiZwYWdlaW5kZXg9XFxcIjtcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgodXJpICsgTVlfUEFHRSArIFxcXCImcGFnZVNpemU9MzBcXFwiKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodDIpIHJldHVybiBfLnNvbmdzIHx8IF87XFxuICAgICAgICBkID0gW107XFxuICAgICAgICAoXy5zb25ncyB8fCBfKS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgaWYgKF8uU1QgPT0gdW5kZWZpbmVkIHx8IF8uU1QgPiAwKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAoXy5zb25nTmFtZSB8fCBfLlNOKSArICcgLSAnICsgKF8ubmlja25hbWUgfHwgXy51c2VyLk5OKSxcXG4gICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlIHx8IChfLnVzZXIgPyBfLnVzZXIuSSA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgY29udGVudDogXy5zb25nS2luZCB8fCBfLlNLLFxcbiAgICAgICAgICAgICAgICB6eWlkOiAoXy5zb25nSWQgfHwgXy5JRCkgKyAnIycgKyAoXy5zb25nS2luZCB8fCBfLlNLKVxcbiAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIGlzVSkge1xcbiAgICAgICAgbGV0IF87XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgbGV0IGxpc3QsIGZpbHRlciA9IHtcXG4gICAgICAgICAgICAgICAgbGliOiAwLFxcbiAgICAgICAgICAgICAgICB5YzogMSxcXG4gICAgICAgICAgICAgICAgZmM6IDIsXFxuICAgICAgICAgICAgICAgIGJ6OiAzXFxuICAgICAgICAgICAgfVtpc1VdO1xcbiAgICAgICAgICAgIGxldCBzdXJsID0gKHN0eXBlKSA9PiBKU09OLnBhcnNlKGZldGNoUEMoXFxcImh0dHA6Ly9zZWFyY2guNXNpbmcua3Vnb3UuY29tL2hvbWUvanNvbj9rZXl3b3JkPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZzb3J0PTEmcGFnZT1cXFwiICsgTVlfUEFHRSArIFxcXCImZmlsdGVyPVxcXCIgKyBmaWx0ZXIgKyBcXFwiJnR5cGU9XFxcIiArIHN0eXBlKSk7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsKCcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywgSlNPTi5wYXJzZShmZXRjaFBDKGBodHRwOi8vc2VydmljZS41c2luZy5rdWdvdS5jb20vc29uZy9kZXRhaWw/c29uZ0lkPSR7Xy5zb25nSWR9JnNvbmdUeXBlPSR7Xy50eXBlfWApKS5kYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdOYW1lICsgJyAtICcgKyBfLm5pY2tOYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8udHlwZUVuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdJZCArICcjJyArIF8udHlwZUVuYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwoJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLmxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljdHVyZVVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ0xpc3RJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLnBhZ2VJbmZvLnRvdGFsQ291bnQ7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIFt0MSwgdDJdID0ga2V5d29yZC5zcGxpdCgnIycpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHQzID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHljOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZjOiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJ6OiAzXFxuICAgICAgICAgICAgICAgICAgICB9W3QyXTtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoUEMoYGh0dHA6Ly9zZXJ2aWNlLjVzaW5nLmt1Z291LmNvbS9zb25nL2RldGFpbD9zb25nSWQ9JHt0MX0mc29uZ1R5cGU9JHt0M31gKSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5uaWNrTmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogdDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDoga2V5d29yZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoXFxcInNvbmcvZ2V0c29uZ2xpc3Q/aWQ9XFxcIiArIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLlQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLlAgfHwgXy51c2VyLmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLklEXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICA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ICB9KSk7XFxuICAgIF8uZGF0YS5jb2RlID0gXy5jb2RlO1xcbiAgICBfLmRhdGEubXNnID0gXy5tc2c7XFxuICAgIHJldHVybiBfLmRhdGE7XFxufVxcbiQuZXhwb3J0cyA9IHtcXG5cXG4gICAgaVRhZzogZnVuY3Rpb24oKSB7XFxuICAgICAgICAvKiDkuI3og73op6PmnpB3eeatjOWNleS6hlxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ3d5P3J1bGU95q2M6K+N6YCC6YWNJykuaVRhZygxKTtcXG4gICAgICAgICAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bXFxcIuWFqOmDqFxcXCJdID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgoXFxcInRvcGxpc3Q/XFxcIikubGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgKi9cXG4gICAgICAgIGxldCBhcnIgPSBcXFwiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVojXFxcIi5zcGxpdChcXFwiXFxcIik7XFxuICAgICAgICBhcnIudW5zaGlmdChcXFwi5o6o6I2QXFxcIik7XFxuICAgICAgICBhcnIubWFwKCh0LCBpKSA9PiB7XFxuICAgICAgICAgICAgaVRhZ1t0XSA9IHt9O1xcbiAgICAgICAgICAgIGlUYWdbdF1bXFxcIk15RnJlZU1QM1xcXCJdID0gU3RyaW5nKGkpO1xcbiAgICAgICAgfSlcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJteV9pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDor6bmg4VcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gW3RzWzBdICsgOTYsIHRzWzFdICsgMTI4LCB0c1syXSArIDMyMCwgdHNbM10gKyAyMDAwXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0MiA9IGlucHV0LnNwbGl0KCfjgJEnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBhamF4KFxcXCJsaW5rXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHk6IHQyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZShmZXRjaCh1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5oZWFkZXJzLmxvY2F0aW9uWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBpaSwgbHJjID0gYWpheChcXFwibHlyaWNcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogdDFcXG4gICAgICAgICAgICAgICAgfSkubHJjO1xcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIgPSBbMjAwMCwgMzIwLCAxMjgsIDk2XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9IFszMjAsIDEyOCwgOTYsIDIwMDBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gWzEyOCwgMzIwLCAyMDAwLCA5Nl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9IFs5NiwgMTI4LCAzMjAsIDIwMDBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBuYW1lcyA9IFtdO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJscyA9IGFyci5tYXAoKHF1YWxpdHksIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzW2ldID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIDk2OiB0c1swXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAxMjg6IHRzWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDMyMDogdHNbMl0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgMjAwMDogdHNbM11cXG4gICAgICAgICAgICAgICAgICAgIH1bcXVhbGl0eV07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWpheChcXFwibGlua1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eTogcXVhbGl0eSArICcnXFxuICAgICAgICAgICAgICAgICAgICB9KSArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogdXJscyxcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzOiBuYW1lcyxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvL+mmlumhtVxcbiAgICAgICAgICAgICAgICAvKlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0MS5tYXRjaCgvXFxcXD8vKSkgdDEgPSBcXFwidG9wL3BsYXlsaXN0P2NhdD1cXFwiICsgdDEgKyBcXFwiJlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgodDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKF8ucmVzdWx0IHx8IF8ucGxheWxpc3RzKS5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwgfHwgXy5waWNVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICovXFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJhcnRpc3QvbGlzdFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGluaXRpYWw6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZTogTVlfUEFHRVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdCB8fCBbXTtcXG4gICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyB8fCAnaGlrZXI6Ly9pbWFnZXMvcnVsZV90eXBlX2F1ZGlvJyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsIC8vIDJcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gKE1ZX1BBR0UgLSAxKSAqIDkwICsgbGlzdC5sZW5ndGg7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSlcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJzZWFyY2gvcGxheWxpc3RcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJkXFxcIiArIHQxXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0OiBbXVxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoXFxcImFydGlzdFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogdDFcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBfID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3Q6IFtdXFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmKHQyKXJldHVybiBfLmxpc3Q7XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLmxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAoXy5hcnRpc3QgPyAnIC0gJyArIF8uYXJ0aXN0Lm1hcChfID0+IF8ubmFtZSkuam9pbignJicpIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGltZzogXy5waWMgfHwgKF8uYWxidW0gJiYgXy5hbGJ1bS5waWMgPyBfLmFsYnVtLnBpYyA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBjb250ZW50OiAnd3knLFxcbiAgICAgICAgICAgIHp5aWQ6IF8uaGFzaCB8fCBfLmlkXFxuICAgICAgICB9LCAxKSk7XFxuICAgICAgICBpZiAoXy5saXN0Lmxlbmd0aCA9PSAwICYmIF8ubmFtZSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgIGRlc2M6IF8uZGVzY3JpcHRpb24sXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIHN0eXBlLCBpc05ldykge1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICBsZXQgc3R5cGUgPSBzdHlwZSB8fCAnd3knO1xcbiAgICAgICAgICAgICAgICBsZXQgc3R5cGUyID0ge1xcbiAgICAgICAgICAgICAgICAgICAgJ3d5JzogJ1lRRCcsXFxuICAgICAgICAgICAgICAgICAgICAna3cnOiAnWVFCJyxcXG4gICAgICAgICAgICAgICAgICAgICdtZyc6IGlzTmV3ID8gJ1lRTScgOiAnbWlndScsXFxuICAgICAgICAgICAgICAgICAgICAnMXQnOiAnMXRpbmcnLFxcbiAgICAgICAgICAgICAgICAgICAgJ2RiJzogJ2RvdWJhbicsXFxuICAgICAgICAgICAgICAgICAgICAnNXknOiAnd3VzaW5neWMnLFxcbiAgICAgICAgICAgICAgICAgICAgJzVmJzogJ3d1c2luZ2ZjJ1xcbiAgICAgICAgICAgICAgICB9W3N0eXBlXTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaXN0LCBib2R5LCBfLCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNOZXcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gYWpheCgnc2VhcmNoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBzdHlwZTIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IE1ZX1BBR0UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHY6ICdiZXRhJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLmxpc3QgfHwgW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAoXy5hcnRpc3QgPyAnIC0gJyArIF8uYXJ0aXN0Lm1hcChfID0+IF8ubmFtZSkuam9pbignJicpIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljIHx8IF8uYWxidW0ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBzdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5oYXNoIHx8IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gXFxcInRleHQ9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnR5cGU9XFxcIiArIHN0eXBlMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gJC5yZXF1aXJlKFxcXCJteT9ydWxlPeatjOivjemAgumFjVxcXCIpLm9sZF9lbmNvZGUoYm9keSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoJ3NlYXJjaCcsIGJvZHksIFxcXCJodHRwOi8vYXBpMlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLmxpc3QgfHwgW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExhenkoJ215JywgXy5pZClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy51cmxfbTRhKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKF8udXJsX200YSArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0c1swXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnVybF8xMjgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfMTI4ICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRzWzFdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsXzMyMClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaChfLnVybF8zMjAgKyAnI2lzTXVzaWM9dHJ1ZSMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2godHNbMl0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy51cmxfZmxhYylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaChfLnVybF9mbGFjICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRzWzNdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXIgfHwgXy5waWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBzdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IHVybHMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogbmFtZXMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBseXJpYzogXy5scmNcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5sZW5ndGggPT0gMCAmJiBfLmNvZGUgPT0gNDAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubXNnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBfLmNvZGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnvZHnu5zlvILluLjvvIzmkJzntKLlpLHotKVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGUudG9TdHJpbmcoKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwid3k/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZWFyY2goMSwga2V5d29yZCwgMSkubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIG5ld190b2tlbjogZnVuY3Rpb24oYm9keSkge1xcbiAgICAgICAgW3QsIGUsIEFzXSA9IFtcXG4gICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgIFxcXCIyMDIzMDMyNy5cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwieUd6NG45WEU5eFl5Mk9qNVViN0U2dTlhNXA1YUlXWlllNTNPcnE1d0U1VWduamJXcTA0MTBXVHZtTEJPMVoyTlxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJwVzhqZy9ta2U2Y08xRjRDVHVhaXN3aFpmUUd6TXlxNU5KUkxQVkl2RHhsQTc9RTNZclNVb0gwYjJCWEtuOXRkK1xcXCJcXG4gICAgICAgICAgICBdLFxcbiAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgXFxcIjIwMjIxMjIyLlxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJIMmh1dXdYZjh3TjlDeDVLM2xFUWtkZzRWVENKcUliNDQwUVFYOTVPUXllMUQwOTIyOTJCSTZyZ2pGZ0s5bWN4XFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIlFzVm10NHJwcVBGSnlXY2cxWS9TUkF1TE1UZWRCMzc1WFpORGxPR3hqNmIydmFuOT1DOFVoSEtFK3dpZklrb3owXFxcIlxcbiAgICAgICAgICAgIF1cXG4gICAgICAgIF1bMF07XFxuICAgICAgICB2YXIgYSwgYiwgYywgZCxcXG4gICAgICAgICAgICB2ID0gMCxcXG4gICAgICAgICAgICB0ayA9IFxcXCJcXFwiO1xcbiAgICAgICAgdmFyIGUgPSBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoYm9keSkpLnNwbGl0KFxcXCJcXFwiKVxcbiAgICAgICAgICAgIC5tYXAoKHQsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHQuY2hhckNvZGVBdCgwKSBeIGUuY2hhckNvZGVBdChNYXRoLmZsb29yKGkgJSA2NCkpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIHZhciBpID0gZS5sZW5ndGggJSAzXFxuICAgICAgICBkbyB7XFxuICAgICAgICAgICAgYSA9IGVbdisrXVxcbiAgICAgICAgICAgIGIgPSBlW3YrK11cXG4gICAgICAgICAgICBjID0gZVt2KytdXFxuICAgICAgICAgICAgZCA9IGEgPDwgMTYgfCBiIDw8IDggfCBjXFxuICAgICAgICAgICAgYSA9IGQgPj4gMTggJiA2M1xcbiAgICAgICAgICAgIGIgPSBkID4+IDEyICYgNjNcXG4gICAgICAgICAgICBjID0gZCA+PiA2ICYgNjNcXG4gICAgICAgICAgICBkID0gZCAmIDYzXFxuICAgICAgICAgICAgdGsgKz0gQXMuY2hhckF0KGEpICsgQXMuY2hhckF0KGIpICsgQXMuY2hhckF0KGMpICsgQXMuY2hhckF0KGQpXFxuICAgICAgICB9IHdoaWxlICh2IDwgZS5sZW5ndGgpXFxuICAgICAgICByZXR1cm4gdCArIG1kNShpID09IDAgPyB0ayA6IHRrLnNsaWNlKDAsIGkgLSAzKSArICc9PT0nLnNsaWNlKGkgfHwgMykpXFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIG9sZF9lbmNvZGU6IGZ1bmN0aW9uKGUpIHtcXG4gICAgICAgIHZhciBwID0gbWQ1KFxcXCI8RzZzWCxMa35eMjpZJTRaXFxcIik7XFxuICAgICAgICB2YXIgYSA9IG1kNShwLnN1YnN0cigxNiwgMzIpKTtcXG4gICAgICAgIHZhciB0ID0gbmV3IERhdGUoKS5nZXRUaW1lKCkgLyAxMDAwICsgODY0MDAgPj4gMDtcXG4gICAgICAgIHZhciB0ID0gdCArIG1kNShlICsgYSkuc3Vic3RyKDAsIDE2KSArIGU7XFxuICAgICAgICB2YXIgRSA9IGUgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciBSNCA9IFIoNCk7XFxuICAgICAgICBmb3IgKGxldCBpIGluIHQpIHtcXG4gICAgICAgICAgICBpID0gdC5jaGFyQ29kZUF0KGkpXFxuICAgICAgICAgICAgaWYgKGkgPCAxMjgpIHtcXG4gICAgICAgICAgICAgICAgZSArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGkpXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgZSArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGkgPj4gMTIgfCAyMjQpXFxuICAgICAgICAgICAgICAgIGUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShpID4+IDYgJiA2MyB8IDEyOClcXG4gICAgICAgICAgICAgICAgZSArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGkgJiA2MyB8IDEyOClcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgYSA9IG1kNShwLnN1YnN0cigwLCAxNikpO1xcbiAgICAgICAgdmFyIGEgPSBhICsgbWQ1KGEgKyBSNCk7XFxuICAgICAgICB2YXIgcCA9IFtdO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAyNTY7IGkrKykgcFtpXSA9IGk7XFxuICAgICAgICB2YXIgSSA9IGIgPSBjID0gdCA9IDA7XFxuICAgICAgICBmb3IgKGxldCBpIGluIHApIHtcXG4gICAgICAgICAgICBJID0gKEkgKyBwW2ldICsgYVtpICUgNjRdLmNoYXJDb2RlQXQoKSkgJSAyNTZcXG4gICAgICAgICAgICBYID0gcFtpXVxcbiAgICAgICAgICAgIHBbaV0gPSBwW0ldXFxuICAgICAgICAgICAgcFtJXSA9IFhcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGkgaW4gZSkge1xcbiAgICAgICAgICAgIEkgPSBOdW1iZXIoaSkgKyAxO1xcbiAgICAgICAgICAgIFggPSBwW0ldO1xcbiAgICAgICAgICAgIGIgPSAoYiArIFgpICUgMjU2O1xcbiAgICAgICAgICAgIHBbSV0gPSBwW2JdO1xcbiAgICAgICAgICAgIHBbYl0gPSBYO1xcbiAgICAgICAgICAgIEUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShcXG4gICAgICAgICAgICAgICAgZVtpXS5jaGFyQ29kZUF0KCkgXlxcbiAgICAgICAgICAgICAgICBwWyhwW0ldICsgcFtiXSkgJSAyNTZdXFxuICAgICAgICAgICAgKTtcXG4gICAgICAgIH1cXG4gIC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TljNGM4YzNhNzgxYzMwODQ1ZlxcXCIpO1xcbiAgICBsZXQgdSA9IGBodHRwczovL211c2ljLjkxcS5jb20vdjEvJHt1cml9P2AgKyBib2R5O1xcbiAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaCh1KSkuZGF0YTtcXG59XFxuXFxuZnVuY3Rpb24gc2VhcmNoKHBsYXRmb3JtLCBrZXl3b3JkLCBwbGF0Zm9ybTIsIHJ1bikge1xcbiAgICBsZXQgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgIGNhc2UgJzAnOlxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtMikpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnenonOiAvLyDlpLHmlYhcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly96ejEyMy5jb20nO1xcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShwb3N0KHUgKyAnL2FqYXgvJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IFxcXCJhY3Q9c2VhcmNoJmtleT1cXFwiICsga2V5d29yZCArIFxcXCImbGFuZz0mcGFnZT1cXFwiICsgTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm1uYW1lICsgJyAtICcgKyBfLnNuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogdSArIF8ucGljLnJlcGxhY2UoL1xcXFw/LiovLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ3p6JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkICsgJyN6eidcXG4gICAgICAgICAgICAgICAgICAgIH0sIHIxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnYmQnOlxcbiAgICAgICAgICAgICAgICAgICAgcWlhbnFpYW4oXFxcInNlYXJjaFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3b3JkOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VObzogTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgfSkudHlwZVRyYWNrLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIV8uaXNWaXApIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0Lm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnYmQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkICsgJyNiZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdreic6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwczovL2hheXFiaGdyLnNsaWRlci5rei9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBKU09OLnBhcnNlKGZldGNoKHUgKyBcXFwidmtfYXV0aC5waHA/cT1cXFwiICsga2V5d29yZCkpW1xcXCJhdWRpb3NcXFwiXVtcXFwiXFxcIl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgXyBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IChfLnVybC5tYXRjaCgvaHR0cHM/Oi8pID8gXFxcIlxcXCIgOiB1KSArIF8udXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnRpdF9hcnQuc3BsaXQoJyAtICcpLnJldmVyc2UoKS5qb2luKCcgLSAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdreicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2t6JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uenlpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ25pJzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIGh0bSA9IFxcXCItMS5odG1cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgZWxzZSBodG0gPSBcXFwiLTEtXFxcIiArIE1ZX1BBR0UgKyBcXFwiLmh0bVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBrZXl3b3JkID0gZW5jb2RlVVJJQ29tcG9uZW50KGtleXdvcmQpLnJlcGxhY2UoLy0vZywgJ18yZCcpLnJlcGxhY2UoLyUvZywgJ18nKTtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBmZXRjaENvZGVCeVdlYlZpZXcoXFxcImh0dHBzOi8vd3d3LmhpZmluaS5jb20vc2VhcmNoLVxcXCIgKyBrZXl3b3JkICsgaHRtLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jsb2NrUnVsZXMnOiBbJy5qcycsICcuY3NzJywgJy5wbmcnLCAnLmljbyddLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDUwMDBcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJmxpLm1lZGlhW2RhdGEtdGlkXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBkZmgoaXRlbSwgXFxcImEsMiYmVGV4dFxcXCIpICE9IFxcXCLnibnkvptcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQgPSBwZGZoKGl0ZW0sIFxcXCJhLDEmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyAnI25pJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxhenkoJ25pJywgenlpZCwgMCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhLDEmJlRleHRcXFwiKS5zcGxpdChcXFwi44CLXFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUuc3BsaXQoXFxcIuOAilxcXCIpLnJldmVyc2UoKS5qb2luKCcgLSAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly93d3cuaGlmaW5pLmNvbS9cXFwiICsgcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICduaScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZzMnOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vd3d3LmdnZ211c2ljLmNvbS9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAga2V5d29yZCA9IGVuY29kZVVSSUNvbXBvbmVudChrZXl3b3JkKS5yZXBsYWNlKC8tL2csICdfMmQnKS5yZXBsYWNlKC8lL2csICdfJyk7XFxuICAgICAgICAgICAgICAgICAgICBodG1sID0gZmV0Y2hDb2RlQnlXZWJWaWV3KHUgKyBcXFwic2VhcmNoLVxcXCIgKyBrZXl3b3JkICsgXFxcIi0xLmh0bVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmxvY2tSdWxlcyc6IFsnLmpzJywgJy5jc3MnLCAnLnBuZycsICcuaWNvJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dDogNTAwMFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShodG1sLCBcXFwiYm9keSYmbGkuY2FyZFtkYXRhLXRpZF1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQgPSBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyAnI2czJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsYXp5KCdnMycsIHp5aWQsIDAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnNwbGl0KFxcXCIgLSBcXFwiKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogdSArIHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdnMycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnYnonOlxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwczovL2RlYmVuemkuY29tLz9zPVxcXCIgKyBrZXl3b3JkKSwgXFxcImJvZHkmJmgyLmVudHJ5LXRpdGxlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQgPSBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyAnI2J6JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxhenkoJ2J6JywgenlpZCwgMCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9waWMucm1iLmJkc3RhdGljLmNvbS9iamgvMzliOTY0YjJiMDg3YTA1YzM5YTU2YTJlMzhjMDQwMTkzMzguanBlZycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnYnonLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ3N0JzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKGBodHRwOi8vd3d3LnNvbmd0YXN0ZS5jby9kYW5jZS9zZWFyY2g/a2V5PSR7a2V5d29yZH0mcGFnZT0ke01ZX1BBR0V9YCksIFxcXCJib2R5JiYubWxpc3QmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkID0gcGRmaChpdGVtLCBcXFwiLnRkMyYmYSYmaHJlZlxcXCIpLnJlcGxhY2UoLy4qXFxcXC8vLCAnJykgKyAnI3N0JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsYXp5KCdzdCcsIHp5aWQsIDAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIudGQzJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKS5yZXBsYWNlKCdwaWNkYXRhJywgJ2F0dGFjaG1lbnQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ3N0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdibG0nOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IEpTT04ucGFyc2UoZmV0Y2goYGh0dHBzOi8vYmxhY2tibG0uYmFpbGVtaS5jb20vaW5kZXgucGhwL2RhbmNlL3NlYXJjaD9rZXk9JHtrZXl3b3JkfSZwYWdlPSR7TVlfUEFHRX1gKSkuZGFuY2VsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgXyBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXy5kb3dudXJsIHx8IF8ucGxheXVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCAmJiBfLm5hbWUpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgKF8uc2luZ2VyIHx8IF8udXBfdXNlciksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlciB8fCBfLnVwX3VzZXJfbG9nbyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2JsbScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ2lkICsgJyNibG0nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2ZwJzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChcXFwiaHR0cHM6Ly93d3cuZmFuZ3BpLm5ldC9zL1xcXCIgKyBrZXl3b3JkKSwgXFxcImJvZHkmJltjbGFzcz1yb3ddXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImRpdiwxJiZUZXh0XFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcImRpdiwyJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnZnAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdmcCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyAnI2ZwJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2h0JzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChcXFwiaHR0cDovL20uaHRxeXkuY29tL3NlYXJjaC9yZXN1bHQ/aWQ9XFxcIiArIGtleXdvcmQpLCBcXFwiYm9keSYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcImVtLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKSArICcwQGhlYWRlcnM9e1xcXCJyZWZlcmVyXFxcIjpcXFwiaHR0cDovL20uaHRxeXkuY29tXFxcIn0nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2h0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcIi5wbGF5JiZkYXRhLWlkXFxcIikgKyAnI2h0J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJzF0JzpcXG4gICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2goYGh0dHBzOi8vc28uMXRpbmcuY29tL3NvbmcvanNvbj9xPSR7a2V5d29yZH0mcGFnZT0ke01ZX1BBR0V9JnNpemU9MzBgKSkucmVzdWx0cy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ19uYW1lICsgJyAtICcgKyBfLnNpbmdlcl9uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOicgKyBfLmFsYnVtX2NvdmVyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICcxdCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25nX2lkICsgJyMxdCdcXG4gICAgICAgICAgICAgICAgICAgIH0sIHIxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnOXQnOlxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2goYGh0dHA6Ly9uZXcuOXNreS5jb20vYXBpL3dlaWJvL2NvbnRlbnQvc2VhcmNoP2NvbnRlbnQ9JHtrZXl3b3JkfWApKS5kYXRhLnNvbmdfbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXk4kL2kudGVzdChfLmlzX3N0YXRpb24pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly9uZXcuOXNreS5jb20vYXBpL3NvbmcvZGV0YWlsP2lkPVxcXCIgKyBfLnNvbmdfaWQgKyBcXFwiJmlzX2xvZ2luPU5cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2godSkpLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ19uYW1lICsgJyAtICcgKyBfLm11c2ljaWFuX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmRpc2NfaW1nX3VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnOXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ19pZCArICcjOXQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtfLnNvbmdfdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjOiBfLmx5cmljX3VybCB8fCBMcmMoXy5kZXNpZ25fbm90ZXMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2t5JzpcXG4gICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UocG9zdCgnaHR0cDovL2FwaS5rdWFpeWluMTIzLm5ldC9xL3NlYXJjaCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFwicT1cXFwiICsga2V5d29yZCArIFxcXCImY2xpZW50X3Y9Mi43LjEmcGFnZT1cXFwiICsgTVlfUEFHRSArIFxcXCImcGxhdGZvcm09QW5kcm9pZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiY2xpZW50LXZcXFwiOiBcXFwiMi43LjFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZGV2aWNlLWlkXFxcIjogUigxNiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwbGF0Zm9ybVxcXCI6IFxcXCJBbmRyb2lkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwib2todHRwLzMuMTQuNFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb25uZWN0aW9uXFxcIjogXFxcIktlZXAtQWxpdmVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29udGVudC1UeXBlXFxcIjogXFxcImFwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5tdXNpY19saXN0LnJvd3MubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnRpdGxlICsgJyAtICcgKyBfLnVzZXJfaW5mby5uaWNrbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2t5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnp5aWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW18ucGxheV91cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBseXJpYzogXy5scmNfdXJsXFxuICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnNW5kJzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChcXFwiaHR0cDovL20uNW5kLmNvbS9zby9zX1xcXCIgKyBrZXl3b3JkKSwgXFxcImJvZHkmJi5saXN0LXNvbmcmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi5zb25nJiZUZXh0XFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcIi5hcnRpc3QmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICc1bmQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSYmaHJlZlxcXCIpLnJlcGxhY2UoLy4qXFxcXC98XFxcXC4uKi9nLCAnJykgKyAnIzVuZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdiaXUnOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHBzOi8vYml1Lm1vZS9pbmRleC5waHA/bT0mYz1Tb25nJmE9c2VhcmNoJmRhdGE9XFxcIiArIGtleXdvcmQgKyBcXFwiJnA9XFxcIiArIE1ZX1BBR0UpLCBcXFwiYm9keSYmdGJvZHkmJnRyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJpdV9zaWQgPSBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRCsvLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZIdG1sXFxcIikucmVwbGFjZSgvXFxcXHMqPHNwYW5bXFxcXHNcXFxcU10rL2ksIFxcXCJcXFwiKSArICcgLSAnICsgcGRmaChpdGVtLCBcXFwiYSwxJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOi8vYml1Lm1vZS9Tb25nL3Nob3dDb3Zlci9zaWQvXFxcIiArIGJpdV9zaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdiaXUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBiaXVfc2lkICsgJyNiaXUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ211cyc6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChcXFwiaHR0cHM6Ly9za3ltdXMub3JnL3RyYWNrcy9cXFwiICsga2V5d29yZCArIFxcXCIvXFxcIiArIE1ZX1BBR0UpLCBcXFwiYm9keSYmLmYtdGFibGVcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLmFydGlzdC1uYW1lJiZUZXh0XFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcIi50cmFjay1uYW1lJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKS5yZXBsYWNlKC9eKC4rKS8sICdodHRwczokMScpIHx8ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnbXVzJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdtdXMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiAndW5kZWZpbmVkJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXFxcImh0dHBzOlxcXCIgKyBwZGZoKGl0ZW0sIFxcXCIubXAzJiZocmVmXFxcIikgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2phbSc6XFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL3NvbHJjbG91ZC5qYW1lbmRvLmNvbS9zb2xyL2phbWNvbT93dD1qc29uJnJvd3M9MzAmcT1cXFwiICsga2V5d29yZCArIFxcXCImc3RhcnQ9XFxcIiArICgoTVlfUEFHRSAtIDEpICogMzApKSkucmVzcG9uc2UuZG9jcy5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHBzOi8vcHJvZC0xLnN0b3JhZ2UuamFtZW5kby5jb20vZG93bmxvYWQvdHJhY2svXFxcIiArIF8uaWQgKyBcXFwiL21wMzVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZS5yZXBsYWNlKF8uYXJ0aXN0X25hbWUgKyAnIC0gJywgJycpICsgJyAtICcgKyBfLmFydGlzdF9uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL3VzZXJjb250ZW50LmphbWVuZG8uY29tLz90eXBlPWFsYnVtJmlkPVxcXCIgKyBfLmFsYnVtX2lkLnJlcGxhY2UoL1xcXFxEL2csICcnKSArIFxcXCImd2lkdGg9NTAwJnRyYWNraWQ9XFxcIiArIF8uaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdqYW0nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiAndW5kZWZpbmVkJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2p1aSc6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gZXZhbChwb3N0KCdodHRwczovL25ldy5teWZyZWVtcDNqdWljZXMuY2MvYXBpL2FwaV9zZWFyY2gucGhwP2NhbGxiYWNrPXFpYW5xaWFuJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IFxcXCJxPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFXFxuICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdSA9IFxcXCJodHRwczovL25wbGF5LmlkbXAzcy5jb20vc3RyZWFtL1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbyA9IFxcXCJBQkNERUZHSEpLTU5QUVJTVFVWV1hZWmFiY2RlZmdoamttbnBxcnN0dXZ4eXoxMjNcXFwiO1xcblxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24ganVpX2QodCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT0gdCkgcmV0dXJuIG9bMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh0IDwgMCAmJiAodCAqPSAtMSwgZSArPSBcXFwiLVxcXCIpOyAwIDwgdDspIHZhbCA9IHBhcnNlSW50KHQgJSA0OCksIHQgPSBwYXJzZUludCh0IC8gNDgpLCBlICs9IG9bdmFsXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gbGlzdFtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmV0dHlJZCA9IGp1aV9kKF8ub3duZXJfaWQpICsgXFxcIjpcXFwiICsganVpX2QoXy5pZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRsZSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdqdWknKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2p1aScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ucHJldHR5SWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3UgKyBwcmV0dHlJZCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAneTMnOlxcbiAgICAgICAgICAgICAgICAgICAgJHNvbmdfZGF0YSA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgc29uZ19saXN0ID0gKGksIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9ICRzb25nX2RhdGFbaV0uc3BsaXQoXFxcInx8XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGl0ZW0uc3BsaXQoXFxcInxcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9bNF0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwOi8vdGluZzYueXltcDMubmV0OjgyL1xcXCIgKyBTdHJpbmcoX1s0XSkucmVwbGFjZSgnLndtYScsICcubXAzJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF9bMV0gKyAnIC0gJyArIF9bM10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ3kzJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ3kzJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnByZXR0eUlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoUEMoXFxcImh0dHA6Ly93d3cueXltcDMuY29tL3AvZ2V0c2VyLmFzcHg/a2V5PVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnMzY1JzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAkMzY1X1NlYXJjaFJlc3VsdCh0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwZGZhKFxcXCI8Ym9keT5cXFwiICsgdCArIFxcXCI8L2JvZHk+XFxcIiwgXFxcImJvZHkmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBldmFsKFxcXCIkMzY1X1xcXCIgKyBmZXRjaChcXFwiaHR0cDovL2hpdC55dWUzNjUuY29tL3NlYXJjaC5hc3A/cm5kPVxcXCIgKyBNYXRoLnJhbmRvbSgpICsgXFxcIiZrZXl3b3Jkcz1cXFwiICsgZXNjYXBlKGtleXdvcmQpICsgXFxcIiZ0PTFcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTXVzaWNJZCA9IHBkZmgoaXRlbSwgXFxcImEsMCYmaHJlZlxcXCIpLnJlcGxhY2UoLy4qXFxcXC98XFxcXC4uKi9nLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwOi8vOTYuaWVyZ2UuY24vXFxcIiArIHBhcnNlSW50KE11c2ljSWQgLyAzMDAwMCkgKyBcXFwiL1xcXCIgKyBwYXJzZUludChNdXNpY0lkIC8gMjAwMCkgKyBcXFwiL1xcXCIgKyBNdXNpY0lkICsgXFxcIi5tcDNcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLm5hbWUmJlRleHRcXFwiKSArICcgLSAnICsgcGRmaChpdGVtLCBcXFwiLnNpbmdlciYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJzM2NScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJzM2NScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiAndW5kZWZpbmVkJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqMSc6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly93d3cuenp6ZGouY29tXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoUEModSArIFxcXCIvbXVzaWMvc2VhcmNoLVxcXCIgKyBrZXl3b3JkICsgXFxcIj9jYXRfaWQ9MCZwYWdlPVxcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJnRib2R5JiZ0clxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm1hdGNoKC9hbHQ9XFxcIiguKz8pXFxcIi8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBpdGVtLm1hdGNoKC9zcmM9XFxcIiguKz8pXFxcIi8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGoxJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvZGF0YS1pZD1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqMSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGoyJzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoUEMoXFxcImh0dHBzOi8vd3d3LmRqdXUuY29tL3NlYXJjaD9tdXNpY25hbWU9XFxcIiArIGtleXdvcmQgKyBcXFwiJmxpc3Q9MiZjaWQ9MCZwYWdlPVxcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJi5saXN0X211c2ljbGlzdCYmdHJbY2xhc3NdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubWF0Y2goL3RpdGxlPVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6XFxcIiArIGl0ZW0ubWF0Y2goL3NyYz1cXFwiKC4rPylcXFwiLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajInLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC92YWx1ZT1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqMidcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGozJzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL3d3dy5sYWxhZGouY29tXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoUEModSArIFxcXCIvc2VhcmNoP3NlYXJjaD1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSksIFxcXCJib2R5JiYubGlzdF9tdXNpY2xpc3QmJnRyW2NsYXNzXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIudDEmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiB1ICsgaXRlbS5tYXRjaCgvc3JjPVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqMycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL3ZhbHVlPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGozJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajQnOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2hQQyhcXFwiaHR0cHM6Ly9tLmFoYWRqLmNvbS9zZWFyY2gvP2tleT1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSArIFxcXCIuaHRtbFxcXCIpLCBcXFwiYm9keSYmLnlpbnl1ZV9saXN0JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcImgzJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHBzOi8vc3QuOTJrdS5jb20vendjcy9cXFwiICsgdGl0bGUgKyBcXFwiLm1wNFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqNCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcImEsMCYmaHJlZlxcXCIpLnJlcGxhY2UoL1xcXFxEL2csICcnKSArICcjZGo0J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMF1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajUnOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9ICdodHRwczovL3d3dy5kai5uZXQvJztcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBwb3N0KHUgKyAnc2VhcmNoLnBocD9tb2Q9bXVzaWMmZm9ybWhhc2g9OGM5NjRlOGEmc3JjaHR4dD0nICsgZW5jb2RlU3RyKGtleXdvcmQsICdHQksnKSArICcmc2VhcmNoc3VibWl0PXllcycsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAndGV4dC9odG1sOyBjaGFyc2V0PWdiaycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gdSArIEpTT04ucGFyc2UoXykuaGVhZGVycy5sb2NhdGlvblswXSArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKHVybCksIFxcXCJib2R5JiYubXVzaWMtbGlzdCYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwxJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogdSArIHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIikucmVwbGFjZShcXFwiJnNpemU9c21hbGxcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCJhLDEmJmhyZWZcXFwiKS5tYXRjaCgvaWQ9KFxcXFxkKykvKVsxXSArICcjZGo1J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajYnOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9ICdodHRwOi8vd3d3LjM2ZGouY29tL2Uvc2VhcmNoLyc7XFxuICAgICAgICAgICAgICAgICAgICBfID0gcG9zdCh1ICsgJ2luZGV4LnBocCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzaWQ6ICcxLDIsMyw0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5Ym9hcmQ6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Ym1pdDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3c6ICd0aXRsZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBpZDogJzEnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgdSArPSBKU09OLnBhcnNlKF8pLmhlYWRlcnMubG9jYXRpb25bMF0gKyBcXFwiJnBhZ2U9XFxcIiArIChNWV9QQUdFIC0gMSk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaCh1KSwgXFxcImJvZHkmJiNwbGF5bGlzdCYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdkajYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqNicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL3ZhbHVlPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGo2J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajcnOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9ICdodHRwczovL3d3dy43aWRqLmNvbS9lL3NlYXJjaC8nXFxuICAgICAgICAgICAgICAgICAgICBfID0gcG9zdCh1ICsgJ2luZGV4LnBocCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleWJvYXJkOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93OiAndGl0bGUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgdSArPSBKU09OLnBhcnNlKF8pLmhlYWRlcnMubG9jYXRpb25bMF0gKyBcXFwiJnBhZ2U9XFxcIiArIChNWV9QQUdFIC0gMSk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaCh1KSwgXFxcImJvZHkmJmxpW2RhdGEtaWRdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnZGo3JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC9kYXRhLWlkPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGo3J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajgnOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9ICdodHRwczovL3d3dy5kanU4LmNvbS8nO1xcbiAgICAgICAgICAgICAgICAgICAgaXRlbSA9IGZldGNoUEModSArICdrZXkvbWxfJyArIGVuY29kZVN0cihrZXl3b3JkLCAnR0JLJykgKyAnXycgKyBNWV9QQUdFICsgJy5odG1sJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICd0ZXh0L2h0bWw7IGNoYXJzZXQ9Z2IyMzEyJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZmVyZXInOiB1XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShpdGVtLCBcXFwiYm9keSYmI2Rqb3VyJiZsaVtvbm1vdXNlb3Zlcl1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdkajgnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqOCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL3ZhbHVlPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGo4J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajknOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9ICdodHRwczovL3d3dy5kanl5eS5jb20vc2VhcmNoLnBocD9hYz1kaiZrZXk9JyArIGtleXdvcmQgKyAnJnBhZ2VzPScgKyBNWV9QQUdFO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2hQQyh1KSwgXFxcImJvZHkmJmxpW2RhdGEtaWRdIFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2RqOScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvZGF0YS1pZD1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqOSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmjqXlj6PplJnor69+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5rKh5pyJ5Y+v5Lul5pCc57Si5q2M5Y2V55qE5o6l5Y+jflxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICB9XFxufVxcblxcbmZ1bmN0aW9uIGxhenkocGxhdGZvcm0sIHQxLCB0MiwgdDMpIHtcXG4gICAgW3QxLCBwbGF0Zm9ybSwgdHlwZV0gPSB0MS5zcGxpdCgnIycpO1xcbiAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgIGNhc2UgJ3p6JzogLy8g5aSx5pWIXFxuICAgICAgICAgICAgdSA9ICdodHRwczovL3p6MTIzLmNvbSc7XFxuICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1ICsgJy9hamF4LycsIHtcXG4gICAgICAgICAgICAgICAgYm9keTogXFxcImFjdD1zb25naW5mbyZpZD1cXFwiICsgdDEgKyBcXFwiJmxhbmc9XFxcIlxcbiAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgICAgIHVybCA9IHUgKyBfLm1wMztcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UodSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IFt7XFxuICAgICAgICAgICAgICAgICAgICByZWZlcmVyOiB1XFxuICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICBseXJpYzogXy5scmMucmVwbGFjZSgvXFxcXHIvZywgJycpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdiZCc6XFxuICAgICAgICAgICAgXyA9IHFpYW5xaWFuKFxcXCJzb25nL3RyYWNrbGlua1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgVFNJRDogdDFcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+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+z6LSoJykuc2VsZWN0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3J1bGU95q2M6K+N6YCC6YWNJykoKTtcXG4gICAgICAgIE9iamVjdC5rZXlzKGlUYWcpLm1hcCgobmFtZSwgaWkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlkID09IG5hbWUgPyBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpIDogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpZCcsIHRpZCk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWknKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogQ29sb3IoXFxcIjxiPuWIh+aNouaOpeWPozwvYj5cXFwiLCBcXFwiI2ZmNjYwMVxcXCIpLFxcbiAgICAgICAgICAgIHVybDogJChwbGF0Zm9ybXMuc2xpY2UoMCwgOCkubWFwKHRpdGxlID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKHRpdGxlID09IHBsYXRmb3JtKVxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBSaWNoKFN0cm9uZyhDb2xvcih0aXRsZSkpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRpdGxlXFxuICAgICAgICAgICAgfSksIDIsICfpgInmi6nmjqXlj6PlubPlj7AnKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoIWlucHV0Lm1hdGNoKC9e4oCY4oCY4oCZ4oCZLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdwbGF0Zm9ybScsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcigndGlkJyk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWknKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKHBsYXRmb3JtKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogQ29sb3IoXFxcIjxiPlRHWOaUtuiXjzwvYj5cXFwiLCBcXFwiI2ZmNjYwMVxcXCIpLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb2xsZWN0aW9uI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjP3J1bGU95q2M6K+N6YCC6YWNXFxcIixcXG4gICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgn5pS26JePJyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzMnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogXFxcIlRHWOaUtuiXj1xcXCIsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBDb2xvcihcXFwiPGI+6Kej5p6Q566h55CGPC9iPlxcXCIsIFxcXCIjZmY2NjAxXFxcIiksXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3J1bGVMaXN0I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjP3BhZ2VUaXRsZT3op6PmnpDnrqHnkIYmcnVsZT3mrYzor43pgILphY1cXFwiLFxcbiAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCforr7nva4nKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ/CflI0nLFxcbiAgICAgICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDliIbkuqvpk77mjqUnLFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoc19wbGF0Zm9ybSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQudHJpbSgpKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc19wbGF0Zm9ybScsIHNfcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3BsYXRmb3JtJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc190MycpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3Q0Jyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3NlYXJjaCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cD1meXBhZ2UmcnVsZT3mrYzor43pgILphY1cXFwiO1xcbiAgICAgICAgICAgIH0sIHBsYXRmb3JtKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaDFcXFwiLFxcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IFxcXCLpq5jnuqfmkJzntKJcXFwiLFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJzX3QyXFxcIiksXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ3NfdDInLCBpbnB1dClcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5oiR55qE5pS26JePJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2NvbGxlY3Rpb24/cnVsZT3mrYzor43pgILphY0nLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb24xJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6ICfljoblj7LorrDlvZUnLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vaGlzdG9yeT9ydWxlPeatjOivjemAgumFjScsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjMnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJ+mrmOe6p+aQnOe0oicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc19wbGF0Zm9ybScpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDQnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2Uvc2VhcmNoI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wPWZ5cGFnZSZydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjInLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFJpY2goQ29sb3IoJzxiPicgKyB0aWQgKyAnPC9iPicsICcjZmY2NjAxJykpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICB0cnIubWFwKChuYW1lLCBpaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aWkgPT0gaWkgPyBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpIDogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpaScsIHRpaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCBpaSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBMb2FkaW5nKCk7XFxuICAgIH1cXG4gICAgdXJpID0gaVRhZ1t0aWRdW3Ryclt0aWldXTtcXG4gICAgaWYgKCFBcnJheS5pc0FycmF5KHVyaSkpIHtcXG4gICAgICAgIGlmIChNWV9QQUdFID09IDEgfHwgZ2V0TXlWYXIoJ2hvbWVfcGFnZScsICcwJykgPT0gJzAnKSB7XFxuICAgICAgICAgICAgbGV0IHBhZ2VTaXplID0gcGxhdGZvcm0gPT0gXFxcIm15XFxcIiA/IDkwIDogKHBsYXRmb3JtID09IFxcXCI1c1xcXCIgPyAxNiA6IDMwKTtcXG4gICAgICAgICAgICBsZXQgdG90YWwgPSAkLnJlcXVpcmUocGxhdGZvcm0gKyBcXFwiP3J1bGU95q2M6K+N6YCC6YWNXFxcIikubGF6eSgxLCB1cmkpO1xcbiAgICAgICAgICAgIGlmICh0b3RhbCA8IE1ZX1BBR0UgKiBwYWdlU2l6ZSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignaG9tZV9wYWdlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArICfmiJHmmK/mnInlupXnur/nmoQnLmZvbnRjb2xvcignR3JheScpLnNtYWxsKCksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdob21lX3BhZ2UnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSBkID0gZC5jb25jYXQodXJpKTtcXG59IGNhdGNoIChmZXRjaF9lcnJvcikge1xcbiAgICAvLyBlcnJvcihmZXRjaF9lcnJvcik7XFxuICAgIGQgPSBbe1xcbiAgICAgICAgdGl0bGU6IFxcXCLnvZHnu5zlvILluLggLyDmjqXlj6PltKnmuoPkuoZcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuaNouS4quaOpeWPo+eci+eci+OAglxcXCIsXFxuICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9XTtcXG4gICAgcGxhdGZvcm1zLnNsaWNlKDEsIDgpXFxuICAgICAgICAuZmlsdGVyKHRpdGxlID0+IHRpdGxlICE9IHBsYXRmb3JtKVxcbiAgICAgICAgLm1hcCh0aXRsZSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fMl9yb3VuZCcsXFxuICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aXRsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3BsYXRmb3JtJywgdGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignaG9tZV9wYWdlJyk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWQnKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpaScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIHRpdGxlKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxufVxcbk1ZX1BBR0UgPT0gMSA/IHNldFByZVJlc3VsdChkKSA6IHNldFJlc3VsdChkKTtcXG5kZWxldGVJdGVtQnlDbHMoJ2x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LCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5MaXRlX1NpZ25pbihtYXRbMV0sIG1hdFsyXSwgbWF0WzNdLCB0cnVlKTtcXG4gICAgICAgICAgICAgICAgfSwga2dfbGl0ZSksXFxuICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgXy50aW1lID0gbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxuICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDE7XFxuICAgICAgICAgICAgICAgICAgICBsZXQganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X2tnJywgW10pO1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0LnVuc2hpZnQoXyk7XFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJyLmZpbmRJbmRleChvID0+IG1kNShvYmoudGl0bGUgKyBvYmoudXJsKSA9PT0gbWQ1KG8udGl0bGUgKyBvLnVybCkpID09PSBpbmRleDtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X2tnJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUxJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ku4rml6XkuI3lho3mj5DnpLrvvIzor7flnKjorr7nva7pobXmiYvliqjnrb7liLBcXFwiXFxuICAgICAgICAgICAgICAgIH0sIGtnX2xpdGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUxJywgJzAnKTsgLy8g5LuK5aSp5bey57uP562+5Yiw6L+H5LqGXFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBwdXRNeVZhcigndXBkYXRlMScsICcwJyk7IC8vIOayoeacieamguW/teeJiOino+aekCAvIOS4jeaPkOekulxcbiAgICB9XFxuICAgIGlmIChnZXRNeVZhcigndXBkYXRlMicsIGdldEl0ZW0oJ3VwZGF0ZTInLCAnMCcpKSA9PSAnMScgJiYgKCFrZ19saXRlIHx8ICQuZGF0ZUZvcm1hdChrZ19saXRlLnRpbWUsICd5eXl5TU1kZCcpID09IHRpbWUpKSB7XFxuICAgICAgICBsZXQgcXFfbGl0ZSA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9xcScsIFtdKVxcbiAgICAgICAgICAgIC5maW5kKF8gPT4gbWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImUyYzFhNGJmOGQ1OGQxNzAzYTVlODEwOWUxZjkwY2MwXFxcIik7XFxuICAgICAgICBpZiAocXFfbGl0ZSkge1xcbiAgICAgICAgICAgIGlmICgkLmRhdGVGb3JtYXQocXFfbGl0ZS50aW1lICsgNS4zZTgsICd5eXl5TU1kZCcpIDwgdGltZSkge1xcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnW1FR6Z+z5LmQXSDliLfmlrBjb29raWUnLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+avj+S4g+WkqemcgOimgeWIt+aWsOS4gOasoWNvb2tpZScsXFxuICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvb2tpZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL0Nvb2tpZTogXFxcIihbXlxcXCJdKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMicsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5yZWZyZXNoX2xvZ2luKGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBxcV9saXRlKSxcXG4gICAgICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8udGltZSArPSA4LjZlNztcXG4gICAgICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9xcScsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QudW5zaGlmdChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBtZDUob2JqLnRpdGxlICsgb2JqLnVybCkgPT09IG1kNShvLnRpdGxlICsgby51cmwpKSA9PT0gaW5kZXg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X3FxJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMicsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S7iuaXpeS4jeWGjeaPkOekuu+8jOivt+WcqOiuvue9rumhteaJi+WKqOetvuWIsFxcXCJcXG4gICAgICAgIC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XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5r+A5rS75a+G5YyZXFxcIikuaW5wdXQoKG9wZW4pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20xJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfb3BlbicsIG9wZW4pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5r+A5rS75aSx6LSlXFxcIjtcXG4gICAgICAgICAgICB9LCBvcGVuKTtcXG4gICAgICAgIH1cXG4gICAgfSwganhfczEsIGp4X29wZW4gPyAnMCcgOiAnMScpLFxcbiAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfb3BlbiA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojZmY2NjAxXFxcIj48Yj7lkK/nlKjkuIvovb08L2I+PC9zcGFuPicsXFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSywgZG93bikgPT4ge1xcbiAgICAgICAgaWYgKEspIHtcXG4gICAgICAgICAgICBwdXRNeVZhcignanhfZG93bicsIGRvd24pO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ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kaW5nIycpLmxhenlSdWxlKCh0aWQsIHRpaSwgZmVnKSA9PiB7XFxuICAgICAgICAgICAgaWYgKHRpaSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfdGlkJywgdGlkKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgbmFtZSwgIWksICFqeF9zMiksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfNSdcXG4gICAgfSk7XFxufSk7XFxuc3dpdGNoIChqeF90aWQpIHtcXG4gICAgY2FzZSAn6aKE6KeIJzpcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZyhnZXRNeVZhcignanhfdGl0bGUnKSksXFxuICAgICAgICAgICAgZGVzYzogW1xcXCJtcDNcXFwiLCBcXFwiaHFcXFwiLCBcXFwic3FcXFwiLCBcXFwiaHJcXFwiLCAvKiBcXFwienFcXFwiKi8gXS5tYXAodCA9PiBnZXRNeVZhcihcXFwianhfXFxcIiArIHQpICE9IFxcXCJcXFwiID8gJ+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/neWtmOW5tumAgOWHuicpKSksXFxuICAgIGRlc2M6ICfkuIrmrKHnvJbovpHvvJonICsgJC5kYXRlRm9ybWF0KE51bWJlcihnZXRNeVZhcihcXFwianhfdGltZVxcXCIpKSB8fCBuZXcgRGF0ZSgpLmdldFRpbWUoKSwgJ3l5eXktTU0tZGQgaGg6bW06c3MnKSxcXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgIGlmIChnZXRNeVZhcignanhfbTInKSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXRFZGl0KCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mqjOivgeWksei0pe+8jOS4jeaUr+aMgeS/neWtmO+8jOivt+W3puS4iuinkuaJi+WKqOmAgOWHuuOAglxcXCI7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RWRpdCgpO1xcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICB9XFxufSk7XFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pGl6KeE5YiZ5YiX6KGoXCIsXCJwYXRoXCI6XCJydWxlTGlzdFwiLFwicnVsZVwiOlwianM6XFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG5sZXQgZCA9IFtdO1xcbmQucHV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Qua2V5cyh6eSk7XFxuICAgICAgICBpZiAoenUubGVuZ3RoID09IDApIHJldHVybiBcXFwidG9hc3Q6Ly/msqHmnInpgInkuK3op6PmnpBcXFwiO1xcbiAgICAgICAgbGV0IHQxLCB0MiwganNvbiA9IHt9O1xcbiAgICAgICAgaWYgKHp1Lmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgbGV0IF8gPSB6eVt6dVswXV07XFxuICAgICAgICAgICAgaWYgKF8ubTEgJiYgXy5tMSAhPSBcXFwiXFxcIiAmJiBTdHJpbmcoXy5tMSkubGVuZ3RoID09IDMyKSB7XFxuICAgICAgICAgICAgICAgIF8uczEgPSBcXFwiMVxcXCI7XFxuICAgICAgICAgICAgICAgIF8ub3BlbiA9IFxcXCIwXFxcIjtcXG4gICAgICAgICAgICAgICAgXy5kb3duID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoXy5tMiAmJiBfLm0yICE9IFxcXCJcXFwiICYmIFN0cmluZyhfLm0yKS5sZW5ndGggPT0gMzIgJiYgXy5zMiA9PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgXy5zMiA9IFxcXCIyXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAganNvbltfLnR5cGVdID0gW19dO1xcbiAgICAgICAgICAgIGxldCB0MSA9IF8udHlwZTtcXG4gICAgICAgICAgICBsZXQgdDIgPSBfLnRpdGxlO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgb2YgenUpIHtcXG4gICAgICAgICAgICAgICAgbGV0IF8gPSB6eVtrZXldO1xcbiAgICAgICAgICAgICAgICBpZiAoIWpzb25bXy50eXBlXSkge1xcbiAgICAgICAgICAgICAgICAgICAganNvbltfLnR5cGVdID0gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKF8ubTEgJiYgXy5tMSAhPSBcXFwiXFx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gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF0Zm9ybXMgPSBbcGxhdGZvcm1dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHBsYXRmb3JtIG9mIHBsYXRmb3Jtcykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oJ2p4bGlzdF8nICsgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgfSwgcGxhdGZvcm0pXFxuICAgICAgICAgICAgfV1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSk7XFxubGV0IGp4bGlzdCA9IFtdO1xcbmlmIChqeF9wbGF0Zm9ybSA9PSBcXFwibGliXFxcIikge1xcbiAgICBwbGF0Zm9ybXMuc2xpY2UoMSkubWFwKHBsYXRmb3JtID0+IHtcXG4gICAgICAgIGp4bGlzdCA9IGp4bGlzdC5jb25jYXQoc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0XycgKyBwbGF0Zm9ybSwgW10pKTtcXG4gICAgfSk7XFxufSBlbHNlIHtcXG4gICAganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0XycgKyBqeF9wbGF0Zm9ybSwgW10pO1xcbn1cXG5pZiAoanhsaXN0Lmxlbmd0aCA9PSAwKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IoXFxcIuayoeacieino+aekFxcXCIpKSksXFxuICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgIGNvbF90eXB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uICAgICAgICAgICAgICAgIGxldCBqc29uLCBqeGxpc3QyLCBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3RfJyArIHR5cGUsIFtdKTtcXG4gICAgICAgICAgICAgICAgbGV0IHp1ID0ganhsaXN0Lm1hcChfID0+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/nlKhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGp4bGlzdCwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9ICcwJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAganhsaXN0W2ldID0gXztcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIGp4X29wZW4oanhsaXN0W2ldKTtcXG4gICAgICAgICAgICB9LCBfLnR5cGUsIF8udGl0bGUsIF8udXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKF8ub3BlbiA9PSAnMScgPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxufVxcbnNldFJlc3VsdChkKTtcIn0se1w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5cGUgPT0gXFxcIm9wZW5cXFwiICYmIHF1YWxpdHkgIT0gXFxcIm1wM1xcXCI7XFxuICAgICAgICBpZiAoanhsaXN0Lmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgaWYgKGlzUGxheSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFtmYWxzZSwgbHJjLCBpaSAtIDFdO1xcbiAgICAgICAgICAgIGVsc2UgaWYgKHVUeXBlID09IFxcXCJkb3duXFxcIiB8fCBqeGxpc3QyLmxlbmd0aCA9PSAwKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gW1xcXCJ0b2FzdDovL+ayoeacieWPr+eUqOeahFxcXCIgKyAodVR5cGUgPT0gXFxcIm9wZW5cXFwiID8gXFxcIuivleWQrFxcXCIgOiBcXFwi5LiL6L29XFxcIikgKyBcXFwi6Kej5p6QXFxcIiwgbHJjLCBpaV07XFxuICAgICAgICB9XFxuICAgICAgICBpZiAocGxhdGZvcm0gIT0gXFxcInF0XFxcIikge1xcbiAgICAgICAgICAgIGZvciAobGV0IF8gb2YganhsaXN0KSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bcXVhbGl0eV0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bXFxcImppZXhpXFxcIl0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodXJsICYmIFN0cmluZyh1cmwpLmxlbmd0aCA+IDE5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFt1cmwsIGxyYywgaWldO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChqeEVycm9yKSB7XFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coZXJyb3IoanhFcnJvcikpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHF1YWxpdHkgPT0gXFxcIm1wM1xcXCIpIHsgLy8g6LCD55So5YW25a6D6Kej5p6Q5o6l5Y+jXFxuICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgbGF6eSxcXG4gICAgICAgICAgICAgICAgc2VhcmNoXFxuICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwicXQ/cnVsZT3mrYzor43pgILphY1cXFwiKTtcXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShtdXNpY0l0ZW0pKSB7XFxuICAgICAgICAgICAgICAgIG11c2ljSXRlbSA9IG11c2ljSXRlbVswXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHNvbmdOYW1lID0gKG11c2ljSXRlbS5zb25nTmFtZSB8fCBtdXNpY0l0ZW0ubmFtZSkuc3BsaXQoJyAtICcpO1xcbiAgICAgICAgICAgIHNvbmdOYW1lID0gc29uZ05hbWVbMV0gfHwgc29uZ05hbWVbMF07XFxuICAgICAgICAgICAgbGV0IHNvbmdBcnRpc3QgPSBtdXNpY0l0ZW0uYXJ0aXN0IHx8IG11c2ljSXRlbS5zaW5nZXJuYW1lIHx8IG11c2ljSXRlbS5zaW5nZXIgfHwgbXVzaWNJdGVtLmFyO1xcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHNvbmdBcnRpc3QpKSB7XFxuICAgICAgICAgICAgICAgIC8vIHNvbmdBcnRpc3QgPSBzb25nQXJ0aXN0Lm1hcChfPT5fLm5hbWUpLmpvaW4oXFxcIiZcXFwiKTtcXG4gICAgICAgICAgICAgICAgc29uZ0FydGlzdCA9IHNvbmdBcnRpc3RbMF0ubmFtZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgTVlfUEFHRSA9IDE7XFxuICAgICAgICAgICAgZm9yIChsZXQgXyBvZiBqeGxpc3QyKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bcXVhbGl0eV0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bXFxcImppZXhpXFxcIl0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodXJsICYmIFN0cmluZyh1cmwpLmxlbmd0aCA+IDE5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFt1cmwsIGxyYywgaWldO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChqeEVycm9yKSB7XFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coZXJyb3IoanhFcnJvcikpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGlzUGxheSkgcmV0dXJuIFtmYWxzZSwgbHJjLCBpaV07XFxuICAgICAgICByZXR1cm4gW1xcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXCIsIGxyYywgaWldO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBnZXRTaGFyZShqc29uLCBpc0p4LCBsZW4sIHQxLCB0MiwgYXJyLCBzaSwga2V5KSB7XFxuICAgICAgICBsZXQgdGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICByZXR1cm4gJChnZXRQYXN0ZXMoKS5jb25jYXQoXFxcIue6r+aWh+acrFxcXCIpLmNvbmNhdChhcnIgfHwgW10pLCAyLCAn6YCJ5oup5YiG5Lqr5qC85byPJykuc2VsZWN0KCh0ZXh0LCBpc0p4LCBsZW4sIHQxLCB0Miwgc2ksIGtleSkgPT4ge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5om56YeP5YiG5LqrXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaXRjaDogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV1cXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvX2NhdGNoL0ltcG9ydC50eHRcXFwiLCBKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9yZWx5MiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT3mrYzor43pgILphY1cXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5a6Y5pa56ZO+5o6lXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjsgLy/ov5jmsqHlhpkgICAgXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGRlc2MsIHR5cGUsIHJlbHksIGdyb3VwO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgIT0gXFxcIue6r+aWh+acrFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRleHQgPSBzaGFyZVBhc3RlKHRleHQsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIGdyb3VwID0gXFxcIlBhc3RlXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGdyb3VwID0gXFxcIlRleHRcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAoaXNKeCkge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFxcXCLop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgcmVseSA9IFxcXCIxXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSBcXFwi5pS26JePXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIHJlbHkgPSBcXFwiMlxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGxlbiA9PSAxICYmIHQxICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICAgICAgZGVzYyA9IHQxICsgdHlwZSArIFxcXCLjgIxcXFwiICsgdDIgKyBcXFwi44CNXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlc2MgPSBcXFwi5YWx44CMXFxcIiArIGxlbiArIFxcXCLjgI3mnaFcXFwiICsgdHlwZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdqeGxpc3QyJyk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8v5q2M6K+N6YCC6YWNXFxcIiArIHR5cGUgKyBcXFwi5Y+j5Luk77yM5omT5byA5rW36ZiU5Y2z5Y+v5a+85YWlXFxcXG5cXFwiICsgZGVzYyArIFxcXCLvv6VcXFwiICsgZ3JvdXAgKyBcXFwi77+lXFxcIiArIHRleHQgKyAnQGltcG9ydD1qczokLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0UnVsZShpbnB1dCxcXFwiJyArIHJlbHkgKyAnXFxcIik7JztcXG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIhuS6q+Wksei0pVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgdGV4dCwgaXNKeCwgbGVuLCB0MSwgdDIsIHNpLCBrZXkpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZXRSdWxlOiBmdW5jdGlvbihpbnB1dCwgcmVseSkge1xcbiAgICAgICAgW3REZXNjLCB0VHlwZSwgdGV4dF0gPSBTdHJpbmcoaW5wdXQpLnNwbGl0KFxcXCLvv6VcXFwiKTtcXG4gICAgICAgIHN3aXRjaCAodFR5cGUpIHtcXG4gICAgICAgICAgICBjYXNlICdQYXN0ZSc6XFxuICAgICAgICAgICAgICAgIHRleHQgPSBwYXJzZVBhc3RlKHRleHQpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdMYW56b3UnOlxcbiAgICAgICAgICAgICAgICBbdXJsLCBwd2RdID0gdGV4dC5zcGxpdChcXFwiIyNcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IGR1cmwgPSAkLnJlcXVpcmUoJ2xhbnpvdT9ydWxlPeatjOivjemAgumFjScpLm9uZV91cmwodXJsLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICB0ZXh0ID0gU3RyaW5nKGZldGNoKGR1cmwpKTtcXG4gICAgICAgICAgICAgICAgbGV0IHNwID0gdGV4dC5zcGxpdChcXFwi77+lXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChzcC5sZW5ndGggPT0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHNwWzJdLnNwbGl0KFxcXCJAXFx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JqeF9tcDNcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgaHE6IGdldE15VmFyKFxcXCJqeF9ocVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBzcTogZ2V0TXlWYXIoXFxcImp4X3NxXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGhyOiBnZXRNeVZhcihcXFwianhfaHJcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgenE6IGdldE15VmFyKFxcXCJqeF96cVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBqaWV4aTogZ2V0TXlWYXIoXFxcImp4X2ppZXhpXFxcIiwgXFxcIlxcXCIpLFxcblxcbiAgICAgICAgICAgIHMxOiBnZXRNeVZhcihcXFwianhfczFcXFwiLCBcXFwiMFxcXCIpLFxcbiAgICAgICAgICAgIG0xOiBnZXRNeVZhcihcXFwianhfbTFcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgczI6IGdldE15VmFyKFxcXCJqeF9zMlxcXCIsIFxcXCIwXFxcIiksXFxuICAgICAgICAgICAgbTI6IGdldE15VmFyKFxcXCJqeF9tMlxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICB0aW1lOiBuZXcgRGF0ZSgpLmdldFRpbWUoKVxcbiAgICAgICAgfTtcXG4gICAgICAgIGlmIChfLnRpdGxlICE9IFxcXCJcXFwiICYmIF8udXJsICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgdCBpbiBfKSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4XycgKyB0KTtcXG4gICAgICAgICAgICAgICAgaWYgKF9bdF0gPT0gXFxcIlxcXCIgfHwgX1t0XSA9PSBcXFwiVmZhbmFocy95MGlaeGNTTDBQSkFjUT09XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIF9bdF07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF8nICsgXy50eXBlLCBbXSk7XFxuICAgICAgICAgICAgbGV0IHVpZHMgPSBqeGxpc3QubWFwKF9fID0+IG1kNShfXy50eXBlICsgJzonICsgX18udGl0bGUgKyAnOicgKyBfXy51cmwpKTtcXG4gICAgICAgICAgICBsZXQgaSA9IHVpZHMuaW5kZXhPZihnZXRNeVZhcignanhfdWlkJywgJy0xJykpO1xcbiAgICAgICAgICAgIGlmIChpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdC5wdXNoKF8pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdC5zcGxpY2UoaSwgMSwgXyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4X3RpZCcpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4X3VpZCcpO1xcbiAgICAgICAgICAgIGp4bGlzdCA9IGp4bGlzdC5maWx0ZXIoKG9iaiwgaW5kZXgsIGFycikgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gYXJyLmZpbmRJbmRleChvID0+IG1kNShvYmoudGl0bGUgKyBvYmoudXJsKSA9PT0gbWQ1KG8udGl0bGUgKyBvLnVybCkpID09PSBpbmRleDtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3RfJyArIF8udHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgJ3RvYXN0Oi8v5L+d5a2Y5oiQ5YqfJztcXG4gICAgICAgIH0gZWxzZSBpZiAoXy50aXRsZSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7floavlhpnmupDlkI3np7AnO1xcbiAgICAgICAgfSBlb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6YW354uX5qaC5b+154mIXFxcIiwgXFxcImh0dHBzOi8vZ2F0ZXdheS5rdWdvdS5jb21cXFwiLCBjMCwgYzEsIFxcXCIzMTE2XFxcIiwgYzIpO1xcbiAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDA7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ2t3JzpcXG4gICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihfLCB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBcXFwi6YW35oiR6Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBcXFwiaHR0cDovL21vYmkua3V3by5jblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcIlJYbG5aTnlZSVViMTNNdWtJazlSVFE9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiaHFcXFwiOiBcXFwiVk0rcGFURnVwczFhZVNvbit6MGgyZz09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzcVxcXCI6IFxcXCJQR0FuQ1FDanVKWHpiaWErcCswSHRRPT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImhyXFxcIjogXFxcInRxMXBYNFQvWTEzdlRlQTNaZktYblZYMnAyb2JQOHRJbWNYRWk5RHlRSEU9XFxcIixcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmICghQzApIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICBfLmppZXhpID0gZ2V0UHJpdmF0ZUpTKEMwKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAna3cyJzpcXG4gICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihfLCB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBcXFwi5rOi54K56Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBcXFwiaHR0cHM6Ly9iZC1hcGkua3V3by5jblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcImxvcTZlbm9BdkprYWdMQTg2U0VpSENCNlZqTXBydkhUOExGdnVnYnVmcVE9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJocVxcXCI6IFxcXCJlay9ibVUwOXZYRHFQTEhyVEhEanZTQjZWak1wcnZIVDhMRnZ1Z2J1ZnFRPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwic3FcXFwiOiBcXFwiUHc0VlpCeUFBUW92aVA3cVpvS1V1aVR5UWRsZGpsKzk4R0ROVzhXdmlwcz1cXFwiLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYyA9IEMwLnNwbGl0KC91aWQ9L2kpO1xcbiAgICAgICAgICAgICAgICBjMCA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICAgICAgICAgIGMgPSBDMS5zcGxpdCgvdG9rZW49L2kpO1xcbiAgICAgICAgICAgICAgICBjMSA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICAgICAgICAgIGMgPSBDMi5zcGxpdCgvZGV2SWQ9L2kpO1xcbiAgICAgICAgICAgICAgICBjMiA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICAgICAgICAgIGlmICghYzAgfHwgIWMxIHx8ICFjMikgcmV0dXJuIFxcXCJ0b2FzdDovL2Nvb2tpZeagvOW8j+mUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgIF8uamlleGkgPSBnZXRQcml2YXRlSlMoYHVybCA9IEpTT04ucGFyc2UoZmV0Y2goXy51cmwgKyBcXFwiL2FwaS9zZXJ2aWNlL211c2ljL2Rvd25sb2FkSW5mby9cXFwiICsgdDEgKyBcXFwiP2lzTXY9MCZmb3JtYXQ9XFxcIiArIHQzICsgXFxcIiZicj1cXFwiICsgdDIgKyBcXFwiJmxldmVsPVxcXCIsIHtcXG4gICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAnVXNlci1BZ2VudCc6ICdva2h0dHAvMy4xMC4wJyxcXG4gICAgICAgICdjaGFubmVsJzogJ3FxJyxcXG4gICAgICAgICdwbGF0JzogJ2FyJyxcXG4gICAgICAgICduZXQnOiAnd2lmaScsXFxuICAgICAgICAndmVyJzogJzMuMS4yJyxcXG4gICAgICAgICd1aWQnOiAnJHtjMH0nLFxcbiAgICAgICAgJ3Rva2VuJzogJyR7YzF9JyxcXG4gICAgICAgICdkZXZJZCc6ICcke2MyfSdcXG4gICAgfVxcbn0pKS5kYXRhLnVybDtgKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnbWcnOlxcbiAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKF8sIHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0aXRsZVxcXCI6IFxcXCLlkqrlkpXpn7PkuZBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwczovL20ubXVzaWMubWlndS5jblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcImhTM2RyWWtwN09JMXhLT2MyQmtmcVE9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiaHFcXFwiOiBcXFwiUHdYcnZ2em0wNGZ0b0NuVVdrcEpGdz09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzcVxcXCI6IFxcXCI1L21LOVRjWjFpOGgvWTl6MU5IaHp3PT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImhyXFxcIjogXFxcInc1bFFueVhWYWhKc1lHZVVlK3BOdXc9PVxcXCIsXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL1NFU1NJT049L2kpO1xcbiAgICAgICAgICAgICAgICBjMCA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICAgICAgICAgIGlmICghYzApIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICBfLmppZXhpID0gZ2V0UHJpdmF0ZUpTKGBoZWFkZXJzID0ge1xcbiAgICBoZWFkZXJzOiB7XFxuICAgICAgICBcXFwiUmVmZXJlclxcXCI6IF8udXJsICsgXFxcIi92NC9cXFwiLFxcbiAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUEsXFxuICAgICAgICBcXFwiQnlcXFwiOiBtZDUoTU9CSUxFX1VBKSxcXG4gICAgICAgIFxcXCJDb29raWVcXFwiOiBcXFwiU0VTU0lPTj0ke2MwfVxcXCJcXG4gICAgfVxcbn07XFxudSA9IF8udXJsICsgXFxcIi9taWd1bXVzaWMvaDUvcGxheS9hdXRoL2dldFNvbmdQbGF5SW5mbz90eXBlPVxcXCIgKyB0MiArIFxcXCImY29weXJpZ2h0SWQ9XFxcIiArIHQxO1xcbnVybCA9IFxcXCJodHRwczpcXFwiICsgSlNPTi5wYXJzZShmZXRjaCh1LCBoZWFkZXJzKSkuZGF0YS5wbGF5VXJsO2ApO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJqeGxpc3RfXFxcIiArIF8udHlwZSwgW10pO1xcbiAgICAgICAganhsaXN0LnVuc2hpZnQoXyk7XFxuICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4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cXG4gICAgICAgICAgICBkZWxldGUgXy5jb2xfdHlwZTtcXG4gICAgICAgICAgICByZXR1cm4gXztcXG4gICAgICAgIH0pO1xcbiAgICAgICAgY2xlYXJNeVZhcignYWRkbGlzdCcpO1xcbiAgICAgICAgY2xlYXJNeVZhcignYWRkcGl0Y2gnKTtcXG4gICAgICAgIGlmICh0eXBlID09PSAwKVxcbiAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLmxvZ0RhdGEobmV3RGF0YXMsIHNpLCBuYW1lIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgIGVsc2UgaWYgKHR5cGUgPT09IDEpXFxuICAgICAgICAgICAgcmV0dXJuICQobmFtZSB8fCBcXFwiXFxcIiwgXFxcIuehruWumuWIhue7hOWQjeensFxcXCIpLmlucHV0KChzaSwgbmV3RGF0YXMpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDEsXFxuICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IG5ld0RhdGFzXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5nZXRTaGFyZShqc29uLCBmYWxzZSwgbmV3RGF0YXMubGVuZ3RoKTtcXG4gICAgICAgICAgICB9LCBzaSwgbmV3RGF0YXMpO1xcbiAgICB9LCBhZGRsaXN0LCBfLnNpLCBfLnR5cGUsIF8ubmFtZSksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgIH1dXFxuICAgIH0sXFxuICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdhZGQnKVxcbn0pO1xcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIua4qemmqOaPkOekulwiLFwicGF0aFwiOlwibm90aWNlXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSBmdW5jdGlvbigpIHtcXG4gICAgbGV0IGYgPSBcXFwiR3JheVxcXCI7XFxuICAgIGxldCB0ID0gZmFsc2U7XFxuICAgIGxldCBhcnIgPSBbXTtcXG4gICAgbGV0IHVwID0gZ2V0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnJyk7XFxuICAgIGxldCB1cmwsIHYsIHJ1biwgVDtcXG4gICAgaWYgKHVwICE9ICcxJykge1xcbiAgICAgICAgbGV0IHZlcnNpb24gPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vaG9tZUDmrYzor43pgILphY1cXFwiKSkudmVyc2lvbjtcXG4gICAgICAgIGlmICh1cCA9PSAnJykge1xcbiAgICAgICAgICAgIFt1cmwsIHYsIHJ1bl0gPSAkLnJlcXVpcmUoXFxcImxhbnpvdT9ydWxlPeatjOivjemAgumFjVxcXCIpLmxpc3Rfb25lKFxcXCJodHRwczovL3d3ci5sYW56b3VpLmNvbS9iMDNyMzc5aGNcXFwiLCBcXFwiZ2NzcFxcXCIpO1xcbiAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAndHJ1ZScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgKi9cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgdiA9IHZlcnNpb24gKyAxO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHZlcnNpb24gPCB2KSB7XFxuICAgICAgICAgICAgZiA9IFxcXCJyZWRcXFwiO1xcbiAgICAgICAgICAgIHQgPSBcXFwi5qOA5rWL5Yiw5paw54mI5pu05paw77yM54K55Ye75LqG6Kej6K+m5oOF44CCXFxcIjtcXG4gICAgICAgICAgICBUID0gXFxcIuabtOaWsOWGheWuuVxcXCI7XFxuICAgICAgICAgICAgaWYgKHVwID09ICcnKSB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKCd1cGRhdGUwJywgJzEnKSA9PSAnMScpIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDmj5DnpLonLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+ajgOa1i+WIsOS9oOeahOinhOWImeeJiOacrOWwj+S6juacjeWKoeWZqOeJiOacrO+8jOaYr+WQpueri+WNs+abtOaWsO+8nycsXFxuICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChkYSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAkLnJlcXVpcmUoXFxcImxhbnpvdT9ydWxlPeatjOivjemAgumFjVxcXCIpLm9uZV91cmwoZGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh1cCwgdmVyc2lvbikgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsYW56b3U/cnVsZT3mrYzor43pgILphY1cXFwiKS5vbmVfaW5mbyh1cCwgXFxcImdjc3BcXFwiLCB2ZXJzaW9uKTtcXG4gICAgICAgICAgICB9LCB1cmwgfHwgdXAsIHZlcnNpb24pO1xcbiAgICAgICAgICAgIGFyci5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfnqIvluo/orr7nva4nLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9pbnN0YWxsI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjP3BhZ2VUaXRsZT3nqIvluo/orr7nva4nO1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgaWYgKCF0KSB7XFxuICAgICAgICBUID0gXFxcIueoi+W6j+iuvue9rlxcXCI7XFxuICAgICAgICB1cmwgPSBcXFwiaGlrZXI6Ly9wYWdlL2luc3RhbGwjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjI25vUmVmcmVzaCNcXFwiO1xcbiAgICAgICAgbGV0IGhvdXIgPSBuZXcgRGF0ZSgpLmdldEhvdXJzKCk7XFxuICAgICAgICBpZiAoaG91ciA8IDUpIHtcXG4gICAgICAgICAgICB0ID0gXFxcIua3seWknO+8jOeOsOWcqOeahOWknO+8jOeGrOW+l+WPquaYr+i/mOacquaUueWPmOeahOS5oOaDr1xcXCI7XFxuICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMSkge1xcbiAgICAgICAgICAgIHQgPSBcXFwi5pep5a6J77yM5riF5pmo54a55b6u55qE6Ziz5YWJ77yMIOaYr+S9oOWcqOW+rueskeWQl1xcXCI7XFxuICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNCkge1xcbiAgICAgICAgICAgIHQgPSBcXFwi5Y2I5aW977yM5Ly06ZqP552A54af5oKJ55qE5LmQ5puy77yM6IGG5ZCs552A5Yqo5Lq655qE5peL5b6LXFxcIjtcXG4gICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE5KSB7XFxuICAgICAgICAgICAgdCA9IFxcXCLlpJXmmq7vvIzkvLzmuIXpo47phonmmZrpnJ7vvIzkuI3nu4/mhI/pl7Tnm4jnrJHlm57nnLhcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB0ID0gXFxcIuWknOaZmu+8jOS4gOS4quWuiemdmeeahOinkuiQve+8jOmdmemdmeWcsOiBhuWQrOWknOabslxcXCI7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHQuZm9udGNvbG9yKGYpLnNtYWxsKCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHBhZ2VUaXRsZTogVCxcXG4gICAgICAgICAgICBsaW5lVmlzaWJsZTogZ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ICAgICAgICBpc1RwID0gIXVybC5tYXRjaChcXFwiL3RwL1xcXCIpO1xcbiAgICAgICAgaWYgKGlzVHAgJiYgIW5vVHApIHtcXG4gICAgICAgICAgICBkYSA9IHVybC5yZXBsYWNlKC9eKC4qP1xcXFwuY29tKS8sICckMS90cCcpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBkYSA9IHVybDtcXG4gICAgICAgIH1cXG4gICAgICAgIGh0bWwgPSBTdHJpbmcoSHRtbCB8fCBmZXRjaChkYSwgaGVhZCkpO1xcbiAgICAgICAgaWYgKGh0bWwgPT0gXFxcIlxcXCIgJiYgaXNUcCAmJiAhbm9UcCkge1xcbiAgICAgICAgICAgIHJldHVybiBvbmVfdXJsKHVybCwgcHdkLCBydW4sIHRydWUpO1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBwYXRoID0gaHRtbC5tYXRjaCgvbGluayA9IFsnXFxcIl0oW15cXFwiJ10rKS9pKVsxXTtcXG4gICAgICAgICAgICBob3N0ID0gdXJsLm1hdGNoKC9eKC4qP1xcXFwuY29tXFxcXC8pLylbMV07XFxuICAgICAgICAgICAgcmV0dXJuIG9uZV91cmwoaG9zdCArIHBhdGgsIHB3ZCwgcnVuKTtcXG4gICAgICAgIH0gY2F0Y2ggKGVycjApIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBwYXRoID0gaHRtbC5tYXRjaCgvJyhcXFxcPy4rPyknLylbMV07XFxuICAgICAgICAgICAgICAgIGhvc3QgPSBcXFwiaHR0cHM6Ly9kZXZlbG9wZXIubGFuem91Zy5jb21cXFwiO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycjEpIHtcXG4gICAgICAgICAgICAgICAgZXZhbChodG1sLm1hdGNoKC92YWx1ZVxcXFw7KFtcXFxcc1xcXFxTXSs/KVxcXFwkXFxcXCgvaSlbMV0pO1xcbiAgICAgICAgICAgICAgICBldmFsKCdib2R5PScgKyBodG1sLm1hdGNoKC9bXFxcXHNcXFxcU10qZGF0YSA6KFtcXFxcc1xcXFxTXSo/XFxcXH0pLFxcXFxzKy8pWzFdKTtcXG4gICAgICAgICAgICAgICAgdSA9IFN0cmluZyh1cmwpLnJlcGxhY2UoL1xcXFwuY29tLiovLCBcXFwiLmNvbS9hamF4bS5waHBcXFwiKTtcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkLmhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICBib2R5XFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgcGF0aCA9IF8udXJsO1xcbiAgICAgICAgICAgICAgICBob3N0ID0gXy5kb207XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdSA9IGhvc3QgKyBcXFwiL2ZpbGUvXFxcIiArIHBhdGg7XFxuICAgICAgICBrID0gSlNPTi5wYXJzZShmZXRjaCh1LCB7XFxuICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvbjtcXG4gICAgICAgIGsgPSBBcnJheS5pc0FycmF5KGspID8ga1swXSA6IGs7XFxuICAgICAgICBpZiAocnVuKSByZXR1cm4gaztcXG4gICAgICAgIGxldCBmID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvX2ZpbGVTZWxlY3RfcnVsZS5qc29uXFxcIjtcXG4gICAgICAgIGRvd25sb2FkRmlsZShrLCBmKTtcXG4gICAgICAgIHJldHVybiBmO1xcbiAgICB9IGNhdGNoIChlcnIyKSB7XFxuICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgIH1cXG59O1xcbiQuZXhwb3J0cyA9IHtcXG4gICAgbGlzdF9vbmU6IGZ1bmN0aW9uK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2dpLCBcXFwiPGJyPlxcXCIpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwiPGI+4oCc4oCc56Gu5a6a5pu05paw4oCd4oCdPC9iPlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKHVybCwgcHdkLCBpdGVtLCBpc0xvb2spID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdSdWxlX25vdXBkYXRlJykgPT0gJzEnICYmICFpc0xvb2spIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrKHRydWUpLCBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgIG9uZV91cmxcXG4gICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2xhbnpvdT9ydWxlPeatjOivjemAgumFjVxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgSyA9IG9uZV91cmwodXJsLCBwd2QsIDEsIDAsIGl0ZW0pO1xcbiAgICAgICAgICAgICAgICBpZiAoIUspIHtcXG4gICAgICAgICAgICAgICAgICAgIEsgPSBvbmVfdXJsKHVybCwgcHdkLCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIUspIHtcXG4gICAgICAgICAgICAgICAgICAgIEsgPSBvbmVfdXJsKHVybC5zcGxpdChcXFwiP1xcXCIpWzBdLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChLKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZiA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0X3J1bGUuanNvblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoSywgZik7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ojrflj5bkuIvovb3pk77mjqXlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgdXJsLCBwd2QsIGl0ZW0sICEhaXNMb29rKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIueoi+W6j+iuvue9rlwiLFwicGF0aFwiOlwiaW5zdGFsbFwiLFwicnVsZVwiOlwianM6XFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG5sZXQgXyA9IEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9ob21lQOatjOivjemAgumFjVxcXCIpKTtcXG5sZXQgZCA9IFtdO1xcbmQucHVzaCh7XFxuICAgIGltZzogXy5pY29uLFxcbiAgICBjb2xfdHlwZTogJ3BpY18xX2NlbnRlcicsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgIH0sXFxuICAgIHVybDogJChbXFxuICAgICAgICBcXFwiW+mFt+eLl+amguW/teeJiF0g5ZCs5q2M6aKG5Lya5ZGYXFxcIixcXG4gICAgICAgIFxcXCJbUVHpn7PkuZBdIOWIt+aWsGNvb2tpZVxcXCIsXFxuICAgIF0sIDEsIFxcXCLpgInmi6nmianlsZXmk43kvZxcXFwiKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAzOyBpKyspIHtcXG4gICAgICAgICAgICBjbGVhck15VmFyKCd2aXBydWxlX2MnICsgaSk7XFxuICAgICAgICB9XFxuICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgY2FzZSAnW1FR6Z+z5LmQXSDliLfmlrBjb29raWUnOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZDtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignYmFjaycpID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2JhY2snKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gW107XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5Yi35pawY29va2llJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IF8gPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3RfcXEnLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZpbmQoXyA9PiBtZDUoXy50aXRsZSArIF8udXJsKSA9PSBcXFwiZTJjMWE0YmY4ZDU4ZDE3MDNhNWU4MTA5ZTFmOTBjYzBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn5q+P5LiD5aSp6ZyA6KaB5Yi35paw5LiA5qyhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ2Nvb2tpZSDpnIDopoHljIXlkKsgcW1fa2V5c3Qg5ZKMIHVpbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogNCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcInZpcHJ1bGVfYzBcXFwiLCBpbnB1dCk7YCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LuO6Kej5p6Q6I635Y+WXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9zZWFyY2g2XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29va2llO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnNpZ25pbiA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tpZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL0Nvb2tpZTogXFxcIihbXlxcXCJdKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBjb29raWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5q2j5Zyo6LCD55So6Kej5p6Q5Y+C5pWwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5aW95YOP6L+Y5rKh5Yiw5Yi35paw5pe26Ze077yM56Gu5a6a6I635Y+W5ZCX77yfXFxcIikuY29uZmlybSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvQ29va2llOiBcXFwiKFteXFxcIl0rKS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBjb29raWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mraPlnKjosIPnlKjop6PmnpDlj4LmlbAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ayoeaciVFR6Z+z5LmQ55qE6Kej5p6QXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi56Gu5a6a5Yi35pawXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9tZW51NlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSBTdHJpbmcoZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzAnKSkudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZSAmJiBjb29raWUgIT0gXFxcIlxcXCIgJiYgY29va2llLm1hdGNoKFxcXCJxbV9rZXlzdD1cXFwiKSAmJiBjb29raWUubWF0Y2goXFxcInVpbj1cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmkgPSAkLnJlcXVpcmUoXFxcInFxP3J1bGU95q2M6K+N6YCC6YWNXFxcIikucmVmcmVzaF9sb2dpbihjb29raWUsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHVyaSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikucnVsZSgoW3FtX2tleXN0LCB1aW5dKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29va2llID0gYHFtX2tleXN0PSR7cW1fa2V5c3R9OyB1aW49JHt1aW59O2BcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5Yi35paw5oiQ5YqfJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICdjb29raWXliLfmlrDmiJDlip8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPGJyPjxoNiBzdHlsZT1cXFwidGV4dC1hbGlnbjogY2VudGVyO1xcXCI+JyArIGNvb2tpZSArIFxcXCI8L2g2PlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlpI3liLZjb29raWVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoY29va2llKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignYmFjaycsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgXFxcImNvcHk6Ly9cXFwiICsgY29va2llO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBjb29raWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2Nsb3VkNlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWvvOWFpei/m+ino+aekFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKChrZXksIHVpbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2JhY2snLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzEnLCB1aW4pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXRFZGl0MihcXFwicXFcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwga2V5LCB1aW4pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2Rvd25sb2FkNlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVyaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVyaTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogJ+WIt+aWsOaIkOWKnycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnW+mFt+eLl+amguW/teeJiF0g5ZCs5q2M6aKG5Lya5ZGYJzpcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikucnVsZSgodHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKCflkKzmrYzpoobkvJrlkZgnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBfID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X2tnJywgW10pXFxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbmQoXyA9PiBtZDUoXy50aXRsZSArIF8udXJsKSA9PSBcXFwiYzg3N2FlNzJiOTdiYzI2NzIwYWQ4YjFhMzkzNjJkNDdcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBkID0gW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn5q+P5aSp5Y+q6IO96aKG5Y+W5LiA5qyhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1dO1xcbiAgICAgICAgICAgICAgICAgICAgWyd1c2VyaWQnLCAndG9rZW4nLCAnc2lnbmtleSddLm1hcCgodCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IHQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3ZpcHJ1bGVfYycgKyBpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcInZpcHJ1bGVfYyR7aX1cXFwiLCBpbnB1dCk7YCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LuO6Kej5p6Q6I635Y+WXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX3NlYXJjaDZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uc2lnbmluID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF0ID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvXFxcIihbXlxcXCJdKylcXFwiLCBcXFwiKC4rKVxcXCIsIFxcXCIzMTE2XFxcIiwgXFxcIiguKylcXFwiLyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBtYXRbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MxJywgbWF0WzJdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMicsIG1hdFszXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5q2j5Zyo6LCD55So6Kej5p6Q5Y+C5pWwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S7iuWkqeW3sue7j+etvuWIsOi/h+S6hic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ5qaC5b+154mI55qE6Kej5p6QXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgXylcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuehruWumumihuWPllxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9tZW51NlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1c2VyaWQgPSBnZXRNeVZhcigndmlwcnVsZV9jMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9rZW4gPSBnZXRNeVZhcigndmlwcnVsZV9jMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2lnbmtleSA9IGdldE15VmFyKCd2aXBydWxlX2MyJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZDUoc2lnbmtleSkgPT0gXFxcIjc4YzYwYzM1ZTU5MGJlZThlMTRiYWU0NGJkZTUxMjc3XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHQxID0gJC5kYXRlRm9ybWF0KG5ldyBEYXRlKCkuZ2V0VGltZSgpLCAneXl5eU1NZGQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0MiA9ICQuZGF0ZUZvcm1hdChfLnRpbWUsICd5eXl5TU1kZCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1hdCA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL1xcXCIoW15cXFwiXSspXFxcIiwgXFxcIiguKylcXFwiLCBcXFwiMzExNlxcXCIsIFxcXCIoLispXFxcIi8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1hdHggPSB1c2VyaWQgPT0gbWF0WzFdICYmIHRva2VuID09IG1hdFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXR4ICYmIHQxIDwgdDIgJiYgXy5zaWduaW4gPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ku4rlpKnlt7Lnu4/nrb7liLDov4fkuoYnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLkxpdGVfU2lnbmluKFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaWdua2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXR4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9zaWdua2V56ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH0pXFxufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08Yj5cXFwiICsgU3RyaW5nKF8udmVyc2lvbikucmVwbGFjZSgvKFxcXFxkXFxcXGQpKFxcXFxkXFxcXGQpJC8sIFxcXCItJDEtJDJcXFwiKS5mb250Y29sb3IoXFxcInJlZFxcXCIpLnNtYWxsKCkgKyBcXFwiPC9iPlxcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh2ZXJzaW9uKSA9PiB7XFxuICAgICAgICBsZXQgaG9zdCA9IFxcXCJodHRwczovL3d3ci5sYW56b3VpLmNvbVxcXCI7XFxuICAgICAgICBsZXQgbGlzdCA9ICQucmVxdWlyZShcXFwibGFuem91P3J1bGU95q2M6K+N6YCC6YWNXFxcIilcXG4gICAgICAgICAgICAubGlzdF9vbmUoaG9zdCArIFxcXCIvYjAzcjM3OWhjXFxcIiwgXFxcImdjc3BcXFwiLCAxKVxcbiAgICAgICAgICAgIC5tYXAoXyA9PiAoe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPGI+4oCY4oCYXFxcIiArIChfLm5hbWVfYWxsLm1hdGNoKHZlcnNpb24pID8gXy5uYW1lX2FsbCArIFxcXCLigJnigJlcXFwiIDogXFxcIuKAmeKAmVxcXCIgKyBfLm5hbWVfYWxsKSArICc8L2I+JyxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAmOKAmOKAmeKAmVxcXCIgKyAoJ/Cfkr4gJyArIF8uaWNvbiArICfjgIDwn5OlICcgKyBfLnNpemUgKyAn44CA4o+x77iPICcgKyBfLnRpbWUpLnNtYWxsKCksXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh1cCwgdmVyc2lvbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGFuem91P3J1bGU95q2M6K+N6YCC6YWNXFxcIikub25lX2luZm8odXAsIFxcXCJnY3NwXFxcIiwgdmVyc2lvbiwgMSk7XFxuICAgICAgICAgICAgICAgIH0sIGhvc3QgKyAnL3RwLycgKyBfLmlkLCB2ZXJzaW9uKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogXy5uYW1lX2FsbCxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pKTtcXG4gICAgICAgIHNldFJlc3VsdChsaXN0KTtcXG4gICAgfSwgXy52ZXJzaW9uKSxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIHBhZ2VUaXRsZTogJ+WOhuWPsueJiOacrCcsXFxuICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgfVxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPGI+XFxcIiArIFxcXCLpu5jorqTorr7nva48YnI+PGJyPjxzbWFsbD7lsI/nqIvluo/pu5jorqTorr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0cmE6IHtcXG4gICAgICAgICAgICAgICAgcGFnZVRpdGxlOiAnaWt1buWFrOebiumfs+a6kC5qcydcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mjKXmna/lip08L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiBcXFwiZG93bmxvYWQ6Ly9odHRwczovL21pcnJvci5naHByb3h5LmNvbS9odHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vSHVpYnEva2VlcC1hbGl2ZS9tYXN0ZXIvbHhtdXNpY2FwaS5qc1xcXCIsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6ICfmjKXmna/lip3pn7PmupAuanMnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuXFxuXFxuICAgICAgICBsaW5lKCk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+TXVzaWNGcmVlPC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdodHRwczovL211c2ljZnJlZS51cHVwLmZ1bi8jbm9IaXN0b3J5IycsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9tdXNpY2ZyZWUudXB1cC5mdW4vaW1nL2xvZ28ucG5nJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7lrpjmlrk8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIueCueWHu+ehruWumuWkjeWItumTvuaOpVxcXFxuXFxcIiArIHVybCkuY29uZmlybSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH0sIFxcXCJodHRwczovL2dpdGVlLmNvbS9tYW90b3VtYW8vTXVzaWNGcmVlUGx1Z2lucy9yYXcvbWFzdGVyL3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuS9nOiAhTwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vZ2l0ZWUuY29tL1Rob21hc1lvdS9tdXNpY2ZyZWUvcmF3L21hc3Rlci9kaXN0L3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPumAn+aCpjwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHA6Ly9hZGFkMjN1LmFwcGluc3RhbGwubGlmZS9kaXN0L19wbHVnaW5zL3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuaMpeadr+WKnTwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0d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CBpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIFN0cmluZyhpKSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcblxcblxcblxcbiAgICAgICAgbGluZSgpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuW8ueeql+aPkOekujwvYj4nLnNtYWxsKCksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vNDEucG5nJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCB1MCA9IGdldEl0ZW0oJ3VwZGF0ZTAnLCAnMScpID09ICcxJztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7lsI/nqIvluo/mm7TmlrA8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1MCkgPT4ge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCd1cGRhdGUwJywgdTApO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgdTAgPyAnMCcgOiAnMScpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh1MCA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCB1MSA9IGdldEl0ZW0oJ3VwZGF0ZTEnLCAnMScpID09ICcxJztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mpoLlv7XniYjnrb7liLA8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1MSkgPT4ge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCd1cGRhdGUxJywgdTEpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgdTEgPyAnMCcgOiAnMScpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh1MSA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCB1MiA9IGdldEl0ZW0oJ3VwZGF0ZTInLCAnMCcpID09ICcxJztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj5xcemfs+S5kOWIt+aWsDwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHUyKSA9PiB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3VwZGF0ZTInLCB1Mik7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB1MiA/ICcwJyA6ICcxJyksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKHUyID8gNTUgOiA2MykgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcblxcblxcblxcbiAgICAgICAgbGluZSgpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPum7mOiupOS4u+mhtTwvYj4nLnNtYWxsKCksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vNDIucG5nJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBwbGF0Zm9ybSA9IGdldEl0ZW0oJ3BsYXRmb3JtJywgJ2t3Jyk7XFxuICAgICAgICBwbGF0Zm9ybXMuc2xpY2UoMCwgOCkubWFwKHRpdGxlID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUgPT0gcGxhdGZvcm0gPyBSaWNoKFN0cm9uZyhDb2xvcih0aXRsZSkpKSA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfNCcsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodGl0bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3BsYXRmb3JtJywgdGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgdGl0bGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG5cXG5cXG5cXG4gICAgICAgIGxpbmUoKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7pu5jorqTmkJzntKI8L2I+Jy5zbWFsbCgpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzQzLnBuZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgc19wbGF0Zm9ybSA9IGdldEl0ZW0oJ3NfcGxhdGZvcm0nLCAna3cnKTtcXG4gICAgICAgIHBsYXRmb3Jtcy5zbGljZSgxLCA2KS5tYXAodGl0bGUgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSA9PSBzX3BsYXRmb3JtID8gUmljaChTdHJvbmcoQ29sb3IodGl0bGUpKSkgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzUnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCdzX3BsYXRmb3JtJywgdGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgdGl0bGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG5cXG5cXG5cXG4gICAgICAgIGxpbmUoKTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBwYWdlVGl0bGU6ICfnqIvluo/pu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XG4gICAgICAgIGNvbF90eXBlOiBcXFwiY2FyZF9waWNfMlxcXCIsXFxuICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKShwKSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgcGFnZVRpdGxlOiBfW3BdICsgJ+mFjee9ridcXG4gICAgICAgIH0sXFxuICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgodHlwZSkgPT4ge1xcbiAgICAgICAgICAgIHN3aXRjaCAodHlwZSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICdxcSc6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ2Nvb2tpZeacieaViOacnzflpKnvvIzlt7LmlK/mjIHliLfmlrBjb29raWUnLCAn5by556qX5o+Q56S66buY6K6k5YWz6Zet77yM6K+35omL5Yqo5byA5ZCvJywgWydxbV9rZXlzdCcsICd1aW4nXV07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnd3knOlxcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gWyd3ZWFwaeW3suaUueaIkGVhcGknLCAn5bqU6K+l5omA5pyJ6Z+z6LSo6YO96IO96I635Y+W5LqGJywgWydNVVNJQ19VJ11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2tnJzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsn5Y+v5Lul5oqT572R6aG156uv55qEY29va2llJywgJ+OAgCcsIFsndXNlcmlkJywgJ3Rva2VuJ11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2tnMic6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ+W3suaUr+aMgeavj+WkqeetvuWIsOmihuS8muWRmCcsICdzaWdua2V55YWz6ZSu6K+NTG5UNnhwJywgWyd1c2VyaWQnLCAndG9rZW4nLCAnc2lnbmtleSddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdrdyc6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ+iHquW3seWGmWpz6I635Y+WJywgJ2h0dHBzOi8vZ2l0aHViLmNvbS95aHNqMDkxOS9tdXNpY19hcGkvYmxvYi9tYWluL2xpYi9hcGkva3V3by9tb2R1bGUvc29uZy5kYXJ0JywgWydyaWTkvKDlj4LkuLrvvJp0MVxcXFxuYnLkvKDlj4LkuLrvvJp0MlxcXFxuZGVz6LCD55So77yaJC5yZXF1aXJlKFxcXCJrdz9ydWxlPeatjOivjemAgumFjVxcXCIpLmRlcyhzdHIpOyddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdrdzInOlxcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gWyfku45BUFDmipPljIUnLCAn44CAJywgWyd1aWQnLCAndG9rZW4nLCAnZGV2aWQnXV07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnbWcnOlxcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gWyfku47nvZHpobXnmbvlvZUnLCAn44CAJywgWydTRVNTSU9OJ11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ+S9nOiAhSc6XFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSAndG9hc3Q6Ly/pgqLllYrvvIzkvZzogIXkuI3mg7PmlLbliLDlvovluIjlh73vvIzmmoLkuI3mlK/mjIEnO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlICE9ICfkvZzogIUnKSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMzsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd2aXBydWxlX2MnICsgaSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMjbm9SZWZyZXNoI1xcXCIpLnJ1bGUoKHR5cGUsIFt0aXRsZSwgZGVzYywgY29va2llc10pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBkID0gW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1dO1xcbiAgICAgICAgICAgICAgICAgICAgY29va2llcy5tYXAoKHQsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiB0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHQ6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IHR5cGUgPT0gJ2t3JyA/IDcgOiAzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcigndmlwcnVsZV9jJyArIGkpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IGBwdXRNeVZhcihcXFwidmlwcnVsZV9jJHtpfVxcXCIsIGlucHV0KTtgLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJznoa7lrprlr7zlhaXigJ3igJ1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXRFZGl0Mih0eXBlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB0eXBlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgfSwgdHlwZSwgYXJyKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgIH0sIHApLFxcbiAgICB9KTtcXG59XFxuc2V0UmVzdWx0KGQpO1wifV0iLCJpY29uIjoiaHR0cDovL21tYml6LnFwaWMuY24vbW1iaXpfcG5nLzVzN0oyOFU5R0hWaWNEN2d1dnliYXNlODZIaEhDMTJvT0RidHJzZ0s3Q3hyajVRcEw2Z0tueWliZVpEd0VLSVZLVU90UG9IY3hwZndhMHBvbloxaWE1bmxBLzA/d3hfZm10PXBuZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment