Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@用心直播@eyJmaXJzdEhlYWRlciI6ImNsYXNzIiwibGFzdF9jaGFwdGVyX3J1bGUiOiIiLCJ0aXRsZSI6IueUqOW/g+ebtOaSrSIsImF1dGhvciI6IuWwj+ajieiihPCfjJ4mSm9rZXIm54ix5piv55So5b+DIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSNmeUFsbCIsInZlcnNpb24iOjAsImNvbF90eXBlIjoidGV4dF8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJsaXZlIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG5sZXQgZGF0YSA9IFtdLFxuICAgIGNvbmZpZ1BhdGggPSBcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblwiO1xuaWYgKCFmaWxlRXhpc3QoY29uZmlnUGF0aCkpIHtcbiAgICB3cml0ZUZpbGUoY29uZmlnUGF0aCwgXCJcIik7XG59XG5sZXQgY29uZmlnID0gZmV0Y2goY29uZmlnUGF0aCksXG4gICAgcmVuZGVyU2V0dGluZyA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3JlbmRlclNldHRpbmcnKS5yZW5kZXJTZXR0aW5nO1xuXG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdChcImhpa2VyOi8vcGFnZS9jb25maWdcIikpLnJ1bGUpO1xuVVJMID0gXCJoaWtlcjovL2VtcHR5XCIgKyBnZXRWYXIoJ3NldCcpO1xuaWYgKGNvbmZpZyA9PSBcIlwiIHx8IFVSTC5pbmRleE9mKCdzZXR0aW5nJykgPiAwKSB7XG4gICAgZGF0YSA9IHJlbmRlclNldHRpbmcoKTtcbn0gZWxzZSB7XG4gICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XG4gICAgaWYgKGNvbmZpZy5kYXRhLmxlbmd0aCA8PSAwKSB7XG4gICAgICAgIGRhdGEgPSByZW5kZXJTZXR0aW5nKCk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgbGV0IHNlbGVjdCA9IGdldFZhcihcImxpdmUtc2VsZWN0XCIsIGNvbmZpZy5kYXRhWzBdLm5hbWUpO1xuICAgICAgICBsZXQgaGFzID0gY29uZmlnLmRhdGEubWFwKGkgPT4gaS5uYW1lKS5pbmNsdWRlcyhzZWxlY3QpO1xuICAgICAgICBpZiAoIWhhcykge1xuICAgICAgICAgICAgc2VsZWN0ID0gY29uZmlnLmRhdGFbMF0ubmFtZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogJ/CflI0nLFxuICAgICAgICAgICAgZGVzYzogJ+ivt+i+k+WFpeaQnOe0ouWFs+mUruivjScsXG4gICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0VmFyKCdzZWFyY2hfa2V5JywgJycpLFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAncHV0VmFyKFwic2VhcmNoX2tleVwiLGlucHV0KSdcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3NlYXJjaD9ydWxlPScgKyBnZXRNeVZhcigndGl0bGUnKSArICcmcz0nICsgZ2V0VmFyKCdzZWFyY2hfa2V5JywgJycpXG4gICAgICAgICAgICB9KVxuICAgICAgICB9KVxuXG4gICAgICAgIGZvciAoc291cmNlIG9mIGNvbmZpZy5kYXRhKSB7XG4gICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgIHRpdGxlOiBzb3VyY2UubmFtZSA9PSBzZWxlY3QgPyBcIuKAnOKAnOKAneKAnTxzcGFuIHN0eWxlPSdjb2xvcjogIzE5Qjg5RCc+XCIgKyBzZWxlY3QgKyBcIjwvc3Bhbj5cIiA6IHNvdXJjZS5uYW1lLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGEpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFwibGl2ZS1zZWxlY3RcIiwgYSk7XG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzZWxlY3RHcm91cCcsICcnKTtcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwiaGlrZXI6Ly9lbXB0eVwiXG4gICAgICAgICAgICAgICAgfSwgc291cmNlLm5hbWUpXG4gICAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogXCLorr7nva5cIixcbiAgICAgICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgICAgIHVybDogJChcIlwiKS5sYXp5UnVsZSgoKSA9PiB7XG4gICAgICAgICAgICAgICAgcHV0VmFyKFwic2V0XCIsICcjc2V0dGluZycpO1xuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH0pXG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXG4gICAgICAgIH0pXG4gICAgICAgIGZvciAoc291cmNlIG9mIGNvbmZpZy5kYXRhKSB7XG4gICAgICAgICAgICBpZiAoc291cmNlLm5hbWUgPT0gc2VsZWN0KSB7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGl0ZW1zID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvcmVuZGVyRGF0YScpLnJlbmRlckxpdmVEYXRhKHNvdXJjZS51cmwpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgZ3JvdXBzID0gT2JqZWN0LmtleXMoaXRlbXMpO1xuICAgICAgICAgICAgICAgICAgICBncm91cHMucHVzaChncm91cHMuc3BsaWNlKGdyb3Vwcy5pbmRleE9mKDApLCAxKVswXSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBzZWxlY3RHcm91cCA9IGdldE15VmFyKCdzZWxlY3RHcm91cCcsIGdyb3Vwc1swXSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzZWxlY3RHcm91cCA9PSBcIlwiKSBzZWxlY3RHcm91cCA9IGdyb3Vwc1swXTtcbiAgICAgICAgICAgICAgICAgICAgZ3JvdXBzLmZvckVhY2goKGdyb3VwKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ3JvdXAgPT0gc2VsZWN0R3JvdXAgPyBcIuKAnOKAnOKAneKAnTxzcGFuIHN0eWxlPSdjb2xvcjogIzE5Qjg5RCc+XCIgKyBncm91cCArIFwiPC9zcGFuPlwiIDogZ3JvdXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZ3JvdXApID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzZWxlY3RHcm91cCcsIGdyb3VwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGdyb3VwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHRpdGxlIGluIGl0ZW1zW3NlbGVjdEdyb3VwXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IGl0ZW1zW3NlbGVjdEdyb3VwXVt0aXRsZV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcbmNvbF90eXBlOiAnaWNvbl8yX3JvdW5kJyxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBcImh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzIyOC5wbmdcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIuaVsOaNruWKoOi9veWksei0pVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogSlNPTi5zdHJpbmdpZnkoZSksXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXCJ0ZXh0XzFcIlxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cbnNldFJlc3VsdChkYXRhKTsiLCJzZWFyY2hfdXJsIjoiaGlrZXI6Ly9lbXB0eT9rZXk9KioiLCJncm91cCI6IjPnm7Tmkq0iLCJzZWFyY2hGaW5kIjoianM6XG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdChcImhpa2VyOi8vcGFnZS9jb25maWdcIikpLnJ1bGUpO1xubGV0IGNvbmZpZyA9IGdldENvbmZpZygpO1xubGV0IHJ1bGVzID0gY29uZmlnLmRhdGEubWFwKChzb3VyY2UpID0+IHtcbiAgICByZXR1cm4ge1xuICAgICAgICB0aXRsZTogc291cmNlLm5hbWUsXG4gICAgICAgIHNlYXJjaF91cmw6ICdoaWtlcjovL2VtcHR5P2tleT0qKicsXG4gICAgICAgIHNlYXJjaEZpbmQ6ICdqczonICsgJC50b1N0cmluZygodXJsLCBydWxlX3RpdGxlKSA9PiB7XG4gICAgICAgICAgICBsZXQgZCA9IFtdLFxuICAgICAgICAgICAgICAgIGtleSA9IGdldFBhcmFtKCdrZXknKTtcbiAgICAgICAgICAgIGxldCBpdGVtcyA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3JlbmRlckRhdGE/cnVsZT0nICsgcnVsZV90aXRsZSkucmVuZGVyTGl2ZURhdGEodXJsKTtcbiAgICAgICAgICAgIGZvciAobGV0IGdyb3VwIGluIGl0ZW1zKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgdGl0bGUgaW4gaXRlbXNbZ3JvdXBdKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aXRsZS5pbmRleE9mKGtleSkgPj0gMCB8fCB0aXRsZS50b0xvd2VyQ2FzZSgpLmluZGV4T2Yoa2V5KSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogaXRlbXNbZ3JvdXBdW3RpdGxlXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xuICAgICAgICB9LCBzb3VyY2UudXJsLCBnZXRNeVZhcigndGl0bGUnKSlcbiAgICB9O1xufSlcbnNldFJlc3VsdChbe1xuICAgIHRpdGxlOiBcIueCueaIkeW8gOWni+iBmuaQnFwiLFxuICAgIHVybDogXCJoaWtlcjovL3NlYXJjaD9zPVwiICsgZ2V0UGFyYW0oXCJrZXlcIiksXG4gICAgZXh0cmE6IHtcbiAgICAgICAgcnVsZXM6ICQudG9TdHJpbmcoKHJ1bGVzKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocnVsZXMpXG4gICAgICAgIH0sIHJ1bGVzKVxuICAgIH1cbn1dKSIsImRldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJkZXRhaWxfZmluZF9ydWxlIjoiIiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6IiIsInVhIjoibW9iaWxl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uc3BsaXQoXFxcIjovL1xcXCIpWzFdLnNwbGl0KFxcXCIvXFxcIilbMF07XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiBudWxsXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgdmFyIHR4dHMgPSBmZXRjaENhY2hlKHVybCwyNCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgUmVmZXJlcjogZ2V0UmVmZXJlcih1cmwpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkucmVwbGFjZSgvI0VYVElORjotMSAsL2csICcnKVxcbiAgICAgICAgLnJlcGxhY2UoLyNFWFRJTkY6LTEsL2csICcnKVxcbiAgICAgICAgLnJlcGxhY2UoL1xcXFxuI2dlbnJlIy9nLCAnLCNnZW5yZSMnKVxcbiAgICAgICAgLnJlcGxhY2UoLyNFWFRJTkY6LTEvZywgJycpXFxuICAgICAgICAucmVwbGFjZSgvZ3JvdXAtdGl0bGU9XFxcIi9nLCAnJylcXG4gICAgICAgIC5yZXBsYWNlKC9cXFxcbmh0dHAvZywgJyxodHRwJylcXG4gICAgICAgIC5yZXBsYWNlKC89L2csICcnKVxcbiAgICAgICAgLnJlcGxhY2UoL++8jCMvZywgJywjJylcXG4gICAgICAgIC5yZXBsYWNlKC9cXFwiLC9nLCAnLycpXFxuICAgICAgICAucmVwbGFjZSgvIC9nLCAnJylcXG4gICAgICAgIC5zcGxpdCgnXFxcXG4nKTtcXG4gICAgY29uc3QgZDEgPSBbXVxcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHR4dHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIHZhciByID0ge307XFxuICAgICAgICB2YXIgaiA9IHR4dHNbaV0uc3BsaXQoJywnKTtcXG4gICAgICAgIGlmICh0eHRzW2ldLmluZGV4T2YoXFxcIiNFWFRJTkZcXFwiKSA9PSAwICYmXFxuICAgICAgICAgICAgai5sZW5ndGggPT0gMyAmJiBqWzJdLmluZGV4T2YoXFxcImh0dHBcXFwiKSA9PSAwKSB7XFxuICAgICAgICAgICAgci50aXRsZSA9IGpbMV0uc3BsaXQoJy8nKVtqWzBdLnNwbGl0KCcvJykubGVuZ3RoIC0gMV07XFxuICAgICAgICAgICAgci51cmwgPSBqWzJdLnJlcGxhY2UoYFxcXFxuYCwgJycpLnJlcGxhY2UoJ1xcXFxyJywgJycpO1xcbiAgICAgICAgICAgIGlmIChyLnVybC5pbmRleE9mKFxcXCJodHRwXFxcIikgPT0gMCkge1xcbiAgICAgICAgICAgICAgICByLnVybCA9IHIudXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZDEucHVzaChyKTtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmIChqLmxlbmd0aCA8IDIpIHtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHIudGl0bGUgPSBqWzBdLnNwbGl0KCcvJylbalswXS5zcGxpdCgnLycpLmxlbmd0aCAtIDFdO1xcbiAgICAgICAgci51cmwgPSBqWzFdLnJlcGxhY2UoYFxcXFxuYCwgJycpLnJlcGxhY2UoJ1xcXFxyJywgJycpO1xcbiAgICAgICAgaWYgKHIudXJsLmluZGV4T2YoXFxcImh0dHBcXFwiKSA9PSAwKSB7XFxuICAgICAgICAgICAgci51cmwgPSByLnVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBkMS5wdXNoKHIpO1xcbiAgICB9XFxuICAgIC8v5aSa57q/6LevXFxuICAgIGNvbnN0IGQyID0ge31cXG4gICAgZm9yIChsZXQgaXQgb2YgZDEpIHtcXG4gICAgICAgIGlmIChkMltpdC50aXRsZV0gPT0gbnVsbCkge1xcbiAgICAgICAgICAgIGQyW2l0LnRpdGxlXSA9IFtdXFxuICAgICAgICB9XFxuICAgICAgICBkMltpdC50aXRsZV0ucHVzaChpdC51cmwpXFxuICAgIH1cXG4gICAgcmV0dXJuIGQyO1xcbn1cXG5cXG5mdW5jdGlvbiByZW5kZXJMaXZlRGF0YTIodXJsKSB7XFxuICAgIGZ1bmN0aW9uIGdldFJlZmVyZXIodXJsKSB7XFxuICAgICAgICBpZiAodXJsLmluZGV4T2YoXFxcImdpdGVlXFxcIikgPiAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL1xcXCIgKyB1cmwuc3BsaXQoXFxcIjovL1xcXCIpWzFdLnNwbGl0KFxcXCIvXFxcIilbMF07XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiBudWxsXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgY29uc3QgbTN1ID0gZmV0Y2hDYWNoZSh1cmwsIDI0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICBSZWZlcmVyOiBnZXRSZWZlcmVyKHVybClcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIG1vZGUgPSBtM3UuaW5kZXhPZignI0VYVE0zVScpID09IDAsXFxuICAgICAgICByZSA9IG1vZGUgPyAvKC4qKSwoLiopXFxcXHMqPygoPzpodHRwfHJ0bXApW14jXFxcXHNdKikvZyA6IC8oKSguKiksKCNnZW5yZSN8KD86aHR0cHxydG1wKVteI1xcXFxzXSopL2c7XFxuICAgIGxldCBpdGVtcyA9IHt9LFxcbiAgICAgICAgZ3JvdXAgPSAn5pyq5YiG57uEJztcXG4gICAgZm9yIChsZXQgaSA9IHJlLmV4ZWMobTN1KTsgaSAhPSBudWxsOyBpID0gcmUuZXhlYyhtM3UpKSB7XFxuICAgICAgICBpZiAobW9kZSkge1xcbiAgICAgICAgICAgIGdyb3VwID0gKC9ncm91cC10aXRsZT1cXFwiKC4qPylcXFwiLy5leGVjKGlbMV0pIHx8IFtudWxsLCAnJ10pWzFdO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Lor7fovpPlhaXnm7Tmkq3mupDorqLpmIXlnLDlnYBcXFwiLFxcbiAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChydWxlKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kuI3og73kuLrnqbpcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5pbmRleE9mKFxcXCJodHRwXFxcIikgIT0gMCAmJiBpbnB1dC5pbmRleE9mKFxcXCJmaWxlXFxcIikgIT0gMCAmJiBpbnB1dC5pbmRleE9mKFxcXCJoaWtlclxcXCIpICE9IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+acieivr1xcXCJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImlucHV0Oi8vLy8vL+ivt+i+k+WFpeiuoumYheagh+mimC5qczpcXFwiICsgJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZz9ydWxlPVxcXCIgKyBydWxlKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNv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pmaTmraTorqLpmIXvvJ8uanM6XFxcIiArICQudG9TdHJpbmcoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2xpdmUvY29uZmlnLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZyA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IFtdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZlcnNpb246IDBcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IEpTT04ucGFyc2UoY29uZmlnKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhID0gY29uZmlnLmRhdGEuZmlsdGVyKGkgPT4gaS5uYW1lICE9IG5hbWUpO1xcblxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0OuW3suWIoOmZpFxcXCI7XFxuICAgICAgICAgICAgfSwgc291cmNlLm5hbWUpXFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIHJldHVybiBkXFxufVxcblxcbiQuZXhwb3J0cyA9IHtcXG4gICAgcmVuZGVyU2V0dGluZzogcmVuZGVyU2V0dGluZ1xcbn1cIn1dIiwiaWNvbiI6Imh0dHA6Ly9xMS5xbG9nby5jbi9nP2I9cXEmbms9MTMwMjQwNzIxNiZzPTY0MCIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment