Advertisement
xiaomianao666

邀您一起看:MX影视-余生,请多指教

Jul 2nd, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥MX影视-余生,请多指教@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczpcXG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9jaGFwdGVyJywge30pKS5ydWxlKTtcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0olwiLFwicGF0aFwiOlwic2VhclwiLFwicnVsZVwiOlwidmFyIHJlcyA9IHt9O1xcbnZhciBpdGVtcyA9IFtdO1xcbi8v6K6+572u5pCc57Si57q/56iLXFxudmFyIHNzbW9kZSA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuc3Ntb2RlO1xcbnZhciBrZXkgPSBNWV9VUkwuc3BsaXQoJyQkJCcpWzFdO1xcbi8vc2V0RXJyb3IobGUpO1xcbmlmIChzc21vZGUgPT0gJzAnKSB7XFxuICAgIHNldFBhZ2VUaXRsZShrZXkgKyAnIOeahOaQnOe0oue7k+aenCcpXFxufTtcXG4vKnRyeSB7XFxuICAgIHZhciBhcHBmaWxlID0gZmV0Y2hDYWNoZSgnaHR0cHM6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ZGxpc3RbaV0udGl0bGUgKyBcXFwiIOmhueebruafpeeciyDigJzigJxcXFwiICsga2V5ICsgXFxcIuKAneKAnSDnmoTmkJzntKLnu5PmnpxcXFwiIDogXFxcIiDpgInmi6nkuIDkuKogXFxcIiArIGRsaXN0W2ldLnRpdGxlICsgXFxcIiDpobnnm67mn6XnnIsgXFxcIiArIGtleSArIFxcXCIg55qE5pCc57Si57uT5p6cXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmsgPSBsaXN0W2pdLnVybDtcXG4gICAgICAgICAgICB2YXIgbGl0aXQgPSBsaXN0W2pdLm11cmw7XFxuICAgICAgICAgICAgaWYgKC9cXFxcL3ZvZFxcXFwvLy50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgIGlmICgvMTlqeHwyOTN5c3x6aGFpa2FueXN8amlcXFxcLWRpbmdcXFxcLWhlfHBob2ViZXx5dW5ib1xcXFwuYnhpbnxsYW5yZW50a3xoZXRhb3lzfHB4dW58MTM5XFxcXC4xNTV8ZmtrZHl8MDU2MTU4fGFpeGl4aXxydW94aW5ld3xmZWlmYW4xMjN8c2lxaXR2Ly50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9hYz1saXN0JnptPScgKyBrZXkgKyAnJnBhZ2U9ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP2FjPWxpc3Qmd2Q9JyArIGtleSArICcmcGFnZT1meXBhZ2UnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKC9kaWppYXhpYS8udGVzdChsaW5rKSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGluayA9ICdodHRwOi8vd3d3LmRpamlheGlhLmNvbS9hcGkucGhwL2FwcC8nXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGlmIChsaW5rLmluZGV4T2YoJ2FwaS5waHAvYXBwLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz1meXBhZ2UmdGV4dD0nICsga2V5ICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmsuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz1meXBhZ2UmdGV4dD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9pb3Blbnl1bi8udGVzdChsaW5rKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnL2xpc3Q/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGxpc3Rbal0udGl0bGUsXFxuICAgICAgICAgICAgICAgIGltZzogbGlzdFtqXS5pbWcsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS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N0W2ldLm5leHRsaW5rO1xcbiAgICB2YXIgZGVzYyA9IGxpc3RbaV0uc3RhdGU7XFxuICAgIHVybCA9IHVybC5zdGFydHNXaXRoKCdodHRwJykgPyB1cmwgOiBtdXJsICsgJz9hYz1kZXRhaWwmaWRzPScgKyB1cmw7XFxuICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICB1cmw6ICQodXJsKS5ydWxlKCgpID0+IHtcXG4gICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XFxuICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxuICAgICAgICAgICAgdmFyIG15dXJsID0gTVlfVVJMLm1hdGNoKC8oW1xcXFxTXSo/OlxcXFwvXFxcXC9bXFxcXFNdKj8pXFxcXC8vKVsxXTtcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAnMjU1JiZmbG9hdCcsXFxuICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgcmVzLmRhdGEgPSBpdGVtcztcXG4gICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XFxuICAgICAgICB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LnNwbGl0KCcsJylbMF0ucmVwbGFjZSgnanNvbmJzJywgJycpO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLmluZGV4T2YoXFxcIj1cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICB2YXIgamllayA9IChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLnJlcGxhY2UoL1xcXFwuXFxcXC4vZywgXFxcIi5cXFwiKS5zcGxpdCgnLCcpWzBdO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBqaWVrID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vc2V0RXJyb3Ioamllayk7ICAgICAgICAgICAgICAgIFxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAvL2ppZWvmi7zmjqVcXG4gICAgaWYgKGppZWsgIT0gJycgJiYgamllayAhPSBudWxsKSB7XFxuICAgICAgICBpZiAoamllay5zdWJzdHJpbmcoMCwgNCkgPT0gJ2h0dHAnKSB7XFxuICAgICAgICAgICAgamllayA9IGppZWs7XFxuICAgICAgICB9IGVsc2UgaWYgKGppZWsuc3Vic3RyaW5nKDAsIDIpID09ICdcXFxcL1xcXFwvJykge1xcbiAgICAgICAgICAgIGppZWsgPSAnaHR0cHM6JyArIGppZWs7XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBqaWVrID0gXFxcIlxcXCI7XFxuICAgIH1cXG4gICAgLy/lr7nlpLHmlYjmjqXlj6Pov5vooYzmm7/mjaJcXG4gICAgaWYgKC9jb2tlbXYvLnRlc3QobXl1cmwpICYmIC9jb2tlcWllfHhpbnw5M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L3JyLnBocD91cmw9JztcXG4gICAgfSBlbHNlIGlmICgvbWlhb3BhcnR5Ly50ZXN0KHB0YWIpICYmIG15dXJsLnNlYXJjaCgvZnVuNGsvKSAhPSAtMSkge1xcbiAgICAgICAgamllayA9ICdodHRwczovL3d3dy5mdW40ay5jb20vYXBsYXllci8/dXJsPSc7XFxuICAgIH0gZWxzZSBpZiAoL2poeXVuXFxcXC5waHAvLnRlc3QoamllaykpIHtcXG4gICAgICAgIGppZWsgPSBqaWVrLnJlcGxhY2UoJ2h0dHA6Ly9zdmlwLmpoeXVuLmp4LmNuOjEyMzQvamh5dW4ucGhwP3VybD0nLCAnaHR0cHM6Ly9hcGkuamhkeXcudmlwLz91cmw9Jyk7XFxuICAgIH07XFxuICAgIC8v5omT5Y2w5o6l5Y+jXFxuICAgIHRyeSB7XFxuICAgICAgICBpZiAoaiA9PSAnMCcpIHtcXG4gICAgICAgICAgICBpZiAoaHRtbC5kYXRhLnZvZF91cmxfd2l0aF9wbGF5ZXIpIHtcXG4gICAgICAgICAgICAgICAgbG9nKCdcXFxcbue6v+i3r++8micgKyBwdGFiICsgJ1xcXFxu6KeG6aKR77yaJyArIHZsaW5rICsgJ1xcXFxuJyArICfop6PmnpDmjqXlj6PvvJpcXFxcbicgKyBqaWVrKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuZGF0YS52b2RfaW5mbyAmJiBodG1sLmRhdGEudm9kX2luZm8udm9kX3VybF93aXRoX3BsYXllcikge1xcbiAgICAgICAgICAgICAgICBsb2coJ1xcXFxu57q/6Lev77yaJyArIHB0YWIgKyAnXFxcXG7op4bpopHvvJonICsgdmxpbmsgKyAnXFxcXG4nICsgJ+ino+aekOaOpeWPo++8mlxcXFxuJyArIGppZWspO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UyICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UyKS5pbmRleE9mKFxcXCI9XFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZygnXFxcXG7nur/ot6/vvJonICsgcHRhYiArICdcXFxcbuinhumike+8micgKyB2bGluayArICdcXFxcbicgKyAn6Kej5p6Q5o6l5Y+j77yaXFxcXG4nICsgY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlMi5yZXBsYWNlKC9cXFxcLlxcXFwuL2csIFxcXCIuXFxcIikucmVwbGFjZSgvXFxcXCwvZywgXFxcIlxcXFxuXFxcXG5cXFwiKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLmluZGV4T2YoXFxcIj1cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdcXFxcbue6v+i3r++8micgKyBwdGFiICsgJ1xcXFxu6KeG6aKR77yaJyArIHZsaW5rICsgJ1xcXFxuJyArICfop6PmnpDmjqXlj6PvvJpcXFxcbicgKyBjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UucmVwbGFjZSgvXFxcXC5cXFxcLi9nLCBcXFwiLlxcXCIpLnJlcGxhY2UoL1xcXFwsL2csIFxcXCJcXFxcblxcXFxuXFxcIikpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdcXFxcbue6v+i3r++8micgKyBwdGFiICsgJ1xcXFxu6KeG6aKR77yaJyArIHZsaW5rICsgJ1xcXFxuJyArICfop6PmnpDmjqXlj6PvvJpcXFxcbicgKyBqaWVrKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL3NldEVycm9yKGppZWspOyAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgIC8v5aOw5piO6ZO+5o6lXFxuICAgIHZhciBsaW5rID0gamllayArIHZsaW5rO1xcbiAgICAvKlxcbiAgICBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvcy8udGVzdCh2bGluaykgJiYgL2h0dHAvLnRlc3QodmxpbmspKSB7XFxuICAgICAgICBsaW5rID0gdmxpbms7XFxuICAgIH1cXG4gICAgKi9cXG4gICAgLy9sb2cobGluayk7XFxuICAgIHRpdGxlID0gdGl0bGUubWF0Y2goLyjnrKx8XFxcXGR8LSkqKOmbhnzor5185pyfKS9nKSA/IHRpdGxlLnJlcGxhY2UoL+esrHzpm4Z86K+dfOacny9nLCAnJykgOiB0aXRsZTtcXG4gICAgaWYgKGxpc3QubGVuZ3RoIDw9IDQpIHtcXG4gICAgICAgIHZhciBjbHQgPSAndGV4dF8yJztcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHZhciBjbHQgPSBpc05hTih0aXRsZSkgPyAnZmxleF9idXR0b24nIDogJ3RleHRfNSdcXG4gICAgfTtcXG4gICAgaXRlbXMucHVzaCh7XFxuICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHknKS5sYXp5UnVsZSgocHRhYiwgbGluaywgbXl1cmwsIHZsaW5rKSA9PiB7XFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG9wZW51cmwocmVzdXJsKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzdXJsLm1hdGNoKC95b3VrdXxtZ3R2fGl4aWd1YXxxcS5jb218cWl5aXxtaWd1fGJpbGliaWxpfHNvaHV8cHB0dnxsZXwxOTA1LmNvbS8pICYmIHJlc3VybC5zZWFyY2goL2h0bWx8YmlsaWJpbGl8aXhpZ3VhLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2h0bWznvZHpobXosIPnlKjmlq3mj5Lop6PmnpBcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBjb25maWcgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UocmVzdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvc3xuZXRlYXNlXFxcXC5jb20vLnRlc3QocmVzdXJsKSAmJiAvaHR0cC8udGVzdChyZXN1cmwpICYmICEvXFxcXC5odG1sLy50ZXN0KHJlc3VybCkgJiYgIS9cXFxcPWh0dHAvLnRlc3QocmVzdXJsKSAmJiBwdGFiICE9ICdkdW9kdW96eScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3drZmlsZS8udGVzdChyZXN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL30nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcPS8udGVzdChyZXN1cmwpID8gcmVzdXJsLnNwbGl0KCc9JylbMV0gOiByZXN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/osIPnlKjmlq3mj5LpgJrnlKjlh73mlbDop6PmnpBcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5LpgJrnlKjlh73mlbDop6PmnpBcXFxcbicgKyBwdGFiICsgJyjpgJrnlKjlh73mlbApJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBjb25maWcgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gcHRhYiArICco6YCa55So5Ye95pWwKSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQYXJzZVNbbmFtZV0ocmVzdXJsLCBteXVybCk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdkdW9kdW96eScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gRGUod29yZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGEgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShtZDUoJ3JYald2WGw2JykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKCdOWGJIb1dKYnBzRU9pbjhiJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDcnlwdG9KUy5BRVMuZGVjcnlwdCh3b3JkLCBhLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXY6IHQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgZGR6eSA9ICdhZEh1Um8wZGN1SG9NMTYzTDF5NCcgKyBiYXNlNjRFbmNvZGUoc3JjdXJsKS5zbGljZSgxMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9iby5kZDUyMC5jYy94cGxheS9hcGkucGhwXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9iby5kZDUyMC5jYy94bXBsYXllci9hcGkucGhwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGR3eSA9IGZldGNoKCdodHRwczovL2pocGMubWFuZHVodS5jb20vZHVvZHVvL2FwaS5waHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiAndXJsPScgKyByZXN1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coZGR3eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBEZShKU09OLnBhcnNlKGRkd3kpLnVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvbWlhb3BhcnR5Ly50ZXN0KHB0YWIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZSgnaHR0cHM6Ly9jb2RlLmFsaXl1bi5jb20vbHprMjM1NTkvUHVibGljUnVsZS9yYXcvbWFzdGVyL3g1cnVsZS5qcycsIDI0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZSgnaHR0cHM6Ly93d3cuZnVuNGsuY29tL2FwbGF5ZXIvP3VybD0nICsgcmVzdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJyAmJiB2bGluay5tYXRjaCgveW91a3V8bWd0dnxpeGlndWF8cXEuY29tfHFpeWl8bWlndXxiaWxpYmlsaXxzb2h1fHBwdHZ8bGV8MTkwNS5jb20vKSAmJiB2bGluay5zZWFyY2goL2h0bWx8YmlsaWJpbGl8aXhpZ3VhLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+W3suW8gOWQr+aWreaPku+8jOWwhuiwg+eUqOaWreaPkuino+aekGh0bWwnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZSh2bGluayk7XFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgdmFyIHNyY3VybCA9IGxpbms7XFxuICAgICAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxuICAgICAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB5byA5aeLXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAvL+WkhOeQhuaMh+WumuinhumikeS4jue6v+i3r1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcLm0zdTh8XFxcXC5tcDR8b2JqXFxcXC90b3N8bmV0ZWFzZVxcXFwuY29tLy50ZXN0KHNyY3VybCkgJiYgL2h0dHAvLnRlc3Qoc3JjdXJsKSAmJiAhL1xcXFwuaHRtbC8udGVzdChzcmN1cmwpICYmICEvXFxcXD1odHRwLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3drZmlsZS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcmN1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL30nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcPS8udGVzdChzcmN1cmwpID8gc3JjdXJsLnNwbGl0KCc9JylbMV0gOiBzcmN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3JjdXJsLmluZGV4T2YoXFxcIi9zaGFyZS9cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXCIvc2hhcmVcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZjID0gZmV0Y2goc3JjdXJsLCB7fSkucmVwbGFjZShcXFwidmFyIHB1cmxcXFwiLCBcXFwidmFyIG1haW5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZjLmluZGV4T2YoXFxcIm1haW5cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdCA9IGZjLm1hdGNoKC92YXIgbWFpbi4qPzsvKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwobWF0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYWluID0gZmMubWF0Y2goL3VybDouKj9bXFxcXCdcXFxcXFxcIl0oLio/KVtcXFxcJ1xcXFxcXFwiXS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXkgPSAobWFpbi5pbmRleE9mKFxcXCJodHRwXFxcIikgIT0gLTEgPyBtYWluIDogbGluayArIG1haW4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC85ODN2aXAvLnRlc3Qoc3JjdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC94XFxcXC1uXFxcXC5jY3xuaGR6NjY2Ly50ZXN0KHNyY3VybCkgJiYgL1xcXFwuaHRtbHxiaWxpYmlsaS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgLy/lpITnkIbmjIflrprop4bpopHlkoznur/ot6/nu5PmnZ9cXG4gICAgICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb2RlID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIm9raHR0cC80LjEuMFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coc2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMicgfHwgc2NvZGUuc3RhdHVzQ29kZSA9PSAnMzAxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5omT5byA6Kej5p6Q5pyJMzAy6YeN5a6a5ZCR55qE6ZO+5o6lXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlZHVybCA9IHNjb2RlLmhlYWRlcnMubG9jYXRpb25bMF0ucmVwbGFjZSgvXFxcXFxcXFwvZywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXD1odHRwLy50ZXN0KHJlZHVybCkgJiYgL2h0bWx8YmlsaWJpbGl8a2V5XFxcXD0vLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw9aHR0cC8udGVzdChyZWR1cmwpICYmIC9cXFxcLm0zdTh8XFxcXC5tcDR8XFxcXC5mbHYvLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVkdXJsLnN1YnN0cmluZyhyZWR1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL2h0dHAvLnRlc3QocmVkdXJsKSAmJiAva2V5XFxcXD18dWlkXFxcXD0vLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWR1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGh0bWwgPSByZXF1ZXN0KHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBzY29kZS5ib2R5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl64vLnRlc3QoaHRtbCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw8Ym9keS8udGVzdChodG1sKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+WwneivlemdnkpTT07mjqXlj6PnvZHpobXop6PmnpAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZUNhY2hlKCdodHRwczovL2NvZGUuYWxpeXVuLmNvbS9semsyMzU1OS9QdWJsaWNSdWxlL3Jhdy9tYXN0ZXIveDVydWxlLmpzJywgMjQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geDVydWxlKHNyY3VybCwgc3JjdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gb3BlbnVybChzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vanNvbuino+aekOeahOWPlumTvuaOpVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IGh0bWwubWF0Y2goL1tcXFxcJ1xcXFxcXFwiXXVybFtcXFxcJ1xcXFxcXFwiXTouKj9bXFxcXCdcXFxcXFxcIl0oLio/KVtcXFxcJ1xcXFxcXFwiXS8pWzFdLnJlcGxhY2UoL1xcXFxcXFxcL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2cocHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvaHR0cC8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gJ2JpbGliaWxpJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJzt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHB0YWIgPT0gJ21ndHYnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29qYmsvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICc7e1JlZmVyZXJAaHR0cHM6Ly9iYWsub2pia2p4LmNvbS99JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZXNjYXBlKHB1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/pnZ5odHRw5byA5aS055qE5omT5byA5Y6f6ZO+5o6lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8v5oql6ZSZ5Yik5pat5aSE55CGXFxuICAgICAgICAgICAgICAgICAgICBsb2coJ+aJp+ihjOaKpemUmei3s+i9rOWkhOeQhicpO1xcbiAgICAgICAgICAgICAgICAgICAgLyppZiAoc3JjdXJsLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXC9cXFxcLycpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCgnaHR0cHM6JyArIHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcPWh0dHAvLnRlc3Qoc3JjdXJsKSAmJiAvXFxcXC5odG1sfGJpbGliaWxpLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBzcmN1cmwuc3BsaXQoJz0nKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybChzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsqL1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspXFxuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAneDVXZWJWaWV3Oi8vJytzcmN1cmxcXG4gICAgICAgICAgIC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KSAmJiByZXN1cmwuc2VhcmNoKC9odG1sfGJpbGliaWxpLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVuRG4gPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShyZXN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcPUxUXFxcXC0vLnRlc3QocmVzdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5JsdG5i6YCa55So6Kej5p6QJyk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gJ2x0bmIo6YCa55So5Ye95pWwKSc7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFyc2VTW25hbWVdKHJlc3VybC5zdWJzdHJpbmcocmVzdXJsLmluZGV4T2YoJz1MVC0nKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdmFyIGVuRG4gPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL3h5cS9hcHBtc2V0Lmpzb24nLCB7fSkpLmVuRG47XFxuICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJyAmJiBzcmN1cmwubWF0Y2goL3lvdWt1fG1ndHZ8aXhpZ3VhfHFxLmNvbXxxaXlpfG1pZ3V8YmlsaWJpbGl8c29odXxwcHR2fGxlfDE5MDUuY29tLykgJiYgc3JjdXJsLnNlYXJjaCgvaHRtbHxiaWxpYmlsaXxpeGlndWEvKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2Uoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxuICAgICAgICAgICAgLy/liqjmgIHop6PmnpDku6PnoIHlvIDlp4tcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvcy8udGVzdChzcmN1cmwpICYmIC9odHRwLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAvXFxcXD0vLnRlc3Qoc3JjdXJsKSA/IHNyY3VybC5zcGxpdCgnPScpWzFdIDogc3JjdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzcmN1cmwuaW5kZXhPZihcXFwiL3NoYXJlL1xcXCIpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXCIvc2hhcmVcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmMgPSBmZXRjaChzcmN1cmwsIHt9KS5yZXBsYWNlKFxcXCJ2YXIgcHVybFxcXCIsIFxcXCJ2YXIgbWFpblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYy5pbmRleE9mKFxcXCJtYWluXFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdCA9IGZjLm1hdGNoKC92YXIgbWFpbi4qPzsvKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChtYXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGxheSA9IChtYWluLmluZGV4T2YoXFxcImh0dHBcXFwiKSAhPSAtMSA/IG1haW4gOiBsaW5rICsgbWFpbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1haW4gPSBmYy5tYXRjaCgvdXJsOi4qP1tcXFxcJ1xcXFxcXFwiXSguKj8pW1xcXFwnXFxcXFxcXCJdLylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXk7XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdhbGl6eScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gZmV0Y2goJ2h0dHBzOi8vZm91YmluLmNvbS9qaWV4aS5waHA/dXJsPScgKyBzcmN1cmwsIHt9KS5tYXRjaCgvXFxcXFxcXCJ1cmxcXFxcXFxcIjpcXFxcXFxcIiguKj8pXFxcXFxcXCIvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC8xOWp4XFxcXC52aXB8bmZ5aW5nc2hpLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwucmVwbGFjZSgnaHR0cDovLycsICdodHRwczovLycpLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvdGl0YW4ubWd0di8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9vYmpcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLyplbHNlIGlmICgvemhhaWthbnlzLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IEpTT04ucGFyc2UoZmV0Y2goc3JjdXJsICsgJyZhcHA9MTAwMDMmYWNjb3VudD0yNzI3NzUwMjgmcGFzc3dvcmQ9cXEyNzI3NzUwMjgnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3RpdGFuLm1ndHYvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9vYmpcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcbiAgICAgICAgICAgICAgICB2YXIgc2NvZGUgPSBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhzY29kZSk7XFxuICAgICAgICAgICAgICAgIGlmIChzY29kZS5zdGF0dXNDb2RlID09ICczMDInIHx8IHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gc2NvZGUuaGVhZGVycy5sb2NhdGlvblswXS5yZXBsYWNlKC9cXFxcXFxcXC9nLCAnJyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBodG1sID0gcmVxdWVzdChzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBzY29kZS5ib2R5O1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoLzQwNCBOb3QgRm91bmR85aSH5qGI5ZCO5Y+v57un57ut6K6/6ZeufOS4jeWtmOWcqC8udGVzdChodG1sKSB8fCBodG1sID09ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFxcXFwidXJsXFxcXFxcXCJcXFxcOlxcXFxcXFwiaHR0cC8udGVzdChodG1sKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gaHRtbC5tYXRjaCgvXFxcXFxcXCJ1cmxcXFxcXFxcIjpcXFxcXFxcIiguKj8pXFxcXFxcXCIvKVsxXS5yZXBsYWNlKC9cXFxcXFxcXC9nLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuc3RhcnRzV2l0aCgneycpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHB1cmwgPSBzcmN1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlQ2FjaGUoJ2h0dHBzOi8vY29kZS5hbGl5dW4uY29tL2x6azIzNTU5L1B1YmxpY1J1bGUvcmF3L21hc3Rlci94NXJ1bGUuanMnLCAyNCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZShzcmN1cmwsIHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ3g1V2ViVmlldzovLycrKHNyY3VybCkgXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIC8vbG9nKHB1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoL3RpdGFuLm1ndHYvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29ialxcXFwvdG9zLy50ZXN0KHB1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcbiAgICAgICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHNyY3VybC5zdWJzdHJpbmcoMCwgMikgPT0gJ1xcXFwvXFxcXC8nKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCgnaHR0cHM6JyArIHNyY3VybCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw9aHR0cC8udGVzdChzcmN1cmwpICYmIC9cXFxcLmh0bWx8YmlsaWJpbGkvLnRlc3Qoc3JjdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gc3JjdXJsLnNwbGl0KCc9JylbMV07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybChzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB57uT5p2fXFxuICAgICAgICB9LCBwdGFiLCBzcmN1cmwsIG15dXJsKSxcXG4gICAgICAgIGNvbF90eXBlOiBjbHRcXG4gICAgfSk7XFxufVxcbi8vfVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5YiX6KGo5qih5byP5pCc57Si5LqM57qnXCIsXCJwYXRoXCI6XCJzZWFyZXJqXCIsXCJydWxlXCI6XCJ2YXIgcmVzID0ge307XFxudmFyIGl0ZW1zID0gW107XFxudmFyIG5vd0RhdGUgPSBuZXcgRGF0ZSgpO1xcbnZhciBtb250aCA9IG5vd0RhdGUuZ2V0TW9udGgoKSArIDEgPC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pc3RbaV0uc3RhdGU7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHRkb21pbi5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2ZhbnR1YW4vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWxJRD92b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWw/a2V5PScgKyBkYXRlU3RyICsgJyZ2b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZShrZXksICfigJzigJwnICsga2V5ICsgJ+KAneKAnScpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBwaWMgKyAnQFJlZmVyZXI9JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKHRkb21pbi5pbmRleE9mKFxcXCJtb2dhaV9hcGlcXFwiKSAhPSAtMSA/IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JyA6IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QG9raHR0cC80LjEuMH0nKS5ydWxlKCh0ZG9taW4pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZSdcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbXl1cmwgPSBNWV9VUkwubWF0Y2goLyhbXFxcXFNdKj86XFxcXC9cXFxcL1tcXFxcU10qPylcXFxcLy8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcL3ZvZFxcXFwvLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICA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yAnL2RldGFpbElEP3ZvZF9pZD0nICsgdXJsICsgJyZyZWxfbGltaXQ9MTA7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JztcXG4gICAgICAgIH0gZWxzZSBpZiAoL2RpamlheGlhLy50ZXN0KG11cmwpKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmsgPSAnaHR0cDovL3d3dy5kaWppYXhpYS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyB1cmw7XFxuICAgICAgICB9XFxuICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgdXJsOiAkKGxpbmspLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShnZXRSZXNDb2RlKCkpO1xcbiAgICAgICAgICAgICAgICB2YXIgbXl1cmwgPSBNWV9VUkwubWF0Y2goLyhbXFxcXFNdKj86XFxcXC9cXFxcL1tcXFxcU10qPylcXFxcLy8pWzFdO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICA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AgIHJlbWYgPSAnJztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICgv77+lYmFzZTY0Ly50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgdmFyIHJlbXYgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZShyZW1mLnNwbGl0KCdAJylbMl0pKS52ZXJzaW9uO1xcbiAgICAgICAgfSBlbHNlIGlmICgv77+laG9tZV9ydWxl77+lLy50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgdmFyIHJlbXYgPSBKU09OLnBhcnNlKHJlbWYuc3BsaXQoJ++/pWhvbWVfcnVsZe+/pScpWzFdKS52ZXJzaW9uO1xcbiAgICAgICAgfTtcXG4gICAgICAgIGlmICgv77+laG9tZV9ydWxlLy50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgbG9nKCfov5znqIvniYjmnKzvvJonICsgcmVtdik7XFxuICAgICAgICAgICAgbG9nKCfmnKzlnLDniYjmnKzvvJonICsgbG9jdmVyKTtcXG4gICAgICAgICAgICBpZiAobG9jdmVyICE9IHJlbXYpIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdhcHBudmVyJywgcmVtZik7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mnInmlrDniYjmnKzvvIzngrnlr7zlhaXmm7TmlrDlj6/mm7TmlrDop4TliJnjgIInO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mmoLml6DmlrDniYjmnKzvvIwyNOWwj+aXtuWGheajgOa1i+aXoOaViOOAgidcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5qOA5rWL5pu05paw5aSx6LSl77yM5Y+v6IO95LqR56uv5oq96aOO5LqG44CCJ1xcbiAgICAgICAgfVxcbiA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XRoX3BsYXllcjtcXG4gICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX2luZm8udm9kX3BsYXlfdXJsLnNwbGl0KCckJCQnKTtcXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHZhciBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV9saXN0O1xcbiAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV91cmwuc3BsaXQoJyQkJCcpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29udHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGlmIChodG1sLnZpZGVvbGlzdCkge1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC52aWRlb2xpc3RbY29udHNbaV1dO1xcbiAgICAgICAgfSBlbHNlIGlmIChjb250c1tpXS51cmxzKSB7XFxuICAgICAgICAgICAgdmFyIGxpc3QgPSBjb250c1tpXS51cmxzO1xcbiAgICAgICAgfSBlbHNlIGlmIChjb250c1tpXS51cmwpIHtcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGNvbnRzW2ldLnVybC5zcGxpdChcXFwiI1xcXCIpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGNvbnRzW2ldLnNwbGl0KFxcXCIjXFxcIik7XFxuICAgICAgICB9XFxuICAgICAgICBjaHAucHVzaChsaXN0Lmxlbmd0aCk7XFxuICAgIH1cXG59IGNhdGNoIChlKSB7fVxcbi8vbG9nKE1hdGgubWF4LmFwcGx5KE1hdGgsY2hwKSk7XFxuc2V0UmVzdWx0KCfmm7TmlrDoh7M6JyArIChNYXRoLm1heC5hcHBseShNYXRoLCBjaHApKSk7XCJ9LHtcImNvbF90eXBl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YzsgaiA8IGxlOyBqKyspIHtcXG4gICAgICAgIGlmIChqIDwgbGlzdC5sZW5ndGgpIHtcXG4gICAgICAgICAgICB2YXIgbGluayA9IGxpc3Rbal0udXJsO1xcbiAgICAgICAgICAgIHZhciBsaXRpdCA9IGxpc3Rbal0ubXVybDtcXG4gICAgICAgICAgICBpZiAoL1xcXFwvdm9kXFxcXC8vaS50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgIGlmICgvMTlqeHwyOTN5c3x6aGFpa2FueXN8amlcXFxcLWRpbmdcXFxcLWhlfHBob2ViZXx5dW5ib1xcXFwuYnhpbnxsYW5yZW50a3xoZXRhb3lzfHB4dW58MTM5XFxcXC4xNTV8ZmtrZHl8MDU2MTU4fGFpeGl4aXxydW94aW5ld3xmZWlmYW4xMjN8c2lxaXR2Ly50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9hYz1saXN0JnptPScgKyBrZXkgKyAnJnBhZ2U9MSc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9hYz1saXN0JndkPScgKyBrZXkgKyAnJnBhZ2U9MSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoL2RpamlheGlhLy50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5rID0gJ2h0dHA6Ly93d3cuZGlqaWF4aWEuY29tL2FwaS5waHAvYXBwLydcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgaWYgKGxpbmsuaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPTEmdGV4dD0nICsga2V5ICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmsuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz0xJnRleHQ9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvaW9wZW55dW4vLnRlc3QobGluaykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJy9saXN0P3BhZ2U9ZnlwYWdlJmxpbWl0PTEwJndkPScgKyBrZXk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP3BhZ2U9MSZsaW1pdD0xMCZ3ZD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vRGF0YS5wdXNoKHt1cmw6IGhtdXJsLG9wdGlvbnM6IHtoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiRGFydC8yLjE0IChkYXJ0OmlvKVxcXCJ9LHRpbWVvdXQ6IHRpbWVvdX19KTtcXG4gICAgICAgICAgICBEYXRhLnB1c2goe1xcbiAgICAgICAgICAgICAgICB1cmw6IGhtdXJsLFxcbiAgICAgICAgICAgICAgICBvcHRpb25zOiB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBsaW5rLmluZGV4T2YoXFxcIm1vZ2FpX2FwaVxcXCIpICE9IC0xID8gXFxcIkRhcnQvMi4xNCAoZGFydDppbylcXFwiIDogXFxcIm9raHR0cC80LjEuMFxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiB0aW1lb3VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIFRpdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0OiBsaXN0W2pdLnRpdGxlLFxcbiAgICAgICAgICAgICAgICBsaW5rOiBsaW5rLFxcbiAgICAgICAgICAgICAgICB0eXBubTogbGl0aXRcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gLy9pZlxcbiAgICB9IC8vZm9yIGpcXG59IGNhdGNoIChlKSB7fVxcbmlmIChEYXRhLmxlbmd0aCA8PSAwKSB7XFxuICAgIHNldFJlc3VsdChbXSk7XFxufSBlbHNlIHtcXG4gICAgaXRlbXMucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuato+WcqOWKoOi9veS4reesrFxcXCIgKyBNWV9QQUdFICsgXFxcIumhte+8jOi/m+W6pu+8mjEvXFxcIiArIERhdGEubGVuZ3RoLFxcbiAgICAgICAgdXJsOiBcXFwiXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBzZXRSZXN1bHQoaXRlbXMpO1xcbiAgICBsZXQgdGFza3MgPSBbXTtcXG5cXG4gICAgZm9yIChsZXQgayBpbiBEYXRhKSB7XFxuICAgICAgICBsZXQgaXQgPSBEYXRhW2tdO1xcbiAgICAgICAgdGFza3MucHVzaCh7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0pIHtcXG4gICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaChwYXJhbS5pdC51cmwsIHBhcmFtLml0Lm9wdGlvbnMpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhodG1sKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBodG1sLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXHJcXFxcbicgPyBodG1sLnJlcGxhY2UoJ1xcXFxyXFxcXG4nLCAnJykgOiBodG1sO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICBpZiAoL2J0d2FmLy50ZXN0KGh0bWwpKSB7XFxuICAgICAgICAgICAgICAgICAgICBodG1sID0gZmV0Y2gocGFyYW0uaXQudXJsICsgJyZidHdhZicgKyBodG1sLm1hdGNoKC9idHdhZiguKj8pXFxcXFxcXCIvKVsxXSwge30pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChodG1sID09IFxcXCJcXFwiIHx8IGh0bWwgPT0gbnVsbCB8fCBodG1sLnN1YnN0cmluZygwLCA1KSA9PSAnZXJyb3InIHx8ICFodG1sLnN0YXJ0c1dpdGgoJ3snKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5sZW5ndGggPCA4MCkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBKU09OLnBhcnNlKGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdHlwZXQgPSBwYXJhbS50aXQudHlwbm07XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGRvbWluID0gcGFyYW0udGl0Lmxpbms7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaHRtbC5saXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuZGF0YS5saXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmRhdGEubGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5kYXRhKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFwvdm9kXFxcXC8vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnBpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSBsaXN0W2ldLm5leHRsaW5rO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0uc3RhdGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGRvbWluLmluZGV4T2YoJ2FwaS5waHAvYXBwLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvZmFudHVhbi8udGVzdCh0ZG9taW4pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJ3ZpZGVvX2RldGFpbD9pZD0nICsgbGlzdFtpXS52b2RfaWQgKyAnJnRva2VuPSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnR5cGUudHlwZV9kZXM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnZvZF9uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnR5cGUudHlwZV9kZXM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0udm9kX3BpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvZGV0YWlsSUQ/dm9kX2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWw/a2V5PScgKyBkYXRlU3RyICsgJyZ2b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVtID0gbGlzdFtpXS52b2RfcmVtYXJrcztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnN0YXRlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh2aWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IE1ZX1RZUEUgPT0gXFxcImhvbWVcXFwiID8gdGl0bGUucmVwbGFjZShrZXksICfigJzigJwnICsga2V5ICsgJ+KAneKAnScpICsgJ1xcXFxuJyArIHJlbSA6IHRpdGxlICsgcmVtLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogcGljICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodGRvbWluLmluZGV4T2YoXFxcIm1vZ2FpX2FwaVxcXCIpICE9IC0xID8gdmlkICsgJztnZXQ7dXRmLTg7e1VzZXItQWdlbnRARGFydC8yLjE0IChkYXJ0OmlvKX0nIDogdmlkICsgJztnZXQ7dXRmLTg7e1VzZXItQWdlbnRAb2todHRwLzQuMS4wfScpLnJ1bGUoKHRkb21pbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UoZ2V0UmVzQ29kZSgpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnMjU1JiZmbG9hdCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG15dXJsID0gTVlfVVJMLm1hdGNoKC8oW1xcXFxTXSo/OlxcXFwvXFxcXC9bXFxcXFNdKj8pXFxcXC8vKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFwvdm9kXFxcXC8vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2FwcG1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sdGRvbWluKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29udGVudDogcmVtLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogdHl0aXQgKyAnID0+ICcgKyBwYXJhbS50aXQudGl0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSAvL2ZvciBpXFxuICAgICAgICAgICAgICAgICAgICB9IC8vaWYgbGlzdC5sZW5ndGhcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBpdDogaXQsXFxuICAgICAgICAgICAgICAgIHRpdDogVGl0W2tdXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBpZDogXFxcInRhc2tcXFwiXFxuICAgICAgICB9KVxcbiAgICB9XFxuXFxuICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgLy9sb2coXFxcImxpc3RlbmVyOiBcXFwiICsgKHJlc3VsdCB8fCBbXSkubGVuZ3RoKVxcbiAgICAgICAgICAgIHBhcmFtLmkgPSBwYXJhbS5pICsgMTtcXG4gICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgcGFyYW0uaiA9IHBhcmFtLmogKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmpcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5q2j5Zyo5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG177yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICBhbGw6IERhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgIGk6IDAsXFxuICAgICAgICAgICAgajogLTFcXG4gICAgICAgIH1cXG4gICAgfSlcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmlbDmja7ovazmjaJcIixcInBhdGhcIjpcImNvbnZlclwiLFwicnVsZVwiOlwiLy9qczpcXG4vL3JlbShyZXMpO1xcbnZhciDorrDlvZUgPSBbXTtcXG52YXIg6L6T5YWl5p2h55uuID0gcmVtZmlsZS5tYXRjaCgvLis9aHR0cC4rL2cpO1xcbmZvciAodmFyIGogaW4g6L6T5YWl5p2h55uuKSB7XFxuICAgIHZhciB0aXRsZSA9IOi+k+WFpeadoeebrltqXS5zcGxpdCgnQCcpWzFdLnNwbGl0KCc9JylbMF07XFxuICAgIHZhciB1cmwgPSDovpPlhaXmnaHnm65bal0uc3BsaXQoJz0nKVsxXS5zcGxpdCgnIycpWzBdO1xcbiAgICB2YXIgaW1nID0g6L6T5YWl5p2h55uuW2pdLnNwbGl0KCcjJylbMV07XFxuICAgIGlmIChpbWcuaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xKSB7XFxuICAgICAgICB2YXIgaW1nID0gaW1nO1xcbiAgICB9IGVsc2UgaWYgKGltZyA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgdmFyIGltZyA9IFxcXCJodHRwczovL2lubWVtb3J5LmNvZGluZy5uZXQvcC9Jbk1lbW9yeS9kL01Ccm93c2VyL2dp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sXFxcIjtcXG4gICAgfVxcbiAgICDorrDlvZUucHVzaCh7XFxuICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgbXVybDogbXVybCxcXG4gICAgICAgIHR5cGU6IHR5cGVcXG4gICAgfSk7XFxufVxcbi8vaWYgKF8ucmVhZChmaWxlbmFtZSkpIHtcXG4vL3ZhciDmlrDorrDlvZUgPSBKU09OLnBhcnNlKF8ucmVhZChmaWxlbmFtZSkpO1xcbi8vfSBlbHNlIHtcXG52YXIg5paw6K6w5b2VID0gW107XFxuLy99XFxuZm9yICh2YXIgaSBpbiDorrDlvZUpIHtcXG4gICAgdmFyIOW9k+WJjeadoeebriA9IFtdO1xcbiAgICDlvZPliY3mnaHnm64ucHVzaCjorrDlvZVbaV0pO1xcbiAgICBpZiAo5paw6K6w5b2VLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICDmlrDorrDlvZUucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IOiusOW9lVtpXS50eXBlLFxcbiAgICAgICAgICAgIGxpc3Q6IOW9k+WJjeadoeebrlxcbiAgICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgIGxldCByZXMgPSDmlrDorrDlvZUuc29tZShpdGVtID0+IHtcXG4gICAgICAgIC8v5Yik5pat57G75Z6L77yM5pyJ5bCx5re75Yqg5Yiw5b2T5YmN6aG5XFxuICAgICAgICBpZiAoaXRlbS50aXRsZSA9PSDorrDlvZVbaV0udHlwZSkge1xcbiAgICAgICAgICAgIGl0ZW0ubGlzdCA9IOW9k+WJjeadoeebri5jb25jYXQoaXRlbS5saXN0LmZpbHRlcihkID0+IGQudXJsICE9IOiusOW9lVtpXS51cmwpKTtcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgaWYgKCFyZXMpIHtcXG4gICAgICAgIC8v5aaC5p6c5rKh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Skge1xcXFxuICAgICAgICAgICAgICAgICAgICBsaW5rID0gJ2h0dHA6Ly93d3cuZGlqaWF4aWEuY29tL2FwaS5waHAvYXBwLydcXFxcbiAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgIGlmIChsaW5rLmluZGV4T2YoJ2FwaS5waHAvYXBwLycpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPWZ5cGFnZSZ0ZXh0PScgKyBrZXkgKyAnJnRva2VuPSc7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5rLmluZGV4T2YoJ3hnYXBwLnBocC92MS8nKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz1meXBhZ2UmdGV4dD0nICsga2V5O1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvaW9wZW55dW4vLnRlc3QobGluaykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnL2xpc3Q/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP3BhZ2U9ZnlwYWdlJmxpbWl0PTEwJndkPScgKyBrZXk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbGlzdFtqXS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGxpc3Rbal0uaW1nLFxcXFxuICAgICAgICAgIC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AgICBpdGVtcy5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICBwaWNfdXJsOiBpbWcgKyAnQFJlZmVyZXI9JyxcXFxcbiAgICAgICAgdXJsOiAkKGxpbmspLnJ1bGUoKCkgPT4ge1xcXFxuICAgICAgICAgICAgdmFyIHJlcyA9IHt9O1xcXFxuICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XFxcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJycsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZSdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxcXG4gICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UoZ2V0UmVzQ29kZSgpKTtcXFxcbiAgICAgICAgICAgIHZhciBteXVybCA9IE1ZX1VSTC5tYXRjaCgvKFtcXFxcXFxcXFNdKj86XFxcXFxcXFwvXFxcXFxcXFwvW1xcXFxcXFxcU10qPylcXFxcXFxcXC8vKVsxXTtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvYXBwbW92bGlzdCcsIHt9KSkucnVsZSk7XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgcmVzLmRhdGEgPSBpdGVtcztcXFxcbiAgICAgICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTtcXFxcbiAgICAgICAgfSksXFxcXG4gICAgICAgIGRlc2M6IGRlc2MsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnbW92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1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UgJiYgKGNvbnRzW2dldE15VmFyKHRpdGxlLCAnMCcpXS5wbGF5ZXJfaW5mby5wYXJzZSkuaW5kZXhPZihcXFxcXFxcIj1cXFxcXFxcIikgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgamllayA9IChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLnJlcGxhY2UoL1xcXFxcXFxcLlxcXFxcXFxcLi9nLCBcXFxcXFxcIi5cXFxcXFxcIikuc3BsaXQoJywnKVswXTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGppZWsgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgLy9zZXRFcnJvcihqaWVrKTsgICAgICAgICAgICAgICAgXFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgIC8vamlla+aLvOaOpVxcXFxuICAgIGlmIChqaWVrICE9ICcnICYmIGppZWsgIT0gbnVsbCkge1xcXFxuICAgICAgICBpZiAoamllay5zdWJzdHJpbmcoMCwgNCkgPT0gJ2h0dHAnKSB7XFxcXG4gICAgICAgICAgICBqaWVrID0gamllaztcXFxcbiAgICAgICAgfSBlbHNlIGlmIChqaWVrLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXFxcXFwvXFxcXFxcXFwvJykge1xcXFxuICAgICAgICAgICAgamllayA9ICdodHRwczonICsgamllaztcXFxcbiAgICAgICAgfVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIGppZWsgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgIH1cXFxcbiAgICAvL+WvueWkseaViOaOpeWPo+i/m+ihjOabv+aNolxcXFxuICAgIGlmICgvY29rZW12Ly50ZXN0KG15dXJs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LCAnMCcpXS5wbGF5ZXJfaW5mby5wYXJzZS5yZXBsYWNlKC9cXFxcXFxcXC5cXFxcXFxcXC4vZywgXFxcXFxcXCIuXFxcXFxcXCIpLnJlcGxhY2UoL1xcXFxcXFxcLC9nLCBcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFxcblxcXFxcXFwiKSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdcXFxcXFxcXG7nur/ot6/vvJonICsgcHRhYiArICdcXFxcXFxcXG7op4bpopHvvJonICsgdmxpbmsgKyAnXFxcXFxcXFxuJyArICfop6PmnpDmjqXlj6PvvJpcXFxcXFxcXG4nICsgamllayk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIC8vc2V0RXJyb3Ioamllayk7ICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAvL+WjsOaYjumTvuaOpVxcXFxuICAgIHZhciBsaW5rID0gamllayArIHZsaW5rO1xcXFxuICAgIC8qXFxcXG4gICAgaWYgKC9cXFxcXFxcXC5tM3U4fFxcXFxcXFxcLm1wNHxvYmpcXFxcXFxcXC90b3MvLnRlc3QodmxpbmspICYmIC9odHRwLy50ZXN0KHZsaW5rKSkge1xcXFxuICAgICAgICBsaW5rID0gdmxpbms7XFxcXG4gICAgfVxcXFxuICAgICovXFxcXG4gICAgLy9sb2cobGluayk7XFxcXG4gICAgdGl0bGUgPSB0aXRsZS5tYXRjaCgvKOesrHxcXFxcXFxcXGR8LSkqKOmbhnzor5185pyfKS9nKSA/IHRpdGxlLnJlcGxhY2UoL+esrHzpm4Z86K+dfOacny9nLCAnJykgOiB0aXRsZTtcXFxcbiAgICBpZiAobGlzdC5sZW5ndGggPD0gNCkge1xcXFxuICAgICAgICB2YXIgY2x0ID0gJ3RleHRfMic7XFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgdmFyIGNsdCA9IGlzTmFOKHRpdGxlKSA/ICdmbGV4X2J1dHRvbicgOiAndGV4dF81J1xcXFxuICAgIH07XFxcXG4gICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5JykubGF6eVJ1bGUoKHB0YWIsIGxpbmssIG15dXJsLCB2bGluaykgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG9wZW51cmwocmVzdXJsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1cmwubWF0Y2goL3lvdWt1fG1ndHZ8aXhpZ3VhfHFxLmNvbXxxaXlpfG1pZ3V8YmlsaWJpbGl8c29odXxwcHR2fGxlfDE5MDUuY29tLykgJiYgcmVzdXJsLnNlYXJjaCgvaHRtbHxiaWxpYmlsaXxpeGlndWEvKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9odG1s572R6aG16LCD55So5pat5o+S6Kej5p6QXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygn6LCD55So5pat5o+S6Kej5p6QaHRtbCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcXFxcXCJ2YXIgY29uZmlnID1cXFxcXFxcIiArIGZldGNoKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShyZXN1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcXFxcXC5tM3U4fFxcXFxcXFxcLm1wNHxvYmpcXFxcXFxcXC90b3N8bmV0ZWFzZVxcXFxcXFxcLmNvbS8udGVzdChyZXN1cmwpICYmIC9odHRwLy50ZXN0KHJlc3VybCkgJiYgIS9cXFxcXFxcXC5odG1sLy50ZXN0KHJlc3VybCkgJiYgIS9cXFxcXFxcXD1odHRwLy50ZXN0KHJlc3VybCkgJiYgcHRhYiAhPSAnZHVvZHVvenknKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3drZmlsZS8udGVzdChyZXN1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VybCArICc7e1JlZmVyZXJAaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vfSdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcXFxcXD0vLnRlc3QocmVzdXJsKSA/IHJlc3VybC5zcGxpdCgnPScpWzFdIDogcmVzdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v6LCD55So5pat5o+S6YCa55So5Ye95pWw6Kej5p6QXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygn6LCD55So5pat5o+S6YCa55So5Ye95pWw6Kej5p6QXFxcXFxcXFxuJyArIHB0YWIgKyAnKOmAmueUqOWHveaVsCknKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXFxcXFwidmFyIGNvbmZpZyA9XFxcXFxcXCIgKyBmZXRjaChcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGNvbmZpZy5jaikpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gcHRhYiArICco6YCa55So5Ye95pWwKSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBhcnNlU1tuYW1lXShyZXN1cmwsIG15dXJsKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdkdW9kdW96eScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKGdldENyeXB0b0pTKCkpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gRGUod29yZCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKG1kNSgnclhqV3ZYbDYnKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZSgnTlhiSG9XSmJwc0VPaW44YicpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDcnlwdG9KUy5BRVMuZGVjcnlwdCh3b3JkLCBhLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdjogdCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgZGR6eSA9ICdhZEh1Um8wZGN1SG9NMTYzTDF5NCcgKyBiYXNlNjRFbmNvZGUoc3JjdXJsKS5zbGljZSgxMCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9odHRwczovL2JvLmRkNTIwLmNjL3hwbGF5L2FwaS5waHBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2h0dHBzOi8vYm8uZGQ1MjAuY2MveG1wbGF5ZXIvYXBpLnBocCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGR3eSA9IGZldGNoKCdodHRwczovL2pocGMubWFuZHVodS5jb20vZHVvZHVvL2FwaS5waHAnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBNT0JJTEVfVUFcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogJ3VybD0nICsgcmVzdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGRkd3kpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBEZShKU09OLnBhcnNlKGRkd3kpLnVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9taWFvcGFydHkvLnRlc3QocHRhYikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlQ2FjaGUoJ2h0dHBzOi8vY29kZS5hbGl5dW4uY29tL2x6azIzNTU5L1B1YmxpY1J1bGUvcmF3L21hc3Rlci94NXJ1bGUuanMnLCAyNCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZSgnaHR0cHM6Ly93d3cuZnVuNGsuY29tL2FwbGF5ZXIvP3VybD0nICsgcmVzdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVuRG4gPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL3h5cS9hcHBtc2V0Lmpzb24nLCB7fSkpLmVuRG47XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJyAmJiB2bGluay5tYXRjaCgveW91a3V8bWd0dnxpeGlndWF8cXEuY29tfHFpeWl8bWlndXxiaWxpYmlsaXxzb2h1fHBwdHZ8bGV8MTkwNS5jb20vKSAmJiB2bGluay5zZWFyY2goL2h0bWx8YmlsaWJpbGl8aXhpZ3VhLykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZygn5bey5byA5ZCv5pat5o+S77yM5bCG6LCD55So5pat5o+S6Kej5p6QaHRtbCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFxcXFxcInZhciBjb25maWcgPVxcXFxcXFwiICsgZmV0Y2goXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXFxcXFwiKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGNvbmZpZy5jaikpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZSh2bGluayk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICB2YXIgc3JjdXJsID0gbGluaztcXFxcbiAgICAgICAgICAgICAgICAvL2xvZyhzcmN1cmwpO1xcXFxuICAgICAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB5byA5aeLXFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy/lpITnkIbmjIflrprop4bpopHkuI7nur/ot69cXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcXFxcXC5tM3U4fFxcXFxcXFxcLm1wNHxvYmpcXFxcXFxcXC90b3N8bmV0ZWFzZVxcXFxcXFxcLmNvbS8udGVzdChzcmN1cmwpICYmIC9odHRwLy50ZXN0KHNyY3VybCkgJiYgIS9cXFxcXFxcXC5odG1sLy50ZXN0KHNyY3VybCkgJiYgIS9cXFxcXFxcXD1odHRwLy50ZXN0KHNyY3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvd2tmaWxlLy50ZXN0KHNyY3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3JjdXJsICsgJzt7UmVmZXJlckBodHRwczovL2ZhbnR1YW4ud2tmaWxlLmNvbS99J1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gL1xcXFxcXFxcPS8udGVzdChzcmN1cmwpID8gc3JjdXJsLnNwbGl0KCc9JylbMV0gOiBzcmN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNyY3VybC5pbmRleE9mKFxcXFxcXFwiL3NoYXJlL1xcXFxcXFwiKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGluayA9IHNyY3VybC5zcGxpdChcXFxcXFxcIi9zaGFyZVxcXFxcXFwiKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmMgPSBmZXRjaChzcmN1cmwsIHt9KS5yZXBsYWNlKFxcXFxcXFwidmFyIHB1cmxcXFxcXFxcIiwgXFxcXFxcXCJ2YXIgbWFpblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmMuaW5kZXhPZihcXFxcXFxcIm1haW5cXFxcXFxcIikgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdCA9IGZjLm1hdGNoKC92YXIgbWFpbi4qPzsvKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChtYXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGxheSA9IChtYWluLmluZGV4T2YoXFxcXFxcXCJodHRwXFxcXFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWFpbiA9IGZjLm1hdGNoKC91cmw6Lio/W1xcXFxcXFxcJ1xcXFxcXFxcXFxcXFxcXCJdKC4qPylbXFxcXFxcXFwnXFxcXFxcXFxcXFxcXFxcIl0vKVsxXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXkgPSAobWFpbi5pbmRleE9mKFxcXFxcXFwiaHR0cFxcXFxcXFwiKSAhPSAtMSA/IG1haW4gOiBsaW5rICsgbWFpbilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAneDVXZWJWaWV3Oi8vJyArIChzcmN1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvOTgzdmlwLy50ZXN0KHNyY3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IE1PQklMRV9VQVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgveFxcXFxcXFxcLW5cXFxcXFxcXC5jY3xuaGR6NjY2Ly50ZXN0KHNyY3VybCkgJiYgL1xcXFxcXFxcLmh0bWx8YmlsaWJpbGkvLnRlc3Qoc3JjdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIC8v5aSE55CG5oyH5a6a6KeG6aKR5ZKM57q/6Lev57uT5p2fXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgc2NvZGUgPSBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBcXFxcXFxcIm9raHR0cC80LjEuMFxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXFxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhzY29kZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzY29kZS5zdGF0dXNDb2RlID09ICczMDInIHx8IHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5omT5byA6Kej5p6Q5pyJMzAy6YeN5a6a5ZCR55qE6ZO+5o6lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVkdXJsID0gc2NvZGUuaGVhZGVycy5sb2NhdGlvblswXS5yZXBsYWNlKC9cXFxcXFxcXFxcXFxcXFxcL2csICcnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXFxcXFw9aHR0cC8udGVzdChyZWR1cmwpICYmIC9odG1sfGJpbGliaWxpfGtleVxcXFxcXFxcPS8udGVzdChyZWR1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoZmV0Y2gocmVkdXJsLCB7fSkpLnVybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFxcXFxcPWh0dHAvLnRlc3QocmVkdXJsKSAmJiAvXFxcXFxcXFwubTN1OHxcXFxcXFxcXC5tcDR8XFxcXFxcXFwuZmx2Ly50ZXN0KHJlZHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVkdXJsLnN1YnN0cmluZyhyZWR1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvaHR0cC8udGVzdChyZWR1cmwpICYmIC9rZXlcXFxcXFxcXD18dWlkXFxcXFxcXFw9Ly50ZXN0KHJlZHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVkdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBodG1sID0gcmVxdWVzdChzcmN1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBzY29kZS5ib2R5O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoLzQwNCBOb3QgRm91bmR85aSH5qGI5ZCO5Y+v57un57ut6K6/6ZeuLy50ZXN0KGh0bWwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXFxcXFw8Ym9keS8udGVzdChodG1sKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygn5bCd6K+V6Z2eSlNPTuaOpeWPo+e9kemhteino+aekCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZSgnaHR0cHM6Ly9jb2RlLmFsaXl1bi5jb20vbHprMjM1NTkvUHVibGljUnVsZS9yYXcvbWFzdGVyL3g1cnVsZS5qcycsIDI0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geDVydWxlKHNyY3VybCwgc3JjdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBvcGVudXJsKHNyY3VybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vanNvbuino+aekOeahOWPlumTvuaOpVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gaHRtbC5tYXRjaCgvW1xcXFxcXFxcJ1xcXFxcXFxcXFxcXFxcXCJddXJsW1xcXFxcXFxcJ1xcXFxcXFxcXFxcXFxcXCJdOi4qP1tcXFxcXFxcXCdcXFxcXFxcXFxcXFxcXFwiXSguKj8pW1xcXFxcXFxcJ1xcXFxcXFxcXFxcXFxcXCJdLylbMV0ucmVwbGFjZSgvXFxcXFxcXFxcXFxcXFxcXC9nLCAnJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2cocHVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9odHRwLy50ZXN0KHB1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwdGFiID09ICdiaWxpYmlsaScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJzt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocHRhYiA9PSAnbWd0dicpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29qYmsvLnRlc3QocHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJzt7UmVmZXJlckBodHRwczovL2Jhay5vamJranguY29tL30nO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZXNjYXBlKHB1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/pnZ5odHRw5byA5aS055qE5omT5byA5Y6f6ZO+5o6lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCh2bGluaylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8v5oql6ZSZ5Yik5pat5aSE55CGXFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZygn5omn6KGM5oql6ZSZ6Lez6L2s5aSE55CGJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8qaWYgKHNyY3VybC5zdWJzdHJpbmcoMCwgMikgPT0gJ1xcXFxcXFxcL1xcXFxcXFxcLycpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKCdodHRwczonICsgc3JjdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXFxcXFw9aHR0cC8udGVzdChzcmN1cmwpICYmIC9cXFxcXFxcXC5odG1sfGJpbGliaWxpLy50ZXN0KHNyY3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIHNyY3VybC5zcGxpdCgnPScpWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsqL1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCh2bGluaylcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ3g1V2ViVmlldzovLycrc3JjdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAvL+WKqOaAgeino+aekOS7o+eggee7k+adn1xcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHB0YWIsXFxcXG4gICAgICAgICAgICBsaW5rLFxcXFxuICAgICAgICAgICAgbXl1cmwsXFxcXG4gICAgICAgICAgICB2bGluayksXFxcXG4gICAgICAgIGNvbF90eXBlOiBjbHRcXFxcbiAgICB9KTtcXFxcbn1cXFxcbi8vfVxcXCJ9LHtcXFwiY29sX3R5cGVcXFwiOlxcXCJtb3ZpZV8zXFxcIixcXFwibmFtZVxcXCI6XFxcIlRW566A5LuL5LiO6YCJ6ZuGXFxcIixcXFwicGF0aFxcXCI6XFxcInR2bW92bGlzdFxcXCIsXFxcInJ1bGVcXFwiOlxcXCJ2YXIgdGFicyA9IE9iamVjdC5rZXlzKGh0bWwudmlkZW9saXN0KTtcXFxcbnZhciB0aHVtYiA9IGh0bWwuaW1nX3VybDtcXFxcbml0ZW1zLnB1c2goe1xcXFxuICAgIHRpdGxlOiAn5Ymn5oOF566A5LuL77yaJyxcXFxcbiAgICBkZXNjOiBodG1sLmludHJvLFxcXFxuICAgIHBpY191cmw6IHRodW1iLFxcXFxuICAgIHVybDogJCgnaG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BhcnNlU2V0Lmpzb25cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UocmVzdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcXFxcXD1MVFxcXFxcXFxcLS8udGVzdChyZXN1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZygn6LCD55So5pat5o+SbHRuYumAmueUqOino+aekCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKFxcXFxcXFwidmFyIGNvbmZpZyA9XFxcXFxcXCIgKyBmZXRjaChcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIG5hbWUgPSAnbHRuYijpgJrnlKjlh73mlbApJztcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBhcnNlU1tuYW1lXShyZXN1cmwuc3Vic3RyaW5nKHJlc3VybC5pbmRleE9mKCc9TFQtJykgKyAxKSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VybFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICBcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGVuRG4gPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL3h5cS9hcHBtc2V0Lmpzb24nLCB7fSkpLmVuRG47XFxcXG4gICAgICAgICAgICAgICAgaWYgKGVuRG4gPT0gJzEnICYmIHNyY3VybC5tYXRjaCgveW91a3V8bWd0dnxpeGlndWF8cXEuY29tfHFpeWl8bWlndXxiaWxpYmlsaXxzb2h1fHBwdHZ8bGV8MTkwNS5jb20vKSAmJiBzcmN1cmwuc2VhcmNoKC9odG1sfGJpbGliaWxpfGl4aWd1YS8pICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZygn6LCD55So5pat5o+S6Kej5p6QaHRtbCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKFxcXFxcXFwidmFyIGNvbmZpZyA9XFxcXFxcXCIgKyBmZXRjaChcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAvL2xvZyhzcmN1cmwpO1xcXFxuICAgICAgICAgICAgLy/liqjmgIHop6PmnpDku6PnoIHlvIDlp4tcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKC9cXFxcXFxcXC5tM3U4fFxcXFxcXFxcLm1wNHxvYmpcXFxcXFxcXC90b3MvLnRlc3Qoc3JjdXJsKSAmJiAvaHR0cC8udGVzdChzcmN1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAvXFxcXFxcXFw9Ly50ZXN0KHNyY3VybCkgPyBzcmN1cmwuc3BsaXQoJz0nKVsxXSA6IHNyY3VybCArICcjaXNWaWRlbz10cnVlIyc7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzcmN1cmwuaW5kZXhPZihcXFxcXFxcIi9zaGFyZS9cXFxcXFxcIikgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXFxcXFwiL3NoYXJlXFxcXFxcXCIpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZjID0gZmV0Y2goc3JjdXJsLCB7fSkucmVwbGFjZShcXFxcXFxcInZhciBwdXJsXFxcXFxcXCIsIFxcXFxcXFwidmFyIG1haW5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmMuaW5kZXhPZihcXFxcXFxcIm1haW5cXFxcXFxcIikgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWF0ID0gZmMubWF0Y2goL3ZhciBtYWluLio/Oy8pWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwobWF0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGxheSA9IChtYWluLmluZGV4T2YoXFxcXFxcXCJodHRwXFxcXFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1haW4gPSBmYy5tYXRjaCgvdXJsOi4qP1tcXFxcXFxcXCdcXFxcXFxcXFxcXFxcXFwiXSguKj8pW1xcXFxcXFxcJ1xcXFxcXFxcXFxcXFxcXCJdLylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXkgPSAobWFpbi5pbmRleE9mKFxcXFxcXFwiaHR0cFxcXFxcXFwiKSAhPSAtMSA/IG1haW4gOiBsaW5rICsgbWFpbilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocHRhYiA9PSAnYWxpenknKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gZmV0Y2goJ2h0dHBzOi8vZm91YmluLmNvbS9qaWV4aS5waHA/dXJsPScgKyBzcmN1cmwsIHt9KS5tYXRjaCgvXFxcXFxcXFxcXFxcXFxcInVybFxcXFxcXFxcXFxcXFxcXCI6XFxcXFxcXFxcXFxcXFxcIiguKj8pXFxcXFxcXFxcXFxcXFxcIi8pWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybDtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC8xOWp4XFxcXFxcXFwudmlwfG5meWluZ3NoaS8udGVzdChzcmN1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwucmVwbGFjZSgnaHR0cDovLycsICdodHRwczovLycpLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IE1PQklMRV9VQVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5oZWFkZXJzLmxvY2F0aW9uWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoL3RpdGFuLm1ndHYvLnRlc3QocHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29ialxcXFxcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgLyplbHNlIGlmICgvemhhaWthbnlzLy50ZXN0KHNyY3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwgKyAnJmFwcD0xMDAwMyZhY2NvdW50PTI3Mjc3NTAyOCZwYXNzd29yZD1xcTI3Mjc3NTAyOCcsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBNT0JJTEVfVUFcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoSGVhZGVyczogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3RpdGFuLm1ndHYvLnRlc3QocHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIycgKyAnO3tSZWZlcmVyQHd3dy5tZ3R2LmNvbSYmVXNlci1BZ2VudEBNb3ppbGxhLzUuMH0nO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvb2JqXFxcXFxcXFwvdG9zLy50ZXN0KHB1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAvLy0tLS3liIblibLnur8tLS0tLy9cXFxcbiAgICAgICAgICAgICAgICB2YXIgc2NvZGUgPSBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogTU9CSUxFX1VBXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXFxcbiAgICAgICAgICAgICAgICB9KSk7XFxcXG4gICAgICAgICAgICAgICAgLy9sb2coc2NvZGUpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChzY29kZS5zdGF0dXNDb2RlID09ICczMDInIHx8IHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBzY29kZS5oZWFkZXJzLmxvY2F0aW9uWzBdLnJlcGxhY2UoL1xcXFxcXFxcXFxcXFxcXFwvZywgJycpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vdmFyIGh0bWwgPSByZXF1ZXN0KHNyY3VybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gc2NvZGUuYm9keTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl6585LiN5a2Y5ZyoLy50ZXN0KGh0bWwpIHx8IGh0bWwgPT0gJycpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHNyY3VybC5zdWJzdHJpbmcoc3JjdXJsLmluZGV4T2YoJz1odHRwJykgKyAxKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFxcXFxcXFxcXFxcXCJ1cmxcXFxcXFxcXFxcXFxcXFwiXFxcXFxcXFw6XFxcXFxcXFxcXFxcXFxcImh0dHAvLnRlc3QoaHRtbCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gaHRtbC5tYXRjaCgvXFxcXFxcXFxcXFxcXFxcInVybFxcXFxcXFxcXFxcXFxcXCI6XFxcXFxcXFxcXFxcXFxcIiguKj8pXFxcXFxcXFxcXFxcXFxcIi8pWzFdLnJlcGxhY2UoL1xcXFxcXFxcXFxcXFxcXFwvZywgJycpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuc3RhcnRzV2l0aCgneycpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IHNyY3VybC5zdWJzdHJpbmcoc3JjdXJsLmluZGV4T2YoJz1odHRwJykgKyAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHB1cmwgPSBzcmN1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZSgnaHR0cHM6Ly9jb2RlLmFsaXl1bi5jb20vbHprMjM1NTkvUHVibGljUnVsZS9yYXcvbWFzdGVyL3g1cnVsZS5qcycsIDI0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4NXJ1bGUoc3JjdXJsLCBzcmN1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ3g1V2ViVmlldzovLycrKHNyY3VybCkgXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKHB1cmwpO1xcXFxuICAgICAgICAgICAgICAgIGlmICgvdGl0YW4ubWd0di8udGVzdChwdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIycgKyAnO3tSZWZlcmVyQHd3dy5tZ3R2LmNvbSYmVXNlci1BZ2VudEBNb3ppbGxhLzUuMH0nO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29ialxcXFxcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXFxcbiAgICAgICAgICAgICAgICB9O1xcXFxuXFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHNyY3VybC5zdWJzdHJpbmcoMCwgMikgPT0gJ1xcXFxcXFxcL1xcXFxcXFxcLycpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoJ2h0dHBzOicgKyBzcmN1cmwpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFxcXFxcPWh0dHAvLnRlc3Qoc3JjdXJsKSAmJiAvXFxcXFxcXFwuaHRtbHxiaWxpYmlsaS8udGVzdChzcmN1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIHNyY3VybC5zcGxpdCgnPScpWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybChzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHNyY3VybClcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAv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XFxuICAgICAgICAgICAgdGl0bGU6ICfmnKrmkJzntKLliLDvvIzngrnlh7vorr/pl67ljp/nvZHpobUnLFxcXFxuICAgICAgICAgICAgdXJsOiBzcGxbMV0gKyBgQGxhenlSdWxlPS5qczppbnB1dC5zcGxpdCgnOycpWzBdYCxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ1xcXFxuICAgICAgICB9KTtcXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXFxcblxcXFxuICAgICAgICAgICAgaWYgKC9cXFxcXFxcXC92b2RcXFxcXFxcXC8vLnRlc3QodGRvbWluKSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udGl0bGU7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0ucGljO1xcXFxuICAgICAgICAgICAgICAgIC8vdmFyIHZpZD10ZG9taW4rJy9kZXRhaWw/dm9kX2lkPScrbGlzdFtpXS5uZXh0bGluaysnJnJlbF9saW1pdD0xMCc7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHZpZCA9IGxpc3RbaV0ubmV4dGxpbms7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0uc3RhdGU7XFxcXG4gICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0uc3RhdGU7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGlmICh0ZG9taW4uaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0udm9kX3BpYztcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9mYW50dWFuLy50ZXN0KHRkb21pbikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSB0ZG9taW4gKyAndmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVtID0gbGlzdFtpXS52b2RfcmVtYXJrcztcXFxcbiAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0udm9kX3BpYztcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVtID0gbGlzdFtpXS52b2RfcmVtYXJrcztcXFxcbiAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnZvZF9uYW1lO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSB0ZG9taW4gKyAnL2RldGFpbElEP3ZvZF9pZD0nICsgbGlzdFtpXS52b2RfaWQgKyAnJnRva2VuPSc7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWw/a2V5PScgKyBkYXRlU3RyICsgJyZ2b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2Uoa2V5LCAn4oCc4oCcJyArIGtleSArICfigJ3igJ0nKSxcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBwaWMgKyAnQFJlZmVyZXI9JyxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQodGRvbWluLmluZGV4T2YoXFxcXFxcXCJtb2dhaV9hcGlcXFxcXFxcIikgIT0gLTEgPyB2aWQgKyAnO2dldDt1dGYtODt7VXNlci1BZ2VudEBEYXJ0LzIuMTQgKGRhcnQ6aW8pfScgOiB2aWQgKyAnO2dldDt1dGYtODt7VXNlci1BZ2VudEBva2h0dHAvNC4xLjB9JykucnVsZSgodGRvbWluKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShnZXRSZXNDb2RlKCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJ1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBteXVybCA9IE1ZX1VSTC5tYXRjaCgvKFtcXFxcXFxcXFNdKj86XFxcXFxcXFwvXFxcXFxcXFwvW1xcXFxcXFxcU10qPylcXFxcXFxcXC8vKVsxXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcXFxcXC92b2RcXFxcXFxcXC8vLnRlc3QodGRvbWluKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdHZtb3ZsaXN0Jywge30pKS5ydWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2FwcG1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgIC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gICAgICAgIH0gZWxzZSBpZiAoL2lvcGVueXVuLy50ZXN0KG11cmwpKSB7XFxcXG4gICAgICAgICAgICB2YXIgbGluayA9IG11cmwgKyAnL2RldGFpbElEP3ZvZF9pZD0nICsgdXJsICsgJyZyZWxfbGltaXQ9MTA7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JztcXFxcbiAgICAgICAgfSBlbHNlIGlmICgvZGlqaWF4aWEvLnRlc3QobXVybCkpIHtcXFxcbiAgICAgICAgICAgIHZhciBsaW5rID0gJ2h0dHA6Ly93d3cuZGlqaWF4aWEuY29tL2FwaS5waHAvYXBwL3ZpZGVvX2RldGFpbD9pZD0nICsgdXJsO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxcXG4gICAgICAgICAgICB1cmw6ICQobGluaykucnVsZSgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHJlcyA9IHt9O1xcXFxuICAgICAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcXFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAnJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZSdcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoWDVXZWJWaWV3KCcnKTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UoZ2V0UmVzQ29kZSgpKTtcXFxcb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JyYW5jaC9tYXN0ZXIvYXBwbW92aWUudHh0JywgMjQpO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICByZW1mID0gJyc7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaWYgKC/vv6ViYXNlNjQvLnRlc3QocmVtZikpIHtcXFxcbiAgICAgICAgICAgIHZhciByZW12ID0gSlNPTi5wYXJzZShiYXNlNjREZWNvZGUocmVtZi5zcGxpdCgnQCcpWzJdKSkudmVyc2lvbjtcXFxcbiAgICAgICAgfSBlbHNlIGlmICgv77+laG9tZV9ydWxl77+lLy50ZXN0KHJlbWYpKSB7XFxcXG4gICAgICAgICAgICB2YXIgcmVtdiA9IEpTT04ucGFyc2UocmVtZi5zcGxpdCgn77+laG9tZV9ydWxl77+lJylbMV0pLnZlcnNpb247XFxcXG4gICAgICAgIH07XFxcXG4gICAgICAgIGlmICgv77+laG9tZV9ydWxlLy50ZXN0KHJlbWYpKSB7XFxcXG4gICAgICAgICAgICBsb2coJ+i/nOeoi+eJiOacrO+8micgKyByZW12KTtcXFxcbiAgICAgICAgICAgIGxvZygn5pys5Zyw54mI5pys77yaJyArIGxvY3Zlcik7XFxcXG4gICAgICAgICAgICBpZiAobG9jdmVyICE9IHJlbXYpIHtcXFxcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2FwcG52ZXInLCByZW1mKTtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mnInmlrDniYjmnKzvvIzngrnlr7zlhaXmm7TmlrDlj6/mm7TmlrDop4TliJnjgIInO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5pqC5peg5paw54mI5pys77yMMjTlsI/ml7blhoXmo4DmtYvml6DmlYjjgIInXFxcXG4gICAgICAgICAgICB9O1xcXFxuICAgICAgICB9IG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odG1sLmRhdGEudm9kX3BsYXlfdXJsLnNwbGl0KCckJCQnKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0gZWxzZSBpZiAoaHRtbC5kYXRhLnZvZF9pbmZvICYmIGh0bWwuZGF0YS52b2RfaW5mby52b2RfdXJsX3dpdGhfcGxheWVyKSB7XFxcXG4gICAgICAgIHZhciBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfdXJsX3dpdGhfcGxheWVyO1xcXFxuICAgICAgICBpZiAoY29udHMubGVuZ3RoIDwgMSkge1xcXFxuICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX2luZm8udm9kX3BsYXlfdXJsLnNwbGl0KCckJCQnKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIHZhciBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV9saXN0O1xcXFxuICAgICAgICBpZiAoY29udHMubGVuZ3RoIDwgMSkge1xcXFxuICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfdXJsLnNwbGl0KCckJCQnKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcblxcXFxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29udHMubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgaWYgKGh0bWwudmlkZW9saXN0KSB7XFxcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGh0bWwudmlkZW9saXN0W2NvbnRzW2ldXTtcXFxcbiAgICAgICAgfSBlbHNlIGlmIChjb250c1tpXS51cmxzKSB7XFxcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGNvbnRzW2ldLnVybHM7XFxcXG4gICAgICAgIH0gZWxzZSBpZiAoY29udHNbaV0udXJsKSB7XFxcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGNvbnRzW2ldLnVybC5zcGxpdChcXFxcXFxcIiNcXFxcXFxcIik7XFxcXG4gICAgICAgIH0gZWx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U9MSc7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/YWM9bGlzdCZ3ZD0nICsga2V5ICsgJyZwYWdlPTEnO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKC9kaWppYXhpYS8udGVzdChsaW5rKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsaW5rID0gJ2h0dHA6Ly93d3cuZGlqaWF4aWEuY29tL2FwaS5waHAvYXBwLydcXFxcbiAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgIGlmIChsaW5rLmluZGV4T2YoJ2FwaS5waHAvYXBwLycpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPTEmdGV4dD0nICsga2V5ICsgJyZ0b2tlbj0nO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGluay5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICdzZWFyY2g/cGc9MSZ0ZXh0PScgKyBrZXk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9pb3Blbnl1bi8udGVzdChsaW5rKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICcvbGlzdD9wYWdlPWZ5cGFnZSZsaW1pdD0xMCZ3ZD0nICsga2V5O1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/cGFnZT0xJmxpbWl0PTEwJndkPScgKyBrZXk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAvL0RhdGEucHVzaCh7dXJsOiBobXVybCxvcHRpb25zOiB7aGVhZGVyczoge1xcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBcXFxcXFxcIkRhcnQvMi4xNCAoZGFydDppbylcXFxcXFxcIn0sdGltZW91dDogdGltZW91fX0pO1xcXFxuICAgICAgICAgICAgRGF0YS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB1cmw6IGhtdXJsLFxcXFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IGxpbmsuaW5kZXhPZihcXFxcXFxcIm1vZ2FpX2FwaVxcXFxcXFwiKSAhPSAtMSA/IFxcXFxcXFwiRGFydC8yLjE0IChkYXJ0OmlvKVxcXFxcXFwiIDogXFxcXFxcXCJva2h0dHAvNC4xLjBcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiB0aW1lb3VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIFRpdC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXQ6IGxpc3Rbal0udGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgbGluazogbGluayxcXFxcbiAgICAgICAgICAgICAgICB0eXBubTogbGl0aXRcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IC8vaWZcXFxcbiAgICB9IC8vZm9yIGpcXFxcbn0gY2F0Y2ggKGUpIHt9XFxcXG5pZiAoRGF0YS5sZW5ndGggPD0gMCkge1xcXFxuICAgIHNldFJlc3V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cXFxcXFxcbicsICcnKSA6IGh0bWw7XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgICAgICBpZiAoL2J0d2FmLy50ZXN0KGh0bWwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBmZXRjaChwYXJhbS5pdC51cmwgKyAnJmJ0d2FmJyArIGh0bWwubWF0Y2goL2J0d2FmKC4qPylcXFxcXFxcXFxcXFxcXFwiLylbMV0sIHt9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKGh0bWwgPT0gXFxcXFxcXCJcXFxcXFxcIiB8fCBodG1sID09IG51bGwgfHwgaHRtbC5zdWJzdHJpbmcoMCwgNSkgPT0gJ2Vycm9yJyB8fCAhaHRtbC5zdGFydHNXaXRoKCd7JykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChodG1sLmxlbmd0aCA8IDgwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaHRtbCA9IEpTT04ucGFyc2UoaHRtbCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdHlwZXQgPSBwYXJhbS50aXQudHlwbm07XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ZG9taW4gPSBwYXJhbS50aXQubGluaztcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGh0bWwubGlzdCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmxpc3Q7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5kYXRhLmxpc3QpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC5kYXRhLmxpc3Q7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5kYXRhKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IGh0bWwuZGF0YTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW107XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoIDwgMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFxcXFxcL3ZvZFxcXFxcXFxcLy8udGVzdCh0ZG9taW4pKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udGl0bGU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnBpYztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IGxpc3RbaV0ubmV4dGxpbms7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnN0YXRlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZG9taW4uaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9mYW50dWFuLy50ZXN0KHRkb21pbikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gJ2h0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL2FwaS5waHAvYXBwL3ZpZGVvX2RldGFpbD9pZD0nICsgbGlzdFtpXS52b2RfaWQgKyAnJnRva2VuPSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSB0ZG9taW4gKyAndmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0ZG9taW4uaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnZvZF9uYW1lO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0udm9kX3BpYztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSB0ZG9taW4gKyAndmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9pb3Blbnl1bi8udGVzdCh0ZG9taW4pKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvZGV0YWlsSUQ/dm9kX2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvZGV0YWlsP2tleT0nICsgZGF0ZVN0ciArICcmdm9kX2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnN0YXRlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKHZpZCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IE1ZX1RZUEUgPT0gXFxcXFxcXCJob21lXFxcXFxcXCIgPyB0aXRsZS5yZXBsYWNlKGtleSwgJ+KAnOKAnCcgKyBrZXkgKyAn4oCd4oCdJykgKyAnXFxcXFxcXFxuJyArIHJlbSA6IHRpdGxlICsgcmVtLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBwaWMgKyAnQFJlZmVyZXI9JyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHRkb21pbi5pbmRleE9mKFxcXFxcXFwibW9nYWlfYXBpXFxcXFxcXCIpICE9IC0xID8gdmlkICsgJztnZXQ7dXRmLTg7e1VzZXItQWdlbnRARGFydC8yLjE0IChkYXJ0OmlvKX0nIDogdmlkICsgJztnZXQ7dXRmLTg7e1VzZXItQWdlbnRAb2todHRwLzQuMS4wfScpLnJ1bGUoKHRkb21pbikgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IHt9O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UoZ2V0UmVzQ29kZSgpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnMjU1JiZmbG9hdCcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbXl1cmwgPSBNWV9VUkwubWF0Y2goLyhbXFxcXFxcXFxTXSo/OlxcXFxcXFxcL1xcXFxcXFxcL1tcXFxcXFxcXFNdKj8pXFxcXFxcXFwvLylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFxcXFxcL3ZvZFxcXFxcXFxcLy8udGVzdCh0ZG9taW4pKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdHZtb3ZsaXN0Jywge30pKS5ydWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvYXBwbW92bGlzdCcsIHt9KSkucnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5kYXRhID0gaXRlbXM7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sdGRvbWluKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jb250ZW50OiByZW0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IHR5dGl0ICsgJyA9PiAnICsgcGFyYW0udGl0LnRpdCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gLy9mb3IgaVxcXFxuICAgICAgICAgICAgICAgICAgICB9IC8vaWYgbGlzdC5sZW5ndGhcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQ7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxcXG4gICAgICAgICAgICAgICAgaXQ6IGl0LFxcXFxuICAgICAgICAgICAgICAgIHRpdDogVGl0W2tdXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgaWQ6IFxcXFxcXFwidGFza1xcXFxcXFwiXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuXFxcXG4gICAgYmF0Y2hFeGVjdXRlKHRhc2tzLCB7XFxcXG4gICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcXFxuICAgICAgICAgICAgLy9sb2coXFxcXFxcXCJsaXN0ZW5lcjogXFxcXFxcXCIgKyAocmVzdWx0IHx8IFtdKS5sZW5ndGgpXFxcXG4gICAgICAgICAgICBwYXJhbS5pID0gcGFyYW0uaSArIDE7XFxcXG4gICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgcmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBhcmFtLmogPSBwYXJhbS5qICsgMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0LmRlc2MsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXFxcXFwiX19hcHBcXFxcXFxcIiArIE1ZX1BBR0UgKyBcXFxcXFxcIkBcXFxcXFxcIiArIHBhcmFtLmpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcXFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGFnZWlkKVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5q2j5Zyo5Yqg6L2956ysXFxcXFxcXCIgKyBNWV9QQUdFICsgXFxcXFxcXCLpobXvvIzov5vluqbvvJpcXFxcXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFxcXFxcIi9cXFxcXFxcIiArIHBhcmFtLmFsbCxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgYWxsOiBEYXRhLmxlbmd0aCxcXFxcbiAgICAgICAgICAgIGk6IDAsXFxcXG4gICAgICAgICAgICBqOiAtMVxcXFxuICAgICAgICB9XFxcXG4gICAgfSlcXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLmlbDmja7ovazmjaJcXFwiLFxcXCJwYXRoXFxcIjpcXFwiY29udmVyXFxcIixcXFwicnVsZVxcXCI6XFxcIi8vanM6XFxcXG4vL3JlbShyZXMpO1xcXFxudmFyIOiusOW9lSA9IFtdO1xcXFxudmFyIOi+k+WFpeadoeebriA9IHJlbWZpbGUubWF0Y2goLy4rPWh0dHAuKy9nKTtc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nJlYWQoZmlsZW5hbWUpKTtcXFxcbi8vfSBlbHNlIHtcXFxcbnZhciDmlrDorrDlvZUgPSBbXTtcXFxcbi8vfVxcXFxuZm9yICh2YXIgaSBpbiDorrDlvZUpIHtcXFxcbiAgICB2YXIg5b2T5YmN5p2h55uuID0gW107XFxcXG4gICAg5b2T5YmN5p2h55uuLnB1c2go6K6w5b2VW2ldKTtcXFxcbiAgICBpZiAo5paw6K6w5b2VLmxlbmd0aCA9PSAwKSB7XFxcXG4gICAgICAgIOaWsOiusOW9lS5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiDorrDlvZVbaV0udHlwZSxcXFxcbiAgICAgICAgICAgIGxpc3Q6IOW9k+WJjeadoeebrlxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgIGxldCByZXMgPSDmlrDorrDlvZUuc29tZShpdGVtID0+IHtcXFxcbiAgICAgICAgLy/liKTmlq3nsbvlnovvvIzmnInlsLHmt7vliqDliLDlvZPliY3poblcXFxcbiAgICAgICAgaWYgKGl0ZW0udGl0bGUgPT0g6K6w5b2VW2ldLnR5cGUpIHtcXFxcbiAgICAgICAgICAgIGl0ZW0ubGlzdCA9IOW9k+WJjeadoeebri5jb25jYXQoaXRlbS5saXN0LmZpbHRlcihkID0+IGQudXJsICE9IOiusOW9lVtpXS51cmwpKTtcXFxcbiAgICAgICAgICAgIHJldHVybiB0cnVlXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbiAgICBpZiAoIXJlcykge1xcXFxuICAgICAgICAvL+WmguaenOayoeaJvuebuOWQjOexu+Wei+a3u+WKoOS4gOS4quexu+Wei1xcXFxuICAgICAgICDmlrDorrDlvZUucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTog6K6w5b2VW2ldLnR5cGUsXFxcXG4gICAgICAgICAgICBsaXN0OiDlvZPliY3mnaHnm65cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIH1cXFxcbn1cXFxcbnZhciBuZXdmaWxlID0ge307XFxcXG5uZXdmaWxlLmRhdGEgPSDmlrDorrDlvZU7XFxcXG4vL2xvZyhyZW1maWxlKTtcXFwifV1cIn0iLCJwaWNVcmwiOiJodHRwOi8vcHV1aS5xcGljLmNuL3Zjb3Zlcl92dF9waWMvMC9temMwMDIwMG9wcXpnNXAxNjQ3MjI1NjcwNzczLzBAUmVmZXJlcj0iLCJ0aXRsZSI6Ik1Y5b2x6KeGLeS9meeUn++8jOivt+WkmuaMh+aVmSJ9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement