Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@电视直播@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi55S16KeG55u05pKtIiwiYXV0aG9yIjoi8J+PheS6rOaipuS/ruaUuVvlsI/mo4noooTwn4yeJkpva2VyXSIsInVybCI6Imhpa2VyOi8vZW1wdHkiLCJ2ZXJzaW9uIjo2LCJjb2xfdHlwZSI6Imljb25fMl9yb3VuZCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoibGl2ZSIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXCJoaWtlcjovL3BhZ2UvY29uZmlnXCIpKS5ydWxlKTsgLy9nZXRDb25maWdcblxubGV0IGRhdGEgPSBbXSxcbiAgICBjb25maWcgPSBnZXRDb25maWcoKTtcbmNvbmZpZy5kYXRhID0gY29uZmlnLmRhdGEuZmlsdGVyKHYgPT4gIXYuaW5WaXNpYmxlKTtcbmlmIChjb25maWcuZGF0YS5sZW5ndGggPD0gMCkge1xuICAgIGRhdGEgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJTZXR0aW5nJykucmVuZGVyU2V0dGluZygpO1xufSBlbHNlIHtcbiAgICBsZXQgc2VsZWN0ID0gZ2V0SXRlbShcImxpdmUtc2VsZWN0XCIsIGNvbmZpZy5kYXRhWzBdLm5hbWUpLFxuICAgICAgICBoYXMgPSBjb25maWcuZGF0YS5tYXAoaSA9PiBpLm5hbWUpLmluY2x1ZGVzKHNlbGVjdCk7XG4gICAgaWYgKCFoYXMpIHtcbiAgICAgICAgc2VsZWN0ID0gY29uZmlnLmR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a2V5JywgJycpXG4gICAgICAgIH0pXG4gICAgfSlcbiAgICBcbiAgICBmb3IgKHNvdXJjZSBvZiBjb25maWcuZGF0YSkge1xuICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgdGl0bGU6IHNvdXJjZS5uYW1lID09IHNlbGVjdCA/IFwi4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9J2NvbG9yOiAjMTlCODlEJz5cIiArIHNlbGVjdCArIFwiPC9zcGFuPlwiIDogc291cmNlLm5hbWUsXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCIsXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGEpID0+IHtcbiAgICAgICAgICAgICAgICBzZXRJdGVtKFwibGl2ZS1zZWxlY3RcIiwgYSk7XG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnc2VsZWN0R3JvdXAnLCAnJyk7XG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgICAgIH0sIHNvdXJjZS5uYW1lKVxuICAgICAgICB9KVxuICAgIH1cblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXG4gICAgfSlcblxuICAgIGZvciAoc291cmNlIG9mIGNvbmZpZy5kYXRhKSB7XG4gICAgICAgIGlmIChzb3VyY2UubmFtZSA9PSBzZWxlY3QpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgbGV0IGl0ZW1zID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvcmVuZGVyRGF0YScpLnJlbmRlckxpdmVEYXRhKHNvdXJjZS51cmwpO1xuICAgICAgICAgICAgICAgIGxldCBncm91cHMgPSBPYmplY3Qua2V5cyhpdGVtcyk7XG4gICAgICAgICAgICAgICAgLy9ncm91cHMucHVzaChncm91cHMuc3BsaWNlKGdyb3Vwcy5pbmRleE9mKDApLCAxKVswXSk7XG4gICAgICAgICAgICAgICAgbGV0IHNlbGVjdEdyb3VwID0gZ2V0SXRlbSgnc2VsZWN0R3JvdXAnLCBncm91cHNbMF0pO1xuICAgICAgICAgICAgICAgIGlmIChzZWxlY3RHcm91cCA9PSBcIlwiIHx8ICFncm91cHMuaW5jbHVkZXMoc2VsZWN0R3JvdXApKSBzZWxlY3RHcm91cCA9IGdyb3Vwc1swXTtcbiAgICAgICAgICAgICAgICBncm91cHMuZm9yRWFjaCgoZ3JvdXApID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBncm91cCA9PSBzZWxlY3RHcm91cCA/IFwi4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9J2NvbG9yOiAjMTlCODlEJz5cIiArIGdyb3VwICsgXCI8L3NwYW4+XCIgOiBncm91cCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGdyb3VwKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3NlbGVjdEdyb3VwJywgZ3JvdXApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZ3JvdXApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgdGl0bGUgaW4gaXRlbXNbc2VsZWN0R3JvdXBdKSB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBpdGVtc1tzZWxlY3RHcm91cF1bdGl0bGVdLnVybCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBpdGVtc1tzZWxlY3RHcm91cF1bdGl0bGVdLmhlYWRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9jb2xfdHlwZTogJ3RleHRfMycsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMjIxLnBuZ1wiXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIuaVsOaNruWKoOi9veWksei0pVxcblwiICsgSlNPTi5zdHJpbmdpZnkoZSksXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcImxvbmdfdGV4dFwiXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuXG5cbn1cbnNld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5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBpdGVtc1tncm91cF1bdGl0bGVdLnVybCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaXRlbXNbZ3JvdXBdW3RpdGxlXS5oZWFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzZXRSZXN1bHQoZCk7XG4gICAgICAgIH0sIHNvdXJjZS51cmwsIGdldE15VmFyKCd0aXRsZScpKVxuICAgIH07XG59KVxuc2V0UmVzdWx0KFt7XG4gICAgdGl0bGU6IFwi54K55oiR5byA5aeL6IGa5pCcXCIsXG4gICAgdXJsOiBcImhpa2VyOi8vc2VhcmNoP3M9XCIgKyBnZXRQYXJhbShcImtleVwiKSxcbiAgICBleHRyYToge1xuICAgICAgICBydWxlczogJC50b1N0cmluZygocnVsZXMpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcylcbiAgICAgICAgfSwgcnVsZXMpXG4gICAgfVxufV0pIiwiZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsImRldGFpbF9maW5kX3J1bGUiOiIiLCJzZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsInNkZXRhaWxfZmluZF9ydWxlIjoiIiwidWEiOiJtb2JpbGUiLCJwcmVSdWxlIjoicHV0TXlWYXIoJ3RpdGxlJyxNWV9SVUxFLnRpdGxlKTsiLCJwYWdlcyI6Ilt7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Yqg6L295pWw5o2uXCIsXCJwYXRoXCI6XCJjb25maWdcIixcInJ1bGVcIjpcImZ1bmN0aW9uIGdldENvbmZpZygpIHtcXG4gICAgdHJ5IHtcXG4gICAgICAgIGxldCBjb25maWcgPSBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIik7XFxuICAgICAgICBpZiAoIWNvbmZpZyB8fCBjb25maWcgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICBkYXRhOiBbXSxcXG4gICAgICAgICAgICAgICAgdmVyc2lvbjogMFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoY29uZmlnKVxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHRvYXN0KFxcXCLphY3nva7mlofku7bmoLzlvI/mnInor69cXFwiKVxcbiAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgZGF0YTogW10sXFxuICAgICAgICAgICAgdmVyc2lvbjogMFxcbiAgICAgICAgfVxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5om56YeP5a+85YWlXCIsXCJwYXRoXCI6XCJiYXRjaEltXCIsXCJydWxlXCI6XCJmdW5jdGlvbiBiYXRjaEltcG9ydChpbnB1dCwgcnVsZSkge1xcbiAgICBpbnB1dCA9IGlucHV0LnRyaW0oKTtcXG4gICAgaWYgKGlucHV0Lmxlbmd0aCA8IDMgfHwgaW5wdXRbMF0gIT0gXFxcIntcXFwiKSB7XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K+36L6T5YWl5q2j56Gu55qE5qC85byPXFxcIlxcbiAgICB9XFxuICAgIGxldCBpbSA9IEpTT04ucGFyc2UoaW5wdXQpO1xcbiAgICBpZiAoaW0uZGF0YSA9PSBudWxsIHx8IGltLmRhdGEubGVuZ3RoIDwgMS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dLFxcbiAgICAgICAgICAgICAgICAgICAgIGFyciA9IGNvbi5zcGxpdCgnJiYnKTtcXG4gICAgICAgICAgICAgICAgYXJyLmZvckVhY2goKGkpPT57XFxuICAgICAgICAgICAgICAgICAgICBsZXQgW2tleSx2YWx1ZV0gPSBpLnNwbGl0KCdAJyk7XFxuICAgICAgICAgICAgICAgICAgICBvYmpba2V5XSA9IHZhbHVlLnJlcGxhY2UoLzsvZywn77yb77ybJyk7XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGFycmF5W2luZGV4XSA9IHYubWF0Y2goL14oW147XSopO1xcXFx7LylbMV1cXG4gICAgICAgICAgICAgICAgaGVhZGVycy5wdXNoKG9iaik7XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnMucHVzaCh7J1VzZXItQWdlbnQnIDogTU9CSUxFX1VBLnJlcGxhY2UoLzsvZywn77yb77ybJyl9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyYXlbaW5kZXhdID0gYXJyYXlbaW5kZXhdLnJlcGxhY2UoLzsvZywn77yb77ybJykrJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgIH0pO1xcbiAgICAgICAgaWYgKGl0ZW1zW2dyb3VwXSkge1xcbiAgICAgICAgICAgIGlmIChpdGVtc1tncm91cF1bdGl0bGVdKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zW2dyb3VwXVt0aXRsZV0udXJsID0gaXRlbXNbZ3JvdXBdW3RpdGxlXS51cmwuY29uY2F0KHVybCk7XFxuICAgICAgICAgICAgICAgIGl0ZW1zW2dyb3VwXVt0aXRsZV0uaGVhZGVycyA9IGl0ZW1zW2dyb3VwXVt0aXRsZV0uaGVhZGVycy5jb25jYXQoaGVhZGVycyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaXRlbXNbZ3JvdXBdW3RpdGxlXSA9IHt1cmw6dXJsLGh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T5YWl6K6i6ZiF5qCH6aKYXFxcIikuaW5wdXQoKHVybCwgcnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWc/cnVsZT1cXFwiICsgcnVsZSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2xpdmUvY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5L+d5a2YXFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgZ2V0TXlWYXIoJ3RpdGxlJykpXFxuICAgIH0pO1xcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGdldENvbG9yZWRUZXh0KFxcXCLmibnph4/lr7zlhaVcXFwiKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICB1cmw6ICQoJycsJ+aUr+aMgeWOn+Wni+aVsOaNruWSjOS6keWJqui0tOadv+WIhuS6q+mTvuaOpScpLmlucHV0KChydWxlKSA9PiB7XFxuICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9iYXRjaEltP3J1bGU9XFxcIiArIHJ1bGUpKS5ydWxlKTtcXG4gICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aCgn55S16KeG55u05pKt5YiG5LqrIyMnKSkge1xcbiAgICAgICAgICAgICAgICBpbnB1dCA9IHBhcnNlUGFzdGUoaW5wdXQuc3BsaXQoJyMjXFxcXG4nKVsxXSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBiYXRjaEltcG9ydChpbnB1dCwgcnVsZSk7XFxuICAgICAgICB9LCBnZXRNeVZhcigndGl0bGUnKSlcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0Q29sb3JlZFRleHQoXFxcIuWvvOWHuuWFqOmDqFxcXCIpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgIHVybDogJChbXFxcIuWOn+Wni+aVsOaNrlxcXCIsIFxcXCLkupHliarotLTmnb9cXFwiXSwgMSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICByZXR1cm4gJCgn56Gu5a6a5a+85Ye677yfXFxcXG4o56aB55So6K6i6ZiF5LiN5Lya5a+85Ye6KScpLmNvbmZpcm0oKHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICBjb25maWcuZGF0YSA9IGNvbmZpZy5kYXRhLmZpbHRlcih2ID0+ICF2LmluVmlzaWJsZSk7XFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09IFxcXCLkupHliarotLTmnb9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YSA9ICfnl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1vZGUgPyAn4oCc4oCc4oCd4oCdJyArIHYuYm9sZCgpLmZvbnRjb2xvcignIzE5Qjg5RCcpIDogdixcXG4gICAgICAgICAgICB1cmw6IHYgPT0gZWRpdE1vZGUgPyAnaGlrZXI6Ly9lbXB0eScgOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh2KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdlZGl0TW9kZScsIHYpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgdiksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGNvbmZpZy5kYXRhLmZvckVhY2goKHYsIGkpID0+IHtcXG4gICAgICAgIGxldCBlbCA9IHtcXG4gICAgICAgICAgICB0aXRsZTogdi5uYW1lLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfVxcbiAgICAgICAgc3dpdGNoIChlZGl0TW9kZSkge1xcbiAgICAgICAgICAgIGNhc2UgJ+WQr+eUqOemgeeUqCc6XFxuICAgICAgICAgICAgICAgIGVsLnRpdGxlID0gKHYuaW5WaXNpYmxlID8gJ/CflLQgJyA6ICfwn5+iICcpICsgZWwudGl0bGVcXG4gICAgICAgICAgICAgICAgZWwudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhW2ldLmluVmlzaWJsZSA9ICFjb25maWcuZGF0YVtpXS5pblZpc2libGU7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIGNhc2UgJ+WIoOmZpOiuoumYhSc6XFxuICAgICAgICAgICAgICAgIGVsLnVybCA9IFxcXCJjb25maXJtOi8v56Gu6K6k5Yig6Zmk4oCcXFxcIiArIHYubmFtZSArIFxcXCLigJ3orqLpmIXvvJ8uanM6XFxcIiArICQudG9TdHJpbmcoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YSA9IGNvbmZpZy5kYXRhLmZpbHRlcihpID0+IGkubmFtZSAhPSBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5Yig6ZmkXFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgdi5uYW1lKVxcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIGNhc2UgJ+mHjeaWsOaOkuW6jyc6XFxuICAgICAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgICAgICBlbC50aXRsZSA9IChzb3J0RmxhZyA9PSBpID8gJ/CflIMgICcgOiAnJykgKyBlbC50aXRsZVxcbiAgICAgICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgICAgICBlbC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBlbC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YS5zcGxpY2UobmV3SW5kZXgsIDAsIGNvbmZpZy5kYXRhLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2xpdmUvY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIGNhc2UgJ+e8lui+keiuoumYhSc6XFxuICAgICAgICAgICAgICAgIGxldCBhcnIgPSBbJ+e8lui+keWQjeensCcsICfnvJbovpHlnLDlnYAnLCAn57yW6L6R5YaF5a65J107XFxuICAgICAgICAgICAgICAgIGVsLnVybCA9ICQoYXJyLCAzKS5zZWxlY3QoKHYsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSAn57yW6L6R5ZCN56ewJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHYubmFtZSwgJ+i+k+WFpeaWsOWQjeensCcpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YVtpXS5uYW1lID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5LiN6IO95Li656m6J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09ICfnvJbovpHlnLDlnYAnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQodi51cmwsICfovpPlhaXmlrDlnLDlnYAnKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeiDveS4uuepulxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5pbmRleE9mKFxcXCJodHRwXFxcIikgIT0gMCAmJiBpbnB1dC5pbmRleE9mKFxcXCJmaWxlXFxcIikgIT0gMCAmJiBpbnB1dC5pbmRleE9mKFxcXCJoaWtlclxcXCIpICE9IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/mnInor69cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YVtpXS51cmwgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2xpdmUvY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSAn57yW6L6R5YaF5a65Jykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2LnVybC5zdGFydHNXaXRoKCdmaWxlOi8vJykgfHwgdi51cmwuc3RhcnRzV2l0aCgnaGlrZXI6Ly9maWxlcycpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZWRpdEZpbGU6Ly8nICsgdi51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZWRpdEZpbGU6Ly9oaWtlcjovL2ZpbGVzL2xpYnMvJyArIG1kNSh2LnVybCkgKyAnLmpzJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCB2LCBpKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAn5riF6Zmk57yT5a2YJzpcXG4gICAgICAgICAgICAgICAgZWwudXJsID0gJCgn56Gu5a6a5riF6Zmk4oCcJyArIHYubmFtZSArICfigJ3orqLpmIXnvJPlrZjvvJ9cXFxcbijlj6/nq4vljbPmm7TmlrApJykuY29uZmlybSgodXJsKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlQ2FjaGUodXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/muIXpmaTmiJDlip8nXFxuICAgICAgICAgICAgICAgIH0sdi51cmwpXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKGVsKVxcbiAgICB9KTtcXG4gICAgcmV0dXJuIGQ7XFxufVxcblxcbiQuZXhwb3J0cyA9IHtcXG4gICAgcmVuZGVyU2V0dGluZzogcmVuZGVyU2V0dGluZ1xcbn1cIn1dIiwiaWNvbiI6Imh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzg3LnBuZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment