Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_网页限制解除(改)@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWVzcGFjZSAgICAgICAgIGh0dHBzOi8vZ3JlYXN5Zm9yay5vcmcvemgtQ04vdXNlcnMvMTA2MjIyLXF4aW4taQogCi8vIEBuYW1lICAgICAgICAgICAgICDnvZHpobXpmZDliLbop6PpmaQo5pS5KQovLyBAbmFtZTplbiAgICAgICAgICAgUmVtb3ZlIHdlYiBsaW1pdHMobW9kaWZpZWQpCi8vIEBuYW1lOnpoICAgICAgICAgICDnvZHpobXpmZDliLbop6PpmaQo5pS5KQovLyBAbmFtZTpqYSAgICAgICAgICAg44Km44Kn44OW44Gu6KaP5Yi257ep5ZKMKOWkieabtCkKIAovLyBAYXV0aG9yICAgICAgICAgICAgQ2F0NzMgJiBpcXhpbijkv67mlLkpIAovLyBAY29udHJpYnV0b3IgICAgICAgaXF4aW4KIAovLyBAZGVzY3JpcHRpb24gICAgICAg6YCa5p2A5aSn6YOo5YiG572R56uZLOWPr+S7peino+mZpOemgeatouWkjeWItuOAgeWJquWIh+OAgemAieaLqeaWh+acrOOAgeWPs+mUruiPnOWNleeahOmZkOWItuOAguWOn+S9nOiAhWNhdDczLOWboOS4uuWSjOaQnOe0oui3s+i9rOiEmuacrOWGsueqgSzpgYLov5vooYzkuobmlLnliqjjgIIKLy8gQGRlc2NyaXB0aW9uOmVuICAgIFBhc3MgdG8ga2lsbCBtb3N0IG9mIHRoZSBzaXRlLCB5b3UgY2FuIGxpZnQgdGhlIHJlc3RyaWN0aW9ucyBwcm9oaWJpdGVkIHRvIGNvcHksIGN1dCwgc2VsZWN0IHRoZSB0ZXh0LCByaWdodC1jbGljayBtZW51LnJldmlzZWQgdmVyc2lvbgovLyBAZGVzY3JpcHRpb246emggICAg6YCa5p2A5aSn6YOo5YiG572R56uZLOWPr+S7peino+mZpOemgeatouWkjeWItuO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ZXMiOiAibW91c2Vkb3dufG1vdXNldXB8a2V5ZG93bnxrZXl1cCIsCiAgICAgICAgICAgICAgICAiZG9tMCI6IHRydWUsCiAgICAgICAgICAgICAgICAiaG9va19hZGRFdmVudExpc3RlbmVyIjogdHJ1ZSwKICAgICAgICAgICAgICAgICJob29rX3ByZXZlbnREZWZhdWx0IjogdHJ1ZSwKICAgICAgICAgICAgICAgICJob29rX3NldF9yZXR1cm5WYWx1ZSI6IHRydWUsCiAgICAgICAgICAgICAgICAiYWRkX2NzcyI6IHRydWUKICAgICAgICAgICAgfSwKICAgICAgICAgICAgInJ1bGVfcGx1cyI6IHsKICAgICAgICAgICAgICAgICJuYW1lIjogImRlZmF1bHQiLAogICAgICAgICAgICAgICAgImhvb2tfZXZlbnROYW1lcyI6ICJjb250ZXh0bWVudXxzZWxlY3R8c2VsZWN0c3RhcnR8Y29weXxjdXR8ZHJhZ3N0YXJ0fG1vdXNlZG93bnxtb3VzZXVwfG1vdXNlbW92ZXxiZWZvcmV1bmxvYWQiLAogICAgICAgICAgICAgICAgInVuaG9va19ldmVudE5hbWVzIjogImtleWRvd258a2V5dXAiLAogICAgICAgICAgICAgICAgImRvbTAiOiB0cnVlLAogICAgICAgICAgICAgICAgImhvb2tfYWRkRXZlbnRMaXN0ZW5lciI6IHRydWUsCiAgICAgICAgICAgICAgICAiaG9va19wcmV2ZW50RGVmYXVsdCI6IHRydWUsCiAgICAgICAgICAgICAgICAiaG9va19zZXRfcmV0dXJuVmFsdWUiOiB0cnVlLAogICAgICAgICAgICAgICAgImFkZF9jc3MiOiB0cnVlCiAgICAgICAgICAgIH0sCiAgICAgICAgICAgICJydWxlX3poaWh1IjogewogICAgICAgICAgICAgICAgIm5hbWUiOiAiZGVmYXVsdCIsCiAgICAgICAgICAgICAgICAiaG9va19ldmVudE5hbWVzIjogImNvbnRleHRtZW51fHNlbGVjdHxzZWxlY3RzdGFydHxjb3B5fGN1dHxkcmFnc3RhcnR8bW91c2Vtb3ZlIiwKICAgICAgICAgICAgICAgICJ1bmhvb2tfZXZlbnROYW1lcyI6ICJrZXlkb3dufGtleXVwIiwKICAgICAgICAgICAgICAgICJkb20wIjogdHJ1ZSwKICAgICAgICAgICAgICAgICJob29rX2FkZEV2ZW50TGlzdGVuZXIiOiB0cnVlLAogICAgICAgICAgICAgICAgImhvb2tfcHJldmVudERlZmF1bHQiOiB0cnVlLAogICAgICAgICAgICAgICAgImhvb2tfc2V0X3JldHVyblZhbHVlIjogdHJ1ZSwKICAgICAgICAgICAgICAgICJhZGRfY3NzIjogdHJ1ZQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAiZGF0YSI6IFsKICAgICAgICAgICAgImIuZmFsb28uY29tIiwKICAgICAgICAgICAgImJicy5jb29jYWEuY29tIiwKICAgICAgICAgICAgImJvb2suaGpzbS50b20uY29tIiwKICAgICAgICAgICAgImJvb2suemh1bGFuZy5jb20iLAogICAgICAgICAgICAiYm9vay56b25naGVuZy5jb20iLAogICAgICAgICAgICAiY2hva3N0aWNrLmNvbSIsCiAgICAgICAgICAgICJjaHVhbmdzaGkucXEuY29tIiwKICAgICAgICAgICAgImNpdHkudWRuLmNvbSIsCiAgICAgICAgICAgICJjdXRlbGlzYTU1LnBpeG5ldC5uZXQiLAogICAgICAgICAgICAiaHVheXUuYmFpZHUuY29tIiwKICAgICAgICAgICAgImltYWMuaGsiLAogICAgICAgICAgICAibGlmZS50dyIsCiAgICAgICAgICAgICJsdXhtdXNjbGVzLmNvbSIsCiAgICAgICAgICAgICJuZXdzLm1pc3NldmFuLmNvbSIsCiAgICAgICAgICAgICJyZWFkLnFpZGlhbi5jb20iLAogICAgICAgICAgICAid3d3LjE1eWFuLmNvbSIsCiAgICAgICAgICAgICJ3d3cuMTdrLmNvbSIsCiAgICAgICAgICAgICJ3d3cuMTgxODMuY29tIiwKICAgICAgICAgICAgInd3dy4zNjBkb2MuY29tIiwKICAgICAgICAgICAgInd3dy5jb2NvMDEubmV0IiwKICAgICAgICAgICAgInd3dy5leXUuY29tIiwKICAgICAgICAgICAgInd3dy5ob25nc2h1LmNvbSIsCiAgICAgICAgICAgICJ3d3cuaG9uZ3hpdS5jb20iLAogICAgICAgICAgICAid3d3Lmltb29jLmNvbSIsCiAgICAgICAgICAgICJ3d3cuamp3eGMubmV0IiwKICAgICAgICAgICAgInd3dy5yZWFkbm92ZWwuY29tIiwKICAgICAgICAgICAgInd3dy50YWR1LmNvbSIsCiAgICAgICAgICAgICJ3d3cueHhzeS5uZXQiLAogICAgICAgICAgICAid3d3LnozejQuY29tIiwKICAgICAgICAgICAgInd3dy56aGlodS5jb20iLAogICAgICAgICAgICAieXVlZHUuMTYzLmNvbSIsCiAgICAgICAgICAgICJ3d3cucHBrYW8uY29tIiwKICAgICAgICAgICAgIm1vdmllLmRvdWJhbi5jb20iLAogICAgICAgICAgICAid3d3LnJ1aXdlbi5jb20iLAogICAgICAgICAgICAidmlwcmVhZGVyLnFpZGlhbi5jb20iLAogICAgICAgICAgICAid3d3LnBpZ2FpLm9yZyIsCiAgICAgICAgICAgICJ3d3cuc2hhbmdjLm5ldCIsCiAgICAgICAgICAgICJ3d3cubXlodGxtZWJvb2suY29tIiwKICAgICAgICAgICAgInd3dy55dXF1ZS5jb20iLAogICAgICAgICAgICAid3d3LmxvbmdtYWJvb2tjbi5jb20iLAogICAgICAgICAgICAid3d3LmFscGhhcG9saXMuY28uanAiLAogICAgICAgICAgICAid3d3LnNkaWZlbi5jb20iLAogICAgICAgICAgICAidm90ZXR3LmNvbSIsCiAgICAgICAgICAgICJib2tlMTEyLmNvbSIsCiAgICAgICAgICAgICJ3d3cubXlodGVib29rcy5jb20iLAogICAgICAgICAgICAid3d3LnhpZWd3LmNuIiwKICAgICAgICAgICAgImNodWFuZ3NoaS5xcS5jb20iLAogICAgICAgICAgICAid3d3LnV0YS1uZXQuY29tIiwKICAgICAgICAgICAgInd3dy5iaW1pYWNnLm5ldCIsCiAgICAgICAgICAgICJ3d3cuZGlhbnl1YW4uY29tIiwKICAgICAgICAgICAgIm9yaWdlbmFwZWxsaWRvLmNvbSIsCiAgICAgICAgICAgICIzZy4xNjMuY29tIiwKICAgICAgICAgICAgInd3dy5sdS14dS5jb20iLAogICAgICAgICAgICAibGVldGNvZGUuY24iLAogICAgICAgICAgICAid3d3LmppYW5iaWFva3UuY29tIiwKICAgICAgICAgICAgInd3dy5zb3lvdW5nLmNvbSIsCiAgICAgICAgICAgICJkb2MuZ3VhbmRhbmcubmV0IiwKICAgICAgICAgICAgInd3dy41MWRvbmdzaGkuY29tIiwKICAgICAgICAgICAgIm0uaGFvZGYuY29tIiwKICAgICAgICAgICAgInd3dy5kYW9kb2MuY29tIiwKICAgICAgICAgICAgInd3dy53Y3FqeXcuY29tIiwKICAgICAgICAgICAgInd3dy5zenh4LmNvbS5jbiIsCiAgICAgICAgXQogICAgfQogCiAgICB2YXIgcndsX3VzZXJEYXRhID0gbnVsbDsKICAgIHZhciBob3N0bmFtZSA9IHdpbmRvdy5sb2NhdGlvbi5ob3N0bmFtZTsKICAgIHZhciBidG5fbm9kZSA9IG51bGw7ICAgCiAgICB2YXIgcnVsZSA9IG51bGw7CiAgICB2YXIgbGlzdCA9IG51bGw7CiAgICB2YXIgaGFzRnJhbWUgPSBmYWxzZTsKIAogICAgLy8g5YKo5a2Y5ZCN56ewCiAgICB2YXIgc3RvcmFnZU5hbWUgPSAiaXF4aW5TdG9yYWdlTmFtZSI7CiAgICAvLyDopoHlpITnkIbnmoQgZXZlbnQg5YiX6KGoCiAgICB2YXIgaG9va19ldmVudE5hbWVzLCB1bmhvb2tfZXZlbnROYW1lcywgZXZlbnROYW1lczsKICAgIC8vIOWCqOWtmOiiqyBIb29rIOeahOWHveaVsAogICAgdmFyIEV2ZW50VGFyZ2V0X2FkZEV2ZW50TGlzdGVuZXIgPSBFdmVudFRhcmdldC5wcm90b3R5cGUuYWRkRXZlbnRMaXN0ZW5lcjsKICAgIHZhciBkb2N1bWVudF9hZGRFdmVudExpc3RlbmVyID0gZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcjsKICAgIHZhciBFdmVudF9wcmV2ZW50RGVmYXVsdCA9IEV2ZW50LnByb3RvdHlwZS5wcmV2ZW50RGVmYXVsdDsKIAogICAgLy8g5p+l55yL5pys5Zyw5piv5ZCm5a2Y5Zyo5pen5pWw5o2uCiAgICByd2xfdXNlckRhdGEgPSBHTV9nZXRWYWx1ZSgicndsX3VzZXJEYXRhIik7CiAgICBpZighcndsX3VzZXJEYXRhKXsKICAgICAgICByd2xfdXNlckRhdGEgPSBzZXR0aW5nRGF0YQogICAgICAgIC8vIEdNX3NldFZhbHVlKCJyd2xfdXNlckRhdGEiLHJ3bF91c2VyRGF0YSk7CiAgICB9CiAgICAvLyDoh6rliqjmm7TmlrDmlbDmja4KICAgIGZvcihsZXQgdmFsdWUgaW4gc2V0dGluZ0RhdGEpewogICAgICAgIGlmKCFyd2xfdXNlckRhdGEuaGFzT3duUHJvcGVydHkodmFsdWUpKXsKICAgICAgICAgICAgcndsX3VzZXJEYXRhW3ZhbHVlXSA9IHNldHRpbmdEYXRhW3ZhbHVlXTsKICAgICAgICAgICAgR01fc2V0VmFsdWUoInJ3bF91c2VyRGF0YSIscndsX3VzZXJEYXRhKTsKICAgICAgICB9CiAgICB9CiAKICAgIHZlcnNpb25fdXBfM190b180KCk7CiAKICAgIC8vIOiOt+WPlum7keWQjeWNlee9keermQogICAgbGlzdCA9IGdldF9ibGFja19saXN0KCk7CiAKICAgIC8vIOa3u+WKoOaMiemSrgogICAgLy8gaWYocndsX3VzZXJEYXRhLmFkZEJ0bil7CiAgICAgICAgYWRkQnRuKCk7ICAvLyDmt7vliqAKICAgICAgICBidG5fbm9kZSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJibGFja19ub2RlIik7CiAKICAgICAgICB2YXIgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewogICAgICAgICAgICBpZihkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiYmxhY2tfbm9kZSIpKXsKICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwogICAgICAgICAgICAgICAgcXhpblN0YXJ0KCk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBhZGRCdG4oKTsKICAgICAgICAgICAgfQogICAgICAgIH0sNTAwKQogCiAgICAvLyB9CiAKICAgIEdNX3JlZ2lzdGVyTWVudUNvbW1hbmQoIuWkjeWItumZkOWItuino+mZpCDorr7nva4iLCBzZXRNZW51KQogICAgdmFyIHVzZXJTZXR0aW5nID0gR01fZ2V0VmFsdWUoInJ3bF91c2VyRGF0YSIpOwogCiAgICAvLyAvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS3lh73mlbAgZnVuYwogCiAgICBmdW5jdGlvbiBxeGluU3RhcnQoKXsKICAgICAgICBjb25zb2xlLmxvZygi6ISa5pysOiDlpI3liLbpmZDliLbop6PpmaQo5pS5KSAtLS0g5byA5aeL5omn6KGMIC0tLSDlj5HluIPogIU6IHF4aW4gLS0tIEdpdEh1YjogaHR0cHM6Ly9naXRodWIuY29tL3F4aW5HaXRIdWIvUmVtb3ZlLXdlYi1saW1pdHMtIik7CiAgICAgICAgYWRkRHJhZ0V2ZW4oKTsKICAgICAgICBzZXRCdG5DbGljaygpOwogCiAgICAgICAgLy8g5qOA5p+l5piv5ZCm5Zyo6buR5ZCN5Y2V5LitCiAgICAgICAgaWYoY2hlY2tfYmxhY2tfbGlzdChsaXN0LGhvc3RuYW1lKSl7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBpZihyd2xfdXNlckRhdGEuYWRkQnRuKXsKICAgICAgICAgICAgICAgICAgICBidG5fbm9kZS5jaGVja2VkID0gdHJ1ZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcigi6ISa5pyscndsLemUmeivr++8mlxuIGJ0bl9ub2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MiOwogCiAgICAgICAgdmFyIHN0eWxlSW5uZXIgPSAiI3J3bC1pcXhpbnsiICsKICAgICAgICAgICAgICAgICJwb3NpdGlvbjpmaXhlZDsiICsKICAgICAgICAgICAgICAgICJ0cmFuc2Zvcm06dHJhbnNsYXRlKC05NSUsMCk7IiArCiAgICAgICAgICAgICAgICAid2lkdGg6ODVweDsiICsKICAgICAgICAgICAgICAgICJoZWlnaHQ6MjVweDsiICsKICAgICAgICAgICAgICAgICJmb250LXNpemU6MTJweDsiICsKICAgICAgICAgICAgICAgICJmb250LXdlaWdodDogNTAwOyIgKwogICAgICAgICAgICAgICAgImZvbnQtZmFtaWx5OlZlcmRhbmEsIEFyaWFsLCAn5a6L5L2TJzsiICsKICAgICAgICAgICAgICAgICJjb2xvcjojZmZmOyIgKwogICAgICAgICAgICAgICAgImJhY2tncm91bmQ6IzMzMzsiICsKICAgICAgICAgICAgICAgICJ6LWluZGV4OjIxNDc0ODM2NDc7IiArCiAgICAgICAgICAgICAgICAibWFyZ2luOiAwOyIgKwogICAgICAgICAgICAgICAgIm9wYWNpdHk6MC4wNTsiICsKICAgICAgICAgICAgICAgICJ0cmFuc2l0aW9uOjAuM3M7IiArCiAgICAgICAgICAgICAgICAib3ZlcmZsb3c6aGlkZGVuOyIgKwogICAgICAgICAgICAgICAgInVzZXItc2VsZWN0Om5vbmU7IiArCiAgICAgICAgICAgICAgICAidGV4dC1hbGlnbjpjZW50ZXI7IiArCiAgICAgICAgICAgICAgICAid2hpdGUtc3BhY2U6bm93cmFwOyIgKwogICAgICAgICAgICAgICAgImxpbmUtaGVpZ2h0OjI1cHg7IiArCiAgICAgICAgICAgICAgICAicGFkZGluZzowIDE2cHg7IiArCiAgICAgICAgICAgICAgICAiYm9yZGVyOjFweCBzb2xpZCAjY2NjOyIgKwogICAgICAgICAgICAgICAgImJvcmRlci13aWR0aDoxcHggMXB4IDFweCAwOyIgKwogICAgICAgICAgICAgICAgImJvcmRlci1ib3R0b20tcmlnaHQtcmFkaXVzOjVweDsiICsKICAgICAgICAgICAgICAgICJib3gtc2l6aW5nOiBjb250ZW50LWJveDsiICsKICAgICAgICAgICAgIn0iICsKICAgICAgICAgICAgIiNyd2wtaXF4aW4gaW5wdXR7IiArCiAgICAgICAgICAgICAgICAibWFyZ2luOiAwOyIgKwogICAgICAgICAgICAgICAgInBhZGRpbmc6IDA7IiArCiAgICAgICAgICAgICAgICAidmVydGljYWwtYWxpZ246bWlkZGxlOyIgKwogICAgICAgICAgICAgICAgIi13ZWJraXQtYXBwZWFyYW5jZTpjaGVja2JveCAhaW1wb3J0YW50OyIgKwogICAgICAgICAgICAgICAgIi1tb3otYXBwZWFyYW5jZTpjaGVja2JveDsiICsKICAgICAgICAgICAgICAgICJwb3NpdGlvbjogc3RhdGljOyIgKwogICAgICAgICAgICAgICAgImNsaXA6IGF1dG87IiArCiAgICAgICAgICAgICAgICAib3BhY2l0eTogMTsiICsKICAgICAgICAgICAgICAgICJjdXJzb3I6IHBvaW50ZXI7IiArCiAgICAgICAgICAgICJ9IiArCiAgICAgICAgICAgICIjcndsLWlxeGluLnJ3bC1hY3RpdmUtaXF4aW57IiArCiAgICAgICAgICAgICAgICAibGVmdDogMHB4OyIgKwogICAgICAgICAgICAgICAgInRyYW5zZm9ybTp0cmFuc2xhdGUoMCwwKTsiICsKICAgICAgICAgICAgICAgICJvcGFjaXR5OiAwLjk7IiArCiAgICAgICAgICAgICAgICAiaGVpZ2h0OiAzMnB4OyIgKwogICAgICAgICAgICAgICAgImxpbmUtaGVpZ2h0OiAzMnB4IiArCiAgICAgICAgICAgICJ9IiArCiAgICAgICAgICAgICIjcndsLWlxeGluIGxhYmVseyIgKwogICAgICAgICAgICAgICAgIm1hcmdpbjowOyIgKwogICAgICAgICAgICAgICAgInBhZGRpbmc6MDsiICsKICAgICAgICAgICAgICAgICJmb250LXdlaWdodDo1MDA7IiArCiAgICAgICAgICAgICJ9IiArCiAgICAgICAgICAgICIjcndsLWlxeGluICNyd2wtc2V0YnRueyIgKwogICAgICAgICAgICAgICAgIm1hcmdpbjogMCA0cHggMCAwOyIgKwogICAgICAgICAgICAgICAgInBhZGRpbmc6IDAgMCAwIDRweDsiICsKICAgICAgICAgICAgICAgICJib3JkZXI6IG5vbmU7IiArCiAgICAgICAgICAgICAgICAiYm9yZGVyLXJhZGl1czogMnB4OyIgKwogICAgICAgICAgICAgICAgImN1cnNvcjogcG9pbnRlcjsiICsKICAgICAgICAgICAgICAgICJiYWNrZ3JvdW5kOiAjZmZmOyIgKwogICAgICAgICAgICAgICAgImNvbG9yOiAjMDAwOyIgKwogICAgICAgICAgICAifSIgKwogICAgICAgICAgICAiICIKICAgICAgICAgICAgCiAgICAgICAgaWYoIXJ3bF91c2VyRGF0YS5hZGRCdG4pewogICAgICAgICAgICB2YXIgc3R5bGVUZW1wID0gIiNyd2wtaXF4aW57ZGlzcGxheTpub25lfSI7CiAgICAgICAgICAgIHN0eWxlLmlubmVySFRNTCA9IHN0eWxlSW5uZXIgKyBzdHlsZVRlbXA7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgc3R5bGUuaW5uZXJIVE1MID0gc3R5bGVJbm5lcjsKICAgICAgICB9CiAgICAgICAgaWYoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI3J3bC1pcXhpbiIpKXsKICAgICAgICAgICAgLy8gY29uc29sZS5sb2coIumAmui/h3N0eWxl5o+S5YWlIik7CiAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNyd2wtaXF4aW4iKS5hcHBlbmRDaGlsZChzdHlsZSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgLy8gY29uc29sZS5sb2coIumAmui/h0dN5o+S5YWlIik7CiAgICAgICAgICAgIEdNX2FkZFN0eWxlKHN0eWxlSW5uZXIpOwogICAgICAgIH0KICAgIH07CiAKICAgIC8vIOe7meaMiemSrue7keWumueCueWHu+S6i+S7tgogICAgZnVuY3Rpb24gc2V0QnRuQ2xpY2soKXsgIAogICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNyd2wtc2V0YnRuIikuYWRkRXZlbnRMaXN0ZW5lcigiY2xpY2siLHNldE1lbnUpOwogICAgfQogCiAgICAvLyDoj5zljZUKICAgICBmdW5jdGlvbiBzZXRNZW51KCl7CiAgICAgICAgICAgIHZhciBvbGRFZGl0Qm94ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI3J3bC1zZXRNZW51Iik7CiAgICAgICAgICAgIGlmKG9sZEVkaXRCb3gpewogICAgICAgICAgICAgICAgb2xkRWRpdEJveC5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKG9sZEVkaXRCb3gpOwogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHZhciB1c2VyU2V0dGluZyA9IEdNX2dldFZhbHVlKCJyd2xfdXNlckRhdGEiKTsKICAgICAgICAgICAgdmFyIHVwbG9hZF9jaGVja2VkID0gdXNlclNldHRpbmcuY29ubmVjdFRvVGhlU2VydmVyPyJjaGVja2VkIjoiIjsKICAgICAgICAgICAgdmFyIGJ0bmNoZWNrZWQgPSAgdXNlclNldHRpbmcuYWRkQnRuPydjaGVja2VkJzonJwogCiAgICAgICAgICAgIHZhciBvZG9tID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiZGl2Iik7CiAgICAgICAgICAgIG9kb20uaWQgPSAicndsLXNldE1lbnUiOwogICAgICAgICAgICBvZG9tLnN0eWxlLmNzc1RleHQgPSJwb3NpdGlvbjogZml4ZWQ7IiArCiAgICAgICAgICAgICAgICAidG9wOiAxMDBweDsiICsKICAgICAgICAgICAgICAgICJsZWZ0OiA1MHB4OyIgKwogICAgICAgICAgICAgICAgInBhZGRpbmc6IDEwcHg7IiArCiAgICAgICAgICAgICAgICAiYmFja2dyb3VuZDogI2ZmZjsiICsKICAgICAgICAgICAgICAgICJib3JkZXItcmFkaXVzOiA0cHg7IjsKICAgICAgICAgICAgR01fYWRkU3R5bGUoIiNyd2wtc2V0TWVudVNhdmUsIiArCiAgICAgICAgICAgICAgICAiI3J3bC1yZXNldCwiICsKICAgICAgICAgICAgICAgICIjcndsLXNldE1lbnVDbG9zZXsiICsKICAgICAgICAgICAgICAgICAgICAibWFyZ2luOiAwOyIgKwogICAgICAgICAgICAgICAgICAgICJwYWRkaW5nOiAwIDJweDsiICsKICAgICAgICAgICAgICAgICAgICAiYm9yZGVyOiBub25lOyIgKwogICAgICAgICAgICAgICAgICAgICJib3JkZXItcmFkaXVzOiAycHg7IiArCiAgICAgICAgICAgICAgICAgICAgImN1cnNvcjogcG9pbnRlcjsiICsKICAgICAgICAgICAgICAgICAgICAiYmFja2dyb3VuZDogI2ZmZjsiICsKICAgICAgICAgICAgICAgICAgICAiY29sb3I6ICMwMDA7IiArCiAgICAgICAgICAgICAgICAifSIgKwogICAgICAgICAgICAgICAgIiNyd2wtcmVzZXR7IiArCiAgICAgICAgICAgICAgICAgICAgImJvcmRlcjogMXB4IHNvbGlkICM2NjY7IiArCiAgICAgICAgICAgICAgICAifSIgKwogICAgICAgICAgICAgICAgIiNyd2wtc2V0TWVudVNhdmV7IiArCiAgICAgICAgICAgICAgICAgICAgImJvcmRlcjogMXB4IHNvbGlkIGdyZWVuOyIgKwogICAgICAgICAgICAgICAgIn0iICsKICAgICAgICAgICAgICAgICIjcndsLXNldE1lbnVDbG9zZXsiICsKICAgICAgICAgICAgICAgICAgICAiYm9yZGVyOiAxcHggc29saWQgcmVkOyIgKwogICAgICAgICAgICAgICAgIn0iICsKICAgICAgICAgICAgICAgICIjcndsLXNldE1lbnV7IiArCiAgICAgICAgICAgICAgICAgICAgInRleHQtYWxpZ246bGVmdDsiICsKICAgICAgICAgICAgICAgICAgICAiZm9udC1zaXplOjE0cHg7IiArCiAgICAgICAgICAgICAgICAgICAgInotaW5kZXg6OTk5OTk5OyIgKwogICAgICAgICAgICAgICAgICAgICJib3JkZXI6IDFweCBzb2xpZCBjb3JuZmxvd2VyYmx1ZTsiICsKICAgICAgICAgICAgICAgICJ9IiArCiAgICAgICAgICAgICAgICAiI3J3bC1zZXRNZW51IHB7IiArCiAgICAgICAgICAgICAgICAgICAgIm1hcmdpbjo1cHggYXV0bzsiICsKICAgICAgICAgICAgICAgICJ9IiArCiAgICAgICAgICAgICAgICAiICIpCiAgICAgICAgICAgIHZhciBpbm5lckggPSAiIiArCiAgICAgICAgICAgICAgICAiPHA+6Led56a76aG26YOo6Led56a777yI5Y2V5L2NIOWDj+e0oO+8iSA8aW5wdXQgaWQ9J3Bvc2l0aW9udG9wJyB0eXBlPSd0ZXh0JyB2YWx1ZT0iICsgdXNlclNldHRpbmcucG9zaXRpb25Ub3AgKyAiPjwvcD4iICsgIiIgKwogICAgICAgICAgICAgICAgLy8gIjxsYWJlcmw+IDxwPuWFgeiuuOS4iuS8oOm7keWQjeWNlTxpbnB1dCBpZD0ndXBsb2FkY2hlY2tlZCcgIHR5cGU9J2NoZWNrYm94JyAiICsgdXBsb2FkX2NoZWNrZWQgKyAiPjwvcD4iICsgIjwvbGFiZXJsPiIgKwogICAgICAgICAgICAgICAgIjxwIGlkPSdyd2wtc2hvcnRjdXRzJyB0aXRsZT0n5b+r5o236ZSuJz7lv6vmjbfplK7vvJoiICsKICAgICAgICAgICAgICAgICAgICAiPHNlbGVjdCBpZD0ncndsLXNob3J0Y3V0Jz4iICsKICAgICAgICAgICAgICAgICAgICAgICAgIjxvcHRpb24gdmFsdWU9J29mZiciICsgKHVzZXJTZXR0aW5nLnNob3J0Y3V0ID09IDA/InNlbGVjdGVkIjoiIikgICsgIj7lhbPpl608L29wdGlvbj4iICsKICAgICAgICAgICAgICAgICAgICAgICAgIjxvcHRpb24gdmFsdWU9J2YxJyIgKyAodXNlclNldHRpbmcuc2hvcnRjdXQgPT0gMT8ic2VsZWN0ZWQiOiIiKSAgKyAiPiBGMSA8L29wdGlvbj4iICsKICAgICAgICAgICAgICAgICAgICAgICAgIjxvcHRpb24gdmFsdWU9J2N0cmxmMSciIC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M6Ly9naXRodWIuY29tL0NhdDczNzMvcmVtb3ZlLXdlYi1saW1pdHMnPumhueebruS4u+mhtTwvYT4gPC9QPiIgKwogICAgICAgICAgICAgICAgIjxwPuiDveWKm+aciemZkCzkuI3og73mr4/kuKrnvZHnq5npg73og73lroznvo48L1A+IiArCiAgICAgICAgICAgICAgICAiPHA+5aaC6Iul5Y+N6aaILOWKoeW/heW4puS4iuivpue7hue9keWdgDwvUD4iICsKICAgICAgICAgICAgICAgICI8cD4gIDwvUD4iICsKICAgICAgICAgICAgICAgIC8vICI8cD48cz7mmL7npLrmjInpkq7vvIjlvoXmt7vliqDvvIk8L3M+PC9wPiIgKwogICAgICAgICAgICAgICAgLy8gIjxwPjxzPuaMiemSrumAj+aYjuW6pu+8iOW+hea3u+WKoO+8iTwvcz48L3A+IiArCiAgICAgICAgICAgICAgICAvLyAiPHA+PHM+5b+r6YCf5aSN5Yi277yI5b6F5re75Yqg77yJPC9zPjwvcD4iICsKICAgICAgICAgICAgICAgIC8vICI8cD48cz7lhbbku5YgKOW+hea3u+WKoO+8iTwvcz48L3A+IiArCiAgICAgICAgICAgICAgICAiPHA+5pWw5o2u5a2Y5YKo5pa55byP5Li6SlNPTizlpoLoi6XlnKjmraTkv67mlLks5rOo5oSP5byV5Y+36YCX5Y+3PC9QPiIgKwogICAgICAgICAgICAgICAgIjx0ZXh0YXJlYSB3cmFwPSdvZmYnIGNvbHM9JzQ1JyByb3dzPScyMCcgc3R5bGU9J292ZXJmbG93OmF1dG87Ym9yZGVyLXJhZGl1czo0cHg7Jz4iICsgSlNPTi5zdHJpbmdpZnkodXNlclNldHRpbmcuZGF0YSxmYWxzZSw0KSArICI8L3RleHRhcmVhPiIgKyAKICAgICAgICAgICAgICAgICI8YnI+IiArCiAgICAgICAgICAgICAgICAiPHF4aW5idXR0b24gaWQ9J3J3bC1yZXNldCc+5riF56m66K6+572uPC9xeGluYnV0dG9uPiAmbmJzcDsmbmJzcDsmbmJzcDsiICsKICAgICAgICAgIC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TZXR0aW5nKTsKICAgICAgICAgICAgLy8g5Yi35paw6aG16Z2iCiAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgIHdpbmRvdy5sb2NhdGlvbi5yZWxvYWQoKTsKICAgICAgICAgICAgfSwzMDApOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGFsZXJ0KCLovpPlhaXkuLrnqboiKTsKICAgICAgICAgICAgLy8gdGhpcy5yZXNldCgpOwogICAgICAgIH0KICAgICAgICBjbG9zZU1lbnUoKTsKICAgIH0KICAgIC8vIOWkjeWOn+iPnOWNlQogICAgZnVuY3Rpb24gcndsUmVzZXQoKXsKICAgICAgICBHTV9kZWxldGVWYWx1ZSgicndsX3VzZXJEYXRhIik7CiAgICAgICAgd2luZG93LmxvY2F0aW9uLnJlbG9hZCgpOwogICAgfQogCiAgICAvL+WFs+mXreiPnOWNlQogICAgZnVuY3Rpb24gY2xvc2VNZW51KCl7CiAgICAgICAgdmFyIG9sZEVkaXRCb3ggPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjcndsLXNldE1lbnUiKTsKICAgICAgICBpZihvbGRFZGl0Qm94KXsKICAgICAgICAgICAgb2xkRWRpdEJveC5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKG9sZEVkaXRCb3gpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgfQogCiAgICAvLyDlop7liqDmi5bmi73kuovku7Yg6L+b6KGM57uR5a6aCiAgICBmdW5jdGlvbiBhZGREcmFnRXZlbigpewogICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIGRyYWdCdG4oKQogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCJkcmFnQnRu5Ye95pWwIOaKpemUmSIpOwogICAgICAgICAgICB9CiAgICAgICAgfSwxMDAwKQogICAgICAgIC8vIGRyYWdCdG4oKTsgIC8vIOWinuWKoOaLluWKqOS6i+S7tgogICAgfQogCiAgICAvLyDlop7liqDmi5bliqjkuovku7YgZnVuYwogICAgZnVuY3Rpb24gZHJhZ0J0bigpewogICAgICAgIHZhciByd2xfbm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNyd2wtaXF4aW4iKTsKICAgICAgICByd2xfbm9kZS5hZGRFdmVudExpc3RlbmVyKCJtb3VzZWRvd24iLGZ1bmN0aW9uKGV2ZW50KXsKICAgICAgICAgICAgcndsX25vZGUuc3R5bGUudHJhbnNpdGlvbiA9ICJudWxsIjsKICAgICAgICAgICAgdmFyIGRpc1ggPSBldmVudC5jbGllbnRYIC0gcndsX25vZGUub2Zmc2V0TGVmdDsKICAgICAgICAgICAgdmFyIGRpc1kgPSBldmVudC5jbGllbnRZIC0gcndsX25vZGUub2Zmc2V0VG9wOwogCiAgICAgICAgICAgIHZhciBtb3ZlID0gZnVuY3Rpb24oZXZlbnQpewogICAgICAgICAgICAgICAgcndsX25vZGUuc3R5bGUubGVmdCA9IGV2ZW50LmNsaWVudFggLSBkaXNYICsgInB4IiA7CiAgICAgICAgICAgICAgICByd2xfbm9kZS5zdHlsZS50b3AgID0gZXZlbnQuY2xpZW50WSAtIGRpc1kgKyAicHgiIDsKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoIm1vdXNlbW92ZSIsbW92ZSk7CiAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoIm1vdXNldXAiLGZ1bmN0aW9uKCl7CiAgICAgICAgICAgICAgICByd2xfbm9kZS5zdHlsZS50cmFuc2l0aW9uID0gIjAuM3MiOwogICAgICAgICAgICAgICAgZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcigibW91c2Vtb3ZlIixtb3ZlKTsKICAgICAgICAgICAgICAgIC8vIOatpOWHveaVsOWGheaJgOacieeahOazqOmHiuivreWPpemDveaYr+acieeUqOeahAogICAgICAgICAgICAgICAgICAgIC8vIOW8gOWQr+WQjizlj6/mi5bliqjliLDlsY/luZXlj7Pkvqcs5L2G5bCa5pyq5re75YqgY3NzCiAgICAgICAgICAgICAgICAgICAgLy8g5Zyo5LiK6Z2i5re75YqgIHJ3bC1hY3RpdmUtaXF4aW4g55qE5Zyw5pa55Yqg5LiK5Yik5pat5bem5Y+zLOWcqOWKoOS4iuebuOW6lOeahGNzc+WNs+WPrwogICAgICAgICAgICAgICAgICAgIC8vIOaHkiAyMDE4LTA0LTE4IDIxOjUxOjMyCiAgICAgICAgICAgICAgICAvLyB2YXIgYm9keVdpZHRoID0gZG9jdW1lbnQuYm9keS5jbGllbnRXaWR0aDsKICAgICAgICAgICAgICAgIHZhciByd2xfbm9kZVdpZHRoID0gcndsX25vZGUub2Zmc2V0TGVmdCArIHJ3bF9ub2RlLm9mZnNldFdpZHRoLzI7CiAgICAgICAgICAgICAgICAvLyBpZihyd2xfbm9kZVdpZHRoID4gYm9keVdpZHRoLzIpewogICAgICAgICAgICAgICAgLy8gICAgIHJ3bF9ub2RlLnN0eWxlLmxlZnQgPSAiYXV0byI7CiAgICAgICAgICAgICAgICAvLyAgICAgcndsX25vZGUuc3R5bGUucmlnaHQgPSAwOwogICAgICAgICAgICAgICAgLy8gICAgIHJ3bF91c2VyRGF0YS5wb3NpdGlvbkxlZnQgPSAiYXV0byI7CiAgICAgICAgICAgICAgICAvLyAgICAgcndsX3VzZXJEYXRhLnBvc2l0aW9uUmlnaHQgPSAiMCI7CiAgICAgICAgICAgICAgICAvLyB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHJ3bF9ub2RlLnN0eWxlLnJpZ2h0ID0gcndsX3VzZXJEYXRhLnBvc2l0aW9uUmlnaHQgPSAiYXV0byI7CiAgICAgICAgICAgICAgICAgICAgcndsX25vZGUuc3R5bGUubGVmdCA9IHJ3bF91c2VyRGF0YS5wb3NpdGlvbkxlZnQgPSAgMDsKICAgICAgICAgICAgICAgIC8vIH0KICAgICAgICAgICAgICAgIHJ3bF91c2VyRGF0YS5wb3NpdGlvblRvcCA9IHJ3bF9ub2RlLm9mZnNldFRvcDsKICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJyd2xfdXNlckRhdGEiLHJ3bF91c2VyRGF0YSk7CiAKICAgICAgICAgICAgfSkKICAgICAgICB9KQogICAgfQogCiAgICAvLyDliJ3lp4vljJYgaW5pdCBmdW5jICDov5nph4zmiY3mmK/moLjlv4MKICAgIGZ1bmN0aW9uIGluaXQoKSB7CiAgICAgICAgLy8g6ZKI5a+55Liq5Yir572R56uZ6YeH5Y+W5LiN5ZCM55qE562W55WlCiAgICAgICAgcnVsZSA9IGNsZWFyKCk7CiAgICAgICAgLy8g6K6+572uIGV2ZW50IOWIl+ihqAogICAgICAgIGhvb2tfZXZlbnROYW1lcyA9IHJ1bGUuaG9va19ldmVudE5hbWVzLnNwbGl0KCJ8Iik7CiAgICAgICAgLy8gVE9ETyBBbGxvd2VkIHRvIHJldHVybiB2YWx1ZQogICAgICAgIHVuaG9va19ldmVudE5hbWVzID0gcnVsZS51bmhvb2tfZXZlbnROYW1lcy5zcGxpdCgifCIpOwogICAgICAgIGV2ZW50TmFtZXMgPSBob29rX2V2ZW50TmFtZXMuY29uY2F0KHVuaG9va19ldmVudE5hbWVzKTsKIAogICAgICAgIC8vIOiwg+eUqOa4heeQhiBET00wIGV2ZW50IOaWueazleeahOW+queOrwogICAgICAgIGlmKHJ1bGUuZG9tMCkgewogICAgICAgICAgICBzZXRJbnRlcnZhbChjbGVhckxvb3AsIDEwICogMTAwMCk7CiAgICAgICAgICAgIHNldFRpbWVvdXQoY2xlYXJMb29wLCAxNTAwKTsKICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLCBjbGVhckxvb3AsIHRydWUpOwogICAgICAgICAgICBjbGVhckxvb3AoKTsKICAgICAgICB9CiAKICAgICAgICAvLyBob29rIGFkZEV2ZW50TGlzdGVuZXIgLy/lr7zoh7TmkJzntKLot7PovazlpLHmlYjnmoTljp/lm6AKICAgICAgICBpZihydWxlLmhvb2tfYWRkRXZlbnRMaXN0ZW5lcikgewogICAgICAgICAgICBFdmVudFRhcmdldC5wcm90b3R5cGUuYWRkRXZlbnRMaXN0ZW5lciA9IGFkZEV2ZW50TGlzdGVuZXI7CiAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIgPSBhZGRFdmVudExpc3RlbmVyOwogCiAgICAgICAgICAgIGlmKGhhc0ZyYW1lKXsKICAgICAgICAgICAgICAgIGZvcihsZXQgaSA9IDA7aTxoYXNGcmFtZS5sZW5ndGg7aSsrKXsKICAgICAgICAgICAgICAgICAgICBoYXNGcmFtZVtpXS5jb250ZW50V2luZG93LmRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIgPSBhZGRFdmVudExpc3RlbmVyOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAKICAgICAgICB9CiAKICAgICAgICAvLyBob29rIHByZXZlbnREZWZhdWx0CiAgICAgICAgaWYocnVsZS5ob29rX3ByZXZlbnREZWZhdWx0KSB7CiAgICAgICAgICAgIEV2ZW50LnByb3RvdHlwZS5wcmV2ZW50RGVmYXVsdCA9IGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgaWYoaG9va19ldmVudE5hbWVzLmluZGV4T2YodGhpcy50eXBlKSA8IDApIHsKICAgICAgICAgICAgICAgICAgICBFdmVudF9wcmV2ZW50RGVmYXVsdC5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwogCiAgICAgICAgICAgIGlmKGhhc0ZyYW1lKXsKICAgICAgICAgICAgICAgIGZvcihsZXQgaSA9IDA7aTxoYXNGcmFtZS5sZW5ndGg7aSsrKXsKICAgICAgICAgICAgICAgICAgICBoYXNGcmFtZVtpXS5jb250ZW50V2luZG93LkV2ZW50LnByb3RvdHlwZS5wcmV2ZW50RGVmYXVsdCA9IGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICAgICAgICBpZihob29rX2V2ZW50TmFtZXMuaW5kZXhPZih0aGlzLnR5cGUpIDwgMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRfcHJldmVudERlZmF1bHQuYXBwbHkodGhpcywgYXJndW1lbnRzKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAKICAgICAgICAvLyBIb29rIHNldCByZXR1cm5WYWx1ZQogICAgICAgIGlmKHJ1bGUuaG9va19zZXRfcmV0dXJuVmFsdWUpIHsKICAgICAgICAgICAgRXZlbnQucHJvdG90eXBlLl9fZGVmaW5lU2V0dGVyX18oJ3JldHVyblZhbHVlJywgZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICBpZih0aGlzLnJldHVyblZhbHVlICE9PSB0cnVlICYmIGhvb2tfZXZlbnROYW1lcy5pbmRleE9mKHRoaXMudHlwZSkgPj0gMCkgewogICAgICAgICAgICAgICAgICAgIHRoaXMucmV0dXJuVmFsdWUgPSB0cnVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAKICAgICAgICAvLyDmt7vliqBDU1MgICAgIC8vIGNvbnNvbGUuZGVidWcoJ3VybDogJyArIHVybCwgJ3N0b3JhZ2VOYW1l77yaJyArIHN0b3JhZ2VOYW1lLCAncnVsZTogJyArIHJ1bGUubmFtZSk7CiAgICAgICAgaWYocnVsZS5hZGRfY3NzKSB7CiAgICAgICAgICAgIEdNX2FkZFN0eWxlKCdodG1sLCA6bm90KFtjbGFzcyo9InJ3bC1leGVtcHQiXSkgey13ZWJraXQtdXNlci1zZWxlY3Q6dGV4dCFpbXBvcnRhbnQ7IC1tb3otdXNlci1zZWxlY3Q6dGV4dCFpbXBv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WRkRXZlbnRMaXN0ZW5lci5hcHBseSh0aGlzLCBbdHlwZSwgdXNlQ2FwdHVyZSA/IHVuaG9va190IDogdW5ob29rX2YsIHVzZUNhcHR1cmVdKTsKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIHRoaXNbZnVuY3NOYW1lXS5wdXNoKGZ1bmMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIF9hZGRFdmVudExpc3RlbmVyLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CiAgICAgICAgfQogICAgfQogCiAgICAvLyDmuIXnkIblvqrnjq8KICAgIGZ1bmN0aW9uIGNsZWFyTG9vcCgpIHsKICAgICAgICBydWxlID0gY2xlYXIoKSAvLyDlr7nkuo7liqjmgIHnlJ/miJDnmoToioLngrks6ZqP5pe25qOA5rWLCiAgICAgICAgdmFyIGVsZW1lbnRzID0gZ2V0RWxlbWVudHMoKTsKIAogICAgICAgIGZvcih2YXIgaSBpbiBlbGVtZW50cykgewogICAgICAgICAgZm9yKHZhciBqIGluIGV2ZW50TmFtZXMpIHsKICAgICAgICAgICAgdmFyIG5hbWUgPSAnb24nICsgZXZlbnROYW1lc1tqXTsKIAogICAgICAgICAgICAvLyA7P+acquino+WGswogICAgICAgICAgICAgICAgLy8gMjAxOC0wNC0wMiBlbGVtZW50c+S4reS8muacieWtl+espuS4suWHuueOsCzljp/niYjkuI3kvJos6Zeu6aKY5LiN5piOLOagueacrOWOn+WboOWwmuacquino+WGswogICAgICAgICAgICAgICAgLy8g55u45YWz5Y+N6aaIICBodHRwczovL2dyZWFzeWZvcmsub3JnL3poLUNOL2ZvcnVtL2Rpc2N1c3Npb24vMzYwMTQKICAgICAgICAgICAgICAgIC8vIOmXrumimOeJiOacrOWPtyAgdjMuMC43CiAgICAgICAgICAgICAgICAvLyDpl67popjooaXlhYUgICDkuYvliY3lj6/ku6Xkvb/nlKgs5YW35L2T54mI5pys5pyq5rWL77yIMjAxOC0wNC0wMiAyMToyNzo1M++8iSzljp/niYjlj6/ku6Xkvb/nlKgKICAgICAgICAgICAgaWYoT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKGVsZW1lbnRzW2ldKT09IltvYmplY3QgU3RyaW5nXSIpewogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0KIAogICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhlbGVtZW50c1tpXSkKICAgICAgICAgICAgLy8gaWYodHlwZW9mIGVsZW1lbnRzW2ldW25hbWVdID09PSAib2JqZWN0Iil7CiAgICAgICAgICAgIC8vICAgICBjb25zb2xlLmxvZyh0eXBlb2YgZWxlbWVudHNbaV1bbmFtZV0pCiAgICAgICAgICAgIC8vIH0KICAgICAgICAgICAgaWYoZWxlbWVudHNbaV1bbmFtZV0gIT09IG51bGwgJiYgZWxlbWVudHNbaV1bbmFtZV0gIT09IG9ueHh4KSB7CiAgICAgICAgICAgICAgICBpZih1bmhvb2tfZXZlbnROYW1lcy5pbmRleE9mKGV2ZW50TmFtZXNbal0pID49IDApIHsKICAgICAgICAgICAgICAgICAgICBlbGVtZW50c1tpXVtzdG9yYWdlTmFtZSArIG5hbWVdID0gZWxlbWVudHNbaV1bbmFtZV07CiAgICAgICAgICAgICAgICAgICAgZWxlbWVudHNbaV1bbmFtZV0gPSBvbnh4eDsKICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGVsZW1lbnRzW2ldW25hbWVdID0gbnVsbDsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgCiAgICAgICAgZG9jdW1lbnQub25tb3VzZWRvd24gPSBmdW5jdGlvbigpe3JldHVybiB0cnVlO307CiAgICB9CiAKICAgIC8vIOi/lOWbnnRydWXnmoTlh73mlbAKICAgIGZ1bmN0aW9uIHJldHVyblRydWUoZSkgewogICAgICAgIHJldHVybiB0cnVlOwogICAgfQogICAgZnVuY3Rpb24gdW5ob29rX3QoZSkgewogICAgICAgIHJldHVybiB1bmhvb2soZSwgdGhpcywgc3RvcmFnZU5hbWUgKyBlLnR5cGUgKyAndCcpOwogICAgfQogICAgZnVuY3Rpb24gdW5ob29rX2YoZSkgewogICAgICAgIHJldHVybiB1bmhvb2soZSwgdGhpcywgc3RvcmFnZU5hbWUgKyBlLnR5cGUgKyAnZicpOwogICAgfQogICAgZnVuY3Rpb24gdW5ob29rKGUsIHNlbGYsIGZ1bmNzTmFtZSkgewogICAgICAgIHZhciBsaXN0ID0gc2VsZltmdW5jc05hbWVdOwogICAgICAgIGZvcih2YXIgaSBpbiBsaXN0KSB7CiAgICAgICAgICAgIGxpc3RbaV0oZSk7CiAgICAgICAgfQogCiAgICAgICAgZS5yZXR1cm5WYWx1ZSA9IHRydWU7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CiAgICBmdW5jdGlvbiBvbnh4eChlKSB7CiAgICAgICAgdmFyIG5hbWUgPSBzdG9yYWdlTmFtZSArICdvbicgKyBlLnR5cGU7CiAgICAgICAgdGhpc1tuYW1lXShlKTsKIAogICAgICAgIGUucmV0dXJuVmFsdWUgPSB0cnVlOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQogCiAgICAvLyDojrflj5bmiYDmnInlhYPntKAg5YyF5ousZG9jdW1lbnQKICAgIGZ1bmN0aW9uIGdldEVsZW1lbnRzKCkgewogICAgICAgIHZhciBlbGVtZW50cyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCcqJykpOwogICAgICAgIGVsZW1lbnRzLnB1c2goZG9jdW1lbnQpOwogCiAgICAgICAgLy8g5b6q546v5omA5pyJIGZyYW1lIOeql+WPowogICAgICAgIHZhciBmcmFtZXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCJmcmFtZSIpCiAgICAgICAgaWYoZnJhbWVzKXsKICAgICAgICAgICAgaGFzRnJhbWUgPSBmcmFtZXM7CiAgICAg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7CiAgICAgICAgZm9yKGxldCBpPTA7aTxsaXN0Lmxlbmd0aDtpKyspewogICAgICAgICAgICBpZih+aG9zdG5hbWUuaW5kZXhPZihsaXN0W2ldKSl7CiAgICAgICAgICAgICAgICByZXR1cm4gaSsxOyAgLy/kuIfkuIDljLnphY3liLDnrKzkuIDkuKos6L+U5ZueMAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH0KIAogICAgLy8g6byg5qCH54K55Ye75ZCO5oyJ6ZKu5ZCOIOajgOafpeaYr+WQpuWcqOm7keWQjeWNlQogICAgZnVuY3Rpb24gYmxhY2tfY2hlY2soYm9vbCl7CiAgICAgICAgdmFyIGxpc3QgPSBHTV9nZXRWYWx1ZSgicndsX3VzZXJEYXRhIikuZGF0YQogICAgICAgIHZhciBjaGVjayA9IGNoZWNrX2JsYWNrX2xpc3QobGlzdCxob3N0bmFtZSk7CiAKICAgICAgICBpZiAoYm9vbCAmJiAhY2hlY2spIHsKICAgICAgICAgICAgbGlzdCA9IGxpc3QuY29uY2F0KGhvc3RuYW1lKTsKICAgICAgICAgICAgLy8gY29uc29sZS5sb2coIumAieS4rSDkuI3lnKjpu5HlkI3ljZUsIOWinuWKoCIsaG9zdG5hbWUsbGlzdCk7CiAgICAgICAgICAgIHJ3bF91c2VyRGF0YS53YWl0VXBsb2FkLnB1c2goaG9zdG5hbWUpOyAvL+WHhuWkh+S4iuS8oAogICAgICAgICAgICByd2xfdXNlckRhdGEuY3VycmVudFVSTCA9IHdpbmRvdy5sb2NhdGlvbi5ocmVmOwogICAgICAgICAgICAvLyBjb25zb2xlLmxvZygiYWZ0ZXI6ICIscndsX3VzZXJEYXRhLndhaXRVcGxvYWQpCiAKICAgICAgICAgICAgc2F2ZURhdGEobGlzdCk7CiAgICAgICAgICAgIGluaXQoKTsKIAogICAgICAgIH1lbHNlIGlmKCFib29sICYmIGNoZWNrKXsKICAgICAgICAgICAgbGlzdC5zcGxpY2UoY2hlY2stMSwxKTsKICAgICAgICAgICAgc2F2ZURhdGEobGlzdCk7CiAgICAgICAgICAgIC8vIOWIt+aWsOmhtemdogogICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAgICAgICAgICAgICAgICB3aW5kb3cubG9jYXRpb24ucmVsb2FkKHRydWUpOwogICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuWIt+aWsOmhtemdomxvYWRpbmciKTsKICAgICAgICAgICAgfSwzNTApOwogICAgICAgIH1lbHNlewogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgfQogICAgfQogCiAgICAvLyDkv53lrZjmnKzlnLDmlbDmja4s5bm25bCG5pWw5o2u5LiK5Lyg6Iez5pyN5Yqh5ZmoCiAgICBmdW5jdGlvbiBzYXZlRGF0YShsaXN0cyl7CiAgICAgICAgbGlzdHMgPSBsaXN0cy5maWx0ZXIoZnVuY3Rpb24oaXRlbSl7CiAgICAgICAgICAgIHJldHVybiBpdGVtLmxlbmd0aD4xOwogICAgICAgIH0pCiAKICAgICAgICAvLyDmm7TmlrDmlbDmja4KICAgICAgICByd2xfdXNlckRhdGEuZGF0YSA9IGxpc3RzLnNvcnQoKTsKIAogICAgICAgIC8vIOWwhuacrOWcsOm7keWQjeWNleS4iuS8oAogICAgICAgIC8vIGlmIChyd2xfdXNlckRhdGEud2FpdFVwbG9hZC5sZW5ndGggPiAwICYmIHJ3bF91c2VyRGF0YS5jb25uZWN0VG9UaGVTZXJ2ZXIpewogICAgICAgIC8vICAgICAvLyBjb25zb2xlLmxvZygicndsIDog5LiK5LygLi4uIixyd2xfdXNlckRhdGEud2FpdFVwbG9hZCk7CiAgICAgICAgLy8gICAgIC8vIGNvbnNvbGUubG9nKCJyd2wgOiDlvIDlp4vkuIrkvKAtLS0tLSIpOwogICAgICAgIC8vICAgICBHTV94bWxodHRwUmVxdWVzdCh7CiAgICAgICAgLy8gICAgICAgbWV0aG9kOiAiUE9TVCIsCiAgICAgICAgLy8gICAgICAgLy8gdXJsOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwL3Rvb2wvdGVzdGFqYXgvIiwKICAgICAgICAvLyAgICAgICB1cmw6ICJodHRwOi8vZWVtbS5tZS90b29sL3J3bF91cGxvYWQvIiwKICAgICAgICAvLyAgICAgICBkYXRhOiBKU09OLnN0cmluZ2lmeShyd2xfdXNlckRhdGEpLAogICAgICAgIC8vICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAvLyAgICAgICAgICJDb250ZW50LVR5cGUiOiAiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkIgogICAgICAgIC8vICAgICAgIH0sCiAgICAgICAgLy8gICAgICAgb25sb2FkOiBmdW5jdGlvbihyZXNwb25zZSkgewogICAgICAgIC8vICAgICAgICAgLy8gY29uc29sZS5sb2coInJ3bCA6IOS4iuS8oOaIkOWKny0tLS0iKTsKICAgICAgICAvLyAgICAgICB9CiAgICAgICAgLy8gICAgIH0pOwogICAgICAgIC8vICAgICByd2xfdXNlckRhdGEud2FpdFVwbG9hZCA9IFtdOwogICAgICAgIC8vIH0KIAogICAgICAgIEdNX3NldFZhbHVlKCJyd2xfdXNlckRhdGEiLHJ3bF91c2VyRGF0YSk7CiAgICAgICAgcmV0dXJuIHJ3bF91c2VyRGF0YTsKICAgIH0KIAogICAgLy8g5pWw57uE5Y676YeNCiAgICBmdW5jdGlvbiB1bmlxdWUoYXJyKSB7CiAgICAgIHZhciByZXQgPSBbXQogICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykgewogICAgICAgIHZhciBpdGVtID0gYXJyW2ldCiAgICAgICAgaWYgKHJldC5pbmRleE9mKGl0ZW0pID09PSAtMSkgewogICAgICAgICAgcmV0LnB1c2goaXRlbSkKICAgICAgICB9CiAgICAgIH0KICAgICAgcmV0dXJuIHJldDsKICAgIH0KIAogICAgLy8g5aSN5Yi25Yiw5Ymq6LS05p2/CiAgICBmdW5jdGlvbiBzZXRDbGlwYm9hcmQoKXsKICAgICAgICB2YXIgdGV4dF9vYmogPSB3aW5kb3cuZ2V0U2VsZWN0aW9uKCk7CiAgICAgICAgdmFyIHRleHQgPSB0ZXh0X29iai50b1N0cmluZygpOwogICAgICAgIEdNX3NldENsaXBib2FyZCh0ZXh0KTsKIAogICAgfQogCiAgICAvLyDlv6vmjbfplK4gRjHvvIhjdHJsK2Yx77yJIOWkjeWItiAKICAgIGZ1bmN0aW9uIGhvdGtleSgpIHsKICAgICAgICB2YXIgYSA9IHdpbmRvdy5ldmVudC5rZXlDb2RlOwogICAgICAgIC8vIGlmICgoYSA9PSAxMTIpICYmIChldmVudC5jdHJsS2V5KSkgewogICAgICAgIGlmIChhID09IDExMiAmJiB1c2VyU2V0dGluZy5zaG9ydGN1dCA9PSAxKSB7CiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CiAgICAgICAgICAgIHNldENsaXBib2FyZCgpOwogICAgICAgICAgICBldmVudC5rZXlDb2RlPTA7CiAgICAgICAgICAgIGV2ZW50LnJldHVyblZhbHVlPWZhbHNlOwogICAgICAgICAgICByZXR1cm4gZmFsc2U7IAogICAgICAgIH0gZWxzZSBpZiAoYSA9PSAxMTIgJiYgKGV2ZW50LmN0cmxLZXkpICYmIHVzZXJTZXR0aW5nLnNob3J0Y3V0ID09IDIpewogICAgICAgICAgICBzZXRDbGlwYm9hcmQoKTsKICAgICAgICB9IGVsc2UgaWYoKGEgPT0gNjcpICYmIChldmVudC5jdHJsS2V5KSAmJiB1c2VyU2V0dGluZy5zaG9ydGN1dCA9PSAzKXsKICAgICAgICAgICAgc2V0Q2xpcGJvYXJkKCk7CiAgICAgICAgfWVsc2UgewogICAgICAgICAgICBjb25zb2xlLmxvZygi5YWz6Zet5LqG5b+r5o236ZSuIik7CiAgICAgICAgfQogICAgfSAKICAgIGRvY3VtZW50Lm9ua2V5ZG93biA9IGhvdGtleTsgLy/lvZNvbmtleWRvd24g5LqL5Lu25Y+R55Sf5pe26LCD55SoaG90a2V55Ye95pWwICAKIAogICAgLy8g6YOo5YiG572R56uZ6YeH55So5LqG5YW25LuW55qE6Ziy5aSN5Yi25omL5q61CiAgICBmdW5jdGlvbiBjbGVhcigpewogICAgICAgIC8vIGNvbnNvbGUubG9nKCLov5vlhaVjbGVhciIsaG9zdG5hbWUscndsX3VzZXJEYXRhLnJ1bGVzKTsKICAgICAgICBzd2l0Y2ggKGhvc3RuYW1lKXsKICAgICAgICAgICAgY2FzZSAiY2h1YW5nc2hpLnFxLmNvbSI6IGNsZWFyX2NodWFuZ3NoaSgpO2JyZWFrOwogICAgICAgICAgICBjYXNlICJ2b3RldHcuY29tIjogY2xlYXJfdm90ZXR3KCk7YnJlYWs7CiAgICAgICAgICAgIGNhc2UgInd3dy5teWh0ZWJvb2tzLmNvbSI6IGNsZWFyX2NvdmVycygiLmZ1bGxpbWciKTticmVhazsKICAgICAgICAgICAgY2FzZSAid3d3LnozejQuY29tIjogY2xlYXJfY292ZXJzKCIubW92aWVkb3duYWRkaXYiKTsgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgImh1YXl1LmJhaWR1LmNvbSI6IGNsZWFyX2NvdmVycygiI2pxQ29udGV4dE1lbnUiKTsgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInd3dy5teWh0bG1lYm9vay5jb20iOiBjbGVhcl9jb3ZlcnMoImltZy5mdWxsaW1nIik7IGJyZWFrOwogICAgICAgICAgICBjYXNlICJ3d3cuc3p4eC5jb20uY24iOiBjbGVhcl9jb3ZlcnMoImltZyNhZENvdmVyIik7IGJyZWFrOwogICAgICAgICAgICBjYXNlICJ6aGlodS5jb20iOgogICAgICAgICAgICBjYXNlICJ3d3cuemhpaHUuY29tIjogcmV0dXJuIHJ3bF91c2VyRGF0YS5ydWxlcy5ydWxlX3poaWh1OyBicmVhazsKICAgICAgICAgICAgY2FzZSAidC5iaWxpYmlsaS5jb20iOiBjbGVhcl9saW5rX2JpbGliaWxpKCk7IGJyZWFrOwogICAgICAgICAgICBjYXNlICJ3d3cudXNsc29mdHdhcmUuY29tIjogY2xlYXJfY292ZXJzKCIucHJvdGVjdF9jb250ZW50cy1vdmVybGF5Iik7Y2xlYXJfY292ZXJzKCIucHJvdGVjdF9hbGVydCIpOyByZXR1cm4gcndsX3VzZXJEYXRhLnJ1bGVzLnJ1bGVfcGx1czsgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInd3dy5sb25nbWFib29rY24uY29tIjogY2xlYXJfY292ZXJzKCIuZnVsbGltZyIpOyByZXR1cm4gcndsX3VzZXJEYXRhLnJ1bGVzLnJ1bGVfcGx1czsgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgImJva2UxMTIuY29tIjogcmV0dXJuIHJ3bF91c2VyRGF0YS5ydWxlcy5ydWxlX3BsdXM7IGJyZWFrOwogICAgICAgICAgICBjYXNlICJ3d3cuc2hhbmdjLm5ldCI6IHJldHVybiByd2xfdXNlckRhdGEucnVsZXMucnVsZV9wbHVzOyBicmVhazsKICAgICAgICAgICAgLy8g5Y676Zmk5by556qXCiAgICAgICAgICAgIGNhc2UgInd3dy5kYW9kb2MuY29tIjogY2xlYXJfbWFya3MoIi5tYXJrcyIpOyBicmVhazsKICAgICAgICAgICAgY2FzZSAid3d3LndjcWp5dy5jb20iOiBjbGVhcl9tYXJrcygiLm1hcmtzIik7IGJyZWFrOwogICAgICAgICAgICBjYXNlICJ3d3cuamlhbmJpYW9rdS5jb20iOiBjbGVhcl9tYXJrcygiLmxheXVpLWxheWVyLXNoYWRlIik7IGJyZWFrOwogICAgICAgIH0KICAgICAgICByZXR1cm4gcndsX3VzZXJEYXRhLnJ1bGVzLnJ1bGVfZGVmOwogICAgfQogICAgLy8g5Y676Zmk6KaG55uW5bGCCiAgICBmdW5jdGlvbiBjbGVhcl9jb3ZlcnMoZWxlKXsKICAgICAgICB2YXIgb2RpdiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoZWxlKTsKICAgICAgICBpZihvZGl2KXsKICAgICAgICAgICA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ICAgICAgICAgICAgJHtub2RlfSB7CiAgICAgICAgICAgICAgICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7CiAgICAgICAgICAgIH0KICAgICAgICBgKQogICAgfQogCiAgICAvLyDliJvkuJbkuK3mlofnvZEKICAgIGZ1bmN0aW9uIGNsZWFyX2NodWFuZ3NoaSgpewogICAgICAgIGNvbnNvbGUubG9nKCLliJvkuJbkuK3mlofnvZEg5byA5aeL5omn6KGMIik7CgogICAgICAgIC8vIEpTIOaxieWtl+S4jlVuaWNvZGXnoIHnmoTnm7jkupLovazljJYKICAgICAgICAgICAgLy8gaHR0cHM6Ly93d3cuY25ibG9ncy5jb20vd3dsaG9tZS9wLzU2NTA3NDQuaHRtbAogICAgICAgIGZ1bmN0aW9uIHRvdW5pY29kZShkYXRhKQogICAgICAgIHsKICAgICAgICAgICAgaWYoZGF0YSA9PSAnJykgcmV0dXJuICfor7fovpPlhaXmsYnlrZcnOwogICAgICAgICAgICB2YXIgc3RyID0nJzsgCiAgICAgICAgICAgIGZvcih2YXIgaT0wO2k8ZGF0YS5sZW5ndGg7aSsrKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBzdHIrPSJcXHUiK3BhcnNlSW50KGRhdGFbaV0uY2hhckNvZGVBdCgwKSwxMCkudG9TdHJpbmcoMTYpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiBzdHI7CiAgICAgICAgfQogICAgICAgIGZ1bmN0aW9uIHRvaGFuemkoZGF0YSkKICAgICAgICB7CiAgICAgICAgICAgIGlmKGRhdGEgPT0gJycpIHJldHVybiAn6K+36L6T5YWl5Y2B5YWt6L+b5Yi2dW5pY29kZSc7CiAgICAgICAgICAgIGRhdGEgPSBkYXRhLnNwbGl0KCJcXHUiKTsKICAgICAgICAgICAgdmFyIHN0ciA9Jyc7CiAgICAgICAgICAgIGZvcih2YXIgaT0wO2k8ZGF0YS5sZW5ndGg7aSsrKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBz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GZ1bmN0aW9uKCQwKcKge8KgcmV0dXJuwqByZXBsYWNlbWVudHNbJDBdO8KgfSk7CiAgICAgICAgICAgIAogICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhzdHJVbmljb2RlKQogICAgICAgICAgICBzdHJVbmljb2RlID0gc3RyVW5pY29kZS5yZXBsYWNlKCJ1MCIsIiIpOwogICAgICAgICAgICBzdHIgPSB0b2hhbnppKHN0clVuaWNvZGUpOwogICAgCiAgICAgICAgICAgIGJvb2tyZWFkZXJjb250ZW50LmlubmVyVGV4dCA9IHN0cjsKICAgICAgICB9CgoKICAgIH0KIAogICAgLy8gMy54Lngg6L+H5rihIDQueC54IOeJiOacrAogICAgZnVuY3Rpb24gdmVyc2lvbl91cF8zX3RvXzQoKXsKICAgICAgICB2YXIgb2xkX3ZlcnNpb24gPSBHTV9nZXRWYWx1ZSgiYmxhY2tfbGlzdCIpOwogICAgICAgIGlmKCFvbGRfdmVyc2lvbil7cmV0dXJufTsKICAgICAgICByd2xfdXNlckRhdGEuZGF0YSA9IHVuaXF1ZShyd2xfdXNlckRhdGEuZGF0YS5jb25jYXQob2xkX3ZlcnNpb24uZGF0YSkpOwogICAgICAgIEdNX3NldFZhbHVlKCJyd2xfdXNlckRhdGEiLHJ3bF91c2VyRGF0YSk7CiAKICAgICAgICBHTV9kZWxldGVWYWx1ZSgiYmxhY2tfbGlzdCIpOwogICAgICAgIEdNX2RlbGV0ZVZhbHVlKCJyd2xfdXNlcmRhdGEiKTsKICAgIH0KfSkoKTsg
Add Comment
Please, Sign In to add comment