Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥Kumascans@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwiQ2xhc3NUYWJcIixcInBhdGhcIjpcIkNsYXNzVGFiXCIsXCJydWxlXCI6XCJjb25zdCBDbGFzc1RhYiA9IGZ1bmN0aW9uKGNsYXNzQXJyYXksIHBhcmFtcykge1xcbiAgICBPYmplY3QuYXNzaWduKHRoaXMsIHBhcmFtcylcXG4gICAgdGhpcy5hcnIgPSBjbGFzc0FycmF5Lm1hcCh2ID0+IHRoaXMuaW5pdCh2KSlcXG4gICAgdGhpcy5zaWduID0gJyQnICsgUUlOR19USVRMRSArICdfJyArICh0aGlzLm5hbWUgfHwgJycpICsgJ18nXFxuICAgIHRoaXMuY29sb3IgPSB0aGlzLmNvbG9yIHx8ICcjMTJiNjY4J1xcbiAgICB0aGlzLmJvdW5kYXJ5ID0gdGhpcy5ib3VuZGFyeSB8fCAnYmxhbmtfYmxvY2snXFxufVxcbkNsYXNzVGFiLnByb3RvdHlwZSA9IHtcXG4gICAgY29uc3RydWN0b3I6IENsYXNzVGFiLFxcbiAgICBsb2FkKGVsKSB7XFxuICAgICAgICBsZXQgZm9sZGVkID0gdGhpcy5mb2xkICYmIGdldFZhcignZm9sZF8nICsgdGhpcy5zaWduLCAnJylcXG4gICAgICAgIGlmICh0aGlzLmFyci5sZW5ndGggPiAxICYmIHRoaXMuZm9sZCkgZWwucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgKGZvbGRlZCA/ICfilrYnIDogJ+KWvCcpLmZvbnRjb2xvcignIzA0OWVmZicpLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgZm9sZGVkKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignZm9sZF8nICsgc2lnbiwgeyAnJzogJ1QnLCAnVCc6ICcnIH0gW2ZvbGRlZF0pXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgdGhpcy5zaWduLCBmb2xkZWQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pXFxuICAgICAgICBsZXQgYXJyID0gZm9sZGVkID8gW3RoaXMuYXJyWzBdXSA6IHRoaXMuYXJyXFxuICAgICAgICBhcnIuZm9yRWFjaCgodikgPT4ge1xcbiAgICAgICAgICAgIGxldCB7IGlkLCBjbGFzc19uYW1lLCBjbGFzc191cmwgfSA9IHYsXFxuICAgICAgICAgICAgc2VsZWN0ZWQgPSBKU09OLnN0cmluZ2lmeSh0aGlzLmdldENsYXNzKGlkKSlcXG4gICAgICAgICAgICBjbGFzc19uYW1lLmZvckVhY2goKG5hbWUsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGNsYXNzX3VybFtpXSxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXG4gICAgICAgICAgICAgICAgZWwucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogc2VsZWN0ZWQgPT0gbm93ID8gJ+KAnOKAnOKAneKAnScgKyBuYW1lLmZvbnRjb2xvcih0aGlzLmNvbG9yKS5ib2xkKCkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBzZWxlY3RlZCA9PSBub3cgPyAnaGlrZXI6Ly9lbXB0eScgOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBpZCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKHNpZ24gKyBpZCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBlbC5wdXNoKHsgY29sX3R5cGU6IHRoaXMuYm91bmRhcnkgfSlcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIGluaXQoY2xhc3NPYmplY3QpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc19uYW1lID0gY2xhc3NPYmplY3QuY2xhc3NfbmFtZS5zcGxpdCgnJicpXFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX3VybCA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc191cmwgPSBjbGFzc09iamVjdC5jbGFzc191cmwuc3BsaXQoJyYnKS5tYXAoKHYp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yOi8vcGFnZS8nKSkgdXJsID0gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICBpZiAoaW5wdXQgPT0gJ+Wkh+S7vScpIHJldHVybiAkKCdoaWtlcjovL2ZpbGVzL3RtcC8nICsgUUlOR19USVRMRSArICdfYmFja3VwLmpzb24nLCAn6L6T5YWl5aSH5Lu96Lev5b6EJylcXG4gICAgICAgICAgICAuaW5wdXQoKHVybCwgdXBkYXRlSW50ZXJ2YWwsIG5ld1dpbmRvdywgdGFiRm9sZCwgZGlzYWJsZUN1c3RvbSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSByZXF1ZXN0KHVybCksXFxuICAgICAgICAgICAgICAgICAgICBjdXN0b21EYXRhID0gcmVhZEZpbGUoJ2N1c3RvbURhdGEnKVxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoaW5wdXQsIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUludGVydmFsOiB1cGRhdGVJbnRlcnZhbCxcXG4gICAgICAgICAgICAgICAgICAgIG5ld1dpbmRvdzogbmV3V2luZG93LFxcbiAgICAgICAgICAgICAgICAgICAgdGFiRm9sZDogdGFiRm9sZCxcXG4gICAgICAgICAgICAgICAgICAgIGRpc2FibGVDdXN0b206IGRpc2FibGVDdXN0b20sXFxuICAgICAgICAgICAgICAgICAgICBjdXN0b21EYXRhOiBjdXN0b21EYXRhLFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXM6IHJ1bGVzXFxuICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5aSH5Lu977yM5rOo5oSP6Iul5LuT5bqT5Li65a2Q6aG16Z2i5YiZ5LiN5aSH5Lu9J1xcbiAgICAgICAgICAgIH0sIHVybCwgdXBkYXRlSW50ZXJ2YWwsIG5ld1dpbmRvdywgdGFiRm9sZCwgZGlzYWJsZUN1c3RvbSlcXG4gIC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FxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5pY29uID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJ1bGVzW2ldLmljb25cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5a+85YWl5rW36ZiUJzpcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpPT57XFxuICAgICAgICAgICAgICAgIGxldCBkYXRhID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZGF0YUxvYWQ/cnVsZT0nICsgZ2V0TXlWYXIoJ215Q29sbGVjdGlvbicpK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W1xcXFxzXFxcXFNdKj8pQHJ1bGU9KFtcXFxcc1xcXFxTXSopJC8pXFxuICAgICAgICAgICAgICAgIHYudXJsID0gdXJsXFxuICAgICAgICAgICAgICAgIE1ZX19SVUxFLmRldGFpbF9maW5kX3J1bGUgPSBydWxlXFxuICAgICAgICAgICAgICAgIE1ZX19SVUxFLmRldGFpbF9jb2xfdHlwZSA9IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vcGFnZS8nKSkge1xcbiAgICAgICAgICAgICAgICBpZiAodi51cmwuaW5jbHVkZXMoJ3J1bGU9JykgfHwgdi5leHRyYS5ydWxlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICAgICAgbGV0IFtfLCBwYXRoLCBmbGFnLCBwYXJhbXNdID0gdi51cmwubWF0Y2goL15oaWtlcjpcXFxcL1xcXFwvcGFnZVxcXFwvKC4rPykoIy4qPyk/KD86XFxcXD8oLiopKT8kLyksXFxuICAgICAgICAgICAgICAgICAgICBzdWJQYWdlID0gTVlfUlVMRS5wYWdlTGlzdC5maW5kKCh2KSA9PiB2LnBhdGggPT0gcGF0aCksXFxuICAgICAgICAgICAgICAgICAgICBzdWJVcmwgPSAocGFyYW1zIHx8ICcnKS5zcGxpdCgnJicpLmZpbmQoKHYpID0+IHYuc3RhcnRzV2l0aCgndXJsPScpKVxcbiAgICAgICAgICAgICAgICB2LnVybCA9IChzdWJVcmwgPyBzdWJVcmwuc2xpY2UoNCkucmVwbGFjZSgv77yf77yfL2csICc/JykucmVwbGFjZSgv77yG77yGL2csICcmJykgOiAodi5leHRyYSB8fCB7fSkudXJsKSB8fCAnaGlrZXI6Ly9lbXB0eScgKyBmbGFnICsgJz8nICsgKHBhcmFtcyB8fCAnJylcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSA9IHN1YlBhZ2UucnVsZVxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfY29sX3R5cGUgPSBzdWJQYWdlLmNvbF90eXBlXFxuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gdi51cmwuaW5kZXhPZignLmpzOicpXFxuICAgICAgICAgICAgICAgIGlmIChyZUluZGV4ID49IDApIHYudXJsID0gdi51cmwuc2xpY2UoMCwgcmVJbmRleCkgKyAnLmpzOlxcXFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsICcgKyBhc3NpZ25MYXp5UnVsZSArICcpOycgKyB2LnVybC5zbGljZShyZUluZGV4ICsgNClcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzSW5kZXgpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCFNWV9SVUxFLmRldGFpbF9maW5kX3J1bGUgfHwgL2hpa2VyOlxcXFwvXFxcXC8oPyFlbXB0eS4rJCkvLnRlc3Qodi51cmwpKSByZXR1cm4gdlxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHYuZXh0cmEgPSBPYmplY3QuYXNzaWduKHt9LCB2LmV4dHJhLCB7XFxuICAgICAgICAgICAgICAgIHVybDogZ2VuRXhVcmwodi51cmwpLFxcbiAgICAgICAgICAgICAgICBSVUxFOiBNWV9fUlVMRSxcXG4gICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpc0luZGV4ICYmIHYudGl0bGVcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHYudXJsID0gJ2hpa2VyOi8vcGFnZS9mcmFtZUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRVxcbiAgICAgICAgICAgIHJldH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Y2ggKGUpIHsgcmV0dXJuICcnIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICByZXMgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSwgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogTVlfUlVMRS5jb2xfdHlwZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIGlmIChyZXMudXJsKSB7XFxuICAgICAgICAgICAgaWYgKHJlcy51cmwuaW5jbHVkZXMoJ0BsYXp5UnVsZT0nKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVJbmRleCA9IHJlcy51cmwuaW5kZXhPZignLmpzOicpXFxuICAgICAgICAgICAgICAgIGlmIChyZUluZGV4ID49IDApIHJlcy51cmwgPSByZXMudXJsLnNsaWNlKDAsIHJlSW5kZXgpICsgJy5qczpcXFxcbmlmKE1ZX1JVTEUpT2JqZWN0LmFzc2lnbihNWV9SVUxFLCAnICsgYXNzaWduTGF6eVJ1bGUgKyAnKTsnICsgcmVzLnVybC5zbGljZShyZUluZGV4ICsgNClcXG4gICAgICAgICAgICB9IGVsc2UgIGlmIChkZXRhaWxGaW5kUnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGdlbkV4VXJsKHVybCksXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiBPYmplY3QuYXNzaWduKGdlbk15UnVsZSgpLCB7IGRldGFpbF9maW5kX3J1bGU6IGRldGFpbEZpbmRSdWxlIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpc0luZGV4ICYmIHRpdGxlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9ICdoaWtlcjovL3BhZ2UvZnJhbWVMb2FkP3J1bGU9JyArIFFJTkdfVElU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bliLDmlbDmja4nKVxcbiAgICAgICAgICAgIGRhdGEgPSByZW1vdGVEYXRhXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZGF0YSA9IGRhdGEuZmlsdGVyKCh2KSA9PiB7IHJldHVybiB2LnRpdGxlICE9IGdldE15VmFyKCdteUNvbGxlY3Rpb24nKSAmJiAhKHYuYXV0aG9yIHx8ICcnKS5pbmNsdWRlcygn6L275ZCI6ZuG55Sf5oiQ5ZmoJykgfSlcXG4gICAgaWYgKHJlYWRGaWxlKCdkaXNhYmxlQ3VzdG9tJykpIHJldHVybiBkYXRhXFxuICAgIGVsc2UgeyAvLyDlhpnlhaXoh6rlrprkuYnmlbDmja5cXG4gICAgICAgIGxldCBjdXN0b21EYXRhID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpLFxcbiAgICAgICAgICAgIHJld3JpdGVEYXRhID0gW11cXG4gICAgICAgIGN1c3RvbURhdGEgPSBjdXN0b21EYXRhLnJlZHVjZSgoc2VsZiwgdikgPT4ge1xcbiAgICAgICAgICAgIGxldCBpbmRleCA9IGRhdGEuZmluZEluZGV4KCh2dikgPT4gdi50aXRsZSA9PSB2di50aXRsZSlcXG4gICAgICAgICAgICBpZiAoaW5kZXggPj0gMCkge1xcbiAgICAgICAgICAgICAgICBzZWxmLnB1c2godilcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGUgPSBkYXRhLnNwbGljZShpbmRleCwgMSlbMF1cXG4gICAgICAgICAgICAgICAgaWYgKHNob3dBbGwgfHwgdi52aXNpYmxlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV3cml0ZURhdGEucHVzaChPYmplY3QuYXNzaWduKHJ1bGUsIHYpKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gc2VsZlxcbiAgICAgICAgfSwgW10pXFxuICAgICAgICBkYXRhLmZvckVhY2goKHYpID0+IGN1c3RvbURhdGEucHVzaCh7IHRpdGxlOiB2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wi5pS26LW3XFxcIikgPT0gXFxcIuaUtui1t1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcihcXFwiampzXFxcIiwgXFxcIuWxleW8gFxcXCIpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGpqaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn566A5LuLIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuaUtui1tz48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiM4MDgwODBcXFwiPicgKyBkZXNfZGVzYyArICcuLi48L3NwYW4+J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcihcXFwiampzXFxcIiwgXFxcIuaUtui1t1xcXCIpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGpqaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn566A5LuLIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuWxleW8gD48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiM4MDgwODBcXFwiPicgKyBkZXNfZGVzYy5zdWJzdHIoMCwgMzApICsgJy4uLjwvc3Bhbj4nXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgfSwgTVlfUlVMRSArIFxcXCJfamppZFxcXCIsIE1ZX1JVTEUgKyBcXFwiX2RlY2lkXFxcIiwgZGVzX2Rlc2MpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogTVlfUlVMRSArIFxcXCJfamppZFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjLnN1YnN0cigwLCAzMCkgKyAnLi4uPC9zcGFuPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNCxcXG4gICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgIGlkOiBNWV9SVUxFICsgXFxcIl9kZWNpZFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSlcXG4gICAgfSBjYXRjaCAoZSkge31cXG59XFxuXFxuZnVuY3Rpb24gZG93bihUaXRsZSwgY2hhcHRlclBpYywgbGlzdCwgY2hhcHRlclRpdGxlLCBjaGFwdGVyTGluZSwgZG93bmxvYWRsYXp5KSB7XFxuICAgIHRyeSB7XFxuICAgICAgICBsZXQgZG9MaXN0ID0gbGlzdC5tYXAoKGl0ZW0pID0+ICh7XFxuICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgY2hhcHRlclRpdGxlKSxcXG4gICAgICAgICAgICB1cmw6IHBkKGl0ZW0sIGNoYXB0ZXJMaW5lKSxcXG4gICAgICAgIH0pKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICMxYW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pdGxlICsgJyNsaW5lLXRpdGxlJyksIGxpbmUwVGl0bGUpID09PSBsaW5lVGl0bGUgPyBcXFwi5YiH5o2iOuKAmOKAmFxcXCIgKyBsaW5lVGl0bGUgKyBcXFwiXFxcIiA6IGxpbmVUaXRsZSArIFxcXCLigJjigJg65YiH5o2iXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHZhcktleSwgbGluZUluZGV4LCBsaW5lVGl0bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcih2YXJLZXksIGxpbmVJbmRleC50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgLy8gbG9nKE1ZX1JVTEUudXJsKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKChNWV9SVUxFLnRpdGxlICsgJyNsaW5lLXRpdGxlJyksIGxpbmVUaXRsZSlcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhNWV9SVUxFLnRpdGxlICsgZ2V0VmFyKChNWV9SVUxFLnRpdGxlICsgJyNsaW5lLXRpdGxlJykpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWIh+aNouiHs1xcXCIgKyBsaW5lVGl0bGVcXG4gICAgICAgICAgICAgICAgfSwgdmFyS2V5LCBpLCBsaW5lVGl0bGUpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgICAgICAgICAgfSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6Kej5p6QW+WMhV1cIixcInBhdGhcIjpcImJ6an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GQoaXRlbSwg5YiG57G76ZO+5o6lKSArICcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhdGUucHVzaChpbmRleCA9PT0gMCA/IHBhcmFtcy5rZXkudG9TdHJpbmcoKSA6IFxcXCIwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnRpdGxlLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAoZm9sZCA9PT0gJzEnKSB7XFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogJyArIOWIhuexu+minOiJsiArICdcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnRpdGxlLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICA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x8IGxheW91dFsn5oqY5Y+g5oyJ6ZKu5o+S5YWl6KGMJ11cXG4gICAgICAgICAgICBpZiAobGF5b3V0LnRpdGxlIHx8IGxheW91dC51cmwgfHwgbGF5b3V0LmNvbF90eXBlIHx8IGluamVjdEluZGV4KSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5ID0ga2V5c1tpXVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUZvbGRMYXlvdXRdW2tleV0gPSBsYXlvdXRba2V5XTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5q2j56Gu55qE5oqY5Y+g55WM6Z2i5YWD57Sg77yBXFxcIilcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8gaW5qZWN0SW5kZXgg5oqY5Y+g5oyJ6ZKu5o+S5YWl56ysIGluamVjdEluZGV4IOihjFxcbiAgICAgICAgICAgIGlmIChpbmplY3RJbmRleCkge1xcbiAgICAgICAgICAgICAgICBpZiAoISh0eXBlb2YgKGluamVjdEluZGV4KSA9PT0gJ251bWJlcicpKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeaVsOWtl++8gVxcXCIpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGluamVjdEluZGV4IDwgMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLmipjlj6DmjInpkq7mj5LlhaXooYzor7fkvKDlhaXlpKfkuo4gMCDnmoTmlbTmlbDvvIFcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAg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sb3IobUNvbG9yKSB7XFxuICAgICAgICB0aGlzW3N5bWJvbE1hcC5tQ29sb3JdID0gbUNvbG9yXFxuICAgICAgICByZXR1cm4gdGhpc1xcbiAgICB9LFxcbiAgICB0YWcobVRhZykge1xcbiAgICAgICAgdGhpc1tzeW1ib2xNYXAubVRhZ10gPSBtVGFnXFxuICAgICAgICByZXR1cm4gdGhpc1xcbiAgICB9LFxcbiAgICBhZGQocnVsZU9iaikge1xcbiAgICAgICAgLy8gbG9nKCQuc3RyaW5naWZ5KHJ1bGVPYmopKVxcbiAgICAgICAgaWYgKHJ1bGVPYmouY29uc3RydWN0b3IgPT09IEFycmF5KSB7XFxuICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAucnVsZU9iakxpc3RdID0gdGhpc1tzeW1ib2xNYXAucnVsZU9iakxpc3RdLmNvbmNhdChydWxlT2JqKVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5ydWxlT2JqTGlzdF0ucHVzaChydWxlT2JqKVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIGV2YWxKU1J1bGUoaXRlbSwganNSdWxlKSB7XFxuICAgICAgICBsZXQgcnVsZSA9IGpzUnVsZS5yZXBsYWNlKFxcXCJAanM6XFxcIiwgXFxcIlxcXCIpXFxuICAgICAgICBydWxlID0gcnVsZS50cmltKClcXG4gICAgICAgIC8vIGxvZygkLnN0cmluZ2lmeShydWxlKSlcXG4gICAgICAgIGxldCBpbnB1dCA9IGl0ZW1cXG4gICAgICAgIGlmIChydWxlLnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcbiAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdCA9ICcgKyBydWxlKVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvKipcXG4gICAgICAgICAgICAgKiDov5jljp/miJAgJC50b1N0cmluZyguLi4pIOeahOacgOe7iOe7k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KSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCBtVXJsUnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgIGlmICh1cmxSdWxlLnBhcnNlT3B0aW9uKSB7XFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHVybFJ1bGUucGFyc2VPcHRpb24pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwYXJzZURvbVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwYXJzZURvbUZvckh0bWxcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBkZmhcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tRm9ySHRtbDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cmxSdWxlW1xcXCLop6PmnpDmlrnms5VcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh1cmxSdWxlW1xcXCLop6PmnpDmlrnms5VcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwZFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tRm9ySHRtbFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRmaFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb21Gb3JIdG1sO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHVybCA9IHBhcnNlKHNyYywgbVVybFJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5kZWFsVXJsKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVybFJ1bGUuZGVhbFVybCh1cmwpXFxuICAgICAgICAgICAgfSBlbHNlIGlmICh1cmxSdWxlWyfkuozmrKHlpITnkIYnXSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB1cmxSdWxlWyfkuozmrKHlpITnkIYnXSh1cmwpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdGhpcy5ldmFsSlNSdWxlKHNyYywgdXJsUnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gcGFyc2VEb20oc3JjLCB1cmxSdWxlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdXJsIHx8IFxcXCJcXFwiO1xcbiAgICB9LFxcbiAgICBidWlsZCgpIHtcXG4gICAgICAgIC8vIOajgOa1i+aYr+WQpuS8oOWFpemcgOimgeeahOWPguaVsFxcbiAgICAgICAgdGhpcy5jaGVja1BhcmFtcygpXFxuICAgICAgICAvLyDmr4/kuIDkuKrliIbnsbvnmoTllK/kuIDmoIfor4ZcXG4gICAgICAgIGxldCBtVGFnID0gdGhpc1tzeW1ib2xNYXAubVRhZ10gfHwgXFxcIlxcXCJcXG4gICAgICAgIC8v57+76aG1IOmcgOimgeagueaNruWunumZheabv+aNolxcbiAgICAgICAgY29uc3QgaHRtbCA9IHRoaXNbc3ltYm9sTWFwLnNyY10gfHwgcmVxdWVzdCh0aGlzW3N5bWJvbE1hcC50cnVlX3VybF0pXFxuICAgICAgICBjb25zdCBlbXB0eSA9IFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgLy/ojrflj5bliJfooahcXG4gICAgICAgIGNvbnN0IGNhdGVnb3JpZXMgPSBbXVxcbiAgICAgICAgdGhpc1tzeW1ib2xNYXAucnVsZU9iakxpc3RdLm1hcChydWxlT2JqID0+IHtcXG4gICAgICAgICAgICBsZXQgbGlzdCA9IFtdXFxuICAgICAgICAgICAgbGV0IGxpc3RSdWxlID0gcnVsZU9iai5saXN0UnVsZSB8fCBydWxlT2JqW1xcXCLkuIDnuqfliIbnsbtcXFwiXVxcbiAgICAgICAgICAgIGlmIChsaXN0UnVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgLy8gbG9nKCQuc3RyaW5naWZ5KGxpc3RSdWxlKSlcXG4gICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCBsaXN0UnVsZSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCBsaXN0UnVsZSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8gbG9nKGxpc3QpXFxuICAgICAgICAgICAgbGlzdC5tYXAoY2F0ZWdvcnkgPT4ge1xcbiAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdDogY2F0ZWdvcnksXFxuICAgICAgICAgICAgICAgICAgICBzdWJMaXN0UnVsZTogcnVsZU9iai5zdWJMaXN0UnVsZSB8fCBydWxlT2JqW1xcXCLlrZDliIbnsbtcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlUnVsZTogcnVsZU9iai50aXRsZVJ1bGUgfHwgcnVsZU9ialtcXFwi5YiG57G75qCH6aKYXFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICB1cmxSdWxlOiBydWxlT2JqLnVybFJ1bGUgfHwgcnVsZU9ialtcXFwi5YiG57G76ZO+5o6lXFxcIl0sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcblxcbiAgICAgICAgLy8gbG9nKCQuc3RyaW5naWZ5KGNhdGVnb3JpZXMpKVxcblxcbiAgICAgICAgbGV0IGluaXRfY2F0ZSA9IFtdXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDIwOyBpKyspIHtcXG4gICAgICAgICAgICBpbml0X2NhdGUucHVzaChcXFwiMFxcXCIpXFxuICAgICAgICB9XFxuXFxuICAgICAgICBjb25zdCBjYXRlX3RlbXBfanNvbiA9IGdldE15VmFyKG1UYWcgKyB0aGlzLlZBUk1BUC5DQVRFR09SWSwgSlNPTi5zdHJpbmdpZnkoaW5pdF9jYXRlKSlcXG4gICAgICAgIGNvbnN0IGNhdGVfdGVtcCA9IEpTT04ucGFyc2UoY2F0ZV90ZW1wX2pzb24pXFxuXFxuICAgICAgICBpZiAodGh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2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFnOiBtVGFnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZvbGQ6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0uY29sX3R5cGUgfHwgXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaChmb2xkTGF5b3V0KVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8v5YW35L2T5YiX6KGo5LiL55qE5YiG57G7XFxuICAgICAgICAgICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgICAgICBpZiAoY2F0ZWdvcnkuc3ViTGlzdFJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHRoaXMuZXZhbEpTUnVsZShjYXRlZ29yeS5saXN0LCBjYXRlZ29yeS5zdWJMaXN0UnVsZSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGFyc2VEb21Gb3JBcnJheShjYXRlZ29yeS5saXN0LCBjYXRlZ29yeS5zdWJMaXN0UnVsZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGluZGV4IDwgKHRoaXNbc3ltYm9sTWFwLm1Gb2xkSW5kZXhdIHx8IDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIGNhdGVnb3J5KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSB0aGlzLmdldFVybChpdGVtLCBjYXRlZ29yeSlcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxmb250IGNvbG9yPScgKyB0aGlzW3N5bWJvbE1hcC5tQ29sb3JdICsgJz4nICsgdGl0bGUgKyAnIDwvZm9udD48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5pbmRleCA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhdGUucHVzaChpbmRleCA9PT0gMCA/IHBhcmFtcy5rZXkudG9TdHJpbmcoKSA6IFxcXCIwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5DQVRFR09SWSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmluZGV4ID09PSAwID8gbmV3X2NhdGUgOiBwYXJhbXMuY2F0ZV90ZW1wKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLlVSTCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWc6IG1UYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHRoaXNbc3ltYm9sTWFwLm1QYWdlXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpc1tzeW1ib2xNYXAubUZvbGRdID09PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIGNhdGVnb3J5KVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9JyArIHRoaXNbc3ltYm9sTWFwLm1Db2xvcl0gKyAnPicgKyB0aXRsZSArICcgPC9mb250PjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuQ0FURUdPUlksIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuVVJMLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZzogbVRhZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcbiAgICDnlYzpnaIobGF5b3V0KSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5sYXlvdXQobGF5b3V0KVxcbiAgICB9LFxcbiAgICDliIbnsbvpk77mjqUodHJ1ZVVybCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1ZVVybCh0cnVlVXJsKTtcXG4gICAgfSxcXG4gICAg6aG156CBKHBhZ2UpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLnBhZ2UocGFnZSk7XFxuICAgIH0sXFxuICAgIOa6kOeggShodG1sKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5odG1sKGh0bWwpO1xcbiAgICB9LFxcbiAgICDlrprkvY3kuIDnuqfliIbnsbsobGlzdCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMubGlzdChsaXN0KTtcXG4gICAgfSxcXG4gICAg5a6a5L2N5a2Q5YiG57G7KHN1Ykxpc3QpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLnN1Ykxpc3Qoc3ViTGlzdCk7XFxuICAgIH0sXFxuICAgIOWumuS9jeWIhuexu+agh+mimCh0aXRsZSkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMudGl0bGUodGl0bGUpO1xcbiAgICB9LFxcbiAgICDlrprkvY3liIbnsbvpk77mjqUodXJsKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy51cmwodXJsKTtcXG4gICAgfSxcXG4gICAg5byA5ZCv5YaF572u5oqY5Y+g5Yqf6IO9KCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuZm9sZElubmVyKHRydWUpO1xcbiAgICB9LFxcbiAgICDlhbPpl63lh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A9IHRoaXMucmVnZXhNYXAuY29uY2F0KHJlZ0V4cClcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdGhpcy5yZWdleE1hcC5wdXNoKHJlZ0V4cClcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICBkZWJ1ZygpIHtcXG4gICAgICAgIHRoaXMucGFyYW1zLmRlYnVnID0gdHJ1ZVxcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIGV4ZWMoKSB7XFxuICAgICAgICB0aGlzLmNoZWNrUGFyYW1zKClcXG4gICAgICAgIGxldCB0cnVlX3VybCA9ICcnXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMucmVnZXhNYXAubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgcmVnT2JqID0gdGhpcy5yZWdleE1hcFtpXTtcXG4gICAgICAgICAgICBsZXQgdXJsRXhwID0gcmVnT2JqLnJlZztcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHVybEV4cCA9PT0gJ3N0cmluZycpIHtcXG4gICAgICAgICAgICAgICAgdXJsRXhwID0gbmV3IFJlZ0V4cCh1cmxFeHApXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh1cmxFeHAudGVzdCh0aGlzLnBhcmFtcy51cmwpKSB7XFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnBhcmFtcy5kZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHVybEV4cC50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRydWVfdXJsID0gcmVnT2JqLmV4ZWMoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHRydWVfdXJsKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRydWVfdXJsO1x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gKGxldCBpIGluIGtleXMpIHtcXG4gICAgICAgIHRhcmdldFtrZXlzW2ldXSA9IHNvdXJjZVtrZXlzW2ldXVxcbiAgICB9XFxufVxcblxcbmZ1bmN0aW9uIOS4gOe6pyhvYmopIHtcXG4gICAgdmFyIGQgPSBbXTtcXG4gICAgaWYgKCQudHlwZShvYmopID09IFxcXCJzdHJpbmdcXFwiKSB7XFxuICAgICAgICBvYmogPSBjb252ZXJ0MShvYmopXFxuICAgIH1cXG4gICAgaWYgKG9iai7op4TliJkpIHtcXG4gICAgICAgIGxldCBjID0gY29udmVydDEob2JqLuinhOWImSlcXG4gICAgICAgIG1lcmdlKGMsIG9iailcXG4gICAgfVxcbiAgICBsZXQgYXJyID0gcGRmYShnZXRSZXNDb2RlKCksIG9iai7liJfooagpO1xcbiAgICAgICBpZiAob2JqLuWIl+ihqOWkhOeQhiAhPSBudWxsKSB7XFxuICAgICAgICAgICAgYXJyID0gb2JqLumTvuaOpeWkhOeQhihhcnIpXFxuICAgICAgICB9XFxuICAgIGZvciAobGV0IGl0IG9mIGFycikge1xcbiAgICAgICAgbGV0IHVybCA9IHBkKGl0LCBvYmou6ZO+5o6lKVxcbiAgICAgICAgaWYgKG9iai7pk77mjqXlpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIHVybCA9IG9iai7pk77mjqXlpITnkIYodXJsKVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHBpYyA9IHBkKGl0LCBvYmou5Zu+54mHKVxcbiAgICAgICAgaWYgKG9iai7lm77niYflpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIHBpYyA9IG9iai7lm77niYflpITnkIYocGljKVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogcGRmaChpdCwgb2JqLuagh+mimCksXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJcXFwiLFxcbiAgICAgICAgIC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uICAgICAgICAgICAgZG9MaXN0dXJsID0gZG9MaXN0dXJsLmluY2x1ZGVzKFxcXCJodHRwXFxcIikgPyBkb0xpc3R1cmwgOiDliY3nvIAgKyBkb0xpc3R1cmxcXG4gICAgICAgICAgICBkb0xpc3QucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0LCDpm4blkI0pLFxcbiAgICAgICAgICAgICAgICB1cmw6IGRvTGlzdHVybFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuXFxuICAgICAgICB2YXIgYm9va05hbWUgPSAh5aSa6Lev57q/5ZCmID8g5qCH6aKYIDog5qCH6aKYICsgJy0nICsg5YiX6KGo5ZCNW2ldXFxuXFxuICAgICAgICDnq6DoioJqc29uLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiDliJfooajlkI1baV0sXFxuICAgICAgICAgICAgbGlzdDogZG9MaXN0LFxcbiAgICAgICAgICAgIHNqc3M6IHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlckxpc3Q6IGRvTGlzdCxcXG4gICAgICAgICAgICAgICAgaW5mbzoge1xcbiAgICAgICAgICAgICAgICAgICAgYm9va05hbWU6IGJvb2tOYW1lLCAvL+a8q+eUu+WQjeensCxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVOYW1lOiBNWV9SVUxFLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgYm9va1RvcFBpYzog5Zu+54mHLFxcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VDb2RlOiDmvKvnlLvop6PmnpAsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWaWV3OiBcXFwiMVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIHJldHVybiDnq6DoioJqc29uXFxufVxcblxcblxcbmZ1bmN0aW9uIOa3u+WKoOWktOmDqOWIl+ihqChkLCDmoIfpopgsIOWbvueJhywg5o+P6L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OS7i+agt+W8j1xcbiAgICB2YXIgbXp0ZXh0ID0gXFxcIiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOzxzbWFsbD7nroDku4s8L3NtYWxsPjxicj5cXFwiXFxuICAgIHZhciBidHRpdGxlID0gJzxmb250IGNvbG9yPVxcXCIjMDk4QUMxXFxcIj7mvKvnlLvnroDku4sgIDwvZm9udD48c21hbGw+PHNtYWxsPjxmb250IGNvbG9yPVxcXCIjZjQ3OTgzXFxcIj7nroDku4vmlLY+PC9mb250Pjwvc21hbGw+PC9zbWFsbD4nXFxuXFxuICAgIC8v5bGV5byA5LiO5pS257yp5pON5L2cXFxuICAgIHZhciBqaiA9IGdldFZhcijpobVVUkwgKyBcXFwi566A5LuL5pS2XFxcIiwgXFxcIuW3suaUtui1t1xcXCIpO1xcbiAgICB2YXIgamp1cmwgPSAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCjnroDku4vlhoXlrrksIOeugOS7i+WGheWuueaUtiwg5pS2LCDmlLblhoXlrrksIOW9k+WJjVVSTCkgPT4ge1xcbiAgICAgICAgdmFyIGpzYmwgPSDlvZPliY1VUkwgKyBcXFwi566A5LuL5pS2XFxcIjtcXG4gICAgICAgIHZhciBqaiA9IGdldFZhcijlvZPliY1VUkwgKyBcXFwi566A5LuL5pS2XFxcIiwgXFxcIuW3suaUtui1t1xcXCIpO1xcbiAgICAgICAgamogPSBqaiA9PSBcXFwi5bey5pS26LW3XFxcIiA/IFxcXCLlsZXlvIBcXFwiIDogXFxcIuW3suaUtui1t1xcXCI7XFxuICAgICAgICBwdXRWYXIoanNibCwgamopXFxuICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDog5b2T5YmNVVJMICsgXFxcIl9idFxcXCJcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHRpdGxlOiDmlLYucmVwbGFjZShcXFwi566A5LuL5pS2XFxcIiwgamopXFxuICAgICAgICB9KVxcblxcbiAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IOW9k+WJjVVSTCArIFxcXCJfbXpcXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB0aXRsZTogamogPT0gXFxcIuW3suaUtui1t1xcXCIgPyDmlLblhoXlrrkucmVwbGFjZShcXFwi566A5LuLXFxcIiwg566A5LuL5YaF5a655pS2KSA6IOaUtuWGheWuuS5yZXBsYWNlKFxcXCLnroDku4tcXFwiLCDnroDku4vlhoXlrrkpXFxuICAgICAgICB9KVxcbiAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICB9LCDnroDku4vlhoXlrrksIOeugOS7i+WGheWuueaUtiwgYnR0aXRsZSwgbXp0ZXh0LCDpobVVUkwpXFxuXFxuXFxuICAgIC8v5qCH6aKYXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogYnR0aXRsZS5yZXBsYWNlKFxcXCLnroDku4vmlLZcXFwiLCBqaiksXFxuICAgICAgICB1cmw6IGpqdXJsLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgcGljX3VybDog5Zu+54mHLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDog6aG1VVJMICsgXFxcIl9idFxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIC8v566A5LuLXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogamogPT0gXFxcIuW3suaUtui1t1xcXCIgPyBtenRleHQucmVwbGFjZShcXFwi566A5LuLXFxcIiwg566A5LuL5YaF5a655pS2KSA6IG16dGV4dC5yZXBsYWNlKFxcXCLnroDku4tcXFwiLCDnroDku4vlhoXlrrkpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFw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fmraPluo8nIDogJ+WAkuW6jyc7XFxuXFxuICAgIHZhciDmjpLluo91cmwgPSAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCjmoIfpopjlkI0sIOagh+mimOaVsOaNriwg5YiX6KGo5pWw5o2uLCDop6PmnpDku6PnoIEsIOmhtVVSTCkgPT4ge1xcbiAgICAgICAgdmFyIOaOkuW6jyA9IGdldFZhcijpobVVUkwgKyBcXFwi56ug6IqC5o6S5bqPXFxcIiwgXFxcIuato+W6j1xcXCIpO1xcbiAgICAgICAgdmFyIOaPkOekuiA9IOaOkuW6jyA9PSAn5YCS5bqPJyA/ICfmraPluo8nIDogJ+WAkuW6jyc7XFxuICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDog6aG1VVJMICsgXFxcIl/mjpLluo9cXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB0aXRsZTog5qCH6aKY5ZCNLnJlcGxhY2UoJ+i3r+e6vycsIOagh+mimOaVsOaNrikucmVwbGFjZSgn5o6S5bqPJywg5o+Q56S6KVxcbiAgICAgICAgfSlcXG5cXG5cXG4gICAgICAgIGlmICjmj5DnpLogPT0gJ+WAkuW6jycpIHtcXG4gICAgICAgICAgICDliJfooajmlbDmja4ucmV2ZXJzZSgpXFxuICAgICAgICB9XFxuICAgICAgICDliJfooajmlbDmja4uZm9yRWFjaChmdW5jdGlvbihkYXRhLCBzc2lkKSB7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBkYXRhLnRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IGRhdGEudXJsICsg6Kej5p6Q5Luj56CBLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJf6YCJ6ZuGXFxcIiArIHNzaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuXFxuXFxuICAgICAgICBwdXRWYXIo6aG1VVJMICsgXFxcIueroOiKguaOkuW6j1xcXCIsIOaPkOekuilcXG4gICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgfSwg5qCH6aKY5ZCNLCDmoIfpopjmlbDmja4sIOWIl+ihqOaVsOaNriwg6Kej5p6Q5Luj56CBLCDpobVVUkwpXFxuXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTog5qCH6aKY5ZCNLnJlcGxhY2UoJ+i3r+e6vycsIOagh+mimOaVsOaNrikucmVwbGFjZSgn5o6S5bqPJywg5o6S5bqPKSxcXG4gICAgICAgIHBpY191cmw6IOWbvueJhyxcXG4gICAgICAgIHVybDog5o6S5bqPdXJsLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDog6aG1VVJMICsgXFxcIl/mjpLluo9cXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICBpZiAo5o6S5bqPID09ICflgJLluo8nKSB7XFxuICAgICAgICDliJfooajmlbDmja4ucmV2ZXJzZSgpXFxuICAgIH1cXG5cXG4gICAg5YiX6KGo5pWw5o2uLmZvckVhY2goZnVuY3Rpb24oZGF0YSwgaWQpIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGRhdGEudGl0bGUsXFxuICAgICAgICAgICAgdXJsOiBkYXRhLnVybCArIOino+aekOS7o+eggSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJf6YCJ6ZuGXFxcIiArIGlkXFxuICAgICAgICAgICAgfVxcbiAgICAgICAg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6v+aVsOaNri5mb3JFYWNoKGZ1bmN0aW9uKGRhdGEsIGlkKSB7XFxuXFxuICAgICAgICAgICAgdmFyIGpqdXJsID0gJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgo6aG1VVJMLGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0o6aG1VVJMICsgJ+mAieaLqeWIl+ihqCcsaWQrJycpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSzpobVVUkwsaWQpO1xcblxcbiAgICAgICAgICAgIHZhciDmoIfpopjlkI0gPSBpZCA9PSDpgInmi6nliJfooaggPyDot6/nur/pgInkuK0ucmVwbGFjZSgn6YCJ5LitJywgZGF0YS50aXRsZSkgOiBkYXRhLnRpdGxlO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiDmoIfpopjlkI0sXFxuICAgICAgICAgICAgICAgIHVybDogamp1cmwsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJf6Lev57q/XFxcIiArIGlkXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcblxcbiAgICB9XFxuICAgIHJldHVybiDpgInmi6nliJfooahcXG59XFxuXFxuXFxuZnVuY3Rpb24g5re75Yqg6YCJ5oup5LiL6L29KGQsIOi3r+e6v+aVsOaNriwg5aSa6Lev57q/5ZCmKSB7XFxuXFxuICAgIC8v6Lev57q/5pWw5o2uIOagvOW8j1t7dGl0bGU6J+i3r+e6v+WQjScsc2pzczon5LiL6L296LWE5paZ5L+h5oGvJ30sLi4uLl1cXG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ZGluZyNcXFwiKS5sYXp5UnVsZSgo57q/6LevLCBsYXp5LCBpZCkgPT4ge1xcbiAgICAgICAgICAgIHZhciBsaXN0cyA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJsaXN0c1xcXCIpO1xcbiAgICAgICAgICAgIHZhciDmjpLluo8gPSBnZXRNeVZhcihNWV9VUkwgKyBcXFwi56ug6IqC5o6S5bqPXFxcIiwgJyMxYWFkMTlcXFwiPuato+W6jycpO1xcbiAgICAgICAgICAgIHZhciDmj5DnpLogPSDmjpLluo8gPT0gJyNGRjAwMDBcXFwiPuWAkuW6jycgPyAnIzFhYWQxOVxcXCI+5q2j5bqPJyA6ICcjRkYwMDAwXFxcIj7lgJLluo8nO1xcblxcbiAgICAgICAgICAgIOe6v+i3ry5mb3JFYWNoKChkYXRhLCB4bGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGlkID09IHhsaWQgPyAn4oCc4oCcJyArIGRhdGEgKyAn4oCd4oCdJyA6IGRhdGEsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9VUkwgKyBcXFwiX+e6v+i3r1xcXCIgKyB4bGlkXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcHV0TXlWYXIoTVlfVVJMLCBpZClcXG4gICAgICAgICAgICB2YXIg56ug6IqCID0gbGlzdHNbZ2V0TXlWYXIoTVlfVVJMLCAnMCcpXTtcXG4gICAgICAgICAgICBpZiAo5o6S5bqPID09ICcjRkYwMDAwXFxcIj7lgJLluo8nKSB7XFxuICAgICAgICAgICAgICAgIOeroOiKgi5yZXZlcnNlKClcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGNwID0g56ug6IqCLm1hcCgoZGF0YSwgc3NpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoZGF0YSwgJ2EmJlRleHQnKSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogcGQoZGF0YSwgJ2EmJmhyZWYnKSArIGxhenksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMicsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogTVlfVVJMICsgXFxcIl/pgInpm4ZcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKE1ZX1VSTCArIFxcXCJf6YCJ6ZuGXFxcIik7XFxuICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShNWV9VUkwgKyBcXFwiZm9vdGVyXFxcIiwgY3ApO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgIH0sIHRhYnMsIGxhenksIGlkKSxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogTVlfVVJMICsgXFxcIl/nur/ot69cXFwiICsgaWRcXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSlcXG5cXG5pZiAo5o6S5bqPID09ICcjRkYwMDAwXFxcIj7lgJLluo8nKSB7XFxuICAgIGxpc3QucmV2ZXJzZSgpXFxufVxcbmxpc3QuZm9yRWFjaCgoZGF0YSwgaWQpID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBwZGZoKGRhdGEsICdhJiZUZXh0JyksXFxuICAgICAgICB1cmw6IHBkKGRhdGEsICdhJiZocmVmJykgKyBsYXp5LFxcbiAgICAgICA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9DbGFzc1RhYj9ydWxlPScgKyBRSU5HX1RJVExFKSkucnVsZSlcXG4gICAgICAgIHRhYkhlYWRlci5sb2FkKG15Q29sbGVjdGlvbl9lbClcXG4gICAgICAgIGlmIChSVUxFLnNlYXJjaF91cmwpIG15Q29sbGVjdGlvbl9lbC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuaQnOe0olxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuaQnOS9oOaDs+imgeeahC4uLlxcXCIsXFxuICAgICAgICAgICAgdXJsOiAnXFxcImhpa2VyOi8vc2VhcmNoP3M9XFxcIitpbnB1dCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcnVsZXM6ICQudG9TdHJpbmcoKFFJTkdfVElUTEUsIHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9kYXRhTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFKSgpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcyA9IFtydWxlcy5maW5kKCh2KSA9PiB2LnRpdGxlID09IHRpdGxlKV1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcylcXG4gICAgICAgICAgICAgICAgfSwgUUlOR19USVRMRSwgUlVMRS50aXRsZSksXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3NlYXJjaEtleScsICcnKSxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIH0pXFxuICAgICAgICBNWV9SVUxFLmNsYXNzX3VybCA9IHRhYkhlYWRlci5nZXRDbGFzcyhmeUF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sX3R5cGVcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlSW5kZXggPSB2LnVybC5pbmRleE9mKCcuanM6JylcXG4gICAgICAgICAgICAgICAgaWYgKHJlSW5kZXggPj0gMCkgdi51cmwgPSB2LnVybC5zbGljZSgwLCByZUluZGV4KSArICcuanM6XFxcXG5pZihNWV9SVUxFKU9iamVjdC5hc3NpZ24oTVlfUlVMRSwgJyArIGFzc2lnbkxhenlSdWxlICsgJyk7JyArIHYudXJsLnNsaWNlKHJlSW5kZXggKyA0KVxcbiAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNJbmRleCkge1xcbiAgICAgICAgICAgICAgICBpZiAoIU1ZX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSB8fCAvaGlrZXI6XFxcXC9cXFxcLyg/IWVtcHR5LiskKS8udGVzdCh2LnVybCkpIHJldHVybiB2XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdi5leHRyYSA9IE9iamVjdC5hc3NpZ24oe30sIHYuZXh0cmEsIHtcXG4gICAgICAgICAgICAgICAgdXJsOiBnZW5FeFVybCh2LnVybCksXFxuICAgICAgICAgICAgICAgIFJVTEU6IE1ZX19SVUxFLFxcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGlzSW5kZXggJiYgdi50aXRsZVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgdi51cmwgPSAnaGlrZXI6Ly9wYWdlL2ZyYW1lTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFXFxuICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgIH0pKVxcbiAgICAgICAgbWV0aG9kX3NldFJlc3VsdC5pbnZva2UoamF2YUNvbn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9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYywgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgaWYgKHJlcy51cmwpIHtcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gcmVzLnVybC5pbmRleE9mKCcuanM6JylcXG4gICAgICAgICAgICAgICAgaWYgKHJlSW5kZXggPj0gMCkgcmVzLnVybCA9IHJlcy51cmwuc2xpY2UoMCwgcmVJbmRleCkgKyAnLmpzOlxcXFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsICcgKyBhc3NpZ25MYXp5UnVsZSArICcpOycgKyByZXMudXJsLnNsaWNlKHJlSW5kZXggKyA0KVxcbiAgICAgICAgICAgIH0gZWxzZSAgaWYgKGRldGFpbEZpbmRSdWxlKSB7XFxuICAgICAgICAgICAgICAgIHJlcy5leHRyYSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZ2VuRXhVcmwodXJsKSxcXG4gICAgICAgICAgICAgICAgICAgIFJVTEU6IE9iamVjdC5hc3NpZ24oZ2VuTXlSdWxlKCksIHsgZGV0YWlsX2ZpbmRfcnVsZTogZGV0YWlsRmluZFJ1bGUgfSksXFxuICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGlzSW5kZXggJiYgdGl0bGVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXMudXJsID0gJ2hpa2VyOi8vcGFnZS9mcmFtZUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoTVlfUlVMRS5kZXRhaWxfZmluZF9ydWxl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aGlzLmFyclxcXFxuICAgICAgICBhcnIuZm9yRWFjaCgodikgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IHsgaWQsIGNsYXNzX25hbWUsIGNsYXNzX3VybCB9ID0gdixcXFxcbiAgICAgICAgICAgIHNlbGVjdGVkID0gSlNPTi5zdHJpbmdpZnkodGhpcy5nZXRDbGFzcyhpZCkpXFxcXG4gICAgICAgICAgICBjbGFzc19uYW1lLmZvckVhY2goKG5hbWUsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gY2xhc3NfdXJsW2ldLFxcXFxuICAgICAgICAgICAgICAgICAgICBub3cgPSBKU09OLnN0cmluZ2lmeSh7IG5hbWU6IG5hbWUsIHVybDogdXJsIH0pXFxcXG4gICAgICAgICAgICAgICAgZWwucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBzZWxlY3RlZCA9PSBub3cgPyAn4oCc4oCc4oCd4oCdJyArIG5hbWUuZm9udGNvbG9yKHRoaXMuY29sb3IpLmJvbGQoKSA6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc2VsZWN0ZWQgPT0gbm93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKHNpZ24gKyBpZCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICA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ID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSByZXF1ZXN0KHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgIGN1c3RvbURhdGEgPSByZWFkRmlsZSgnY3VzdG9tRGF0YScpXFxcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGlucHV0LCBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUludGVydmFsOiB1cGRhdGVJbnRlcnZhbCxcXFxcbiAgICAgICAgICAgICAgICAgICAgbmV3V2luZG93OiBuZXdXaW5kb3csXFxcXG4gICAgICAgICAgICAgICAgICAgIHRhYkZvbGQ6IHRhYkZvbGQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRpc2FibGVDdXN0b206IGRpc2FibGVDdXN0b20sXFxcXG4gICAgICAgICAgICAgICAgICAgIGN1c3RvbURhdGE6IGN1c3RvbURhdGEsXFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzOiBydWxlc1xcXFxuICAgICAgICAgICAgICAgIH0pKVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LlpIfku73vvIzms6jmhI/oi6Xku5PlupPkuLrlrZDpobXpnaLliJnkuI3lpIfku70nXFxcXG4gICAgICAgICAgICB9LCB1cmwsIHVwZGF0ZUludGVydmFsLCBuZXdXaW5kb3csIHRhYkZvbGQsIGRpc2FibGVDdXN0b20pXFxcXG4gICAgICAgIGVsc2UgcmV0dXJuICQoJ2hpa2VyOi8vZmlsZXMvdG1wLycgKyBRSU5HX1RJVExFICsgJ19iYWNrdXAuanNvbicsICfovpPlhaXlpIfku73ot6/lvoQnKS5pbnB1dCgodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICBsZXQgeyB1cGRhdGVJbnRlcnZhbCwgbmV3V2luZG93LCB0YWJGb2xkLCBkaXNhYmxlQ3VzdG9tLCBjdXN0b21EYXRhLCBydWxlcyB9ID0gSlNPTi5wYX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iAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgIGNhc2UgJ+mHjeaWsOaOkuW6jyc6XFxcXG4gICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXFxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcXFxuICAgICAgICAgICAgaWYgKHNvcnRGbGFnID09IC0xKVxcXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxcXG4gICAgICAgICAgICBlbHNlXFxcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzLnNwbGljZShuZXdJbmRleCwgMCwgcnVsZXMuc3BsaWNlKG9sZEluZGV4LCAxKVswXSlcXFxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxcXG4gICAgICAgICAgICBicmVha1xcXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcXFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5pY29uID0gaW5wdXRcXFxcbiAgICAgICAgICAgICAgICBlbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBydWxlc1tpXS5pY29uXFxcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgfSwgaSlcXFxcbiAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgIGNhc2UgJ+WvvOWFpea1t+mYlCc6XFxcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpPT57XFxcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9kYXRhTG9hZD9ydWxlPScgKyB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jaCgvXihbXFxcXFxcXFxzXFxcXFxcXFxTXSo/KSg/Oj09PihbXFxcXFxcXFxzXFxcXFxcXFxTXSopKT8kLylcXFxcbiAgICBmaW5kUnVsZSA9IGZpbmRSdWxlLnNwbGl0KCc7JylcXFxcbiAgICBwYXJzZURvbUZvckFycmF5KGdldFJlc0NvZGUoKSwgZmluZFJ1bGUuc2hpZnQoKSkuZm9yRWFjaCgoZGF0YSkgPT4ge1xcXFxuICAgICAgICBsZXQgW3RpdGxlLCBpbWcsIGRlc2MsIHVybF0gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAodiA9PSAnKicpIHJldHVybiAnJ1xcXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb20oZGF0YSwgdikgOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgeyByZXR1cm4gJycgfVxcXFxuICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICByZXMgPSB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLCBpbWc6IGltZyxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogTVlfUlVMRS5jb2xfdHlwZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICBpZiAocmVzLnVybCkge1xcXFxuICAgICAgICAgICAgaWYgKHJlcy51cmwuaW5jbHVkZXMoJ0BsYXp5UnVsZT0nKSkge1xcXFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gcmVzLnVybC5pbmRleE9mKCcuanM6JylcXFxcbiAgICAgICAgICAgICAgICBpZiAocmVJbmRleCA+PSAwKSByZXMudXJsID0gcmVzLnVybC5zbGljZSgwLCByZUluZGV4KSArICcuanM6XFxcXFxcXFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsICcgKyBhc3NpZ25MYXp5UnVsZSArICcpOycgKyByZXMudXJsLnNsaWNlKHJlSW5kZXggKyA0KVxcXFxuICAgICAgICAgICAgfSBlbHNlICBpZiAoZGV0YWlsRmluZFJ1bGUpIHtcXFxcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZ2VuRXhVcmwodXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgUlVMRTogT2JqZWN0LmFzc2lnbihnZW5NeVJ1bGUoKSwgeyBkZXRhaWxfZmluZF9ydWxlOiBkZXRhaWxGaW5kUnVsZSB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpc0luZGV4ICYmIHRpdGxlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJlcy51cmwgPSAnaGlrZXI6Ly9wYWdlL2ZyYW1lTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKE1ZX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSkge1xcXFxuICAgICAgICAgICAgICAgIHJlcy5leHRyYSA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBnZW5FeFVybCh1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiBnZW5NeVJ1bGUoKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpc0luZGV4ICYmIHRpdGx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iPuWxleW8gD48L3NwYW4+PC9zbWFsbD48L3NtYWxsPicsXFxcXG4gICAgICAgICAgICBpbWc6IFxcXFxcXFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMTk3LnBuZ1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKGpqaWQsIGRlY2lkLCBkZXNfZGVzYykgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChnZXRWYXIoXFxcXFxcXCJqanNcXFxcXFxcIiwgXFxcXFxcXCLmlLbotbdcXFxcXFxcIikgPT0gXFxcXFxcXCLmlLbotbdcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcXFxcXCJqanNcXFxcXFxcIiwgXFxcXFxcXCLlsZXlvIBcXFxcXFxcIik7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBqamlkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnroDku4sgPHNtYWxsPjxzbWFsbD48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiMxOUI4OURcXFxcXFxcIj7mlLbotbc+PC9zcGFuPjwvc21hbGw+PC9zbWFsbD4nXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lU3BhY2luZzogMyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXFxcXFwiY29sb3I6IzgwODA4MFxcXFxcXFwiPicgKyBkZXNfZGVzYyArICcuLi48L3NwYW4+J1xcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcXFxcXCJqanNcXFxcXFxcIiwgXFxcXFxcXCLmlLbotbdcXFxcXFxcIik7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBqamlkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnroDku4sgPHNtYWxsPjxzbWFsbD48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiMxOUI4OURcXFxcXFxcIj7lsZXlvIA+PC9zcGFuPjwvc21hbGw+PC9zbWFsbD4nXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lU3BhY2luZzogMyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXFxcXFwiY29sb3I6IzgwODA4MFxcXFxcXFwiPicgKyBkZXNfZGVzYy5zdWJzdHIoMCwgMzApICsgJy4uLjwvc3Bhbj4nXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgfSwgTVlfUlVMRSArIFxcXFxcXFwiX2pqaWRcXFxcXFxcIiwgTVlfUlVMRSArIFxcXFxcXFwiX2RlY2lkXFxcXFxcXCIsIGRlc19kZXNjKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImF2YXRhclxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBpZDogTVlfUlVMRSArIFxcXFxcXFwiX2pqaWRcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiM4MDgwODBcXFxcXFxcIj4nICsgZGVzX2Rlc2Muc3Vic3RyKDAsIDMwKSArICcuLi48L3NwYW4+JyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInJpY2hfdGV4dFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxcXG4gICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxcXG4gICAgICAgICAgICAgICAgaWQ6IE1ZX1JV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EUudGl0bGUgKyAnI2xpbmUtdGl0bGUnKSwgbGluZTBUaXRsZSkgPT09IGxpbmVUaXRsZSA/IFxcXFxcXFwi5YiH5o2iOuKAmOKAmFxcXFxcXFwiICsgbGluZVRpdGxlICsgXFxcXFxcXCJcXFxcXFxcIiA6IGxpbmVUaXRsZSArIFxcXFxcXFwi4oCY4oCYOuWIh+aNolxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKCh2YXJLZXksIGxpbmVJbmRleCwgbGluZVRpdGxlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcih2YXJLZXksIGxpbmVJbmRleC50b1N0cmluZygpKVxcXFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coTVlfUlVMRS51cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcigoTVlfUlVMRS50aXRsZSArICcjbGluZS10aXRsZScpLCBsaW5lVGl0bGUpXFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhNWV9SVUxFLnRpdGxlICsgZ2V0VmFyKChNWV9SVUxFLnRpdGxlICsgJyNsaW5lLXRpdGxlJykpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5bey5YiH5o2i6IezXFxcXFxcXCIgKyBsaW5lVGl0bGVcXFxcbiAgICAgICAgICAgICAgICB9LCB2YXJLZXksIGksIGxpbmVUaXRsZSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgIH1cXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxufVxcXCJ9LHtcXFwi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lsI/nsbvlrprkvY0pO1xcXFxuICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcXFxcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiAnICsg5YiG57G76aKc6ImyICsgJ1xcXFxcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFxcXFxcIjBcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkobmV3X2NhdGUpKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIGlmIChmb2xkID09PSAnMScpIHtcXFxcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiAnICsg5YiG57G76aKc6ImyICsgJ1xcXFxcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pXFxcXG59XFxcIn0se1xcXCJjb2xf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iAgICAgICAgICAgICAgICBpZiAoISh0eXBlb2YgKGluamVjdEluZGV4KSA9PT0gJ251bWJlcicpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeaVsOWtl++8gVxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXggPCAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeWkp+S6jiAwIOeahOaVtOaVsO+8gVxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXggPiB0aGlzW3N5bWJvbE1hcC5tRm9sZEluZGV4XSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcXFxcXCLmipjlj6DmjInpkq7mj5LlhaXooYzkuI3lvpflpKfkuo7mmL7npLrmipjlj6DooYzmlbDvvIHor7fosIPnlKggLmZvbGRJbmRleChpbmRleCkg5oiWIC7nrKzlh6DooYzlvIDlp4vmipjlj6AoaW5kZXgpIOS8oOWFpeato+ehrueahOaYvuekuuaKmOWPoOihjOaVsFxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0uaW5qZWN0SW5kZXggPSBpbmplY3RJbmRleCB8fCAxO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXFxcXFwi6K+35Lyg5YWl5q2j56Gu55qE5oqY5Y+g55WM6Z2i5YWD57Sg77yBXFxcXFxcXCIpX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cXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBkXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwYXJzZURvbUZvckh0bWxcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwZGZoXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbUZvckh0bWw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHVybFJ1bGVbXFxcXFxcXCLop6PmnpDmlrnms5VcXFxcXFxcIl0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh1cmxSdWxlW1xcXFxcXFwi6Kej5p6Q5pa55rOVXFxcXFxcXCJdKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwicGFyc2VEb21cXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwZFxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwicGFyc2VEb21Gb3JIdG1sXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwicGRmaFxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb21Gb3JIdG1sO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHVybCA9IHBhcnNlKHNyYywgbVVybFJ1bGUpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuZGVhbFVybCkge1xcXFxuICAgICAgICAgICAgICAgIHVybCA9IHVybFJ1bGUuZGVhbFVybCh1cmwpXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHVybFJ1bGVbJ+S6jOasoeWkhOeQhiddKSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsID0gdXJsUnVsZVsn5LqM5qyh5aSE55CGJ10odXJsKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuc3RhcnRzV2l0aChcXFxcXFxcIkBqczpcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCB1cmxSdWxlKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsID0gcGFyc2VEb20oc3JjLCB1cmxSdWxlKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICByZXR1cm4gdXJsIHx8IFxcXFxcXFwiXFxcXFxcXCI7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15VmFyKHBhcmFtcy5tVGFnICsgcGFyYW1zLlZBUk1BUC5GT0xELCBnZXRNeVZhcihwYXJhbXMubVRhZyArIHBhcmFtcy5WQVJNQVAuRk9MRCwgcGFyYW1zLmlzRm9sZCkgPT09ICcxJyA/ICcwJyA6ICcxJylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhZzogbVRhZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZvbGQ6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0uY29sX3R5cGUgfHwgXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaChmb2xkTGF5b3V0KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgIC8v5YW35L2T5YiX6KGo5LiL55qE5YiG57G7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxcXG4gICAgICAgICAgICAgICAgaWYgKGNhdGVnb3J5LnN1Ykxpc3RSdWxlLnN0YXJ0c1dpdGgoXFxcXFxcXCJAanM6XFxcXFxcXCI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AgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuaW5kZXggPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcXFxcXCIwXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuaW5kZXggPT09IDAgPyBuZXdfY2F0ZSA6IHBhcmFtcy5jYXRlX3RlbXApKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5VUkwsIGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZzogbVRhZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHRoaXNbc3ltYm9sTWFwLm1QYWdlXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpc1tzeW1ib2xNYXAubUZvbGRdID09PSAnMCcpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIGNhdGVnb3J5KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIGNhdGVnb3J5KVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9JyArIHRoaXNbc3ltYm9sTWFwLm1Db2xvcl0gKyAnPicgKyB0aXRsZSArICcgPC9mb250PjwvYj4nIDogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5DQVRFR09SWSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLlVSTCwgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFnOiBtVGFnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuXFxcXG4gICAg55WM6Z2iKGxheW91dCkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy5sYXlvdXQobGF5b3V0KVxcXFxuICAgIH0sXFxcXG4gICAg5YiG57G76ZO+5o6lKHRydWVVcmwpIHtcXFxcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1ZVVybCh0cnVlVXJsKTtcXFxcbiAgICB9LFxcXFxuICAgIOmhteeggShwYWdlKSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLnBhZ2UocGFnZSk7XFxcXG4gICAgfSxcXFxcbiAgICDmupDnoIEoaHRtbCkge1xcXFxuIC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7XFxcXG4gICAgICAgIHRoaXMucGFyYW1zLnVybCA9IHVybFxcXFxuICAgICAgICByZXR1cm4gdGhpc1xcXFxuICAgIH0sXFxcXG4gICAgcGFnZShwYWdlKXtcXFxcbiAgICAgICAgdGhpcy5wYXJhbXMucGFnZSA9IHBhZ2VcXFxcbiAgICAgICAgcmV0dXJuIHRoaXNcXFxcbiAgICB9LFxcXFxuICAgIGFkZEV4dHJhKHJlZ0V4cCkge1xcXFxuICAgICAgICBpZiAocmVnRXhwLmNvbnN0cnVjdG9yID09PSBBcnJheSkge1xcXFxuICAgICAgICAgICAgdGhpcy5yZWdleE1hcCA9IHRoaXMucmVnZXhNYXAuY29uY2F0KHJlZ0V4cClcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHRoaXMucmVnZXhNYXAucHVzaChyZWdFeHApXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxcXG4gICAgfSxcXFxcbiAgICBkZWJ1ZygpIHtcXFxcbiAgICAgICAgdGhpcy5wYXJhbXMuZGVidWcgPSB0cnVlXFxcXG4gICAgICAgIHJldHVybiB0aGlzO1xcXFxuICAgIH0sXFxcXG4gICAgZXhlYygpIHtcXFxcbiAgICAgICAgdGhpcy5jaGVja1BhcmFtcygpXFxcXG4gICAgICAgIGxldCB0cnVlX3VybCA9ICcnXFxcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5yZWdleE1hcC5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgbGV0IHJlZ09iaiA9IHRoaXMucmVnZXhNYXBbaV07XFxcXG4gICAgICAgICAgICBsZXQgdXJsRXhwID0gcmVnT2JqLnJlZztcXFxcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdXJsRXhwID09PSAnc3RyaW5nJykge1xcXFxuICAgICAgICAgICAgICAgIHVybEV4cCA9IG5ldyBSZWdFeHAodXJsRXhwKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHVybEV4cC50ZXN0KHRoaXMucGFyYW1zLnVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXJhbXMuZGVidWcpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKHVybEV4cC50b1N0cmluZygpKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB0cnVlX3VybCA9IHJlZ09iai5leGVjKCk7XFxcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaWYgKHRydWVfdXJsKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZV91cmw7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJhbXMudXJsXFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuICAgIOiOt+WPluWkhOeQhue7k+aenCgpIHtcXFxcbiAgICAgICAgcmV0dXJuIHRoaXMuZXhlYygpXFxcXG4gICAgfSxcXFxcbiAgICDpk77mjqUodXJsKSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLmJhc2VVcmwodXJsKVxcXFxuICAgIH0sXFxcXG4gICAg6aG156CBKHBhZ2UpIHtcXFxcbiAgICAgICAgcmV0dXJuIHRoaXMucGFnZShwYWdlKVxcXFxuICAgIH0sXFxcXG4gICAg5o+S5YWl5paw5aSE55CG6KeE5YiZKHJlZ0V4cCkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy5hZGRFeHRyYShyZWdFeHApXFxcXG4gICAgfSxcXFxcbiAgICDosIPor5XmqKHlvI8oKSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLmRlYnVnKCk7XFxcXG4gICAgfVxcXFxufSlcXFxcbiQuZXhwb3J0cz1uZXcgVXJsUHJvY2Vzc29yKClcXFxcbiQuZXhwb3J0c1xcXFxuXFxc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uICAgICAg6ZuG5pWw57uEW2ldLnNwbGljZSjmoIfor4ZpZCwgMSlcXFxcbiAgICB9O1xcXFxuICB9KTtcXFxcblxcXFxuICAgICAgICBmb3IgKGxldCBpdCBvZiDpm4bmlbDnu4RbaV0pIHtcXFxcbiAgICAgICAgICAgIHZhciBkb0xpc3R1cmwgPSBwZGZoKGl0LCDpm4Z1cmwpXFxcXG4gICAgICAgICAgICBkb0xpc3R1cmwgPSBkb0xpc3R1cmwuaW5jbHVkZXMoXFxcXFxcXCJodHRwXFxcXFxcXCIpID8gZG9MaXN0dXJsIDog5YmN57yAICsgZG9MaXN0dXJsXFxcXG4gICAgICAgICAgICBkb0xpc3QucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXQsIOmbhuWQjSksXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBkb0xpc3R1cmxcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgICAgICB2YXIgYm9va05hbWUgPSAh5aSa6Lev57q/5ZCmID8g5qCH6aKYIDog5qCH6aKYICsgJy0nICsg5YiX6KGo5ZCNW2ldXFxcXG5cXFxcbiAgICAgICAg56ug6IqCanNvbi5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiDliJfooajlkI1baV0sXFxcXG4gICAgICAgICAgICBsaXN0OiBkb0xpc3QsXFxcXG4gICAgICAgICAgICBzanNzOiB7XFxcXG4gICAgICAgICAgICAgICAgY2hhcHRlckxpc3Q6IGRvTGlzdCxcXFxcbiAgICAgICAgICAgICAgICBpbmZvOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJvb2tOYW1lOiBib29rTmFtZSwgLy/mvKvnlLvlkI3np7AsXFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVOYW1lOiBNWV9SVUxFLnRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICBib29rVG9wUGljOiDlm77niYcsXFxcXG4gICAgICAgICAgICA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iAgICB2YXIg5o+Q56S6ID0g5o6S5bqPID09ICflgJLluo8nID8gJ+ato+W6jycgOiAn5YCS5bqPJztcXFxcblxcXFxuICAgIHZhciDmjpLluo91cmwgPSAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKOagh+mimOWQjSwg5qCH6aKY5pWw5o2uLCDliJfooajmlbDmja4sIOino+aekOS7o+eggSwg6aG1VVJMKSA9PiB7XFxcXG4gICAgICAgIHZhciDmjpLluo8gPSBnZXRWYXIo6aG1VVJMICsgXFxcXFxcXCLnq6DoioLmjpLluo9cXFxcXFxcIiwgXFxcXFxcXCLmraPluo9cXFxcXFxcIik7XFxcXG4gICAgICAgIHZhciDmj5DnpLogPSDmjpLluo8gPT0gJ+WAkuW6jycgPyAn5q2j5bqPJyA6ICflgJLluo8nO1xcXFxuICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXFxcXFwiX+aOkuW6j1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgdGl0bGU6IOagh+mimOWQjS5yZXBsYWNlKCfot6/nur8nLCDmoIfpopjmlbDmja4pLnJlcGxhY2UoJ+aOkuW6jycsIOaPkOekuilcXFxcbiAgICAgICAgfSlcXFxcblxcXFxuXFxcXG4gICAgICAgIGlmICjmj5DnpLogPT0gJ+WAkuW6jycpIHtcXFxcbiAgICAgICAgICAgIOWIl+ihqOaVsOaNri5yZXZlcnNlKClcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICDliJfooajmlbDmja4uZm9yRWFjaChmdW5jdGlvbihkYXRhLCBzc2lkKSB7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogZGF0YS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IGRhdGEudXJsICsg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gKyBcXFxcXFxcIueroOiKguaOkuW6j1xcXFxcXFwiLCAnIzFhYWQxOVxcXFxcXFwiPuato+W6jycpO1xcXFxuICAgICAgICB2YXIg5o+Q56S6ID0g5o6S5bqPID09ICcjRkYwMDAwXFxcXFxcXCI+5YCS5bqPJyA/ICcjMWFhZDE5XFxcXFxcXCI+5q2j5bqPJyA6ICcjRkYwMDAwXFxcXFxcXCI+5YCS5bqPJztcXFxcbiAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiBNWV9VUkwgKyBcXFxcXFxcIl/mjpLluo9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHRpdGxlOiDmjpLluo/lkI0ucmVwbGFjZSgn5o6S5bqPJywg5o+Q56S6KVxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBpZiAo5o6S5bqPID09ICcjMWFhZDE5XFxcXFxcXCI+5q2j5bqPJykge1xcXFxuICAgICAgICAgICAg56ug6IqCLnJldmVyc2UoKVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBjcCA9IOeroOiKgi5tYXAoKGRhdGEsIHNzaWQpID0+IHtcXFxcbiAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoZGF0YSwgJ2EmJlRleHQnKSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHBkKGRhdGEsICdhJiZocmVmJykgKyBsYXp5LFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8yJyxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1VSTCArIFxcXFxcXFwiX+mAiembhlxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIG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I+5YCS5bqPJyA/ICcjMWFhZDE5XFxcXFxcXCI+5q2j5bqPJyA6ICcjRkYwMDAwXFxcXFxcXCI+5YCS5bqPJztcXFxcblxcXFxuICAgICAgICAgICAg57q/6LevLmZvckVhY2goKGRhdGEsIHhsaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGlkID09IHhsaWQgPyAn4oCc4oCcJyArIGRhdGEgKyAn4oCd4oCdJyA6IGRhdGEsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfVVJMICsgXFxcXFxcXCJf57q/6LevXFxcXFxcXCIgKyB4bGlkXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9VUkwsIGlkKVxcXFxuICAgICAgICAgICAgdmFyIOeroOiKgiA9IGxpc3RzW2dldE15VmFyKE1ZX1VSTCwgJzAnKV07XFxcXG4gICAgICAgICAgICBpZiAo5o6S5bqPID09ICcjRkYwMDAwXFxcXFxcXCI+5YCS5bqPJykge1xcXFxuICAgICAgICAgICAgICAgIOeroOiKgi5yZXZlcnNlKClcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBjcCA9IOeroOiKgi5tYXAoKGRhdGEsIHNzaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChkYXRhLCAnYSYmVGV4dCcpLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHBkKGRhdGEsICdhJiZocmVmJykgKyBsYXp5LFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMicsXFxcXG4gICAgICAgICAg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xcXFxcXFwiXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbn0pXFxcXG5kLnB1c2goe1xcXFxuICAgIGNvbF90eXBlOiBcXFxcXFxcImJpZ19ibGFua19ibG9ja1xcXFxcXFwiLFxcXFxuICAgIGV4dHJhOiB7XFxcXG4gICAgICAgIGlkOiBNWV9VUkwgKyBcXFxcXFxcImZvb3RlclxcXFxcXFwiXFxcXG4gICAgfVxcXFxufSk7XFxcIn1dXCIsXCJwcm94eVwiOlwiXCJ9IiwicGljVXJsIjoiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL3EvMTMucG5nIiwidGl0bGUiOiJLdW1hc2NhbnMifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement