Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥设置@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwiQ2xhc3NUYWJcIixcInBhdGhcIjpcIkNsYXNzVGFiXCIsXCJydWxlXCI6XCJmdW5jdGlvbiBDbGFzc1RhYihjbGFzc0FycmF5LCBwYXJhbXMpIHtcXG4gICAgT2JqZWN0LmFzc2lnbih0aGlzLCBwYXJhbXMpXFxuICAgIHRoaXMuYXJyID0gY2xhc3NBcnJheS5tYXAodiA9PiB0aGlzLmluaXQodikpXFxuICAgIHRoaXMuc2lnbiA9ICckJyArIE1ZX1JVTEUudGl0bGUgKyAnXycgKyAodGhpcy5uYW1lIHx8ICcnKSArICdfJ1xcbiAgICB0aGlzLmNvbG9yID0gdGhpcy5jb2xvciB8fCAnIzEyYjY2OCdcXG4gICAgdGhpcy5ib3VuZGFyeSA9IHRoaXMuYm91bmRhcnkgfHwgJ2JsYW5rX2Jsb2NrJ1xcbn1cXG5DbGFzc1RhYi5wcm90b3R5cGUgPSB7XFxuICAgIGNvbnN0cnVjdG9yOiBDbGFzc1RhYixcXG4gICAgbG9hZChlbCkge1xcbiAgICAgICAgbGV0IGZvbGRlZCA9IGdldFZhcignZm9sZF8nICsgdGhpcy5zaWduLCAnJylcXG4gICAgICAgIGlmICh0aGlzLmZvbGQpIGVsLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcImNvbG9yOiMwNDllZmZcXFwiPicgKyAoZm9sZGVkID8gJ+KWticgOiAn4pa8JyksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBmb2xkZWQpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdmb2xkXycgKyBzaWduLCB7ICcnOiAnVCcsICdUJzogJycgfSBbZm9sZGVkXSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCB0aGlzLnNpZ24sIGZvbGRlZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgICAgIGxldCBhcnIgPSBmb2xkZWQgPyBbdGhpcy5hcnJbMF1dIDogdGhpcy5hcnJcXG4gICAgICAgIGFyci5mb3JFYWNoKCh2KSA9PiB7XFxuICAgICAgICAgICAgbGV0IHsgaWQsIGNsYXNzX25hbWUsIGNsYXNzX3VybCB9ID0gdixcXG4gICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBKU09OLnN0cmluZ2lmeSh0aGlzLmdldENsYXNzKGlkKSlcXG4gICAgICAgICAgICBjbGFzc19uYW1lLmZvckVhY2goKG5hbWUsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGNsYXNzX3VybFtpXSxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXG4gICAgICAgICAgICAgICAgZWwucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogKHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6JyArIHRoaXMuY29sb3IgKyAnXFxcIj48Yj4nIDogJycpICsgbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBlbC5wdXNoKHsgY29sX3R5cGU6IHRoaXMuYm91bmRhcnkgfSlcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIGluaXQoY2xhc3NPYmplY3QpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc19uYW1lID0gY2xhc3NPYmplY3QuY2xhc3NfbmFtZS5zcGxpdCgnJicpXFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX3VybCA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc191cmwgPSBjbGFzc09iamVjdC5jbGFzc191cmwuc3BsaXQoJyYnKVxcbiAgICAgICAgcmV0d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FtMylcXG4gICAgfVxcblxcbiAgICBldmFsKE1ZX1JVTEUuZmluZF9ydWxlLnNsaWNlKDMpKVxcbn0gZWxzZSB7XFxuICAgIGxldCBmaW5kUnVsZSA9IE1ZX1JVTEUuZmluZF9ydWxlLnNwbGl0KCc7JylcXG4gICAgcGFyc2VEb21Gb3JBcnJheShpbmRleEh0bWwsIGZpbmRSdWxlLnNoaWZ0KCkpLmZvckVhY2goKGRhdGEpID0+IHtcXG4gICAgICAgIGxldCBbdGl0bGUsIGltZywgZGVzYywgdXJsXSA9IGZpbmRSdWxlLm1hcCgodiwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHYgPT0gJyonKSByZXR1cm4gJydcXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgdiA9IChpID09IDEgfHwgaSA9PSAzKSA/XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb20oZGF0YSwgdikgOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tRm9ySHRtbChkYXRhLCB2KVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgIT0gMykgdiA9IHJ1bkNvZGUodilcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ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ywgZmluZFJ1bGUsIGRldGFpbEZpbmRSdWxlXSA9IE1ZX1JVTEUuZmluZF9ydWxlLm1hdGNoKC9eKC4qPykoPzo9PT4oLiopKT8kLylcXG4gICAgZmluZFJ1bGUgPSBmaW5kUnVsZS5zcGxpdCgnOycpXFxuICAgIHBhcnNlRG9tRm9yQXJyYXkoaW5kZXhIdG1sLCBmaW5kUnVsZS5zaGlmdCgpKS5mb3JFYWNoKChkYXRhKSA9PiB7XFxuICAgICAgICBsZXQgW3RpdGxlLCBpbWcsIGRlc2MsIHVybF0gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIHJlcyA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgaWYgKHJlcy51cmwpIHtcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcyg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9XFxuICAgICAgICAvLyBwb3N05pa55rOV5pe26L2s5o2i5Y+C5pWwXFxuICAgICAgICBpZiAoL15wb3N0JC9pLnRlc3Qob3B0aW9uc1snbWV0aG9kJ10pKSB7XFxuICAgICAgICAgICAgbGV0IFtvcmlVcmwsIGJvZHldID0gdXJsWzBdLnNwbGl0KCc/JylcXG4gICAgICAgICAgICB1cmxbMF0gPSBvcmlVcmwucmVwbGFjZSgv77yf77yfL2csICc/JylcXG4gICAgICAgICAgICBpZiAoYm9keS5zdGFydHNXaXRoKCdKc29uQm9keT0nKSkgYm9keSA9IGJvZHkuc2xpY2UoOSlcXG4gICAgICAgICAgICBvcHRpb25zWydib2R5J10gPSBib2R5XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodXJsWzJdKSBvcHRpb25zLmhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gb3B0aW9ucy5oZWFkZXJzWydDb250ZW50LVR5cGUnXS5zbGljZSgwLCAxOSkgKyB1cmxbMl1cXG4gICAgICAgIGlmICh1cmxbM10pIHVybFszXS5tYXRjaCgveyguKil9LylbMV0uc3BsaXQoJyYmJykuZm9yRWFjaCgodikgPT4ge1xcbiAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSB2LnNwbGl0KCdAJylcXG4gICAgICAgICAgICBvcHRpb25zLmhlYWRlcnNba2V5XSA9IHJ1bkNvZGUodmFsdWUpXFxuICAgICAgICB9KVxcbiAgICAgICAgLy8g5re75Yqg5YWo5bGAVUFcXG4gICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzWydVc2VyLUFnZW50J10pIHtcXG4gICAgICAgICAgICBpZiAoTVlfUlVMRS51YSA9PSAncGMnKVxcbiAgICAgICAgICAgICAgICBvcHRpb25zLmhlYWRlcnNbJ1VzZXItQWdlbnQnXSA9IFBDX1VBXFxuICAgICAgICAgICAgZWxzZSBpZiAoTVlfUlVMRS51YSA9PSAnbW9iaWxlJylcXG4gICAgICAgICAgICAgICAgb3B0aW9uc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ICAgIHJldHVybiB2XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9IHJlcy51cmwucmVwbGFjZSgnLmpzOicsICcuanM6XFxcXG5pZihNWV9SVUxFKU9iamVjdC5hc3NpZ24oTVlfUlVMRSwnICsgJC5zdHJpbmdpZnkoeyB0aXRsZTogTVlfUlVMRS50aXRsZSwgcGFnZXM6IE1ZX1JVTEUucGFnZXMsIHBhZ2VMaXN0OiBNWV9SVUxFLnBhZ2VMaXN0LCBmaW5kX3J1bGU6ICcnLCBwYXJhbXM6ICcnIH0pICsgJyk7JylcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGRldGFpbEZpbmRSdWxlKSB7XFxuICAgICAgICAgICAgICAgIHJlcy5leHRyYSA9IHsgUlVMRTogT2JqZWN0LmFzc2lnbih7fSwgTVlfUlVMRSwgeyB1cmw6IHJlcy51cmwsIGRldGFpbF9maW5kX3J1bGU6IGRldGFpbEZpbmRSdWxlIH0pLCBwYWdlVGl0bGU6IHRpdGxlIH1cXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9ICdoaWtlcjovL3BhZ2UvZGV0YWlsTG9hZD9ydWxlPScgKyBnZXRJdGVtKCdteUNvbGxlY3Rpb24nKVxcbiAgICAgICAgICAgIH1cXG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AgICAgICAgICAgICAgc2VsZWN0ZWQgPSBKU09OLnN0cmluZ2lmeSh0aGlzLmdldENsYXNzKGlkKSlcXFxcbiAgICAgICAgICAgIGNsYXNzX25hbWUuZm9yRWFjaCgobmFtZSwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBjbGFzc191cmxbaV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXFxcbiAgICAgICAgICAgICAgICBlbC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChzZWxlY3RlZCA9PSBub3cgPyAn4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjonICsgdGhpcy5jb2xvciArICdcXFxcXFxcIj48Yj4nIDogJycpICsgbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBpZCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiArIGlkLCBub3cpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIGVsLnB1c2goeyBjb2xfdHlwZTogdGhpcy5ib3VuZGFyeSB9KVxcXFxuICAg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sc2Uge1xcXFxuICAgIGxldCBmaW5kUnVsZSA9IE1ZX1JVTEUuZmluZF9ydWxlLnNwbGl0KCc7JylcXFxcbiAgICBwYXJzZURvbUZvckFycmF5KGluZGV4SHRtbCwgZmluZFJ1bGUuc2hpZnQoKSkuZm9yRWFjaCgoZGF0YSkgPT4ge1xcXFxuICAgICAgICBsZXQgW3RpdGxlLCBpbWcsIGRlc2MsIHVybF0gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAodiA9PSAnKicpIHJldHVybiAnJ1xcXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb20oZGF0YSwgdikgOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgcmVzID0ge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIGlmIChyZXMudXJsKSB7XFxcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxcXG4gIC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ICAgICAgICB9XFxcXG4gICAgICAgIGlmICh1cmxbMl0pIG9wdGlvbnMuaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSBvcHRpb25zLmhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddLnNsaWNlKDAsIDE5KSArIHVybFsyXVxcXFxuICAgICAgICBpZiAodXJsWzNdKSB1cmxbM10ubWF0Y2goL3soLiopfS8pWzFdLnNwbGl0KCcmJicpLmZvckVhY2goKHYpID0+IHtcXFxcbiAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSB2LnNwbGl0KCdAJylcXFxcbiAgICAgICAgICAgIG9wdGlvbnMuaGVhZGVyc1trZXldID0gcnVuQ29kZSh2YWx1ZSlcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgLy8g5re75Yqg5YWo5bGAVUFcXFxcbiAgICAgICAgaWYgKCFvcHRpb25zLmhlYWRlcnNbJ1VzZXItQWdlbnQnXSkge1xcXFxuICAgICAgICAgICAgaWYgKE1ZX1JVTEUudWEgPT0gJ3BjJylcXFxcbiAgICAgICAgICAgICAgICBvcHRpb25zLmhlYWRlcnNbJ1VzZXItQWdlbnQnXSA9IFBDX1VBXFxcXG4gICAgICAgICAgICBlbHNlIGlmIChNWV9SVUxFLnVhID09ICdtb2JpbGUnKVxcXFxuICAgICAgICAgICAgICAgIG9wdGlvbnMuaGVhZGVyc1snVXNlci1BZ2VudCddID0gTU9CSUxFX1VBXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgcmV0dXJuIHsgTVlfVVJMOiB1cmxbMF0sIGluZGV4SHRtbDogZmV0Y2godXJsWzBdLCBvcHRpb25zKSB9XFxcXG4gICAgfVxcXFxufVxcXFxuXFxcIn1dXCJ9IiwicGljVXJsIjoiaHR0cHM6Ly96My5heDF4LmNvbS8yMDIxLzA2LzE4L1JwYkxkTy5wbmciLCJ0aXRsZSI6Iuiuvue9riJ9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement