Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@聚直播@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6IGa55u05pKtIiwiYXV0aG9yIjoi5bCP5qOJ6KKE8J+MniZKb2tlciIsInVybCI6Imhpa2VyOi8vZW1wdHkiLCJ2ZXJzaW9uIjoxMCwiY29sX3R5cGUiOiJpY29uXzJfcm91bmQiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6ImxpdmUiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1wiKSkucnVsZSk7IC8vZ2V0Q29uZmlnXG5cbmxldCBkYXRhID0gW10sXG4gICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XG5jb25maWcuZGF0YSA9IGNvbmZpZy5kYXRhLmZpbHRlcih2ID0+ICF2LmluVmlzaWJsZSk7XG5cbmlmIChjb25maWcuZGF0YS5sZW5ndGggPD0gMCkge1xuICAgIGRhdGEgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJTZXR0aW5nJykucmVuZGVyU2V0dGluZygpO1xufSBlbHNlIHtcbiAgICBsZXQgc2VsZWN0ID0gZ2V0SXRlbShcImxpdmUtc2VsZWN0XCIsIGNvbmZpZy5kYXRhWzBdLm5hbWUpLFxuICAgICAgICBoYXMgPSBjb25maWcuZGF0YS5tYXAoaSA9PiBpLm5hbWUpLmluY2x1ZGVzKHNlbGVjdCk7XG4gICAgaWYgKCFoYXMpIHtcbiAgICAgICAgc2VsZWN0ID0gY29uZmlnLmRhdGFbMF0ubmFtZTtcbiAgICB9XG5cbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogJ+iBmuebtOaSrScuYm9sZCgpICsgJyAmbmJzcCAmbmJzcCAnICsgJ+KamSDogZrnm7Tmkq3orr7nva4g4pqZJy5zbWFsbCgpLFxuICAgICAgICBjb2xfdHlwZTogXCJhdmF0YXJcIixcbiAgICAgICAgcGljX3VybDogTVlfUlVMRS5pY29uLFxuICAgICAgICB1cmw6ICQoXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcIikucnVsZSgoKSA9PiB7XG4gICAgICAgICAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICdyZWZyZXNoUGFnZSgpJylcbiAgICAgICAgICAgIHNldFJlc3VsdCgkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJTZXR0aW5nJykucmVuZGVyU2V0dGluZygpKVxuICAgICAgICB9KVxuICAgIH0pXG5cbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogJ+aQnOe0oicsXG4gICAgICAgIGRlc2M6ICfor7fovpPlhaXmkJzntKLlhbPplK7or40nLFxuICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRWYXIoJ3NlYXJjaF9rZXknLCAnJyksXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcInNlYXJjaF9rZXlcIixpbnB1dCknXG4gICAgICAgIH0sXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3NlYXJjaD9ydWxlPScgKyBnZXRNeVZhcigndGl0bGUnKSArICcmcz0nICsgZ2V0VmFyKCdzZWFyY2hfa2V5JywgJycpXG4gICAgICAgIH0pXG4gICAgfSlcblxuXG5cbiAgICBmb3IgKHNvdXJjZSBvZiBjb25maWcuZGF0YSkge1xuICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgdGl0bGU6IHNvdXJjZS5uYW1lID09IHNlbGVjdCA/IFwi4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9J2NvbG9yOiAjMTlCODlEJz5cIiArIHNlbGVjdCArIFwiPC9zcGFuPlwiIDogc291cmNlLm5hbWUsXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCIsXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGEpID0+IHtcbiAgICAgICAgICAgICAgICBzZXRJdGVtKFwibGl2ZS1zZWxlY3RcIiwgYSk7XG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnc2VsZWN0R3JvdXAnLCAnJyk7XG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgICAgIH0sIHNvdXJjZS5uYW1lKVxuICAgICAgICB9KVxuICAgIH1cblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXG4gICAgfSlcbiAgICBcbiAgICBpZiAodHlwZW9mKHNldFByZVJlc3VsdCkgIT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgcGljX3VybDogXCJodHRwczovL2hpa2VyZmFucy5jb20vd2Vpc3lyL2ltZy9Mb2FkaW5nMS5naWZcIixcbiAgICAgICAgICAgIGNvbF90eXBlOiBcInBpY18xX2NlbnRlclwiLFxuICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICBjbHM6IFwibG9hZGluZ19naWZcIlxuICAgICAgICAgICAgfVxuICAgICAgIH0pXG4gICAgICAgc2V0UHJlUmVzdWx0KGRhdGEpO1xuICAgICAgIGRhdGEgPSBbXTtcbiAgICB9XG5cbiAgICBmb3IgKHNvdXJjZSBvZiBjb25maWcuZGF0YSkge1xuICAgICAgICBpZiAoc291cmNlLm5hbWUgPT0gc2VsZWN0KSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGxldCBpdGVtcyA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3JlbmRlckRhdGEnKS5yZW5kZXJMaXZlRGF0YShzb3VyY2UudXJsLHNvdXJjZS51YSk7XG4gICAgICAgICAgICAgICAgbGV0IGdyb3VwcyA9IE9iamVjdC5rZXlzKGl0ZW1zKTtcbiAgICAgICAgICAgICAgICAvL2dyb3Vwcy5wdXNoKGdyb3Vwcy5zcGxpY2UoZ3JvdXBzLmluZGV4T2YoMCksIDEpWzBdKTtcbiAgICAgICAgICAgICAgICBsZXQgc2VsZWN0R3JvdXAgPSBnZXRJdGVtKCdzZWxlY3RHcm91cCcsIGdyb3Vwc1swXSk7XG4gICAgICAgICAgICAgICAgaWYgKHNlbGVjdEdyb3VwID09IFwiXCIgfHwgIWdyb3Vwcy5pbmNsdWRlcyhzZWxlY3RHcm91cCkpIHNlbGVjdEdyb3VwID0gZ3JvdXBzWzBdO1xuICAgICAgICAgICAgICAgIGdyb3Vwcy5mb3JFYWNoKChncm91cCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdyb3VwID09IHNlbGVjdEdyb3VwID8gXCLigJzigJzigJ3igJ08c3BhbiBzdHlsZT0nY29sb3I6ICMxOUI4OUQnPlwiICsgZ3JvdXAgKyBcIjwvc3Bhbj5cIiA6IGdyb3VwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZ3JvdXApID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnc2VsZWN0R3JvdXAnLCBncm91cCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBncm91cCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICBmb3IgKGxldCB0aXRsZSBpbiBpdGVtc1tzZWxlY3RHcm91cF0pIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChzb3VyY2V1cmwsc2VsZWN0R3JvdXAsdGl0bGUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaXRlbXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJEYXRhJykucmVuZGVyTGl2ZURhdGEoc291cmNldXJsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3VybHMgPSBpdGVtc1tzZWxlY3RHcm91cF1bdGl0bGVdLnVybDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2hlYWRlcnMgPSBpdGVtc1tzZWxlY3RHcm91cF1bdGl0bGVdLmhlYWRlcnM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgZ3JvdXBpIGluIGl0ZW1zKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdyb3VwID0gaXRlbXNbZ3JvdXBpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWdyb3VwKSBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXRpdGxlIGluIGdyb3VwKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0aXRsZSA9PSB0aXRsZSAmJiAhIWdyb3VwW2l0aXRsZV0pe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmxzID0gZ3JvdXBbaXRpdGxlXS51cmw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhlYWRlcnMgPSBncm91cFtpdGl0bGVdLmhlYWRlcnM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdXJscyA9IHN1cmxzLmNvbmNhdCh1cmxzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoZWFkZXJzID0gc2hlYWRlcnMuY29uY2F0KGhlYWRlcnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1cmxzID0gQXJyYXkuZnJvbShuZXcgU2V0KHN1cmxzKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hlYWRlcnMgPSBBcnJheS5mcm9tKG5ldyBTZXQoc2hlYWRlcnMpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBzdXJscyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogc2hlYWRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgfSxzb3VyY2UudXJsLHNlbGVjdEdyb3VwLHRpdGxlKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vY29sX3R5cGU6ICd0ZXh0XzMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbW9yZS8yMjgucG5nXCJcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5pWw5o2u5Yqg6L295aSx6LSlXFxuXCIgKyBKU09OLnN0cmluZ2lmeShlKSxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFwibG9uZ190ZXh0XCJcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZGVsZXRlSXRlbUJ5Q2xzKFwibG9hZGluZ19naWZcIik7XG59XG5zZXRSZXN1bHQoZGF0YSk7Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHk/a2V5PSoqIiwiZ3JvdXAiOiLwn42J55u05pKtIiwic2VhcmNoRmluZCI6ImpzOlxuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXCJoaWtlcjovL3BhZ2UvY29uZmlnXCIpKS5ydWxlKTtcbmxldCBjb25maWcgPSBnZXRDb25maWcoKTtcbmxldCBydWxlcyA9IGNvbmZpZy5kYXRhLm1hcCgoc291cmNlKSA9PiB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgdGl0bGU6IHNvdXJjZS5uYW1lLFxuICAgICAgICBzZWFyY2hfdXJsOiAnaGlrZXI6Ly9lbXB0eT9rZXk9KionLFxuICAgICAgICBzZWFyY2hGaW5kOiAnanM6JyArICQudG9TdHJpbmcoKHVybCwgcnVsZV90aXRsZSkgPT4ge1xuICAgICAgICAgICAgbGV0IGQgPSBbXSxcbiAgICAgICAgICAgICAgICBrZXkgPSBnZXRQYXJhbSgna2V5Jyk7XG4gICAgICAgICAgICBsZXQgaXRlbXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJEYXRhP3J1bGU9JyArIHJ1bGVfdGl0bGUpLnJlbmRlckxpdmVEYXRhKHVybCk7XG4gICAgICAgICAgICBmb3IgKGxldCBncm91cCBpbiBpdGVtcykge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IHRpdGxlIGluIGl0ZW1zW2dyb3VwXSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUuaW5kZXhPZihrZXkpID49IDAgfHwgdGl0bGUudG9Mb3dlckNhc2UoKS5pbmRleE9mKGtleSkgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IGl0ZW1zW2dyb3VwXVt0aXRsZV0udXJsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBpdGVtc1tncm91cF1bdGl0bGVdLmhlYWRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNldFJlc3Vs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ZztcXG4gICAgfVxcbiAgICAgICAgXFxuICAgIGxldCBpdGVtcyA9IHt9LFxcbiAgICAgICAgZ3JvdXAgPSAn5pyq5YiG57uEJztcXG4gICAgZm9yIChsZXQgaSA9IHJlLmV4ZWMobTN1KTsgaSAhPSBudWxsOyBpID0gcmUuZXhlYyhtM3UpKSB7XFxuICAgICAgICBpZiAobW9kZSkge1xcbiAgICAgICAgICAgIGdyb3VwID0gKGlbMV0ubWF0Y2goL2dyb3VwLXRpdGxlPVxcXCIoLio/KVxcXCIvKSB8fCBbbnVsbCwgZ3JvdXBdKVsxXTtcXG4gICAgICAgIH0gZWxzZSBpZiAoWycjZ2VucmUjJywnIyMnLCflpLQjJywnJGNfZW5kJ10uaW5jbHVkZXMoaVszXSkpIHtcXG4gICAgICAgICAgICBncm91cCA9IGlbMl07XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdGl0bGUgPSBpWzJdLFxcbiAgICAgICAgICAgIHVybCA9IGlbM10uaW5jbHVkZXMoJyMnKSA/IGlbM10uc3BsaXQoJyMnKSA6IFtpWzNdXSxcXG4gICAgICAgICAgICBoZWFkZXJzID0gW107XFxuICAgICAgICBpZighdXJsW3VybC5sZW5ndGgtMV0pIHVybC5wb3AoKTtcXG4gICAgICAgIHVybC5mb3JFYWNoKCh2LGluZGV4LGFycmF5KT0+e1xcbiAgICAgICAgICAgIGlmKC87XFxcXHsoLiopXFxcXH0vLnRlc3Qodikpe1xcbiAgICAgICAgICAgICAgICBsZXQgb2JqID0ge30sXFxuICAgICAgICAgICAgICAgICAgICAgY29uID0gdi5tYXRjaCgvO1xcXFx7KC4qKVxcXFx9LylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgYXJyID0gY29uLnNwbGl0KCcmJicpO1xcbiAgICAgICAgICAgICAgICBhcnIuZm9yRWFjaCgoaSk9PntcXG4gICAgICAgICAgICAgICAgICAgIGxldCBba2V5LHZhbHVlXSA9IGkuc3BsaXQoJ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CgnJywgJ+ivt+i+k+WFpeiuoumYheWcsOWdgFxcXFxu5Y+v5Lul5Zyo5Zyw5Z2A5ZCO5YqgdWFcXFxcbijkvb/nlKgkJCTliIblibIpJykuaW5wdXQoKHJ1bGUpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeiDveS4uuepulxcXCJcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluZGV4T2YoXFxcImh0dHBcXFwiKSAhPSAwICYmIGlucHV0LmluZGV4T2YoXFxcImZpbGVcXFwiKSAhPSAwICYmIGlucHV0LmluZGV4T2YoXFxcImhpa2VyXFxcIikgIT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP5pyJ6K+vXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCBbdXJsLHVhXSA9IGlucHV0LnNwbGl0KCckJCQnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJycsIFxcXCLor7fovpPlhaXorqLpmIXmoIfpophcXFwiKS5pbnB1dCgodXJsLCBydWxlLHVhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZz9ydWxlPVxcXCIgKyBydWxlKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1YTogdWEgfHwgJydcXG4gICAgICAgIC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KHtcXG4gICAgICAgIHRpdGxlOiBnZXRDb2xvcmVkVGV4dChcXFwi5a+85YWl5pys5Zyw5rqQXFxcIiksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeebtOaSrea6kOWQjeensFxcXCIsXFxuICAgICAgICB1cmw6ICQoJycsICfor7fovpPlhaXnm7Tmkq3mupDlkI3np7AnKS5pbnB1dCgocnVsZSkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZmlsZVNlbGVjdDovL1xcXCIgKyAkLnRvU3RyaW5nKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcyA9IGlucHV0LnNwbGl0KFxcXCIvXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9saXZlL1xcXCIgKyBuYW1lICsgXFxcIi5tM3VcXFwiXFxuICAgICAgICAgICAgICAgICAgICB2YXIgYyA9IGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXCIgKyBzW3MubGVuZ3RoIC0gMV0pXFxuICAgICAgICAgICAgICAgICAgICBpZiAoIWMuaW5jbHVkZXMoJ2h0dHAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pnZ7ms5Xmlofku7YnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUodXJsLCBjKVxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWc/cnVsZT3ogZrnm7Tmkq1cXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suS/neWtmCdcXG4gICAgICAgICAgICAgICAgfSwgaW5wdXQpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0Q29sb3JlZFRleHQoXFxcIuWIhuS6q+iuoumYhVxcXCIpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgIHVybDogJChbXFxcIuWOn+Wni+aVsOaNrlxcXCIsIFxcXCLkupHliarotLTmnb9cXFwiLCBcXFwi5LqR5Y+j5LukXFxcIl0sIDMpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgcmV0dXJuICQoJ+ehruWumuWvvOWHuu+8n1xcXFxuKOemgeeUqOiuoumYheS4jeS8muWvvOWHuiknKS5jb25maXJtKCh0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGEgPSBjb25maWcuZGF0YS5maWx0ZXIodiA9PiAhdi5pblZpc2libGUpO1xcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSBcXFwi5LqR5Ymq6LS05p2/XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSAn6IGa55u05pKt5YiG5LqrIyNcXFxcbicgKyBzaGFyZVBhc3RlKEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gXFxcIuS6keWPo+S7pFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gJ+iBmuebtOaSreWIhuS6qyzlpI3liLblkI7miZPlvIDova/ku7bljbPlj6/lr7zlhaVcXFxcbicgKyBzaGFyZVBhc3RlKEpTT04uc3RyaW5naWZ5KGNvbmZpZykpICsgJ0BpbXBvcnQ9anM6ZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2UvY2xvdWQ/cnVsZT3ogZrnm7Tmkq1cXFwiKSkucnVsZSknO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSBKU09OLnN0cmluZ2lmeShjb25maWcpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyBkYXRhO1xcbiAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0Q29sb3JlZFRleHQoXFxcIue8lui+keWFqOmDqFxcXCIpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXF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9yRWFjaCgodiwgaSkgPT4ge1xcbiAgICAgICAgbGV0IGVsID0ge1xcbiAgICAgICAgICAgIHRpdGxlOiB2Lm5hbWUsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICB9XFxuICAgICAgICBzd2l0Y2ggKGVkaXRNb2RlKSB7XFxuICAgICAgICAgICAgY2FzZSAn5ZCv55So56aB55SoJzpcXG4gICAgICAgICAgICAgICAgZWwudGl0bGUgPSAodi5pblZpc2libGUgPyAn8J+UtCAnIDogJ/Cfn6IgJykgKyBlbC50aXRsZVxcbiAgICAgICAgICAgICAgICBlbC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFbaV0uaW5WaXNpYmxlID0gIWNvbmZpZy5kYXRhW2ldLmluVmlzaWJsZTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgY2FzZSAn5Yig6Zmk6K6i6ZiFJzpcXG4gICAgICAgICAgICAgICAgZWwudXJsID0gXFxcImNvbmZpcm06Ly/noa7orqTliKDpmaTigJxcXFwiICsgdi5uYW1lICsgXFxcIuKAneiuoumYhe+8ny5qczpcXFwiICsgJC50b1N0cmluZygoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhLnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5Yig6ZmkXFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICAgICAgZWwudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZWwudGl0bGVcXG4gICAgICAgICAgICAgICAgaWYgKHNvcnRGbGFnID09IC0xKVxcbiAgICAgICAgICAgICAgICAgICAgZWwudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsIGkudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZWwudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgob2xkSW5kZXgsIG5ld0luZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGEuc3BsaWNlKG5ld0luZGV4LCAwLCBjb25maWcuZGF0YS5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJylcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICB9LCBzb3J0RmxhZywgaSlcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICfnvJbovpHorqLpmIUnOlxcbiAgICAgICAgICAgICAgICBsZXQgYXJyID0gWyfnvJbovpHlkI3np7AnLCAn57yW6L6R5Zyw5Z2AJywgJ+e8lui+keWGheWuuSddO1xcbiAgICAgICAgICAgICAgICBlbC51cmwgPSAkKGFyciwgMykuc2VsZWN0KCh2LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gJ+e8lui+keWQjeensCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh2Lm5hbWUsICfovpPlhaXmlrDlkI3np7AnKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFbaV0ubmFtZSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S4jeiDveS4uuepuidcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSAn57yW6L6R5Zyw5Z2AJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHYudWEgPyB2LnVybCArICckJCQnICsgdi51YSA6IHYudXJsLCAn6L6T5YWl5paw5Zyw5Z2AJykuaW5wdXQoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kuI3og73kuLrnqbpcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IDAgJiYgaW5wdXQuaW5kZXhPZihcXFwiZmlsZVxcXCIpICE9IDAgJiYgaW5wdXQuaW5kZXhPZihcXFwiaGlrZXJcXFwiKSAhPSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP5pyJ6K+vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IFt1cmwsdWFdID0gaW5wdXQuc3BsaXQoJyQkJCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFbaV0udXJsID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFbaV0udWEgPSB1YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gJ+e8lui+keWGheWuuScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodi51cmwuc3RhcnRzV2l0aCgnZmlsZTovLycpIHx8IHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vZmlsZXMnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2VkaXRGaWxlOi8vJyArIHYudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2VkaXRGaWxlOi8vaGlrZXI6Ly9maWxlcy9saWJzLycgKyBtZDUodi51cmwpICsgJy5qcydcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgdiwgaSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ+a4hemZpOe8k+WtmCc6XFxuICAgICAgICAgICAgICAgIGVsLnVybCA9ICQoJ+ehruWumua4hemZpOKAnCcgKyB2Lm5hbWUgKyAn4oCd6K6i6ZiF57yT5a2Y77yfXFxcXG4o5Y+v56uL5Y2z5pu05pawKScpLmNvbmZpcm0oKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlQ2FjaGUodXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9h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