Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ζ΅·ιθ§ηθ§εεδΊ«οΌε½εεδΊ«ηζ―οΌε°η¨εΊοΏ₯home_rule_v2οΏ₯base64://@πππ―ππ@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi8J2QifCdkJrwnZCv8J2Qg/CdkIEiLCJhdXRob3IiOiLOseaooeadvyZSIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly9qYXZkYi5jb20vIyNmeXBhZ2UiLCJ2ZXJzaW9uIjoyMDI0MDUyMiwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IuS6kTZvb29vbGUveHh4eHh4L3hvenhkd2ppNXJyaHJsNnYiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG5hZGRMaXN0ZW5lcihcIm9uQ2xvc2VcIiwgJC50b1N0cmluZygoKSA9PiB7XG4gICAgbGV0IGtleXMgPSBsaXN0TXlWYXJLZXlzKCk7XG4gICAgZm9yIChsZXQgaXQgb2Yga2V5cykge1xuICAgICAgICBjbGVhck15VmFyKGl0KTtcbiAgICB9XG59KSk7XG5cbmNvbnN0IOS4i+S4gOmhtSA9IFwicGQoaHRtbCwgJy5wYWdpbmF0aW9uJiZhW3JlbD1uZXh0XSYmaHJlZicpXCI7XG5jb25zdCBwYWdlID0gTVlfUEFHRTtcbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UveWknKSkucnVsZSlcblxudmFyIOWumuS9jeS/oeaBryA9IFt7XG4gICAg5aSn57G75a6a5L2NOiAnLm5hdmJhci1zdGFydCYmLm5hdmJhci1sa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tcXFwieWlfZmlyc3RwYWdlXFxcIl0sXFxuICAgICAgICBkZWJ1ZzogZmFsc2UsXFxuXFxuICAgICAgICDpooTorr4ocGFyYW0pIHtcXG4gICAgICAgICAgICBpZiAocGFyYW0gPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIHBhcmFtID0gW107XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKHBhcmFtKS5mb3JFYWNoKChwcm9wZXJ0eSkgPT4ge1xcbiAgICAgICAgICAgICAgICAvLyDlr7nmr4/kuKrlsZ7mgKflkI3miafooYzmk43kvZxcXG4gICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBwYXJhbVtwcm9wZXJ0eV07IC8vIOiOt+WPluWxnuaAp+WAvFxcbiAgICAgICAgICAgICAgICAvLyDlnKjov5nph4zmiafooYzmgqjnmoTmk43kvZxcXG4gICAgICAgICAgICAgICAgdGhpc1twcm9wZXJ0eV0gPSB2YWx1ZTtcXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHByb3BlcnR5ICsgXFxcIjpcXFwiICsgdmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9LFxcbiAgICAgICAgZXZhbEpTUnVsZShpdGVtLFxcbiAgICAgICAgICAgIGpzUnVsZSkge1xcbiAgICAgICAgICAgIGxldCBydWxlID0ganNSdWxlLnJlcGxhY2UoXFxcIkBqczpcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiXFxcIik7XFxuICAgICAgICAgICAgcnVsZSA9IHJ1bGUudHJpbSgpO1xcbiAgICAgICAgICAgIC8vbG9nKCQuc3RyaW5naWZ5KHJ1bGUpKVxcbiAgICAgICAgICAgIGxldCBpbnB1dCA9IGl0ZW07XFxuICAgICAgICAgICAgaWYgKHJ1bGUuc3RhcnRzV2l0aChcXFwiKFxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoXFxcInJlc3VsdCA9IFxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAvKipcXG4gICAgICAgICAgICAgICAgICog6L+Y5Y6f5oiQICQudG9TdHJpbmcoLi4uKSDnmoTmnIDnu4jnu5PmnpzvvIzovr7liLDmnIDnu4jlpITnkIbmlrnlvI/ot5/kuIrpnaLnmoQgaWYg5LiA6Ie055qE55uu55qEXFxuICAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICBldmFsKFxcXCJyZXN1bHQgPSBcXFwiICsgXFxcIigoKSA9PiB7XFxcIiArIHJ1bGUgKyBcXFwifSkoKVxcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0IHx8IFxcXCJcXFwiO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGdldFRpdGxlKHNyYywgY2F0ZWdvcnkpIHtcXG4gICAgICAgICAgICBsZXQgdGl0bGUgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICBsZXQgdGl0bGVSdWxlID0gY2F0ZWdvcnkgfHwgXFxcImEmJlRleHRcXFwiO1xcbiAgICAgICAgICAgIGlmICh0aXRsZVJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlID0gdGhpcy5ldmFsSlNSdWxlKHNyYywgdGl0bGVSdWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHBhcnNlRG9tRm9ySHRtbChzcmMsIHRpdGxlUnVsZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB0aXRsZSB8fCBcXFwiXFxcIjtcXG4gICAgICAgIH0sXFxuICAgICAgICBnZXRVcmwoc3JjLCBjYXRlZ29yeSkge1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICBsZXQgdXJsUnVsZSA9IGNhdGVnb3J5LumTvuaOpSB8fCBcXFwiYSYmaHJlZlxcXCI7XFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIHVybFJ1bGUpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHBkKHNyYywgdXJsUnVsZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlb2YgY2F0ZWdvcnku6ZO+5o6l5aSE55CGID09IFxcXCJmdW5jdGlvblxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gY2F0ZWdvcnku6ZO+5o6l5aSE55CGKHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgfHwgXFxcIlxcXCI7XFxuICAgICAgICB9LFxcbiAgICAgICAgaXNOdWxsKHBhcmFtKSB7XFxuICAgICAgICAgICAgaWYgKHBhcmFtID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH0sXFxuICAgICAgICBpc0Jvb2xlYW4odmFyaWFibGUpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhcmlhYmxlICE9PSBcXFwiYm9vbGVhblxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLlvIDlkK/mipjlj6Dor7fkvKDlhaXluIPlsJTlgLxcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAg5riF6ZmkKGxpc3QpIHtcXG4gICAgICAgICAgICBpZiAodGhpcy5pc051bGwobGlzdCkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChsaXN0LmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIua4hemZpOaKpemUmTror7fkvKDliJfooahcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5jbGVhcnMgPSBsaXN0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWFqOa4hShsaXN0KSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgYyA9IHRoaXMuY2xlYXJhbGw7XFxuICAgICAgICAgICAgbGlzdCA9IGMuY29uY2F0KGxpc3QpO1xcbiAgICAgICAgICAgIHRoaXMuY2xlYXJhbGwgPSBsaXN0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOa6kOeggShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMuaHRtbCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOeVjOmdoihpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMubGF5b3V0ID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAg6aG156CBKGlucHV0KSB7XFxuICAgICAgICAgICAgdGhpcy5wYWdlID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAg54q25oCBKGlucHV0KSB7XFxuICAgICAgICAgICAgdGhpcy5zdGF0ZSA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOW8gOWQr+aQnOe0oihpbnB1dCkge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0aGlzLnNlYXJjaCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOW8gOWQr+aKmOWPoChpbnB1dCkge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0aGlzLmlzQm9vbGVhbihpbnB1dCk7XFxuICAgICAgICAgICAgdGhpcy5vcGVuID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAgc2V0VGl0bGUoaywgaSwgdCkge1xcbiAgICAgICAgICAgIHJldHVybiBrID09IGkgPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHQuZm9udGNvbG9yKHRoaXMu5YiG57G76aKc6ImyKSA6IHQ7XFxuICAgICAgICB9LFxcbiAgICAgICAgYWN0aW9uKG9iaikge1xcbiAgICAgICAgICAgIHJldHVybiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhvYmopO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihvYmouc3RhdGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmNsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICB9LCBvYmopLFxcbiAgICAgICAgICAgIH0sIF07XFxuICAgICAgICB9LFxcbiAgICAgICAgY2hlY2tQYXJhbSgpIHtcXG4gICAgICAgICAgICB2YXIgb2JqID0ge307XFxuICAgICAgICAgICAgaWYgKHRoaXMucGFnZSA9PSAwICYmIHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl6aG156CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIumhteeggVxcXCJdID0gdGhpcy5wYWdlO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMuaHRtbCA9PSBcXFwiZW1wdHlcXFwiICYmIHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5rqQ56CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIua6kOeggVxcXCJdID0gdGhpcy5odG1sO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLmupDnoIFcXFwiXSA9IGh0bWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMubGF5b3V0ID09IFxcXCJ1bmRlZmluZWRcXFwiICYmIHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl55WM6Z2iXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gdGhpcy5sYXlvdXQ7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gZDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gb2JqO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWIm+W7uuWKqOaAgeWIhuexuyhydWxlT2JqKSB7XFxuICAgICAgICAgICAgbGV0IGl0ZW1zID0gW107XFxuICAgICAgICAgICAgbGV0IGNhdGVzID0gW107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Fyc2UoXFxuICAgICAgICAgICAgICAgIGdldE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShpbml0X2NhdGUpKVxcbiAgICAgICAgICAgICk7XFxuICAgICAgICAgICAgaWYgKHNlYXJjaCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCInaGlrZXI6Ly9zZWFyY2g/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZSArIFxcXCImcz0nK2lucHV0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLmkJzntKLlhbPplK7or41cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcImtleXdvcmRcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwia2V5d29yZFxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjb25zdCBjYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgcnVsZU9iai5mb3JFYWNoKCh4KSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgIC8vbG9nKHgpXFxuICAgICAgICAgICAgICAgIGlmICh4Lmpzb24gIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgICAgICB4Lmpzb24ubWFwKGsgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChKU09OLnN0cmluZ2lmeShrKS5yZXBsYWNlKC9eXFxcXFt8XFxcXF0kL2csICcnKSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAvL2NhdGVnb3JpZXMucHVzaCh4Lmpzb24pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHgu5LiA57qn5a6a5L2NKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7kuIDnuqflrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCB4LuS4gOe6p+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh4LuWkp+exu+WumuS9jS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKGh0bWwsIHgu5aSn57G75a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IFtwZGZhKGh0bWwsIHgu5aSn57G75a6a5L2NKS5qb2luKCdcXFxcbicpXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcblxcblxcbiAgICAgICAgdmFyIOS4gOe6pyA9IGxpc3QubWFwKChzKSA9PiB7XFxuICAgICAgICAgIHZhciBzbGlzdCA9IFtdO1xcbiAgICAgICAgICBpZiAoIShcXFwi5bCP57G7XFxcIiBpbiB4KSkge1xcbiAgICAgICAgICAgIHgu5bCP57G7ID0gXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXCI7XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgaWYgKHgu5bCP57G7LnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgIHNsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIC8vLS3pop3lpJblpITnkIYtLVxcbiAgICAgICAgICBpZiAoKCflop7liqAnIGluIHgpKSB7XFxuICAgICAgICAgICAgaWYgKHgu5aKe5YqgLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgeC7lop7liqAgPSBldmFsKHgu5aKe5YqgKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc2xpc3QgPSB4LuWinuWKoC5jb25jYXQoc2xpc3QpO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIGlmICgoJ+ihpeWFhScgaW4geCkpIHtcXG4gICAgICAgICAgICBpZiAoeC7ooaXlhYUuY29uc3RydWN0b3IgPT0gU3RyaW5nKSB7XFxuICAgICAgICAgICAgICB4LuihpeWFhSA9IGV2YWwoeC7ooaXlhYUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzbGlzdCA9IHNsaXN0LmNvbmNhdCh4LuihpeWFhSk7XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgLy8tLemineWkluWkhOeQhi0tXFxuICAgICAgICAgIHZhciDlrprkvY0gPSBzbGlzdC5tYXAoKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIHgu5qCH6aKYKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgeCk7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IHtcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSwgdXJsOiB1cmxcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGlmICgoJ2V4dCcgaW4geCkpIHtcXG4gICAgICAgICAgICAgIG9ialsnZXh0J10gPSB4LmV4dDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KG9iaik7XFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgICByZXR1cm4g5a6a5L2NO1xcbiAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKOS4gOe6pylcXG4gICAgICAgICAgICAgICAgLy9sb2co5LiA57qnLmxlbmd0aClcXG4gICAgICAgICAgICAgICAgaWYgKOS4gOe6py5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXCJcXFxcblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIOS4gOe6py5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFwiLFxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3JpZXMpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKOaKmOWPoOeKtuaAgSkge1xcbiAgICAgICAgICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcIjFcXFwiID8g5oqY5Y+gIDog5bGV5byALFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRpdGxlLCBmb2xkLCB1LCBhbGwsIGV4cHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb2xkID0gZ2V0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgW+WxleW8gCwg5oqY5Y+gXSA9IGV4cHM7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN4ID0gZmluZEl0ZW1zQnlDbHModGl0bGUgKyAnY2F0ZV9idXR0b24nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignY2F0ZV9idXR0b24nLCBjeCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHRpdGxlICsgJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjeCA9IHN0b3JhZ2UwLmdldE15VmFyKCdjYXRlX2J1dHRvbicsIFtdKS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhbJ2NvbF90eXBlJ10gPSB4Wydjb2xfdHlwZSddID8geFsnY29sX3R5cGUnXSA6IHhbJ3R5cGUnXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHRpdGxlICsgJ2NhdGVfbGluZScsIGN4KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyphbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0odGl0bGUgKyAnY2F0ZV9leHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT0gMSA/IOWxleW8gCA6IOaKmOWPoCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLmdyb3VwLCBmb2xkID09PSBcXFwiMVxcXCIgPyBcXFwiMFxcXCIgOiBcXFwiMVxcXCIpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9SVUxFLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOWFqOa4hSwgW+WxleW8gCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOaKmOWPoFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfUlVMRS50aXRsZSArICdjYXRlX2V4cCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogdGhpcy5hY3Rpb24oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2w6IOa4hemZpCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5mb3JFYWNoKChjYXRlZ29yeSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3J5KVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgICAgICAgICAvKmlmICjlsI/nsbvlrprkvY0uaW5jbHVkZXMoXFxcIjtcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jS5zcGxpdChcXFwiO1xcXCIpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgaWYgKHN1Yl9jYXRlZ29yaWVzLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVsxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ki9cXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGluZGV4KVxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBKU09OLnBhcnNlKGBbJHtjYXRlZ29yeX1dYCk7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhzdWJfY2F0ZWdvcmllcylcXG4gICAgICAgICAgICAgICAgICAgIC8vIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/lpKfnsbtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIF/lpKfnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnRpdGxlO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXdSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSAnJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdXJsID0gcGQoaXRlbSwgX+Wkp+exu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0g5LiA57qn5YiG57G75aSE55CGKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiZHRfXFxcIiArIHBhcmFtcy5qc29uLnR5cGUsIHBhcmFtcy5qc29uLnZhbHVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9saW5lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL+Wwj+exu1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmFwb3MgPSBmYWxzZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAoaXRlbS5pbmNsdWRlcygndHlwZT1cXFwiQGV4dHJhXFxcIicpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFwb3MgPSB0cnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKCfpmYTliqDlrprkvY0nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4dHJhcG9zKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwgXFxcImEmJnN0YXRlXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwgXFxcImEmJnZhbHVlXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNvbiA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLypzd2l0Y2ggKHRydWUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8ganNvbiA9IHBkKGl0ZW0sIOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qdmFyIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzFdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU65YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpOyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhcmFtcyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGhpcy5zZXRUaXRsZShrZXkudG9TdHJpbmcoKSwgY2F0ZV90ZW1wW2luZGV4XSwgdGl0bGUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB0aXRsZSA9PSBcXFwi8J2QhfCdkILwnZ+QXFxcIiA/IFxcXCJoaWtlcjovL3BhZ2UvZmMyP3VybD1cXFwiICsgZ2V0TXlWYXIoXFxcImZjMlxcXCIpICsgXFxcIiNmeXBhZ2Ujbm9IaXN0b3J5I1xcXCIgOiAkKFxcXCJoaWtlcjovL2VtcHR5XFxcIiArIFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmFsbGNsZWFycy5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignY2F0ZV9idXR0b24nKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaGVhZC5jYXRlXFxcIiwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3RhdGUsIHBhcmFtcy5qc29uKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogTVlfUlVMRS50aXRsZSArICdjYXRlX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogTVlfUlVMRS50aXRsZSArICdjYXRlX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChmb2xkID09PSBcXFwiMVxcXCIgfHwg5oqY5Y+g54q25oCBID09IGZhbHNlKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zID0gaXRlbXMuY29uY2F0KGNhdGVzKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGZvbGQgPT09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignY2F0ZV9idXR0b24nLCBjYXRlcylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiBzZXRQcmVSZXN1bHQgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMgPSBkLmNvbmNhdChpdGVtcyk7XFxuICAgICAgICAgICAgICAgIC8v5riF56m657un5om/5pWw57uEXFxuICAgICAgICAgICAgICAgIGQubGVuZ3RoID0gMDtcXG4gICAgICAgICAgICAgICAgc2V0UHJlUmVzdWx0KGl0ZW1zKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpdGVtcy5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sXFxuICAgIH07XFxuICAgIG9iai7pooTorr4ob3B0aW9ucyk7XFxuICAgIHJldHVybiBvYmo7XFxufVxcblxcbnZhciDnirbmgIEgPVxcbiAgICB0eXBlb2Yg54q25oCB5qCH6K6wICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOeKtuaAgeagh+iusCAhPSBcXFwiXFxcIiA/IOeKtuaAgeagh+iusCA6IE1ZX1JVTEUudXJsO1xcblxcbmxldCBkdF9kZWJ1ZyA9IGZhbHNlO1xcblxcbmFkZExpc3RlbmVyKFxcbiAgICBcXFwib25DbG9zZVxcXCIsXFxuICAgICQudG9TdHJpbmcoKCkgPT4ge30pXFxuKTtcXG5cXG52YXIgQ3JlYXRlID0ge1xcbiAgICBuZXh0UGFnZTogZnVuY3Rpb24oKSB7XFxuICAgICAgICB2YXIgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBuZXh0ID0gZXZhbCjkuIvkuIDpobUpO1xcbiAgICAgICAgICAgIC8vbG9nKCduOicrbmV4dClcXG4gICAgICAgICAgICBpZiAobmV4dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ+S4i+S4gOmhtemTvuaOpeS4uuepuicpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlc3VsdCA9IHRydWU7XFxuICAgICAgICAgICAgaWYgKHRydWVfdXJsID09IG5leHQpIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIC8vbG9nKFxcXCLlj6/og73kuI3lrZjlnKjkuIvkuIDpobXmiJbogIXkuIvkuIDpobXlrprkvY3mnInpl67pophcXFwiKTtcXG4gICAgICAgICAgICAvL2xvZyhcXFwi6ZSZ6K+v5L+h5oGvOlxcXCIgKyBlLm1lc3NhZ2UpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKChuZXh0ID09IFxcXCJcXFwiIHx8IG5leHQgPT0gdW5kZWZpbmVkKSAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBuZXh0ID0gdHJ1ZV91cmw7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIC8vcmVzdWx0PWZhbHNlO1xcbiAgICAgICAgICAgIG5leHQgPSBnZXRNeVZhcijnirbmgIEpO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9sb2coJ2wnK3RydWVfdXJsKVxcbiAgICAgICAgLy9sb2coJ24nK25leHQpXFxuICAgICAgICBpZiAocGFnZSAhPSAxKSB7XFxuICAgICAgICAgICAgaWYgKHRydWVfdXJsID09IG5leHQgJiYgIXJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXN1bHQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiByZXN1bHQ7XF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tLScpO1xcbiAgICAgICAgaWYgKGl0ZW0uY29uc3RydWN0b3IgPT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgaXRlbSA9IEpTT04uc3RyaW5naWZ5KGl0ZW0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgbG9nKCdpdGVt5YaF5a65OlxcXFxyXFxcXG4nICsgaXRlbSArICdcXFxcclxcXFxuJyArXFxuICAgICAgICAgICAgYFxcXFxuXFxcXHR0aXRsZeWumuS9jTogICR7cnVsZS50aXRsZX0gIC0tLT4g57uT5p6cOiAgJHtvYmoudGl0bGV9YCArXFxuICAgICAgICAgICAgYFxcXFxuXFxcXHRkZXNj5a6a5L2NOiAgJHtydWxlLmRlc2N9ICAtLS0+IOe7k+aenDogICR7b2JqLmRlc2N9YCArXFxuICAgICAgICAgICAgYFxcXFxuXFxcXHRpbWflrprkvY06ICAke3J1bGUuaW1nfSAgLS0tPiDnu5Pmnpw6ICAke29iai5pbWd9YCArXFxuICAgICAgICAgICAgKHJ1bGUuY29udGVudCAhPSB1bmRlZmluZWQgPyBgXFxcXG5cXFxcdGNvbnRlbnTlrprkvY06ICAke3J1bGUuY29udGVudH0gIC0tLT4g57uT5p6cOiAgJHtvYmouY29udGVudH1gIDogJycpICtcXG4gICAgICAgICAgICBgXFxcXG5cXFxcdHVybOWumuS9jTogICR7cnVsZS51cmx9ICAtLS0+IOe7k+aenDogICR7b2JqLnVybH1gXFxuICAgICAgICApO1xcbiAgICAgICAgbG9nKCctLS0tLS0tLS0tJyArIChpICsgMSkgKyAnOuiwg+ivlee7k+adny0tLS0tLS0tLS0nKTtcXG4gICAgfSxcXG4gICAganNvbkxpc3Q6IGZ1bmN0aW9uKGFyciwganNvbiwgcnVsZSkge1xcbiAgICAgICAgaWYgKGpzb24uY29uc3RydWN0b3IgIT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAganNvbiA9IEpTT04ucGFyc2UoanNvbik7XFxuICAgICAgIC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1bGUudXJsKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gcnVsZS5pbXQgPyBocmVmICsgXFxcIiNpbW1lcnNpdmVUaGVtZSNcXFwiIDogaHJlZjtcXG4gICAgICAgICAgICB2YXIgbGF6eSA9IHJ1bGUubGF6eSA/IHJ1bGUubGF6eSA6IFxcXCJcXFwiO1xcblxcbiAgICAgICAgICAgIHZhciBkZCA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgIHVybDogKGVtcHR5ID8gXFxcImhpa2VyOi8vZW1wdHkjI1xcXCIgOiAnJykgKyB1cmwsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgICAgIHZhciByeCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIGltZyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICB1cmxcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgdGhpcy5kZWJ1Z2xvZyhpLCBpdGVtLCBydWxlLCByeCk7XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGlmIChsYXp5ICE9IFxcXCJcXFwiKSB7XFx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udCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcblxcbiAgICAgICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBpbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHRoaXMuZGVidWdsb2coaSwgaXRlbSwgcnVsZSwgcngpO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB2YXIgbGF6eSA9IHJ1bGUubGF6eSA/IHJ1bGUubGF6eSA6IFxcXCJcXFwiO1xcbiAgICAgICAgICAgIHZhciBkZCA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjMSArIFxcXCJcXFxcdFxcXFx0XFxcXHRcXFxcdFxcXCIgKyBkZXNjLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgIHVybDogKGVtcHR5ID8gXFxcImhpa2VyOi8vZW1wdHkjI1xcXCIgOiAnJykgKyB1cmwgKyAnQHJ1bGU9anM6JC5yZXF1aXJlKFxcXCJlalxcXCIpJyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHJ1bGUuY29sX3R5cGUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+OAkOi3s+mhteOAkScsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHRydWVfdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKCcnLCAnMeWIsDgx5LmL6Ze055qE55qE6aG156CBJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5pbnB1dCgodHJ1ZV91cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJzZUludChpbnB1dCkgPiAxICYmIHBhcnNlSW50KGlucHV0KSA8IDgxICYmIHBhcnNlSW50KGlucHV0KSAlIDEgPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBqdW1wdSA9IHRydWVfdXJsLnJlcGxhY2UoLyhcXFxcP3BhZ2U9XFxcXGQrfFxcXFwmcGFnZT1cXFxcZCt8JCkvLCAobWF0Y2gpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hdGNoLnN0YXJ0c1dpdGgoJz9wYWdlPScpIHx8IG1hdGNoLnN0YXJ0c1dpdGgoJyZwYWdlPScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2guY2hhckF0KDApICsgJ3BhZ2U9JyArIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh0cnVlX3VybC5pbmNsdWRlcygnPycpID8gJyZwYWdlPScgOiAnP3BhZ2U9JykgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnVybCwganVtcHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd5aV9maXJzdHBhZ2UnLCBqdW1wdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kvaDlt7Lnu4/nqb/otorliLDkuoYnICsgaW5wdXQgKyAn6aG1J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K+36L6T5YWl5q2j56Gu55qE6aG156CBXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0cnVlX3VybClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRydWVfdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgaWYgKGxhenkgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgZGRbXFxcInVybFxcXCJdID0gdXJsICsgbGF6eTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyLnB1c2goZGQpO1xcbiAgICAgICAgfSk7XFxuICAgIH0sXFxuICAgIExpc3Q6IGZ1bmN0aW9uKGFyciwgaHRtbCwgcnVsZSwgcGFyYW0pIHtcXG4gICAgICAgIHBhcmFtID0gcGFyYW0gPyBwYXJhbSA6IHt9O1xcbiAgICAgICAgdmFyI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WxlLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgdmFyIGRlc2MgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS5kZXNjKTtcXG4gICAgICAgICAgICAgICAgdmFyIGltZyA9IHRoaXMuaW1nSGFuZGxlKGl0ZW0sIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICAgICAgICAgIHZhciBjb250ZW50ID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuY29udGVudCk7XFxuXFxuICAgICAgICAgICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJ4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWJ1Z2xvZyhpLCBpdGVtLCBydWxlLCByeCk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZCA9IFxcXCJsYXN0aWRfXFxcIiArIHBhZ2U7XFxuICAgICAgICAgICAgICAgICAgICBjbHMgPSBcXFwibGFzdG1hcmtcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAoZW1wdHkgPyBcXFwiaGlrZXI6Ly9lbXB0eSMjXFxcIiA6ICcnKSArIHVybCArICc/cGFnZT1meXBhZ2VAcnVsZT1qczokLnJlcXVpcmUoXFxcInlqXFxcIiknLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6IGNscyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfjgJDot7PpobXjgJEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0cnVlX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgnJywgJzHliLAzMeS5i+mXtOeahOeahOmhteeggScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5wdXQoKHRydWVfdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyc2VJbnQoaW5wdXQpID4gMSAmJiBwYXJzZUludChpbnB1dCkgPCA4MSAmJiBwYXJzZUludChpbnB1dCkgJSAxID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganVtcHUgPSB0cnVlX3VybC5yZXBsYWNlKC8oXFxcXD9wYWdlPVxcXFxkK3xcXFxcJnBhZ2U9XFxcXGQrfCQpLywgKG1hdGNoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaC5zdGFydHNXaXRoKCc/cGFnZT0nKSB8fCBtYXRjaC5zdGFydHNXaXRoKCcmcGFnZT0nKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoLmNoYXJBdCgwKSArICdwYWdlPScgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAodHJ1ZV91cmwuaW5jbHVkZXMoJz8nKSA/ICcmcGFnZT0nIDogJz9wYWdlPScpICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGp1bXB1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneWlfZmlyc3RwYWdlJywganVtcHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L2g5bey57uP56m/6LaK5Yiw5LqGJyArIGlucHV0ICsgJ+mhtSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ivt+i+k+WFpeato+ehrueahOmhteeggVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHJ1ZV91cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnVlX3VybClcXG4gICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxICYmIHNob3cpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcInBhZ2VsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHNtYWxsPuWKoOi9veS4rS4uLjwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwicGFnZW51bVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcInBhZ2VudW1cXFwiLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7liLDlupXkuoY8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBcXFwibGFzdFxcXCIsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuLypcXG4gICAgICAgIGlmIChsaXN0Lmxlbmd0aCA9PSAwICYmIHBhZ2UgPT0gMSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Zm9udCBjb2xvcj1cXFwiZ3JleVxcXCI+PHNtYWxsPuaXoOWGheWuuTwvc21hbGw+PC9mb250PicsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge30sXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9Ki9cXG4gICAgICAgIGlmICh0aGlzLm5leHRQYWdlKCkpIHtcXG4gICAgICAgICAgICAvL2xvZygndCcpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCd5aV9pc25leHQnLCAndCcpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvL2xvZygnZicpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCd5aV9pc25leHQnLCAnZicpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGF1dG8pIHtcXG4gICAgICAgICAgICAvL2NyZWF0ZU5leHRQYWdlKCk7XFxuICAgICAgICAgICAgYXV0b1BhZ2UoKTtcXG4gICAgICAgIH1cXG4gICAgfSxcXG59O1xcblxcbnZhciBleHRNZXRob2QgPSB7XFxuICAgIFRvUGFyYW1zOiBmdW5jdGlvbigpIHtcXG4gICAgICAgIHZhciBqc29uID0gYXJndW1lbnRzWzBdO1xcbiAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKGpzb24pXFxuICAgICAgICAgICAgLm1hcCgoa2V5KSA9PiBrZXkgKyBcXFwiPVxcXCIgKyBqc29uW2tleV0pXFxuICAgICAgICAgICAgLmpvaW4oXFxcIiZcXFwiKTtcXG4gICAgfSxcXG4gICAgdXJsUGFyc2U6IGZ1bmN0aW9uKHUpIHtcXG4gICAgICAgIHZhciBkaWN0ID0ge307XFxuICAgICAgICBkaWN0LlNvdXJjZSA9IHU7XFxuICAgICAgICBsZXQgcGFyYW1zID0gKHVybCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBxdWVyeVBhcmFtcyA9IHt9O1xcbiAgICAgICAgICAgIGxldCByZWcgPSAvKFtePz0mXSspPShbXj89Jl0rKS9nO1xcbiAgICAgICAgICAgIHVybC5yZXBsYWNlKHJlZywgZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgIHF1ZXJ5UGFyYW1zW2FyZ3VtZW50c1sxXV0gPSBhcmd1bWVudHNbMl07XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIHF1ZXJ5UGFyYW1zO1xcbiAgICAgICAgfTtcXG4gICAgICAgIHZhciBqYXZhVXJsID0gSmF2YUltcG9ydGVyKGphdmEubmV0LlVSTCk7XFxuICAgICAgICB3aXRo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gPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc3RyMi5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGlmIChzdHIxW2ldICE9PSBzdHIyW2ldKSB7XFxuICAgICAgICAgICAgICAgIGRpZmZDaGFycy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGluZGV4OiBpLFxcbiAgICAgICAgICAgICAgICAgICAgczE6IHN0cjFbaV0sXFxuICAgICAgICAgICAgICAgICAgICBzMjogc3RyMltpXSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGRpZmZDaGFycztcXG4gICAgfSxcXG4gICAgcmVwbGFjZUNoYXJBdDogZnVuY3Rpb24oc3RyLCBpbmRleCwgcmVwbGFjZW1lbnQpIHtcXG4gICAgICAgIGlmIChpbmRleCA8IDAgfHwgaW5kZXggPj0gc3RyLmxlbmd0aCkge1xcbiAgICAgICAgICAgIHJldHVybiBzdHI7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhpbmRleClcXG4gICAgICAgIGNvbnN0IGFyciA9IHN0ci5zcGxpdChcXFwiXFxcIik7XFxuICAgICAgICBhcnJbaW5kZXhdID0gcmVwbGFjZW1lbnQ7XFxuICAgICAgICByZXR1cm4gYXJyLmpvaW4oXFxcIlxcXCIpO1xcbiAgICB9LFxcbiAgICBnZXRPYmplY3RLZXlzRGlmZjogZnVuY3Rpb24ob2JqMSwgb2JqMikge1xcbiAgICAgICAgY29uc3QgZGlmZmVyZW50S2V5cyA9IFtdO1xcbiAgICAgICAgZm9yIChsZXQga2V5IGluIG9iajEpIHtcXG4gICAgICAgICAgICBpZiAoIW9iajIuaGFzT3duUHJvcGVydHkoa2V5KSB8fCBvYmoxW2tleV0gIT09IG9iajJba2V5XSkge1xcbiAgICAgICAgICAgICAgICBkaWZmZXJlbnRLZXlzLnB1c2goa2V5KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gb2JqMikge1xcbiAgICAgICAgICAgIGlmICghb2JqMS5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XFxuICAgICAgICAgICAgICAgIGRpZmZlcmVudEtleXMucHVzaChrZXkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBkaWZmZXJlbnRLZXlzO1xcbiAgICB9LFxcbiAgICBnZXROZXh0VXJsOiBmdW5jdGlvbihzb3VyY2UsIHRhcmdldCwgcGFyYW1zKSB7XFxuICAgICAgICB2YXIgdTEgPSB0aGlzLnVybFBhcnNlKHNvdXJjZSk7XFxuICAgICAgICB2YXIgdTIgPSB0aGlzLnVybFBhcnNlKHRhcmdldCk7XFxuICAgICAgICB2YXIgcGEgPSB1bmRlZmluZWQ7XFxuICAgICAgICBpZiAodHlwZW9mIHBhcmFtcyA9PSBcXFwib2JqZWN0XFxcIikge1xcbiAgICAgICAgICAgIHBhID0gcGFyYW1zLmhhc093blByb3BlcnR5KFxcXCLnibnlvoFcXFwiKSA/IHBhcmFtcy7nibnlvoEgOiB1bmRlZmluZWQ7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgbmV4dHVybCA9IHNvdXJjZTtcXG4gICAgICAgIHZhciBjYSA9IE9iamVjdC5rZXlzKHUyLlBhcmFtcykubGVuZ3RoID09IDAgPyBcXFwiXFxcIiA6IFxcXCI/XFxcIjtcXG4gICAgICAgIGlmIChwYSAhPSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICB2YXIgcnMgPSBTdHJpbmcodTIuUGF0aCkucmVwbGFjZShuZXcgUmVnRXhwKHBhKSwgXFxcIiQxZnlwYWdlXFxcIik7XFxuICAgICAgICAgICAgbmV4dHVybCA9IHUyLkhvc3RzICsgcnMgKyBjYSArIHRoaXMuVG9QYXJhbXModTIuUGFyYW1zKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNFcXVhbCh1MS5QYXJhbXMsIHUyLlBhcmFtcykpIHtcXG4gICAgICAgICAgICAgICAgaWYgKGR0X2RlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2codTEuUGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICBsb2codTIuUGF0aCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGRmID0gdGhpcy5maW5kRGlmZmVyZW50SW5kZXgoU3RyaW5nKHUxLlBhdGgpLCBTdHJpbmcodTIuUGF0aCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoZHRfZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhkZik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGRmLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSBkZlswXS5pbmRleDtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBmID0gZGYuZmlsdGVyKCh4KSA9PiAvXFxcXGQrLy50ZXN0KHguczIpKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZSA9IGZbMF0uaW5kZXg7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGVxID0gdGhpcy5yZXBsYWNlQ2hhckF0KFN0cmluZyh1Mi5QYXRoKSwgcmUsIFxcXCJmeXBhZ2VcXFwiKTtcXG4gICAgICAgICAgICAgICAgbmV4dHVybCA9IHUyLkhvc3RzICsgZXEgKyBjYSArIHRoaXMuVG9QYXJhbXModTIuUGFyYW1zKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgZXAgPSB0aGlzLmdldE9iamVjdEtleXNEaWZmKHUxLlBhcmFtcywgdTIuUGFyYW1zKVxcbiAgICAgICAgICAgICAgICBpZiAoZXAubGVuZ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gICAgICAgICB2YXIgbGlzdCA9IEpTT04ucGFyc2Uoc3RyKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0LmluZGV4T2YobmFtZSkgPT0gJy0xJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgLy8gbGlzdC5wdXNoKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudW5zaGlmdChuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX2FjdG9yLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBsaXN0LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgIGxpc3Quc3BsaWNlKGluZGV4LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl9hY3Rvci50eHQnLCBKU09OLnN0cmluZ2lmeShsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgc3RyKSxcXG4gICAgZXh0cmE6IHtcXFwiZ3JhZGllbnRcXFwiOnRydWV9XFxufSk7XFxuICAgIH1jYXRjaHt9XFxuICAgICAgIGlmICh0eXBlb2YgcGFnZXMgIT09ICd1bmRlZmluZWQnICYmIHBhZ2VzICE9PSBudWxsKSB7XFxuICAgICAgICAgIHNldEl0ZW0oJ3BhZ2VzJywgcGFnZXMudG9TdHJpbmcoKSk7XFxuIC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ICAgICAgICB9KX0se3RpdGxlOiAn55m+5bqm57+76K+RJywganM6ICQudG9TdHJpbmcoKHRpdGxlKT0+eyBcXG4gICAgICAgIHJldHVybiBcXFwieDU6Ly9odHRwczovL2ZhbnlpLmJhaWR1LmNvbS8janAvemgvXFxcIiArIHRpdGxlXFxuICAgICAgICAgICAgICAgICAgICAgICB9LHRpdGxlKX0se3RpdGxlOiAnRGVlcGznv7vor5EnLCBqczogJC50b1N0cmluZygodGl0bGUpPT57IFxcbiAgICAgICAgcmV0dXJuIFxcXCJ4NTovL2h0dHBzOi8vd3d3LmRlZXBsLmNvbS96aC90cmFuc2xhdG9yLW1vYmlsZSNqYS96aC9cXFwiICsgdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgIH0sdGl0bGUpfSx7dGl0bGU6ICfosLfmrYznv7vor5EnLCBqczogJC50b1N0cmluZygodGl0bGUpPT57IFxcbiAgICAgICAgcmV0dXJuIFxcXCJ4NTovL2h0dHBzOi8vdHJhbnNsYXRlLmdvb2dsZS5jb20vP2hsPXpoLUNOJnNsPWphJnRsPXpoLUNOJnRleHQ9XFxcIiArIHRpdGxlXFxuICAgICAgICAgICAgICAgICAgICAgICB9LHRpdGxlKX1dXFxufVxcbiAgICB9KVxcbn1cXG5cXG4vL3NldFBhZ2VUaXRsZSh0aXRsZSkgLy9mY+mhtemdouiOt+WPluagh+mimFxcblxcbnZhciDor4bliKvnoIEgPSBwZGZoKGh0bWwsICdib2R5JiYuZmlyc3QtYmxvY2smJi52YWx1ZSYmVGV4dCcpLnRvTG93ZXJDYXNlKCk7XFxuXFxudmFyIGltZyA9IHBkKGh0bWwsJy5jb2x1bW4tdmlkZW8tY292ZXImJmltZyYmc3JjJyk7XFxuLy92YXIgaW1nID0gTVlfUEFSQU1TLmltZztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICB1cmw6IFxcXCJjb3B5Oi8vXFxcIiArIGltZyxcXG4gICAgICAgICAgICAgY29sX3R5cGU6ICdwaWNfMV9mdWxsJyxcXG4gICAgICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZSxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAnZG1t5Zu+54mHJywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PntcXG4gICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vcGljcy5kbW0uY28uanAvbW9uby9tb3ZpZS9hZHVsdC9cXFwiICsg6K+G5Yir56CBLnJlcGxhY2UoLy18Xy8sJycpICsgJy8nICsg6K+G5Yir56CBLnJlcGxhY2UoLy18Xy8sJycpICsgXFxcInBsLmpwZ1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKX0se3RpdGxlOiAn5Zu+54mH6aKE6KeIJywganM6ICQudG9TdHJpbmcoKGh0bWwpPT57IFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBpY3MgPSBwZGZhKGh0bWwsXFxcIi5wcmV2aWV3LWltYWdlcyYmLnRpbGUtaXRlbSwxOm5cXFwiKS5tYXAoaXRlbT0+cGRmaChpdGVtLFxcXCJhJiZocmVmXFxcIikpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGljcyAhPVxcXCJcXFwiID8gXFxcInBpY3M6Ly9cXFwiK3BpY3Muam9pbihcXFwiJiZcXFwiKSA6IFxcXCJ0b2FzdDovL+ayoeacieWbvueJh+mihOiniOWTpvCfmJBcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICB9LGh0bWwpfSx7dGl0bGU6ICfmiZPlvIDlm77niYcnLCBqczogJC50b1N0cmluZygoaW1nKT0+eyBcXG4gICAgICAgIHJldHVybiBpbWdcXG4gICAgICAgICAgICAgICAgICAgICAgIH0saW1nKX1dXFxuICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICB9KTtcXG5cXG5ldmFs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jor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS9zZWFyY2g/cT1cXFwiICsg6K+G5Yir56CBO1xcbiAgICAgICAgICAgICAgICB9LCDor4bliKvnoIEpXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+ejgeWKm+aQnOagh+mimCcsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0aXRsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2Uvc291P3J1bGU956OB5Yqb5ZCbLueugCZwPWZ5cGFnZSZzZWFyY2hUZXJtcz1cXFwiICsgdGl0bGVcXG4gICAgICAgICAgICAgICAgfSwgdGl0bGUpXFxuICAgICAgICAgICAgfV1cXG4gICAgICAgIH0gOiAnJ1xcbiAgICB9KTtcXG4gICAgaWYgKGluZGV4ID09IDApIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHQsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBzdHIgPSBmZXRjaFBDKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl92aWRlby50eHQnKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFzdHIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl92aWRlby50eHQnLCBKU09OLnN0cmluZ2lmeShsaXN0KSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IEpTT04ucGFyc2Uoc3RyKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0LmluZGV4T2YobmFtZSkgPT0gJy0xJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgLy8gbGlzdC5wdXNoKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudW5zaGlmdChuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX3ZpZGVvLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBsaXN0LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgIGxpc3Quc3BsaWNlKGluZGV4LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2Fwb2xsby9qYXZkYi9qYXZkYl92aWRlby50eHQnLCBKU09OLnN0cmluZ2lmeShsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgc3RyKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgfSk7XFxuZC5wdXNoKHtcXG5jb2xfdHlwZTpcXFwiYmxhbmtfYmxvY2tcXFwiXFxufSlcXG4gICAgfVxcbn0pO1xcblxcbi8v54mH5ZWGXFxudHJ5IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi54mH5ZWG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G9hZGluZyNcXFwiKS5sYXp5UnVsZSgodGFibmFtZSwgdGFidXJsLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKHRhYnVybCwgaSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgIH0sIHRhYm5hbWUsIHRhYnVybCwgaSlcXG4gICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgfVxcblxcbnZhciBsaXN0cyA9IFtdO1xcbmZ1bmN0aW9uIHNldExpc3RzKGxpc3RzLCBpbmRleCkge1xcbiAgICBmdW5jdGlvbiBwbGF5TGlzdHMoKSB7XFxuICAgICAgIGlmIChpbmRleCA9PSAwKSB7XFxuLy/pooTop4jop4bpopFcXG4gICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08bWlkZGxlPjxmb250IGNvbG9yPWJsYWNrPvCfk7rpoJDopr3oppbpoLvikaA8L2ZvbnQ+PC9taWRkbGU+JyxcXG4gICAgICAgIHVybDogTVlfVVJMICsgJCgnJykubGF6eVJ1bGUoKOivhuWIq+eggSkgPT4ge1xcbiAgICAgICAgICAgICB0cnl7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3QoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gcGRmaChodG1sLFxcXCIubWVzc2FnZS1ib2R5JiZzb3VyY2UmJnNyY1xcXCIpXFxuICAgICAgICAgICAgICAgICAgIGlmKCAhdXJsLnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSYmdXJsIT09XFxcIlxcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwczpcXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKHVybD09XFxcIlxcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aykuaciemgkOimveWSr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsXFxuICAgICAgICAgICAgIH1jYXRjaHtyZXR1cm4gXFxcInRvYXN0Oi8v5rKS5pyJ6aCQ6Ka95ZKvXFxcIn1cXG4gICAgICAgICAgICAgICAgICB9LOivhuWIq+eggSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMicsXFxuICAgICAgICBleHRyYToge2xpbmVWaXNpYmxlOiBmYWxzZX1cXG4gICAgICAgICAgICAgICAgIH0pXFxuICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPG1pZGRsZT48Zm9udCBjb2xvcj1ibGFjaz7wn5O66aCQ6Ka96KaW6aC74pGhPC9mb250PjwvbWlkZGxlPicsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIiArICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNlYXJjaCA9IFxcXCJodHRwczovL2phdnN1YnRpdGxlZC5jb20vemgvc2VhcmNoP2tleXdvcmRzPVxcXCIgKyDor4bliKvnoIFcXG4gICAgICAgICAgICAgICAgICAgIHZhciBjb2RldXJsID0gXFxcImh0dHBzOi8vamF2c3VidGl0bGVkLmNvbS9cXFwiICsgcGRmaChyZXF1ZXN0KHNlYXJjaCksXFxcImJvZHkmJi52aWRlb2JveCYmYSYmaHJlZlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGxheWxpc3QgPSBmZXRjaChjb2RldXJsKS5tYXRjaCgvaHR0cHM/OlxcXFwvXFxcXC9cXFxcUytcXFxcLm0zdTgvKVswXVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXloZCA9IGZldGNoKHBsYXlsaXN0KS5tYXRjaCgvW15cXFwiXFxcXG5dK1xcXFwubTN1OC9nKS5wb3AoKVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IHBsYXlsaXN0LnJlcGxhY2UoXFxcInBsYXlsaXN0Lm0zdThcXFwiLHBsYXloZClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmxcXG4gICAgICAgICAgICAgfWNhdGNoe3JldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmspLmnInpoJDopr3lkq9cXFwifVxcbiAgICAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF8yJyxcXG4gICAgICAgIGV4dHJhOiB7bGluZVZpc2libGU6IGZhbHNlfVxcbiAgICAgICAgICAgICAgICAgfSlcXG4vL+mihOiniOWbvueJh1xcbnRyeXtcXG4gICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsXFxcIi5wcmV2aWV3LWltYWdlcyYmLnRpbGUtaXRlbSwxOlxcXCIpXFxuaWYobGlzdC5sZW5ndGg+MCl7XFxuICAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08bWlkZGxlPjxmb250IGNvbG9yPSNGRjhDMDA+8J+nlvCfj7vigI3imYDvuI/mqKPlk4HlnJblg486IOWFseaciScgKyBsaXN0Lmxlbmd0aCArICflvLXlnJbniYfwn5GHPC9mb250PjwvbWlkZGxlPicsXFxuICAgICAgICB1cmw6IE1ZX1VSTCArICQoJycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWNzID0gcGRmYShodG1sLFxcXCIucHJldmlldy1pbWFnZXMmJi50aWxlLWl0ZW1cXFwiKS5tYXAoaXRlbT0+cGRmaChpdGVtLFxcXCJhJiZocmVm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HRcXFxcdCcgKyBwZGZoKGl0ZW0sXFxcIi5jb250ZW50JiZUZXh0XFxcIikgKyAnPC9mb250Pjwvc21hbGw+JywgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7bGluZVZpc2libGU6ZmFsc2V9XFxuICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNtYWxsPjxmb250IGNvbG9yPSMxM0I2NkE+5pu05aSa55+t6KmV5Y+v5oiQ5Li6VklQ5oiW6Iez5a6Y5pa5QXBw5Lit5p+l55yLPC9mb250Pjwvc21hbGw+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgo6K+G5Yir56CBKSA9PiB7ICAgICAgICAgICAgICAgXFxuICAgICAgICAgb3BlbkFwcEludGVudCgneHh4LnBvcm5odWIuZnVjaycsICd4eHgucG9ybmh1Yi5mdWNrLk1haW5BY3Rpdml0eScsIHtpbnRlbnREYXRhOiDor4bliKvnoIF9KVxcbiAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyDor4bliKvnoIFcXG4gICAgICAgICAgICAgICAgICB9LOivhuWIq+eggSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7bGluZVZpc2libGU6ZmFsc2V9XFxuICAgICAgICAgICAgICAgfSlcXG59Y2F0Y2h7fVxcbiAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIHBsYXlMaXN0cygpICAgICAgICBcXG4gICAgICAgICAgICB9XFx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gICAgICAgdXJsOiBsYWJlbCA9PSBcXFwi5ryU5ZOhXFxcIj8naGlrZXI6Ly9wYWdlL3lqJzonaGlrZXI6Ly9wYWdlL2VqJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbGFiZWwgPT0gXFxcIua8lOWToVxcXCIgPyAnY2FyZF9waWNfMycgOiAnbW92aWVfMicsXFxuICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgdXJsOiBsaXN0LnNwbGl0KCdAQCcpWzJdLnJlcGxhY2UoZ2V0TXlWYXIoJ3lvbmdqaXUnKSxNWV9IT01FKSxcXG4gICAgICAgICAgICAgIHBhZ2VUaXRsZTogbGlzdC5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICB0aXRsZTogJ+WPlua2iOaUtuiXjycsXFxuICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGxpc3QsIHUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSBKU09OLnBhcnNlKGZldGNoUEModSkgfHwgJ1tdJyk7XFxuICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBkYXRhLmZpbHRlcih4ID0+IHggIT0gbGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSh1LCBKU09OLnN0cmluZ2lmeShkYXRhKSk7XFxuICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgdSlcXG4gICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pGj5LiA57qn6aG16Z2i55m75b2VXCIsXCJwYXRoXCI6XCLnmbvlvZVcIixcInJ1bGVcIjpcIlxcbmlmKGZldGNoKCdoaWtlcjovL2ZpbGVzL2NhY2hlL2phdmRiX2Nvb2tpZS50eHQnKSl7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGJpZz48Zm9udCBjb2xvcj0jRkYwMEZGPui0puWPt+W3sueZu+W9lTwvZm9udD48L2JpZz4nLFxcbiAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgJ+WIh+aNouWIhuexu+WIt+aWsOmhtemdouWGheWuuScuZm9udGNvbG9yKCcjRkYwMEZGJykuYmlnKCksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIH0pO1xcbiAgICB9ZWxzZXtcXG5cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfngrnlh7vnmbvlvZXotKblj7cnLmZvbnRjb2xvcignI0ZGMDBGRicpLmJpZygpLFxcbiAgICAgICAgdXJsOiB0cnVlX3VybCArICQoJycpLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIHZhciBkID0gW107XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZScsXFxuICAgICAgICAgICAgICAgIHVybDogTVlfVVJMLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAnbGlzdCYmc2NyZWVuJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHVhOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgIHNob3dQcm9ncmVzczogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrKCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xldCBub2RlcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJyN0YWdzJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbyA9IGZiYS5nZXRDb29raWUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZygnY286Ojo6OjonICsgY28pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY28uaW5jbHVkZXMoJ3JlbWVtYmVyX21lX3Rva2VuJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5wYXJzZUxhenlSdWxlKCQkJCgpLmxhenlSdWxlKChjbykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS9qYXZkYl9jb29raWUudHh0JywgY28pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfotKblj7flt7LnmbvlvZUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgY28pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2ssIDUwMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2soKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIE1ZX1VSTClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBzZXRSZXN1bHQoZCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxuXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5pCc57SiXCIsXCJwYXRoXCI6XCJzZWFyY2hcIixcInJ1bGVcIjpcIiAgICAgICAgaWYgKHBhZ2UgPT09IDEpIHtcXG4gICAgICAgICAgICB2YXIgdGFicyA9IFtcXFwi5b2x54mHXFxcIiwgXFxcIua8lOWRmFxcXCIsIFxcXCLlj6/mkq3mlL5cXFwiLCBcXFwi5Lit5a2XXFxcIiwgXFxcIuejgemTvlxcXCIsIFxcXCLmuIXljZVcXFwiXVxcbiAgICAgICAgICAgIHZhciBsaXN0cyA9IFtcXFwiYWxsXFxcIiwgXFxcImFjdG9yXFxcIiwgXFxcInBsYXlhYmxlXFxcIiwgXFxcImNuc3ViXFxcIiwgXFxcImRvd25sb2FkXFxcIiwgXFxcImxpc3RcXFwiXVxcblxcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRUYWJzKHRhYnMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgaW4gdGFicykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcihcXFwidGFiXFxcIiwgJzAnKSA9PSBpID8gJ+KAmOKAmOKAmeKAmTxzdHJvbmc+PGZvbnQgY29sb3I9XFxcIiNGRjAwRkZcXFwiPicgKyB0YWJzW2ldICsgJzwvZm9udD48L3N0cm9uZz4nIDogdGFic1tpXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmxhenlSdWxlKChpLCBsaXN0cykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInRhYlxcXCIsIGkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2tleScpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGtleXMgPSBsaXN0TXlWYXJLZXlzKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2Yga2V5cykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInRhYlxcXCIsIGkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnVybCwgXFxcImh0dHBzOi8vamF2ZGIuY29tL3NlYXJjaD9mPVxcXCIgKyBsaXN0c1tpXSArIFxcXCImcT1cXFwiICsgZ2V0TXlWYXIoJ2tleScpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneWlfZmlyc3RwYWdlJywgXFxcImh0dHBzOi8vamF2ZGIuY29tL3NlYXJjaD9mPVxcXCIgKyBsaXN0c1tpXSArIFxcXCImcT1cXFwiICsgZ2V0TXlWYXIoJ2tleScpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaSwgbGlzdHMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRMaXN0cyhsaXN0cywgaW5kZXgpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHBsYXlMaXN0cygpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIvCfko5cXFwiICsgdGFic1tpbmRleF0gKyBcXFwi8J+SjlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICfmkJzntKLkvaDmg7PopoHnmoQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChsaXN0cywgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXknLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBrZXlzID0gbGlzdE15VmFyS2V5cygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGtleXMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIFxcXCJodHRwczovL2phdmRiLmNvbS9zZWFyY2g/Zj1cXFwiICsgbGlzdHNbaW5kZXhdICsgXFxcIiZxPVxcXCIgKyBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3lpX2ZpcnN0cGFnZScsIFxcXCJodHRwczovL2phdmRiLmNvbS9zZWFyY2g/Zj1cXFwiICsgbGlzdHNbaW5kZXhdICsgXFxcIiZxPVxcXCIgKyBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbGlzdHMsIGluZGV4KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ2tleScsICcnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ2tleScsIGlucHV0KVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdHMoKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgc2V0VGFicyh0YWJzLCB0cnVlX3VybCk7XFxuICAgICAgICAgICAgc2V0TGlzdHMobGlzdHMsIGdldE15V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2ltYWdlcy96ckxrUS5wbmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment