Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@tgx音乐@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoidGd46Z+z5LmQIiwiYXV0aG9yIjoiVGhvbWFz5ZayIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjZnlwYWdlIiwidmVyc2lvbiI6MjAyMzA4MDcsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoibXVzaWMiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczokLnJlcXVpcmUoJ2hvbWU/cnVsZT10Z3jpn7PkuZAnKTsiLCJzZWFyY2hfdXJsIjoiaGlrZXI6Ly9lbXB0eSMjI2Z5cGFnZSMjIyoqIiwiZ3JvdXAiOiLpn7PpopEiLCJzZWFyY2hGaW5kIjoianM6JC5yZXF1aXJlKCdzZWFyY2g/cnVsZT10Z3jpn7PkuZAnKTsiLCJkZXRhaWxfY29sX3R5cGUiOiJtb3ZpZV8xIiwiZGV0YWlsX2ZpbmRfcnVsZSI6IiIsInNkZXRhaWxfY29sX3R5cGUiOiJtb3ZpZV8xIiwic2RldGFpbF9maW5kX3J1bGUiOiIiLCJ1YSI6InBjIiwicHJlUnVsZSI6IiIsInBhZ2VzIjoiW3tcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLikaHpgJrnlKjlh73mlbBcIixcInBhdGhcIjpcImluZm9cIixcInJ1bGVcIjpcImpzOlxcbmNvbnN0IHBjYXBpID0gXFxcImh0dHBzOi8vd3d3Lmt1d28uY24vYXBpL1xcXCI7XFxuY29uc3QgZW1wdHkgPSAnaGlrZXI6Ly9lbXB0eSM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ICAgICBpZiAoc2kgPT09IDEpIHsgLy8g5q2M5puyXFxuICAgICAgICAgICAgbmV3RGF0YSA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IChfLnNvbmdOYW1lIHx8IF8ubmFtZSkgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICBpbWc6IF8ucGljLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAnXFxcXG7wn5SWICcgKyAoXy5pc0xpc3RlbkZlZSA9PSB0cnVlID8gJ1BhaWQnIDogJ0ZyZWUnKSArICdNdXNpY+OAgPCfk4AgJyArIChfLmFsYnVtIHx8ICfmmoLml6DkuJPovpEnKSxcXG4gICAgICAgICAgICAgICAgZGVzYzogJ/Cfk7wgJyArIF8uc29uZ1RpbWVNaW51dGVzLFxcbiAgICAgICAgICAgICAgICB1cmw6IChfLmlkIHx8IF8ucmlkKSArIGxhenkxLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogZ2V0SXRlbSgndHlwZScsICdjYXJkX3BpY18zJylcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSBlbHNlIGlmIChzaSA9PT0gMikgeyAvLyDkuJPovpFcXG4gICAgICAgICAgICBuZXdEYXRhID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXy5hbGJ1bSxcXG4gICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ1xcXFxu8J+OuyAnICsgXy5hcnRpc3QgKyAn44CA8J+TgCAnICsgKF8uYWxidW0gfHwgJ+aaguaXoOS4k+i+kScpLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAn8J+ThiAnICsgXy5yZWxlYXNlRGF0ZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGVtcHR5KS5ydWxlKChhbGJ1bWlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9pbmZvP3J1bGU9dGd46Z+z5LmQJywge30pKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiYWpheD9ydWxlPXRneOmfs+S5kFxcXCIpKHBjYXBpICsgXFxcInd3dy9hbGJ1bS9hbGJ1bUluZm8/YWxidW1JZD1cXFwiICsgYWxidW1pZCArIFxcXCImcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgXy5tdXNpY0xpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBMaXN0X1B1c2goXywgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgfSwgXy5hbGJ1bWlkKVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9IGVsc2UgaWYgKHNpID09PSAzKSB7IC8vIE1WXFxuICAgICAgICAgICAgbmV3RGF0YSA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgICAgIGltZzogXy5waWMsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdcXFxcbvCflKUgJyArIF8ubXZQbGF5Q250LFxcbiAgICAgICAgICAgICAgICBkZXNjOiAn8J+TvCAnICsgXy5zb25nVGltZU1pbnV0ZXMsXFxuICAgICAgICAgICAgICAgIHVybDogKF8uaWQgfHwgXy5yaWQpICsgJChcXFwiXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvaW5mbz9ydWxlPXRneOmfs+S5kCcsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJhamF4P3J1bGU9dGd46Z+z5LmQXFxcIikocGNhcGkgKyBcXFwidjEvd3d3L211c2ljL3BsYXlVcmw/bWlkPVxcXCIgKyBpbnB1dCArIFxcXCImdHlwZT1tdiZcXFwiKS51cmxcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfMydcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSBlbHNlIGlmIChzaSA9PT0gNCkgeyAvLyDmrYzljZVcXG4gICAgICAgICAgICBuZXdEYXRhID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAnXFxcXG7wn467ICcgKyAoXy51c2VyTmFtZSB8fCBfLnVuYW1lKSArICfjgIDwn5OfICcgKyBfLnRvdGFsICsgJ+mmluatjOabsicsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfwn5SlICcgKyBfLmxpc3RlbmNudCxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGVtcHR5KS5ydWxlKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvaW5mbz9ydWxlPXRneOmfs+S5kCcsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImFqYXg/cnVsZT10Z3jpn7PkuZBcXFwiKShwY2FwaSArIFxcXCJ3d3cvcGxheWxpc3QvcGxheUxpc3RJbmZvP3BpZD1cXFwiICsgaWQgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIF8ubXVzaWNMaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBMaXN0X1B1c2goXywgMSlcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9LCBfLmlkKVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9IGVsc2UgaWYgKHNpID09PSA1KSB7IC8vIOatjOaJi1xcbiAgICAgICAgICAgIG5ld0RhdGEgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogXy5waWMsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdcXFxcbvCfk58gJyArIF8ubXVzaWNOdW0gKyAn6aaW5q2M5puyJyxcXG4gICAgICAgICAgICAgICAgZGVzYzogJ/CfjJAgJyArIF8uY291bnRyeSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGVtcHR5KS5ydWxlKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvaW5mbz9ydWxlPXRneOmfs+S5kCcsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImFqYXg/cnVsZT10Z3jpn7PkuZBcXFwiKShwY2FwaSArIFxcXCJ3d3cvYXJ0aXN0L2FydGlzdE11c2ljP2FydGlzdGlkPVxcXCIgKyBpZCArIFxcXCImcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgXy5saXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBMaXN0X1B1c2goXywgMSlcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9LCBfLmlkKVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9XFxuXFxuICAgICAgICBFeHRyYShuZXdEYXRhLCBzaSwgKF8uaWQgfHwgXy5yaWQgfHwgXy5hbGJ1bWlkKSk7XFxuICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgbG9nKGVycilcXG4gICAgfVxcbn1cXG5cXG5cXG5tYXBIaXN0b3J5ID0gKGhpc3RvcnkpID0+IHtcXG4gICAgbGV0IGkgPSAwLFxcbiAgICAgICAgaWQgPSBcXFwidGd46Z+z5LmQXFxcIjtcXG4gICAgZm9yIChsZXQga2V5IG9mIGhpc3RvcnkpIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGtleSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGtleSxzaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3Nva2V5Jywga2V5KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vc2VhcmNoP3M9XFxcIiArIGtleSArIFxcXCIjIyNcXFwiICsgc2lkICsgXFxcIiZydWxlPXRneOmfs+S5kFxcXCI7XFxuICAgICAgICAgICAgfSwga2V5LCBnZXRNeVZhcignaW5wdXQyJywgZ2V0SXRlbSgnc2lkJywgJzEnKSkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6a2V5OlxcXCIgKyBrZXksXFxuICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6Zmk5YWz6ZSu6K+NOlxcXCIgKyBrZXksXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaWQsIGtleSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoaXN0b3J5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgaGlzdG9yeSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID09IDApIGFkZEl0ZW1BZnRlcihpZCArIFxcXCI6c2VhcmNoSGlzdG9yeVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCI6a2V5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCArIFxcXCI6a2V5OlxcXCIgKyBrZXkpO1xcbiAgICAgICAg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YnVtSWQ9XFxcIiArIGlkICsgXFxcIiZwbj0xJnJuPTEmXFxcIik7XFxuICAgICAgICBMaXN0X1B1c2goXywgMik7XFxuICAgIH0gZWxzZSBpZiAobWF0KC9cXFxcL212cGxheShcXFxcL1xcXFxkKyk/XFxcXC8oXFxcXGQrKS9pKSkge1xcbiAgICAgICAgJC5yZXF1aXJlKFxcXCJhamF4P3J1bGU9dGd46Z+z5LmQXFxcIikocGNhcGkgKyBcXFwid3d3L211c2ljL211c2ljSW5mbz9taWQ9XFxcIiArIGlkICsgXFxcIiZpcD0mY2lwPSZcXFwiKTtcXG4gICAgICAgIGlmIChfKVxcbiAgICAgICAgICAgIExpc3RfUHVzaChfLCAzKTtcXG4gICAgICAgIGVsc2Uge1xcbiAgICAgICAgICAgIGRpdiA9IGZldGNoQ29kZUJ5V2ViVmlldyhzb2tleSwge1xcbiAgICAgICAgICAgICAgICAnYmxvY2tSdWxlcyc6IFsnLnBuZycsICcuanBnJywgJy5jc3MnXSxcXG4gICAgICAgICAgICAgICAgdGltZW91dDogOTk5OVxcbiAgICAgICAgICAgIH0pLm1hdGNoKC8oXFxcXChmdW5jdGlvblxcXFwoW1xcXFxTXFxcXHNdK1xcXFwpXFxcXCkpOy8pWzFdO1xcbiAgICAgICAgICAgIF8gPSBldmFsKGRpdikuZGF0YVswXS5WaWRlb0luZm87XFxuICAgICAgICAgICAgcyA9IF8uZHVyYXRpb24gJSA2MFxcbiAgICAgICAgICAgIG0gPSBfLmR1cmF0aW9uIC0gc1xcbiAgICAgICAgICAgIHRpbWUgPSBtIC8gNjAgKyAnOicgKyBzXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogICfwn5SlICcgKyBfLmNvdW50X3BsYXkrJ1xcXFxu8J+OuyAnICsgXy51c2VyX25hbWUsXFxuICAgICA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iZydWxlPXVja2vkupFcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgcnVsZXM6ICQudG9TdHJpbmcoKHNhcnIsIGlucHV0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgc2FyclswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXJyLm1hcChbdGl0bGUsIHNpZF0gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogdGl0bGUucmVwbGFjZSgvJm5ic3A7L2csICcgJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoX3VybFxcXCI6IFxcXCJoaWtlcjovL2VtcHR5IyMjZnlwYWdlIyMjXFxcIiArIGlucHV0ICsgXFxcIiMjI1xcXCIgKyBzaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoRmluZFxcXCI6IFxcXCJqczogJC5yZXF1aXJlKCdzZWFyY2g/cnVsZT10Z3jpn7PkuZAnKTtcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc2Fyciwgc29rZXkpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgc3VybCgnTXVzaWMnKTtcXG4gICAgICAgICAgICBfLmxpc3QubWFwKF8gPT4gTGlzdF9QdXNoKF8sIDEpKTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgIHN1cmwoJ0FsYnVtJyk7XFxuICAgICAgICAgICAgXy5hbGJ1bUxpc3QubWFwKF8gPT4gTGlzdF9QdXNoKF8sIDIpKTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJzMnOlxcbiAgICAgICAgICAgIHN1cmwoJ012Jyk7XFxuICAgICAgICAgICAgXy5tdmxpc3QubWFwKF8gPT4gTGlzdF9QdXNoKF8sIDMpKTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJzQnOlxcbiAgICAgICAgICAgIHN1cmwoJ1BsYXlMaXN0Jyk7XFxuICAgICAgICAgICAgXy5saXN0Lm1hcChfID0+IExpc3RfUHVzaChfLCA0KSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICc1JzpcXG4gICAgICAgICAgICBzdXJsKCdBcnRpc3QnKTtcXG4gICAgICAgICAgICBfLmxpc3QubWFwKF8gPT4gTGlzdF9QdXNoKF8sIDUpKTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLplJnor6/nmoTmkJzntKLmjqXlj6NcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgIH1cXG59XFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pGi56iL5bqP6aaW6aG1XCIsXCJwYXRoXCI6XCJob21lXCIsXCJydWxlXCI6XCJqczpcXG5ldmFsKEpT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biAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcigndGlkJywgZ2V0SXRlbSgndGlkJywgJzAnKSkgPT0gdGlkID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUucmVwbGFjZSgvJm5ic3A7L2csICcgJyksXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGlkJywgdGlkKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2lpJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCB0aWQpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojZmY2NjAxXFxcIj48Yj7ovazliLAgVEdY5pS26JePPC9iPjwvc3Bhbj4nLFxcbiAgICAgICAgICAgIGRlc2M6ICfmrYzljZXmlLbol48nLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb2xsZWN0aW9uI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9naHByb3h5LmNvbS9odHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vbHMxMjU3ODEwMDMvbG10dWJpYW8vbWFpbi9tdXNpYy84Mi5zdmcnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IFxcXCJUR1jmlLbol49cXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIHRpdGxlOiAn8J+UjScsXFxuICAgICAgICAgICAgZGVzYzogJ+aQnOe0ouWFs+mUruivjSAvIOWIhuS6q+mTvuaOpScsXFxuICAgICAgICAgICAgdXJsOiAnXFxcImhpa2VyOi8vc2VhcmNoP3M9XFxcIitpbnB1dCtcXFwiJnJ1bGU9XFxcIitNWV9SVUxFLnRpdGxlJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJzb2tleVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc29rZXknLGlucHV0KVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6ICfmiJHnmoTmlLbol48nLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vY29sbGVjdGlvbj9ydWxlPXRneOmfs+S5kCcsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIHRpdGxlOiAn5Y6G5Y+y6K6w5b2VJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2hpc3Rvcnk/cnVsZT10Z3jpn7PkuZAnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJ+mrmOe6p+aQnOe0oicsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL3NlYXJjaDIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgIH1cXG5cXG5cXG5cXG4gICAg6K6+572uID0gMDtcXG4gICAgdGlkID0gZ2V0TXlWYXIoJ3RpZCcsIGdldEl0ZW0oJ3RpZCcsICcwJykpO1xcbiAgICB0aWkgPSBnZXRNeVZhcignaWknLCBnZXRJdGVtKCdpaV8wXycgKyB0aWQsICcwJykpO1xcbiAgICBpZiAodGlkIDwgNykge1xcbiAgICAgICAgaVRhZyA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJpVGFnXFxcIik7XFxuICAgICAgICBpZiAoaVRhZyA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIGlUYWcgPSAkLnJlcXVpcmUoXFxcImFqYXg/cnVsZT10Z3jpn7PkuZBcXFwiKShwY2FwaSArIFxcXCJ3d3cvcGxheWxpc3QvZ2V0VGFnTGlzdD9cXFwiKTtcXG4gICAgICAgICAgICBpVGFnID0gW3tcXG4gICAgICAgICAgICAgICAgbmFtZTogXFxcIuaOqOiNkFxcXCIsXFxuICAgICAgICAgICAgICAgIGRhdGE6IFt7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBcXFwi5q+P5pel5o6o6I2QXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBcXFwicmNtL2luZGV4L3BsYXlsaXN0P2lkPXJjbVxcXCJcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogXFxcIuacgOaWsOeyvumAiVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBpZDogXFxcImNsYXNzaWZ5L3BsYXlsaXN0L2dldFJjbVBsYXlMaXN0P29yZGVyPW5ld1xcXCJcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogXFxcIueDremXqOeyvumAiVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBpZDogXFxcImNsYXNzaWZ5L3BsYXlsaXN0L2dldFJjbVBsYXlMaXN0P29yZGVyPWhvdFxcXCJcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9XS5jb25jYXQoaVRhZyk7XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcImlUYWdcXFwiLCBpVGFnKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHp1ID0gaVRhZ1t0aWRdLmRhdGEubWFwKF8gPT4gXy5uYW1lKTtcXG4gICAgICAgIGxlbiA9IHp1Lmxlbmd0aDtcXG4gICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxiPjxmb250IGNvbG9yPSNmZjY2MDE+JyArIHRhcnJbdGlkXSArICc8L2ZvbnQ+PC9iPicsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpVGFnW3RpZF0uZGF0YS5tYXAoKF8sIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGlpID09IGlpID8gUmljaChTdHJvbmcoQ29sb3IoXy5uYW1lKSkpIDogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdpaScsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaWkpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpbnN0YWxsKCk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodGlpID09IGxlbikge1xcbiAgICAgICAgICAgIOiuvue9riA9IDE7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEgfHwgISh0aWQgPT0gJzAnICYmIHRpaSA9PSAnMCcpKSB7XFxuICAgICAgICAgICAgICAgIGlkID0gaVRhZ1t0aWRdLmRhdGFbdGlpXS5pZDtcXG4gICAgICAgICAgICAgICAgaWYgKHRpZCAhPSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gXFxcImNsYXNzaWZ5L3BsYXlsaXN0L2dldFRhZ1BsYXlMaXN0P2lkPVxcXCIgKyBpZDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImFqYXg/cnVsZT10Z3jpn7PkuZBcXFwiKShwY2FwaSArIFxcXCJ3d3cvXFxcIiArIGlkICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIik7XFxuICAgICAgICAgICAgICAgIChfLmRhdGEgfHwgXy5saXN0KS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSkucnVsZSgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvaW5mbz9ydWxlPXRneOmfs+S5kCcsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiYWpheD9ydWxlPXRneOmfs+S5kFxcXCIpKHBjYXBpICsgXFxcInd3dy9wbGF5bGlzdC9wbGF5TGlzdEluZm8/cGlkPVxcXCIgKyBpZCArIFxcXCImcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8ubXVzaWNMaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExpc3RfUHVzaChfLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBfLmlkKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzMnXFxuICAgICAgICAgICAgICAgICAgICB9LCA0LCBfLmlkKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSBpZiAodGlkID09IDcpIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48Zm9udCBjb2xvcj0jZmY2NjAxPuaOkuihjDwvZm9udD48L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgXyA9IHN0b3JhZ2UwLmdldE15VmFyKCdiYW5nJylcXG4gICAgICAgIGlmIChfID09ICcnKSB7XFxuICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwiYWpheD9ydWxlPXRneOmfs+S5kFxcXCIpKHBjYXBpICsgXFxcInd3dy9iYW5nL2JhbmcvYmFuZ01lbnU/XFxcIik7XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2JhbmcnLCBfKTtcXG4gICAgICAgIH1cXG4gICAgICAgIF8uZm9yRWFjaCgoXywgaWkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlpID09IGlpID8gUmljaChTdHJvbmcoQ29sb3IoXy5uYW1lKSkpIDogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignaWknLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIGlpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICB6dSA9IFtdO1xcbiAgICAgICAgXy5mb3JFYWNoKF8gPT4genUucHVzaChfLm5hbWUpKTtcXG4gICAgICAgIGxlbiA9IHp1Lmxlbmd0aDtcXG4gICAgICAgIGluc3RhbGwoKTtcXG4gICAgICAgIGlmICh0aWkgPT0gbGVuKSB7XFxuICAgICAgICAgICAg6K6+572uID0gMTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgX1t0aWldLmxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSkucnVsZSgoc291cmNlaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9pbmZvP3J1bGU9dGd46Z+z5LmQJywge30pKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImFqYXg/cnVsZT10Z3jpn7PkuZBcXFwiKShwY2FwaSArIFxcXCJ3d3cvYmFuZy9iYW5nL211c2ljTGlzdD9iYW5nSWQ9XFxcIiArIHNvdXJjZWlkICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8ubXVzaWNMaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzdF9QdXNoKF8sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIF8uc291cmNlaWQpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdjYXJkX3BpY18zJ1xcbiAgICAgICAgICAgICAgICB9LCA0LCBcXFwicmFua0xpc3RcXFwiKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2UgaWYgKHRpZCA9PSA4KSB7XFxuICAgICAgICB6dSA9IFtcXFwi5YWo6YOoXFxcIiwgXFxcIuWNjuivreeUt1xcXCIsIFxcXCLljY7or63lpbNcXFwiLCBcXFwi5Y2O6K+t57uE5ZCIXFxcIiwgXFxcIuaXpemfqeeUt1xcXCIsIFxcXCLml6Xpn6nlpbNcXFwiLCBcXFwi5pel6Z+p57uE5ZCIXFxcIiwgXFxcIuasp+e+jueUt1xcXCIsIFxcXCLmrKfnvo7lpbNcXFwiLCBcXFwi5qyn576O57uE5ZCIXFxcIiwgXFxcIuWFtuS7llxcXCJdO1xcbiAgICAgICAgbGVuID0genUubGVuZ3RoO1xcbiAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+PGZvbnQgY29sb3I9I2ZmNjYwMT7mrYzmiYs8L2ZvbnQ+PC9iPicsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB6dS5tYXAoKG5hbWUsIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGlpID09IGlpID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2lpJywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpaSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGluc3RhbGwoKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmICh0aWkgPT0gbGVuKSB7XFxuICAgICAgICAgICAg6K6+572uID0gMTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJhamF4P3J1bGU9dGd46Z+z5LmQXFxcIikoXFxcImh0dHBzOi8vd2FwaS5rdXdvLmNuL2FwaS93d3cvYXJ0aXN0L2FydGlzdEluZm8/Y2F0ZWdvcnk9XFxcIiArIGdldE15VmFyKCdpaScsICcwJykgKyBcXFwiJnByZWZpeD0mcG49XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnJuPTMwJlxcXCIpO1xcbiAgICAgICAgICAgIF8uYXJ0aXN0TGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKGVtcHR5KS5ydWxlKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2luZm8/cnVsZT10Z3jpn7PkuZAnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiYWpheD9ydWxlPXRneOmfs+S5kFxcXCIpKHBjYXBpICsgXFxcInd3dy9hcnRpc3QvYXJ0aXN0TXVzaWM/YXJ0aXN0aWQ9XFxcIiArIGlkICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8ubGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIExpc3RfUHVzaChfLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBfLmlkKSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfMydcXG4gICAgICAgICAgICAgICAgfSwgNSwgXy5pZClcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIGlmICh0aWQgPT0gOSkge1xcbiAgICAgICAgenUgPSBbXFxcIummluaSrVxcXCIsIFxcXCLljY7or61cXFwiLCBcXFwi5pel6Z+pXFxcIiwgXFxcIue9kee7nFxcXCIsIFxcXCLmrKfnvo5cXFwiLCBcXFwi546w5Zy6XFxcIiwgXFxcIueDreiInlxcXCIsIFxcXCLkvKTmhJ9cXFwiLCBcXFwi5Ymn5oOFXFxcIl07XFxuICAgICAgICBsZW4gPSB6dS5sZW5ndGg7XFxuICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48Zm9udCBjb2xvcj0jZmY2NjAxPk1WPC9mb250PjwvYj4nLFxcbiAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgenUubWFwKChuYW1lLCBpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpaSA9PSBpaSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdpaScsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaWkpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpbnN0YWxsKCk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodGlpID09IGxlbikge1xcbiAgICAgICAgICAgIOiuvue9riA9IDE7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICQucmVxdWlyZShcXFwiYWpheD9ydWxlPXRneO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ICAgY2xlYXJJdGVtKCdpaV8xXycgKyBpdFsxXSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIHNhcnIpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBbXFxcIuWfuuehgFxcXCIsIFxcXCLkuLvpobVcXFwiLCBcXFwi5pCc57SiXFxcIl0ubWFwKChuYW1lLCBpaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcignaWknLCAnMCcpID09IGlpID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaWkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdpaScsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgaWkpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGlpID0gZ2V0TXlWYXIoJ2lpJywgJzAnKTtcXG4gICAgICAgIGlmIChpaSA9PSAnMCcpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WIhue7hOiuvue9ricsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfliIbnsbvmmL7npLrliIbnu4Torr7nva4nLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIuehruWumumHjee9ruWIhue7hOebuOWFs+iuvue9ruWQl++8n1xcXCIpLmNvbmZpcm0oKGxlbjEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbSgndHlwZV8wJyk7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuMTsgaSsrKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbSgnaWlfMF8nICsgaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHRpZCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ1xcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8Yj7lkK/nlKjorr7nva48L2I+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3R5cGVfMCcsIHNpZCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIGdldEl0ZW0oJ3R5cGVfMCcsICcwJykgPT0gJzEnID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGdldEl0ZW0oJ3R5cGVfMCcsICcwJykgPT0gMSA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn6buY6K6k5qC35byPJyxcXG4gICAgICAgICAgICAgICAgZGVzYzogJ+atjOabsuWIl+ihqOeahOm7mOiupOagt+W8jycsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwi56Gu5a6a5oGi5aSN6buY6K6k6K6+572u5ZCX77yfXFxcIikuY29uZmlybSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oJ3R5cGUnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIFsnY2FyZF9waWNfMycsICdhdmF0YXInLCAndGV4dF8xJ10ubWFwKG5hbWUgPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICc8Yj4nICsgbmFtZSArICc8L2I+JyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3R5cGUnLCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgbmFtZSksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoZ2V0SXRlbSgndHlwZScsICdjYXJkX3BpY18zJykgPT0gbmFtZSA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0pO1xcblxcblxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5qOA5rWL5pu05pawXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuW9k+WJjeeJiOacrO+8mlxcXCIgKyBTdHJpbmcoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL2hvbWVAdGd46Z+z5LmQXFxcIikpLnZlcnNpb24pLnJlcGxhY2UoLyhcXFxcZFxcXFxkKShcXFxcZFxcXFxkKSQvLCAnLSQxLSQyJyksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIpLmxhenlSdWxlKCgpID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgICAgIHZ0aW1lID0gTnVtYmVyKGdldEl0ZW0oJ3Z0aW1lJywgJzAnKSkgKyA2ZTY7XFxuXFxuICAgICAgICAgICAgICAgICAgICBpZiAodnRpbWUgPCBuZXcgRGF0ZSgpLmdldFRpbWUoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZlcnNpb24gPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vaG9tZUB0Z3jpn7PkuZBcXFwiKSkudmVyc2lvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6Ly93d3IubGFuem91aS5jb20vYjAzcWh2MTRkXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwd2QgPSBcXFwicmVhZFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiTW96aWxsYS81LjAgKExpbnV4OyBBbmRyb2lkIDguMC4wOyBNSSA1cyBQbHVzIEJ1aWxkL09QUjEuMTcwNjIzLjAzMjsgd3YpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIFZlcnNpb24vNC4wIENocm9tZS83MS4wLjM1NzguOTkgTW9iaWxlIFNhZmFyaS81MzcuMzZcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ0dFVCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNyYyA9IGZldGNoKHVybCwgaGVhZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChzcmMubWF0Y2goL3ZhciBwZ3M7KFtcXFxcc1xcXFxTXSo/cGdzLis7KS8pWzFdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdfPScgKyBzcmMubWF0Y2goL2RhdGEgOihbXFxcXHNcXFxcU10qP1xcXFx9KS8pWzFdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkLmJvZHkgPSBPYmplY3Qua2V5cyhfKS5tYXAoa2V5ID0+IGtleSArIFxcXCI9XFxcIiArIF9ba2V5XSkuam9pbignJicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQubWV0aG9kID0gJ1BPU1QnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IHVybC5yZXBsYWNlKC9cXFxcLmNvbS4qLywgXFxcIi5jb20vZmlsZW1vcmVhamF4LnBocFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKHVybCwgaGVhZCkpLnRleHRbMF07XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSA9IF8ubmFtZV9hbGwubWF0Y2goL1xcXFxbKC4rKVxcXFxdLylbMV0uc3BsaXQoJ18nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2ID0gfn5uYW1lWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZ2ID0gbmFtZVsxXSB8fCAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ZXJzaW9uIDwgdiB8fCAodmVyc2lvbiA9PSB2ICYmIHZ2ID4gMSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDmj5DnpLonLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+ajgOa1i+WIsOS9oOeahOinhOWImeeJiOacrOWwj+S6juacjeWKoeWZqOeJiOacrO+8jOaYr+WQpueri+WNs+abtOaWsO+8nycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChkYSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3Z0aW1lJywgU3RyaW5nKG5ldyBEYXRlKCkuZ2V0VGltZSgpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBcXFwiaHR0cHM6Ly9kZXZlbG9wZXIubGFuem91Zy5jb20vZmlsZS9cXFwiICsgcmVxdWVzdChkYSkubWF0Y2goLycoXFxcXD8uKj8pJy8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBrID0gSlNPTi5wYXJzZShmZXRjaCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZiA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0X3J1bGUuanNvblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKGssIGYpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiXFxcXHU2ZDc3XFxcXHU5NjE0XFxcXHU4OWM2XFxcXHU3NTRjXFxcXHVmZmU1aG9tZV9ydWxlX3VybFxcXFx1ZmZlNVxcXCIgKyBnZXRQYXRoKGYpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsLnJlcGxhY2UoL2ZpbGVtby4qLywgJ3RwLycgKyBfLmlkKSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLCAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3Z0aW1lJywgU3RyaW5nKG5ldyBEYXRlKCkuZ2V0VGltZSgpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ayoeacieabtOaWsOWTplxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6L+H5LiA5Lya5YaN55yL55yL5ZCnXFxcIjtcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgIH0gZWxzZSBpZiAoaWkgPT0gJzEnKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfpu5jorqTkuLvpobUnLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAn5omT5byA56iL5bqP5pe26buY6K6k5omT5byAJyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7lrprmgaLlpI3pu5jorqTorr7nva7lkJfvvJ9cXFwiKS5jb25maXJtKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbSgndGlkJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB0YXJyLm1hcCgobmFtZSwgdGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJzxiPicgKyBuYW1lICsgJzwvYj4nLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCd0aWQnLCB0aWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgICAgICB9LCBTdHJpbmcodGlkKSksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoZ2V0SXRlbSgndGlkJywgJzAnKSA9PSB0aWQgPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAoaWkgPT0gMikge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn6buY6K6k5pCc57SiJyxcXG4gICAgICAgICAgICAgICAgZGVzYzogJ+WOn+eUn+aQnOe0oueahOm7mOiupOaOpeWPoycsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwi56Gu5a6a5oGi5aSN6buY6K6k6K6+572u5ZCX77yfXFxcIikuY29uZmlybSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oJ3NpZCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgc2Fyci5tYXAoW25hbWUsIHNpZF0gPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICc8Yj4nICsgbmFtZSArICc8L2I+JyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnc2lkJywgc2lkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgU3RyaW5nKHNpZCkpLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGdldEl0ZW0oJ3NpZCcsICcxJykgPT0gc2lkID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgaWYgKOiuvue9rikge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+m7mOiupOWIhue7hCcsXFxuICAgICAgICAgICAgZGVzYzogJ+aJk+W8gOWIhuexu+WQjueahOm7mOiupOWIhue7hCcsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7lrprmgaLlpI3pu5jorqTorr7nva7lkJfvvJ9cXFwiKS5jb25maXJtKCh0aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJJdGVtKCdpaV8wXycgKyB0aWQpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCB0aWQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICB6dS5tYXAoKG5hbWUsIHNpZCkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnPGI+JyArIG5hbWUgKyAnPC9iPicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaWlfMF90aWQsIHNpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShpaV8wX3RpZCwgc2lkKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgJ2lpXzBfJyArIHRpZCwgU3RyaW5nKHNpZCkpLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoZ2V0SXRlbSgnaWlfMF8nICsgdGlkLCAnMCcpID09IHNpZCA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufSBjYXRjaCAoZXJyb3IpIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhDb2xvcignfn5+5b2T5YmN572R57uc5byC5bi477yM6K+35Yi35paw6YeN6K+Vfn5+JykpKSxcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pXFxufVxcbnN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lIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5zcGxpdCgnIyMjJylbMF1cXG4gICAgICAgICAgICAgICAgaWYgKCFnZXRNeVZhcignaW5wdXQyJywgJzEnKS5tYXRjaCgvXig5OTkpPyQvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgc2FyciA9IFtzYXJyW2dldE15VmFyKCdpbnB1dDInLCAnMScpXV1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBzYXJyWzBdO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlucHV0ID0gaW5wdXQucmVwbGFjZSgvXuiBmuWQiD/mkJzntKI/XFxcXHMqLywgJycpO1xcbiAgICAgICAgICAgIHNhcnIubWFwKFt0aXRsZSwgc2lkXSA9PiB7XFxuICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiB0aXRsZS5yZXBsYWNlKC8mbmJzcDsvZywgJyAnKSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hfdXJsXFxcIjogXFxcImhpa2VyOi8vZW1wdHkjIyNmeXBhZ2UjIyNcXFwiICsgaW5wdXQgKyBcXFwiIyMjXFxcIiArIHNpZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hGaW5kXFxcIjogXFxcImpzOiAkLnJlcXVpcmUoJ3NlYXJjaD9ydWxlPXRneOmfs+S5kCcpO1xcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoZGF0YSk7XFxuICAgICAgICB9LCBzYXJyKSxcXG4gICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcInNva2V5XFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICA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ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgaWYgKHp5ID09PSBcXFwiXFxcIiB8fCBKU09OLnN0cmluZ2lmeSh6eSkgPT0gJ3t9JykgenkgPSB7XFxuICAgICAgICBcXFwi5YWo6YOoXFxcIjogW11cXG4gICAgfSwgc3RvcmFnZTAuc2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2ksIHp5KTtcXG4gICAgbGV0IHp1ID0gW107XFxuICAgIGZvciAoaSBpbiB6eSkgenUucHVzaChpKTtcXG4gICAgenUuY29uY2F0KFxcXCLorr7nva5cXFwiKS5tYXAoKG5hbWUsIGlpKSA9PiB7XFxuICAgICAgICBpZiAoaWkgIT0genUubGVuZ3RoIHx8IGdldEl0ZW0oJ3R5cGVfMScsICcxJykgPT0gJzEnKVxcbiAgICAgICAgICAgIGlmIChpaSAhPSB6dS5sZW5ndGgpIGV4dHJhID0ge1xcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpCBcXFwiICsgbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaRcXFwiICsgbmFtZSArIFxcXCLlkJfvvJ9cXFwiKS5jb25maXJtKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB6eVtuYW1lXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJdGVtKCdpaV8xXycgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2lpJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiY29sbGVjdGlvbjI/cnVsZT10Z3jpn7PkuZBcXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmiZPlvIDkuLrkuoznuqdcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjJykucnVsZSgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvaW5mbz9ydWxlPXRneOmfs+S5kCcsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtuYW1lXS5tYXAoXyA9PiBFeHRyYShfLCBzaSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLnlkI3np7BcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXmlrDnmoTnu4TlkI1cXFwiKS5pbnB1dCgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSBpbiB6eSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gbmFtZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baW5wdXRdID0genlbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpXSA9IHp5W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImNvbGxlY3Rpb24yP3J1bGU9dGd46Z+z5LmQXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuabtOaUueaOkuW6j1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgenUuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHNpLCB6dSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIG9mIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25bbmFtZV0gPSB6eVtuYW1lXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignaWknLCB6dS5pbmRleE9mKGkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwi5pyA5ZCO6Z2iXFxcIiA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltuYW1lXSA9IHp5W25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2lpJywgenUubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiY29sbGVjdGlvbjI/cnVsZT10Z3jpn7PkuZBcXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSlcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGVsc2UgZXh0cmEgPSB7fTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpID09IGlpID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignaWknLCBpaSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIGlpKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgfSk7XFxuICAgIH0pO1xcbiAgICBpZiAodGkgIT0genUubGVuZ3RoKSB7XFxuICAgICAgICBpZiAoSlNPTi5zdHJpbmdpZnkoenUpID09ICdbXFxcIuWFqOmDqFxcXCJdJyAmJiB6eVtcXFwi5YWo6YOoXFxcIl0ubGVuZ3RoID09IDApIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOmDveayoeaciX5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIilcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgenlbenVbdGldXS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgIF8uZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLnlkI3np7BcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwga2V5LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKG5hbWUsIFxcXCLor7fovpPlhaXmlrDnmoTlkI3np7BcXFwiKS5pbnB1dCgoc2ksIGtleSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IHp5Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy50aXRsZSA9PSBuYW1lKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8udGl0bGUgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImNvbGxlY3Rpb24yP3J1bGU9dGd46Z+z5LmQXFxcIikuc2V0RGF0YShzaSwgenksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dVt0aV0sIF8udGl0bGUpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLnlsIHpnaJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwga2V5LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKG5hbWUsIFxcXCLor7fovpPlhaXmraPnoa7nmoTlsIHpnaLlnLDlnYBcXFwiKS5pbnB1dCgoc2ksIGtleSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IHp5Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5pbWcgPT0gbmFtZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLmltZyA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiY29sbGVjdGlvbjI/cnVsZT10Z3jpn7PkuZBcXFwiKS5zZXREYXRhKHNpLCB6eSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1W3RpXSwgXy5pbWcpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmm7TmlLnmjpLluo9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwga2V5LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKVtrZXldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenUgPSB6eS5tYXAoXyA9PiBfLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSB6eVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDEsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHNpLCBrZXksIHp5LCB6dSwgZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIGluIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHp1W2ldID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbi5wdXNoKHp5W2ldKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwi5pyA5ZCO6Z2iXFxcIiA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImNvbGxlY3Rpb24yP3J1bGU9dGd46Z+z5LmQXFxcIikuc2V0RGF0YShzaSwgenksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIHp5LCB6dSwgZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1W3RpXSwgXy50aXRsZSlcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkIFxcXCIgKyBfLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBrZXksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6ZmkXFxcIiArIG5hbWUgKyBcXFwi5ZCX77yfXFxcIikuY29uZmlybSgoc2ksIGtleSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp1ID0genkubWFwKF8gPT4gXy50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSB6dS5pbmRleE9mKG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiY29sbGVjdGlvbjI/cnVsZT10Z3jpn7PkuZBcXFwiKS5zZXREYXRhKHNpLCB6eSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5LCBuYW1lKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1W3RpXSwgXy50aXRsZSlcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goXyk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn6buY6K6k5YiG57uEJyxcXG4gICAgICAgICAgICBkZXNjOiAn5omT5byA5YiG57G75ZCO55qE6buY6K6k5YiG57uEJyxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIuehruWumuaBouWkjem7mOiupOiuvue9ruWQl++8n1xcXCIpLmNvbmZpcm0oKHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGNsZWFySXRlbSgnaWlfMV8nICsgc2kpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBzaSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHp1Lm1hcCgobmFtZSwgc2lkKSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8Yj4nICsgbmFtZSArICc8L2I+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpaV8xX3NpLCBzaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oaWlfMV9zaSwgc2lkKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgJ2lpXzFfJyArIHNpLCBTdHJpbmcoc2lkKSksXFxuICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChnZXRJdGVtKCdpaV8xXycgKyBzaSwgJzAnKSA9PSBzaWQgPyA1NSA6IDYzKSArICcuc3Z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YOoXFxcIjogW11cXG4gICAgICAgIH0sIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpLCB6eSk7XFxuICAgICAgICBsZXQgenUgPSBbXTtcXG4gICAgICAgIGZvciAoaSBpbiB6eSkgenUucHVzaChpKTtcXG5cXG5cXG4gICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5paw57uEXFxcIiksIDMsIFxcXCLpgInmi6nnu4RcXFwiKS5zZWxlY3QoKHp5LCB6dSwgbmV3RGF0YSwgc2kpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuaWsOe7hFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCF6dS5pbmNsdWRlcyhpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5paw57uE5ZCN56ewXFxcIikuaW5wdXQoKHp5LCB6dSwgbmV3RGF0YSwgc2kpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAzLCAn6K+36YCJ5oup5paw57uE5L2N572uJykuc2VsZWN0KCh6eSwgaW5wdXQyLCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuacgOWQjumdolxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2lucHV0Ml0gPSBbbmV3RGF0YV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgaW4genkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2lucHV0Ml0gPSBbbmV3RGF0YV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJjb2xsZWN0aW9uMj9ydWxlPXRneOmfs+S5kFxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB6eSwgaW5wdXQsIG5ld0RhdGEsIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHp5LCB6dSwgbmV3RGF0YSwgc2kpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIhue7hOWQjeensOmHjeWkjeS6hn5cXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIHp5ID0genlbaW5wdXRdO1xcbiAgICAgICAgICAgIHp1ID0genkubWFwKGl0ID0+IGl0LnRpdGxlKTtcXG4gICAgICAgICAgICBpZiAoIXp1LmluY2x1ZGVzKG5ld0RhdGEudGl0bGUpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHp5LCB6dSwgaW5wdXQyLCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmnIDlkI7pnaJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgenkucHVzaChuZXdEYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5LnNwbGljZShpLCAwLCBuZXdEYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImNvbGxlY3Rpb24yP3J1bGU9dGd46Z+z5LmQXFxcIikuc2V0RGF0YShzaSwgenksIGlucHV0Mik7XFxuICAgICAgICAgICAgICAgIH0sIHp5LCB6dSwgaW5wdXQsIG5ld0RhdGEsIHNpKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mrYzmm7LlkI3np7Dph43lpI3kuoZ+XFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHp5LCB6dSwgbmV3RGF0YSwgc2kpO1xcbiAgICB9LFxcbiAgICBzZXREYXRhOiBmdW5jdGlvbihzaSwgenkyLCBrZXkpIHtcXG4gICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgIGlmIChrZXkpIHtcXG4gICAgICAgICAgICB6eVtrZXldID0genkyO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB6eSA9IHp5MjtcXG4gICAgICAgIH1cXG4gICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpLCB6eSk7XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5oiQ5YqfXFxcIjtcXG4gICAgfSxcXG4gICAgY29weXVybDogZnVuY3Rpb24oc2ksIHp5aWQpIHtcXG4gICAgICAgIGN1cmwgPSBcXFwiaHR0cHM6Ly93d3cua3V3by5jbi9cXFwiXFxuICAgICAgICBpZiAoU3RyaW5nKHp5aWQpLnRyaW0oKS5tYXRjaCgvXlxcXFxkKyQvKSkge1xcbiAgICAgICAgICAgIGlmIChzaSA9PSAnMScpXFxuICAgICAgICAgICAgICAgIGN1cmwgKz0gXFxcInBsYXlfZGV0YWlsL1xcXCI7XFxuICAgICAgICAgICAgZWxzZSBpZiAoc2kgPT0gMilcXG4gICAgICAgICAgICAgICAgY3VybCArPSBcXFwiYWxidW1fZGV0YWlsL1xcXCI7XFxuICAgICAgICAgICAgZWxzZSBpZiAoc2kgPT0gMylcXG4gICAgICAgICAgICAgICAgY3VybCArPSBcXFwibXZwbGF5L1xcXCI7XFxuICAgICAgICAgICAgZWxzZSBpZiAoc2kgPT0gNClcXG4gICAgICAgICAgICAgICAgY3VybCArPSBcXFwicGxheWxpc3RfZGV0YWlsL1xcXCI7XFxuICAgICAgICAgICAgZWxzZSBpZiAoc2kgPT0gNSlcXG4gICAgICAgICAgICAgICAgY3VybCArPSBcXFwic2luZ2VyX2RldGFpbC9cXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIGN1cmwgKyB6eWlkO1xcbiAgICB9XFxufVwifV0iLCJpY29uIjoiaHR0cHM6Ly9hbmRyb2lkLWFydHdvcmtzLjI1cHAuY29tL2ZzMDgvMjAyMy8wMy8yMy80LzExMF8zYTcwYzNjNWExOWIyM2Q2NjQ5ZjAyYzU4ODM5MmY1M19jb25fMTMweDEzMC5wbmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment