Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥九酷音乐pc@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwiQ2xhc3NUYWJcIixcInBhdGhcIjpcIkNsYXNzVGFiXCIsXCJydWxlXCI6XCJmdW5jdGlvbiBDbGFzc1RhYihjbGFzc0FycmF5LCBwYXJhbXMpIHtcXG4gICAgT2JqZWN0LmFzc2lnbih0aGlzLCBwYXJhbXMpXFxuICAgIHRoaXMuYXJyID0gY2xhc3NBcnJheS5tYXAodiA9PiB0aGlzLmluaXQodikpXFxuICAgIHRoaXMuc2lnbiA9ICckJyArIE1ZX1JVTEUudGl0bGUgKyAnXycgKyAodGhpcy5uYW1lIHx8ICcnKSArICdfJ1xcbiAgICB0aGlzLmNvbG9yID0gdGhpcy5jb2xvciB8fCAnIzEyYjY2OCdcXG4gICAgdGhpcy5ib3VuZGFyeSA9IHRoaXMuYm91bmRhcnkgfHwgJ2JsYW5rX2Jsb2NrJ1xcbn1cXG5DbGFzc1RhYi5wcm90b3R5cGUgPSB7XFxuICAgIGNvbnN0cnVjdG9yOiBDbGFzc1RhYixcXG4gICAgbG9hZChlbCkge1xcbiAgICAgICAgbGV0IGZvbGRlZCA9IGdldFZhcignZm9sZF8nICsgdGhpcy5zaWduLCAnJylcXG4gICAgICAgIGlmICh0aGlzLmZvbGQpIGVsLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcImNvbG9yOiMwNDllZmZcXFwiPicgKyAoZm9sZGVkID8gJ+KWticgOiAn4pa8JyksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBmb2xkZWQpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdmb2xkXycgKyBzaWduLCB7ICcnOiAnVCcsICdUJzogJycgfSBbZm9sZGVkXSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCB0aGlzLnNpZ24sIGZvbGRlZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgICAgIGxldCBhcnIgPSBmb2xkZWQgPyBbdGhpcy5hcnJbMF1dIDogdGhpcy5hcnJcXG4gICAgICAgIGFyci5mb3JFYWNoKCh2KSA9PiB7XFxuICAgICAgICAgICAgbGV0IHsgaWQsIGNsYXNzX25hbWUsIGNsYXNzX3VybCB9ID0gdixcXG4gICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBKU09OLnN0cmluZ2lmeSh0aGlzLmdldENsYXNzKGlkKSlcXG4gICAgICAgICAgICBjbGFzc19uYW1lLmZvckVhY2goKG5hbWUsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGNsYXNzX3VybFtpXSxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXG4gICAgICAgICAgICAgICAgZWwucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogKHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6JyArIHRoaXMuY29sb3IgKyAnXFxcIj48Yj4nIDogJycpICsgbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBlbC5wdXNoKHsgY29sX3R5cGU6IHRoaXMuYm91bmRhcnkgfSlcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIGluaXQoY2xhc3NPYmplY3QpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc19uYW1lID0gY2xhc3NPYmplY3QuY2xhc3NfbmFtZS5zcGxpdCgnJicpXFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX3VybCA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc191cmwgPSBjbGFzc09iamVjdC5jbGFzc191cmwuc3BsaXQoJyYnKVxcbiAgICAgICA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gICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLmluY2x1ZGVzKCdAcnVsZT0nKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgW18sIHVybCwgcnVsZV0gPSB2LnVybC5tYXRjaCgvXihbXFxcXHNcXFxcU10qPylAcnVsZT0oW1xcXFxzXFxcXFNdKikkLylcXG4gICAgICAgICAgICAgICAgdi51cmwgPSB1cmxcXG4gICAgICAgICAgICAgICAgUlVMRS5kZXRhaWxfZmluZF9ydWxlID0gcnVsZVxcbiAgICAgICAgICAgICAgICBSVUxFLmRldGFpbF9jb2xfdHlwZSA9IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vcGFnZS8nKSkge1xcbiAgICAgICAgICAgICAgICBpZiAodi51cmwuaW5jbHVkZXMoJ3J1bGU9JykgfHwgKHYuZXh0cmEgfHwge30pLnJ1bGUpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IHYudXJsLnNwbGl0KCcjJylbMF0ubWF0Y2goL15oaWtlcjpcXFxcL1xcXFwvcGFnZVxcXFwvKC4rPykoPzpcXFxcPy4qKT8kLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICBzdWJQYWdlID0gTVlfUlVMRS5wYWdlTGlzdC5maW5kKCh2KSA9PiB2LnBhdGggPT0gcGF0aClcXG4gICAgICAgICAgICAgICAgUlVMRS5kZXRhaWxfZmluZF9ydWxlID0gc3ViUGFnZS5ydWxlXFxuICAgICAgICAgICAgICAgIFJVTEUuZGV0YWlsX2NvbF90eXBlID0gc3ViUGFnZS5jb2xfdHlwZVxcbiAgICAgICAgICAgICAgICBSVUxFLnBhcmFtcyA9IHYuZXh0cmEgfHwge31cXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCFNWV9SVUxFLmRldGFpbF9maW5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gICAgICAgICBpZiAodiA9PSAnKicpIHJldHVybiAnJ1xcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDMpID9cXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbShkYXRhLCB2KSA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAzKSB2ID0gcnVuQ29kZSh2KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICByZXMgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogTVlfUlVMRS5jb2xfdHlwZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIGlmIChyZXMudXJsKSB7XFxuICAgICAgICAgICAgaWYgKHJlcy51cmwuaW5jbHVkZXMoJ0BsYXp5UnVsZT0nKSkge1xcbiAgICAgICAgICAgICAgICByZXMudXJsID0gcmVzLnVybC5yZXBsYWNlKCcuanM6JywgJy5qczpcXFxcbmlmKE1ZX1JVTEUpT2JqZWN0LmFzc2lnbihNWV9SVUxFLCcgKyAkLnN0cmluZ2lmeSh7IHRpdGxlOiBNWV9SVUxFLnRpdGxlLCBwYWdlczogTVlfUlVMRS5wYWdlcywgcGFnZUxpc3Q6IE1ZX1JVTEUucGFnZUxpc3QsIGZpbmRfcnVsZTogJycsIHBhcmFtczogJycgfSkgKyAnKTsnKVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoTVlfUlVMRS5kZXRhaWxfZmluZF9ydWxl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AgIGxldCBmaW5kUnVsZSA9IE1ZX1JVTEUuZmluZF9ydWxlLnNwbGl0KCc7JylcXG4gICAgcGFyc2VEb21Gb3JBcnJheShnZXRSZXNDb2RlKCksIGZpbmRSdWxlLnNoaWZ0KCkpLmZvckVhY2goKGRhdGEpID0+IHtcXG4gICAgICAgIGxldCBbdGl0bGUsIGltZywgZGVzYywgdXJsXSA9IGZpbmRSdWxlLm1hcCgodiwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHYgPT0gJyonKSByZXR1cm4gJydcXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgdiA9IChpID09IDEgfHwgaSA9PSAzKSA/XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb20oZGF0YSwgdikgOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tRm9ySHRtbChkYXRhLCB2KVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgIT0gMykgdiA9IHJ1bkNvZGUodilcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCAmJiByZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpXFxuICAgICAgICAgICAgcmVzLnVybCA9IHJlcy51cmwucmVwbGFjZSgnLmpzOicsICcuanM6XFxcXG5pZihNWV9SVUxFKU9iamVjdC5hc3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ICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIHYudXJsID0gdi51cmwucmVwbGFjZSgnLmpzOicsICcuanM6XFxcXG5pZihNWV9SVUxFKU9iamVjdC5hc3NpZ24oTVlfUlVMRSwnICsgJC5zdHJpbmdpZnkoeyB0aXRsZTogTVlfUlVMRS50aXRsZSwgcGFnZXM6IE1ZX1JVTEUucGFnZXMsIHBhZ2VMaXN0OiBNWV9SVUxFLnBhZ2VMaXN0LCBmaW5kX3J1bGU6ICcnLCBwYXJhbXM6ICcnIH0pICsgJyk7JylcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLmluY2x1ZGVzKCdAcnVsZT0nKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgW18sIHVybCwgcnVsZV0gPSB2LnVybC5tYXRjaCgvXihbXFxcXHNcXFxcU10qPylAcnVsZT0oW1xcXFxzXFxcXFNdKikkLylcXG4gICAgICAgICAgICAgICAgdi51cmwgPSB1cmxcXG4gICAgICAgICAgICAgICAgUlVMRS5kZXRhaWxfZmluZF9ydWxlID0gcnVsZVxcbiAgICAgICAgICAgICAgICBSVUxFLmRldGFpbF9jb2xfdHlwZSA9IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vcGFnZS8nKSkge1xcbiAgICAgICAgICAgICAgICBpZiAodi51cmwuaW5jbHVkZXMoJ3J1bGU9JykgfHwgKHYuZXh0cmEgfHwge30pLnJ1bGUpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IHYudXJsLnNwbGl0KCcjJylbMF0ubWF0Y2goL15oaWtlcjpcXFxcL1xcXFwvcGF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HBhcmFtMiwgcGFyYW0zKVxcbiAgICB9XFxuXFxuICAgIGV2YWwoTVlfUlVMRS5maW5kX3J1bGUuc2xpY2UoMykpXFxufSBlbHNlIHtcXG4gICAgbGV0IGZpbmRSdWxlID0gTVlfUlVMRS5maW5kX3J1bGUuc3BsaXQoJzsnKVxcbiAgICBwYXJzZURvbUZvckFycmF5KGluZGV4SHRtbCwgZmluZFJ1bGUuc2hpZnQoKSkuZm9yRWFjaCgoZGF0YSkgPT4ge1xcbiAgICAgICAgbGV0IFt0aXRsZSwgaW1nLCBkZXNjLCB1cmxdID0gZmluZFJ1bGUubWFwKCh2LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodiA9PSAnKicpIHJldHVybiAnJ1xcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDMpID9cXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbShkYXRhLCB2KSA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAzKSB2ID0gcnVuQ29kZSh2KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICByZXMgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogTVlfUlVMRS5jb2xfdHlwZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIGlmIChyZXMudXJsKSB7XFxuICAgICAgICAgICAgaWYgKHJlcy51c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m9sZGVkKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgbGV0IGFyciA9IGZvbGRlZCA/IFt0aGlzLmFyclswXV0gOiB0aGlzLmFyclxcXFxuICAgICAgICBhcnIuZm9yRWFjaCgodikgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IHsgaWQsIGNsYXNzX25hbWUsIGNsYXNzX3VybCB9ID0gdixcXFxcbiAgICAgICAgICAgICAgICBzZWxlY3RlZCA9IEpTT04uc3RyaW5naWZ5KHRoaXMuZ2V0Q2xhc3MoaWQpKVxcXFxuICAgICAgICAgICAgY2xhc3NfbmFtZS5mb3JFYWNoKChuYW1lLCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGNsYXNzX3VybFtpXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgbm93ID0gSlNPTi5zdHJpbmdpZnkoeyBuYW1lOiBuYW1lLCB1cmw6IHVybCB9KVxcXFxuICAgICAgICAgICAgICAgIGVsLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogKHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOicgKyB0aGlzLmNvbG9yICsgJ1xcXFxcXFwiPjxiPicgOiAnJykgKyBuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNpZ24sIGlkLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduLCBub3cpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiA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wYXJhbXM6ICcnIH0pICsgJyk7JylcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdlxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQHJ1bGU9JykpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgW18sIHVybCwgcnVsZV0gPSB2LnVybC5tYXRjaCgvXihbXFxcXFxcXFxzXFxcXFxcXFxTXSo/KUBydWxlPShbXFxcXFxcXFxzXFxcXFxcXFxTXSopJC8pXFxcXG4gICAgICAgICAgICAgICAgdi51cmwgPSB1cmxcXFxcbiAgICAgICAgICAgICAgICBSVUxFLmRldGFpbF9maW5kX3J1bGUgPSBydWxlXFxcXG4gICAgICAgICAgICAgICAgUlVMRS5kZXRhaWxfY29sX3R5cGUgPSBNWV9SVUxFLmNvbF90eXBlXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vcGFnZS8nKSkge1xcXFxuICAgICAgICAgICAgICAgIGlmICh2LnVybC5pbmNsdWRlcygncnVsZT0nKSB8fCAodi5leHRyYSB8fCB7fSkucnVsZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXFxcbiAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IHYudXJsLnNwbGl0KCcjJylbMF0ubWF0Y2goL15oaWtlcjpcXFxcXFxcXC9cXFxcXFxcXC9wYWdlXFxcXFxcXFwvKC4rPykoPzpcXFxcXFxcXD8uKik/JC8pWzFdLFxcXFxuICAgICAgICAgICAgICAgICAgICBzdWJQYWdlID0gTVlfUlVMRS5wYWdlTGlzdC5maW5kKCh2KSA9PiB2LnBhdGggPT0gcGF0aClcXFxcbiAgICAgICAgICAgICAgICBSVUxFLmRldGFpbF9maW5kX3J1bGUgPSBzdWJQYWdlLnJ1bGVcXFxcbiAgICAgICAgICAgICAgICBSVUxFLmRldGFpbF9jb2xfdHlwZSA9IHN1YlBhZ2UuY29sX3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mRSdWxlLnNoaWZ0KCkpLmZvckVhY2goKGRhdGEpID0+IHtcXFxcbiAgICAgICAgbGV0IFt0aXRsZSwgaW1nLCBkZXNjLCB1cmxdID0gZmluZFJ1bGUubWFwKCh2LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHYgPT0gJyonKSByZXR1cm4gJydcXFxcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDMpID9cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tRm9ySHRtbChkYXRhLCB2KVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAzKSB2ID0gcnVuQ29kZSh2KVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIHJlcyA9IHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogTVlfUlVMRS5jb2xfdHlwZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICBpZiAocmVzLnVybCkge1xcXFxuICAgICAgICAgICAgaWYgKHJlcy51cmwuaW5jbHVkZXMoJ0BsYXp5UnVsZT0nKSkge1xcXFxuICAgICAgICAgICAgICAgIHJlcy51cmwgPSByZXMudXJsLnJlcGxhY2UoJy5qczonLCAnLmpzOlxcXFxcXFxcbmlmKE1ZX1JVTEUpT2JqZWN0LmFzc2lnbihN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XG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgcmVzID0ge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIGlmIChyZXMudXJsICYmIHJlcy51cmwuaW5jbHVkZXMoJ0BsYXp5UnVsZT0nKSlcXFxcbiAgICAgICAgICAgIHJlcy51cmwgPSByZXMudXJsLnJlcGxhY2UoJy5qczonLCAnLmpzOlxcXFxcXFxcbmlmKE1ZX1JVTEUpT2JqZWN0LmFzc2lnbihNWV9SVUxFLCcgKyAkLnN0cmluZ2lmeSh7IHRpdGxlOiBNWV9SVUxFLnRpdGxlLCBwYWdlczogTVlfUlVMRS5wYWdlcywgcGFnZUxpc3Q6IE1ZX1JVTEUucGFnZUxpc3QsIGZpbmRfcnVsZTogJycsIHBhcmFtczogJycgfSkgKyAnKTsnKVxcXFxuICAgICAgICBteUNvbGxlY3Rpb25fZWwucHVzaChyZXMpXFxcXG4gICAgfSlcXFxcbiAgICBzZXRSZXN1bHQobXlDb2xsZWN0aW9uX2VsKVxcXFxufVxcXFxuXFxcIn0se1xcXCJjb2xfdHlwZVxcXCI6XFxcIm1vdmllXzNcXFwiLFxcXCJuYW1lXFxcIjpcXFwi5pWw5o2u6L295YWlXFxcIixcXFwicGF0aFxcXCI6XFxcImRhdGFMb2FkXFxcIixcXFwicnVsZVxcXCI6X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dWVdID0gdi5zcGxpdCgnQCcpXFxcXG4gICAgICAgICAgICBvcHRpb25zLmhlYWRlcnNba2V5XSA9IHJ1bkNvZGUodmFsdWUpXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIC8vIOa3u+WKoOWFqOWxgFVBXFxcXG4gICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzWydVc2VyLUFnZW50J10pIHtcXFxcbiAgICAgICAgICAgIGlmIChNWV9SVUxFLnVhID09ICdwYycpXFxcXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5oZWFkZXJzWydVc2VyLUFnZW50J10gPSBQQ19VQVxcXFxuICAgICAgICAgICAgZWxzZSBpZiAoTVlfUlVMRS51YSA9PSAnbW9iaWxlJylcXFxcbiAgICAgICAgICAgICAgICBvcHRpb25zLmhlYWRlcnNbJ1VzZXItQWdlbnQnXSA9IE1PQklMRV9VQVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiB7IE1ZX1VSTDogdXJsWzBdLCBpbmRleEh0bWw6IGZldGNoKHVybFswXSwgb3B0aW9ucykgfVxcXFxuICAgIH1cXFxcbn1cXFxcblxcXCJ9XVwifSIsInBpY1VybCI6Imh0dHBzOi8vbS45a3UuY29tL2Zhdmljb24uaWNvIiwidGl0bGUiOiLkuZ3phbfpn7PkuZBwYyJ9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement