Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥《折梨》作者:风歌且行〖世子殿下vs郡守千金〗.txt@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLkZpbGXlt6XlhbdcIixcInBhdGhcIjpcIkZpbGUuanNcIixcInJ1bGVcIjpcImNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3Qge1xcbiAgICBGaWxlcyxcXG4gICAgUGF0aHMsXFxuICAgIFN0YW5kYXJkQ29weU9wdGlvbixcXG4gICAgU3RhbmRhcmRPcGVuT3B0aW9uXFxufSA9IGphdmEubmlvLmZpbGU7XFxuY29uc3QgamF2YVN0cmluZyA9IGphdmEubGFuZy5TdHJpbmc7XFxubGV0IGphdmFTY29wZSA9IG5ldyBKYXZhSW1wb3J0ZXIoamF2YS5pbywgamF2YS5sYW5nLCBqYXZhLmxhbmcucmVmbGVjdCwgamF2YS51dGlsLlZlY3Rvcik7XFxuXFxuZnVuY3Rpb24gZGVsZXRlRmlsZXMoZmlsZU5hbWUpIHtcXG4gICAgbGV0IGZpbGUgPSBuZXcgRmlsZShmaWxlTmFtZSk7XFxuICAgIGlmICghZmlsZS5leGlzdHMoKSkge1xcbiAg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aWwocmF0aW8gKiAxMCk7XFxuICAgICAgICAgICAgaXNTdWNjZXNzID0gdHJ1ZTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkuIvovb3ov5vluqbvvJpcXFwiICsgc3VjY2Vzc0NJRC5sZW5ndGggKyBcXFwiL1xcXCIgKyB0YXNrQ291bnQsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuKWh1xcXCIucmVwZWF0KHN0cmlwQ291bnQpLmZvbnRjb2xvcihcXFwiI2ZmYWMyZFxcXCIpICsgXFxcIuKWh1xcXCIucmVwZWF0KDEwIC0gc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZTVlMWU0XFxcIikgKyBcXFwiIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3ov5vluqZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlrozmiJDkuIvovb3vvJpcXFwiICsgaWQpO1xcbiAgICAgICAgfSBlbHNlIGlmIChDSUQgPT09IC0xKSB7XFxuICAgICAgICAgICAgZmFpbE5hbWUucHVzaChpZCk7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICBjb3VudCA9IHRhc2tDb3VudDtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmICh0YXNrQ291bnQgIT09IGNvdW50KSByZXR1cm47XFxuICAgICAgICBpZiAoc3VjY2Vzc0NJRC5sZW5ndGggPT09IHRhc2tD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XRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+WkhOeQhuWksei0pV1cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZhaWxUZWFtLmxlbmd0aCA+IDAgJiYgc3RhdHVzID09PSBcXFwiMVxcXCIpIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjRcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl0j5bey5YGc5q2i5omA5pyJ5Lu75Yqh77yM5L2G5bey5pyJ6L+b5bqm5LiN5Lya5raI5aSxI1xcXCIpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvph43mlrDlvIDlp4tdXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiYnJlYWtcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjJcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIuS4i+i9veS7u+WKoVtcXFwiICsgaW5mby5ib29rTmFtZSArIFxcXCJd5bey5YWo6YOo5oiQ5Yqf5a6M5oiQXFxcIik7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIH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Y1swXSwgdGFza1BhcmFtLmNoYXB0ZXJQYXRoICsgKHRhc2tQYXJhbS5pICsgMSkgKyBcXFwiLmpwZ1xcXCIsIHBpY1sxXSwgdGFza1BhcmFtLmRlY29kZSk7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcih0YXNrUGFyYW0uTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCJcXFwiKSA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0gPSAwO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGlmIChpID09PSA5KSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRhc2tQYXJhbS5DSUQ7XFxuICAgIH1cXG4gICAgbGV0IGNvdW50ID0gMDtcXG4gICAgbGV0IHRvdGFsQ291bnQgPSAwO1xcbiAgICBsZXQgc3VjY2Vzc0NJRCA9IFtdO1xcblxcbiAgICBmdW5jdGlvbiBsaXN0ZW5lcihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgdG90YWxDb3VudCsrO1xcblxcbiAgICAgICAgICAgIGlmIChlcnJvciAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeS4i+i9veWksei0pe+8mlxcXCIgKyBpZCArIFxcXCI8RVJST1JAIFxcXCIgKyBlcnJvciArIFxcXCI+XFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN1bHQgPT09IC0xKSB7XFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeW3suWBnOatou+8mlxcXCIgKyBpZCk7XFxuICAgICAgICAgICAgICAgIHRvdGFsQ291bnQgPSBwYXJhbS5waXZDb3VudDtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjb3VudCsrO1xcbiAgICAgICAgICAgICAgICBsZXQgcmF0aW8gPSAoKGNvdW50IC8gcGFyYW0ucGl2Q291bnQpKS50b0ZpeGVkKDQpO1xcbiAgICAgICAgICAgICAgICBsZXQgc3RyaXBDb3VudCA9IE1hdGguY2VpbChyYXRpbyAqIDEwKTtcXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLnBpdkNvdW50ID09PSB0b3RhbENvdW50ICYmIHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWNjZXNzQ0lELnB1c2gocGFyYW0uQ0lEKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiL6L296L+b5bqm77yaXFxcIiArIChzdWNjZXNzQ0lELmxlbmd0aCkgKyBcXFwiL1xcXCIgKyBwYXJhbS50b3RhbCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuKWh1xcXCIucmVwZWF0KHN0cmlwQ291bnQpLmZvbnRjb2xvcihcXFwiI2ZmYWMyZFxcXCIpICsgXFxcIuKWh1xcXCIucmVwZWF0KDEwIC0gc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZTVlMWU0XFxcIikgKyBcXFwiIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9vei/m+W6plxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5a6M5oiQ5LiL6L2977yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgIT09IHBhcmFtLnBpdkNvdW50KSByZXR1cm47XFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxuICAgICAgICAgICAgICAgIEZpbGUucmVuYW1lRmlsZShwYXJhbS5jaGFwdGVyUGF0aCwgcGFyYW0uQ0lEICsgXFxcIiRBJFxcXCIgKyBUb29sLnRleHRTaGllbGQocGFyYW0udGl0bGUpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdG90YWxDb3VudCA9IGNvdW50ID0gMDtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImJyZWFrXFxcIjtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBsZXQgdGFza1RlYW0gPSBbXTtcXG4gICAgbGV0IG1haW5QYXRoID0gQ29uZmlnLmNvbWljUGF0aCArIFxcXCIvXFxcIiArIGluZm8ucnVsZU5hbWUgKyBcXFwiL1xcXCIgKyBUb29sLnRleHRTaGllbGQoaW5mby5ib29rTmFtZSkgKyBcXFwiL1xcXCI7XFxuICAgIGlmIChpbmZvLmJvb2tUb3BQaWMpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGJvb2tUb3BQaWMgPSBUb29sLmhpa2VyUGljKGluZm8uYm9va1RvcFBpYyk7XFxuICAgICAgICAgICAgVG9vbC5waWNEb3dubG9hZChib29rVG9wUGljWzBdLCBtYWluUGF0aCArIGluZm8uYm9va05hbWUgKyBcX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coXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor68+IFxcXCIgKyBlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHBpY0xpc3QubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCI85ryr55S75Zu+54mH6Kej5p6Q6ZSZ6K+v77ya5Zu+54mH6ZO+5o6l6L+U5Zue5Li656m6PlxcXCIpO1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgfVxcbiAgICAgICAgcGljTGlzdCA9IHBpY0xpc3QuZmlsdGVyKHAgPT4gcCk7XFxuICAgICAgICB2YXIgdGFza1RlYW0gPSBwaWNMaXN0Lm1hcCgodXJsLCBpKSA9PiAoe1xcbiAgICAgICAgICAgIGZ1bmM6IHRhc2ssXFxuICAgICAgICAgICAgaWQ6IGksXFxuICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGk6IGksXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aCxcXG4gICAgICAgICAgICAgICAgTVlfSUQ6IE1ZX0lELFxcbiAgICAgICAgICAgICAgICBkZWNvZGU6IGluZm8uZGVjb2RlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgYmUodGFza1RlYW0sIHtcXG4gICAgICAgICAgICBmdW5jOiBsaXN0ZW5lcixcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBwaXZDb3VudDogcGljTGlzdC5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIHRvdGFsOiBjaGFwdGVyVGVhbS5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIG9yZGVyOiBvcmRlcixcXG4gICAgICAgICAgICAgICAgQ0lEOiBpdGVtLkNJRCxcXG4gICAgICAgICAgIC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PSBmdW5jdGlvbihpdGVtLCBpbmZvLCBvcmRlciwgTVlfSUQpIHtcXG4gICAgcmV0dXJuICRleGVbaW5mby50eXBlXShpdGVtLCBpbmZvLCBvcmRlciwgTVlfSUQpO1xcbn07XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCIjZi7pgJrnlKjlt6XlhbdcIixcInBhdGhcIjpcIlRvb2wuanNcIixcInJ1bGVcIjpcImNvbnN0IHYgPSB7XFxuICAgIHNwbGl0KHRleHQsIHRhcmdldCwgY291bnQpIHtcXG4gICAgICAgIGNvdW50ID0gY291bnQgPT09IHVuZGVmaW5lZCA/IDEgOiBjb3VudDtcXG4gICAgICAgIGxldCBhcnJheSA9IFt0ZXh0XTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY291bnQ7IGkrKykge1xcbiAgICAgICAgICAgIHRleHQgPSBhcnJheVtpXTtcXG4gICAgICAgICAgICBsZXQgaW5kZXggPSB0ZXh0LmluZGV4T2YodGFyZ2V0KTtcXG4gICAgICAgICAgICBpZiAoaW5kZXggPT09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnJheVtpXSA9IHRleHQuc2xpY2UoMCwgaW5kZXgpO1xcbiAgICAgICAgICAgIGFycmF5W2kgKyAxXSA9IHRleHQuc2xpY2UoaW5kZXggKyB0YXJnZXQubGVuZ3RoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBhcnJheTtcXG4gICAgfSxcXG4gICAgY2h1bmsoYXJyLCBzaXplKSB7XFxuICAgICAgICB2YXIgcmVzdWx0ID0gW107XFxuICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gYXJyLmxlbmd0aDsgaSA8IGxlbjsgaSArPSBzaXplKSB7XFxuICAgICAgICAgICAgcmVzdWx0LnB1c2goYXJyLnNsaWNlKGksIGkgKyBzaXplKSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICB9LFxcbiAgICBoaWtlclBpYyh1cmwpIHtcXG4gICAgICAgIHZhciBoZWFkZXJzID0ge307XFxuICAgICAgICBsZXQgdXJscyA9IHVybC5zcGxpdChcXFwiQFxcXCIpO1xcbiAgICAgICAgbGV0IHBpY1VybCA9IHVybHMuc2hpZnQoKTtcXG4gICAgICAgIGxldCBsZW5ndGggPSB1cmxzLmxlbmd0aDtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgW2tleSwgdmFsdWVdID0gdi5zcGxpdCh1cmxzW2ldLCBcXFwiPVxcXCIpO1xcbiAgICAgICAgICAgIGlmIChrZXkgPT09IFxcXCJoZWFkZXJzXFxcIikge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihoZWFkZXJzLCBKU09OLnBhcnNlKHZhbHVlKSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkuaW5jbHVkZXMoXFxcIi5cXFwiKSB8fCBrZXkuaW5jbHVkZXMoXFxcIj9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICBwaWNVcmwgKz0gXFxcIkBcXFwiICsga2V5ICsgKHZhbHVlID8gXFxcIj1cXFwiICsgdmFsdWUgOiBcXFwiXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkgIT09IFxcXCJqc1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyc1trZXldID0gdmFsdWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFtwaWNVcmwsIGhlYWRlcnNdO1xcbiAgICB9LFxcbiAgICByYW5nZShzdGFydCwgZW5kKSB7XFxuICAgICAgICByZXR1cm4gQXJyYXkoZW5kIC0gc3RhcnQpLmZpbGwoMCkubWFwKChlbCwgaSkgPT4gc3RhcnQgKyBpKTtcXG4gICAgfSxcXG4gICAgcGljRG93bmxvYWQodXJsLCBwYXRoLCBoZWFkZXJzLCBkZWNpcGhlKSB7XFxuICAgICAgICBpZiAodHlwZW9mIGRlY2lwaGUgPT09IFxcXCJzdHJpbmdcXFwiICYmIGRlY2lwaGUubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgIGxldCBpbnN0cmVhbTtcXG4gICAgICAgICAgICBsZXQgb3V0c3RyZWFtO1xcbiAgICAgICAgICAgIGxldCBmaWxlO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGZpbGUgPSBuZXcgamF2YS5pby5GaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICBpZiAoZmlsZS5leGlzdHMoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBkaXIgPSBmaWxlLmdldFBhcmVudEZpbGUoKTtcXG4gICAgICAgICAgICAgICAgaWYgKGRpciAhPSBudWxsICYmICFkaXIuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRpci5ta2RpcnMoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpbnN0cmVhbSA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtOiB0cnVlXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICBvdXRzdHJlYW0gPSBuZXcgamF2YS5pby5GaWxlT3V0cHV0U3RyZWFtKHBhdGgpO1xcbiAgICAgICAgICAgICAgICBsZXQgdCA9ICQuaGlrZXIuaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICBjID0gJC5oaWtlci51cmw7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSBpbnN0cmVhbTtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSB1cmw7XFxuICAgICAgICAgICAgICAgIGxldCBwaWNpbiA9IChuZXcgRnVuY3Rpb24oXFxcInJldHVybiBcXFwiICsgZGVjaXBoZSkpKCk7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSB0O1xcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IGM7XFxuICAgICAgICAgICAgICAgIGxldCBidWYgPSBqYXZhLmxhbmcucmVmbGVjdC5BcnJheS5uZXdJbnN0YW5jZShqYXZhLmxhbmcuQnl0ZS5UWVBFLCAxMDI0KTtcXG4gICAgICAgICAgICAgICAgbGV0IGxlbjtcXG4gICAgICAgICAgICAgICAgd2hpbGUgKChsZW4gPSBwaWNpbi5yZWFkKGJ1ZikpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICBvdXRzdHJlYW0ud3JpdGUoYnVmLCAwLCBsZW4pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBpZiAoZmlsZSBpbnN0YW5jZW9mIGphdmEuaW8uRmlsZSAmJiBmaWxlLmV4aXN0cygpKSB7XFxuICAgICAgICAgICAgICAgICAgICBmaWxlLmRlbGV0ZSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgI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ICAgICBjbGVhck15VmFyKFxcXCIudGdudW1cXFwiKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgIH0sIHR5cGUpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgIH0pO1xcbiAgICBpZiAodHlwZSA9PT0gXFxcInR4dFxcXCIpIHtcXG4gICAgICAgIGxldCB0eHRWaWV3ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZXh0ZXJuYWxpbXBvcnRUeHQudmlld1xcXCIpO1xcbiAgICAgICAgcmV0dXJuIHR4dFZpZXcobGF5b3V0KTtcXG4gICAgfVxcbiAgICBsZXQgdGFnID0gRmlsZS5nZXRGaWxlUGF0aChDb25maWdbdHlwZSArIFxcXCJQYXRoXFxcIl0sIFxcXCJkaXJcXFwiKTtcXG4gICAgaWYgKHRhZy5sZW5ndGggPT09IDApIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLorr7nva5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOW4ruWKqeKAneKAnVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2hlbHAudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5Iz9rZXl3b3JkPW5vdmVsQ29taWNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8aDEgc3R5bGU9XFxcInRleHQtYWxpZ246IGNlbnRlcjtcXFwiPuWVpemDveayoeacieiAtjwvaDE+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIHNldFJlc3VsdChsYXlvdXQpO1xcbiAgICB9XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHVybDogJ1xcXCJoaWtlcjovL3NlYXJjaD9zPVxcXCIraW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuaQnOS9oOaDs+imgeeahCNcXFwiICsgdHlwZSArIFxcXCIjLi4uLi4uXFxcIixcXG4gICAgICAgIHRpdGxlOiBcXFwi8J+UjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgcnVsZXM6ICQudG9TdHJpbmcoKHRhZywgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyMSA9IFtdO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRhZy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgYXJyMS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiB0YWdbaV0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoX3VybFxcXCI6IFxcXCJoaWtlcjovL2VtcHR5P2lzQWxsPTEmc2VhcmNoVGVybXM9KiomdHlwZT1cXFwiICsgdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoRmluZFxcXCI6IFxcXCJqczokLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9TZWFyY2gudmlldz9ydWxlPScrTVlfUlVMRS5fdGl0bGUpO1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShhcnIxKTtcXG4gICAgICAgICAgICB9LCB0YWcsIHR5cGUpLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3NlYXJjaEtleScsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdzZWFyY2hLZXknLGlucHV0KVxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi4oCY4oCY4pqZ6K6+572u4oCZ4oCZXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvU2V0dGluZy52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdmVyc2lvbjogTVlfUlVMRS52ZXJzaW9uXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcblxcbiAgICBmb3IgKGxldCBpIGluIHRhZykge1xcbiAgICAgICAgbGV0IGl0ID0gdGFnW2ldO1xcbiAgICAgICAgaWYgKHRnbnVtID09PSBpKSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnFxcXCIgKyBpdC5uYW1lICsgXFxcIuKAneKAnVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChbXFxcIuWIoOmZpOivpeebruW9lVxcXCIsIFxcXCLot7PovazlsI/nqIvluo9cXFwiLCBcXFwi5omT5byA5Lmm5p62XFxcIl0sIDEsIFxcXCLpgInmi6nmk43kvZxcXFwiKS5zZWxlY3QoKGl0LCB0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXFxcIui3s+i9rOWwj+eoi+W6j1xcXCIgPT09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2hvbWVAXFxcIiArIGl0Lm5hbWU7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoXFxcIuWIoOmZpOivpeebruW9lVxcXCI9PT1pbnB1dCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gdGhlbihbXFxcIuivpeaTjeS9nOS4jeS8muWIoOmZpOWwj+eoi+W6j++8jOS9huivpeWwj+eoi+W6j+S4i+i9veeahOaJgOaciea8q+eUu+Wwhuiiq+WIoOmZpFxcXCJdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi6K+l5pON5L2c5LiN5Lya5Yig6Zmk5bCP56iL5bqP77yM5L2G6K+l5bCP56iL5bqP5LiL6L2955qE5omA5pyJIOa8q+eUuy/lsI/or7Qg5bCG6KKr5Yig6ZmkXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiLnRnbnVtXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0LnBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvQm9va3JhY2sudmlldz9ydWxlPeacrOWcsOi1hOa6kOeuoeeQhiZydWxlTmFtZT1cXFwiK2l0Lm5hbWUrXFxcIiZ0eXBlPVxcXCIrdHlwZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXQsIHR5cGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0Lm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCIudGdudW1cXFwiLCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBsZXQgcGF0aCA9IHRhZ1t0Z251bV0ucGF0aDtcXG4gICAgbGV0IG1obGlzdCA9IEZpbGUuZ2V0RmlsZVBhdGgocGF0aCwgXFxcImRpclxcXCIpO1xcblxcbiAgICBpZiAobWhsaXN0Lmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCLllaXpg73msqHmnInogLZcXFwiLmJpZygpLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICByZXR1cm4gc2V0UmVzdWx0KGxheW91dCk7XFxuICAgIH1cXG4gICAgbGV0IHBhZ2VVcmwgPSB0eXBlID09PSBcXFwibm92ZWxcXFwiID8gXFxcImhpa2VyOi8vcGFnZS9Ob3ZlbEJyb3dzZXIudmlld1xcXCIgOiBcXFwiaGlrZXI6Ly9wYWdlL0NvbWljQnJvd3Nlci52aWV3XFxcIjtcXG4gICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXG4gICAgICAgIGxldCBwaWMgPSBmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgaXRlbS5wYXRoICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lICsgXFxcIi5qcGdcXFwiKSA/IGl0ZW0ucGF0aCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCIuanBnXFxcIiA6IENvbmZpZy5kZWZfUGljO1xcbiAgICAgICAgbGV0IG5hbWVzPVN0cmluZyhpdGVtLm5hbWUpLnNwbGl0KFxcXCIkXFxcIik7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IG5hbWVzWzBdLFxcbiAgICAgICAgICAgIGRlc2M6IG5hbWVzWzFdLFxcbiAgICAgICAgICAgIHBpY191cmw6IHBpYyxcXG4gICAgICAgICAgICB1cmw6IHR5cGUgPT09IFxcXCJub3ZlbFxcXCIgP3BhZ2VVcmwgKyBcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGU6JChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFnZVVybCwgcGF0aCk9PntcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibG9uZ1ByZXNzLmpzXFxcIikuc2luZ2xlRW50ZXIocGFnZVVybCwgcGF0aCk7XFxuICAgICAgICAgICAgfSwgcGFnZVVybCwgaXRlbS5wYXRoKSxcXG4gICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbihpdGVtLCB7XFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibG9uZ1ByZXNzLmpzXFxcIikuZGVsZXRlRmlsZUZvckJvb2socGF0aClcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0ucGF0aCl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GxldCB0aXRsZSA9IGdldFRpdGxlKGl0ZW0ubmFtZSk7XFxuICAgICAgICAgICAgYXJyYXkucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2NvbWljQ29tcGF0aWJsZS52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjP3BhdGg9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChpdGVtLnBhdGgpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9Db21pY19TdHlsZSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaXRlbS5wYXRoICsgXFxcIi8xLmpwZ1xcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhdGgsXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0VGl0bGUyKGl0ZW0ubmFtZSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxufSBlbHNlIHtcXG4gICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXG4gICAgICAgIGxldCBuYW1lID0gZ2V0VGl0bGUyKGl0ZW0ubmFtZSk7XFxuICAgICAgICBhcnJheS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOWIoOmZpFtcXFwiICsgbmFtZSArIFxcXCJd77yfXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgIC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AobGV0IHNvbkRpciBvZiBjb21pY1J1bGVEaXJzKSB7XFxuICAgIGxldCBjb21pY0xpc3QgPSBGaWxlLmdldEZpbGVQYXRoKHNvbkRpci5wYXRoLCBcXFwiZGlyXFxcIik7XFxuICAgIGZvciAobGV0IGNvbWljIG9mIGNvbWljTGlzdCkge1xcbiAgICAgICAgaWYgKHNlYXJjaFRlc3QoY29taWMubmFtZSkpIHtcXG4gICAgICAgICAgICBzZWFyY2hSZXN1bHQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjb21pYy5uYW1lLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBjb21pYy5wYXRoICsgXFxcIi9cXFwiICsgY29taWMubmFtZSArIFxcXCIuanBnXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBwYWdlVXJsICsgXFxcIj9ydWxlPVxcXCIgKyBNWV9SVUxFLl90aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogc29uRGlyLm5hbWUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBjb21pY1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxufVxcbnNldFJlc3VsdChzZWFyY2hSZXN1bHQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiI3Yu6K6+572uXCIsXCJwYXRoXCI6XCJTZXR0aW5nLnZpZXdcIixcInJ1bGVcIjpcImpzOlxcbnNldFBhZ2VUaXRsZShNWV9SVUxFLnRpdGxlICsgXFxcInzorr7nva5cXFwiKTtcXG5jb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNcXFwiKTtcXG5cXG5sZXQgbGF5b3V0ID0gW107XFxuXFxubGF5b3V0LnB1c2goe1xcbiAgICB0aXRsZTogXFxcIjxzdHJvbmc+5Z+656GA6K6+572uPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgY29sX3R5cG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lX2xhdGVcXFwiKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgZm9yIChsZXQgaSA9IHN0YXJ0OyBpIDw9IDQ7IGkrKykge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlm77niYdcXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJtb3ZpZV8zXFxcIixcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcImhpa2VyOi8vaW1hZ2VzL2hvbWVfcGljXFxcIiArIGksXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShzZXREZWZhdWx0UGljLCBcXFwiaGlrZXI6Ly9pbWFnZXMvaG9tZV9waWNcXFwiICsgaSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuiHquWumuS5ieKelVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChbXFxcIuiHquWumuS5iXVybFxcXCIsIFxcXCLpgInmi6nmlofku7bot6/lvoRcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi6Ieq5a6a5LmJdXJsXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLovpPlhaXlm77niYfnmoTot6/lvoTmiJbogIXpk77mjqVcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgMCkgfHwgXFxcInt9XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlnLmRlZl9QaWMgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSAkLnJlcXVpcmUocmVxdWlyZVVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIDApIHx8IFxcXCJ7fVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IFxcXCJmaWxlOi8vXFxcIiArIFBBVEg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiOmRlZmF1bHRQaWNCYWNrXFxcIiwgXFxcInRydWVcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qcGd8LmpwZWd8LmdpZnwucG5nfC5zdmd8LmJtcFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXCJjb25maXJtXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yZTogXFxcInNlbGVjdFBhdGhDYWNoZTJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lbW9yeVBhdGg6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSBcXFwicmVwbGFjZVJ1bGVcXFwiOlxcbiAgICAgICAgaWYgKE1ZX1BBUkFNUy5pc1JlZnJlc2gpIHtcXG4gICAgICAgICAgICBhZGRMaXN0ZW5lcihcXFwib25DbG9zZVxcXCIsICQudG9TdHJpbmcoKCkgPT4gcmVmcmVzaFBhZ2UoKSkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXCLmm7/mjaLop4TliJl86K6+572uXFxcIik7XFxuICAgICAgICBsZXQgcnVsZUxpc3QgPSBbXTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn6ZSZ6K+v5o+Q56S6JyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+abv+aNouaVsOaNruivu+WPluWksei0pe+8jOaYr+WQpuWIneWni+WMlu+8n1xcXFxu6K+l5pON5L2c5Lya5riF6Zmk5L2g55qE5pu/5o2i5pWw5o2uISEhJyxcXG4gICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5Yid5aeL5YyW5a6M5oiQXFxcIik7XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgLy90b2FzdChcXFwi5Y+W5raIXFxcIik7XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuaWsOW7uuabv+aNolxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2lzTmV3PXRydWVcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLlr7zlh7rop4TliJlcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5a+85Ye6XFxcIiArIHJ1bGVMaXN0Lmxlbmd0aCArIFxcXCLmnaHop4TliJn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idG9hc3Q6Ly/ojrflj5bmlofku7bkuLrnqbpcXFwiO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdSdWxlTGlzdCA9IEpTT04ucGFyc2UocnVsZVRleHQpO1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdDb3VudCA9IDAsXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCA9IDA7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gbmV3UnVsZUxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBuZXdSdWxlID0gbmV3UnVsZUxpc3RbaV07XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcInJlcGxhY2VtZW50XFxcIikgfHwgIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcInBhdHRlcm5cXFwiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFwibmFtZVxcXCIpIHx8IChuZXdSdWxlLnNjb3BlQ29udGVudCA9PT0gdW5kZWZpbmVkID8gZmFsc2UgOiAhbmV3UnVsZS5zY29wZUNvbnRlbnQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSBuZXdSdWxlLmlkO1xcbiAgICAgICAgICAgICAgICAgICAgbmV3UnVsZS5pZCA9IGlkIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkSW5kZXggPSBydWxlTGlzdC5maW5kSW5kZXgocnVsZSA9PiBydWxlLmlkID09PSBpZCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaWRJbmRleCA+IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQrKztcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5zcGxpY2UoaWRJbmRleCwgMSwgbmV3UnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NvdW50Kys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3QucHVzaChuZXdSdWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxuICAgICAgICAgICAgICAgIGlmIChpc2JhY2spIHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbG9nKFxcXCJcXFxcbui3r+W+hO+8mlxcXCIgKyBpbnB1dCArIFxcXCJcXFxcbuaAu+inhOWImeaVsO+8mlxcXCIgKyBuZXdSdWxlTGlzdC5sZW5ndGggKyBcXFwiXFxcXG7mm7TmlrDop4TliJkgXFxcIiArIHVwZGF0ZUNvdW50ICsgXFxcIiDmnaFcXFxcdOaWsOWinuinhOWImSBcXFwiICsgbmV3Q291bnQgKyBcXFwiIOadoVxcXCIpO1xcbiAgICAgICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlzYmFjaykgYmFjaygpO1xcbiAgICAgICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5aSx6LSlXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5a+85YWl6KeE5YiZXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLlpJbpg6jmlofku7ZcXFwiLCBcXFwi5YaF6YOo5paH5Lu2XFxcIl0sIDEsIFxcXCLop4TliJnlr7zlhaVcXFwiKS5zZWxlY3QoKGltcG9ydFJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi5aSW6YOo5paH5Lu2XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJmaWxlU2VsZWN0Oi8vXFxcIiArICQudG9TdHJpbmcoaW1wb3J0UnVsZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKGltcG9ydFJ1bGUsIHRydWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIuanNvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXCJjb25maXJtXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXCJzZWxlY3RQYXRoQ2FjaGVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGltcG9ydFJ1bGUpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBmb3IgKGxldCBpID0gMCwgbGVuID0gcnVsZUxpc3QubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgcmVwbGFjZVJ1bGUgPSBydWxlTGlzdFtpXTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiByZXBsYWNlUnVsZS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGksXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGlkLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIpIHx8IFxcXCJbXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGcgPSBydWxlTGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9kZWxldGVJdGVtQnlDbHMoaWQgKyBcXFwiLlxcXCIgKyBpbmRleCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5Yig6Zmk5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpZCwgaSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi57yW6L6RXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2luZGV4PVxcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgXFxcImNvbnRlbnRzXFxcIjpcXG4gICAgICAgIGxldCBmID0gcmVxdWlyZShcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCIpO1xcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXCLnm67lvZXorr7nva586K6+572uXFxcIik7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLpgInmi6nmlofku7blpLlcXFwiLFxcbiAgICAgICAgICAgIHVybDogSlNPTi5zdHJpbmdpZnkoZi5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gZmluZEl0ZW0oaWQpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgICAgICAgICBpbml0aWFsUGF0aDogQ29uZmlnLmhvbWVQYXRoLFxcbiAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCIsXFxuICAgICAgICAgICAgICAgIHBhdHRlcm46IDFcXG4gICAgICAgICAgICB9KSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuaUr+aMgWhpa2VyOi8vZmlsZXPot6/lvoQo6K+l5pON5L2c5LiN5Lya5Yid5aeL5YyW55uu5b2VKVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBDb25maWcuaG9tZVBhdGgsXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoaWQsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgICAgICAgICBpZDogaWRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuehruiupFxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgaW5wdXQgPSBnZXRNeVZhcihpZCwgZmluZEl0ZW0oaWQpLmV4dHJhLmRlZmF1bHRWYWx1ZSB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwiaGlrZXI6Ly9maWxlcy9cXFwiKSkgaW5wdXQgPSBnZXRQYXRoKGlucHV0KS5zbGljZSg3KTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LmVuZHNXaXRoKFxcXCIvXFxcIikpIGlucHV0ID0gaW5wdXQucmVwbGFjZSgvXFxcXC8kLywgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLmhvbWVQYXRoID09IGlucHV0KSByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5piv5b2T5YmN55uu5b2VXFxcIjtcXG4gICAgICAgICAgICAgICAgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCAwKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICAgICAgQ29uZmlnLmhvbWVQYXRoID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lkv53lrZhcXFwiO1xcbiAgICAgICAgICAgIH0sIGlkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICBicmVhaztcXG59XFx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cnVlOiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICRpZCxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShib29rSW5mbykpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCArIGksIHJlcGxhY2VSdWxlLCBNWV9QQVJBTVMucGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5YWz6ZetXFxcIixcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoJGlkLCByZXBsYWNlUnVsZSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgIGlmICghZmluZEl0ZW0oJGlkKS5leHRyYS5pc1RydWUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWFs+mXrVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBbXVxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIikgfHwgXFxcInt9XFxcIikpO1xcbiAgICAgICAgICAgIGJvb2tJbmZvLnNlbGVjdGVkLnNwbGljZShib29rSW5mby5zZWxlY3RlZC5pbmRleE9mK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cXFwiLCBcXFwi5rW36ZiU6YCJ5oup5ZmoXFxcIl0sIDEsIFxcXCLpgInmi6nlmajnsbvlnotcXFwiKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIuezu+e7n+mAieaLqeWZqFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJmaWxlU2VsZWN0Oi8vXFxcIiArICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEvKFxcXFwudHh0fC5lcHViKSQvaS50ZXN0KGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLpgInmi6nkuobplJnor6/nmoTmlofku7bnsbvlnotcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlTWF0Y2ggPSBpbnB1dC5tYXRjaCgvXFxcXC8oW15cXFxcL10qPykoXFxcXC50eHR8XFxcXC5lcHViKSQvaSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbm92ZWxOYW1lID0gZmlsZU1hdGNoWzFdLnJlcGxhY2UoXFxcIl9maWxlU2VsZWN0X1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGggPSBDb25maWcuZXh0ZXJuYWxJbXBvcnRQYXRoICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aENhY2hlID0gQ29uZmlnLmNvbnRlbnRzQ2FjaGUgKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IGlucHV0LnJlcGxhY2UoXFxcImZpbGU6Ly9cXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlr7zlhaXmj5DnpLpcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBcXFwi5bey5a2Y5ZyoW1xcXCIgKyBub3ZlbE5hbWUgKyBcXFwiXeaYr+WQpuimhueblj9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIjtcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSAkLnJlcXVpcmUocmVxdWlyZVVybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmaWxlTWF0Y2ggPSBQQVRILm1hdGNoKC9cXFxcLyhbXlxcXFwvXSo/KShcXFxcLnR4dHxcXFxcLmVwdWIpJC9pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm92ZWxOYW1lID0gZmlsZU1hdGNoWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGggPSBDb25maWcuZXh0ZXJuYWxJbXBvcnRQYXRoICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXRoID0gUEFUSDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuW3suWtmOWcqFtcXFwiICsgbm92ZWxOYW1lICsgXFxcIl3mmK/lkKbopobnm5Y/XFxcIikuY29uZmlybSgocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLnR4dHwuZXB1YlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmU6IFxcXCJzZWxlY3RQYXRoQ2FjaGUxXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIG1lbW9yeVBhdGg6IHRydWVcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgbGV0IG9wdGlvbnMgPSBbXFxcIumYheivu1xcXCIsIFxcXCLliIbkuqtcXFwiLCBcXFwi5Yig6ZmkXFxcIiwgXFxcIuaJk+W8gOaWueW8j1xcXCJdO1xcblxcbiAgICBsZXQgcGF0dGVybiA9IGdldE15VmFyKFxcXCI6dHh0UGF0dGVyblxcXCIsIG9wdGlvbnNbMF0pO1xcbiAgICBsZXQgaWQgPSBEYXRlLm5vdygpICsgXFxcIjrmqKHlvI9cXFwiO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB0aXRsZTogcGF0dGVybixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgIHVybDogJChvcHRpb25zLCAxLCBcXFwi5pON5L2c5qih5byPXFxcIikuc2VsZWN0KChpZCkgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCI6dHh0UGF0dGVyblxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpbnB1dFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB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4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiLmpzb25cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHBhdGggKyBcXFwiLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGF0aClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlIFxcXCLpmIXor7tcXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gKHR5cGU9PT1cXFwiLnR4dFxcXCI/XFxcImhpa2VyOi8vcGFnZS90eHRQYXJzZXIudmlld1xcXCI6XFxcImhpa2VyOi8vcGFnZS9lcHViUGFyc2VyLnZpZXcjYXV0b0NhY2hlI1xcXCIpK1xcXCI/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSBcXFwi5omT5byA5pa55byPXFxcIjpcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJvcGVuRmlsZTovL2ZpbGU6Ly9cXFwiICsgcGF0aDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG4gICAgZm9yIChsZXQgbm92ZWwgb2YgZmlsZXMpIHtcXG4gICAgICAgIGxldCB0eXBlID0gbm92ZWwubmFtZS5zdWJzdHJpbmcobm92ZWwubmFtZS5sYXN0SW5kZXhPZihcXFwiLlxcXCIpKTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUob3BlcmF0aW9uLCBub3ZlbC5wYXRoLCBub3ZlbC5uYW1lLCB0eXBlKSxcXG4gICAgICAgICAgICBkZXNjOiBcXFwi5aSn5bCP77yaXFxcIiArIEZpbGUuZ2V0RmlsZVNpemUobm92ZWwucGF0aCkgKyBcXFwiXFxcXG7kv67mlLnml7bpl7TvvJpcXFwiICsgJC5kYXRlRm9ybWF0KG5vdmVsLmxhc3RNb2RpZmllZCwgXFxcInl5eXktTU0tZGQgSEg6bW06c3NcXFwiKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcGF0aDogbm92ZWwucGF0aCxcXG4gICAgICAgICAgICAgICAgaXNDYWNoZTogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5vdmVsLm5hbWUsXFxuICAgICAgICAgICAgICAgIGlkOiBub3ZlbC5wYXRoLFxcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcInNoYXJlOi8vXFxcIiArIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6ZiF6K+7XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeSgodHlwZT09PVxcXCIudHh0XFxcIj9cXFwiaGlrZXI6Ly9wYWdlL3R4dFBhcnNlci52aWV3XFxcIjpcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcIikrXFxcIj9ydWxlPVxcXCIgKyBNWV9SVUxFLnRpdGxlKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaJk+W8gOaWueW8j1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXCIgKyBub3ZlbC5wYXRoKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxvbmdQcmVzcy5qc1xcXCIpLmRlbGV0ZUZpbGVGb3JUeHQocGF0aClcXG4gICAgICAgICAgICAgICAgICAgIH0sIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgaWYgKGZpbGVzLmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6K6+572uXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvU2V0dGluZy52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM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mZpZy5jb250ZW50c0NhY2hlKTtcXG4gICAgaWYgKGlzQ2FjaGUmJmZpbGVFeGlzdChjYWNoZVBhdGgpKSB7XFxuICAgICAgICB0cnkge1xcblxcbiAgICAgICAgICAgIGxldCBjID0gSlNPTi5wYXJzZShyZXF1ZXN0KGNhY2hlUGF0aCkpO1xcbiAgICAgICAgICAgIGNoYXB0ZXJOYW1lcyA9IGMuY2hhcHRlck5hbWVzO1xcbiAgICAgICAgICAgIGludGVydmFscyA9IGMuaW50ZXJ2YWxzO1xcbiAgICAgICAgICAgIGhhc1ByZWZhY2UgPSBjLmhhc1ByZWZhY2U7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumHjeaWsOino+aekOebruW9lVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShwYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBwYXRoK1xcXCIuanNvblxcXCIpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6ZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6XFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgc2V0UmVzdWx0KFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHN0cm9uZz7nm67lvZXop6PmnpDlpLHotKUo6YeN5paw6Kej5p6QKTwvc3Ryb25nPlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShwYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBwYXRoK1xcXCIuanNvblxcXCIpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XSk7XFxuICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgfVxcblxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcIuato+WcqOino+aekOebruW9lVxcXCIpO1xcbiAgICAgICAgbGV0IHR4dCA9IHJlcXVlc3QocGF0aCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgLy9cXFwiY29udGVudC10eXBlXFxcIjogXFxcInRleHQvcGxhaW47IGNoYXJzdD1cXFwiICsgY2hhcnN0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgcGF0dGVybiA9IHJlZ3MuZ2V0VG9jUnVsZSh0eHQpO1xcbiAgICAgICAgaWYgKCFwYXR0ZXJuKSB7XFxuICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pTwvc3Ryb25nPlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBiYWNrKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XSk7XFxuICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IG1hdGNoZXIgPSBwYXR0ZXJuLm1hdGNoZXIodHh0KTtcXG4gICAgICAgIGxldCBwb2ludGVyID0gMDtcXG4gICAgICAgIHdoaWxlIChtYXRjaGVyLmZpbmQoKSkge1xcbiAgICAgICAgICAgIGxldCBzdGFydCA9IG1hdGNoZXIuc3RhcnQoKTtcXG4gICAgICAgICAgICBsZXQgZW5kID0gbWF0Y2hlci5lbmQoKTtcXG4gICAgICAgICAgICBsZXQgdCA9IG1hdGNoZXIuZ3JvdXAoKTtcXG4gICAgICAgICAgICBpZiAocG9pbnRlciA9PT0gMCAmJiBzdGFydCA+IDMwKSB7XFxuICAgICAgICAgICAgICAgIGhhc1ByZWZhY2UgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBja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8h5bygKSkpLnswLDMwfSRcXFwiLFxcbiAgICAgICAgXFxcImV4YW1wbGVcXFwiOiBcXFwi56ys5LiA56ugIOagh+WHhueahOeypOivreWwseaYr+i/meagt1xcXCIsXFxuICAgICAgICBcXFwic2VyaWFsTnVtYmVyXFxcIjogMVxcbiAgICB9LFxcbiAgICB7XFxuICAgICAgICBcXFwiaWRcXFwiOiAtMyxcXG4gICAgICAgIFxcXCJlbmFibGVcXFwiOiBmYWxzZSxcXG4gICAgICAgIFxcXCJuYW1lXFxcIjogXFxcIuebruW9lSjljLnphY3nroDku4spXFxcIixcXG4gICAgICAgIFxcXCJydWxlXFxcIjogXFxcIig/PD1b44CAXFxcXFxcXFxzXSkoPzooPzrlhoXlrrl85paH56ugKT/nroDku4t85paH5qGIfOWJjeiogHzluo/nq6B85qWU5a2QfOato+aWhyg/IeWujHznu5MpfOe7iOeroHzlkI7orrB85bC+5aOwfOeVquWklnznrKw/XFxcXFxcXFxzezAsNH1bXFxcXFxcXFxk44CH6Zu25LiA5LqM5Lik5LiJ5Zub5LqU5YWt5LiD5YWr5Lmd5Y2B55m+5Y2D5LiH5aO56LSw5Y+B6IKG5LyN6ZmG5p+S5o2M546W5ou+5L2w5LufXSs/XFxcXFxcXFxzezAsNH0oPzrnq6B86IqCKD8h6K++KXzljbd86ZuGKD8hW+WQiOWSjF0pfOmDqCg/IVvliIbotZvmuLhdKXzlm54oPyFb5ZCI5p2l5LqL5Y67XSl85Zy6KD8hW+WSjOWQiOavlOeUteaYr10pfOevhyg/IeW8oCkpKS57MCwzMH0kXFxcIixcXG4gICAgICAgIFxcXCJleGFtcGxlXFxcIjogXFxcIueugOS7iyDogIHlpKvor7jokZvmnZHlpKtcXFwiLFxcbiAgICAgICAgXFxcInNlcmlhbE51bWJlclxcXCI6IDJcXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgXFxcImlkXFxcIjogLTQsXFxuICAgICAgICBcXFwiZW5hYmxlXFxcIjogZmFsc2UsXFxuICAgICAgIC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VcXFwiOiBcXFwi44CO5Yqg5Liq55u06KeS5byV5Y+35pu05LiT5Lia44CPXFxcIixcXG4gICAgICAgIFxcXCJzZXJpYWxOdW1iZXJcXFwiOiAxMVxcbiAgICB9LFxcbiAgICB7XFxuICAgICAgICBcXFwiaWRcXFwiOiAtMTQsXFxuICAgICAgICBcXFwiZW5hYmxlXFxcIjogdHJ1ZSxcXG4gICAgICAgIFxcXCJuYW1lXFxcIjogXFxcIueJueauiuespuWPtyDmoIfpopgo5Y2V5LiqKVxcXCIsXFxuICAgICAgICBcXFwicnVsZVxcXCI6IFxcXCIoPzw9W1xcXFxcXFxcc+OAgF17MCw0fSkoPzpb4piG4piF4pym4pynXS57MSwzMH18KD865YaF5a65fOaWh+eroCk/566A5LuLfOaWh+ahiHzliY3oqIB85bqP56ugfOallOWtkHzmraPmlocoPyHlrox857uTKXznu4jnq6B85ZCO6K6wfOWwvuWjsHznlarlpJYpWyDjgIBdezAsNH0kXFxcIixcXG4gICAgICAgIFxcXCJleGFtcGxlXFxcIjogXFxcIuKYhuOAgeaZi+axn+S9nOiAheacgOWWnOasoueahOagvOW8j1xcXCIsXFxuICAgICAgICBcXFwic2VyaWFsTnVtYmVyXFxcIjogMTJcXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgXFxcImlkXFxcIjogLTE1LFxcbiAgICAgICAgXFxcImVuYWJsZVxcXCI6IHRydWUsXFxuICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLnq6Av5Y23IOW6j+WPtyDmoIfpophcXFwiLFxcbiAgICAgICAgXFxcInJ1bGVcXFwiOiBcXFwiXlsgXFxcXFxcXFx044CAXXswLDR9KD86KD865YaF5a65fOaWh+eroCk/566A5LuLfOaWh+ahiHzliY3oqIB85bqP56ugfOallOWtkHzmraPmlocoPyHlrox857uTKXznu4jnq6B85ZCO6K6wfOWwvuWjsHznlarlpJZ8W+WNt+eroF1bXFxcXFxcXFxk44CH6Zu25LiA5LqM5Lik5LiJ5Zub5LqU5YWt5Li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UNvZGUpO1xcbiAgICAgICAgcGljTGlzdCA9IGdldFBpY0xpc3QoaXRlbS51cmwsIGl0ZW0udXJsLCBvcmRlciwgaXRlbS50aXRsZSk7XFxuICAgICAgICBpZiAodHlwZW9mIHBpY0xpc3QgPT09IFxcXCJzdHJpbmdcXFwiKSB7XFxuICAgICAgICAgICAgcGljTGlzdCA9IHBpY0xpc3QucmVwbGFjZShcXFwicGljczovL1xcXCIsIFxcXCJcXFwiKS5zcGxpdChcXFwiJiZcXFwiKTtcXG4gICAgICAgIH1cXG4gICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgZS5tZXNzYWdlID0gXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor68+IFxcXCIgKyBlLm1lc3NhZ2U7XFxuICAgICAgICB0aHJvdyBlO1xcbiAgICB9XFxuICAgIHBpY0xpc3QgPSBwaWNMaXN0LmZpbHRlcihwID0+IHApO1xcbiAgICBjb25zdCBMID0gcGljTGlzdC5sZW5ndGg7XFxuICAgIGlmIChMID09PSAwKSB7XFxuICAgICAgICB0b2FzdChcXFwi5Zu+54mH6ZO+5o6l5Li656m6XFxcIik7XFxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor6/vvJrlm77niYfpk77mjqXov5Tlm57kuLrnqbo+XFxcIik7XFxuICAgIH1cXG4gICAgaWYgKGluZm8uYm9va1RvcFBpYykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgYm9va1RvcFBpYyA9IFRvb2wuaGlrZXJQaWMoaW5mby5ib29rVG9wUGljKTtcXG4gICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKGJvb2tUb3BQaWNbMF0sIG1haW5QYXRoICsgaW5mby5ib29rTmFtZSArIGlkICsgXFxcIi5qcGdcXFwiLCBib29rVG9wUGljWzFdLCBpbmZvLmRlY29kZSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKFxcXCI85bCB6Z2i5LiL6L296ZSZ6K+vPiBcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbiAgICBsZXQgZXJyb3JOdW0gPSAwO1xcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IEw7IGkrKykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgcGljID0gVG9vbC5oaWtlclBpYyhwaWNMaXN0W2ldKTtcXG4gICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKHBpY1swXSwgY2hhcHRlclBhdGggKyAoaSArIDEpICsgXFxcIi5qcGdcXFwiLCBwaWNbMV0sIGluZm8uZGVjb2RlKTtcXG4gICAgICAgICAgICBpZiAoaW50ZXJydXB0ICYmIGdldE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiXFxcIikgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGVycm9yTnVtID0gMDtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBpZiAoZXJyb3JOdW0gPCAxMCkge1xcbiAgICAgICAgICAgICAgICBpLS07XFxuICAgICAgICAgICAgICAgIGVycm9yTnVtKys7XFxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9XFxuXFxuICAgIEZpbGUucmVuYW1lRmlsZShjaGFwdGVyUGF0aCwgb3JkZXIgKyBcXFwiJEEkXFxcIiArIFRvb2wudGV4dFNoaWVsZChpdGVtLnRpdGxlKSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiI3Yu5ryr55S75YW85a65XCIsXCJwYXRoXCI6XCJjb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XFxcIuKGk1xcXCIgOiBcXFwi4oaRXFxcIjtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdGl0bGViID0gXFxcIuKGlVxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlYSArIHRpdGxlYixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJhbmtNZXRob2QgPSBnZXRJdGVtKFxcXCJib29rcmFjazpyYW5rTWV0aG9kXFxcIiwgXFxcIuezu+e7n1xcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgcmFua0lzUmV2ZXJzZSA9IGdldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtJc1JldmVyc2VcXFwiLCBcXFwiXFxcIik7XFxuXFxuICAgICAgICAgICAgICAgIGlmIChyYW5rTWV0aG9kID09PSBuYW1lKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocmFua0lzUmV2ZXJzZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtJc1JldmVyc2UgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFua0lzUmV2ZXJzZSA9IFxcXCIxXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtJc1JldmVyc2VcXFwiLCByYW5rSXNSZXZlcnNlKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtJc1JldmVyc2Vc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GUsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsb25nUHJlc3MuanNcXFwiKS5kZWxldGVGaWxlRm9yQm9vayhwYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0uZ2V0UGF0aCgpKVxcbiAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZ2V0UGF0aCgpLFxcbiAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLmdldFBhdGgoKSxcXG4gICAgICAgICAgICAgICAgbmFtZTogaXRlbS5nZXROYW1lKClcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBpZiAocmFua0lzUmV2ZXJzZSkge1xcbiAgICAgICAgYm9va0xpc3QucmV2ZXJzZSgpO1xcbiAgICB9XFxuXFxuICAgIHNldFJlc3VsdChsYXlvdXQuY29uY2F0KGJvb2tMaXN0KSk7XFxufSkoKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLuaWh+S7tuaOkuW6j1wiLFwicGF0aFwiOlwiZmlsZVJhbmsuanNcIixcInJ1bGVcIjpcImpzOlxcbmNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcIkZpbGUuanNcXFwiKTtcXG5sZXQgY2huTnVtQ2hhciA9IHtcXG4gICAg6Zu2OiAwLFxcbiAgICDkuIA6IDEsXFxuICAgIOS6jDogMixcXG4gICAg5LiJOiAzLFxcbiAgICDlm5s6IDQsXFxuICAgIOS6lDogNSxcXG4gICAg5YWtOiA2LFxcbiAgICDk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AgICAgIGRlbGV0ZUZpbGUocGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFwiLmpzb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOmZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOlxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlKOmHjeaWsOino+aekCk8L3N0cm9uZz5cXFwiLmJpZygpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUocGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFwiLmpzb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfV0pO1xcbiAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgIH1cXG5cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXCLmraPlnKjop6PmnpDnm67lvZVcXFwiKTtcXG4gICAgICAgIGxldCB0eHQgPSByZXF1ZXN0KHBhdGgsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgIC8vXFxcImNvbnRlbnQtdHlwZVxcXCI6IFxcXCJ0ZXh0L3BsYWluOyBjaGFyc3Q9XFxcIiArIGNoYXJzdFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHBhdHRlcm4gPSByZWdzLmdldFRvY1J1bGUodHh0KTtcXG4gICAgICAgIGlmICghcGF0dGVybikge1xcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgc2V0UmVzdWx0KFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHN0cm9uZz7nm67lvZXop6PmnpDlpLHotKU8L3N0cm9uZz5cXFwiLmJpZygpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfV0pO1xcbiAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBtYXRjaGVyID0gcGF0dGVybi5tYXRjaGVyKHR4dCk7XFxuICAgICAgICBsZXQgcG9pbnRlciA9IDA7XFxuICAgICAgICB3aGlsZSAobWF0Y2hlci5maW5kKCkpIHtcXG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBtYXRjaGVyLnN0YXJ0KCk7XFxuICAgICAgICAgICAgbGV0IGVuZCA9IG1hdGNoZXIuZW5kKCk7XFxuICAgICAgICAgICAgbGV0IHQgPSBtYXRjaGVyLmdyb3VwKCk7XFxuICAgICAgICAgICAgaWYgKHBvaW50ZXIgPT09IDAgJiYgc3RhcnQgPiAzMCkge1xcbiAgICAgICAgICAgICAgICBoYXNQcmVmYWNlID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY2hhcHRlck5hbWVzLnB1c2godCk7XFxuICAgICAgICAgICAgaW50ZXJ2YWxzLnB1c2goW3BvaW50ZXIsIHN0YXJ0XSk7XFxuICAgICAgICAgICAgcG9pbnRlciA9IGVuZDtcXG4gICAgICAgIH1cXG4gICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCB0eHQubGVuZ3RoXSk7XFxuICAgICAgICBpZiAoaXNDYWNoZSkge1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShjYWNoZVBhdGgsIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWVzOiBjaGFwdGVyTmFtZXMsXFxuICAgICAgICAgICAgICAgIGludGVydmFsczogaW50ZXJ2YWxzLFxcbiAgICAgICAgICAgICAgICBoYXNQcmVmYWNlOiBoYXNQcmVmYWNlXFxuICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgfVxcblxcblxcbiAgICBpZiAoaGFzUHJlZmFjZSkge1xcbiAgICAgICAgbGV0IGludGVydmFsID0gaW50ZXJ2YWxzWzBdO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5bqP6KiAXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1RYVFZpZXdlci52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZTogXFxcIuW6j+iogFxcXCIsXFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXG4gICAgICAgICAgICAgICAgcGF0aDogcGF0aCxcXG4gICAgICAgICAgICAgICAgY2hhcnN0OiBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNoYXB0ZXJOYW1lcy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgbGV0IG5hbWUgPSBjaGFwdGVyTmFtZXNbaV07XFxuICAgICAgICBsZXQgaW50ZXJ2YWwgPSBpbnRlcnZhbHNbaSArIDFdO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvVFhUVmlld2VyLnZpZXcjYXV0b1BhZ2UjI3JlYWRUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXG4gICAgICAgICAgIC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cXG4gICAgfVxcXFxuICAgIGxldCBmbGFnID0gdHJ1ZTtcXFxcbiAgICAvLyDliKDpmaTmlofku7blpLnkuIvnmoTmiYDmnInmlofku7Yo5YyF5ous5a2Q55uu5b2VKVxcXFxuICAgIGxldCBmaWxlcyA9IGRpckZpbGUubGlzdEZpbGVzKCk7XFxcXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBmaWxlcy5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAvLyDliKDpmaTlrZDmlofku7ZcXFxcbiAgICAgICAgaWYgKGZpbGVzW2ldLmlzRmlsZSgpKSB7XFxcXG4gICAgICAgICAgICBmbGFnID0gZGVsZXRlRmlsZShmaWxlc1tpXS5nZXRBYnNvbHV0ZVBhdGgoKSk7XFxcXG4gICAgICAgICAgICBpZiAoIWZsYWcpIHtcXFxcbiAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSBlbHNlIHsgLy8g5Yig6Zmk5a2Q55uu5b2VXFxcXG4gICAgICAgICAgICBmbGFnID0gZGVsZXRlRGlyZWN0b3J5KGZpbGVzW2ldLmdldEFic29sdXRlUGF0aCgpKTtcXFxcbiAgICAgICAgICAgIGlmICghZmxhZykge1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIGlmICghZmxhZykge1xcXFxuICAgICAgICAvL2xvZyhcXFxcXFxcIuWIoOmZpOebruW9leWksei0pVxcXFxcXFwiKTtcXFxcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xcXFxuICAgIH1cXFxcbiAgICAvLyDliKDpmaTlvZPliY3nm67lvZVcXFxcbiAgICBpZiAoZGlyRmlsZS5kZWxldGUoKSkge1xcXFxuICAgICAgICAvL2xvZyhcXFxcXFxcIuWIoOmZpOebruW9lVxcXFxcXFwiICsgZGlyICsgXFxcXFxcXCLmiJDlip/vvIFcXFx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ICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIlvmraPlnKjlgZzmraIuLi5dXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFxcXFxcInx85LiL6L295o6n5Yi2XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5q2j5Zyo5Y+W5raI5LiL6L295Lu75YqhXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gXFxcXFxcXCIxXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+ato+WcqOaaguWBnC4uLlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09IFxcXFxcXFwiMlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5bey6YCA5Ye65LiL6L295ZmoXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFtcXFxcXFxcIjNcXFxcXFxcIiwgXFxcXFxcXCI0XFxcXFxcXCJdLmluY2x1ZGVzKHN0YXR1cykpIHtcXFxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKE1ZX0lEICsgXFxcXFxcXCI6aXNTdGFydFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKE1ZX0lEICsgXFxcXFxcXCI6c3RhdHVzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWY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ICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXSPlt7LlgZzmraLmiYDmnInku7vliqHvvIzkvYblt7LmnInov5vluqbkuI3kvJrmtojlpLEjXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwiW+mHjeaWsOW8gOWni11cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFxcXFxcInx85LiL6L295o6n5Yi2XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImJyZWFrXFxcXFxcXCI7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXFxcXFwiOnN0YXR1c1xcXFxcXFwiLCBcXFxcXFxcIjJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICBwdXRMb2coXFxcXFxcXCLkuIvovb3ku7vliqFbXFxcXFxcXCIgKyBpbmZvLmJvb2tOYW1lICsgXFxcXFxcXCJd5bey5YWo6YOo5oiQ5Yqf5a6M5oiQXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwiW+i/lOWbnl1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFxcXFxcInx85LiL6L295o6n5Yi2XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB0b2FzdChcXFxcXFxcIuS4i+i9veS7u+WKoVtc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Ub29sLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDEwOyBpKyspIHtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHBpYyA9IFRvb2wuaGlrZXJQaWModGFza1BhcmFtLnVybCk7XFxcXG4gICAgICAgICAgICAgICAgVG9vbC5waWNEb3dubG9hZChwaWNbMF0sIHRhc2tQYXJhbS5jaGFwdGVyUGF0aCArICh0YXNrUGFyYW0uaSArIDEpICsgXFxcXFxcXCIuanBnXFxcXFxcXCIsIHBpY1sxXSwgdGFza1BhcmFtLmRlY29kZSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKHRhc2tQYXJhbS5NWV9JRCArIFxcXFxcXFwiOnN0YXR1c1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKSA9PT0gXFxcXFxcXCIxXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBlcnJvck51bSA9IDA7XFxcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT09IDkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgcmV0dXJuIHRhc2tQYXJhbS5DSUQ7XFxcXG4gICAgfVxcXFxuICAgIGxldCBjb3VudCA9IDA7XFxcXG4gICAgbGV0IHRvdGFsQ291bnQgPSAwO1xcXFxuICAgIGxldCBzdWNjZXNzQ0lEID0gW107XFxcXG5cXFxcbiAgICBmdW5jdGlvbiBsaXN0ZW5lcihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIHRvdGFsQ291bnQrKztcXFxcblxcXFxuICAgICAgICAgICAgaWYgKGVycm9yICE9IG51bGwpIHtcXFxcbiAgICAgICAgICAgICAgICBwdXRMb2coXFxcXFxcXCJbbGlzdGVuZXJd5LiL6L295aSx6LSl77yaXFxcXFxcXCIgKyBpZCArIFxcXFxcXFwiPEVSUk9SQCBcXFxcXFxcIiArIGVycm9yICsgXFxcXFxcXCI+XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN1bHQgPT09IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeW3suWBnOatou+8mlxcXFxcXFwiICsgaWQpO1xcXFxuICAgICAgICAgICAgICAgIHRvdGFsQ291bnQgPSBwYXJhbS5waXZDb3VudDtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgY291bnQrKztcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmF0aW8gPSAoKGNvdW50IC8gcGFyYW0ucGl2Q291bnQpKS50b0ZpeGVkKDQpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBzdHJpcENvdW50ID0gTWF0aC5jZWlsKHJhdGlvICogMTApO1xcXFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbS5waXZDb3VudCA9PT0gdG90YWxDb3VudCAmJiB0b3RhbENvdW50ID09PSBjb3VudCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBzdWNjZXNzQ0lELnB1c2gocGFyYW0uQ0lEKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuS4i+i9vei/m+W6pu+8mlxcXFxcXFwiICsgKHN1Y2Nlc3NDSUQubGVuZ3RoKSArIFxcXFxcXFwiL1xcXFxcXFwiICsgcGFyYW0udG90YWwsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdXFxcXFxcXCIgKyBcXFxcXFxcIuKWh1xcXFxcXFwiLnJlcGVhdChzdHJpcENvdW50KS5mb250Y29sb3IoXFxcXFxcXCIjZmZhYzJkXFxcXFxcXCIpICsgXFxcXFxcXCLilodcXFxcXFxcIi5yZXBlYXQoMTAgLSBzdHJpcENvdW50KS5mb250Y29sb3IoXFxcXFxcXCIjZTVlMWU0XFxcXFxcXCIpICsgXFxcXFxcXCIgXFxcXFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFxcXFxcIiVcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXFxcXFwifHzkuIvovb3ov5vluqZcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgLy9wdXRMb2coXFxcXFxcXCJbbGlzdGVuZXJd5bey5a6M5oiQ5LiL6L2977yaXFxcXFxcXCIgKyBpZCk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAodG90YWxDb3VudCAhPT0gcGFyYW0ucGl2Q291bnQpIHJldHVybjtcXFxcbiAgICAgICAgICAgIGlmICh0b3RhbENvdW50ID09PSBjb3VudCkge1xcXFxuICAgICAgICAgICAgICAgIEZpbGUucmVuYW1lRmlsZShwYXJhbS5jaGFwdGVyUGF0aCwgcGFyYW0uQ0lEICsgXFxcXFxcXCIkQSRcXFxcXFxcIiArIFRvb2wudGV4dFNoaWVsZChwYXJhbS50aXRsZSkpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgdG90YWxDb3VudCA9IGNvd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+aekOmUmeivr++8muWbvueJh+mTvuaOpei/lOWbnuS4uuepuj5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBwaWNMaXN0ID0gcGljTGlzdC5maWx0ZXIocCA9PiBwKTtcXFxcbiAgICAgICAgdmFyIHRhc2tUZWFtID0gcGljTGlzdC5tYXAoKHVybCwgaSkgPT4gKHtcXFxcbiAgICAgICAgICAgIGZ1bmM6IHRhc2ssXFxcXG4gICAgICAgICAgICBpZDogaSxcXFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgaTogaSxcXFxcbiAgICAgICAgICAgICAgICBjaGFwdGVyUGF0aDogY2hhcHRlclBhdGgsXFxcXG4gICAgICAgICAgICAgICAgTVlfSUQ6IE1ZX0lELFxcXFxuICAgICAgICAgICAgICAgIGRlY29kZTogaW5mby5kZWNvZGVcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSkpO1xcXFxuICAgICAgICBiZSh0YXNrVGVhbSwge1xcXFxuICAgICAgICAgICAgZnVuYzogbGlzdGVuZXIsXFxcXG4gICAgICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgICAgIHBpdkNvdW50OiBwaWNMaXN0Lmxlbmd0aCxcXFxcbiAgICAgICAgICAgICAgICB0b3RhbDogY2hhcHRlclRlYW0ubGVuZ3RoLFxcXFxuICAgICAgICAgICAgICAgIG9yZGVyOiBvcmRlcixcXFxcbiAgICAgICAgICAgICAgICBDSUQ6IGl0ZW0uQ0lELFxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgaWYgKGdldE15VmF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AgICAgbGV0IGFycmF5ID0gW3RleHRdO1xcXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHtcXFxcbiAgICAgICAgICAgIHRleHQgPSBhcnJheVtpXTtcXFxcbiAgICAgICAgICAgIGxldCBpbmRleCA9IHRleHQuaW5kZXhPZih0YXJnZXQpO1xcXFxuICAgICAgICAgICAgaWYgKGluZGV4ID09PSAtMSkge1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgYXJyYXlbaV0gPSB0ZXh0LnNsaWNlKDAsIGluZGV4KTtcXFxcbiAgICAgICAgICAgIGFycmF5W2kgKyAxXSA9IHRleHQuc2xpY2UoaW5kZXggKyB0YXJnZXQubGVuZ3RoKTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICByZXR1cm4gYXJyYXk7XFxcXG4gICAgfSxcXFxcbiAgICBjaHVuayhhcnIsIHNpemUpIHtcXFxcbiAgICAgICAgdmFyIHJlc3VsdCA9IFtdO1xcXFxuICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gYXJyLmxlbmd0aDsgaSA8IGxlbjsgaSArPSBzaXplKSB7XFxcXG4gICAgICAgICAgICByZXN1bHQucHVzaChhcnIuc2xpY2UoaSwgaSArIHNpemUpKTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcXFxuICAgIH0sXFxcXG4gICAgaGlrZXJQaWModXJsKSB7XFxcXG4gICAgICAgIHZhciBoZWFkZXJzID0ge307XFxcXG4gICAgICAgIGxldCB1cmxzID0gdXJsLnNwbGl0KFxcXFxcXFwiQFxcXFxcXFwiKTtcXFxcbiAgICAgICAgbGV0IHBpY1VybCA9IHVybHMuc2hpZnQoKTtcXFxcbiAgICAgICAgbGV0IGxlbmd0aCA9IHVybHMubGVuZ3RoO1xcXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxlbmd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ICAgIHBpY0Rvd25sb2FkKHVybCwgcGF0aCwgaGVhZGVycywgZGVjaXBoZSkge1xcXFxuICAgICAgICBpZiAodHlwZW9mIGRlY2lwaGUgPT09IFxcXFxcXFwic3RyaW5nXFxcXFxcXCIgJiYgZGVjaXBoZS5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICBsZXQgaW5zdHJlYW07XFxcXG4gICAgICAgICAgICBsZXQgb3V0c3RyZWFtO1xcXFxuICAgICAgICAgICAgbGV0IGZpbGU7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGZpbGUgPSBuZXcgamF2YS5pby5GaWxlKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlLmV4aXN0cygpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbGV0IGRpciA9IGZpbGUuZ2V0UGFyZW50RmlsZSgpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChkaXIgIT0gbnVsbCAmJiAhZGlyLmV4aXN0cygpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRpci5ta2RpcnMoKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaW5zdHJlYW0gPSBmZXRjaCh1cmwsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgaW5wdXRTdHJlYW06IHRydWVcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIG91dHN0cmVhbSA9IG5ldyBqYXZhLmlvLkZpbGVPdXRwdXRTdHJlYW0ocGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHQgPSAkLmhpa2VyLmlucHV0LFxcXFxuICAgICAgICAgICAgICAgICAgICBjID0gJC5oaWtlci51cmw7XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IGluc3RyZWFtO1xcXFxuICAgICAgICAgICAgICAgICQuaGlrZXIudXJsID0gdXJsO1xcXFxuICAgICAgICAgICAgICAgIGxldCBwaWNpbiA9IChuZXcgRnVuY3Rpb24oXFxcXFxcXCJyZXR1cm4gXFxcXFxcXCIgKyBkZWNpcGhlKSkoKTtcXFxcbiAgICAgICAgICAgICAgICAkLmhpa2VyLmlucHV0ID0gdDtcXFxcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IGM7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGJ1ZiA9IGphdmEubGFuZy5yZWZsZWN0LkFycmF5Lm5ld0luc3RhbmNlKGphdmEubGFuZy5CeXRlLlRZUEUsIDEwMjQpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBsZW47XFxcXG4gICAgICAgICAgICAgICAgd2hpbGUgKChsZW4gPSBwaWNpbi5yZWFkKGJ1ZikpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG91dHN0cmVhbS53cml0ZShidWYsIDAsIGxlbik7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGUgaW5zdGFuY2VvZiBqYXZhLmlvLkZpbGUgJiYgZmlsZS5leGlzdHMoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmaWxlLmRlbGV0ZSgpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBsb2coXFxcXFxcXCI86Kej5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cXFxuICAgICAgICBsZXQgdHh0VmlldyA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9leHRlcm5hbGltcG9ydFR4dC52aWV3XFxcXFxcXCIpO1xcXFxuICAgICAgICByZXR1cm4gdHh0VmlldyhsYXlvdXQpO1xcXFxuICAgIH1cXFxcbiAgICBsZXQgdGFnID0gRmlsZS5nZXRGaWxlUGF0aChDb25maWdbdHlwZSArIFxcXFxcXFwiUGF0aFxcXFxcXFwiXSwgXFxcXFxcXCJkaXJcXFxcXFxcIik7XFxcXG4gICAgaWYgKHRhZy5sZW5ndGggPT09IDApIHtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiLFxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6K6+572uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL1NldHRpbmcudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8yXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIHZlcnNpb246IE1ZX1JVTEUudmVyc2lvblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzluK7liqnigJ3igJ1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvaGVscC52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRI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Wwj+eoi+W6j+S4i+i9veeahOaJgOaciea8q+eUu+Wwhuiiq+WIoOmZpFxcXFxcXFwiXSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuivpeaTjeS9nOS4jeS8muWIoOmZpOWwj+eoi+W6j++8jOS9huivpeWwj+eoi+W6j+S4i+i9veeahOaJgOaciSDmvKvnlLsv5bCP6K+0IOWwhuiiq+WIoOmZpFxcXFxcXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcXFxcXCIudGdudW1cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdC5wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL3BhZ2UvQm9va3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xcbiAgICAgICAgICAgIGRlc2M6IG5hbWVzWzFdLFxcXFxuICAgICAgICAgICAgcGljX3VybDogcGljLFxcXFxuICAgICAgICAgICAgdXJsOiB0eXBlID09PSBcXFxcXFxcIm5vdmVsXFxcXFxcXCIgP3BhZ2VVcmwgKyBcXFxcXFxcIj9ydWxlPVxcXFxcXFwiICsgTVlfUlVMRS50aXRsZTokKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKHBhZ2VVcmwsIHBhdGgpPT57XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFxcXFxcImxvbmdQcmVzcy5qc1xcXFxcXFwiKS5zaW5nbGVFbnRlcihwYWdlVXJsLCBwYXRoKTtcXFxcbiAgICAgICAgICAgIH0sIHBhZ2VVcmwsIGl0ZW0ucGF0aCksXFxcXG4gICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbihpdGVtLCB7XFxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcXFxcXCJsb25nUHJlc3MuanNcXFxcXFxcIikuZGVsZXRlRmlsZUZvckJvb2socGF0aClcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgaXRlbS5wYXRoKVxcXFxuICAgICAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICAgICAgICAgIGlkOiBpdGVtLnBhdGhcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICBzZXRSZXN1bHQobGF5b3V0KTtcXFxcbn1cXFxcblxcXFxubWFpbigpO1xcXCJ9LHtcXFwiY29sX3R5cG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cXFwi6Ieq5a6a5LmJdXJsXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLovpPlhaXlm77niYfnmoTot6/lvoTmiJbogIXpk77mjqVcXFxcXFxcIikuaW5wdXQoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcXFxcXCJjb25maWcuanNvblxcXFxcXFwiLCAwKSB8fCBcXFxcXFxcInt9XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlnLmRlZl9QaWMgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9ICQucmVxdWlyZShyZXF1aXJlVXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcXFxcXCJjb25maWcuanNvblxcXFxcXFwiLCAwKSB8fCBcXFxcXFxcInt9XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyBQQVRIO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCI6ZGVmYXVsdFBpY0JhY2tcXFxcXFxcIiwgXFxcXFxcXCJ0cnVlXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIuanBnfC5qcGVnfC5naWZ8LnBuZ3wuc3ZnfC5ibXBcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFxcXFxcImNvbmZpcm1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlOiBcXFxcXFxcInNlbGVjdFBhdGhDYWNoZTJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lbW9yeVBhdGg6IHRydWVcXFxcbiAgICAgICAgICAgICAgICAgICB9KTtcXFxc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HRvYXN0KFxcXFxcXFwi5Yid5aeL5YyW5a6M5oiQXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vdG9hc3QoXFxcXFxcXCLlj5bmtohcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5paw5bu65pu/5o2iXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2lzTmV3PXRydWVcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfM1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLlr7zlh7rop4TliJlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChcXFxcXFxcIuehruiupOWvvOWHulxcXFxcXFwiICsgcnVsZUxpc3QubGVuZ3RoICsgXFxcXFxcXCLmnaHop4TliJnvvJ9cXFxcXFxcXG4oe2hvbWVQdGFofS9yZXBsYWNlUnVsZS5qc29uKVxcXFxcXFwiKS5jb25maXJtKChudW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBzYXZlUHRh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pcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IG5ld1J1bGVMaXN0ID0gSlNPTi5wYXJzZShydWxlVGV4dCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFxcXFxcInJlcGxhY2VSdWxlLmpzb25cXFxcXFxcIikgfHwgXFxcXFxcXCJbXVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbmV3Q291bnQgPSAwLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCA9IDA7XFxcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBuZXdSdWxlTGlzdCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgbmV3UnVsZSA9IG5ld1J1bGVMaXN0W2ldO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcXFxcXCJyZXBsYWNlbWVudFxcXFxcXFwiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFxcXFxcInBhdHRlcm5cXFxcXFxcIikgfHwgIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcXFxcXCJuYW1lXFxcXFxcXCIpIHx8IChuZXdSdWxlLnNjb3BlQ29udGVudCA9PT0gdW5kZWZpbmVkID8gZmFsc2UgOiAhbmV3UnVsZS5zY29wZUNvbnRlbnQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSBuZXdSdWxlLmlkO1xcXFxuICAgICAgICAgICAgICAgICAgICBuZXdSdWxlLmlkID0gaWQgfHwgbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZEluZGV4ID0gcnVsZUxpc3QuZmluZEluZGV4KHJ1bGUgPT4gcnVsZS5pZCA9PT0gaWQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaWRJbmRleCA+IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCsrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3Quc3BsaWNlKGlkSW5kZXgsIDEsIG5ld1J1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q291bnQrKztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnB1c2gobmV3UnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlzYmFjaykge1xcXFxuICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbG9nKFxcXFxcXFwiXFxcXFxcXFxu6Lev5b6E77yaXFxcXFxcXCIgKyBpbnB1dCArIFxcXFxcXFwiXFxcXFxcXFxu5oC76KeE5YiZ5pWw77yaXFxcXFxcXCIgKyBuZXdSdWxlTGlzdC5sZW5ndGggKyBcXFxcXFxcIlxcXFxcXFxcbuabtOaWsOinhOWImSBcXFxcXFxcIiArIHVwZGF0ZUNvdW50ICsgXFxcXFxcXCIg5p2hXFxcXFxcXFx05paw5aKe6KeE5YiZIFxcXF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GZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKGltcG9ydFJ1bGUsIHRydWUpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFxcXFxcIi5qc29uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcXFxcXCJjb25maXJtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXFxcXFwic2VsZWN0UGF0aENhY2hlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSwgaW1wb3J0UnVsZSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzNcXFxcXFxcIlxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBmb3IgKGxldCBpID0gMCwgbGVuID0gcnVsZUxpc3QubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcXFxcbiAgICAgICAgICAgIGxldCByZXBsYWNlUnVsZSA9IHJ1bGVMaXN0W2ldO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiByZXBsYWNlUnVsZS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaSxcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yig6ZmkXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKGlkLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXFxcXFwicmVwbGFjZVJ1bGUuanNvblxcXFxcXFwiKSB8fCBcXFxcXFxcIltdXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZyA9IHJ1bGVMaXN0LnNwbGljZShpbmRleCwgMSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vZGVsZXRlSXRlbUJ5Q2xzKGlkICsgXFxcXFxcXCIuXFxcXFxcXCIgKyBpbmRleCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLliKDpmaTmiJDlip9cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9LCBpZCwgaSksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaVxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8yXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIue8lui+kVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvZWRpdFJlcGxhY2VSdWxlLnZpZXcjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjI25vUmVmcmVzaCM/aW5kZXg9XFxcXFxcXCIgKyBpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgXFxcXFxcXCJjb250ZW50c1xcXFxcXFwiOlxcXFxuICAgICAgICBsZXQgZiA9IHJlcXVpcmUoXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCIpO1xcXFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcXFxcXCLnm67lvZXorr7nva586K6+572uXFxcXFxcXCIpO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLpgInmi6nmlofku7blpLlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogSlNPTi5zdHJpbmdpZnkoZi5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBQQVRIXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcXFxuICAgICAgICAgICAgICAgIGluaXRpYWxQYXRoOiBDb25maWcuaG9tZVBhdGgsXFxcXG4gICAgICAgICAgICAgICAgcmVxdWlyZVVybDogXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgcGF0dGVybjogMVxcXFxuICAgICAgICAgICAgfSkpLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiaW5wdXRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi5pSv5oyBaGlrZXI6Ly9maWxlc+i3r+W+hCjor6Xmk43kvZzkuI3kvJrliJ3lp4vljJbnm67lvZUpXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogQ29uZmlnLmhvbWVQYXRoLFxcXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihpZCwgaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXFxcbiAgICAgICAgICAgICAgICBpZDogaWRcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi56Gu6K6kXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaW5wdXQgPSBnZXRNeVZhcihpZCwgZmluZEl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XG4gICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICBpc1RydWU6IGlzVHJ1ZSxcXFxcbiAgICAgICAgICAgIGlkOiBpZCArIGksXFxcXG4gICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6IFxcXFxcXFwi5byA5ZCvXFxcXFxcXCIsXFxcXG4gICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKCgkaWQsIHJlcGxhY2VSdWxlLCBwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICBpZiAoZmluZEl0ZW0oJGlkKS5leHRyYS5pc1RydWUpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3suW8gOWQr1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgY29uc3QgYm9va0luZm8gPSBPYmplY3QuYXNzaWduKHtcXFxcbiAgICAgICAgICAgICAgICBzZWxlY3RlZDogW11cXFxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHBhdGggKyBcXFxcXFxcIi9ib29rSW5mby5qc29uXFxcXFxcXCIpIHx8IFxcXFxcXFwie31cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgYm9va0luZm8uc2VsZWN0ZWQucHVzaChyZXBsYWNlUnVsZS5pZCk7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCRpZCwge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuKXj1xcXFxcXFwiICsgcmVwbGFjZVJ1bGUubmFtZSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpc1RydWU6IHR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ByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IGlucHV0Lm1hdGNoKC9cXFxcXFxcXC8oW15cXFxcXFxcXC9dKj8pKFxcXFxcXFxcLnR4dHxcXFxcXFxcXC5lcHViKSQvaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV0ucmVwbGFjZShcXFxcXFxcIl9maWxlU2VsZWN0X1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IGlucHV0LnJlcGxhY2UoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5a+85YWl5o+Q56S6XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXFxcXFxcXCLlt7LlrZjlnKhbXFxcXFxcXCIgKyBub3ZlbE5hbWUgKyBcXFxcXFxcIl3mmK/lkKbopobnm5Y/XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aENhY2hlKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5a+85YWl5oiQ5YqfXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSAkLnJlcXVpcmUocmVxdWlyZVVybCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZU1hdGNoID0gUEFUSC5tYXRjaCgvXFxcXFxcXFwvKFteXFxcXFxcXFwvXSo/KShcXFxcXFxcXC50eHR8XFxcXFxcXFwuZXB1YikkL2kpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vdmVsTmFtZSA9IGZpbGVNYXRjaFsxXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGggPSBDb25maWcuZXh0ZXJuYWxJbXBvcnRQYXRoICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aENhY2hlID0gQ29uZmlnLmNvbnRlbnRzQ2FjaGUgKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IFBBVEg7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi5bey5a2Y5ZyoW1xcXFxcXFwiICsgbm92ZWxOYW1lICsgXFxcXFxcXCJd5piv5ZCm6KaG55uWP1xcXFxcXFwiKS5jb25maXJtKChwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aENhY2hlKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIudHh0fC5lcHViXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFxcXFxcImNvbmZpcm1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmU6IFxcXFxcXFwic2VsZWN0UGF0aENhY2hlMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBtZW1vcnlQYXRoOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pLFxcXFxuICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbiAgICBsZXQgb3B0aW9ucyA9IFtcXFxcXFxcIumYheivu1xcXFxcXFwiLCBcXFxcXFxcIuWIhuS6q1xcXFxcXFwiLCBcXFxcXFxcIuWIoOmZpFxcXFxcXFwiLCBcXFxcXFxcIuaJk+W8gOaWueW8j1xcXFxcXFwiXTtcXFxcblxcXFxuICAgIGxldCBwYXR0ZXJuID0gZ2V0TXlWYXIoXFxcXFxcXCI6dHh0UGF0dGVyblxcXFxcXFwiLCBvcHRpb25zWzBdKTtcXFxcbiAgICBsZXQgaWQgPSBEYXRlLm5vdygpICsgXFxcXFxcXCI65qih5byPXFxcXFxcXCI7XFxcXG4gICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogcGF0dGVybixcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8zXFxcXFxcXCIsXFxcXG4gICAgICAgIHVybDogJChvcHRpb25zLCAxLCBcXFxcXFxcIuaTjeS9nOaooeW8j1xcXFxcXFwiKS5zZWxlY3QoKG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FxcXFxcInNoYXJlOi8vXFxcXFxcXCIgKyBwYXRoO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgY2FzZSBcXFxcXFxcIuWIoOmZpFxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi56Gu6K6k5Yig6ZmkW1xcXFxcXFwiICsgbmFtZSArIFxcXFxcXFwiXVxcXFxcXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyBwYXRoICsgXFxcXFxcXCIuanNvblxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXMocGF0aCArIFxcXFxcXFwiLmpzb25cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhdGgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAg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sZSlcXFxcbiAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaJk+W8gOaWueW8j1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcXFxcXCJvcGVuRmlsZTovL2ZpbGU6Ly9cXFxcXFxcIiArIG5vdmVsLnBhdGgpXFxcXG4gICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcXFxcXCJsb25nUHJlc3MuanNcXFxcXFxcIikuZGVsZXRlRmlsZUZvclR4dChwYXRoKVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBub3ZlbC5wYXRoKVxcXFxuICAgICAgICAgICAgICAgIH1dXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICBpZiAoZmlsZXMubGVuZ3RoID09PSAwKSB7XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuiuvue9rlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXFxcbiAgICA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XFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoK1xcXFxcXFwiLmpzb25cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6ZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTpcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcXFxuICAgICAgICAgICAgc2V0UmVzdWx0KFt7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPHN0cm9uZz7nm67lvZXop6PmnpDlpLHotKUo6YeN5paw6Kej5p6QKTwvc3Ryb25nPlxcXFxcXFwiLmJpZygpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFxcXFxcIi5qc29uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1dKTtcXFxcbiAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcXFxcXCLmraPlnKjop6PmnpDnm67lvZVcXFxcXFxcIik7XFxcXG4gICAgICAgIGxldCB0eHQgPSByZXF1ZXN0KHBhdGgsIHtcXFxcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAvL1xcXFxcXFwiY29udGVudC10eXBlXFxcXFxcXCI6IFxcXFxcXFwidGV4dC9wbGFpbjsgY2hhcnN0PVxcXFxcXFwiICsgY2hhcnN0XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsZXQgcGF0dGVybiA9IHJlZ3MuZ2V0VG9jUnVsZSh0eHQpO1xcXFxuICAgICAgICBpZiAoIXBhdHRlcm4pIHtcXFxcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pTwvc3Ryb25nPlxcXFxcXFwiLmJpZygpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfV0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBtYXRjaGVyID0gcGF0dGVybi5tYXRjaGVyKHR4dCk7XFxcXG4gICAgICAgIGxldCBwb2ludGVyID0gMDtcXFxcbiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7XFxcXG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBtYXRjaGVyLnN0YXJ0KCk7XFxcXG4gICAgICAgICAgICBsZXQgZW5kID0gbWF0Y2hlci5lbmQoKTtcXFxcbiAgICAgICAgICAgIGxldCB0ID0gbWF0Y2hlci5ncm91cCgpO1xcXFxuICAgICAgICAgICAgaWYgKHBvaW50ZXIgPT09IDAgJiYgc3RhcnQgPiAzMCkge1xcXFxuICAgICAgICAgICAgICAgIGhhc1ByZWZhY2UgPSB0cnVlO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgY2hhcHRlck5hbWVzLnB1c2godCk7XFxcXG4gICAgICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgc3RhcnRdKTtcXFxcbiAgICAgICAgICAgIHBvaW50ZXIgPSBlbmQ7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaW50ZXJ2YWxzLnB1c2goW3BvaW50ZXIsIHR4dC5sZW5ndGhdKTtcXFxcbiAgICAgICAgaWYgKGlzQ2FjaGUpIHtcXFxcbiAgICAgICAgICAgIHdyaXRlRmlsZShjYWNoZVBhdGgsIEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZXM6IGNoYXB0ZXJOYW1lcyxcXFxcbiAgICAg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DsgaSsrKSB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBsZXQgcGljID0gVG9vbC5oaWtlclBpYyhwaWNMaXN0W2ldKTtcXFxcbiAgICAgICAgICAgIFRvb2wucGljRG93bmxvYWQocGljWzBdLCBjaGFwdGVyUGF0aCArIChpICsgMSkgKyBcXFxcXFxcIi5qcGdcXFxcXFxcIiwgcGljWzFdLCBpbmZvLmRlY29kZSk7XFxcXG4gICAgICAgICAgICBpZiAoaW50ZXJydXB0ICYmIGdldE15VmFyKE1ZX0lEICsgXFxcXFxcXCI6c3RhdHVzXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpID09PSBcXFxcXFxcIjFcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGVycm9yTnVtID0gMDtcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgaWYgKGVycm9yTnVtIDwgMTApIHtcXFxcbiAgICAgICAgICAgICAgICBpLS07XFxcXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0rKztcXFxcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdGhyb3cgZTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcblxcXFxuICAgIEZpbGUucmVuYW1lRmlsZShjaGFwdGVyUGF0aCwgb3JkZXIgKyBcXFxcXFxcIiRBJFxcXFxcXFwiICsgVG9vbC50ZXh0U2hpZWxkKGl0ZW0udGl0bGUpKTtcXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCIjdi7mvKvnlLvlhbzlrrlcXFwiLFxcXCJwYXRoXFxcIjpcXFwiY29taWNDb21wYXRp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ICsgdGl0bGViLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChuYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJhbmtNZXRob2QgPSBnZXRJdGVtKFxcXFxcXFwiYm9va3JhY2s6cmFua01ldGhvZFxcXFxcXFwiLCBcXFxcXFxcIuezu+e7n1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmFua0lzUmV2ZXJzZSA9IGdldEl0ZW0oXFxcXFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgaWYgKHJhbmtNZXRob2QgPT09IG5hbWUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJhbmtJc1JldmVyc2UpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtJc1JldmVyc2UgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFua0lzUmV2ZXJzZSA9IFxcXFxcXFwiMVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFxcXFxcImJvb2tyYWNrOnJhbmtJc1JldmVyc2VcXFxcXFxcIiwgcmFua0lzUmV2ZXJzZSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFxcXFxcImJvb2tyYWNrOnJhbmtJc1JldmVyc2VcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIik7XF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ogdHlwZSA9PT0gXFxcXFxcXCJub3ZlbFxcXFxcXFwiID9wYWdlVXJsICsgXFxcXFxcXCI/cnVsZT1cXFxcXFxcIiArIE1ZX1JVTEUudGl0bGU6JChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChwYWdlVXJsLCBwYXRoKT0+e1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcXFxcXCJsb25nUHJlc3MuanNcXFxcXFxcIikuc2luZ2xlRW50ZXIocGFnZVVybCwgcGF0aCk7XFxcXG4gICAgICAgICAgICB9LCBwYWdlVXJsLCBpdGVtLmdldFBhdGgoKSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTpjb2xfdHlwZSxcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcXFxcXCJsb25nUHJlc3MuanNcXFxcXFxcIikuZGVsZXRlRmlsZUZvckJvb2socGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0uZ2V0UGF0aCgpKVxcXFxuICAgICAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICAgICAgICAgIGlkOiBpdGVtLmdldFBhdGgoKSxcXFxcbiAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLmdldFBhdGgoKSxcXFxcbiAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLmdldE5hbWUoKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG4gICAgaWYgKHJhbmtJc1JldmVyc2UpIHtcXFxcbiA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