Advertisement
xiaomianao666

邀您一起看:搜索淫妻

Feb 26th, 2023
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥搜索淫妻@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwi5rqQ55uu5b2VXCIsXCJwYXRoXCI6XCJzb3VyY2VcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxudmFyIG0gPSBNWV9QQVJBTVMucnVsZXNcXG52YXIgYmFzZXVybCA9IG0uYm9va1NvdXJjZVVybFxcbmlmIChtLnJ1bGVFeHBsb3JlLmJvb2tMaXN0KSB7XFxuICAgIHZhciBydWxlID0gbS5ydWxlRXhwbG9yZVxcbn0gZWxzZSB7XFxuICAgIHZhciBydWxlID0gbS5ydWxlU2VhcmNoXFxufVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi5pCc57SiXFxcIixcXG4gICAgZGVzYzogXFxcIuivt+i+k+WFpeaQnOe0ouWFs+mUruivjVxcXCIsXFxuICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICBwdXRNeVZhcihcXFwia3dcXFwiLCBpbnB1dCk7XFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9zZWFyY2g/cD1meXBhZ2Uma3c9XFxcIiArIGlucHV0XFxuICAgIH0pLFxcbiAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIFxcXCJ1XFxcIjogYmFzZXVybCArIG0uc2VhcmNoVXJsLFxcbiAgICAgICAgXFxcInJ1bGVzXFxcIjogbSxcXG4gICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcImt3XFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgYm9va1NvdXJjZU5hbWU6IG0uYm9va1NvdXJjZU5hbWVcXG4gICAgfVxcbn0pO1xcbnRyeSB7XFxuICAgIGlmIChtLmVuYWJsZWRFeHBsb3JlICYmIG0uZXhwbG9yZVVybCkge1xcbiAgICAgICAgSlNPTi5wYXJzZShtLmV4cGxvcmVVcmwpLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udGl0bGUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdGVtLnN0eWxlLmxheW91dF9mbGV4QmFzaXNQZXJjZW50ID09IDEgPyBcXFwidGV4dF9jZW50ZXJfMVxcXCIgOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBpdGVtLnVybCA9PSBcXFwiXFxcIiA/IFxcXCJoaWtlcjovL2VtcHR5XFxcIiA6IFxcXCJoaWtlcjovL3BhZ2UvYm9va3M/cD1meXBhZ2VcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImFsbFxcXCI6IG0sXFxuICAgICAgICAgICAgICAgICAgICBcXFwicnVsZXNcXFwiOiBydWxlLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInVcXFwiOiBiYXNldXJsICsgaXRlbS51cmxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgI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cXCIpLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogcGRmaDEoaXRlbSwgbmFtZSksXFxuICAgICAgICAgICAgICAgIGltZzogKGNvdmVyID8gcGQxKGl0ZW0sIGNvdmVyKSArIFxcXCJAUmVmZXJlcj1cXFwiIDogXFxcImhpa2VyOi8vZW1wdHlcXFwiKSxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL21lbnVcXFwiLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAoYXV0aG9yID8gcGRmaDEoaXRlbSwgYXV0aG9yKSA6IFxcXCJcXFwiKSArIFxcXCJcXFxcblxcXCIgKyAoaW50cm8gPyBwZGZoMShpdGVtLCBpbnRybykgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiYm9va05hbWVcXFwiOiBwZGZoMShpdGVtLCBuYW1lKSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjb3ZlclxcXCI6IChjb3ZlciA/IHBkMShpdGVtLCBjb3ZlcikgKyBcXFwiQFJlZmVyZXI9XFxcIiA6IFxcXCJoaWtlcjovL2VtcHR5XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBcXFwiVG9jXFxcIjogTVlfUEFSQU1TLmFsbC5ydWxlVG9jLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNvbnRlbnRcXFwiOiBNWV9QQVJBTVMuYWxsLnJ1bGVDb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBuZXh0dG9jID8gXFxcImhpa2VyOi8vZW1wdHkjXFxcIiArIHUxIDogdTEsXFxuICAgICAgICAgICAgICAgICAgICB1MTogbmV4dHRvYyA/IHUxIDogbnVsbCxcXG4gICAgICAgICAgICAgICAgICAgIGNoYXJzZXQ6IG0uY2hhcnNldCxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWIl+ihqOWKoOi9veWksei0pe+8mlxcXCIgKyBsaXN0cnVsZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9KVxcbiAgICB9XFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLliqDovb3lpLHotKXvvJpcXFwiICsgZS5tZXNzYWdlLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgIH0pXFxufVxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcInRleHRfY2VudGVyXzFcIixcIm5hbWVcIjpcIuiuvue9rlwiLFwicGF0aFwiOlwiY29uZmlnXCIsXCJydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbnRyeSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIua3u+WKoOiuoumYhVxcXCIsXFxuICAgICAgICB1cmw6ICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXorqLpmIXlkI3np7DvvIzlj5bkuKrlkI3lkKfvvIjms6jmhI/kuI3opoHloavlnLDlnYDvvIlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0ID09IG51bGwgfHwgaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeWhq+aAjuS5iOiDveihjOWRolxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCI6Ly9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LiN6IO95aGr5Zyw5Z2A5ZOm77yM5YK75a6d6LSdXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeiuoumYheWcsOWdgFxcXCIpLmlucHV0KChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICBhZGQsXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVcXG4gICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2RhdGF0XFxcIik7XFxuICAgICAgICAgICAgICAgIGFkZChuYW1lLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGUobmFtZSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXlpLHotKVcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIua3u+WKoOacrOWcsFxcXCIsXFxuICAgICAgICB1cmw6ICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXorqLpmIXlkI3np7Dv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tZTtcXG4gICAgICAgICAgICAgICAgbGV0IGMgPSBmZXRjaChcXFwiZmlsZTovL1xcXCIgKyBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIGlmICghYy5pbmNsdWRlcyhcXFwiYm9va1NvdXJjZVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5qC85byP5LiN5a+577yM5LuF5pSv5oyB5Lmm5rqQ5paH5Lu2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZSh1cmwsIGMpO1xcbiAgICAgICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICAgICAgYWRkLFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kYXRhdFxcXCIpO1xcbiAgICAgICAgICAgICAgICBhZGQobmFtZSwgdXJsKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZShuYW1lLCB1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXlpLHotKVcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbnB1dCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICB9KVxcbiAgICBsZXQgbGlzdCA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2RhdGF0XFxcIikubG9hZCgpO1xcbiAgICBsaXN0LmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICBkZXNjOiBpdGVtLnVybCxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLliKDpmaTorqLpmIVcXFwiLCBcXFwi57yW6L6R5ZCN56ewXFxcIiwgXFxcIuWIhuS6q+iuoumYhVxcXCIsIFxcXCLmm7TmlrDmlbDmja5cXFwiXSkuc2VsZWN0KChuYW1lLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliKDpmaTorqLpmIVcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu6K6k5Yig6Zmk77yfXFxcIikuY29uZmlybSgobmFtZSwgdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5zdGFydHNXaXRoKFxcXCJoaWtlcjovL2ZpbGVzL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUodXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9cXFwiICsgbWQ1KG5hbWUpICsgXFxcIi5qc29uXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kYXRhdFxcXCIpLnJlbW92ZSh1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWIoOmZpFxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi57yW6L6R5ZCN56ewXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIpLmlucHV0KChuYW1lLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXCIgKyBtZDUobmFtZSkgKyBcXFwiLmpzb25cXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2RhdGF0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlKGlucHV0LCB1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlbmFtZSh1cmwsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi5YiG5Lqr6K6i6ZiFXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5zdGFydHNXaXRoKFxcXCJoaWtlcjovL2ZpbGVzL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W9k+WJjeiuoumYheS4uuacrOWcsOaWh+S7tu+8jOaXoOazleWIhuS6q1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgobmFtZSwgdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hhcmVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YXRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2hhcmUobmFtZSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbmFtZSwgdXJsKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YXRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGUobmFtZSwgdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pu05paw5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mm7TmlrDlpLHotKVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpdGVtLm5hbWUsIGl0ZW0udXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCJcXG4gICAgICAgIH0pXFxuICAgIH0pXFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLplJnor6/vvJpcXFwiICsgZS5tZXNzYWdl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GV0IGkgPSAwOyBpIDwgYy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGlmIChjW2ldLnVybCA9PSBjaGUudXJsKSB7XFxuICAgICAgICAgICAgICAgIGNbaV0gPSBjaGU7XFxuICAgICAgICAgICAgICAgIGxvZyhcXFwiY2xlYXI6XFxcIiArIHVybClcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcImNoYXB0ZXIuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGMpKVxcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSwgdXJsKSlcXG4gICAgZm9yIChsZXQgaXQgb2YgY2FjaGVzKSB7XFxuICAgICAgICBpZiAoaXQudXJsID09IHVybCkge1xcbiAgICAgICAgICAgIHJldHVybiBpdDtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICByZXR1cm4ge1xcbiAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICBuZXh0OiBcXFwiXFxcIixcXG4gICAgICAgIGNoYXB0ZXJzOiBbXVxcbiAgICB9XFxufVxcblxcbmZ1bmN0aW9uIHNhdmVDYWNoZShjaGUpIHtcXG4gICAgbGV0IGMgPSBjYWNoZXNcXG4gICAgaWYgKGMubGVuZ3RoID4gMTApIHtcXG4gICAgICAgIGMuc2hpZnQoKVxcbiAgICB9XFxuICAgIGxldCBleGlzdCA9IGZhbHNlXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgaWYgKGNbaV0udXJsID09IGNoZS51cmwpIHtcXG4gICAgICAgICAgICBjW2ldID0gY2hlO1xcbiAgICAgICAgICAgIGV4aXN0ID0gdHJ1ZTtcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGlmICghZXhpc3QpIHtcXG4gICAgICAgIGMucHVzaChjaGUpXFxuICAgIH1cXG4gICAgc2F2ZUZpbGUo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lYXI6IFxcXCIgKyBhaWQpO1xcbiAgICAgICAgY2xlYXJNeVZhcihhaWQpO1xcbiAgICB9LCBhaWQpKTtcXG4gICAgbGV0IGFyciA9IGNhY2hlLmNoYXB0ZXJzIHx8IFtdO1xcbiAgICB2YXIgY2MgPSAoYSkgPT4ge1xcbiAgICAgICAgcmV0dXJuIGEubWFwKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIHZhciB0aXRsZSA9IGdldFRleHQoaXRlbSwgVG9jLmNoYXB0ZXJOYW1lKVxcbiAgICAgICAgICAgIGlmICh0aXRsZSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBsZXQgdTEgPSBnZXRVcmwwKGl0ZW0sIFRvYy5jaGFwdGVyTGlzdCwgVG9jLmNoYXB0ZXJVcmwpICsgXFxcIiNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXCI7XFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQVJBTVMuY2hhcnNldCkge1xcbiAgICAgICAgICAgICAgICAgICAgdTEgPSB1MSArIFxcXCI7Z2V0O1xcXCIgKyBNWV9QQVJBTVMuY2hhcnNldDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2NvbnRlbnRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogTVlfUEFSQU1TLmNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1MVxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIlxcbiAgICAgICAgICA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ICB2YXIgdXJscyA9IFtudXJsXTtcXG4gICAgd2hpbGUgKHRydWUpIHtcXG4gICAgICAgIGxldCBhID0gW107XFxuICAgICAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXG4gICAgICAgICAgICBhLnB1c2goaXQpO1xcbiAgICAgICAgfVxcbiAgICAgICAgY2FjaGUuY2hhcHRlcnMgPSBhO1xcbiAgICAgICAgbGV0IGFycjEgPSBnZXRBcnJheShyZXMsIFRvYy5jaGFwdGVyTGlzdCk7XFxuICAgICAgICAvL2xvZyhhcnIxKTtcXG4gICAgICAgIGlmIChhcnIxICYmIGFycjEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGFycjEpIHtcXG4gICAgICAgICAgICAgICAgYXJyLnB1c2goaXQpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgYWRkSXRlbUJlZm9yZShpZCwgY2MoYXJyMSkpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoYWlkLCBcXFwiMFxcXCIpICE9IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICBsb2coXFxcImJyZWFrOiBcXFwiICsgYWlkKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGphdmEubGFuZy5UaHJlYWQuc2xlZXAoNTApO1xcbiAgICAgICAgICAgIGxldCBudXJsMiA9IHBkKHJlcywgXFxcImJvZHkmJlxcXCIgKyBuZXh0KTtcXG4gICAgICAgICAgICBpZiAobnVybDIgJiYgbnVybDIgIT0gXFxcIlxcXCIgJiYgIXVybHMuaW5jbHVkZXMobnVybDIpKSB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnNbXFxcIlJlZmVyZXJcXFwiXSA9IGNhY2hlLm5leHQuc3BsaXQoXFxcIiNcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgdXJscy5wdXNoKG51c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UEFSQU1TLmNoYXJzZXQ7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2NvbnRlbnRcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogTVlfUEFSQU1TLmNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHUxXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgdmFyIGNwID0gZC5tYXAoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBpdGVtLnRpdGxlLFxcbiAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBpdGVtLmV4dHJhLnVybC5yZXBsYWNlKFxcXCIjYXV0b1BhZ2UjI3JlYWRUaGVtZSNcXFwiLCBcXFwiXFxcIilcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGlmIChsaXN0Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgIGQudW5zaGlmdCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLkuIvovb1cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9kb3dubG9hZC52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9SZWZyZXNoIyNub0hpc3RvcnkjP3J1bGU95pys5Zyw6LWE5rqQ566h55CGXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJMaXN0OiBjcCxcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZpZXc6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgaW5mbzoge1xcbiAgICAgICAgICAgICAgICAgICAgYm9va05hbWU6IE1ZX1BBUkFNUy5ib29rTmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGJvb2tUb3BQaWM6IE1ZX1BBUkFNUy5jb3ZlcixcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVOYW1lOiBcXFwi5oKm6K+7XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlQ29kZTogJC50b1N0cmluZygoTVlfUEFSQU1TLCByMCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnZlcnRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvY29udmVydGVyP3J1bGU9XFxcIiArIHIwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJ1bGUgPSBNWV9QQVJBTVMuY29udGVudDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgciA9IGNvbnZlcnQocnVsZS5jb250ZW50KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcjEgPSByLnNwbGl0KFxcXCImJlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByMiA9IHIxLnNsaWNlKDAsIHIxLmxlbmd0aCAtIDEpLmpvaW4oXFxcIiYmXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IHBkZmEocmVzLCBcXFwiYm9keSYmXFxcIiArIHIyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0dCA9IFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgYXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ID0gaXQucmVwbGFjZShuZXcgUmVnRXhwKFxcXCJcXFxcblxcXCIsIFxcXCJnXFxcIiksIFxcXCItLWJyLS1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coaXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IHBkZmgoaXQsIFxcXCJUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSB0LnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiLS1ici0tXFxcIiwgXFxcImdcXFwiKSwgXFxcIjxicj5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHQyID0gdC5zcGxpdChcXFwiPGJyPlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdDIgb2YgdDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDIgPT0gXFxcIlxcXCIgfHwgaXQyLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXQyLnN0YXJ0c1dpdGgoXFxcIuOAgFxcXCIpICYmICFpdDIuc3RhcnRzV2l0aChcXFwiJm5ic3A7Jm5ic3A7XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdDIgPSBcXFwiJm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7XFxcIiArIGl0Mi50cmltKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVsZS5yZXBsYWNlUmVnZXgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdDIgPSBpdDIucmVwbGFjZShuZXcgUmVnRXhwKHJ1bGUucmVwbGFjZVJlZ2V4LnJlcGxhY2UoXFxcIiMjXFxcIiwgXFxcIlxcXCIpLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDIgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHQgKz0gaXQyICsgXFxcIlxcXFxuXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0dFxcbiAgICAgICAgICAgICAgICAgICAgfSwgTVlfUEFSQU1TLCBNWV9SVUxFLnRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IFxcXCJub3ZlbFxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgZC51bnNoaWZ0KHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuacquino+aekOWIsOebruW9leWIl+ihqFxcXCIsXFxuICAgIC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XCIpWzBdLnNwbGl0KFxcXCJ8fFxcXCIpO1xcbiAgICBsZXQgYyA9IGNvbnZlcnQocjFbMF0pO1xcbiAgICBpZiAoYy5pbmNsdWRlcyhcXFwiJiZsaSYmYVxcXCIpICYmIGNbYy5sZW5ndGggLSAxXSA9PSBcXFwiYVxcXCIpIHtcXG4gICAgICAgIGMgPSBjLnJlcGxhY2UoXFxcIiYmbGkmJmFcXFwiLCBcXFwiJiZsaVxcXCIpO1xcbiAgICB9XFxuICAgIGxvZyhjKTtcXG4gICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJlxcXCIgKyBjKTtcXG4gICAgaWYgKHIxLmxlbmd0aCA+IDEpIHtcXG4gICAgICAgIGxldCByMiA9IHIxWzFdLnNwbGl0KFxcXCI6XFxcIik7XFxuICAgICAgICBsZXQgcjMgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGl0IG9mIHIyKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IGkgPSBwYXJzZUludChpdCk7XFxuICAgICAgICAgICAgICAgIGlmIChpc05hTihpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcjMucHVzaChpKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGFycjIgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgaWYgKHIzLmluZGV4T2YoaSkgPCAwKSB7XFxuICAgICAgICAgICAgICAgIGFycjIucHVzaChhcnJbaV0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBhcnIyO1xcbiAgICB9XFxuICAgIGxvZyhcXFwi6I635Y+W5aSx6LSl77yM5aSx6LSl5a6a5L2N77y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ge1xcbiAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihydWxlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBzZWFyY2gocnVsZSwgcywgMSk7XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwYXJhbTogaXQsXFxuICAgICAgICAgICAgaWQ6IFxcXCJydWxlQFxcXCIgKyBpdC5uYW1lXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICBiYXRjaEV4ZWN1dGUodGFza3MsIHtcXG4gICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcbiAgICAgICAgICAgIC8vbG9nKFxcXCJsaXN0ZW5lcjogXFxcIiArIChyZXN1bHQgfHwgW10pLmxlbmd0aClcXG4gICAgICAgICAgICBwYXJhbS5pID0gcGFyYW0uaSArIDE7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgcmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0uaiA9IHBhcmFtLmogKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaE11c3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWFyY2hDb250YWlucyhpdC50aXRsZSwgcykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGl0LmV4dHJhIHx8IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmlkID0gXFxcIl9fYXBwXFxcIiArIE1ZX1BBR0UgKyBcXFwiQFxcXCIgKyBwYXJhbS5qO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmJvb2tOYW1lID0gaXQudGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYS5jb3ZlciA9IGl0LnBpY191cmwgfHwgaXQuaW1nXFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnRpdGxlLmluY2x1ZGVzKFxcXCLigJzigJzigJ3igJ1cXFwiKSA/IGl0LnRpdGxlIDogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBpdC50aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAoXFxcIjxlbT58PC9lbT5cXFwiLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIikucmVwbGFjZShuZXcgUmVnRXhwKHMsIFxcXCJnXFxcIiksIFxcXCI8c3Ryb25nPjxzcGFuIHN0eWxlPVxcXFxcXFwiY29sb3I6ICMxRTkwRkZcXFxcXFxcIj5cXFwiICsgcyArIFxcXCI8L3NwYW4+PC9zdHJvbmc+XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0LmRlc2MsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQudXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsIHx8IGl0LmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LnBpY191cmwgfHwgaXQuaW1nID8gJ21vdmllXzFfdmVydGljYWxfcGljJyA6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAocGFyYW0uaSA+PSBwYXJhbS5hbGwpIHtcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYWdlaWQpXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWKoOi9veesrFxcXCIgKyBNWV9QQUdFICsgXFxcIumhteS4re+8jOi/m+W6pu+8mlxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcIi9cXFwiICsgcGFyYW0uYWxsLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sXFxuICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgIGFsbDogZGF0YS5sZW5ndGgsXFxuICAgICAgICAgICAgaTogMCxcXG4gICAgICAgICAgICBqOiAtMVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmkJzntKLovoXliqlcIixcInBhdGhcIjpcInNzXCIsXCJydWxlXCI6XCJ2YXIge1xcbiAgICBjb252ZXJ0LFxcbiAgICBwYXJzZVVybCxcXG4gICAgZ2V0Q2hhcnNldFxcbn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dHJpbmcodXJsMS5pbmRleE9mKFxcXCIse1xcXCIpICsgMiwgdXJsMS5sZW5ndGgpO1xcbiAgICAgICAgICAgIC8vbG9nKGV4dCk7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZXh0ID0gSlNPTi5wYXJzZShleHQpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgZXZhbChcXFwiZXh0PVxcXCIgKyBleHQpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZXh0Lm1ldGhvZCAmJiBleHQubWV0aG9kICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIG1ldGhvZCA9IGV4dC5tZXRob2Q7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChleHQuYm9keSAmJiBleHQuYm9keSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBib2R5ID0gZXh0LmJvZHk7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnNbXFxcIkNvbnRlbnQtVHlwZVxcXCJdID0gXFxcImFwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZFxcXCIgKyAoaGVhZGVycy5jaGFyc2V0ID8gXFxcIjtjaGFyc2V0PVxcXCIgKyBoZWFkZXJzLmNoYXJzZXQgOiBcXFwiXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICBpZiAodXJsMS5pbmNsdWRlcygnXFxcIlBPU1RcXFwiJykgfHwgdXJsMS5pbmNsdWRlcygnXFxcInBvc3RcXFwiJykpIHtcXG4gICAgICAgICAgICBtZXRob2QgPSBcXFwicG9zdFxcXCI7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgaWYgKG1ldGhvZCA9PSBcXFwicG9zdFxcXCIgfHwgbWV0aG9kID09IFxcXCJQT1NUXFxcIikge1xcbiAgICAgICAg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VsbCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcnVsZXMuZmlsdGVyKGkgPT4gaS5uYW1lID09IHJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgc3RhcnQgPSAocGFnZSAtIDEpICogc2l6ZTtcXG4gICAgICAgICAgICBpZiAocnVsZXMubGVuZ3RoIDwgc3RhcnQgKyAxKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGxlbiA9IHNpemU7XFxuICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA8IHBhZ2UgKiBzaXplKSB7XFxuICAgICAgICAgICAgICAgIGxlbiA9IHJ1bGVzLmxlbmd0aCAtIHN0YXJ0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBhbGwgPSBydWxlcy5sZW5ndGg7XFxuICAgICAgICAgICAgbGV0IHVzZSA9IChwYWdlIC0gMSkgKiBzaXplICsgbGVuO1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIGFsbDogYWxsLFxcbiAgICAgICAgICAgICAgICB1c2U6IHVzZSxcXG4gICAgICAgICAgICAgICAgZGF0YTogcnVsZXMuc2xpY2Uoc3RhcnQsIHN0YXJ0ICsgbGVuKVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgYWxsOiAwLFxcbiAgICAgICAgICAgICAgICB1c2U6IDAsXFxuICAgICAgICAgICAgICAgIGRhdGE6IFtdXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5pWw5o2uXCIsXCJwYXRoXCI6XCJkYXRhdFwiLFwicnVsZVwiOlwibGV0IGxvYWQgPSBmdW5jdGl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ICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5qID0gcGFyYW0uaiArIDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hdGNoTXVzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNlYXJjaENvbnRhaW5zKGl0LnRpdGxlLCBzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhID0gaXQuZXh0cmEgfHwge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuaWQgPSBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmo7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuYm9va05hbWUgPSBpdC50aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmNvdmVyID0gaXQucGljX3VybCB8fCBpdC5pbWdcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUuaW5jbHVkZXMoXFxcIuKAnOKAnOKAneKAnVxcXCIpID8gaXQudGl0bGUgOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIGl0LnRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiPGVtPnw8L2VtPlxcXCIsIFxcXCJnXFxcIiksIFxcXCJcXFwiKS5yZXBsYWNlKG5ldyBSZWdFeHAocywgXFxcImdcXFwiKSwgXFxcIjxzdHJvbmc+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjogIzFFOTBGRlxcXFxcXFwiPlxcXCIgKyBzICsgXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwgfHwgaXQuaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCB8fCBpdC5pbWcgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWMnIDogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxcXG4gICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICBpOiAwLFxcbiAgICAgICAgICAgIGo6IC0xXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn1cIixcImdyb3VwXCI6XCLpmIXor7tcIixcInVhXCI6XCJtb2JpbGVcIixcInByZVJ1bGVcIjpcIlwiLFwicGFnZXNcIjpcIlt7XFxcImNvbF90eXBlXFxcIjpcXFwidGV4dF8xXFxcIixcXFwibmFtZVxcXCI6XFxcIua6kOebruW9lVxcXCIsXFxcInBhdGhcXFwiOlxcXCJzb3VyY2VcXFwiLFxcXCJydWxlXFxcIjpcXFwianM6XFxcXG52YXIgZCA9IFtdO1xcXFxudmFyIG0gPSBNWV9QQVJBTVMucnVsZXNcXFxcbnZhciBiYXNldXJsID0gbS5ib29rU291cmNlVXJsXFxcXG5pZiAobS5ydWxlRXhwbG9yZS5ib29rTGlzdCkge1xcXFxuICAgIHZhciBydWxlID0gbS5ydWxlRXhwbG9yZVxcXFxufSBlbHNlIHtcXFxcbiAgICB2YXIgcnVsZSA9IG0ucnVsZVNlYXJjaFxcXFxufVxcXFxuZC5wdXNoKHtcXFxcbiAgICB0aXRsZTogXFxcXFxcXCLmkJzntKJcXFxcXFxcIixcXFxcbiAgICBkZXNjOiBcXFxcXFxcIuivt+i+k+WFpeaQnOe0ouWFs+mUruivjVxcXFxcXFwiLFxcXFxuICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgIHB1dE15VmFyKFxcXFxcXFwia3dcXFxcXFxcIiwgaW5wdXQpO1xcXFxuICAgICAgICByZXR1cm4gXF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uIFxcXFxcXFwidG9hc3Q6Ly/moLzlvI/kuI3lr7nvvIzku4XmlK/mjIHkuabmupDmlofku7ZcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUodXJsLCBjKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQge1xcXFxuICAgICAgICAgICAgICAgICAgICBhZGQsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZVxcXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvZGF0YXRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgYWRkKG5hbWUsIHVybCk7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlKG5hbWUsIHVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9LCBpbnB1dCk7XFxcXG4gICAgICAgIH0pLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzJcXFxcXFxcIlxcXFxuICAgIH0pXFxcXG4gICAgbGV0IGxpc3QgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvZGF0YXRcXFxcXFxcIikubG9hZCgpO1xcXFxuICAgIGxpc3QuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgIGRlc2M6IGl0ZW0udXJsLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFxcXFxcIuWIoOmZpOiuoumYhVxcXFxcXFwiLCBcXFxcXFxcIue8lui+keWQjeensFxcXFxcXFwiLCBcXFxcXFxcIuWIhuS6q+iuoumYhVxcXFxcXFwiLCBcXFxcXFxcIuabtOaWsOaVsOaNrlxcXFxcXFwiXSkuc2VsZWN0KChuYW1lLCB1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCLliKDpmaTorqLpmIVcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruiupOWIoOmZpO+8n1xcXFxcXFwiKS5jb25maXJtKChuYW1lLCB1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuc3RhcnRzV2l0aChcXFxcXFxcImhpa2VyOi8vZmlsZXMvXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZSh1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShcXFxcXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvXFxcXFxcXCIgKyBtZDUobmFtZSkgKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvZGF0YXRcXFxcXFxcIikucmVtb3ZlKHVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lt7LliKDpmaRcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBuYW1lLCB1cmwpXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFxcXFxcIue8lui+keWQjeensFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwiXFxcXFxcXCIpLmlucHV0KChuYW1lLCB1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXFxcXFwiICsgbWQ1KG5hbWUpICsgXFxcXFxcXCIuanNvblxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2RhdGF0XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlKGlucHV0LCB1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVuYW1lKHVybCwgaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBuYW1lLCB1cmwpXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFxcXFxcIuWIhuS6q+iuoumYhVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICh1cmwuc3RhcnRzV2l0aChcXFxcXFxcImhpa2VyOi8vZmlsZXMvXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W9k+WJjeiuoumYheS4uuacrOWcsOaWh+S7tu+8jOaXoOazleWIhuS6q1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKG5hbWUsIHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFyZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9kYXRhdFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzaGFyZShuYW1lLCB1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvZGF0YXRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGUobmFtZSwgdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5pu05paw5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcm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hY2hlLmNoYXB0ZXJzIHx8IFtdO1xcXFxuICAgIHZhciBjYyA9IChhKSA9PiB7XFxcXG4gICAgICAgIHJldHVybiBhLm1hcChpdGVtID0+IHtcXFxcbiAgICAgICAgICAgIHZhciB0aXRsZSA9IGdldFRleHQoaXRlbSwgVG9jLmNoYXB0ZXJOYW1lKVxcXFxuICAgICAgICAgICAgaWYgKHRpdGxlICE9IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdTEgPSBnZXRVcmwwKGl0ZW0sIFRvYy5jaGFwdGVyTGlzdCwgVG9jLmNoYXB0ZXJVcmwpICsgXFxcXFxcXCIjYXV0b1BhZ2UjI3JlYWRUaGVtZSNcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFSQU1TLmNoYXJzZXQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdTEgPSB1MSArIFxcXFxcXFwiO2dldDtcXFxcXFxcIiArIE1ZX1BBUkFNUy5jaGFyc2V0O1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvY29udGVudFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogTVlfUEFSQU1TLmNvbnRlbnQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUxXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfTtcX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0gZWxzZSBpZiAoTVlfUEFSQU1TLnUxKSB7XFxcXG4gICAgICAgIHJlcyA9IGZldGNoKE1ZX1VSTCwge1xcXFxuICAgICAgICAgICAgaGVhZGVyczogaGVhZGVyc1xcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG4gICAgdmFyIHVybHMgPSBbbnVybF07XFxcXG4gICAgd2hpbGUgKHRydWUpIHtcXFxcbiAgICAgICAgbGV0IGEgPSBbXTtcXFxcbiAgICAgICAgZm9yIChsZXQgaXQgb2YgYXJyKSB7XFxcXG4gICAgICAgICAgICBhLnB1c2goaXQpO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGNhY2hlLmNoYXB0ZXJzID0gYTtcXFxcbiAgICAgICAgbGV0IGFycjEgPSBnZXRBcnJheShyZXMsIFRvYy5jaGFwdGVyTGlzdCk7XFxcXG4gICAgICAgIC8vbG9nKGFycjEpO1xcXFxuICAgICAgICBpZiAoYXJyMSAmJiBhcnIxLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGFycjEpIHtcXFxcbiAgICAgICAgICAgICAgICBhcnIucHVzaChpdClcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBhZGRJdGVtQmVmb3JlKGlkLCBjYyhhcnIxKSk7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoYWlkLCBcXFxcXFxcIjBcXFxcXFxcIikgIT0gXFxcXFxcXCIxXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICBsb2coXFxcXFxcXCJicmVhazogXFxcXFxcXCIgKyBhaWQpO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgamF2YS5sYW5nLlRocmVhZC5zbGVlcCg1MCk7XFxcXG4gICAgICAgICAgICBsZXQgbnVybDIgPSBwZChyZXMsIFxcXFxcXFwiYm9keSYmXFxcXFxcXCIgKyBuZXh0KTtcXFxcbiAgICAgICAgICAgIGlmIChudXJsMiAmJiBudXJsMiAhPSBcXFxcXFxcIlxcXFxcXFwiICYmICF1cmxzLmluY2x1ZGVzKG51cmwyKSkge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnNbXFxcXFxcXCJSZWZlcmVyXFxcXFxcXCJdID0gY2FjaGUubmV4dC5zcGxpdChcXFxcXFxcIiNcXFxcXFxcIilbMF07XFxcXG4gICAgICAgICAgICAgICAgdXJscy5wdXNoKG51cmwyKTtcXFxcbiAgICAgICAgICAgICAgICBjYWNoZS5uZXh0ID0gbnVybDI7XFxcXG4gICAgICAgICAgICAgICAgbnVybCA9IG51cmwyO1xcXFxuICAgICAgICAgICAgICAgIE1ZX1VSTCA9IG51cmw7XFxcXG4gICAgICAgICAgICAgICAgcmVzID0gZmV0Y2gobnVybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBkZWxldGVJdGVtKGlkKTtcXFxcbiAgICAvL2xvZyhjYWNoZS5uZXh0ICsgXFxcXFxcXCI6ZW5kOlxcXFxcXFwiICsgY2FjaGUuY2hhcHRlcnMubGVuZ3RoKTtcXFxcbiAgICBzYXZlQ2FjaGUoY2FjaGUpO1xcXFxufSBlbHNlIHtcXFxcbiAgICBsaXN0ID0gZ2V0QXJyYXkocmVzLCBUb2MuY2hhcHRlckxpc3QpO1xcXFxuICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHtcXFxcbiAgICAgICAgLy9sb2coaXRlbSk7IC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IGl0ZW0uZXh0cmEudXJsLnJlcGxhY2UoXFxcXFxcXCIjYXV0b1BhZ2UjI3JlYWRUaGVtZSNcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIilcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuICAgIGlmIChsaXN0Lmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgZC51bnNoaWZ0KHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuS4i+i9vVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9kb3dubG9hZC52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9SZWZyZXNoIyNub0hpc3RvcnkjP3J1bGU95pys5Zyw6LWE5rqQ566h55CGXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJMaXN0OiBjcCxcXFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmlldzogXFxcXFxcXCIxXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgaW5mbzoge1xcXFxuICAgICAgICAgICAgICAgICAgICBib29rTmFtZTogTVlfUEFSQU1TLmJvb2tOYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICBib29rVG9wUGljOiBNWV9QQVJBTVMuY292ZXIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVOYW1lOiBcXFxcXFxcIuaCpuivu1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBwYXJzZUNvZGU6ICQudG9TdHJpbmcoKE1ZX1BBUkFNUywgcjApID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udmVydFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9jb252ZXJ0ZXI/cnVsZT1cXFxcXFxcIiArIHIwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSByZXF1ZXN0KGlucHV0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBydWxlID0gTVlfUEFSQU1TLmNvbnRlbnQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgciA9IGNvbnZlcnQocnVsZS5jb250ZW50KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByMSA9IHIuc3BsaXQoXFxcXFxcXCImJlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByMiA9IHIxLnNsaWNlKDAsIHIxLmxlbmd0aCAtIDEpLmpvaW4oXFxcXFxcXCImJlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSBwZGZhKHJlcywgXFxcXFxcXCJib2R5JiZcXFxcXFxcIiArIHIyKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGFycik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdHQgPSBcXFxcXFxcIlxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdCA9IGl0LnJlcGxhY2UobmV3IFJlZ0V4cChcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiLCBcXFxcXFxcImdcXFxcXFxcIiksIFxcXFxcXFwiLS1ici0tXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGl0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IHBkZmgoaXQsIFxcXFxcXFwiVGV4dFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gdC5yZXBsYWNlKG5ldyBSZWdFeHAoXFxcXFxcXCItLWJyLS1cXFxcXFxcIiwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIjxicj5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdDIgPSB0LnNwbGl0KFxcXFxcXFwiPGJyPlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdDIgb2YgdDIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0MiA9PSBcXFxcXFxcIlxcXFxcXFwiIHx8IGl0Mi5sZW5ndGggPT0gMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWl0Mi5zdGFydHNXaXRoKFxcXFxcXFwi44CAXFxcXFxcXCIpICYmICFpdDIuc3RhcnRzV2l0aChcXFxcXFxcIiZuYnNwOyZuYnNwO1xcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQyID0gXFxcXFxcXCImbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDtcXFxcXFxcIiArIGl0Mi50cmltKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1bGUucmVwbGFjZVJlZ2V4KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdDIgPSBpdDIucmVwbGFjZShuZXcgUmVnRXhwKHJ1bGUucmVwbGFjZVJlZ2V4LnJlcGxhY2UoXFxcXFxcXCIjI1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKSwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIlxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDIgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dCArPSBpdDIgKyBcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHR0XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIE1ZX1BBUkFNUywgTVlfUlVMRS50aXRsZSksXFxcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IFxcXFxcXFwibm92ZWxcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgZC51bnNoaWZ0KHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuacquino+aekOWIsOebruW9leWIl+ihqFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBNWV9VUkwsXFxcXG4gICAgICAgICAg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CA+IDApIHtcXFxcbiAgICAvL+Wkmue6v+eoi+WKoOi9vVxcXFxuICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXFxcbiAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHJ1bGUpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gc2VhcmNoKHJ1bGUsIHMsIDEpO1xcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHBhcmFtOiBpdCxcXFxcbiAgICAgICAgICAgIGlkOiBcXFxcXFxcInJ1bGVAXFxcXFxcXCIgKyBpdC5uYW1lXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcblxcXFxuICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcXFxuICAgICAgICBmdW5jOiBmdW5jdGlvbihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXFxcbiAgICAgICAgICAgIC8vbG9nKFxcXFxcXFwibGlzdGVuZXI6IFxcXFxcXFwiICsgKHJlc3VsdCB8fCBbXSkubGVuZ3RoKVxcXFxuICAgICAgICAgICAgcGFyYW0uaSA9IHBhcmFtLmkgKyAxO1xcXFxuICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0uaiA9IHBhcmFtLmogKyAxO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hdGNoTXVzdCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2VhcmNoQ29udGFpbnMoaXQudGl0bGUsIHMpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgI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dC51cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaXQucGljX3VybCB8fCBpdC5pbWcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LnBpY191cmwgfHwgaXQuaW1nID8gJ21vdmllXzFfdmVydGljYWxfcGljJyA6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJhXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHBhcmFtLmkgPj0gcGFyYW0uYWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYWdlaWQpXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliqDovb3nrKxcXFxcXFxcIiArIE1ZX1BBR0UgKyBcXFxcXFxcIumhteS4re+8jOi/m+W6pu+8mlxcXFxcXFwiICsgKHBhcmFtLmkgKyAxKSArIFxcXFxcXFwiL1xcXFxcXFwiICsgcGFyYW0uYWxsLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcX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wiXFxcXFxcXFxuXFxcXFxcXCIgKyBwZGZoMShpdGVtLCBpbnRybyksXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwiVG9jXFxcXFxcXCI6IHJ1bGUucnVsZVRvYyxcXFxcbiAgICAgICAgICAgICAgICBcXFxcXFxcImNvbnRlbnRcXFxcXFxcIjogcnVsZS5ydWxlQ29udGVudCxcXFxcbiAgICAgICAgICAgICAgICBcXFxcXFxcImJvb2tOYW1lXFxcXFxcXCI6IHBhcnNlRG9tRm9ySHRtbChpdGVtLCBuYW1lKSxcXFxcbiAgICAgICAgICAgICAgICBcXFxcXFxcImNvdmVyXFxcXFxcXCI6IHBhcnNlRG9tKGl0ZW0sIGNvdmVyLCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgIHVybDogbmV4dHRvYyA/IFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNcXFxcXFxcIiArIHUxIDogdTEsXFxcXG4gICAgICAgICAgICAgICAgdTE6IG5leHR0b2MgPyB1MSA6IG51bGwsXFxcXG4gICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICBjaGFyc2V0OiBjXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSk7XFxcXG4gICAgcmV0dXJuIGQ7XFxcXG59XFxcXG4kLmV4cG9ydHMgPSB7XFxcXG4gICAgY29udmVydDogY29udmVydCxcXFxcbiAgICBzZWFyY2g6IHNlYXJjaCxcXFxcbiAgICBsaXN0UnVsZXM6IChwYWdlLCBydWxlKSA9PiB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAvL+W5tuWPkeaVsOmHj1xcXFxuICAgICAgICAgICAgbGV0IHNpemUgPSAxNjtcXFxcbiAgICAgICAgICAgIGxldCB7XFxcXG4gICAgICAgICAgICAgICAgbG9hZCxcXFxcbiAgICAgICAgICAgICAgICBs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XFxcbn1cXFxcbiQuZXhwb3J0cyA9IHtcXFxcbiAgICBhZGQ6IGFkZCxcXFxcbiAgICB1cGRhdGU6IHVwZGF0ZSxcXFxcbiAgICByZW1vdmU6IHJlbW92ZSxcXFxcbiAgICByZW5hbWU6IHJlbmFtZSxcXFxcbiAgICBsb2FkOiBsb2FkLFxcXFxuICAgIGxvYWRSdWxlczogbG9hZFJ1bGVzLFxcXFxuICAgIGdldFNlbGVjdDogZ2V0U2VsZWN0LFxcXFxuICAgIHNoYXJlOiBzaGFyZSxcXFxcbiAgICBjYTogY2xvdWRBZGRcXFxcbn1cXFwifV1cIixcInByb3h5XCI6XCJcIn0iLCJ0aXRsZSI6IuaQnOe0oua3q+WmuyJ9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement