xiaomianao666

小程序:歌词适配

Apr 16th, 2024
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@歌词适配@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5q2M6K+N6YCC6YWNIiwiYXV0aG9yIjoiVGhvbWFz5ZayIiwidXJsIjoiaGlrZXI6Ly9lbXB0eT9wPWZ5cGFnZSIsInZlcnNpb24iOjIwMjQwNDE1LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6Im11c2ljIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6JC5yZXF1aXJlKCdob21lP3J1bGU95q2M6K+N6YCC6YWNJyk7Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHk/cz0qKiIsImdyb3VwIjoi6Z+z6aKRIiwic2VhcmNoRmluZCI6ImpzOlxuc2V0UmVzdWx0KFt7XG4gICAgdGl0bGU6IFwi5pCc57SiID0+IFwiICsgTVlfS0VZV09SRCxcbiAgICBkZXNjOiAn6YCa6L+HXCLpq5jnuqfmkJzntKJcIumhtemdouaQnOe0oicsXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzX3QyKSA9PiB7XG4gICAgICAgIGlmIChnZXRNeVZhcignc19wbGF0Zm9ybScsICdsaWInKSA9PSAnbGliJylcbiAgICAgICAgICAgIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgZ2V0SXRlbSgnc19wbGF0Zm9ybScsICdrdycpKTtcbiAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBzX3QyKTtcbiAgICAgICAgY2xlYXJNeVZhcignc2VhcmNo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KHIxKSB7XFxuICAgICAgICBfLnRpdGxlID0gUmljaChfLnRpdGxlKS5yZXBsYWNlKFxcXCLigJjigJjigJnigJlcXFwiLCAnJyk7XFxuICAgICAgICBfLmltZyA9IFN0cmluZyhfLmltZykucmVwbGFjZSgve3NpemV9L2dpLCAnNDgwJyk7XFxuICAgICAgICBfLmNvbnRlbnQgPSBfLmNvbnRlbnQgKyAnJztcXG4gICAgICAgIF8uenlpZCA9IF8uenlpZCArICcnO1xcbiAgICAgICAgaWYgKCFfLmRlc2MpIF8uZGVzYyA9IHRoaXNfcGxhdGZvcm07XFxuICAgIH1cXG4gICAgbGV0IHI0LCB0MSA9IE51bWJlcihfLmNvbnRlbnQucmVwbGFjZSgvXihcXFxcZD9cXFxcRFxcXFxkPykrJC8sICcwJykpIDwgMiA/IDAgOiAxO1xcbiAgICBfLmV4dHJhID0ge1xcbiAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgIGNsczogaWQgKyAnOmFkZGxpc3QnLFxcbiAgICAgICAgaWQ6IFtfLmRlc2MsIF8uenlpZCA9PSBcXFwidW5kZWZpbmVkXFxcIiA/IE1hdGgucmFuZG9tKCkgOiBfLnp5aWQsIF8uY29udGVudF0uam9pbihcXFwiJFxcXCIpLFxcbiAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4piFIOaUtuiXj1xcXCIgKyAodDEgPyAn5q2M5Y2VJyA6ICfljZXmm7InKSArIFxcXCIg4piFXFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygodDEsIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikubG9nRGF0YShfLCB0MSk7XFxuICAgICAgICAgICAgfSwgdDEsIF8pXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLimIUg5om56YeP5pS26JePIOKYhVxcXCIsXFxuICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGNsc0lkLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IDAsXFxuICAgICAgICAgICAgICAgICAgICBwaXRjaDogMCxcXG4gICAgICAgICAgICAgICAgICAgIHNpOiBzaSxcXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZGF0YTogZmluZEl0ZW1zQnlDbHMoY2xzSWQpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL19jYXRjaC9JbXBvcnQudHh0XFxcIiwgSlNPTi5zdHJpbmdpZnkoanNvbikpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9yZWx5MiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT3mrYzor43pgILphY1cXFwiO1xcbiAgICAgICAgICAgIH0sIGlkICsgJzphZGRsaXN0JywgdDEpXFxuICAgICAgICB9XVxcbiAgICB9O1xcbiAgICBpZiAoXy5kZXNjLm1hdGNoKC9xcXx3eXxrZ3xrd3xtZ3w1cy8pICYmIF8uY29udGVudCAhPSAzKSB7XFxuICAgICAgICBfLmV4dHJhLmxvbmdDbGljay5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKcqSDlpI3liLbpk77mjqUg4pypXFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygoYSwgYiwgYykgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5jb3B5dXJsKGEsIGIsIGMpO1xcbiAgICAgICAgICAgIH0sIF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQpXFxuICAgICAgICB9KTtcXG4gICAgfVxcblxcbiAgICBpZiAocjMpIHtcXG4gICAgICAgIHI0ID0gJChyMy5uYW1lcywgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgobmFtZXMsIHVybHMpID0+IHtcXG4gICAgICAgICAgICBsZXQgaSA9IG5hbWVzLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsc1tpXTtcXG4gICAgICAgIH0sIHIzLm5hbWVzLCByMy51cmxzKTtcXG4gICAgICAgIGlmIChyMSA9PSAyKSB7XFxuICAgICAgICAgICAgXy51cmwgPSByNDtcXG4gICAgICAgICAgICBfLmV4dHJhLnVybCA9IHIzO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBfLnVybCA9IHIzO1xcbiAgICAgICAgICAgIF8uZXh0cmEudXJsID0gcjQ7XFxuICAgICAgICB9XFxuICAgICAgICBfLmV4dHJhLmxvbmdDbGljay51bnNoaWZ0KHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDkuIvovb3mrYzmm7Ig4piFXFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygobmFtZXMsIHVybHMpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQobmFtZXMsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKG5hbWVzLCB1cmxzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpID0gbmFtZXMuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybHNbaV07XFxuICAgICAgICAgICAgICAgIH0sIG5hbWVzLCB1cmxzKTtcXG4gICAgICAgICAgICB9LCByMy5uYW1lcywgcjMudXJscylcXG4gICAgICAgIH0pO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgXy51cmwgPSBMYXp5KF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQsIHIxID09IDIpO1xcbiAgICAgICAgaWYgKCF0MSkge1xcbiAgICAgICAgICAgIF8uZXh0cmEudXJsID0gTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkLCByMSAhPSAyKTtcXG4gICAgICAgICAgICBfLmV4dHJhLmxvbmdDbGljay51bnNoaWZ0KHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLimIUg5LiL6L295q2M5puyIOKYhVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCwgMSkpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgXy5jb2xfdHlwZSA9ICdjYXJkX3BpY18zJztcXG4gICAgaWYgKHIyKSByZXR1cm4gXztcXG4gICAgZC5wdXNoKF8pO1xcbn1cXG5cXG5cXG5cXG4kLmV4cG9ydHMgPSB7XFxuXFxuXFxuXFxuICAgIGxvZ0RhdGE6IGZ1bmN0aW9uKG5ld0RhdGEsIHNpLCBuYW1lKSB7XFxuICAgICAgICBpZiAobmV3RGF0YS56eWlkID09PSBcXFwidW5kZWZpbmVkXFxcIilcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LiN5pSv5oyB5pS26JePflxcXCI7XFxuXFxuICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICBpZiAoenkgPT09IFxcXCJcXFwiKSB6eSA9IHtcXG4gICAgICAgICAgICBcXFwi5YWo6YOoXFxcIjogW11cXG4gICAgICAgIH0sIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpLCB6eSk7XFxuICAgICAgICBsZXQgenUgPSBPYmplY3Qua2V5cyh6eSk7XFxuXFxuXFxuICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuaWsOe7hFxcXCIpLCAzLCBcXFwi6YCJ5oup57uEXFxcIikuc2VsZWN0KCh6eSwgenUsIG5ld0RhdGEsIHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmlrDnu4RcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGlmICghenUuaW5jbHVkZXMoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChuYW1lLCBcXFwi6K+36L6T5YWl5paw57uE5ZCN56ewXFxcIikuaW5wdXQoKHp5LCB6dSwgbmV3RGF0YSwgc2kpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQudHJpbSgpLm1hdGNoKC9eXFxcXGQrfF5cXFxccyoo5paw57uEKT9cXFxccyokLykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nu4TlkI3kuI3og73kuLrnqbogJiDmnIDliY3pnaLkuI3og73mmK/mlbDlrZcgJiDkuZ/kuI3og73lj6vmlrDnu4RcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDMsICfor7fpgInmi6nmlrDnu4TkvY3nva4nKS5zZWxlY3QoKHp5LCBpbnB1dDIsIG5ld0RhdGFzLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3RGF0YSA9IEFycmF5LmlzQXJyYXkobmV3RGF0YXMpID8gbmV3RGF0YXMgOiBbbmV3RGF0YXNdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuacgOWQjumdolxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2lucHV0Ml0gPSBuZXdEYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4genkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2lucHV0Ml0gPSBuZXdEYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2ldID0genlbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobmV3RGF0YXMpKSBiYWNrKHRydWUpLCB0b2FzdCgn5oiQ5YqfJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB6eSwgaW5wdXQsIG5ld0RhdGEsIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHp5LCB6dSwgbmV3RGF0YSwgc2ksIG5hbWUpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIhue7hOWQjeensOmHjeWkjeS6hn5cXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIHp5ID0genlbaW5wdXRdO1xcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG5ld0RhdGEpKSB7XFxuICAgICAgICAgICAgICAgIHp5ID0genkuY29uY2F0KG5ld0RhdGEpO1xcbiAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcbiAgICAgICAgICAgICAgICB0b2FzdCgn5oiQ5YqfJyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBpbnB1dCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHp1ID0genkubWFwKGl0ID0+IGl0LnRpdGxlKTtcXG4gICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAyLCAn6K+36YCJ5oup6LWE5rqQ5L2N572uJykuc2VsZWN0KCh6eSwgenUsIGlucHV0MiwgbmV3RGF0YSwgc2kpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmnIDlkI7pnaJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICB6eS5wdXNoKG5ld0RhdGEpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSB6dS5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHp5LnNwbGljZShpLCAwLCBuZXdEYXRhKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSwgaW5wdXQyKTtcXG4gICAgICAgICAgICB9LCB6eSwgenUsIGlucHV0LCBuZXdEYXRhLCBzaSk7XFxuICAgICAgICB9LCB6eSwgenUsIG5ld0RhdGEsIHNpKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgc2V0RGF0YTogZnVuY3Rpb24oc2ksIHp5Miwga2V5KSB7XFxuICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICBpZiAoa2V5KSB7XFxuICAgICAgICAgICAgenlba2V5XSA9IHp5MjtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgenkgPSB6eTI7XFxuICAgICAgICB9XFxuICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSwgenkpO1xcbiAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aIkOWKn1xcXCI7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGNvcHl1cmw6IGZ1bmN0aW9uKEEsIEIsIEMpIHtcXG4gICAgICAgIHN3aXRjaCAoQSkge1xcbiAgICAgICAgICAgIGNhc2UgJ3FxJzpcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChCKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9pLnkucXEuY29tL24yL20vc2hhcmUvZGV0YWlscy90YW9nZS5odG1sP2lkPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9pLnkucXEuY29tL3Y4L3BsYXlzb25nLmh0bWw/c29uZ21pZD0nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICd3eSc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoQikge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8veS5tdXNpYy4xNjMuY29tL20vcGxheWxpc3Q/aWQ9JyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL3kubXVzaWMuMTYzLmNvbS9tL3Nvbmc/aWQ9JyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAna2cnOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChDLm1hdGNoKC9fLykpIHJldHVybiBcXFwidG9hc3Q6Ly/kuI3mlK/mjIFnY2lk6ZO+5o6l5YiG5LqrXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9tLmt1Z291LmNvbS93ZWliby8/c2hhcmVfdHlwZT1zcGVjaWFsJmlkPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9tLmt1Z291LmNvbS93ZWliby8/aGFzaD0nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdrdyc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoQikge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vbS5rdXdvLmNuL25ld2g1YXBwL3BsYXlsaXN0X2RldGFpbC8nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vbS5rdXdvLmNuL25ld2g1YXBwL3BsYXlfZGV0YWlsLycgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ21nJzpcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChCKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9tLm11c2ljLm1pZ3UuY24vdjMvbXVzaWMvcGxheWxpc3QvJyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ubXVzaWMubWlndS5jbi92My9tdXNpYy9zb25nLycgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzVzJzpcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChCKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cDovLzVzaW5nLmt1Z291LmNvbS90b3BpYy9zaGFyZS9zb25nbGlzdC8jLz9pZD0nICsgQztcXG4gICAgICAgICAgICAg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KEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogX18udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfXy5oZWFkUGljVXJsIHx8IF9fLmZyb250UGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogX18udG9wSWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEsIDEpKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJxcV9pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIGxldCBsaXN0LCBfLCB1O1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhSAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vdS55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2dcXFwiO1xcbiAgICAgICAgICAgICAgICBfID0gYWpheCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29tbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdDogJzE5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Y6ICcxODU5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZTogJ211c2ljLnBmX3NvbmdfZGV0YWlsX3N2cicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ2dldF9zb25nX2RldGFpbF95cXEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29uZ19taWQ6IHQxXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgIH0pLnJlcS5kYXRhLnRyYWNrX2luZm87XFxuICAgICAgICAgICAgICAgIGxldCBmID0gXy5maWxlO1xcblxcbiAgICAgICAgICAgICAgICAvLyDkuIvovb1cXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gW107XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5zaXplXzEyOG1wMylcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSArIFNpemUoZi5zaXplXzEyOG1wMykpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV8zMjBtcDMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKGYuc2l6ZV8zMjBtcDMpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLnNpemVfZmxhYylcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUoZi5zaXplX2ZsYWMpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLnNpemVfaGlyZXMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbNF0gKyBTaXplKGYuc2l6ZV9oaXJlcykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIHQxLCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBhcnIuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwicXFcXFwiLCB0MSwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgdDEsIF8pO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB2YXIgdXJsLCBpaSwgbHJjO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlpID0gZ2V0SXRlbSgncGxheV9wbGF0Zm9ybScsICcwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzMnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmW1xcXCJzaXplX2hpcmVzXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInFxXFxcIiwgdDEsIDMsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZbXFxcInNpemVfZmxhY1xcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJxcVxcXCIsIHQxLCAyLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmW1xcXCIzMjBtcDNcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwicXFcXFwiLCB0MSwgMSwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnBheS5wYXlfcGxheSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInFxXFxcIiwgdDEsIDAsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgKz0gYD9kYXRhPXtcXFwicmVxXzBcXFwiOntcXFwibW9kdWxlXFxcIjpcXFwidmtleS5HZXRWa2V5U2VydmVyXFxcIixcXFwibWV0aG9kXFxcIjpcXFwiQ2dpR2V0VmtleVxcXCIsXFxcInBhcmFtXFxcIjp7XFxcImd1aWRcXFwiOlxcXCIwXFxcIixcXFwicGxhdGZvcm1cXFwiOlxcXCIyMFxcXCIsXFxcImZpbGVuYW1lXFxcIjpbXFxcIk01MDAke3QxK3QxfS5tcDNcXFwiXSxcXFwic29uZ21pZFxcXCI6W1xcXCIke3QxfVxcXCJdfX19YDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX18gPSBhamF4KHUpLnJlcV8wLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IF9fLm1pZHVybGluZm9bMF0ucHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCAmJiB1cmwgIT0gXFxcIlxcXCIpIHVybCA9IF9fLnNpcFswXSArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBcXFwidG9hc3Q6Ly/ml6Dms5Xop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcblxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGxUeXBlIG9mIFtcXFwibmV3XFxcIiwgXFxcInlxcVxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gYWpheChcXFwiaHR0cDovL2MueS5xcS5jb20vbHlyaWMvZmNnaS1iaW4vZmNnX3F1ZXJ5X2x5cmljX1xcXCIgKyBsVHlwZSArIFxcXCIuZmNnP2Zvcm1hdD1qc29uJm5vYmFzZTY0PTEmc29uZ21pZD1cXFwiICsgdDEpLmx5cmljO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWxyYy5tYXRjaCgvXFxcXFtcXFxcZCtcXFxcOlxcXFxkKy8pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBMcmMobHJjLCBfLmludGVydmFsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxyYykgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vYy55LnFxLmNvbS9zcGxjbG91ZC9mY2dpLWJpbi9mY2dfZ2V0X2Rpc3NfYnlfdGFnLmZjZz9mb3JtYXQ9anNvbiZjYXRlZ29yeUlkPVxcXCIgKyB0MSArIFxcXCImc2luPVxcXCIgKyAoKE1ZX1BBR0UgLSAxKSAqIDMwKSArIFxcXCImZWluPVxcXCIgKyAoKE1ZX1BBR0UgKiAzMCkgLSAxKTtcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgodSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdDtcXG4gICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5kaXNzbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWd1cmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXy5zdW0gfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly9jLnkucXEuY29tL3F6b25lL2ZjZy1iaW4vZmNnX3VjY19nZXRjZGluZm9fYnlpZHNfY3AuZmNnP2Zvcm1hdD1qc29uJnR5cGU9MSZ1dGY4PTEmZGlzc3RpZD1cXFwiICsgdDE7XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHUpLmNkbGlzdFswXS5zb25nbGlzdDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vdS55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2c/Z190az01MzgxJmRhdGE9XFxcIiArIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkZXRhaWxcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1vZHVsZVxcXCI6IFxcXCJtdXNpY1RvcGxpc3QuVG9wbGlzdEluZm9TZXJ2ZXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJtZXRob2RcXFwiOiBcXFwiR2V0RGV0YWlsXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1cXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ0b3BJZFxcXCI6ICt0MSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm9mZnNldFxcXCI6IChNWV9QQUdFIC0gMSkgKiAzMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm51bVxcXCI6IDMwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGVyaW9kXFxcIjogXFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb21tXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiY3RcXFwiOiAyNCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImN2XFxcIjogMFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHUpLmRldGFpbC5kYXRhLnNvbmdJbmZvTGlzdDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodDIpIHJldHVybiBfO1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgdGl0bGU6IChfLm5hbWUgfHwgXy5zb25nbmFtZSkgKyAnIC0gJyArIF8uc2luZ2VyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgIGltZzogKGFsYnVtaWQgPSBfLmFsYnVtbWlkIHx8IChfLmFsYnVtID8gXy5hbGJ1bS5taWQgOiBcXFwiXFxcIikpICE9IFxcXCJcXFwiID8gYGh0dHBzOi8veS5ndGltZy5jbi9tdXNpYy9waG90b19uZXcvVDAwMlIzMDB4MzAwTTAwMCR7YWxidW1pZH0uanBnYCA6IFxcXCJoaWtlcjovL2ltYWdlcy9ydWxlX3R5cGVfYXVkaW9cXFwiLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IF8ucGF5LnBheXBsYXksXFxuICAgICAgICAgICAgenlpZDogXy5taWQgfHwgXy5zb25nbWlkXFxuICAgICAgICB9LCAxKSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIGlzVSwgcnVuKSB7XFxuICAgICAgICBsZXQgXztcXG4gICAgICAgIGlmIChpc1UgIT0gXFxcInVybFxcXCIpIHtcXG4gICAgICAgICAgICBsZXQgbGlzdCwgX18gPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogKF8pID0+IHRydWUsXFxuICAgICAgICAgICAgICAgIHBhaWQ6IChfKSA9PiBfLnBheS5wYXlfcGxheSA9PSAnMScsXFxuICAgICAgICAgICAgICAgIGZyZWU6IChfKSA9PiBfLnBheS5wYXlfcGxheSA9PSAnMCdcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHN1cmwgPSAoc3R5cGUpID0+IGFqYXgoXFxcImh0dHA6Ly91Ni55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2dcXFwiLCB7XFxuICAgICAgICAgICAgICAgIFxcXCJib2R5XFxcIjogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlcVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibW9kdWxlXFxcIjogXFxcIm11c2ljLnNlYXJjaC5TZWFyY2hDZ2lTZXJ2aWNlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIkRvU2VhcmNoRm9yUVFNdXNpY0xpdGVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInF1ZXJ5XFxcIjoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF90eXBlXFxcIjogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJudW1fcGVyX3BhZ2VcXFwiOiAzMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhZ2VfbnVtXFxcIjogTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIFxcXCJtZXRob2RcXFwiOiBcXFwiUE9TVFxcXCJcXG4gICAgICAgICAgICB9KS5yZXEuZGF0YTtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwoMCk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5ib2R5Lml0ZW1fc29uZztcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLnNpbmdlci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAoYWxidW1pZCA9IF8uYWxidW1taWQgfHwgKF8uYWxidW0gPyBfLmFsYnVtLm1pZCA6IFxcXCJcXFwiKSkgIT0gXFxcIlxcXCIgPyBgaHR0cHM6Ly95Lmd0aW1nLmNuL211c2ljL3Bob3RvX25ldy9UMDAyUjMwMHgzMDBNMDAwJHthbGJ1bWlkfS5qcGdgIDogXFxcImhpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9hdWRpb1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8ucGF5LnBheV9wbGF5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLm1pZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsKDMpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYm9keS5pdGVtX3NvbmdsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uZGlzc25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmxvZ28sXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmRpc3NpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLm1ldGEuc3VtIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJodHRwczovL3UueS5xcS5jb20vY2dpLWJpbi9tdXNpY3UuZmNnXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Q6ICcxOScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdjogJzE4NTknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlOiAnbXVzaWMucGZfc29uZ19kZXRhaWxfc3ZyJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ2dldF9zb25nX2RldGFpbF95cXEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb25nX21pZDoga2V5d29yZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgICAgIH0pLnJlcS5kYXRhLnRyYWNrX2luZm87XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5zaW5nZXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAoYWxidW1pZCA9IF8uYWxidW1taWQgfHwgKF8uYWxidW0gPyBfLmFsYnVtLm1pZCA6IFxcXCJcXFwiKSkgIT0gXFxcIlxcXCIgPyBgaHR0cHM6Ly95Lmd0aW1nLmNuL211c2ljL3Bob3RvX25ldy9UMDAyUjMwMHgzMDBNMDAwJHthbGJ1bWlkfS5qcGdgIDogXFxcImhpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9hdWRpb1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy5wYXkucGF5cGxheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLm1pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoXFxcImh0dHA6Ly9jLnkucXEuY29tL3F6b25lL2ZjZy1iaW4vZmNnX3VjY19nZXRjZGluZm9fYnlpZHNfY3AuZmNnP2Zvcm1hdD1qc29uJnR5cGU9MSZ1dGY4PTEmZGlzc3RpZD1cXFwiICsga2V5d29yZCkuY2RsaXN0WzBdO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKF8uZGlzc25hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5sb2dvLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzdGlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gMDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgcmVmcmVzaF9sb2dpbjogZnVuY3Rpb24oY29va2llLCBydW4pIHtcXG4gICAgICAgIGxldCBib2R5LCBjLCBDID0gU3RyaW5nKGNvb2tpZSkudHJpbSgpO1xcbiAgICAgICAgYyA9IEMuc3BsaXQoL3FtX2tleXN0PS9pKTtcXG4gICAgICAgIGxldCBrZXkgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdChcXFwiO1xcXCIpWzBdO1xcbiAgICAgICAgYyA9IEMuc3BsaXQoL3Vpbj0vaSk7XFxuICAgICAgICBsZXQgdWluID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgIGlmIChrZXkuc3RhcnRzV2l0aCgnV19YJykpIHtcXG4gICAgICAgICAgICBib2R5ID0ge1xcbiAgICAgICAgICAgICAgICBcXFwiY29tbVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJmUGVyc29uYWxpdHlcXFwiOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidG1lTG9naW5UeXBlXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInRtZUxvZ2luTWV0aG9kXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYXV0aHN0XFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiY3RcXFwiOiBcXFwiMTFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImN2XFxcIjogXFxcIjEyMDgwMDA4XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ2XFxcIjogXFxcIjEyMDgwMDA4XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0bWVBcHBJRFxcXCI6IFxcXCJxcW11c2ljXFxcIlxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBcXFwicmVxMVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJtb2R1bGVcXFwiOiBcXFwibXVzaWMubG9naW4uTG9naW5TZXJ2ZXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJMb2dpblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1cXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNvZGVcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwib3BlbmlkXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfdG9rZW5cXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic3RyX211c2ljaWRcXFwiOiB1aW4sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm11c2lja2V5XFxcIjoga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1bmlvbmlkXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfa2V5XFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImxvZ2luTW9kZVxcXCI6IDJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgYm9keSA9IHtcXG4gICAgICAgICAgICAgICAgJ3JlcTEnOiB7XFxuICAgICAgICAgICAgICAgICAgICAnbW9kdWxlJzogJ1FRQ29ubmVjdExvZ2luLkxvZ2luU2VydmVyJyxcXG4gICAgICAgICAgICAgICAgICAgICdtZXRob2QnOiAnUVFMb2dpbicsXFxuICAgICAgICAgICAgICAgICAgICAncGFyYW0nOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4cGlyZWRfaW4nOiA3Nzc2MDAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtdXNpY2lkJzogdWluLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtdXNpY2tleSc6IGtleVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgYm9keSA9IEpTT04uc3RyaW5naWZ5KGJvZHkpO1xcbiAgICAgICAgbGV0IHVybCA9IFxcXCJodHRwczovL3UueS5xcS5jb20vY2dpLWJpbi9tdXNpY3MuZmNnP3NpZ249enphXFxcIiArIFIoMTYpICsgbWQ1KCdDSkJQQUNyUnVOeTcnICsgYm9keSk7XFxuICAgICAgICBsZXQgXyA9IEpTT04ucGFyc2UocG9zdCh1cmwsIHtcXG4gICAgICAgICAgICBib2R5OiBib2R5XFx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iBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHBsYXRmb3JtLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwbGF0Zm9ybSkgPT4ge1xcbiAgICAgICAgICAgIGlmICghcGxhdGZvcm0ubWF0Y2goL17igJjigJjigJnigJkvKSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignY19wbGF0Zm9ybScsIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignY190MicpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBwbGF0Zm9ybSksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgIH0pO1xcbn0pO1xcbmQucHVzaCh7XFxuICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxufSk7XFxubGV0IGN0YWI7XFxuaWYgKHNpID09ICcwJykge1xcbiAgICBzd2l0Y2ggKGNfcGxhdGZvcm0pIHtcXG4gICAgICAgIGNhc2UgJzVzJzpcXG4gICAgICAgICAgICBjdGFiID0gW1xcXCJsaWJcXFwiLCBcXFwieWNcXFwiLCBcXFwiZmNcXFwiLCBcXFwiYnpcXFwiXTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ215JzpcXG4gICAgICAgICAgICBjdGFiID0gW1xcXCJsaWJcXFwiLCBcXFwid3lcXFwiLCBcXFwia3dcXFwiLCBcXFwibWdcXFwiXTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ3F0JzpcXG4gICAgICAgICAgICBjdGFiID0gcXRzO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICBjdGFiID0gW1xcXCJsa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Y0Q3Z3V2eWJhc2U4NkhoSEMxMm9PRGJ0cnNnSzdDeHJqNVFwTDZnS255aWJlWkR3RUtJVktVT3RQb0hjeHBmd2EwcG9uWjFpYTVubEEvMD93eF9mbXQ9cG5nJyxcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLimIXmiZPlvIDkuoznuqfimIVcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IycpLnJ1bGUoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbbmFtZV0ubWFwKF8gPT4gRXh0cmEoXykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJUR1jmlLbol48gLSDojrflj5bplJnor69cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogKHNpID09ICcwJyA/ICfmrYzmm7InIDogJ+atjOWNlScpICsgXFxcIuWIhue7hCDjgIxcXFwiICsgbmFtZSArIFxcXCLjgI0g5LiN5a2Y5Zyo77yfXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLlcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuS/ruaUueWQjeensFxcXCIsIFxcXCLmm7TmlLnmjpLluo9cXFwiLCBcXFwi5YiG57uE5ZCI5bm2XFxcIiwgXSwgMSwgJ+mAieaLqeimgeWPmOabtOeahOS6i+S7ticpLnNlbGVjdCgoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfkv67mlLnlkI3np7AnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXmlrDnmoTnu4TlkI1cXFwiKS5pbnB1dCgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQubWF0Y2goL15cXFxccyoo5paw57uEfOacgOWQjumdoik/XFxcXHMqJC8pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v57uE5ZCN5LiN6IO95Li656m677yM5Lmf5LiN6IO96K6+572u5Li6J+aWsOe7hCcvJ+acgOWQjumdoidcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSBpbiB6eSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBuYW1lKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2lucHV0XSA9IHp5W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2ldID0genlbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfmm7TmlLnmjpLluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAyLCAn6K+36YCJ5oup6LWE5rqQ5L2N572uJykuc2VsZWN0KChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpIG9mIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW25hbWVdID0genlbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGknLCB6dS5pbmRleE9mKGkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2ldID0genlbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLmnIDlkI7pnaJcXFwiID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25bbmFtZV0gPSB6eVtuYW1lXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpJywgenUubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WIhue7hOWQiOW5tic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp1LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LCAzLCAn6YCJ5oup6KaB5ZCI5bm255qE5YiG57uEJykuc2VsZWN0KChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpIG9mIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpXSA9IHp5W2ldLmNvbmNhdCh6eVtuYW1lXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGknLCB6dS5pbmRleE9mKGkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2ldID0genlbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpdGNoOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpOiBzaSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKVtuYW1lXVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5nZXRTaGFyZShqc29uLCBmYWxzZSwganNvbi5kYXRhLmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaTliIbnu4QgXFxcIiArIG5hbWUgKyBcXFwiIOWQl++8n1xcXFxu5q2k5pON5L2c5LiN5Y+v6YCG77yM6LCo5oWO6YCJ5oup44CCXFxcIikuY29uZmlybSgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHp5W25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgICAg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p1W3RpXV0ubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBkZWxldGUgenlbenVbdGldXTtcXG4gICAgICAgIGNsZWFyTXlWYXIoJ3RpJyk7XFxuICAgICAgICAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIGxldCBpaSA9IDA7XFxuICAgICAgICB6eVt6dVt0aV1dLm1hcCgoXywgaSkgPT4ge1xcbiAgICAgICAgICAgIGlmICgoKGNfcGxhdGZvcm0gPT0gJ2xpYicgfHwgY19wbGF0Zm9ybSA9PSBfLmRlc2MpICYmIChjX3QyID09ICdsaWInIHx8IGNfdDIgPT0gXy5jb250ZW50KSkgfHwgKGNfcGxhdGZvcm0gPT0gJ2xpYicgJiYgKChjX3QyID09IF8uY29udGVudCkgfHwgKGNfdDIgPT0gJzAnICYmIF8uY29udGVudCAhPSAnMScpKSkpIHtcXG4gICAgICAgICAgICAgICAgXy5leHRyYSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgJzphZGRsaXN0JyxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIHp1LCBrZXksIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwi5L+u5pS55ZCN56ewXFxcIiwgXFxcIuabtOaUueaOkuW6j1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIuS/ruaUueWwgemdolxcXCIsIFxcXCLliIfmjaLliIbnu4RcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qXFxcIuaJuemHj+aNoue7hFxcXCIqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgMiwgJ+mAieaLqeimgeWPmOabtOeahOS6i+S7ticpLnNlbGVjdCgoc2ksIHp1LCBrZXksIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+S/ruaUueWQjeensCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+S/ruaUueWwgemdoic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdHlwZSwgdGV4dF0gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIuS/ruaUueWQjeensFxcXCI6IFsndGl0bGUnLCAn6K+36L6T5YWl5paw55qE5ZCN56ewJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIuS/ruaUueWwgemdolxcXCI6IFtfLmltZyA/ICdpbWcnIDogJ3BpYycsICfor7fovpPlhaXmraPnoa7nmoTlsIHpnaLlnLDlnYAnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVtpbnB1dF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChfW3R5cGVdLCB0ZXh0KS5pbnB1dCgoc2ksIGtleSwgaSwgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09ICd0aXRsZScgJiYgaW5wdXQubWF0Y2goL15cXFxccyrmnIDlkI7pnaJcXFxccyokLykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/otYTmupDlkI3kuI3og73orr7nva7miJAn5pyA5ZCO6Z2iJ1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaV1bdHlwZV0gPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5LCBpLCB0eXBlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfmm7TmlLnmjpLluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenUgPSB6eS5tYXAoXyA9PiBfLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0genlbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAyLCAn6K+36YCJ5oup6LWE5rqQ5L2N572uJykuc2VsZWN0KChzaSwga2V5LCB6eSwgenUsIGRhdGEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4genUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHp1W2ldID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uLnB1c2goZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbi5wdXNoKHp5W2ldKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLmnIDlkI7pnaJcXFwiID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIHp5LCB6dSwgZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5YiH5o2i5YiG57uEJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpaSA9IHp1LmluZGV4T2Yoa2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp1LnNwbGljZShpaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoJ+aWsOe7hCcpLCAzLCAn6K+36YCJ5oup6LWE5rqQ5L2N572uJykuc2VsZWN0KChzaSwga2V5LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhLCBqc29uID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlba2V5XS5tYXAoKF8sIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSAhPSBpKSBqc29uLnB1c2goXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgZGF0YSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlba2V5XSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCfmlrDnu4QnID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5paw57uE5ZCN56ewXFxcIikuaW5wdXQoKHNpLCB6eSwgZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0Lm1hdGNoKC9eXFxcXHMqKOaWsOe7hHzmnIDlkI7pnaIpP1xcXFxzKiQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v57uE5ZCN5LiN6IO95Li656m677yM5Lmf5LiN6IO96K6+572u5Li6J+aWsOe7hCcvJ+acgOWQjumdoidcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaW5wdXRdID0gW2RhdGFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenksIGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpbnB1dF0ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5om56YeP5o2i57uEJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLnJ1bGUoKHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiYWRkbGlzdD9ydWxlPXRneOmfs+S5kFxcXCIpKHNpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBrZXksIGksIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIHp1W3RpXSwgaSwgXylcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliIbkuqtcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoXywgc2ksIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaXRjaDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBbX11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLmdldFNoYXJlKGpzb24sIGZhbHNlLCAxLCBzaSA9PSBcXFwiMFxcXCIgPyBcXFwi5q2M5puyXFxcIiA6IFxcXCLmrYzljZVcXFwiLCBfLnRpdGxlLCBbXFxcIuaJuemHj+WIhuS6q1xcXCIsIC8qXFxcIuWumOaWuemTvuaOpVxcXCIqLyBdLCBzaSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgXywgc2ksIHp1W3RpXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIGtleSwgaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruWumuWIoOmZpFxcXCIgKyBuYW1lICsgXFxcIuWQl++8n1xcXCIpLmNvbmZpcm0oKHNpLCBrZXksIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgaSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1W3RpXSwgaSwgXy50aXRsZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKF8uZGVzYy5tYXRjaCgvcXF8d3l8a2d8a3d8bWd8NXMvKSAmJiBfLmNvbnRlbnQgIT0gMykgXy5leHRyYS5sb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKcqSDlpI3liLbpk77mjqUg4pypXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChhLCBiLCBjKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuY29weXVybChhLCBiLCBjKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoTnVtYmVyKF8uY29udGVudC5yZXBsYWNlKC9eKFxcXFxkKlxcXFxEK1xcXFxkKikrJC8sICcwJykpIDwgMikgXy5leHRyYS5sb25nQ2xpY2sudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDkuIvovb3mrYzmm7Ig4piFXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkLCAxKSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmICghXy51cmwpIF8udXJsID0gTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkKTtcXG4gICAgICAgICAgICAgICAgXy5jb2xfdHlwZSA9ICdjYXJkX3BpY18zJztcXG4gICAgICAgICAgICAgICAgZC5wdXNoKF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5cXG5cXG5cXG5pZiAoc190MSA9PSAnMCcpIHtcXG4gICAgc3dpdGNoIChzX3BsYXRmb3JtKSB7XFxuICAgICAgICBjYXNlICdsaWInOlxcbiAgICAgICAgICAgIHNfdDMgPSBnZXRNeVZhcignc190MycsICdrdycpO1xcbiAgICAgICAgICAgIHRhYnMgPSBbJ2t3JywgJ2tnJ107XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICc1cyc6XFxuICAgICAgICAgICAgdGFicyA9IFsnbGliJywgJ3ljJywgJ2ZjJywgJ2J6J107XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICdteSc6XFxuICAgICAgICAgICAgc190NCA9IGdldE15VmFyKCdzX3Q0JywgJzEnKSA9PSAnMSc7XFxuICAgICAgICAgICAgc190MyA9IGdldE15VmFyKCdzX3QzJywgJ3d5Jyk7XFxuICAgICAgICAgICAgaWYgKCFzX3QzLm1hdGNoKC93eXxrd3xtZy8pICYmIHNfdDQpXFxuICAgICAgICAgICAgICAgIHNfdDMgPSAnd3knO1xcbiAgICAgICAgICAgIHRhYnMgPSBbXFxcInd5XFxcIiwgXFxcImt3XFxcIiwgXFxcIm1nXFxcIiwgXFxcIjF0XFxcIiwgXFxcImRiXFxcIiwgXFxcIjV5XFxcIiwgXFxcIjVmXFxcIl0uc2xpY2UoMCwgc190NCA/IDMgOiA3KTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ3F0JzpcXG4gICAgICAgICAgICBzX3QzID0gZ2V0TXlWYXIoJ3NfdDMnLCAnYmQnKTtcXG4gICAgICAgICAgICB0YWJzID0gcXRzLnNsaWNlKDEpO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICBpZiAoc190MyA9PSAna3cnIHx8IHNfdDMgPT0gJ2tnJykge1xcbiAgICAgICAgICAgICAgICBzX3QzID0gJ2xpYic7XFxuICAgICAgICAgICAgf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C8uKihcXFxcP3NvbmcuKj89fFxcXFwvKShbYS16MC05XSspKFxcXFwmc29uZy4qPz18XFxcXC8pKFthLXowLTldKykvaV0sXFxuICAgICAgICAgICAgW1xcXCJrZ1xcXCIsIC9rdWdvdVxcXFwuL2ksIC8oXFxcXC9zcGVjaWFsXFxcXC9zaW5nbGVcXFxcL3xzaGFyZV90eXBlPXNwZWNpYWwmaWQ9fGdsb2JhbF9zcGVjaWFsaWQ9fF5bXihcXFxcL3NoYXJlKV0rWyZcXFxcP11pZD0pKFteJl0rKS9pLCAvKGhhc2g9KShbYS16MC05XSspL2ldLFxcbiAgICAgICAgXTtcXG4gICAgICAgIGZvciAoW3BsYXRmb3JtLCByZWcxLCByZWcyLCByZWczXSBvZiByZWdzKSB7XFxuICAgICAgICAgICAgaWYgKHNfdDIubWF0Y2gocmVnMSkpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHNfcGxhdGZvcm0gPSBwbGF0Zm9ybTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZWcyICYmIChtYXQgPSBzX3QyLm1hdGNoKHJlZzIpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNfdDEgPSAnMSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVnaWQgPSBtYXRbMl07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlZzMgJiYgKG1hdCA9IHNfdDIubWF0Y2gocmVnMykpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc190MSA9ICcwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWdpZCA9IG1hdFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocGxhdGZvcm0gPT0gJzVzJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVnaWQubWF0Y2goL1xcXFxELykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpZCA9IG1hdFs0XSArICcjJyArIHJlZ2lkO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpZCArPSAnIycgKyBtYXRbNF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHt9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGlmICghcmVnaWQpIHsgLy8g5q2j5YiZ5pyq5Yy56YWNXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgW3NfcGxhdGZvcm0sIHNfdDEsIHJlZ2lkXSA9IEpTT04ucGFyc2UoZXhlY3V0ZVdlYlJ1bGUoc190Mi5yZXBsYWNlKC9eW1xcXFxzXFxcXFNdKj8oaHR0cFteXFxcXG5dKylbXFxcXHNcXFxcU10qL2ksIFxcXCIkMVxcXCIpLCAkLnRvU3RyaW5nKChyZWdzLCBwbGF0Zm9ybSwgc190MSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlzUmVnID0gKHJlZywgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3aW5kb3cubG9jYXRpb24uaHJlZi5tYXRjaChyZWcpW2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKG1hdEVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbXFxcInFxXFxcIiwgXFxcIjFcXFwiLCBpc1JlZyhyZWdzWzBdWzJdLCAyKSB8fCBmaXJzdFBhZ2VEYXRhLnRhb2dlRGF0YS5pZF07XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBocFBhcmFtID0gZGF0YUZyb21TbWFydHlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGlzS2dwZSkge31cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY2lhbGlkID0gcGhwUGFyYW0uc3BlY2lhbGlkIHx8IHBocFBhcmFtLmdsb2JhbF9jb2xsZWN0aW9uX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3BlY2lhbGlkKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbXFxcImtnXFxcIiwgXFxcIjFcXFwiLCBzcGVjaWFsaWRdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnVuID0gW1xcXCJrZ1xcXCIsIFxcXCIwXFxcIiwgaXNSZWcocmVnc1s1XVszXSwgMikgfHwgcGhwUGFyYW0uaGFzaF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7IC8vIOWlveWDj+aYr+i/meagt+aLvOeahCjlpKfmpoJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobGlzdGlkID0gaXNSZWcoL2xpc3RpZD0oXFxcXGQrKS9pLCAxKSkgJiYgKHVpZCA9IGlzUmVnKC91aWQ9KFxcXFxkKykvaSwgMSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnVuID0gW1xcXCJrZ1xcXCIsIFxcXCIxXFxcIiwgXFxcImNvbGxlY3Rpb25fM19cXFwiICsgdWlkICsgXFxcIl9cXFwiICsgbGlzdGlkICsgXFxcIl8wXFxcIl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBocFBhcmFtID0gKHdpbmRvdy4kb3V0cHV0ID8gd2luZG93LiRvdXRwdXQuaW5mbyA6IG5EYXRhKS5saXN0aW5mbztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbXFxcImtnXFxcIiwgXFxcIjFcXFwiLCBwaHBQYXJhbS5zcGVjaWFsaWQgfHwgcGhwUGFyYW0uZ2xvYmFsX2NvbGxlY3Rpb25faWRdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW4gPSBbcGxhdGZvcm0sIHNfdDEsIFxcXCJcXFwiXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShSdW4pO1xcbiAgICAgICAgICAgICAgICB9LCByZWdzLCBwbGF0Zm9ybSwgc190MSksIHtcXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ10sXFxuICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiA4MDAwXFxuICAgICAgIC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AgumFjVxcXCI7XFxuICAgICAgICB9LCBNWV9QQVJBTVMpLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBwYWdlVGl0bGU6IFxcXCJUR1jmlLbol49cXFwiLFxcbiAgICAgICAgICAgIGJhY2s6IDFcXG4gICAgICAgIH1cXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IFN0cm9uZyhcXFwi5pCc57SiXFxcIiArIChzX3QxID09PSAnMCcgPyBcXFwi5Y2V5puyXFxcIiA6IFxcXCLmrYzljZVcXFwiKSksXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNfdDEpID0+IHtcXG4gICAgICAgICAgICBwdXRNeVZhcignc190MScsIHNfdDEpO1xcbiAgICAgICAgICAgIC8vIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgIH0sIHNfdDEgPT09ICcwJyA/ICcxJyA6ICcwJyksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX3hpdXRhblxcXCJcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IFN0cm9uZyhcXFwi5oiR55qE5pS26JePXFxcIiksXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2NvbGxlY3Rpb24/cnVsZT3mrYzor43pgILphY1cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uX3NtYWxsXzNcXFwiLFxcbiAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9kb3dubG9hZFxcXCJcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IFN0cm9uZyhcXFwi5Y6G5Y+y6K6w5b2VXFxcIiksXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2hpc3Rvcnk/cnVsZT3mrYzor43pgILphY1cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uX3NtYWxsXzNcXFwiLFxcbiAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9oaXNcXFwiXFxuICAgIH1dO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5SNJyxcXG4gICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDliIbkuqvpk77mjqUnLFxcbiAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChzX3BsYXRmb3JtKSA9PiB7XFxuICAgICAgICAgICAgc190MiA9IGlucHV0LnRyaW0oKTtcXG4gICAgICAgICAgICBpZiAoc190MiAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIHNfdDIpO1xcbiAgICAgICAgICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSAnbGliJylcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgZ2V0SXRlbSgnc19wbGF0Zm9ybScsICdrdycpKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgc19wbGF0Zm9ybSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjpzZWFyY2hcXFwiLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcInNfdDJcXFwiKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdzX3QyJyxpbnB1dClcXFwiLFxcbiAgICAgICAgICAgIC8qIOS4jeWlveeUqFxcbiAgICAgICAgICAgICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0ID0gU3RyaW5nKGlucHV0KS50cmltKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihcXFwic190MlxcXCIpICE9IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhpZCArICc6Y21kOmtleScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ICYmIGlucHV0ICE9IFxcXCJcXFwiICYmICEvaHR0cHM/OlxcXFwvXFxcXC8vLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbXNlYXJjaGNkbi5rdWdvdS5jb20vbmV3L2FwcC9pL3NlYXJjaC5waHA/Y21kPTMwMiZrZXl3b3JkPVxcXCIgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gSlNPTi5wYXJzZShmZXRjaCh1KSkuZGF0YVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5rZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkK1xcXCI6c2VhcmNoXFxcIikuZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmRlZmF1bHRWYWx1ZSA9IGtleTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaWQsIF8ua2V5d29yZCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArICc6Y21kOmtleSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihpZCArICc6c2VhcmNoJywgZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpZClcXG4gICAgICAgICAgKi9cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICB9KTtcXG4gICAgcGxhdGZvcm1zLm1hcChwbGF0Zm9ybSA9PiB7XFxuICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSBwbGF0Zm9ybSlcXG4gICAgICAgICAgICBwbGF0Zm9ybSA9IFJpY2goU3Ryb25nKENvbG9yKHBsYXRmb3JtKSkpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogcGxhdGZvcm0sXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwbGF0Zm9ybSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoIXBsYXRmb3JtLm1hdGNoKC9e4oCY4oCY4oCZ4oCZLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc19wbGF0Zm9ybScsIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDQnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa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gICAgICAgICAgc2V0UGFnZVRpdGxlKCfpq5jnuqfmkJzntKIgLSAnICsgc190MiArICcjJyArIE1ZX1BBR0UpO1xcbiAgICAgICAgaWYgKGlzUCAmJiAhaXNVICYmIHNfdDEgPT0gJzAnKSB7XFxuICAgICAgICAgICAgaXNfZG93biA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGlzX2Rvd24gPyAnPGI+8J+TpSDkuIvovb08L2I+JyA6ICc8Yj7wn461IOaSreaUvjwvYj4nLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvJyArIChpc19kb3duID8gMjIgOiA0MCkgKyAnLnBuZycsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpc19kb3duID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMSc7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUsIGltZyA9ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvJztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc19kb3duKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAnPGI+8J+OtSDmkq3mlL48L2I+JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWcgKz0gJzQwJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAnPGI+8J+TpSDkuIvovb08L2I+JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWcgKz0gJzIyJztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGltZyArPSAnLnBuZyc7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc2VhcmNoX2Rvd24nLCBpc19kb3duID8gJzAnIDogJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQgKyAnOnlpeWFuJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IGZpbmRJdGVtc0J5Q2xzKGlkICsgJzphZGRsaXN0JykgfHwgW107XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhX3VybCA9IGl0LnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaXQuZXh0cmEudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0LmV4dHJhLnVybCA9IGV4dHJhX3VybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGl0LmV4dHJhLmlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBpdC5leHRyYSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9pY29uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpZCArICc6eWl5YW4nXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAoaXNQKSB7XFxuICAgICAgICAgICAgLy8gaXNfZG93biA9IGZldGNoKCdodHRwczovL3YxLmhpdG9rb3RvLmNuLz9lbmNvZGU9dGV4dCcpO1xcbiAgICAgICAgICAgIGlzX2Rvd24gPSBmZXRjaCgnaHR0cHM6Ly90ZW5hcGkuY24vdjIveWl5YW4nKTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJzxiPvCfk5ogJyArIGlzX2Rvd24gKyAnPC9iPicsXFxuICAgICAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb240JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlzX2Rvd24gPSBmZXRjaCgnaHR0cHM6Ly90ZW5hcGkuY24vdjIveWl5YW4nKTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJzxiPvCfk5ogJyArIGlzX2Rvd24gKyAnPC9iPicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWkjeWItjogXFxcIiArIGlzX2Rvd24sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpc19kb3duKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaWQgKyBcXFwiOnNlYXJjaF9kb3duXFxcIiksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9pY29uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6c2VhcmNoX2Rvd25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5aSN5Yi2OiBcXFwiICsgaXNfZG93bixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgdFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlzX2Rvd24pXFxuICAgICAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaXNQIHx8IGdldE15VmFyKCdzZWFyY2hfcGFnZScsICcwJykgPT0gJzAnIHx8IHNfcGxhdGZvcm0ubWF0Y2goL215fHF0LykpIHtcXG4gICAgICAgICAgICBsZXQgcGFnZVNpemUgPSBzX3BsYXRmb3JtID09IFxcXCI1c1xcXCIgPyAoc190MSA9PSAnMCcgPyAxMCA6IDE1KSA6IDMwO1xcbiAgICAgICAgICAgIGxldCB0b3RhbCA9ICQucmVxdWlyZShzX3BsYXRmb3JtICsgXFxcIj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNlYXJjaChzX3QxLCBzX3QyLCBzX3QzLCBzX3Q0KTtcXG4gICAgICAgICAgICBpZiAodG90YWwgPCBNWV9QQUdFICogcGFnZVNpemUpIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaF9wYWdlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArICfmiJHmmK/mnInlupXnur/nmoQnLmZvbnRjb2xvcignR3JheScpLnNtYWxsKCksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfVxcbn0gZWxzZSBpZiAoaXNQICYmICFpc1UpIHtcXG4gICAgc2V0UGFnZVRpdGxlKCfpq5jnuqfmkJzntKInKTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNmZjY2MDFcXFwiPjxiPuWOhuWPsuaQnOe0ojwvYj48L3NwYW4+JyxcXG4gICAgICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2ZpbmRcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCLnoa7lrprmuIXpmaTlhajpg6jmkJzntKLorrDlvZXvvJ9cXFwiKS5jb25maXJtKChpZCkgPT4ge1xcbiAgICAgICAgICAgIGNsZWFySXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIpO1xcbiAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhpZCArIFxcXCI6a2V5XFxcIik7XFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkICsgXFxcIjpzZWFyY2hIaXN0b3J5XFxcIiwge1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0sIGlkKSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjpzZWFyY2hIaXN0b3J5XFxcIixcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGlmIChoaXN0b3J5Lmxlbmd0aCA9PT0gMCkgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZWxzZSBoaXN0b3J5Lm1hcCgoa2V5LCBpLCBpZCkgPT4ge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZToga2V5LFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoc19wbGF0Zm9ybSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICh0cnVlKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc19wbGF0Zm9ybSA9PSAnbGliJykgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBnZXRJdGVtKCdzX3BsYXRmb3JtJywgJ2t3JykpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgIC8vIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKFxcXCJnY3NwMTk5OTpzZWFyY2hcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhLmRlZmF1bHRWYWx1ZSA9IGtleTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LCBzX3BsYXRmb3JtLCBrZXkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6a2V5OlxcXCIgKyBrZXksXFxuICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6Zmk5YWz6ZSu6K+NOlxcXCIgKyBrZXksXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoaXN0b3J5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWkgPSBoaXN0b3J5LmluZGV4T2Yoa2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIGhpc3RvcnkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oaWQgKyBcXFwiOmtleTpcXFwiICsga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGlzdG9yeS5sZW5ndGggPT09IDApIGFkZEl0ZW1BZnRlcihpZCArIFxcXCI6c2VhcmNoSGlzdG9yeVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCI6a2V5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpZCwga2V5KVxcbiAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9KTtcXG4gICAgUmVzb3UgPSAoaWQsIHNfcGxhdGZvcm0sIHBsYXRmb3JtLCByZXNvdSkgPT4ge1xcbiAgICAgICAgbGV0IEQgPSBbXTtcXG4gICAgICAgIHJlc291Lm1hcChuYW1lID0+IHtcXG4gICAgICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzX3BsYXRmb3JtLCBwbGF0Zm9ybSwga2V5d29yZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNfcGxhdGZvcm0gPT0gJ2xpYicpIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QxJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywga2V5d29yZCk7XFxuICAgICAgICAgICAgICAgICAgICAvLyBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBzX3BsYXRmb3JtLCBwbGF0Zm9ybSwgbmFtZSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArICc6cmVzb3U6a2V5J1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBEO1xcbiAgICB9O1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojZmY2NjAxXFxcIj48Yj7lpKflrrbpg73lnKjmkJw8L2I+PC9zcGFuPicsXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGlkLCBzX3BsYXRmb3JtLCBwbGF0Zm9ybSwgUmVzb3UpID0+IHtcXG4gICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoaWQgKyAnOnJlc291OmtleScpO1xcbiAgICAgICAgICAgIGxldCBzcmVjO1xcbiAgICAgICAgICAgIGlmIChwbGF0Zm9ybSAhPSAna2cnKSB7XFxuICAgICAgICAgICAgICAgIHNyZWMgPSBbXTtcXG4gICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL3NlYXJjaHJlYy5rdXdvLmNuL3NyZWMucz9zZWFyY2hyZWNhcGk9MCZpZD0wXFxcIikpLmFic2xpc3QubWFwKGFibGlzdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBhYmxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNyZWMucHVzaChfLndvcmQpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIE1ZX1BBR0UgPSAxO1xcbiAgICAgICAgICAgICAgICBzcmVjID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLnNlYXJjaChcXFwiMFxcXCIsIFxcXCJcXFwiLCBcXFwibGliXFxcIiwgXFxcInNyZWNcXFwiKS5tYXAoXyA9PiBfLk9yaVNvbmdOYW1lKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkICsgJzpyZXNvdScsIFJlc291KGlkLCBzX3BsYXRmb3JtLCBwbGF0Zm9ybSwgc3JlYykpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCwgc19wbGF0Zm9ybSwgc190MywgUmVzb3UpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgcGljX3VybDogXFxcImhpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9jb21pY3NcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogaWQgKyBcXFwiOnJlc291XFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgbGV0IHNyZWMgPSBzdG9yYWdlMC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VybiB0cnVlO1xcbiAgICAgICAgLypcXG4gICAgICAgICAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bXFxcIuWFqOmDqFxcXCJdID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgoXFxcInRvcGxpc3Q/XFxcIikubGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgKi9cXG4gICAgICAgICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4MyhcXFwiL2FwaS90b3BsaXN0L2RldGFpbC92MlxcXCIpLmRhdGEubWFwKF8gPT4ge1xcbiAgICAgICAgICAgIGlmIChfLmxpc3QgJiYgXy5saXN0Lmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICBsZXQgbmFtZSA9IF8ubmFtZS5yZXBsYWNlKC/mppzljZU/LywgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXVtuYW1lXSA9IFtdO1xcbiAgICAgICAgICAgICAgICBfLmxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8uaWQgIT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW25hbWVdLnB1c2goRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInd5X2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0Mikge1xcbiAgICAgICAgbGV0IGxpc3QsIF87XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIi92My9zb25nL2RldGFpbFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGM6IGBbe1xcXCJpZFxcXCI6JHt0MX19XWBcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGxldCBhID0gXy5zb25nc1swXTtcXG4gICAgICAgICAgICAgICAgbGV0IGlzRnJlZU11c2ljID0gKGEuZmVlID09IDAgfHwgYS5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlc1swXS5zdCA+IC0xKTtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5LiL6L29XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IFt0c1sxXSArIFNpemUoYS5sID8gYS5sLnNpemUgOiBhLm0uc2l6ZSldO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGEuaClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUoYS5oLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLnNxKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdICsgU2l6ZShhLnNxLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLmhyKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzRdICsgU2l6ZShhLmhyLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgYSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJkb3duXFxcIiwgXFxcInd5XFxcIiwgdDEsIGksIGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBhKTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgdmFyIHVybCwgaWksIGxyYztcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5ocikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwid3lcXFwiLCB0MSwgMywgYSwgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5zcSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwid3lcXFwiLCB0MSwgMiwgYSwgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpaWkgPSBpaSA+IDAgPyAxIDogMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0ZyZWVNdXNpYykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXJsID0gYGh0dHA6Ly9tdXNpYy4xNjMuY29tL3NvbmcvbWVkaWEvb3V0ZXIvdXJsP2lkPSR7dDF9Lm1wM2A7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDMoXFxcIi9hcGkvc29uZy9lbmhhbmNlL3BsYXllci91cmwvdjFcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWRzOiBgWyR7dDF9XWAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWw6IGlpaSA+IDAgPyBcXFwiZXhoaWdoXFxcIiA6IFxcXCJzdGFuZGFyZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jb2RlVHlwZTogXFxcImZsYWNcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5kYXRhWzBdLnVybC5zcGxpdChcXFwiP1xcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChhLmggJiYgaWkgPT0gMSkgfHwgaWlpID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInd5XFxcIiwgdDEsIGlpaSwgYSwgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlpaSAtPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKGlpaSA+IC0xKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybCkgcmV0dXJuIFxcXCJ0b2FzdDovL+aXoOazleino+aekFxcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICBpZiAoIWxyYykge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIi9zb25nL2x5cmljXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGx2OiAtMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga3Y6IC0xLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0djogLTFcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KS5scmMubHlyaWM7XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArIFxcXCIjaXNNdXNpYz10cnVlI1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8v6aaW6aG1XFxuICAgICAgICAgICAgICAgIGlmICghdDEubWF0Y2goL1xcXFw/LykpIHQxID0gXFxcInRvcC9wbGF5bGlzdD9jYXQ9XFxcIiArIHQxICsgXFxcIiZcXFwiO1xcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgodDEpO1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gXy5yZXN1bHQgfHwgXy5wbGF5bGlzdHM7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCB8fCBfLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgaWYgKHQxID09IFxcXCJwZXJzb25hbGl6ZWQ/XFxcIikgcmV0dXJuIDA7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImdkL3Y2L1xcXCIgKyB0MSwgOTk5OTkpLnBsYXlsaXN0LnRyYWNrcztcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IFtdO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0MikgcmV0dXJuIF87XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLmFyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgIGltZzogXy5hbC5waWNVcmwsXFxuICAgICAgICAgICAgY29udGVudDogKChfLmZlZSA9PSAwIHx8IF8uZmVlID09IDgpICYmIChfLnByaXZpbGVnZSA/IChfLnByaXZpbGVnZS5zdCA+IC0xKSA6IDEpKSA/IDAgOiAxLFxcbiAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgIH0sIDEpKTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSxcXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgaXNVKSB7XFxuICAgICAgICBsZXQgXztcXG4gICAgICAgIGlmIChpc1UgIT0gXFxcInVybFxcXCIpIHtcXG4gICAgICAgICAgICBsZXQgbGlzdCwgX18gPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogKF8pID0+IHRydWUsXFxuICAgICAgICAgICAgICAgIHBhaWQ6IChfKSA9PiAoKF8uZmVlID09IDAgfHwgXy5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlID8gKF8ucHJpdmlsZWdlLnN0ID4gLTEpIDogMSkpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgIGZyZWU6IChfKSA9PiAoKF8uZmVlID09IDAgfHwgXy5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlID8gKF8ucHJpdmlsZWdlLnN0ID4gLTEpIDogMSkpID8gMSA6IDBcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGxldCBzdXJsID0gKHN0eXBlKSA9PiBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIvc2VhcmNoL2dldFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgczoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgbGltaXQ6IDMwLFxcbiAgICAgICAgICAgICAgICBvZmZzZXQ6IChNWV9QQUdFIC0gMSkgKiAzMCxcXG4gICAgICAgICAgICAgICAgdHlwZTogc3R5cGUsXFxuICAgICAgICAgICAgICAgIHN0cmF0ZWd5OiA1LFxcbiAgICAgICAgICAgICAgICBxdWVyeUNvcnJlY3Q6IHRydWVcXG4gICAgICAgICAgICB9KS5yZXN1bHQ7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBzdXJsKDEpLnNvbmdzO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVSA9PT0gMSkgcmV0dXJuIGxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5hci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmFsLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogKChfLmZlZSA9PSAwIHx8IF8uZmVlID09IDgpICYmIChfLnByaXZpbGVnZSA/IChfLnByaXZpbGVnZS5zdCA+IC0xKSA6IDEpKSA/IDAgOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHN1cmwoMTAwMCkucGxheWxpc3RzO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVSA9PT0gMSkgcmV0dXJuIGxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXy5zb25nQ291bnQgfHwgXy5wbGF5bGlzdENvdW50IHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIi92My9zb25nL2RldGFpbFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjOiBgW3tcXFwiaWRcXFwiOiR7a2V5d29yZH19XWBcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGEgPSBfLnNvbmdzWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBhLm5hbWUgKyAnIC0gJyArIGEuYXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBhLmFsLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAoKGEuZmVlID09IDAgfHwgYS5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlc1swXS5zdCA+IC0xKSkgPyAwIDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBhLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImdkL3Y2L1xcXCIgKyBrZXl3b3JkLCAwKS5wbGF5bGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgLyogTXlGcmVlTVAzIOatjOWNleino+aekOW0qeS6hu+8jOS4jeaYvuekulxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnbXknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gMDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgYWpheDogZnVuY3Rpb24ocGF0aCwgbikge1xcbiAgICAgICAgaWYgKHBhdGgubWF0Y2goL15nZFxcXFwvdjZcXFxcLy8pKSB7XFxuICAgICAgICAgICAgcGF0aCA9IHBhdGgucmVwbGFjZSgvXmdkKFxcXFwvdjZcXFxcLykoXFxcXGQrKS8sIFxcXCJodHRwczovL211c2ljLjE2My5jb20vYXBpJDFwbGF5bGlzdC9kZXRhaWw/aWQ9JDImbj1cXFwiKSArIG47XFxuICAgICAgICB9IGVsc2UgaWYgKCFwYXRoLm1hdGNoKC9eaHR0cHM/OlxcXFwvXFxcXC8vKSkge1xcbiAgICAgICAgICAgIGlmIChwYXRoID09IFxcXCJwZXJzb25hbGl6ZWQ/XFxcIikgcGF0aCArPSBcXFwibGltaXQ9MTJcXFwiO1xcbiAgICAgICAgICAgIGVsc2UgaWYgKHBhdGgubWF0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AgICAgICAgIFxcXCJtZDVmb3JlbmNyeXB0XFxcIlxcbiAgICAgICAgKSk7XFxuICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShwb3N0UEMocGF0aC5yZXBsYWNlKFxcXCIvXFxcIiwgXFxcImh0dHBzOi8vaW50ZXJmYWNlLm11c2ljLjE2My5jb20vZVxcXCIpLCB7XFxuICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICBwYXJhbXM6IENyeXB0b1V0aWwuQUVTLmVuY3J5cHQoXFxuICAgICAgICAgICAgICAgICAgICBwYXJhbXMuam9pbihcXFwiLTM2Y2Q0NzliNmI1LVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgQ3J5cHRvVXRpbC5EYXRhLnBhcnNlVVRGOChcXFwiZTgyY2tlbmg4ZGljaGVuOFxcXCIpLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogXFxcIkFFUy9FQ0IvUEtDUzdQYWRkaW5nXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgKS50b0hleCgpXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBoZWFkZXJzOiBPYmplY3QuYXNzaWduKGhlYWRlcnMsIGhlYWQgfHwge30pXFxuICAgICAgICB9KSk7XFxuICAgIH0sXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p24a2dcIixcInBhdGhcIjpcImtnXCIsXCJydWxlXCI6XCJldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nKSkucnVsZSk7XFxuY29uc3QgdGhpc19wbGF0Zm9ybSA9IFxcXCJrZ1xcXCI7XFxuXFxuZnVuY3Rpb24gd2ViU2lnbih1cmwsIHBhcmFtcykge1xcbiAgICBsZXQgbWlkID0gbmV3IERhdGUoKS5nZXRUaW1lKCkgKyBcXFwiXFxcIjtcXG4gICAgc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gICAgICAgICAgICAgaW1nOiBfLmltZ3VybCxcXG4gICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgenlpZDogXy5yYW5raWQsXFxuICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwia2dfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICAvLyAyMDI0MDIyNSAg6L+Z5Liq5o6l5Y+j5LiN6IO955So5LqGICBgaHR0cHM6Ly93d3dhcGkua3Vnb3UuY29tL3l5L2luZGV4LnBocD9yPXBsYXkvZ2V0ZGF0YSZoYXNoPSR7dDF9JmFsYnVtX2lkPSR7Xy5yZWNvbW1lbmRfYWxidW1faWR9Jm1pZD0ke1IoMzIpfSZwbGF0aWQ9NGA7XFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIsIHQzKSB7XFxuICAgICAgICBsZXQgbGlzdCwgXztcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDor6bmg4VcXG4gICAgICAgICAgICAgICAgbGV0IHJlbGF0ZV9nb29kcyA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFt7XFxuICAgICAgICAgICAgICAgICAgICBoYXNoOiB0MVxcbiAgICAgICAgICAgICAgICB9XSlbMF0ucmVsYXRlX2dvb2RzLnNsaWNlKDAsIDQpO1xcbiAgICAgICAgICAgICAgICBfID0gcmVsYXRlX2dvb2RzWzBdO1xcblxcbiAgICAgICAgICAgICAgICAvLyDkuIvovb1cXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gcmVsYXRlX2dvb2RzLm1hcCgoXywgaSkgPT4gdHNbaSArIDFdICsgU2l6ZShfLmluZm8uZmlsZXNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgcmVsYXRlX2dvb2RzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBhcnIuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwia2dcXFwiLCB0MSwgaSwgcmVsYXRlX2dvb2RzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCB0MSwgcmVsYXRlX2dvb2RzKTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgdmFyIHVybCwgaWksIGxyYztcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbGF0ZV9nb29kc1szXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia2dcXFwiLCB0MSwgMywgcmVsYXRlX2dvb2RzLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDMgJiYgaWkgPT0gMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRlX2dvb2RzWzJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrZ1xcXCIsIHQxLCAyLCByZWxhdGVfZ29vZHMsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0MyAmJiBpaSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWxhdGVfZ29vZHNbMV0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImtnXFxcIiwgdDEsIDEsIHJlbGF0ZV9nb29kcywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnByaXZpbGVnZSA9PSAwIHx8IF8ucHJpdmlsZWdlID09IDgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXJsID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKHQxLCAnMTI4JywgXy5hbGJ1bV9pZCwgXy5hbGJ1bV9hdWRpb19pZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vbS5rdWdvdS5jb20vYXBwL2kvZ2V0U29uZ0luZm8ucGhwP2NtZD1wbGF5SW5mbyZoYXNoPVxcXCIgKyB0MSkpLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrZ1xcXCIsIHQxLCAwLCByZWxhdGVfZ29vZHMsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybCkgcmV0dXJuIFxcXCJ0b2FzdDovL+aXoOazleino+aekFxcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICBpZiAoIWxyYykge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IFxcXCJodHRwOi8va3Jjcy5rdWdvdS5jb20vc2VhcmNoP3Zlcj0xJm1hbj15ZXMmY2xpZW50PW1vYmkma2V5d29yZD0mZHVyYXRpb249Jmhhc2g9XFxcIiArIHQxICsgXFxcIiZhbGJ1bV9hdWRpb19pZD1cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBfXyA9IEpTT04ucGFyc2UoZmV0Y2godSkpLmNhbmRpZGF0ZXNbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9fICYmIF9fLmlkICYmIF9fLmFjY2Vzc2tleSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly9seXJpY3Mua3Vnb3UuY29tL2Rvd25sb2FkP3Zlcj0xJmNsaWVudD1wYyZpZD1cXFwiICsgX18uaWQgKyBcXFwiJmFjY2Vzc2tleT1cXFwiICsgX18uYWNjZXNza2V5ICsgXFxcIiZmbXQ9bHJjJmNoYXJzZXQ9dXRmOFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IGJhc2U2NERlY29kZShKU09OLnBhcnNlKGZldGNoKHUpKS5jb250ZW50KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOmmlumhtVxcbiAgICAgICAgICAgICAgICBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL3d3dzIua3Vnb3Uua3Vnb3UuY29tL3l1ZWt1L3Y5L3NwZWNpYWwvZ2V0U3BlY2lhbD9pc19hamF4PTEmY2RuPWNkbiZ0PTUmcGFnZXNpemU9MzAmYz1cXFwiICsgdDEgKyBcXFwiJnA9XFxcIiArIE1ZX1BBR0UpKS5zcGVjaWFsX2RiO1xcbiAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNwZWNpYWxuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNwZWNpYWxpZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBpZiAodDEubWF0Y2goL18vKSkge1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IHdlYlNpZ24oXFxcImh0dHBzOi8vbW9iaWxlcy5rdWdvdS5jb20vYXBpL3Y1L3NwZWNpYWwvc29uZ192MlxcXCIsIFsnZ2xvYmFsX3NwZWNpYWxpZD0nICsgdDEsICdzcGVjaWFsaWQ9JyArIHQxLCBdKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLmluZm87XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGV4ZWN1dGVXZWJSdWxlKGBodHRwOi8vd3d3Mi5rdWdvdS5rdWdvdS5jb20veXVla3Uvdjkvc3BlY2lhbC9zaW5nbGUvJHt0MX0tNS05OTk5OS5odG1sP2pzb249dHJ1ZWAsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoZ2xvYmFsLmRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gSlNPTi5wYXJzZShfKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoKVxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KGxpc3QpO1xcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBfID0gW107XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc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HJpdmlsZWdlID09IDgpXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAvLyBzdXJsID0gKHN0eXBlKSA9PiBKU09OLnBhcnNlKGZldGNoKGBodHRwOi8vbW9iaWxlY2RuLmt1Z291LmNvbS9hcGkvdjMvc2VhcmNoLyR7c3R5cGV9P2Zvcm1hdD1qc29uJmtleXdvcmQ9JHtrZXl3b3JkfSZwYWdlPSR7TVlfUEFHRX0mcGFnZXNpemU9MzBgKSkuZGF0YS5pbmZvO1xcbiAgICAgICAgICAgIGxldCBzdXJsMiA9IChzdHlwZSwgcGxhdGZvcm0pID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IFxcXCJodHRwczovL2dhdGV3YXkua3Vnb3UuY29tL2NvbXBsZXhzZWFyY2gvXFxcIiArIHN0eXBlICsgXFxcIi9zZWFyY2gvXFxcIiArIChzdHlwZSA9PSBcXFwidjNcXFwiID8gXFxcInNvbmdcXFwiIDogXFxcInNwZWNpYWxcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHdlYlNpZ24odXJsLCBbXFxcImtleXdvcmQ9XFxcIiArIGtleXdvcmQsIHBsYXRmb3JtXSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVID09ICdmcmVlJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsMihcXFwidjNcXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykgcmV0dXJuIF8ubGlzdHNbMF07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxpc3QgPSBzdXJsKCdzb25nJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwyKFxcXCJ2M1xcXCIsIFxcXCJwbGF0Zm9ybT1XZWJGaWx0ZXJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdzcmVjJykgcmV0dXJuIF8ubGlzdHM7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXy5saXN0cyk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChfLmZpbGVuYW1lIHx8IF8ubmFtZSkuc3BsaXQoJyAtICcpLnJldmVyc2UoKS5qb2luKCcgLSAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmFsYnVtX3NpemFibGVfY292ZXIgfHwgKF8uaW5mbyA/IF8uaW5mby5pbWFnZSA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogKF8ucHJpdmlsZWdlID09IDAgfHwgXy5wcml2aWxlZ2UgPT0gOCkgPyAwIDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5oYXNoXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgLy8gbGlzdCA9IHN1cmwoJ3NwZWNpYWwnKTtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsMihcXFwidjFcXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0cztcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNwZWNpYWxuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWd1cmwgfHwgXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNwZWNpYWxpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhc2g6IGtleXdvcmRcXG4gICAgICAgICAgICAgICAgICAgIH1dKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogKF8uZmlsZW5hbWUgfHwgXy5uYW1lKS5zcGxpdCgnIC0gJykucmV2ZXJzZSgpLmpvaW4oJyAtICcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5hbGJ1bV9zaXphYmxlX2NvdmVyIHx8IChfLmluZm8gPyBfLmluZm8uaW1hZ2UgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogKF8ucHJpdmlsZWdlID09IDAgfHwgXy5wcml2aWxlZ2UgPT0gOCkgPyAwIDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmhhc2ggKyBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHdlYlNpZ24oXFxcImh0dHBzOi8vbW9iaWxlcy5rdWdvdS5jb20vYXBpL3Y1L3NwZWNpYWwvaW5mb192MlxcXCIsIFtcXFwic3BlY2lhbGlkPVxcXCIgKyBrZXl3b3JkLCBcXFwiZ2xvYmFsX3NwZWNpYWxpZD1cXFwiICsga2V5d29yZF0pO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNwZWNpYWxuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWd1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiAoXy5zcGVjaWFsaWQgfHwgXy5nbG9iYWxfc3BlY2lhbGlkKSArIFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gMDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgYWpheDog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bWQ1KGhhc2ggKyBcXFwiNTdhZTEyZWI2ODkwMjIzZTM1NWNjZmNiNzRlZGY3MGRcXFwiICsgYXBwaWQgKyBtaWQgKyB1c2VyaWQpLFxcbiAgICAgICAgICAgICdhbGJ1bV9pZD0nICsgYWxidW1faWQsXFxuICAgICAgICAgICAgJ2FsYnVtX2F1ZGlvX2lkPScgKyBhbGJ1bV9hdWRpb19pZCxcXG4gICAgICAgICAgICAnY2xpZW50dGltZT0nICsgTWF0aC5mbG9vcihkYXRlIC8gMTAwMCksXFxuICAgICAgICAgICAgJ29wZW5fdGltZT0nICsgJC5kYXRlRm9ybWF0KGRhdGUsICd5eXl5TU1kZCcpLFxcbiAgICAgICAgICAgICd0b2tlbj0nICsgdG9rZW4sXFxuICAgICAgICAgICAgJ2FyZWFfY29kZT0xJyxcXG4gICAgICAgICAgICAnbW9kdWxlPScsXFxuICAgICAgICAgICAgJ3NzYV9mbGFnPWlzX2Zyb210cmFjaycsXFxuICAgICAgICAgICAgJ2NsaWVudHZlcj0xMDUxOCcsIC8vMTIwMjlcXG4gICAgICAgICAgICAndmlwVHlwZT02JyxcXG4gICAgICAgICAgICAncHR5cGU9MCcsXFxuICAgICAgICAgICAgJ2F1dGg9JyxcXG4gICAgICAgICAgICAnbXR5cGU9MCcsXFxuICAgICAgICAgICAgJ2JlaGF2aW9yPXBsYXknLFxcbiAgICAgICAgICAgICdwaWQ9MicsXFxuICAgICAgICAgICAgJ2RmaWQ9LScsXFxuICAgICAgICAgICAgJ3BpZHZlcnNpb249MzAwMScsXFxuICAgICAgICAgICAgJ3NlY3JldD0nICsgUigzMiksXFxuICAgICAgICAgICAgLy8gJ2JlaGF2aW9yPXBsYXknLFxcbiAgICAgICAgICAgIC8vICd2ZXJzaW9uPTkyMDknLFxcbiAgICAgICAgICAgIC8vICdjbWQ9MjYnLFxcbiAgICAgICAgXS5zb3J0KCk7XFxuICAgICAgICB2YXIgc2lnbmF0dXJlID0gbWQ1KHNpZ25rZXkgKyBwYXJhbXMuam9pbihcXFwiXFxcIikgKyBzaWdua2V5KTtcXG4gICAgICAgIC8vIGJvZHlfID0gXFxcImh0dHA6Ly90cmFja2VyY2RuZ3oua3Vnb3UuY29tL2kvdjIvP1xcXCIgKyBwYXJhbXMuam9pbihcXFwiJlxcXCIpO1xcbiAgICAgICAgdmFyIGJvZHlfID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9nYXRld2F5Lmt1Z291LmNvbS92NS91cmw/XFxcIiArIHBhcmFtcy5qb2luKFxcXCImXFxcIikgKyBcXFwiJnNpZ25hdHVyZT1cXFwiICsgc2lnbmF0dXJlLCB7XFxuICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIkFuZHJvaWQ3MTItQW5kcm9pZFBob25lLTEwNTE4LTE4LTAtTmV0TXVzaWMtd2lmaVxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJLRy1USGFzaFxcXCI6IFxcXCIzZTVlYzZiXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIktHLVJlY1xcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIktHLVJDXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwieC1yb3V0ZXJcXFwiOiBcXFwidHJhY2tlci5rdWdvdS5jb21cXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgaWYgKGJvZHlfLnN0YXR1cyA9PSAxKVxcbiAgICAgICAgICAgIHJldHVybiBib2R5X1tcXFwidXJsXFxcIl1bMF07XFxuICAgICAgICBlbHNlIGlmIChib2R5Xy5zdGF0dXMgPT0gMilcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Y+v6IO95piv55m75b2V6L+H5pyf5LqG44CCXFxcIjtcXG4gICAgICAgIGVsc2VcXG4gICAgICAgICAgICByZXR1c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AgICAgICAgICAgJ3V1aWQ9JyArIG1kNShtaWQpLFxcbiAgICAgICAgICAgICdkZmlkPS0nXFxuICAgICAgICBdLnNvcnQoKTtcXG4gICAgICAgIGxldCBzaWduYXR1cmUgPSBtZDUoXFxuICAgICAgICAgICAgc2lnbmtleSArXFxuICAgICAgICAgICAgcGFyYW1zLmpvaW4oXFxcIlxcXCIpICtcXG4gICAgICAgICAgICBib2R5ICtcXG4gICAgICAgICAgICBzaWdua2V5XFxuICAgICAgICApO1xcbiAgICAgICAgbGV0IGp4bGlzdCwgcmVxID0gSlNPTi5wYXJzZShwb3N0KFxcXCJodHRwczovL2dhdGV3YXkua3Vnb3UuY29tL3YyL3JlcG9ydC9saXN0ZW5fc29uZz9cXFwiICsgcGFyYW1zLmpvaW4oXFxcIiZcXFwiKSArIFxcXCImc2lnbmF0dXJlPVxcXCIgKyBzaWduYXR1cmUsIHtcXG4gICAgICAgICAgICBib2R5LFxcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiQW5kcm9pZDcxMi1BbmRyb2lkUGhvbmUtMTA1MTgtMTgtMC1OZXRNdXNpYy13aWZpXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIktHLVRIYXNoXFxcIjogXFxcIjNlNWVjNmJcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiS0ctUmVjXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiS0ctUkNcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJ4LXJvdXRlclxcXCI6IFxcXCJ5b3V0aC5rdWdvdS5jb21cXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgaWYgKHJlcS5zdGF0dXMgPT0gMSkge1xcbiAgICAgICAgICAgIGlmIChpc2p4KSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9rZycsIFtdKVxcbiAgICAgICAgICAgICAgICAgICAgLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImM4NzdhZTcyYjk3YmMyNjcyMGFkOGIxYTM5MzYyZDQ3XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnRpbWUgPSBkYXRlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X2tnJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIGlmIChyZXEuZXJyb3JfY29kZSA9PSAxMzAwMTIpIHsgLy8g562+5Yiw6L+H5LqG77yfICAgICAgXFxuICAgICAgICAgICAgaWYgKGlzangpIHtcXG4gICAgICAgICAgICAgICAganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X2tnJywgW10pXFxuICAgICAgICAgICAgICAgICAgICAubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZDUoXy50aXRsZSArIF8udXJsKSA9PSBcXFwiYzg3N2FlNzJiOTdiYzI2NzIwYWQ4YjFhMzkzNjJkNDdcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8udGltZSA9IGRhdGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uc2lnbmluID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3Rfa2cnLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v562+5Yiw5aSx6LSl77ya5LuK5aSp5bey57uP562+5Yiw6L+H5LqG77yfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v562+5Yiw5aSx6LSl77ya5LuK5aSp5bey57uP562+5Yiw6L+H5LqG77yfXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nrb7liLDlpLHotKXvvJpcXFwiICsgcmVxLmVycm9yX21zZztcXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgLy8gR2V0X0tnX05ld19Ub2tlblxcbiAgICByZWZyZXNoX3Rva2VuOiBmdW5jdGlvbih1c2VyaWQsIHRva2VuLCBhcHBpZCwgc2lnbmtleSkge1xcbiAgICAgICAgdmFyIGFwcGlkID0gYXBwaWQgfHwgXFxcIjEwMDVcXFwiO1xcbiAgICAgICAgdmFyIHNpZ25rZXkgPSBzaWdua2V5IHx8IFxcXCJPSWx3aWVrczI4ZGsyazA5Mmxrc2kyVUlrcFxcXCI7XFxuICAgICAgICBbYWVzX2tleSwgYWVzX2l2XSA9IHtcXG4gICAgICAgICAgICBcXFwiMTAwNVxcXCI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meSh7XFxuICAgICAgICAgICAgcDMsXFxuICAgICAgICAgICAgY2xpZW50dGltZV9tcyxcXG4gICAgICAgICAgICB0MTogXFxcIjBcXFwiLFxcbiAgICAgICAgICAgIHQyOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgdXNlcmlkLFxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICAvLyB1dWlkXFxuICAgICAgICBsZXQgcGFyYW1zID0gW1xcbiAgICAgICAgICAgIFxcXCJkZmlkPS1cXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcHBpZD1cXFwiICsgYXBwaWQsXFxuICAgICAgICAgICAgXFxcIm1pZD1cXFwiICsgUigzMiwgXFxcIjEyMzQ1Njc4OTBcXFwiKSxcXG4gICAgICAgICAgICBcXFwiY2xpZW50dmVyPTEwNTk3XFxcIixcXG4gICAgICAgICAgICBcXFwiY2xpZW50dGltZT1cXFwiICsgY2xpZW50dGltZSxcXG4gICAgICAgIF0uc29ydCgpO1xcbiAgICAgICAgbGV0IHNpZ25hdHVyZSA9IG1kNShzaWdua2V5ICsgcGFyYW1zLmpvaW4oXFxcIlxcXCIpICsgYm9keSArIHNpZ25rZXkpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShwb3N0KFxcXCJodHRwOi8vbG9naW4udXNlci5rdWdvdS5jb20vdjQvbG9naW5fYnlfdG9rZW4vP1xcXCIgKyBwYXJhbXMuam9pbihcXFwiJlxcXCIpICsgXFxcIiZzaWduYXR1cmU9XFxcIiArIHNpZ25hdHVyZSwge1xcbiAgICAgICAgICAgICAgICBib2R5LFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJBbmRyb2lkODAwLTEwNzAtMTA1OTctNDYtMC1MT0dJTi13aWZpXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJLRy1USGFzaFxcXCI6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KG8gKiBuICsgbCkgJSBjO1xcbiAgICAgICAgZm9yIChkID0gZC50b1N0cmluZygxNik7IGQubGVuZ3RoIDwgODspXFxuICAgICAgICAgICAgZCA9IFxcXCIwXFxcIiArIGQ7XFxuICAgICAgICBsZXQgU2VjcmV0ID0gZiArIGQ7XFxuICAgICAgICBwdXRNeVZhcigna3dfQ29va2llJywgQ29va2llKTtcXG4gICAgICAgIHB1dE15VmFyKCdrd19TZWNyZXQnLCBTZWNyZXQpO1xcbiAgICAgICAgcHV0TXlWYXIoJ2t3X1B1dFRpbWUnLCBuZXcgRGF0ZSgpLmdldFRpbWUoKSArIDNlNSk7XFxuICAgIH1cXG4gICAgdXJsICs9IGBodHRwc1N0YXR1cz0xJnJlcUlkPSR7Uig4KX0tJHtSKDQpfS0ke1IoNCl9LSR7Uig0KX0tJHtSKDEyKX0mcGxhdD13ZWJfd3d3JmZyb209YDtcXG4gICAgbGV0IGdldGRhdGEgPSAoYWpheGVycikgPT4ge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaFBDKHVybCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL2t1d28uY24vJyxcXG4gICAgICAgICAgICAgICAgICAgICdDb29raWUnOiBnZXRNeVZhcigna3dfQ29va2llJyksXFxuICAgICAgICAgICAgICAgICAgICAnU2VjcmV0JzogZ2V0TXlWYXIoJ2t3X1NlY3JldCcpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgIHJldHVybiBhamF4ZXJyIDwgMiA/IGdldGRhdGEoYWpheGVyciArIDEpIDogXFxcIlxcXCI7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgcmV0dXJuIGdldGRhdGEoMCk7XFxufVxcbiQuZXh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gMTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGsgb2YgWzEyOCwgMzIwLCAyMDAwLCA0MDAwXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChSZWcoaykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbaV0gKyByZWdbMV0ucmVwbGFjZSgvXFxcXHMqbWIvaSwgXFxcIiBNQlxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSsrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJkb3duXFxcIiwgXFxcImt3XFxcIiwgdDEsIGksIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBfKTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgdmFyIHVybCwgaWksIGxyYztcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpaSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICczJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFJlZyg0MDAwKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia3dcXFwiLCB0MSwgMywgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFJlZygyMDAwKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia3dcXFwiLCB0MSwgMiwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFJlZygzMjApKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrd1xcXCIsIHQxLCAxLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udHBheSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImt3XFxcIiwgdDEsIDAsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVybCA9IGFqYXgocGNhcGkucmVwbGFjZSgvKGFwaVxcXFwvKS8sICckMXYxLycpICsgXFxcIm11c2ljL3BsYXlVcmw/bWlkPVxcXCIgKyB0MSArIFxcXCImdHlwZT1tdXNpYyZcXFwiKS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IGZldGNoKFxcXCJodHRwczovL2FudGlzZXJ2ZXIua3V3by5jbi9hbnRpLnM/dHlwZT1jb252ZXJ0X3VybCZmb3JtYXQ9bXAzJnJpZD1cXFwiICsgdDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybCkgcmV0dXJuIFxcXCJ0b2FzdDovL+aXoOazleino+aekFxcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICBpZiAoIWxyYykge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBhamF4KFxcXCJodHRwOi8vbS5rdXdvLmNuL25ld2g1L3NpbmdsZXMvc29uZ2luZm9hbmRscmM/bXVzaWNJZD1cXFwiICsgdDEgKyBcXFwiJlxcXCIpLmxyY2xpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcyA9ICgoXy50aW1lIC0gMCkgJSA2MCkudG9GaXhlZCgzKS5wYWRTdGFydCg2LCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbSA9ICgoXy50aW1lIC0gcykgLyA2MCkudG9GaXhlZCgwKS5wYWRTdGFydCgyLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYFske219OiR7c31dYCArIF8ubGluZUx5cmljXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkuam9pbignXFxcXG4nKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g6aaW6aG1XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHBjYXBpICsgdDEgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IF8uZGF0YSB8fCBfLmxpc3Q7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgocGNhcGkgKyBcXFwicGxheWxpc3QvcGxheUxpc3RJbmZvP3BpZD1cXFwiICsgdDEgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBfID0gYWpheChwY2FwaSArIFxcXCJiYW5nL2JhbmcvbXVzaWNMaXN0P2JhbmdJZD1cXFwiICsgdDEgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodDIpIHJldHVybiBfLm11c2ljTGlzdDtcXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIF8ubXVzaWNMaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogKF8uc29uZ05hbWUgfHwgXy5uYW1lKSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgaW1nOiBfLnBpYyB8fCBfLmltZyB8fCBmZXRjaCgnaHR0cDovL2FydGlzdHBpY3NlcnZlci5rdXdvLmNuL3BpYy53ZWI/dHlwZT1yaWRfcGljJnBpY3R5cGU9dXJsJnNpemU9NTAwJnJpZD0nICsgXy5pZCksXFxuICAgICAgICAgICAgY29udGVudDogXy5pc0xpc3RlbkZlZSA9PSB0cnVlID8gMSA6IDAsXFxuICAgICAgICAgICAgenlpZDogXy5pZCB8fCBfLnJpZFxcbiAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBpc1UsIHJ1bikge1xcbiAgICAgICAgbGV0IF87XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgbGV0IGxpc3QsIF9fID0ge1xcbiAgICAgICAgICAgICAgICBsaWI6IChfKSA9PiB0cnVlLFxcbiAgICAgICAgICAgICAgICBwYWlkOiAoXykgPT4gXy50cGF5ID09ICcxJyxcXG4gICAgICAgICAgICAgICAgZnJlZTogKF8pID0+IF8udHBheSA9PSAnMCdcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIC8vIHN1cmwgPSAoc3R5cGUpID0+IGFqYXgocGNhcGkgKyBcXFwic2VhcmNoL3NlYXJjaFxcXCIgKyBzdHlwZSArIFxcXCJCeWtleVdvcmQ/a2V5PVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIikubGlzdDtcXG4gICAgICAgICAgICBsZXQgc3VybDIgPSAoZnQsIHZpcHZlcikgPT4gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL3NlYXJjaC5rdXdvLmNuL3Iucz9jbGllbnQ9a3QmYWxsPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwbj1cXFwiICsgKE1ZX1BBR0UgLSAxKSArIFxcXCImcm49MzAmdWlkPTAmdmVyPWt3cGxheWVyaGRfYXJfOC41LjQuNSZmdD1cXFwiICsgZnQgKyBcXFwiJmNsdXN0ZXI9MCZzdHJhdGVneT0yMDEyJmVuY29kaW5nPXV0ZjgmcmZvcm1hdD1qc29uJnZlcm1lcmdlPTEmbW9iaT0xXFxcIiArIHZpcHZlcikpO1xcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICAvLyBzdXJsKCdNdXNpYycpLm1hcCgpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVSA9PSAnZnJlZScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwyKFxcXCJtdXNpY1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcIm11c2ljXFxcIiwgXFxcIiZ2aXB2ZXI9MVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYWJzbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBfIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIV8uU09OR05BTUUubWF0Y2goJ+eJh+autScpKSByZXR1cm4gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbWcsIHJpZCA9IF8uTVVTSUNSSUQuc3BsaXQoJ18nKVsxXSArICcnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ud2ViX2FsYnVtcGljX3Nob3J0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gXFxcImh0dHBzOi8vaW1nMi5rdXdvLmNuL3N0YXIvYWxidW1jb3Zlci9cXFwiICsgXy53ZWJfYWxidW1waWNfc2hvcnQucmVwbGFjZSgvXjEyMC8sICc1MDAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gZmV0Y2goJ2h0dHA6Ly9hcnRpc3RwaWNzZXJ2ZXIua3V3by5jbi9waWMud2ViP3R5cGU9cmlkX3BpYyZwaWN0eXBlPXVybCZzaXplPTUwMCZyaWQ9JyArIHJpZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1nID09IFxcXCJOT19QSUNcXFwiICYmIF8ud2ViX2FydGlzdHBpY19zaG9ydCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwOi8vaW1nMS5rdXdvLmNuL3N0YXIvc3RhcmhlYWRzL1xcXCIgKyBfLndlYl9hcnRpc3RwaWNfc2hvcnQucmVwbGFjZSgvXjEyMC8sICc1MDAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5TT05HTkFNRSArICcgLSAnICsgXy5BUlRJU1QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy50cGF5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHJpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIC8vIHN1cmwoJ1BsYXlMaXN0JykubWFwKCk7XFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcInBsYXlsaXN0XFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYWJzbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ucGxheWxpc3RpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLlRPVEFMIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwOi8vZGF0YWNlbnRlci5rdXdvLmNuL2QuYz9jbWtleT1wbGlzdF9wbDIwMTImZnQ9bXVzaWMmcmVzZW5jPXV0ZjgmaWRzPVxcXCIgKyBrZXl3b3JkKSlbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogZmV0Y2goJ2h0dHA6Ly9hcnRpc3RwaWNzZXJ2ZXIua3V3by5jbi9waWMud2ViP3R5cGU9cmlkX3BpYyZwaWN0eXBlPXVybCZzaXplPTUwMCZyaWQ9JyArIF8uaWQpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8udHBheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChwY2FwaSArIFxcXCJwbGF5bGlzdC9wbGF5TGlzdEluZm8/cGlkPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwbj0xJnJuPTEmXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGRlczogZnVuY3Rpb24odCkge1xcbiAgICAgICAgcmV0dXJuIGV4ZWN1dGVXZWJSdWxlKFxcXCJcXFwiLCAkLnRvU3RyaW5nKCh0KSA9PiB7XFxuICAgICAgICAgICAgY29uc3QgQnVmZmVyID0ge1xcbiAgICAgICAgICAgICAgICBmcm9tOiB0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHIgPSB0Lmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgICAgIGUgPSBuZXcgVWludDhBcnJheShyKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobiA9IDA7IG4gPCByOyBuKyspXFxuICAgICAgICAgICAgICAgICAgICAgICAgZVtuXSA9IHQuY2hhckNvZGVBdChuKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmFuZ2UgPSB0ID0+IEFycmF5LmZyb20obmV3IEFycmF5KHQpLmtleXMoKSk7XFxuICAgICAgICAgICAgTG9uZyA9IHQgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25zdCByID0gQmlnSW50KHQpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdG9TdHJpbmc6ICgpID0+IHIudG9TdHJpbmcoKSxcXG4gICAgICAgICAgICAgICAgICAgIGlzTmVnYXRpdmU6ICgpID0+IHIgPCAwLFxcbiAgICAgICAgICAgICAgICAgICAgbm90OiAoKSA9PiBMb25nKH5yKSxcXG4gICAgICAgICAgICAgICAgICAgIGxvdzogTnVtYmVyKHIpLFxcbiAgICAgICAgICAgICAgICAgICAgb3I6IHQgPT4gTG9uZyhyIHwgQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgICAgIHhvcjogdCA9PiBMb25nKHIgXiBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICAgICAgYW5kOiB0ID0+IExvbmcociAmIEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgICAgICBlcXVhbHM6IHQgPT4gciA9PT0gQmlnSW50KHQpLFxcbiAgICAgICAgICAgICAgICAgICAgc2hpZnRMZWZ0OiB0ID0+IExvbmcociA8PCBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICAgICAgc2hpZnRSaWdodDogdCA9PiBMb25nKHIgPj4gQmlnSW50KHQpKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBMb25nQXJyYXkgPSB0ID0+IHQubWFwKHQgPT4gTG9uZyh0KSk7XFxuXFxuXFxuICAgICAgICAgICAgYXJyYXlFID0gTG9uZ0FycmF5KFtcXG4gICAgICAgICAgICAgICAgMzEsIDAsIDEsIDIsIDMsIDQsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMywgNCwgNSwgNiwgNywgOCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICA3LCA4LCA5LCAxMCwgMTEsIDEyLCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDExLCAxMiwgMTMsIDE0LCAxNSwgMTYsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMTUsIDE2LCAxNywgMTgsI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wgNTIsIDIwLCA2MCwgMjgsXFxuICAgICAgICAgICAgICAgIDM1LCAzLCA0MywgMTEsIDUxLCAxOSwgNTksIDI3LFxcbiAgICAgICAgICAgICAgICAzNCwgMiwgNDIsIDEwLCA1MCwgMTgsIDU4LCAyNixcXG4gICAgICAgICAgICAgICAgMzMsIDEsIDQxLCA5LCA0OSwgMTcsIDU3LCAyNSxcXG4gICAgICAgICAgICAgICAgMzIsIDAsIDQwLCA4LCA0OCwgMTYsIDU2LCAyNFxcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgYXJyYXlMcyA9IFtcXG4gICAgICAgICAgICAgICAgMSwgMSwgMiwgMiwgMiwgMiwgMiwgMixcXG4gICAgICAgICAgICAgICAgMSwgMiwgMiwgMiwgMiwgMiwgMiwgMVxcbiAgICAgICAgICAgIF1cXG4gICAgICAgICAgICBhcnJheUxzTWFzayA9IExvbmdBcnJheShbMCwgMTA0ODU3NywgMzE0NTczMV0pXFxuICAgICAgICAgICAgYXJyYXlNYXNrID0gcmFuZ2UoNjQpLm1hcCh0ID0+IE1hdGgucG93KDIsIHQpKVxcbiAgICAgICAgICAgIGFycmF5TWFza1s2M10gKj0gLTFcXG4gICAgICAgICAgICBhcnJheVAgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICAxNSwgNiwgMTksIDIwLCAyOCwgMTEsIDI3LCAxNixcXG4gICAgICAgICAgICAgICAgMCwgMTQsIDIyLCAyNSwgNCwgMTcsIDMwLCA5LFxcbiAgICAgICAgICAgICAgICAxLCA3LCAyMywgMTMsIDMxLCAyNiwgMiwgOCxcXG4gICAgICAgICAgICAgICAgMTgsIDEyLCAyOSwgNSwgMjEsIDEwLCAzLCAyNFxcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgYXJyYXlQQ18xID0gTG9uZ0FycmF5KFtcXG4gICAgICAgICAgICAgICAgNTYsIDQ4LCA0MCwgMzIsIDI0LCAxNiwgOCwgMCxcXG4gICAgICAgICAgICAgICAgNTcsIDQ5LCA0MSwgMzMsIDI1LCAxNywgOSwgMSxcXG4gICAgICAgICAgICAgICAgNTgsIDUwLCA0MiwgMzQsIDI2LCAxOCwgMTAsIDIsXFxuICAgICAgICAgICAgICAgIDU5LCA1MSwgNDMsIDM1LCA2MiwgNTQsIDQ2LCAzOCxcXG4gICAgICAgICAgICAgICAgMzAsIDIyLCAxNCwgNiwgNjEsIDUzLCA0NSwgMzcsXFxuICAgICAgICAgICAgICAgIDI5LCAyMSwgMTMsIDUsIDYwLCA1MiwgNDQsIDM2LFxcbiAgICAgICAgICAgICAgICAyOCwgMjAsIDEyLCA0LCAyNywgMTksIDExLCAzXFxuICAgICAgICAgICAgXSlcXG4gICAgICAgICAgICBhcnJheVBDXzIgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICAxMywgMTYsIDEwLCAyMywgMCwgNCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyLCAyNywgMTQsIDUsIDIwLCA5LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDIyLCAxOCwgMTEsIDMsIDI1LCA3LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDE1LCA2LCAyNiwgMTksIDEyLCAxLCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDQwLCA1MSwgMzAsIDM2LCA0NiwgNTQsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMjksIDM5LCA1MCwgNDQsIDMyLCA0NywgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICA0MywgNDgsIDM4LCA1NSwgMzMsIDUyLCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDQ1LCA0MSwgNDksIDM1LCAyOCwgMzEsIC0xLCAtMVxcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgbWF0cml4TlNCb3ggPSBbXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDE0LCA0LCAzLCAxNSwgMiwgMTMsIDUsIDMsXFxuICAgICAgICAgICAgICAgICAgICAxMywgMTQsIDYsIDksIDExLCAyLCAwLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMSwgMTAsIDEyLCAxNSwgNiwgOSwgMTAsXFxuICAgICAgICAgICAgICAgICAgICAxLCA4LCAxMiwgNywgOCwgMTEsIDcsIDAsXFxuICAgICAgICAgICAgICAgICAgICAwLCAxNSwgMTAsIDUsIDE0LCA0LCA5LCAxMCxcXG4gICAgICAgICAgICAgICAgICAgIDcsIDgsIDEyLCAzLCAxMywgMSwgMywgNixcXG4gICAgICAgICAgICAgICAgICAgIDE1LCAxMiwgNiwgMTEsIDIsIDksIDUsIDAsXFxuICAgICAgICAgICAgICAgICAgICA0LCAyLCAxMSwgMTQsIDEsIDcsIDgsIDEzXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDE1LCAwLCA5LCA1LCA2LCAxMCwgMTIsIDksXFxuICAgICAgICAgICAgICAgICAgICA4LCA3LCAyLCAxMiwgMywgMTMsIDUsIDIsXFxuICAgICAgICAgICAgICAgICAgICAxLCAxNCwgNywgOCwgMTEsIDQsIDAsIDMsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgMTEsIDEzLCA2LCA0LCAxLCAxMCwgMTUsXFxuICAgICAgICAgICAgICAgICAgICAzLCAxMywgMTIsIDExLCAxNSwgMywgNiwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEwLCAxLCA3LCA4LCA0LCAxMSwgMTQsXFxuICAgICAgICAgICAgICAgICAgICAxMywgOCwgMCwgNiwgMiwgMTUsIDksIDUsXFxuICAgICAgICAgICAgICAgICAgICA3LCAxLCAxMCwgMTIsIDE0LCAyLCA1LCA5XFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDEwLCAxMywgMSwgMTEsIDYsIDgsIDExLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgOSwgNCwgMTIsIDIsIDE1LCAzLCAyLCAxNCxcXG4gICAgICAgICAgICAgICAgICAgIDAsIDYsIDEzLCAxLCAzLCAxNSwgNCwgMTAsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgOSwgNywgMTIsIDUsIDAsIDgsIDcsXFxuICAgICAgICAgICAgICAgICAgICAxMywgMSwgMiwgNCwgMywgNiwgMTIsIDExLFxcbiAgICAgICAgICAgICAgICAgICAgMCwgMTMsIDUsIDE0LCA2LCA4LCAxNSwgMixcXG4gICAgICAgICAgICAgICAgICAgIDcsIDEwLCA4LCAxNSwgNCwgOSwgMTEsIDUsXFxuICAgICAgICAgICAgICAgICAgICA5LCAwLCAxNCwgMywgMTAsIDcsIDEsIDEyXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDcsIDEwLCAxLCAxNSwgMCwgMTIsIDExLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDksIDgsIDMsIDksIDcsIDQsIDgsXFxuICAgICAgICAgICAgICAgICAgICAxMywgNiwgMiwgMSwgNiwgMTEsIDEyLCAyLFxcbiAgICAgICAgICAgICAgICAgICAgMywgMCwgNSwgMTQsIDEwLCAxMywgMTUsIDQsXFxuICAgICAgICAgICAgICAgICAgICAxMywgMywgNCwgOSwgNiwgMTAsIDEsIDEyLFxcbiAgICAgICAgICAgICAgICAgICAgMTEsIDAsIDIsIDUsIDAsIDEzLCAxNCwgMixcXG4gICAgICAgICAgICAgICAgICAgIDgsIDE1LCA3LCA0LCAxNSwgMSwgMTAsIDcsXFxuICAgICAgICAgICAgICAgICAgICA1LCA2LCAxMiwgMTEsIDMsIDgsIDksIDE0XFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDIsIDQsIDgsIDE1LCA3LCAxMCwgMTMsIDYsXFxuICAgICAgICAgICAgICAgICAgICA0LCAxLCAzLCAxMiwgMTEsIDcsIDE0LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgMTIsIDIsIDUsIDksIDEwLCAxMywgMCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDEsIDExLCAxNSwgNSwgNiwgOCwgOSwgMTQsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgMTEsIDUsIDYsIDQsIDEsIDMsIDEwLFxcbiAgICAgICAgICAgICAgICAgICAgMiwgMTIsIDE1LCAwLCAxMywgMiwgOCwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDExLCA4LCAwLCAxNSwgNywgMTQsIDksIDQsXFxuICAgICAgICAgICAgICAgICAgICAxMiwgNywgMTAsIDksIDEsIDEzLCA2LCAzXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDEyLCA5LCAwLCA3LCA5LCAyLCAxNCwgMSxcXG4gICAgICAgICAgICAgICAgICAgIDEwLCAxNSwgMywgNCwgNiwgMTIsIDUsIDExLFxcbiAgICAgICAgICAgICAgICAgICAgMSwgMTQsIDEzLCAwLCAyLCA4LCA3LCAxMyxcXG4gICAgICAgICAgICAgICAgICAgIDE1LCA1LCA0LCAxMCwgOCwgMywgMTEsIDYsXFxuICAgICAgICAgICAgICAgICAgICAxMCwgNCwgNiwgMTEsIDcsIDksIDAsIDYsXFxuICAgICAgICAgICAgICAgICAgICA0LCAyLCAxMywgMSwgOSwgMTUsIDMsIDgsXFxuICAgICAgICAgICAgICAgICAgICAxNSwgMywgMSwgMTQsIDEyLCA1LCAxMSwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDIsIDEyLCAxNCwgNywgNSwgMTAsIDgsIDEzXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEsIDMsIDEwLCAxNSwgMTIsIDUsIDAsXFxuICAgICAgICAgICAgICAgICAgICAyLCAxMSwgOSwgNiwgOCwgNywgNiwgOSxcXG4gICAgICAgICAgICAgICAgICAgIDExLCA0LCAxMiwgMTUsIDAsIDMsIDEwLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDEzLCA3LCA4LCAxMywgMTQsIDEsIDIsXFxuICAgICAgICAgICAgICAgICAgICAxMywgNiwgMTQsIDksIDQsIDEsIDIsIDE0LFxcbiAgICAgICAgICAgICAgICAgICAgMTEsIDEzLCA1LCAwLCAxLCAxMCwgOCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDAsIDExLCAzLCA1LCA5LCA0LCAxNSwgMixcXG4gICAgICAgICAgICAgICAgICAgIDcsIDgsIDEyLCAxNSwgMTAsIDcsIDYsIDEyXFxuICAgICAgICAgICAgICAgIF0sXFxuICAgICAgICAgICAgICAgIFtcXG4gICAgICAgICAgICAgICAgICAgIDEzLCA3LCAxMCwgMCwgNiwgOSwgNSwgMTUsXFxuICAgICAgICAgICAgICAgICAgICA4LCA0LCAzLCAxMCwgMTEsIDE0LCAxMiwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDIsIDExLCA5LCA2LCAxNSwgMTIsIDAsIDMsXFxuICAgICAgICAgICAgICAgICAgICA0LCAxLCAxNCwgMTMsIDEsIDIsIDcsIDgsXFxuICAgICAgICAgICAgICAgICAgICAxLCAyLCAxMiwgMTUsIDEwLCA0LCAwLCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDE0LCA2LCA5LCA3LCA4LCA5LCA2LFxcbiAgICAgICAgICAgICAgICAgICAgMTUsIDEsIDUsIDEyLCAzLCAxMCwgMTQsIDUsXFxuICAgICAgICAgICAgICAgICAgICA4LCA3LCAxMSwgMCwgNCwgMTMsIDIsIDExXFxuICAgICAgICAgICAgICAgIF1cXG4gICAgICAgICAgICBdXFxuICAgICAgICAgICAgYml0VHJhbnNmb3JtID0gKHQsIHIsIGUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IG4gPSBMb25nKDApO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcmFuZ2UocikuZm9yRWFjaChyID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHRbcl0uaXNOZWdhdGl2ZSgpIHx8IGUuYW5kKGFycmF5TWFza1t0W3JdLmxvd10pLmVxdWFscygwKSB8fCAobiA9IG4ub3IoYXJyYXlNYXNrW3JdKSlcXG4gICAgICAgICAgICAgICAgfSksIG5cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgREVTNjQgPSAodCwgcikgPT4ge1xcbiAgICAgICAgICAgICAgICBlID0gW10sXFxuICAgICAgICAgICAgICAgICAgICBuID0gW107XFxuICAgICAgICAgICAgICAgIGYgPSBiaXRUcmFuc2Zvcm0oYXJyYXlJUCwgNjQsIHIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gblswXSA9IGYuYW5kKDQyOTQ5NjcyOTUpLFxcbiAgICAgICAgICAgICAgICAgICAgblsxXSA9IGYuYW5kKC00Mjk0OTY3Mjk2KS5zaGlmdFJpZ2h0KDMyKSxcXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlKDE2KS5mb3JFYWNoKHIgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmID0gTG9uZygwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gTG9uZyhuWzFdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGJpdFRyYW5zZm9ybShhcnJheUUsIDY0LCBpKS54b3IodFtyXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlKDgpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlW3RdID0gaS5zaGlmdFJpZ2h0KDggKiB0KS5hbmQoMjU1KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2UoOCkucmV2ZXJzZSgpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gZi5zaGlmdExlZnQoNCkub3IobWF0cml4TlNCb3hbdF1bZVt0XV0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gYml0VHJhbnNmb3JtKGFycmF5UCwgMzIsIGYpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gTG9uZyhuWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgblswXSA9IExvbmcoblsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5bMV0gPSBvLnhvcihpKVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBuLnJldmVyc2UoKSxcXG4gICAgICAgICAgICAgICAgICAgIGYgPSBuWzFdLnNoaWZ0TGVmdCgzMikuYW5kKC00Mjk0OTY3Mjk2KS5vcihuWzBdLmFuZCg0Mjk0OTY3Mjk1KSksXFxuICAgICAgICAgICAgICAgICAgICBmID0gYml0VHJhbnNmb3JtKGFycmF5SVBfMSwgNjQsIGYpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHN1YktleXMgPSAodCwgcikgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgbiA9IGJpdFRyYW5zZm9ybShhcnJheVBDXzEsIDU2LCB0KTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UoMTYpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBuID0gbi5hbmQoYXJyYXlMc01hc2tbYXJyYXlMc1t0XV0pLnNoaWZ0TGVmdCgyOCAtIGFycmF5THNbdF0pLm9yKG4uYW5kKGFycmF5THNNYXNrW2FycmF5THNbdF1dLm5vdCgpKS5zaGlmdFJpZ2h0KGFycmF5THNbdF0pKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByW3RdID0gYml0VHJhbnNmb3JtKGFycmF5UENfMiwgNjQsIG4pXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGIgPSBmdW5jdGlvbih0KSB7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHIgPSBCdWZmZXIuZnJvbShcXFwieWx6c3hrd21cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IG4gPSBMb25nKDApO1xcbiAgICAgICAgICAgICAgICByYW5nZSg4KS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbiA9IExvbmcoclt0XSkuc2hpZnRMZWZ0KDggKiB0KS5vcihuKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgY29uc3QgbyA9IE1hdGguZmxvb3IodC5sZW5ndGggLyA4KSxcXG4gICAgICAgICAgICAgICAgICAgIGkgPSByYW5nZSgxNikubWFwKCgpID0+IExvbmcoMCkpO1xcbiAgICAgICAgICAgICAgICBzdWJLZXlzKG4sIGkpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBmID0gcmFuZ2UobykubWFwKCgpID0+IExvbmcoMCkpO1xcbiAgICAgICAgICAgICAgICByYW5nZShvKS5mb3JFYWNoKHIgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2UoOCkuZm9yRWFjaChlID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmW3JdID0gTG9uZyh0W2UgKyA4ICogcl0pLnNoaWZ0TGVmdCg4ICogZSkub3IoZltyXSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjb25zdCBzID0gW107XFxuICAgICAgICAgICAgICAgIHJhbmdlKG8pLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzW3RdID0gREVTNjQoaSwgZlt0XSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHUgPSB0LnNsaWNlKDggKiBvKTtcXG4gICAgICAgICAgICAgICAgbGV0IGggPSBMb25nKDApO1xcbiAgICAgICAgICAgICAgICByYW5nZSh0Lmxlbmd0aCAlIDgpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBoID0gTG9uZyh1W3RdKS5zaGlmdExlZnQoOCAqIHQpLm9yKGgpXFxuICAgICAgICAgICAgICAgIH0pLCBzW29dID0gREVTNjQoaSwgaCk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IGEgPSBbXTtcXG4gICAgICAgICAgICAgICAgbGV0IGMgPSAwO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcy5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2UoOCkuZm9yRWFjaChyID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhW2NdID0gdC5zaGlmdFJpZ2h0KDggKiByKS5hbmQoMjU1KS5sb3c7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYysrXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KSwgYTtcXG4gICAgICAgICAgICB9KEJ1ZmZlci5mcm9tKHQpKTtcXG4gICAgICAgICAgICByZXR1cm4gd2luZG93LmJ0b2EoU3RyaW5nLmZyb21DaGFyQ29kZS5hcHBseShudWxsLCBiKSk7XFxuICAgICAgICB9LCB0KSk7XFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLinbptZ1wiLFwicGF0aFwiOlwibWdcIixcInJ1bGVcIjpcImV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScpKS5ydWxlKTtcXG5jb25zdCB0aGlzX3BsYXRmb3JtID0gXFxcIm1nXFxcIjtcXG5cXG5mdW5jdGlvbiBhamF4KHVyaSwgc2l6ZSwgaGVhZCkge1xcbiAgICB1cmkgPSBTdHJpbmcodXJpKTtcXG4gICAgaWYgKHVyaS5tYX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ICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcIm1nX2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0Mikge1xcbiAgICAgICAgbGV0IGxpc3QsIF87XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm1nP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIjJcXFwiLCB0MSwgXFxcImNvcHlyaWdodElkXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBmID0gXy5jb2RlUmF0ZTtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5LiL6L29XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHQgPSBfLm5ld1JhdGVGb3JtYXRzO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuUFEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0gKyBTaXplKHRbMF0uc2l6ZSB8fCB0WzBdLmFuZHJvaWRTaXplIHx8IHRbMF0uaW9zU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuSFEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKHRbMV0uc2l6ZSB8fCB0WzFdLmFuZHJvaWRTaXplIHx8IHRbMV0uaW9zU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuU1EpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10gKyBTaXplKHRbMl0uc2l6ZSB8fCB0WzJdLmFuZHJvaWRTaXplIHx8IHRbMl0uaW9zU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuWlEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbNF0gKyBTaXplKHRbM10uc2l6ZSB8fCB0WzNdLmFuZHJvaWRTaXplIHx8IHRbM10uaW9zU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIHQxLCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBhcnIuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwibWdcXFwiLCB0MSwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgdDEsIF8pO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB2YXIgdXJsLCBpaSwgbHJjID0gXy5scmNVcmw7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYuWlEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcIm1nXFxcIiwgdDEsIDMsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCcxOiAnICsgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5TUSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwibWdcXFwiLCB0MSwgMiwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJzI6ICcgKyBpaSArICc6JyArIHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5IUSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwibWdcXFwiLCB0MSwgMSwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnZpcFR5cGUgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJtZ1xcXCIsIHQxLCAwLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfXyA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vbS5tdXNpYy5taWd1LmNuL21pZ3UvcmVtb3RpbmcvY21zX2RldGFpbF90YWc/Y3BpZD1cXFwiICsgdDEsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vbS5tdXNpYy5taWd1LmNuL3YzL1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IF9fLmx5cmljTHJjIHx8IGxyYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gX18ubGlzUXEgfHwgX18ubGlzdGVuVXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybCkgcmV0dXJuIFxcXCJ0b2FzdDovL+aXoOazleino+aekFxcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICBpZiAoIWxyYykge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL211c2ljLm1pZ3UuY24vdjMvYXBpL211c2ljL2F1ZGlvUGxheWVyL2dldEx5cmljP2NvcHlyaWdodElkPVxcXCIgKyB0MSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaGVhZGVyc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vYXBwLmMubmYubWlndS5jbi9cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkubHlyaWM7XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOmmlumhtVxcbiAgICAgICAgICAgICAgICBfID0gYWpheCh1cmkpO1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gXy5pdGVtcyB8fCBfWzBdLml0ZW1zO1xcbiAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgfHwgXy50aXRsZSB8fCBfLnBsYXlMaXN0TmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcgfHwgXy5pbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkIHx8IF8ucGxheUxpc3RJZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxlbiA9IGFqYXgoYHBsYXlsaXN0L2luZm8/c29uZ0xpc3RJZD0ke3QxfWApLmNvbnRlbnRDb3VudDtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KGBwbGF5bGlzdC9zb25nc0luZm8/cGFseWxpc3RJZD0ke3QxfWAsIGxlbik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBfID0ge1xcbiAgICAgICAgICAgICAgICAgICAgaXRlbXM6IFtdXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgoYGJpbGxib2FyZC9ob21lP3BhdGhOYW1lPSR7dDF9YCkuc29uZ3M7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHQyKSByZXR1cm4gXy5pdGVtcztcXG4gICAgICAgIGQgPSBbXTtcXG4gICAgICAgIF8uaXRlbXMubWFwKF8gPT4ge1xcbiAgICAgICAgICAgIGlmIChfLmZ1bGxTb25nKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAoXy5zaW5nZXJzID8gJyAtICcgKyBfLnNpbmdlcnMubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJykgOiAnJyksXFxuICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOicgKyBfLm1lZGl1bVBpYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogXy5mdWxsU29uZy52aXBGbGFnLFxcbiAgICAgICAgICAgICAgICB6eWlkOiBfLmNvcHlyaWdodElkXFxuICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgaXNVKSB7XFxuICAgICAgICBsZXQgXztcXG4gICAgICAgIGlmIChpc1UgIT0gXFxcInVybFxcXCIpIHtcXG4gICAgICAgICAgICBsZXQgbGlzdCwgX18gPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogKF8pID0+IHRydWUsXFxuICAgICAgICAgICAgICAgIHBhaWQ6IChfKSA9PiBfLmZ1bGxTb25nLnZpcEZsYWcgPT0gJzEnLFxcbiAgICAgICAgICAgICAgICBmcmVlOiAoXykgPT4gXy5mdWxsU29uZy52aXBGbGFnID09ICcwJ1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgbGV0IHN1cmwgPSAoc3R5cGUsIGVycmkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhamF4KFxcXCJzZWFyY2gvXFxcIiArIHN0eXBlICsgXFxcIj90ZXh0PVxcXCIgKyBrZXl3b3JkKTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyaSA8IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3VybChzdHlwZSwgZXJyaSArIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW107XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsKCdzb25nJywgMCk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5pdGVtcztcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5mdWxsU29uZyAmJiBfX1tpc1VdKF8pKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAoXy5zaW5nZXJzID8gJyAtICcgKyBfLnNpbmdlcnMubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJykgOiAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOicgKyBfLm1lZGl1bVBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy5mdWxsU29uZy52aXBGbGFnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmNvcHlyaWdodElkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwoJ3NvbmdMaXN0JywgMCk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5pdGVtcztcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXy50b3RhbCB8fCAoKE1ZX1BBR0UgLSAxKSAqIDMwICsgbGlzdC5sZW5ndGgpO1xcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJtZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIyXFxcIiwga2V5d29yZCk7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ05hbWUgKyAnIC0gJyArIF8uc2luZ2VyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5hbGJ1bUltZ3NbMF0uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8udmlwVHlwZSA/IDEgOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uY29weXJpZ2h0SWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KGBwbGF5bGlzdC9pbmZvP3NvbmdMaXN0SWQ9JHtrZXl3b3JkfWApO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnBsYXlMaXN0TmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnBsYXlMaXN0SWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiA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AgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLmxxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzFdICsgU2l6ZShfLmxxc2l6ZSkpLCBhcnIyLnB1c2goXy5scXVybCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXy5ocXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUoXy5ocXNpemUpKSwgYXJyMi5wdXNoKF8uaHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8uc3F1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10gKyBTaXplKF8uc3FzaXplKSksIGFycjIucHVzaChfLnNxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCBhcnIyKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIGFycjJbaV07XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIGFycjIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICB2YXIgdHlwZTIgPSB7XFxuICAgICAgICAgICAgICAgICAgICB5YzogMSxcXG4gICAgICAgICAgICAgICAgICAgIGZjOiAyLFxcbiAgICAgICAgICAgICAgICAgICAgYno6IDNcXG4gICAgICAgICAgICAgICAgfVt0eXBlXTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGBodHRwOi8vc2VydmljZS41c2luZy5rdWdvdS5jb20vc29uZy9kZXRhaWw/c29uZ0lkPSR7dDF9JnNvbmdUeXBlPSR7dHlwZTJ9YDtcXG4gICAgICAgICAgICAgICAgdmFyIGlpLCBscmMgPSBKU09OLnBhcnNlKGZldGNoUEModXJsKSkuZGF0YS5seXJpY3M7XFxuICAgICAgICAgICAgICAgIGlmICghbHJjKSBscmMgPSBnZXRNdXNpY0luZm8oXFxcIm5ld2dldFxcXCIpLmR5bmFtaWNXb3JkcztcXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5zcXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10pLCBhcnIyLnB1c2goXy5zcXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uaHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdKSwgYXJyMi5wdXNoKF8uaHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmxxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSksIGFycjIucHVzaChfLmxxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmhxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSksIGFycjIucHVzaChfLmhxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5scXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0pLCBhcnIyLnB1c2goXy5scXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uc3F1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdKSwgYXJyMi5wdXNoKF8uc3F1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5scXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0pLCBhcnIyLnB1c2goXy5scXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uaHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdKSwgYXJyMi5wdXNoKF8uaHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnNxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSksIGFycjIucHVzaChfLnNxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IGFycixcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IGFycjIubWFwKHUgPT4gdSArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IFN0cmluZyhscmMpLnJlcGxhY2UoLzxiclxcXFwvPz4vZ2ksIFxcXCJcXFxcblxcXCIpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy/pppbpobVcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaChcXFwiaHR0cDovLzVzaW5nLmt1Z291LmNvbS9nZC9nZExpc3Q/JnRhZ05hbWU9XFxcIiArIHQxICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJi5hbGJ1bVxcXCIpO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcIi5qeF9uYW1lJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaW1nID0gcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwxJiZzb25nbGlzdGlkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogenlpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIChNWV9QQUdFIC0gMSkgKiAxNiArIGxpc3QubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJzb25nL2dldHNvbmdsaXN0c29uZz9pZD1cXFwiICsgdDEpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgXyA9IFtdO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIGlmICh0MSA9PSBcXFwibGlzdDI1XFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHVyaSA9IFxcXCJzb25nbGlzdC9ob3RzdXBwb3J0cmFua2xpc3Q/cGFnZT1cXFwiO1xcbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0MSA9PSBcXFwieWNcXFwiIHx8IHQxID09IFxcXCJmY1xcXCIgfHwgdDEgPT0gXFxcImxpc3QyM1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICB1cmkgPSBcXFwicmFuay9kZXRhaWw/aWQ9XFxcIiArIHQxICsgXFxcIiZwYWdlaW5kZXg9XFxcIjtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgdXJpID0gXFxcInJhbmsvc3R5bGVyYW5rP3N0eWxlPVxcXCIgKyB0MSArIFxcXCImcGFnZWluZGV4PVxcXCI7XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHVyaSArIE1ZX1BBR0UgKyBcXFwiJnBhZ2VTaXplPTMwXFxcIik7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHQyKSByZXR1cm4gXy5zb25ncyB8fCBfO1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgKF8uc29uZ3MgfHwgXykubWFwKF8gPT4ge1xcbiAgICAgICAgICAgIGlmIChfLlNUID09IHVuZGVmaW5lZCB8fCBfLlNUID4gMCkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogKF8uc29uZ05hbWUgfHwgXy5TTikgKyAnIC0gJyArIChfLm5pY2tuYW1lIHx8IF8udXNlci5OTiksXFxuICAgICAgICAgICAgICAgIGltZzogXy5pbWFnZSB8fCAoXy51c2VyID8gXy51c2VyLkkgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8uc29uZ0tpbmQgfHwgXy5TSyxcXG4gICAgICAgICAgICAgICAgenlpZDogKF8uc29uZ0lkIHx8IF8uSUQpICsgJyMnICsgKF8uc29uZ0tpbmQgfHwgXy5TSylcXG4gICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBpc1UpIHtcXG4gICAgICAgIGxldCBfO1xcbiAgICAgICAgaWYgKGlzVSAhPSBcXFwidXJsXFxcIikge1xcbiAgICAgICAgICAgIGxldCBsaXN0LCBmaWx0ZXIgPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogMCxcXG4gICAgICAgICAgICAgICAgeWM6IDEsXFxuICAgICAgICAgICAgICAgIGZjOiAyLFxcbiAgICAgICAgICAgICAgICBiejogM1xcbiAgICAgICAgICAgIH1baXNVXTtcXG4gICAgICAgICAgICBsZXQgc3VybCA9IChzdHlwZSkgPT4gSlNPTi5wYXJzZShmZXRjaFBDKFxcXCJodHRwOi8vc2VhcmNoLjVzaW5nLmt1Z291LmNvbS9ob21lL2pzb24/a2V5d29yZD1cXFwiICsga2V5d29yZCArIFxcXCImc29ydD0xJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiJmZpbHRlcj1cXFwiICsgZmlsdGVyICsgXFxcIiZ0eXBlPVxcXCIgKyBzdHlwZSkpO1xcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybCgnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKF8sIEpTT04ucGFyc2UoZmV0Y2hQQyhgaHR0cDovL3NlcnZpY2UuNXNpbmcua3Vnb3UuY29tL3NvbmcvZGV0YWlsP3NvbmdJZD0ke18uc29uZ0lkfSZzb25nVHlwZT0ke18udHlwZX1gKSkuZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5uaWNrTmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnR5cGVFbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25nSWQgKyAnIycgKyBfLnR5cGVFbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsKCcxJyk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpY3R1cmVVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdMaXN0SWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXy5wYWdlSW5mby50b3RhbENvdW50O1xcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBbdDEsIHQyXSA9IGtleXdvcmQuc3BsaXQoJyMnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0MyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB5YzogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmYzogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICBiejogM1xcbiAgICAgICAgICAgICAgICAgICAgfVt0Ml07XFxuICAgICAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaFBDKGBodHRwOi8vc2VydmljZS41c2luZy5rdWdvdS5jb20vc29uZy9kZXRhaWw/c29uZ0lkPSR7dDF9JnNvbmdUeXBlPSR7dDN9YCkpLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ05hbWUgKyAnIC0gJyArIF8ubmlja05hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHQyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGtleXdvcmRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJzb25nL2dldHNvbmdsaXN0P2lkPVxcXCIgKyBrZXl3b3JkKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5ULFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5QIHx8IF8udXNlci5sLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5JRFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIDA7XFxuICAgICAgICB9XFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLinbxteVwiLFwicGF0aFwiOlwibXlcIixcInJ1bGVcIjpcImV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScpKS5ydWxlKTtcXG5jb25zdCB0aGlzX3BsYXRmb3JtID0gXFxcIm15XFxcIjtcXG5cXG5mdW5jdGlvbiBhamF4KHBhdGgsIGJvZHksIGhvc3QpIHtcXG4gICAgbGV0IHVybCA9IChob3N0IHx8IFxcXCJodHRwczovL2FwaVxcXCIpICsgXFxcIi5saXVtaW5neWUuY24vbS9hcGkvXFxcIiArIHBhdGg7XFxuICAgIGlmICghaG9zdCkge1xcbiAgICAgICAgYm9keS5fdCA9IERhdGUubm93KCkgKyAnJ1xcbiAgICAgICAgYm9keS50b2tlbiA9ICQucmVxdWlyZShcXFwibXk/cnVsZT3mrYzor43pgILphY1cXFwiKS5uZXdfdG9rZW4oYm9keSk7XFxuICAgICAgICBpZiAoYm9keS5xdWFsaXR5ICE9IHVuZGVmaW5lZClcXG4gICAgICAgICAgICByZXR1cm4gYnVpbGRVcmwodXJsLCBib2R5KTtcXG4gICAgICAgIGJvZHkgPSBKU09OLnN0cmluZ2lmeShib2R5KTtcXG4gICAgfVxcbiAgICBsZXQgXyA9IEpTT04ucGFyc2UocG9zdCh1cmwsIHtcXG4gICAgICAgIGJvZHk6IGJvZHksXFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUEsXFxuICAgICAgICAgICAgJ09yaWdpbic6ICdodHRwczovL3Rvb2wubGl1bWluZ3llLmNuJyxcXG4gICAgICAgIH1cXG4gICAgfSkpO1xcbiAgICBfLmRhdGEuY29kZSA9IF8uY29kZTtcXG4gICAgXy5kYXRhLm1zZyA9IF8ubXNnO1xcbiAgICByZXR1cm4gXy5kYXRhO1xcbn1cXG4kLmV4cG9ydHMgPSB7XFxuXFxuICAgIGlUYWc6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgLyog5LiN6IO96Kej5p6Qd3nmrYzljZXkuoZcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmlUYWcoMSk7XFxuICAgICAgICAgICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW1xcXCLlhajpg6hcXFwiXSA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KFxcXCJ0b3BsaXN0P1xcXCIpLmxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgICovXFxuICAgICAgICBsZXQgYXJyID0gXFxcIkFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaI1xcXCIuc3BsaXQoXFxcIlxcXCIpO1xcbiAgICAgICAgYXJyLnVuc2hpZnQoXFxcIuaOqOiNkFxcXCIpO1xcbiAgICAgICAgYXJyLm1hcCgodCwgaSkgPT4ge1xcbiAgICAgICAgICAgIGlUYWdbdF0gPSB7fTtcXG4gICAgICAgICAgICBpVGFnW3RdW1xcXCJNeUZyZWVNUDNcXFwiXSA9IFN0cmluZyhpKTtcXG4gICAgICAgIH0pXFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwibXlfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IFt0c1swXSArIDk2LCB0c1sxXSArIDEyOCwgdHNbMl0gKyAzMjAsIHRzWzNdICsgMjAwMF07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdDIgPSBpbnB1dC5zcGxpdCgn44CRJylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gYWpheChcXFwibGlua1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5OiB0MlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHQxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgaWksIGxyYyA9IGFqYXgoXFxcImx5cmljXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHQxXFxuICAgICAgICAgICAgICAgIH0pLmxyYztcXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gWzIwMDAsIDMyMCwgMTI4LCA5Nl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIgPSBbMzIwLCAxMjgsIDk2LCAyMDAwXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9IFsxMjgsIDMyMCwgMjAwMCwgOTZdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIgPSBbOTYsIDEyOCwgMzIwLCAyMDAwXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgbmFtZXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybHMgPSBhcnIubWFwKChxdWFsaXR5LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lc1tpXSA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICA5NjogdHNbMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgMTI4OiB0c1sxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAzMjA6IHRzWzJdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDIwMDA6IHRzWzNdXFxuICAgICAgICAgICAgICAgICAgICB9W3F1YWxpdHldO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFqYXgoXFxcImxpbmtcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHk6IHF1YWxpdHkgKyAnJ1xcbiAgICAgICAgICAgICAgICAgICAgfSkgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IHVybHMsXFxuICAgICAgICAgICAgICAgICAgICBuYW1lczogbmFtZXMsXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy/pppbpobVcXG4gICAgICAgICAgICAgICAgLypcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDEubWF0Y2goL1xcXFw/LykpIHQxID0gXFxcInRvcC9wbGF5bGlzdD9jYXQ9XFxcIiArIHQxICsgXFxcIiZcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KHQxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChfLnJlc3VsdCB8fCBfLnBsYXlsaXN0cykubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsIHx8IF8ucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICBfID0gYWpheChcXFwiYXJ0aXN0L2xpc3RcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBpbml0aWFsOiB0MSxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2U6IE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBfLmxpc3QgfHwgW107XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5waWMgfHwgJ2hpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9hdWRpbycsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLCAvLyAyXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIChNWV9QQUdFIC0gMSkgKiA5MCArIGxpc3QubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChcXFwic2VhcmNoL3BsYXlsaXN0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiZFxcXCIgKyB0MVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIF8gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdDogW11cXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSlcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJhcnRpc3RcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0OiBbXVxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZih0MilyZXR1cm4gXy5saXN0O1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5saXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgKF8uYXJ0aXN0ID8gJyAtICcgKyBfLmFydGlzdC5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBpbWc6IF8ucGljIHx8IChfLmFsYnVtICYmIF8uYWxidW0ucGljID8gXy5hbGJ1bS5waWMgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgY29udGVudDogJ3d5JyxcXG4gICAgICAgICAgICB6eWlkOiBfLmhhc2ggfHwgXy5pZFxcbiAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgaWYgKF8ubGlzdC5sZW5ndGggPT0gMCAmJiBfLm5hbWUpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBfLmRlc2NyaXB0aW9uLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBzdHlwZSwgaXNOZXcpIHtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgbGV0IHN0eXBlID0gc3R5cGUgfHwgJ3d5JztcXG4gICAgICAgICAgICAgICAgbGV0IHN0eXBlMiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICd3eSc6ICdZUUQnLFxcbiAgICAgICAgICAgICAgICAgICAgJ2t3JzogJ1lRQicsXFxuICAgICAgICAgICAgICAgICAgICAnbWcnOiBpc05ldyA/ICdZUU0nIDogJ21pZ3UnLFxcbiAgICAgICAgICAgICAgICAgICAgJzF0JzogJzF0aW5nJyxcXG4gICAgICAgICAgICAgICAgICAgICdkYic6ICdkb3ViYW4nLFxcbiAgICAgICAgICAgICAgICAgICAgJzV5JzogJ3d1c2luZ3ljJyxcXG4gICAgICAgICAgICAgICAgICAgICc1Zic6ICd3dXNpbmdmYydcXG4gICAgICAgICAgICAgICAgfVtzdHlwZV07XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCwgYm9keSwgXywgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzTmV3KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoJ3NlYXJjaCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogc3R5cGUyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBNWV9QQUdFLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2OiAnYmV0YSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0IHx8IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgKF8uYXJ0aXN0ID8gJyAtICcgKyBfLmFydGlzdC5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyB8fCBfLmFsYnVtLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaGFzaCB8fCBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9IFxcXCJ0ZXh0PVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZ0eXBlPVxcXCIgKyBzdHlwZTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9ICQucmVxdWlyZShcXFwibXk/cnVsZT3mrYzor43pgILphY1cXFwiKS5vbGRfZW5jb2RlKGJvZHkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KCdzZWFyY2gnLCBib2R5LCBcXFwiaHR0cDovL2FwaTJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0IHx8IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMYXp5KCdteScsIF8uaWQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsX200YSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaChfLnVybF9tNGEgKyAnI2lzTXVzaWM9dHJ1ZSMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2godHNbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy51cmxfMTI4KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKF8udXJsXzEyOCArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0c1sxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnVybF8zMjApXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfMzIwICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRzWzJdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsX2ZsYWMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfZmxhYyArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0c1szXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVyIHx8IF8ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiB1cmxzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IG5hbWVzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHlyaWM6IF8ubHJjXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoID09IDAgJiYgXy5jb2RlID09IDQwMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm1zZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXy5jb2RlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi572R57uc5byC5bi477yM5pCc57Si5aSx6LSlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBlLnRvU3RyaW5nKCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2VhcmNoKDEsIGtleXdvcmQsIDEpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcblxcblxcbiAgICBuZXdfdG9rZW46IGZ1bmN0aW9uKGJvZHkpIHtcXG4gICAgICAgIFt0LCBlLCBBc10gPSBbXFxuICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICBcXFwiMjAyMzAzMjcuXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInlHejRuOVhFOXhZeTJPajVVYjdFNnU5YTVwNWFJV1pZZTUzT3JxNXdFNVVnbmpiV3EwNDEwV1R2bUxCTzFaMk5cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwicFc4amcvbWtlNmNPMUY0Q1R1YWlzd2haZlFHek15cTVOSlJMUFZJdkR4bEE3PUUzWXJTVW9IMGIyQlhLbjl0ZCtcXFwiXFxuICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgIFxcXCIyMDIyMTIyMi5cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiSDJodXV3WGY4d045Q3g1SzNsRVFrZGc0VlRDSnFJYjQ0MFFRWDk1T1F5ZTFEMDkyMjkyQkk2cmdqRmdLOW1jeFxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJRc1ZtdDRycHFQRkp5V2NnMVkvU1JBdUxNVGVkQjM3NVhaTkRsT0d4ajZiMnZhbjk9QzhVaEhLRSt3aWZJa296MFxcXCJcXG4gICAgICAgICAgICBdXFxuICAgICAgICBdWzBdO1xcbiAgICAgICAgdmFyIGEsIGIsIGMsIGQsXFxuICAgICAgICAgICAgdiA9IDAsXFxuICAgICAgICAgICAgdGsgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciBlID0gZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KGJvZHkpKS5zcGxpdChcXFwiXFxcIilcXG4gICAgICAgICAgICAubWFwKCh0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0LmNoYXJDb2RlQXQoMCkgXiBlLmNoYXJDb2RlQXQoTWF0aC5mbG9vcihpICUgNjQpKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB2YXIgaSA9IGUubGVuZ3RoICUgM1xcbiAgICAgICAgZG8ge1xcbiAgICAgICAgICAgIGEgPSBlW3YrK11cXG4gICAgICAgICAgICBiID0gZVt2KytdXFxuICAgICAgICAgICAgYyA9IGVbdisrXVxcbiAgICAgICAgICAgIGQgPSBhIDw8IDE2IHwgYiA8PCA4IHwgY1xcbiAgICAgICAgICAgIGEgPSBkID4+IDE4ICYgNjNcXG4gICAgICAgICAgICBiID0gZCA+PiAxMiAmIDYzXFxuICAgICAgICAgICAgYyA9IGQgPj4gNiAmIDYzXFxuICAgICAgICAgICAgZCA9IGQgJiA2M1xcbiAgICAgICAgICAgIHRrICs9IEFzLmNoYXJBdChhKSArIEFzLmNoYXJBdChiKSArIEFzLmNoYXJBdChjKSArIEFzLmNoYXJBdChkKVxcbiAgICAgICAgfSB3aGlsZSAodiA8IGUubGVuZ3RoKVxcbiAgICAgICAgcmV0dXJuIHQgKyBtZDUoaSA9PSAwID8gdGsgOiB0ay5zbGljZSgwLCBpIC0gMykgKyAnPT09Jy5zbGljZShpIHx8IDMpKVxcbiAgICB9LFxcblxcblxcblxcbiAgICBvbGRfZW5jb2RlOiBmdW5jdGlvbihlKSB7XFxuICAgICAgICB2YXIgcCA9IG1kNShcXFwiPEc2c1gsTGt+XjI6WSU0WlxcXCIpO1xcbiAgICAgICAgdmFyIGEgPSBtZDUocC5zdWJzdHIoMTYsIDMyKSk7XFxuICAgICAgICB2YXIgdCA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpIC8gMTAwMCArIDg2NDAwID4+IDA7XFxuICAgICAgICB2YXIgdCA9IHQgKyBtZDUoZSArIGEpLnN1YnN0cigwLCAxNikgKyBlO1xcbiAgICAgICAgdmFyIEUgPSBlID0gXFxcIlxcXCI7XFxuICAgICAgICB2YXIgUjQgPSBSKDQpO1xcbiAgICAgICAgZm9yIChsZXQgaSBpbiB0KSB7XFxuICAgICAgICAgICAgaSA9IHQuY2hhckNvZGVBdChpKVxcbiAgICAgICAgICAgIGlmIChpIDwgMTI4KSB7XFxuICAgICAgICAgICAgICAgIGUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShpKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShpID4+IDEyIHwgMjI0KVxcbiAgICAgICAgICAgICAgICBlICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoaSA+PiA2ICYgNjMgfCAxMjgpXFxuICAgICAgICAgICAgICAgIGUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShpICYgNjMgfCAxMjgpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIGEgPSBtZDUocC5zdWJzdHIoMCwgMTYpKTtcXG4gICAgICAgIHZhciBhID0gYSArIG1kNShhICsgUjQpO1xcbiAgICAgICAgdmFyIHAgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMjU2OyBpKyspIHBbaV0gPSBpO1xcbiAgICAgICAgdmFyIEkgPSBiID0gYyA9IHQgPSAwO1xcbiAgICAgICAgZm9yIChsZXQgaSBpbiBwKSB7XFxuICAgICAgICAgICAgSSA9IChJICsgcFtpXSArIGFbaSAlIDY0XS5jaGFyQ29kZUF0KCkpICUgMjU2XFxuICAgICAgICAgICAgWCA9IHBbaV1cXG4gICAgICAgICAgICBwW2ldID0gcFtJXVxcbiAgICAgICAgICAgIHBbSV0gPSBYXFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBpIGluIGUpIHtcXG4gICAgICAgICAgICBJID0gTnVtYmVyKGkpICsgMTtcXG4gICAgICAgICAgICBYID0gcFtJXTtcXG4gICAgICAgICAgICBiID0gKGIgKyBYKSAlIDI1NjtcXG4gICAgICAgICAgICBwW0ldID0gcFtiXTtcXG4gICAgICAgICAgICBwW2JdID0gWDtcXG4gICAgICAgICAgICBFICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoXFxuICAgICAgICAgICAgICAgIGVbaV0uY2hhckNvZGVBdCgpIF5cXG4gICAgICAgICAgICAgICAgcFsocFtJXSArIHBbYl0pICUgMjU2XVxcbiAgICAgICAgICAgICk7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgWiA9IFxcXCJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OS1fXFxcIjtcXG4gICAgICAgIGZvciAoXFxuICAgICAgICAgICAgdmFyIE8gPSBcXFwiXFxcIjsgRS5jaGFyQXQodCB8IDApIHx8IChaID0gJz0nLCB0ICUgMSk7IE8gKz0gWi5jaGFyQXQoNjMgJiBjID4+IDggLSB0ICUgMSAqIDgpXFxuICAgICAgICApIGMgPSBjIDw8IDggfCBFLmNoYXJDb2RlQXQodCArPSAwLjc1KTtcXG4gICAgICAgIHJldHVybiBcXFwiZGF0YT1cXFwiICsgUjQgKyBPICsgXFxcIiZ2PTJcXFwiO1xcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p29cXRcIixcInBhdGhcIjpcInF0XCIsXCJydWxlXCI6XCJldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nKSkucnVsZSk7XFxuY29uc3QgdGhpc19w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AgICAgICAgICBib2R5OiBcXFwiYWN0PXNlYXJjaCZrZXk9XFxcIiArIGtleXdvcmQgKyBcXFwiJmxhbmc9JnBhZ2U9XFxcIiArIE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgXyBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZCA9IF8uaWQgKyAnI3p6JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsYXp5KCd6eicsIHp5aWQsIDAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm1uYW1lICsgJyAtICcgKyBfLnNuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljLnJlcGxhY2UoL1xcXFw/LiovLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICd6eicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnYmQnOlxcbiAgICAgICAgICAgICAgICAgICAgcWlhbnFpYW4oXFxcInNlYXJjaFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3b3JkOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VObzogTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgfSkudHlwZVRyYWNrLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIV8uaXNWaXApIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0Lm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnYmQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkICsgJyNiZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdreic6IC8vIOS6uuacuumqjOivgVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly9oYXlxYmhnci5zbGlkZXIua3ovXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaCh1ICsgXFxcInZrX2F1dGgucGhwP3E9XFxcIiArIGtleXdvcmQpKVtcXFwiYXVkaW9zXFxcIl1bXFxcIlxcXCJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IF8gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAoXy51cmwubWF0Y2goL2h0dHBzPzovKSA/IFxcXCJcXFwiIDogdSkgKyBfLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRfYXJ0LnNwbGl0KCcgLSAnKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgna3onKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdreicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICduaSc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSBodG0gPSBcXFwiLTEuaHRtXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaHRtID0gXFxcIi0xLVxcXCIgKyBNWV9QQUdFICsgXFxcIi5odG1cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAga2V5d29yZCA9IGVuY29kZVVSSUNvbXBvbmVudChrZXl3b3JkKS5yZXBsYWNlKC8tL2csICdfMmQnKS5yZXBsYWNlKC8lL2csICdfJyk7XFxuICAgICAgICAgICAgICAgICAgICBodG1sID0gZmV0Y2hDb2RlQnlXZWJWaWV3KFxcXCJodHRwczovL3d3dy5oaWZpbmkuY29tL3NlYXJjaC1cXFwiICsga2V5d29yZCArIGh0bSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdibG9ja1J1bGVzJzogWycuanMnLCAnLmNzcycsICcucG5nJywgJy5pY28nXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiA1MDAwXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZsaS5tZWRpYVtkYXRhLXRpZF1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwZGZoKGl0ZW0sIFxcXCJhLDImJlRleHRcXFwiKSAhPSBcXFwi54m55L6bXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwxJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNuaSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsYXp5KCduaScsIHp5aWQsIDAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gcGRmaChpdGVtLCBcXFwiYSwxJiZUZXh0XFxcIikuc3BsaXQoXFxcIuOAi1xcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnNwbGl0KFxcXCLjgIpcXFwiKS5yZXZlcnNlKCkuam9pbignIC0gJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOi8vd3d3LmhpZmluaS5jb20vXFxcIiArIHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnbmknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2czJzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL3d3dy5nZ2dtdXNpYy5jb20vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGtleXdvcmQgPSBlbmNvZGVVUklDb21wb25lbnQoa2V5d29yZCkucmVwbGFjZSgvLS9nLCAnXzJkJykucmVwbGFjZSgvJS9nLCAnXycpO1xcbiAgICAgICAgICAgICAgICAgICAgaHRtbCA9IGZldGNoQ29kZUJ5V2ViVmlldyh1ICsgXFxcInNlYXJjaC1cXFwiICsga2V5d29yZCArIFxcXCItMS5odG1cXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jsb2NrUnVsZXMnOiBbJy5qcycsICcuY3NzJywgJy5wbmcnLCAnLmljbyddLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDUwMDBcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJmxpLmNhcmRbZGF0YS10aWRdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNnMyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGF6eSgnZzMnLCB6eWlkLCAwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZS5zcGxpdChcXFwiIC0gXFxcIikucmV2ZXJzZSgpLmpvaW4oJyAtICcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZzMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2J6JzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChcXFwiaHR0cHM6Ly9kZWJlbnppLmNvbS8/cz1cXFwiICsga2V5d29yZCksIFxcXCJib2R5JiZoMi5lbnRyeS10aXRsZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNieic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsYXp5KCdieicsIHp5aWQsIDAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vcGljLnJtYi5iZHN0YXRpYy5jb20vYmpoLzM5Yjk2NGIyYjA4N2EwNWMzOWE1NmEyZTM4YzA0MDE5MzM4LmpwZWcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2J6JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdzdCc6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChgaHR0cDovL3d3dy5zb25ndGFzdGUuY28vZGFuY2Uvc2VhcmNoP2tleT0ke2tleXdvcmR9JnBhZ2U9JHtNWV9QQUdFfWApLCBcXFwiYm9keSYmLm1saXN0JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZCA9IHBkZmgoaXRlbSwgXFxcIi50ZDMmJmEmJmhyZWZcXFwiKS5yZXBsYWNlKC8uKlxcXFwvLywgJycpICsgJyNzdCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGF6eSgnc3QnLCB6eWlkLCAwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLnRkMyYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIikucmVwbGFjZSgncGljZGF0YScsICdhdHRhY2htZW50JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdzdCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnYmxtJzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBKU09OLnBhcnNlKGZldGNoKGBodHRwczovL2JsYWNrYmxtLmJhaWxlbWkuY29tL2luZGV4LnBocC9kYW5jZS9zZWFyY2g/a2V5PSR7a2V5d29yZH0mcGFnZT0ke01ZX1BBR0V9YCkpLmRhbmNlbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IF8gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IF8uZG93bnVybCB8fCBfLnBsYXl1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwgJiYgXy5uYW1lKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIChfLnNpbmdlciB8fCBfLnVwX3VzZXIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXIgfHwgXy51cF91c2VyX2xvZ28sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdibG0nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdpZCArICcjYmxtJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdmcCc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHBzOi8vd3d3LmZhbmdwaS5uZXQvcy9cXFwiICsga2V5d29yZCksIFxcXCJib2R5JiZbY2xhc3M9cm93XVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJkaXYsMSYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCJkaXYsMiYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2ZwJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZnAnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNmcCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdodCc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHA6Ly9tLmh0cXl5LmNvbS9zZWFyY2gvcmVzdWx0P2lkPVxcXCIgKyBrZXl3b3JkKSwgXFxcImJvZHkmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCJlbSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIikgKyAnMEBoZWFkZXJzPXtcXFwicmVmZXJlclxcXCI6XFxcImh0dHA6Ly9tLmh0cXl5LmNvbVxcXCJ9JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdodCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCIucGxheSYmZGF0YS1pZFxcXCIpICsgJyNodCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICcxdCc6XFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKGBodHRwczovL3NvLjF0aW5nLmNvbS9zb25nL2pzb24/cT0ke2tleXdvcmR9JnBhZ2U9JHtNWV9QQUdFfSZzaXplPTMwYCkpLnJlc3VsdHMubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdfbmFtZSArICcgLSAnICsgXy5zaW5nZXJfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczonICsgXy5hbGJ1bV9jb3ZlcixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnMXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ19pZCArICcjMXQnXFxuICAgICAgICAgICAgICAgICAgICB9LCByMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJzl0JzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKGBodHRwOi8vbmV3Ljlza3kuY29tL2FwaS93ZWliby9jb250ZW50L3NlYXJjaD9jb250ZW50PSR7a2V5d29yZH1gKSkuZGF0YS5zb25nX2xpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL15OJC9pLnRlc3QoXy5pc19zdGF0aW9uKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbmV3Ljlza3kuY29tL2FwaS9zb25nL2RldGFpbD9pZD1cXFwiICsgXy5zb25nX2lkICsgXFxcIiZpc19sb2dpbj1OXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKHUpKS5kYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdfbmFtZSArICcgLSAnICsgXy5tdXNpY2lhbl9uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5kaXNjX2ltZ191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJzl0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdfaWQgKyAnIzl0J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXy5zb25nX3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY191cmwgfHwgTHJjKF8uZGVzaWduX25vdGVzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdreSc6XFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHBvc3QoJ2h0dHA6Ly9hcGkua3VhaXlpbjEyMy5uZXQvcS9zZWFyY2gnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcInE9XFxcIiArIGtleXdvcmQgKyBcXFwiJmNsaWVudF92PTIuNy4xJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnBsYXRmb3JtPUFuZHJvaWRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNsaWVudC12XFxcIjogXFxcIjIuNy4xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImRldmljZS1pZFxcXCI6IFIoMTYpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGxhdGZvcm1cXFwiOiBcXFwiQW5kcm9pZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIm9raHR0cC8zLjE0LjRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29ubmVjdGlvblxcXCI6IFxcXCJLZWVwLUFsaXZlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvbnRlbnQtVHlwZVxcXCI6IFxcXCJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEubXVzaWNfbGlzdC5yb3dzLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRsZSArICcgLSAnICsgXy51c2VyX2luZm8ubmlja25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdreScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy56eWlkXFxuICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtfLnBsYXlfdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgbHlyaWM6IF8ubHJjX3VybFxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJzVuZCc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHA6Ly9tLjVuZC5jb20vc28vc19cXFwiICsga2V5d29yZCksIFxcXCJib2R5JiYubGlzdC1zb25nJiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIuc29uZyYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCIuYXJ0aXN0JiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnNW5kJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcImEmJmhyZWZcXFwiKS5yZXBsYWNlKC8uKlxcXFwvfFxcXFwuLiovZywgJycpICsgJyM1bmQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnYml1JzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwczovL2JpdS5tb2UvaW5kZXgucGhwP209JmM9U29uZyZhPXNlYXJjaCZkYXRhPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwPVxcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJnRib2R5JiZ0clxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBiaXVfc2lkID0gcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQrLywgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmSHRtbFxcXCIpLnJlcGxhY2UoL1xcXFxzKjxzcGFuW1xcXFxzXFxcXFNdKy9pLCBcXFwiXFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcImEsMSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL2JpdS5tb2UvU29uZy9zaG93Q292ZXIvc2lkL1xcXCIgKyBiaXVfc2lkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnYml1JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogYml1X3NpZCArICcjYml1J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdtdXMnOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHBzOi8vc2t5bXVzLm9yZy90cmFja3MvXFxcIiArIGtleXdvcmQgKyBcXFwiL1xcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJi5mLXRhYmxlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi5hcnRpc3QtbmFtZSYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCIudHJhY2stbmFtZSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIikucmVwbGFjZSgvXiguKykvLCAnaHR0cHM6JDEnKSB8fCAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ211cycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnbXVzJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogJ3VuZGVmaW5lZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW1xcXCJodHRwczpcXFwiICsgcGRmaChpdGVtLCBcXFwiLm1wMyYmaHJlZlxcXCIpICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdqYW0nOlxcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9zb2xyY2xvdWQuamFtZW5kby5jb20vc29sci9qYW1jb20/d3Q9anNvbiZyb3dzPTMwJnE9XFxcIiArIGtleXdvcmQgKyBcXFwiJnN0YXJ0PVxcXCIgKyAoKE1ZX1BBR0UgLSAxKSAqIDMwKSkpLnJlc3BvbnNlLmRvY3MubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwczovL3Byb2QtMS5zdG9yYWdlLmphbWVuZG8uY29tL2Rvd25sb2FkL3RyYWNrL1xcXCIgKyBfLmlkICsgXFxcIi9tcDM1XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUucmVwbGFjZShfLmFydGlzdF9uYW1lICsgJyAtICcsICcnKSArICcgLSAnICsgXy5hcnRpc3RfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly91c2VyY29udGVudC5qYW1lbmRvLmNvbS8/dHlwZT1hbGJ1bSZpZD1cXFwiICsgXy5hbGJ1bV9pZC5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyBcXFwiJndpZHRoPTUwMCZ0cmFja2lkPVxcXCIgKyBfLmlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnamFtJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogJ3VuZGVmaW5lZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdqdWknOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGV2YWwocG9zdCgnaHR0cHM6Ly9uZXcubXlmcmVlbXAzanVpY2VzLmNjL2FwaS9hcGlfc2VhcmNoLnBocD9jYWxsYmFjaz1xaWFucWlhbicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFwicT1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHUgPSBcXFwiaHR0cHM6Ly9ucGxheS5pZG1wM3MuY29tL3N0cmVhbS9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIG8gPSBcXFwiQUJDREVGR0hKS01OUFFSU1RVVldYWVphYmNkZWZnaGprbW5wcXJzdHV2eHl6MTIzXFxcIjtcXG5cXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGp1aV9kKHQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZSA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09IHQpIHJldHVybiBvWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCA8IDAgJiYgKHQgKj0gLTEsIGUgKz0gXFxcIi1cXFwiKTsgMCA8IHQ7KSB2YWwgPSBwYXJzZUludCh0ICUgNDgpLCB0ID0gcGFyc2VJbnQodCAvIDQ4KSwgZSArPSBvW3ZhbF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGxpc3RbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJldHR5SWQgPSBqdWlfZChfLm93bmVyX2lkKSArIFxcXCI6XFxcIiArIGp1aV9kKF8uaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnanVpJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdqdWknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnByZXR0eUlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1ICsgcHJldHR5SWQgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ3kzJzpcXG4gICAgICAgICAgICAgICAgICAgICRzb25nX2RhdGEgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIHNvbmdfbGlzdCA9IChpLCBpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSAkc29uZ19kYXRhW2ldLnNwbGl0KFxcXCJ8fFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBpdGVtLnNwbGl0KFxcXCJ8XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfWzRdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cDovL3Rpbmc2Lnl5bXAzLm5ldDo4Mi9cXFwiICsgU3RyaW5nKF9bNF0pLnJlcGxhY2UoJy53bWEnLCAnLm1wMycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfWzFdICsgJyAtICcgKyBfWzNdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCd5MycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICd5MycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wcmV0dHlJZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaFBDKFxcXCJodHRwOi8vd3d3Lnl5bXAzLmNvbS9wL2dldHNlci5hc3B4P2tleT1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJzM2NSc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gJDM2NV9TZWFyY2hSZXN1bHQodCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGRmYShcXFwiPGJvZHk+XFxcIiArIHQgKyBcXFwiPC9ib2R5PlxcXCIsIFxcXCJib2R5JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gZXZhbChcXFwiJDM2NV9cXFwiICsgZmV0Y2goXFxcImh0dHA6Ly9oaXQueXVlMzY1LmNvbS9zZWFyY2guYXNwP3JuZD1cXFwiICsgTWF0aC5yYW5kb20oKSArIFxcXCIma2V5d29yZHM9XFxcIiArIGVzY2FwZShrZXl3b3JkKSArIFxcXCImdD0xXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE11c2ljSWQgPSBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC8uKlxcXFwvfFxcXFwuLiovZywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cDovLzk2LmllcmdlLmNuL1xcXCIgKyBwYXJzZUludChNdXNpY0lkIC8gMzAwMDApICsgXFxcIi9cXFwiICsgcGFyc2VJbnQoTXVzaWNJZCAvIDIwMDApICsgXFxcIi9cXFwiICsgTXVzaWNJZCArIFxcXCIubXAzXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi5uYW1lJiZUZXh0XFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcIi5zaW5nZXImJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCczNjUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICczNjUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogJ3VuZGVmaW5lZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajEnOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vd3d3Lnp6emRqLmNvbVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKHUgKyBcXFwiL211c2ljL3NlYXJjaC1cXFwiICsga2V5d29yZCArIFxcXCI/Y2F0X2lkPTAmcGFnZT1cXFwiICsgTVlfUEFHRSksIFxcXCJib2R5JiZ0Ym9keSYmdHJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5tYXRjaCgvYWx0PVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiB1ICsgaXRlbS5tYXRjaCgvc3JjPVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqMScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL2RhdGEtaWQ9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajEnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqMic6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKFxcXCJodHRwczovL3d3dy5kanV1LmNvbS9zZWFyY2g/bXVzaWNuYW1lPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZsaXN0PTImY2lkPTAmcGFnZT1cXFwiICsgTVlfUEFHRSksIFxcXCJib2R5JiYubGlzdF9tdXNpY2xpc3QmJnRyW2NsYXNzXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm1hdGNoKC90aXRsZT1cXFwiKC4rPylcXFwiLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOlxcXCIgKyBpdGVtLm1hdGNoKC9zcmM9XFxcIiguKz8pXFxcIi8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGoyJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvdmFsdWU9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajInXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqMyc6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly93d3cubGFsYWRqLmNvbVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKHUgKyBcXFwiL3NlYXJjaD9zZWFyY2g9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UpLCBcXFwiYm9keSYmLmxpc3RfbXVzaWNsaXN0JiZ0cltjbGFzc11cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLnQxJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogdSArIGl0ZW0ubWF0Y2goL3NyYz1cXFwiKC4rPylcXFwiLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC92YWx1ZT1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqMydcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo0JzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoUEMoXFxcImh0dHBzOi8vbS5haGFkai5jb20vc2VhcmNoLz9rZXk9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiLmh0bWxcXFwiKSwgXFxcImJvZHkmJi55aW55dWVfbGlzdCYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJoMyYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwczovL3N0Ljkya3UuY29tL3p3Y3MvXFxcIiArIHRpdGxlICsgXFxcIi5tcDRcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyAnI2RqNCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzBdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo1JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGoubmV0Lyc7XFxuICAgICAgICAgICAgICAgICAgICBfID0gcG9zdCh1ICsgJ3NlYXJjaC5waHA/bW9kPW11c2ljJmZvcm1oYXNoPThjOTY0ZThhJnNyY2h0eHQ9JyArIGVuY29kZVN0cihrZXl3b3JkLCAnR0JLJykgKyAnJnNlYXJjaHN1Ym1pdD15ZXMnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ3RleHQvaHRtbDsgY2hhcnNldD1nYmsnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IHUgKyBKU09OLnBhcnNlKF8pLmhlYWRlcnMubG9jYXRpb25bMF0gKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0U7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaCh1cmwpLCBcXFwiYm9keSYmLm11c2ljLWxpc3QmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLnJlcGxhY2UoXFxcIiZzaXplPXNtYWxsXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo1JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSwxJiZocmVmXFxcIikubWF0Y2goL2lkPShcXFxcZCspLylbMV0gKyAnI2RqNSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo2JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cDovL3d3dy4zNmRqLmNvbS9lL3NlYXJjaC8nO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IHBvc3QodSArICdpbmRleC5waHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc2lkOiAnMSwyLDMsNCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleWJvYXJkOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJtaXQ6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93OiAndGl0bGUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1waWQ6ICcxJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHUgKz0gSlNPTi5wYXJzZShfKS5oZWFkZXJzLmxvY2F0aW9uWzBdICsgXFxcIiZwYWdlPVxcXCIgKyAoTVlfUEFHRSAtIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2godSksIFxcXCJib2R5JiYjcGxheWxpc3QmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnZGo2JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajYnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC92YWx1ZT1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqNidcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo3JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuN2lkai5jb20vZS9zZWFyY2gvJ1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IHBvc3QodSArICdpbmRleC5waHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlib2FyZDoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdzogJ3RpdGxlJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHUgKz0gSlNPTi5wYXJzZShfKS5oZWFkZXJzLmxvY2F0aW9uWzBdICsgXFxcIiZwYWdlPVxcXCIgKyAoTVlfUEFHRSAtIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2godSksIFxcXCJib2R5JiZsaVtkYXRhLWlkXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2RqNycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo3JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvZGF0YS1pZD1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqNydcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo4JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGp1OC5jb20vJztcXG4gICAgICAgICAgICAgICAgICAgIGl0ZW0gPSBmZXRjaFBDKHUgKyAna2V5L21sXycgKyBlbmNvZGVTdHIoa2V5d29yZCwgJ0dCSycpICsgJ18nICsgTVlfUEFHRSArICcuaHRtbCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAndGV4dC9odG1sOyBjaGFyc2V0PWdiMjMxMicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyZWZlcmVyJzogdVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoaXRlbSwgXFxcImJvZHkmJiNkam91ciYmbGlbb25tb3VzZW92ZXJdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnZGo4JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajgnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC92YWx1ZT1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqOCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo5JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGp5eXkuY29tL3NlYXJjaC5waHA/YWM9ZGoma2V5PScgKyBrZXl3b3JkICsgJyZwYWdlcz0nICsgTVlfUEFHRTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoUEModSksIFxcXCJib2R5JiZsaVtkYXRhLWlkXSBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdkajknKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqOScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL2RhdGEtaWQ9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5o6l5Y+j6ZSZ6K+vflxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuayoeacieWPr+S7peaQnOe0ouatjOWNleeahOaOpeWPo35cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiBsYXp5KHBsYXRmb3JtLCB0MSwgdDIsIHQzKSB7XFxuICAgIFt0MSwgcGxhdGZvcm0sIHR5cGVdID0gdDEuc3BsaXQoJyMnKTtcXG4gICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICBjYXNlICd6eic6XFxuICAgICAgICAgICAgdSA9ICdodHRwczovL3p6MTIzLmNvbSc7XFxuICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1ICsgJy9hamF4LycsIHtcXG4gICAgICAgICAgICAgICAgYm9keTogXFxcImFjdD1zb25naW5mbyZpZD1cXFwiICsgdDEgKyBcXFwiJmxhbmc9XFxcIlxcbiAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgICAgIHVybCA9IF8ubXAzO1xcbiAgICAgICAgICAgIGlmICh0MykgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UodSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBfLmxyYy5yZXBsYWNlKC9cXFxcci9nLCAnJylcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2JkJzpcXG4gICAgICAgICAgICBfID0gcWlhbnFpYW4oXFxcInNvbmcvdHJhY2tsaW5rXFxcIiwge1xcbiAgICAgICAgICAgICAgICBUU0lEOiB0MVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCBfLnBhdGgpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbXy5wYXRoICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnbmknOlxcbiAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly93d3cuaGlmaW5pLmNvbS9cXFwiO1xcbiAgICAgICAgICAgIGl0ZW0gPSBwZGZoKGZldGNoKHUgKyBgdGhyZWFkLSR7dDF9Lmh0bWApLCBcXFwiZGl2Lm1lc3NhZ2UuYnJlYWstYWxsJiZIdG1sXFxcIik7XFxuICAgICAgICAgICAgdXJsID0gdSArIGl0ZW0ubWF0Y2goL3VybDpcXFxccypbXFxcIiddKFteXFxcIiddKykvKVsxXTtcXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IGl0ZW0ucmVwbGFjZSgvXltcXFxcc1xcXFxTXSs/PFxcXFwvaDU+fDxoNVtePl0qPltcXFxcc1xcXFxTXSsvZ2ksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBMcmMobHJjKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZzMnOlxcbiAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL3d3dy5nZ2dtdXNpYy5jb20vXFxcIjtcXG4gICAgICAgICAgICBpdGVtID0gcGRmaChmZXRjaCh1ICsgXFxcInRocmVhZC1cXFwiICsgdDEgKyBcXFwiLmh0bVxcXCIpLCBcXFwiZGl2Lm1lc3NhZ2UuYnJlYWstYWxsJiZIdG1sXFxcIik7XFxuICAgICAgICAgICAgZXZhbChcXFwidXJsPVxcXCIgKyBpdGVtLm1hdGNoKC91cmw6XFxcXHMqKFteXFxcXG4sXSspLylbMV0ucmVwbGFjZShcXFwiYmFzZTY0X2RlY29kZVxcXCIsIFxcXCJiYXNlNjREZWNvZGVcXFwiKSk7XFxuICAgICAgICAgICAgaWYgKCF1cmwubWF0Y2goL2h0dHAvKSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB1ICsgdXJsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0MykgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbHJjID0gaXRlbS5zcGxpdChcXFwiPC9oNT5cXFwiKVsxXS5zcGxpdChcXFwiPGg1XFxcIilbMF07XFxuICAgICAgICAgICAgaWYgKGxyYy5tYXRjaCgvXFxcXFtcXFxcZCs6XFxcXGQrLykpXFxuICAgICAgICAgICAgICAgIGxyYyA9IGxyYy5yZXBsYWNlKC8oXFxcXHMqPFxcXFwvP3A+KSsvZ2ksIFxcXCJcXFxcblxcXCIpO1xcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgbHJjID0gTHJjKGxyYyk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgcmVmZXJlcjogdVxcbiAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnYnonOlxcbiAgICAgICAgICAgIGl0ZW0gPSBmZXRjaChcXFwiaHR0cHM6Ly9kZWJlbnppLmNvbS91L1xcXCIgKyB0MSArIFxcXCIvXFxcIik7XFxuICAgICAgICAgICAgdXJsID0gcGRmaChpdGVtLCBcXFwiYXVkaW8mJnNyY1xcXCIpO1xcbiAgICAgICAgICAgIGlmICh0MykgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbHJjID0gcGRmaChpdGVtLCBcXFwiLmVudHJ5LWNvbnRlbnQmJkh0bWxcXFwiKS5zcGxpdChcXFwiPHN0cm9uZz7mrYzor43vvJo8L3N0cm9uZz5cXFwiKVsxXTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBMcmMobHJjKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnc3QnOlxcbiAgICAgICAgICAgIGl0ZW0gPSBmZXRjaFBDKFxcXCJodHRwOi8vd3d3LnNvbmd0YXN0ZS5jby9zb25nL1xcXCIgKyB0MSk7XFxuICAgICAgICAgICAgdXJsID0gcGRmaChpdGVtLCBcXFwic291cmNlLDAmJnNyY1xcXCIpO1xcbiAgICAgICAgICAgIGlmICh0MykgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZXZhbChTdHJpbmcoaXRlbS5tYXRjaCgvbHJjID0gYFtcXFxcc1xcXFxTXSo/YDsvKVswXSkpO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgbHlyaWM6IExyYyhscmMpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdibG0nOlxcbiAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly9ibGFja2JsbS5iYWlsZW1pLmNvbS9pbmRleC5waHAvZGFuY2UvcGxheS9pZC8nICsgdDE7XFxuICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2godSkpO1xcbiAgICAgICAgICAgIHVybCA9IF8uZG93bnVybCB8fCBfLnBsYXl1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZnAnOlxcbiAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vd3d3LmZhbmdwaS5uZXQvYXBpL3BsYXlfdXJsP2lkPVxcXCIgKyB0MSArIFxcXCImanNvbj0xXFxcIikpLmRhdGEudXJsO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBcXFwiaHR0cHM6Ly93d3cuZmFuZ3BpLm5ldC9kb3dubG9hZC9scmMvXFxcIiArIHQxXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdodCc6XFxuICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbS5odHF5eS5jb20vcGxheS9cXFwiICsgdDE7XFxuICAgICAgICAgICAgY29kZSA9IGV4ZWN1dGVXZWJSdWxlKHUsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZTtcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXJsID0gXFxcImh0dHA6Ly9mNS5odHF5eS5jb20vcGxheTkvXFxcIiArIHQxICsgXFxcIi9tcDMvXFxcIiArIGNvZGU7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogW3tcXG4gICAgICAgICAgICAgICAgICAgIHJlZmVyZXI6IHVcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJzF0JzpcXG4gICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vd3d3LjF0aW5nLmNvbVxcXCI7XFxuICAgICAgICAgICAgcGF0aCA9IGV4ZWN1dGVXZWJSdWxlKGBodHRwczovL2g1LjF0aW5nLmNvbS9zb25nL2AgKyB0MSwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBnX3NvbmdfbWV0YS5zb25nX3BhdGg7XFxuICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHVybCA9IHUgKyBcXFwiL2FwaS9hdWRpbz9cXFwiICsgcGF0aDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsLCBoZWFkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZlcmVyOiB1XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZSh1KS5oZWFkZXJzLmxvY2F0aW9uWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCwgdSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IHUgKyBcXFwiL3RvdWNoL2FwaS9seXJpYy9cXFwiICsgdDE7XFxuICAgICAgICAgICAgbHJjID0gSlNPTi5wYXJzZShmZXRjaChscmMpKS5seXJpY19jb250ZW50O1xcbiAgICAgICAgICAgIGlmICghbHJjLm1hdGNoKC9cXFxcW1xcXFxkKzpcXFxcZCsvKSlcXG4gICAgICAgICAgICAgICAgbHJjID0gTHJjKGxyYyk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgcmVmZXJlcjogdVxcbiAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnOXQnOlxcbiAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL25ldy45c2t5LmNvbS9hcGkvc29uZy9kZXRhaWw/aWQ9XFxcIiArIHQxICsgXFxcIiZpc19sb2dpbj1OXFxcIjtcXG4gICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaCh1KSkuZGF0YTtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgXy5zb25nX3VybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFtfLnNvbmdfdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY191cmwgfHwgTHJjKF8uZGVzaWduX25vdGVzKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnNW5kJzpcXG4gICAgICAgICAgICBpdGVtID0gZmV0Y2goYGh0dHA6Ly9tLjVuZC5jb20vdGluZy8ke3QxfS5odG1sYCk7XFxuICAgICAgICAgICAgZXZhbChpdGVtLm1hdGNoKC9tcDMgPSAuKj87LylbMF0pO1xcbiAgICAgICAgICAgIHVybCA9ICdodHRwOi8vbXBnZS41bmQuY29tLycgKyBtcDM7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IHBkZmgoaXRlbSwgXFxcIiNscmNjb250JiZIdG1sXFxcIikucmVwbGFjZSgvPFxcXFwhLS0uKj8tLT58PGJyXFxcXC8/Pi9naSwgJ1xcXFxuJylcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2JpdSc6XFxuICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9iaXUubW9lL1NvbmcvcGxheVNJRC9zaWQvXFxcIiArIHQxKSkudXJsaW5mby51cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IHBkZmgoZmV0Y2goXFxcImh0dHBzOi8vYml1Lm1vZS9zXFxcIiArIHQxKSwgXFxcIi5hbS1wb3B1cC1iZCYmSHRtbFxcXCIpLnJlcGxhY2UoLzwoYnV0dG9uKS4qP1xcXFwxPnw8XFxcXC8/YnJcXFxcLz8+L2dpLCBcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqMSc6XFxuICAgICAgICAgICAgaXRlbSA9IGZldGNoUEMoXFxcImh0dHA6Ly93d3cuenp6ZGouY29tL211c2ljL2luZm8tXFxcIiArIHQxKTtcXG4gICAgICAgICAgICB1cmwgPSBwZGZoKGl0ZW0sIFxcXCJhdWRpbyYmc3JjXFxcIik7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGoyJzpcXG4gICAgICAgICAgICB1cmkgPSBKU09OLnBhcnNlKGZldGNoUEMoXFxcImh0dHBzOi8vd3d3LmRqdXUuY29tL3dhcC9wbGF5L3BsYXk/aWQ9XFxcIiArIHQxKSkuZGF0YS5saXN0ZW51cmw7XFxuICAgICAgICAgICAgdXJsID0gYGh0dHA6Ly9tcDQuZGp1dS5jb20vJHt1cml9Lm00YWA7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGozJzpcXG4gICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoUEMoXFxcImh0dHA6Ly93d3cubGFsYWRqLmNvbS9pbmRleC9pbmRleC9nZXRfY29va2llXFxcIiwge1xcbiAgICAgICAgICAgICAgICBcXFwiaGVhZGVyc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBgc29uZ19saXN0PXRoaW5rOlt7XFxcImlkXFxcIjpcXFwiJHt0MX1cXFwifV07YFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSkpLmRhdGFbMF0ucGF0aDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzBdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHVybCArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdkajQnOlxcbiAgICAgICAgICAgIHVyaSA9IGV4ZWN1dGVXZWJSdWxlKFxcXCJodHRwczovL3d3dy5haGFkai5jb20vbXVzaWMvXFxcIiArIHQxICsgXFxcIi5odG1sXFxcIiwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBkYW5jZUZpbGVQYXRoO1xcbiAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB1cmwgPSBgaHR0cHM6Ly9zdC45Mmt1LmNvbS9gICsgdXJpO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqNSc6XFxuICAgICAgICAgICAgXyA9IHBvc3QoJ2h0dHBzOi8vbS5kai5uZXQvdGVtcGxhdGUvemh6aF9kem11c2ljL2FqYXgvP2FjdGlvbj1nZXR1cmwnLCB7XFxuICAgICAgICAgICAgICAgIGJvZHk6IFxcXCJpZD1cXFwiICsgdDFcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6Ly9kam5ldC5zcmMuZGoubmV0OjQ0MzEvXFxcIiArIEpTT04ucGFyc2UoXykuZGF0YVswXS5zcmM7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGo2JzpcXG4gICAgICAgICAgICB1cmkgPSBleGVjdXRlV2ViUnVsZShcXFwiaHR0cDovL3d3dy4zNmRqLmNvbS9wbGF5L1xcXCIgKyB0MSArIFxcXCIuaHRtbFxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5mby5wbGF5dXJsO1xcbiAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJywgJy9lLyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXJsID0gYGh0dHA6Ly90bjEuNzJkamFwcC5jbjo4Mzk5L2AgKyB1cmk7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGo3JzpcXG4gICAgICAgICAgICB1cmwgPSBleGVjdXRlV2ViUnVsZShcXFwiaHR0cHM6Ly93d3cuN2lkai5jb20vZGovXFxcIiArIHQxICsgXFxcIi5odG1sXFxcIiwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBwbGF5dXJsO1xcbiAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzBdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHVybCArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdkajgnOlxcbiAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGp1OC5jb20nO1xcbiAgICAgICAgICAgIGl0ZW0gPSB1ICsgJy9pay96Lz8nICsgZXhlY3V0ZVdlYlJ1bGUodSArICcvZGlzY28vJyArIHQxICsgJy8nLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZ1cmw7XFxuICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGl0ZW0gPSBmZXRjaENvZGVCeVdlYlZpZXcoaXRlbSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB1cmwgPSBwZGZoKGl0ZW0sIFxcXCJhdWRpbyYmc3JjXFxcIik7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGo5JzpcXG4gICAgICAgICAgICB1cmwgPSBleGVjdXRlV2ViUnVsZSgnaHR0cHM6Ly9tLmRqeXl5LmNvbS9wbGF5LycgKyB0MSArICcuaHRtbCcsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcGxheXVybDtcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICB9XFxufVxcbiQuZXhwb3J0cyA9IHtcXG4gICAgc2VhcmNoLFxcbiAgICBsYXp5XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pGi56iL5bqP6aaW6aG1XCI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XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGlkJywgdGlkKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpaScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgbmFtZSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBDb2xvcihcXFwiPGI+5YiH5o2i5o6l5Y+jPC9iPlxcXCIsIFxcXCIjZmY2NjAxXFxcIiksXFxuICAgICAgICAgICAgdXJsOiAkKHBsYXRmb3Jtcy5zbGljZSgwLCA4KS5tYXAodGl0bGUgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAodGl0bGUgPT0gcGxhdGZvcm0pXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IFJpY2goU3Ryb25nKENvbG9yKHRpdGxlKSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdGl0bGVcXG4gICAgICAgICAgICB9KSwgMiwgJ+mAieaLqeaOpeWPo+W5s+WPsCcpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICghaW5wdXQubWF0Y2goL17igJjigJjigJnigJkvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3BsYXRmb3JtJywgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignaG9tZV9wYWdlJyk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWQnKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpaScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykocGxhdGZvcm0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF8zJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBDb2xvcihcXFwiPGI+VEdY5pS26JePPC9iPlxcXCIsIFxcXCIjZmY2NjAxXFxcIiksXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2NvbGxlY3Rpb24jbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjI25vUmVmcmVzaCM/cnVsZT3mrYzor43pgILphY1cXFwiLFxcbiAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCfmlLbol48nKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBcXFwiVEdY5pS26JePXFxcIixcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IENvbG9yKFxcXCI8Yj7op6PmnpDnrqHnkIY8L2I+XFxcIiwgXFxcIiNmZjY2MDFcXFwiKSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvcnVsZUxpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjI25vUmVmcmVzaCM/cGFnZVRpdGxlPeino+aekOeuoeeQhiZydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ+iuvue9ricpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF8zJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn8J+UjScsXFxuICAgICAgICAgICAgZGVzYzogJ+aQnOe0ouWFs+mUruivjSAvIOWIhuS6q+mTvuaOpScsXFxuICAgICAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChzX3BsYXRmb3JtKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgc19wbGF0Zm9ybSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfcGxhdGZvcm0nKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDQnKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2Uvc2VhcmNoI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wPWZ5cGFnZSZydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgICAgICAgICAgfSwgcGxhdGZvcm0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6c2VhcmNoMVxcXCIsXFxuICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogXFxcIumrmOe6p+aQnOe0olxcXCIsXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcInNfdDJcXFwiKSxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc190MicsIGlucHV0KVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmiJHnmoTmlLbol48nLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vY29sbGVjdGlvbj9ydWxlPeatjOivjemAgumFjScsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjEnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJ+WOhuWPsuiusOW9lScsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9oaXN0b3J5P3J1bGU95q2M6K+N6YCC6YWNJyxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9pY29uMycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIHRpdGxlOiAn6auY57qn5pCc57SiJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3BsYXRmb3JtJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc190NCcpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9zZWFyY2gjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3A9ZnlwYWdlJnJ1bGU95q2M6K+N6YCC6YWNXFxcIjtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9pY29uMicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogUmljaChDb2xvcignPGI+JyArIHRpZCArICc8L2I+JywgJyNmZjY2MDEnKSksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHRyci5tYXAoKG5hbWUsIGlpKSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpaSA9PSBpaSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignaG9tZV9wYWdlJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGlpJywgdGlpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIGlpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgICAgICB9KTtcXG4gICAgICAgIExvYWRpbmcoKTtcXG4gICAgfVxcbiAgICB1cmkgPSBpVGFnW3RpZF1bdHJyW3RpaV1dO1xcbiAgICBpZiAoIUFycmF5LmlzQXJyYXkodXJpKSkge1xcbiAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSB8fCBnZXRNeVZhcignaG9tZV9wYWdlJywgJzAnKSA9PSAnMCcpIHtcXG4gICAgICAgICAgICBsZXQgcGFnZVNpemUgPSBwbGF0Zm9ybSA9PSBcXFwibXlcXFwiID8gOTAgOiAocGxhdGZvcm0gPT0gXFxcIjVzXFxcIiA/IDE2IDogMzApO1xcbiAgICAgICAgICAgIGxldCB0b3RhbCA9ICQucmVxdWlyZShwbGF0Zm9ybSArIFxcXCI/cnVsZT3mrYzor43pgILphY1cXFwiKS5sYXp5KDEsIHVyaSk7XFxuICAgICAgICAgICAgaWYgKHRvdGFsIDwgTVlfUEFHRSAqIHBhZ2VTaXplKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdob21lX3BhZ2UnLCAnMScpO1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgJ+aIkeaYr+acieW6lee6v+eahCcuZm9udGNvbG9yKCdHcmF5Jykuc21hbGwoKSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIGQgPSBkLmNvbmNhdCh1cmkpO1xcbn0gY2F0Y2ggKGZldGNoX2Vycm9yKSB7XFxuICAgIC8vIGVycm9yKGZldGNoX2Vycm9yKTtcXG4gICAgZCA9IFt7XFxuICAgICAgICB0aXRsZTogXFxcIue9kee7nOW8guW4uCAvIOaOpeWPo+W0qea6g+S6hlxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi5o2i5Liq5o6l5Y+j55yL55yL44CCXFxcIixcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH1dO1xcbiAgICBwbGF0Zm9ybXMuc2xpY2UoMSwgOClcXG4gICAgICAgIC5maWx0ZXIodGl0bGUgPT4gdGl0bGUgIT0gcGxhdGZvcm0pXFxuICAgICAgICAubWFwKHRpdGxlID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl8yX3JvdW5kJyxcXG4gICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykodGl0bGUpLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncGxhdGZvcm0nLCB0aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdob21lX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpZCcpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcigndGlpJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgdGl0bGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG59XFxuTVlfUEFHRSA9PSAxID8gc2V0UHJlUmVzdWx0KGQpIDogc2V0UmVzdWx0KGQpO1xcbmRlbGV0ZUl0ZW1CeUNscygnbG9hZGluZ19naWYnKTtcXG5cXG5cXG5cXG5cXG5cXG4vLyDlsI/nqIvluo/msqHmnInmm7TmlrDvvIzlr7nop6PmnpDov5vooYzmo4DmtYvjgIJcXG5pZiAoZ2V0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnJykgPT0gJzEnICYmIE1ZX1BBR0UgPT0gMSkge1xcbiAgICBsZXQga2dfbGlzdDEgPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3Rfa2cnLCBbXSk7XFxuICAgIGxldCBrZ19saXN0MiA9IGtnX2xpc3QxLm1hcChfID0+IG1kNShfLn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gICAgICAgICAgICAgICAgdGl0bGU6ICdb6YW354uX5qaC5b+154mIXSDlkKzmrYzpoobkvJrlkZgnLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAn5q+P5pel5ZCs5q2M5Y2z5Y+v6aKG5Y+WMeaXpemFt+eLl+amguW/teeJiFZJUCcsXFxuICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXQgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF8uamlleGkpLm1hdGNoKC9cXFwiKFxcXFxkKylcXFwiLCBcXFwiKFteXFxcIl0rKVxcXCIsIFxcXCJcXFxcZCpcXFwiLCBcXFwiKFteXFxcIl0qKVxcXCIvKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUxJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuTGl0ZV9TaWduaW4obWF0WzFdLCBtYXRbMl0sIG1hdFszXSwgdHJ1ZSk7XFxuICAgICAgICAgICAgICAgIH0sIGtnX2xpdGUpLFxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKGp4bGlzdCwgaSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgXy50aW1lID0gbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxuICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDE7XFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3RbaV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X2tnJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUxJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6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paw5LiA5qyhY29va2llJyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29va2llID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvQ29va2llOiBcXFwiKFteXFxcIl0rKS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUyJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLnJlZnJlc2hfbG9naW4oY29va2llKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHFxX2xpdGUpLFxcbiAgICAgICAgICAgICAgICAgICAgY2FuY2VsOiAkLnRvU3RyaW5nKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXy50aW1lICs9IDguNmU3O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8uc2lnbmluID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X3FxJywgW10pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdC51bnNoaWZ0KF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdCA9IGp4bGlzdC5maWx0ZXIoKG9iaiwgaW5kZXgsIGFycikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJyLmZpbmRJbmRleChvID0+IG1kNShvYmoudGl0bGUgKyBvYmoudXJsKSA9PT0gbWQ1KG8udGl0bGUgKyBvLnVybCkpID09PSBpbmRleDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3RfcXEnLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUyJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LuK5pel5LiN5YaN5o+Q56S677yM6K+35Zyo6K6+572u6aG15omL5Yqo562+5YiwXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwgcXFfbGl0ZSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3VwZGF0ZTInLCAnMCcpOyAvLyDov5jmsqHliLDnrb7liLDml7bpl7RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUyJywgJzAnKTsgLy8g5rKh5pyJcXHop6PmnpAgLyDkuI3mj5DnpLpcXG4gICAgICAgIH1cXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKRpuinhOWImee8lui+kVwiLFwicGF0aFwiOlwicnVsZUVkaXRcIixcInJ1bGVcIjpcImpzOlxcbmV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScsIHt9KSkucnVsZSk7XFxubGV0IGQgPSBbXTtcXG5sZXQganhfczEgPSBnZXRNeVZhcignanhfczEnLCAnMCcpID09ICcwJztcXG5sZXQganhfczIgPSBnZXRNeVZhcignanhfczInLCAnMCcpID09ICcwJztcXG5sZXQganhfczMgPSBnZXRNeVZhcignanhfczInLCAnMCcpID09ICcxJztcXG5sZXQganhfdHlwZSA9IGdldE15VmFyKCdqeF90eXBlJywgJ2t3Jyk7XFxubGV0IGp4X29wZW4gPSBnZXRNeVZhcignanhfb3BlbicsICcxJykgPT0gJzEnO1xcbmxldCBqeF9kb3du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IG9wZW4pID0+IHtcXG4gICAgICAgIGlmIChLKSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X29wZW4nLCBvcGVuKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXmv4DmtLvlr4bljJlcXFwiKS5pbnB1dCgob3BlbikgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTEnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MxJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9vcGVuJywgb3Blbik7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mv4DmtLvlpLHotKVcXFwiO1xcbiAgICAgICAgICAgIH0sIG9wZW4pO1xcbiAgICAgICAgfVxcbiAgICB9LCBqeF9zMSwganhfb3BlbiA/ICcwJyA6ICcxJyksXFxuICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChqeF9vcGVuID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF8zJ1xcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNmZjY2MDFcXFwiPjxiPuWQr+eUqOS4i+i9vTwvYj48L3NwYW4+JyxcXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLLCBkb3duKSA9PiB7XFxuICAgICAgICBpZiAoSykge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdqeF9kb3duJywgZG93bik7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5r+A5rS75a+G5YyZXFxcIikuaW5wdXQoKGRvd24pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20xJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfZG93bicsIGRvd24pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5r+A5rS75aSx6LSlXFxcIjtcXG4gICAgICAgICAgICB9LCBkb3duKTtcXG4gICAgICAgIH1cXG4gICAgfSwganhfczEsIGp4X2Rvd24gPyAnMCcgOiAnMScpLFxcbiAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfZG93biA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG59KTtcXG5bXFxcIumihOiniFxcXCIsIFxcXCLln7rmnKxcXFwiLCBcXFwi6Z+z6LSoXFxcIiwgXFxcIuino+aekFxcXCIsIFxcXCLmi5PlsZVcXFwiXS5tYXAobmFtZSA9PiB7XFxuICAgIGxldCBpID0ganhfdGlkID09IG5hbWVcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhpID8gQ29sb3IobmFtZSkgOiBuYW1lKSksXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpZCwgdGlpLCBmZWcpID0+IHtcXG4gICAgICAgICAgICBpZiAodGlpKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF90aWQnLCB0aWQpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBuYW1lLCAhaSwgIWp4X3MyKSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF81J1xcbiAgICB9KTtcXG59KTtcXG5zd2l0Y2ggKGp4X3RpZCkge1xcbiAgICBjYXNlICfpooTop4gnOlxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKGdldE15VmFyKCdqeF90aXRsZScpKSxcXG4gICAgICAgICAgICBkZXNjOiBbXFxcIm1wM1xcXCIsIFxcXCJocVxcXCIsIFxcXCJzcVxcXCIsIFxcXCJoclxcXCIsIC8qIFxcXCJ6cVxcXCIqLyBdLm1hcCh0ID0+IGdldE15VmFyKFxcXCJqeF9cXFwiICsgdCkgIT0gXFxcIlxcXCIgPyAn4piFJyA6ICfimIYnKS5qb2luKFxcXCJcXFwiKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBnZXRNeVZhcignanhfaW1nJykgfHwgJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKClcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoJ2p4X2Rlc2MnKSArICfkuKgnICsgZ2V0TXlWYXIoJ2p4X3VybCcpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcignanhfY29udGVudCcsICdcXFxcblxcXFxuXFxcXG5cXFxcblxcXFxuJykucmVwbGFjZSgvXFxcXG4vZywgJzxicj4nKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfkvb/nlKjmnYPpmZAnLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSykgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoSykgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTEnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mqjOivgeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0sIGp4X3MxKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfczEgPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fMl9yb3VuZCcsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfnvJbovpHmnYPpmZAnLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSykgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoSykgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMicsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mqjOivgeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0sIGp4X3MyKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfczIgPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fMl9yb3VuZCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgJ+WfuuacrCc6XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDmoIfor4YnLCAndXJsJ10sXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDlkI3np7AnLCAndGl0bGUnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOa6kOWbvuaghycsICdpbWcnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOa6kOWIhue7hCcsICdkZXNjJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDms6jph4onLCAnY29udGVudCddXFxuICAgICAgICBdLm1hcChbYSwgYl0gPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGRlc2M6IGEsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihcXFwianhfXFxcIiArIGIpLFxcbiAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IGBwdXRNeVZhcihcXFwianhfJHtifVxcXCIsIGlucHV0KWAsXFxuICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHQ6IHRydWVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAn6Z+z6LSoJzpcXG4gICAgICAgIFtcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOagh+WHhumfs+i0qOOAguS+i++8mnQyPVxcXCIxMjhrXFxcIicsICdtcDMnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOmrmOWTgemfs+i0qOOAguS+i++8mnQyPVxcXCIzMjBrXFxcIicsICdocSddLFxcbiAgICAgICAgICAgIFsn6YCJ5aGr77yM5peg5o2f6Z+z6LSo44CC5L6L77yadDI9XFxcIjIwMDBrXFxcIicsICdzcSddLFxcbiAgICAgICAgICAgIFsn6YCJ5aGr77yM6auY5ZOB5peg5o2f44CC5L6L77yadDI9XFxcIjQwMDBrXFxcIicsICdociddLFxcbiAgICAgICAgICAgIC8vIFsn6YCJ5aGr77yM56uL5L2T5peg5o2f44CC5L6L77yadDI9XFxcIjIwMDAwa1xcXCInLCAnenEnXVxcbiAgICAgICAgXS5tYXAoW2EsIGJdID0+IHtcXG4gICAgICAgICAgICBsZXQgXyA9IHtcXG4gICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChqeF9zMiB8fCBqeF9zMykge1xcbiAgICAgICAgICAgICAgICBfLmRlZmF1bHRWYWx1ZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgZ2V0TXlWYXIoXFxcImp4X1xcXCIgKyBiKSk7XFxuICAgICAgICAgICAgICAgIF8ub25DaGFuZ2UgPSAkLnRvU3RyaW5nKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQudHJpbSgpICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIobmFtZSwgZ2V0UHJpdmF0ZUpTKGlucHV0LnRyaW0oKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihuYW1lLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIFxcXCJqeF9cXFwiICsgYik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgXy5kZWZhdWx0VmFsdWUgPSBcXFwi5rKh5pyJ5p2D6ZmQ77yM6K+36Kej6ZSB44CCXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBkZXNjOiBhLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IF9cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgJ+ino+aekCc6XFxuICAgICAgICBsZXQgXyA9IHtcXG4gICAgICAgICAgICBoaWdobGlnaHQ6IHRydWUsXFxuICAgICAgICAgICAgdHlwZTogXFxcInRleHRhcmVhXFxcIixcXG4gICAgICAgICAgICBoZWlnaHQ6IDdcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChqeF9zMiB8fCBqeF9zMykge1xcbiAgICAgICAgICAgIF8uZGVmYXVsdFZhbHVlID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBnZXRNeVZhcihcXFwianhfamlleGlcXFwiKSk7XFxuICAgICAgICAgICAgXy5vbkNoYW5nZSA9ICQudG9TdHJpbmcoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LnRyaW0oKSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIobmFtZSwgZ2V0UHJpdmF0ZUpTKGlucHV0Ln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ICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCfnvJbovpHmupDnmoTpmZDliLYnKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2VkaXQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICflj6/ku6XnnIvvvIzlj6/ku6XnvJbovpEo5aSn54ix5peg55aGKScsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChLKSByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IGdldE15VmFyKCdqeF9tMicpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfbTInLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mm7TmlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mqjOivgeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0sIGp4X3MyKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MyID8gNTUgOiA2MykgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+WPr+S7peeci++8jOS4jeiDvee8lui+kSjpmLLmraLkuozmlLkpJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKEsxLCBLMikgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2p4X20yJykgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+356Gu6K6k5a+G5YyZXFxcIikuaW5wdXQoKGlucHV0MikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gaW5wdXQyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczInLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20yJywgbWQ1KGlucHV0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChLMSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLmk43kvZznsbvlnovvvJrmm7TmlLnlr4bljJlcXFxcbuivt+i+k+WFpeWOn+WvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+356Gu6K6k5a+G5YyZXFxcIikuaW5wdXQoKGlucHV0MikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBpbnB1dDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20yJywgbWQ1KGlucHV0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4blpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WOn+WvhuWMmemqjOivgeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChLMikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLmk43kvZznsbvlnovvvJrmnYPpmZDpmY3nuqdcXFxcbuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczInLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr4bljJnplJnor6/vvIzpmY3nuqflpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczInLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGp4X3MzLCAhanhfczIpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfczIgPyA2MyA6IGp4X3MzID8gNTUgOiA2MykgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+S4jeiDveeci++8jOS4jeiDvee8lui+kSjog73nlKjlsLHooYwpJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKEsxLCBLMikgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2p4X20yJykgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+356Gu6K6k5a+G5YyZXFxcIikuaW5wdXQoKGlucHV0MikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gaW5wdXQyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczInLCAnMicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20yJywgbWQ1KGlucHV0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChLMSAmJiBLMikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLmk43kvZznsbvlnovvvJrmm7TmlLnlr4bljJlcXFxcbuivt+i+k+WFpeWOn+WvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+356Gu6K6k5a+G5YyZXFxcIikuaW5wdXQoKGlucHV0MikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBpbnB1dDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzInKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20yJywgbWQ1KGlucHV0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4blpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WOn+WvhuWMmemqjOivgeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMicsICcyJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgIWp4X3MzLCAhanhfczIpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfczIgPyA2MyA6IGp4X3MzID8gNjMgOiA1NSkgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCfkvb/nlKjmupDnmoTpmZDliLYnKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2NvZGUnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmsqHmnInpqozor4Eo5LiN5pCe6Iqx55qEKScsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChLKSByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IGdldE15VmFyKCdqeF9tMScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MxJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfbTEnLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mqjOivgeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0sIGp4X3MxKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MxID8gNTUgOiA2MykgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+a/gOa0u+mqjOivgSjpqozor4HkuIDkuIspJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKEspID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdqeF9tMScpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IGlucHV0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MxJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMScsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoSykge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MxJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuaTjeS9nOexu+Wei++8muabtOaUueWvhuWMmVxcXFxu6K+36L6T5YWl5Y6f5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IGdldE15VmFyKCdqeF9tMScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fnoa7orqTlr4bljJlcXFwiKS5pbnB1dCgoaW5wdXQyKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IGlucHV0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczEnLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfbTEnLCBtZDUoaW5wdXQpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Y6f5a+G5YyZ6aqM6K+B5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwganhfczEpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfczEgPyA2MyA6IDU1KSArICcuc3ZnJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5pe25pWI6aqM6K+BKOetieW+heWujOWWhCknLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LzYzLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgYnJlYWs7XFxufVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhDb2xvcign5L+d5a2Y5bm26YCA5Ye6JykpKSxcXG4gICAgZGVzYzogJ+S4iuasoee8lui+ke+8micgKyAkLmRhdGVGb3JtYXQoTnVtYmVyKGdldE15VmFyKFxcXCJqeF90aW1lXFxcIikpIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpLCAneXl5eS1NTS1kZCBoaDptbTpzcycpLFxcbiAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgaWYgKGdldE15VmFyKCdqeF9tMicpICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IGdldE15VmFyKCdqeF9tMicpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldEVkaXQoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6aqM6K+B5aSx6LSl77yM5LiN5pSv5oyB5L+d5a2Y77yM6K+35bem5LiK6KeS5omL5Yqo6YCA5Ye644CCXFxcIjtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXRFZGl0KCk7XFxuICAgICAgICB9XFxuICAgIH0pLFxcbiAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgIH1cXG59KTtcXG5zZXRSZXN1bHQoZCk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLikaXop4TliJnliJfooahcIixcInBhdGhcIjpcInJ1bGVMaXN0XCIsXCJydWxlXCI6XCJqczpcXG5ldmFsKEpTT04ucGFyc2UoZm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sZXQgenkgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwianhsaXN0MlxcXCIsIHt9KTtcXG4gICAgICAgIGxldCB6dSA9IE9iamVjdC5rZXlzKHp5KTtcXG4gICAgICAgIGlmICh6dS5sZW5ndGggPT0gMCkgcmV0dXJuIFxcXCJ0b2FzdDovL+ayoeaciemAieS4reino+aekFxcXCI7XFxuICAgICAgICBsZXQgdDEsIHQyLCBqc29uID0ge307XFxuICAgICAgICBpZiAoenUubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICBsZXQgXyA9IHp5W3p1WzBdXTtcXG4gICAgICAgICAgICBpZiAoXy5tMSAmJiBfLm0xICE9IFxcXCJcXFwiICYmIFN0cmluZyhfLm0xKS5sZW5ndGggPT0gMzIpIHtcXG4gICAgICAgICAgICAgICAgXy5zMSA9IFxcXCIxXFxcIjtcXG4gICAgICAgICAgICAgICAgXy5vcGVuID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICBfLmRvd24gPSBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChfLm0yICYmIF8ubTIgIT0gXFxcIlxcXCIgJiYgU3RyaW5nKF8ubTIpLmxlbmd0aCA9PSAzMiAmJiBfLnMyID09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICBfLnMyID0gXFxcIjJcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBqc29uW18udHlwZV0gPSBbX107XFxuICAgICAgICAgICAgbGV0IHQxID0gXy50eXBlO1xcbiAgICAgICAgICAgIGxldCB0MiA9IF8udGl0bGU7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBvZiB6dSkge1xcbiAgICAgICAgICAgICAgICBsZXQgXyA9IHp5W2tleV07XFxuICAgICAgICAgICAgICAgIGlmICghanNvbltfLnR5cGVdKSB7XFxuICAgICAgICAgICAgICAgICAgICBqc29uW18udHlwZV0gPSBbXTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoXy5tMSAmJiBfLm0xICE9IFxcXCJcXFwiICYmIFN0cmluZyhfLm0xKS5sZW5ndGggPT0gMzIpIHtcXG4gICAgICAgICAgICAgICAgICAgIF8uczEgPSBcXFwiMVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBfLm9wZW4gPSBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBfLmRvd24gPSBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKF8ubTIgJiYgXy5tMiAhPSBcXFwiXFxcIiAmJiBTdHJpbmcoXy5tMikubGVuZ3RoID09IDMyICYmIF8uczIgPT0gXFxcIjBcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBfLnMyID0gXFxcIjJcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGpzb25bXy50eXBlXS5wdXNoKF8pO1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLmdldFNoYXJlKGpzb24sIHRydWUsIHp1Lmxlbmd0aCwgdDEsIHQyKTtcXG4gICAgfSlcXG59KTtcXG5sZXQganhfcGxhdGZvcm0gPSBnZXRNeVZhcignanhfcGxhdGZvcm0nLCAnbGliJyk7XFxucGxhdGZvcm1zID0gcGxhdGZvcm1zLnNsaWNlKDAsIDYpLmNvbmNhdChcXFwicXRcXFwiKTtcXG5wbGF0Zm9ybXMubWFwKHBsYXRmb3JtID0+IHtcXG4gICAgbGV0IHBsYXRmb3JtMjtcXG4gICAgaWYgKGp4X3BsYXRmb3JtID09IHBsYXRmb3JtKVxcbiAgICAgICAgcGxhdGZvcm0yID0gUmljaChTdHJvbmcoQ29sb3IocGxhdGZvcm0pKSk7XFxuICAgIGVsc2VcXG4gICAgICAgIHBsYXRmb3JtMiA9IHBsYXRmb3JtO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHBsYXRmb3JtMixcXG4gICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGxhdGZvcm0pID0+IHtcXG4gICAgICAgICAgICBpZiAoIXBsYXRmb3JtLm1hdGNoKC9e4oCY4oCY4oCZ4oCZLykpIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3BsYXRmb3JtJywgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBwbGF0Zm9ybSksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5Yig6ZmkJyArIHBsYXRmb3JtLnJlcGxhY2UoJ2xpYicsICflhajpg6gnKSArICfop6PmnpAnLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGxhdGZvcm0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaTigJxcXFwiICsgcGxhdGZvcm0ucmVwbGFjZSgnbGliJywgJ+WFqOmDqCcpICsgXFxcIuino+aekOKAneWQl++8n1xcXFxu5q2k5pON5L2c5LiN5Y+v6YCG77yM6K+36LCo5oWO6YCJ5oup44CCXFxcIikuY29uZmlybSgocGxhdGZvcm0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocGxhdGZvcm0gPT0gJ2xpYicpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXRmb3JtcyA9IFsncXEnLCAnd3knLCAna2cnLCAna3cnLCAnbWcnLCAncXQnXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXRmb3JtcyA9IFtwbGF0Zm9ybV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgcGxhdGZvcm0gb2YgcGxhdGZvcm1zKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbSgnanhsaXN0XycgKyBwbGF0Zm9ybSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICB9LCBwbGF0Zm9ybSlcXG4gICAgICAgICAgICB9XVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59KTtcXG5sZXQganhsaXN0ID0gW107XFxuaWYgKGp4X3BsYXRmb3JtID09IFxcXCJsaWJcXFwiKSB7XFxuICAgIHBsYXRmb3Jtcy5zbGljZSgxKS5tYXAocGxhdGZvcm0gPT4ge1xcbiAgICAgICAganhsaXN0ID0ganhsaXN0LmNvbmNhdChzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3RfJyArIHBsYXRmb3JtLCBbXSkpO1xcbiAgICB9KTtcXG59IGVsc2Uge1xcbiAgICBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3RfJyArIGp4X3BsYXRmb3JtLCBbXSk7XFxufVxcbmlmIChqeGxpc3QubGVuZ3RoID09IDApIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhDb2xvcihcXFwi5rKh5pyJ6Kej5p6QXFxcIikpKSxcXG4gICAgICAgIHVybDogJ2h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vZwnKS5zZWxlY3QoKHR5cGUsIHRpdGxlLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGpzb24sIGp4bGlzdDIsIGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwgW10pO1xcbiAgICAgICAgICAgICAgICBsZXQgenUgPSBqeGxpc3QubWFwKF8gPT4gbWQ1KF8udHlwZSArICc6JyArIF8udGl0bGUgKyAnOicgKyBfLnVybCkpO1xcbiAgICAgICAgICAgICAgICBsZXQgbSA9IG1kNSh0eXBlICsgJzonICsgdGl0bGUgKyAnOicgKyB1cmwpO1xcbiAgICAgICAgICAgICAgICBsZXQgaSA9IHp1LmluZGV4T2YobSk7XFxuICAgICAgICAgICAgICAgIGxldCBfID0ganhsaXN0W2ldO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfliIbkuqsnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLm0xICYmIF8ubTEgIT0gXFxcIlxcXCIgJiYgU3RyaW5nKF8ubTEpLmxlbmd0aCA9PSAzMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnMxID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLm9wZW4gPSBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uZG93biA9IFxcXCIwXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ubTIgJiYgXy5tMiAhPSBcXFwiXFxcIiAmJiBTdHJpbmcoXy5tMikubGVuZ3RoID09IDMyICYmIF8uczIgPT0gXFxcIjBcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uczIgPSBcXFwiMlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqc29uW3R5cGVdID0gW19dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuZ2V0U2hhcmUoanNvbiwgdHJ1ZSwgMSwgdHlwZSwgdGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn57yW6L6RJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBbXFxcInR5cGVcXFwiLCBcXFwib3BlblxcXCIsIFxcXCJkb3duXFxcIiwgXFxcImltZ1xcXCIsIFxcXCJ0aXRsZVxcXCIsIFxcXCJkZXNjXFxcIiwgXFxcInVybFxcXCIsIFxcXCJjb250ZW50XFxcIiwgXFxcIm1wM1xcXCIsIFxcXCJocVxcXCIsIFxcXCJzcVxcXCIsIFxcXCJoclxcXCIsIFxcXCJ6cVxcXCIsIFxcXCJqaWV4aVxcXCIsIFxcXCJzMVxcXCIsIFxcXCJtMVxcXCIsIFxcXCJzMlxcXCIsIFxcXCJtMlxcXCIsIFxcXCJ0aW1lXFxcIiwgXFxcInRpZFxcXCIsIFxcXCJ1aWRcXFwiXS5tYXAodCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4XycgKyB0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF91aWQnLCBtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhfKS5tYXAodCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF8nICsgdCwgX1t0XSB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcnVsZUVkaXQjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3BhZ2VUaXRsZT3op4TliJnnvJbovpEmcnVsZT3mrYzor43pgILphY0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Yig6ZmkJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6ZmkXFxcIiArIF8udHlwZSArIFxcXCLop6PmnpDigJxcXFwiICsgXy50aXRsZSArICfigJ3lkJfvvJ9cXFxcbuatpOaTjeS9nOS4jeWPr+mAhu+8jOivt+iwqOaFjumAieaLqeOAgicpLmNvbmZpcm0oKHR5cGUsIGp4bGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3RfJyArIHR5cGUsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBqeGxpc3QsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn56e75YqoJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHp1ID0ganhsaXN0Lm1hcChfID0+IF8udGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6nnp7vliqjkvY3nva4nKS5zZWxlY3QoKHR5cGUsIGp4bGlzdCwgXywgenUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSB6dS5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gLTEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QucHVzaChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0LnNwbGljZShpLCAwLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwianhsaXN0X1xcXCIgKyB0eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwganhsaXN0LCBfLCB6dSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfpgInkuK3op6PmnpAnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDIgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwianhsaXN0MlxcXCIsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyW21dID0gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwianhsaXN0MlxcXCIsIGp4bGlzdDIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WPlua2iOmAieS4rSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBqeGxpc3QyW21dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJqeGxpc3QyXFxcIiwganhsaXN0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5ZCv55So5LiL6L29JzpcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+emgeeUqOS4i+i9vSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uczEgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uZG93biA9IF8uZG93biA9PSAnMScgPyAnMCcgOiAnMSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChfLmRvd24gPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5r+A5rS75a+G5YyZXFxcIikuaW5wdXQoKGp4bGlzdCwgaSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gXy5tMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uczEgPSAnMCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gJzEnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdFtpXSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0XycgKyBfLnR5cGUsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly/mv4DmtLvmiJDlip/vvIzmrKLov47kvb/nlKgnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvhuWMmemUmeivr++8jOaXoOazleWQr+eUqFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGp4bGlzdCwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5kb3duID0gJzAnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdFtpXSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0XycgKyB0eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIF8udHlwZSwgXy50aXRsZSwgXy51cmwpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6IF8uaW1nIHx8ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgpXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IF8udHlwZSArICfkuKgnICsgKF8uZGVzYyB8fCAn5pyq55+lJykgKyAn5LioJyArIF8udXJsLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodHlwZSwgdGl0bGUsIHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0XycgKyB0eXBlLCBbXSk7XFxuICAgICAgICAgICAgICAgIGxldCB6dSA9IGp4bGlzdC5tYXAoXyA9PiBtZDUoXy50eXBlICsgJzonICsgXy50aXRsZSArICc6JyArIF8udXJsKSk7XFxuICAgICAgICAgICAgICAgIGxldCBtID0gbWQ1KHR5cGUgKyAnOicgKyB0aXRsZSArICc6JyArIHVybCk7XFxuICAgICAgICAgICAgICAgIGxldCBpID0genUuaW5kZXhPZihtKTtcXG4gICAgICAgICAgICAgICAgbGV0IGp4X29wZW4gPSAoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8uczEgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gXy5vcGVuID09ICcxJyA/ICcwJyA6ICcxJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoXy5vcGVuID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5r+A5rS75a+G5YyZXFxcIikuaW5wdXQoKGp4bGlzdCwgaSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBfLm0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnMxID0gJzAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gJzEnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0W2ldID0gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgXy50eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL+a/gOa0u+aIkOWKn++8jOasoui/juS9v+eUqCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvhuWMmemUmeivr++8jOaXoOazleWQr+eUqFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwganhsaXN0LCBpLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gJzAnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3RbaV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0XycgKyB0eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4ganhfb3BlbihqeGxpc3RbaV0pO1xcbiAgICAgICAgICAgIH0sIF8udHlwZSwgXy50aXRsZSwgXy51cmwpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoXy5vcGVuID09ICcxJyA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAg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xMDknLCBfW1F1YWxpdHldKSk7XFxuICAgICAgICBsZXQgaXNQbGF5wqAgPSB1VHlwZSA9PSBcXFwib3BlblxcXCIgJiYgcXVhbGl0eSAhPSBcXFwibXAzXFxcIjtcXG4gICAgICAgIGlmIChqeGxpc3QubGVuZ3RoID09IDApIHtcXG4gICAgICAgICAgICBpZiAoaXNQbGF5KVxcbiAgICAgICAgICAgICAgICByZXR1cm4gW2ZhbHNlLCBscmMsIGlpIC0gMV07XFxuICAgICAgICAgICAgZWxzZSBpZiAodVR5cGUgPT0gXFxcImRvd25cXFwiIHx8IGp4bGlzdDIubGVuZ3RoID09IDApXFxuICAgICAgICAgICAgICAgIHJldHVybiBbXFxcInRvYXN0Oi8v5rKh5pyJ5Y+v55So55qEXFxcIiArICh1VHlwZSA9PSBcXFwib3BlblxcXCIgPyBcXFwi6K+V5ZCsXFxcIiA6IFxcXCLkuIvovb1cXFwiKSArIFxcXCLop6PmnpBcXFwiLCBscmMsIGlpXTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChwbGF0Zm9ybSAhPSBcXFwicXRcXFwiKSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgXyBvZiBqeGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBmYWxzZTtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoU3RyaW5nKGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgX1txdWFsaXR5XSkpKTtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoU3RyaW5nKGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgX1tcXFwiamlleGlcXFwiXSkpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh1cmwgJiYgU3RyaW5nKHVybCkubGVuZ3RoID4gMTkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW3VybCwgbHJjLCBpaV07XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGp4RXJyb3IpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vIGxvZyhlcnJvcihqeEVycm9yKSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBpZiAocXVhbGl0eSA9PSBcXFwibXAzXFxcIikgeyAvLyDosIPnlKjlhbblroPop6PmnpDmjqXlj6NcXG4gICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICBsYXp5LFxcbiAgICAgICAgICAgICAgICBzZWFyY2hcXG4gICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJxdD9ydWxlPeatjOivjemAgumFjVxcXCIpO1xcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG11c2ljSXRlbSkpIHtcXG4gICAgICAgICAgICAgICAgbXVzaWNJdGVtID0gbXVzaWNJdGVtWzBdO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgc29uZ05hbWUgPSAobXVzaWNJdGVtLnNvbmdOYW1lIHx8IG11c2ljSXRlbS5uYW1lKS5zcGxpdCgnIC0gJyk7XFxuICAgICAgICAgICAgc29uZ05hbWUgPSBzb25nTmFtZVsxXSB8fCBzb25nTmFtZVswXTtcXG4gICAgICAgICAgICBsZXQgc29uZ0FydGlzdCA9IG11c2ljSXRlbS5hcnRpc3QgfHwgbXVzaWNJdGVtLnNpbmdlcm5hbWUgfHwgbXVzaWNJdGVtLnNpbmdlciB8fCBtdXNpY0l0ZW0uYXI7XFxuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoc29uZ0FydGlzdCkpIHtcXG4gICAgICAgICAgICAgICAgLy8gc29uZ0FydGlzdCA9IHNvbmdBcnRpc3QubWFwKF89Pl8ubmFtZSkuam9pbihcXFwiJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBzb25nQXJ0aXN0ID0gc29uZ0FydGlzdFswXS5uYW1lO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBNWV9QQUdFID0gMTtcXG4gICAgICAgICAgICBmb3IgKGxldCBfIG9mIGp4bGlzdDIpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBmYWxzZTtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoU3RyaW5nKGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgX1txdWFsaXR5XSkpKTtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoU3RyaW5nKGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgX1tcXFwiamlleGlcXFwiXSkpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh1cmwgJiYgU3RyaW5nKHVybCkubGVuZ3RoID4gMTkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW3VybCwgbHJjLCBpaV07XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGp4RXJyb3IpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vIGxvZyhlcnJvcihqeEVycm9yKSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaXNQbGF5KSByZXR1cm4gW2ZhbHNlLCBscmMsIGlpXTtcXG4gICAgICAgIHJldHVybiBbXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcIiwgbHJjLCBpaV07XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGdldFNoYXJlKGpzb24sIGlzSngsIGxlbiwgdDEsIHQyLCBhcnIsIHNpLCBrZXkpIHtcXG4gICAgICAgIGxldCB0ZXh0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGpzb24pKTtcXG4gICAgICAgIHJldHVybiAkKGdldFBhc3RlcygpLmNvbmNhdChcXFwi57qv5paH5pysXFxcIikuY29uY2F0KGFyciB8fCBbXSksIDIsICfpgInmi6nliIbkuqvmoLzlvI8nKS5zZWxlY3QoKHRleHQsIGlzSngsIGxlbiwgdDEsIHQyLCBzaSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmibnph4/liIbkuqtcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpdGNoOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpOiBzaSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XVxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9fY2F0Y2gvSW1wb3J0LnR4dFxcXCIsIEpTT04uc3RyaW5naWZ5KGpzb24pKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3JlbHkyI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLlrpjmlrnpk77mjqVcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiOyAvL+i/mOayoeWGmSAgICBcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgZGVzYywgdHlwZSwgcmVseSwgZ3JvdXA7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCAhPSBcXFwi57qv5paH5pysXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHNoYXJlUGFzdGUodGV4dCwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgZ3JvdXAgPSBcXFwiUGFzdGVcXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgZ3JvdXAgPSBcXFwiVGV4dFxcXCI7XFxuICAgICAgICAgICAgICAgIGlmIChpc0p4KSB7XFxuICAgICAgICAgICAgICAgICAgICB0eXBlID0gXFxcIuino+aekFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICByZWx5ID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFxcXCLmlLbol49cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgcmVseSA9IFxcXCIyXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAobGVuID09IDEgJiYgdDEgIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgICAgICBkZXNjID0gdDEgKyB0eXBlICsgXFxcIuOAjFxcXCIgKyB0MiArIFxcXCLjgI1cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgZGVzYyA9IFxcXCLlhbHjgIxcXFwiICsgbGVuICsgXFxcIuOAjeadoVxcXCIgKyB0eXBlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4bGlzdDInKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly/mrYzor43pgILphY1cXFwiICsgdHlwZSArIFxcXCLlj6Pku6TvvIzmiZPlvIDmtbfpmJTljbPlj6/lr7zlhaVcXFxcblxcXC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xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgX1t0XTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0XycgKyBfLnR5cGUsIFtdKTtcXG4gICAgICAgICAgICBsZXQgdWlkcyA9IGp4bGlzdC5tYXAoX18gPT4gbWQ1KF9fLnR5cGUgKyAnOicgKyBfXy50aXRsZSArICc6JyArIF9fLnVybCkpO1xcbiAgICAgICAgICAgIGxldCBpID0gdWlkcy5pbmRleE9mKGdldE15VmFyKCdqeF91aWQnLCAnLTEnKSk7XFxuICAgICAgICAgICAgaWYgKGkgPT0gLTEpIHtcXG4gICAgICAgICAgICAgICAganhsaXN0LnB1c2goXyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAganhsaXN0LnNwbGljZShpLCAxLCBfKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignanhfdGlkJyk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignanhfdWlkJyk7XFxuICAgICAgICAgICAganhsaXN0ID0ganhsaXN0LmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gbWQ1KG9iai50aXRsZSArIG9iai51cmwpID09PSBtZDUoby50aXRsZSArIG8udXJsKSkgPT09IGluZGV4O1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgXy50eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgIHJldHVybiBiYWNrKHRydWUpLCAndG9hc3Q6Ly/kv53lrZjmiJDlip8nO1xcbiAgICAgICAgfSBlbHNlIGlmIChfLnRpdGxlID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+Whq+WGmea6kOWQjeensCc7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7floavlhpnmupDmoIfor4YnO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcblxcblxcbiAgICBzZXRFZGl0MjogZnVuY3Rpb24odHlwZSwgcnVuKSB7XFxuICAgICAgICBsZXQgYywgXyA9IHtcXG4gICAgICAgICAgICBcXFwiczFcXFwiOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgXFxcInMyXFxcIjogXFxcIjBcXFwiLFxcbiAgICAgICAgICAgIFxcXCJpbWdcXFwiOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykodHlwZSksXFxuICAgICAgICAgICAgXFxcInR5cGVcXFwiOiBTdHJpbmcodHlwZSkucmVwbGFjZSgvMiQvLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgXFxcInRpbWVcXFwiOiBuZXcgRGF0ZSgpLmdldFRpbWUoKSxcXG4gICAgICAgICAgICBcXFwib3BlblxcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICBcXFwiZG93blxcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICBcXFwiZGVzY1xcXCI6IFxcXCLkvJjpgIlcXFwiLFxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IEMwID0gU3RyaW5nKGdldE15VmFyKCd2aXBydWxlX2MwJywgJycpKS50cmltKCk7XFxuICAgICAgICBsZXQgQzEgPSBTdHJpbmcoZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzEnLCAnJykpLnRyaW0oKTtcXG4gICAgICAgIGxldCBDMiA9IFN0cmluZyhnZXRNeVZhcigndmlwcnVsZV9jMicsICcnKSkudHJpbSgpO1xcbiAgICAgICAgbGV0IGdldGtnamlleGkgPSAodGl0bGUsIHVybCwgdXNlcmlkLCB0b2tlbiwgYXBwaWQsIHNpZ25rZXkpID0+IHtc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iO1xcbiAgICAgICAgICAgICAgICBnZXRrZ2ppZXhpKFxcXCLphbfni5fmpoLlv7XniYhcXFwiLCBcXFwiaHR0cHM6Ly9nYXRld2F5Lmt1Z291LmNvbVxcXCIsIGMwLCBjMSwgXFxcIjMxMTZcXFwiLCBjMik7XFxuICAgICAgICAgICAgICAgIF8uc2lnbmluID0gMDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAna3cnOlxcbiAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKF8sIHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0aXRsZVxcXCI6IFxcXCLphbfmiJHpn7PkuZBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwOi8vbW9iaS5rdXdvLmNuXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJtcDNcXFwiOiBcXFwiUlhsblpOeVlJVWIxM011a0lrOVJUUT09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJocVxcXCI6IFxcXCJWTStwYVRGdXBzMWFlU29uK3owaDJnPT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInNxXFxcIjogXFxcIlBHQW5DUUNqdUpYemJpYStwKzBIdFE9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiaHJcXFwiOiBcXFwidHExcFg0VC9ZMTN2VGVBM1pmS1huVlgycDJvYlA4dEltY1hFaTlEeVFIRT1cXFwiLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKCFDMCkgcmV0dXJuIFxcXCJ0b2FzdDovL2Nvb2tpZeagvOW8j+mUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgIF8uamlleGkgPSBnZXRQcml2YXRlSlMoQzApO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdrdzInOlxcbiAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKF8sIHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0aXRsZVxcXCI6IFxcXCLms6Lngrnpn7PkuZBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwczovL2JkLWFwaS5rdXdvLmNuXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJtcDNcXFwiOiBcXFwibG9xNmVub0F2SmthZ0xBODZTRWlIQ0I2VmpNcHJ2SFQ4TEZ2dWdidWZxUT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImhxXFxcIjogXFxcImVrL2JtVTA5dlhEcVBMSHJUSERqdlNCNlZqTXBydkhUOExGdnVnYnVmcVE9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzcVxcXCI6IFxcXCJQdzRWWkJ5QUFRb3ZpUDdxWm9LVXVpVHlRZGxkamwrOThHRE5XOFd2aXBzPVxcXCIsXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL3VpZD0vaSk7XFxuICAgICAgICAgICAgICAgIGMwID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgYyA9IEMxLnNwbGl0KC90b2tlbj0vaSk7XFxuICAgICAgICAgICAgICAgIGMxID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgYyA9IEMyLnNwbGl0KC9kZXZJZD0vaSk7XFxuICAgICAgICAgICAgICAgIGMyID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgaWYgKCFjMCB8fCAhYzEgfHwgIWMyKSByZXR1cm4gXFxcInRvYXN0Oi8vY29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgXy5qaWV4aSA9IGdldFByaXZhdGVKUyhgdXJsID0gSlNPTi5wYXJzZShmZXRjaChfLnVybCArIFxcXCIvYXBpL3NlcnZpY2UvbXVzaWMvZG93bmxvYWRJbmZvL1xcXCIgKyB0MSArIFxcXCI/aXNNdj0wJmZvcm1hdD1cXFwiICsgdDMgKyBcXFwiJmJyPVxcXCIgKyB0MiArIFxcXCImbGV2ZWw9XFxcIiwge1xcbiAgICBcXFwiaGVhZGVyc1xcXCI6IHtcXG4gICAgICAgICdVc2VyLUFnZW50JzogJ29raHR0cC8zLjEwLjAnLFxcbiAgICAgICAgJ2NoYW5uZWwnOiAncXEnLFxcbiAgICAgICAgJ3BsYXQnOiAnYXInLFxcbiAgICAgICAgJ25ldCc6ICd3aWZpJyxcXG4gICAgICAgICd2ZXInOiAnMy4xLjInLFxcbiAgICAgICAgJ3VpZCc6ICcke2MwfScsXFxuICAgICAgICAndG9rZW4nOiAnJHtjMX0nLFxcbiAgICAgICAgJ2RldklkJzogJyR7YzJ9J1xcbiAgICB9XFxufSkpLmRhdGEudXJsO2ApO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdtZyc6XFxuICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogXFxcIuWSquWSlemfs+S5kFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogXFxcImh0dHBzOi8vbS5tdXNpYy5taWd1LmNuXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJtcDNcXFwiOiBcXFwiaFMzZHJZa3A3T0kxeEtPYzJCa2ZxUT09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJocVxcXCI6IFxcXCJQd1hydnZ6bTA0ZnRvQ25VV2twSkZ3PT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInNxXFxcIjogXFxcIjUvbUs5VGNaMWk4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S5kYXRhO1xcbiAgICAgICAgbmV3RGF0YXMgPSBhZGRsaXN0Lm1hcChpID0+IHtcXG4gICAgICAgICAgICBsZXQgXyA9IG5ld0RhdGFzW2ldO1xcbiAgICAgICAgICAgIGRlbGV0ZSBfLmV4dHJhO1xcbiAgICAgICAgICAgIGRlbGV0ZSBfLmNvbF90eXBlO1xcbiAgICAgICAgICAgIHJldHVybiBfO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBjbGVhck15VmFyKCdhZGRsaXN0Jyk7XFxuICAgICAgICBjbGVhck15VmFyKCdhZGRwaXRjaCcpO1xcbiAgICAgICAgaWYgKHR5cGUgPT09IDApXFxuICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikubG9nRGF0YShuZXdEYXRhcywgc2ksIG5hbWUgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgZWxzZSBpZiAodHlwZSA9PT0gMSlcXG4gICAgICAgICAgICByZXR1cm4gJChuYW1lIHx8IFxcXCJcXFwiLCBcXFwi56Gu5a6a5YiG57uE5ZCN56ewXFxcIikuaW5wdXQoKHNpLCBuZXdEYXRhcykgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IDAsXFxuICAgICAgICAgICAgICAgICAgICBwaXRjaDogMSxcXG4gICAgICAgICAgICAgICAgICAgIHNpOiBzaSxcXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgZGF0YTogbmV3RGF0YXNcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLmdldFNoYXJlKGpzb24sIGZhbHNlLCBuZXdEYXRhcy5sZW5ndGgpO1xcbiAgICAgICAgICAgIH0sIHNpLCBuZXdEYXRh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uICAgICAgICAgICAgLypcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICd0cnVlJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAqL1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB1cmwgPSBmYWxzZTtcXG4gICAgICAgICAgICB2ID0gdmVyc2lvbiArIDE7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodmVyc2lvbiA8IHYpIHtcXG4gICAgICAgICAgICBmID0gXFxcInJlZFxcXCI7XFxuICAgICAgICAgICAgdCA9IFxcXCLmo4DmtYvliLDmlrDniYjmm7TmlrDvvIzngrnlh7vkuobop6Por6bmg4XjgIJcXFwiO1xcbiAgICAgICAgICAgIFQgPSBcXFwi5pu05paw5YaF5a65XFxcIjtcXG4gICAgICAgICAgICBpZiAodXAgPT0gJycpIHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oJ3VwZGF0ZTAnLCAnMScpID09ICcxJykgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+abtOaWsOaPkOekuicsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAn5qOA5rWL5Yiw5L2g55qE6KeE5YiZ54mI5pys5bCP5LqO5pyN5Yqh5Zmo54mI5pys77yM5piv5ZCm56uL5Y2z5pu05paw77yfJyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKGRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZiA9ICQucmVxdWlyZShcXFwibGFuem91P3J1bGU95q2M6K+N6YCC6YWNXFxcIikub25lX3VybChkYSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCA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BIdG1sKSB7XFxuICAgIHRyeSB7XFxuICAgICAgICBoZWFkLmhlYWRlcnMucmVmZXJlciA9IHVybC5zcGxpdChcXFwiP1xcXCIpWzBdO1xcbiAgICAgICAgbGV0IGRhLCBodG1sLCBwYXRoLCBob3N0LCBrLCB1LCBfLFxcbiAgICAgICAgICAgIGlzVHAgPSAhdXJsLm1hdGNoKFxcXCIvdHAvXFxcIik7XFxuICAgICAgICBpZiAoaXNUcCAmJiAhbm9UcCkge1xcbiAgICAgICAgICAgIGRhID0gdXJsLnJlcGxhY2UoL14oLio/XFxcXC5jb20pLywgJyQxL3RwJyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGRhID0gdXJsO1xcbiAgICAgICAgfVxcbiAgICAgICAgaHRtbCA9IFN0cmluZyhIdG1sIHx8IGZldGNoKGRhLCBoZWFkKSk7XFxuICAgICAgICBpZiAoaHRtbCA9PSBcXFwiXFxcIiAmJiBpc1RwICYmICFub1RwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIG9uZV91cmwodXJsLCBwd2QsIHJ1biwgdHJ1ZSk7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHBhdGggPSBodG1sLm1hdGNoKC9saW5rID0gWydcXFwiXShbXlxcXCInXSspL2kpWzFdO1xcbiAgICAgICAgICAgIGhvc3QgPSB1cmwubWF0Y2goL14oLio/XFxcXC5jb21cXFxcLykvKVsxXTtcXG4gICAgICAgICAgICByZXR1cm4gb25lX3VybChob3N0ICsgcGF0aCwgcHdkLCBydW4pO1xcbiAgICAgICAgfSBjYXRjaCAoZXJyMCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHBhdGggPSBodG1sLm1hdGNoKC8nKFxcXFw/Lis/KScvKVsxXTtcXG4gICAgICAgICAgICAgICAgaG9zdCA9IFxcXCJodHRwczovL2RldmVsb3Blci5sYW56b3VnLmNvbVxcXCI7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZXJyMSkge1xcbiAgICAgICAgICAgICAgICBldmFsKGh0bWwubWF0Y2goL3ZhbHVlXFxcXDsoW1xcXFxzXFxcXFNdKz8pXFxcXCRcXFxcKC9pKVsxXSk7XFxuICAgICAgICAgICAgICAgIGV2YWwoJ2JvZHk9JyArIGh0bWwubWF0Y2goL1tcXFxcc1xcXFxTXSpkYXRhIDooW1xcXFxzXFxcXFNdKj9cXFxcfSksXFxcXHMrLylbMV0pO1xcbiAgICAgICAgICAgICAgICB1ID0gU3RyaW5nKHVybCkucmVwbGFjZSgvXFxcXC5jb20uKi8sIFxcXCIuY29tL2FqYXhtLnBocFxcXCIpO1xcbiAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShwb3N0KHUsIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWQuaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHlcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICBwYXRoID0gXy51cmw7XFxuICAgICAgICAgICAgICAgIGhvc3QgPSBfLmRvbTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICB1ID0gaG9zdCArIFxcXCIvZmlsZS9cXFwiICsgcGF0aDtcXG4gICAgICAgIGsgPSBKU09OLnBhcnNlKGZldGNoKHUsIHtcXG4gICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgIH0pKS5oZWFkZXJzLmxvY2F0aW9uO1xcbiAgICAgICAgayA9IEFycmF5LmlzQXJyYXkoaykgPyBrWzBdIDogaztcXG4gICAgICAgIGlmIChydW4pIHJldHVybiBrO1xcbiAgICAgICAgbGV0IGYgPSBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9fZmlsZVNlbGVjdF9ydWxlLmpzb25cXFwiO1xcbiAgICAgICAgZG93bmxvYWRGaWxlKGssIGYpO1xc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rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIubWRvJiZIdG1sXFxcIikucmVwbGFjZSgvKDxcXFxcL3NwYW4+KT9cXFxccyo8c3Bhbj4vZ2ksIFxcXCI8YnI+XFxcIiksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8Yj7igJzigJznoa7lrprmm7TmlrDigJ3igJ08L2I+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgodXJsLCBwd2QsIGl0ZW0sIGlzTG9vaykgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ1J1bGVfbm91cGRhdGUnKSA9PSAnMScgJiYgIWlzTG9vaykge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJhY2sodHJ1ZSksIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICAgICAgb25lX3VybFxcbiAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvbGFuem91P3J1bGU95q2M6K+N6YCC6YWNXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBLID0gb25lX3VybCh1cmwsIHB3ZCwgMSwgMCwgaXRlbSk7XFxuICAgICAgICAgICAgICAgIGlmICghSykge1xcbiAgICAgICAgICAgICAgICAgICAgSyA9IG9uZV91cmwodXJsLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghSykge1xcbiAgICAgICAgICAgICAgICAgICAgSyA9IG9uZV91cmwodXJsLnNwbGl0KFxcXCI/XFxcIilbMF0sIHB3ZCwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKEspIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvX2ZpbGVTZWxlY3RfcnVsZS5qc29uXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRmlsZShLLCBmKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiXFxcXHU2ZDc3XFxcXHU5NjE0XFxcXHU4OWM2XFxcXHU3NTRjXFxcXHVmZmU1aG9tZV9ydWxlX3VybFxcXFx1ZmZlNVxcXCIgKyBnZXRQYXRoKGYpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iOt+WPluS4i+i9vemTvuaOpeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCB1cmwsIHB3ZCwgaXRlbSwgISFpc0xvb2spLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1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AgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdiYWNrJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignYmFjaycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKCfliLfmlrBjb29raWUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgXyA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9xcScsIFtdKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmluZChfID0+IG1kNShfLnRpdGxlICsgXy51cmwpID09IFxcXCJlMmMxYTRiZjhkNThkMTcwM2E1ZTgxMDllMWY5MGNjMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICfmr4/kuIPlpKnpnIDopoHliLfmlrDkuIDmrKEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnY29va2llIOmcgOimgeWMheWQqyBxbV9rZXlzdCDlkowgdWluJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiA0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcigndmlwcnVsZV9jMCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IGBwdXRNeVZhcihcXFwidmlwcnVsZV9jMFxcXCIsIGlucHV0KTtgLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLku47op6PmnpDojrflj5ZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX3NlYXJjaDZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fMl9yb3VuZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb29raWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uc2lnbmluID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvQ29va2llOiBcXFwiKFteXFxcIl0rKS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMCcsIGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mraPlnKjosIPnlKjop6PmnpDlj4LmlbAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLlpb3lg4/ov5jmsqHliLDliLfmlrDml7bpl7TvvIznoa7lrprojrflj5blkJfvvJ9cXFwiKS5jb25maXJtKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWUgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF8uamlleGkpLm1hdGNoKC9Db29raWU6IFxcXCIoW15cXFwiXSspLylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMCcsIGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ato+WcqOiwg+eUqOino+aekOWPguaVsCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJUVHpn7PkuZDnmoTop6PmnpBcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnoa7lrprliLfmlrBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX21lbnU2XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvb2tpZSA9IFN0cmluZyhnZXRNeVZhcigndmlwcnVsZV9jMCcpKS50cmltKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llICYmIGNvb2tpZSAhPSBcXFwiXFxcIiAmJiBjb29raWUubWF0Y2goXFxcInFtX2tleXN0PVxcXCIpICYmIGNvb2tpZS5tYXRjaChcXFwidWluPVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVyaSA9ICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5yZWZyZXNoX2xvZ2luKGNvb2tpZSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkodXJpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKChbcW1fa2V5c3QsIHVpbl0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSBgcW1fa2V5c3Q9JHtxbV9rZXlzdH07IHVpbj0ke3Vpbn07YFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKCfliLfmlrDmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkID0gW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ2Nvb2tpZeWIt+aWsOaIkOWKnycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICc8YnI+PGg2IHN0eWxlPVxcXCJ0ZXh0LWFsaWduOiBjZW50ZXI7XFxcIj4nICsgY29va2llICsgXFxcIjwvaDY+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWkjeWItmNvb2tpZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKChjb29raWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdiYWNrJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrKHRydWUpLCBcXFwiY29weTovL1xcXCIgKyBjb29raWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGNvb2tpZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25fY2xvdWQ2XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5a+85YWl6L+b6Kej5p6QXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKGtleSwgdWluKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignYmFjaycsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMCcsIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMScsIHVpbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldEVkaXQyKFxcXCJxcVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBrZXksIHVpbiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25fZG93bmxvYWQ2XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL2Nvb2tpZeagvOW8j+mUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiAn5Yi35paw5oiQ5YqfJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdb6YW354uX5qaC5b+154mIXSDlkKzmrYzpoobkvJrlkZgnOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUoJ+WQrOatjOmihuS8muWRmCcpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IF8gPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3Rfa2cnLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAuZmluZChfID0+IG1kNShfLnRpdGxlICsgXy51cmwpID09IFxcXCJjODc3YWU3MmI5N2JjMjY3MjBhZDhiMWEzOTM2MmQ0N1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICfmr4/lpKnlj6rog73pooblj5bkuIDmrKEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfV07XFxuICAgICAgICAgICAgICAgICAgICBbJ3VzZXJpZCcsICd0b2tlbicsICdzaWdua2V5J10ubWFwKCh0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcigndmlwcnVsZV9jJyArIGkpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IGBwdXRNeVZhcihcXFwidmlwcnVsZV9jJHtpfVxcXCIsIGlucHV0KTtgLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLku47op6PmnpDojrflj5ZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25fc2VhcmNoNlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5zaWduaW4gPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtYXQgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF8uamlleGkpLm1hdGNoKC9cXFwiKFteXFxcIl0rKVxcXCIsIFxcXCIoLispXFxcIiwgXFxcIjMxMTZcXFwiLCBcXFwiKC4rKVxcXCIvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMCcsIG1hdFsxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzEnLCBtYXRbMl0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MyJywgbWF0WzNdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mraPlnKjosIPnlKjop6PmnpDlj4LmlbAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5LuK5aSp5aW95YOP5bey57uP562+5Yiw6L+H5LqG77yM56Gu5a6a6I635Y+W5ZCX77yfXFxcIikuY29uZmlybSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF0ID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvXFxcIihbXlxcXCJdKylcXFwiLCBcXFwiKC4rKVxcXCIsIFxcXCIzMTE2XFxcIiwgXFxcIiguKylcXFwiLyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MwJywgbWF0WzFdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzEnLCBtYXRbMl0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMicsIG1hdFszXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mraPlnKjosIPnlKjop6PmnpDlj4LmlbAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ5qaC5b+154mI55qE6Kej5p6QXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgXylcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuehruWumumihuWPllxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9tZW51NlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1c2VyaWQgPSBnZXRNeVZhcigndmlwcnVsZV9jMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9rZW4gPSBnZXRNeVZhcigndmlwcnVsZV9jMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2lnbmtleSA9IGdldE15VmFyKCd2aXBydWxlX2MyJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZDUoc2lnbmtleSkgPT0gXFxcIjc4YzYwYzM1ZTU5MGJlZThlMTRiYWU0NGJkZTUxMjc3XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHQxID0gJC5kYXRlRm9ybWF0KG5ldyBEYXRlKCkuZ2V0VGltZSgpLCAneXl5eU1NZGQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0MiA9ICQuZGF0ZUZvcm1hdChfLnRpbWUsICd5eXl5TU1kZCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1hdCA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL1xcXCIoW15cXFwiXSspXFxcIiwgXFxcIiguKylcXFwiLCBcXFwiMzExNlxcXCIsIFxcXCIoLispXFxcIi8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1hdHggPSB1c2VyaWQgPT0gbWF0WzFdICYmIHRva2VuID09IG1hdFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXR4ICYmIHQxIDwgdDIgJiYgXy5zaWduaW4gPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ku4rlpKnlt7Lnu4/nrb7liLDov4fkuoYnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLkxpdGVfU2lnbmluKFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaWdua2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXR4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9zaWdua2V56ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH0pXFxufSk7XFxuZC5wdXNoKHtcXG4gIC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KHR5cGUpID0+IHtcXG4gICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScsIHt9KSkucnVsZSk7XFxuICAgICAgICBsZXQgbGluZSA9ICgpID0+IGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgZCA9IFtdO1xcblxcblxcblxcbiAgICAgICAgbGluZSgpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPue9keermeaOqOiNkDwvYj4nLnNtYWxsKCksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjJyxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9ydWxlX3R5cGVfYXVkaW8nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPnNsaWRlci5rejwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICdodHRwczovL2hheXFiaGdyLnNsaWRlci5rei8jbm9IaXN0b3J5IycsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5p+g5LmQPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJ2h0dHA6Ly80My4xNDAuMjQ1LjI0MzoxMDgwL211c2ljLyNub0hpc3RvcnkjJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS8xMC5wbmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7lha3pn7M8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9mbGFjLmxpZmUvI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuaenOaguDwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICdodHRwczovL211c2ljLmdoeGkuY29tLyNub0hpc3RvcnkjJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS8xMC5wbmcnXFxuICAgICAgICB9KTtcXG5cXG5cXG5cXG4gICAgICAgIGxpbmUoKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj5MWCBNdXNpYzwvYj4nLnNtYWxsKCksXFxuICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9kb2NzLmx4bXVzaWMudG9wLyNub0hpc3RvcnkjJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2RvY3MubHhtdXNpYy50b3AvbG9nby5zdmcnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuWFremfszwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a6Lez6L2s572R5Z2AXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vd3d3LnNpeHlpbi5jb20vNzY0NS5odG1sXFxcIiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5qKT5r6EPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLngrnlh7vnoa7lrprot7PovaznvZHlnYBcXFxcbuaPkOWPluegge+8mmx4bXVzaWNcXFwiKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vd3dwLmxhbnpvdXEuY29tL2IwMmZxOXc4ZFxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPmlLdW48L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIueCueWHu+ehruWumuWkjeWItumTvuaOpVxcXFxuXFxcIiArIHVybCkuY29uZmlybSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH0sIFxcXCJodHRwczovL2x4bXVzaWMuaWt1bnNoYXJlLmNvbTo5NzYzL3NjcmlwdD9rZXk9aWt1bnNvdXJjZVxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuaMpeadr+WKnTwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vbWlycm9yLmdocHJveHkuY29tL2h0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9IdWlicS9rZWVwLWFsaXZlL21hc3Rlci9seG11c2ljYXBpLmpzXFxcIiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuXFxuXFxuXFxuICAgICAgICBsaW5lKCk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+TXVzaWNGcmVlPC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdodHRwczovL211c2ljZnJlZS51cHVwLmZ1bi8jbm9IaXN0b3J5IycsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9tdXNpY2ZyZWUudXB1cC5mdW4vaW1nL2xvZ28ucG5nJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7lrpjmlrk8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIueCueWHu+ehruWumuWkjeWItumTvuaOpVxcXFxuXFxcIiArIHVybCkuY29uZmlybSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH0sIFxcXCJodHRwczovL2dpdGVlLmNvbS9tYW90b3VtYW8vTXVzaWNGcmVlUGx1Z2lucy9yYXcvbWFzdGVyL3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuS9nOiAhTwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vZ2l0ZWUuY29tL1Rob21hc1lvdS9tdXNpY2ZyZWUvcmF3L21hc3Rlci9kaXN0L3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPumAn+aCpjwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHA6Ly9hZGFkMjN1LmFwcGluc3RhbGwubGlmZS9kaXN0L19wbHVnaW5zL3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuaMpeadr+WKnTwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vbWlycm9yLmdocHJveHkuY29tL2h0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9IdWlicS9rZWVwLWFsaXZlL21hc3Rlci9NdXNpY19GcmVlL215UGx1Z2lucy5qc29uXFxcIiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuXFxuXFxuXFxuXFxuICAgICAgICBsaW5lKCk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5pKt5pS+6Z+z6LSoPC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9pY29uX21lbnU2JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBwbGF5X3BsYXRmb3JtID0gZ2V0SXRlbSgncGxheV9wbGF0Zm9ybScsICcwJyk7XFxuICAgICAgICB0cy5zbGljZSgxLCA1KS5tYXAoKHRpdGxlLCBpKSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFN0cm9uZyh0aXRsZSksXFxuICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChpID09IHBsYXlfcGxhdGZvcm0gPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIFN0cmluZyhpKSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcblxcblxcblxcbiAgICAgICAgbGluZSgpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuW8ueeql+aPkOekujwvYj4nLnNtYWxsKCksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vNDEucG5nJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCB1MCA9IGdldEl0ZW0oJ3VwZGF0ZTAnLCAnMScpID09ICcxJztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7lsI/nqIvluo/mm7TmlrA8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1MCkgPT4ge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCd1cGRhdGUwJywgdTApO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgdTAgPyAnMCcgOiAnMScpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh1MCA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCB1MSA9IGdldEl0ZW0oJ3VwZGF0ZTEnLCAnMScpID09ICcxJztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mpoLlv7XniYjnrb7liLA8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1MSkgPT4ge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCd1cGRhdGUxJywgdTEpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgdTEgPyAnMCcgOiA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gICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSA9PSBzX3BsYXRmb3JtID8gUmljaChTdHJvbmcoQ29sb3IodGl0bGUpKSkgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzUnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCdzX3BsYXRmb3JtJywgdGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgdGl0bGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG5cXG5cXG5cXG4gICAgICAgIGxpbmUoKTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBwYWdlVGl0bGU6ICfnqIvluo/pu5jorqTphY3nva4nXFxuICAgIH1cXG59KTtcXG5sZXQgYXJyID0gW1xcXCJUR1jmlLbol49cXFwiLCBcXFwi6auY57qn5pCc57SiXFxcIiwgXFxcIuino+aekOeuoeeQhlxcXCIsIFxcXCLnqIvluo/pppbpobVcXFwiXTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiPlxcXCIgKyBcXFwi5Li76aG15YWD57SgPGJyPjxicj48c21hbGw+5L+d5a2Y5YWD57Sg5YiwXFxcXFxcXCLmiJHnmoTkuLvpobVcXFxcXFxcIjwvc21hbGw+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKSArIFxcXCI8L2I+XFxcIixcXG4gICAgY29sX3R5cGU6IFxcXCJjYXJkX3BpY18yXFxcIixcXG4gICAgdXJsOiAkKGFyciwgMSwgJ+m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jb29raWUnLCAn5by556qX5o+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