Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@测试福利@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5rWL6K+V56aP5YipIiwiYXV0aG9yIjoi6aG6IiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjbm9SZWZyZXNoIyIsInZlcnNpb24iOjIwMjQwNDI1LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgZCA9IFtdO1xuaWYgKE1ZX1BBR0UgPT0gMSkge1xuICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcImhpa2VyOi8vcGFnZS/pppbpobXlm7rlrppKU09OXCIpKS5ydWxlKVxuICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcImhpa2VyOi8vcGFnZS/pppbpobXliJfooahcIikpLnJ1bGUpXG4gICAgZCA9IGQuY29uY2F0KEQpXG59XG5zZXRSZXN1bHQoZCk7Iiwic2VhcmNoX3VybCI6IiIsImdyb3VwIjoi4pGg5o6o6I2QIiwic2VhcmNoRmluZCI6IiIsImRldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJkZXRhaWxfZmluZF9ydWxlIjoiIiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6ImluZGV4T2YiLCJ1YSI6Im1vYmlsZSIsInByZVJ1bGUiOiIiLCJwYWdlcyI6Ilt7XCJjb2xfdHlwZVwiOlwiaWNvbl80XCIsXCJuYW1lXCI6XCLwn5Si6aaW6aG15YiX6KGoXCIsXCJwYXRoXCI6XCLpppbpobXliJfooahcIixcInJ1bGVcIjpcInZhciB0aXBzX3RpdGxlID0gZ2V0TXlWYXIoXFxcIuS4u+agh+mimFxcXCIsICfliIbnsbvkvZzlk4HlupMnKVxcbnZhciBEID0gW107XFxuLy/liKTmlq1cXG5cXG5pZiAodGlwc190aXRsZS5pbmRleE9mKFxcXCLkvZzlk4FcXFwiKSA+IC0xKSB7XFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgWFBDLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICB2YXIgdm0gPSBYUENbaV07XFxuICAgICAgICB2YXIgYXBwX2xpbmtzID0gdm0udXJsO1xcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdm0uY2F0ZWdvcnlfbmFtZSxcXG4gICAgICAgICAgICBpbWc6IHZtLmNvdmVyLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnICsgYXBwX2xpbmtzKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS9hcHBf5LqM57qn5YiX6KGoXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfM19jZW50ZXInLFxcbiAgICAgICAgICAgIGRlc2M6ICcwJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjbHM6ICfpppbpobUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBwdXRNeVZhcign6aaW6aG1X+WIhuexuycsIEpTT04uc3RyaW5naWZ5KEQpKVxcbn0gZWxzZSB7XFxuICAgIHZhciBhcHB1cmw7XFxuICAgIGlmICh0aXBzX3RpdGxlID09ICfmjqjojZAnKSB7XFxuICAgICAgICAvL2FwcHVybCA9ICdodHRwczovL2Fw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ICAgfSBlbHNlIGlmICh0aXBzX3RpdGxlID09ICfmnKzlnLDlkajovrknKSB7XFxuICAgICAgICB2bWpzb24gPSB2bWpzb24uY2hpbGRyZW47XFxuICAgIH1cXG4gICAgRC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZScsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiAn6aaW6aG1X+epuuagvCcsXFxuICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgfVxcbiAgICB9KVxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHZtanNvbi5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgaWYgKFsn5o6o6I2QJywgJ+eyvumAiSddLmluY2x1ZGVzKHRpcHNfdGl0bGUpKSB7XFxuICAgICAgICAgICAgdmFyIHZtID0gdm1qc29uW2ldLmRhdGEucmVzb3VyY2U7XFxuICAgICAgICB9IGVsc2UgaWYgKFsn5pys5Zyw5ZGo6L65J10uaW5jbHVkZXModGlwc190aXRsZSkpIHtcXG4gICAgICAgICAgICB2YXIgdm0gPSB2bWpzb25baV0uY2hpbGRyZW5bMF0ubW9kZWwucmVzb3VyY2U7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgUExBWV9MSU5LUyA9IHZtLnVybC5yZXBsYWNlKC9uZXdzdHVkaW9zLywgJ2h0dHBzJyk7XFxuICAgICAgICB2YXIgVVNFUl9IT01FID0gJ2h0dHBzOi8vYXBwLnhpbnBpYW5jaGFuZy5jb20vdXNlci8nICsgdm0udXNlcl9pZDtcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHZtLmF1dGhvci51c2VyaW5mby51c2VybmFtZSxcXG4gICAgICAgICAgICBwaWNfdXJsOiB2bS5hdXRob3IudXNlcmluZm8uYXZhdGFyLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnICsgVVNFUl9IT01FKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS/liJvkvZzkurrpppbpobVcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogJ+mmlumhtSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdm0udGl0bGUsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycgKyBQTEFZX0xJTktTKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCfor6bnu4bnsbvliKsnLCAn566A5LuLJyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS/op4bpopHor6bmg4XpobVcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogJ+mmlumhtSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdm0udGl0bGUsXFxuICAgICAgICAgICAgaW1nOiB2bS5jb3ZlcixcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJyArIFBMQVlfTElOS1MpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL2FwcOaSreaUvumTvuaOpVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiB2bS50aXRsZSxcXG4gICAgICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB2bS5jb3VudC5jb3VudF9jb2xsZWN0LFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvaWNvbi9iYnPmlLbol48uc3ZnJyxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB2bS5jb3VudC5jb3VudF9jb21tZW50LFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvaWNvbi9iYnPlm57lpI0uc3ZnJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJyArIFBMQVlfTElOS1MpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+ivpue7huexu+WIqycsICfor4TorronKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB2bS5jb3VudC5jb3VudF9saWtlLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvaWNvbi9iYnPngrnotZ4uc3ZnJyxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgaWYgKHRpcHNfdGl0bGUgPT0gJ+aOqOiNkCcpIHB1dE15VmFyKCfpppbpobVf5o6o6I2QJywgSlNPTi5zdHJpbmdpZnkoRCkpO1xcbiAgICBpZiAodGlwc190aXRsZSA9PSAn57K+6YCJJykgcHV0TXlWYXIoJ+mmlumhtV/nsr7pgIknLCBKU09OLnN0cmluZ2lmeShEKSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwiY2FyZF9waWNfMVwiLFwibmFtZVwiOlwiYXBw5YiG57G75LiO5pCc57Si5YiX6KGoXCIsXCJwYXRoXCI6XCJhcHDliIbnsbvkuI7mkJzntKLliJfooahcIixcInJ1bGVcIjpcInZhciBEID0gW107XFxyXFxubGV0IEREID0gYXBwX2xpc3RzO1xcclxcbmlmIChERC5sZW5ndGggPiAwKSB7XFxyXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgREQubGVuZ3RoOyBpKyspIHtcXHJcXG4gICAgICAgIHZhciBQTEFZX0xJTktTID0gRERbaV0udXJsICsgaSArIFxcXCIuanNvblxcXCI7XFxyXFxuICAgICAgICB2YXIgdXJsID0gRERbaV0udXJsO1xcclxcbiAgICAgICAgLy9sb2coUExBWV9MSU5LUylcXHJcXG4gICAgICAgIGlmICh1cmwuaW5kZXhPZihcXFwiZ2l0Y29kZS5uZXRcXFwiKSAhPT0gLTEpIHtcXHJcXG4gICAgICAgICAgICBELnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICBpbWc6IEREW2ldLmltZyxcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IEREW2ldLnRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICBkZXNjOiBERFtpXS5kZXNjLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJyArIFBMQVlfTElOS1MpLmxhenlSdWxlKCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfor6bnu4bnsbvliKsnLCAn566A5LuLJyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv6KeG6aKR6K+m5oOF6aG1XFxcIikpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICB9KSxcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IEREW2ldLmNvbF90eXBlLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAn5pCc57SiJ1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgRC5wdXNoKHtcXHJ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lKVxcXCIsXFxuICAgICAgICBkZXNjOiAn5pCc57Si5L2c5ZOB44CB5Yib5L2c5Lq6JyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiB0aXBzX3RpdGxlLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0VmFyKCfmkJzlhbPplK7lrZcnLGlucHV0KVxcXCJcXG4gICAgICAgIH0sXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIHRpdGxlOiAn5pCc57SiJyxcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcbiAgICB9KVxcblxcbiAgICBpZiAoIXRpcHNfdGl0bGUpIHtcXG4gICAgICAgIGlmIChyZXF1ZXN0KCdoaWtlcjovL2ZpbGVzL2NhY2hlL+aWsOeJh+WcuuWOhuWPsuaQnOe0oi5qc29uJykpIHtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDEwOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9Z3JheT4nICsgJ/Cfl5HvuI8g5Y6G5Y+y5pCc57SiJyArICc8L2ZvbnQ+PC9iPicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS/mlrDniYflnLrljoblj7LmkJzntKIuanNvbicsICcnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHZhciBsb2NhbERhdGEgPSByZXF1ZXN0KCdoaWtlcjovL2ZpbGVzL2NhY2hlL+aWsOeJh+WcuuWOhuWPsuaQnOe0oi5qc29uJyk7XFxuICAgICAgICAgICAgaWYgKCFsb2NhbERhdGEpIGxvY2FsRGF0YSA9IFxcXCJbXVxcXCI7XFxuICAgICAgICAgICAgdmFyIGxpc2hpID0gSlNPTi5wYXJzZShsb2NhbERhdGEpLnNsaWNlKC0yOCk7XFxuICAgICAgICAgICAgdmFyIEhpc3RvcnkgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gbGlzaGkubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcXG4gICAgICAgICAgICAgICAgdmFyIGNjbGlzaGkgPSBsaXNoaVtpXTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBjY2xpc2hpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGNjbGlzaGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign5pCc5YWz6ZSu5a2XJywgY2NsaXNoaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgY2NsaXNoaSksXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMjA7IGkrKykge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj1ncmF5PicgKyAn8J+UpSDng63pl6jlhoXlrrknICsgJzwvZm9udD48L2I+JyxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgUm11cmwgPSAnaHR0cHM6Ly9hcHAueGlucGlhbmNoYW5nLmNvbS92Mi9zZWFyY2gvaG90Q29udGVudHMnO1xcbiAgICAgICAgUm1qc29uID0gSlNPTi5wYXJzZShyZXF1ZXN0KFJtdXJsKSkuZGF0YS5saXN0O1xcbiAgICAgICAgZm9yIChsZXQgaSBpbiBSbWpzb24pIHtcXG4gICAgICAgICAgICB2YXIgdGlwcyA9IChwYXJzZUludChpKSArIDEpICsgJyAnICsgUm1qc29uW2ldLnRpdGxlO1xcbiAgICAgICAgICAgIHZhciBQTEFZX0xJTktTID0gUm1qc29uW2ldLmxpbmsucmVwbGFjZSgvbmV3c3R1ZGlvcy8sICdodHRwcycpO1xcbiAgICAgICAgICAgIHZhciB1cmwgPSBSbWpzb25baV0ubGluaztcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlwcyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJytQTEFZX0xJTktTKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign6K+m57uG57G75YirJywgJ+eugOS7iycpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj1ncmF5PicgKyAn8J+UpSDng63pl6jmkJzntKInICsgJzwvZm9udD48L2I+JyxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICB2YXIgdXJsID0gJ2h0dHBzOi8vYXBwLnhpbnBpYW5jaGFuZy5jb20vc2VhcmNoX3JlY29tbWVuZF9rd3MnO1xcbiAgICAgICAgdmFyIEhvdGpzb24gPSBKU09OLnBhcnNlKGZldGNoKHVybCkpLmRhdGEubGlzdDtcXG4gICAgICAgIGZvciAobGV0IGkgaW4gSG90anNvbikge1xcbiAgICAgICAgICAgIHZhciB0aXBzID0gSG90anNvbltpXS5uYW1lO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXBzLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpcHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfmkJzlhbPplK7lrZcnLCB0aXBzKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCB0aXBzKSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICB2YXIgQ29sb3IgPSBcXFwiI0ZBNzI5OFxcXCI7XFxuXFxuICAgIGZ1bmN0aW9uIGdldEhlYWQodGl0bGVzKSB7XFxuICAgICAgICByZXR1cm4gJ+KAmOKAmOKAmeKAmTxzdHJvbmc+PGZvbnQgY29sb3I9XFxcIicgKyBDb2xvciArICdcXFwiPicgKyB0aXRsZXMgKyAnPC9mcm9udD48L3N0cm9uZz4nO1xcbiAgICB9XFxuICAgIGlmICh0aXBzX3RpdGxlKSB7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDU7IGkrKykge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpcHNfc2VsZWN0ID09ICdhcnRpY2xlJyA/IGdldEhlYWQoJ+S9nOWTgScpIDogJ+S9nOWTgScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoQ29sb3IsIFBBR0UpID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+mhteeggScsICcxJyk7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihcXFwi5L2cL+WImy/mlodcXFwiKSAhPSAnYXJ0aWNsZScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfkvZwv5YibL+aWhycsICdhcnRpY2xlJyk7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+aQnOe0oicpXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKCdlbmQnKVxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5pCc57SiX+S9nOWTgScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxzdHJvbmc+PGZvbnQgY29sb3I9XFxcIicgKyBDb2xvciArICdcXFwiPicgKyAn5L2c5ZOBJyArICc8L2Zyb250Pjwvc3Ryb25nPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfmkJzntKJf5Yib5L2c5Lq6Jywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5Yib5L2c5Lq6J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHZhciBBUFBfVVJMID0gXFxcImh0dHBzOi8vYXBwLnhpbnBpYW5jaGFuZy5jb20vdjIvc2VhcmNoP3R5cGU9YXJ0aWNsZVxcXCIgKyBcXFwiJmt3PVxcXCIgKyBnZXRNeVZhcihcXFwi5pCc5YWz6ZSu5a2XXFxcIikgKyAnJnBhZ2U9JyArIFBBR0U7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgYXBwX2xpc3RzID0gSlNPTi5wYXJzZShyZXF1ZXN0KEFQUF9VUkwpKS5kYXRhLmxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS9hcHDliIbnsbvkuI7mkJzntKLliJfooahcXFwiKSkucnVsZSlcXG4gICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcign5pCc57SiX+WIm+S9nOS6uicsIEQpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgIH0sIENvbG9yLCBQQUdFKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogJ+aQnOe0ol/kvZzlk4EnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpcHNfc2VsZWN0ID09ICdjcmVhdG9yJyA/IGdldEhlYWQoJ+WIm+S9nOS6uicpIDogJ+WIm+S9nOS6uicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoQ29sb3IsIFBBR0UpID0+IHtcXG4gICAgICAgICAgICAgICAgLy9wdXRNeVZhcign5L2cL+WImy/mlocnLCAnY3JlYXRvcicpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcign6aG156CBJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKFxcXCLkvZwv5YibL+aWh1xcXCIpICE9ICdjcmVhdG9yJykge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+S9nC/liJsv5paHJywgJ2NyZWF0b3InKTtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygn5pCc57SiJylcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oJ2VuZCcpXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfmkJzntKJf5Yib5L2c5Lq6Jywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiJyArIENvbG9yICsgJ1xcXCI+JyArICfliJvkvZzkuronICsgJzwvZnJvbnQ+PC9zdHJvbmc+J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ+aQnOe0ol/kvZzlk4EnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfkvZzlk4EnXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2UvYXBw5Yib5L2c5Lq65pCc57Si5YiX6KGoXFxcIikpLnJ1bGUpXFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ+aQnOe0ol/liJvkvZzkuronLCBEKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgIC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b2RlLnNwbGl0KFxcXCJcXFxcblxcXCIpO1xcbiAgICAgICAgbGV0IHIgPSBbXVxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICB2YXIgbGluZSA9IEpTT04ucGFyc2UoYXJyW2ldKVxcbiAgICAgICAgICAgICAgICBpZiAobGluZS5jb250ZW50KSB7XFxuICAgICAgICAgICAgICAgICAgICByLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IGxpbmUuY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lOiBsaW5lLm9mZnNldFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICB9XFxuICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvZGFubXUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHIpKVxcbiAgICAgICAgLy8g57uT5p2f5by55bmV6I635Y+WXFxuICAgICAgICBsZXQgdXJscyA9IFtdO1xcbiAgICAgICAgbGV0IG5hbWVzID0gW107XFxuICAgICAgICBsZXQgaGVhZCA9IFtdO1xcbiAgICAgICAgZm9yIChsZXQgaSBpbiBwbGF5X3VybHMpIHtcXG4gICAgICAgICAgICB1cmxzLnB1c2gocGxheV91cmxzW2ldLnVybClcXG4gICAgICAgICAgICBuYW1lcy5wdXNoKHBsYXlfdXJsc1tpXS5wcm9maWxlKVxcbiAgICAgICAgICAgIGhlYWQucHVzaCh7J1VzZXItQWdlbnQnOiAnRXhvUGxheWVyTGliJ30pXFxuICAgICAgICB9XFxuICAgICAgICBsZXQgYWxsX3VybCA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICB1cmxzOiB1cmxzLFxcbiAgICAgICAgICAgIG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aV0udXJsLnJlcGxhY2UoL25ld3N0dWRpb3MvLCAnaHR0cHMnKVxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7XFxuICAgICAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICfmkJzntKInXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIHVybCA9ICQoJyNub0xvYWRpbmcjJyArIFVTRVJfSE9NRSkubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS/liJvkvZzkurrpppbpobVcXFwiKSkucnVsZSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgaW1nOiBhcHBfbGlzdHNbaV0uYXZhdGFyICsgJ0BSZWZlcmVyPScgKyBhcHBfbGlzdHNbaV0uYXZhdGFyLFxcbiAgICAgICAgICAgIHRpdGxlOiBhcHBfbGlzdHNbaV0udXNlcm5hbWUsXFxuICAgICAgICAgICAgZGVzYzogJycsXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogJ+aQnOe0oidcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcblxcbiAgICAgICAgdmFyIG9jY3VwYXRpb24gPSBhcHBfbGlzdHNbaV0ub2NjdXBhdGlvbjtcXG4gICAgICAgIHZhciBmb2xsb3dlciA9ICfnsonkuJ0gJyArIGFwcF9saXN0c1tpXS5jb3VudC5jb3VudF9mb2xsb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udF9mb2xsb3dlciA9IFVTRVJfSlNPTi5jb3VudC5jb3VudF9mb2xsb3dlcjtcXG4gICAgICAgIGlmIChjb3VudF9mb2xsb3dlciA+IDEwMDApIGNvdW50X2ZvbGxvd2VyID0gKGNvdW50X2ZvbGxvd2VyIC8gMTAwMCkudG9GaXhlZCgxKSArICdrJztcXG4gICAgICAgIGlmIChQQUdFID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJzAnLFxcbiAgICAgICAgICAgICAgICBpbWc6IGFwcF9iYWNrZ3JvdW5kLFxcbiAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB1c2VyX25hbWUgKyAnXFxcXHRcXFxcdFxcXFx0XFxcXHQnICsgXFxcIjxmb250IGNvbG9yPWdyZXk+XFxcIiArICfkurrmsJQgJyArIGNvdW50X3BvcHVsYXJpdHkgKyAnIMK3ICcgKyAn57KJ5LidICcgKyBjb3VudF9mb2xsb3dlciArIFxcXCI8L2ZvbnQ+XFxcIixcXG4gICAgICAgICAgICAgICAgaW1nOiB1c2VyX2F2YXRhcixcXG4gICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJyxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDU7IGkrKykge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHZhciBDb2xvciA9IFxcXCIjRkE3Mjk4XFxcIjtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXRIZWFkKHRpdGxlcykge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+KAmOKAmOKAmeKAmTxzdHJvbmc+PGZvbnQgY29sb3I9XFxcIicgKyBDb2xvciArICdcXFwiPicgKyB0aXRsZXMgKyAnPC9mcm9udD48L3N0cm9uZz4nO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMycsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXBzX3NlbGVjdCA9PSAnbmV3JyA/IGdldEhlYWQoXFxcIuacgOaWsFxcXCIpIDogJ+acgOaWsCcsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnICsgaW5wdXQpLmxhenlSdWxlKChQQUdFKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ+S4u+mhteexu+WIqycpICE9ICduZXcnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+S4u+mhteexu+WIqycsICduZXcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfkuLvpobXng63pl6gnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi54Ot6ZeoXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5Li76aG15LiT6L6RJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS4k+i+kVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfkuLvpobXmnIDmlrAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiI0ZBNzI5OFxcXCI+5pyA5pawPC9mcm9udD48L3N0cm9uZz4nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2hvd0xvYWRpbmcoJ0xvYWRpbmcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ2VuZCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv5Yib5L2c5Lq65L2c5ZOB5YiX6KGoXFxcIikpLnJ1bGUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKCfkuLvpobUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vYWRkSXRlbUFmdGVyKCfkuLvpobXkuJPovpEnLCBEKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ+S4u+mhteS4k+i+kScsIEpTT04ucGFyc2UoZ2V0TXlWYXIoJ+S9nOWTgW5ldycgKyBpbnB1dCkpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIFBBR0UpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICfkuLvpobXmnIDmlrAnXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMycsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXBzX3NlbGVjdCA9PSAndmlldycgPyBnZXRIZWFkKFxcXCLng63pl6hcXFwiKSA6ICfng63pl6gnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJyArIGlucHV0KS5sYXp5UnVsZSgoUEFHRSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCfkuLvpobXnsbvliKsnKSAhPSAndmlldycpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign5Li76aG157G75YirJywgJ3ZpZXcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfkuLvpobXmnIDmlrAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5pyA5pawXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ+S4u+mhteS4k+i+kScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkuJPovpFcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5Li76aG154Ot6ZeoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxzdHJvbmc+PGZvbnQgY29sb3I9XFxcIiNGQTcyOThcXFwiPueDremXqDwvZnJvbnQ+PC9zdHJvbmc+J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygnZW5kJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFnZXRNeVZhcign5L2c5ZOBdmlldycgKyBpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvd0xvYWRpbmcoJ0xvYWRpbmcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv5Yib5L2c5Lq65L2c5ZOB5YiX6KGoXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+S4u+mhtScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ+S4u+mhteS4k+i+kScsIEQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygn5Li76aG1Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcign5Li76aG15LiT6L6RJywgSlNPTi5wYXJzZShnZXRNeVZhcign5L2c5ZOBdmlldycgKyBpbnB1dCkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBQQUdFKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAn5Li76aG154Ot6ZeoJ1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzMnLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlwc19zZWxlY3QgPT0gJ2NvbGxlY3Rpb25zJyA/IGdldEhlYWQoXFxcIuS4k+i+kVxcXCIpIDogJ+S4k+i+kScsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnICsgaW5wdXQpLmxhenlSdWxlKChQQUdFKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ+S4u+mhteexu+WIqycpICE9ICdjb2xsZWN0aW9ucycpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign5Li76aG157G75YirJywgJ2NvbGxlY3Rpb25zJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5Li76aG154Ot6ZeoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIueDremXqFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfkuLvpobXmnIDmlrAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5pyA5pawXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ+S4u+mhteS4k+i+kScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPVxcXCIjRkE3Mjk4XFxcIj7kuJPovpE8L2Zyb250Pjwvc3Ryb25nPidcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ2VuZCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZ2V0TXlWYXIoJ+S4k+i+kScgKyBpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvd0xvYWRpbmcoJ0xvYWRpbmcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv5Yib5L2c5Lq65LiT6L6R5YiX6KGoXFxcIikpLnJ1bGUpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygn5Li76aG1Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcign5Li76aG15LiT6L6RJywgRCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKCfkuLvpobUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCfkuLvpobXkuJPovpEnLCBKU09OLnBhcnNlKGdldE15VmFyKCfkuJPovpEnICsgaW5wdXQpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgUEFHRSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogJ+S4u+mhteS4k+i+kSdcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncGljXzFfZnVsbCcsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnMCcsXFxuICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzO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1nP3J1bGU9XFxcIiArIE1ZX1RJVExFKS5jb21wcmVzcygpKTtcXG4gICAgICAgIHZhciB0aXRsZSA9IGFwcF9jYWNoZS50aXRsZTtcXG4gICAgICAgIHZhciBwdWJsaXNoX3RpbWUgPSBhcHBfY2FjaGUucHVibGlzaF90aW1lO1xcbiAgICAgICAgLy8g5pe26Ze05oiz6L2s5bm05pyI5pelXFxuICAgICAgICBwdWJsaXNoX3RpbWUgPSB0aW1lc3RhbXBUb1RpbWUodG0gPSBwdWJsaXNoX3RpbWUsIHRzID0gMClcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX2xlZnRfcGljJyxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnSA8c21hbGw+PGZvbnQgY29sb3I9J2dyZXknPlxcXCIgKyBwdWJsaXNoX3RpbWUgKyAnXFxcXG4nICsgbGlrZSArICcg5Zac5qyiJyArICcgwrcgJyArIHZpZXcgKyAnIOingueciycgKyBcXFwiPC9mb250PiA8L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgdXJsOiAkKFBMQVlfTElOS1MpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+ivpue7huexu+WIqycsICfnroDku4snKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjbHM6ICfkuLvpobUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59IGVsc2Uge1xcbiAgICBldmFsKEpTT04ucGFyc2UoZmV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AgICAgICAgdmFyIHB1dF90aXRsZSA9IFxcXCLigJzigJzigJ3igJ0gPHNtYWxsPjxmb250IGNvbG9yPSdncmV5Jz5cXFwiICsgJ+S9nOWTgSAnICsgYXJ0aWNsZSArICcgwrcgJyArICfmtY/op4ggJyArIHZpZXcgKyAnIMK3ICcgKyAn6LWeICcgKyBsaWtlICsgXFxcIjwvZm9udD4gPC9zbWFsbD5cXFwiO1xcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2NhcmQnLFxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICBpbWc6IGJnX2ltZyArICdAUmVmZXJlcj0nICsgYmdfaW1nLFxcbiAgICAgICAgICAgIGRlc2M6ICfkvZzlk4EgJyArIGFydGljbGUgKyAnICDCtyAgJyArICfmtY/op4ggJyArIHZpZXcgKyAnICDCtyAgJyArICfotZ4gJyArIGxpa2UsXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I2Z5cGFnZSNpbW1lcnNpdmVUaGVtZSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMjYXV0b0NhY2hlIyNub1JlZnJlc2gjJykucnVsZSgoYmdfaW1nLCBwdXRfdGl0bGUsIGRlc2MsIEFsYnVtX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgUEFHRSA9IE1ZX1BBR0U7XFxuICAgICAgICAgICAgICAgIHZhciBkID0gW107XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBBbGJ1bV91cmwgKyBQQUdFO1xcbiAgICAgICAgICAgICAgICB2YXIgQVBQX0pTT04gPSBKU09OLnBhcnNlKHJlcXVlc3QodXJsKSkuZGF0YS5saXN0O1xcbiAgICAgICAgICAgICAgICBpZiAoUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncGljXzFfZnVsbCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBiZ19pbWcsXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwdXRfdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIjxzbWFsbD48Zm9udCBjb2xvcj0nZ3JleSc+XFxcIiArIGRlc2MgKyBcXFwiPC9mb250PiA8L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoQVBQX0pTT04ubGVuZ3RoICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpIGluIEFQUF9KU09OKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFBMQVlfTElOS1MgPSBBUFBfSlNPTltpXS51cmwucmVwbGFjZSgvbmV3c3R1ZGlvcy8sICdodHRwcycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IEFQUF9KU09OW2ldLnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbWcgPSBBUFBfSlNPTltpXS5jb3ZlcjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2F0ID0gQVBQX0pTT05baV0uY2F0ZWdvcmllcztcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2F0X2FsbCA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBjYXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNhdF8xID0gY2F0W2ldLmNhdGVnb3J5X25hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjYXRfMiA9IGNhdFtpXS5zdWIuY2F0ZWdvcnlfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0X2FsbC5wdXNoKFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0XzEgKyAnLScgKyBjYXRfMiArICcgXFx0J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdF9hbGwgPSBjYXRfYWxsLmpvaW4oXFxcIlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNhdF90aXRsZSA9ICfigJzigJzigJ3igJ08c21hbGw+PGZvbnQgY29sb3I9Z3JleT4nICsgY2F0X2FsbCArICc8L2ZvbnQ+PC9zbWFsbD4nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV9sZWZ0X3BpYycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogY2F0X3RpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFBMQVlfTElOS1MpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfor6bnu4bnsbvliKsnLCAn566A5LuLJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv6KeG6aKR6K+m5oOF6aG1XFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgfSwgYmdfaW1nLCBwdXRfdGl0bGUsIGRlc2MsIEFsYnVtX3VybCksXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn5Li76aG1JyxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbn0gZWxzZSBpZiAodG90YWwhPSAnMCcpe1xcbiAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS9FTkRcXFwiKSkucnVsZSkoRClcXG59XFxuaWYoUEFHRSA9PSAxKSBwdXRNeVZhcign5LiT6L6RJytpbnB1dCwgSlNPTi5zdHJpbmdpZnkoRCkpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiRU5EXCIsXCJwYXRoXCI6XCJFTkRcIixcInJ1bGVcIjpcImZ1bmN0aW9uKGFycil7XFxuYXJyLnB1c2go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YnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgodGl0bGUsIHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2NhdGVfMicsIHRpdGxlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2N1cnJlbnRfdXJsJywgdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdGl0bGUsIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICB9KVxcblxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICB2YXIgYXBwX2xpc3RzID0gQXBwX0pzb24ubGlzdDtcXG4gICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2UvYXBw5YiG57G75LiO5pCc57Si5YiX6KGoXFxcIikpLnJ1bGUpXFxuICAgIGQgPSBkLmNvbmNhdChEKVxcbiAgICBzZXRSZXN1bHQoZClcXG59LCBpbnB1dClcXG5cIn0se1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwi6KeG6aKR6K+m5oOF6aG1XCIsXCJwYXRoXCI6XCLop4bpopHor6bmg4XpobVcIixcInJ1bGVcIjpcIiQoJ2hpa2VyOi8vZW1wdHkjZnlwYWdlIyNnYW1lVGhlbWUjI25vSGlzdG9yeSMjbm9SZWZyZXNoIycpLnJ1bGUoKGlucHV0KSA9PiB7XFxuICAgIHZhciBkID0gW107XFxuICAgIHZhciBEQVRBX0pTT05TID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KSk7XFxuICAgIHZhciBEQVRBX0pTT04gPSBEQVRBX0pTT05TLmRhdGE7XFxuICAgIC8vbG9nKERBVEFfSlNPTilcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAncGljXzFfZnVsbCcsXFxuICAgICAgICB0aXRsZTogREFUQV9KU09OLnRpdGxlLFxcbiAgICAgICAgaW1nOiBEQVRBX0pTT04uY292ZXIsXFxuICAgICAgICB1cmw6IERBVEFfSlNPTi51cmwsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBcXFwiMVxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMicsXFxuICAgICAgICB0aXRsZTogJ+S8mOaDoOa4oOmBkycsXFxuICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogJ+S8mOaDoOa4oOmBkydcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMicsXFxuICAgICAgICB0aXRsZTogJ+acgOaWsOa0u+WKqCcsXFxuICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogJ+acgOaWsOa0u+WKqCcgXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS/op4bpopHkv6Hmga9cXFwiKSkucnVsZSlcXG4gICAgZCA9IGQuY29uY2F0KEQpXFxuICAgIHNldFJlc3VsdChkKTtcXG59LCBpbnB1dClcXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuinhumikeS/oeaBr1wiLFwicGF0aFwiOlwi6KeG6aKR5L+h5oGvXCIsXCJydWxlXCI6XCJ2YXIgRCA9IFtdXFxuXFxubGV0IHh4ID0gREFUQV9KU09OUy5saXN0O1xcbmZvciAobGV0IGkgPSAwOyBpIDwgeHgubGVuZ3RoOyBpKyspIHtcXG4gICAgdmFyIHZtID0geHhbaV07XFxuICAgIEQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogdm0uY29sX3R5cGUsXFxuICAgICAgICB0aXRsZTogdm0udGl0bGUsXFxuICAgICAgICBwaWNfdXJsOiB2bS5waWNfdXJsLFxcbiAgICAgICAgaW1nOiB2bS5pbWcsXFxuICAgICAgICB1cmw6IHZtLnVybCxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgIGNsczogJ+ivpuaDhemhtSdcXG4gICAgICAgIH1cXG4gICAgfSk7XFxufVxcbnB1dE15VmFyKCfor6bmg4UnICsgZ2V0TXlWYXIoJ2NhY2hlJyksIEpTT04uc3RyaW5naWZ5KEQpKVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6KeG6aKR6K+E6K66XCIsXCJwYXRoXCI6XCLop4bpopHor4TorrpcIixcInJ1bGVcIjpcInZhciBEID0gW107XFxudmFyIG15UGFnZSA9SlNPTi5wYXJzZShnZXRNeVZhcign6aG156CBJywnMScpKTtcXG5pZihQQUdFID4gbXlQYWdlICYmIGdldE15VmFyKFxcXCLor6bnu4bnsbvliKtcXFwiKSA9PSAn6K+E6K66Jykge1xcbiAgICBteVBhZ2UrKztcXG4gICAgcHV0TXlWYXIoJ+mhteeggScsSlNPTi5zdHJpbmdpZnkobXlQYWdlKSk7XFxuICAgIC8vbG9nKCfmlrAnK215UGFnZSlcXG59XFxuZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv5pe26Ze05oiz6L2s5o2iXFxcIikpLnJ1bGUpO1xcbmxldCBjb21tZW50X3VybCA9IFxcXCJodHRwczovL2FwcC54aW5waWFuY2hhbmcuY29tL2NvbW1lbnRzP3Jlc291cmNlX2lkPVxcXCIgKyBJRCArIFxcXCImdHlwZT1hcnRpY2xlJnBhZ2U9XFxcIiArIE51bWJlcihteVBhZ2UpO1xcbnZhciBDT01NRU5UX0pTT04gPSBKU09OLnBhcnNlKHJlcXVlc3QoY29tbWVudF91cmwpKS5kYXRhO1xcbi8vIOivhOiuuuaAu+aVsFxcbi8vbG9nKENPTU1FTlRfSlNPTilcXG52YXIgdG90YWwgPSBDT01NRU5UX0pTT04udG90YWw7XFxudmFyIGNhY2hlX2pzb24gPSBDT01NRU5UX0pTT04ubGlzdDtcXG4vL+aXoOivhOiuulxcbmlmICghdG90YWwgfHwgdG90YWwgPT0gMCAmJiBteVBhZ2UgPT0gMSkge1xcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IDMwOyBpKyspIHtcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6K+m5oOF6aG1JytpbnB1dFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgRC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdIDxzbWFsbD48Zm9udCBjb2xvcj0nZ3JleSc+XFxcIiArICfigJTigJQgICDmmoLml6Dor4TorrogICDigJTigJQnICsgXFxcIjwvZm9udD4gPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgY2xzOiAn6K+m5oOF6aG1JytpbnB1dFxcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5pZiAoY2FjaGVfanNvbi5sZW5ndGggPiAwKSB7XFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2FjaGVfanNvbi5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgdmFyIFVTRVJfSE9NRSA9ICdodHRwczovL2FwcC54aW5waWFuY2hhbmcuY29tL3VzZXIvJyArIGNhY2hlX2pzb25baV0udXNlcmlkO1xcbiAgICAgICAgdmFyIHVzZXJfYXZhdGFyID0gY2FjaGVfanNvbltpXS51c2VySW5mby5hdmF0YXI7XFxuICAgICAgICB2YXIgdXNlcl91c2VybmFtZSA9IGNhY2hlX2pzb25baV0udXNlckluZm8udXNlcm5hbWU7XFxuICAgICAgICBpZiAoZ2V0TXlWYXIoJ+S9nOiAhScpID09IHVzZXJfdXNlcm5hbWUpIHVzZXJfdXNlcm5hbWUgPSAnPGZvbnQgY29sb3I9I2VkOWE0MT4nICsgdXNlcl91c2VybmFtZSArXFxuICAgICAgICAgICAgJzwvZm9udD4nO1xcbiAgICAgICAgLy8g6K+E6K665YaF5a65XFxuICAgICAgICB2YXIgY29udGVudCA9IGNhY2hlX2pzb25baV0uY29udGVudDtcXG4gICAgICAgIC8vIOivhOiuuuaXtumXtFxcbiAgICAgICAgdmFyIGFkZHRpbWUgPSBjYWNoZV9qc29uW2ldLmFkZHRpbWU7XFxuICAgICAgICBhZGR0aW1lID0gdGltZXN0YW1wVG9UaW1lKHRtID0gYWRkdGltZSwgdHMgPSAxKVxcbiAgICAgICAgLy8g5Zue5aSNXFxuICAgICAgICBpZiAoY2FjaGVfanNvbltpXS5yZWZlcmVyKSB7XFxuICAgICAgICAgICAgdmFyIHJlX25hbWUgPSBjYWNoZV9qc29uW2ldLnJlZmVyZXIudXNlckluZm8udXNlcm5hbWU7XFxuICAgICAgICAgICAgdmFyIHJlX2NvbnRlbnQgPSBjYWNoZV9qc29uW2ldLnJlZmVyZXIuY29udGVudDtcXG4gICAgICAgICAgICB2YXIgcmVmZXJlciA9IFxcXCI8YmxvY2txdW90ZT48Zm9udCBjb2xvcj0nZ3JleSc+XFxcIiArICc8Y29kZT4nICsgcmVfbmFtZSArICc8L2NvZGU+JyArICc8YnI+JyArXFxuICAgICAgICAgICAgICAgIHJlX2NvbnRlbnQgKyBcXFwiPC9mb250PjwvYmxvY2txdW90ZT5cXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB2YXIgcmVmZXJlciA9IFxcXCJcXFwiXFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDEwOyBpKyspIHtcXG4gICAgICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ+ivpuaDhemhtScraW5wdXRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB1c2VyX3VzZXJuYW1lICsgXFxcIjxzbWFsbD48Zm9udCBjb2xvcj0nZ3JleSc+XFxcIiArICdcXFxcdFxcXFx0JyArIGFkZHRpbWUgK1xcbiAgICAgICAgICAgICAgICBcXFwiPC9mb250Pjwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICBpbWc6IHVzZXJfYXZhdGFyICsgJ0BSZWZlcmVyPScgKyB1c2VyX2F2YXRhcixcXG4gICAgICAgICAgICB1cmw6ICQoVVNFUl9IT01FKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS/liJvkvZzkurrpppbpobVcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogJ+ivpuaDhemhtScraW5wdXRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHJlZmVyZXIgKyBcXFwiPGZvbnQgY29sb3I9JzAwMCc+XFxcIiArICdcXFxcdFxcXFx0XFxcXHRcXFxcdFxcXFx0JyArIGNvbnRlbnQgKyBcXFwiPC9mb250PlxcXCIsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogJ+ivpuaDhemhtScraW5wdXRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogJ+ivpuaDhemhtScraW5wdXRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBELnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaycsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGNsczogJ+ivpuaDhemhtScraW5wdXQsXFxuICAgICAgICAgICAgaWQ6ICfnu5PmnZ/or4TorronXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn0gZWxzZSBpZih0b3RhbCE9IDAgKXtcXG4gICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2UvRU5EXFxcIikpLnJ1bGUpKEQpXF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AgICAgICAgLnRvRml4ZWQoMSkgKyAnayc7XFxuICAgICAgICB2YXIgbmV4dF91c2VyID0gTkVYVF9KU09OW2ldLmRhdGEuYXV0aG9yLnVzZXJpbmZvLnVzZXJuYW1lO1xcbiAgICAgICAgbGV0IGNhY2hlX2xpbmsgPSBpbnB1dDtcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX2xlZnRfcGljJyxcXG4gICAgICAgICAgICB0aXRsZTogbmV4dF90aXRsZSxcXG4gICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdIDxzbWFsbD48Zm9udCBjb2xvcj0nZ3JleSc+XFxcIiArICfmkq3mlL7ph48gJyArIG5leHRfdmlldyArICcgwrcg5Zac5qyiICcgKyBuZXh0X2xpa2UgKyAnXFxcXG4nICsgbmV4dF91c2VyICsgXFxcIjwvZm9udD4gPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgIGltZzogbmV4dF9jb3ZlcixcXG4gICAgICAgICAgICB1cmw6ICQoUExBWV9MSU5LUykubGF6eVJ1bGUoKGNhY2hlX2xpbmspID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ+ivhOiuuicgKyBnZXRNeVZhcignY2FjaGUnK2NhY2hlX2xpbmspKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfor6bnu4bnsbvliKsnLCAn566A5LuLJyk7XFxuICAgICAgICAgICAgICAgICAgICAvL3B1dE15VmFyKCfnm7jkvLzop4bpopEnLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgfSxjYWNoZV9saW5rKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjbHM6ICf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ibGlzaF90aW1lO1xcbiAgICAgICAgICAgIC8vIOaXtumXtOaIs+i9rOW5tOaciOaXpVxcbiAgICAgICAgICAgIHB1Ymxpc2hfdGltZSA9IHRpbWVzdGFtcFRvVGltZSh0bSA9IHB1Ymxpc2hfdGltZSwgdHMgPSAwKVxcbiAgICAgICAgICAgIEFyciA9IHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX2xlZnRfcGljJyxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdIDxzbWFsbD48Zm9udCBjb2xvcj0nZ3JleSc+XFxcIiArIHB1Ymxpc2hfdGltZSArICdcXFxcbicgKyBsaWtlICsgJyDllpzmrKInICsgJyDCtyAnICsgdmlldyArICcg6KeC55yLJyArIFxcXCI8L2ZvbnQ+IDwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIHVybDogJChQTEFZX0xJTktTKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign6K+m57uG57G75YirJywgJ+eugOS7iycpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICfkuLvpobUnXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIEQucHVzaChBcnIpO1xcbiAgICAgICAgfVxcblxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgLy9ldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS9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