xiaomianao666

ε°η¨‹εΊοΌšπ‰πšπ―πƒπ

May 25th, 2024
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ζ΅·ι˜”θ§†η•Œθ§„εˆ™εˆ†δΊ«οΌŒε½“ε‰εˆ†δΊ«ηš„ζ˜―οΌšε°η¨‹εΊοΏ₯home_rule_v2οΏ₯base64://@π‰πšπ―πƒπ@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi8J2QifCdkJrwnZCv8J2Qg/CdkIEiLCJhdXRob3IiOiLOseaooeadvyZSIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly9qYXZkYjM2Ni5jb20vIyNmeXBhZ2UiLCJ2ZXJzaW9uIjoyMDI0MDUyNCwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IuS6kTZvb29vbGUveHh4eHh4L3hvenhkd2ppNXJyaHJsNnYiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG5hZGRMaXN0ZW5lcihcIm9uQ2xvc2VcIiwgJC50b1N0cmluZygoKSA9PiB7XG4gICAgbGV0IGtleXMgPSBsaXN0TXlWYXJLZXlzKCk7XG4gICAgZm9yIChsZXQgaXQgb2Yga2V5cykge1xuICAgICAgICBjbGVhck15VmFyKGl0KTtcbiAgICB9XG59KSk7XG5cbmNvbnN0IOS4i+S4gOmhtSA9IFwicGQoaHRtbCwgJy5wYWdpbmF0aW9uJiZhW3JlbD1uZXh0XSYmaHJlZicpXCI7XG5jb25zdCBwYWdlID0gTVlfUEFHRTtcbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ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vbWUgPSBNWV9SVUxFLnVybC5tYXRjaCgvaHR0cHM/OlxcL1xcL1teIy8/Jl0rXFwvLylbMF07XG4gICAgICAgICAgICB2YXIgaHRtID0gZmV0Y2goaG9tZSArICcvYWJvdXQnKTtcbiAgICAgICAgICAgIHZhciBob3N0ID0gcGRmaChodG0sJy5zdWItaGVhZGVyJiYuY29udGVudCYmYVtocmVmfj1jb21dJiZocmVmJylcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XG4gICAgICAgICAgICBpZiAoIWhvc3QpIHJldHVybiBcInRvYXN0Oi8v6I635Y+W5aSx6LSlXCI7XG4gICAgICAgICAgICB0b2FzdChob3N0KTtcbiAgICAgICAgICAgIHZhciBjdXJyZW50RGF0ZSA9IG5ldyBEYXRlKCk7XG4gICAgICAgICAgICB2YXIgeWVhciA9IGN1cnJlbnREYXRlLmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICB2YXIgbW9udGggPSBTdHJpbmcoY3VycmVudERhdGUuZ2V0TW9udGgoKSArIDEpLnBhZFN0YXJ0KDIsICcwJyk7XG4gICAgICAgICAgICB2YXIgZGF5ID0gU3RyaW5nKGN1cnJlbnREYXRlLmdldERhdGUoKSkucGFkU3RhcnQoMiwgJzAnKTtcbiAgICAgICAgICAgIE1ZX1JVTEUudmVyc2lvbiA9IGAke3llYXJ9JHttb250aH0ke2RheX1gO1xuICAgICAgICAgICAgLyhodHRwcz86XFwvXFwvW14jLz8mXStcXC8pLy50ZXN0KE1ZX1JVTEUudXJsKTtcbiAgICAgICAgICAgIE1ZX1JVTEUudXJsID0gTVlfUlVMRS51cmwucmVwbGFjZShSZWdFeHAuJDEsIGhvc3QpO1xuICAgICAgICAgICAgcmV0dXJuIFwicnVsZTovL1wiICsgYmFzZTY0RW5jb2RlKFwi5rW36ZiU6KeG55WM77+laG9tZV9ydWxl77+lXCIgKyBKU09OLnN0cmluZ2lmeShNWV9SVUxFKSk7ICAgICAgICAgICAgXG4gICAgICAgIH0sXG4gIC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bHNlLFxcblxcbiAgICAgICAg6aKE6K6+KHBhcmFtKSB7XFxuICAgICAgICAgICAgaWYgKHBhcmFtID09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICBwYXJhbSA9IFtdO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhwYXJhbSkuZm9yRWFjaCgocHJvcGVydHkpID0+IHtcXG4gICAgICAgICAgICAgICAgLy8g5a+55q+P5Liq5bGe5oCn5ZCN5omn6KGM5pON5L2cXFxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcGFyYW1bcHJvcGVydHldOyAvLyDojrflj5blsZ7mgKflgLxcXG4gICAgICAgICAgICAgICAgLy8g5Zyo6L+Z6YeM5omn6KGM5oKo55qE5pON5L2cXFxuICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHldID0gdmFsdWU7XFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmRlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhwcm9wZXJ0eSArIFxcXCI6XFxcIiArIHZhbHVlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGV2YWxKU1J1bGUoaXRlbSxcXG4gICAgICAgICAgICBqc1J1bGUpIHtcXG4gICAgICAgICAgICBsZXQgcnVsZSA9IGpzUnVsZS5yZXBsYWNlKFxcXCJAanM6XFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIHJ1bGUgPSBydWxlLnRyaW0oKTtcXG4gICAgICAgICAgICAvL2xvZygkLnN0cmluZ2lmeShydWxlKSlcXG4gICAgICAgICAgICBsZXQgaW5wdXQgPSBpdGVtO1xcbiAgICAgICAgICAgIGlmIChydWxlLnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBldmFsKFxcXCJyZXN1bHQgPSBcXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgLyoqXFxuICAgICAgICAgICAgICAgICAqIOi/mOWOn+aIkCAkLnRvU3RyaW5nKC4uLikg55qE5pyA57uI57uT5p6c77yM6L6+5Yiw5pyA57uI5aSE55CG5pa55byP6Lef5LiK6Z2i55qEIGlmIOS4gOiHtOeahOebrueahFxcbiAgICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgZXZhbChcXFwicmVzdWx0ID0gXFxcIiArIFxcXCIoKCkgPT4ge1xcXCIgKyBydWxlICsgXFxcIn0pKClcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCB8fCBcXFwiXFxcIjtcXG4gICAgICAgIH0sXFxuICAgICAgICBnZXRUaXRsZShzcmMsIGNhdGVnb3J5KSB7XFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgbGV0IHRpdGxlUnVsZSA9IGNhdGVnb3J5IHx8IFxcXCJhJiZUZXh0XFxcIjtcXG4gICAgICAgICAgICBpZiAodGl0bGVSdWxlLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIHRpdGxlUnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSBwYXJzZURvbUZvckh0bWwoc3JjLCB0aXRsZVJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdGl0bGUgfHwgXFxcIlxcXCI7XFxuICAgICAgICB9LFxcbiAgICAgICAgZ2V0VXJsKHNyYywgY2F0ZWdvcnkpIHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgbGV0IHVybFJ1bGUgPSBjYXRlZ29yeS7pk77mjqUgfHwgXFxcImEmJmhyZWZcXFwiO1xcbiAgICAgICAgICAgIGlmICh1cmxSdWxlLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCB1cmxSdWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cmwgPSBwZChzcmMsIHVybFJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodHlwZW9mIGNhdGVnb3J5LumTvuaOpeWkhOeQhiA9PSBcXFwiZnVuY3Rpb25cXFwiKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IGNhdGVnb3J5LumTvuaOpeWkhOeQhih1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsIHx8IFxcXCJcXFwiO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGlzTnVsbChwYXJhbSkge1xcbiAgICAgICAgICAgIGlmIChwYXJhbSA9PSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9LFxcbiAgICAgICAgaXNCb29sZWFuKHZhcmlhYmxlKSB7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB2YXJpYWJsZSAhPT0gXFxcImJvb2xlYW5cXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi5byA5ZCv5oqY5Y+g6K+35Lyg5YWl5biD5bCU5YC8XFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxcXG4gICAgICAgIOa4hemZpChsaXN0KSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAobGlzdC5jb25zdHJ1Y3RvciA9PSBTdHJpbmcpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLmuIXpmaTmiqXplJk66K+35Lyg5YiX6KGoXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHRoaXMuY2xlYXJzID0gbGlzdDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlhajmuIUobGlzdCkge1xcbiAgICAgICAgICAgIGlmICh0aGlzLmlzTnVsbChsaXN0KSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIGMgPSB0aGlzLmNsZWFyYWxsO1xcbiAgICAgICAgICAgIGxpc3QgPSBjLmNvbmNhdChsaXN0KTtcXG4gICAgICAgICAgICB0aGlzLmNsZWFyYWxsID0gbGlzdDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDmupDnoIEoaW5wdXQpIHtcXG4gICAgICAgICAgICB0aGlzLmh0bWwgPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDnlYzpnaIoaW5wdXQpIHtcXG4gICAgICAgICAgICB0aGlzLmxheW91dCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOmhteeggShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMucGFnZSA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOeKtuaAgShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMuc3RhdGUgPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlvIDlkK/mkJzntKIoaW5wdXQpIHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5zZWFyY2ggPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlvIDlkK/mipjlj6AoaW5wdXQpIHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5pc0Jvb2xlYW4oaW5wdXQpO1xcbiAgICAgICAgICAgIHRoaXMub3BlbiA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIHNldFRpdGxlKGssIGksIHQpIHtcXG4gICAgICAgICAgICByZXR1cm4gayA9PSBpID8gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyB0LmZvbnRjb2xvcih0aGlzLuWIhuexu+minOiJsikgOiB0O1xcbiAgICAgICAgfSxcXG4gICAgICAgIGFjdGlvbihvYmopIHtcXG4gICAgICAgICAgICByZXR1cm4gW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmuIXpmaTnirbmgIFcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygob2JqKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsb2cob2JqKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIob2JqLnN0YXRlKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignY2F0ZV9idXR0b24nKTtcXG4gICAgICAgICAgICAgICAgICAgIG9iai5hbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIG9iai5jbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgfSwgb2JqKSxcXG4gICAgICAgICAgICB9LCBdO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGNoZWNrUGFyYW0oKSB7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IHt9O1xcbiAgICAgICAgICAgIGlmICh0aGlzLnBhZ2UgPT0gMCAmJiB0eXBlb2YgcGFnZSA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuivt+S8oOWFpemhteeggVxcXCIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcGFnZSA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHRoaXMucGFnZTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIG9ialtcXFwi6aG156CBXFxcIl0gPSBwYWdlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0aGlzLmh0bWwgPT0gXFxcImVtcHR5XFxcIiAmJiB0eXBlb2YgaHRtbCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuivt+S8oOWFpea6kOeggVxcXCIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaHRtbCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLmupDnoIFcXFwiXSA9IHRoaXMuaHRtbDtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIG9ialtcXFwi5rqQ56CBXFxcIl0gPSBodG1sO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0aGlzLmxheW91dCA9PSBcXFwidW5kZWZpbmVkXFxcIiAmJiB0eXBlb2YgZCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuivt+S8oOWFpeeVjOmdolxcXCIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLnlYzpnaJcXFwiXSA9IHRoaXMubGF5b3V0O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLnlYzpnaJcXFwiXSA9IGQ7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIG9iajtcXG4gICAgICAgIH0sXFxuICAgICAgICDliJvlu7rliqjmgIHliIbnsbsocnVsZU9iaikge1xcbiAgICAgICAgICAgIGxldCBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgIGxldCBjYXRlcyA9IFtdO1xcbiAgICAgICAgICAgIGlmIChydWxlT2JqID09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICBydWxlT2JqID0gW107XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8v5Yid5aeL5YyW5Y+Y6YeP5byA5aeLXFxuICAgICAgICAgICAgY29uc3QgcGFyYW0gPSB0aGlzLmNoZWNrUGFyYW0oKTtcXG4gICAgICAgICAgICBjb25zdCBwYWdlID0gcGFyYW0u6aG156CBO1xcbiAgICAgICAgICAgIGNvbnN0IGh0bWwgPSBwYXJhbS7mupDnoIE7XFxuICAgICAgICAgICAgY29uc3QgZCA9IHBhcmFtLueVjOmdojtcXG4gICAgICAgICAgICBjb25zdCDnirbmgIEgPSB0aGlzLnN0YXRlO1xcbiAgICAgICAgICAgIGNvbnN0IHNlYXJjaCA9IHRoaXMuc2VhcmNoO1xcbiAgICAgICAgICAgIGNvbnN0IGVtcHR5ID0gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgIGNvbnN0IOaKmOWPoOeKtuaAgSA9IHRoaXMub3BlbjtcXG4gICAgICAgICAgICB2YXIg5bGV5byAID0gdGhpcy7lsZXlvIA7XFxuICAgICAgICAgICAgdmFyIOaKmOWPoCA9IHRoaXMu5oqY5Y+gO1xcbiAgICAgICAgICAgIHZhciDlhajmuIUgPSB0aGlzLmNsZWFyYWxsO1xcbiAgICAgICAgICAgIHZhciDmuIXpmaQgPSB0aGlzLmNsZWFycztcXG4gICAgICAgICAgICAvL+WIneWni+WMluWPmOmHj+e7k+adn1xcbiAgICAgICAgICAgIGxldCBpbml0X2NhdGUgPSBuZXcgQXJyYXkoMjApLmZpbGwoXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICBjb25zdCBmb2xkID0gZ2V0TXlWYXIoTVlfUlVMRS5ncm91cCwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICBjb25zdCBjYXRlX3RlbXAgPSBKU09OLnBhcnNlKFxcbiAgICAgICAgICAgICAgICBnZXRNeVZhcihcXFwiaGVhZC5jYXRlXFxcIiwgSlNPTi5zdHJpbmdpZnkoaW5pdF9jYXRlKSlcXG4gICAgICAgICAgICApO1xcbiAgICAgICAgICAgIGlmIChzZWFyY2ggJiYgcGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiJ2hpa2VyOi8vc2VhcmNoP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUgKyBcXFwiJnM9JytpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi5pCc57Si5YWz6ZSu6K+NXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJrZXl3b3JkXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImtleXdvcmRcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY29uc3QgY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgIHJ1bGVPYmouZm9yRWFjaCgoeCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IFtdO1xcbiAgICAgICAgICAgICAgICAvL2xvZyh4KVxcbiAgICAgICAgICAgICAgICBpZiAoeC5qc29uICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICAgICAgeC5qc29uLm1hcChrID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLnB1c2goSlNPTi5zdHJpbmdpZnkoaykucmVwbGFjZSgvXlxcXFxbfFxcXFxdJC9nLCAnJykpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgLy9jYXRlZ29yaWVzLnB1c2goeC5qc29uKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICh4LuS4gOe6p+WumuS9jSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu5LiA57qn5a6a5L2NLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7kuIDnuqflrprkvY0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShodG1sLCB4LuS4gOe6p+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHgu5aSn57G75a6a5L2NKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCB4LuWkp+exu+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBbcGRmYShodG1sLCB4LuWkp+exu+WumuS9jSkuam9pbignXFxcXG4nKV07XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG5cXG5cXG4gICAgICAgIHZhciDkuIDnuqcgPSBsaXN0Lm1hcCgocykgPT4ge1xcbiAgICAgICAgICB2YXIgc2xpc3QgPSBbXTtcXG4gICAgICAgICAgaWYgKCEoXFxcIuWwj+exu1xcXCIgaW4geCkpIHtcXG4gICAgICAgICAgICB4LuWwj+exuyA9IFxcXCJib2R5JiZhOm5vdCg6bWF0Y2hlcyjpppbpobUpKTpub3QoYTpub3QoW2hyZWZdKSlcXFwiO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIGlmICh4LuWwj+exuy5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShzLCB4LuWwj+exuyk7XFxuICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgc2xpc3QgPSBwZGZhKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICAvLy0t6aKd5aSW5aSE55CGLS1cXG4gICAgICAgICAgaWYgKCgn5aKe5YqgJyBpbiB4KSkge1xcbiAgICAgICAgICAgIGlmICh4LuWinuWKoC5jb25zdHJ1Y3RvciA9PSBTdHJpbmcpIHtcXG4gICAgICAgICAgICAgIHgu5aKe5YqgID0gZXZhbCh4LuWinuWKoCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHNsaXN0ID0geC7lop7liqAuY29uY2F0KHNsaXN0KTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICBpZiAoKCfooaXlhYUnIGluIHgpKSB7XFxuICAgICAgICAgICAgaWYgKHgu6KGl5YWFLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgeC7ooaXlhYUgPSBldmFsKHgu6KGl5YWFKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc2xpc3QgPSBzbGlzdC5jb25jYXQoeC7ooaXlhYUpO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIC8vLS3pop3lpJblpITnkIYtLVxcbiAgICAgICAgICB2YXIg5a6a5L2NID0gc2xpc3QubWFwKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gdGhpcy5nZXRUaXRsZShpdGVtLCB4Luagh+mimCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIHgpO1xcbiAgICAgICAgICAgIHZhciBvYmogPSB7XFxuICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsIHVybDogdXJsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZiAoKCdleHQnIGluIHgpKSB7XFxuICAgICAgICAgICAgICBvYmpbJ2V4dCddID0geC5leHQ7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmopO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgcmV0dXJuIOWumuS9jTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAvL2xvZyjkuIDnuqcpXFxuICAgICAgICAgICAgICAgIC8vbG9nKOS4gOe6py5sZW5ndGgpXFxuICAgICAgICAgICAgICAgIGlmICjkuIDnuqcubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaCjkuIDnuqcuam9pbihcXFwiXFxcXG5cXFwiKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICDkuIDnuqcuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChpdGVtLmpvaW4oXFxcIixcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL2xvZyhjYXRlZ29yaWVzKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmICjmipjlj6DnirbmgIEpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT09IFxcXCIxXFxcIiA/IOaKmOWPoCA6IOWxleW8gCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0aXRsZSwgZm9sZCwgdSwgYWxsLCBleHBzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZm9sZCA9IGdldE15VmFyKE1ZX1JVTEUuZ3JvdXAsIGZvbGQpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFvlsZXlvIAsIOaKmOWPoF0gPSBleHBzO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbGQgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjeCA9IGZpbmRJdGVtc0J5Q2xzKHRpdGxlICsgJ2NhdGVfYnV0dG9uJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2NhdGVfYnV0dG9uJywgY3gpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh0aXRsZSArICdjYXRlX2J1dHRvbicpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3ggPSBzdG9yYWdlMC5nZXRNeVZhcignY2F0ZV9idXR0b24nLCBbXSkubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4Wydjb2xfdHlwZSddID0geFsnY29sX3R5cGUnXSA/IHhbJ2NvbF90eXBlJ10gOiB4Wyd0eXBlJ107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcih0aXRsZSArICdjYXRlX2xpbmUnLCBjeClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHRpdGxlICsgJ2NhdGVfZXhwJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBmb2xkID09IDEgPyDlsZXlvIAgOiDmipjlj6AsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCA9PT0gXFxcIjFcXFwiID8gXFxcIjBcXFwiIDogXFxcIjFcXFwiKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfUlVMRS50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9sZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDlhajmuIUsIFvlsZXlvIAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDmipjlj6BcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9leHAnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IHRoaXMuYWN0aW9uKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGw6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsOiDmuIXpmaQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMuZm9yRWFjaCgoY2F0ZWdvcnksIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgLyppZiAo5bCP57G75a6a5L2NLmluY2x1ZGVzKFxcXCI7XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVswXSk7XFxuICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWJfY2F0ZWdvcmllcy5sZW5ndGggPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NLnNwbGl0KFxcXCI7XFxcIilbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyovXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhpbmRleClcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gSlNPTi5wYXJzZShgWyR7Y2F0ZWdvcnl9XWApO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coc3ViX2NhdGVnb3JpZXMpXFxuICAgICAgICAgICAgICAgICAgICAvLyBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICAvL31cXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5aSn57G7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IHRpdGxlID0gcGRmaChpdGVtLCBf5aSn57G75qCH6aKYKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gaXRlbS50aXRsZTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3UmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0gJydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyYW1zID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhcnM6IOa4hemZpCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IHVybCA9IHBkKGl0ZW0sIF/lpKfnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qaWYgKOWkp+exu+WkhOeQhikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IOS4gOe6p+WIhuexu+WkhOeQhih1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2codXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wLmZvckVhY2goKGNhdGUsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3RhdGUsIHBhcmFtcy5qc29uKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9SVUxFLnRpdGxlICsgJ2NhdGVfbGluZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/lsI/nsbtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGV4dHJhcG9zID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qaWYgKGl0ZW0uaW5jbHVkZXMoJ3R5cGU9XFxcIkBleHRyYVxcXCInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhcG9zID0gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygn6ZmE5Yqg5a6a5L2NJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChleHRyYXBvcykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gcGRmaChpdGVtLCBcXFwiYSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIFxcXCJhJiZzdGF0ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIFxcXCJhJiZ2YWx1ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGpzb24gPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qc3dpdGNoICh0cnVlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXCJAQEBcXFwiKTpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAQFxcXCIpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXCJAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAXFxcIilbMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAXFxcIilbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGpzb24gPSBwZChpdGVtLCDliIbnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKnZhciBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEBAJyk/e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVswXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTsqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdGl0bGUgPT0gXFxcIvCdkIXwnZCC8J2fkFxcXCIgPyBcXFwiaGlrZXI6Ly9wYWdlL2ZjMj91cmw9XFxcIiArIGdldE15VmFyKFxcXCJmYzJcXFwiKSArIFxcXCIjZnlwYWdlI25vSGlzdG9yeSNcXFwiIDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5qc29uLmNvbnN0cnVjdG9yID09PSBPYmplY3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZm9sZCA9PT0gXFxcIjFcXFwiIHx8IOaKmOWPoOeKtuaAgSA9PSBmYWxzZSkge1xcbiAgICAgICAgICAgICAgICBpdGVtcyA9IGl0ZW1zLmNvbmNhdChjYXRlcyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChmb2xkID09PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2NhdGVfYnV0dG9uJywgY2F0ZXMpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc2V0UHJlUmVzdWx0ICE9ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zID0gZC5jb25jYXQoaXRlbXMpO1xcbiAgICAgICAgICAgICAgICAvL+a4heepuue7p+aJv+aVsOe7hFxcbiAgICAgICAgICAgICAgICBkLmxlbmd0aCA9IDA7XFxuICAgICAgICAgICAgICAgIHNldFByZVJlc3VsdChpdGVtcyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaChpdGVtKTtcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICB9O1xcbiAgICBvYmou6aKE6K6+KG9wdGlvbnMpO1xcbiAgICByZXR1cm4gb2JqO1xcbn1cXG5cXG52YXIg54q25oCBID1cXG4gICAgdHlwZW9mIOeKtuaAgeagh+iusCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDnirbmgIHmoIforrAgIT0gXFxcIlxcXCIgPyDnirbmgIHmoIforrAgOiBNWV9SVUxFLnVybDtcXG5cXG5sZXQgZHRfZGVidWcgPSBmYWxzZTtcXG5cXG5hZGRMaXN0ZW5lcihcXG4gICAgXFxcIm9uQ2xvc2VcXFwiLFxcbiAgICAkLnRvU3RyaW5nKCgpID0+IHt9KVxcbik7XFxuXFxudmFyIENyZWF0ZSA9IHtcXG4gICAgbmV4dFBhZ2U6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgdmFyIHJlc3VsdCA9IGZhbHNlO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICB2YXIgbmV4dCA9IGV2YWwo5LiL5LiA6aG1KTtcXG4gICAgICAgICAgICAvL2xvZygnbjonK25leHQpXFxuICAgICAgICAgICAgaWYgKG5leHQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCfkuIvkuIDpobXpk77mjqXkuLrnqbonKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXN1bHQgPSB0cnVlO1xcbiAgICAgICAgICAgIGlmICh0cnVlX3VybCA9PSBuZXh0KSB7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAvL2xvZyhcXFwi5Y+v6IO95LiN5a2Y5Zyo5LiL5LiA6aG15oiW6ICF5LiL5LiA6aG15a6a5L2N5pyJ6Zeu6aKYXFxcIik7XFxuICAgICAgICAgICAgLy9sb2coXFxcIumUmeivr+S/oeaBrzpcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICgobmV4dCA9PSBcXFwiXFxcIiB8fCBuZXh0ID09IHVuZGVmaW5lZCkgJiYgcGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgbmV4dCA9IHRydWVfdXJsO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvL3Jlc3VsdD1mYWxzZTtcXG4gICAgICAgICAgICBuZXh0ID0gZ2V0TXlWYXIo54q25oCBKTtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vbG9nKCdsJyt0cnVlX3VybClcXG4gICAgICAgIC8vbG9nKCduJytuZXh0KVxcbiAgICAgICAgaWYgKHBhZ2UgIT0gMSkge1xcbiAgICAgICAgICAgIGlmICh0cnVlX3VybCA9PSBuZXh0ICYmICFyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgIC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ykge1xcbiAgICAgICAgICAgIGltZyA9IHBkZmgoaXRlbSwgcnVsZS5pbWcpO1xcbiAgICAgICAgICAgIGltZyA9IHRoaXMuZ2V0QmFja0ltYWdlKGltZyk7XFxuICAgICAgICAgICAgaW1nID0gdGhpcy5odHRwSGFuZGxlKGltZyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGltZyA9IHBkZmgoaXRlbSwgcnVsZS5pbWcpO1xcbiAgICAgICAgICAgIGlmICghaW1nLnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBpbWcgPSBwZChpdGVtLCBydWxlLmltZyk7XFxuICAgICAgICAgICAgICAgIGltZyA9IHRoaXMuaHR0cEhhbmRsZShpbWcpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpbWcgKyBydWxlLnJlZjtcXG4gICAgfSxcXG4gICAgdXJsSGFuZGxlOiBmdW5jdGlvbihpdGVtLCBydWxlKSB7XFxuICAgICAgICB2YXIgaHJlZiA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKHJ1bGUudXJsLnN0YXJ0c1dpdGgoXFxcInBkXFxcIikpIHtcXG4gICAgICAgICAgICBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGhyZWYgPSBwZChpdGVtLCBydWxlLnVybCk7XFxuICAgICAgICB9XFxuICAgICAgICBocmVmID0gcnVsZS5pbXQgPyBocmVmICsgXFxcIiNpbW1lcnNpdmVUaGVtZSNcXFwiIDogaHJlZjtcXG4gICAgICAgIHJldHVybiBocmVmO1xcbiAgICB9LFxcbiAgICBzZXRDb250ZW50OiBmdW5jdGlvbihpdGVtLCBpbnB1dCkge1xcbiAgICAgICAgbGV0IG91dHB1dCA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKGlucHV0ID09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgIC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G4gICAgICAgIH1cXG4gICAgICAgIGlmIChqc29uW3J1bGUubGlzdF0gPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgYXJyLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5peg5YaF5a65PC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7fSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgZGVidWcgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmRlYnVnLCBmYWxzZSk7XFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXG4gICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgIGxvZygn5a6a5L2N5YiX6KGoOicgKyBydWxlLmxpc3QpO1xcbiAgICAgICAgfVxcbiAgICAgICAganNvbltydWxlLmxpc3RdLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBldmFsKHJ1bGUudGl0bGUpO1xcbiAgICAgICAgICAgIHZhciBkZXNjID0gZXZhbChydWxlLmRlc2MpO1xcbiAgICAgICAgICAgIHZhciBjb250ZW50ID0gZXZhbChydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgICAgIHZhciBpbWcgPSBldmFsKHJ1bGUuaW1nKSArIHJ1bGUucmVmO1xcbiAgICAgICAgICAgIHZhciBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHJ1bGUuaW10ID8gaHJlZiArIFxcXCIjaW1tZXJzaXZlVGhlbWUjXFxcIiA6IGhyZWY7XFxuICAgICAgICAgICAgdmFyIGxhenkgPSBydWxlLmxhenkgPyBydWxlLmxhenkgOiBcXFwiXFxcIjtcXG5cXG4gICAgICAgICAgICB2YXIgZGQgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBpbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHRoaXMuZGVidWdsb2coaSwgaXRlbSwgcnVsZSwgcngpO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBpZiAobGF6eSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBkZFtcXFwidXJsXFxcIl0gPSBocmVmICsgbGF6eT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XG4gICAgICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHJ4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIHVybFxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB0aGlzLmRlYnVnbG9nKGksIGl0ZW0sIHJ1bGUsIHJ4KTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgdmFyIGxhenkgPSBydWxlLmxhenkgPyBydWxlLmxhenkgOiBcXFwiXFxcIjtcXG4gICAgICAgICAgICB2YXIgZGQgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYzEgKyBcXFwiXFxcXHRcXFxcdFxcXFx0XFxcXHRcXFwiICsgZGVzYyxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsICsgJ0BydWxlPWpzOiQucmVxdWlyZShcXFwiZWpcXFwiKScsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfjgJDot7PpobXjgJEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0cnVlX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgnJywgJzHliLA4MeS5i+mXtOeahOeahOmhteeggScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5wdXQoKHRydWVfdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyc2VJbnQoaW5wdXQpID4gMSAmJiBwYXJzZUludChpbnB1dCkgPCA4MSAmJiBwYXJzZUludChpbnB1dCkgJSAxID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganVtcHUgPSB0cnVlX3VybC5yZXBsYWNlKC8oXFxcXD9wYWdlPVxcXFxkK3xcXFxcJnBhZ2U9XFxcXGQrfCQpLywgKG1hdGNoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaC5zdGFydHNXaXRoKCc/cGFnZT0nKSB8fCBtYXRjaC5zdGFydHNXaXRoKCcmcGFnZT0nKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoLmNoYXJBdCgwKSArICdwYWdlPScgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAodHJ1ZV91cmwuaW5jbHVkZXMoJz8nKSA/ICcmcGFnZT0nIDogJz9wYWdlPScpICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGp1bXB1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneWlfZmlyc3RwYWdlJywganVtcHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L2g5bey57uP56m/6LaK5Yiw5LqGJyArIGlucHV0ICsgJ+mhtSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ivt+i+k+WFpeato+ehrueahOmhteeggVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHJ1ZV91cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnVlX3VybClcXG4gICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGlmIChsYXp5ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGRkW1xcXCJ1cmxcXFwiXSA9IHVybCArIGxhenk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGFyci5wdXNoKGRkKTtcXG4gICAgICAgIH0pO1xcbiAgICB9LFxcbiAgICBMaXN0OiBmdW5jdGlvbihhcnIsIGh0bWwsIHJ1bGUsIHBhcmFtKSB7XFxuICAgICAgICBwYXJhbSA9IHBhcmFtID8gcGFyYW0gOiB7fTtcXG4gICAgICAgIHZhciBhdXRvID0gcGFyYW0uYXV0byA/IHBhcmFtLmF1dG8gOiBmYWxzZTtcXG4gICA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Db250ZW50KGl0ZW0sIHJ1bGUuZGVzYyk7XFxuICAgICAgICAgICAgICAgIHZhciBpbWcgPSB0aGlzLmltZ0hhbmRsZShpdGVtLCBydWxlKTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMudXJsSGFuZGxlKGl0ZW0sIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcblxcbiAgICAgICAgICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByeCA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGVidWdsb2coaSwgaXRlbSwgcnVsZSwgcngpO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBcXFwibGFzdGlkX1xcXCIgKyBwYWdlO1xcbiAgICAgICAgICAgICAgICAgICAgY2xzID0gXFxcImxhc3RtYXJrXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogKGVtcHR5ID8gXFxcImhpa2VyOi8vZW1wdHkjI1xcXCIgOiAnJykgKyB1cmwgKyAnP3BhZ2U9ZnlwYWdlQHJ1bGU9anM6JC5yZXF1aXJlKFxcXCJ5alxcXCIpJyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn44CQ6Lez6aG144CRJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodHJ1ZV91cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoJycsICcx5YiwMzHkuYvpl7TnmoTnmoTpobXnoIEnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmlucHV0KCh0cnVlX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGlucHV0KSA+IDEgJiYgcGFyc2VJbnQoaW5wdXQpIDwgODEgJiYgcGFyc2VJbnQoaW5wdXQpICUgMSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGp1bXB1ID0gdHJ1ZV91cmwucmVwbGFjZSgvKFxcXFw/cGFnZT1cXFxcZCt8XFxcXCZwYWdlPVxcXFxkK3wkKS8sIChtYXRjaCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2guc3RhcnRzV2l0aCgnP3BhZ2U9JykgfHwgbWF0Y2guc3RhcnRzV2l0aCgnJnBhZ2U9JykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaC5jaGFyQXQoMCkgKyAncGFnZT0nICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRydWVfdXJsLmluY2x1ZGVzKCc/JykgPyAnJnBhZ2U9JyA6ICc/cGFnZT0nKSArIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBqdW1wdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3lpX2ZpcnN0cGFnZScsIGp1bXB1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S9oOW3sue7j+epv+i2iuWIsOS6hicgKyBpbnB1dCArICfpobUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7fovpPlhaXmraPnoa7nmoTpobXnoIFcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRydWVfdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZV91cmwpXFxuICAgICAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSAmJiBzaG93KSB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJwYWdlbGluZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzbWFsbD7liqDovb3kuK0uLi48L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcInBhZ2VudW1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJwYWdlbnVtXFxcIiwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5Yiw5bqV5LqGPC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogXFxcImxhc3RcXFwiLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbi8qXFxuICAgICAgICBpZiAobGlzdC5sZW5ndGggPT0gMCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7ml6DlhoXlrrk8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHt9LFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSovXFxuICAgICAgICBpZiAodGhpcy5uZXh0UGFnZSgpKSB7XFxuICAgICAgICAgICAgLy9sb2coJ3QnKTtcXG4gICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcigneWlfaXNuZXh0JywgJ3QnKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgLy9sb2coJ2YnKTtcXG4gICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcigneWlfaXNuZXh0JywgJ2YnKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChhdXRvKSB7XFxuICAgICAgICAgICAgLy9jcmVhdGVOZXh0UGFnZSgpO1xcbiAgICAgICAgICAgIGF1dG9QYWdlKCk7XFxuICAgICAgICB9XFxuICAgIH0sXFxufTtcXG5cXG52YXIgZXh0TWV0aG9kID0ge1xcbiAgICBUb1BhcmFtczogZnVuY3Rpb24oKSB7XFxuICAgICAgICB2YXIganNvbiA9IGFyZ3VtZW50c1swXTtcXG4gICAgICAgIHJldHVybiBPYmplY3Qua2V5cyhqc29uKVxcbiAgICAgICAgICAgIC5tYXAoKGtleSkgPT4ga2V5ICsgXFxcIj1cXFwiICsganNvbltrZXldKVxcbiAgICAgICAgICAgIC5qb2luKFxcXCImXFxcIik7XFxuICAgIH0sXFxuICAgIHVybFBhcnNlOiBmdW5jdGlvbih1KSB7XFxuICAgICAgICB2YXIgZGljdCA9IHt9O1xcbiAgICAgICAgZGljdC5Tb3VyY2UgPSB1O1xcbiAgICAgICAgbGV0IHBhcmFtcyA9ICh1cmwpID0+IHtcXG4gICAgICAgICAgICBsZXQgcXVlcnlQYXJhbXMgPSB7fTtcXG4gICAgICAgICAgICBsZXQgcmVnID0gLyhbXj89Jl0rKT0oW14/PSZdKykvZztcXG4gICAgICAgICAgICB1cmwucmVwbGFjZShyZWcsIGZ1bmN0aW9uKCkge1xcbiAgICAgICAgICAgICAgICBxdWVyeVBhcmFtc1thcmd1bWVudHNbMV1dID0gYXJndW1lbnRzWzJdO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBxdWVyeVBhcmFtcztcXG4gICAgICAgIH07XFxuICAgICAgICB2YXIgamF2YVVybCA9IEphdmFJbXBvcnRlcihqYXZhLm5ldC5VUkwpO1xcbiAgICAgICAgd2l0aChqYXZhVXJsKSB7XFxuICAgICAgICAgICAgdmFyIHVybCA9I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ubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBpZiAoc3RyMVtpXSAhPT0gc3RyMltpXSkge1xcbiAgICAgICAgICAgICAgICBkaWZmQ2hhcnMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogaSxcXG4gICAgICAgICAgICAgICAgICAgIHMxOiBzdHIxW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgczI6IHN0cjJbaV0sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBkaWZmQ2hhcnM7XFxuICAgIH0sXFxuICAgIHJlcGxhY2VDaGFyQXQ6IGZ1bmN0aW9uKHN0ciwgaW5kZXgsIHJlcGxhY2VtZW50KSB7XFxuICAgICAgICBpZiAoaW5kZXggPCAwIHx8IGluZGV4ID49IHN0ci5sZW5ndGgpIHtcXG4gICAgICAgICAgICByZXR1cm4gc3RyO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9sb2coaW5kZXgpXFxuICAgICAgICBjb25zdCBhcnIgPSBzdHIuc3BsaXQoXFxcIlxcXCIpO1xcbiAgICAgICAgYXJyW2luZGV4XSA9IHJlcGxhY2VtZW50O1xcbiAgICAgICAgcmV0dXJuIGFyci5qb2luKFxcXCJcXFwiKTtcXG4gICAgfSxcXG4gICAgZ2V0T2JqZWN0S2V5c0RpZmY6IGZ1bmN0aW9uKG9iajEsIG9iajIpIHtcXG4gICAgICAgIGNvbnN0IGRpZmZlcmVudEtleXMgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGtleSBpbiBvYmoxKSB7XFxuICAgICAgICAgICAgaWYgKCFvYmoyLmhhc093blByb3BlcnR5KGtleSkgfHwgb2JqMVtrZXldICE9PSBvYmoyW2tleV0pIHtcXG4gICAgICAgICAgICAgICAgZGlmZmVyZW50S2V5cy5wdXNoKGtleSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChsZX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uUGFyYW1zLCB1Mi5QYXJhbXMpKSB7XFxuICAgICAgICAgICAgICAgIGlmIChkdF9kZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHUxLlBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHUyLlBhdGgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBkZiA9IHRoaXMuZmluZERpZmZlcmVudEluZGV4KFN0cmluZyh1MS5QYXRoKSwgU3RyaW5nKHUyLlBhdGgpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGR0X2RlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2coZGYpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChkZi5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gZGZbMF0uaW5kZXg7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZiA9IGRmLmZpbHRlcigoeCkgPT4gL1xcXFxkKy8udGVzdCh4LnMyKSk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSBmWzBdLmluZGV4O1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBlcSA9IHRoaXMucmVwbGFjZUNoYXJBdChTdHJpbmcodTIuUGF0aCksIHJlLCBcXFwiZnlwYWdlXFxcIik7XFxuICAgICAgICAgICAgICAgIG5leHR1cmwgPSB1Mi5Ib3N0cyArIGVxICsgY2EgKyB0aGlzLlRvUGFyYW1zKHUyLlBhcmFtcyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIGVwID0gdGhpcy5nZXRPYmplY3RLZXlzRGlmZih1MS5QYXJhbXMsIHUyLlBhcmFtcylcXG4gICAgICAgICAgICAgICAgaWYgKGVwLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB1MS5QYXJhbXNbZXBbMF1dID0gJ2Z5cGFnZSdcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhlcCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGVxID0gU3RyaW5nKHUxLlBhdGgpLnJlcGxhY2UoL1xcXFxkKy8sIFxcXCJmeXBhZ2VcXFwiKTtcXG4gICAgICAgICAgICAgICAgbmV4dHVybCA9IHUxLkhvc3RzICsgZXEgKyBjYSArIHRoaXMuVG9QYXJhbXModTEuUGFyYW1zKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZygnbmV4dDonK25leHR1cmwpXFxuICAgICAgICByZXR1cm4gbmV4dHVybDtcXG4gICAgfSxcXG59O1xcblxcbmZ1bmN0aW9uIGdldFRydWVsaW5rKG1hcmssIHVybCwgcGFnZSkge1xcbiAgICB2YXIgcCA9IGdldE15VmFyKG1hcmssIHVybCkucmVwbGFjZShcXFwiZnlwYWdlXFxcIiwgcGFnZSk7XFxuICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgIHJldHVybiBnZXRNeVZhcihcXFwieWlfZmlyc3RwYWdlXFxcIiwgcCk7XFxuICAgIH0gZWxzZSBpZiAocCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgcmV0dXJuIHA7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICByZXR1cm4gdXJsO1xcbiAgICB9XFxufVxcbi8v5p6E5bu6XFxuZnVuY3Rpb24gY3JlYXRlTmV4dFBhZ2UoKSB7XFxuICAgIGxldCBzdGFydG51bSA9IDE7XFxuICAgIHZhciBvYmogPSBhcmd1bWVudHNbMF07XFxuICAgIGlmICh0cnVlX3VybCAhPSBnZXRNeVZhcihcXFwieWlfcGFnZXVybFxcXCIsIFxcXCJcXFwiKSkge1xcbiAgICAgICAgY2xlYXJNeVZhcihcXFwieWlfcGFnZXVybFxcXCIpO1xcbiAgICB9XFxuICAgIGlmIChwYWdlID09IHN0YXJ0bnVtICYmIGdldE15VmFyKFxcXCJ5aV9wYWdldXJsXFxcIikgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgIHB1dE15VmFyKFxcXCJ5aV9maXJzdHBhZ2VcXFwiLCB0cnVlX3VybCk7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBuZXh0ID0gZXZhbCjkuIvkuIDpobUpO1xcbiAgICAgICAgICAgIC8vbG9nKFxcXCJuZXh0XFxcIik7XFxuICAgICAgICAgICAgLy9sb2cobmV4dCk7XFxuICAgICAgICB9IGNhdGNoIHtcXG4gICAgICAgICAgICBsb2coXFxcIuWPr+iDveS4jeWtmOWcqOS4i+S4gOmhteaIluiAheS4i+S4gOmhteWumuS9jeaciemXrumimFxcXCIpO1xcbiAgICAgICAgICAgIG5leHQgPSBcXFwiXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChuZXh0ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgdmFyIG54dXJsID0gZXh0TWV0aG9kLmdldE5leHRVcmwodHJ1ZV91cmwsIG5leHQsIG9iaik7XFxuICAgICAgICAgICAgLy9sb2coXFxcIm54dXJsOlxcXCIgKyBueHVybCk7XFxuICAgICAgICAgICAgcHV0TXlWYXIo54q25oCBLCBueHVybCk7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcInlpX3BhZ2V1cmxcXFwiLCBueHVybCk7XFxuICAgICAgICB9XFxuICAgIH1cXG59XFxuXFxuZnVuY3Rpb24gYXV0b1BhZ2UoKSB7XFxuICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgIHB1dE15VmFyKFxcXCJ5aV9maXJzdHBhZ2VcXFwiLCB0cnVlX3VybCk7XFxuICAgIH1cXG4gICAgdHJ5IHtcXG4gICAgICAgIHZhciBuZXh0ID0gZXZhbCjkuIvkuIDpobUpO1xcbiAgICAgICAgLy9sb2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AobGlzdC5pbmRleE9mKG5hbWUpID09ICctMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgIC8vIGxpc3QucHVzaChuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnVuc2hpZnQobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl9hY3Rvci50eHQnLCBKU09OLnN0cmluZ2lmeShsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdC5pbmRleE9mKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICBsaXN0LnNwbGljZShpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9hcG9sbG8vamF2ZGIvamF2ZGJfYWN0b3IudHh0JywgSlNPTi5zdHJpbmdpZnkobGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHN0ciksXFxuICAgIGV4dHJhOiB7XFxcImdyYWRpZW50XFxcIjp0cnVlfVxcbn0pO1xcbiAgICB9Y2F0Y2h7fVxcbiAgICAgICBpZiAodHlwZW9mIHBhZ2VzICE9PSAndW5kZWZpbmVkJyAmJiBwYWdlcyAhPT0gbnVsbCkge1xcbiAgICAgICAgICBzZXRJdGVtKCdwYWdlcycsIHBhZ2VzLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgIH0gXFxuXFxuLy/mvJTlkZjliIbnsbtcXG4gICB0cnl7XFxuICAgICAgICB2YXIgY2F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dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgfSlcXG4gICAgICAgIH1jYXRjaHt9XFxuIC8v5YiG5YmyXFxuICAgIGQucHVzaCh7XFxuICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgIH0pXFxufVxcblxcbnZhciBwYWdlcyA9IGdldEl0ZW0oJ3BhZ2VzJyk7XFxuXFxudHJ5e1xcbmxldCBub3cgPSBnZXRJdGVtKCdub3cnKTtcXG5pZihwYWdlcz4xJiZwYWdlczwzNyl7XFxuZm9yICh2YXIgaiA9IDE7IGogPD0gcGFnZXM7IGogKyspe1xcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9wYWdlPVxcXFxkKy8sICdwYWdlPScraik7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogaiA9PU1ZX1BBR0UgfHwgbm93ID09KCBqICsgJ+mhtScpPyAn4oCc4oCc4oCd4oCdJyArIChqICsgJ+mhtScpLmZvbnRjb2xvcigncmVkJykgOiAoaiArICfpobUnKSxcXG4gICAgICAgIHVybDokKHVybCkubGF6eVJ1bGUoKGopID0+IHtcXG4gICAgICAgICAgICBzZXRJdGVtKFxcXCJub3dcXFwiLCggaiArICfpobUnKSk7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcInVybFxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICB9LGopLFxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG59KVxcbn1cXG59ZWxzZSBpZihwYWdlcz4zNyl7XFxuZm9yICh2YXIgaiA9IDE7IGogPD0gNjE7IGogKz0oaj09MSk/MjozKXtcXG52YXIgdXJsID0gdHJ1ZV91cmwucmVwbGFjZSgvcGFnZT1cXFxcZCsvLCAncGFnZT0nK2opO1x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ZXR1cm4gXFxcIng1Oi8vaHR0cHM6Ly9mYW55aS5iYWlkdS5jb20vI2pwL3poL1xcXCIgKyB0aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgfSx0aXRsZSl9LHt0aXRsZTogJ0RlZXBs57+76K+RJywganM6ICQudG9TdHJpbmcoKHRpdGxlKT0+eyBcXG4gICAgICAgIHJldHVybiBcXFwieDU6Ly9odHRwczovL3d3dy5kZWVwbC5jb20vemgvdHJhbnNsYXRvci1tb2JpbGUjamEvemgvXFxcIiArIHRpdGxlXFxuICAgICAgICAgICAgICAgICAgICAgICB9LHRpdGxlKX0se3RpdGxlOiAn6LC35q2M57+76K+RJywganM6ICQudG9TdHJpbmcoKHRpdGxlKT0+eyBcXG4gICAgICAgIHJldHVybiBcXFwieDU6Ly9odHRwczovL3RyYW5zbGF0ZS5nb29nbGUuY29tLz9obD16aC1DTiZzbD1qYSZ0bD16aC1DTiZ0ZXh0PVxcXCIgKyB0aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgfSx0aXRsZSl9XVxcbn1cXG4gICAgfSlcXG59XFxuXFxuLy9zZXRQYWdlVGl0bGUodGl0bGUpIC8vZmPpobXpnaLojrflj5bmoIfpophcXG5cXG52YXIg6K+G5Yir56CBID0gcGRmaChodG1sLCAnYm9keSYmLmZpcnN0LWJsb2NrJiYudmFsdWUmJlRleHQnKS50b0xvd2VyQ2FzZSgpO1xcblxcbnZhciBpbWcgPSBwZChodG1sLCcuY29sdW1uLXZpZGVvLWNvdmVyJiZpbWcmJnNyYycpO1xcbi8vdmFyIGltZyA9IE1ZX1BBUkFNUy5pbWc7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgdXJsOiBcXFwiY29weTovL1xcXCIgKyBpbWcsXFxuICAgICAgICAgICAgIGNvbF90eXBlOiAncGljXzFfZnVsbCcsXFxuICAgICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6ZmFsc2UsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3t0aXRsZTogJ2RtbeWbvueJhycsIGpzOiAkLnRvU3RyaW5nKCjor4bliKvnoIEpPT57XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL3BpY3MuZG1tLmNvLmpwL21vbm8vbW92aWUvYWR1bHQvXFxcIiArIOivhuWIq+eggS5yZXBsYWNlKC8tfF8vLCcnKSArICcvJyArIOivhuWIq+eggS5yZXBsYWNlKC8tfF8vLCcnKSArIFxcXCJwbC5qcGdcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICB9LOivhuWIq+eggSl9LHt0aXRsZTogJ+WbvueJh+mihOiniCcsIGpzOiAkLnRvU3RyaW5nKChodG1sKT0+eyBcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWNzID0gcGRmYShodG1sLFxcXCIucHJldmlldy1pbWFnZXMmJi50aWxlLWl0ZW0sMTpuXFxcIikubWFwKGl0ZW09PnBkZmgoaXRlbSxcXFwiYSYmaHJlZlxcXCIpKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBpY3MgIT1cXFwiXFxcIiA/IFxcXCJwaWNzOi8vXFxcIitwaWNzLmpvaW4oXFxcIiYmXFxcIikgOiBcXFwidG9hc3Q6Ly/msqHmnInlm77niYfpooTop4jlk6bwn5iQXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgfSxodG1sKX0se3RpdGxlOiAn5omT5byA5Zu+54mHJywganM6ICQudG9TdHJpbmcoKGltZyk9PnsgXFxuICAgICAgICByZXR1cm4gaW1nXFxuICAgICAgICAgICAgICAgICAgICAgICB9LGltZyl9XVxcbiAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UveWl5YW4nLCB7fSkpLnJ1bGUpO1xcblxcblxcbnZhciBzY29yZSA9IHBkZmgo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vc2VhcmNoP3E9XFxcIiArIOivhuWIq+eggTtcXG4gICAgICAgICAgICAgICAgfSwg6K+G5Yir56CBKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfno4HlipvmkJzmoIfpopgnLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodGl0bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3NvdT9ydWxlPeejgeWKm+WQmy7nroAmcD1meXBhZ2Umc2VhcmNoVGVybXM9XFxcIiArIHRpdGxlXFxuICAgICAgICAgICAgICAgIH0sIHRpdGxlKVxcbiAgICAgICAgICAgIH1dXFxuICAgICAgICB9IDogJydcXG4gICAgfSk7XFxuICAgIGlmIChpbmRleCA9PSAwKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB0LFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgc3RyID0gZmV0Y2hQQygnaGlrZXI6Ly9maWxlcy9ydWxlcy9hcG9sbG8vamF2ZGIvamF2ZGJfdmlkZW8udHh0Jyk7XFxuICAgICAgICAgICAgICAgIGlmICghc3RyKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IFtuYW1lXTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9hcG9sbG8vamF2ZGIvamF2ZGJfdmlkZW8udHh0JywgSlNPTi5zdHJpbmdpZnkobGlzdCkpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBKU09OLnBhcnNlKHN0cik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5pbmRleE9mKG5hbWUpID09ICctMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgIC8vIGxpc3QucHVzaChuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnVuc2hpZnQobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl92aWRlby50eHQnLCBKU09OLnN0cmluZ2lmeShsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdC5pbmRleE9mKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICBsaXN0LnNwbGljZShpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9hcG9sbG8vamF2ZGIvamF2ZGJfdmlkZW8udHh0JywgSlNPTi5zdHJpbmdpZnkobGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHN0ciksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIH0pO1xcbmQucHVzaCh7XFxuY29sX3R5cGU6XFxcImJsYW5rX2Jsb2NrXFxcIlxcbn0pXFxuICAgIH1cXG59KTtcXG5cXG4vL+eJh+WVhlxcbnRyeSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIueJh+WVhjpcXFwiLFxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICB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ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcih0YWJ1cmwsIGkpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICB9LCB0YWJuYW1lLCB0YWJ1cmwsIGkpXFxuICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgIH1cXG5cXG52YXIgbGlzdHMgPSBbXTtcXG5mdW5jdGlvbiBzZXRMaXN0cyhsaXN0cywgaW5kZXgpIHtcXG4gICAgZnVuY3Rpb24gcGxheUxpc3RzKCkge1xcbiAgICAgICBpZiAoaW5kZXggPT0gMCkge1xcbi8v6aKE6KeI6KeG6aKRXFxuICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPG1pZGRsZT48Zm9udCBjb2xvcj1ibGFjaz7wn5O66aCQ6Ka96KaW6aC74pGgPC9mb250PjwvbWlkZGxlPicsXFxuICAgICAgICB1cmw6IE1ZX1VSTCArICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IHBkZmgoaHRtbCxcXFwiLm1lc3NhZ2UtYm9keSYmc291cmNlJiZzcmNcXFwiKVxcbiAgICAgICAgICAgICAgICAgICBpZiggIXVybC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikmJnVybCE9PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZih1cmw9PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mspLmnInpoJDopr3lkq9cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgICB9Y2F0Y2h7cmV0dXJuIFxcXCJ0b2FzdDovL+aykuaciemgkOimveWSr1xcXCJ9XFxuICAgICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgZXh0cmE6IHtsaW5lVmlzaWJsZTogZmFsc2V9XFxuICAgICAgICAgICAgICAgICB9KVxcbiAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxtaWRkbGU+PGZvbnQgY29sb3I9YmxhY2s+8J+TuumgkOimveimlumgu+KRoTwvZm9udD48L21pZGRsZT4nLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyAkKCcnKS5sYXp5UnVsZSgo6K+G5Yir56CBKSA9PiB7XFxuICAgICAgICAgICAgIHRyeXtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBzZWFyY2ggPSBcXFwiaHR0cHM6Ly9qYXZzdWJ0aXRsZWQuY29tL3poL3NlYXJjaD9rZXl3b3Jkcz1cXFwiICsg6K+G5Yir56CBXFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29kZXVybCA9IFxcXCJodHRwczovL2phdnN1YnRpdGxlZC5jb20vXFxcIiArIHBkZmgocmVxdWVzdChzZWFyY2gpLFxcXCJib2R5JiYudmlkZW9ib3gmJmEmJmhyZWZcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXlsaXN0ID0gZmV0Y2goY29kZXVybCkubWF0Y2goL2h0dHBzPzpcXFxcL1xcXFwvXFxcXFMrXFxcXC5tM3U4LylbMF1cXG4gICAgICAgICAgICAgICAgICAgIHZhciBwbGF5aGQgPSBmZXRjaChwbGF5bGlzdCkubW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QnICsgcGRmaChpdGVtLFxcXCIuY29udGVudCYmVGV4dFxcXCIpICsgJzwvZm9udD48L3NtYWxsPicsICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge2xpbmVWaXNpYmxlOmZhbHNlfVxcbiAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jMTNCNjZBPuabtOWkmuefreipleWPr+aIkOS4ulZJUOaIluiHs+WumOaWuUFwcOS4reafpeecizwvZm9udD48L3NtYWxsPicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOivhuWIq+eggSkgPT4geyAgICAgICAgICAgICAgIFxcbiAgICAgICAgIG9wZW5BcHBJbnRlbnQoJ3h4eC5wb3JuaHViLmZ1Y2snLCAneHh4LnBvcm5odWIuZnVjay5NYWluQWN0aXZpdHknLCB7aW50ZW50RGF0YTog6K+G5Yir56CBfSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsg6K+G5Yir56CBXFxuICAgICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge2xpbmVWaXNpYmxlOmZhbHNlfVxcbiAgICAgICAgICAgICAgIH0pXFxufWNhdGNoe31cXG4gICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICBwbGF5TGlzdHMoKSAgICAgICAgXFxuICAgICAgICAgICAgfVxcblxcbnNldFRhYnModGFicywgTVlfVV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VyOi8vcGFnZS95aic6J2hpa2VyOi8vcGFnZS9laicsXFxuICAgICAgICAgICAgY29sX3R5cGU6IGxhYmVsID09IFxcXCLmvJTlk6FcXFwiID8gJ2NhcmRfcGljXzMnIDogJ21vdmllXzInLFxcbiAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgIHVybDogbGlzdC5zcGxpdCgnQEAnKVsyXS5yZXBsYWNlKGdldE15VmFyKCd5b25naml1JyksTVlfSE9NRSksXFxuICAgICAgICAgICAgICBwYWdlVGl0bGU6IGxpc3Quc3BsaXQoJ0BAJylbMF0sXFxuICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgdGl0bGU6ICflj5bmtojmlLbol48nLFxcbiAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChsaXN0LCB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gSlNPTi5wYXJzZShmZXRjaFBDKHUpIHx8ICdbXScpO1xcbiAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YS5maWx0ZXIoeCA9PiB4ICE9IGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUodSwgSlNPTi5zdHJpbmdpZnkoZGF0YSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIHUpXFxuICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH0pO1xcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKRo+S4gOe6p+mhtemdoueZu+W9lVwiLFwicGF0aFwiOlwi55m75b2VXCIsXCJydWxlXCI6XCJcXG5pZihmZXRjaCgnaGlrZXI6Ly9maWxlcy9jYWNoZS9qYXZkYl9jb29raWUudHh0Jykpe1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxiaWc+PGZvbnQgY29sb3I9I0ZGMDBGRj7otKblj7flt7LnmbvlvZU8L2ZvbnQ+PC9iaWc+JyxcXG4gICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdJyArICfliIfmjaLliIbnsbvliLfmlrDpobXpnaLlhoXlrrknLmZvbnRjb2xvcignI0ZGMDBGRicpLmJpZygpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICB9KTtcXG4gICAgfWVsc2V7XFxuXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn54K55Ye755m75b2V6LSm5Y+3Jy5mb250Y29sb3IoJyNGRjAwRkYnKS5iaWcoKSxcXG4gICAgICAgIHVybDogdHJ1ZV91cmwgKyAkKCcnKS5ydWxlKCgpID0+IHtcXG4gICAgICAgICAgICB2YXIgZCA9IFtdO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnLFxcbiAgICAgICAgICAgICAgICB1cmw6IE1ZX1VSTCxcXG4gICAgICAgICAgICAgICAgZGVzYzogJ2xpc3QmJnNjcmVlbicsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICB1YTogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICBzaG93UHJvZ3Jlc3M6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGVjaygpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgbm9kZXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcjdGFncycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY28gPSBmYmEuZ2V0Q29va2llKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coJ2NvOjo6Ojo6JyArIGNvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvLmluY2x1ZGVzKCdyZW1lbWJlcl9tZV90b2tlbicpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZSgkJCQoKS5sYXp5UnVsZSgoY28pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvY2FjaGUvamF2ZGJfY29va2llLnR4dCcsIGNvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6LSm5Y+35bey55m75b2VJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGNvKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGNoZWNrLCA1MDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBNWV9VUkwpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm4gc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgIH0pO1xcblxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0olwiLFwicGF0aFwiOlwic2VhcmNoXCIsXCJydWxlXCI6XCIgICAgICAgIGlmIChwYWdlID09PSAxKSB7XFxuICAgICAgICAgICAgdmFyIHRhYnMgPSBbXFxcIuW9seeJh1xcXCIsIFxcXCLmvJTlkZhcXFwiLCBcXFwi5Y+v5pKt5pS+XFxcIiwgXFxcIuS4reWtl1xcXCIsIFxcXCLno4Hpk75cXFwiLCBcXFwi5riF5Y2VXFxcIl1cXG4gICAgICAgICAgICB2YXIgbGlzdHMgPSBbXFxcImFsbFxcXCIsIFxcXCJhY3RvclxcXCIsIFxcXCJwbGF5YWJsZVxcXCIsIFxcXCJjbnN1YlxcXCIsIFxcXCJkb3dubG9hZFxcXCIsIFxcXCJsaXN0XFxcIl1cXG5cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0VGFicyh0YWJzKSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIHRhYnMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoXFxcInRhYlxcXCIsICcwJykgPT0gaSA/ICfigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPVxcXCIjRkYwMEZGXFxcIj4nICsgdGFic1tpXSArICc8L2ZvbnQ+PC9zdHJvbmc+JyA6IHRhYnNbaV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5sYXp5UnVsZSgoaSwgbGlzdHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJ0YWJcXFwiLCBpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdrZXknKSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBrZXlzID0gbGlzdE15VmFyS2V5cygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGtleXMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJ0YWJcXFwiLCBpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIFxcXCJodHRwczovL2phdmRiLmNvbS9zZWFyY2g/Zj1cXFwiICsgbGlzdHNbaV0gKyBcXFwiJnE9XFxcIiArIGdldE15VmFyKCdrZXknKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3lpX2ZpcnN0cGFnZScsIFxcXCJodHRwczovL2phdmRiLmNvbS9zZWFyY2g/Zj1cXFwiICsgbGlzdHNbaV0gKyBcXFwiJnE9XFxcIiArIGdldE15VmFyKCdrZXknKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGksIGxpc3RzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0TGlzdHMobGlzdHMsIGluZGV4KSB7XFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBwbGF5TGlzdHMoKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLwn5KOXFxcIiArIHRhYnNbaW5kZXhdICsgXFxcIvCfko5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn5pCc57Si5L2g5oOz6KaB55qEJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJC50b1N0cmluZygobGlzdHMsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5JywgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQga2V5cyA9IGxpc3RNeVZhcktleXMoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBrZXlzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBcXFwiaHR0cHM6Ly9qYXZkYi5jb20vc2VhcmNoP2Y9XFxcIiArIGxpc3RzW2luZGV4XSArIFxcXCImcT1cXFwiICsgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd5aV9maXJzdHBhZ2UnLCBcXFwiaHR0cHM6Ly9qYXZkYi5jb20vc2VhcmNoP2Y9XFxcIiArIGxpc3RzW2luZGV4XSArIFxcXCImcT1cXFwiICsgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGxpc3RzLCBpbmRleCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdrZXknLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdrZXknLCBpbnB1dClcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcGxheUxpc3RzKClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHNldFRhYnModGFicywgdHJ1ZV91cmwpO1xcbiAgICAgICAgICAgIHNldExpc3RzKGxpc3RzLCBnZXRNeVZhcigndGFiJywgJzAnKSk7XFxuICAgICAgICB9O1wifSx7XCJjb2xfdHlwZVwi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2hpdG9rb3RvJ11cXG4gICAgZGF5X3NheV9jYWNoZVsndGltZSddID0gTWF0aC5mbG9vcihEYXRlLm5vdygpIC8gMTAwMClcXG4gICAgZ2xvYmFsTWFwMC5wdXRNeVZhcignZGF5c2F5JywgZGF5X3NheV9jYWNoZSlcXG4gICAgcmV0dXJuIGRheV9zYXlfaHRtbFsnaGl0b2tvdG8nXVxcbn1cXG5cXG4gICAgbGV0IGRheV9zYXkgPSAnJ1xcbiAgICB0cnkge1xcbiAgICAgICAgbGV0IGRheV9zYXlfY2FjaGUgPSB7fVxcbiAgICAgICAgbGV0IGRheV90aW1lID0gMFxcbiAgICAgICAgaWYgKGdsb2JhbE1hcDAuaGFzTXlWYXIoJ2RheXNheScpKSB7XFxuICAgICAgICAgICAgZGF5X3NheV9jYWNoZSA9IGdsb2JhbE1hcDAuZ2V0TXlWYXIoJ2RheXNheScsIHt9KVxcbiAgICAgICAgICAgIGRheV90aW1lID0gZGF5X3NheV9jYWNoZVsndGltZSddXFxuICAgICAgICAgICAgaWYgKE1hdGguZmxvb3IoRGF0ZS5ub3coKSAvIDEwMDApIC0gZGF5X3RpbWUgPj0gNjAwKSB7XFxuICAgICAgICAgICAgICAgIGRheV9zYXkgPSBzYXZlX2RheV9zYXlfY2FjaGUoKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGRheV9zYXkgPSBkYXlfc2F5X2NhY2hlWydjb250ZW50J11cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGRheV9zYXkgPSBzYXZlX2RheV9zYXlfY2FjaGUoKVxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIHtcXG4gICAgICAgIGRheV9zYXkgPSAnJ1xcbiAgICB9XCJ9XSIsImljb24iOiJodHRwczovL2ltZy52aW51YS5jbi9pbWFnZXMvenJMa1EucG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment