Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥⚙️设置@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS4u+mhtVwiLFwicGF0aFwiOlwiaG9tZVwiLFwicnVsZVwiOlwianM6XFxudmFyIGQgPSBbXTtcXG5pZiAoZmlsZUV4aXN0KFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL2FsaXN0X2NhY2hlLmpzb25cXFwiKSkge1xcbiAgICBsZXQgYWxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pXFxuICAgIHZhciBsID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9hbGlzdF9jYWNoZS5qc29uXFxcIikpXFxuICAgIHZhciB0ZXN0bGlzdCA9IGFsaXN0Lm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICByZXR1cm4gaXRlbS51cmxcXG4gICAgfSlcXG4gICAgbC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgaWYgKCF0ZXN0bGlzdC5pbmNsdWRlcyhpdGVtLnVybCkpIHtcXG4gICAgICAgICAgICBhbGlzdC5wdXNoKGl0ZW0p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IH0gZWxzZSB7XFxuICAgICAgICAgICAgdG9hc3QoXFxcIueZu+mZhuWksei0pVxcXCIpXFxuICAgICAgICAgICAgbG9nKHJlcylcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIui0puWPt+WvhueggemUmeivr1xcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICBpZiAocGF0aCA9PSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKame+4j+iuvue9rlxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBhbGlzdC5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaSA9PSBzZWxlY3RlZCA/ICQucmVxdWlyZShcXFwiYXBpXFxcIikuY29sb3IoaXRlbS5uYW1lLCBcXFwicmVkXFxcIikgOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBpID09IHNlbGVjdGVkID8gXFxcIng1Oi8vXFxcIiArIG5vdy51cmwgOiAkKCkubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJzZWxlY3RlZFxcXCIsIGkgKyBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSlcXG4gICAgICAgIGlmIChub3cuc2VhcmNoKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLwn5SOIOaQnOe0olxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9zZWFyY2g/cGFnZT1meXBhZ2UmdT1cXFwiICsgbm93LnVybCArIFxcXCImcGF0aD1cXFwiICsgcGF0aCxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICBub3c6IG5vd1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChub3cudXNlciAmJiBub3cucGFzc3dvcmQpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaWsOW7uuaWh+S7tuWkuVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9ta2RpclxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGggKyBcXFwiL1xcXCIgKyBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnNcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yib5bu65oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yib5bu65aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBwYXRoLCBub3csIGhlYWRlcnMpXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaWsOW7uuaWh+S7tlxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1tcXFwiRmlsZS1QYXRoXFxcIl0gPSBlbmNvZGVVUkkocGF0aCArIFxcXCIvXFxcIiArIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdChub3cudXJsICsgXFxcImFwaS9mcy9wdXRcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IFxcXCJQVVRcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmt7vliqBhcmlhMuS7u+WKoVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiXFxcIiwgXFxcIuWkmuadoeeUqOWbnui9pumalOW8gFxcXCIpLmlucHV0KChwYXRoLCBub3csIGhlYWRlcnMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXCJhcGkvZnMvYWRkX2FyaWEyXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogcGF0aCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogaW5wdXQuc3BsaXQoXFxcIlxcXFxuXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgIH0pXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KVxcblxcbiAgICAgICAgLy8g5o6S5bqPXFxuICAgICAgICBzb3JyLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgaWYgKG5zb3J0ID09IGl0ZW0pIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXCLihpNcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChuc29ydC5pbmNsdWRlcyhcXFwi5Y+NXFxcIikgJiYgbnNvcnQuaW5jbHVkZXMoaXRlbSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXCLihpFcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXCLihpVcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXCJzb3J0XFxcIiwgXFxcIum7mOiupFxcXCIpID09IGl0ZW0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJzb3J0XFxcIiwgaXRlbSArIFxcXCLlj41cXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJzb3J0XFxcIiwgaXRlbSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBsZXQgYmlkID0gcGF0aCArIFxcXCItbG9hZGluZy1cXFwiICsgTVlfUEFHRTtcXG4gICAgbGV0IGQyID0gW107XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuWKquWKm+WKoOi9veS4re+8jOivt+eojeWAmS4uLlxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogYmlkLFxcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KVxcbiAgICBzZXRSZXN1bHQoZCk7XFxuXFxuICAgIHRyeSB7XFxuICAgICAgICAvLyDojrflj5bmlofku7bliJfooahcXG4gICAgICAgIHZhciBsaXN0ID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFwiYXBpL2ZzL2xpc3RcXFwiLCB7XFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGF0aFxcXCI6IHBhdGgsXFxuICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGFsaXN0W3NlbGVjdGVkXVtcXFwiYnJvd3Nlci1wYXNzd29yZFxcXCJdW3BhdGhdID8gYWxpc3Rbc2VsZWN0ZWRdW1xcXCJicm93c2VyLXBhc3N3b3JkXFxcIl1bcGF0aF0gOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInBhZ2VcXFwiOiBNWV9QQUdFLFxcbiAgICAgICAgICAgICAgICBcXFwicGVyX3BhZ2VcXFwiOiAzMCxcXG4gICAgICAgICAgICAgICAgXFxcInJlZnJlc2hcXFwiOiBmYWxzZVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnNcXG4gICAgICAgIH0pKVxcbiAgICAgICAgaWYgKGxpc3QuY29kZSA9PSAyMDAgJiYgbGlzdC5kYXRhLmNvbnRlbnQpIHtcXG4gICAgICAgICAgICBzb3J0cyhsaXN0LmRhdGEuY29udGVudCwgbnNvcnQpXFxuICAgICAgICAgICAgbGlzdC5kYXRhLmNvbnRlbnQuZm9yRWFjaCgoaXRlbSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIGRlc2MgPSBmb3JtYXREYXRlKGl0ZW0ubW9kaWZpZWQpICsgXFxcIiBcXFwiICsgZ2V0RmlsZVNpemUoaXRlbS5zaXplKVxcbiAgICAgICAgICAgICAgICB2YXIgZG93bl91cmwgPSBlbmNvZGVVUkkobm93LnVybCArIFxcXCJkXFxcIiArIChwYXRoID09IFxcXCIvXFxcIiA/IFxcXCJcXFwiIDogcGF0aCkgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIGl0ZW0uc2lnbilcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9ICQoKS5sYXp5UnVsZSgoaXRlbSwgdXJsLCBwYXRoLCBsaXN0LCB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCB0eXBlX2RpY3QgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgMDogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAyOiAkLnRvU3RyaW5nKCh1cmwsIGxpc3QsIHUsIHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN1YnRpdGxlcyA9ICQucmVxdWlyZShcXFwiYXBpXFxcIikuZ2V0U3VidGl0bGVzKGxpc3QsIHUsIHBhdGgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWJ0aXRsZXMubGVuZ3RoID4gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5hbWVsaXN0ID0gc3VidGl0bGVzLm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKG5hbWVsaXN0LCAxLCBcXFwi6K+36YCJ5oup5a2X5bmVXFxcIikuc2VsZWN0KChzdWJ0aXRsZXMsIG5hbWVsaXN0LCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IHN1YnRpdGxlc1tuYW1lbGlzdC5pbmRleE9mKGlucHV0KV0udXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHN1YnRpdGxlcywgbmFtZWxpc3QsIHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwsIGxpc3QsIHUsIHBhdGgpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiNpc011c2ljPXRydWUjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgNDogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICA1OiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjLmpwZ1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc19kaXIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9ob21lP3BhZ2U9ZnlwYWdlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLnJlcXVpcmUoXFxcImFwaVxcXCIpLmdldEh6bShpdGVtLm5hbWUpID09IFxcXCJwZGZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL2FsaXN0LW9yZy5naXRodWIuaW8vcGRmLmpzL3dlYi92aWV3ZXIuaHRtbD9maWxlPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5vZmZpY2UuaW5jbHVkZXMoJC5yZXF1aXJlKFxcXCJhcGlcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuW+rui9r1xcXCIsIFxcXCLosLfmrYxcXFwiXSkuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLlvq7ova9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vdmlldy5vZmZpY2VhcHBzLmxpdmUuY29tL29wL3ZpZXcuYXNweD9zcmM9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9ndmlldz8mZW1iZWRkZWQ9dHJ1ZSZ1cmw9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbCh0eXBlX2RpY3RbaXRlbS50eXBlXSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgZG93bl91cmwsIHBhdGgsIGxpc3QuZGF0YS5jb250ZW50LCBub3cudXJsKVxcbiAgICAgICAgICAgICAgICB2YXIgbG9uZ0NsaWNrID0gW11cXG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmlzX2Rpcikge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiL6L29XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgdSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIHVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBkb3duX3VybCwgcGF0aClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIueUqOWFtuS7lui9r+S7tuaJk+W8gFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKHUsIFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXCIgKyBpdGVtLm5hbWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwib3BlbkZpbGU6Ly9cXFwiICsgXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGRvd25fdXJsLCBwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWIoOmZpO+8n1xcXCIpLmNvbmZpcm0oKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9yZW1vdmVcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcjogcGF0aCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtpdGVtLm5hbWVdXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YeN5ZG95ZCNXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGl0ZW0ubmFtZSkuaW5wdXQoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9yZW5hbWVcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGggKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6YeN5ZG95ZCN5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6YeN5ZG95ZCN5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogZ2V0SXRlbShcXFwic3R5bGVcXFwiLCBcXFwiYXZhdGFyXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGdldEljb24oaXRlbSksXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IChwYXRoID09IFxcXCIvXFxcIiA/IFxcXCIvXFxcIiA6IHBhdGggKyBcXFwiL1xcXCIpICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFwicGxheWxpc3QgbWFpblxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oXFxcInN0eWxlXFxcIiwgXFxcImF2YXRhclxcXCIpID09IFxcXCJhdmF0YXJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAmOKAmOKAmeKAmTxzbWFsbD48Zm9udCBjb2xvcj0nI2FhYWFhYSc+JHtkZXNjfTwvZm9udD48L3NtYWxsPmAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogKHBhdGggPT0gXFxcIi9cXFwiID8gXFxcIi9cXFwiIDogcGF0aCArIFxcXCIvXFxcIikgKyBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcInBsYXlsaXN0IGRlc2NcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKGxpc3QubWVzc2FnZSA9PSBcXFwicGFzc3dvcmQgaXMgaW5jb3JyZWN0IG9yIHlvdSBoYXZlIG5vIHBlcm1pc3Npb25cXFwiKSB7XFxuICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5rWP6KeI5a+G56CB6ZSZ6K+vXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCJcXFwiLCBcXFwi6L6T5YWl5a+G56CBXFxcIikuaW5wdXQoKGFsaXN0LCBzZWxlY3RlZCwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgYWxpc3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ByZXR1cm4gXFxcInRvYXN0Oi8v5ZCN56ew5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgfSBlbHNlIGlmIChzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pLm1hcChmdW5jdGlvbihpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBpLm5hbWVcXG4gICAgICAgICAgICB9KS5pbmNsdWRlcyhpbnB1dCkpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5pyJ55u45ZCM55qE572R56uZ5LqGXFxcIlxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIumTvuaOpSDnpLrkvos6aHR0cDovLzEyNy4wLjAuMS9cXFwiKS5pbnB1dCgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoIWlucHV0LmluY2x1ZGVzKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFwiXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXRbaW5wdXQubGVuZ3RoIC0gMV0gIT0gXFxcIi9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgKz0gXFxcIi9cXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0ICsgXFxcImFwaS9wdWJsaWMvc2V0dGluZ3NcXFwiKSkuZGF0YVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pXFxuICAgICAgICAgICAgICAgICAgICBsaXN0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiYnJvd3Nlci1wYXNzd29yZFxcXCI6IHt9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hcXFwiOiBjb25maWcuc2VhcmNoX2luZGV4ICYmIGNvbmZpZy5zZWFyY2hfaW5kZXggIT0gXFxcIm5vbmVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH1cXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbn0sIHtcXG4gICAgdGl0bGU6IFxcXCLliIbkuqtcXFwiLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgIHVybDogJChbXFxcIuS7heWIhuS6q+e9keermVxcXCIsIFxcXCLliIbkuqvnvZHnq5nliqDlr4bnoIFcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKVxcbiAgICAgICAgaWYgKGlucHV0ID09IFxcXCLku4XliIbkuqvnvZHnq5lcXFwiKSB7XFxuICAgICAgICAgICAgdmFyIGFsaXN0ID0gbGlzdC5tYXAoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBpdGVtLnVybCxcXG4gICAgICAgICAgICAg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gdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgIGRlc2M6IGl0ZW0udXJsLFxcbiAgICAgICAgdXJsOiAkKFtcXFwi5Yig6ZmkXFxcIiwgXFxcIuaOkuW6j1xcXCIsIFxcXCLkv67mlLnlkI3np7BcXFwiLCBcXFwi5L+u5pS56ZO+5o6lXFxcIiwgXFxcIuS/ruaUuei0puaIt+WvhueggVxcXCJdKS5zZWxlY3QoKGEsIGkpID0+IHtcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImxpc3RcXFwiLCBbXSlcXG4gICAgICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuWIoOmZpFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu6K6k5Yig6Zmk77yfXFxcIikuY29uZmlybSgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3Quc3BsaWNlKGksIDEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJdGVtKFxcXCJzZWxlY3RlZFxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCLkv67mlLnlkI3np7BcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXS5uYW1lKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5ZCN56ew5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKS5tYXAoZnVuY3Rpb24oaSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGkubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5pbmNsdWRlcyhpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sue7j+acieebuOWQjOeahOe9keermeS6hlxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldLm5hbWUgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCLkv67mlLnpk77mjqVcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXS51cmwpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpbnB1dC5pbmNsdWRlcyhcXFwiaHR0cFxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldLnVybCA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUuei0puaIt+WvhueggVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldW1xcXCJ1c2VyXFxcIl0gPyBsaXN0W2ldW1xcXCJ1c2VyXFxcIl0gOiBcXFwiXFxcIiwgXFxcIui0puWPt1xcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA/IGxpc3RbaV1bXFxcInBhc3N3b3JkXFxcIl0gOiBcXFwiXFxcIiwgXFxcIuWvhueggVxcXCIpLmlucHV0KCh1c2VyLCBsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV1bXFxcInVzZXJcXFwiXSA9IHVzZXJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQsIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCLmjpLluo9cXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaSArIDEgKyBcXFwiXFxcIiwgXFxcIuaLjeWIsOesrOWHoOS4qlxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2tSYXRlKGlucHV0KSB744CA44CAXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZSA9IC9eWzAtOV0rLj9bMC05XSovOyAvL+WIpOaWreWtl+espuS4suaYr+WQpuS4uuaVsOWtly8v5Yik5pat5q2j5pW05pWwL1sx4oiSOV0rWzDiiJI5XeKIl13iiJcvXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOOAgOOAgFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmUudGVzdChpbnB1dCnjgIDjgIBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZWNrUmF0ZShpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGEgPSBwYXJzZUludChpbnB1dCkgLSAxIC8vIOebruagh1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+IGxpc3QubGVuZ3RoICYmIGEgPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuS4jeiDveWkp+S6juWIl+ihqOaVsOmHj++8gVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcCA9IGxpc3RbYV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbYV0gPSBsaXN0W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldID0gdGVtcFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi6K+36L6T5YWl5q2j5pW05pWwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIGl0ZW0sIGkpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiXFxuICAgIH0pXFxufSlcXG5zZXRSZXN1bHQoZCk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLku6PnoIFcIixcInBhdGhcIjpcImFwaVwiLFwicnVsZVwiOlwiJC5leHBvcnRzID0ge1xcbiAgICBjb2xvcjogZnVuY3Rpb24odGV4dCwgY29sb3IpIHtcXG4gICAgICAgIHJldHVybiBg4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiJHtjb2xvcn1cXFwiPiR7dGV4dH08L2Zyb250Pjwvc3Ryb25nPmBcXG4gICAgfSxcXG4gICAgZ2V0SWNvbjogZnVuY3Rpb24oY29udGVudCkge1xcbiAgICAgICAgaWYgKGNvbn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AgaWYgKHNpemUgPiAxMDI0KSB7XFxuICAgICAgICAgICAgICAgIHNpemUgLz0gMTAyNDtcXG4gICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHNpemUudG9GaXhlZCgyKS5yZXBsYWNlKC8oXFxcXC4wMCkkLywgXFxcIlxcXCIpICsgdW5pdEZvcm1baV07XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJFUlJPUjrmlbDlgLzov4flpKdcXFwiO1xcbiAgICB9LFxcbiAgICBnZXRIem06IGZ1bmN0aW9uKGZpbGVOYW1lKSB7XFxuICAgICAgICByZXR1cm4gZmlsZU5hbWUuc3Vic3RyKGZpbGVOYW1lLmxhc3RJbmRleE9mKFxcXCIuXFxcIikgKyAxKVxcbiAgICB9LFxcbiAgICBzb3J0czogZnVuY3Rpb24obGlzdCwgbWV0aG9kKSB7XFxuICAgICAgICBpZiAobWV0aG9kLmluY2x1ZGVzKFxcXCLlkI3np7BcXFwiKSkge1xcbiAgICAgICAgICAgIGxpc3Quc29ydChmdW5jdGlvbihhLCBiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhLm5hbWUubG9jYWxlQ29tcGFyZShiLm5hbWUpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kLmluY2x1ZGVzKFxcXCLml7bpl7RcXFwiKSkge1xcbiAgICAgICAgICAgIGxpc3Quc29ydChmdW5jdGlvbihhLCBiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhLm1vZGlmaWVkIC0gYi5tb2RpZmllZFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZC5pbmNsdWRlcyhcXFwi5aSn5bCPXFxcIikpIHtcXG4gICAgICAgICAgICBsaXN0LnNvcnQoZnVuY3Rpb24oYSwgYikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gYS5zaXplIC0gYi5zaXplXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChtZXRob2QuaW5jbHVkZXMoXFxcIuWPjVxcXCIpKSB7XFxuICAgICAgICAgICAgbGlzdC5yZXZlcnNlKCk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gbGlzdFxcbiAgICB9LFxcbiAgICBnZXRTdWJ0aXRsZXM6IGZ1bmN0aW9uKGxpc3QsIHVybCwgcGF0aCkge1xcbiAgICAgICAgY29uc3Qge1xcbiAgICAgICAgICAgIGdldEh6bVxcbiAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiYXBpXFxcIilcXG4gICAgICAgIGxldCBzID0gW11cXG4gICAgICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICBpZiAoJC5zdWJ0aXRsZS5pbmNsdWRlcyhnZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZW5jb2RlVVJJKHVybCArIFxcXCJkXFxcIiArIChwYXRoID09IFxcXCIvXFxcIiA/IFxcXCJcXFwiIDogcGF0aCkgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIGl0ZW0uc2lnbilcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgcy51bnNoaWZ0KHtcXG4gICAgICAgICAgICBuYW1lOiBcXFwi5LiN6ZyA6KaB5a2X5bmVXFxcIlxcbiAgICAgICAgfSlcXG4gICAgICAgIHJldHVybiBzXFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmkJzntKJcIixcInBhdGhcI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TT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmVudFxcXCI6IGdldFBhcmFtKFxcXCJwYXRoXFxcIiksXFxuICAgICAgICAgICAgICAgIFxcXCJrZXl3b3Jkc1xcXCI6IGdldE15VmFyKFxcXCJrd1xcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgXFxcInBhZ2VcXFwiOiBNWV9QQUdFLFxcbiAgICAgICAgICAgICAgICBcXFwicGVyX3BhZ2VcXFwiOiAxMDBcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSkpXFxuICAgICAgICBpZiAobGlzdC5jb2RlID09IDIwMCAmJiBsaXN0LmRhdGEuY29udGVudCkge1xcbiAgICAgICAgICAgIGxpc3QuZGF0YS5jb250ZW50LmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBkZXNjID0gZ2V0RmlsZVNpemUoaXRlbS5zaXplKVxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IEpTT04ucGFyc2UocG9zdCh1ICsgXFxcImFwaS9mcy9nZXRcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXRoXFxcIjogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnblxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IGVuY29kZVVSSSh1ICsgXFxcImRcXFwiICsgaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIHNpZ24pXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCB0eXBlX2RpY3QgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgMDogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAyOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiNpc011c2ljPXRydWUjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgNDogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICA1OiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjLmpwZ1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc19kaXIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9ob21lP3BhZ2U9ZnlwYWdlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLnJlcXVpcmUoXFxcImFwaVxcXCIpLmdldEh6bShpdGVtLm5hbWUpID09IFxcXCJwZGZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL2FsaXN0LW9yZy5naXRodWIuaW8vcGRmLmpzL3dlYi92aWV3ZXIuaHRtbD9maWxlPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5vZmZpY2UuaW5jbHVkZXMoJC5yZXF1aXJlKFxcXCJhcGlcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuW+rui9r1xcXCIsIFxcXCLosLfmrYxcXFwiXSkuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLlvq7ova9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vdmlldy5vZmZpY2VhcHBzLmxpdmUuY29tL29wL3ZpZXcuYXNweD9zcmM9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9ndmlldz8mZW1iZWRkZWQ9dHJ1ZSZ1cmw9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbCh0eXBlX2RpY3RbaXRlbS50eXBlXSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgbm93LnVybCwgcGF0aCwgaGVhZGVycylcXG4gICAgICAgICAgICAgICAgdmFyIGxvbmdDbGljayA9IFtdXFxuICAgICAgICAgICAgICAgIGlmICghaXRlbS5pc19kaXIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS4i+i9vVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgsIGhlYWRlcnMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJkb3dubG9hZDovL1xcXCIgKyBlbmNvZGVVUkkodSArIFxcXCJkXFxcIiArIGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lICsgXFxcIj9zaWduPVxcXCIgKyBKU09OLnBhcnNlKHBvc3QodSArIFxcXCJhcGkvZnMvZ2V0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGF0aFxcXCI6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5zaWduKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnlKjlhbbku5bova/ku7bmiZPlvIBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzaWduID0gSlNPTi5wYXJzZShwb3N0KHUgKyBcXFwiYXBpL2ZzL2dldFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhdGhcXFwiOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoZW5jb2RlVVJJKHUgKyBcXFwiZFxcXCIgKyBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCI/c2lnbj1cXFwiICsgc2lnbiksIFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXCIgKyBpdGVtLm5hbWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwib3BlbkZpbGU6Ly9cXFwiICsgXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChub3cudXNlciAmJiBub3cucGFzc3dvcmQpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu6K6k5Yig6Zmk77yfXFxcIikuY29uZmlybSgoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFwiYXBpL2ZzL3JlbW92ZVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyOiBpdGVtLnBhcmVudCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtpdGVtLm5hbWVdXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YeN5ZG95ZCNXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGl0ZW0ubmFtZSkuaW5wdXQoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9yZW5hbWVcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aTjeS9nOaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aTjeS9nOWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogZ2V0SXRlbShcXFwic3R5bGVcXFwiLCBcXFwiYXZhdGFyXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGdldEljb24oaXRlbSksXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXCJzdHlsZVxcXCIsIFxcXCJhdmF0YXJcXFwiKSA9PSBcXFwiYXZhdGFyXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAmOKAmOKAmeKAmTxzbWFsbD48Zm9udCBjb2xvcj0nI2FhYWFhYSc+JHtkZXNjfTwvZm9udD48L3NtYWxsPmAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0gZWxzZSBpZiAobGlzdC5jb2RlICE9IDIwMCkge1xcbiAgICAgICAgICAgIHRvYXN0KFxcXCLlh7rplJnkuoZcXFwiKVxcbiAgICAgICAgICAgIGxvZyhsaXN0Lm1lc3NhZ2UpXFxuICAgICAgICB9XFxuICA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q6Ly/lkI3np7DkuI3og73kuLrnqbpcXFwiXFxuICAgICAgICB9IGVsc2UgaWYgKHN0b3JhZ2UwLmdldEl0ZW0oXFxcImxpc3RcXFwiLCBbXSkubWFwKGZ1bmN0aW9uKGkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGkubmFtZVxcbiAgICAgICAgICAgIH0pLmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lnu4/mnInnm7jlkIznmoTnvZHnq5nkuoZcXFwiXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6ZO+5o6lIOekuuS+izpodHRwOi8vMTI3LjAuMC4xL1xcXCIpLmlucHV0KChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCArPSBcXFwiL1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZhciBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoaW5wdXQgKyBcXFwiYXBpL3B1YmxpYy9zZXR0aW5nc1xcXCIpKS5kYXRhXFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImxpc3RcXFwiLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJicm93c2VyLXBhc3N3b3JkXFxcIjoge30sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaFxcXCI6IGNvbmZpZy5zZWFyY2hfaW5kZXggJiYgY29uZmlnLnNlYXJjaF9pbmRleCAhPSBcXFwibm9uZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxufSwge1xcbiAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgdXJsOiAkKFtcXFwi5LuF5YiG5Lqr572R56uZXFxcIiwgXFxcIuWIhuS6q+e9keermeWKoOWvhueggVxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgdmFyIGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pXFxuICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuS7heWIhuS6q+e9keermVxcXCIpIHtcXG4gICAgICAgICAgICB2YXIgYWxpc3QgPSBsaXN0Lm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGl0ZW0udXJsLFxcbiAgICAgICAgICAgICAgICAgICAgX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B0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgZGVzYzogaXRlbS51cmwsXFxuICAgICAgICB1cmw6ICQoW1xcXCLliKDpmaRcXFwiLCBcXFwi5o6S5bqPXFxcIiwgXFxcIuS/ruaUueWQjeensFxcXCIsIFxcXCLkv67mlLnpk77mjqVcXFwiLCBcXFwi5L+u5pS56LSm5oi35a+G56CBXFxcIl0pLnNlbGVjdCgoYSwgaSkgPT4ge1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKVxcbiAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5Yig6ZmkXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7orqTliKDpmaTvvJ9cXFwiKS5jb25maXJtKChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5zcGxpY2UoaSwgMSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oXFxcInNlbGVjdGVkXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUueWQjeensFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLm5hbWUpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lkI3np7DkuI3og73kuLrnqbpcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pLm1hcChmdW5jdGlvbihpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5pyJ55u45ZCM55qE572R56uZ5LqGXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0ubmFtZSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUuemTvuaOpVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLnVybCkuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlucHV0LmluY2x1ZGVzKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0W2lucHV0Lmxlbmd0aCAtIDFdICE9IFxcXCIvXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP6ZSZ6K+vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0udXJsID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5L+u5pS56LSm5oi35a+G56CBXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGxpc3RbaV1bXFxcInVzZXJcXFwiXSA/IGxpc3RbaV1bXFxcInVzZXJcXFwiXSA6IFxcXCJcXFwiLCBcXFwi6LSm5Y+3XFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldW1xcXCJwYXNzd29yZFxcXCJdID8gbGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA6IFxcXCJcXFwiLCBcXFwi5a+G56CBXFxcIikuaW5wdXQoKHVzZXIsIGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXVtcXFwidXNlclxcXCJdID0gdXNlclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldW1xcXCJwYXNzd29yZFxcXCJdID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuaOkuW6j1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpICsgMSArIFxcXCJcXFwiLCBcXFwi5ouN5Yiw56ys5Yeg5LiqXFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGVja1JhdGUoaW5wdXQpIHvjgIDjgIBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gL15bMC05XSsuP1swLTldKi87IC8v5Yik5pat5a2X56ym5Liy5piv5ZCm5Li65pWw5a2XLy/liKTmlq3mraPmlbTmlbAvWzHiiJI5XStbMOKIkjld4oiXXeKIly9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg44CA44CAXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZS50ZXN0KGlucHV0KeOAgOOAgFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2tSYXRlKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IHBhcnNlSW50KGlucHV0KSAtIDEgLy8g55uu5qCHXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhID4gbGlzdC5sZW5ndGggJiYgYSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5LiN6IO95aSn5LqO5YiX6KGo5pWw6YeP77yBXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wID0gbGlzdFthXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFthXSA9IGxpc3RbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0gPSB0ZW1wXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLor7fovpPlhaXmraPmlbTmlbBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgaXRlbSwgaSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCJcXG4gICAgfSlcXG59KVxcbnNldFJlc3VsdChkKTtcIixcImdyb3VwXCI6XCLikaDnvZHnm5hcIixcInVhXCI6XCJtb2JpbGVcIixcInByZVJ1bGVcIjpcIiQuZXh0ZW5kKHtcXG4gICAgdGV4dDogW1xcXCJodG1cXFwiLCBcXFwiaHRtbFxcXCIsIFxcXCJ4bWxcXFwiLCBcXFwiamF2YVxcXCIsIFxcXCJwcm9wZXJ0aWVzXFxcIiwgXFxcInNxbFxcXCIsIFxcXCJqc1xcXCIsIFxcXCJtZFxcXCIsIFxcXCJqc29uXFxcIiwgXFxcImNvbmZcXFwiLCBcXFwiaW5pXFxcIiwgXFxcInZ1ZVxcXCIsIFxcXCJwaHBcXFwiLCBcXFwicHlcXFwiLCBcXFwiYmF0XFxcIiwgXFxcImdpdGlnb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gIGlmIChyZXMuY29kZSA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgIGhlYWRlcnNbXFxcXFxcXCJBdXRob3JpemF0aW9uXFxcXFxcXCJdID0gcmVzLmRhdGEudG9rZW5cXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi55m76ZmG5aSx6LSlXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICBsb2cocmVzKVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLotKblj7flr4bnoIHplJnor69cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIHNldFJlc3VsdChkKVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIGlmIChNWV9QQUdFID09IDEpIHtcXFxcbiAgICAgICAgaWYgKHBhdGggPT0gXFxcXFxcXCIvXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4pqZ77iP6K6+572uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBhbGlzdC5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGkgPT0gc2VsZWN0ZWQgPyAkLnJlcXVpcmUoXFxcXFxcXCJhcGlcXFxcXFxcIikuY29sb3IoaXRlbS5uYW1lLCBcXFxcXFxcInJlZFxcXFxcXFwiKSA6IGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGkgPT0gc2VsZWN0ZWQgPyBcXFxcXFxcIng1Oi8vXFxcXFxcXCIgKyBub3cudXJsIDogJCgpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwic2VsZWN0ZWRcXFxcXFxcIiwgaSArIFxcXFxcXFwiXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgaSlcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBpZiAobm93LnNlYXJjaCkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLwn5SOIOaQnOe0olxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL3NlYXJjaD9wYWdlPWZ5cGFnZSZ1PVxcXFxcXFwiICsgbm93LnVybCArIFxcXFxcXFwiJnBhdGg9XFxcXFxcXCIgKyBwYXRoLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgIG5vdzogbm93XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaWsOW7uuaWh+S7tuWkuVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJcXFxcXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9ta2RpclxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogcGF0aCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaW5wdXRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVyc1xcXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rmiJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rlpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcXFxuICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaWsOW7uuaWh+S7tlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJcXFxcXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzW1xcXFxcXFwiRmlsZS1QYXRoXFxcXFxcXCJdID0gZW5jb2RlVVJJKHBhdGggKyBcXFxcXFxcIi9cXFxcXFxcIiArIGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShyZXF1ZXN0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9wdXRcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IFxcXFxcXFwiUFVUXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yib5bu65oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yib5bu65aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGgsIG5vdywgaGVhZGVycylcXFxcbiAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmt7vliqBhcmlhMuS7u+WKoVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLlpJrmnaHnlKjlm57ovabpmpTlvIBcXFxcXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9hZGRfYXJpYTJcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogaW5wdXQuc3BsaXQoXFxcXFxcXCJcXFxcXFxcXG5cXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVyc1xcXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rmiJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rlpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCJcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJpZ19ibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJiaWdfYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICB9KVxcXFxuXFxcXG4gICAgICAgIC8vIOaOkuW6j1xcXFxuICAgICAgICBzb3JyLmZvckVhY2goaXRlbSA9PiB7XFxcXG4gICAgICAgICAgICBpZiAobnNvcnQgPT0gaXRlbSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0gKyBcXFxcXFxcIuKGk1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKG5zb3J0LmluY2x1ZGVzKFxcXFxcXFwi5Y+NXFxcXFxcXCIpICYmIG5zb3J0LmluY2x1ZGVzKGl0ZW0pKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXFxcXFwi4oaRXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXFxcXFwi4oaVXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaXRlbSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbShcXFxcXFxcInNvcnRcXFxcXFxcIiwgXFxcXFxcXCLpu5jorqRcXFxcXFxcIikgPT0gaXRlbSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFxcXFxcInNvcnRcXFxcXFxcIiwgaXRlbSArIFxcXFxcXFwi5Y+NXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwic29ydFxcXFxcXFwiLCBpdGVtKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXF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Y29uc3QgdHlwZV9kaWN0ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgMDogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDI6ICQudG9TdHJpbmcoKHVybCwgbGlzdCwgdSwgcGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdWJ0aXRsZXMgPSAkLnJlcXVpcmUoXFxcXFxcXCJhcGlcXFxcXFxcIikuZ2V0U3VidGl0bGVzKGxpc3QsIHUsIHBhdGgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN1YnRpdGxlcy5sZW5ndGggPiAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuYW1lbGlzdCA9IHN1YnRpdGxlcy5tYXAoZnVuY3Rpb24oaXRlbSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChuYW1lbGlzdCwgMSwgXFxcXFxcXCLor7fpgInmi6nlrZfluZVcXFxcXFxcIikuc2VsZWN0KChzdWJ0aXRsZXMsIG5hbWVsaXN0LCB1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybF0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IHN1YnRpdGxlc1tuYW1lbGlzdC5pbmRleE9mKGlucHV0KV0udXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzdWJ0aXRsZXMsIG5hbWVsaXN0LCB1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCwgbGlzdCwgdSwgcGF0aCksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcXFxcXCIjaXNNdXNpYz10cnVlI1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgNDogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFxcXFxcIiMuanBnXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc19kaXIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9ob21lP3BhZ2U9ZnlwYWdlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLnJlcXVpcmUoXFxcXFxcXCJhcGlcXFxcXFxcIikuZ2V0SHptKGl0ZW0ubmFtZSkgPT0gXFxcXFxcXCJwZGZcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly9hbGlzdC1vcmcuZ2l0aHViLmlvL3BkZi5qcy93ZWIvdmlld2VyLmh0bWw/ZmlsZT1cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQub2ZmaWNlLmluY2x1ZGVzKCQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFxcXFxcIuW+rui9r1xcXFxcXFwiLCBcXFxcXFxcIuiwt+atjFxcXFxcXFwiXSkuc2VsZWN0KCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCLlvq7ova9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJodHRwczovL3ZpZXcub2ZmaWNlYXBwcy5saXZlLmNvbS9vcC92aWV3LmFzcHg/c3JjPVxcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZ3ZpZXc/JmVtYmVkZGVkPXRydWUmdXJsPVxcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwodHlwZV9kaWN0W2l0ZW0udHlwZV0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBkb3duX3VybCwgcGF0aCwgbGlzdC5kYXRhLmNvbnRlbnQsIG5vdy51cmwpXFxcXG4gICAgICAgICAgICAgICAgdmFyIGxvbmdDbGljayA9IFtdXFxcXG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmlzX2Rpcikge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLkuIvovb1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIHVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGRvd25fdXJsLCBwYXRoKVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLnlKjlhbbku5bova/ku7bmiZPlvIBcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKHUsIFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFxcXFxcIiArIGl0ZW0ubmFtZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJvcGVuRmlsZTovL1xcXFxcXFwiICsgXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXFxcXFwiICsgaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBkb3duX3VybCwgcGF0aClcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKG5vdy51c2VyICYmIG5vdy5wYXNzd29yZCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruiupOWIoOmZpO+8n1xcXFxcXFwiKS5jb25maXJtKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcXFxcXCJhcGkvZnMvcmVtb3ZlXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyOiBwYXRoLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbaXRlbS5uYW1lXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6YeN5ZG95ZCNXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaXRlbS5uYW1lKS5pbnB1dCgoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXFxcXFwiYXBpL2ZzL3JlbmFtZVxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGggKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6YeN5ZG95ZCN5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6YeN5ZG95ZCN5aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZDIucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBnZXRJdGVtKFxcXFxcXFwic3R5bGVcXFxcXFxcIiwgXFxcXFxcXCJhdmF0YXJcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZ2V0SWNvbihpdGVtKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogKHBhdGggPT0gXFxcXFxcXCIvXFxcXFxcXCIgPyBcXFxcXFxcIi9cXFxcXFxcIiA6IHBhdGggKyBcXFxcXFxcIi9cXFxcXFxcIikgKyBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFxcXFxcInBsYXlsaXN0IG1haW5cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbShcXFxcXFxcInN0eWxlXFxcXFxcXCIsIFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIpID09IFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZDIucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAmOKAmOKAmeKAmTxzbWFsbD48Zm9udCBjb2xvcj0nI2FhYWFhYSc+JHtkZXNjfTwvZm9udD48L3NtYWxsPmAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiAocGF0aCA9PSBcXFxcXFxcIi9cXFxcXFxcIiA/IFxcXFxcXFwiL1xcXFxcXFwiIDogcGF0aCArIFxcXFxcXFwiL1xcXFxcXFwiKSArIGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXFxcXFwicGxheWxpc3QgZGVzY1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfSBlbHNlIGlmIChsaXN0Lm1lc3NhZ2UgPT0gXFxcXFxcXCJwYXNzd29yZCBpcyBpbmNvcnJlY3Qgb3IgeW91IGhhdmUgbm8gcGVybWlzc2lvblxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICBkMi5wdXNo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HJldHVybiBpLm5hbWVcXFxcbiAgICAgICAgICAgIH0pLmluY2x1ZGVzKGlucHV0KSkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lt7Lnu4/mnInnm7jlkIznmoTnvZHnq5nkuoZcXFxcXFxcIlxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLpk77mjqUg56S65L6LOmh0dHA6Ly8xMjcuMC4wLjEvXFxcXFxcXCIpLmlucHV0KChuYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCFpbnB1dC5pbmNsdWRlcyhcXFxcXFxcImh0dHBcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFxcXFxcIi9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgKz0gXFxcXFxcXCIvXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0ICsgXFxcXFxcXCJhcGkvcHVibGljL3NldHRpbmdzXFxcXFxcXCIpKS5kYXRhXFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgW10pXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcXF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FwibGlzdFxcXFxcXFwiLCBsaXN0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJdGVtKFxcXFxcXFwic2VsZWN0ZWRcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcIuS/ruaUueWQjeensFxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLm5hbWUpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5ZCN56ew5LiN6IO95Li656m6XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RvcmFnZTAuZ2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgW10pLm1hcChmdW5jdGlvbihpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5pbmNsdWRlcyhpbnB1dCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3sue7j+acieebuOWQjOeahOe9keermeS6hlxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0ubmFtZSA9IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgbGlzdClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcIuS/ruaUuemTvuaOpVxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLnVybCkuaW5wdXQoKGxpc3QsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcXFxcXCJodHRwXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFxcXFxcIi9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP6ZSZ6K+vXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXS51cmwgPSBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcXFxcXCJsaXN0XFxcXFxcXCIsIGxpc3QpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLkv67mlLnotKbmiLflr4bnoIFcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXVtcXFxcXFxcInVzZXJcXFxcXFxcIl0gPyBsaXN0W2ldW1xcXFxcXFwidXNlclxcXFxcXFwiXSA6IFxcXFxcXFwiXFxcXFxcXCIsIFxcXFxcXFwi6LSm5Y+3XFxcXFxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldW1xcXFxcXFwicGFzc3dvcmRcXFxcXFxcIl0gPyBsaXN0W2ldW1xcXFxcXFwicGFzc3dvcmRcXFxcXFxcIl0gOiBcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIuWvhueggVxcXFxcXFwiKS5pbnB1dCgodXNlciwgbGlzdCwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV1bXFxcXFxcXCJ1c2VyXFxcXFxcXCJdID0gdXNlclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV1bXFxcXFxcXCJwYXNzd29yZFxcXFxcXFwiXSA9IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgbGlzdClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwi5o6S5bqPXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGkgKyAxICsgXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLmi43liLDnrKzlh6DkuKpcXFxcXFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrUmF0ZShpbnB1dCkge+OAgOOAgFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZSA9IC9eWzAtOV0rLj9bMC05XSovOyAvL+WIpOaWreWtl+espuS4suaYr+WQpuS4uuaVsOWtly8v5Yik5pat5q2j5pW05pWwL1sx4oiSOV0rWzDiiJI5XeKIl13iiJcvXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg44CA44CAXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlLnRlc3QoaW5wdXQp44CA44CAXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2tSYXRlKGlucHV0KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhID0gcGFyc2VJbnQoaW5wdXQpIC0gMSAvLyDnm67moIdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+IGxpc3QubGVuZ3RoICYmIGEgPT0gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuS4jeiDveWkp+S6juWIl+ihqOaVsOmHj++8gVxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wID0gbGlzdFthXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2FdID0gbGlzdFtpXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldID0gdGVtcFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXFxcXFwibGlzdFxcXFxcXFwiLCBsaXN0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuivt+i+k+WFpeato+aVtOaVsFxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LCBpdGVtLCBpKSxcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCJcXFxcbiAgICB9KVxcXFxufSlcXFxcbnNldFJlc3VsdChkKTtcXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLku6PnoIFcXFwiLFxcXCJwYXRoXFxcIjpcXFwiYXBpXFxcIixcXFwicnVsZVxcXCI6XFxcIiQuZXhwb3J0cyA9IHtcXFxcbiAgICBjb2xvcjogZnVuY3Rpb24odGV4dCwgY29sb3IpIHtcXFxcbiAgICAgICAgcmV0dXJuIGDigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPVxcXFxcXFwiJHtjb2xvcn1cXFxcXFxcIj4ke3RleHR9PC9mcm9udD48L3N0cm9uZz5gXFxcXG4gICAgfSxcXFxcbiAgICBnZXRJY29uOiBmdW5jdGlvbihjb250ZW50KSB7XFxcXG4gICAgICAgIGlmIChjb250ZW50LmlzX2Rpcikge1xcXFxuICAgICAgICAgICAgaW1nID0gXFxcXFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvMjc0LnBuZ1xcXFxcXFwiXFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBsZXQgZmlsZU5hbWUgPSBjb250ZW50Lm5hbWUudG9Mb3dlckNhc2UoKVxcXFxuICAgICAgICAgICAgbGV0IGh6bSA9ICQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKS5nZXRIem0oZmlsZU5hbWUpXFxcXG4gICAgICAgICAgICBpZiAoY29udGVudC50aHVtYiAmJiBjb250ZW50LnR5cGUgIT0gMCkge1xcXFxuICAgICAgICAgICAgICAgIGltZyA9IGNvbnRlbnQudGh1bWJcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5tb3ZpZS5pbmNsdWRlcyhoem0pKSB7XFxcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcXFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvMzAucG5nXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhoem0pKSB7XFxcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcXFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvNDAucG5nXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC50ZXh0LmluY2x1ZGVzKGh6bSkpIHtcXFxcbiAgICAgICAgICAgICAgICBpbWcgPSBcXFxcXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbW9yZS83OC5wbmdcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmltZy5pbmNsdWRlcyhoem0pKSB7XFxcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcXFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvMzgucG5nXFxcX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FxcXFxcIiArIHNpZ24pXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHR5cGVfZGljdCA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDA6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImRvd25sb2FkOi8vXFxcXFxcXCIgKyB1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAyOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcXFxcXCIjaXNWaWRlbz10cnVlI1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgMzogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXFxcXFwiI2lzTXVzaWM9dHJ1ZSNcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDQ6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImRvd25sb2FkOi8vXFxcXFxcXCIgKyB1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICA1OiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcXFxcXCIjLmpwZ1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0uaXNfZGlyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL3BhZ2UvaG9tZT9wYWdlPWZ5cGFnZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5yZXF1aXJlKFxcXFxcXFwiYXBpXFxcXFxcXCIpLmdldEh6bShpdGVtLm5hbWUpID09IFxcXFxcXFwicGRmXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImh0dHBzOi8vYWxpc3Qtb3JnLmdpdGh1Yi5pby9wZGYuanMvd2ViL3ZpZXdlci5odG1sP2ZpbGU9XFxcXFxcXCIgKyB1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLm9mZmljZS5pbmNsdWRlcygkLnJlcXVpcmUoXFxcXFxcXCJhcGlcXFxcXFxcIikuZ2V0SHptKGl0ZW0ubmFtZSkpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcXFxcXCLlvq7ova9cXFxcXFxcIiwgXFxcXFxcXCLosLfmrYxcXFxcXFxcIl0pLnNlbGVjdCgodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXFxcXFwi5b6u6L2vXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly92aWV3Lm9mZmljZWFwcHMubGl2ZS5jb20vb3Avdmlldy5hc3B4P3NyYz1cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImh0dHBzOi8vZG9jcy5nb29nbGUuY29tL2d2aWV3PyZlbWJlZGRlZD10cnVlJnVybD1cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBldmFsKHR5cGVfZGljdFtpdGVtLnR5cGVdKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgbm93LnVybCwgcGF0aCwgaGVhZGVycylcXFxcbiAgICAgICAgICAgICAgICB2YXIgbG9uZ0NsaWNrID0gW11cXFxcbiAgICAgICAgICAgICAgICBpZiAoIWl0ZW0uaXNfZGlyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuS4i+i9vVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgsIGhlYWRlcnMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJkb3dubG9hZDovL1xcXFxcXFwiICsgZW5jb2RlVVJJKHUgKyBcXFxcXFxcImRcXFxcXFxcIiArIGl0ZW0ucGFyZW50ICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpdGVtLm5hbWUgKyBcXFxcXFxcIj9zaWduPVxcXFxcXFwiICsgSlNPTi5wYXJzZShwb3N0KHUgKyBcXFxcXFxcImFwaS9mcy9nZXRcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhdGhcXFxcXFxcIjogaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLnNpZ24pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBub3cudXJsLCBwYXRoLCBoZWFkZXJzKVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLnlKjlhbbku5bova/ku7bmiZPlvIBcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNpZ24gPSBKU09OLnBhcnNlKHBvc3QodSArIFxcXFxcXFwiYXBpL2ZzL2dldFxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGF0aFxcXFxcXFwiOiBpdGVtLnBhcmVudCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRmlsZShlbmNvZGVVUkkodSArIFxcXFxcXFwiZFxcXFxcXFwiICsgaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZSArIFxcXFxcXFwiP3NpZ249XFxcXFxcXCIgKyBzaWduKSwgXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXFxcXFwiICsgaXRlbS5uYW1lKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcIm9wZW5GaWxlOi8vXFxcXFxcXCIgKyBcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvXFxcXFxcXCIgKyBpdGVtLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmIChub3cudXNlciAmJiBub3cucGFzc3dvcmQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yig6ZmkXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCLnoa7orqTliKDpmaTvvJ9cXFxcXFxcIikuY29uZmlybSgoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXFxcXFwiYXBpL2ZzL3JlbW92ZVxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcjogaXRlbS5wYXJlbnQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtpdGVtLm5hbWVdXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLph43lkb3lkI1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpdGVtLm5hbWUpLmlucHV0KChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcXFxcXCJhcGkvZnMvcmVuYW1lXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5pON5L2c5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5pON5L2c5aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGdldEl0ZW0oXFxcXFxcXCJzdHlsZVxcXFxcXFwiLCBcXFxcXFxcImF2YXRhclxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXFxcXFwic3R5bGVcXFxcXFxcIiwgXFxcXFxcXCJhdmF0YXJcXFxcXFxcIikgPT0gXFxcXFxcXCJhdmF0YXJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGDigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9JyNhYWFhYWEnPiR7ZGVzY308L2ZvbnQ+PC9zbWFsbD5gLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBsb25nQ2xpY2ssXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0gZWxzZSBpZiAobGlzdC5jb2RlICE9IDIwMCkge1xcXFxuICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLlh7rplJnkuoZcXFxcXFxcIilcXFxcbiAgICAgICAgICAgIGxvZyhsaXN0Lm1lc3NhZ2UpXFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG59IGNhdGNoIChlKSB7XFxcXG4gICAgc2V0UmVzdWx0KFt7XFxcXG4gICAgICAgIHRpdGxlOiBcXFxcXFxcIuiuvue9rlxcXFxcXFwiLFxcXFxuICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYW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