xiaomianao666

小程序:道长仓库Pro

Nov 24th, 2024
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@道长仓库Pro@eyJmaXJzdEhlYWRlciI6ImNsYXNzIiwibGFzdF9jaGFwdGVyX3J1bGUiOiIiLCJ0aXRsZSI6IumBk+mVv+S7k+W6k1BybyIsImF1dGhvciI6IkBMb3lEZ0lrIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSIsInZlcnNpb24iOjE2NCwiY29sX3R5cGUiOiJpY29uXzJfcm91bmQiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InRvb2wiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbmNvbnN0IHtcbiAgICBnZXRBcGksXG4gICAgY29sb3IsXG4gICAgc21hbGwsXG4gICAgZ2V0RmlsZSxcbiAgICBodG1sVGFnLFxuICAgIGFwaSxcbiAgICBtZFxufSA9ICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS91dGlsaXlcIik7XG52YXIgciA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL25vdGljZScpO1xuXG5cbmNvbnN0IGxzZyA9ICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS9sb2NhbFN0b3JhZ2U/cnVsZT3pgZPplb/ku5PlupNQcm9cIik7XG5sZXQgY2xhc3NBID0gZ2V0VmFyKFwiV2FyZWhvdXNlLmNsYXNzXCIsIFwiMFwiKTtcbmxldCBsaXN0VXJsID0gZ2V0QXBpKFwidXNlcnNVcmxcIikgKyBjbGFzc0EsXG4gICAgbXlVcmwgPSBnZXRBcGkoXCJkZXZTZWxmXCIpLFxuICAgIG5vdGljZVVybCA9IGdldEFwaShcIm5vdGljZVVybFw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HJlcXVlc3QoanNvblVybCk7XG4gICAgICAgICAgICBpZiAoIS92ZXJzaW9uLy50ZXN0KHRleHQpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+acjeWKoeWZqOato+W/mSzor7fnqI3lgJnlho3or5UuLi4nXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWxldGVDYWNoZShqc29uVXJsKTtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgcmVxdWlyZShqc29uVXJsKTtcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfliLfmlrDmiJDlip/mj5DnpLonLFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBcInRvYXN0Oi8v5bey5Yi35pawLOW9k+WJjeeJiOacrOS/oeaBrzpcXG5cIiArIEpTT04uc3RyaW5naWZ5KHZlcnNpb24pXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ezn+ezle+8jOacrOWcsOe8k+WtmOaPkuS7tuiiq+a4hemZpOS6hu+8jOS9huaYr+acjeWKoeWZqOmAmuiur+Wksei0pSEnXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIGdldEFwaShcImltcG9ydFVybFwiKSksXG4gICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIlxuICAgIH0pO1xuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOiBcIumAmuWFjTpcIiArIGNvbG9yKGxzZy5nZXRJdGVtKFwi6YCa5YWNXCIsIFwiWDVcIiksIFwiI2ZmNzAwMFwiKSxcbiAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF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G4gICAgICAgICAgICB1cGRhdGVJdGVtKCdzb3J0Jywge1xuICAgICAgICAgICAgICAgIHRpdGxlOiBcIuaOkuW6jzpcIiArIGNvbG9yKG5leHQsIFwiI2ZmNzAwMFwiKVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIHJldHVybiBcInRvYXN0Oi8v5bey6K6+572u5LuT5bqT5byA5Y+R6ICF6KeE5YiZ5o6S5bqP5qih5byP5Li6OlwiICsgbmV4dDtcbiAgICAgICAgfSwgY29sb3IpLFxuICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgaWQ6ICdzb3J0J1xuICAgICAgICB9XG4gICAgfSk7XG4gICAgZGF0YS5wdXNoKHtcbiAgICAgICAgdGl0bGU6IGNvbG9yKFwi5LuT5bqT5YWs5ZGKXCIsIFwiI2ZmNzAwMFwiKSxcbiAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjJykucnVsZSgobWQpID0+IHtcbiAgICAgICAgICAgIHJlcXVpcmUobWQpO1xuICAgICAgICAgICAgbGV0IGQgPSBbXTtcbiAgICAgICAgICAgIGxldCDku5PlupPlhazlkYogPSBcIuaaguaXoOWFrOWRilwiO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICDku5PlupPlhazlkYogPSBmZXRjaCgnaHR0cHM6Ly9naXRjb2RlLm5ldC9xcV8zMjM5NDM1MS9kci8tL3Jhdy9tYXN0ZXIvanMv5LuT5bqT5YWs5ZGKLm1kJyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxuICAgICAgICAgICAgaWYgKOS7k+W6k+WFrOWRiikge1xuICAgICAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBtYXJrZWQucGFyc2Uo5LuT5bqT5YWs5ZGKKSxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnLFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5J1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xuICAgICAgICB9LCBtZClcbiAgICB9KTtcblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOiBjb2xvcihcIuWNh+e6p+S7k+W6k1wiLCBcIiMxNWFiMjFcIiksXG4gICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHtcbiAgICAgICAgICAgICAgICBnZXRBcGlcbiAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXCJoaWtlcjovL3BhZ2UvdXRpbGl5XCIpO1xuICAgICAgICAgICAgbGV0IHJ1bGVIZWFkID0gJ+a1t+mYlOinhueVjOmmlumhtemikemBk+inhOWImeOAkOmBk+mVv+S7k+W6k1Byb+OAke+/pWhvbWVfcnVsZV91cmzvv6UnO1xuICAgICAgICAgICAgbGV0IHVybCA9IGdldEFwaSgnaW1wb3J0VXJsJykgKyBcIjEwOTRcIjtcbiAgICAgICAgICAgIGxldCBpbXBvcnRVcmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUocnVsZUhlYWQgKyB1cmwpO1xuICAgICAgICAgICAgcmV0dXJuIGltcG9ydFVybFxuICAgICAgICB9KVxuICAgIH0pO1xuXG4gICAgZGF0YS5wdXNoKHtcbiAgICAgICAgdGl0bGU6IGNvbG9yKFwi5Y2H57qnJOaJqeWxlVwiLCBcIiMxNWFiMjFcIiksXG4gICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlK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Y29kZV9zdHIpO1xuICAgICAgICB9IGNhdGNoIChlKSB7fVxuICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDAgJiYgY29kZS5yZXN1bHQuYWN0aXZlKSB7XG4gICAgICAgICAgICBpc19sb2dpbiA9IHRydWU7XG4gICAgICAgICAgICBpZiAoY29kZS5yZXN1bHQuaXNfbWFuYWdlcikge1xuICAgICAgICAgICAgICAgIGlzX21hbmFnZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UuaXNfbWFuYWdlcicsICfnnJ8nKTtcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVzZXJuYW1lJywgdXNlcm5hbWUpO1xuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UucGFzc3dvcmQnLCBwYXNzd29yZCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UuaXNfbWFuYWdlcicsICcnKTtcbiAgICAgICAgICAgICAgICBjbGVhclZhcignaG91c2UudXNlcm5hbWUnKTtcbiAgICAgICAgICAgICAgICBjbGVhclZhcignaG91c2UucGFzc3dvcmQnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAoaXNfbG9naW4pIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIG5vd0NvbiA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRBcGkoXCJub3dDb25VcmxcIiksIHRtcF9oZWFkZXJzKSkucmVzdWx0O1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBub3dDb24gPSAn5pyq55+lJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgZGV2RGF0YSA9IHVzZXJMaXN0LmZpbmQoaXRlbSA9PiBpdGVtLnFxID09PSB1c2VybmFtZSk7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogJzxzdHJvbmc+PHNwYW4gc3R5bGU9XCJjb2xvcjogI2ZmNzAwMFwiPicgKyBkZXZEYXRhLm5hbWUgKyAnPC9zcGFuPjwvc3Ryb25nPiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOzxzbWFsbD48dT7op4TliJnnrqHnkIYgPjwvdT48L3NtYWxsPicsXG4gICAgICAgICAgICBwaWNfdXJsOiBkZXZEYXRhLmF2YXRhcixcbiAgICAgICAgICAgIGNvbF90eXBlOiBcImF2YXRhclwiLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9kZXZNYW5hZ2Ujbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXCIsXG4gICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgIC8vdXNlcm5hbWU6IHVzZXJuYW1lLFxuICAgICAgICAgICAgICAgIC8vcGFzc3dvcmQ6IHBhc3N3b3JkLFxuICAgICAgICAgICAgICAgIGRldjogZGV2RGF0YVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcbiAgICAgICAgICAgIHRpdGxlOiBzbWFsbChcIueOsOaciSBcIiArIGNvbG9yKHVzZXJMaXN0Lmxlbmd0aCwgXCIjZmY3MDAwXCIpICsgXCIg5ZCN5byA5Y+R6ICF77yMXCIgKyBjb2xvcihydWxlQ291bnRbMF0sIFwiI2ZmNzAwMFwiKSArIFwiIOadoeWFrOW8gOinhOWIme+8jFwiICsgY29sb3IocnVsZUNvdW50WzFdLCBcIiNmZjcwMDBcIikgKyBcIiDmnaHpm4boirPpmIHop4TliJnjgILlnKjnur86XCIgKyBjb2xvcihub3dDb24sIFwiI2ZmNzAwMFwiKSksXG4gICAgICAgICAgICB1cmw6IFwidG9hc3Q6Ly/llrXllrXllrU/XCIsXG4gICAgICAgIH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogc21hbGwoY29sb3IoXCLlvIDlj5HogIXnmbvlvZVcIiwgXCIjMDBCRkZGXCIpKSxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXG4gICAgICAgICAgICBkZXNjOiBzbWFsbChcIueOsOaciVwiICsgY29sb3IodXNlckxpc3QubGVuZ3RoLCBcIiNmZjcwMDBcIikgKyBcIuWQjeW8gOWPkeiAhe+8jFwiICsgY29sb3IocnVsZUNvdW50WzBdLCBcIiNmZjcwMDBcIikgKyBcIuadoeWFrOW8gOinhOWIme+8jFwiICsgY29sb3IoMCwgXCIjZmY3MDAwXCIpICsgXCLmnaHpm4boirPpmIHop4TliJnjgIJcIiksXG4gICAgICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL2RldkxvZ2luXCJcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGlmIChBcnJheS5pc0FycmF5KHVzZXIpICYmIHVzZXIubGVuZ3RoID09PSAyKSB7XG4gICAgICAgIGxldCB1c2VybG9naW4gPSByZXF1ZXN0KGFwaS5kaXNfbG9naW4sIHtcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgIFwicGFyYW1zXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJxcVwiOiB1c2VyWzBdLFxuICAgICAgICAgICAgICAgICAgICBcImF1dGhfY29kZVwiOiB1c2VyWzFdXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcbiAgICAgICAgICAgIHRpbWVvdXQ6IHRpbWVvdXRcbiAgICAgICAgfSk7XG4gICAgICAgIHVzZXJsb2dpbiA9IEpTT04ucGFyc2UodXNlcmxvZ2luKS5yZXN1bHQ7XG4gICAgICAgIGlmICh1c2VybG9naW4uc3RhdHVzID09PSAwKSB7XG4gICAgICAgICAgICB1c2VybG9naW4gPSB1c2VybG9naW4ucmVzdWx0XG4gICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgIHRpdGxlOiB1c2VybG9naW4ubmFtZSArIFwiJm5ic3A7Jm5ic3A7XCIgKyB1c2VybG9naW4ucXEgKyBcIiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOzxzbWFsbD48dT7mm7TmjaLotKblj7cgPjwvdT48L3NtYWxsPlwiLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiB1c2VybG9naW4uYXZhdGFyX3VybCxcbiAgICAgICAgICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL1VzZXJyZWdpc3RyYXRpb25cIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkYXRhLnNwbGljZSgzLCAwLCB7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHVzZXJsb2dpbi5oYXNfcmVwbHkgPyBcIvCfhpXlm57lpI1cIiA6IFwi8J+UlOWbnuWkjVwiLFxuICAgICAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvTXlSZXBseT91cmw9aGlrZXI6Ly9lbXB0eSNmeXBhZ2Ujbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXCIsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgIGF1dGhfY29kZTogdXNlclsxXSxcbiAgICAgICAgICAgICAgICAgICAgcXE6IHVzZXJbMF1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHVzZXJsb2dpbi5kZXRhaWwsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcbiAgICAgICAgICAgICAgICBkZXNjOiBcIuKAnOKAnOKAneKAnTxzbWFsbD48dT7ph43mlrDojrflj5bpqozor4HnoIEgPjwvdT48L3NtYWxsPlwiLFxuICAgICAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvVXNlcnJlZ2lzdHJhdGlvblwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogXCLor4TorrrnmbvlvZUv5rOo5YaMXCIsXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxuICAgICAgICAgICAgZGVzYzogXCJcIixcbiAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvVXNlcnJlZ2lzdHJhdGlvblwiXG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBmb3IgKHZhciBpdGVtIG9mIHVzZXJMaXN0KSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lICsgXCIoXCIgKyBpdGVtLnJ1bGVfbnVtICsgXCIpXCIsXG4gICAgICAgICAgICBkZXNjOiBpdGVtLmlkICsgJzonICsgaXRlbS5uaWNrX25hbWUsXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcixcbiAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvcnVsZXMjbm9IaXN0b3J5I1wiLFxuICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICBhdmF0YXJVcmw6IGl0ZW0uYXZhdGFyLFxuICAgICAgICAgICAgICAgIHFxOiBpdGVtLnFxLFxuICAgICAgICAgICAgICAgIGlkOiBpdGVtLmlkLFxuICAgICAgICAgICAgICAgIGNhbl91cGxvYWQ6IGl0ZW0uY2FuX3VwbG9hZFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBkYXRhLnB1c2goe1xuICAgICAgICBjb2xfdHlwZTogJ2xvbmdfdGV4dCdcbiAgICB9KTtcbiAgICBzZXRSZXN1bHQoZGF0YSk7XG4gICAgdHJ5IHtcbiAgICAgICAgbGV0IGltZyA9IFtcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICBcImhpa2VyOi8vZmlsZXMvaWNvbi/otZ4uc3ZnXCIsIFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9Njc1NlwiXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFwiaGlrZXI6Ly9maWxlcy9pY29uL+i4qS5zdmdcIiwgXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD02NzU3XCJcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgXCJoaWtlcjovL2ZpbGVzL2ljb24v6K+E6K66LnN2Z1wiLCBcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTY3NThcIlxuICAgICAgICAgICAgXVxuICAgICAgICBdO1xuICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGltZykge1xuICAgICAgICAgICAgaWYgKCFmaWxlRXhpc3QoaXRlbVswXSkpIHtcbiAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoaXRlbVsxXSwgaXRlbVswXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9IGNhdGNoIChlKSB7XG5cbiAgICB9XG59Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHkjKioiLCJncm91cCI6IiPvuI/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nZXRTZWNvbmRzKCkrMTtcXG4gICAgICAgICAgICBpZiAobW9udGggPj0gMSAmJiBtb250aCA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIG1vbnRoID0gXFxcIjBcXFwiICsgbW9udGhcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0ckRhdGUgPj0gMCAmJiBzdHJEYXRlIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyRGF0ZSA9IFxcXCIwXFxcIiArIHN0ckRhdGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0ckhvdXJzID49IDAgJiYgc3RySG91cnMgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJIb3VycyA9IFxcXCIwXFxcIiArIHN0ckhvdXJzXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChzdHJNaW51dGVzID49IDAgJiYgc3RyTWludXRlcyA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ck1pbnV0ZXMgPSBcXFwiMFxcXCIgKyBzdHJNaW51dGVzXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChzdHJTZWNvbmRzID49IDAgJiYgc3RyU2Vjb25kcyA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0clNlY29uZHMgPSBcXFwiMFxcXCIgKyBzdHJTZWNvbmRzXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vbGV0IGN1cnJlbnRkYXRlID0gZGF0ZS5nZXRGdWxsWWVhcigpICsgc2VwZXJhdG9yMSArIG1vbnRoICsgc2VwZXJhdG9yMSArIHN0ckRhdGUgKyBcXFwiIFxcXCIgKyBzdHJIb3VycyArIHNlcGVyYXRvcjIgKyBzdHJNaW51dGVzICsgc2VwZXJhdG9yMiArIHN0clNlY29uZHM7XFxuICAgICAgICAgICAgbGV0IGN1cnJlbnRkYXRlID0gKGRhdGUuZ2V0RnVsbFllYXIoKS0yMDIwKSsnJysgbW9udGggKycnKyBz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AgICB1cmw6IHN1YlVybCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL1xcXCIrdGl0bGUrXFxcIi5qc29uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvZGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgYWN0aXZlOiBmYWxzZSwvL+emgeeUqOW5tuWPkeabtOaWsFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBzaGFyZVRleHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoc3ViT2JqKSk7XFxuICAgICAgICAgICAgICAgIHZhciBwYXN0ZXMgPSBnZXRQYXN0ZXMoKTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHNoYXJlUGFzdGUoc2hhcmVUZXh0LHBhc3Rlcy5zbGljZSgtMSlbMF0pO1xcbiAgICAgICAgICAgICAgICBsZXQgaW1wb3J0X3J1bGU9IFxcXCLovbvlkIjpm4borqLpmIXvvJpcXFwiK3RpdGxlKydcXFxcbicrdXJsO1xcbiAgICAgICAgICAgICAgICBjb3B5KGltcG9ydF9ydWxlKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgcGF0aCA9ICdoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL3N1Yi5qc29uJztcXG4gICAgICAgICAgICAgICAgJC5yYyhjb25maWcubGliLnN1Yik7XFxuICAgICAgICAgICAgICAgIHJldHVybiDorqLpmIXlr7zlhaUocGF0aClcXG4gICAgICAgICAgICB9LGRhdGFJdGVtLHN1YlVybCksXFxuICAgICAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlXFxuICAgICAgICB9KTtcXG4gICAgfVxcbn1cXG5pZiAocnVsZUNvZGUpIHtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5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3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiY2FuX3VwbG9hZFxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/CfmqvnpoHmraLkuIrkvKAnLFxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJCgn56aB5q2i6K+l5byA5Y+R6ICF5LiK5Lyg6KeE5YiZP+S9oOeahOaTjeS9nOWwhuiiq+ezu+e7n+iusOW9lScpLmNvbmZpcm0oKGlkLCBjYW5fdXBsb2FkX2FwaSwgc2V0VXBsb2FkKSA9PiB7XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldFVwbG9hZChmYWxzZSwgY2FuX3VwbG9hZF9hcGkpO1xcbiAgICAgICAgICAgIGlmICghL+aTjeS9nOWksei0pS8udGVzdChyZXQpKSB7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignV2FyZWhv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gICAgIGxldCB0aXRsZSA9IFxcXCJKLVxcXCIrZGF0YUl0ZW0ubmFtZS5zcGxpdCgnLicpWzBdO1xcbiAgICAgICAgICAgICAgICBsZXQgc3ViT2JqID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBzdWJVcmwsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3J1bGVDYWNoZS9cXFwiK3RpdGxlK1xcXCIuanNvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2RlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGFjdGl2ZTogZmFsc2UsLy/npoHnlKjlubblj5Hmm7TmlrBcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgc2hhcmVUZXh0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHN1Yk9iaikpO1xcbiAgICAgICAgICAgICAgICB2YXIgcGFzdGVzID0gZ2V0UGFzdGVzKCk7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBzaGFyZVBhc3RlKHNoYXJlVGV4dCxwYXN0ZXMuc2xpY2UoLTEpWzBdKTtcXG4gICAgICAgICAgICAgICAgbGV0IGltcG9ydF9ydWxlPSBcXFwi6L275ZCI6ZuG6K6i6ZiF77yaXFxcIit0aXRsZSsnXFxcXG4nK3VybDtcXG4gICAgICAgICAgICAgICAgY29weShpbXBvcnRfcnVsZSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSAnaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3J1bGVDYWNoZS9zdWIuanNvbic7XFxuICAgICAgICAgICAgICAgICQucmMoY29uZmlnLmxpYi5zdWIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4g6K6i6ZiF5a+85YWlKHBhdGgpXFxuICAgICA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HtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpc19zYWZlXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGZ1bmN0aW9uIHNldElzR29vZChmbGFnLG1hbl9ydWxlX2dvb2QpIHtcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgY29kZSA9IGZldGNoKG1hbl9ydWxlX2dvb2QsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlzX2dvb2RcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifwn5qr6aOO6ZmpJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrpo47pmak/6aOO6Zmp6KeE5YiZ5peg5rOV6KKr5a+85YWlJykuY29uZmlybSgoaWQsbWFuX3J1bGVfc2FmZSxzZX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lX2dvb2Qsc2V0SXNHb29kKT0+e1xcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc0dvb2QoZmFsc2UsbWFuX3J1bGVfZ29vZCk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX2dvb2Qsc2V0SXNHb29kKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifwn5KW5LyY6LSoJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrkvJjotKg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzR29vZCh0cnVlLG1hbl9ydWxlX2dvb2QpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9nb29kLHNldElzR29vZClcXG4gICAgfSk7XFxufVxcblxcbmRhdGEucHVzaCh7XFxuICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG59KTtcXG5kYXRhLnB1c2goe1xcbiAgICB0aXRsZTogZGF0YUl0ZW0uZ29vZF9udW0sXFxuICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ZpbGVzL2ljb24v6LWeLnN2Z1xcXCIs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meSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicmVhc29uXFxcIjogZGVzY3JpcHRpb24sXFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHVzZXJuYW1lXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdwb3N0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGlkcmVzdWx0ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldElkICsgXFxcIj9xcT1cXFwiICsgdXNlcm5hbWUpKTtcXG4gICAgICAgIGlmIChpZHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIGlkcmVzdWx0LmRldGFpbDtcXG4gICAgICAgIH1cXG4gICAgICAgIFxcbiAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLovpPlhaXpgq7nrrHpqozor4HnoIFcXFxcblxcXCIgKyByZXN1bHQuZGV0YWlsKS5pbnB1dCgoY29uZmlybSwgaWQsIGFjY291bnQpID0+IHtcXG4gICAgICAgICAgICBzaG93TG9hZGluZyhcXFwi6K+36ICQ5b+D562J5b6FXFxcIik7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoY29uZmlybSwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZ2lzdF9pZFxcXCI6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwieXptXFxcIjogaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcihcXFwiV2FyZWhvdXNlVXNlcm5hbWVcXFwiLCBhY2NvdW50WzBdKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcihcXFwiV2FyZWhvdXNlUGFzc3dvcmRcXFwiLCBhY2NvdW50WzFdKTtcXG4gICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuIC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XG4gICAgICAgICAgICB0eXBlOlxcXCJwYXNzd29yZFxcXCIsXFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRWYXIoJ1dhcmVob3VzZS5tLlBhc3N3b3JkLnknLCAnJyksXFxuICAgICAgICAgICAgb25DaGFuZ2U6ICdwdXRWYXIoXFxcIldhcmVob3VzZS5tLlBhc3N3b3JkLnlcXFwiLGlucHV0KSdcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6XFxcIuaWsOWvhueggVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXmlrDlr4bnoIFcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0eXBlOlxcXCJwYXNzd29yZFxcXCIsXFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRWYXIoJ1dhcmVob3VzZS5tLlBhc3N3b3JkLngnLCAnJyksXFxuICAgICAgICAgICAgb25DaGFuZ2U6ICdwdXRWYXIoXFxcIldhcmVob3VzZS5tLlBhc3N3b3JkLnhcXFwiLGlucHV0KSdcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTpcXFwi6YeN5aSN5paw5a+G56CBXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+mHjeWkjeaWsOWvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgIGRlZmF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xcXCJnb29kXFxcIjogXFxcIvCfkY1cXFwiLFxcbiAgICBcXFwiYmFkXFxcIjogXFxcIvCfkY5cXFwiLFxcbiAgICBcXFwicmVwbHlcXFwiOlxcXCLlvIDlj5HogIXwn5ejXFxcIlxcbn1cXG5sZXQgY29udHJvbD0ocGlkLGFjdGl2ZSk9PnZvaWQgMDtcXG5pZihub19hY3RpdmUpe1xcbiAgICBjb250cm9sPWZ1bmN0aW9uKHBpZCxhY3RpdmUpe1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTphY3RpdmU/XFxcIumakOiXj+ivhOiuulxcXCI6XFxcIuWxleekuuivhOiuulxcXCIsXFxuICAgICAgICAgICAgdXJsOiQoYXBpLmRpc19kZXZfY29udHJvbCtwaWQrXFxcIj9xcT1cXFwiICsgdXNlcm5hbWUgKyBcXFwiJnBhc3N3b3JkPVxcXCIgKyBwYXNzd29yZCtcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKT0+e1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0PUpTT04ucGFyc2UocmVxdWVzdChpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIrcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTpcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOlxcXCLliKDpmaTor4TorrpcXFwiLFxcbiAgICAgICAgICAgIHVybDokKFxcXCLnoa7orqTliKDpmaTor6Xor4Torro/XFxcIikuY29uZmlybSgoaW5wdXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQ9SlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KSk7XFxuICAgICAgIC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HRfMidcXG59KTtcXG5cXG5kYXRhLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIuaPkOS6pFxcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgIHVybDogJChhcGkuZGlzX25ldyArIGlkKS5sYXp5UnVsZSgoQWNjb3VudCkgPT4ge1xcbiAgICAgICAgbGV0IHRleHQgPSBnZXRWYXIoJ1dhcmVob3VzZS5jb21tZW50LnRleHQnLCAnJyk7XFxuICAgICAgICBsZXQgW3FxLGF1dGhfY29kZV0gPSBBY2NvdW50O1xcbiAgICAgICAgbGV0IHR5cGUgPSBnZXRWYXIoJ1dhcmVob3VzZS5jb21tZW50LnR5cGUnKSB8fCAnZ29vZCc7XFxuICAgICAgICBxcT1xcXx8XFxcIlxcXCI7XFxuICAgICAgICBhdXRoX2NvZGU9YXV0aF9jb2RlfHxcXFwiXFxcIjtcXG4gICAgICAgIGlmKHFxPT1cXFwiXFxcInx8YXV0aF9jb2RlPT1cXFwiXFxcIil7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+acqueZu+W9lei0puWPt1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBpZih0ZXh0PT1cXFwiXFxcIil7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWGmeWVilxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBmdW5jdGlvbiByKHApIHtcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHApLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHAgPSB7XFxuICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRpc2N1c3NfdGV4dFxcXCI6IHRleHQsXFxuICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxLFxcbiAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc190eXBlXFxcIjogdHlwZSxcXG4gICAgICAgICAgICAgICAgXFxcImF1dGhfY29kZVxcXCI6IGF1dGhfY29kZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGxldCByZXN1bHQgPSByKHApO1xcbiAgICAgICAgaWYocmVzdWx0LnN0YXR1cz09PTApe1xcbiAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIrcmVzdWx0LmRldGFpbDtcXG5cXG4gICAgfSx1c2VyKVxcbn0pO1xcblxcbnNldFJlc3VsdChkYXRhKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS8queUqOaIt+azqOWGjFwiLFwicGF0aFwiOlwiVXNlcnJlZ2lzdHJhdGlvblwiLFwicnVsZVwiOlwianM6XFxuY29uc3Qge1xcbiAgICBhcGksXFxuICAgIGdldEZpbGUsXFxuICAgIGdldFVzZXJEYXRlXFxufSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVxcXCIpO1xcbmxldCBkYXRhID0gW107XFxuZGF0YS5wdXNoKHtcXG4gICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbn0pO1xcbnNldFBhZ2VUaXRsZShcXFwi55So5oi35YiX6KGo566h55CGXFxcIik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gICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiBxcVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0MiA9IEpTT04ucGFyc2UocmVxdWVzdChiICsgXFxcIj9xcT1cXFwiICsgcXEpKTtcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQyLmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICB0aHJvdyBlO1xcbiAgICAgICAgfVxcbiAgICAgICAgfSwgcXEsIGEsIGIpO1xcblxcbiAgICB9LCBhcGkuZGlzX25ld191c2VyLCBhcGkuZGlzX3ZlcmlmeSksXFxuICAgIGV4dHJ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VXFxcIixcXG4gICAgdXJsOiAkKFxcXCLnoa7lrprkv53lrZjvvIzpqozor4HnoIHloavplJnvvIzml6Dms5Xor4Torrrlk6ZcXFwiKS5jb25maXJtKChmLCBsLCBsb2dpbikgPT4ge1xcbiAgICAgICAgbGV0IHFxID0gZ2V0VmFyKCdXYXJlaG91c2UubS5xcScsICcnKTtcXG4gICAgICAgIGxldCB5em0gPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnl6bScsICcnKTtcXG4gICAgICAgIGlmIChxcSA9PSBcXFwiXFxcIiB8fCB5em0gPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vcXHmiJbpqozor4HnoIHkuLrnqbpcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QobG9naW4sIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImF1dGhfY29kZVxcXCI6IHl6bVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgZi51c2VyID0gW3FxLCB5em1dO1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9XY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xcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pyq55m75b2V6LSm5Y+3XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0ZXh0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWGmeWVilxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImRpc2N1c3NfdGV4dFxcXCI6IHRleHQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiB1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImRpc2N1c3NfaWRcXFwiOiBydWxlSWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcblxcbiAgICB9LCBw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GVhZGVycyx3aXRoSGVhZGVyczpmYWxzZSxyZWRpcmVjdDpmYWxzZX07XFxuICAgICAgICAgICAgaWYod2ViX3VybF9hcnIubGVuZ3RoPj0yJiZ3ZWJfdXJsX2FyclsxXS5sZW5ndGg+Mil7IC8vIOiuvue9ruivt+axguaWueazlVxcbiAgICAgICAgICAgICAgICBwYXJhbXNbJ21ldGhvZCddID0gd2ViX3VybF9hcnJbMV0udG9VcHBlckNhc2UoKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbG9nKCflvIDlp4vojrflj5bmupDnoIEnKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAvKlxcbiAgICAgICAgICAgICAgICByZXF1ZXN0QXN5bmMod2ViX3VybCxwYXJhbXMsZnVuY3Rpb24gKGtleSxjb2RlKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYmFja19jb2RlID0gY29kZTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICBsZXQgYmFja19jb2RlID0gZ2V0SXRlbSgnaG91c2UuZmlsZV91YScpPT09J+eUteiEkSc/ZmV0Y2god2ViX3VybCxwYXJhbXMpOnJlcXVlc3Qod2ViX3VybCxwYXJhbXMpO1xcbiAgICAgICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKXtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5Ys5bm26YOo5YiG5o+S5YWl5Yiw5paH5pys5Yy65Z+fJ1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bliLDnqbrmlofmnKzvvIznlpHkvLzkvaDmsqHmnInmraTmlofku7YhJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WPkeeUn+S6humUmeivrzpcXFxcbicrZS5tZXNzYWdlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNlIGlmKC/kuLvpopjvv6V85YWD57Sg77+lLy50ZXN0KGlucHV0KSl7XFxuICAgICAgICAgICAgbG9nKCfkuLvpopjpk77mjqUnKTtcXG4gICAgICAgICAgICBsZXQgd2ViX3VybF9hcnIgPSBpbnB1dC5zcGxpdCgn77+lJyk7XFxuICAgICAgICAgICAgbGV0IHdlYl91cmwgPSB3ZWJfdXJsX2Fyclt3ZWJfdXJsX2Fyci5sZW5ndGgtMV07XFxuICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IHBhcnNlUGFzdGUod2ViX3VybCk7XFxuICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCkge1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bov5Tlm57kuLo6XFxcXG4nK2JhY2tfY29kZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6Z2e5rOV6ZO+5o6lOlxcXFxuJytnZXRWYXIoJ2hvdXNlLndlYl91cmwnKTtcXG4gICAgICAgIH1cXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiXFxufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLpgInmi6nmlofku7bot6/lvoRcXFwiLFxcbiAgICB1cmw6JCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKT0+e1xcbiAgICAgICAgLypcXG4gICAgICAgIGxldCBmcCA9ICdodHRwczovL2dpdGNvZGUubmV0L3FxXzMyMzk0MzUxL2RyLy0vcmF3L21hc3Rlci9qcy9maWxlU2VsZWN0LmpzJztcXG4gICAgICAgIGxldCBmID0gcmVxdWlyZShmcCk7XFxuICAgICAgICAqL1xcbiAgICAgICAgbGV0IGZwPWNvbmZpZy5saWIuZmlsZVNlbGVjdDtcXG4gICAgICAgIGxldCBmPSQucmMoZnApO1xcbiAgICAgICAgcmV0dXJuIGYuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gZmluZEl0ZW0oXFxcImZpbGVQYXRoXFxcIikuZXh0cmE7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcImZpbGVQYXRoXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBQQVRIXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS53ZWJfdXJsJyxQQVRIKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgb25DbGlja1R5cGU6J2NvbmZpcm0nLFxcbiAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLmpzfC50eHR8Lmhpa2VyfC5qc29ufC5odG1sXFxcIixcXG4gICAgICAgICAgICBwYXR0ZXJuOiAwLFxcbiAgICAgICAgICAgIHJlcXVpcmVVcmw6ZnAsXFxuICAgICAgICAgICAgaW5pdGlhbFBhdGg6Z2V0UGF0aCgnaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlLycpLnNsaWNlKDcpLFxcbiAgICAgICAgICAgIG1lbW9yeTondHJ1ZScsXFxuICAgICAgICB9KTtcXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6J+S4iuS8oOexu+WeiycsXFxuICAgIGRlc2M6J+S4iuS8oOaWh+S7tueahOexu+WeiyzlvZPliY3kuLo6Jytjb2xvcihnZXRJdGVtKCdob3VzZS5maWxlX3R5cGUnLCfpnZnmgIHmlofku7YnK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uc3BsaXQoJzsnKVswXTtcXG4gICAgICAgIGxldCBmaWxlTmFtZSA9ICcnO1xcbiAgICAgICAgaWYoL15oaWtlcjp8XmZpbGU6fF5odHRwOnxeaHR0cHM6fF5cXFxcL3N0b3JhZ2VcXFxcL3xeXFxcXC9zZGNhcmRcXFxcLy8udGVzdCh3ZWJfdXJsKSl7XFxuICAgICAgICAgICAgZmlsZU5hbWUgPSB3ZWJfdXJsLnNwbGl0KCcvJylbd2ViX3VybC5zcGxpdCgnLycpLmxlbmd0aC0xXTtcXG4gICAgICAgIH1lbHNlIGlmKC/kuLvpopjvv6V85YWD57Sg77+lLy50ZXN0KGlucHV0KSl7XFxuICAgICAgICAgICAgbGV0IGJrYXJyID0gdXBfY29kZS5zcGxpdCgn77+lJyk7XFxuICAgICAgICAgICAgaWYoYmthcnIubGVuZ3RoPDMpe1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5LqR5Ymq6LS05p2/5YaF5a655pyJ6K+vJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzd2l0Y2ggKGJrYXJyWzFdKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfdGhlbWUnOlxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfjgIwnKVsxXS5zcGxpdCgn44CNJylbMF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnbXlfaG9tZV9zaW5nbGUnOlxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfjgIwnKVsxXS5zcGxpdCgn44CNJylbMF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnanNfdXJsJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn77+lJylbMl0uc3BsaXQ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ZmgobGlzdFtpXSx0WzFdKSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDpfcGljLFxcbiAgICAgICAgICAgICAgICBkZXNjOnBkZmgobGlzdFtpXSx0WzNdKSxcXG4gICAgICAgICAgICAgICAgdXJsOmVqP3BkKGxpc3RbaV0sdFs0XSk6cGQobGlzdFtpXSx0WzRdKStsYXp5XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZih0Lmxlbmd0aD41KXsvL+WGheWuue+8jOeUqOS6juaQnOe0olxcbiAgICAgICAgICAgICAgICBpdC5jb250ZW50PXBkZmgobGlzdFtpXSx0WzVdKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goaXQpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYob25seWJhY2spe1xcbiAgICAgICAgICAgIHJldHVybiBkXFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgIH1cXG4gICAgfSxwYXJTdHIsZWosb25seWJhY2ssaHRtbCxpc1BpYylcXG59XFxuXFxuZnVuY3Rpb24gaXNCYWRWaWRlbyh2aWRlb1VybCkgey8v5piv5Z2P55qE6KeG6aKRXFxuICAgIGxldCBkbVBhdGggPSAnaGlrZXI6Ly9maWxlcy9jYWNoZS9kaWFvbWFvLnR4dCc7Ly/lkIrmr5vmqKHlvI/ov4fmu6Tmlofku7bot6/lvoRcXG4gICAgbGV0IGRtVXJscztcXG4gICAgdHJ5IHtcXG4gICAgICAgIGRtVXJscyA9IHJlcXVlc3QoZG1QYXRoKS50cmltKCkuc3BsaXQoJ1xcXFxuJykuZmlsdGVyKGl0ID0+IGl0ICYmICFpdC5zdGFydHNXaXRoKCcvLycpKTtcXG4gICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgZG1VcmxzID0gW107XFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gaGFzRG0odmlkZW9VcmwsIGRtVXJscykgey8v5pKt5pS+5Zyw5Z2A5piv5ZCm5Li65ZCK5q+b6KeG6aKRXFxuICAgICAgICBpZiAoZG1VcmxzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2VcXG4gICAgICAgIH1cXG4gICAgICAgIGZ1bmN0aW9uIHByaW50KHN0cil7XFxuICAgICAgICAgICAgaWYodHlwZW9mKGxvZykhPT0ndW5kZWZpbmVkJyl7XFxuICAgICAgICAgICAgICAgIGxvZyhzdHIpO1xcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKHN0cik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChsZXQgZG1Vcmwgb2YgZG1VcmxzKSB7XFxuICAgICAgICAgICAgaWYgKChuZXcgUmVnRXhwKGRtVXJsKSkudGVzdCh2aWRlb1VybCkpIHsvL+aSreaUvuWcsOWdgOWMheWQq+WQiuavm+agh+W/l+eahOWcsOWdgFxcbiAgICAgICAgICAgICAgICBwcmludCgn5ZCK5q+b6KeG6aKRLOiHquWKqOi/h+a7pDonK3ZpZGVvVXJsKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBwcmludCgn6Z2e5ZCK5q+b6KeG6aKRLOWPr+aSreaUvjonK3ZpZGVvVXJsKTtcXG4gICAgICAgIHJldHVybiBmYWxzZVxcbiAgICB9XFxuXFxuICAgIGZ1bmN0aW9uIGlzRG0ocmV0KSB7XFxuICAgICAgICBpZiAoIXJldCkge1xcbiAgICAgICAgICAgIHJldHVybiB0cnVlXFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaGFzRG0ocmV0LnNwbGl0KCcjJylbMF0uc3BsaXQoJzsnKVswXSwgZG1VcmxzKVxcbiAgICB9XFxuICAgIHJldHVybiBpc0RtKHZpZGVvVXJsKVxcbn1cXG5cXG5mdW5jdGlvbiBsYXp5UGFyc2UocGxheV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ykpJiYoIS9tc2d8Y29kZXxodG1sLy50ZXN0KGJhY2spKSl7XFxuICAgICAgICAgICAgbG9nKGJhY2spO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/nlpHkvLzlr7nmlrnmlbDmja7liqDlr4bkuobvvIzlhbfkvZPmlbDmja7nnIvml6Xlv5cnXFxuICAgICAgICB9XFxuICAgIH1jYXRjaChlKXtcXG4gICAgICAgIGxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgcmV0dXJuIGJhZFxcbiAgICB9XFxuICAgIHRyeSB7XFxuICAgICAgICBiYWNrPUpTT04ucGFyc2UoYmFjayk7XFxuICAgICAgICBsZXQgcmVhbFVybD1iYWNrLnVybDtcXG4gICAgICAgIGlmKHR5cGVvZihyZWFsVXJsKT09XFxcInVuZGVmaW5lZFxcXCJ8fCFyZWFsVXJsKXtcXG4gICAgICAgICAgICBsb2coYmFjayk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mBk+mVv+S7k+W6k+ino+aekOWksei0pe+8gei/lOWbnuaSreaUvuWcsOWdgOS4uuepulxcXCJcXG4gICAgICAgIH0gZWxzZSBpZih0eXBlb2YoaXNWaWRlbyhyZWFsVXJsLHJlY2hhbmdlKSk9PSdzdHJpbmcnKXtcXG4gICAgICAgICAgICByZXR1cm4gaXNWaWRlbyhyZWFsVXJsLHJlY2hhbmdlKTtcXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHJldHVybiByZWFsVXJsK1xcXCIjaXNWaWRlbz10cnVlI1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICAvL2Vsc2V7XFxuICAgICAgICAvL3JlYWxVcmwrPVxcXCI7e1VzZXItQWdlbnRATW96aWxsYS81LjB9XFxcIjtcXG4gICAgICAgIC8vIH1cXG4gICAgfWNhdGNoIChlKSB7XFxuICAgICAgICBsb2coXFxcIuajgOa1i+WIsOino+aekOWPo+mdnmpzb27plJnor686XFxcIitlLm1lc3NhZ2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ICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlcXVlc3QpPT0ndW5kZWZpbmVkJ3x8IXJlcXVlc3Qpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmJhLmdldEludGVybmFsSnMoKSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGZiYS5wdXRWYXIoXFxcIl94NWp4VXJsXFxcIixwbGF5VXJsKTtcXG4gICAgICAgICAgICAgICAgaWYod2luZG93LmNvdW50ID09IG51bGwpe1xcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNvdW50PTE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHRleHQ9Jyc7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICAgICAgaWYoL+inpuWPkeS6humYsuebl+mTvnzmnKrmjojmnYN85o6l5Y+j6Ziy55uXLy50ZXN0KHRleHQpJiZ3aW5kb3cuY291bnQ9PT0xKXtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuajgOa1i+WIsOacieaOiOadg++8jOW8gOWni+i/h+aOiOadg1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2NhdGlvbi5yZWxvYWQoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLmhyZWY9ZmJhLmdldFZhcihcXFwiX3g1anhVcmxcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQrKztcXG4gICAgICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6Jyt3aW5kb3cuY291bnQrJyxtYXhfY291bnQ6JyttYXhfY291bnQpO1xcbiAgICAgICAgICAgICAgICBpZiggd2luZG93LmNvdW50ID49IG1heF9jb3VudCl7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLotoXov4dcXFwiK21heF9jb3VudCoyNTArXFxcIuavq+enkuacquiOt+WPluWIsOi1hOa6kOWcsOWdgO+8jOi3s+WIsOa6kOe9kemhtSzku6XkuIvmmK/liqDovb3ov4fnmoTlnLDlnYBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKHRleHQpO1xcbiAgICAgICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhKU09OLnN0cmluZ2lmeShfZ2V0VXJscygpKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmJhLmdldFZhcihcXFwiX3g1anhVcmxcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBtdXRlTWUoZWxlbSkge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtLnBhdXNlKCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciB2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJ2aWRlb1xcXCIpLCBhdWRpb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJhdWRpb1xcXCIpLCB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImVtYmVkXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiI3BsYXllclxcXCIpO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHZpZGVvcywgZnVuY3Rpb24gKHZpZGVvKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHZpZGVvKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYyLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYzLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB2YXIgdXJscyA9IF9nZXRVcmxzKCk7XFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkodXJscykpO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU9dW5lc2NhcGUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXC8vLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwidmlk5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1cXFxcLy8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0ID0gdS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBob3N0K3Uuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInZpZOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcPyguKik9aHR0cC8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cFxcXCIrdS5zcGxpdCgvXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuWFtuS7luWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3xpbmRleFxcXFwubTN1OCRcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcLzFcXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgdT11LnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlYWxVcmwgPSBpc1ZpZGVvKHUscmVjaGFuZ2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVXJsKT09J3N0cmluZycmJiFpc0JhZFZpZGVvKHUpKXsvL+i/h+a7pOWQiuavm+inhumikVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Z5X2JyaWRnZV9hcHAuc2V0V2ViVWEoUENfVUEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YoZmJhLmdldEhlYWRlclVybCkhPT0ndW5kZWZpbmVkJyYmdHlwZW9mKHJlY2hhbmdlKSE9PSdmdW5jdGlvbicpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGV0IGJhY2tVcmwgPSBmYmEuZ2V0SGVhZGVyVXJsKHUucmVwbGFjZShcXFwiO3tcXFwiLFxcXCIjaXNWaWRlbz10cnVlIzt7XFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tVcmwgPSBmYmEuZ2V0SGVhZGVyVXJsKHVybHNbaV0pLnJlcGxhY2UoJzt7JywnI2lnbm9yZUltZz10cnVlIyNpc1ZpZGVvPXRydWUjO3snKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1MSA9IGJhY2tVcmwuc3BsaXQoJyNpZ25vcmVJbWcnKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1MiA9ICcjaWdub3JlSW1nJytiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3VybD1cXFxcLy8udGVzdCh1MSkmJi9cXFxcLm0zdTgvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdDEgPSB1MS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBob3N0MSt1MS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXC8vLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QxID0gdTEubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcPyguKik9aHR0cC8udGVzdCh1MSkmJi9cXFxcLm0zdTgvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IFxcXCJodHRwXFxcIit1MS5zcGxpdCgvXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrVXJsID0gdTEgKyB1MjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coJ+i/lOWbnuiHquWKqOWKoGNvb2tpZemTvuaOpTonK2JhY2tVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZygn6L+U5Zue6ZO+5o6lOicrdSsn5bm26Ieq5Yqo5Yqg5LqGY29va2llLOWFt+S9k2Nvb2tpZeWcqOinhumikeaSreaUvuWkhOafpeeciycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJhY2tVcmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIui/lOWbnuS7k+W6k3g15YWN5ZeF57uT5p6cOlxcXCIrcmVhbFVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbFVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIC8vIGZ5X2JyaWRnZV9hcHAubG9nKCd4NeWkp+iMg+WbtOmUmeivrzonK2UubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIGFsZXJ0KCd4NeWkp+iMg+WbtOmUmeivrzonK2UubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/miqXplJnnu5PmnZ94NSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LGlzVmlkZW8scmVjaGFuZ2UscGxheVVybCxtYXhfY291bnQsUENfVUEsaXNCYWRWaWRlbyk7XFxuICAgICAgICBsZXQgdXNlV2ViPWxzZy5nZXRJdGVtKFxcXCLpgJrlhY1cXFwiLFxcXCJYNVxcXCIpPT09XFxcIldFQlxcXCI7XFxuICAgICAgICAvL2xvZyhcXFwi5LuT5bqT5L2/55Sod2Vi6YCa5YWN5pu/5LujeDU6XFxcIit1c2VXZWIpO1xcbiAgICAgICAgbGV0IHJ1bGVIZWFkPXVzZVdlYiYmcGFyc2VJbnQoZ2V0QXBwVmVyc2lvbigpKT49MjMzOT9cXFwid2ViUnVsZTovL1xcXCI6XFxcIng1UnVsZTovL1xcXCI7XFxuICAgICAgICBsZXQgeDVVcmwgPSBydWxlSGVhZCtwbGF5VXJsKyAnQCcgK194NTtcXG4gICAgICAgIHJldHVybiB4NVVybFxcbiAgICB9XFxufVxcblxcbm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ooYznmoTmrKHmlbBcXG4gICAgcHV0VmFyKCd4NUxpc3QnLEpTT04uc3RyaW5naWZ5KHg1bGlzdCkpO1xcbiAgICBsZXQgX3g1ID0gJC50b1N0cmluZygoaXNWaWRlbywgbWF4X2NvdW50LHg1VGltZW91dCxpc0JhZFZpZGVvKSA9PiB7XFxuICAgICAgICAvL+WIneWni+WMlmZiYeWSjHJlcXVzdFxcbiAgICAgICAgaWYgKHR5cGVvZiAoZmJhKSA9PSAndW5kZWZpbmVkJyB8fCAhZmJhKSB7XFxuICAgICAgICAgICAgdmFyIGZiYSA9IGZ5X2JyaWRnZV9hcHA7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YgKHJlcXVlc3QpID09ICd1bmRlZmluZWQnIHx8ICFyZXF1ZXN0KSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoZmJhLmdldEludGVybmFsSnMoKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tXFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPT0gbnVsbCkge1xcbiAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQgPSAxO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgdGV4dD0nJztcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcbiAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT0xKXtcXG4gICAgICAgICAgICAgICAgbG9jYXRpb24ucmVsb2FkKCk7XFxuICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuajgOa1i+WIsOacieaOiOadg++8jOW8gOWni+i/h+aOiOadg1xcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB3aW5kb3cuY291bnQrKztcXG4gICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonICsgd2luZG93LmNvdW50ICsgJyxtYXhfY291bnQ6JyArIG1heF9jb3VudCk7XFxuICAgICAgICAgICAgaWYgKHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpIHtcXG4gICAgICAgICAgICAgICAgZmJhLmNsZWFyVmFyKCd4NUxpc3QnKTtcXG4gICAgICAgICAgICAgICAgZmJhLmhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIGxldCBmbXNnID0gJ+mBk+mVv+S7k+W6k+mAmuWFjeino+aekOWksei0pSzljp/lm6A66LaF5pe2Jyt4NVRpbWVvdXQrJ+avq+enkic7XFxuICAgICAgICAgICAgICAgIGZiYS5sb2coZm1zZyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK2Ztc2c7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBlbGVtLnBhdXNlKCk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHZhciB2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJ2aWRlb1xcXCIpLCBhdWRpb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJhdWRpb1xcXCIpLFxcbiAgICAgICAgICAgIHYyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiZW1iZWRcXFwiKSwgdjMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCIjcGxheWVyXFxcIik7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2aWRlb3MsIGZ1bmN0aW9uICh2aWRlbykge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwoYXVkaW9zLCBmdW5jdGlvbiAoYXVkaW8pIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYyLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgLy91PWRlY29kZVVSSUNvbXBvbmVudCh1KTtcXG4gICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgIHU9dW5lc2NhcGUodSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcPyguKik9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBcXFwiK3Uuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKFxcXCLlhbbku5bliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFwvMVxcXFwubTN1OCQvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdT11LnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxuICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1KTtcXG4gICAgICAgICAgICAgICAgaWYgKHJlYWxVcmwmJiFpc0JhZFZpZGVvKHUpK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/cnVsZT3pgZPplb/ku5PlupNQcm8nKTtcXG4gICAgLy8gbG9nKCflvIDlp4vmiafooYwnK3BsYXlVcmxMaXN0Lmxlbmd0aCsn5Liq5Zyw5Z2A55qE5om56YeP5ZeF5o6iOicrcGxheVVybExpc3QpO1xcbiAgICBsb2coJ+W8gOWni+aJp+ihjCcrcGxheVVybExpc3QubGVuZ3RoKyfkuKrlnLDlnYDnmoTmibnph4/ll4XmjqInKTtcXG4gICAgbGV0IHBsYXlVcmxzID0gcGxheVVybExpc3QubWFwKChpdCk9PntcXG4gICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgdXJsOml0LnNwbGl0KFxcXCI7XFxcIilbMF0sXFxuICAgICAgICAgICAgb3B0aW9uczoge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAvL1xcXCJVc2VyLUFnZW50XFxcIjogXFxcIkRhcnQvMi4xMyAoZGFydDppbylcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOlxcXCJNb3ppbGxhLzUuMFxcXCJcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgdGltZW91dDogZ2V0VGltZW91dFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxldCBiaHRtbCA9IGJhdGNoRmV0Y2gocGxheVVybHMpO1xcbiAgICBsZXQgdmlkZW9zID0gW107XFxuICAgIGxldCB4NWxpc3QgPSBbXTtcXG4gICAgZm9yKGxldCBpIGluIGJodG1sKXtcXG4gICAgICAgIGxldCBvcmRlciA9IHBhcnNlSW50KGkpKzE7XFxuICAgICAgICBsZXQgdG5hbWU9b3JkZXIrJ+WPt+ino+aekOe9keWdgDonO1xcbiAgICAgICAgLy9sb2codG5hbWUpO1xcbiAgICAgICAgbGV0IHR1cmw9cGxheVVybExpc3RbaV0uc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAg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h1cmwpO1xcbiAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFZpZGVvKT09J3N0cmluZycpe1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHRuYW1lKyflt7Lop6PmnpDlh7rop4bpopE6JytyZWFsVmlkZW8pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoam5hbWUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlYWxWaWRlbys9XFxcIuKYhVxcXCIram5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZpZGVvcy5wdXNoKHJlYWxWaWRlbyk7XFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHRuYW1lKyfop6PmnpDlh7rkuI3nn6XpgZPku4DkuYjkuJzopb86Jyt1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgdXJsKz1cXFwiI2lzVmlkZW89dHJ1ZSNcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoam5hbWUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCs9XFxcIuKYhVxcXCIram5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZpZGVvcy5wdXNoKHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgbG9nKHRuYW1lKyfkuLpqc29u5o6l5Y+j5LiU5peg6L+U5Zue6KeG6aKR5Zyw5Z2A5pWw5o2uOicrcGxheVVybExpc3RbaV0rJ1xcXFxuJytiYWNrY29kZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKHRuYW1lKyfkuLp4NeaOpeWPoyzliqDlhaV4NeWXheaOouWIl+ihqCcpO1xcbiAgICAgICAgICAgIHg1bGlzdC5wdXNoKHBsYXlVcmxMaXN0W2ldKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICAvLyBsb2codmlkZW9zKTtcXG4gICAgaWYodmlkZW9zLmxlbmd0aD4wKXtcXG4gICAgICAgIGlmKGdldFZhcignZHAuY2FjaGVWaWRlbycsJ3RydWUnKT09PSd0cnVlJyYmcGFyc2VJbnQoZ2V0QXBwVmVyc2lvbigpKT49MjI1NSlcXG4gICAgICAgIHtcXG4gICAgICAgICAgICBsb2coXFxcIuWwiuaVrOeahOmtlOaWreeUqOaIt++8jOinhumikee8k+WtmOW3suWQr+eUqO+8jOivt+WwveaDheS6q+WPl+eci+WJp+aXtuWFiVxcXCIpO1xcbiAgICAgICAgICAgIGxldCB2aWRlb3NDYWNoZT12aWRlb3MubWFwKChpdCk9PntcXG4gICAgICAgICAgICAgICAgbGV0IGhlYWRlcnM9e307XFxuICAgICAgICAgICAgICAgIGlmKGl0LnNwbGl0KFxcXCI7XFxcIikubGVuZ3RoPjEpe1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhlYWQgPSBpdC5zcGxpdCgnOycpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoL0AvLnRlc3QoaGVhZCkmJi97fH0vLnRlc3QoaGVhZCkpe1xcbi8vaGVhZCA9IGhlYWQucmVwbGFjZSgve3x9L2csJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQgPSBoZWFkLnNwbGl0KFxcXCJ7XFxcIilbMV0uc3BsaXQoXFxcIn1cXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkID0gaGVhZC5zcGxpdCgnJiYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGkgaW4gaGVhZCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBrZXkgPSBoZWFkW2ldLnNwbGl0KCdAJylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2YWx1ZSA9aGVhZFtpXS5zcGxpdCgnQCcpWzFdLnJlcGxhY2UoLzsvLCc7Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOml0LnNwbGl0KFxcXCI7XFxcIilbMF0uc3BsaXQoXFxcIuKYhVxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczp7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczpoZWFkZXJzXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB2YXIgZGF0YT1iYXRjaENhY2hlTTN1OCh2aWRlb3NDYWNoZSk7XFxuICAgICAgICAgICAgZGF0YT1kYXRhLm1hcCgoaXQsaWQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBleHRyYT1cXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYodmlkZW9zW2lkXS5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCI7XFxcIit2aWRlb3NbaWRdLnNwbGl0KFxcXCI7XFxcIilbMV07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCLimIVcXFwiK3ZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGlmKGl0K1xcXCJcXFwiIT1cXFwibnVsbFxcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0K2V4dHJhXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZpZGVvc1tpZF1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIC8vbG9nKGRhdGEpO1xcbiAgICAgICAgICAgIHJldHVybiBkYXRhXFxuICAgICAgICAgICAgLy9yZXR1cm4gdmlkZW9zXFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gdmlkZW9zXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgbG9nKCflhbHmnIknK3g1bGlzdC5sZW5ndGgrJ+S4qng15Zyw5Z2A6L+b6KGM6L2u5rWB5ZeF5o6iJyk7XFxuICAgIC8v5rKh5pyJ55qE6K+d5bCx5byA5aeL5L6d5qyheDXll4XmjqJcXG4gICAgc2hvd0xvYWRpbmcoJ+WXheaOouS4re+8jOiLpeWksei0peWwseWIh+aNondlYuWXheaOoi4uLicpO1xcbiAgICByZXR1cm4geDVQYXJzZVBybyh4NWxpc3QseDVUaW1lb3V0LGlzVmlkZW8pO1xcbn1cXG52YXIgbGF6eT0kKCcnKS5sYXp5UnVsZSgoKT0+e1xcbiAgICB0cnl7XFxuICAgICAgICByZWFsVXJsPWlucHV0O1xcbiAgICAgICAgZXZhbChcXFwidmFyIGNvbmZpZ19kcCA9XFxcIiArIGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCIpKTtcXG4gICAgICAgIGV2YWwoZmV0Y2goY29uZmlnX2RwLmNqKSk7XFxuICAgICAgICBsb2coaW5wdXQrJy0+5q2j5Zyo5pat5o+S6a2U5pS554mI6Kej5p6QLi4uJyk7XFxuICAgICAgICAvLyDliqDlhaXotoXml7borr7nva7vvIzlu7rorq7lnKjpppbpobXorr7nva5cXG4gICAgICAgIHJldHVybiBheXRtUGFyc2UocmVhbFVybClcXG4gICA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A9IGhvdXNlRmlsZSgpO1xcbiAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdCh0YXNrX2FwaSwge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgIH0sXFxuICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidHlwZVxcXCI6IHRhc2subW9kZXx8J3J1bicsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZnVuY1xcXCI6IHRhc2suZnVuY3x8JycsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjogdGFzay5wYXJhbXN8fFtdXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJhdXRoXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBob3VzZV9kYXRhLnVzZXJuYW1lfHxcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGhvdXNlX2RhdGEucGFzc3dvcmR8fFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgIH0pO1xcbiAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG59XFxuXFxuZnVuY3Rpb24gdGFza191cGxvYWQodGFzayl7IC8vIOmAmueUqOS7u+WKoeWPkeW4g+aWsOWinuWPiuS/ruaUueWKn+iDvVxcbiAgICBjb25zdCB7YXBpLGdldEZpbGV9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5P3J1bGU96YGT6ZW/5LuT5bqTUHJvXFxcIik7XFxuICAgIGxldCBob3VzZUZpbGUgPSBnZXRGaWxlfHxmYWxzZTtcXG4gICAgaWYoIWhvdXNlRmlsZSl7XFxuICAgICAgICBzZXRJdGVtKCdpc19ob3VzZV92aXAnLCAnZmFsc2UnKTtcXG4gICAgfVxcbiAgICBsZXQgYXBpX3VybCA9IGFwaS5ob3N0KycvaGlrZXJ1bGUvdGFzay9hZGQnO1xcbiAgICBsZXQgaG91c2VfZGF0YSA9IGhvdXNlRmlsZSgpO1xcbiAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChhcGlfdXJsLCB7XFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgfSxcXG4gICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICBcXFwiZGF0YVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogdGFzay5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInB5Y29kZVxcXCI6IHRhc2sucHljb2RlLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5vdGVcXFwiOiB0YXNrLm5vdGUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidGVzdF9jb2RlXFxcIjogdGFzay50ZXN0X2NvZGUsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJhdXRoXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBob3VzZV9kYXRhLnVzZXJuYW1lfHxcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGhvdXNlX2RhdGEucGFzc3dvcmR8fFxcXCJcXFwiXFxuICAgICAgIC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AgICAgICB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOmRldkluZm8sXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOidyaWNoX3RleHQnLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIF0pO1xcbiAgICB9KVxcbn0pO1xcbmQucHVzaCh7XFxuICAgIGRlc2M6IFxcXCLlv6vmnaXnvJbovpHkvaDnmoTlhazlkYrlkKd+XFxcIixcXG4gICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcignZGV2SW5mbycsICcnKXx8XFxcIlxcXCIsXFxuICAgICAgICB0eXBlOiBcXFwidGV4dGFyZWFcXFwiLFxcbiAgICAgICAgaGVpZ2h0Oi0xLFxcbiAgICAgICAgb25DaGFuZ2U6ICdwdXRNeVZhcihcXFwiZGV2SW5mb1xcXCIsaW5wdXQpJ1xcbiAgICB9XFxufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6XFxcIuS/neWtmOWFrOWRilxcXCIsXFxuICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgIHVybDokKCfnoa7orqTkv53lrZjlhazlkYrlkJfvvJ/lsIbkvJrkuI7pgZPplb/ku5PlupPmnI3liqHlmajpgJrorq8nKS5jb25maXJtKCgpPT57XFxuICAgICAgICBsZXQgZGV2X3NldF9pbmZvID0gZ2V0TXlWYXIoXFxcImRldl9zZXRfaW5mb1xcXCIpLnNwbGl0KCckJCcpO1xcbiAgICAgICAgbGV0IGlucHV0X3RleHQgPSBnZXRNeVZhcignZGV2SW5mbycsICcnKTtcXG4gICAgICAgIGlmKGlucHV0X3RleHQubGVuZ3RoID49IDQpe1xcbiAgICAgICAgICAgIGxldCBpbmZvX3NldF91cmw9IGRldl9zZXRfaW5mb1syXTtcXG4gICAgICAgICAgICBsZXQgc2VuZF9kYXRhID0ge1xcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAge1xcXCJkYXRhXFxcIjoge1xcXCJpbmZvXFxcIjogaW5wdXRfdGV4dH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBkZXZfc2V0X2luZm9bMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZGV2X3NldF9pbmZvWzFdfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgLy8gbG9nKHNlbmRfZGF0YSk7XFxuICAgICAgICAgICAgbGV0IHBhcjIgPSB7aGVhZGVyczp7J2NvbnRlbnQtdHlwZSc6J2FwcGxpY2F0aW9uL2pzb247Y2hhcnNldD1VVEYtOCcsJ1VzZXItQWdlbnQnOmRldl9zZXRfaW5mb1szXX0sYm9keTpKU09OLnN0cmluZ2lmeShzZW5kX2RhdGEpLG1ldGhvZDonUE9TVCd9O1xcbiAgICAgICAgICAgIC8vIHBhcjIgPSBKU09OLnN0cmluZ2lmeShwYXIyKTsgLy94NemHjOmdouivt+axguaJjemcgOimgee8lueggVxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX3JldCA9IHJlcXVlc3QoaW5mb19zZXRfdXJsLCBwYXIyKTtcXG4gICAgICAgICAgICAgICAgYmFja19yZXQgPSBKU09OLnBhcnNlKGJhY2tfcmV0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmKGJhY2tfcmV0LnN0YXR1cz09PTApe1xcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjmiJDlip9cXFxcbicrYmFja19yZXQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZ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lofku7bpgInmi6nlmahcXG4gICAgICAgICAgICBkdDogXFxcImR0LmpzXFxcIiwgLy/liqjmgIHliIbnsbtcXG4gICAgICAgICAgICBkcjogXFxcImRyLmpzXFxcIiwgLy9kcuaooeadv+S+nei1llxcbiAgICAgICAgICAgIGRycHJlOiBcXFwiZHJwcmUuanNcXFwiLCAvL2Ry5qih5p2/6aKE5aSE55CGXFxuICAgICAgICAgICAgZHJ1cDogXFxcImRydXAuanNcXFwiLCAvL2Ry5qih5p2/6Ieq5Yqo5pu05pawXFxuICAgICAgICAgICAgZHJtYXRjaDogXFxcImRybWF0Y2guanNcXFwiLCAvL2Ry5qih5p2/6Ieq5Yqo5qih5p2/5Yy56YWNXFxuICAgICAgICAgICAgZHJtOiBcXFwiZHJtLmpzXFxcIiwgLy9kcuaooeadv+Wwj+eoi+W6j1xcbiAgICAgICAgICAgIGNtczogXFxcImNtcy5qc1xcXCIsIC8vY21z5qih5p2/5L6d6LWWXFxuICAgICAgICAgICAgY21zcHJlOiBcXFwiY21zcHJlLmpzXFxcIiwgLy9jbXPpooTlpITnkIZcXG4gICAgICAgICAgICBjbXNtOiBcXFwiY21zbS5qc1xcXCIsIC8vY21z5qih5p2/5bCP56iL5bqPXFxuICAgICAgICAgICAgbGliY2hlY2s6IFxcXCJsaWJjaGVjay5qc1xcXCIsIC8vZHLmo4DmtYvkvp3otZZcXG4gICAgICAgICAgICBydWxlRWRpdG9yOiBcXFwicnVsZUVkaXRvci5qc1xcXCIsIC8v5YaZ6aG15rqQ56We5Zmo5bCP56iL5bqPXFxuICAgICAgICAgICAgaG91c2VMYXp5OiBcXFwiaG91c2VMYXp5LmpzXFxcIiwgLy/ku5PlupPpgJrlhY1cXG4gICAgICAgICAgICBsYXp5OiBcXFwibGF6eS5qc1xcXCIsIC8v6aaZ5YWNXFxuICAgICAgICAgICAgc3ViOiBcXFwic3ViLmpzXFxcIiwgLy/pgZPlvrfnu4/orqLpmIVcXG4gICAgICAgICAgICBoaWtlclVpOiBc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4gICAgICAgIGNvbF90eXBlOiBcXFwieDVfd2Vidmlld19zaW5nbGVcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiYWJvdXQ6YmxhbmtcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIjUwJiZsaXN0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGgsIHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IGRvY3VtZW50LmRvY3VtZW50RWxlbWVudDtcXG4gICAgICAgICAgICAgICAgaHRtbC5pbm5lckhUTUwgPSBoO1xcblxcbiAgICAgICAgICAgICAgICBjb25zdCB0ZXh0Q29udGFpbmVyID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3RleHRDb250YWluZXInKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgdGV4dCA9IHRleHRDb250YWluZXIuaW5uZXJIVE1MO1xcbiAgICAgICAgICAgICAgICB0ZXh0Q29udGFpbmVyLm9uY2xpY2s9ZnVuY3Rpb24oKXtcXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5sb2NhdGlvbi5ocmVmID0gdXJsfHxcXFwiYWJvdXQ6Ymxhbmsvbm90aWNlXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLyDorr7nva7mlofmnKzlrrnlmajlrr3luqbkuLrmlofmnKzlhoXlrrnnmoTlrr3luqZcXG4gICAgICAgICAgICAgICAgdGV4dENvbnRhaW5lci5zdHlsZS53aWR0aCA9IGAke3RleHRDb250YWluZXIub2Zmc2V0V2lkdGh9cHhgO1xcblxcbiAgICAgICAgICAgICAgICAvLyDlpI3liLbmlofmnKzlhoXlrrnlubbov73liqDliLDmlofmnKzlrrnlmajlkI7pnaJcXG4gICAgICAgICAgICAgICAgdGV4dENvbnRhaW5lci5pbm5lckhUTUwgKz0gJyAnICsgdGV4dDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5Yqo5oCB6K6h566X5Yqo55S75oyB57ut5pe26Ze0XFxuICAgICAgICAgICAgICAgIGNvbnN0IGR1cmF0aW9uID0gKHRleHRDb250YWluZXIub2Zmc2V0V2lkdGggLyB0ZXh0Q29udGFpbmVyLnBhcmVudEVsZW1lbnQub2Zmc2V0V2lkdGgpICogMTA7XFxuXFxuICAgICAgICAgICAgICAgIHZhciBzdHlsZUVsZW1lbnRzID0gZG9jdW1lbnQuaGVhZC5nZXRFbGVtZW50c0J5VGFnTmFtZSgnc3R5bGUnKTtcXG5cXG5cXG4gICAgICAgICAgICAgICAgc3R5bGVFbGVtZW50c1syXS5pbm5lckhUTUwgPSBgLm1hcnF1ZWUgc3BhbiB7XFxuICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XFxuICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDEwMCU7XFxuICAgICAgICAgICAgICAgICAgICBhbmltYXRpb246IG1hcnF1ZWUgJHtkdXJhdGlvbn1zIGxpbmVhciBpbmZpbml0ZVxcbiAgICAgICAgICAgICAgICB9YDtcXG5cXG4gICAgICAgICAgICB9LCBodG1sLCB1cmwpLFxcbiAgICAgICAgICAgIHVybEludGVyY2VwdG9yOiAkLnRvU3RyaW5nKChjb250ZW50KSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dD09PVxcXCJhYm91dDpibGFuay9ub3RpY2VcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygoY29udGVudCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlhazlkYpcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmRSdWxlOiBcXFwianM6XFxcIiArICQkJC50b1N0cmluZygoY29udGVudCkgPT4gc2V0UmVzdWx0KFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfV0pLGNvbnRlbnQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgY29udGVudCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBjb250ZW50IHx8IHRleHQpLFxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59XCJ9XSIsImljb24iOiJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vb3RoZXIvMzAuc3ZnIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment