Advertisement
xiaomianao666

邀您一起看:番·仓________风吹花海轻舞,醉卧番仓梦乡。

May 17th, 2024
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥番·仓________风吹花海轻舞,醉卧番仓梦乡。@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczpcXG52YXIgY2hwID0gW107XFxudHJ5IHtcXG4gICAgdmFyIGh0bWwgPSBnZXRSZXNDb2RlKCk7XFxuICAgIHZhciBjb250cyA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJ2JvZHkmJi5zb3J0LWl0ZW0nKTtcXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250cy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGNvbnRzW2ldLCAnYm9keSYmYScpO1xcbiAgICAgICAgY2hwLnB1c2gobGlzdC5sZW5ndGgpO1xcbiAgICB9ICAgICBcXG59IGNhdGNoIChlKSB7fVxcbnNldFJlc3VsdCgn5pu05paw6IezOicgKyAoTWF0aC5tYXguYXBwbHkobnVsbCwgY2hwKSkpO1wiLFwibGlzdFRvQ2xlYXJBc3NvY2lhdGVkRktcIjpbXSxcImxpc3RUb0NsZWFyU2VsZkZLXCI6W10sXCJwYWdlTGlzdFwiOlt7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5LiA57qn5YiG57G75YiX6KGoXCIsXCJwYXRoXCI6XCJ5aVwiLFwicnVsZVw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tcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgIH1cXG4gICAgICByZXR1cm4gZmFsc2U7XFxuICAgIH0sXFxuICAgIGlzQm9vbGVhbih2YXJpYWJsZSkge1xcbiAgICAgIGlmICh0eXBlb2YgdmFyaWFibGUgIT09IFxcXCJib29sZWFuXFxcIikge1xcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLlvIDlkK/mipjlj6Dor7fkvKDlhaXluIPlsJTlgLxcXFwiKTtcXG4gICAgICB9XFxuICAgIH0sXFxuICAgIOa4hemZpChsaXN0KSB7XFxuICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICB9XFxuICAgICAgaWYgKGxpc3QuY29uc3RydWN0b3IgPT0gU3RyaW5nKSB7XFxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIua4hemZpOaKpemUmTror7fkvKDliJfooahcXFwiKTtcXG4gICAgICB9XFxuICAgICAgdGhpcy5jbGVhcnMgPSBsaXN0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDlhajmuIUobGlzdCkge1xcbiAgICAgIGlmICh0aGlzLmlzTnVsbChsaXN0KSkge1xcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgfVxcbiAgICAgIHZhciBjID0gdGhpcy5jbGVhcmFsbDtcXG4gICAgICBsaXN0ID0gYy5jb25jYXQobGlzdCk7XFxuICAgICAgdGhpcy5jbGVhcmFsbCA9IGxpc3Q7XFxuICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIOa6kOeggShpbnB1dCkge1xcbiAgICAgIHRoaXMuaHRtbCA9IGlucHV0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDnlYzpnaIoaW5wdXQpIHtcXG4gICAgICB0aGlzLmxheW91dCA9IGlucHV0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDpobXnoIEoaW5wdXQpIHtcXG4gICAgICB0aGlzLnBhZ2UgPSBpbnB1dDtcXG4gICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAg54q25oCBKGlucHV0KSB7XFxuICAgICAgdGhpcy5zdGF0ZSA9IGlucHV0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDlvIDlkK/mkJzntKIoKSB7XFxuICAgICAgdGhpcy5zZWFyY2ggPSB0cnVlO1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDlvIDlkK/mipjlj6AoaW5wdXQpIHtcXG4gICAgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICBpbnB1dCA9IHRydWU7XFxuICAgICAgfVxcbiAgICAgIHRoaXMuaXNCb29sZWFuKGlucHV0KTtcXG4gICAgICB0aGlzLm9wZW4gPSBpbnB1dDtcXG4gICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAgc2V0VGl0bGUoaywgaSwgdCkge1xcbiAgICAgIHJldHVybiBrID09IGkgPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHQuZm9udGNvbG9yKHRoaXMu5YiG57G76aKc6ImyKSA6IHQ7XFxuICAgIH0sXFxuICAgIGFjdGlvbihvYmopIHtcXG4gICAgICByZXR1cm4gW1xcbiAgICAgICAge1xcbiAgICAgICAgICB0aXRsZTogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICBsb2cob2JqKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKG9iai5zdGF0ZSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICBjbG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4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgfSxcXG4gICAgICAgIH0pO1xcbiAgICAgIH1cXG4gICAgICBjb25zdCBjYXRlZ29yaWVzID0gW107XFxuICAgICAgcnVsZU9iai5mb3JFYWNoKCh4KSA9PiB7XFxuICAgICAgICB2YXIgbGlzdCA9IFtdO1xcbiAgICAgICAgaWYoeC7kuIDnuqflrprkvY0pe1xcbiAgICAgICAgICBpZiAoeC7kuIDnuqflrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7kuIDnuqflrprkvY0pO1xcbiAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYoeC7lpKfnsbvlrprkvY0pe1xcbiAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7lpKfnsbvlrprkvY0pO1xcbiAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIGxpc3QgPSBbcGRmYShodG1sLCB4LuWkp+exu+WumuS9jSkuam9pbignXFxcXG4nKV07XFxuICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIOS4gOe6pyA9IGxpc3QubWFwKChzKSA9PiB7XFxuICAgICAgICAgIHZhciBzbGlzdCA9IFtdO1xcbiAgICAgICAgICBpZiAoIShcXFwi5bCP57G7XFxcIiBpbiB4KSkge1xcbiAgICAgICAgICAgIHgu5bCP57G7ID0gXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXCI7XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgaWYgKHgu5bCP57G7LnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgIHNsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIHZhciDlrprkvY0gPSBzbGlzdC5tYXAoKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIHgu5qCH6aKYKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgeCk7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IHsgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCB9O1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmopO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgcmV0dXJuIOWumuS9jTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgLy9sb2co5LiA57qnKVxcbiAgICAgICAgLy9sb2co5LiA57qnLmxlbmd0aClcXG4gICAgICAgIGlmICjkuIDnuqcubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXCJcXFxcblxcXCIpKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIOS4gOe6py5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFwiLFxcXCIpKTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhjYXRlZ29yaWVzKVxcbiAgICAgIH0pO1xcbiAgICAgIGlmICjmipjlj6DnirbmgIEpIHtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcIjFcXFwiID8g5oqY5Y+gIDog5bGV5byALFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShcXG4gICAgICAgICAgICAgIChmb2xkLCB1LCBhbGwpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCA9PT0gXFxcIjFcXFwiID8gXFxcIjBcXFwiIDogXFxcIjFcXFwiKTtcXG4gICAgICAgICAgICAgICAgLyphbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pOyovXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICBmb2xkLFxcbiAgICAgICAgICAgICAg54q25oCBLFxcbiAgICAgICAgICAgICAg5YWo5riFXFxuICAgICAgICAgICAgKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICBsb25nQ2xpY2s6IHRoaXMuYWN0aW9uKHtcXG4gICAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgICAgYWxsOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgIGNsOiDmuIXpmaQsXFxuICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICB9XFxuICAgICAgaWYgKHBhZ2UgPT0gMSk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ICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXdSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBqc29uPScnXFxuICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcbiAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIC8vbGV0IHVybCA9IHBkKGl0ZW0sIF/lpKfnsbvpk77mjqUpO1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAvKmlmICjlpKfnsbvlpITnkIYpIHtcXG4gICAgICAgICAgICAgIHVybCA9IOS4gOe6p+WIhuexu+WkhOeQhih1cmwpO1xcbiAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgIC8vbG9nKHVybClcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxuICAgICAgICAgICAgICAgIHBhcmFtcy5jbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LCBwYXJhbXMpLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09IFxcXCIxXFxcIiB8fCDmipjlj6DnirbmgIEgPT0gZmFsc2UpIHtcXG4gICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgdmFyIGV4dHJhcG9zID0gZmFsc2U7XFxuICAgICAgICAgICAgLyppZiAoaXRlbS5pbmNsdWRlcygndHlwZT1cXFwiQGV4dHJhXFxcIicpKSB7XFxuICAgICAgICAgICAgICBleHRyYXBvcyA9IHRydWU7XFxuICAgICAgICAgICAgICAvL2xvZygn6ZmE5Yqg5a6a5L2NJylcXG4gICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICBpZiAoZXh0cmFwb3MpIHtcXG4gICAgICAgICAgICAgIHZhciB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcImEmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIHZhciBqc29uID0ge1xcbiAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIFxcXCJhJiZzdGF0ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCBcXFwiYSYmdmFsdWVcXFwiKSxcXG4gICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgIC8vdmFyIHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgIHZhciBqc29uID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAvKnN3aXRjaCAodHJ1ZSkge1xcbiAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFwiQEBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVswXSksXFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAQFxcXCIpWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFwiQEBcXFwiKTpcXG4gICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZTog5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQFxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQFxcXCIpWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAvLyBqc29uID0gcGQoaXRlbSwg5YiG57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgLyp2YXIganNvbj3liIbnsbvpk77mjqUuaW5jbHVkZXMoJ0BAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMV0pLFxcbiAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU65YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpOyovXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKCk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSk7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhb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InBhZ2VudW1cXFwiKTtcXG4gICAgICAgIGRlbGV0ZUl0ZW0oXFxcInBhZ2VsaW5lXFxcIik7XFxuICAgICAgICB2YXIgaWQgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciBjbHMgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciB0aXRsZSA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLnRpdGxlKTtcXG4gICAgICAgIHZhciBkZXNjID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuZGVzYyk7XFxuICAgICAgICB2YXIgaW1nID0gdGhpcy5pbWdIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgIGlkID0gXFxcImxhc3RpZF9cXFwiICsgcGFnZTtcXG4gICAgICAgICAgY2xzID0gXFxcImxhc3RtYXJrXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZXI/dXJsPVxcXCIgKyB1cmwsXFxuICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgIH0sXFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSAmJiBzaG93KSB7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgaWQ6IFxcXCJwYWdlbGluZVxcXCIsXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c21hbGw+5Yqg6L295LitLi4uPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgIGlkOiBcXFwicGFnZW51bVxcXCIsXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgdXBkYXRlSXRlbShcXFwicGFnZW51bVxcXCIsIHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7liLDlupXkuoY8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgaWQ6IFxcXCJsYXN0XFxcIixcXG4gICAgICAgIH0sXFxuICAgICAgfSk7XFxuICAgIH1cXG4gICAgaWYgKGxpc3QubGVuZ3RoID09IDAgJ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bnQnOiAnTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMCknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgfSx0aW1lb3V0OjUwMDBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgIGV2YWwoaHRtbC5tYXRjaCgvZXZhbC4qP1xcXFxuLylbMF0pXFxuICAgICAgICAgICAgICAgICAgICAvLyDojrflj5bnlLvotKjliJfooajvvIzlubbljrvmnIDpq5jnlLvotKhcXG4gICAgICAgICAgICAgICAgICAgIGxldCBncm91cF9xdWFsaXR5ID0gZmV0Y2goc291cmNlLHtoZWFkZXJzOntcXFwib3JpZ2luXFxcIjpcXFwiaHR0cHM6Ly90aGlzYXYuY29tXFxcIn19KVxcbiAgICAgICAgICAgICAgICAgICAgaGdoZXN0X3F1YWxpdHkgPSBncm91cF9xdWFsaXR5Lm1hdGNoKC9eKC4qKVxcXFwubTN1OCQvZ20pXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlLnJlcGxhY2UoXFxcInBsYXlsaXN0Lm0zdThcXFwiLCBoZ2hlc3RfcXVhbGl0eVtoZ2hlc3RfcXVhbGl0eS5sZW5ndGgtMV0pICsgJzt7T3JpZ2luQGh0dHBzOi8vdGhpc2F2LmNvbX0nICAgICAgICAgXFxuICAgICAgICAgICAgICAgICB9Y2F0Y2h7cmV0dXJuIFxcXCJ0b2FzdDovL+aMguair+aIluayoeacieatpOW9seeJh1xcXCJ9XFxuICAgICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxuICAgIGV4dHJhOiB7IGxvbmdDbGljazogW3t0aXRsZTogJ+afpeeci+e9keWdgCcsIGpzOiAkLnRvU3RyaW5nKCjor4bliKvnoIEpPT57IHJldHVybiBcXFwiaHR0cHM6Ly90aGlzYXYuY29tL2NuL1xcXCIgKyDor4bliKvnoIE7fSzor4bliKvnoIEpfV0gfVxcbn0pO1xcblxcbi8vTUlTU0FWXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjMDBGRjAwXFxcIj4gTUlTU0FWPC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjEuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9mcnVpdHMtbi12ZWdldGFibGVzLWNvbG9yZWQtZ3JhZGllbnQvMTI4L2NhdWxpZmxvd2VyLTEyOC5wbmcnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgdHJ5e1xcbiAgICAgICAgICAgICB2YXIgYXYgPSBcXFwiaHR0cHM6Ly9taXNzYXYudG8vc2VhcmNoL21vdmllL1xcXCIgKyDor4bliKvnoIE7ICBcXG4gICAgICAgICAgICAgdmFyIHVybHMgPSBbXTsgICAgXFxuICAgICAgICAgICAgIHZhciBsaXN0ID0gcGRmYShmZXRjaChhdix7dGltZW91dDo1MDAwfSksXFxcIi52aWRlb3MtbGlzdCYmYXJ0aWNsZVxcXCIpO1xcbiAgICAgICAgICAgIGZvcih2YXIgaiBpbiBsaXN0KXtcXG4gICAgICAgICAgICAgIHVybHMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBkZmgobGlzdFtqXSxcXFwiYSYmaHJlZlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIHBsYXlzID0gYmYodXJscykubWFwKGg9PmgubWF0Y2goL3NyYz1cXFwiKC4qPylcXFwiLylbMV0uc3BsaXQoXFxcIiZcXFwiKVswXS5yZXBsYWNlKFxcXCI/aWQ9XFxcIixcXFwiaGxzL1xcXCIpICsgXFxcIi5tM3U4XFxcIikgICBcXG4gICAgICAgICAgICAgcmV0dXJuIHt1cmxzOnBsYXlzf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1bGVzOiBbJzI0MCddLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJyouZG9wcGlvY2RuLionXSxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWydkbW0uY28uanAnXSxcXG4gICAgICAgICAgICAgICAgLy92aWRlb1J1bGVzOiBbJyptM3U4KiddLFxcbiAgICAgICAgICAgICAgICBjYWNoZU0zdTg6IHRydWUsXFxuICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PnsgcmV0dXJuIFxcXCJodHRwczovL25qYXYudHYvemgvdi9cXFwiICsg6K+G5Yir56CBO30s6K+G5Yir56CBKX1dXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbn0pO1xcblxcbi8vYXYwMVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+PG1pZGRsZT48Zm9udCBjb2xvcj1cXFwiIzc1MTI3QVxcXCI+IEFWMDE8L2ZvbnQ+PC9taWRkbGU+JyxcXG4gICAgcGljX3VybDogJ2h0dHBzOi8vY2RuMi5pY29uZmluZGVyLmNvbS9kYXRhL2ljb25zL293bC0xMC81MDAvbmltNTMyXzExX3B1cnBsZV9vd2xfa2lkX2JpcnRoZGF5X2ZhY2VfZXllLTEyOC5wbmcnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL3d3dy5hdjAxLnR2L1xcXCIgKyDor4bliKvnoIE7IFxcbi8vbG9nKGF2KVxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXG4gICAgICAgICAgICAgICAgIHZhciBjb2RlID0gcGRmaChodG1sLCcjcGx5cl92aWRlbyYmcG9zdGVyJylcXG5sb2coY29kZSlcXG4gICAgICAgICAgICAgICAgIGlmKCFjb2RlKXsgICAgICAgICBcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFwiXFxuICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ2aWRlbzovL1xcXCIgKyBhdjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICB9LOivhuWIq+eggSksXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnZG9wcGlvY2RuJ10sXFxuICAgICAgICAgICAgICAgIHZpZGVvRXhjbHVkZVJ1bGVzOiBbJzI0MCddLFxcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWyc0ODAnXSxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuZG9wcGlvY2RuLiddLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJ2RtbS5jby5qcCddLFxcbiAgICAgICAgICAgICAgICAvL3ZpZGVvUnVsZXM6IFsnKm0zdTgqJ10sXFxuICAgICAgICAgICAgICAgIGNhY2hlTTN1ODogdHJ1ZSxcXG4gICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7dGl0bGU6ICfmn6XnnIvnvZHlnYAnLCBqczogJC50b1N0cmluZygo6K+G5Yir56CBKT0+eyByZXR1cm4gXFxcImh0dHBzOi8vd3d3LmF2MDEudHYvXFxcIiArIOivhuWIq+eggTt9LOivhuWIq+eggSl9XVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG59KTtcXG5cXG4vL0phYmxlXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjRkY4QzAwXFxcIj4gSmFibGU8L2ZvbnQ+PC9taWRkbGU+JyxcXG4gICAgcGljX3VybDogJ2h0dHBzOi8vY2RuMy5pY29uZmluZGVyLmNvbS9kYXRhL2ljb25zL2NhdC1wb3dlci1wcmVtaXVtLzEyMC9jYXRfZm9vZGxvdmUtMTI4LnBuZycsXFxuICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOivhuWIq+eggSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgdmFyIGF2ID0gXFxcImh0dHBzOi8vamFibGUudHYvdmlkZW9zL1xcXCIgKyDor4bliKvnoIEgKyBcXFwiL1xcXCI7IFxcbi8vbG9nKGF2KVxcbiAgICAgICAgICAgICAgICAvLyByZXF1ZXN0KFxcXCJodHRwczovL2phYmxlLnR2L1xcXCIpXFxuICAgICAgICAgICAgICB0cnl7XFxuICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IGZldGNoKGF2LHt0aW1lb3V0OjUwMDB9KVxcbiAgICAgICAgICAgICAgICAgdmFyIHVybCA9IGh0bWwubWF0Y2goL2h0dHBzPzpcXFxcL1xcXFwvXFxcXFMrP1xcXFwubTN1OC8pWzBdXFxuICAgICAgICAgICAgICAgICByZXR1cm4gdXJsXFxuICAgICAgICAgICAgICAgICB9Y2F0Y2h7cmV0dXJuIFxcXCJ0b2FzdDovL+ayoeacieaMguair+WtkOaIluayoeacieatpOW9seeJh1xcXCJ9XFxuICAgICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxuICAgIGV4dHJhOiB7IGxvbmdDbGljazogW3t0aXRsZTogJ+afpeeci+e9keWdgCcsIGpzOiAkLnRvU3RyaW5nKCjor4bliKvnoIEpPT57IHJldHVybiBcXFwiaHR0cHM6Ly9qYWJsZS50di92aWRlb3MvXFxcIiArIOivhuWIq+eggSArIFxcXCIvXFxcIjt9LOivhuWIq+eggSl9XSB9XFxufSk7XFxuXFxuLy9UaGlzc0FW56C06KejXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjRkVGRTAwXFxcIj7nhKHnorznoLTop6M8L2ZvbnQ+PC9taWRkbGU+JyxcXG4gICAgcGljX3VybDogJ2h0dHBzOi8vY2RuNC5pY29uZmluZGVyLmNvbS9kYXRhL2ljb25zL3NvY2lhbC1tZWRpYS1mbGF0LTcvNjQvU29jaWFsLW1lZGlhX1NuYXBjaGF0LTEyOC5wbmcnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL3RoaXNhdi5jb20vY24vXFxcIiArIOivhuWIq+eggSArIFxcXCItdW5jZW5zb3JlZC1sZWFrXFxcIjsgXFxuLy9sb2coYXYpXFxuICAgICAgICAgICAgICB0cnl7XFxuICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IGZldGNoKGF2LCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiAnTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMCknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgfSx0aW1lb3V0OjUwMDBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgIGV2YWwoaHRtbC5tYXRjaCgvZXZhbC4qP1xcXFxuLylbMF0pXFxuICAgICAgICAgICAgICAgICAgICAvLyDojrflj5bnlLvotKjliJfooajvvIzlubbljrvmnIDpq5jnlLvotKhcXG4gICAgICAgICAgICAgICAgICAgIGxldCBncm91cF9xdWFsaXR5ID0gZmV0Y2goc291cmNlLHtoZWFkZXJzOntcXFwib3JpZ2luXFxcIjpcXFwiaHR0cHM6Ly90aGlzYXYuY29tXFxcIn19KVxcbiAgICAgICAgICAgICAgICAgICAgaG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L1xcXCIgKyDor4bliKvnoIEgKyBcXFwiLXVuY2Vuc29yZWQtbGVha2VkXFxcIjsgXFxuLy9sb2coYXYpXFxuICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IGZldGNoKGF2LHt0aW1lb3V0OjUwMDB9KVxcbiAgICAgICAgICAgICAgICAgaWYoIWh0bWwgfHwgaHRtbC5pbmNsdWRlcyhcXFwi6K+35qOA5p+l5Zyw5Z2A5qCP5Lit55qE572R5Z2AXFxcIikpeyAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aMguair+aIluayoeacieatpOW9seeJh1xcXCJcXG4gICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInZpZGVvOi8vXFxcIiArIGF2O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKSxcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWycyNDAnXSxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycqLmRvcHBpb2Nkbi4qJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnZG1tLmNvLmpwJ10sXFxuICAgICAgICAgICAgICAgIC8vdmlkZW9SdWxlczogWycqbTN1OConXSxcXG4gICAgICAgICAgICAgICAgY2FjaGVNM3U4OiB0cnVlLFxcbiAgICAgICAgICAgICAgIGxvbmdDbGljazogW3t0aXRsZTogJ+afpeeci+e9keWdgCcsIGpzOiAkLnRvU3RyaW5nKCjor4bliKvnoIEpPT57IHJldHVybiBcXFwiaHR0cHM6Ly9uamF2LnR2L3poL3YvXFxcIiArIOivhuWIq+eggSArIFxcXCItdW5jZW5zb3JlZC1sZWFrZWRcXFwiO30s6K+G5Yir56CBKX1dXFxuICAgICAgICAgICAgICAg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xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKDIzLCAn6K+36L6T5YWl6KaB6Lez6L2s5Yiw55qE6aG15pWwJykuaW5wdXQoKHRydWVfdXJsLGssbmFtZXMsaikgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4ocGFyc2VJbnQoaW5wdXQpKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i+k+WFpeacieivryzor7fovpPlhaXkuIDkuKoxficgKyBrICsgJ+eahOaVsOWtlydcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBsZXQgdG9QYWdlID0gcGFyc2VJbnQoaW5wdXQpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodG9QYWdlIDwgMSB8fCB0b1BhZ2UgPiBrKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6L6T5YWl5pyJ6K+vLOivt+i+k+WFpeS4gOS4qjF+JyArIGsgKyAn55qE5pWw5a2XJ1xcclxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgIGlmKC9mb3J1bVxcXFwtXFxcXGQrXFxcXC1cXFxcZCsvLnRlc3QodHJ1ZV91cmwpKXtcXG52YXIgdXJsID0gdHJ1ZV91cmwucmVwbGFjZSgvXFxcXGQrXFxcXC5odG0vLCB0b1BhZ2UgKyAnLmh0bScpO1xcbiAgICAgICAgICAgICAgfWVsc2V7XFxudmFyIHVybCA9IHRydWVfdXJsLnJlcGxhY2UoL1xcXFwuaHRtLywgJy0nICsgdG9QYWdlICsgJy5odG0nKTtcXG4gICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcXFwibm93XFxcIiwgbmFtZXNbal0pO1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIHVybCk7XFxuICAgICAgICAgICAgICAgIC8vcHV0TXlWYXIoJ3lpX2ZpcnN0cGFnZScsIHVybCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6Lez6LaK5Yiw5LqG56ysJyArIHRvUGFnZSArICfpobUnXFxyXFxuICAgICAgICAgICAgfSx0cnVlX3VybCwgayxuYW1lcyxqKSxcXHJcXG4gICAgICAgIH0pO1xcblxcbn1lbHNle1xcblxcbmlmKGFycltqXT09J+maj+acuicpe1xcbiAgICAgICAgICAgICAgYXJyW2pdID0gTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogaykgKzEgICBcXG59ZWxzZSBpZihhcnJbal09PSflsL7pobUnK2spe1xcbiAgICAgICAgICAgICAgYXJyW2pdID0ga1xcbn1lbHNlIGlmKGFycltqXT09MSl7XFxuICAgICAgICAgICAgICBuYW1lc1tqXSA9IFxcXCLpppbpobVcXFwiXFxufWVsc2UgaWYoYXJyW2pdPT0n6Lez6aG1Jyl7XFxuICAgICAgICAgICAgIGFycltqXSA9IDIyM1xcbn1cXG5cXG4gICAgICAgICAgaWYoL2ZvcnVtXFxcXC1cXFxcZCtcXFxcLVxcXFxkKy8udGVzdCh0cnVlX3VybCkpe1xcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9cXFxcZCtcXFxcLmh0bS8sIGFycltqXSArICcuaHRtJyk7XFxuICAgICAgICAgICAgICB9ZWxzZXtcXG52YXIgdXJsID0gdHJ1ZV91cmwucmVwbGFjZSgvXFxcXC5odG0vLCAnLScgKyBhcnJbal0gKyAnLmh0bScpO1xcbiAgICAgICAgICAgICAgfVxcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6bm93ID09bmFtZXNbal0/ICfigJzigJzigJ3igJ0nICsgbmFtZXNbal0uZm9udGNvbG9yKCdyZWQnKSA6IG5hbWVzW2pdLFxcbi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gZXh0cmE6e1xcbiAgICAgICAgICBwYWdlVGl0bGU6cGRmaCh4LCAnYSYmVGV4dCcpLFxcbiAgICAgICAgICAgICAgICAgIH1cXG4gIH0pO1xcbn0pXFxuXFxuc2V0UmVzdWx0KGQpXCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLnjq/looNcIixcInBhdGhcIjpcInJlcGFpclwiLFwicnVsZVwiOlwianM6XFxudmFyIGRvY3VtZW50ID0ge307XFxudmFyIHdpbmRvdyA9IHtcXG4gICAgbG9jYXRpb246IHtcXG4gICAgICAgIHJlbG9hZDogZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgfVxcbiAgICB9XFxufTtcXG5cXG4vLyDlrprkuYnkuIDkuKrlr7nosaHnlKjkuo7lrZjlgqggY29va2llIOWQjeensOWSjOWAvOeahOmUruWAvOWvuVxcbnZhciBjb29raWVzID0ge307XFxuT2JqZWN0LmRlZmluZVByb3BlcnR5KGRvY3VtZW50LCAnY29va2llJywge1xcbiAgICBlbnVtZXJhYmxlOiB0cnVlLFxcbiAgICBjb25maWd1cmFibGU6IHRydWUsXFxuICAgIGdldDogZnVuY3Rpb24oKSB7XFxuICAgICAgICByZXR1cm4gT2JqZWN0LmVudHJpZXMoY29va2llcykubWFwKChba2V5LCB2YWx1ZV0pID0+IGAke2tleX09JHt2YWx1ZX1gKS5qb2luKCc7ICcpO1xcbiAgICB9LFxcbiAgICBzZXQ6IGZ1bmN0aW9uKHZhbHVlKSB7XFxuICAgICAgICB2YXIgbGlzdCA9IFtdO1xcbiAgICAgICAgaWYgKHZhbHVlLmluY2x1ZGVzKCc7JykpIHtcXG4gICAgICAgICAgICBsaXN0ID0gdmFsdWUuc3BsaXQoJzsnKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbGlzdCA9IFt2YWx1ZV07XFxuICAgICAgICB9XFxuICAgICAgICBsaXN0LmZvckVhY2goeCA9PiB7XFxuICAgICAgICAgICAgdmFyIGluZGV4ID0geC5pbmRleE9mKFxcXCI9XFxcIik7XFxuICAgICAgICAgICAgdmFyIGtleSA9IHguc3Vic3RyaW5nKDAsIGluZGV4KS50cmltKCk7XFxuICAgICAgICAgICAgdmFyIHZhbHVlID0geC5zdWJzdHJpbmcoaW5kZXggKyAxKTtcXG4gICAgICAgICAgICBjb29raWVzW2tleV0gPSB2YWx1ZTtcXG4gICAgICAgIH0pXFxuICAgIH1cXG59KTtcXG5cXG5mdW5jdGlvbiBndWFyZCh1cmwsIGhlYWRvYmopIHtcXG4gICAgdmFyIGhlYWQgPSBoZWFkb2JqID8gaGVhZG9iajp7XFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgQ29va2llOiBnZXRDb29raWUodXJsKSxcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICB2YXIgaHRtbCA9IGZldGNoKHVybCwgaGVhZCk7XFxuICAgIGlmIChodG1sLmluY2x1ZGVzKCdfZ3VhcmQvYXV0by5qcycpKSB7XFxuICAgICAgICBkb2N1bWVudFtcXFwiY29va2llXFxcIl0gPSBnZXRDb29raWUodXJsKTtcXG4gICAgICAgIGV2YWwoZmV0Y2goZ2V0SG9tZSh1cmwpICsgJy9fZ3VhcmQvYXV0by5qcycpKVxcbiAgICAgICAgaHRtbCA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgQ29va2llOiBkb2N1bWVudFtcXFwiY29va2llXFxcIl0sXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgLy9sb2coZG9jdW1lbnRbXFxcImNvb2tpZVxcXCJdKVxcbiAgICByZXR1cm4gaHRtbFxcbn1cXG5cXG5mdW5jdGlvbiBjc3BsaXQoYSwgYiwgYykge1xcbiAgICBiID0gcGFyc2VJbnQoYiwgMTApIHx8IDc2O1xcbiAgICBjID0gYyB8fCAnXFx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pID0+IHtcXFxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLmdyb3VwLCBmb2xkID09PSBcXFxcXFxcIjFcXFxcXFxcIiA/IFxcXFxcXFwiMFxcXFxcXFwiIDogXFxcXFxcXCIxXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIC8qYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgfSk7Ki9cXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICBmb2xkLFxcXFxuICAgICAgICAgICAgICDnirbmgIEsXFxcXG4gICAgICAgICAgICAgIOWFqOa4hVxcXFxuICAgICAgICAgICAgKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgIGxvbmdDbGljazogdGhpcy5hY3Rpb24oe1xcXFxuICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxcXG4gICAgICAgICAgICAgICAgYWxsOiDlhajmuIUsXFxcXG4gICAgICAgICAgICAgICAgY2w6IOa4hemZpCxcXFxcbiAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICB9XFxcXG4gICAgICBpZiAocGFnZSA9PSAxKSB7XFxcXG4gICAgICBjYXRlZ29yaWVzLmZvckVhY2goKGNhdGVnb3J5LCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAvL2xvZyhjYXRlZ29yaWVz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ICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3UmVnRXhwKOaOkumZpCwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBqc29uPScnXFxcXG4gICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxcXG4gICAgICAgICAgICBcXFxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxcXG4gICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXFxcbiAgICAgICAgICAgICAgY2xlYXJzOiDmuIXpmaQsXFxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxcXG4gICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxcXG4gICAgICAgICAgICAgIGFsbGNsZWFyczog5YWo5riFLFxcXFxuICAgICAgICAgICAgfTtcXFxcblxcXFxuICAgICAgICAgICAgLy9sZXQgdXJsID0gcGQoaXRlbSwgX+Wkp+exu+mTvuaOpSk7XFxcXG4gICAgICAgICAgICBsZXQgdXJsID0gaXRlbS51cmw7XFxcXG4gICAgICAgICAgICAvKmlmICjlpKfnsbvlpITnkIYpIHtcXFxcbiAgICAgICAgICAgICAgdXJsID0g5LiA57qn5YiG57G75aSE55CGKHVybCk7XFxcXG4gICAgICAgICAgICB9Ki9cXFxcbiAgICAgICAgICAgIC8vbG9nKHVybClcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxcXG4gICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmFsbGNsZWFycy5mb3JFYWNoKChpdGVtKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgbmV3X2NhdGUucHVzaChpbmRleCA9PT0gMCA/IHBhcmFtcy5rZXkudG9TdHJpbmcoKSA6IFxcXFxcXFwiMFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImhlYWQuY2F0ZVxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImR0X1xcXFxcXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3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ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFxcXFxcIkBAQFxcXFxcXFwiKVswXSksXFxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFxcXFxcIkBAQFxcXFxcXFwiKVsxXSksXFxcXG4gICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcXFxcXCJAQFxcXFxcXFwiKTpcXFxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IOWIhuexu+mTvuaOpS5zcGxpdChcXFxcXFxcIkBAXFxcXFxcXCIpWzBdLFxcXFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcXFxcXCJAQFxcXFxcXFwiKVsxXSksXFxcXG4gICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcXFxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXFxcbiAgICAgICAgICAgICAgICAgIC8vIGpzb24gPSBwZChpdGVtLCDliIbnsbvpk77mjqUpO1xcXFxuICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgIH0qL1xcXFxuICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxcXG4gICAgICAgICAgICAgIC8qdmFyIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQEAnKT97XFxcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMF0pLFxcXFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVsxXSksXFxcXG4gICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7XFxcXG4gICAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAganNvbj3liIbnsbvpk77mjqUuaW5jbHVkZXMoJ0BAJyk/e1xcXFxuICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVsxXSksXFxcXG4gICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7Ki9cXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgbGV0IHBhcmFtcyA9IHtcXFxcbiAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXFxcbiAgICAgICAgICAgICAga2V5OiBrZXksXFxcXG4gICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxcXG4gICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxcXG4gICAgICAgICAgICAgIGFsbGNsZWFyczog5YWo5riFLFxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxcXG4gICAgICAgICAgICAgIHVybDogJChcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIiArIFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcXFxuICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKCk7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJoZWFkLmNhdGVcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImR0X1xcXFxcXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3RhdGUsIHBhcmFtcy5qc29uKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgIH0sIHBhcmFtcyksXFxcXG4gICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgIC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TlQgMTAuMCknXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9LHRpbWVvdXQ6NTAwMFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgIGV2YWwoaHRtbC5tYXRjaCgvZXZhbC4qP1xcXFxcXFxcbi8pWzBdKVxcXFxuICAgICAgICAgICAgICAgICAgICAvLyDojrflj5bnlLvotKjliJfooajvvIzlubbljrvmnIDpq5jnlLvotKhcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGdyb3VwX3F1YWxpdHkgPSBmZXRjaChzb3VyY2Use2hlYWRlcnM6e1xcXFxcXFwib3JpZ2luXFxcXFxcXCI6XFxcXFxcXCJodHRwczovL3RoaXNhdi5jb21cXFxcXFxcIn19KVxcXFxuICAgICAgICAgICAgICAgICAgICBoZ2hlc3RfcXVhbGl0eSA9IGdyb3VwX3F1YWxpdHkubWF0Y2goL14oLiopXFxcXFxcXFwubTN1OCQvZ20pXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzb3VyY2UucmVwbGFjZShcXFxcXFxcInBsYXlsaXN0Lm0zdThcXFxcXFxcIiwgaGdoZXN0X3F1YWxpdHlbaGdoZXN0X3F1YWxpdHkubGVuZ3RoLTFdKSArICc7e09yaWdpbkBodHRwczovL3RoaXNhdi5jb219JyAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgICB9Y2F0Y2h7cmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFxcXFxcIn1cXFxcbiAgICAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKSxcXFxcbiAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxcXG4gICAgZXh0cmE6IHsgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PnsgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly90a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cXFwiLm0zdThcXFxcXFxcIikgICBcXFxcbiAgICAgICAgICAgICByZXR1cm4ge3VybHM6cGxheXN9XFxcXG4gICAgICAgICAgfWNhdGNoe3JldHVybiBcXFxcXFxcInRvYXN0Oi8v5rKh5pyJ5q2k5b2x54mHXFxcXFxcXCJ9XFxcXG4gICAgICAgfSAgIFxcXFxuICAgICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXFxcbiAgICBleHRyYTogeyBsb25nQ2xpY2s6IFt7dGl0bGU6ICfmn6XnnIvnvZHlnYAnLCBqczogJC50b1N0cmluZygo6K+G5Yir56CBKT0+eyByZXR1cm4gXFxcXFxcXCJodHRwczovL21pc3Nhdi50by9zZWFyY2gvbW92aWUvXFxcXFxcXCIgKyDor4bliKvnoIF9LOivhuWIq+eggSl9XSB9XFxcXG59KTtcXFxcblxcXFxuLy9uamF2XFxcXG5kLnB1c2goe1xcXFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+PG1pZGRsZT48Zm9udCBjb2xvcj1cXFxcXFxcIiMxRTkwRkZcXFxcXFxcIj4gbkphdi50djwvZm9udD48L21pZGRsZT4nLFxcXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjIuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9zb2NpYWwtaWNvbnMtMzMvMTI4L0ZhY2Vib29rX01lc3Nlbmdlci0xMjgucG5nJyxcXFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgdmFyIGF2ID0gXFxcXFxcXCJodHRwczovL25qYXYudHYvemgvdi9cXFxcXFxcIiArIOivhuWIq+eggTsgXFxcXG4vL2xvZyhhdilcXFxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXFxcbiAgICAgICAgICAgICAgICAgaWYoIWh0bWwgfHwgaHRtbC5pbmNsdWRlcyhcXFxcXFxcIuivt+ajgOafpeWcsOWdgOagj+S4reeahOe9keWdgFxcXFxcXFwiKSl7ICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5oyC5qKv5oiW5rKh5pyJ5q2k5b2x54mHXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidmlkZW86Ly9cXFxcXFxcIiArIGF2O1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICB9LOivhuWIq+eggSksXFxcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcXFxuICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycqLmRvcHBpb2Nkbi4qJ10sXFxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWydkbW0uY28uanAnXSxcXFxcbiAgICAgICAgICAgICAgICAvL3ZpZGVvUnVsZXM6IFsnKm0zdTgqJ10sXFxcXG4gICAgICAgICAgICAgICAgY2FjaGVNM3U4OiB0cnVlLFxcXFxuICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PnsgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly9uamF2LnR2L3poL3YvXFxcXFxcXCIgKyDor4bliKvnoIE7fSzor4bliKvnoIEpfV1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbn0pO1xcXFxuXFxcXG4vL2F2MDFcXFxcbmQucHVzaCh7XFxcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXFxcXFwiIzc1MTI3QVxcXFxcXFwiPiBBVjAxPC9mb250PjwvbWlkZGxlPicsXFxcXG4gICAgcGljX3VybDogJ2h0dHBzOi8vY2RuMi5pY29uZmluZGVyLmNvbS9kYXRhL2ljb25zL293bC0xMC81MDAvbmltNTMyXzExX3B1cnBsZV9vd2xfa2lkX2JpcnRoZGF5X2ZhY2VfZXllLTEyOC5wbmcnLFxcXFxuICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOivhuWIq+eggSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICB2YXIgYXYgPSBcXFxcXFxcImh0dHBzOi8vd3d3LmF2MDEudHYvXFxcXFxcXCIgKyDor4bliKvnoIE7IFxcXFxuLy9sb2coYXYpXFxcXG4gICAgICAgICAgICAgICAgIHZhciBodG1sID0gZmV0Y2goYXYse3RpbWVvdXQ6NTAwMH0pXFxcXG4gICAgICAgICAgICAgICAgIHZhciBjb2RlID0gcGRmaChodG1sLCcjcGx5cl92aWRlbyYmcG9zdGVyJylcXFxcbmxvZyhjb2RlKVxcXFxuICAgICAgICAgICAgICAgICBpZighY29kZSl7ICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5oyC5qKv5oiW5rKh5pyJ5q2k5b2x54mHXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidmlkZW86Ly9cXFxcXFxcIiArIGF2O1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICB9LOivhuWIq+eggSksXFxcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcXFxuICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnZG9wcGlvY2RuJ10sXFxcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6I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YXQtNy82NC9Tb2NpYWwtbWVkaWFfU25hcGNoYXQtMTI4LnBuZycsXFxcXG4gICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgo6K+G5Yir56CBKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXFxcXFwiaHR0cHM6Ly90aGlzYXYuY29tL2NuL1xcXFxcXFwiICsg6K+G5Yir56CBICsgXFxcXFxcXCItdW5jZW5zb3JlZC1sZWFrXFxcXFxcXCI7IFxcXFxuLy9sb2coYXYpXFxcXG4gICAgICAgICAgICAgIHRyeXtcXFxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdiwge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6ICdNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wKSdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sdGltZW91dDo1MDAwXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgZXZhbChodG1sLm1hdGNoKC9ldmFsLio/XFxcXFxcXFxuLylbMF0pXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vIOiOt+WPlueUu+i0qOWIl+ihqO+8jOW5tuWOu+acgOmrmOeUu+i0qFxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZ3JvdXBfcXVhbGl0eSA9IGZldGNoKHNvdXJjZSx7aGVhZGVyczp7XFxcXFxcXCJvcmlnaW5cXFxcXFxcIjpcXFxcXFxcImh0dHBzOi8vdGhpc2F2LmNvbVxcXFxcXFwifX0pXFxcXG4gICAgICAgICAgICAgICAgICAgIGhnaGVzdF9xdWFsaXR5ID0gZ3JvdXBfcXVhbGl0eS5tYXRjaCgvXiguKilcXFxcXFxcXC5tM3U4JC9nbSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJu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sgXFxcXFxcXCItdW5jZW5zb3JlZC1sZWFrZWRcXFxcXFxcIjsgXFxcXG4vL2xvZyhhdilcXFxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXFxcbiAgICAgICAgICAgICAgICAgaWYoIWh0bWwgfHwgaHRtbC5pbmNsdWRlcyhcXFxcXFxcIuivt+ajgOafpeWcsOWdgOagj+S4reeahOe9keWdgFxcXFxcXFwiKSl7ICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5oyC5qKv5oiW5rKh5pyJ5q2k5b2x54mHXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidmlkZW86Ly9cXFxcXFxcIiArIGF2O1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICB9LOivhuWIq+eggSksXFxcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcXFxuICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycqLmRvcHBpb2Nkbi4qJ10sXFxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWydkbW0uY28uanAnXSxcXFxcbiAgICAgICAgICAgICAgICAvL3ZpZGVvUnVsZXM6IFsnKm0zdTgqJ10sXFxcXG4gICAgICAgICAgICAgICAgY2FjaGVNM3U4OiB0cnVlLFxcXFxuICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PnsgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly9uamF2LnR2L3poL3YvXFxcXFxcXCIgKyDor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XFxkK1xcXFxcXFxcLmh0bS8sIHRvUGFnZSArICcuaHRtJyk7XFxcXG4gICAgICAgICAgICAgIH1lbHNle1xcXFxudmFyIHVybCA9IHRydWVfdXJsLnJlcGxhY2UoL1xcXFxcXFxcLmh0bS8sICctJyArIHRvUGFnZSArICcuaHRtJyk7XFxcXG4gICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcXFxcXCJub3dcXFxcXFxcIiwgbmFtZXNbal0pO1xcXFxuICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnVybCwgdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAvL3B1dE15VmFyKCd5aV9maXJzdHBhZ2UnLCB1cmwpO1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i3s+i2iuWIsOS6huesrCcgKyB0b1BhZ2UgKyAn6aG1J1xcXFxyXFxcXG4gICAgICAgICAgICB9LHRydWVfdXJsLCBrLG5hbWVzLGopLFxcXFxyXFxcXG4gICAgICAgIH0pO1xcXFxuXFxcXG59ZWxzZXtcXFxcblxcXFxuaWYoYXJyW2pdPT0n6ZqP5py6Jyl7XFxcXG4gICAgICAgICAgICAgIGFycltqXSA9IE1hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIGspICsxICAgXFxcXG59ZWxzZSBpZihhcnJbal09PSflsL7pobUnK2spe1xcXFxuICAgICAgICAgICAgICBhcnJbal0gPSBrXFxcXG59ZWxzZSBpZihhcnJbal09PTEpe1xcXFxuICAgICAgICAgICAgICBuYW1lc1tqXSA9IFxcXFxcXFwi6aaW6aG1XFxcXFxcXCJcXFxcbn1lbHNlIGlmKGFycltqXT09J+i3s+mhtScpe1xcXFxuICAgICAgICAgICAgIGFycltqXSA9IDIyM1xcXFxufVxcXFxuXFxcXG4gICAgICAgICAgaWYoL2ZvcnVtXFxcXF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xcIixcXFxcXFxcImdcXFxcXFxcIikpLmpvaW4oYylcXFxcbn1cXFxcblxcXFxuZnVuY3Rpb24gcmV1cmwoYSkge1xcXFxuICAgIHZhciBiID0gJyc7XFxcXG4gICAgdmFyIGMgPSBjc3BsaXQoYSwgOCkuc3BsaXQoJ1xcXFxcXFxcclxcXFxcXFxcbicpO1xcXFxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgKGMubGVuZ3RoIC0gMSk7IGkrKykge1xcXFxuICAgICAgICBiID0gYiArIFN0cmluZy5mcm9tQ2hhckNvZGUoKHBhcnNlSW50KGNbaV0sIDIpIC0gMTApLnRvU3RyaW5nKDEwKSlcXFxcbiAgICB9XFxcXG4gICAgcmV0dXJuIGJcXFxcbn1cXFwifV1cIixcInByb3h5XCI6XCJcIn0iLCJwaWNVcmwiOiJodHRwczovL3d3dy5mZG5zMS54eXovdmlldy9pbWcvY2FuZzUucG5nIiwidGl0bGUiOiLnlarCt+S7k19fX19fX19f6aOO5ZC56Iqx5rW36L276Iie77yM6YaJ5Y2n55Wq5LuT5qKm5Lmh44CCIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement