Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@聚直播@eyJmaXJzdEhlYWRlciI6ImNsYXNzIiwibGFzdF9jaGFwdGVyX3J1bGUiOiIiLCJ0aXRsZSI6IuiBmuebtOaSrSIsImF1dGhvciI6IuWwj+ajieiihPCfjJ4mSm9rZXIiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTAsImNvbF90eXBlIjoiaWNvbl8yX3JvdW5kIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJsaXZlIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdChcImhpa2VyOi8vcGFnZS9jb25maWdcIikpLnJ1bGUpOyAvL2dldENvbmZpZ1xuXG5sZXQgZGF0YSA9IFtdLFxuICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xuY29uZmlnLmRhdGEgPSBjb25maWcuZGF0YS5maWx0ZXIodiA9PiAhdi5pblZpc2libGUpO1xuaWYgKGNvbmZpZy5kYXRhLmxlbmd0aCA8PSAwKSB7XG4gICAgZGF0YSA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3JlbmRlclNldHRpbmcnKS5yZW5kZXJTZXR0aW5nKCk7XG59IGVsc2Uge1xuICAgIGxldCBzZWxlY3QgPSBnZXRJdGVtKFwibGl2ZS1zZWxlY3RcIiwgY29uZmlnLmRhdGFbMF0ubmFtZSksXG4gICAgICAgIGhhcyA9IGNvbmZpZy5kYXRhLm1hcChpID0+IGkubmFtZSkuaW5jbHVkZXMoc2VsZWN0KTtcbiAgICBpZiAoIWhhcykge1xuICAgICAgICBzZWxlY3QgPSBjb25maWcuZGF0YVswXS5uYW1lO1xuICAgIH1cblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOiAn6IGa55u05pKtJy5ib2xkKCkgKyAnICZuYnNwICZuYnNwICcgKyAn4pqZIOiBmuebtOaSreiuvue9riDimpknLnNtYWxsKCksXG4gICAgICAgIGNvbF90eXBlOiBcImF2YXRhclwiLFxuICAgICAgICBwaWNfdXJsOiBNWV9SVUxFLmljb24sXG4gICAgICAgIHVybDogJChcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1wiKS5ydWxlKCgpID0+IHtcbiAgICAgICAgICAgIGFkZExpc3RlbmVyKCdvbkNsb3NlJywgJ3JlZnJlc2hQYWdlKCknKVxuICAgICAgICAgICAgc2V0UmVzdWx0KCQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3JlbmRlclNldHRpbmcnKS5yZW5kZXJTZXR0aW5nKCkpXG4gICAgICAgIH0pXG4gICAgfSlcblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOiAn5pCc57SiJyxcbiAgICAgICAgZGVzYzogJ+ivt+i+k+WFpeaQnOe0ouWFs+mUruivjScsXG4gICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignc2VhcmNoX2tleScsICcnKSxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiAncHV0VmFyKFwic2VhcmNoX2tleVwiLGlucHV0KSdcbiAgICAgICAgfSxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXG4gICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vc2VhcmNoP3J1bGU9JyArIGdldE15VmFyKCd0aXRsZScpICsgJyZzPScgKyBnZXRWYXIoJ3NlYXJjaF9rZXknLCAnJylcbiAgICAgICAgfSlcbiAgICB9KVxuXG5cblxuICAgIGZvciAoc291cmNlIG9mIGNvbmZpZy5kYXRhKSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogc291cmNlLm5hbWUgPT0gc2VsZWN0ID8gXCLigJzigJzigJ3igJ08c3BhbiBzdHlsZT0nY29sb3I6ICMxOUI4OUQnPlwiICsgc2VsZWN0ICsgXCI8L3NwYW4+XCIgOiBzb3VyY2UubmFtZSxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoYSkgPT4ge1xuICAgICAgICAgICAgICAgIHNldEl0ZW0oXCJsaXZlLXNlbGVjdFwiLCBhKTtcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCdzZWxlY3RHcm91cCcsICcnKTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBcImhpa2VyOi8vZW1wdHlcIlxuICAgICAgICAgICAgfSwgc291cmNlLm5hbWUpXG4gICAgICAgIH0pXG4gICAgfVxuXG4gICAgZGF0YS5wdXNoKHtcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcbiAgICB9KVxuXG4gICAgZm9yIChzb3VyY2Ugb2YgY29uZmlnLmRhdGEpIHtcbiAgICAgICAgaWYgKHNvdXJjZS5uYW1lID09IHNlbGVjdCkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBsZXQgaXRlbXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJEYXRhJykucmVuZGVyTGl2ZURhdGEoc291cmNlLnVybCxzb3VyY2UudWEpO1xuICAgICAgICAgICAgICAgIGxldCBncm91cHMgPSBPYmplY3Qua2V5cyhpdGVtcyk7XG4gICAgICAgICAgICAgICAgLy9ncm91cHMucHVzaChncm91cHMuc3BsaWNlKGdyb3Vwcy5pbmRleE9mKDApLCAxKVswXSk7XG4gICAgICAgICAgICAgICAgbGV0IHNlbGVjdEdyb3VwID0gZ2V0SXRlbSgnc2VsZWN0R3JvdXAnLCBncm91cHNbMF0pO1xuICAgICAgICAgICAgICAgIGlmIChzZWxlY3RHcm91cCA9PSBcIlwiIHx8ICFncm91cHMuaW5jbHVkZXMoc2VsZWN0R3JvdXApKSBzZWxlY3RHcm91cCA9IGdyb3Vwc1swXTtcbiAgICAgICAgICAgICAgICBncm91cHMuZm9yRWFjaCgoZ3JvdXApID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBncm91cCA9PSBzZWxlY3RHcm91cCA/IFwi4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9J2NvbG9yOiAjMTlCODlEJz5cIiArIGdyb3VwICsgXCI8L3NwYW4+XCIgOiBncm91cCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGdyb3VwKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3NlbGVjdEdyb3VwJywgZ3JvdXApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZ3JvdXApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgdGl0bGUgaW4gaXRlbXNbc2VsZWN0R3JvdXBdKSB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoc291cmNldXJsLHNlbGVjdEdyb3VwLHRpdGxlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGl0ZW1zID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvcmVuZGVyRGF0YScpLnJlbmRlckxpdmVEYXRhKHNvdXJjZXVybCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1cmxzID0gaXRlbXNbc2VsZWN0R3JvdXBdW3RpdGxlXS51cmw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNoZWFkZXJzID0gaXRlbXNbc2VsZWN0R3JvdXBdW3RpdGxlXS5oZWFkZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGdyb3VwaSBpbiBpdGVtcyl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBncm91cCA9IGl0ZW1zW2dyb3VwaV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFncm91cCkgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0aXRsZSBpbiBncm91cCl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGl0bGUgPT0gdGl0bGUgJiYgISFncm91cFtpdGl0bGVdKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJscyA9IGdyb3VwW2l0aXRsZV0udXJsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzID0gZ3JvdXBbaXRpdGxlXS5oZWFkZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VybHMgPSBzdXJscy5jb25jYXQodXJscyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGVhZGVycyA9IHNoZWFkZXJzLmNvbmNhdChoZWFkZXJzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdXJscyA9IEFycmF5LmZyb20obmV3IFNldChzdXJscykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoZWFkZXJzID0gQXJyYXkuZnJvbShuZXcgU2V0KHNoZWFkZXJzKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogc3VybHMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHNoZWFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sc291cmNlLnVybCxzZWxlY3RHcm91cCx0aXRsZSksXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2NvbF90eXBlOiAndGV4dF8zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8yMjgucG5nXCJcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICA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iBpdGVtc1tncm91cF0pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRpdGxlLmluZGV4T2Yoa2V5KSA+PSAwIHx8IHRpdGxlLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihrZXkpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBpdGVtc1tncm91cF1bdGl0bGVdLnVybCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaXRlbXNbZ3JvdXBdW3RpdGxlXS5oZWFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzZXRSZXN1bHQoZCk7XG4gICAgICAgIH0sIHNvdXJjZS51cmwsIGdldE15VmFyKCd0aXRsZScpKVxuICAgIH07XG59KVxuc2V0UmVzdWx0KFt7XG4gICAgdGl0bGU6IFwi54K55oiR5byA5aeL6IGa5pCcXCIsXG4gICAgdXJsOiBcImhpa2VyOi8vc2VhcmNoP3M9XCIgKyBnZXRQYXJhbShcImtleVwiKSxcbiAgICBleHRyYToge1xuICAgICAgICBydWxlczogJC50b1N0cmluZygocnVsZXMpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcylcbiAgICAgICAgfSwgcnVsZXMpXG4gICAgfVxufV0pIiwiZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsImRldGFpbF9maW5kX3J1bGUiOiIiLCJzZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsInNkZXRhaWxfZmluZF9ydWxlIjoiIiwidWEiOiJtb2JpbGUiLCJwcmVSdWxlIjoicHV0TXlWYXIoJ3RpdGxlJyxNWV9SVUxFLnRpdGxlKTsiLCJwYWdlcyI6Ilt7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Yqg6L295pWw5o2uXCIsXCJwYXRoXCI6XCJjb25maWdcIixcInJ1bGVcIjpcImZ1bmN0aW9uIGdldENvbmZpZygpIHtcXG4gICAgdHJ5IHtcXG4gICAgICAgIGxldCBjb25maWcgPSBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIik7XFxuICAgICAgICBpZiAoIWNvbmZpZyB8fCBjb25maWcgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICBkYXRhOiBbXSxcXG4gICAgICAgICAgICAgICAgdmVyc2lvbjogMFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoY29uZmlnKVxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHRvYXN0KFxcXCLphY3nva7mlofku7bmoLzlvI/mnInor69cXFwiKVxcbiAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgZGF0YTogW10sXFxuICAgICAgICAgICAgdmVyc2lvbjogMFxcbiAgICAgICAgfVxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5om56YeP5a+85YWlXCIsXCJwYXRoXCI6XCJiYXRjaEltXCIsXCJydWxlXCI6XCJmdW5jdGlvbiBiYXRjaEltcG9ydChpbnB1dCwgcnVsZSkge1xcbiAgICBpbnB1dCA9IGlucHV0LnRy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G4gICAgICAgICAgICB1cmwgPSBpWzNdLmluY2x1ZGVzKCcjJykgPyBpWzNdLnNwbGl0KCcjJykgOiBbaVszXV0sXFxuICAgICAgICAgICAgaGVhZGVycyA9IFtdO1xcbiAgICAgICAgaWYoIXVybFt1cmwubGVuZ3RoLTFdKSB1cmwucG9wKCk7XFxuICAgICAgICB1cmwuZm9yRWFjaCgodixpbmRleCxhcnJheSk9PntcXG4gICAgICAgICAgICBpZigvO1xcXFx7KC4qKVxcXFx9Ly50ZXN0KHYpKXtcXG4gICAgICAgICAgICAgICAgbGV0IG9iaiA9IHt9LFxcbiAgICAgICAgICAgICAgICAgICAgIGNvbiA9IHYubWF0Y2goLztcXFxceyguKilcXFxcfS8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgIGFyciA9IGNvbi5zcGxpdCgnJiYnKTtcXG4gICAgICAgICAgICAgICAgYXJyLmZvckVhY2goKGkpPT57XFxuICAgICAgICAgICAgICAgICAgICBsZXQgW2tleSx2YWx1ZV0gPSBpLnNwbGl0KCdAJyk7XFxuICAgICAgICAgICAgICAgICAgICBvYmpba2V5XSA9IHZhbHVlLnJlcGxhY2UoLzsvZywn77yb77ybJyk7XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGFycmF5W2luZGV4XSA9IHYubWF0Y2goL14oW147XSopO1xcXFx7LylbMV1cXG4gICAgICAgICAgICAgICAgaGVhZGVycy5wdXNoKG9iaik7XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnMucHVzaCh7J1VzZXItQWdlbnQnIDogTU9CSUxFX1VBLnJlcGxhY2UoLzsvZywn77yb77ybJyl9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyYXlbaW5kZXhdID0gYXJyYXlbaW5kZXhdLnJlcGxhY2UoLzsvZywn77yb77ybJykrJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgIH0pO1xcbiAgICAgICAgaWYgKGl0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ZXQgW3VybCx1YV0gPSBpbnB1dC5zcGxpdCgnJCQkJyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKCcnLCBcXFwi6K+36L6T5YWl6K6i6ZiF5qCH6aKYXFxcIikuaW5wdXQoKHVybCwgcnVsZSx1YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWc/cnVsZT1cXFwiICsgcnVsZSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdWE6IHVhIHx8ICcnXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suS/neWtmFxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHVybCwgcnVsZSx1YSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBnZXRNeVZhcigndGl0bGUnKSlcXG4gICAgfSk7XFxuXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0Q29sb3JlZFRleHQoXFxcIuWvvOWFpeiuoumYhVxcXCIpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgI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HMgPSBpbnB1dC5zcGxpdChcXFwiL1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvbGl2ZS9cXFwiICsgbmFtZSArIFxcXCIubTN1XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGMgPSBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFwiICsgc1tzLmxlbmd0aCAtIDFdKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjLmluY2x1ZGVzKCdodHRwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6Z2e5rOV5paH5Lu2J1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHVybCwgYylcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnP3J1bGU96IGa55u05pKtXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7Lkv53lrZgnXFxuICAgICAgICAgICAgICAgIH0sIG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c2hhcmVQYXN0ZShKU09OLnN0cmluZ2lmeShjb25maWcpKSArICdAaW1wb3J0PWpzOmV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL2Nsb3VkP3J1bGU96IGa55u05pKtXFxcIikpLnJ1bGUpJztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gSlNPTi5zdHJpbmdpZnkoY29uZmlnKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgZGF0YTtcXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGdldENvbG9yZWRUZXh0KFxcXCLnvJbovpHlhajpg6hcXFwiKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJlZGl0RmlsZTovL2hpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCJcXG4gICAgfSk7XFxuXFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICB9KTtcXG5cXG4gICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICBsZXQgZWRpdE1vZGUgPSBnZXRNeVZhcignZWRpdE1vZGUnLCAn5ZCv55So56aB55SoJyk7XFxuICAgIFsn5ZCv55So56aB55SoJywgJ+WIoOmZpOiuoumYhScsICfph43mlrDmjpLluo8nLCAn57yW6L6R6K6i6ZiFJywgJ+a4hemZpOe8k+WtmCddLmZvckVhY2goKHYpID0+IHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHYgPT0gZWRpdE1vZGUgPyAn4oCc4oCc4oCd4oCdJyArIHYuYm9sZCgpLmZvbnRjb2xvcignIzE5Qjg5RCcpIDogdixcXG4gICAgICAgICAgICB1cmw6IHYgPT0gZWRpdE1vZGUgPyAnaGlrZXI6Ly9lbXB0eScgOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh2KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdlZGl0TW9kZScsIHYpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgdiksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGNvbmZpZy5kYXRhLmZvckVhY2goKHYsIGkpID0+IHtcXG4gICAgICAgIGxldCBlbCA9IHtcXG4gICAgICAgICAgICB0aXRsZTogdi5uYW1lLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfVxcbiAgICAgICAgc3dpdGNoIChlZGl0TW9kZSkge1xcbiAgICAgICAgICAgIGNhc2UgJ+WQr+eUqOemgeeUqCc6XFxuICAgICAgICAgICAgICAgIGVsLnRpdGxlID0gKHYuaW5WaXNpYmxlID8gJ/CflLQgJyA6ICfwn5+iICcpICsgZWwudGl0bGVcXG4gICAgICAgICAgICAgICAgZWwudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhW2ldLmluVmlzaWJsZSA9ICFjb25maWcuZGF0YVtpXS5pblZpc2libGU7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIGNhc2UgJ+WIoOmZpOiuoumYhSc6XFxuICAgICAgICAgICAgICAgIGVsLnVybCA9IFxcXCJjb25maXJtOi8v56Gu6K6k5Yig6Zmk4oCcXFxcIiArIHYubmFtZSArIFxcXCLigJ3orqLpmIXvvJ8uanM6XFxcIiArICQudG9TdHJpbmcoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWIoOmZpFxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXG4gICAgICAgICAgICAgICAgbGV0IHNvcnRGbGFnID0gcGFyc2VJbnQoZ2V0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJykpXFxuICAgICAgICAgICAgICAgIGVsLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGVsLnRpdGxlXFxuICAgICAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgICAgIGVsLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mAieaLqeimgeenu+WKqOWIsOeahOS9jee9ridcXG4gICAgICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGVsLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhLnNwbGljZShuZXdJbmRleCwgMCwgY29uZmlnLmRhdGEuc3BsaWNlKG9sZEluZGV4LCAxKVswXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgY2FzZSAn57yW6L6R6K6i6ZiFJzpcXG4gICAgICAgICAgICAgICAgbGV0IGFyciA9IFsn57yW6L6R5ZCN56ewJywgJ+e8lui+keWcsOWdgCcsICfnvJbovpHlhoXlrrknXTtcXG4gICAgICAgICAgICAgICAgZWwudXJsID0gJChhcnIsIDMpLnNlbGVjdCgodiwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09ICfnvJbovpHlkI3np7AnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQodi5uYW1lLCAn6L6T5YWl5paw5ZCN56ewJykuaW5wdXQoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhW2ldLm5hbWUgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2xpdmUvY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kuI3og73kuLrnqbonXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gJ+e8lui+keWcsOWdgCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh2LnVhID8gdi51cmwgKyAnJCQkJyArIHYudWEgOiB2LnVybCwgJ+i+k+WFpeaWsOWcsOWdgCcpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluZGV4T2YoXFxcImh0dHBcXFwiKSAhPSAwICYmIGlucHV0LmluZGV4T2YoXFxcImZpbGVcXFwiKSAhPSAwICYmIGlucHV0LmluZGV4T2YoXFxcImhpa2VyXFxcIikgIT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+acieivr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBbdXJsLHVhXSA9IGlucHV0LnNwbGl0KCckJCQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhW2ldLnVybCA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhW2ldLnVhID0gdWE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09ICfnvJbovpHlhoXlrrknKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2ZpbGU6Ly8nKSB8fCB2LnVybC5zdGFydHNXaXRoKCdoaWtlcjovL2ZpbGVzJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdlZGl0RmlsZTovLycgKyB2LnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdlZGl0RmlsZTovL2hpa2VyOi8vZmlsZXMvbGlicy8nICsgbWQ1KHYudXJsKSArICcuanMnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHYsIGkpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICfmuIXpmaTnvJPlrZgnOlxcbiAgICAgICAgICAgICAgICBlbC51cmwgPSAkKCfnoa7lrprmuIXpmaTigJwnICsgdi5uYW1lICsgJ+KAneiuoumYhee8k+WtmO+8n1xcXFxuKOWPr+eri+WNs+abtOaWsCknKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUNhY2hlKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5riF6Zmk5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9LCB2LnVybClcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBkLnB1c2goZWwpXFxuICAgIH0pO1xcbiAgICByZXR1cm4gZDtcXG59XFxuXFxuJC5leHBvcnRzID0ge1xcbiAgICByZW5kZXJTZXR0aW5nOiByZW5kZXJTZXR0aW5nXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5LqR5Y+j5LukXCIsXCJwYXRoXCI6XCJjbG91ZFwiLFwicnVsZVwiOlwiZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9iYXRjaEltP3J1bGU96IGa55u05pKtXFxcIikpLnJ1bGUpO1xcbmxldCBjb250ZW50ID0gcGFyc2VQYXN0ZShpbnB1dCk7XFxuYmF0Y2hJbXBvcnQoY29udGVudCwgXFxcIuiBmuebtOaSr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