Advertisement
xiaomianao666

邀您一起看:「云顶TVAPP」

Oct 25th, 2024
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥「云顶TVAPP」@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuW3peWFt1wiLFwicGF0aFwiOlwidXRpbGl5XCIsXCJydWxlXCI6XCJqczpcXG5sZXQgaG9zdCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3NcXFwiO1xcbi8vbGV0IGhvc3QgPSBcXFwiaHR0cDovLzE5Mi4xNjguMzEuNDk6ODA3OVxcXCI7XFxubGV0IGhvbWUgPSBiYXNlNjREZWNvZGUoXFxcImFHbHJaWEk2THk5b2IyMWxcXFwiKTtcXG52YXIgYXBpID0ge1xcbiAgICBob3N0OiBob3N0K1xcXCIvaGlrZXJ1bGVcXFwiLFxcbiAgICBub3RpY2VVcmw6XFxcIi9ub3RpY2UvZ2V0XFxcIiwvL+iOt+WPluS7k+W6k+WFrOWRilxcbiAgICB1c2Vyc1VybDogXFxcIi9kZXYvdXNlcnM/b3JkZXI9XFxcIiwgLy/nlKjmiLfliJfooahcXG4gICAgcnVsZUNvdW50VXJsOiBcXFwiL2Rldi9ydWxlY291bnRcXFwiL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lID0gbmV3IERhdGUoKTtcXG4gICAgICAgICAgICBsZXQgc2VwZXJhdG9yMSA9IFxcXCItXFxcIjtcXG4gICAgICAgICAgICBsZXQgc2VwZXJhdG9yMiA9IFxcXCI6XFxcIjtcXG4gICAgICAgICAgICBsZXQgbW9udGggPSBkYXRlLmdldE1vbnRoKCkgKyAxO1xcbiAgICAgICAgICAgIGxldCBzdHJEYXRlID0gZGF0ZS5nZXREYXRlKCk7XFxuICAgICAgICAgICAgbGV0IHN0ckhvdXJzID0gZGF0ZS5nZXRIb3VycygpO1xcbiAgICAgICAgICAgIGxldCBzdHJNaW51dGVzID0gZGF0ZS5nZXRNaW51dGVzKCk7XFxuICAgICAgICAgICAgbGV0IHN0clNlY29uZHMgPSBkYXRlLmdldFNlY29uZHMoKSsxO1xcbiAgICAgICAgICAgIGlmIChtb250aCA+PSAxICYmIG1vbnRoIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgbW9udGggPSBcXFwiMFxcXCIgKyBtb250aFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyRGF0ZSA+PSAwICYmIHN0ckRhdGUgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJEYXRlID0gXFxcIjBcXFwiICsgc3RyRGF0ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RySG91cnMgPj0gMCAmJiBzdHJIb3VycyA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckhvdXJzID0gXFxcIjBcXFwiICsgc3RySG91cnNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0ck1pbnV0ZXMgPj0gMCAmJiBzdHJNaW51dGVzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyTWludXRlcyA9IFxcXCIwXFxcIiArIHN0ck1pbnV0ZXNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0clNlY29uZHMgPj0gMCAmJiBzdHJTZWNvbmRzIDw9IDkp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bGlzdCYmL2hvbWVfcnVsZV91cmx8aHRtbC8udGVzdChkYXRhSXRlbS5kYXRhX3R5cGUpKXtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6ICNmZjcwMDBcXFwiPuWvvOWFpemBk+W+t+e7jzwvc3Bhbj4nLFxcbiAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChkYXRhSXRlbSxzdWJVcmwpPT57XFxuICAgICAgICAgICAgICAgIC8vIGxldCB0aXRsZSA9IFxcXCJILVxcXCIrZGF0YUl0ZW0ubmFtZStcXFwiLlxcXCIrZGF0YUl0ZW0uYXV0aG9yO1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBcXFwiSi1cXFwiK2RhdGFJdGVtLm5hbWUuc3BsaXQoJy4nKVswXTtcXG4gICAgICAgICAgICAgICAgbGV0IHN1Yk9iaiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc3ViVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvXFxcIit0aXRsZStcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBhY3RpdmU6IGZhbHNlLC8v56aB55So5bm25Y+R5pu05pawXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHNoYXJlVGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShzdWJPYmopKTtcXG4gICAgICAgICAgICAgICAgdmFyIHBhc3RlcyA9IGdldFBhc3RlcygpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShzaG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X2NvbF90eXBlLFxcbiAgICAgICAgdXJsOiAkKGdldEFwaShcXFwiZ2VuQXV0aFxcXCIpICsgcmVxQnlHZXQgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGJhY2sgPSByZXF1ZXN0KGlucHV0KTtcXG4gICAgICAgICAgICBsZXQgcmV0ID0gSlNPTi5wYXJzZShiYWNrKTtcXG4gICAgICAgICAgICBpZiAocmV0LnN0YXR1cyA9PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sueUn+aIkOmaj+acuuWvhueggVxcXFxuXFxcIiArIHJldC5yZXN1bHRcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+maj+acuuWvhueggeeUn+aIkOWksei0pVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9KTtcXG4gICAgbGV0IHRpbWVPdmVyID0ge1xcbiAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlXFxuICAgIH07XFxuICAgIGlmIChkYXRhSXRlbS50aW1lX292ZXIpIHtcXG4gICAgICAgIHRpbWVPdmVyLnRpdGxlID0gc21hbGwoY29sb3IoXFxcIuefreaXtuWvhumSpVxcXCIsIFxcXCJncmVlblxcXCIpICsgY29sb3IoXFxcIijihpLmsLjkuYUpXFxcIiwgXFxcInJlZFxcXCIpKTtcXG4gICAgICAgIHRpbWVPdmVyLnVybCA9IGdldEFwaShcXFwidGltZW92ZXJcXFwiKSArIHJlcUJ5R2V0ICsgXFxcIiZmbGFnPTFcXFwiO1xcbiAgICAgICAgdGltZU92ZXIuY29uZmlybSA9IFxcXCLmmK/lkKbnoa7orqTku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BzKTtcXG4gICAgLy8gbG9nKCdjYW5fdXBsb2FkOicrY2FuX3VwbG9hZCk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pqg6IO95ZCm5LiK5LygOicrKGdldFZhcignV2FyZWhvdXNlLmNhbl91cGxvYWQnKXx8dGlwcyksXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6J2hpa2VyOi8vZW1wdHknXFxuICAgIH0pO1xcbiAgICBmdW5jdGlvbiBzZXRVcGxvYWQoZmxhZyxjYW5fdXBsb2FkX2FwaSkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2goY2FuX3VwbG9hZF9hcGksIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNhbl91cGxvYWRcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifwn5qr56aB5q2i5LiK5LygJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfnpoHmraLor6XlvIDlj5HogIXkuIrkvKDop4TliJk/5L2g55qE5pON5L2c5bCG6KKr57O757uf6K6w5b2VJykuY29uZmlybSgoaWQsY2FuX3VwbG9hZF9hcGksc2V0VXBsb2FkKT0+e1xcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRVcGxvYWQoZmFsc2UsY2FuX3VwbG9hZF9hcGkpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJywn5ZCmJyk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGlkLGNhbl91cGxvYWRfYXBpLHNldFVwbG9hZClcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pyF5YWB6K645LiK5LygJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCflhYHorrjor6XlvIDlj5HogIXkuIrkvKDop4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5zcGxpdChcXFwiXFxcXG5cXFwiKVswXSk7XFxuICAgICAgICAgICAgICAgIC8vcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICBpbXBvcnRVcmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUocnVsZUNvZGUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gaW1wb3J0VXJsXFxuICAgICAgICAgICAgfSxkYXRhSXRlbSxydWxlTGlzdEpzb24gKyBkYXRhSXRlbS5pZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlMlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcImNvbG9yOiAjZmY3MDAwXFxcIj7lr7zlhaXpgZPlvrfnu488L3NwYW4+JyxcXG4gICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoZGF0YUl0ZW0sc3ViVXJsKT0+e1xcbiAgICAgICAgICAgICAgICAvLyBsZXQgdGl0bGUgPSBcXFwiSC1cXFwiK2RhdGFJdGVtLm5hbWUrXFxcIi5cXFwiK2RhdGFJdGVtLmF1dGhvcjtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gXFxcIkotXFxcIitkYXRhSXRlbS5uYW1lLnNwbGl0KCcuJylbMF07XFxuICAgICAgICAgICAgICAgIGxldCBzdWJPYmogPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHN1YlVybCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL1xcXCIrdGl0bGUrXFxcIi5qc29uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvZGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgYWN0aXZlOiBmYWxzZSwvL+emgeeUqOW5tuWPkeabtOaWsFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBzaGFyZVRleHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoc3ViT2JqKSk7XFxuICAgICAgICAgICAgICAgIHZhciBwYXN0ZXMgPSBnZXRQYXN0ZXMoKTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHNoYXJlUGFzdGUoc2hhcmVUZXh0LHBhc3Rlcy5zbGljZSgtMSlbMF0pO1xcbiAgICAgICAgICAgICAgICBsZXQgaW1wb3J0X3J1bGU9IFxcXCLovbvlkIjpm4borqLpmIXvvJpcXFwiK3RpdGxlKydcXFxcbicrdXJsO1xcbiAgICAgICAgICAgICAgICBjb3B5KGltcG9ydF9ydWxlKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgcGF0aCA9ICdoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL3N1Yi5qc29uJztcXG4gICAgICAgICAgICAgICAgJC5yYyhjb25maWcubGliLnN1Yik7XFxuICAgICAgICAgICAgICAgIHJldHVybiDorqLpmIXlr7zlhaUocGF0aClcXG4gICAgICAgICAgICB9LGRhdGFJdGVtLHJ1bGVMaXN0SnNvbiArIGRhdGFJdGVtLmlkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGUyXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8c21hbGw+5o+Q56S677ya5byA5Y+R6ICF5Y2V54us5YiG5Lqr55qE5ZCI6ZuG5paH5Lu25Y+q6IO95Y2V54us5a+85YWl44CCPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICAgICAgfSk7XFxuICAgIH0gZWx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ICAgICAgICAgICAgICBwdXRWYXIoXFxcIldhcmVob3VzZS5iYWNrXFxcIiwgXFxcIjFcXFwiKTtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gaG9tZStcXFwic0BcXFwiICsgbmFtZTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pyq5a6J6KOFXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBkYXRhSXRlbS5uYW1lLGFwaS5ob21lKSxcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICB9KVxcbn1cXG5sZXQgbWFuX3J1bGVfc2FmZSA9IGdldEFwaShcXFwibWFuUnVsZVNhZmVcXFwiKStkYXRhSXRlbS5pZDtcXG5sZXQgbWFuX3J1bGVfZ29vZCA9IGdldEFwaShcXFwibWFuUnVsZUdvb2RcXFwiKStkYXRhSXRlbS5pZDtcXG4vLyBkYXRhSXRlbS5pc19zYWZlO1xcbmlmKGdldFZhcignaG91c2UuaXNfbWFuYWdlcicpKXtcXG4gICAgZnVuY3Rpb24gc2V0SXNTYWZlKGZsYWcsbWFuX3J1bGVfc2FmZSkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfc2FmZSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfc2FmZVxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBmdW5jdGlvbiBzZXRJc0dvb2QoZmxhZyxtYW5fcnVsZV9nb29kKSB7XFxuICAgICAgICBmbGFnID0gZmxhZyB8fCAnJztcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChtYW5fcnVsZV9nb29kLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpc19nb29kXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+mjjumZqScsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn5qCH6K6w6K+l6KeE5YiZ5Li66aOO6ZmpP+mjjumZqeinhOWImeaXoOazleiiq+WvvOWFpScpLmNvbmZpcm0oKGlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKT0+e1xcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc1NhZmUoZmFsc2UsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifinIXmraPluLgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuato+W4uD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKHRydWUsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifimaXpnZ7kvJjotKgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumdnuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNHb29kKGZhbHNlLG1hbl9ydWxlX2dvb2QpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8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gICAgICAgICAgICAgICBcXFwicXFcXFwiOiB1c2VybmFtZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAncG9zdCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBpZHJlc3VsdCA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRJZCArIFxcXCI/cXE9XFxcIiArIHVzZXJuYW1lKSk7XFxuICAgICAgICBpZiAoaWRyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyBpZHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICB9XFxuICAgICAgICBcXG4gICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6L6T5YWl6YKu566x6aqM6K+B56CBXFxcXG5cXFwiICsgcmVzdWx0LmRldGFpbCkuaW5wdXQoKGNvbmZpcm0sIGlkLCBhY2NvdW50KSA9PiB7XFxuICAgICAgICAgICAgc2hvd0xvYWRpbmcoXFxcIuivt+iAkOW/g+etieW+hVxcXCIpO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGNvbmZpcm0sIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJyZWdpc3RfaWRcXFwiOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInl6bVxcXCI6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcIldhcmVob3VzZVVzZXJuYW1lXFxcIiwgYWNjb3VudFswXSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcIldhcmVob3VzZVBhc3N3b3JkXFxcIiwgYWNjb3VudFsxXSk7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aIkOWKn+aPkOS6pOazqOWGjOazqOWGjFxcXFxuXFxcIityZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBoaWRl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XG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0ucGV0TmFtZScsICcnKXx8ZGV2Lm5hbWUsXFxuICAgICAgICAgICAgb25DaGFuZ2U6ICdwdXRWYXIoXFxcIldhcmVob3VzZS5tLnBldE5hbWVcXFwiLGlucHV0KSdcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLkv53lrZhcXFwiLFxcbiAgICAgICAgdXJsOiAkKGdldEFwaShcXFwibW9kaWZ5X25hbWVcXFwiKSArIHBhdGgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgbmV3UGV0TmFtZSA9IGdldFZhcignV2FyZWhvdXNlLm0ucGV0TmFtZScsICcnKTtcXG4gICAgICAgICAgICBpZiAobmV3UGV0TmFtZSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L2g6L+Y5LuA5LmI6YO95rKh5aGr5ZWKIVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0ICsgXFxcIiZuYW1lPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQobmV3UGV0TmFtZSkpO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLn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tcXG4gICAgICAgICAgICBcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCArIFxcXCImYXZhdGFyX3VybD1cXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KG5ld0F2YXRhcikpO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxufVxcblxcbmZ1bmN0aW9uIG1fcHdkKCkge1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOlxcXCLljp/lr4bnoIFcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5Y6f5a+G56CBXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdHlwZTpcXFwicGFzc3dvcmRcXFwiLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0VmFyKCdXYXJlaG91c2UubS5QYXNzd29yZC55JywgJycpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiAncHV0VmFyKFxcXCJXYXJlaG91c2UubS5QYXNzd29yZC55XFxcIixpbnB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GFzc3dvcmQrXFxcIiZuZXdfcGFzc3dvcmRfcmU9XFxcIituZXdfcGFzc3dvcmRfYWdhaW4pO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvV2FyZWhvdXNlVVNFUi5qc29uXFxcIixKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1c2VybmFtZTp1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHBhc3N3b3JkOm5ld19wYXNzd29yZFxcbiAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0scGFzc3dvcmQsdXNlcm5hbWUpLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICB9KTtcXG59XFxuXFxuc3dpdGNoIChQYXR0ZXJuKSB7XFxuICAgIGNhc2UgMDpcXG4gICAgICAgIHNldFBhZ2VUaXRsZShcXFwi5L+u5pS55aS05YOPXFxcIik7XFxuICAgICAgICBtX2F2YXRhcigpO1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgMTpcXG4gICAgICAgIHNldFBhZ2VUaXRsZShcXFwi5L+u5pS55pi156ewXFxcIik7XFxuICAgICAgICBtX3BldE5hbWUoKTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIDI6XFxuICAgICAgICBzZXRQYWd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aWdodDotMSxcXG4gICAgICAgIG9uQ2hhbmdlOiAncHV0VmFyKFxcXCJXYXJlaG91c2UucnVsZS5ub3Rlc1xcXCIsaW5wdXQpJ1xcbiAgICB9XFxufSk7XFxuXFxuZGF0YS5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLkv53lrZhcXFwiLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICB1cmw6ICQoZ2V0QXBpKFxcXCJzZXRfcnVsZV9ub3RlXFxcIikgKyBpZCkubGF6eVJ1bGUoKHVzZXJuYW1lLCBwYXNzd29yZCkgPT4ge1xcbiAgICAgICAgbGV0IG5vdGVzID0gZ2V0VmFyKCdXYXJlaG91c2UucnVsZS5ub3RlcycsICcnKTtcXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiB1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5vdGVcXFwiOm5vdGVzXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvY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ID0gZ2V0VmFyKCdXYXJlaG91c2UuY29tbWVudC50ZXh0JywgJycpO1xcbiAgICAgICAgbGV0IFtxcSxhdXRoX2NvZGVdID0gQWNjb3VudDtcXG4gICAgICAgIGxldCB0eXBlID0gZ2V0VmFyKCdXYXJlaG91c2UuY29tbWVudC50eXBlJykgfHwgJ2dvb2QnO1xcbiAgICAgICAgcXE9cXF8fFxcXCJcXFwiO1xcbiAgICAgICAgYXV0aF9jb2RlPWF1dGhfY29kZXx8XFxcIlxcXCI7XFxuICAgICAgICBpZihxcT09XFxcIlxcXCJ8fGF1dGhfY29kZT09XFxcIlxcXCIpe1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mnKrnmbvlvZXotKblj7dcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYodGV4dD09XFxcIlxcXCIpe1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHlhpnllYpcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgZnVuY3Rpb24gcihwKSB7XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeShwKSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwID0ge1xcbiAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX3RleHR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XCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXFcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdDIgPSBKU09OLnBhcnNlKHJlcXVlc3QoYiArIFxcXCI/cXE9XFxcIiArIHFxKSk7XFxuICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0Mi5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgdGhyb3cgZTtcXG4gICAgICAgIH1cXG4gICAgICAgIH0sIHFxLCBhLCBiKTtcXG5cXG4gICAgfSwgYXBpLmRpc19uZXdfdXNlciwgYXBpLmRpc192ZXJpZnkpLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgdHlwZTogXFxcIm51bWJlclxcXCIsXFxuICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0ucXEnLCAnJykgfHwgdXNlck5hbWUsXFxuICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm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Jyk7XFxuICAgICAgICBsZXQgeXptID0gZ2V0VmFyKCdXYXJlaG91c2UubS55em0nLCAnJyk7XFxuICAgICAgICBpZiAocXEgPT0gXFxcIlxcXCIgfHwgeXptID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL3Fx5oiW6aqM6K+B56CB5Li656m6XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGxvZ2luLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiBxcSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJhdXRoX2NvZGVcXFwiOiB5em1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgIGYudXNlciA9IFtxcSwgeXptXTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvV2FyZWhvdXNlVVNFUi5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoZikpO1xcbiAgICAgICAgICAgIGxldCBpbmRleCA9IGwuZmluZEluZGV4KGl0ZW0gPT4gaXRlbVswXSA9PT0gcXEpO1xcbiAgICAgICAgICAgIGlmIChpbmRleCA+IC0xKSB7XFxuICAgICAgICAgICAg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0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX3RleHRcXFwiOiB0ZXh0LFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX2lkXFxcIjogcnVsZUlkXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICBiYWNrKGZhbHNlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG5cXG4gICAgfSwgcGFzc3dvcmQsIHVzZXJuYW1lLCByZXBseUlkKVxcbn0pO1xcblxcbnNldFJlc3VsdChkYXRhKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaIkeeahOWbnuWkjVwiLFwicGF0aFwiOlwiTXlSZXBseVwiLFwicnVsZVwiOlwianM6XFxuY29uc3Qge1xcbiAgICBhcGlcXG59ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ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VXBwZXJDYXNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxvZygn5byA5aeL6I635Y+W5rqQ56CBJyk7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgLypcXG4gICAgICAgICAgICAgICAgcmVxdWVzdEFzeW5jKHdlYl91cmwscGFyYW1zLGZ1bmN0aW9uIChrZXksY29kZSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IGNvZGU7XFxuICAgICAgICAgICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5Ys5bm26YOo5YiG5o+S5YWl5Yiw5paH5pys5Yy65Z+fJ1xcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPluWIsOepuuaWh+acrO+8jOeWkeS8vOS9oOayoeacieatpOaWh+S7tiEnO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IGdldEl0ZW0oJ2hvdXNlLmZpbGVfdWEnKT09PSfnlLXohJEnP2ZldGNoKHdlYl91cmwscGFyYW1zKTpyZXF1ZXN0KHdlYl91cmwscGFyYW1zKTtcXG4gICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgbG9nKGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lj5HnlJ/kuobplJnor686XFxcXG4nK2UubWVzc2FnZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgIGxvZygn5Li76aKY6ZO+5o6lJyk7XFxuICAgICAgICAgICAgbGV0IHdlYl91cmxfYXJyID0gaW5wdXQuc3BsaXQoJ++/pScpO1xcbiAgICAgICAgICAgIGxldCB3ZWJfdXJsID0gd2ViX3VybF9hcnJbd2ViX3VybF9hcnIubGVuZ3RoLTFdO1xcbiAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBwYXJzZVBhc3RlKHdlYl91cmwpO1xcbiAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIH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sIHtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2Uud2ViX3VybCcsUEFUSCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG9uQ2xpY2tUeXBlOidjb25maXJtJyxcXG4gICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qc3wudHh0fC5oaWtlcnwuanNvbnwuaHRtbFxcXCIsXFxuICAgICAgICAgICAgcGF0dGVybjogMCxcXG4gICAgICAgICAgICByZXF1aXJlVXJsOmZwLFxcbiAgICAgICAgICAgIGluaXRpYWxQYXRoOmdldFBhdGgoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS8nKS5zbGljZSg3KSxcXG4gICAgICAgICAgICBtZW1vcnk6J3RydWUnLFxcbiAgICAgICAgfSk7XFxuICAgIH0pLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOifkuIrkvKDnsbvlnosnLFxcbiAgICBkZXNjOifkuIrkvKDmlofku7bnmoTnsbvlnoss5b2T5YmN5Li6OicrY29sb3IoZ2V0SXRlbSgnaG91c2UuZmlsZV90eXBlJywn6Z2Z5oCB5paH5Lu2JyksJyNmZjcwMDAnKSxcXG4gICAgY29sX3R5cGU6J3RleHRfMScsXFxuICAgIHVybDokKGZpbGVfdHlwZV90aXRsZSwyKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgc2V0SXRlbSgnaG91c2UuZmlsZV90eXBlJyxpbnB1dC5yZXBsYWNlKCfwn5GJJywnJykpO1xcb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X3VybCkpe1xcbiAgICAgICAgICAgIGZpbGVOYW1lID0gd2ViX3VybC5zcGxpdCgnLycpW3dlYl91cmwuc3BsaXQoJy8nKS5sZW5ndGgtMV07XFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgIGxldCBia2FyciA9IHVwX2NvZGUuc3BsaXQoJ++/pScpO1xcbiAgICAgICAgICAgIGlmKGJrYXJyLmxlbmd0aDwzKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S6keWJqui0tOadv+WGheWuueacieivrydcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3dpdGNoIChia2FyclsxXSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3RoZW1lJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfc2luZ2xlJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2pzX3VybCc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ++/pScpWzJdLnNwbGl0KCdAJylbMF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM572R6aG16ZO+5o6l5peg5YaF5a65ISc7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdW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lXFxuICAgICAgICB9XFxuICAgICAgICBmdW5jdGlvbiBwcmludChzdHIpe1xcbiAgICAgICAgICAgIGlmKHR5cGVvZihsb2cpIT09J3VuZGVmaW5lZCcpe1xcbiAgICAgICAgICAgICAgICBsb2coc3RyKTtcXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhzdHIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGRtVXJsIG9mIGRtVXJscykge1xcbiAgICAgICAgICAgIGlmICgobmV3IFJlZ0V4cChkbVVybCkpLnRlc3QodmlkZW9VcmwpKSB7Ly/mkq3mlL7lnLDlnYDljIXlkKvlkIrmr5vmoIflv5fnmoTlnLDlnYBcXG4gICAgICAgICAgICAgICAgcHJpbnQoJ+WQiuavm+inhumikSzoh6rliqjov4fmu6Q6Jyt2aWRlb1VybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcHJpbnQoJ+mdnuWQiuavm+inhumikSzlj6/mkq3mlL46Jyt2aWRlb1VybCk7XFxuICAgICAgICByZXR1cm4gZmFsc2VcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBpc0RtKHJldCkge1xcbiAgICAgICAgaWYgKCFyZXQpIHtcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGhhc0RtKHJldC5zcGxpdCgnIycpWzBdLnNwbGl0KCc7JylbMF0sIGRtVXJscylcXG4gICAgfVxcbiAgICByZXR1cm4gaXNEbSh2aWRlb1VybClcXG59XFxuXFxuZnVuY3Rpb24gbGF6eVBhcnNlKHBsYXlVcmwsbXMsdG0scmVjaGFuZ2Upe1xcbiAgICAvLyBsb2coJ+iwg+eUqOS7k+W6k+WFjeWXheaOouS8oOWPgui2heaXtuS4ujonK21zKTtcXG4gICAgdG0g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ICAgICAgICAgICBldmFsKGZiYS5nZXRJbnRlcm5hbEpzKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJfeDVqeFVybFxcXCIscGxheVVybCk7XFxuICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5jb3VudCA9PSBudWxsKXtcXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudD0xO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT09MSl7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9jYXRpb24ucmVsb2FkKCk7XFxuICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50Oicrd2luZG93LmNvdW50KycsbWF4X2NvdW50OicrbWF4X2NvdW50KTtcXG4gICAgICAgICAgICAgICAgaWYoIHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpe1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi6LaF6L+HXFxcIittYXhfY291bnQqMjUwK1xcXCLmr6vnp5LmnKrojrflj5bliLDotYTmupDlnLDlnYDvvIzot7PliLDmupDnvZHpobUs5Lul5LiL5piv5Yqg6L296L+H55qE5Zyw5Z2AXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyh0ZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkoX2dldFVybHMoKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSwgdjIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJlbWJlZFxcXCIpLCB2MyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcIiNwbGF5ZXJcXFwiKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2aWRlb3MsIGZ1bmN0aW9uICh2aWRlbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2aWRlbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbChhdWRpb3MsIGZ1bmN0aW9uIChhdWRpbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKEpTT04uc3RyaW5naWZ5KHVybHMpKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFwvLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInZpZOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXC8vLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ2aWTliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBcXFwiK3Uuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLlhbbku5bliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy98aW5kZXhcXFxcLm0zdTgkXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXC8xXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1LHJlY2hhbmdlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFVybCk9PSdzdHJpbmcnJiYhaXNCYWRWaWRlbyh1KSl7Ly/ov4fmu6TlkIrmr5vop4bpopFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9meV9icmlkZ2VfYXBwLnNldFdlYlVhKFBDX1VBKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYS5nZXRIZWFkZXJVcmwpIT09J3VuZGVmaW5lZCcmJnR5cGVvZihyZWNoYW5nZSkhPT0nZnVuY3Rpb24nKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1LnJlcGxhY2UoXFxcIjt7XFxcIixcXFwiI2lzVmlkZW89dHJ1ZSM7e1xcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1cmxzW2ldKS5yZXBsYWNlKCc7eycsJyNpZ25vcmVJbWc9dHJ1ZSMjaXNWaWRlbz10cnVlIzt7Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTEgPSBiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSAnI2lnbm9yZUltZycrYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXC8vLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QxID0gdTEubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFwvLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBcXFwiaHR0cFxcXCIrdTEuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja1VybCA9IHUxICsgdTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCfov5Tlm57oh6rliqjliqBjb29raWXpk77mjqU6JytiYWNrVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coJ+i/lOWbnumTvuaOpTonK3UrJ+W5tuiHquWKqOWKoOS6hmNvb2tpZSzlhbfkvZNjb29raWXlnKjop4bpopHmkq3mlL7lpITmn6XnnIsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrVXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLov5Tlm57ku5PlupN4NeWFjeWXhee7k+aenDpcXFwiK3JlYWxVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgIC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ICQudG9TdHJpbmcoKGlzVmlkZW8sIG1heF9jb3VudCx4NVRpbWVvdXQsaXNCYWRWaWRlbykgPT4ge1xcbiAgICAgICAgLy/liJ3lp4vljJZmYmHlkoxyZXF1c3RcXG4gICAgICAgIGlmICh0eXBlb2YgKGZiYSkgPT0gJ3VuZGVmaW5lZCcgfHwgIWZiYSkge1xcbiAgICAgICAgICAgIHZhciBmYmEgPSBmeV9icmlkZ2VfYXBwO1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIChyZXF1ZXN0KSA9PSAndW5kZWZpbmVkJyB8fCAhcmVxdWVzdCkge1xcbiAgICAgICAgICAgICAgICBldmFsKGZiYS5nZXRJbnRlcm5hbEpzKCkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSk7XFxuICAgICAgICB9XFxuICAgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBpZiAod2luZG93LmNvdW50ID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50ID0gMTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHRleHQ9Jyc7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICBpZigv6Kem5Y+R5LqG6Ziy55uX6ZO+fOacquaOiOadg3zmjqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09MSl7XFxuICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6JyArIHdpbmRvdy5jb3VudCArICcsbWF4X2NvdW50OicgKyBtYXhfY291bnQpO1xcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KSB7XFxuICAgICAgICAgICAgICAgIGZiYS5jbGVhclZhcigneDVMaXN0Jyk7XFxuICAgICAgICAgICAgICAgIGZiYS5oaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICBsZXQgZm1zZyA9ICfpgZPplb/ku5PlupPpgJrlhY3op6PmnpDlpLHotKUs5Y6f5ZugOui2heaXticreDVUaW1lb3V0Kyfmr6vnp5InO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKGZtc2cpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytmbXNnO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGZ1bmN0aW9uIG11dGVNZShlbGVtKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSxcXG4gICAgICAgICAgICB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImVtYmVkXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiI3BsYXllclxcXCIpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHZpZGVvKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxuICAgICAgICAgICAgICAgIC8vdT1kZWNvZGVVUklDb21wb25lbnQodSk7XFxuICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxuICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwXFxcIit1LnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhcXFwi5YW25LuW5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcLzFcXFxcLm0zdTgkLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVmlkZW8odSk7XFxuICAgICAgICAgICAgICAgIGlmIChyZWFsVXJsJiYhaXNCYWRWaWRlbyh1KSkgey8v6L+H5ruk5ZCK5q+bXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLku5PlupN4NeWFjeWXhee7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WYodHlwZW9mKHJlYWxWaWRlbyk9PSdzdHJpbmcnKXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5bey6Kej5p6Q5Ye66KeG6aKROicrcmVhbFZpZGVvKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFsVmlkZW8rPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaChyZWFsVmlkZW8pO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn6Kej5p6Q5Ye65LiN55+l6YGT5LuA5LmI5Lic6KW/OicrdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCs9XFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaCh1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6anNvbuaOpeWPo+S4lOaXoOi/lOWbnuinhumikeWcsOWdgOaVsOaNrjonK3BsYXlVcmxMaXN0W2ldKydcXFxcbicrYmFja2NvZGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6eDXmjqXlj6Ms5Yqg5YWleDXll4XmjqLliJfooagnKTtcXG4gICAgICAgICAgICB4NWxpc3QucHVzaChwbGF5VXJsTGlzdFtpXSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgLy8gbG9nKHZpZGVvcyk7XFxuICAgIGlmKHZpZGVvcy5sZW5ndGg+MCl7XFxuICAgICAgICBpZihnZXRWYXIoJ2RwLmNhY2hlVmlkZW8nLCd0cnVlJyk9PT0ndHJ1ZScmJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIyNTUpXFxuICAgICAgICB7XFxuICAgICAgICAgICAgbG9nKFxcXCLlsIrmlaznmoTprZTmlq3nlKjmiLfvvIzop4bpopHnvJPlrZjlt7LlkK/nlKjvvIzor7flsL3mg4Xkuqvlj5fnnIvliafml7blhYlcXFwiKTtcXG4gICAgICAgICAgICBsZXQgdmlkZW9zQ2FjaGU9dmlkZW9zLm1hcCgoaXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzPXt9O1xcbiAgICAgICAgICAgICAgICBpZihpdC5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBoZWFkID0gaXQuc3BsaXQoJzsnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKC9ALy50ZXN0KGhlYWQpJiYve3x9Ly50ZXN0KGhlYWQpKXtcXG4vL2hlYWQgPSBoZWFkLnJlcGxhY2UoL3t8fS9nLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkID0gaGVhZC5zcGxpdChcXFwie1xcXCIpWzFdLnNwbGl0KFxcXCJ9XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoJyYmJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIGhlYWQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0gaGVhZFtpXS5zcGxpdCgnQCcpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPWhlYWRbaV0uc3BsaXQoJ0AnKVsxXS5yZXBsYWNlKC87LywnOycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzW2tleV0gPSB2YWx1ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHVybDppdC5zcGxpdChcXFwiO1xcXCIpWzBdLnNwbGl0KFxcXCLimIVcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6e1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6aGVhZGVyc1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdmFyIGRhdGE9YmF0Y2hDYWNoZU0zdTgodmlkZW9zQ2FjaGUpO1xcbiAgICAgICAgICAgIGRhdGE9ZGF0YS5tYXAoKGl0LGlkKT0+e1xcbiAgICAgICAgICAgICAgICBsZXQgZXh0cmE9XFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcIjtcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYT1cXFwiO1xcXCIrdmlkZW9zW2lkXS5zcGxpdChcXFwiO1xcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZih2aWRlb3NbaWRdLnNwbGl0KFxcXCLimIVcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYT1cXFwi4piFXFxcIit2aWRlb3NbaWRdLnNwbGl0KFxcXCLimIVcXFwiKVsxXTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBpZihpdCtcXFwiXFxcIiE9XFxcIm51bGxcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdCtleHRyYVxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2aWRlb3NbaWRdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAvL2xvZyhkYXRhKTtcXG4gICAgICAgICAgICByZXR1cm4gZGF0YVxcbiAgICAgICAgICAgIC8vcmV0dXJuIHZpZGVvc1xcbiAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgcmV0dXJuIHZpZGVvc1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxvZygn5YWx5pyJJyt4NWxpc3QubGVuZ3RoKyfkuKp4NeWcsOWdgOi/m+ihjOi9rua1geWXheaOoicpO1xcbiAgICAvL+ayoeacieeahOivneWwseW8gOWni+S+neasoXg15ZeF5o6iXFxuICAgIHNob3dMb2FkaW5nKCfll4XmjqLkuK3vvIzoi6XlpLHotKXlsLHliIfmjaJ3ZWLll4XmjqIuLi4nKTtcXG4gICAgcmV0dXJuIHg1UGFyc2VQcm8oeDVsaXN0LHg1VGltZW91dCxpc1ZpZGVvKTtcXG59XFxudmFyIGxhenk9JCgnJykubGF6eVJ1bGUoKCk9PntcXG4gICAgdHJ5e1xcbiAgICAgICAgcmVhbFVybD1pbnB1dDtcXG4gICAgICAgIGV2YWwoXFxcInZhciBjb25maWdfZHAgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICBldmFsKGZldGNoKGNvbmZpZ19kcC5jaikpO1xcbiAgICAgICAgbG9nKGlucHV0KyctPuato+WcqOaWreaPkumtlOaUueeJiOino+aekC4uLicpO1xcbiAgICAgICAgLy8g5Yqg5YWl6LaF5pe26K6+572u77yM5bu66K6u5Zyo6aaW6aG16K6+572uXFxuICAgICAgICByZXR1cm4gYXl0bVBhcnNlKHJlYWxVcmwpXFxuICAgIH1jYXRjaChlKXtcXG4gIC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AgbGV0IHJlc3VsdCA9IHJlcXVlc3QodGFza19hcGksIHtcXG4gICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICB9LFxcbiAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJkYXRhXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInR5cGVcXFwiOiB0YXNrLm1vZGV8fCdydW4nLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImZ1bmNcXFwiOiB0YXNrLmZ1bmN8fCcnLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHRhc2sucGFyYW1zfHxbXVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBcXFwiYXV0aFxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogaG91c2VfZGF0YS51c2VybmFtZXx8XFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBob3VzZV9kYXRhLnBhc3N3b3JkfHxcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICB9KTtcXG4gICAgcmV0dXJuIEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxufVxcblxcbmZ1bmN0aW9uIHRhc2tfdXBsb2FkKHRhc2speyAvLyDpgJrnlKjku7vliqHlj5HluIPmlrDlop7lj4rkv67mlLnlip/og71cXG4gICAgY29uc3Qge2FwaSxnZXRGaWxlfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3V0aWxpeT9ydWxlPemBk+mVv+S7k+W6k1Byb1xcXCIpO1xcbiAgICBsZXQgaG91c2VGaWxlID0gZ2V0RmlsZXx8ZmFsc2U7XFxuICAgIGlmKCFob3VzZUZpbGUpe1xcbiAgICAgICAgc2V0SXRlbSgnaXNfaG91c2VfdmlwJywgJ2ZhbHNlJyk7XFxuICAgIH1cXG4gICAgbGV0IGFwaV91cmwgPSBhcGkuaG9zdCsnL2hpa2VydWxlL3Rhc2svYWRkJztcXG4gICAgbGV0IGhvdXNlX2RhdGEgPSBob3VzZUZpbGUoKTtcXG4gICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoYXBpX3VybCwge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgIH0sXFxuICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IHRhc2submFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJweWNvZGVcXFwiOiB0YXNrLnB5Y29kZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJub3RlXFxcIjogdGFzay5ub3RlLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInRlc3RfY29kZVxcXCI6IHRhc2sudGVzdF9jb2RlLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBcXFwiYXV0aFxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogaG91c2VfZGF0YS51c2VybmFtZXx8XFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBob3VzZV9kYXRhLnBhc3N3b3JkfHxcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxc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lbmRfZGF0YSA9IHtcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHtcXFwiZGF0YVxcXCI6IHtcXFwiaW5mb1xcXCI6IGlucHV0X3RleHR9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZGV2X3NldF9pbmZvWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGRldl9zZXRfaW5mb1sxXX1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIC8vIGxvZyhzZW5kX2RhdGEpO1xcbiAgICAgICAgICAgIGxldCBwYXIyID0ge2hlYWRlcnM6eydjb250ZW50LXR5cGUnOidhcHBsaWNhdGlvbi9qc29uO2NoYXJzZXQ9VVRGLTgnLCdVc2VyLUFnZW50JzpkZXZfc2V0X2luZm9bM119LGJvZHk6SlNPTi5zdHJpbmdpZnkoc2VuZF9kYXRhKSxtZXRob2Q6J1BPU1QnfTtcXG4gICAgICAgICAgICAvLyBwYXIyID0gSlNPTi5zdHJpbmdpZnkocGFyMik7IC8veDXph4zpnaLor7fmsYLmiY3pnIDopoHnvJbnoIFcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgYmFja19yZXQgPSByZXF1ZXN0KGluZm9fc2V0X3VybCwgcGFyMik7XFxuICAgICAgICAgICAgICAgIGJhY2tfcmV0ID0gSlNPTi5wYXJzZShiYWNrX3JldCkucmVzdWx0O1xcbiAgICAgICAgICAgICAgICBpZihiYWNrX3JldC5zdGF0dXM9PT0wKXtcXG4gICAgICAgICAgICAgICAgICAgIC8vIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+d5a2Y5oiQ5YqfXFxcXG4nK2JhY2tfcmV0LmRldGFpbDtcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3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lbGVjdC5qc1xcXCIsIC8v5paH5Lu26YCJ5oup5ZmoXFxuICAgICAgICAgICAgZHQ6IFxcXCJkdC5qc1xcXCIsIC8v5Yqo5oCB5YiG57G7XFxuICAgICAgICAgICAgZHI6IFxcXCJkci5qc1xcXCIsIC8vZHLmqKHmnb/kvp3otZZcXG4gICAgICAgICAgICBkcnByZTogXFxcImRycHJlLmpzXFxcIiwgLy9kcuaooeadv+mihOWkhOeQhlxcbiAgICAgICAgICAgIGRydXA6IFxcXCJkcnVwLmpzXFxcIiwgLy9kcuaooeadv+iHquWKqOabtOaWsFxcbiAgICAgICAgICAgIGRybWF0Y2g6IFxcXCJkcm1hdGNoLmpzXFxcIiwgLy9kcuaooeadv+iHquWKqOaooeadv+WMuemFjVxcbiAgICAgICAgICAgIGRybTogXFxcImRybS5qc1xcXCIsIC8vZHLmqKHmnb/lsI/nqIvluo9cXG4gICAgICAgICAgICBjbXM6IFxcXCJjbXMuanNcXFwiLCAvL2Ntc+aooeadv+S+nei1llxcbiAgICAgICAgICAgIGNtc3ByZTogXFxcImNtc3ByZS5qc1xcXCIsIC8vY21z6aKE5aSE55CGXFxuICAgICAgICAgICAgY21zbTogXFxcImNtc20uanNcXFwiLCAvL2Ntc+aooeadv+Wwj+eoi+W6j1xcbiAgICAgICAgICAgIGxpYmNoZWNrOiBcXFwibGliY2hlY2suanNcXFwiLCAvL2Ry5qOA5rWL5L6d6LWWXFxuICAgICAgICAgICAgcnVsZUVkaXRvcjogXFxcInJ1bGVFZGl0b3IuanNcXFwiLCAvL+WGmemhtea6kOelnuWZqOWwj+eoi+W6j1xcbiAgICAgICAgICAgIGhvdXNlTGF6eTogXFxcImhvdXNlTGF6eS5qc1xcXCIsIC8v5LuT5bqT6YCa5YWNXFxuICAgICAgICAgICAgbGF6eTogXFxcImxhenkuanNcXFwiLCAvL+mmmeWFjVxcbiAgICAgICAgICAgIHN1YjogXFxcInN1Yi5qc1xcXCIsIC8v6YGT5b6357uP6K6i6ZiFXFxuICAgICAgICAgICAgaGlrZXJVaTogXFxcImhpa2VyVWkuanNcXFwiLCAvL+a1t+mYlOe7hOS7tuS+nei1llxcbiAgICAgICAgICAgIGhpa2VyTGliczogXFxcImhpa2VyTGlicy5qc1xcXCIsIC8v5rW36ZiU5YWo6IO95L6d6LWWXFxuICAgICAgICB9KTtcXG4gICAgfWNhdGNoKGUpe1xcbiAgICAgICAgLy90b2FzdCgn6K+35bCd6K+V54K55Ye75LuT5bqT5Li76aG155qE5Y2H57qn5LuT5bqT5peB6L6555qE5oyJ6ZKu5Y2H57qnJOaJqeWxle+8jOWQpuWImeafkOS6m+WKn+iDveS4jeiDveato+W4uOS9v+eUqCcpO1xcbiAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmj5DnpLot54K55Ye756Gu5a6a5Y+v5Lul5a+85YWlJyxcXG4gICAgICAgICAgICBjb250ZW50OiAn6K+35bCd6K+V54K55Ye75LuT5bqT5Li76aG155qE5Y2H57qn5LuT5bqT5peB6L6555qE5oyJ6ZKu5Y2H57qnJOaJqeWxle+8jOWQpuWImeafkOS6m+WKn+iDveS4jeiDveato+W4uOS9v+eUqCcsXFxuICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoKT0+e1xcbiAgICAgICAgICAgICAgICBjb25zdCB7Z2V0QXBpfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3V0aWxpeT9ydWxlPemBk+mVv+S7k+W6k1Byb1xcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZUhlYWQgPSAn5rW36ZiU6KeG55WM77yM572R6aG15o+S5Lu277+lanNfdXJs77+lJGhpa2VyQCc7XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBnZXRBcGkoJ2ltcG9ydFVybCcpK1xcXCI1MTExXFxcIjtcXG4gICAgICAgICAgICAgICAgbGV0IGltcG9ydFVybCA9ICdydWxlOi8vJytiYXNlNjRFbmNvZGUocnVsZUhlYWQrdXJsKT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aCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcIixcXG4gICAgICAgIHVybDogXFxcImFib3V0OmJsYW5rXFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCI1MCYmbGlzdFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChoLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQ7XFxuICAgICAgICAgICAgICAgIGh0bWwuaW5uZXJIVE1MID0gaDtcXG5cXG4gICAgICAgICAgICAgICAgY29uc3QgdGV4dENvbnRhaW5lciA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd0ZXh0Q29udGFpbmVyJyk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHRleHQgPSB0ZXh0Q29udGFpbmVyLmlubmVySFRNTDtcXG4gICAgICAgICAgICAgICAgdGV4dENvbnRhaW5lci5vbmNsaWNrPWZ1bmN0aW9uKCl7XFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cubG9jYXRpb24uaHJlZiA9IHVybHx8XFxcImFib3V0OmJsYW5rL25vdGljZVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8g6K6+572u5paH5pys5a655Zmo5a695bqm5Li65paH5pys5YaF5a6555qE5a695bqmXFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIuc3R5bGUud2lkdGggPSBgJHt0ZXh0Q29udGFpbmVyLm9mZnNldFdpZHRofXB4YDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5aSN5Yi25paH5pys5YaF5a655bm26L+95Yqg5Yiw5paH5pys5a655Zmo5ZCO6Z2iXFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIuaW5uZXJIVE1MICs9ICcgJyArIHRleHQ7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOWKqOaAgeiuoeeul+WKqOeUu+aMgee7reaXtumXtFxcbiAgICAgICAgICAgICAgICBjb25zdCBkdXJhdGlvbiA9ICh0ZXh0Q29udGFpbmVyLm9mZnNldFdpZHRoIC8gdGV4dENvbnRhaW5lci5wYXJlbnRFbGVtZW50Lm9mZnNldFdpZHRoKSAqIDEwO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgc3R5bGVFbGVtZW50cyA9IGRvY3VtZW50LmhlYWQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ3N0eWxlJyk7XFxuXFxuXFxuICAgICAgICAgICAgICAgIHN0eWxlRWxlbWVudHNbMl0uaW5uZXJIVE1MID0gYC5tYXJxdWVlIHNwYW4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xcbiAgICAgICAgICAgICAgICAgICAgcGFkZGluZy1sZWZ0OiAxMDAlO1xcbiAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uOiBtYXJxdWVlICR7ZHVyYXRpb259cyBsaW5lYXIgaW5maW5pdGVcXG4gICAgICAgICAgICAgICAgfWA7XFxuXFxuICAgICAgICAgICAgfSwgaHRtbCwgdXJsKSxcXG4gICAgICAgICAgICB1cmxJbnRlcmNlcHRvcjogJC50b1N0cmluZygoY29udGVudCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQ9PT1cXFwiYWJvdXQ6Ymxhbmsvbm90aWNlXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKGNvbnRlbnQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmYmEub3BlbihKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YWs5ZGKXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5kUnVsZTogXFxcImpzOlxcXCIgKyAkJCQudG9TdHJpbmcoKGNvbnRlbnQpID0+IHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dKSxjb250ZW50KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGNvbnRlbnQpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgY29udGVudCB8fCB0ZXh0KSxcXG4gICAgICAgIH1cXG4gICAgfSk7XFxufVwifV0sXCJwYXJhbXNcIjpcIntcXFwiaWRcXFwiOjcwNDgsXFxcImx2ZXJcXFwiOi0xfVwiLFwic2F2ZWRcIjpmYWxzZSxcInRpdGxlXCI6XCLpgZPplb/ku5PlupNQcm9cIixcInZlcnNpb25cIjowLFwidXJsXCI6XCJoaWtlcjovL3BhZ2UvcnVsZURldGFpbCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcIixcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJmaW5kX3J1bGVcIjpcImpzOlxcbiAgICBjb25zdCB7XFxuICAgICAgICBnZXRBcGksXFxuICAgICAgICBjb2xvcixcXG4gICAgICAgIHNtYWxsLFxcbiAgICAgICAgaHRtbFRhZyxcXG4gICAgICAgIGFwaSxcXG4gICAgICAgIG1kXFxuICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlsaXlcXFwiKTtcXG5sZXQge1xcbiAgICBpZCxcXG4gICAgbHZlcixcXG4gICAgaXNBbGxcXG59ID0gTVlfUEFSQU1TO1xcbmlmKGdldFBhcm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N0ZShpbXBvcnRfcnVsZS5zcGxpdChcXFwiXFxcXG5cXFwiKVswXSk7XFxuICAgICAgICAgICAgICAgIC8vcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICBpbXBvcnRVcmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUocnVsZUNvZGUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gaW1wb3J0VXJsXFxuICAgICAgICAgICAgfSxkYXRhSXRlbSxydWxlTGlzdEpzb24gKyBkYXRhSXRlbS5pZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlMlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcImNvbG9yOiAjZmY3MDAwXFxcIj7lr7zlhaXpgZPlvrfnu488L3NwYW4+JyxcXG4gICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoZGF0YUl0ZW0sc3ViVXJsKT0+e1xcbiAgICAgICAgICAgICAgICAvLyBsZXQgdGl0bGUgPSBcXFwiSC1cXFwiK2RhdGFJdGVtLm5hbWUrXFxcIi5cXFwiK2RhdGFJdGVtLmF1dGhvcjtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gXFxcIkotXFxcIitkYXRhSXRlbS5uYW1lLnNwbGl0KCcuJylbMF07XFxuICAgICAgICAgICAgICAgIGxldCBzdWJPYmogPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHN1YlVybCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL1xcXCIrdGl0bGUrXFxcIi5qc29uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvZGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgYWN0aXZlOiBmYWxzZSwvL+emgeeUqOW5tuWPkeabtOaWsFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBzaGFyZVRleHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoc3ViT2JqKSk7XFxuICAgICAgICAgICAgICAgIHZhciBwYXN0ZXMgPSBnZXRQYXN0ZXMoKTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHNoYXJlUGFzdGUoc2hhcmVUZXh0LHBhc3Rlcy5zbGljZSgtMSlbMF0pO1xcbiAgICAgICAgICAgICAgICBsZXQgaW1wb3J0X3J1bGU9IFxcXCLovbvlkIjpm4borqLpmIXvvJpcXFwiK3RpdGxlKydcXFxcbicrdXJsO1xcbiAgICAgICAgICAgICAgICBjb3B5KGltcG9ydF9ydWxlKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgcGF0aCA9ICdoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL3N1Yi5qc29uJztcXG4gICAgICAgICAgICAgICAgJC5yYyhjb25maWcubGliLnN1Yik7XFxuICAgICAgICAgICAgICAgIHJldHVybiDorqLpmIXlr7zlhaUocGF0aClcXG4gICAgICAgICAgICB9LGRhdGFJdGVtLHJ1bGVMaXN0SnNvbiArIGRhdGFJdGVtLmlkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGUyXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8c21hbGw+5o+Q56S677ya5byA5Y+R6ICF5Y2V54us5YiG5Lqr55qE5ZCI6ZuG5paH5Lu25Y+q6IO95Y2V54us5a+85YWl44CCPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICAgIC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oaGFzUnVsZSkge1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoXFxcIldhcmVob3VzZS5iYWNrXFxcIiwgXFxcIjFcXFwiKTtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gaG9tZStcXFwic0BcXFwiICsgbmFtZTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pyq5a6J6KOFXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBkYXRhSXRlbS5uYW1lLGFwaS5ob21lKSxcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICB9KVxcbn1cXG5sZXQgbWFuX3J1bGVfc2FmZSA9IGdldEFwaShcXFwibWFuUnVsZVNhZmVcXFwiKStkYXRhSXRlbS5pZDtcXG5sZXQgbWFuX3J1bGVfZ29vZCA9IGdldEFwaShcXFwibWFuUnVsZUdvb2RcXFwiKStkYXRhSXRlbS5pZDtcXG4vLyBkYXRhSXRlbS5pc19zYWZlO1xcbmlmKGdldFZhcignaG91c2UuaXNfbWFuYWdlcicpKXtcXG4gICAgZnVuY3Rpb24gc2V0SXNTYWZlKGZsYWcsbWFuX3J1bGVfc2FmZSkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfc2FmZSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfc2FmZVxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBmdW5jdGlvbiBzZXRJc0dvb2QoZmxhZyxtYW5fcnVsZV9nb29kKSB7XFxuICAgICAgICBmbGFnID0gZmxhZyB8fCAnJztcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChtYW5fcnVsZV9nb29kLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpc19nb29kXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+mjjumZqScsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn5qCH6K6w6K+l6KeE5YiZ5Li66aOO6ZmpP+mjjumZqeinhOWImeaXoOazleiiq+WvvOWFpScpLmNvbmZpcm0oKGlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKT0+e1xcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc1NhZmUoZmFsc2UsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifinIXmraPluLgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuato+W4uD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKHRydWUsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifimaXpnZ7kvJjotKgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumdnuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNHb29kKGZhbHNlLG1hbl9ydWxlX2dvb2QpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH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6XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICBsZXQgbW9udGggPSBkYXRlLmdldE1vbnRoKCkgKyAxO1xcXFxuICAgICAgICAgICAgbGV0IHN0ckRhdGUgPSBkYXRlLmdldERhdGUoKTtcXFxcbiAgICAgICAgICAgIGxldCBzdHJIb3VycyA9IGRhdGUuZ2V0SG91cnMoKTtcXFxcbiAgICAgICAgICAgIGxldCBzdHJNaW51dGVzID0gZGF0ZS5nZXRNaW51dGVzKCk7XFxcXG4gICAgICAgICAgICBsZXQgc3RyU2Vjb25kcyA9IGRhdGUuZ2V0U2Vjb25kcygpKzE7XFxcXG4gICAgICAgICAgICBpZiAobW9udGggPj0gMSAmJiBtb250aCA8PSA5KSB7XFxcXG4gICAgICAgICAgICAgICAgbW9udGggPSBcXFxcXFxcIjBcXFxcXFxcIiArIG1vbnRoXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAoc3RyRGF0ZSA+PSAwICYmIHN0ckRhdGUgPD0gOSkge1xcXFxuICAgICAgICAgICAgICAgIHN0ckRhdGUgPSBcXFxcXFxcIjBcXFxcXFxcIiArIHN0ckRhdGVcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChzdHJIb3VycyA+PSAwICYmIHN0ckhvdXJzIDw9IDkpIHtcXFxcbiAgICAgICAgICAgICAgICBzdHJIb3VycyA9IFxcXFxcXFwiMFxcXFxcXFwiICsgc3RySG91cnNcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChzdHJNaW51dGVzID49IDAgJiYgc3RyTWludXRlcyA8PSA5KSB7XFxcXG4gICAgICAgICAgICAgICAgc3RyTWludXRlcyA9IFxcXFxcXFwiMFxcXFxcXFwiICsgc3RyTWludXRlc1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHN0clNlY29uZHMgPj0gMCAmJiBzdHJTZWNvbmRzIDw9IDkpIHtcXFxcbiAgICAgICAgICAg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XBlOiBteV9jb2xfdHlwZSxcXFxcbiAgICAgICAgdXJsOiAkKGdldEFwaShcXFxcXFxcImdlbkF1dGhcXFxcXFxcIikgKyByZXFCeUdldCArIFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGJhY2sgPSByZXF1ZXN0KGlucHV0KTtcXFxcbiAgICAgICAgICAgIGxldCByZXQgPSBKU09OLnBhcnNlKGJhY2spO1xcXFxuICAgICAgICAgICAgaWYgKHJldC5zdGF0dXMgPT0gMCkge1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3sueUn+aIkOmaj+acuuWvhueggVxcXFxcXFxcblxcXFxcXFwiICsgcmV0LnJlc3VsdFxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+maj+acuuWvhueggeeUn+aIkOWksei0pVxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSk7XFxcXG4gICAgbGV0IHRpbWVPdmVyID0ge1xcXFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXFxcbiAgICB9O1xcXFxuICAgIGlmIChkYXRhSXRlbS50aW1lX292ZXIpIHtcXFxcbiAgICAgICAgdGltZU92ZXIudGl0bGUgPSBzbWFsbChjb2xvcihcXFxcXFxcIuefreaXtuWvhumSpVxcXFxcXFwiLCBcXFxcXFxcImdyZWVuXFxcXFxcXCIpICsgY29sb3IoXFxcXFxcXCIo4oaS5rC45LmFKVxcXFxcXFwiLCBcXFxcXFxcInJlZFxcXFxcXFwiKSk7XFxcXG4gICAgICAgIHRpbW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ICAgICAgICAgICAgICAgICB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1c2VybmFtZVxcXFxcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXNzd29yZFxcXFxcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJjYW5fdXBsb2FkXFxcXFxcXCI6ICEhZmxhZ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcXFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG4gICAgZGF0YS5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6J/CfmqvnpoHmraLkuIrkvKAnLFxcXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgIHVybDokKCfnpoHmraLor6XlvIDlj5HogIXkuIrkvKDop4TliJk/5L2g55qE5pON5L2c5bCG6KKr57O757uf6K6w5b2VJykuY29uZmlybSgoaWQsY2FuX3VwbG9hZF9hcGksc2V0VXBsb2FkKT0+e1xcXFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldFVwbG9hZChmYWxzZSxjYW5fdXBsb2FkX2FwaSk7XFxcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXFxcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJywn5ZCmJyk7XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxcXG4gICAgICAgIH0saWQsY2FuX3VwbG9hZF9hcGksc2V0VXBsb2FkKVxcXFxuICAgIH0pO1xcXFxuICAgIGRhdGEucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOifinIXlhYHorrjkuIrkvKAnLFxcXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgIHVybDokKCflhYHorrjor6XlvIDlj5HogIXkuIrkvKDop4TliJk/5L2g55qE5pON5L2c5bCG6KKr57O757uf6K6w5b2VJykuY29uZmlybSgoaWQsY2FuX3VwbG9hZF9hcGksc2V0VXBsb2FkKT0+e1xcXFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldFVwbG9hZCh0cnVlLGNhbl91cGxvYWRfYXBpKTtcXFxcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcXFxuICAgICAgICAgICAgICAgIHB1dFZhcignV2FyZWhvdXNlLmNhbl91cGxvYWQnLCfmmK8nKTtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytyZXRcXFxcbiAgICAgICAgfSxpZCxjYW5fdXBsb2FkX2FwaSxzZXRVcGxvYWQpXFxc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dldFZhcignaG91c2UudXNlcm5hbWUnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImlzX3NhZmVcXFxcXFxcIjogISFmbGFnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBmdW5jdGlvbiBzZXRJc0dvb2QoZmxhZyxtYW5fcnVsZV9nb29kKSB7XFxcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChtYW5fcnVsZV9nb29kLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBNT0JJTEVfVUF9LFxcXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInVzZXJuYW1lXFxcXFxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImlzX2dvb2RcXFxcXFxcIjogISFmbGFnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBkYXRhLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTon8J+aq+mjjumZqScsXFxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumjjumZqT/po47pmanop4TliJnml6Dms5Xooqvlr7zlhaUnKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXFxc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KS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXFxcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc0dvb2QoZmFsc2UsbWFuX3J1bGVfZ29vZCk7XFxcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytyZXRcXFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9nb29kLHNldElzR29vZClcXFxcbiAgICB9KTtcXFxcbiAgICBkYXRhLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTon8J+SluS8mOi0qCcsXFxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXFxcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc0dvb2QodHJ1ZSxtYW5fcnVsZV9nb29kKTtcXFxcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcXFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX2dvb2Qsc2V0SXNHb29kKVxcXFxuICAgIH0pO1xcXFxufVxcXFxuXFxcXG5kYXRhLnB1c2goe1xcXFxuICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxufSk7XFxcXG5kYXRhLnB1c2goe1xcXFxuIC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VybmFtZSwgcGFzc3dvcmQsIG5hbWVdLmluY2x1ZGVzKFxcXFxcXFwiXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+i0puWPtyzlr4bnoIHlkozmmLXnp7DkuI3og73kuLrnqbpcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBzaG93TG9hZGluZyhcXFxcXFxcIuato+WcqOaPkOS6pOeUs+ivt+ihqFxcXFxcXFwiKTtcXFxcbiAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXFxcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwicGFyYW1zXFxcXFxcXCI6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWFzb25cXFxcXFxcIjogZGVzY3JpcHRpb24sXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IHBhc3N3b3JkLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInFxXFxcXFxcXCI6IHVzZXJuYW1lXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICBtZXRob2Q6ICdwb3N0J1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXFxcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXFxcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8vXFxcXFxcXCIgKyByZXN1bHQuZGV0YWlsO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBpZHJlc3VsdCA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRJZCArIFxcXFxcXFwiP3FxPVxcXFxcXFwiICsgdXNlcm5hbWUpKTtcXFxcbiAgICAgICAgaWYgKGlkcmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9cXFxcXFxcIiArIGlkcmVzdWx0LmRldGFpbDtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBcXFxcbiAgICAgICAgcmV0dXJuICQoXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLovpPlhaXpgq7nrrHpqozor4HnoIFcXFxcXFxcXG5cXFxcXFxcIiArIHJlc3VsdC5kZXRhaWwpLmlucHV0KChjb25maXJtLCBpZCwgYWNjb3VudCkgPT4ge1xcXFxuICAgICAgICAgICAgc2hvd0xvYWRpbmcoXFxcXFxcXCLor7fogJDlv4PnrYnlvoVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGNvbmZpcm0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhcmFtc1xcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWdpc3RfaWRcXFxcXFxcIjogaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ5em1cXFxcXFxcIjogaW5wdXRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXFxcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL1xcXFxcXFwiICsgcmVzdWx0LmRldGFpbDtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcXFxcXCJXYXJlaG91c2VVc2VybmFtZVxcXFxcXFwiLCBhY2NvdW50WzBdKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXFxcXFwiV2FyZWhvdXNlUGFzc3dvcmRcXFxcXFxcIiwgYWNjb3VudFsxXSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/miJDlip/mj5DkuqTms6jlhozms6jlhoxcXFxcXFxcXG5cXFxcXFxcIityZXN1bHQuZGV0YWlsO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIC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b2xfdHlwZTogJ2lucHV0JyxcXFxcbiAgICBkZXNjOiBcXFxcXFxcIuivt+i+k+WFpXFxXFxcXFxcXCIsXFxcXG4gICAgdXJsOiAkLnRvU3RyaW5nKChhLCBiKSA9PiB7XFxcXG4gICAgICAgIGxldCBxcSA9IGlucHV0O1xcXFxuICAgICAgICBpZiAocXEgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHloavllYohXFxcXFxcXCI7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcXFxcXCLojrflj5bkuK0uLi5cXFxcXFxcIilcXFxcbiAgICAgICAgcmV0dXJuICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocXEsIGEsIGIpID0+IHtcXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGEsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJxcVxcXFxcXFwiOiBxcVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc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0ucXEnLCAnJyk7XFxcXG4gICAgICAgIGxldCB5em0gPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnl6bScsICcnKTtcXFxcbiAgICAgICAgaWYgKHFxID09IFxcXFxcXFwiXFxcXFxcXCIgfHwgeXptID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8vcXHmiJbpqozor4HnoIHkuLrnqbpcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChsb2dpbiwge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInFxXFxcXFxcXCI6IHFxLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImF1dGhfY29kZVxcXFxcXFwiOiB5em1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcXFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcXFxuICAgICAgICAgICAgZi51c2VyID0gW3FxLCB5em1dO1xcXFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9XYXJlaG91c2VVU0VSLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkoZikpO1x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yq55m75b2V6LSm5Y+3XFxcXFxcXCI7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaWYgKHRleHQgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHlhpnllYpcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImRpc2N1c3NfdGV4dFxcXFxcXFwiOiB0ZXh0LFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInFxXFxcXFxcXCI6IHVzZXJuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IHBhc3N3b3JkLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImRpc2N1c3NfaWRcXFxcXFxcIjogcnVsZUlkXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXFxcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXFxcbiAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcXFxuICAgICAgICB9XFxcXG4gICAgIC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9hcnJbMV0udG9VcHBlckNhc2UoKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxvZygn5byA5aeL6I635Y+W5rqQ56CBJyk7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIC8qXFxcXG4gICAgICAgICAgICAgICAgcmVxdWVzdEFzeW5jKHdlYl91cmwscGFyYW1zLGZ1bmN0aW9uIChrZXksY29kZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgYmFja19jb2RlID0gY29kZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAqL1xcXFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBnZXRJdGVtKCdob3VzZS5maWxlX3VhJyk9PT0n55S16ISRJz9mZXRjaCh3ZWJfdXJsLHBhcmFtcyk6cmVxdWVzdCh3ZWJfdXJsLHBhcmFtcyk7XFxcXG4gICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXFxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPluWIsOepuuaWh+acrO+8jOeWkeS8vOS9oOayoeacieatpOaWh+S7tiEnO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lj5HnlJ/kuobplJnor686XFxcXFxcXFxuJytlLm1lc3NhZ2U7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1lbHNlIGlmKC/kuLvpopjvv6V85YWD57Sg77+lLy50ZXN0KGlucHV0KSl7XFxcXG4gICAgICAgICAgICBsb2coJ+S4u+mimOmTvuaOpScpO1xcXFxuICAgICAgICAgICAgbGV0IHdlYl91cmxfYXJyID0gaW5wdXQuc3BsaXQoJ++/pScpO1xcXFxuICAgICAgICAgICAgbGV0IHdlYl91cmwgPSB3ZWJfdXJsX2Fyclt3ZWJfdXJsX2Fyci5sZW5ndGgtMV07XFxcXG4gICAgICAgICAgICBsZXQgYmFja19jb2RlID0gcGFyc2VQYXN0ZSh3ZWJfdXJsKTtcXFxcbiAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApIHtcXFxcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2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blVyaSh7XFxcXG4gICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKFxcXFxcXFwiZmlsZVBhdGhcXFxcXFxcIikuZXh0cmE7XFxcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShcXFxcXFxcImZpbGVQYXRoXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLndlYl91cmwnLFBBVEgpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcXFxuICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICBvbkNsaWNrVHlwZTonY29uZmlybScsXFxcXG4gICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIuanN8LnR4dHwuaGlrZXJ8Lmpzb258Lmh0bWxcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHBhdHRlcm46IDAsXFxcXG4gICAgICAgICAgICByZXF1aXJlVXJsOmZwLFxcXFxuICAgICAgICAgICAgaW5pdGlhbFBhdGg6Z2V0UGF0aCgnaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlLycpLnNsaWNlKDcpLFxcXFxuICAgICAgICAgICAgbWVtb3J5Oid0cnVlJyxcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfSksXFxcXG4gICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxufSk7XFxcXG5kLnB1c2goe1xcXFxuICAgIHRpdGxlOifkuIrkvKDnsbvlnosnLFxcXFxu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v+WGheWuueacieivrydcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHN3aXRjaCAoYmthcnJbMV0pIHtcXFxcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3RoZW1lJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfjgIwnKVsxXS5zcGxpdCgn44CNJylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfc2luZ2xlJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfjgIwnKVsxXS5zcGxpdCgn44CNJylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2pzX3VybCc6XFxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn77+lJylbMl0uc3BsaXQoJ0AnKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOe9kemhtemTvuaOpeaXoOWGheWuuSEnO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCB1YSA9IGdldEl0ZW0oJ2hvdXNlLmZpbGVfdWEnKT09PSfnlLXohJEnPydNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wOyBXaW42NDsgeDY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvODguMC40MzI0LjE0NiBTYWZhcmkvNTM3LjM2JzonTW96aWxsYS81LjAgKExpbnV4OyBBbmRyb2lkIDk7IE1JIDYpIEFwcGxlV2ViS2l0LzUzNy4z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HtcXFxcbiAgICAgICAgZG1VcmxzID0gW107XFxcXG4gICAgfVxcXFxuXFxcXG4gICAgZnVuY3Rpb24gaGFzRG0odmlkZW9VcmwsIGRtVXJscykgey8v5pKt5pS+5Zyw5Z2A5piv5ZCm5Li65ZCK5q+b6KeG6aKRXFxcXG4gICAgICAgIGlmIChkbVVybHMubGVuZ3RoIDwgMSkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgZnVuY3Rpb24gcHJpbnQoc3RyKXtcXFxcbiAgICAgICAgICAgIGlmKHR5cGVvZihsb2cpIT09J3VuZGVmaW5lZCcpe1xcXFxuICAgICAgICAgICAgICAgIGxvZyhzdHIpO1xcXFxuICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhzdHIpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGZvciAobGV0IGRtVXJsIG9mIGRtVXJscykge1xcXFxuICAgICAgICAgICAgaWYgKChuZXcgUmVnRXhwKGRtVXJsKSkudGVzdCh2aWRlb1VybCkpIHsvL+aSreaUvuWcsOWdgOWMheWQq+WQiuavm+agh+W/l+eahOWcsOWdgFxcXFxuICAgICAgICAgICAgICAgIHByaW50KCflkIrmr5vop4bpopEs6Ieq5Yqo6L+H5rukOicrdmlkZW9VcmwpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgcHJpbnQoJ+mdnuWQiuavm+inhumikSzlj6/mkq3mlL46Jyt2aWRlb1VybCk7XFxcXG4gICAgICAgIHJldHVybiBmYWxzZVxcXFxuICAgIH1cXFxcblxcXFxuICAgIGZ1bmN0aW9uIGlzRG0ocmV0KSB7XFxcXG4gICAgICAgIGlmICghcmV0KSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZVxcXF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jaGUvdmlkZW8ubTN1OFxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgLy93cml0ZUZpbGUobGNhY2hlLGJhY2spO1xcXFxuICAgICAgICAgICAgLy9yZXR1cm4gbGNhY2hlK1xcXFxcXFwiIyNcXFxcXFxcIitwbGF5VXJsK1xcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIlxcXFxuICAgICAgICAgICAgcGxheVVybD1jYWNoZU0zdTgocGxheVVybCk7XFxcXG4gICAgICAgICAgICByZXR1cm4gcGxheVVybFxcXFxuICAgICAgICB9ZWxzZSBpZigoIS/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdChiYWNrKSkmJighL2h0dHB8dXJsLy50ZXN0KGJhY2spKSYmKCEvbXNnfGNvZGV8aHRtbC8udGVzdChiYWNrKSkpe1xcXFxuICAgICAgICAgICAgbG9nKGJhY2spO1xcXFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+eWkeS8vOWvueaWueaVsOaNruWKoOWvhuS6hu+8jOWFt+S9k+aVsOaNrueci+aXpeW/lydcXFxcbiAgICAgICAgfVxcXFxuICAgIH1jYXRjaChlKXtcXFxcbiAgICAgICAgbG9nKGUubWVzc2FnZSk7XFxcXG4gICAgICAgIHJldHVybiBiYWRcXFxcbiAgICB9XFxcXG4gICAgdHJ5IHtcXFxcbiAgICAgICAgYmFjaz1KU09OLnBhcnNlKGJhY2spO1xcXFxuICAgICAgICBsZXQgcmVhbFVybD1iYWNrLnVybDtcXFxcbiAgICAgICAgaWYodHlwZW9mKHJlYWxVcmwpPT1cXFxcXFxcInVuZGVmaW5lZFxcXFxcXFwifHwhcmVhbFVybCl7XFxcXG4gICAgICAgICAgICBsb2coYmFjayk7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+mBk+mVv+S7k+W6k+ino+aekOWksei0pe+8gei/lOWbnuaSreaUvuWcsOWdgOS4uuepulxcXF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G1heF9jb3VudD1NYXRoLmNlaWwobXMvMjUwKTtcXFxcbiAgICAgICAgbG9nKFxcXFxcXFwi5pys5qyh5ZeF5o6i6LaF5pe2OlxcXFxcXFwiK21zK1xcXFxcXFwi5YWx6K6h5b6F5oqT5YyFOlxcXFxcXFwiK21heF9jb3VudCtcXFxcXFxcIuasoVxcXFxcXFwiKTtcXFxcbiAgICAgICAgc2hvd0xvYWRpbmcoJ+WXheaOouS4re+8jOiLpeWksei0peWwseWIh+aNondlYuWXheaOoi4uLicpO1xcXFxuICAgICAgICBsZXQgX3g1ID0gJC50b1N0cmluZygoaXNWaWRlbyxyZWNoYW5nZSxwbGF5VXJsLG1heF9jb3VudCxQQ19VQSxpc0JhZFZpZGVvKT0+e1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBpZih0eXBlb2YoZmJhKT09J3VuZGVmaW5lZCd8fCFmYmEpe1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZmJhID0gZnlfYnJpZGdlX2FwcDtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlcXVlc3QpPT0ndW5kZWZpbmVkJ3x8IXJlcXVlc3Qpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmYmEuZ2V0SW50ZXJuYWxKcygpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGZiYS5wdXRWYXIoXFxcXFxcXCJfeDVqeFVybFxcXFxcXFwiLHBsYXlVcmwpO1xcXFxuICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5jb3VudCA9PSBudWxsKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNvdW50PTE7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFxcXFxcImJvZHlcXFxcXFxcIikuaW5uZXJUZXh0O1xcXFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXFxcbiAgICAgICAgICAgICAgICBpZigv6Kem5Y+R5LqG6Ziy55uX6ZO+fOacquaOiOadg3zmjqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09PTEpe1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXFxcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvY2F0aW9uLnJlbG9hZCgpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWZiYS5nZXRWYXIoXFxcXFxcXCJfeDVqeFVybFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxcXG4gICAgICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6Jyt3aW5kb3cuY291bnQrJyxtYXhfY291bnQ6JyttYXhfY291bnQpO1xcXFxuICAgICAgICAgICAgICAgIGlmKCB3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KXtcXFxcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFxcXFxcIui2hei/h1xcXFxcXFwiK21heF9jb3VudCoyNTArXFxcXFxcXCLmr6vnp5LmnKrojrflj5bliLDotYTmupDlnLDlnYDvvIzot7PliLDmupDnvZHpobUs5Lul5LiL5piv5Yqg6L296L+H55qE5Zyw5Z2AXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFxcXFxcImJvZHlcXFxcXFxcIikuaW5uZXJUZXh0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyh0ZXh0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKEpTT04uc3RyaW5naWZ5KF9nZXRVcmxzKCkpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZiYS5nZXRWYXIoXFxcXFxcXCJfeDVqeFVybFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0ucGF1c2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHZhciB2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXFxcXFwidmlkZW9cXFxcXFxcIiksIGF1ZGlvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcXFxcXCJhdWRpb1xcXFxcXFwiKSwgdjIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXFxcXFwiZW1iZWRcXFxcXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFxcXFxcIiNwbGF5ZXJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHZpZGVvcywgZnVuY3Rpb24gKHZpZGVvKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbChhdWRpb3MsIGZ1bmN0aW9uIChhdWRpbykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjIsIGZ1bmN0aW9uICh2KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYzLCBmdW5jdGlvbiAodikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXFxcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKEpTT04uc3RyaW5naWZ5KHVybHMpKTtcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGkgaW4gdXJscykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXFxcXFwidXJsPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFxcXFxcInVybOWIhuWJsjpcXFxcXFxcIit1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXFxcXFwvLy50ZXN0KHUpJiYvXFxcXFxcXFwubTN1OC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXFxcXFwvXFxcXFxcXFwvKC4qPylcXFxcXFxcXC8vKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXFxcXFwidXJsPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFxcXFxcInVybOWIhuWJsjpcXFxcXFxcIit1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFxcXFxcInZpZD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCJ2aWTliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFxcXFxcLy8udGVzdCh1KSYmL1xcXFxcXFxcLm0zdTgvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0ID0gdS5tYXRjaCgvKC4qKVxcXFxcXFxcL1xcXFxcXFxcLyguKj8pXFxcXFxcXFwvLylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFxcXFxcInZpZD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCJ2aWTliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcXFxcXD8oLiopPWh0dHAvLnRlc3QodSkmJi9cXFxcXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJodHRwXFxcXFxcXCIrdS5zcGxpdCgvXFxcXFxcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCLlhbbku5bliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3xpbmRleFxcXFxcXFxcLm0zdTgkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcXFxcXC8xXFxcXFxcXFwubTN1OC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1PXUucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1LHJlY2hhbmdlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVXJsKT09J3N0cmluZycmJiFpc0JhZFZpZGVvKHUpKXsvL+i/h+a7pOWQiuavm+inhumikVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZnlfYnJpZGdlX2FwcC5zZXRXZWJVYShQQ19VQSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYS5nZXRIZWFkZXJVcmwpIT09J3VuZGVmaW5lZCcmJnR5cGVvZihyZWNoYW5nZSkhPT0nZnVuY3Rpb24nKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGV0IGJhY2tVcmwgPSBmYmEuZ2V0SGVhZGVyVXJsKHUucmVwbGFjZShcXFxcXFxcIjt7XFxcXFxcXCIsXFxcXFxcXCIjaXNWaWRlbz10cnVlIzt7XFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tVcmwgPSBmYmEuZ2V0SGVhZGVyVXJsKHVybHNbaV0pLnJlcGxhY2UoJzt7JywnI2lnbm9yZUltZz10cnVlIyNpc1ZpZGVvPXRydWUjO3snKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUxID0gYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSAnI2lnbm9yZUltZycrYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1MSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFxcXFxcInVybD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFxcXFxcLy8udGVzdCh1MSkmJi9cXFxcXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdDEgPSB1MS5tYXRjaCgvKC4qKVxcXFxcXFxcL1xcXFxcXFxcLyguKj8pXFxcXFxcXFwvLylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXFxcXFwidXJsPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXFxcXFwidXJs5YiG5YmyOlxcXFxcXFwiK3UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUxKSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnNwbGl0KFxcXFxcXFwidmlkPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXFxcXFwvLy50ZXN0KHUxKSYmL1xcXFxcXFxcLm0zdTgvLnRlc3QodTEpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXFxcXFwvXFxcXFxcXFwvKC4qPylcXFxcXFxcXC8vKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcXFxcXCJ2aWQ9XFxcXFxcXCIpLnNsaWNlKC0xKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcXFxcXD8oLiopPWh0dHAvLnRlc3QodTEpJiYvXFxcXFxcXFwubTN1OC8udGVzdCh1MSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBcXFxcXFxcImh0dHBcXFxcXFxcIit1MS5zcGxpdCgvXFxcXFxcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tVcmwgPSB1MSArIHUyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCfov5Tlm57oh6rliqjliqBjb29raWXpk77mjqU6JytiYWNrVXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZygn6L+U5Zue6ZO+5o6lOicrdSsn5bm26Ieq5Yqo5Yqg5LqGY29va2llLOWFt+S9k2Nvb2tpZeWcqOinhumikeaSreaUvuWkhOafpeeciycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFja1VybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFxcXFxcIui/lOWbnuS7k+W6k3g15YWN5ZeF57uT5p6cOlxcXFxcXFwiK3JlYWxVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbFVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAvLyBmeV9icmlkZ2VfYXBwLmxvZygneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcXFxuICAgICAgICAgICAgICAgIGFsZXJ0KCd4NeWkp+iMg+WbtOmUmeivrzonK2UubWVzc2FnZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aKpemUmee7k+adn3g1J1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LGlzVmlkZW8scmVjaGFuZ2UscGxheVVybCxtYXhfY291bnQsUENfVUEsaXNCYWRWaWRlbyk7XF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IGV2YWwoZmJhLmdldEludGVybmFsSnMoKSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLVxcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgaWYgKHdpbmRvdy5jb3VudCA9PSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50ID0gMTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcXFxcXCJib2R5XFxcXFxcXCIpLmlubmVyVGV4dDtcXFxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXFxcbiAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT0xKXtcXFxcbiAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcXFxcbiAgICAgICAgICAgICAgICBmYmEubG9nKFxcXFxcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxcXG4gICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonICsgd2luZG93LmNvdW50ICsgJyxtYXhfY291bnQ6JyArIG1heF9jb3VudCk7XFxcXG4gICAgICAgICAgICBpZiAod2luZG93LmNvdW50ID49IG1heF9jb3VudCkge1xcXFxuICAgICA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GlvbiAodmlkZW8pIHtcXFxcbiAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXFxcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB2YXIgdXJscyA9IF9nZXRVcmxzKCk7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHVybHMpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcXFxuICAgICAgICAgICAgICAgIC8vdT1kZWNvZGVVUklDb21wb25lbnQodSk7XFxcXG4gICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcXFxcXCJ1cmw9XFxcXFxcXCIpLnNsaWNlKC0xKVswXTtcXFxcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFxcXFxcInZpZD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcXFxcXD8oLiopPWh0dHAvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJodHRwXFxcXFxcXCIrdS5zcGxpdCgvXFxcXFxcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coXFxcXFxcXCLlhbbku5bliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFxcXFxcLzFcXFxcXFxcXC5tM3U4JC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB1PXUucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVmlkZW8odSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHJlYWxVcmwmJiFpc0JhZFZpZGVvKHUpKSB7Ly/ov4fmu6TlkIrmr5tcXFxcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFxcXFxcIuS7k+W6k3g15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ICAgIGxldCBwVXJsPWNhY2hlTTN1OCh0dXJsKTtcXFxcbiAgICAgICAgICAgIHZpZGVvcy5wdXNoKHBVcmwpO1xcXFxuICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIGxldCB1cmwgPSBKU09OLnBhcnNlKGJhY2tjb2RlKS51cmw7XFxcXG4gICAgICAgICAgICBpZigvXmh0dHAvLnRlc3QodXJsKSl7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJlYWxWaWRlbyA9IGlzVmlkZW8odXJsKTtcXFxcbiAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFZpZGVvKT09J3N0cmluZycpe1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+W3suino+aekOWHuuinhumikTonK3JlYWxWaWRlbyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlYWxWaWRlbys9XFxcXFxcXCLimIVcXFxcXFxcIitqbmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHZpZGVvcy5wdXNoKHJlYWxWaWRlbyk7XFxcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn6Kej5p6Q5Ye65LiN55+l6YGT5LuA5LmI5Lic6KW/OicrdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsKz1cXFxcXFxcIiNpc1ZpZGVvPXRydWUjXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCs9XFxcXFxcXCLimIVcXFxcXFxcIitqbmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHZpZGVv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lmKC9ALy50ZXN0KGhlYWQpJiYve3x9Ly50ZXN0KGhlYWQpKXtcXFxcbi8vaGVhZCA9IGhlYWQucmVwbGFjZSgve3x9L2csJycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoXFxcXFxcXCJ7XFxcXFxcXCIpWzFdLnNwbGl0KFxcXFxcXFwifVxcXFxcXFwiKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQgPSBoZWFkLnNwbGl0KCcmJicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIGhlYWQpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBrZXkgPSBoZWFkW2ldLnNwbGl0KCdAJylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID1oZWFkW2ldLnNwbGl0KCdAJylbMV0ucmVwbGFjZSgvOy8sJzsnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzW2tleV0gPSB2YWx1ZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6aXQuc3BsaXQoXFxcXFxcXCI7XFxcXFxcXCIpWzBdLnNwbGl0KFxcXFxcXFwi4piFXFxcXFxcXCIpWzBdLFxcXFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOntcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6aGVhZGVyc1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB2YXIgZGF0YT1iYXRjaENhY2hlTTN1OCh2aWRlb3NDYW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xcbiAgICAgICAgfSxcXFxcbiAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwiZGF0YVxcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidHlwZVxcXFxcXFwiOiB0YXNrLm1vZGV8fCdydW4nLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImZ1bmNcXFxcXFxcIjogdGFzay5mdW5jfHwnJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjogdGFzay5wYXJhbXN8fFtdXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBcXFxcXFxcImF1dGhcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIm5hbWVcXFxcXFxcIjogaG91c2VfZGF0YS51c2VybmFtZXx8XFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXNzd29yZFxcXFxcXFwiOiBob3VzZV9kYXRhLnBhc3N3b3JkfHxcXFxcXFxcIlxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KSxcXFxcbiAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICB9KTtcXFxcbiAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXFxcbn1cXFxcblxcXFxuZnVuY3Rpb24gdGFza191cGxvYWQodGFzayl7IC8vIOmAmueUqOS7u+WKoeWPkeW4g+aWsOWinuWPiuS/ruaUueWKn+iDvVxcXFxuICAgIGNvbnN0IHthcGksZ2V0RmlsZX0gPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ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XCI6IHtcXFxcXFxcImluZm9cXFxcXFxcIjogaW5wdXRfdGV4dH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIm5hbWVcXFxcXFxcIjogZGV2X3NldF9pbmZvWzBdLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXNzd29yZFxcXFxcXFwiOiBkZXZfc2V0X2luZm9bMV19XFxcXG4gICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgLy8gbG9nKHNlbmRfZGF0YSk7XFxcXG4gICAgICAgICAgICBsZXQgcGFyMiA9IHtoZWFkZXJzOnsnY29udGVudC10eXBlJzonYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04JywnVXNlci1BZ2VudCc6ZGV2X3NldF9pbmZvWzNdfSxib2R5OkpTT04uc3RyaW5naWZ5KHNlbmRfZGF0YSksbWV0aG9kOidQT1NUJ307XFxcXG4gICAgICAgICAgICAvLyBwYXIyID0gSlNPTi5zdHJpbmdpZnkocGFyMik7IC8veDXph4zpnaLor7fmsYLmiY3pnIDopoHnvJbnoIFcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGJhY2tfcmV0ID0gcmVxdWVzdChpbmZvX3NldF91cmwsIHBhcjIpO1xcXFxuICAgICAgICAgICAgICAgIGJhY2tfcmV0ID0gSlNPTi5wYXJzZShiYWNrX3JldCkucmVzdWx0O1xcXFxuICAgICAgICAgICAgICAgIGlmKGJhY2tfcmV0LnN0YXR1cz09PTApe1xcXFxuICAgICAgICAgICAgICAgICAgICAvLyByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+d5a2Y5oiQ5YqfXFxcXFxcXFxuJytiYWNrX3JldC5kZXRhaWw7XFxcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/k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ZUVkaXRvcjogXFxcXFxcXCJydWxlRWRpdG9yLmpzXFxcXFxcXCIsIC8v5YaZ6aG15rqQ56We5Zmo5bCP56iL5bqPXFxcXG4gICAgICAgICAgICBob3VzZUxhenk6IFxcXFxcXFwiaG91c2VMYXp5LmpzXFxcXFxcXCIsIC8v5LuT5bqT6YCa5YWNXFxcXG4gICAgICAgICAgICBsYXp5OiBcXFxcXFxcImxhenkuanNcXFxcXFxcIiwgLy/pppnlhY1cXFxcbiAgICAgICAgICAgIHN1YjogXFxcXFxcXCJzdWIuanNcXFxcXFxcIiwgLy/pgZPlvrfnu4/orqLpmIVcXFxcbiAgICAgICAgICAgIGhpa2VyVWk6IFxcXFxcXFwiaGlrZXJVaS5qc1xcXFxcXFwiLCAvL+a1t+mYlOe7hOS7tuS+nei1llxcXFxuICAgICAgICAgICAgaGlrZXJMaWJzOiBcXFxcXFxcImhpa2VyTGlicy5qc1xcXFxcXFwiLCAvL+a1t+mYlOWFqOiDveS+nei1llxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9Y2F0Y2goZSl7XFxcXG4gICAgICAgIC8vdG9hc3QoJ+ivt+WwneivleeCueWHu+S7k+W6k+S4u+mhteeahOWNh+e6p+S7k+W6k+aXgei+ueeahOaMiemSruWNh+e6pyTmianlsZXvvIzlkKbliJnmn5Dkupvlip/og73kuI3og73mraPluLjkvb/nlKgnKTtcXFxcbiAgICAgICAgY29uZmlybSh7XFxcXG4gICAgICAgICAgICB0aXRsZTogJ+aPkOekui3ngrnlh7vnoa7lrprlj6/ku6Xlr7zlhaUnLFxcXFxuICAgICAgICAgICAgY29udGVudDogJ+ivt+WwneivleeCueWHu+S7k+W6k+S4u+mhteeahOWNh+e6p+S7k+W6k+aXgei+ueeahOaMiemSruWNh+e6pyTmianlsZXvvIzlkKbliJnmn5Dkupvlip/og73kuI3og73mraPluLjkvb/nlKgnLFxcXFxuICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoKT0+e1xcXFxuICAgICAgICAg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bnRFbGVtZW50O1xcXFxuICAgICAgICAgICAgICAgIGh0bWwuaW5uZXJIVE1MID0gaDtcXFxcblxcXFxuICAgICAgICAgICAgICAgIGNvbnN0IHRleHRDb250YWluZXIgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgndGV4dENvbnRhaW5lcicpO1xcXFxuICAgICAgICAgICAgICAgIGNvbnN0IHRleHQgPSB0ZXh0Q29udGFpbmVyLmlubmVySFRNTDtcXFxcbiAgICAgICAgICAgICAgICB0ZXh0Q29udGFpbmVyLm9uY2xpY2s9ZnVuY3Rpb24oKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmx8fFxcXFxcXFwiYWJvdXQ6Ymxhbmsvbm90aWNlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIC8vIOiuvue9ruaWh+acrOWuueWZqOWuveW6puS4uuaWh+acrOWGheWuueeahOWuveW6plxcXFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIuc3R5bGUud2lkdGggPSBgJHt0ZXh0Q29udGFpbmVyLm9mZnNldFdpZHRofXB4YDtcXFxcblxcXFxuICAgICAgICAgICAgICAgIC8vIOWkjeWItuaWh+acrOWGheWuueW5tui/veWKoOWIsOaWh+acrOWuueWZqOWQjumdolxcXFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIuaW5uZXJIVE1MICs9ICcgJyArIHRleHQ7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAvLyDliqjmgIHorqHnrpfliqjnlLvmjIHnu63ml7bpl7RcXFxcbiAgICAgICAgICAgICAgICBjb25zdCBkdXJhdGlvbiA9ICh0ZXh0Q29udGFpbmVyLm9mZnNldFdpZHRoIC8gdGV4dENvbnRhaW5lci5wYXJlbnRFbGVtZW50Lm9mZnNldFdpZHRoKSAqIDEwO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgdmFyIHN0eWxlRWxlbWVudHMgPSBkb2N1bWVudC5oZWFkLmdldEVsZW1lbnRzQnlUYWdOYW1lKCdzdHlsZScpO1xcXFxuXFxcXG5cXFxcbiAgICAgICAgICAgICAgICBzdHlsZUVsZW1lbnRzWzJdLmlubmVySFRNTCA9IGAubWFycXVlZSBzcGFuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xcXFxuICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDEwMCU7XFxcXG4gICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogbWFycXVlZSAke2R1cmF0aW9ufXMgbGluZWFyIGluZmluaXRlXFxcXG4gICAgICAgICAgICAgICAgfWA7XFxcXG5cXFxcbiAgICAgICAgICAgIH0sIGh0bWwsIHVybCksXFxcXG4gICAgICAgICAgICB1cmxJbnRlcmNlcHRvcjogJC50b1N0cmluZygoY29udGVudCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dD09PVxcXFxcXFwiYWJvdXQ6Ymxhbmsvbm90aWNlXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKGNvbnRlbnQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLlhazlkYpcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IycsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZFJ1bGU6IFxcXFxcXFwianM6XFxcXFxcXCIgKyAkJCQudG9TdHJpbmcoKGNvbnRlbnQpID0+IHNldFJlc3VsdChbe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogY29udGVudCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwicmljaF90ZXh0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfV0pLGNvbnRlbnQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGNvbnRlbnQpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIGNvbnRlbnQgfHwgdGV4dCksXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbn1cXFwifV1cIixcInByb3h5XCI6XCJcIn0iLCJwaWNVcmwiOiJodHRwczovL2ltZy52aW51YS5jbi9pbWFnZXMvSUQyWkwudGgucG5nIiwidGl0bGUiOiLjgIzkupHpobZUVkFQUOOAjSJ9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement