xiaomianao666

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

Jan 7th, 2025
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ζ΅·ι˜”θ§†η•Œθ§„εˆ™εˆ†δΊ«οΌŒε½“ε‰εˆ†δΊ«ηš„ζ˜―οΌšε°η¨‹εΊοΏ₯home_rule_v2οΏ₯base64://@π‰πšπ―πƒπ@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi8J2QifCdkJrwnZCv8J2Qg/CdkIEiLCJhdXRob3IiOiLOseaooeadvyZSIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly9qYXZkYjM2OC5jb20vIyNmeXBhZ2UiLCJ2ZXJzaW9uIjoyMDI0MDgwNSwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IuS6kTZvb29vbGUveHh4eHh4LzNhOHI0Z2g5MzNneXhyYTJcblxu5bCP56iL5bqP77ya8J2QifCdkJrwnZCv8J2Qg/CdkIEiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbiAgICB2YXIgZCA9IFtdO1xuYWRkTGlzdGVuZXIoXCJvbkNsb3NlXCIsICQudG9TdHJpbmcoKCkgPT4ge1xuICAgIGxldCBrZXlzID0gbGlzdE15VmFyS2V5cygpO1xuICAgIGZvciAobGV0IGl0IG9mIGtleXMpIHtcbiAgICAgICAgY2xlYXJNeVZhcihpdCk7XG4gICAgfVxufSkpO1xuXG5jb25zdCDkuIvkuIDpobUgPSBcInBkKGh0bWwsICcucGFnaW5hdGlvbiYmYVtyZWw9bmV4dF0mJmhyZWYnKVwiO1xuY29uc3QgcGFnZSA9IE1ZX1BBR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ArICQudG9TdHJpbmcoKCkgPT4ge1xuICAgICAgICBpZiAoL3NlYXJjaC8udGVzdCh0cnVlX3VybCkpIHtcbiAgICAgICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLFwiLnRvb2xiYXJcIilcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnYm9keSYmLnRhYnN8fC5idXR0b25zLmhhcy1hZGRvbnMnKTtcbiAgICAgICAgICAgIGlmICghL2Fib3V0fHJhbmtpbmdzfHRhZ3N8c2VyaWVzfG1ha2Vyc3x1c2Vyc3xsb2dpbnxhY3RvcnMvLnRlc3QodHJ1ZV91cmwpKSB7XG4gICAgICAgICAgICAgICAgbGlzdGYgPSBwZGZhKGxpc3RbMF0sIFwiYm9keSYmYVwiKVxuICAgICAgICAgICAgICAgIGxpc3RiID0gbGlzdGYuY29uY2F0KFsnPGEgaHJlZj1cIi91c2Vycy9yZWNlbnRfdmlkZW9zXCI+8J2QhfCdkILwnZ+QPC9BPiddKVxuICAgICAgICAgICAgICAgIGxpc3RbMF0gPSBsaXN0Yi5qb2luKFwiLFwiKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgc2kgPSAyXG4gICAgICAgICAgICBsaXN0YSA9IHBkZmEobGlzdFtzaV0sIFwiYm9keSYmYVwiKVxuICAgICAgICAgICAgZWxlbWVudCA9IGxpc3RhLnNwbGljZSgyLCAxKVswXVxuICAgICAgICAgICAgbGlzdGEudW5zaGlmdChlbGVtZW50KTtcbiAgICAgICAgICAgIGxpc3Rbc2ldID0gbGlzdGEuam9pbihcIixcIik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGxpc3RcbiAgICB9KSxcbiAgICDlsI/nsbs6ICdib2R5JiZhOm5vdCg6bWF0Y2hlcyjng63mkq18MjUwfOWwgemdonznjJzkvaB8RkMyKSknLFxuICAgIOagh+mimDogJ1RleHQuanM6aW5wdXQucmVwbGFjZShcIuWQq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zAlMkMxNDZcIiwgXCIxNDclMkMxNTNcIiwgXCIxNTQlMkMxNTlcIiwgXCIxNjAlMkMxNjVcIiwgXCIxNjYlMkMxNzBcIiwgXCIxNzElMkMxNzVcIiwgXCIxNzYlMkMxODBcIiwgXCIxODAlMkMxODVcIl0sXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGN1cDoge1xuICAgICAgICAgICAgICAgICAgICDmoIfpopg6IFtcIue9qeadr1wiLCBcIkFcIiwgXCJCQ1wiLCBcIkRcIiwgXCJFRlwiLCBcIkdIXCIsIFwiSUpcIiwgXCJLXCJdLFxuICAgICAgICAgICAgICAgICAgICDpk77mjqU6IFtcIjAlMkMxNVwiLCBcIjAlMkMxXCIsIFwiMSUyQzNcIiwgXCIzJTJDNFwiLCBcIjQlMkM2XCIsIFwiNiUyQzhcIiwgXCI4JTJDMTBcIiwgXCIxMCUyQzE1XCJdXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfV1cbiAgICAgICAgICAgIHZhciBuZXdsaXN0ID0gW11cbiAgICAgICAgICAgIGxpc3QuZm9yRWFjaCgobGlzdGEsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICAgICAgbGV0IGtleSA9IE9iamVjdC5rZXlzKGxpc3RhKTtcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0YVtrZXldLuagh+mimFxuICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IGxpc3RhW2tleV0u6ZO+5o6lXG4gICAgICAgICAgICAgICAgdmFyIGxpc3RiID0gdGl0bGUubWFwKChpdGVtLCBiaXgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICc8YSBocmVmPVwiJyArICcmJyArIGtleSArICc9JyArIHZhbHVlW2JpeF0gKyAnXCI+JyArIGl0ZW0gKyAnPC9hPic7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICBsaXN0YSA9IGxpc3RiL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RvU3RyaW5nKCh1KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGVjaygpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xldCBub2RlcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJyN0YWdzJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvID0gZmJhLmdldENvb2tpZSh1KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciB1YSA9IGZiYS5nZXRVYSgpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKCdjbzo6Ojo6OicgKyB1YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZygnY286Ojo6OjonICsgY28pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBodG1sQ29udGVudCA9IGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5pbm5lckhUTUw7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL+awuOS5heWfn+WQjS8udGVzdChodG1sQ29udGVudCkpIHtcblxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5wYXJzZUxhenlSdWxlKCQkJCgpLmxhenlSdWxlKChjbykgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL0Fwb2xsby9Db29raWUvamF2ZGJfY29va2llLnR4dCcsIGNvKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCflt7Lojrflj5Zjb29raWXvvIzliIfmjaLliLDpppbpobUnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGNvKSk7XG4gICAgICAgICAgICAgICAgICAgICAg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5a+55q+P5Liq5bGe5oCn5ZCN5omn6KGM5pON5L2cXFxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcGFyYW1bcHJvcGVydHldOyAvLyDojrflj5blsZ7mgKflgLxcXG4gICAgICAgICAgICAgICAgLy8g5Zyo6L+Z6YeM5omn6KGM5oKo55qE5pON5L2cXFxuICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHldID0gdmFsdWU7XFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmRlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhwcm9wZXJ0eSArIFxcXCI6XFxcIiArIHZhbHVlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGV2YWxKU1J1bGUoaXRlbSxcXG4gICAgICAgICAgICBqc1J1bGUpIHtcXG4gICAgICAgICAgICBsZXQgcnVsZSA9IGpzUnVsZS5yZXBsYWNlKFxcXCJAanM6XFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIHJ1bGUgPSBydWxlLnRyaW0oKTtcXG4gICAgICAgICAgICAvL2xvZygkLnN0cmluZ2lmeShydWxlKSlcXG4gICAgICAgICAgICBsZXQgaW5wdXQgPSBpdGVtO1xcbiAgICAgICAgICAgIGlmIChydWxlLnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBldmFsKFxcXCJyZXN1bHQgPSBcXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgLyoqXFxuICAgICAgICAgICAgICAgICAqIOi/mOWOn+aIkCAkLnRvU3RyaW5nKC4uLikg55qE5pyA57uI57uT5p6c77yM6L6+5Yiw5pyA57uI5aSE55CG5pa55byP6Lef5LiK6Z2i55qEIGlmIOS4gOiHtOeahOebrueahFxcbiAgICAgICAgICAgICAgICAg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BwZChzcmMsIHVybFJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodHlwZW9mIGNhdGVnb3J5LumTvuaOpeWkhOeQhiA9PSBcXFwiZnVuY3Rpb25cXFwiKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IGNhdGVnb3J5LumTvuaOpeWkhOeQhih1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsIHx8IFxcXCJcXFwiO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGlzTnVsbChwYXJhbSkge1xcbiAgICAgICAgICAgIGlmIChwYXJhbSA9PSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9LFxcbiAgICAgICAgaXNCb29sZWFuKHZhcmlhYmxlKSB7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB2YXJpYWJsZSAhPT0gXFxcImJvb2xlYW5cXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi5byA5ZCv5oqY5Y+g6K+35Lyg5YWl5biD5bCU5YC8XFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxcXG4gICAgICAgIOa4hemZpChsaXN0KSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAobGlzdC5jb25zdHJ1Y3RvciA9PSBTdHJpbmcpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLmuIXpmaTmiqXplJk66K+35Lyg5YiX6KGoXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHRoaXMuY2xlYXJzID0gbGlzdDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlhajmuIUobGlzdCkge1xcbiAgICAgICAgICAgIGlmICh0aGlzLmlzTnVsbChsaXN0KSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIGMgPSB0aGlzLmNsZWFyYWxsO1xcbiAgICAgICAgICAgIGxpc3QgPSBjLmNvbmNhdChsaXN0KTtcXG4gICAgICAgICAgICB0aGlzLmNsZWFyYWxsID0gbGlzdDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDmupDnoIEoaW5wdXQpIHtcXG4gICAgICAgICAgICB0aGlzLmh0bWwgPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDnlYzpnaIoaW5wdXQpIHtcXG4gICAgICAgICAgICB0aGlzLmxheW91dCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOmhteeggShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMucGFnZSA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOeKtuaAgShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMuc3RhdGUgPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlvIDlkK/mkJzntKIoaW5wdXQpIHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5zZWFyY2ggPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlvIDlkK/mipjlj6AoaW5wdXQpIHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5pc0Jvb2xlYW4oaW5wdXQpO1xcbiAgICAgICAgICAgIHRoaXMub3BlbiA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIHNldFRpdGxlKGssIGksIHQpIHtcXG4gICAgICAgICAgICByZXR1cm4gayA9PSBpID8gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyB0LmZvbnRjb2xvcih0aGlzLuWIhuexu+minOiJsikgOiB0O1xcbiAgICAgICAgfSxcXG4gICAgICAgIHNldGJnY29sb3IoayxpLHQpe1xcbiAgICAgICAgICAgIHJldHVybiAoIGsgPT0gaSB8fCB0LmluY2x1ZGVzKFxcXCLimYjvuI9cXFwiKSkgPyBnZXRSYW5nZUNvbG9ycygpIDogXFxcIlxcXCI7XFxuICAgICAgICB9LFxcbiAgICAgICAgYWN0aW9uKG9iaikge1xcbiAgICAgICAgICAgIHJldHVybiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhvYmopO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihvYmouc3RhdGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmNsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICB9LCBvYmopLFxcbiAgICAgICAgICAgIH0sIF07XFxuICAgICAgICB9LFxcbiAgICAgICAgY2hlY2tQYXJhbSgpIHtcXG4gICAgICAgICAgICB2YXIgb2JqID0ge307XFxuICAgICAgICAgICAgaWYgKHRoaXMucGFnZSA9PSAwICYmIHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl6aG156CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIumhteeggVxcXCJdID0gdGhpcy5wYWdlO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMuaHRtbCA9PSBcXFwiZW1wdHlcXFwiICYmIHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5rqQ56CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIua6kOeggVxcXCJdID0gdGhpcy5odG1sO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLmupDnoIFcXFwiXSA9IGh0bWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMubGF5b3V0ID09IFxcXCJ1bmRlZmluZWRcXFwiICYmIHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl55WM6Z2iXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gdGhpcy5sYXlvdXQ7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gZDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gb2JqO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWIm+W7uuWKqOaAgeWIhuexuyhydWxlT2JqKSB7XFxuICAgICAgICAgICAgbGV0IGl0ZW1zID0gW107XFxuICAgICAgICAgICAgbGV0IGNhdGVzID0gW107XFxuICAgICAgICAgICAgaWYgKHJ1bGVPYmogPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIHJ1bGVPYmogPSBbXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy/liJ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WYgKHNlYXJjaCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCInaGlrZXI6Ly9zZWFyY2g/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZSArIFxcXCImcz0nK2lucHV0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLmkJzntKLlhbPplK7or41cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcImtleXdvcmRcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwia2V5d29yZFxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjb25zdCBjYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgcnVsZU9iai5mb3JFYWNoKCh4KSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgIC8vbG9nKHgpXFxuICAgICAgICAgICAgICAgIGlmICh4Lmpzb24gIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgICAgICB4Lmpzb24ubWFwKGsgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChKU09OLnN0cmluZ2lmeShrKS5yZXBsYWNlKC9eXFxcXFt8XFxcXF0kL2csICcnKSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAvL2NhdGVnb3JpZXMucHVzaCh4Lmpzb24pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHgu5LiA57qn5a6a5L2NKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7kuIDnuqflrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCB4LuS4gOe6p+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh4LuWkp+exu+WumuS9jS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKGh0bWwsIHgu5aSn57G75a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IFtwZGZhKGh0bWwsIHgu5aSn57G75a6a5L2NKS5qb2luKCdcXFxcbicpXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcblxcblxcbiAgICAgICAgdmFyIOS4gOe6pyA9IGxpc3QubWFwKChzKSA9PiB7XFxuICAgICAgICAgIHZhciBzbGlzdCA9IFtdO1xcbiAgICAgICAgICBpZiAoIShcXFwi5bCP57G7XFxcIiBpbiB4KSkge1xcbiAgICAgICAgICAgIHgu5bCP57G7ID0gXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXCI7XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgaWYgKHgu5bCP57G7LnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgIHNsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIC8vLS3pop3lpJblpITnkIYtLVxcbiAgICAgICAgICBpZiAoKCflop7liqAnIGluIHgpKSB7XFxuICAgICAgICAgICAgaWYgKHgu5aKe5YqgLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgeC7lop7liqAgPSBldmFsKHgu5aKe5YqgKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc2xpc3QgPSB4LuWinuWKoC5jb25jYXQoc2xpc3QpO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIGlmICgoJ+ihpeWFhScgaW4geCkpIHtcXG4gICAgICAgICAgICBpZiAoeC7ooaXlhYUuY29uc3RydWN0b3IgPT0gU3RyaW5nKSB7XFxuICAgICAgICAgICAgICB4LuihpeWFhSA9IGV2YWwoeC7ooaXlhYUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzbGlzdCA9IHNsaXN0LmNvbmNhdCh4LuihpeWFhSk7XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgLy8tLemineWkluWkhOeQhi0tXFxuICAgICAgICAgIHZhciDlrprkvY0gPSBzbGlzdC5tYXAoKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIHgu5qCH6aKYKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgeCk7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IHtcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSwgdXJsOiB1cmxcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGlmICgoJ2V4dCcgaW4geCkpIHtcXG4gICAgICAgICAgICAgIG9ialsnZXh0J10gPSB4LmV4dDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KG9iaik7XFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgICByZXR1cm4g5a6a5L2NO1xcbiAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKOS4gOe6pylcXG4gICAgICAgICAgICAgICAgLy9sb2co5LiA57qnLmxlbmd0aClcXG4gICAgICAgICAgICAgICAgaWYgKOS4gOe6py5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXCJcXFxcblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIOS4gOe6py5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFwiLFxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3JpZXMpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKOaKmOWPoOeKtuaAgSkge1xcbiAgICAgICAgICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcIjFcXFwiID8g5oqY5Y+gIDog5bGV5byALFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRpdGxlLCBmb2xkLCB1LCBhbGwsIGV4cHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb2xkID0gZ2V0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgW+WxleW8gCwg5oqY5Y+gXSA9IGV4cHM7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN4ID0gZmluZEl0ZW1zQnlDbHModGl0bGUgKyAnY2F0ZV9idXR0b24nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignY2F0ZV9idXR0b24nLCBjeCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHRpdGxlICsgJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjeCA9IHN0b3JhZ2UwLmdldE15VmFyKCdjYXRlX2J1dHRvbicsIFtdKS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhbJ2NvbF90eXBlJ10gPSB4Wydjb2xfdHlwZSddID8geFsnY29sX3R5cGUnXSA6IHhbJ3R5cGUnXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHRpdGxlICsgJ2NhdGVfbGluZScsIGN4KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyphbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0odGl0bGUgKyAnY2F0ZV9leHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT0gMSA/IOWxleW8gCA6IOaKmOWPoCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLmdyb3VwLCBmb2xkID09PSBcXFwiMVxcXCIgPyBcXFwiMFxcXCIgOiBcXFwiMVxcXCIpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9SVUxFLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOWFqOa4hSwgW+WxleW8gCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOaKmOWPoFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfUlVMRS50aXRsZSArICdjYXRlX2V4cCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogdGhpcy5hY3Rpb24oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2w6IOa4hemZpCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5mb3JFYWNoKChjYXRlZ29yeSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3J5KVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgICAgICAgICAvKmlmICjlsI/nsbvlrprkvY0uaW5jbHVkZXMoXFxcIjtcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jS5zcGxpdChcXFwiO1xcXCIpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgaWYgKHN1Yl9jYXRlZ29yaWVzLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVsxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ki9cXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGluZGV4KVxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBKU09OLnBhcnNlKGBbJHtjYXRlZ29yeX1dYCk7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhzdWJfY2F0ZWdvcmllcylcXG4gICAgICAgICAgICAgICAgICAgIC8vIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/lpKfnsbtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIF/lpKfnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnRpdGxlO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXdSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSAnJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdXJsID0gcGQoaXRlbSwgX+Wkp+exu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0g5LiA57qn5YiG57G75aSE55CGKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogeyAnYmFja2dyb3VuZENvbG9yJzogdGhpcy5zZXRiZ2NvbG9yKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSl9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wLmZvckVhY2goKGNhdGUsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3RhdGUsIHBhcmFtcy5qc29uKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9SVUxFLnRpdGxlICsgJ2NhdGVfbGluZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/lsI/nsbtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGV4dHJhcG9zID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qaWYgKGl0ZW0uaW5jbHVkZXMoJ3R5cGU9XFxcIkBleHRyYVxcXCInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhcG9zID0gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygn6ZmE5Yqg5a6a5L2NJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChleHRyYXBvcykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gcGRmaChpdGVtLCBcXFwiYSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIFxcXCJhJiZzdGF0ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIFxcXCJhJiZ2YWx1ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGpzb24gPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qc3dpdGNoICh0cnVlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXCJAQEBcXFwiKTpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAQFxcXCIpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXCJAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAXFxcIilbMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAXFxcIilbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGpzb24gPSBwZChpdGVtLCDliIbnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKnZhciBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEBAJyk/e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVswXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTsqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdGl0bGUgPT0gXFxcIvCdkIXwnZCC8J2fkFxcXCIgPyBcXFwiaGlrZXI6Ly9wYWdlL2ZjMj91cmw9XFxcIiArIGdldE15VmFyKFxcXCJmYzJcXFwiKSArIFxcXCIjZnlwYWdlI25vSGlzdG9yeSNcXFwiIDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5qc29uLmNvbnN0cnVjdG9yID09PSBPYmplY3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9idXR0b24nLCBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYmFja2dyb3VuZENvbG9yJzogdGhpcy5zZXRiZ2NvbG9yKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogTVlfUlVMRS50aXRsZSArICdjYXRlX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChmb2xkID09PSBcXFwiMVxcXCIgfHwg5oqY5Y+g54q25oCBID09IGZhbHNlKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zID0gaXRlbXMuY29uY2F0KGNhdGVzKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGZvbGQgPT09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignY2F0ZV9idXR0b24nLCBjYXRlcylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiBzZXRQcmVSZXN1bHQgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMgPSBkLmNvbmNhdChpdGVtcyk7XFxuICAgICAgICAgICAgICAgIC8v5riF56m657un5om/5pWw57uEXFxuICAgICAgICAgICAgICAgIGQubGVuZ3RoID0gMDtcXG4gICAgICAgICAgICAgICAgc2V0UHJlUmVzdWx0KGl0ZW1zKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpdGVtcy5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sXFxuICAgIH07XFxuICAgIG9iai7pooTorr4ob3B0aW9ucyk7XFxuICAgIHJldHVybiBvYmo7XFxufVxcblxcbnZhciDnirbmgIEgPVxcbiAgICB0eXBlb2Yg54q25oCB5qCH6K6wICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOeKtuaAgeagh+iusCAhPSBcXFwiXFxcIiA/IOeKtuaAgeagh+iusCA6IE1ZX1JVTEUudXJsO1xcblxcbmxldCBkdF9kZWJ1ZyA9IGZhbHNlO1xcblxcbmFkZExpc3RlbmVyKFxcbiAgICBcXFwib25DbG9zZVxcXCIsXFxuICAgICQudG9TdHJpbmcoKCkgPT4ge30pXFxuKTtcXG5cXG52YXIgQ3JlYXRlID0ge1xcbiAgICBuZXh0UGFnZTogZnVuY3Rpb24oKSB7XFxuICAgICAgICB2YXIgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBuZXh0ID0gZXZhbCjkuIvkuIDpobUpO1xcbiAgICAgICAgICAgIC8vbG9nKCduOicrbmV4dClcXG4gICAgICAgICAgICBpZiAobmV4dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ+S4i+S4gOmhtemTvuaOpeS4uuepuicpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlc3VsdCA9IHRydWU7XFxuICAgICAgICAgICAgaWYgKHRydWVfdXJsID09IG5leHQpIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIC8vbG9nKFxcXCLlj6/og73kuI3lrZjlnKjkuIvkuIDpobXmiJbogIXkuIvkuIDpobXlrprkvY3mnInpl67pophcXFwiKTtcXG4gICAgICAgICAgICAvL2xvZyhcXFwi6ZSZ6K+v5L+h5oGvOlxcXCIgKyBlLm1lc3NhZ2UpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKChuZXh0ID09IFxcXCJcXFwiIHx8IG5leHQgPT0gdW5kZWZpbmVkKSAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBuZXh0ID0gdHJ1ZV91cmw7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIC8vcmVzdWx0PWZhbHNlO1xcbiAgICAgICAgICAgIG5leHQgPSBnZXRNeVZhcijnirbmgIEpO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9sb2coJ2wnK3RydWVfdXJsKVxcbiAgICAgICAgLy9sb2coJ24nK25leHQpXFxuICAgICAgICBpZiAocGFnZSAhPSAxKSB7XFxuICAgICAgICAgICAgaWYgKHRydWVfdXJsID09IG5leHQgJiYgIXJlc3VsdCkge1xcbiAgICAgICAgICAgICA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pO1xcbiAgICB9LFxcbiAgICBkZWJ1Z2xvZzogZnVuY3Rpb24oaSwgaXRlbSwgcnVsZSwgb2JqKSB7XFxuICAgICAgICBsb2coJy0tLS0tLS0tLS0nICsgKGkgKyAxKSArICc66LCD6K+V5byA5aeLLS0tLS0tLS0tLScpO1xcbiAgICAgICAgaWYgKGl0ZW0uY29uc3RydWN0b3IgPT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgaXRlbSA9IEpTT04uc3RyaW5naWZ5KGl0ZW0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgbG9nKCdpdGVt5YaF5a65OlxcXFxyXFxcXG4nICsgaXRlbSArICdcXFxcclxcXFxuJyArXFxuICAgICAgICAgICAgYFxcXFxuXFxcXHR0aXRsZeWumuS9jTogICR7cnVsZS50aXRsZX0gIC0tLT4g57uT5p6cOiAgJHtvYmoudGl0bGV9YCArXFxuICAgICAgICAgICAgYFxcXFxuXFxcXHRkZXNj5a6a5L2NOiAgJHtydWxlLmRlc2N9ICAtLS0+IOe7k+aenDogICR7b2JqLmRlc2N9YCArXFxuICAgICAgICAgICAgYFxcXFxuXFxcXHRpbWflrprkvY06ICAke3J1bGUuaW1nfSAgLS0tPiDnu5Pmnpw6ICAke29iai5pbWd9YCArXFxuICAgICAgICAgICAgKHJ1bGUuY29udGVudCAhPSB1bmRlZmluZWQgPyBgXFxcXG5cXFxcdGNvbnRlbnTlrprkvY06ICAke3J1bGUuY29udGVudH0gIC0tLT4g57uT5p6cOiAgJHtvYmouY29udGVudH1gIDogJycpICtcXG4gICAgICAgICAgICBgXFxcXG5cXFxcdHVybOWumuS9jTogICR7cnVsZS51cmx9ICAtLS0+IOe7k+aenDogICR7b2JqLnVybH1gXFxuICAgICAgICApO1xcbiAgICAgICAgbG9nKCctLS0tLS0tLS0tJyArIChpICsgMSkgKyAnOuiwg+ivlee7k+adny0tLS0tLS0tLS0nKTtcXG4gICAgfSxcXG4gICAganNvbkxpc3Q6IGZ1bmN0aW9uKGFyciwgan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ICAgICAgICAgdmFyIGNvbnRlbnQgPSBldmFsKHJ1bGUuY29udGVudCk7XFxuICAgICAgICAgICAgdmFyIGltZyA9IGV2YWwocnVsZS5pbWcpICsgcnVsZS5yZWY7XFxuICAgICAgICAgICAgdmFyIGhyZWYgPSBldmFsKHJ1bGUudXJsKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gcnVsZS5pbXQgPyBocmVmICsgXFxcIiNpbW1lcnNpdmVUaGVtZSNcXFwiIDogaHJlZjtcXG4gICAgICAgICAgICB2YXIgbGF6eSA9IHJ1bGUubGF6eSA/IHJ1bGUubGF6eSA6IFxcXCJcXFwiO1xcblxcbiAgICAgICAgICAgIHZhciBkZCA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgIHVybDogKGVtcHR5ID8gXFxcImhpa2VyOi8vZW1wdHkjI1xcXCIgOiAnJykgKyB1cmwsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgICAgIHZhciByeCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIGltZyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICB1cmxcXG4gICA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AgICAgICAgICAgdmFyIGltZyA9IHRoaXMuaW1nSGFuZGxlKGl0ZW0sIHJ1bGUpO1xcbiAgICAgICAgICAgIHZhciB1cmwgPSB0aGlzLnVybEhhbmRsZShpdGVtLCBydWxlKTtcXG4gICAgICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcblxcbiAgICAgICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBpbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHRoaXMuZGVidWdsb2coaSwgaXRlbSwgcnVsZSwgcngpO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB2YXIgbGF6eSA9IHJ1bGUubGF6eSA/IHJ1bGUubGF6eSA6IFxcXCJcXFwiO1xcbiAgICAgICAgICAgIHZhciBkZCA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjMS5yZXBsYWNlKFxcXCLlkKvkuK3lrZfno4Hpj4hcXFwiLFxcXCLlkKvkuK3lrZdcXFwiKSArIFxcXCJcXFxcdFxcXFx0XFxcIiArIGRlc2MsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGltZyxcXG4gICAgICAgICAgICAgICAgdXJsOiAoZW1wdHkgPyAnaGlrZXI6Ly9lbXB0eSMjJyA6ICcnKSArIHVybCArICcjbm9IaXN0b3J5I0BydWxlPWpzOiQucmVxdWlyZShcXFwiZWpcXFwiKScsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfjgJDot7PpobXjgJEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0cnVlX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgnJywgJzHliLA4MeS5i+mXtOeahOeahOmhteeggScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5wdXQoKHRydWVfdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyc2VJbnQoaW5wdXQpID4gMSAmJiBwYXJzZUludChpbnB1dCkgPCA4MSAmJiBwYXJzZUludChpbnB1dCkgJSAxID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganVtcHUgPSB0cnVlX3VybC5yZXBsYWNlKC8oXFxcXD9wYWdlPVxcXFxkK3xcXFxcJnBhZ2U9XFxcXGQrfCQpLywgKG1hdGNoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaC5zdGFydHNXaXRoKCc/cGFnZT0nKSB8fCBtYXRjaC5zdGFydHNXaXRoKCcmcGFnZT0nKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoLmNoYXJBdCgwKSArICdwYWdlPScgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAodHJ1ZV91cmwuaW5jbHVkZXMoJz8nKSA/ICcmcGFnZT0nIDogJz9wYWdlPScpICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGp1bXB1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneWlfZmlyc3RwYWdlJywganVtcHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L2g5bey57uP56m/6LaK5Yiw5LqGJyArIGlucHV0ICsgJ+mhtSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ivt+i+k+WFpeato+ehrueahOmhteeggVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHJ1ZV91cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnVlX3VybClcXG4gICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGlmIChsYXp5ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGRkW1xcXCJ1cmxcXFwiXSA9IHVybCArIG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biAgICAgICAgICAgICAgICBkZWxldGVJdGVtKFxcXCJwYWdlbGluZVxcXCIpO1xcbiAgICAgICAgICAgICAgICB2YXIgaWQgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgdmFyIGNscyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS50aXRsZSk7XFxuICAgICAgICAgICAgICAgIHZhciBkZXNjID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuZGVzYyk7XFxuICAgICAgICAgICAgICAgIHZhciBpbWcgPSB0aGlzLmltZ0hhbmRsZShpdGVtLCBydWxlKTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMudXJsSGFuZGxlKGl0ZW0sIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcblxcbiAgICAgICAgICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByeCA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGVidWdsb2coaSwgaXRlbSwgcnVsZSwgcngpO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBcXFwibGFzdGlkX1xcXCIgKyBwYWdlO1xcbiAgICAgICAgICAgICAgICAgICAgY2xzID0gXFxcImxhc3RtYXJrXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogKGVtcHR5ID8gXFxcImhpa2VyOi8vZW1wdHkjI1xcXCIgOiAnJykgKyB1cmwgKyAnP3BhZ2U9ZnlwYWdlI25vSGlzdG9yeSNAcnVsZT1qczokLnJlcXVpcmUoXFxcInlqXFxcIiknLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6IGNscyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfjgJDot7PpobXjgJEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0cnVlX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgnJywgJzHliLAzMeS5i+mXtOeahOeahOmhteeggScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5wdXQoKHRydWVfdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyc2VJbnQoaW5wdXQpID4gMSAmJiBwYXJzZUludChpbnB1dCkgPCA4MSAmJiBwYXJzZUludChpbnB1dCkgJSAxID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganVtcHUgPSB0cnVlX3VybC5yZXBsYWNlKC8oXFxcXD9wYWdlPVxcXFxkK3xcXFxcJnBhZ2U9XFxcXGQrfCQpLywgKG1hdGNoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaC5zdGFydHNXaXRoKCc/cGFnZT0nKSB8fCBtYXRjaC5zdGFydHNXaXRoKCcmcGFnZT0nKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoLmNoYXJBdCgwKSArICdwYWdlPScgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAodHJ1ZV91cmwuaW5jbHVkZXMoJz8nKSA/ICcmcGFnZT0nIDogJz9wYWdlPScpICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGp1bXB1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneWlfZmlyc3RwYWdlJywganVtcHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L2g5bey57uP56m/6LaK5Yiw5LqGJyArIGlucHV0ICsgJ+mhtSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ivt+i+k+WFpeato+ehrueahOmhteeggVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHJ1ZV91cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnVlX3VybClcXG4gICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxICYmIHNob3cpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcInBhZ2VsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHNtYWxsPuWKoOi9veS4rS4uLjwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwicGFnZW51bVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcInBhZ2VudW1cXFwiLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7liLDlupXkuoY8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBcXFwibGFzdFxcXCIsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuLypcXG4gICAgICAgIGlmIChsaXN0Lmxlbmd0aCA9PSAwICYmIHBhZ2UgPT0gMSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Zm9udCBjb2xvcj1cXFwiZ3JleVxcXCI+PHNtYWxsPuaXoOWGheWuuTwvc21hbGw+PC9mb250PicsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge30sXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9Ki9cXG4gICAgICAgIGlmICh0aGlzLm5leHRQYWdlKCkpIHtcXG4gICAgICAgICAgICAvL2xvZygndCcpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCd5aV9pc25leHQnLCAndCcpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvL2xvZygnZicpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCd5aV9pc25leHQnLCAnZicpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGF1dG8pIHtcXG4gICAgICAgICAgICAvL2NyZWF0ZU5leHRQYWdlKCk7XFxuICAgICAgICAgICAgYXV0b1BhZ2UoKTtcXG4gICAgICAgIH1cXG4gICAgfSxcXG59O1xcblxcbnZhciBleHRNZXRob2QgPSB7XFxuICAgIFRvUGFyYW1zOiBmdW5jdGlvbigpIHtcXG4gICAgICAgIHZhciBqc29uID0gYXJndW1lbnRzWzBdO1xcbiAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKGpzb24pXFxuICAgICAgICAgICAgLm1hcCgoa2V5KSA9PiBrZXkgKyBcXFwiPVxcXCIgKyBqc29uW2tleV0pXFxuICAgICAgICAgICAgLmpvaW4oXFxcIiZcXFwiKTtcXG4gICAgfSxcXG4gICAgdXJsUGFyc2U6IGZ1bmN0aW9uKHUpIHtcXG4gICAgICAgIHZhciBkaWN0ID0ge307XFxuICAgICAgICBkaWN0LlNvdXJjZSA9IHU7XFxuICAgICAgICBsZXQgcGFyYW1zID0gKHVybCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBxdWVyeVBhcmFtcyA9IHt9O1xcbiAgICAgICAgICAgIGxldCByZWcgPSAvKFtePz0mXSspPShbXj89Jl0rKS9nO1xcbiAgICAgICAgICAgIHVybC5yZXBsYWNlKHJlZywgZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgIHF1Z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xlbmd0aCAmJlxcbiAgICAgICAgICAgIG9rKHgpLmV2ZXJ5KChrZXkpID0+IHRoaXMuaXNFcXVhbCh4W2tleV0sIHlba2V5XSkpIDogeCA9PT0geTtcXG4gICAgfSxcXG4gICAgZmluZERpZmZlcmVudEluZGV4OiBmdW5jdGlvbihzdHIxLCBzdHIyKSB7XFxuICAgICAgICBjb25zdCBkaWZmQ2hhcnMgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc3RyMi5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGlmIChzdHIxW2ldICE9PSBzdHIyW2ldKSB7XFxuICAgICAgICAgICAgICAgIGRpZmZDaGFycy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGluZGV4OiBpLFxcbiAgICAgICAgICAgICAgICAgICAgczE6IHN0cjFbaV0sXFxuICAgICAgICAgICAgICAgICAgICBzMjogc3RyMltpXSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGRpZmZDaGFycztcXG4gICAgfSxcXG4gICAgcmVwbGFjZUNoYXJBdDogZnVuY3Rpb24oc3RyLCBpbmRleCwgcmVwbGFjZW1lbnQpIHtcXG4gICAgICAgIGlmIChpbmRleCA8IDAgfHwgaW5kZXggPj0gc3RyLmxlbmd0aCkge1xcbiAgICAgICAgICAgIHJldHVybiBzdHI7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhpbmRleClcXG4gICAgICAgIGNvbnN0IGFyciA9IHN0ci5zcGxpdChcXFwiXFxcIik7XFxuICAgICAgICBhcnJbaW5kZXhdID0gcmVwbGFjZW1lbnQ7XFxuICAgICAgICByZXR1cm4gYXJyLmpvaW4oXFxcIlxcXCIpO1xcbiAgICB9LFxcbiAgICBnZXRPYmplY3RLZXlzRGlmZjogZnVuY3Rpb24ob2JqMSwgb2JqMikge1xcbiAgICAgICAgY29uc3QgZGlmZmVyZW50S2V5cyA9IFtdO1xcbiAgICAgICAgZm9yIChsZXQga2V5IGluIG9iajEpIHtcXG4gICAgICAgICAgICBpZiAoIW9iajIuaGFzT3duUHJvcGVydHkoa2V5KSB8fCBvYmoxW2tleV0gIT09IG9iajJba2V5XSkge1xcbiAgICAgICAgICAgICAgICBkaWZmZXJlbnRLZXlzLnB1c2goa2V5KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gb2JqMikge1xcbiAgICAgICAgICAgIGlmICghb2JqMS5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XFxuICAgICAgICAgICAgICAgIGRpZmZlcmVudEtleXMucHVzaChrZXkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBkaWZmZXJlbnRLZXlzO1xcbiAgICB9LFxcbiAgICBnZXROZXh0VXJsOiBmdW5jdGlvbihzb3VyY2UsIHRhcmdldCwgcGFyYW1zKSB7XFxuICAgICAgICB2YXIgdTEgPSB0aGlzLnVybFBhcnNlKHNvdXJjZSk7XFxuICAgICAgICB2YXIgdTIgPSB0aGlzLnVybFBhcnNlKHRhcmdldCk7XFxuICAgICAgICB2YXIgcGEgPSB1bmRlZmluZWQ7XFxuICAgICAgICBpZiAodHlwZW9mIHBhcmFtcyA9PSBcXFwib2JqZWN0XFxcIikge1xcbiAgICAgICAgICAgIHBhID0gcGFyYW1zLmhhc093blByb3BlcnR5KFxcXCLnibnlvoFcXFwiKSA/IHBhcmFtcy7nibnlvoEgOiB1bmRlZmluZWQ7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgbmV4dHVybCA9IHNvdXJjZTtcXG4gICAgICAgIHZhciBjYSA9IE9iamVjdC5rZXlzKHUyLlBhcmFtcykubGVuZ3RoID09IDAgPyBcXFwiXFxcIiA6IFxcXCI/XFxcIjtcXG4gICAgICAgIGlmIChwYSAhPSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICB2YXIgcnMgPSBTdHJpbmcodTIuUGF0aCkucmVwbGFjZShuZXcgUmVnRXhwKHBhKSwgXFxcIiQxZnlwYWdlXFxcIik7XFxuICAgICAgICAgICAgbmV4dHVybCA9IHUyLkhvc3RzICsgcnMgKyBjYSArIHRoaXMuVG9QYXJhbXModTIuUGFyYW1zKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNFcXVhbCh1MS5QYXJhbXMsIHUyLlBhcmFtcykpIHtcXG4gICAgICAgICAgICAgICAgaWYgKGR0X2RlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2codTEuUGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICBsb2codTIuUGF0aCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGRmID0gdGhpcy5maW5kRGlmZmVyZW50SW5kZXgoU3RyaW5nKHUxLlBhdGgpLCBTdHJpbmcodTIuUGF0aCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoZHRfZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhkZik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGRmLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSBkZlswXS5pbmRleDtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBmID0gZGYuZmlsdGVyKCh4KSA9PiAvXFxcXGQrLy50ZXN0KHguczIpKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZSA9IGZbMF0uaW5kZXg7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGVxID0gdGhpcy5yZXBsYWNlQ2hhckF0KFN0cmluZyh1Mi5QYXRoKSwgcmUsIFxcXCJmeXBhZ2VcXFwiKTtcXG4gICAgICAgICAgICAgICAgbmV4dHVybCA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jsgd3YpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIFZlcnNpb24vNC4wIENocm9tZS84OS4wLjQzODkuNzIgTVFRQnJvd3Nlci82LjIgVEJTLzA0NjI3OSBNb2JpbGUgU2FmYXJpLzUzNy4zNlxcXCIsIC8vUENfVUEsICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgc2hvd1Byb2dyZXNzOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2soKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IG5vZGVzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnI3RhZ3MnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvID0gZmJhLmdldENvb2tpZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgdWEgPSBmYmEuZ2V0VWEoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coJ2NvOjo6Ojo6JyArIHVhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGZiYS5sb2coJ2NvOjo6Ojo6JyArIGNvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWxDb250ZW50ID0gZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmlubmVySFRNTDtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC/msLjkuYXln5/lkI0vLnRlc3QoaHRtbENvbnRlbnQpKSB7XFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZSgkJCQoKS5sYXp5UnVsZSgoY28pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvQXBvbGxvL0Nvb2tpZS9qYXZkYl9jb29raWUudHh0JywgY28pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCflt7Lojrflj5Zjb29raWXvvIzliIfmjaLliLDpppbpobUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgY28pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2ssIDUwMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2soKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIE1ZX1VSTClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBzZXRSZXN1bHQoZCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxufVxcbnRyeSB7XFxuICAgIC8v57yT5a2Y5LiL5LiA6aG1XFxuICAgIGxldCBuZXh0VXJsID0gcGQoaHRtbCwgXFxcImE6Y29udGFpbnMo5LiL5LiAKSYmaHJlZlxcXCIpO1xcbiAgICBwdXRNeVZhcihcXFwibmV4dFBhZ2VcXFwiLCBuZXh0VXJsIHx8IFxcXCLmsqHmnInkuIvkuIDpobXlk6bwn5ivXFxcIik7XFxuICAgIC8vbG9nKFxcXCLkuIvkuIDpobXvvJpcXFwiICsgbmV4dFVybClcXG59IGNhdGNoIChlKSB7XFxuICAgIC8vY2xlYXJNeVZhcihcXFwibmV4dFBhZ2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dCcpO1xcbiAgICAgICAgICAgICAgICBpZiAoIXN0cikge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX2FjdG9yLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gSlNPTi5wYXJzZShzdHIpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QuaW5kZXhPZihuYW1lKSA9PSAnLTEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGlzdC5wdXNoKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudW5zaGlmdChuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX2FjdG9yLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdC5pbmRleE9mKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3Quc3BsaWNlKGluZGV4LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX2FjdG9yLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgIC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HVkZXMoJz9wYWdlJykgPyB1cmwgOiAodXJsLmluY2x1ZGVzKCc/JykgPyB1cmwgKyBcXFwiJnBhZ2U9MVxcXCIgOiB1cmwgKyBcXFwiP3BhZ2U9MVxcXCIpXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0uaW5jbHVkZXMoXFxcImlzLWxpbmtcXFwiKSA/ICfigJzigJzigJ3igJ0nICsgdGl0bGUuZm9udGNvbG9yKCdjeWFuJykgKyBcXFwi4pmI77iPXFxcIiA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCArICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwidXJsXFxcIiwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICdiYWNrZ3JvdW5kQ29sb3InOiAnIzY2NjY2NidcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgaWYgKGluZGV4ID09IDQpIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSBjYXRjaCB7fVxcbiAgICAvL+WIhuWJslxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgfSlcXG59XFxuXFxuaWYgKCF0cnVlX3VybC5pbmNsdWRlcyhcXFwic2VhcmNoXFxcIikpIHtcXG4gICAgdmFyIHBhZ2VzID0gZ2V0SXRlbSgncGFnZXMnKTtcXG59XFxudmFyIHBhZ2U7XFxudHJ5IHtcXG4gICAgcGFnZSA9IHRydWVfdXJsLm1hdGNoKC9wYWdlPShcXFxcZCspLylbMV1cXG59IGNhdGNoIHtcXG4gICAgcGFnZSA9PSAxXFxufVxcbnRyeSB7XFxuICAgIGlmIChwYWdlcyA+IDEgJiYgcGFnZXMgPCAzNykge1xcbiAgICAgICAgZm9yICh2YXIgaiA9IDE7IGogPD0gcGFnZXM7IGorKykge1xcbiAgICAgICAgICAgIHZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9wYWdlPVxcXFxkKy8sICdwYWdlPScgKyBqKTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaiA9PSBwYWdlID8gJ+KAnOKAnOKAneKAnScgKyAoaiArICfpobUnKS5mb250Y29sb3IoJ3JlZCcpIDogKGogKyAn6aG1JyksXFxuICAgICAgICAgICAgICAgIHVybDogJCh1cmwrXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGopID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJ1cmxcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgaiksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIGlmIChwYWdlcyA+IDM3KSB7XFxuICAgICAgICB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gICAgICAgICAgIHRpdGxlOiBwZGZoKHgsICcudmlkZW8tdGl0bGUmJlRleHQnKSxcXG4gICAgICAgICAgICBkZXNjOiBwZGZoKHgsICcubWV0YSYmVGV4dCcpLFxcbiAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9laj91cmw9JyArIHBkKHgsICdhJiZocmVmJykgKyAnI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBpbWcuaW5jbHVkZXMoXFxcIi90aHVtYnMvXFxcIikgPyAnbW92aWVfMycgOiAnbW92aWVfMicsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBwZGZoKHgsICcudmlkZW8tdGl0bGUmJlRleHQnKSxcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn44CQ6Lez6aG144CRJyxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0cnVlX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgnJywgJzHliLA4MeS5i+mXtOeahOeahOmhteeggScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5wdXQoKHRydWVfdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGlucHV0KSA+IDEgJiYgcGFyc2VJbnQoaW5wdXQpIDwgODEgJiYgcGFyc2VJbnQoaW5wdXQpICUgMSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBqdW1wdSA9IHRydWVfdXJsLnJlcGxhY2UoLyhcXFxcP3BhZ2U9XFxcXGQrfFxcXFwmcGFnZT1cXFxcZCt8JCkvLCAobWF0Y2gpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaC5zdGFydHNXaXRoKCc/cGFnZT0nKSB8fCBtYXRjaC5zdGFydHNXaXRoKCcmcGFnZT0nKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaC5jaGFyQXQoMCkgKyAncGFnZT0nICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAodHJ1ZV91cmwuaW5jbHVkZXMoJz8nKSA/ICcmcGFnZT0nIDogJz9wYWdlPScpICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwidXJsXFxcIiwganVtcHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kvaDlt7Lnu4/nqb/otorliLDkuoYnICsgaW5wdXQgKyAn6aG1J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7fovpPlhaXmraPnoa7nmoTpobXnoIFcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHJ1ZV91cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnVlX3VybClcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSlcXG59IGVsc2Uge1xcbiAgICAvKlxcbiAgICAgIGZ1bmN0aW9uIGdldEJpZ1RleHQodGV4dCwgY291bnQpIHtcXG4gICAgICAgIGlmIChjb3VudCA+IDApIHtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHtcXG4gICAgICAgICAgICAgICAgdGV4dCA9IHRleHQuYmlnKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IC1jb3VudDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIHRleHQgPSB0ZXh0LnNtYWxsKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRleHQ7XFxuICAgICAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIrZ2V0QmlnVGV4dChcXFwiPGJpZz48Zm9udCBjb2xvcj0nI0ZFQkQ2Ric+5bey57uP6LaF6L+H5LqG5pyA57uI6aG156CBPC9mb250PjwvYmlnPjxicj48c21hbGw+PGZvbnQgY29sb3I9JyNGQjZDNzMnPuS4jeS/oeeCueWHu+aJk+W8gOe9kemhtTwvZm9udD48L3NtYWxsPlxcXCIsIDUpLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodHJ1ZV91cmwpID0+IHtcXG4gICAgcmV0dXJuIHRydWVfdXJsXFxuICAgICAgICAgfSx0cnVlX3VybCks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AgICAgZnVuY3Rpb24gY2hlY2soKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IG5vZGVzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnI3RhZ3MnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvID0gZmJhLmdldENvb2tpZSh1KTtcXG4vL3ZhciB1YSA9IGZiYS5nZXRVYSgpXFxuLy9mYmEubG9nKCdjbzo6Ojo6OicgKyB1YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZygnY286Ojo6OjonICsgY28pO1xcbnZhciBodG1sQ29udGVudCA9IGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5pbm5lckhUTUw7XFxuXFxuaWYoL+awuOS5heWfn+WQjS8udGVzdChodG1sQ29udGVudCkpIHtcXG4gIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLnBhcnNlTGF6eVJ1bGUoJCQkKCkubGF6eVJ1bGUoKGNvKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL0Fwb2xsby9Db29raWUvamF2ZGJfY29va2llLnR4dCcsIGNvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn5bey6I635Y+WY29va2ll77yM5YiH5o2i5Yiw6aaW6aG1Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGNvKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGNoZWNrLCA1MDApO1xcbiAgICAgICAgICAgICAgICA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NjOiAn4oCc4oCc4oCd4oCdJyt0cmFuc2xhdGVzLmZvbnRjb2xvcihcXFwicmVkXFxcIiksXFxufSlcXG59ZWxzZXtcXG51cGRhdGVJdGVtKFxcXCJ0cmFuc2Rlc2NcXFwiLHtcXG4gICAgICAgICAgZGVzYzogJycsXFxufSlcXG59ICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiICAgICAgXFxuLyogICAgICAgXFxuICAgICAgICAgIHZhciB0cmFuc2xhdGVzID0gJC5yZXF1aXJlKFxcXCJ0cmFuc1xcXCIpLnRyYW5zbGF0ZShkZXNjdCkgICBcXG4gICAgICAgICAgcmV0dXJuIFxcXCJjb25maXJtOi8vXFxcIiArIHRyYW5zbGF0ZXMgKyBcXFwiLmpzOidoaWtlcjovL2VtcHR5JyBcXFwiICAgKi9cXG4gICAgICAgICAgICAgICAgfSxkZXNjdCksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgIGlkOiAndHJhbnNkZXNjJyxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn572R6aG1JywganM6ICQudG9TdHJpbmcoKCk9PnsgXFxuICAgICAgICByZXR1cm4gXFxcIndlYjovL1xcXCIgKyBNWV9VUkxcXG4gICAgICAgICAgICAgICAgICAgICAgIH0pfSx7dGl0bGU6ICflpI3liLYnLCBqczogJC50b1N0cmluZygodGl0bGUpPT57IFxcbiAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIHRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgfSx0aXRsZSl9LHt0aXRsZTogJ+eZvuW6pue/u+ivkScsIGpzOiAkLnRvU3RyaW5nKCh0aXRsZSk9PnsgXFxuICAgICAgICByZXR1cm4gXFxcIng1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IGQucHVzaCh7XFxuICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICB1cmw6IFxcXCJjb3B5Oi8vXFxcIiArIGltZyxcXG4gICAgICAgICAgICAgY29sX3R5cGU6ICdwaWNfMV9mdWxsJyxcXG4gICAgICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZSxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAnRE1NJywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PntcXG4gICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vcGljcy5kbW0uY28uanAvbW9uby9tb3ZpZS9hZHVsdC9cXFwiICsg6K+G5Yir56CBLnJlcGxhY2UoLy18Xy8sJycpICsgJy8nICsg6K+G5Yir56CBLnJlcGxhY2UoLy18Xy8sJycpICsgXFxcInBsLmpwZ1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKX0se3RpdGxlOiAn5Zu+54mH6aKE6KeIJywganM6ICQudG9TdHJpbmcoKHBpY3MpPT57ICAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwaWNzICE9XFxcIlxcXCIgPyBcXFwicGljczovL1xcXCIrcGljcy5qb2luKFxcXCImJlxcXCIpIDogXFxcInRvYXN0Oi8v5rKh5pyJ5Zu+54mH6aKE6KeI5ZOm8J+YkFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgIH0scGljcyl9LHt0aXRsZTogJ+aJk+W8gOWbvueJhycsIGpzOiAkLnRvU3RyaW5nKChpbWcpPT57IFxcbiAgICAgICAgcmV0dXJuIGltZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgfSxpbWcpfSx7dGl0bGU6ICflpI3liLbpobXpnaInLCBqczogJC50b1N0cmluZygoaW1nLHRpdGxlLHBhZ2VVcmwpPT57IFxcbiAgICAgICAgcmV0dXJuIF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XG4gICAgICAgICAgICAgICAgdmFyIHBpY251bSA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgKHBpY251bSArIGxpc3QubGVuZ3RoICtcXFwiIFBcXFwiKS5mb250Y29sb3IoXFxcIiMxRTkwRkZcXFwiKS5ib2xkKCkuYmlnKCksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiICsgJChcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAubGF6eVJ1bGUoKGxpc3QpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcInBpY2xpc3RcXFwiLCBcXFwi5pS26LW3XFxcIikgPT0gXFxcIuaUtui1t1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncGljbnVtJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIFxcXCLjgJDmlLbotbflm77niYfjgJFcXFwiLmZvbnRjb2xvcihcXFwiI0ZGMDBGRlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiICsgJChcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmxhenlSdWxlKChsaXN0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBsaXN0Lmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKCdwcmV2aWV3cGljJyArIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oJ25vcGljbGlzdCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicGljbGlzdFxcXCIsIFxcXCLmlLbotbdcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGxpc3QpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcIm5vcGljbGlzdFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IGxpc3QubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3BpY251bScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGRmaChsaXN0W2ldLCBcXFwiYSYmaHJlZlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInBpY18xX2Z1bGxcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdwcmV2aWV3cGljJyArIGlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInBpY2xpc3RcXFwiLCBcXFwi5bGV5byAXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gbGlzdC5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oJ3ByZXZpZXdwaWMnICsgaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKCdub3BpY2xpc3QnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJwaWNsaXN0XFxcIiwgXFxcIuaUtui1t1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QpLCAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIHt9XFxuXFxudmFyIGxpc3RWaWRlb3MgPSBKU09OLnBhcnNlKGZldGNoUEMoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX3ZpZGVvLnR4dCcpIHx8ICdbXScpO1xcbnZhciBzdHIgPSB0aXRsZSArICdAQCcgKyBpbWcgKyAnQEAnICsgcGFnZVVybDtcXG5pZiAobGlzdFZpZGVvcy5pbmRleE9mKHN0cikgPT0gJy0xJykge1xcbiAgICB2YXIgdCA9ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj0jRkZFMTAwPvCfkpvmnKrmlLbol4/wn5KbJ1xcbn0gZWxzZSB7XFxuICAgIHZhciB0ID0gJ+KAnOKAnOKAneKAnTxiPjxmb250IGNvbG9yPSNGRjAwRkY+8J+SluW3suaUtuiXj/CfkpYnXFxufVxcblxcbmxldCBpbmZvID0gcGRmYShodG1sLCAnLnBhbmVsJiYucGFuZWwtYmxvY2s6bWF0Y2hlcyjnlaromZ985pel5pyffOaZgumVtyknKTtcXG5pbmZvLmZvckVhY2goKGxpc3QsIGluZGV4KSA9PiB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogaW5kZXggPT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ovL2VtcHR5JyxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICBleHRyYTogaW5kZXggPT0gMCA/IHtcXG4gICAgICAgICAgICBwYWdlVGl0bGU6IFxcXCLnlarlj7fns7vliJfvvJpcXFwiICsgcGRmaChodG1sLCAnLnZpZGVvLWRldGFpbCYmLmZpcnN0LWJsb2NrJiZhJiZUZXh0JyksXFxuICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+iwt+atjOaQnOe0oicsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS9zZWFyY2g/cT1cXFwiICsg6K+G5Yir56CBO1xcbiAgICAgICAgICAgICAgICB9LCDor4bliKvnoIEpXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+ejgeWKm+aQnOagh+mimCcsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0aXRsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2Uvc291P3J1bGU956OB5Yqb5ZCbLueugCZwPWZ5cGFnZSZzZWFyY2hUZXJtcz1cXFwiICsgdGl0bGVcXG4gICAgICAgICAgICAgICAgfSwgdGl0bGUpXFxuICAgICAgICAgICAgfV1cXG4gICAgICAgIH0gOiAnJ1xcbiAgICB9KTtcXG4gICAgaWYgKGluZGV4ID09IDApIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHQsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBzdHIgPSBmZXRjaFBDKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl92aWRlby50eHQnKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFzdHIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl92aWRlby50eHQnLCBKU09OLnN0cmluZ2lmeShsaXN0KSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IEpTT04ucGFyc2Uoc3RyKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0LmluZGV4T2YobmFtZSkgPT0gJy0xJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgLy8gbGlzdC5wdXNoKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudW5zaGlmdChuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX3ZpZGVvLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBsaXN0LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgIGxpc3Quc3BsaWNlKGluZGV4LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl92aWRlby50eHQnLCBKU09OLnN0cmluZ2lmeShsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICA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L21pZGRsZT48L2I+JyxcXG4gICAgICAgIHVybDogcGFyc2VEb20oYXJ0c1tpXSwgJ2EmJmhyZWYnKSArICc/cGFnZT1meXBhZ2VAcnVsZT1qczokLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS95alxcXCIpJywvL+mTvuaOpVxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJywvL+e7hOS7tuagt+W8j1xcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBwYWdlVGl0bGU6IHBhcnNlRG9tRm9ySHRtbChhcnRzW2ldLCAnVGV4dCcpXFxuICAgICAgICB9XFxufSlcXG59XFxuZC5wdXNoKHtcXG5jb2xfdHlwZTpcXFwiYmxhbmtfYmxvY2tcXFwiXFxufSlcXG59XFxuXFxuLy/pooTop4jop4bpopFcXG4gICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08bWlkZGxlPjxmb250IGNvbG9yPSMxM0I2NkE+8J+TuumgkOimveKRoDwvZm9udD48L21pZGRsZT4nLFxcbiAgICAgICAgdXJsOiBNWV9VUkwgKyAkKCcnKS5sYXp5UnVsZSgo6K+G5Yir56CBKSA9PiB7XFxuICAgICAgICAgICAgIHRyeXtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSBwZGZoKGh0bWwsXFxcIi5tZXNzYWdlLWJvZHkmJnNvdXJjZSYmc3JjXFxcIilcXG4gICAgICAgICAgICAgICAgICAgaWYoICF1cmwuc3RhcnRzV2l0aChcXFwiaHR0cFxcXCIpJiZ1cmwhPT1cXFwiXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHBzOlxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYodXJsPT1cXFwiXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKS5pyJ6aCQ6Ka95ZKvXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmxcXG4gICAgICAgICAgICAgfWNhdGNoe3JldHVybiBcXFwidG9hc3Q6Ly/mspLmnInpoJDopr3lkq9cXFwifVxcbiAgICAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKSxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLCAgICAgICAgXFxuICAgICAgICAgICAgICAgICB9KVxcbiAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxtaWRkbGU+PGZvbnQgY29sb3I9IzEzQjY2QT7wn5O66aCQ6Ka94pGhPC9mb250PjwvbWlkZGxlPicsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIiArICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNlYXJjaCA9IFxcXCJodHRwczovL2phdnN1YnRpdGxlZC5jb20vemgvc2VhcmNoP2tleXdvcmRzPVxcXCIgKyDor4bliKvnoIFcXG4gICAgICAgICAgICAgICAgICAgIHZhciBjb2RldXJsID0gXFxcImh0dHBzOi8vamF2c3VidGl0bGVkLmNvbS9cXFwiICsgcGRmaChyZXF1ZXN0KHNlYXJjaCksXFxcImJvZHkmJi52aWRlb2JveCYmYSYmaHJlZlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGxheWxpc3QgPSBmZXRjaChjb2RldXJsKS5tYXRjaCgvaHR0cHM/OlxcXFwvXFxcXC9cXFxcUytcXFxcLm0zdTgvKVswXVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXloZCA9IGZldGNoKHBsYXlsaXN0KS5tYXRjaCgvW15cXFwiXFxcXG5dK1xcXF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gb3JIdG1sKHZpZGVvLCAnLnRpbWUmJlRleHQnKSxcXG4gICAgICAgIHBpY191cmw6ICdodHRwczovL2ltZy52aW51YS5jbi9pbWFnZXMvT2NxcGoucG5nJyxcXG4gICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+afmuWtkCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuQXBwSW50ZW50KCdjb20ueXV6dXl1enUuZG93bmxvYWQnLCAnY29tLmU0YS5ydW50aW1lLmFuZHJvaWQubWFpbkFjdGl2aXR5Jywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50RGF0YTogdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfSx7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwnZCP8J2fkPCdkI8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BlbkFwcEludGVudCgnY29tLmhzZS5wMnBkb3dubG9hZCcsICdjb20uc2F1c2FnZS5kb3dubG9hZC51aS52MS5hY3Rpdml0eS5NYWluQWN0aXZpdHknLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlbnREYXRhOiB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfpl6rlrZjkupEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BlbkFwcEludGVudCgnY29tLnNoYW54aWF6YWlkb3duJywgJ2NvbS5lNGEucnVudGltZS5hbmRyb2lkLm1haW5BY3Rpdml0eScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudERhdGE6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+S6jOmptCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuQXBwSW50ZW50KCdjb20ucWlrY2xvdWQucWlrJywgJ2NvbS5lNGEucnVudGltZS5hbmRyb2lkLm1haW5BY3Rpdml0eScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudERhdGE6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+aCn+epuicsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuQXBwSW50ZW50KCdjb20ueWZvby53a0Rvd25sb2FkZXInLCAnY29tLnlmb28ud2tEb3dubG9hZGVyLk1haW5BY3Rpdml0eScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudERhdGE6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0se1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn6L+F6Zu3JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wZW5BcHBJbnRlbnQoJ2NvbS54dW5sZWkuZG93bmxvYWRwcm92aWRlci5saXRlJywgJ2NvbS54dW5sZWkuZG93bmxvYWRwcm92aWRlci5sYXVuY2guTGF1bmNoQWN0aXZpdHknLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlbnREYXRhOiB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICB9LHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ1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Jldmlldy1pdGVtOmhhcygucmV2aWV3LXRpdGxlKVxcXCIpXFxuICAgICAgIGxpc3QuZm9yRWFjaChpdGVtPT57XFxuICAgICAgICAgdmFyIGRlc2MgPSAnPG1pZGRsZT48Zm9udCBjb2xvcj0jRkY4QzAwPicgKyBwZGZoKGl0ZW0sXFxcIi5yZXZpZXctdGl0bGUtLS5saWtlcy0tLnJlcG9ydCYmVGV4dFxcXCIpICsgJzwvZm9udD48L21pZGRsZT4nOyAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGRlc2MgKyAnPGJyPicgKyAnPHNtYWxsPjxmb250IGNvbG9yPSNmZjY4Nzc+XFxcXHRcXFxcdFxcXFx0XFxcXHRcXFxcdFxcXFx0XFxcXHRcXFxcdCcgKyBwZGZoKGl0ZW0sXFxcIi5jb250ZW50JiZUZXh0XFxcIikgKyAnPC9mb250Pjwvc21hbGw+JywgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7bGluZVZpc2libGU6ZmFsc2V9XFxuICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNtYWxsPjxmb250IGNvbG9yPSMxM0I2NkE+5pu05aSa55+t6KmV5Y+v5oiQ5Li6VklQ5oiW6Iez5a6Y5pa5QXBw5Lit5p+l55yLPC9mb250Pjwvc21hbGw+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgo6K+G5Yir56CBKSA9PiB7ICAgICAgICAgICAgICAgXFxuICAgICAgICAgb3BlbkFwcEludGVudCgneHh4L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vbUZvckh0bWwodmlkZW8sICdhJiZ0aXRsZScpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICB0aXRsZSxcXG4gICAgICAgIC8vZGVzYzogcGFyc2VEb21Gb3JIdG1sKHZpZGVvLCAnLnZpZGVvLW51bWJlciYmVGV4dCcpLFxcbiAgICAgICAgaW1nOiBwYXJzZURvbSh2aWRlbywgJ2ltZyYmc3JjJykucmVwbGFjZShcXFwidGh1bWJzXFxcIixcXFwiY292ZXJzXFxcIikgKyBcXFwiQFJlZmVyZXI9XFxcIixcXG4gICAgICAgIHVybDogcGFyc2VEb20odmlkZW8sICdhJiZocmVmJykgKyAnQHJ1bGU9anM6JC5yZXF1aXJlKFxcXCJlalxcXCIpJyxcXG4gICAgICAgIGNvbF90eXBlOiAnbW92aWVfMicsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHBhZ2VUaXRsZTogdGl0bGUsXFxuaW1nOiBwYXJzZURvbSh2aWRlbywgJ2ltZyYmc3JjJykucmVwbGFjZShcXFwidGh1bWJzXFxcIixcXFwiY292ZXJzXFxcIikgXFxuICAgICAgICB9XFxuICB9KTtcXG59KSAgIFxcbiAgICAgaWYgKGxpc3QubGVuZ3RoICUgMiAhPSAwKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLwn5evUmFuZG9t8J+Xr1xcXCIsXFxuaW1nOiAnaHR0cHM6Ly90aHVtYnNuYXAuY29tL2kvM3VxamMxcXEuZ2lmJyxcXG4gICAgICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9qYXZkYi5jb20vdi93S2I0bkBydWxlPWpzOiQucmVxdWlyZShcXFwiZWpcXFwiKScsICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfMlxcXCIsXFxuICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgIHBhZ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zXFxcIikgKyBcXFwiQFJlZmVyZXI9XFxcIixcXG4gICAgICAgIHVybDogcGFyc2VEb20odmlkZW8sICdhJiZocmVmJykgKyAnQHJ1bGU9anM6JC5yZXF1aXJlKFxcXCJlalxcXCIpJyxcXG4gICAgICAgIGNvbF90eXBlOiAnbW92aWVfMicsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHBhZ2VUaXRsZTogdGl0bGUsXFxuaW1nOiBwYXJzZURvbSh2aWRlbywgJ2ltZyYmc3JjJykucmVwbGFjZShcXFwidGh1bWJzXFxcIixcXFwiY292ZXJzXFxcIilcXG4gICAgICAgIH1cXG4gIH0pO1xcbn0pICAgXFxuICAgICBpZiAobGlzdC5sZW5ndGggJSAyICE9IDApIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIvCfl69SYW5kb23wn5evXFxcIixcXG5pbWc6ICdodHRwczovL3RodW1ic25hcC5jb20vaS9NVTVVYUI0WS5naWYnLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIiwgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJtb3ZpZV8yXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxufSBjYXRjaCAoZXJyKSB7XFxuICAvL2NvbnNvbGUubG9nKCfmsqHmnInmjqjojZDliJfooagnLCBlcnIpO1xcbn07XFxuXFxufWNhdGNoe1xcbnZhciDor4bliKvnoIEgPSBnZXRQYWdlVGl0bGUoKS5zcGxpdChcXFwiIFxcXCIpWzBdLnJlcGxhY2UoXFxcIkZDMlxcXCIsXFxcIkZDMi1QUFZcXFwiKTtcXG52YXIgaW1nID0gTVlfUEFSQU1TLmltZztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICB1cmw6IFxcXCJjb3B5Oi8vXFxc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biAgICAgICAgICAgIHVybDogbGFiZWwgPT0gXFxcIua8lOWToVxcXCI/J2hpa2VyOi8vcGFnZS95aic6J2hpa2VyOi8vcGFnZS9laicsXFxuICAgICAgICAgICAgY29sX3R5cGU6IGxhYmVsID09IFxcXCLmvJTlk6FcXFwiID8gJ2NhcmRfcGljXzMnIDogJ21vdmllXzInLFxcbiAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgIHVybDogbGlzdC5zcGxpdCgnQEAnKVsyXS5yZXBsYWNlKGdldE15VmFyKCd5b25naml1JyksTVlfSE9NRSksXFxuICAgICAgICAgICAgICBwYWdlVGl0bGU6IGxpc3Quc3BsaXQoJ0BAJylbMF0sXFxuICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgdGl0bGU6ICflj5bmtojmlLbol48nLFxcbiAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChsaXN0LCB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gSlNPTi5wYXJzZShmZXRjaFBDKHUpIHx8ICdbXScpO1xcbiAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YS5maWx0ZXIoeCA9PiB4ICE9IGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUodSwgSlNPTi5zdHJpbmdpZnkoZGF0YSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIHUpXFxuICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH0pO1xcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKRo+S4gOe6p+mhtemdoueZu+W9lVwiLFwicGF0aFwiOlwi55m75b2VXCIsXCJydWxlXCI6XCJcXG4vL2lmKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL0Fwb2xsby9Db29raWUvamF2ZGJfY29va2llLnR4dCcpKXtcXG5cXG5cXG5pZihodG1sLmluY2x1ZGVzKFxcXCLnmbvlh7pcXFwiKSl7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGJpZz48Zm9udCBjb2xvcj0jRkYwMEZGPui0puWPt+W3sueZu+W9lTwvZm9udD48L2JpZz4nLFxcbiAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgJ+WIh+aNouWIhuexu+WIt+aWsOmhtemdouWGheWuuScuZm9udGNvbG9yKCcjRkYwMEZGJykuYmlnKCksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIH0pO1xcbiAgICB9ZWxzZXtcXG5cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfngrnlh7vnmbvlvZXotKblj7cnLmZvbnRjb2xvcignI0ZGMDBGRicpLmJpZygpLFxcbiAgICAgICAgdXJsOiB0cnVlX3VybCArICQoJycpLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIHZhciBkID0gW107XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZScsXFxuICAgICAgICAgICAgICAgIHVybDogTVlfVVJMLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAnbGlzdCYmc2NyZWVuJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIk1vemlsbGEvNS4wIChMaW51eDsgQW5kcm9pZCAxMjsgU00tRzk3NTAgQnVpbGQvU1AxQS4yMTA4MTIuMDE2OyB3dikgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgVmVyc2lvbi80LjAgQ2hyb21lLzg5LjAuNDM4OS43MiBNUVFCcm93c2VyLzYuMiBUQlMvMDQ2Mjc5IE1vYmlsZSBTYWZhcmkvNTM3LjM2XFxcIiwvL1BDX1VBLCAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgIHNob3dQcm9ncmVzczogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrKCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xldCBub2RlcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJyN0YWdzJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbyA9IGZiYS5nZXRDb29raWUodSk7XFxuLy92YXIgdWEgPSBmYmEuZ2V0VWEoKVxcbi8vZmJhLmxvZygnY286Ojo6OjonICsgdWEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgIGZiYS5sb2coJ2NvOjo6Ojo6JyArIGNvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvLmluY2x1ZGVzKCdyZW1lbWJlcl9tZV90b2tlbicpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZSgkJCQoKS5sYXp5UnVsZSgoY28pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvQXBvbGxvL0Nvb2tpZS9qYXZkYl9jb29raWUudHh0JywgY28pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfotKblj7flt7LnmbvlvZUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgY28pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2ssIDUwMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2soKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIE1ZX1VSTClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBzZXRSZXN1bHQoZCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxuXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5pCc57SiXCIsXCJwYXRoXCI6XCJzZWFyY2hcIixcInJ1bGVcIjpcInZhciB0YWJzID0gW1xcXCLlvbHniYdcXFwiLCBcXFwi5ryU5ZGYXFxcIiwgXFxcIuWPr+aSrVxcXCIsIFxcXCLkuK3lrZdcXFwiLCBcXFwi56OB6ZO+XFxcIiwgXFxcIua4heWNlVxcXCJdXFxudmFyIGxpc3RzID0gW1xcXCJhbGxcXFwiLCBcXFwiYWN0b3JcXFwiLCBcXFwicGxheWFibGVcXFwiLCBcXFwiY25zdWJcXFwiLCBcXFwiZG93bmxvYWRcXFwiLCBcXFwibGlzdFxcXCJdXFxuYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2VcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgY2xlYXJNeVZhcihcXFwibGlzdHNcXFwiKTtcXG59KSk7XFxuc3RvcmFnZTAucHV0TXlWYXIoXFxcImxpc3RzXFxcIiwgbGlzdHMpO1xcbnZhciBsaXN0ID0gbGlzdHNbZ2V0TXlWYXIoXFxcIuWKqOaAgeaQnOe0olxcXCIsICcwJyldO1xcblxcbnRhYnMuZm9yRWFjaCgoZGF0YSwgaWQpID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBnZXRNeVZhcihcXFwi5Yqo5oCB5pCc57SiXFxcIiwgJzAnKSA9PSBpZCA/ICfigJzigJzigJ3igJ0nICsgZGF0YS5mb250Y29sb3IoXFxcIiNGRkZGRkZcXFwiKSA6IGRhdGEsXFxuICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKOe6v+i3rywgaWQsIGdldFJhbmdlQ29sb3JzKSA9PiB7XFxuICAgICAgICAgICAgdmFyIGxpc3RzID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImxpc3RzXFxcIik7XFxuICAgICAgICAgICAg57q/6LevLmZvckVhY2goKGRhdGEsIHhsaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaWQgPT0geGxpZCA/ICfigJzigJzigJ3igJ0nICsgZGF0YS5mb250Y29sb3IoXFxcIiNGRkZGRkZcXFwiKSA6IGRhdGEsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogaWQgPT0geGxpZCA/IGdldFJhbmdlQ29sb3JzKCkgOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcIuWKqOaAgeaQnOe0olxcXCIgKyBcXFwiX+e6v+i3r1xcXCIgKyB4bGlkXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCLliqjmgIHmkJzntKJcXFwiLCBpZClcXG4gICAgICAgICAgICB2YXIg56ug6IqCID0gbGlzdHNbZ2V0TXlWYXIoXFxcIuWKqOaAgeaQnOe0olxcXCIsICcwJyldO1xcbiAgICAgICAgICAgIGxldCBjcCA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLwn5Kg5pCcXFxcIiArIOe6v+i3r1tpZF0gKyBcXFwi8J+SoFxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLmkJzntKLkvaDmg7PopoHnmoRcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKOexu+WeiykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleScsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGtleXMgPSBsaXN0TXlWYXJLZXlzKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2Yga2V5cykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd5aV9maXJzdHBhZ2UnLCBnZXRQdWJsaWNJdGVtKCdqYXZkYjAnKSArIFxcXCIvc2VhcmNoP2Y9XFxcIiArIOexu+WeiyArIFxcXCImcT1cXFwiICsgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIGxpc3RzW2dldE15VmFyKFxcXCLliqjmgIHmkJzntKJcXFwiLCAnMCcpXSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiBnZXRNeVZhcihcXFwi5Yqo5oCB5pCc57SiXFxcIiwgJzAnKSA9PSBpZCA/IFxcXCIjMjU2OGM0XFxcIiA6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFwi5Yqo5oCB5pCc57SiXFxcIiArIFxcXCJf5qCH562+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGlkOiDnq6DoioIsXFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdrZXknLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdrZXknLCBpbnB1dClcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFwi5Yqo5oCB5pCc57SiXFxcIiArIFxcXCJf5qCH562+XFxcIik7XFxuICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShcXFwi5Yqo5oCB5pCc57SiXFxcIiArIFxcXCJmb290ZXJcXFwiLCBjcCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgfSwgdGFicywgaWQsIGdldFJhbmdlQ29sb3JzKSxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IGdldE15VmFyKFxcXCLliqjmgIHmkJzntKJcXFwiLCAnM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9rb3RvLmNuJywge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICdVc2VyLUFnZW50JzpcXG4gICAgICAgICAgICAgICAgJ01vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS8xMjIuMC4wLjAgU2FmYXJpLzUzNy4zNicsXFxuICAgICAgICB9LFxcbiAgICB9KVxcbiAgICBkYXlfc2F5X2h0bWwgPSBKU09OLnBhcnNlKGRheV9zYXlfaHRtbClcXG4gICAgZGF5X3NheV9jYWNoZVsnY29udGVudCddID0gZGF5X3NheV9odG1sWydoaXRva290byddXFxuICAgIGRheV9zYXlfY2FjaGVbJ3RpbWUnXSA9IE1hdGguZmxvb3IoRGF0ZS5ub3coKSAvIDEwMDApXFxuICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdkYXlzYXknLCBkYXlfc2F5X2NhY2hlKVxcbiAgICByZXR1cm4gZGF5X3NheV9odG1sWydoaXRva290byddXFxufVxcblxcbiAgICBsZXQgZGF5X3NheSA9ICcnXFxuICAgIHRyeSB7XFxuICAgICAgICBsZXQgZGF5X3NheV9jYWNoZSA9IHt9XFxuICAgICAgICBsZXQgZGF5X3RpbWUgPSAwXFxuICAgICAgICBpZiAoc3RvcmFnZTAuZ2V0TXlWYXIoJ2RheXNheScpKSB7XFxuICAgICAgICAgICAgZGF5X3NheV9jYWNoZSA9IHN0b3JhZ2UwLmdldE15VmFyKCdkYXlzYXknLCB7fSlcXG4gICAgICAgICAgICBkYXlfdGltZSA9IGRheV9zYXlfY2FjaGVbJ3RpbWUnXVxcbiAgICAgICAgICAgIGlmIChNYXRoLmZsb29yKERhdGUubm93KCkgLyAxMDAwKSAtIGRheV90aW1lID49IDYwMCkge1xcbiAgICAgICAgICAgICAgICBkYXlfc2F5ID0gc2F2ZV9kYXlfc2F5X2NhY2hlKClcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBkYXlfc2F5ID0gZGF5X3NheV9jYWNoZVsnY29udGVudCddXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBkYXlfc2F5ID0gc2F2ZV9kYXlfc2F5X2NhY2hlKClcXG4gICAgICAgIH1cXG4gICAgfSBjYXRjaCB7XFxuICAgICAgICBkYXlfc2F5ID0gJydcXG4gICAgfVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi57+76K+RXCIsXCJwYXRoXCI6XCJ0cmFuc1wiLFwicnVsZVwiOlwiICAgIC8v57+76K+RXFxuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZSh0ZXh0KSB7XFxuICAgICAgICB2YXIgc3dpdGNodHJhbnMgPSBnZXRJdGVtKCdzd2l0Y2h0cmFucycsICflvankupHlsI/or5EnKTtcXG4gICAgICAgIGlmIChzd2l0Y2h0cmFucyA9PSB0cnVlIHx8IHN3aXRjaHRyYW5zID09IFxcXCLlvankupHlsI/or5FcXFwiKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdmFyIHRvID0gJ3poJ1xcbiAgICAgICAgICAgICAgICB2YXIgZnJvbSA9ICdhdXRvJ1xcblxcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBpbml0X2RhdGEoc291cmNlX2xhbmcsIHRhcmdldF9sYW5nKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGV0ZWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9zX3R5cGU6ICdpb3MnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRldmljZV9pZDogJ0YxRjkwMkY3LTE3ODAtNEM4OC04NDhELTcxRjM1RDg4QTYwMicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNfdHlwZTogc291cmNlX2xhbmcgKyAnMicgKyB0YXJnZXRfbGFuZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZWRpYTogJ3RleHQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3RfaWQ6IDQyNDIzODMzNSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1c2VyX2lkOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkaWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGdldFJhbmRvbU51bWJlcigpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJhbmQgPSBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiA5OTk5OSkgKyAxMDAwMDBcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByYW5kICogMTAwMFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNvbnN0IHBvc3RfZGF0YSA9IGluaXRfZGF0YShmcm9tLCB0bylcXG4gICAgICAgICAgICAgICAgcG9zdF9kYXRhLnNvdXJjZSA9IHRleHRcXG4gICAgICAgICAgICAgICAgcG9zdF9kYXRhLnJlcXVlc3RfaWQgPSBnZXRSYW5kb21OdW1iZXIoKVxcbiAgICAgICAgICAgICAgICBsZXQgcmVzID0gZmV0Y2goJ2h0dHBzOi8vaW50ZXJwcmV0ZXIuY3lhcGkuY24vdjEvdHJhbnNsYXRvcicsIHtcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAneC1hdXRob3JpemF0aW9uJzogJ3Rva2VuIHNzZGoyNzNrc2Rpd2k5MjNic2Q5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci1hZ2VudCc6ICdjYWl5dW5JbnRlcnByZXRlci81IENGTmV0d29yay8xNDA0LjAuNSBEYXJ3aW4vMjIuMy4wJyxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBwb3N0X2RhdGEsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSBKU09OLnBhcnNlKHJlcylcXG4gICAgICAgICAgICAgICAgICAgIC50YXJnZXRcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIFxcXCLjgJDimIHvuI/jgJFcXFwiXFxuICAgICAgICAgICAgfSBjYXRjaCB7XFxuICAgICAgICAgICAgICAgIGxvZyhcXFwi57+76K+R5aSx6LSl77yM5L2/55So5Y6f5paHXFxcIik7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIGlmIChzd2l0Y2h0cmFucyA9PSBcXFwi5bCP54mb57+76K+RXFxcIikge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBcXFwiaHR0cHM6Ly9hcGkubml1dHJhbnMuY29tL05pdVRyYW5zU2VydmVyL3RyYW5zbGF0aW9uXFxcIjtcXG4gICAgICAgICAgICAgICAgdmFyIGFwaSA9IGdldEl0ZW0oJ2FwaScpO1xcbiAgICAgICAgICAgICAgICBpZiAoYXBpKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodGV4dCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYW5nID0gXFxcImh0dHBzOi8vdGVzdC5uaXV0cmFucy5jb20vTml1VHJhbnNTZXJ2ZXIvbGFuZ3VhZ2U/c3JjX3RleHQ9XFxcIiArIHRleHQgKyBcXFwiJnNvdXJjZT10ZXh0XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZnJvbSA9IEpTT04ucGFyc2UoZmV0Y2gobGFuZywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dDogMTAwMFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmxhbmd1YWdlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBwb3N0KHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNfdGV4dDogdGV4dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206IGZyb20sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bzogXFxcInpoXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwaWtleTogYXBpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAxMjIzXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSBKU09OLnBhcnNlKHJlc3VsdClcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YS50Z3RfdGV4dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF0YS50Z3RfdGV4dCArIFxcXCLjgJDwn5Cu44CRXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhcXFwi57+76K+R5aSx6LSl77yM5L2/55So5Y6f5paHXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coXFxcIue/u+ivkeWksei0pe+8jOWOn+aWh+S4uuepulxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi6aKE5aSE55CG6K+35aGr5YaZ57+76K+RYXBpXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGNhdGNoIHtcXG4gICAgICAgICAgICAgICAgbG9nKFxcXCLnv7vor5HlpLHotKXvvIzkvb/nlKjljp/mlodcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRleHRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICB9XFxuICAgIH07XFxuXFxuICAgICQuZXhwb3J0cy50cmFuc2xhdGUgPSB0cmFuc2xhdGVcIn1dIiwiaWNvbiI6Imh0dHBzOi8vaW1nLnZpbnVhLmNuL2ltYWdlcy96ckxrUS5wbmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment