Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥规则管理@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKTgeWIl+ihqEFQSVwiLFwicGF0aFwiOlwiUXVhcmtTaGFyZUFwaVwiLFwicnVsZVwiOlwianM6XFxuLy9AYXV0aG9yIExveURnSWtcXG5sZXQgaHR0cFJlcXVlc3QgPSAkLnJlcXVpcmUoXFxcImh0dHBSZXF1ZXN0XFxcIik7XFxuY29uc3QgYmFzZVVybCA9IFxcXCJodHRwczovL3Bhbi5xdWFyay5jblxcXCI7XFxuXFxuZnVuY3Rpb24gUXVhcmtTaGFyZUFwaShzaGFyZUlkLCBzaGFyZVB3ZCkge1xcbiAgICB0aGlzLnNoYXJlSWQgPSBzaGFyZUlkO1xcbiAgICB0aGlzLnNoYXJlUHdkID0gc2hhcmVQd2Q7XFxuICAgIHRoaXMucmVmcmVzaENhbGxCYWNrID0gKCgpID0+IHZvaWQgMCk7XFxuICAgIC8vdGhpcy5zaGFyZVRva2VuID0gc2hhcmVUb2tlbiB8fCB0aGlzLmdldFNoYXJlVG9rZW4oKTtcXG59XFxuT2JqZWN0LmFzc2lnbihRdWFya1NoYXJlQXBpLnByb3RvdHlwZSwge1xcbi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7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZXJyID0gdGhpcy5lcnJvclR5cGVDYWxsYmFjayhlcnIsIHJlcyk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodGhpcy5yZXRyeUNvdW50KSB7XFxuICAgICAgICAgICAgICAgIGxldCB0cnlSZXN1bHQgPSB0aGlzLmVycm9yQ2FsbGJhY2tXaXRoUmV0cnkoZXJyLCByZXMsIHRoaXMpO1xcbiAgICAgICAgICAgICAgICBpZiAodHJ5UmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldHJ5Q291bnQtLTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnN0YXJ0KHRvSnNvbik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldHJ5Q291bnQgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZXJyb3JDYWxsYmFjayhlcnIsIHJlcyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5lcnJvckNhbGxiYWNrKGVyciwgcmVzKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIHNldE9wdGlvbnMob3B0aW9ucykge1xcbiAgICAgICAgdGhpcy5vcHRpb25zID0gT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucywge1xcbiAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICBtZXJnZUhlYWRBbmRCb2R5KG9wdGlvbnMpIHtcXG4gICAgICAgIG9wdGlvbnMgPSBvcHRpb25zIHx8IHt9O1xcb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AgICAgIHVybDogJChbXFxcIui3s+i9rOWkuOWFi0FQUFxcXCIsIFxcXCLnmbvlvZVcXFwiLCBcXFwi5Y6f55S75LiL6L2957q/56iLXFxcIl0pLnNlbGVjdCgoc2hhcmVJZCkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIui3s+i9rOWkuOWFi0FQUFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJxa2xpbms6Ly93d3cudWMuY24vYjIwYjg0ZmQ3MzVhOGRkM2Y3NTQxMTI5YmFjYzRlOWE/YWN0aW9uPW9wZW5fdXJsJnVybD1odHRwczovL3Bhbi5xdWFyay5jbi9zL1xcXCIgKyBzaGFyZUlkO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09IFxcXCLnmbvlvZVcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFwi6L6T5YWlQ29va2llXFxcIiwgXFxcIue9kemhteeZu+W9lVxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi572R6aG155m75b2VXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL2xvZ2luXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaVDb29raWVcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcInRvb2xcXFwiKS5pc0xvZ2luQ29va2llKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwicXVhcmtDb29raWVcXFwiLCBpbnB1dC5yZXBsYWNlKC9cXFxccy9nLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09IFxcXCLljp/nlLvkuIvovb3nur/nqItcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKGdldEl0ZW0oXFxcInNwZWVkVGhyZWFkXFxcIiwgXFxcIjEwXFxcIiksIFxcXCLor7fovpPlhaUzLTMy5LmL6Ze055qE5pW05pWwXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNwZWVkVGhyZWFkID0gcGFyc2VJbnQoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNwZWVkVGhyZWFkIDwgMyB8fCBzcGVlZFRocmVhZCA+IDMyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruS4jeWQiOazlVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJzcGVlZFRocmVhZFxcXCIsIFN0cmluZyhzcGVlZFRocmVhZCkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4g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BpdGVtLmluY2x1ZGVfaXRlbXMgKyAn6aG5ICAnLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8yNy5zdmdcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvcXVhcmtMaXN0P3BhZ2U9ZnlwYWdlXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHN0eWxlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVJZCxcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlUHdkLFxcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVUb2tlbjogcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZUlkOiBpdGVtLmZpZCxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogZ2V0SGVhZChpdGVtLm9ial9jYXRlZ29yeSkgKyBpdGVtLmZpbGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogJC5kYXRlRm9ybWF0KGl0ZW0udXBkYXRlZF9hdCwgJ3l5eXktTU0tZGQnKSArICcgICcgKyBmb3JtYXRTaXplKGl0ZW0uc2l6ZSksXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGl0ZW0udGh1bWJuYWlsLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoZmlkLCBmaWRfdG9rZW4sIHB3ZF9pZCwgc3Rva2VuLCBjYXRlZ29yeSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxDYWNoZSA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJwbGF5VXJsQ2FjaGVcXFwiLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocGxheVVybENhY2hlW2ZpZF0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybENhY2hlW2ZpZF07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSAkLnJlcXVpcmUoXFxcInBsYXlcXFwiKS5nZXRQbGF5VXJsKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlVcmxDYWNoZVtmaWRdID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJwbGF5VXJsQ2FjaGVcXFwiLCBwbGF5VXJsQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uZmlkLCBpdGVtLnNoYXJlX2ZpZF90b2tlbiwgc2hhcmVJZCwgcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLCBpdGVtLm9ial9jYXRlZ29yeSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzdHlsZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLmZpZCxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5bGlzdCAnICsgaXRlbS5vYmpfY2F0ZWdvcnlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFx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UmVzID0gZ2V0UHJldmlld1ZpZGVvKGFzZmlkKTtcXG4gICAgICAgICAgICBsZXQgdmlkZW9MaXN0ID0gdmlkZW9SZXMuZGF0YS52aWRlb19saXN0O1xcbiAgICAgICAgICAgIGxldCBwbGF5TGlzdCA9IHtcXG4gICAgICAgICAgICAgICAgbmFtZXM6IFtdLFxcbiAgICAgICAgICAgICAgICB1cmxzOiBbXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogW11cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGxldCBwbGF5Q29va2llID0gY29va2llTWFuYWdlLmdldCgpO1xcbiAgICAgICAgICAgIHZpZGVvTGlzdC5maWx0ZXIodiA9PiB2LmFjY2Vzc2FibGUpLmZvckVhY2godiA9PiB7XFxuICAgICAgICAgICAgICAgIHBsYXlMaXN0Lm5hbWVzLnB1c2godi5yZXNvbHV0aW9uKTtcXG4gICAgICAgICAgICAgICAgcGxheUxpc3QudXJscy5wdXNoKHYudmlkZW9faW5mby51cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiKTtcXG4gICAgICAgICAgICAgICAgcGxheUxpc3QuaGVhZGVycy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIFJlZmVyZXI6IFxcXCJodHRwOi8vcGFuLnF1YXJrLmNuL1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb29raWU6IHBsYXlDb29raWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJjb20uc3R1Yi5TdHViQXBwLzEuMy4wIChMaW51eDtBbmRyb2lkIDE0KSBBbmRyb2lkWE1lZGlhMy8xLjEuMVxcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY3JlYXRlRGVsZXRlVGFzayhhc2ZpZCk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHBsYXlMaXN0KTtcXG4gICAg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GVzYzogXFxcImZsb2F0JiYxMDAlXFxcIixcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIGpzOiAkLnRvU3RyaW5nKChBcGlSb290VXJsKSA9PiB7XFxuICAgICAgICAgICAgbGV0IHRpbWVJbnRlciA9IHNldEludGVydmFsKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IENvb2tpZSA9IGZiYS5nZXRDb29raWUoQXBpUm9vdFVybCk7XFxuICAgICAgICAgICAgICAgIGlmIChDb29raWUuaW5jbHVkZXMoXFxcIl9VUF9GN0VfOERfPVxcXCIpICYmIENvb2tpZS5pbmNsdWRlcyhcXFwiX191aWQ9XFxcIikmJkNvb2tpZS5pbmNsdWRlcyhcXFwiX19wdXVzPVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJxdWFya0Nvb2tpZVxcXCIsIENvb2tpZSlcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZUludGVyKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coQ29va2llKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5iYWNrKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIDYwMCk7XFxuICAgICAgICB9LCBcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY25cXFwiKSxcXG4gICAgICAgIHVhOiBQQ19VQSxcXG4gICAgICAgIGpzTG9hZGluZ0luamVjdDogZmFsc2VcXG4gICAgfVxcbn0pO1xcbnNldFJlc3VsdChkKVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pOB55m75b2V5qOA5rWLXCIsXCJwYXRoXCI6XCJ0b29sXCIsXCJydWxlXCI6XCJqczpcXG4kLmV4cG9ydHMgPSB7XFxuICAgIGlzTG9naW5Db29raWUoY29va2llKSB7XFxuICAgICAgICByZXR1cm4gISEoY29va2llICYmIGNvb2tpZS5pbmNsdWRlcyhcXFwiX1VQX0Y3RV84RF89XFxcIikgJiYgY29va2llLmluY2x1ZGVzKFxcXCJfX3VpZD1cXFwiKSAmJiBjb29raWUuaW5jbHVkZXMoXFxcIl9fcHV1cz1cXFwiKSk7XFxuICAgIH0sXFxuXFxuXFxuXFxuXFxuICAgIHNldFJ1bGUoaW5wdXQpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgLy8g5qC85byP5YyWXFxuICAgICAgICAgICAgW2xvZ1QsIHR5cGUsIHRleHRdID0gU3RyaW5nKGlucHV0KS5zcGxpdChcXFwi77+lXFxcIik7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcodHlwZSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnUGFzdGUnOlxcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHBhcnNlUGFzdGUodGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnTGFuem91JzpcXG4gICAgICAgICAgICAgICAgICAgIFt1cmwsIHB3ZF0gPSB0ZXh0LnNwbGl0KFxcXCIjI1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZHVybCA9ICQucmVxdWlyZSgnbGFuem91P3J1bGU9dWNra+S6kScpLm9uZV91cmwodXJsLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IFN0cmluZyhmZXRjaChkdXJsKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoKHNwID0gdGV4dC5zcGxpdChcXFwi77+lXFxcIikpLmxlbmd0aCA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHNwWzJdLnNwbGl0KFxcXCJAXFxcIilbMF0udHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGFycjEgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZSh0ZXh0KSk7XFxuXFxuXFxuICAgICAgICAgICAgLy8g5ZCI5bm277yM5Y676YeNXFxuICAgICAgICAgICAgYXJyMiA9ICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5nZXRKc29uKCk7XFxuICAgICAgICAgICAgYXJyMyA9IGFycjEuY29uY2F0KGFycjIpLmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gb2JqLmdyb3VwID09PSBvLmdyb3VwICYmIG9iai50aXRsZSA9PT0gby50aXRsZSAmJiAob2JqLnRpbWUgPiBvLnRpbWUgfHwgb2JqLnRpbWUgPT0gby50aW1lKSkgPT09IGluZGV4O1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5zYXZlSnNvbihhcnIzKTtcXG5cXG5cXG4gICAgICAgICAgICAvLyDorqHnrpfkvZnph49cXG4gICAgICAgICAgICB4ID0gYXJyMy5sZW5ndGggLSBhcnIyLmxlbmd0aDtcXG4gICAgICAgICAgICBmID0gYXJyMS5sZW5ndGggLSB4XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5oiQ5Yqf77yM5paw5aKe77yaXFxcIiArIHggKyBcXFwiIOimhueblu+8mlxcXCIgKyBmKTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5aSx6LSlXFxcIik7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuXFxuICAgIHNldEVkaXQoKSB7XFxuICAgICAgICBfID0ge1xcbiAgICAgICAgICAgIGdyb3VwOiBnZXR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iAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9ICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5nZXRKc29uKCk7XFxuICAgICAgICAgICAgICAgIHVpZHMgPSBqeGxpc3QubWFwKF9fID0+IG1kNShfXy5ncm91cCArIF9fLnRpdGxlKSk7XFxuICAgICAgICAgICAgICAgIGkgPSB1aWRzLmluZGV4T2YoZ2V0TXlWYXIoJ3J1bGVfdWlkJywgJy0xJykpO1xcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0LnB1c2goXyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEsIF8pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdGlkJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdWlkJyk7XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9IGp4bGlzdC5maWx0ZXIoKG9iaiwgaW5kZXgsIGFycikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBtZDUob2JqLmdyb3VwICsgb2JqLnRpdGxlKSA9PT0gbWQ1KG8uZ3JvdXAgKyBvLnRpdGxlKSAmJiAob2JqLnRpbWUgPiBvLnRpbWUgfHwgb2JqLnRpbWUgPT09IG8udGltZSkpID09PSBpbmRleDtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5zYXZlSnNvbihqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgJ3Rv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gICAgIHBhZ2UyID0gcGFnZTtcXG4gICAgICAgICAgICAgICAgJDEuc3BsaXQoXFxcIkBcXFwiKS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhZ2UyO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIClcXG4gICAgICAgIC5yZXBsYWNlKC9meXBhZ2UvZywgcGFnZSlcXG4gICAgICAgIC5yZXBsYWNlKFxcbiAgICAgICAgICAgIC9meShjbGFzc3xhcmVhfHllYXJ8c29ydCkvZyxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiBydWxlWyQxICsgJ191cmwnXVtldmFsKCQxICsgJ19pJyldIHx8IFxcXCJcXFwiXFxuICAgICAgICApXFxuICAgICAgICAucmVwbGFjZShcXG4gICAgICAgICAgICAvZnlBbGwvZyxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxuICAgICAgICAgICAgICAgIEZ5QWxsX2lpID0gRnlBbGxfaTtcXG4gICAgICAgICAgICAgICAgaWYgKEZ5QWxsX2lpID4gKHJ1bGUuY2xhc3NfaSAtIDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICBGeUFsbF9paSAtPSBydWxlLmNsYXNzX2k7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoRnlBbGxfaWkgPiAocnVsZS5hcmVhX2kgLSAxKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEZ5QWxsX2lpIC09IHJ1bGUuYXJlYV9pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLnllYXJfaSAtIDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLnNvcnRfdXJsW0Z5QWxsX2lpIC0gcnVsZS55ZWFyX2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLnllYXJfdXJsW0Z5QWxsX2lpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmFyZWFfdXJsW0Z5QWxsX2lpXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmNsYXNzX3VybFtGeUFsbF9paV07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICApO1xcbiAgICByZXR1cm4gYmFzZVU7XFxufVxcbmNvbnN0IGdldFJ1bGVHcm91cCA9IChjb2xfdHlwZSwgU291KSA9PiB7XFxuICAgIGZvciAoaXQgb2YgWydjbGFzcycsICdhcmVhJywgJ3llYXInLCAnc29ydCddKSB7XFxuICAgICAgICBldmFsKGBpbmRleCA9IHtcXG4gICAgY2xhc3M6IDAsXFxuICAgIGFyZWE6IHJ1bGUuY2xhc3NfaSxcXG4gICAgeWVhcjogcnVsZS5jbGFzc19pICsgcnVsZS5hcmVhX2ksXFxuICAgIHNvcnQ6IHJ1bGUuY2xhc3NfaSArIHJ1bGUuYXJlYV9pICsgcnVsZS55ZWFyX2ksXFxufVtpdF1cXG5ydWxlLiR7aXR9X25hbWUubWFwKChuYW1lLCBpKSA9PiB7XFxuICAgIGlmIChpc0Z5QWxsKSB7XFxuICAgICAgICBpID0gaW5kZXggKyBpO1xcbiAgICAgICAgdCA9IEZ5QWxsX2kgPT0gaTtcXG4gICAgICAgIGsgPSAnRnlBbGxfaSc7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICB0ID0gJHtpdH1faSA9PSBpO1xcbiAgICAgICAgayA9ICcke2l0fV9pJ1xcbiAgICB9XFxuICAgIGQucHV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dCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleXdvcmQyJywgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjpzZWFyY2hcXFwiLFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ2tleXdvcmQnLGlucHV0KVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdXJsOiBcXFwidG9hc3Q6Ly/liqDovb3kuK0uLi5cXFwiLFxcbiAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3dlaXN5ci9pbWcvTG9hZGluZzEuZ2lmXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicGljXzFfY2VudGVyXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgY2xzOiBcXFwibG9hZGluZ19naWZcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBzZXRQcmVSZXN1bHQoZCk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p265rip6aao5o+Q56S6XCIsXCJwYXRoXCI6XCJub3RpY2VcIixcInJ1bGVcIjpcIiQuZXhwb3J0cyA9IGZ1bmN0aW9uKCkge1xcbiAgICBmID0gXFxcIkdyYXlcXFwiO1xcbiAgICB0ID0gZmFsc2U7XFxuICAgIHVwID0gZ2V0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnJyk7XFxuICAgIGlmICh1cCAhPSAnMScpIHtcXG4gICAgICAgIHZlcnNpb24gPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vaG9tZUB1Y2tr5LqRXFxcIikpLnZlcnNpb247XFxuICAgICAgICBpZiAodXAgPT0gJycpIHtcXG4gICAgICAgICAgICBbdXJsLCB2LCBydW5dID0gJC5yZXF1aXJlKFxcXCJsYW56b3U/cnVsZT11Y2tr5LqRXFxcIikubGlzdF9vbmUoXFxcImh0dHBzOi8vd3dyLmxhbnpvdWkuY29tL2IwM3FmMjhxYlxcXCIsIFxcXCJyZWFkXFxcIik7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHVybCA9IGZhbHNlO1xcbiAgICAgICAgICAgIHYgPSB2ZXJzaW9uICsgMTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh2ZXJzaW9uIDwgdikge1xcbiAgICAgICAgICAgIGYgPSBcXFwicmVkXFxcIjtcXG4gICAgICAgICAgICB0ID0gXFxcIuajgOa1i+WIsOaWsOeJiOabtOaWsO+8jOeCueWHu+S6huino+ivpuaDheOAglxcXCI7XFxuICAgICAgICAgICAgVCA9IFxcXCLmm7TmlrDlhoXlrrlcXFwiO1xcbiAgICAgICAgICAgIGlmICh1cCA9PSAnJykge1xcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5pu05paw5o+Q56S6JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICfmo4DmtYvliLDkvaDnmoTop4TliJnniYjmnKzlsI/kuo7mnI3liqHlmajniYjmnKzvvIzmmK/lkKbnq4vljbPmm7TmlrDvvJ8nLFxcbiAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoZGEpID0+I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cXCIpO1xcbiAgICAgICAgZiA9IFxcXCJyZWRcXFwiO1xcbiAgICAgICAgVCA9IFxcXCLnmbvlvZXotKblj7dcXFwiO1xcbiAgICAgICAgdCA9IFxcXCLmnKrmo4DmtYvliLDnmbvlvZXkv6Hmga9cXFwiO1xcbiAgICAgICAgdXJsID0gJChbXFxcIui+k+WFpUNvb2tpZVxcXCIsIFxcXCLnvZHpobXnmbvlvZVcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLnvZHpobXnmbvlvZVcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL2xvZ2luXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpUNvb2tpZVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcInRvb2xcXFwiKS5pc0xvZ2luQ29va2llKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInF1YXJrQ29va2llXFxcIiwgaW5wdXQucmVwbGFjZSgvXFxcXHMvZywgXFxcIlxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7miJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSBlbHNlIGlm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O1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycjEpIHtcXG4gICAgICAgICAgICAgICAgZXZhbChodG1sLm1hdGNoKC92YWx1ZVxcXFw7KFtcXFxcc1xcXFxTXSs/KVxcXFwkXFxcXCgvaSlbMV0pO1xcbiAgICAgICAgICAgICAgICBldmFsKCdib2R5PScgKyBodG1sLm1hdGNoKC9bXFxcXHNcXFxcU10qZGF0YSA6KFtcXFxcc1xcXFxTXSo/XFxcXH0pLFxcXFxzKy8pWzFdKTtcXG4gICAgICAgICAgICAgICAgdSA9IFN0cmluZyh1cmwpLnJlcGxhY2UoL1xcXFwuY29tLiovLCBcXFwiLmNvbS9hamF4bS5waHBcXFwiKTtcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZC5oZWFkZXJzXFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgcGF0aCA9IF8udXJsO1xcbiAgICAgICAgICAgICAgICBob3N0ID0gXy5kb207XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdSA9IGhvc3QgKyBcXFwiL2ZpbGUvXFxcIiArIHBhdGg7XFxuICAgICAgICBrID0gSlNPTi5wYXJzZShmZXRjaCh1LCB7XFxuICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvbjtcXG4gICAgICAgIGsgPSBBcnJheS5pc0FycmF5KGspID8ga1swXSA6IGs7XFxuICAgICAgICBpZiAocnVuKSByZXR1cm4gaztcXG4gICAgICAgIGxldCBmID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvX2ZpbGVTZWxlY3RfcnVsZS5qc29uXFxcIjtcXG4gICAgICAg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fSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIubWRvJiZIdG1sXFxcIikucmVwbGFjZSgvKDxcXFxcL3NwYW4+KT9cXFxccyo8c3Bhbj4vZ2ksIFxcXCI8YnI+XFxcIiksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8Yj7igJzigJznoa7lrprmm7TmlrDigJ3igJ08L2I+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgodXJsLCBwd2QsIGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdSdWxlX25vdXBkYXRlJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICBvbmVfdXJsXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9sYW56b3U/cnVsZT3mrYzor43pgILphY1cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IEsgPSBvbmVfdXJsKHVybCwgcHdkLCAxLCAwLCBpdGVtKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwsIHB3ZCwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwuc3BsaXQoXFxcIj9cXFwiKVswXSwgcHdkLCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoSykge1xcbiAgICAgICAgICAgICAgICAgICAgZiA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0X3J1bGUuanNvblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoSywgZik7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ojrflj5bkuIvovb3pk77mjqXlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgdXJsLCBwd2QsIGl0ZW0pLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p275p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B7XFxuICAgICAgICB6eSA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgenUgPSBPYmplY3Qua2V5cyh6eSk7XFxuICAgICAgICBpZiAoenUubGVuZ3RoID09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ6YCJ5Lit6Kej5p6QXFxcIjtcXG4gICAgICAgIH0gZWxzZSBpZiAoenUubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICBqc29uID0gW3p5W3p1WzBdXV07XFxuICAgICAgICAgICAgdSA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignanhsaXN0MicpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly91Y2tr6KeE5YiZ5Y+j5Luk77yM5omT5byA5rW36ZiU5Y2z5Y+v5a+85YWlXFxcXG7vv6VUZXh077+lXFxcIiArIHUgKyAnQGltcG9ydD1qczokLnJlcXVpcmUoXFxcInRvb2w/cnVsZT11Y2tr5LqRXFxcIikuc2V0UnVsZShpbnB1dCk7JztcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAganNvbiA9IHp1Lm1hcChrZXkgPT4genlba2V5XSk7XFxuICAgICAgICAgICAgdCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLliarotLTmnb9cXFwiLCBcXFwi57qv5paH5pysXFxcIl0sIDEsICfpgInmi6nliIbkuqvmoLzlvI8nKS5zZWxlY3QoKHQpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliarotLTmnb9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gc2hhcmVQYXN0ZSh0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E15VmFyKCdwbGF0Zm9ybScsIGdyb3VwKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBncm91cCksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+WIoOmZpCcgKyBncm91cC5yZXBsYWNlKCfnu7zlkIgnLCAn5YWo6YOoJykgKyAn6KeE5YiZJyxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChncm91cCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChncm91cCA9PSBcXFwi57u85ZCIXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKCQkLnJ1bGVQYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMShcXFwiZ3JvdXBcXFwiLCBncm91cCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNhdmVKc29uKHJ1bGVzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgZ3JvdXApXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5LqrJyArIGdyb3VwLnJlcGxhY2UoJ+e7vOWQiCcsICflhajpg6gnKSArICfop4TliJknLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGdyb3VwKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwID09IFxcXCLnu7zlkIhcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbigpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXCJncm91cFxcXCIsIGdyb3VwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA9PSAwKSByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ6KeE5YiZXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHJ1bGVzKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLliarotLTmnb9cXFwiLCBcXFwi57qv5paH5pysXFxcIl0sIDEsICfpgInmi6nliIbkuqvmoLzlvI8nKS5zZWxlY3QoKHQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliarotLTmnb9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gc2hhcmVQYXN0ZSh0LCAn5LqR5Ymq6LS05p2/NicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IFxcXCJQYXN0ZVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBcXFwiVGV4dFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignanhsaXN0MicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL3Vja2vop4TliJnlj6Pku6TvvIzmiZPlvIDmtbfpmJTljbPlj6/lr7zlhaVcXFxcbu+/pVxcXCIgKyB0ICsgXFxcIu+/pVxcXCIgKyB1ICsgJ0BpbXBvcnQ9anM6JC5yZXF1aXJlKFxcXCJ0b29sP3J1bGU9dWNra+S6kVxcXCIpLnNldFJ1bGUoaW5wdXQpOyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdCk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBncm91cClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIF1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSk7XFxuZC5wdXNoKHtcXG4gICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG59KTtcXG5ydWxlcyA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRHcm91cEpzb24oZmFsc2UsIFxcXCJncm91cFxcXCIsIHBsYXRmb3JtLCBcXFwi57u85ZCIXFxcIik7XFxuXFxuXFxuXFxuXFxuXFxucGlkID0gTnVtYmVyKGdldE15VmFyKCdwaWQnKSkgfHwgMDtcXG5uYW1lcyA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRHcm91cE5hbWVzKHJ1bGVzLCBcXFwic2VhcmNoX2dyb3VwXFxcIik7XFxuaWYgKHBpZCA+IG5hbWVzLmxlbmd0aCAtIDEpIHtcXG4gICAgcGlkID0gMDtcXG59XFxubmFtZXMubWFwKChncm91cCwgaSkgPT4ge1xcbiAgICBpZiAoaSA9PSBwaWQpXFxuICAgICAgICBwbGF0Zm9ybTIgPSBSaWNoKFN0cm9uZyhDb2xvcihncm91cCkpKTtcXG4gICAgZWxzZVxcbiAgICAgICAgcGxhdGZvcm0yID0gZ3JvdXA7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogcGxhdGZvcm0yLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ3BpZCcsIGkpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgaSksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5LqrJyArIGdyb3VwLnJlcGxhY2UoJ+WFqOWFqCcsICflhajpg6gnKSArICfop4TliJknLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGxhdGZvcm0sIGdyb3VwKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXCJncm91cFxcXCIsIHBsYXRmb3JtLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChncm91cCAhPSBcXFwi5YWo5YWoXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gcnVsZXMuZmlsdGVyKGYgPT4gZi5zZWFyY2hfZ3JvdXAgPT0gZ3JvdXApO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA9PSAwKSByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ6KeE5YiZXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkocnVsZXMpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFwi5Ymq6LS05p2/XFxcIiwgXFxcIue6r+aWh+acrFxcXCJdLCAxLCAn6YCJ5oup5YiG5Lqr5qC85byPJykuc2VsZWN0KCh0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliarotLTmnb9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHQsICfkupHliarotLTmnb82Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBcXFwiUGFzdGVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gXFxcIlRleHRcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdqeGxpc3QyJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL3Vja2vop4TliJnlj6Pku6TvvIzmiZPlvIDmtbfpmJTljbPlj6/lr7zlhaVcXFxcbu+/pV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iAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9ICQucmVxdWlyZSgndG9vbD9ydWxlPXVja2vkupEnKS5nZXRWYXJpYWJsZXMoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgYXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIodCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9IE9iamVjdC5rZXlzKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBhcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIodCwgX1t0XSB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdydWxlX3VpZCcsIG0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzZWFyY2hfZW5hYmxlZCcsIF8uc2VhcmNoX2VuYWJsZWQgfHwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZXhwbG9yZV9lbmFibGVkJywgXy5leHBsb3JlX2VuYWJsZWQgfHwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9ydWxlRWRpdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cGFnZVRpdGxlPeinhOWImee8lui+kSZydWxlPXVja2vkupEnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Yig6ZmkJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6ZmkXFxcIiArIF8uZ3JvdXAgKyBcXFwi6KeE5YiZ4oCcXFxcIiArIF8udGl0bGUgKyAn4oCd5ZCX77yfXFxcXG7mraTmk43kvZzkuI3lj6/pgIbvvIzor7fosKjmhY7pgInmi6njgIInKS5jb25maXJtKChtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMihtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2F2ZUpzb24ocnVsZXMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnp7vliqgnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6dSA9IHp5LnNsaWNlKDEpLm1hcChfID0+IF8udGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6nnp7vliqjkvY3nva4nKS5zZWxlY3QoKHp5LCB6dSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IC0xKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkucHVzaChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGkgKyAxLCAwLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLnNhdmVKc29uKHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHp5LCB6dSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfpgInkuK3op4TliJknOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDIgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwianhsaXN0MlxcXCIsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyW21dID0gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwianhsaXN0MlxcXCIsIGp4bGlzdDIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WPlua2iOmAieS4rSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBqeGxpc3QyW21dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJqeGxpc3QyXFxcIiwganhsaXN0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5ZCv55So5Y+R546wJzpcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+emgeeUqOWPkeeOsCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtLCBcXFwiZXhwbG9yZV9lbmFibGVkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgbSwgXyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogXy5pY29uXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IF8uZ3JvdXAgKyAn5LioJyArIF8uc2VhcmNoX2dyb3VwICsgJ+S4qCcgKyAoXy54NV91cmwgfHwgKF8udXJsID8gXy51cmwgOiBfLnNlYXJjaF91cmwpLnNwbGl0KFxcXCIvXFxcIikuc2xpY2UoMCwgMykuam9pbihcXFwiL1xcXCIpKSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG0pID0+IHtcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtLCBcXFwic2VhcmNoX2VuYWJsZWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIG0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoXy5zZWFyY2hfZW5hYmxlZCA9PSAnMScgPy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BfLnRpdGxlKSksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigndGlkJywgaSk7XFxuICAgICAgICAgICAgICAgIGZvciAodCBvZiBbXFxcImNsYXNzXFxcIiwgXFxcImFyZWFcXFwiLCBcXFwieWVhclxcXCIsIFxcXCJzb3J0XFxcIiwgXFxcIkZ5QWxsXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIodCArIFxcXCJfaVxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSk7XFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ4NV93ZWJ2aWV3X3NpbmdsZVxcXCIsXFxuICAgICAgICB1cmw6IF8ueDVfZGVzYyA9PSAnMScgfHwgXy54NV91cmwgfHwgXy51cmwsXFxuICAgICAgICBkZXNjOiBfLng1X2Rlc2MgfHwgXFxcInNjcmVlbi0xMzMmJmZsb2F0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgY2FuQmFjazogdHJ1ZSxcXG4gICAgICAgICAgICB1YTogXy54NV91YSA/IChfLng1X3VhID09IFxcXCJQQ19VQVxcXCIgPyBQQ19VQSA6IF8ueDVfdWEpIDogTU9CSUxFX1VBLFxcbiAgICAgICAgICAgIHJlZmVyZXI6IF8ueDVfcmVmZXJlcixcXG4gICAgICAgICAgICBqczogXy54NV9qcyxcXG4gICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6ICEhXy54NV9qc0xvYWRpbmdJbmplY3QsXFxuICAgICAgICAgICAgYXV0b1BsYXk6ICEhXy54NV9hdXRvUGxheSxcXG4gICAgICAgICAgICBmbG9hdFZpZGVvOiAhIV8ueDVfZmxvYXRWaWRlbyxcXG4gICAgICAgICAgICBpbWdMb25nQ2xpY2s6ICFfLng1X2ltZ0xvbmdDbGljayxcXG4gICAgICAgICAgICBzaG93UHJvZ3Jlc3M6ICFfLng1X3Nob3dQcm9ncmVzcyxcXG4gICAgICAgICAgICBibG9ja1J1bGVzOiBldmFsKF8ueDVfYmxvY2tSdWxlcykgfHwgW10sXFxuICAgICAgICAgICAgdXJsSW50ZXJjZXB0b3I6ICQudG9TdHJpbmcoKHVybEludGVyY2VwdG9yX2pzLCB4NVVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlLmNvbS9cXFwiKSB8fCBpbnB1dC5pbmNsdWRlcyhcXFwiYWxpeXVuZHJpdmUubmV0L1xcXCIpIHx8IGlucHV0LmluY2x1ZGVzKFxcXCJhbGlwYW4uY29tL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiAn5LqR55uY5ZCbLueugCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9hbGl5dW4jbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU95LqR55uY5ZCbLueugCZwYWdlPWZ5cGFnZSZyZWFsdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCJxdWFyay5jblxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWkuOWFi+e9keebmFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU9dWNra+S6kSZyZWFsdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgeDVfdXJsSW50ZXJjZXB0b3IgPSBuZXcgRnVuY3Rpb24oXFxcImlucHV0XFxcIiwgXFxcIng1VXJsXFxcIiwgdXJsSW50ZXJjZXB0b3JfanMpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4geDVfdXJsSW50ZXJjZXB0b3IoaW5wdXQsIHg1VXJsKTtcXG4gICAgICAgICAgICB9LCBfLng1X3VybEludGVyY2VwdG9yLCBcXFwiaGlrZXI6Ly9wYWdlL3J1bGVIb21lI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPXVja2vkupEmcGFnZT1meXBhZ2UmcnVsZU5hbWU9XFxcIiArIF8udGl0bGUgKyBcXFwiJnJ1bGVHcm91cD1cXFwiICsgXy5ncm91cCArIFxcXCImYmFzZVVybD1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xcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9ydWxlTGlzdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cGFnZVRpdGxlPeinhOWImeeuoeeQhiZydWxlPVxcXCIgKyBpZCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl94aXV0YW5cXFwiXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcbiAgICAgICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDpk77mjqUk5o+Q5Y+W56CBJyxcXG4gICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnRyaW0oKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0Lm1hdGNoKC9xdWFyay5jbi4qXFxcXC9zXFxcXC8uKy8pKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3JlYWx1cmw9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChpbnB1dCkgKyBcXFwiJnJ1bGU9dWNra+S6kSZzaGFyZVB3ZD1cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaFxcXCIsXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZToga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcigna2V5d29yZCcsaW5wdXQpXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IocnVsZVR5cGUsIFxcXCIjMzM5OWNjXFxcIikpKSxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLnu7zlkIhcXFwiXS5jb25jYXQoZ3JvdXBzKS5tYXAobmFtZSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChuYW1lID09IHJ1bGVUeXBlKSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lID0gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZWFyY2hfdHlwZS5pbmRleE9mKG5hbWUpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lID0gUmljaChcXFwiPFM+XFxcIiArIG5hbWUgKyBcXFwiPC9TPlxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBuYW1lO1xcbiAgICAgICAgICAgIH0pLCAzLCBcXFwi6YCJ5oup5pCc57Si57G75YirXFxcIikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LmluZGV4T2YoXFxcIjxTPlxcXCIpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ5a+55bqU6KeE5YiZXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5pbmRleE9mKFxcXCI8XFxcIikgPT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVUeXBlJywgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwicnVsZUdyb3VwXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCJzaWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2VhcmNoX2dyb3VwLm1hcCgobmFtZSwgaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBydWxlR3JvdXAgPT0gaSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVHcm91cCcsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwic2lkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzZWFyY2hfcnVsZS5tYXAoKF8sIGkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogc2lkID09IGkgPyBSaWNoKFN0cm9uZyhDb2xvcihfLnRpdGxlKSkpIDogXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBnZXRNeVZhcigna2V5d29yZCcpKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzaWQnLCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuXFxuXFxuXFxuXFxuXFxuICAgIGlmIChfU09VKSB7XFxuICAgICAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliqDovb3nrKxcXFwiICsgcGFnZSArIFxcXCLpobXkuK3vvIzov5vluqbvvJoxL1xcXCIgKyBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChfUEFHRSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5rKh5pyJ5Y+v55So55qE5pCc57Si6KeE5YiZXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2UgaWYgKF9QQUdFIHx8IHJ1bGUudXJsLm1hdGNoKFxcXCJmeXBhZ2VcXFwiKSkge1xcbiAgICAgICAgaWYgKF9QQUdFKSB7XFxuICAgICAgICAgICAgaWYgKHJ1bGUudGl0bGUgIT0gXFxcIuiBmuaQnFxcXCIpIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+JyArIENvbG9yKHJ1bGUudGl0bGUsICcjZmY2NjAxJykgKyAnPC9iPicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgW1xcXCJjbGFzc1xcXCIsIFxcXCJhcmVhXFxcIiwgXFxcInllYXJcXFwiLCBcXFwic29ydFxcXCIsIFxcXCJGeUFsbFxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcih0ICsgXFxcIl9pXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICB9LCBcXFwiaGlrZXI6Ly9wYWdlL3J1bGVIb21lP3J1bGU9dWNra+S6kSZwYWdlPWZ5cGFnZSZydWxlTmFtZT1cXFwiICsgcnVsZS50aXRsZSArIFxcXCImcnVsZUdyb3VwPVxcXCIgKyBydWxlLmdyb3VwKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgaW1nOiBydWxlLmljb24sXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBob21lOiAxXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBnZXRSdWxlR3JvdXAoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGJhc2VVcmwgPSBob21lX2Jhc2VVcmw7XFxuICAgICAgICBldmFsKFN0cmluZyhydWxlLnByZVJ1bGUpKTtcXG4gICAgICAgIGV2YWwoU3RyaW5nKHJ1bGUuZmluZF9ydWxlKSk7XFxuICAgIH1cXG59XFxuX1BBR0UgPyBzZXRQcmVSZXN1bHQoZCkgOiBzZXRSZXN1bHQoZCk7XFxuZGVsZXRlSXRlbUJ5Q2xzKCdsb2FkaW5nX2dpZicpO1xcblxcblxcblxcbi8vIOaQnOe0olxcbmlmICghcnVsZV94NSAmJiBfU09VICYmIGRhdGEubGVuZ3RoID4gMCkge1xcbiAgICBsZXQgaWkgPSBoaXN0b3J5LmluZGV4T2Yoa2V5d29yZCk7XFxuICAgIGlmIChpaSA+IC0xKSB7XFxuICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxuICAgIH1cXG4gICAgaWYgKGhpc3RvcnkubGVuZ3RoID4gMjApIHtcXG4gICAgICAgIGhpc3Rvcnkuc3BsaWNlKGhpc3RvcnkubGVuZ3RoIC0gMSwgMSk7XFxuICAgIH1cXG4gICAgaGlzdG9yeS51bnNoaWZ0KGtleXdvcmQpO1xcbiAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgaGlzdG9yeSk7XFxuICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXG4gICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocnVsZSkge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBNWV9QQUdFXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBNWV9QQUdFID0gMVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcGFnZSA9IE1ZX1BBR0U7XFxuICAgICAgICAgICAgICAgICAgICBiYXNlVXJsID0gcnVsZS5zZWFyY2hfdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC9meXBhZ2VAKFteXFxcXD9cXFxcJlxcXFw7XFxcXCNcXFxcXFxcIlxcXFwnXFxcXHtdKylAPy9nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlMiA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkMS5zcGxpdChcXFwiQFxcXCIpLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGFnZTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICApXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL2Z5cGFnZS9nLCBwYWdlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXFxcKlxcXFwqL2csIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhZ2UgPT0gMSB8fCBydWxlLnNlYXJjaF91cmwubWF0Y2goXFxcImZ5cGFnZVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChydWxlLnByZVJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZWFyY2hmaW5kID0gbmV3IEZ1bmN0aW9uKFxcXCJydWxlXFxcIiwgXFxcImJhc2VVcmxcXFwiLCBcXFwia2V5d29yZFxcXCIsIFxcXCJwYWdlXFxcIiwgcnVsZS5zZWFyY2hGaW5kKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IHNlYXJjaGZpbmQocnVsZSwgYmFzZVVybCwga2V5d29yZCwgcGFnZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFsaXN0KSByZXR1cm4gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlc2NUaXBzID0gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBydWxlLnRpdGxlLmZvbnRjb2xvcihcXFwiI2YxM2I2NmFcXFwiKSArIFxcXCImbmJzcDsmbmJzcDtcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXNMaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNMaXN0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnRpdGxlLmluY2x1ZGVzKFxcXCLigJzigJzigJ3igJ1cXFwiKSA/IGl0LnRpdGxlIDogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBpdC50aXRsZS5yZXBsYWNlKC88XFxcXC9lbT4vZywgXFxcIlxcXCIpLnJlcGxhY2UobmV3IFJlZ0V4cChrZXl3b3JkLCBcXFwiZ1xcXCIpLCBcXFwiPHN0cm9uZz48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiAjMUU5MEZGXFxcXFxcXCI+XFxcIiArIGtleXdvcmQgKyBcXFwiPC9zcGFuPjwvc3Ryb25nPlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzY1RpcHMgKyAoaXQuZGVzYyB8fCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXQuaW1nIHx8IGl0LnBpY191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQuY29sX3R5cGUgfHwgXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub1BpYzogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQuZXh0cmEgfHwge30pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzTGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2coXy50aXRsZSArIFxcXCI6XFxcIiArIGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBhcmFtOiBpdCxcXG4gICAgICAgICAgICBpZDogXFxcInVja2tfcnVsZUBcXFwiICsgaXQudGl0bGVcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgcGFyYW0uaSArPSAxO1xcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHJlc3VsdCkpIHtcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbShcXFwiX25vdGhhdmVcXFwiKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHJlc3VsdCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID09PSBwYXJhbS5hbGwpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCFyZXN1bHQgfHwgIXJlc3VsdC5sZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oXFxcIl9ub3RoYXZlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOi1hOa6kOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcIl9ub3RoYXZlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGFnZWlkKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliqDovb3nrKxcXFwiICsgTVlfUEFHRSArIFxcXCLpobXkuK3vvIzov5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AgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgbmFtZSwgIWkpLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzUnXFxuICAgIH0pO1xcbn0pO1xcbmlucHV0X3B1c2ggPSAoZGVzYywgaWQsIHZhbHVlLCBqc29uLCBoZWlnaHQpID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICB0aXRsZTogXFxcIjwvPlxcXCIsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGdyb3VwID0gJC5yZXF1aXJlKFxcXCJjb25maWdzP3J1bGU9dWNra+S6kVxcXCIpLmdldEdyb3VwTmFtZXMoMCwgXFxcInNlYXJjaF9ncm91cFxcXCIpO1xcbiAgICAgICAgICAgIGlmICghZ3JvdXAubGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICQoZ3JvdXAsIDMsIFxcXCLpgInmi6nop4TliJnliIbnu4RcXFwiKS5zZWxlY3QoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oZXh0cmEsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBpZCk7XFxuICAgICAgICB9LCBpZCksXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHtcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKGlkLCB2YWx1ZSksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IGBwdXRNeVZhcihcXFwiJHtpZH1cXFwiLCBpbnB1dClgLFxcbiAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYScsXFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiB0cnVlLFxcbiAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICBoZWlnaHQ6IGhlaWdodCB8fCA1LFxcbiAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgIH0sIGpzb24gfHwge30pXFxuICAgIH0pO1xcbn1cXG5zd2l0Y2ggKHJ1bGVfdGlkKSB7XFxuICAgIGNhc2UgJ+WfuuacrCc6XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDlkI3np7AnLCAndGl0bGUnLCAnJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDlm77moIcnLCAnaWNvbicsICcnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOa6kOS9nOiAhScsICdhdXRob3InLCAn5L2a5ZCNJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIxKc0xpYicsICdwcmVSdWxlJywgJycsIHtcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAzXFxuICAgICAgICAgICAgfV0sXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcbiAgICAgICAgICAgIGlucHV0X3B1c2goYSwgYiwgYywgZSwgMSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmkJzntKInOlxcbiAgICAgICAgW1xcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5pCc57Si6ZO+5o6lJywgJ3NlYXJjaF91cmwnLCAnJ10sXFxuICAgICAgICAgICAgWyflv4XloavvvIzmkJzntKLliIbnu4QnLCAnc2VhcmNoX2dyb3VwJywgJ+WFqOWFqCcsIHtcXG4gICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiBmYWxzZSxcXG4gICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICBbJ+W/heWhq++8jOWIl+ihqOinhOWImVxcXFxu5o+Q5L6b5Y+Y6YePOiBiYXNlVXJsLCBrZXl3b3JkLCBwYWdlXFxcXG5cXFxcbumcgOimgei/lOWbnuaVsOe7hO+8mnJldHVybiBbXTsnLCAnc2VhcmNoRmluZCcsICcnLCB7XFxuICAgICAgICAgICAgICAgIGhlaWdodDogNVxcbiAgICAgICAgICAgIH1dLFxcbiAgICAgICAgXS5tYXAoW2EsIGIsIGMsIGVdID0+IHtcXG4gICAgICAgICAgICBpbnB1dF9wdXNoKGEsIGIsIGMsIGUsIDEpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAn5Y+R546wJzpcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn5L2/55SoIHg1X3dlYnZpZXdfc2luZ2xlJyksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChleHBsb3JlX1g1KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdleHBsb3JlX1g1JywgZXhwbG9yZV9YNSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBleHBsb3JlX1g1ID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGV4cGxvcmVfWDUgPyA1NSA6IDYzKSArICcuc3ZnJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDpk77mjqUnLCAndXJsJywgJycsIHtcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxXFxuICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgWyflv4XloavvvIzliJfooajop4TliJlcXFxcbuWQr+eUqHg15bCx5LiN55So5YaZ5LqGXFxcXG5cXFxcbue7p+aJv+aVsOe7hGTvvJogZC5wdXNoKGpzb24pOycsICdmaW5kX3J1bGUnLCAnJ10sXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcbiAgICAgICAgICAgIGlucHV0X3B1c2goYSwgYiwgYywgZSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmm7/mjaInOlxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCflj5HnjrDpk77mjqXmm7/mjaInKSxcXG4gICAgICAgICAgICBkZXNjOiAn6YCJ5aGrJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2VkaXQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIFtcXG4gICAgICAgICAgICBbJ+WIhuexu+WQjeensCcsICdjbGFzc19uYW1lJywgJyddLFxcbiAgICAgICAgICAgIFsn5YiG57G75pu/5o2iJywgJ2NsYXNzX3VybCcsICcnXSxcXG4gICAgICAgICAgICBbJ+WcsOWMuuWQjeensCcsICdhcmVhX25hbWUnLCAnJ10sXFxuICAgICAgICAgICAgWyflnLDljLrmm7/mjaInLCAnYXJlYV91cmwnLCAnJ10sXFxuICAgICAgICAgICAgWyflubTku6PlkI3np7AnLCAneWVhcl9uYW1lJywgJyddLFxcbiAgICAgICAgICAgIFsn5bm05Luj5pu/5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ly9pbWFnZXMvaG9tZV9pY29uX2VkaXQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7nvZHnq5nliqDovb3kuK3kuZ/miafooYw8L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X2pzTG9hZGluZ0luamVjdCcsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfanNMb2FkaW5nSW5qZWN0ID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfanNMb2FkaW5nSW5qZWN0ID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGlucHV0X3B1c2goXFxcIlxcXCIsIFxcXCJ4NV9qc1xcXCIsIFxcXCJcXFwiLCB7fSwgMyk7XFxuXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCfmi6bmiKrotYTmupAnKSxcXG4gICAgICAgICAgICBkZXNjOiAn6YCJ5aGrJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2VkaX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lWYXIoJ3g1X2ltZ0xvbmdDbGljaycsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfaW1nTG9uZ0NsaWNrID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfaW1nTG9uZ0NsaWNrID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7kuI3mmL7npLrov5vluqbmnaE8L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X3Nob3dQcm9ncmVzcycsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfc2hvd1Byb2dyZXNzID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfc2hvd1Byb2dyZXNzID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mgqzmta7ll4XmjqLmkq3mlL48L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubG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k7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBTdHJvbmcoJ3g15omp5bGVJyksXFxuICAgICAgICAgICAgZGVzYzogJ+mAieWhqycsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6aaW6aG15LiN5pi+56S65pCc57Si5qGGPC9iPicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh4KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd4NV9kZXNjJywgeCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB4NV9kZXNjID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfZGVzYyA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBpbnB1dF9wdXNoKFxcXCJ1cmzvvIzlj5HnjrDpk77mjqXlkox4NemTvuaOpeWGsueqgeaXtuWhq+WGmVxcXCIsIFxcXCJ4NV91cmxcXFwiLCBcXFwiXFxcIiwge30sIDEpO1xcbiAgICAgICAgaW5wdXRfcHVzaChcXFwiaG9tZV9qc++8jOS4jeaYvuekuuaQnOe0ouahhuaXtuaJp+ihjOOAglxcXFxu57un5om/5pWw57uEZO+8jOW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pa2VyOi8vZW1wdHlcXFwiLFxcbiAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwifn5+5LuA5LmI6YO95rKh5pyJ5ZOmfn5+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKSxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgfVxcbn0pO1xcbmVsc2UgaGlzdG9yeS5tYXAoKGtleSwgaSkgPT4ge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGtleSxcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkICsgXFxcIjpzZWFyY2hcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICBleHRyYS5kZWZhdWx0VmFsdWUgPSBrZXk7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCwga2V5KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogaWQgKyBcXFwiOmtleTpcXFwiICsga2V5LFxcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpOWFs+mUruivjTpcXFwiICsga2V5LFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgW10pO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlpID0gaGlzdG9yeS5pbmRleE9mKGtleSk7XFxuICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgaGlzdG9yeSk7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgXFxcIjprZXk6XFxcIiArIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaGlzdG9yeS5sZW5ndGggPT09IDApIGFkZEl0ZW1BZnRlcihpZCArIFxcXCI6c2VhcmNoSGlzdG9yeVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9LCBpZCwga2V5KVxcbiAgICAgICAgIC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cInNlYXJjaEhpc3RvcnlcXFwiLCBoaXN0b3J5KTtcXG5cXG4gICAgICAgICAgICBsZXQgZGQgPSBkO1xcbiAgICAgICAgICAgIGJhc2VVcmwgPSBydWxlLnNlYXJjaF91cmxcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoXFxuICAgICAgICAgICAgICAgICAgICAvZnlwYWdlQChbXlxcXFw/XFxcXCZcXFxcO1xcXFwjXFxcXFxcXCJcXFxcJ1xcXFx7XSspQD8vZyxcXG4gICAgICAgICAgICAgICAgICAgICgkMCwgJDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlMiA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJDEuc3BsaXQoXFxcIkBcXFwiKS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoU3RyaW5nKCdwYWdlMj1wYWdlMicgKyBfKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBhZ2UyO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICApXFxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9meXBhZ2UvZywgcGFnZSlcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL1xcXFwqXFxcXCovZywga2V5d29yZCk7XFxuICAgICAgICAgICAgc2VhcmNoZmluZCA9IG5ldyBGdW5jdGlvbihcXFwicnVsZVxcXCIsIFxcXCJiYXNlVXJsXFxcIiwgXFxcImtleXdvcmRcXFwiLCBcXFwicGFnZVxcXCIsIHJ1bGUuc2VhcmNoRmluZCk7XFxuICAgICAgICAgICAgbGlzdCA9IHNlYXJjaGZpbmQocnVsZSwgYmFzZVVybCwga2V5d29yZCwgcGFnZSk7XFxuICAgICAgICAgICAgZCA9IGRkLmNvbmNhdChsaXN0KTtcXG4gICAgICAgIH0gZWxzZSBpZiAoIV9TT1UgJi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op6PmnpBcXFwiO1xcbiAgICAgICAgfSBlbHNlIGlmICh6dS5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgIGpzb24gPSBbenlbenVbMF1dXTtcXG4gICAgICAgICAgICB1ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGpzb24pKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKCdqeGxpc3QyJyk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL3Vja2vop4TliJnlj6Pku6TvvIzmiZPlvIDmtbfpmJTljbPlj6/lr7zlhaVcXFxcbu+/pVRleHTvv6VcXFwiICsgdSArICdAaW1wb3J0PWpzOiQucmVxdWlyZShcXFwidG9vbD9ydWxlPXVja2vkupFcXFwiKS5zZXRSdWxlKGlucHV0KTsnO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBqc29uID0genUubWFwKGtleSA9PiB6eVtrZXldKTtcXG4gICAgICAgICAgICB0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGpzb24pKTtcXG4gICAgICAgICAgICByZXR1cm4gJChbXFxcIuWJqui0tOadv1xcXCIsIFxcXCLnuq/mlofmnKxcXFwiXSwgMSwgJ+mAieaLqeWIhuS6q+agvOW8jycpLnNlbGVjdCgodCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWJqui0tOadv1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHQsICfkupHliarotLTmnb82Jyk7XFxuICAgICAgICAgICAgICAgICAgICB0ID0gXFxcIlBhc3RlXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xcbiAgICAgICAgICAgICAgICAgICAgdCA9IFxcXCJUZXh0XFxcIjtcXG4gICAgICAgICAgICAg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biAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5Yig6ZmkJyArIGdyb3VwLnJlcGxhY2UoJ+e7vOWQiCcsICflhajpg6gnKSArICfop4TliJknLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGdyb3VwKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwID09IFxcXCLnu7zlkIhcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoJCQucnVsZVBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXCJncm91cFxcXCIsIGdyb3VwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2F2ZUpzb24ocnVsZXMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9LCBncm91cClcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfliIbkuqsnICsgZ3JvdXAucmVwbGFjZSgn57u85ZCIJywgJ+WFqOmDqCcpICsgJ+inhOWImScsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoZ3JvdXApID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXAgPT0gXFxcIue7vOWQiFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzEoXFxcImdyb3VwXFxcIiwgZ3JvdXAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVsZXMubGVuZ3RoID09IDApIHJldHVybiBcXFwidG9hc3Q6Ly/msqHmnInop4TliJlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkocnVsZXMpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuWJqui0tOadv1xcXCIsIFxcXCLnuq/mlofmnKxcXFwiXSwgMSwgJ+mAieaLqeWIhuS6q+agvOW8jycpLnNlbGVjdCgodCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWJqui0tOadv1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHQsICfkupHliarotLTmnb82Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gXFxcIlBhc3RlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IFxcXCJUZXh0XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICA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2goU3Ryb25nKENvbG9yKGdyb3VwKSkpO1xcbiAgICBlbHNlXFxuICAgICAgICBwbGF0Zm9ybTIgPSBncm91cDtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBwbGF0Zm9ybTIsXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICBwdXRNeVZhcigncGlkJywgaSk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBpKSxcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfliIbkuqsnICsgZ3JvdXAucmVwbGFjZSgn5YWo5YWoJywgJ+WFqOmDqCcpICsgJ+inhOWImScsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwbGF0Zm9ybSwgZ3JvdXApID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzEoXFxcImdyb3VwXFxcIiwgcGxhdGZvcm0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwICE9IFxcXCLlhajlhahcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSBydWxlcy5maWx0ZXIoZiA9PiBmLnNlYXJjaF9ncm91cCA9PSBncm91cCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAocnVsZXMubGVuZ3RoID09IDApIHJldHVybiBcXFwidG9hc3Q6Ly/msqHmnInop4TliJlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgdCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShydWxlcykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLliarotLTmnb9cXFwiLCBcXFwi57qv5paH5pysXFxcIl0sIDEsICfpgInmi6nliIbkuqvmoLzlvI8nKS5zZWxlY3QoKHQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWJqui0tOadv1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHNoYXJlUGFzdGUodCwgJ+S6keWJqui0tOadvzYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IFxcXCJQYXN0ZVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBcXFwiVGV4dFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4bGlzdDInKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vdWNra+inhOWImeWPo+S7pO+8jOaJk+W8gOa1t+mYlOWNs+WPr+WvvOWFpVxcXFxu77+lXFxcIiArIHQgKyBcXFwi77+lXFxcIiArIHUgKyAnQGltcG9ydD1qczokLnJlcXVpcmUoXFxcInRvb2w/cnVsZT11Y2tr5LqRXFxcIikuc2V0UnVsZShpbnB1dCk7JztcXG4gICAgICAgICAgICAgICAgICAgIH0sIHQpO1xcbiAgICAgICAgICAgICAgICB9LCBwbGF0Zm9ybSwgZ3JvdXApXFxuICAgICAgICAgICAg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yBDb2xvcihkMiwgXFxcIiMyRTVEOEVcXFwiKSA6IGQyLFxcbiAgICAgICAgICAgIHVybDogJChbXFxcIuWIhuS6q1xcXCIsIFxcXCLnvJbovpFcXFwiLCBcXFwi5Yig6ZmkXFxcIiwgXFxcIuenu+WKqFxcXCJdLmNvbmNhdChbaSA/IFxcXCLpgInkuK3op4TliJlcXFwiIDogXFxcIuWPlua2iOmAieS4rVxcXCIsIGQxID8gXFxcIuemgeeUqOWPkeeOsFxcXCIgOiBcXFwi5ZCv55So5Y+R546wXFxcIl0pLCAyLCAn6YCJ5oup5omp5bGV5pON5L2cJykuc2VsZWN0KChtLCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WIhuS6qyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShbX10pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly91Y2tr6KeE5YiZ5Y+j5Luk77yM5omT5byA5rW36ZiU5Y2z5Y+v5a+85YWlXFxcXG7vv6VUZXh077+lXFxcIiArIF8gKyAnQGltcG9ydD1qczokLnJlcXVpcmUoXFxcInRvb2w/cnVsZT11Y2tr5LqRXFxcIikuc2V0UnVsZShpbnB1dCk7JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+e8lui+kSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gJC5yZXF1aXJlKCd0b29sP3J1bGU9dWNra+S6kScpLmdldFZhcmlhYmxlcygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBhcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcih0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gT2JqZWN0LmtleXMoXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh0IG9mIGFycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcih0LCBfW3RdIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVfdWlkJywgbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaF9lbmFibGVkJywgXy5zZWFyY2hfZW5hYmxlZCB8fCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdleHBsb3JlX2VuYWJsZWQnLCBfLmV4cGxvcmVfZW5hYmxlZCB8fCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3J1bGVFZGl0I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wYWdlVGl0bGU96KeE5YiZ57yW6L6RJnJ1bGU9dWNra+S6kSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfliKDpmaQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaRcXFwiICsgXy5ncm91cCArIFxcXCLop4TliJnigJxcXFwiICsgXy50aXRsZSArICfigJ3lkJfvvJ9cXFxcbuatpOaTjeS9nOS4jeWPr+mAhu+8jOivt+iwqOaFjumAieaLqeOAgicpLmNvbmZpcm0oKG0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8yKG0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zYXZlSnNvbihydWxlcyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+enu+WKqCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgenkgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0SnNvbl8yKG0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHp1ID0genkuc2xpY2UoMSkubWFwKF8gPT4gXy50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMiwgJ+ivt+mAieaLqeenu+WKqOS9jee9ricpLnNlbGVjdCgoenksIHp1LCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSB6dS5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gLTEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5wdXNoKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSArIDEsIDAsIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuc2F2ZUpzb24oenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgenksIHp1LCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mAieS4reinhOWImSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDJbbV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJqeGxpc3QyXFxcIiwganhsaXN0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Y+W5raI6YCJ5LitJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGp4bGlzdDJbbV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCBqeGxpc3QyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICflkK/nlKjlj5HnjrAnOlxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn56aB55So5Y+R546wJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0SnNvbl8yKG0sIFxcXCJleHBsb3JlX2VuYWJsZWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBtLCBfKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBfLmljb25cXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXy5ncm91cCArICfkuKgnICsgXy5zZWFyY2hfZ3JvdXAgKyAn5LioJyArIChfLng1X3VybCB8fCAoXy51cmwgPyBfLnVybCA6IF8uc2VhcmNoX3VybCkuc3BsaXQoXFxcIi9cXFwiKS5zbGljZSgwLCAzKS5qb2luKFxcXCIvXFxcIikpLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgobSkgPT4ge1xcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0SnNvbl8yKG0sIFxcXCJzZWFyY2hfZW5hYmxlZFxcXCIpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgbSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChfLnNlYXJjaF9lbmFibGVkID09ICcxJyA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbm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FxuICAgICAgICAgICAgICAgIGxldCBib2R5ID0gcmVzLmJvZHk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHRvSnNvbikge1xcXFxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gSlNPTi5wYXJzZShib2R5KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3VjY2Vzc0NhbGxiYWNrKGJvZHksIHJlcyk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihTdHJpbmcocmVzLnN0YXR1c0NvZGUpKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGVyciA9IHRoaXMuZXJyb3JUeXBlQ2FsbGJhY2soZXJyLCByZXMpO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAodGhpcy5yZXRyeUNvdW50KSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRyeVJlc3VsdCA9IHRoaXMuZXJyb3JDYWxsYmFja1dpdGhSZXRyeShlcnIsIHJlcywgdGhpcyk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHRyeVJlc3VsdCkge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldHJ5Q291bnQtLTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQodG9Kc29uKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldHJ5Q291bnQgPSAwO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5lcnJvckNhbGxiYWNrKGVyciwgcmVzKTtcXFxcbiAgICAgIC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gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIuivt+i+k+WFpUNvb2tpZVxcXFxcXFwiKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQucmVxdWlyZShcXFxcXFxcInRvb2xcXFxcXFxcIikuaXNMb2dpbkNvb2tpZShpbnB1dCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFxcXFxcInF1YXJrQ29va2llXFxcXFxcXCIsIGlucHV0LnJlcGxhY2UoL1xcXFxcXFxccy9nLCBcXFxcXFxcIlxcXFxcXFwiKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6K6+572u5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9Db29raWXmoLzlvI/plJnor69cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09PSBcXFxcXFxcIuWOn+eUu+S4i+i9vee6v+eoi1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoZ2V0SXRlbShcXFxcXFxcInNwZWVkVGhyZWFkXFxcXFxcXCIsIFxcXFxcXFwiMTBcXFxcXFxcIiksIFxcXFxcXFwi6K+36L6T5YWlMy0zMuS5i+mXtOeahOaVtOa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FxuICAgICAgICAgICAgICAgICAgICBpZiAocGxheVVybENhY2hlW2ZpZF0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5VXJsQ2FjaGVbZmlkXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSAkLnJlcXVpcmUoXFxcXFxcXCJwbGF5XFxcXFxcXCIpLmdldFBsYXlVcmwoZmlkLCBmaWRfdG9rZW4sIHB3ZF9pZCwgc3Rva2VuLCBjYXRlZ29yeSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwbGF5VXJsQ2FjaGVbZmlkXSA9IHVybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXFxcXFwicGxheVVybENhY2hlXFxcXFxcXCIsIHBsYXlVcmxDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbS5maWQsIGl0ZW0uc2hhcmVfZmlkX3Rva2VuLCBzaGFyZUlkLCBxdWFya1NoYXJlQXBpLmdldFRva2VuKCksIGl0ZW0ub2JqX2NhdGVnb3J5KSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogc3R5bGUsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZmlkLFxcXFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5bGlzdCAnICsgaXRlbS5vYmpfY2F0ZWdvcnlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGQuc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iOt+WPlumTvuaOpVxcXCIsXFxcInBhdGhcXFwiOlxcXCJwbGF5XFxcIixcXFwicnVsZVxcXCI6XFxcImpzOlxcXFxuY29uc3QgY29va2llID0gZ2V0SXRlbShcXFxcXFxcInF1YXJrQ29va2llXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxubGV0IGh0dHBSZXF1ZXN0ID0gJC5yZXF1aXJlKFxcXFxcXFwiaHR0cFJlcXVlc3RcXFxcXFxcIik7XFxcXG5cXFxcbmZ1bmN0aW9uIENvb2tpZU1hbmFnZShjb29raWUpIHtcXFxcbiAgICB0aGlzLmNvb2tpZSA9IHt9O1xcXFxuICAgIHRoaXMuYWRkKGNvb2tpZSk7XFxcXG59XFxcXG5PYmplY3QuYXNzaWduKENvb2tpZU1hbmFnZS5wcm90b3R5cGUsIHtcXFxcbiAgICBhZGQoY29va2llKSB7XFxcXG4gICAgICAgIGxldCBjb29raWVzID0gW107XFxcXG4gICAgICAgIGlmICh0eXBlb2YgY29va2llID09PSBcXFxcXFxcInN0cmluZ1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICBjb29raWVzID0gY29va2llLnNwbGl0KFxcXFxcXFwiO1xcXFxcXFwiKTtcXFxcbiAgICAgICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5KGNvb2tpZSkpIHtcXFxcbiAgICAgICAgICAgIGNvb2tpZXMgPSBjb29raWU7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgY29va2llcy5mb3JFYWNoKHYgPT4ge1xcXFxuICAgICAgICAgICAgdiA9IHYuc3BsaXQoXFxcXFxcXCI9XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgaWYodi5sZW5ndGg8MikgcmV0dXJuO1xcXFxuICAgICAgICAgICAgdGhpcy5jb29raWVbdlswXS50cmltKCldID0gdlsxXS50cmltKCk7XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH0sXFxcXG4gICAgZ2V0KCkge1xcXFxuICAgICAgICByZ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IGdldFByZXZpZXdWaWRlbyhhc2ZpZCk7XFxcXG4gICAgICAgICAgICBsZXQgdmlkZW9MaXN0ID0gdmlkZW9SZXMuZGF0YS52aWRlb19saXN0O1xcXFxuICAgICAgICAgICAgbGV0IHBsYXlMaXN0ID0ge1xcXFxuICAgICAgICAgICAgICAgIG5hbWVzOiBbXSxcXFxcbiAgICAgICAgICAgICAgICB1cmxzOiBbXSxcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiBbXVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIGxldCBwbGF5Q29va2llID0gY29va2llTWFuYWdlLmdldCgpO1xcXFxuICAgICAgICAgICAgdmlkZW9MaXN0LmZpbHRlcih2ID0+IHYuYWNjZXNzYWJsZSkuZm9yRWFjaCh2ID0+IHtcXFxcbiAgICAgICAgICAgICAgICBwbGF5TGlzdC5uYW1lcy5wdXNoKHYucmVzb2x1dGlvbik7XFxcXG4gICAgICAgICAgICAgICAgcGxheUxpc3QudXJscy5wdXNoKHYudmlkZW9faW5mby51cmwgKyBcXFxcXFxcIiNpc1ZpZGVvPXRydWUjXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIHBsYXlMaXN0LmhlYWRlcnMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIFJlZmVyZXI6IFxcXFxcXFwiaHR0cDovL3Bhbi5xdWFyay5jbi9cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgY29va2llOiBwbGF5Q29va2llLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogXFxcXFxcXCJjb20uc3R1Yi5TdHViQXBwLzEuMy4wIChMaW51eDtBbmRyb2lkIDE0KSBBbmRyb2lkWE1lZGlhMy8xLjEuMVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGNyZWF0ZURlbGV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1xcXFxuICAgIGlmIChjb29raWUpIHtcXFxcbiAgICAgICAgc2V0SXRlbShcXFxcXFxcInF1YXJrQ29va2llXFxcXFxcXCIsIGNvb2tpZSk7XFxcXG4gICAgICAgIHRvYXN0KFxcXFxcXFwiQ29va2ll6I635Y+W5oiQ5YqfXFxcXFxcXCIpO1xcXFxuICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgIH1cXFxcbiAgICBjbGVhclZhcihcXFxcXFxcInF1YXJrQ29va2llXFxcXFxcXCIpO1xcXFxufSk7XFxcXG5kLnB1c2goe1xcXFxuICAgIGNvbF90eXBlOiBcXFxcXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcXFxcXCIsXFxcXG4gICAgdXJsOiBcXFxcXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL1xcXFxcXFwiLFxcXFxuICAgIGRlc2M6IFxcXFxcXFwiZmxvYXQmJjEwMCVcXFxcXFxcIixcXFxcbiAgICBleHRyYToge1xcXFxuICAgICAgICBqczogJC50b1N0cmluZygoQXBpUm9vdFVybCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IHRpbWVJbnRlciA9IHNldEludGVydmFsKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgQ29va2llID0gZmJhLmdldENvb2tpZShBcGlSb290VXJsKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoQ29va2llLmluY2x1ZGVzKFxcXFxcXFwiX1VQX0Y3RV84RF89XFxcXFxcXCIpICYmIENvb2tpZS5pbmNsdWRlcyhcXFxcXFxcIl9fdWlkPVxcXFxcXFwiKSYmQ29va2llLmluY2x1ZGVzKFxcXFxcXFwiX19wdXVzPVxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXFxcXFwicXVhcmtDb29raWVcXFxcXFxcIiwgQ29va2llKVxcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVJbnRlcik7XFxcXG4gIC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KSkge1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgJ1Bhc3RlJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHBhcnNlUGFzdGUodGV4dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgJ0xhbnpvdSc6XFxcXG4gICAgICAgICAgICAgICAgICAgIFt1cmwsIHB3ZF0gPSB0ZXh0LnNwbGl0KFxcXFxcXFwiIyNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGR1cmwgPSAkLnJlcXVpcmUoJ2xhbnpvdT9ydWxlPXVja2vkupEnKS5vbmVfdXJsKHVybCwgcHdkLCAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IFN0cmluZyhmZXRjaChkdXJsKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgoc3AgPSB0ZXh0LnNwbGl0KFxcXFxcXFwi77+lXFxcXFxcXCIpKS5sZW5ndGggPT0gMykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHNwWzJdLnNwbGl0KFxcXFxcXFwiQFxcXFxcXFwiKVswXS50cmltKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBhcnIxID0gSlNPTi5wYXJzZShiYXNlNjREZWNvZGUodGV4dCkpO1xcXFxuXFxcXG5cXFxcbiAgICAgICAgICAgIC8vIOWQiOW5tu+8jOWOu+mHjVxcXFxuICAgICAgICAgICAgYXJyMiA9ICQucmVxdWlyZShcXFxcXFxcImNvbmZpZ3M/cnVsZT11Y2tr5LqRXFxcXFxcXCIpLmdldEpzb24oKTtcXFxcbiAgICAgICAgICAgIGFycjMgPSBhcnIxLmNvbmNhdChhcnIyKS5maWx0ZXIoKG9iaiwgaW5kZXgsIGFycikgPT4ge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AgICAgICAgdWlkcyA9IGp4bGlzdC5tYXAoX18gPT4gbWQ1KF9fLmdyb3VwICsgX18udGl0bGUpKTtcXFxcbiAgICAgICAgICAgICAgICBpID0gdWlkcy5pbmRleE9mKGdldE15VmFyKCdydWxlX3VpZCcsICctMScpKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3QucHVzaChfKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEsIF8pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdydWxlX3RpZCcpO1xcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdWlkJyk7XFxcXG4gICAgICAgICAgICAgICAganhsaXN0ID0ganhsaXN0LmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gbWQ1KG9iai5ncm91cCArIG9iai50aXRsZSkgPT09IG1kNShvLmdyb3VwICsgby50aXRsZSkgJiYgKG9iai50aW1lID4gby50aW1lIHx8IG9iai50aW1lID09PSBvLnRpbWUpKSA9PT0gaW5kZXg7XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKFxcXFxcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFxcXFxcIikuc2F2ZUpzb24oanhsaXN0KTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgJ3RvYXN0Oi8v5L+d5a2Y5oiQ5YqfJztcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aQnOe0ouinhOWImS/lj5HnjrDop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ID0+IHtcXFxcbiAgICAgICAgICAgICAgICBwYWdlMiA9IHBhZ2U7XFxcXG4gICAgICAgICAgICAgICAgJDEuc3BsaXQoXFxcXFxcXCJAXFxcXFxcXCIpLm1hcChfID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChTdHJpbmcoJ3BhZ2UyPXBhZ2UyJyArIF8pKTtcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFnZTI7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIClcXFxcbiAgICAgICAgLnJlcGxhY2UoL2Z5cGFnZS9nLCBwYWdlKVxcXFxuICAgICAgICAucmVwbGFjZShcXFxcbiAgICAgICAgICAgIC9meShjbGFzc3xhcmVhfHllYXJ8c29ydCkvZyxcXFxcbiAgICAgICAgICAgICgkMCwgJDEpID0+IHJ1bGVbJDEgKyAnX3VybCddW2V2YWwoJDEgKyAnX2knKV0gfHwgXFxcXFxcXCJcXFxcXFxcIlxcXFxuICAgICAgICApXFxcXG4gICAgICAgIC5yZXBsYWNlKFxcXFxuICAgICAgICAgICAgL2Z5QWxsL2csXFxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgRnlBbGxfaWkgPSBGeUFsbF9pO1xcXFxuICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLmNsYXNzX2kgLSAxKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBGeUFsbF9paSAtPSBydWxlLmNsYXNzX2k7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLmFyZWFfaSAtIDEpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBGeUFsbF9paSAtPSBydWxlLmFyZWFfaTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLnllYXJfaSAtIDEpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuc29ydF91cmxbRnlBbGxfaWkgLSBydWxlLnllYXJfaV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLnllYXJfdXJsW0Z5QWxsX2lpXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmFyZWFfdXJsW0Z5QWxsX2lpXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmNsYXNzX3VybFtGeUFsbF9paV07XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICApO1xcXFxuICAgIHJldHVybiBiYXNlVTtcXFxcbn1cXFxcbmNvbnN0IGdldFJ1bGVHcm91cCA9IChjb2xfdHlwZSwgU291KSA9PiB7XFxcXG4gICAgZm9yIChpdCBvZiBbJ2NsYXNzJywgJ2FyZWEnLCAneWVhcicsICdzb3J0J10pIHtcXFxcbiAgICAgICAgZXZhbChgaW5kZXggPSB7XFxcXG4gICAgY2xhc3M6IDAsXFxcXG4gICAgYXJlYTogcnVsZS5jbGFzc19pLFxcXFxuICAgIHllYXI6IHJ1bGUuY2xhc3NfaSArIHJ1bGUuYXJlYV9pLFxcXFxuICAgIHNvcnQ6IHJ1bGUuY2xhc3NfaSArIHJ1bGUuYXJlYV9pICsgcnVsZS55ZWFyX2ksXFxcXG59W2l0XVxcXFxucnVsZS4ke2l0fV9uYW1lLm1hcCgobmFtZSwgaSkgPT4ge1xcXFxuICAgIGlmIChpc0Z5QWxsKSB7XFxcXG4gICAgICAgIGkgPSBpbmRleCArIGk7X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FxcL3NcXFxcXFxcXC8uKy8pKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3JlYWx1cmw9XFxcXFxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQoaW5wdXQpICsgXFxcXFxcXCImcnVsZT11Y2tr5LqRJnNoYXJlUHdkPVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgIT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXFxcbiAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiaW5wdXRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgaWQ6IGlkICsgXFxcXFxcXCI6c2VhcmNoXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBrZXl3b3JkLFxcXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFxcXFxcInB1dE15VmFyKCdrZXl3b3JkJyxpbnB1dClcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdXJsOiBcXFxcXFxcInRvYXN0Oi8v5Yqg6L295LitLi4uXFxcXFxcXCIsXFxcXG4gICAgICAgIGltZzogXFxcXFxcXCJodHRwczovL2hpa2VyZmFucy5j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gICAgICAgdiA9IHZlcnNpb24gKyAxO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGlmICh2ZXJzaW9uIDwgdikge1xcXFxuICAgICAgICAgICAgZiA9IFxcXFxcXFwicmVkXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB0ID0gXFxcXFxcXCLmo4DmtYvliLDmlrDniYjmm7TmlrDvvIzngrnlh7vkuobop6Por6bmg4XjgIJcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIFQgPSBcXFxcXFxcIuabtOaWsOWGheWuuVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgaWYgKHVwID09ICcnKSB7XFxcXG4gICAgICAgICAgICAgICAgY29uZmlybSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5pu05paw5o+Q56S6JyxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+ajgOa1i+WIsOS9oOeahOinhOWImeeJiOacrOWwj+S6juacjeWKoeWZqOeJiOacrO+8jOaYr+WQpueri+WNs+abtOaWsO+8nycsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKGRhKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gJC5yZXF1aXJlKFxcXFxcXFwibGFuem91P3J1bGU9dWNra+S6kVxcXFxcXFwiKS5vbmVfdXJsKGRhKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcIlxcXFxcXFxcdTZkNzdcXFxcXFxcXHU5NjE0XFxcXFxcXFx1ODljNlxcXFxcXFxcdTc1NGNcXFxcXFxcXHVmZmU1aG9tZV9ydWxlX3VybFxcXFxcXFxcdWZmZTVcXFxcXFxcIiArIGdldFBhdGgoZik7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybClcXFxcbiA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ZHpobXnmbvlvZVcXFxcXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXFxcXFwi572R6aG155m75b2VXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL3BhZ2UvbG9naW5cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLor7fovpPlhaVDb29raWVcXFxcXFxcIikuaW5wdXQoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoJC5yZXF1aXJlKFxcXFxcXFwidG9vbFxcXFxcXFwiKS5pc0xvZ2luQ29va2llKGlucHV0KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFxcXFxcInF1YXJrQ29va2llXFxcXFxcXCIsIGlucHV0LnJlcGxhY2UoL1xcXFxcXFxccy9nLCBcXFxcXFxcIlxcXFxcXFwiKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/orr7nva7miJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSlcXFxcbiAgICB9IGVsc2UgaWYgKCF0KSB7XFxcXG4gICAgICAgIFQgPSBcXFxcXFxcIueoi+W6j+iuvue9rlxcXFxc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ivjemAgumFjVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgSyA9IG9uZV91cmwodXJsLCBwd2QsIDEsIDAsIGl0ZW0pO1xcXFxuICAgICAgICAgICAgICAgIGlmICghSykge1xcXFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwsIHB3ZCwgMSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmICghSykge1xcXFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwuc3BsaXQoXFxcXFxcXCI/XFxcXFxcXCIpWzBdLCBwd2QsIDEpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoSykge1xcXFxuICAgICAgICAgICAgICAgICAgICBmID0gXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0X3J1bGUuanNvblxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoSywgZik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiXFxcXFxcXFx1NmQ3N1xcXFxcXFxcdTk2MTRcXFxcXFxcXHU4OWM2XFxcXFxcXFx1NzU0Y1xcXFxcXFxcdWZmZTVob21lX3J1bGVfdXJsXFxcXFxcXFx1ZmZlNVxcXFxcXFwiICsgZ2V0UGF0aChmKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+iOt+WPluS4i+i9vemTvuaOpeWksei0pVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIHVybCwgcHdkLCBpdGVtKSxcXFxcbiAgICAgICAgICAgIGV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yJyk7XFxcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJjb3B5Oi8vdWNra+inhOWImeWPo+S7pO+8jOaJk+W8gOa1t+mYlOWNs+WPr+WvvOWFpVxcXFxcXFxcbu+/pVRleHTvv6VcXFxcXFxcIiArIHUgKyAnQGltcG9ydD1qczokLnJlcXVpcmUoXFxcXFxcXCJ0b29sP3J1bGU9dWNra+S6kVxcXFxcXFwiKS5zZXRSdWxlKGlucHV0KTsnO1xcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAganNvbiA9IHp1Lm1hcChrZXkgPT4genlba2V5XSk7XFxcXG4gICAgICAgICAgICB0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGpzb24pKTtcXFxcbiAgICAgICAgICAgIHJldHVybiAkKFtcXFxcXFxcIuWJqui0tOadv1xcXFxcXFwiLCBcXFxcXFxcIue6r+aWh+acrFxcXFxcXFwiXSwgMSwgJ+mAieaLqeWIhuS6q+agvOW8jycpLnNlbGVjdCgodCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFxcXFxcIuWJqui0tOadv1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHQsICfkupHliarotLTmnb82Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHQgPSBcXFxcXFxcIlBhc3RlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIHQgPSBcXFxcXFxcIlRleHRcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignanhsaXN0MicpO1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2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nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5Yig6ZmkJyArIGdyb3VwLnJlcGxhY2UoJ+e7vOWQiCcsICflhajpg6gnKSArICfop4TliJknLFxcXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoZ3JvdXApID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwID09IFxcXFxcXFwi57u85ZCIXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKCQkLnJ1bGVQYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzEoXFxcXFxcXCJncm91cFxcXFxcXFwiLCBncm91cCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2F2ZUpzb24ocnVsZXMpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgZ3JvdXApXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5LqrJyArIGdyb3VwLnJlcGxhY2UoJ+e7vOWQiCcsICflhajpg6gnKSArICfop4TliJknLFxcXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoZ3JvdXApID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwID09IFxcXFxcXFwi57u85ZCIXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb24oKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzEoXFxcXFxcXCJncm91cFxcXFxcXFwiLCBncm91cCwgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVsZXMubGVuZ3RoID09IDApIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5rKh5pyJ6KeE5YiZXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHJ1bGVzKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcXFxcXCLliarotLTmnb9cXFxcXFxcIiwgXFxcXFxcXCLnuq/mlofmnKxcXFxcXFxcIl0sIDEsICfpgInmi6nliIbkuqvmoLzlvI8nKS5zZWxlY3QoKHQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCLliarotLTmnb9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gc2hhcmVQYXN0ZSh0LCAn5LqR5Ymq6LS05p2/NicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gXFxcXFxcXCJQYXN0ZVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gXFxcXFxcXCJUZXh0XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4bGlzdDInKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiY29weTovL3Vja2vop4TliJnlj6Pku6TvvIzmiZPlvIDmtbfpmJTljbPlj6/lr7zlhaVcXFxcXFxcXG7vv6VcXFxcXFxcIiArIHQgKyBcXFxcXFxcIu+/pVxcXFxcXFwiICsgdSArICdAaW1wb3J0PWpzOiQucmVxdWlyZShcXFxcXFxcInRvb2w/cnVsZT11Y2tr5LqRXFxcXFxcXCIpLnNldFJ1bGUoaW5wdXQpOyc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgZ3JvdXApXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgXVxcXFxuICAgICAgICB9XFxcXG4gICAgfSk7XFxcXG59KTtcXFxcbmQucHVzaCh7XFxcXG4gICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXFxcbn0pO1xcXFxucnVsZXMgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0R3JvdXBKc29uKGZhbHNlLCBcXFxcXFxcImdyb3VwXFxcXFxcXCIsIHBsYXRmb3JtLCBcXFxcXFxcIue7vOWQiFxcXFxcXFwiKTtcXFxcblxcXFxu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1xcXFxuICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzEoXFxcXFxcXCJncm91cFxcXFxcXFwiLCBwbGF0Zm9ybSwgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChncm91cCAhPSBcXFxcXFxcIuWFqOWFqFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9IHJ1bGVzLmZpbHRlcihmID0+IGYuc2VhcmNoX2dyb3VwID09IGdyb3VwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAocnVsZXMubGVuZ3RoID09IDApIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5rKh5pyJ6KeE5YiZXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkocnVsZXMpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXFxcXFwi5Ymq6LS05p2/XFxcXFxcXCIsIFxcXFxcXFwi57qv5paH5pysXFxcXFxcXCJdLCAxLCAn6YCJ5oup5YiG5Lqr5qC85byPJykuc2VsZWN0KCh0KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCLliarotLTmnb9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHQsICfkupHliarotLTmnb82Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IFxcXFxcXFwiUGFzdGVcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgIC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xcXCIsIGQxID8gXFxcXFxcXCLnpoHnlKjlj5HnjrBcXFxcXFxcIiA6IFxcXFxcXFwi5ZCv55So5Y+R546wXFxcXFxcXCJdKSwgMiwgJ+mAieaLqeaJqeWxleaTjeS9nCcpLnNlbGVjdCgobSwgXykgPT4ge1xcXFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5YiG5LqrJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoW19dKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJjb3B5Oi8vdWNra+inhOWImeWPo+S7pO+8jOaJk+W8gOa1t+mYlOWNs+WPr+WvvOWFpVxcXFxcXFxcbu+/pVRleHTvv6VcXFxcXFxcIiArIF8gKyAnQGltcG9ydD1qczokLnJlcXVpcmUoXFxcXFxcXCJ0b29sP3J1bGU9dWNra+S6kVxcXFxcXFwiKS5zZXRSdWxlKGlucHV0KTsnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+e8lui+kSc6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIgPSAkLnJlcXVpcmUoJ3Rvb2w/cnVsZT11Y2tr5LqRJykuZ2V0VmFyaWFibGVzKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgYXJyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcih0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9IE9iamVjdC5rZXlzKF8pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh0IG9mIGFycikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHQsIF9bdF0gfHwgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncnVsZV91aWQnLCBtKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzZWFyY2hfZW5hYmxlZCcsIF8uc2VhcmNoX2VuYWJsZWQgfHwgXFxcXFxcXCIwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2V4cGxvcmVfZW5hYmxlZCcsIF8uZXhwbG9yZV9lbmFibGVkIHx8IFxcXFxcXFwiMFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3J1bGVFZGl0I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wYWdlVGl0bGU96KeE5YiZ57yW6L6RJnJ1bGU9dWNra+S6kSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Yig6ZmkJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi56Gu5a6a5Yig6ZmkXFxcXFxcXCIgKyBfLmdyb3VwICsgXFxcXFxcXCLop4TliJnigJxcXFxcXFxcIiArIF8udGl0bGUgKyAn4oCd5ZCX77yfXFxcXFxcXFxu5q2k5pON5L2c5LiN5Y+v6YCG77yM6K+36LCo5oWO6YCJ5oup44CCJykuY29uZmlybSgobSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8yKG0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNhdmVKc29uKHJ1bGVzKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBtKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnp7vliqgnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgenkgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0SnNvbl8yKG0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgenUgPSB6eS5zbGljZSgxKS5tYXAoXyA9PiBfLnRpdGxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFxcXFxcIuacgOWQjumdolxcXFxcXFwiKSwgMiwgJ+ivt+mAieaLqeenu+WKqOS9jee9ricpLnNlbGVjdCgoenksIHp1LCBfKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YoaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IC0xKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5wdXNoKF8pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGkgKyAxLCAwLCBfKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuc2F2ZUpzb24oenkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHp5LCB6dSwgXyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YCJ5Lit6KeE5YiZJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDIgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFxcXFxcImp4bGlzdDJcXFxcXFxcIiwge30pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MlttXSA9IF87XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcImp4bGlzdDJcXFxcXFxcIiwganhsaXN0Mik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Y+W5raI6YCJ5LitJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDIgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFxcXFxcImp4bGlzdDJcXFxcXFxcIiwge30pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGp4bGlzdDJbbV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcImp4bGlzdDJcXFxcXFxcIiwganhsaXN0Mik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5ZCv55So5Y+R546wJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn56aB55So5Y+R546wJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRKc29uXzIobSwgXFxcXFxcXCJleHBsb3JlX2VuYWJsZWRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9LCBtLCBfKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXFxcbiAgICAgICAgICAgIGltZzogXy5pY29uXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IF8uZ3JvdXAgKyAn5LioJyArIF8uc2VhcmNoX2dyb3VwICsgJ+S4qCcgKyAoXy54NV91cmwgfHwgKF8udXJsID8gXy51cmwgOiBfLnNlYXJjaF91cmwpLnNwbGl0KFxcXFxcXFwiL1xcXFxcXFwiKS5zbGljZSgwLCAzKS5qb2luKFxcXFxcXFwiL1xcXFxcXFwiKSksXFxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0SnNvbl8yKG0sIFxcXFxcXFwic2VhcmNoX2VuYWJsZWRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICB9LCBtKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChfLnNlYXJjaF9lbmFibGVkID09ICcxJyA/IDU1IDogNjMpIC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ICAgICAgICAgICAgYmxvY2tSdWxlczogZXZhbChfLng1X2Jsb2NrUnVsZXMpIHx8IFtdLFxcXFxuICAgICAgICAgICAgdXJsSW50ZXJjZXB0b3I6ICQudG9TdHJpbmcoKHVybEludGVyY2VwdG9yX2pzLCB4NVVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC5pbmNsdWRlcyhcXFxcXFxcImFsaXl1bmRyaXZlLmNvbS9cXFxcXFxcIikgfHwgaW5wdXQuaW5jbHVkZXMoXFxcXFxcXCJhbGl5dW5kcml2ZS5uZXQvXFxcXFxcXCIpIHx8IGlucHV0LmluY2x1ZGVzKFxcXFxcXFwiYWxpcGFuLmNvbS9cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6ICfkupHnm5jlkJsu566AJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2FsaXl1biNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT3kupHnm5jlkJsu566AJnBhZ2U9ZnlwYWdlJnJlYWx1cmw9XFxcXFxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXFxcXFwicXVhcmsuY25cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICA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B1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXFxcbiAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiaW5wdXRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgaWQ6IGlkICsgXFxcXFxcXCI6c2VhcmNoXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBrZXl3b3JkLFxcXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFxcXFxcInB1dE15VmFyKCdrZXl3b3JkJyxpbnB1dClcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IocnVsZVR5cGUsIFxcXFxcXFwiIzMzOTljY1xcXFxcXFwiKSkpLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFxcXFxcIue7vOWQiFxcXFxcXFwiXS5jb25jYXQoZ3JvdXBzKS5tYXAobmFtZSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKG5hbWUgPT0gcnVsZVR5cGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZSA9IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZWFyY2hfdHlwZS5pbmRleE9mKG5hbWUpID09IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG5hbWUgPSBSaWNoKFxcXFxcXFwiPFM+XFxcXFxcXCIgKyBuYW1lICsgXFxcXFxcXCI8L1M+XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gbmFtZTtcXFxcbiAgICAgICAgICAgIH0pLCAzLCBcXFxcXFxcIumAieaLqeaQnOe0ouexu+WIq1xcXFxcXFwiKS5zZWxlY3QoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC5pbmRleE9mKFxcXFxcXFwiPFM+XFxcXFxcXCIpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5rKh5pyJ5a+55bqU6KeE5YiZXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5pbmRleE9mKFxcXFxcXFwiPFxcXFxcXFwiKSA9PSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBnZXRNeVZhcigna2V5d29yZCcpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVUeXBlJywgaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXFxcXFwicnVsZUdyb3VwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXFxcXFwic2lkXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIHNlYXJjaF9ncm91cC5tYXAoKG5hbWUsIGkpID0+IHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHJ1bGVHcm91cCA9PSBpID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncnVsZUdyb3VwJywgaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcXFxcXCJzaWRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIHNlYXJjaF9ydWxlLm1hcCgoXywgaSkgPT4ge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogc2lkID09IGkgPyBSaWNoKFN0cm9uZyhDb2xvcihfLnRpdGxlKSkpIDogXy50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleXdvcmQyJywgZ2V0TXlWYXIoJ2tleXdvcmQnKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzaWQnLCBpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXFxcbiAgICAgICAgICAgICAgICB9LCBpKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcblxcXFxuXFxcXG5cXFxcblxcXFxuXFxcXG4gICAgaWYgKF9TT1UpIHtcXFxcbiAgICAgICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliqDovb3nrKxcXFxcXFxcIiArIHBhZ2UgKyBcXFxcXFxcIumhteS4re+8jOi/m+W6pu+8mjEvXFxcXFxcXCIgKyBkYXRhLmxlbmd0aCxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGVsc2UgaWYgKF9QQUdFKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuayoeacieWPr+eUqOeahOaQnOe0ouinhOWImVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGVsc2UgaWYgKF9QQUdFIHx8IHJ1bGUudXJsLm1hdGNoKFxcXFxcXFwiZnlwYWdlXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgIGlmIChfUEFHRSkge1xcXFxuICAgICAgICAgICAgaWYgKHJ1bGUudGl0bGUgIT0gXFxcXFxcXCLogZrmkJxcXFxcXFxcIikgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxiPicgKyBDb2xvcihydWxlLnRpdGxlLCAnI2ZmNjYwMScpICsgJzwvYj4nLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBbXFxcXFxcXCJjbGFzc1xcXFxcXFwiLCBcXFxcXFxcImFyZWFcXFxcXFxcIiwgXFxcXFxcXCJ5ZWFyXFxcXFxcXCIsIFxcXFxcXFwic29ydFxcXFxcXFwiLCBcXFxcXFxcIkZ5QWxsXFxcXFxcXCJdKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKHQgKyBcXFxcXFxcIl9pXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxcXG4gICAgICAgICAgICAgICAgfSwgXFxcXFxcXCJoaWtlcjovL3BhZ2UvcnVsZUhvbWU/cnVsZT11Y2tr5LqRJnBhZ2U9ZnlwYWdlJnJ1bGVOYW1lPVxcXFxcXFwiICsgcnVsZS50aXRsZSArIFxcXFxcXFwiJnJ1bGVHcm91cD1cXFxcXFxcIiArIHJ1bGUuZ3JvdXApLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBydWxlLmljb24sXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICBob21lOiAxXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBnZXRSdWxlR3JvdXAoKTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBiYXNlVXJsID0gaG9tZV9iYXNlVXJsO1xcXFxuICAgICAgICBldmFsKFN0cmluZyhydWxlLnByZVJ1bGUpKTtcXFxcbiAgICAgICAgZXZhbChTdHJpbmcocnVsZS5maW5kX3J1bGUpKTtcXFxcbiAgICB9XFxcXG59XFxcXG5fUEFHRSA/IHNldFByZVJlc3VsdChkKSA6IHNldFJlc3VsdChkKTtcXFxcbmRlbGV0ZUl0ZW1CeUNscygnbG9hZGluZ19naWYnKTtcXFxcblxcXFxuXFxcXG5cXFxcbi8vIOaQnOe0olxcXFxuaWYgKCFydWxlX3g1ICY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xcXFxcXFxcXFxcXFxcIlxcXFxcXFxcJ1xcXFxcXFxce10rKUA/L2csXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCQwLCAkMSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlMiA9IHBhZ2U7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQxLnNwbGl0KFxcXFxcXFwiQFxcXFxcXFwiKS5tYXAoXyA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBhZ2UyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9meXBhZ2UvZywgcGFnZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXFxcXFxcXCpcXFxcXFxcXCovZywga2V5d29yZCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwYWdlID09IDEgfHwgcnVsZS5zZWFyY2hfdXJsLm1hdGNoKFxcXFxcXFwiZnlwYWdlXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKHJ1bGUucHJlUnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2VhcmNoZmluZCA9IG5ldyBGdW5jdGlvbihcXFxcXFxcInJ1bGVcXFxcXFxcIiwgXFxcXFxcXCJiYXNlVXJsXFxcXFxcXCIsIFxcXFxcXFwia2V5d29yZFxcXFxcXFwiLCBcXFxcXFxcInBhZ2VcXFxcXFxcIiwgcnVsZS5zZWFyY2hGaW5kKTt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HMgKyAoaXQuZGVzYyB8fCBcXFxcXFxcIlxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXQuaW1nIHx8IGl0LnBpY191cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdC5jb2xfdHlwZSB8fCBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9QaWM6IHRydWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQuZXh0cmEgfHwge30pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzTGlzdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKF8udGl0bGUgKyBcXFxcXFxcIjpcXFxcXFxcIiArIGUudG9TdHJpbmcoKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgcGFyYW06IGl0LFxcXFxuICAgICAgICAgICAgaWQ6IFxc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xcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcXFxcXCJfbm90aGF2ZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZCk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0ocGFnZWlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWKoOi9veesrFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcXFxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBwYXJhbS5hbGwsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXFxcbiAgICAgICAgICAgIGk6IDAsXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLinbnop4TliJnnvJbovpFcXFwiLFxcXC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ICAgICBkZXNjOiBkZXNjLFxcXFxuICAgICAgICB0aXRsZTogXFxcXFxcXCI8Lz5cXFxcXFxcIixcXFxcbiAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGdyb3VwID0gJC5yZXF1aXJlKFxcXFxcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFxcXFxcIikuZ2V0R3JvdXBOYW1lcygwLCBcXFxcXFxcInNlYXJjaF9ncm91cFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIGlmICghZ3JvdXAubGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gJChncm91cCwgMywgXFxcXFxcXCLpgInmi6nop4TliJnliIbnu4RcXFxcXFxcIikuc2VsZWN0KChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKGV4dHJhLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9LCBpZCk7XFxcXG4gICAgICAgIH0sIGlkKSxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxcXG4gICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHtcXFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoaWQsIHZhbHVlKSxcXFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcXFxcXCIke2lkfVxcXFxcXFwiLCBpbnB1dClgLFxcXFxuICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXFxcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogdHJ1ZSxcXFxcbiAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXFxcbiAgICAgICAgICAgIGhlaWdodDogaGVpZ2h0IHx8IDUsXFxcXG4gICAgICAgICAgICBpZDogaWQsXFxcXG4gICAgICAgIH0sIGpzb24gfHwge30pXFxcXG4gICAgfSk7XFxcXG59XFxcXG5zd2l0Y2ggKHJ1bGVfdGlkKSB7XFxcXG4gICAgY2FzZSAn5Z+65pysJzpcXFxcbiAgICAgICAgW1xcXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDlkI3np7AnLCAndGl0bGUnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOa6kOWbvuaghycsICdpY29uJywgJyddLFxcXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDkvZzogIUnLCAnYXV0aG9yJywgJ+S9muWQjSddLFxcXFxuICAgICAgICAgICAgWyfpgInloavvvIxKc0xpYicsICdwcmVSdWxlJywgJycsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDNcXFxcbiAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcXFxuICAgICAgICAgICAgaW5wdXRfcHVzaChhLCBiLCBjLCBlLCAxKTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgJ+aQnOe0oic6XFxcXG4gICAgICAgIFtcXFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5pCc57Si6ZO+5o6lJywgJ3NlYXJjaF91cmwnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+W/heWhq++8jOaQnOe0ouWIhue7hCcsICdzZWFyY2hfZ3JvdXAnLCAn5YWo5YWoJywge1xc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1ID8gNTUgOiA2MykgKyAnLnN2ZydcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIFtcXFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5rqQ6ZO+5o6lJywgJ3VybCcsICcnLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxXFxcXG4gICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5YiX6KGo6KeE5YiZXFxcXFxcXFxu5ZCv55SoeDXlsLHkuI3nlKjlhpnkuoZcXFxcXFxcXG5cXFxcXFxcXG7nu6fmib/mlbDnu4Rk77yaIGQucHVzaChqc29uKTsnLCAnZmluZF9ydWxlJywgJyddLFxcXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcXFxuICAgICAgICAgICAgaW5wdXRfcHVzaChhLCBiLCBjLCBlKTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgJ+abv+aNoic6XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCflj5HnjrDpk77mjqXmm7/mjaInKSxcXFxcbiAgICAgICAgICAgIGRlc2M6ICfpgInloasnLFxcXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9ob21lX2ljb25fZWRpdCdcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIFtcXFxcbiAgICAgICAgICAgIFsn5YiG57G75ZCN56ewJywgJ2NsYXNzX25hbWUnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+WIhuexu+abv+aNoicsICdjbGFzc191cmwnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+WcsOWMuuWQjeensCcsICdhcmVhX25hbWUnLCAnJ10sXF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gIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogJzxiPumfs+inhumikeiHquWKqOaSreaUvjwvYj4nLFxcXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X2F1dG9QbGF5JywgeCk7XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICB9LCB4NV9hdXRvUGxheSA/ICcwJyA6ICcxJyksXFxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfYXV0b1BsYXkgPyA1NSA6IDYzKSArICcuc3ZnJyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJ1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCd4NeaJqeWxlScpLFxcXFxuICAgICAgICAgICAgZGVzYzogJ+mAieWhqycsXFxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6aaW6aG15LiN5pi+56S65pCc57Si5qGGPC9iPicsXFxcXG4gICAgIC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gPSBrZXk7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICB9LCBpZCwga2V5KSxcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGlkOiBpZCArIFxcXFxcXFwiOmtleTpcXFxcXFxcIiArIGtleSxcXFxcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIjprZXlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaTlhbPplK7or406XFxcXFxcXCIgKyBrZXksXFxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGlkLCBrZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXFxcXFwic2VhcmNoSGlzdG9yeVxcXFxcXFwiLCBbXSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpaSA9IGhpc3RvcnkuaW5kZXhPZihrZXkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcXFxcXCJzZWFyY2hIaXN0b3J5XFxcXFxcXCIsIGhpc3RvcnkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgXFxcXFxcXCI6a2V5OlxcXFxcXFwiICsga2V5KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID09PSAwKSBhZGRJdGVtQWZ0ZXIoaWQgKyBcXFxcXFxcIjpzZWFyY2hIaXN0b3J5XFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ1cXFxcXFxcIiArIFxcXFxcXFwifn5+5LuA5LmI6YO95rKh5pyJ5ZOmfn5+XFxcXFxcXCIuZm9udGNvbG9yKFxcXFxcXFwiR3JheVxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiOmtleVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9LCBpZCwga2V5KVxcXFxuICAgICAgICAgICAgfV1cXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxufSk7YCxcXFxcblxcXFxuICAgICAgICBjbGFzc19uYW1lOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICBjbGFzc191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIGFyZWFfbmFtZTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgYXJlYV91cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIHllYXJfbmFtZTogXFxcXFxcXCJcX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yYWdlMC5zZXRJdGVtKFxcXFxcXFwic2VhcmNoSGlzdG9yeVxcXFxcXFwiLCBoaXN0b3J5KTtcXFxcblxcXFxuICAgICAgICAgICAgbGV0IGRkID0gZDtcXFxcbiAgICAgICAgICAgIGJhc2VVcmwgPSBydWxlLnNlYXJjaF91cmxcXFxcbiAgICAgICAgICAgICAgICAucmVwbGFjZShcXFxcbiAgICAgICAgICAgICAgICAgICAgL2Z5cGFnZUAoW15cXFxcXFxcXD9cXFxcXFxcXCZcXFxcXFxcXDtcXFxcXFxcXCNcXFxcXFxcXFxcXFxcXFwiXFxcXFxcXFwnXFxcXFxcXFx7XSspQD8vZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgKCQwLCAkMSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTIgPSBwYWdlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJDEuc3BsaXQoXFxcXFxcXCJAXFxcXFxcXCIpLm1hcChfID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGFnZTI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICApXFxcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL2Z5cGFnZS9nLCBwYWdlKVxcXFxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXFxcXFxcXCpcXFxcXFxcXCovZywga2V5d29yZCk7XFxcXG4gICAgICAgICAgICBzZWFyY2hmaW5kID0gbmV3IEZ1bmN0aW9uKFxcXFxcXFwicnVsZVxcXFxcXFwiLCBcXFxcXFxcImJhc2VVcmxcXFxcXFxcIiwgXFxcXFxcXCJrZXl3b3JkXFxcXFxcXCIsIFxcXFxcXFwicGFnZVxcXFxcXFwiLCBydWx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