Advertisement
xiaomianao666

邀您一起看:深海余烬 作者:远瞳.txt

May 6th, 2023
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥深海余烬 作者:远瞳.txt@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLkZpbGXlt6XlhbdcIixcInBhdGhcIjpcIkZpbGUuanNcIixcInJ1bGVcIjpcImNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3Qge1xcbiAgICBGaWxlcyxcXG4gICAgUGF0aHMsXFxuICAgIFN0YW5kYXJkQ29weU9wdGlvbixcXG4gICAgU3RhbmRhcmRPcGVuT3B0aW9uXFxufSA9IGphdmEubmlvLmZpbGU7XFxuY29uc3QgamF2YVN0cmluZyA9IGphdmEubGFuZy5TdHJpbmc7XFxubGV0IGphdmFTY29wZSA9IG5ldyBKYXZhSW1wb3J0ZXIoamF2YS5pbywgamF2YS5sYW5nLCBqYXZhLmxhbmcucmVmbGVjdCwgamF2YS51dGlsLlZlY3Rvcik7XFxuXFxuZnVuY3Rpb24gZGVsZXRlRmlsZXMoZmlsZU5hbWUpIHtcXG4gICAgbGV0IGZpbGUgPSBuZXcgRmlsZShmaWxlTmFtZSk7XFxuICAg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gdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChNWV9JRCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSBnZXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICBpZiAoc3RhdHVzID09PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJb5q2j5Zyo5YGc5q2iLi4uXVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mraPlnKjlj5bmtojkuIvovb3ku7vliqFcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSBcXFwiMVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ato+WcqOaaguWBnC4uLlxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09IFxcXCIyXFxcIikge1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7LpgIDlh7rkuIvovb3lmahcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoW1xcXCIzXFxcIiwgXFxcIjRcXFwiXS5pbmNsdWRlcyhzdGF0dXMpKSB7XFxuICAgICAgICAgICAgICA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FwiIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3ov5vluqZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlrozmiJDkuIvovb3vvJpcXFwiICsgaWQpO1xcbiAgICAgICAgfSBlbHNlIGlmIChDSUQgPT09IC0xKSB7XFxuICAgICAgICAgICAgZmFpbE5hbWUucHVzaChpZCk7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICBjb3VudCA9IHRhc2tDb3VudDtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmICh0YXNrQ291bnQgIT09IGNvdW50KSByZXR1cm47XFxuICAgICAgICBpZiAoc3VjY2Vzc0NJRC5sZW5ndGggPT09IHRhc2tDb3VudCkge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCLilodcXFwiLnJlcGVhdCgxMCkuZm9udGNvbG9yKFxcXCIjMDBmZjAwXFxcIikgKyBcXFwiIDEwMCVcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L296L+b5bqmXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgYmF0Y2hUZWFtID0gSlNPTi5wYXJzZShnZXRNeVZhcihNWV9JRCArIFxcXCI6YmF0Y2hUZWFtXFxc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5Lu75Yqh77yM5L2G5bey5pyJ6L+b5bqm5LiN5Lya5raI5aSxI1xcXCIpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvph43mlrDlvIDlp4tdXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiYnJlYWtcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjJcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIuS4i+i9veS7u+WKoVtcXFwiICsgaW5mby5ib29rTmFtZSArIFxcXCJd5bey5YWo6YOo5oiQ5Yqf5a6M5oiQXFxcIik7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+i/lOWbnl1cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICB0b2FzdChcXFwi5LiL6L295Lu75YqhW1xcXCIgKyBpbmZvLmJvb2tOYW1lICsgXFxcIl3lt7LlrozmiJBcXFwiKTtcXG4gICAgfVxcbiAgICBsZXQgdGFza1RlYW1DaHVuayA9IFtdO1xcbiAgICBpZiAoQ29uZmlnLnRocmVhZE51bSA+IDApIHtcXG4gICAgICAgIHRhc2tUZWFtQ2h1bmsgPSBUb29sLmNodW5rKHRhc2tUZWFtLC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gdGl0bGU6IFxcXCIkPlxcXCIgKyB0ZXh0LFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCIjbG9nI1xcXCIgKyBsb2dDb3VudFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgbG9nQ291bnQrKztcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiB0YXNrKHRhc2tQYXJhbSkge1xcbiAgICAgICAgY29uc3QgVG9vbCA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL1Rvb2wuanNcXFwiKTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMTA7IGkrKykge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBwaWMgPSBUb29sLmhpa2VyUGljKHRhc2tQYXJhbS51cmwpO1xcbiAgICAgICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKHBpY1swXSwgdGFza1BhcmFtLmNoYXB0ZXJQYXRoICsgKHRhc2tQYXJhbS5pICsgMSkgKyBcXFwiLmpwZ1xcXCIsIHBpY1sxXSwgdGFza1BhcmFtLmRlY29kZSk7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcih0YXNrUGFyYW0uTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCJcXFwiKSA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0gPSAwO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGlmIChpID09PSA5KSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRhc2tQYXJhbS5DSUQ7XFxuICAgIH1cXG4gICAgbGV0IGNvdW50ID0gMDtcXG4gICAgbGV0IHRvdGFsQ291bnQgPSAwO1xcbiAgICBsZXQgc3VjY2Vzc0NJRCA9IFtdO1xcblxcbiAgICBmdW5jdGlvbiBsaXN0ZW5lcihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgdG90YWxDb3VudCsrO1xcblxcbiAgICAgICAgICAgIGlmIChlcnJvciAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeS4i+i9veWksei0pe+8mlxcXCIgKyBpZCArIFxcXCI8RVJST1JAIFxcXCIgKyBlcnJvciArIFxcXCI+XFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN1bHQgPT09IC0xKSB7XFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeW3suWBnOatou+8mlxcXCIgKyBpZCk7XFxuICAgICAgICAgICAgICAgIHRvdGFsQ291bnQgPSBwYXJhbS5waXZDb3VudDtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjb3VudCsrO1xcbiAgICAgICAgICAgICAgICBsZXQgcmF0aW8gPSAoKGNvdW50IC8gcGFyYW0ucGl2Q291bnQpKS50b0ZpeGVkKDQpO1xcbiAgICAgICAgICAgICAgICBsZXQgc3RyaXBDb3VudCA9IE1hdGguY2VpbChyYXRpbyAqIDEwKTtcXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLnBpdkNvdW50ID09PSB0b3RhbENvdW50ICYmIHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWNjZXNzQ0lELnB1c2gocGFyYW0uQ0lEKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiL6L296L+b5bqm77yaXFxcIiArIChzdWNjZXNzQ0lELmxlbmd0aCkgKyBcXFwiL1xcXCIgKyBwYXJhbS50b3RhbCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuKWh1xcXCIucmVwZWF0KHN0cmlwQ291bnQpLmZvbnRjb2xvcihcXFwiI2ZmYWMyZFxcXCIpICsgXFxcIuKWh1xcXCIucmVwZWF0KDEwIC0gc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZTVlMWU0XFxcIikgKyBcXFwiIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9vei/m+W6plxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5a6M5oiQ5LiL6L2977yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgIT09IHBhcmFtLnBpdkNvdW50KSByZXR1cm47XFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxuICAgICAgICAgICAgICAgIEZpbGUucmVuYW1lRmlsZShwYXJhbS5jaGFwdGVyUGF0aCwgcGFyYW0uQ0lEICsgXFxcIiRBJFxcXCIgKyBUb29sLnRleHRTaGllbGQocGFyYW0udGl0bGUp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ICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGk6IGksXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aCxcXG4gICAgICAgICAgICAgICAgTVlfSUQ6IE1ZX0lELFxcbiAgICAgICAgICAgICAgICBkZWNvZGU6IGluZm8uZGVjb2RlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgYmUodGFza1RlYW0sIHtcXG4gICAgICAgICAgICBmdW5jOiBsaXN0ZW5lcixcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBwaXZDb3VudDogcGljTGlzdC5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIHRvdGFsOiBjaGFwdGVyVGVhbS5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIG9yZGVyOiBvcmRlcixcXG4gICAgICAgICAgICAgICAgQ0lEOiBpdGVtLkNJRCxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udGl0bGUsXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgaWYgKGdldE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiXFxcIikgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxuICAgIGxldCBzdGF0dXMgPSBnZXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjBcXFwiKTtcXG4gICAgamF2YS5sYW5nLlRocmVhZC5zbGVlcCg0MCk7XFxuICAgIC8vbGV0IGJhdGNoVGVhbSA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoTVlfSUQgKyBcXFwiOmJhdGNoVGVhbVxcXCIsI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xuICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjRcXFwiKTtcXG4gICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXSPlt7LlgZzmraLmiYDmnInku7vliqHvvIzkvYblt7LmnInov5vluqbkuI3kvJrmtojlpLEjXFxcIik7XFxuICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIlvph43mlrDlvIDlp4tdXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3mjqfliLZcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjJcXFwiKTtcXG4gICAgICAgIHB1dExvZyhcXFwi5LiL6L295Lu75YqhW1xcXCIgKyBpbmZvLmJvb2tOYW1lICsgXFxcIl3lt7Llhajpg6jmiJDlip/lrozmiJBcXFwiKTtcXG4gICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwiW+i/lOWbnl1cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmZy7mibnph4/kuLvnqIvluo9cIixcInBhdGhcIjpcIkJhdGNoLmV4ZS5qc1wiLFwicnVsZVwiOlwiY29uc3QgTWlhbiA9ICQucmVxdWlyZShcXFwibWFpbkRvd25sb2FkXFxcIik7XFxuZnV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G4gICAgICAgICAgICBsZXQgaW5kZXggPSB0ZXh0LmluZGV4T2YodGFyZ2V0KTtcXG4gICAgICAgICAgICBpZiAoaW5kZXggPT09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnJheVtpXSA9IHRleHQuc2xpY2UoMCwgaW5kZXgpO1xcbiAgICAgICAgICAgIGFycmF5W2kgKyAxXSA9IHRleHQuc2xpY2UoaW5kZXggKyB0YXJnZXQubGVuZ3RoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBhcnJheTtcXG4gICAgfSxcXG4gICAgY2h1bmsoYXJyLCBzaXplKSB7XFxuICAgICAgICB2YXIgcmVzdWx0ID0gW107XFxuICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gYXJyLmxlbmd0aDsgaSA8IGxlbjsgaSArPSBzaXplKSB7XFxuICAgICAgICAgICAgcmVzdWx0LnB1c2goYXJyLnNsaWNlKGksIGkgKyBzaXplKSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICB9LFxcbiAgICBoaWtlclBpYyh1cmwpIHtcXG4gICAgICAgIHZhciBoZWFkZXJzID0ge307XFxuICAgICAgICBsZXQgdXJscyA9IHVybC5zcGxpdChcXFwiQFxcXCIpO1xcbiAgICAgICAgbGV0IHBpY1VybCA9IHVybHMuc2hpZnQoKTtcXG4gICAgICAgIGxldCBsZW5ndGggPSB1cmxzLmxlbmd0aDtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgW2tleSwgdmFsdWVdID0gdi5zcGxpdCh1cmxzW2ldLCBcXFwiPVxcXCIpO1xcbiAgICAgICAgICAgIGlmIChrZXkgPT09IFxcXCJoZWFkZXJzXFxcIikge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgT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gICAgICAgICAgICBpZiAoZmlsZS5leGlzdHMoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBkaXIgPSBmaWxlLmdldFBhcmVudEZpbGUoKTtcXG4gICAgICAgICAgICAgICAgaWYgKGRpciAhPSBudWxsICYmICFkaXIuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRpci5ta2RpcnMoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpbnN0cmVhbSA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtOiB0cnVlXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICBvdXRzdHJlYW0gPSBuZXcgamF2YS5pby5GaWxlT3V0cHV0U3RyZWFtKHBhdGgpO1xcbiAgICAgICAgICAgICAgICBsZXQgdCA9ICQuaGlrZXIuaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICBjID0gJC5oaWtlci51cmw7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSBpbnN0cmVhbTtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSB1cmw7XFxuICAgICAgICAgICAgICAgIGxldCBwaWNpbiA9IChuZXcgRnVuY3Rpb24oXFxcInJldHVybiBcXFwiICsgZGVjaXBoZSkpKCk7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSB0O1xcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IGM7XFxuICAgICAgICAgICAgICAgIGxldCBidWYgPSBqYXZhLmxhbmcucmVmbGVjdC5BcnJheS5uZXdJbnN0YW5jZShqYXZhLmxhbmcuQnl0ZS5UWVBFLCAxMDI0KTtcXG4gICAgICAgICAgICAgICAgbGV0IGxlbjtcXG4gICAgICAgICAgICAgICAgd2hpbGUgKChsZW4gPSBwaWNpbi5yZWFkKGJ1ZikpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICBvdXRzdHJlYW0ud3JpdGUoYnVmLCAwLCBsZW4pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBpZiAoZmlsZSBpbnN0YW5jZW9mIGphdmEuaW8uRmlsZSAmJiBmaWxlLmV4aXN0cygpKSB7XFxuICAgICAgICAgICAgICAgICAgICBmaWxlLmRlbGV0ZSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxvZyhcXFwiPOino+WvhuS4i+i9vUVycm9yPlxcXCIgKyBlLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICAgICAgfSBmaW5hbGx5IHtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJlcXVpcmVEb3dubG9hZCh1cmwsIHBhdGgsIGhlYWRlcnMpO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICB0ZXh0U2hpZWxkKHRleHQpIHtcXG4gICAgICAgIGxldCBlID0gLyN8OnwmfFxcXFx8fFxcXFxefEB8XFxcXDx8XFxcXD58JXxcXFxcL3xcXFxcPy9nO1xcbiAgICAgICAgcmV0dXJuIHRleH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AgICAgICAgICAgc2V0SXRlbShcXFwibWFpbjp0eXBlXFxcIiwgXFxcInR4dFxcXCIpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcIi50Z251bVxcXCIpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfSwgdHlwZSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCJcXG4gICAgfSk7XFxuICAgIGlmICh0eXBlID09PSBcXFwidHh0XFxcIikge1xcbiAgICAgICAgdHh0VmlldyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2V4dGVybmFsaW1wb3J0VHh0LnZpZXdcXFwiKTtcXG4gICAgICAgIHJldHVybiB0eHRWaWV3KGxheW91dCk7XFxuICAgIH1cXG4gICAgbGV0IHRhZyA9IEZpbGUuZ2V0RmlsZVBhdGgoQ29uZmlnW3R5cGUgKyBcXFwiUGF0aFxcXCJdLCBcXFwiZGlyXFxcIik7XFxuICAgIGlmICh0YWcubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIixcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6K6+572uXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvU2V0dGluZy52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmVyc2lvbjogTVlfUlVMRS52ZXJzaW9uXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzluK7liqnigJ3igJ1cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9oZWxwLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSM/a2V5d29yZD1ub3ZlbENvbWljXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGgxIHN0eWxlPVxcXCJ0ZXh0LWFsaWduOiBjZW50ZXI7XFxcIj7llaXpg73msqHmnInogLY8L2gxPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBzZXRSZXN1bHQobGF5b3V0KTtcXG4gICAgfVxcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB1cmw6ICdcXFwiaGlrZXI6Ly9zZWFyY2g/cz1cXFwiK2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLmkJzkvaDmg7PopoHnmoQjXFxcIiArIHR5cGUgKyBcXFwiIy4uLi4uLlxcXCIsXFxuICAgICAgICB0aXRsZTogXFxcIvCflI1cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHJ1bGVzOiAkLnRvU3RyaW5nKCh0YWcsIHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGFycjEgPSBbXTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0YWcubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGFycjEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogdGFnW2ldLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF91cmxcXFwiOiBcXFwiaGlrZXI6Ly9lbXB0eT9pc0FsbD0xJnNlYXJjaFRlcm1zPSoqJnR5cGU9XFxcIiArIHR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaEZpbmRcXFwiOiBcXFwianM6JC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvU2VhcmNoLnZpZXc/cnVsZT0nK01ZX1JVTEUuX3RpdGxlKTtcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoYXJyMSk7XFxuICAgICAgICAgICAgfSwgdGFnLCB0eXBlKSxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdzZWFyY2hLZXknLCAnJyksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuKAmOKAmOKameiuvue9ruKAmeKAmVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1NldHRpbmcudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHZlcnNpb246IE1ZX1JVTEUudmVyc2lvblxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG5cXG4gICAgZm9yIChsZXQgaSBpbiB0YWcpIHtcXG4gICAgICAgIGxldCBpdCA9IHRhZ1tpXTtcXG4gICAgICAgIGlmICh0Z251bSA9PT0gaSkge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJxcXFwiICsgaXQubmFtZSArIFxcXCLigJ3igJ1cXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoW1xcXCLliKDpmaTor6Xnm67lvZVcXFwiLCBcXFwi6Lez6L2s5bCP56iL5bqPXFxcIiwgXFxcIuaJk+W8gOS5puaetlxcXCJdLCAxLCBcXFwi6YCJ5oup5pON5L2cXFxcIikuc2VsZWN0KChpdCwgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLot7PovazlsI/nqIvluo9cXFwiID09PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9ob21lQFxcXCIgKyBpdC5uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKFxcXCLliKDpmaTor6Xnm67lvZVcXFwiPT09aW5wdXQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIHRoZW4oW1xcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnInmvKvnlLvlsIbooqvliKDpmaRcXFwiXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuivpeaTjeS9nOS4jeS8muWIoOmZpOWwj+eoi+W6j++8jOS9huivpeWwj+eoi+W6j+S4i+i9veeahOaJgOaciSDmvKvnlLsv5bCP6K+0IOWwhuiiq+WIoOmZpFxcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcIi50Z251bVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdC5wYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL0Jvb2tyYWNrLnZpZXc/cnVsZT3mnKzlnLDotYTmupDnrqHnkIYmcnVsZU5hbWU9XFxcIitpdC5uYW1lK1xcXCImdHlwZT1cXFwiK3R5cGU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0LCB0eXBlKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoaSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiLnRnbnVtXFxcIiwgaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgbGV0IHBhdGggPSB0YWdbdGdudW1dLnBhdGg7XFxuICAgIGxldCBtaGxpc3QgPSBGaWxlLmdldEZpbGVQYXRoKHBhdGgsIFxcXCJkaXJcXFwiKTtcXG5cXG4gICAgaWYgKG1obGlzdC5sZW5ndGggPT09IDApIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi5ZWl6YO95rKh5pyJ6IC2XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIHNldFJlc3VsdChsYXlvdXQpO1xcbiAgICB9XFxuICAgIGxldCBwYWdlVXJsID0gdHlwZSA9PT0gXFxcIm5vdmVsXFxcIiA/IFxcXCJoaWtlcjovL3BhZ2UvTm92ZWxCcm93c2VyLnZpZXdcXFwiIDogXFxcImhpa2VyOi8vcGFnZS9Db21pY0Jyb3dzZXIudmlld1xcXCI7XFxuICAgIGZvciAobGV0IGl0ZW0gb2YgbWhsaXN0KSB7XFxuICAgICAgICBsZXQgcGljID0gZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIGl0ZW0ucGF0aCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCIuanBnXFxcIikgPyBpdGVtLnBhdGggKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiLmpwZ1xcXCIgOiBDb25maWcuZGVmX1BpYztcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgIHBpY191cmw6IHBpYyxcXG4gICAgICAgICAgICB1cmw6IHBhZ2VVcmwgKyBcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUsXFxuICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oaXRlbSwge1xcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxvbmdQcmVzcy5qc1xcXCIpLmRlbGV0ZUZpbGVGb3JCb29rKHBhdGgpXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLnBhdGgpXFxuICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICBpZDogaXRlbS5wYXRoXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIHNldFJlc3VsdChsYXlvdXQpO1xcbn1cXG5cXG5tYWluKCk7XCJ9LHtcImNvbF90eXBlXCI6XCJ0ZXh0XzFcIixcIm5hbWVcIjpcIiN2Lua8q+eUu+eroOiKguWIl+ihqFwiLFwicGF0aFwiOlwiQ29taWNCcm93c2VyLnZpZXdc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xcXG4gICAgICAgICAgICAgICAgdXJsOiBpdGVtLnBhdGggKyBsYXp5LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9WaWV3X1N0eWxlLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXG4gICAgICAgICAgICBsZXQgdGl0bGUgPSBnZXRUaXRsZShpdGVtLm5hbWUpO1xcbiAgICAgICAgICAgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb21pY0NvbXBhdGlibGUudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lIz9wYXRoPVxcXCIraXRlbS5wYXRoLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9WaWV3X1N0eWxlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXRoLFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldFRpdGxlMihpdGVtLm5hbWUpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbn0gZWxzZSB7XFxuICAgIGZvciAobGV0IGl0ZW0gb2YgbWhsaXN0KSB7XFxuICAgICAgICBsZXQgbmFtZSA9IGdldFRpdGxlMihpdGVtLm5hbWUpO1xcbiAgICAgICAgYXJyYXkucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTliKDpmaRbXFxcIiArIG5hbWUgKyBcXFwiXe+8n1xcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgY29uc3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AgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9Ob3ZlbE1haW5Cb2R5I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhdGgsXFxuICAgICAgICAgICAgICAgIGRpclBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IENvbmZpZy5kZWZfVmlld19TdHlsZVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59IGVsc2Uge1xcbiAgICBmb3IgKGxldCBpdGVtIG9mIGNoYXB0ZXJMaXN0KSB7XFxuICAgICAgICBsZXQgbmFtZSA9IGdldFRpdGxlKGl0ZW0ubmFtZSk7XFxuICAgICAgICBhcnJheS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOWIoOmZpFtcXFwiICsgbmFtZSArIFxcXCJd77yfXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKV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dGgpKSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgXFxcIua1t+mYlOmihOiniFxcXCI6XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvdHh0UGFyc2VyLnZpZXdcXFwiO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSBcXFwi5omT5byA5pa55byPXFxcIjpcXG4gICAgICAgICAgICByZXR1cm4gXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXCIgKyBwYXRoO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICB9XFxufVxcbmZvciAobGV0IHJ1bGVQYXRocyBvZiBydWxlbERpcikge1xcbiAgICBsZXQgbm92ZWxzID0gRmlsZS5nZXRGaWxlUGF0aChydWxlUGF0aHMucGF0aCwgXFxcImZpbGVcXFwiLCBcXFwiLnR4dFxcXCIpO1xcbiAgICBmb3IgKGxldCBub3ZlbCBvZiBub3ZlbHMpIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLliIbkuqtcXFwiLCBcXFwi5Yig6ZmkXFxcIiwgXFxcIua1t+mYlOmihOiniFxcXCIsIFxcXCLmiZPlvIDmlrnlvI9cXFwiXSwgMSkuc2VsZWN0KG9wZXJhdGlvbiwgbm92ZWwucGF0aCksXFxuICAgICAgICAgICAgZGVzYzogXFxcIuadpea6kO+8mlxcXCIgKyBydWxlUGF0aHMubmFt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gcmV0dXJuIFxcXCJ0b2FzdDovL+a4hemZpOWujOaIkFxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+a4hemZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChsZXQgY2FjaGUgb2YgY2FjaGVEaXIpIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjYWNoZS5uYW1lLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi5aSn5bCP77yaXFxcIiArIEZpbGUuZ2V0RmlsZVNpemUoY2FjaGUucGF0aCkgKyBcXFwiXFxcXG7mj4/ov7DvvJpcXFwiICsgKGtub3duTGlzdC5nZXQoY2FjaGUubmFtZSkgfHwgXFxcIuacquefpeebruW9lVvpo47pmanmnKrnn6VdXFxcIiksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTmuIXpmaQgXFxcIiArIGNhY2hlLm5hbWUgKyBcXFwiID9cXFwiKS5jb25maXJtKGNsZWFuQ2FjaGUsIGNhY2hlLnBhdGgpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLlhajpg6jmuIXpmaQoXFxcIiArIEZpbGUuZ2V0RmlsZVNpemUoQ29uZmlnLmhvbWVQYXRoKSArIFxcXCIpXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5riF6Zmk5YWo6YOo57yT5a2Y5pWw5o2uP1xcXCIpLmNvbmZpcm0oY2xlYW5DYWNoZSwgQ29uZmlnLmhvbWVQYXRoKVxcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSBcXFwiZGVmYXVsdFBpY1xcXCI6XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIum7mOiupOWwgemdonzorr7nva5cXFwiKTtcXG4gICAgICAgIGlmIChnZXRNeVZhcihcXFwiOmRlZmF1bHRQaWNCYWNrXFxcIikpIHtcXG4gICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiOmRlZmF1bHRQaWNCYWNrXFxcIik7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBmdW5jdGlvbiBzZXREZWZhdWx0UGljKHVybCkge1xcbiAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIDApIHx8IFxcXCJ7fVxcXCIpO1xcbiAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gdXJsO1xcbiAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBzdGFydCA9IDE7XFxuICAgICAgICBpZiAodHlwZW9mKE1ZX05BTUUpICE9PSBcXFwidW5kZWZpbmVkXFxcIiAmJiBNWV9OQU1FID09PSBcXFwi5ZeF6KeJ5rWP6KeI5ZmoXFxcIikge1xcbiAgICAgICAgICAgIHN0YXJ0ID0gNDtcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGkgPSBzdGFydDsgaSA8PSA0OyBpKyspIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Zu+54mHXFxcIiArIGksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfM1xcXCIsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX3BpY1xcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoc2V0RGVmYXVsdFBpYywgXFxcImhpa2VyOi8vaW1hZ2VzL2hvbWVfcGljXFxcIiArIGkpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLoh6rlrprkuYninpVcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLoh6rlrprkuYl1cmxcXFwiLCBcXFwi6YCJ5oup5paH5Lu26Lev5b6EXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIuiHquWumuS5iXVybFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6L6T5YWl5Zu+54mH55qE6Lev5b6E5oiW6ICF6ZO+5o6lXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIDApIHx8IFxcXCJ7fVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgMCkgfHwgXFxcInt9XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gXFxcImZpbGU6Ly9cXFwiICsgUEFUSDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCI6ZGVmYXVsdFBpY0JhY2tcXFwiLCBcXFwidHJ1ZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIuanBnfC5qcGVnfC5naWZ8LnBuZ3wuc3ZnfC5ibXBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFwic2VsZWN0UGF0aENhY2hlMlxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pO1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgXFxcInJlcGxhY2VSdWxlXFxcIjpcXG4gICAgICAgIGlmIChNWV9QQVJBTVMuaXNSZWZyZXNoKSB7XFxuICAgICAgICAgICAgYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2VcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHJlZnJlc2hQYWdlKCkpKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHNldFBhZ2VUaXRsZShcXFwi5pu/5o2i6KeE5YiZfOiuvue9rlxcXCIpO1xcbiAgICAgICAgbGV0IHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIpIHx8IFxcXCJbXVxcXCIpO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5paw5bu65pu/5o2iXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJo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UNvbnRlbnQgPT09IHVuZGVmaW5lZCA/IGZhbHNlIDogIW5ld1J1bGUuc2NvcGVDb250ZW50KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gbmV3UnVsZS5pZDtcXG4gICAgICAgICAgICAgICAgICAgIG5ld1J1bGUuaWQgPSBpZCB8fCBuZXcgRGF0ZSgpLmdldFRpbWUoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZEluZGV4ID0gcnVsZUxpc3QuZmluZEluZGV4KHJ1bGUgPT4gcnVsZS5pZCA9PT0gaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlkSW5kZXggPiAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUNvdW50Kys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3Quc3BsaWNlKGlkSW5kZXgsIDEsIG5ld1J1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdDb3VudCsrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnB1c2gobmV3UnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoaXNiYWNrKSB7XFxuICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxvZyhcXFwiXFxcXG7ot6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A5OVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9IHJlcXVpcmUocmVxdWlyZVVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZyhpbXBvcnRSdWxlLCB0cnVlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiByZXF1aXJlVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFwic2VsZWN0UGF0aENhY2hlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbXBvcnRSdWxlKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGxlbiA9IHJ1bGVMaXN0Lmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XFxuICAgICAgICAgICAgbGV0IHJlcGxhY2VSdWxlID0gcnVsZUxpc3RbaV07XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogcmVwbGFjZVJ1bGUubmFtZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBydWxlTGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiKSB8fCBcXFwiW11cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBnID0gcnVsZUxpc3Quc3BsaWNlKGluZGV4LCAxKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vZGVsZXRlSXRlbUJ5Q2xzKGlkICsgXFxcIi5cXFwiICsgaW5kZXgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuWIoOmZpOaIkOWKn1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaWQsIGkpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGlcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIue8lui+kVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9lZGl0UmVwbGFjZVJ1bGUudmlldyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMjbm9SZWZyZXNoIz9pbmRleD1cXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIFxcXCJjb250ZW50c1xcXCI6XFxuICAgICAgICBsZXQgZiA9IHJlcXVpcmUoXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiKTtcXG4gICAgICAgIHNldFBhZ2VUaXRsZShcXFwi55uu5b2V6K6+572ufOiuvue9rlxcXCIpO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6YCJ5oup5paH5Lu25aS5XFxcIixcXG4gICAgICAgICAgICB1cmw6IEpTT04uc3RyaW5naWZ5KGYuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih0YXJnZXQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBQQVRIXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXG4gICAgICAgICAgICAgICAgaW5pdGlhbFBhdGg6IENvbmZpZy5ob21lUGF0aCxcXG4gICAgICAgICAgICAgICAgcmVxdWlyZVVybDogXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiLFxcbiAgICAgICAgICAgICAgICBwYXR0ZXJuOiAxXFxuICAgICAgICAgICAgfSkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgIGRlc2M6IFxcXCLmlK/mjIFoaWtlcjovL2ZpbGVz6Lev5b6EKOivpeaTjeS9nOS4jeS8muWIneWni+WMluebruW9lSlcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogQ29uZmlnLmhvbWVQYXRoLFxcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogJC50b1N0cmluZygoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKGlkLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXG4gICAgICAgICAgICAgICAgaWQ6IGlkXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLnoa7orqRcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGlucHV0ID0gZ2V0TXlWYXIoaWQsIGZpbmRJdGVtKGlkKS5leHRyYS5kZWZhdWx0VmFsdWUgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwiaGlrZXI6Ly9maWxlcy9cXFwiKSkgaW5wdXQgPSBnZXRQYXRoKGlucHV0KS5zbGljZSg3KTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LmVuZHNXaXRoKFxcXCIvXFxcIikpIGlucHV0PWlucHV0LnJlcGxhY2UoL1xcXFwvJC8sXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLmhvbWVQYXRoID09IGlucHV0KSByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5piv5b2T5YmN55uu5b2VXFxcIjtcXG4gICAgICAgICAgICAgICAgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFw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VjdC5hc3NpZ24oe1xcbiAgICAgICAgICAgICAgICBzZWxlY3RlZDogW11cXG4gICAgICAgICAgICB9LCBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIpIHx8IFxcXCJ7fVxcXCIpKTtcXG4gICAgICAgICAgICBib29rSW5mby5zZWxlY3RlZC5wdXNoKHJlcGxhY2VSdWxlLmlkKTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCRpZCwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKXj1xcXCIgKyByZXBsYWNlUnVsZS5uYW1lLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaXNUcnVlOiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICRpZCxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShib29rSW5mbykpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCArIGksIHJlcGxhY2VSdWxlLCBNWV9QQVJBTVMucGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5YWz6ZetXFxcIixcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoJGlkLCByZXBsYWNlUnVsZSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgIGlmICghZmluZEl0ZW0oJGlkKS5leHRyYS5pc1RydWUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWFs+mXrVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBbXVxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIikgfHwgXFxcInt9XFxcIikpO1xcbiAgICAgICAgICAgIGJvb2tJbmZvLnNlbGVjdGVkLnNwbGljZShib29rSW5mby5zZWxlY3RlZC5pbmRleE9mKHJlcGxhY2VSdWxlLmlkKSwgMSk7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSgkaWQsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLil4tcXFwiICsgcmVwbGFjZVJ1bGUubmFtZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlzVHJ1ZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBpZDogJGlkLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGJvb2tJbmZvKSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgIH0sIGlkICsgaSwgcmVwbGFjZVJ1bGUsIE1ZX1BBUkFNUy5wYXRoKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcb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jb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihcXFwic2VhcmNoS2V5QnlUeHRcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5QnlUeHQnLGlucHV0KVxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5a+85YWl5bCP6K+0XFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgIHVybDogJChbXFxcIuezu+e7n+mAieaLqeWZqFxcXCIsIFxcXCLmtbfpmJTpgInmi6nlmahcXFwiXSwgMSwgXFxcIumAieaLqeWZqOexu+Wei1xcXCIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi57O757uf6YCJ5oup5ZmoXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImZpbGVTZWxlY3Q6Ly9cXFwiICsgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIS8oXFxcXC50eHR8LmVwdWIpJC9pLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIumAieaLqeS6humUmeivr+eahOaWh+S7tuexu+Wei1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc29uXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZU1hdGNoID0gaW5wdXQubWF0Y2goL1xcXFwvKFteXFxcXC9dKj8pKFxcXFwudHh0fFxcXFwuZXB1YikkL2kpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5vdmVsTmFtZSA9IGZpbGVNYXRjaFsxXS5yZXBsYWNlKFxcXCJfZmlsZVNlbGVjdF9cXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBpbnB1dC5yZXBsYWNlKFxcXCJmaWxlOi8vXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5a+85YWl5o+Q56S6XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXFxcIuW3suWtmOWcqFtcXFwiICsgbm92ZWxOYW1lICsgXFxcIl3mmK/lkKbopobnm5Y/XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuWvvOWFpeaIkOWKn1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZU1hdGNoID0gUEFUSC5tYXRjaCgvXFxcXC8oW15cXFxcL10qPykoXFxcXC50eHR8XFxcXC5lcHViKSQvaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vdmVsTmFtZSA9IGZpbGVNYXRjaFsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoQ2FjaGUgPSBDb25maWcuY29udGVudHNDYWNoZSArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IFBBVEg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLlt7LlrZjlnKhbXFxcIiArIG5vdmVsTmFtZSArIFxcXCJd5piv5ZCm6KaG55uWP1xcXCIpLmNvbmZpcm0oKHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiByZXF1aXJlVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIudHh0fC5lcHViXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXCJzZWxlY3RQYXRoQ2FjaGUxXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBsZXQgb3B0aW9ucyA9IFtcXFwi6ZiF6K+7XFxcIiwgXFxcIuWIhuS6q1xcXCIsIFxcXCLliKDpmaRcXFwiLCBcXFwi5omT5byA5pa55byPXFxcIl07XFxuXFxuICAgIGxldCBwYXR0ZXJuID0gZ2V0TXlWYXIoXFxcIjp0eHRQYXR0ZXJuXFxcIiwgb3B0aW9uc1swXSk7XFxuICAgIGxldCBpZCA9IERhdGUubm93KCkgKyBcXFwiOuaooeW8j1xcXCI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lIFxcXCLliIbkuqtcXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInNoYXJlOi8vXFxcIiArIHBhdGg7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgXFxcIuWIoOmZpFxcXCI6XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7orqTliKDpmaRbXFxcIiArIG5hbWUgKyBcXFwiXVxcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIuanNvblxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXMocGF0aCArIFxcXCIuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgXFxcIumYhe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gICAgICAgICAgICAgICBwYXRoOiBub3ZlbC5wYXRoLFxcbiAgICAgICAgICAgICAgICBpc0NhY2hlOiB0cnVlLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXG4gICAgICAgICAgICAgICAgaWQ6IG5vdmVsLnBhdGgsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFwic2hhcmU6Ly9cXFwiICsgbm92ZWwucGF0aClcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLpmIXor7tcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6IEpTT04uc3RyaW5naWZ5KCh0eXBlPT09XFxcIi50eHRcXFwiP1xcXCJoaWtlcjovL3BhZ2UvdHh0UGFyc2VyLnZpZXdcXFwiOlxcXCJoaWtlcjovL3BhZ2UvZXB1YlBhcnNlci52aWV3I2F1dG9DYWNoZSNcXFwiKStcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5omT5byA5pa55byPXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFwib3BlbkZpbGU6Ly9maWxlOi8vXFxcIiArIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibG9uZ1ByZXNzLmpzXFxcIikuZGVsZXRlRmlsZUZvclR4dChwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbm92ZWwucGF0aClcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBpZiAoZmlsZXMubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLorr7nva5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOW4ruWKqeKAneKAnVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2hlbHAudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5Iz9rZXl3b3JkPXR4dFxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxoMSBzdHlsZT1cXFwidGV4dC1hbGlnbjogY2VudGVyO1xcXCI+5ZWl6YO95rKh5pyJ6IC2PC9oMT4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICA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AgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFwiLmpzb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOmZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOlxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlKOmHjeaWsOino+aekCk8L3N0cm9uZz5cXFwiLmJpZygpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUocGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFwiLmpzb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfV0pO1xcbiAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgIH1cXG5cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXCLmraPlnKjop6PmnpDnm67lvZVcXFwiKTtcXG4gICAgICAgIGxldCB0eHQgPSByZXF1ZXN0KHBhdGgsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgIC8vXFxcImNvbnRlbnQtdHlwZVxcXCI6IFxcXCJ0ZXh0L3BsYWluOyBjaGFyc3Q9XFxcIiArIGNoYXJzdFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHBhdHRlcm4gPSByZWdzLmdldFRvY1J1bGUodHh0KTtcXG4gICAgICAgIGlmICghcGF0dGVybikge1xcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgc2V0UmVzdWx0KFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHN0cm9uZz7nm67lvZXop6PmnpDlpLHotKU8L3N0cm9uZz5cXFwiLmJpZygpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfV0pO1xcbiAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBtYXRjaGVyID0gcGF0dGVybi5tYXRjaGVyKHR4dCk7XFxuICAgICAgICBsZXQgcG9pbnRlciA9IDA7XFxuICAgICAgICB3aGlsZSAobWF0Y2hlci5maW5kKCkpIHtcXG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBtYXRjaGVyLnN0YXJ0KCk7XFxuICAgICAgICAgICAgbGV0IGVuZCA9IG1hdGNoZXIuZW5kKCk7XFxuICAgICAgICAgICAgbGV0IHQgPSBtYXRjaGVyLmdyb3VwKCk7XFxuICAgICAgICAgICAgaWYgKHBvaW50ZXIgPT09IDAgJiYgc3RhcnQgPiAzMCkge1xcbiAgICAgICAgICAgICAgICBoYXNQcmVmYWNlID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY2hhcHRlck5hbWVzLnB1c2godCk7XFxuICAgICAgICAgICAgaW50ZXJ2YWxzLnB1c2goW3BvaW50ZXIsIHN0YXJ0XSk7XFxuICAgICAgICAgICAgcG9pbnRlciA9IGVuZDtcXG4gICAgICAgIH1cXG4gICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCB0eHQubGVuZ3RoXSk7XFxuICAgICAgICBpZiAoaXNDYWNoZSkge1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShjYWNoZVBhdGgsIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWVzOiBjaGFwdGVyTmFtZXMsXFxuICAgICAgICAgICAgICAgIGludGVydmFsczogaW50ZXJ2YWxzLFxcbiAgICAgICAgICAgICAgICBoYXNQcmVmYWNlOiBoYXNQcmVmYWNlXFxuICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgfVxcblxcblxcbiAgICBpZiAoaGFzUHJlZmFjZSkge1xcbiAgICAgICAgbGV0IGludGVydmFsID0gaW50ZXJ2YWxzWzBdO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5bqP6KiAXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1RYVFZpZXdlci52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZTogXFxcIuW6j+iogFxcXCIsXFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXG4gICAgICAgICAgICAgICAgcGF0aDogcGF0aCxcXG4gICAgICAgICAgICAgICAgY2hhcnN0OiBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNoYXB0ZXJOYW1lcy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgbGV0IG5hbWUgPSBjaGFwdGVyTmFtZXNbaV07XFxuICAgICAgICBsZXQgaW50ZXJ2YWwgPSBpbnRlcnZhbHNbaSArIDFdO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvVFhUVmlld2VyLnZpZXcjYXV0b1BhZ2UjI3JlYWRUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXG4gICAgICAgICAgIC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sXFxuICAgIGNvbF90eXBlOiAncmljaF90ZXh0JyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIHRleHRTaXplOiAxOCxcXG4gICAgICAgIGNsaWNrOiB0cnVlXFxuICAgIH1cXG59KTtcXG5zZXRSZXN1bHQobGF5b3V0KTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNqLueroOiKguato+WImVwiLFwicGF0aFwiOlwicmVndWxhckNoYXB0ZXIuZlwiLFwicnVsZVwiOlwianM6XFxubGV0IHJ1bGVzID0gW3tcXG4gICAgICAgIFxcXCJpZFxcXCI6IC0xLFxcbiAgICAgICAgXFxcImVuYWJsZVxcXCI6IHRydWUsXFxuICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLnm67lvZUo5Y6756m655m9KVxcXCIsXFxuICAgICAgICBcXFwicnVsZVxcXCI6IFxcXCIoPzw9W+OAgFxcXFxcXFxcc10pKD865bqP56ugfOallOWtkHzmraPmlocoPyHlrox857uTKXznu4jnq6B85ZCO6K6wfOWwvuWjsHznlarlpJZ856ysP1xcXFxcXFxcc3swLDR9W1xcXFxcXFxcZOOAh+mbtuS4gOS6jOS4pOS4ieWbm+S6lOWFreS4g+WFq+S5neWNgeeZvuWNg+S4h+Wjuei0sOWPgeiChuS8jemZhuafkuaNjOeOluaLvuS9sOS7n10rP1xcXFxcXFxcc3swLDR9KD8656ugfOiKgig/Ieivvil85Y23fOmbhig/IVvlkIjlkoxdKSkpLnswLDMwfSRcXFwiLFxcbiAgICAgICAgXFxcImV4YW1wbGVcXFwiOiBcXFwi56ys5LiA56ugIOWBh+ijheesrOS4gOeroOWJjemdouacieepuueZveS9huaIkeS4jeimgVxcXCIsXFxuICAgICAgICBcXFwic2VyaWFsTnVtYmVyXFxcIjogMFxcbiAgICB9LFxcbiAgICB7XFxuICAgICAgICBcXFwiaWRcXFwiOiAtMixcXG4gICAgICAgIFxcXCJlbmFibGVcXFwiOiB0cnVlLFxcbiAgICA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FxcXCJuYW1lXFxcIjogXFxcIueJueauiuespuWPtyDmoIfpopgo5oiQ5a+5KVxcXCIsXFxuICAgICAgICBcXFwicnVsZVxcXCI6IFxcXCIoPzw9W1xcXFxcXFxcc+OAgF17MCw0fSkoPzpbXFxcXFxcXFxb44CI44CM44CO44CW44CU44CK77yI44CQXFxcXFxcXFwoXS57MSwzMH1bXFxcXFxcXFwp44CR77yJ44CL44CV44CX44CP44CN44CJXFxcXFxcXFxdXT98KD865YaF5a65fOaWh+eroCk/566A5LuLfOaWh+ahiHzliY3oqIB85bqP56ugfOallOWtkHzmraPmlocoPyHlrox857uTKXznu4jnq6B85ZCO6K6wfOWwvuWjsHznlarlpJYpWyDjgIBdezAsNH0kXFxcIixcXG4gICAgICAgIFxcXCJleGFtcGxlXFxcIjogXFxcIuOAjuWKoOS4quebtOinkuW8leWPt+abtOS4k+S4muOAj1xcXCIsXFxuICAgICAgICBcXFwic2VyaWFsTnVtYmVyXFxcIjogMTFcXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgXFxcImlkXFxcIjogLTE0LFxcbiAgICAgICAgXFxcImVuYWJsZVxcXCI6IHRydWUsXFxuICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLnibnmrornrKblj7cg5qCH6aKYKOWNleS4qilcXFwiLFxcbiAgICAgICAgXFxcInJ1bGVcXFwiOiBcXFwiKD88PVtcXFxcXFxcXHPjgIBdezAsNH0pKD86W+KYhuKYheKcpuKcp10uezEsMzB9fCg/OuWGheWuuXzmlofnq6ApP+eugOS7i3zmlofmoYh85YmN6KiAfOW6j+eroHzmpZTlrZB85q2j5paHKD8h5a6MfOe7kyl857uI56ugfOWQjuiusHzlsL7lo7B855Wq5aSWKVsg44CAXXswLDR9JFxcXCIsXFxuICAgICAgICBcXFwiZXhhbXBsZVxcXCI6IFxcXCLimIbjgIHmmYvmsZ/kvZzogIXmnIDllpzmrKLnmoTmoLzlvI9cXFwiLFxcbiAgICAgICAgXFxcInNlcmlhbE51bWJlclx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KTtcXG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwiPOa8q+eUu+WbvueJh+ino+aekOmUmeivr++8muWbvueJh+mTvuaOpei/lOWbnuS4uuepuj5cXFwiKTtcXG4gICAgfVxcbiAgICBpZiAoaW5mby5ib29rVG9wUGljKSB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBib29rVG9wUGljID0gVG9vbC5oaWtlclBpYyhpbmZvLmJvb2tUb3BQaWMpO1xcbiAgICAgICAgICAgIFRvb2wucGljRG93bmxvYWQoYm9va1RvcFBpY1swXSwgbWFpblBhdGggKyBpbmZvLmJvb2tOYW1lICsgXFxcIi5qcGdcXFwiLCBib29rVG9wUGljWzFdLCBpbmZvLmRlY29kZSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKFxcXCI85bCB6Z2i5LiL6L296ZSZ6K+vPiBcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbiAgICBsZXQgZXJyb3JOdW0gPSAwO1xcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IEw7IGkrKykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgcGljID0gVG9vbC5oaWtlclBpYyhwaWNMaXN0W2ldKTtcXG4gICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKHBpY1swXSwgY2hhcHRlclBhdGggKyAoaSArIDEpICsgXFxcIi5qcGdcXFwiLCBwaWNbMV0sIGluZm8uZGVjb2RlKTtcXG4gICAgICAgICAgICBpZiAoaW50ZXJydXB0ICYmIGdldE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiXFxcIikgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGVycm9yTnVtID0gMDtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4g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idGl0bGVcXFwiOiBydWxlTmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoX3VybFxcXCI6IFxcXCJoaWtlcjovL2VtcHR5P2lzQWxsPTEmc2VhcmNoVGVybXM9KiomdHlwZT1cXFwiICsgdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoRmluZFxcXCI6IFxcXCJqczokLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9TZWFyY2gudmlldz9ydWxlPScrTVlfUlVMRS5fdGl0bGUpO1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1dO1xcbiAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGFycjEpO1xcbiAgICAgICAgICAgIH0sIHJ1bGVOYW1lLCB0eXBlKSxcXG4gICAgICAgICAgICAvKmRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3NlYXJjaEtleScsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdzZWFyY2hLZXknLGlucHV0KVxcXCIqL1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLwn6epXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgdXJsOiAkKGNvbFR5cGVzLm1hcCh2PT52PT09Y29sX3R5cGU/XFxcIuKAnOKAnFxcXCIrditcXFwi4oCd4oCdXFxcIjp2KSkuc2VsZWN0KChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgaWYoL+KAnOKAnC4qP+KAneKAnS8udGVzdChpbnB1dCkpIHJldHVybjtcXG4gICAgICAgICAgICBzZXRJdGVtKFxcXCJib29rcmFjazpjb2xfdHlwZVxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGZvciAobGV0IG5hbWUgb2YgcmFua01ldGhvZHMpIHtcXG4gICAgICAgIGxldCBhID0gcmFua01ldGhvZCA9PT0gbmFtZTtcXG4gICAgICAgIGxldCB0aXRsZWEgPSBhID8gXFxcIuKAmOKAmFxcXCIgKyBuYW1lICsgXFxcIuKAmeKAmVxcXCIgOiBuYW1lO1xcbiAgICAgICAgbGV0IHRpdGxlYiA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKGEpIHtcXG4gICAgICAgICAgICB0aXRsZWIgPSAhcmFua0lzUmV2ZXJzZSA/IFxcXCLihpNcXFwiIDogXFxcIuKGkVxcXCI7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRpdGxlYiA9IFxcXCLihpVcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZWEgKyB0aXRsZWIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCByYW5rTWV0aG9kID0gZ2V0SXRlbShcXFwiYm9va3JhY2s6cmFua01ldGhvZFxcXCIsIFxcXCLns7vnu59cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IHJhbmtJc1JldmVyc2UgPSBnZXRJdGVtKFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcIiwgXFxcIlxcXCIpO1xcblxcbiAgICAgICAgICAgICAgICBpZiAocmFua01ldGhvZCA9PT0gbmFtZSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJhbmtJc1JldmVyc2UpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5rSXNSZXZlcnNlID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtJc1JldmVyc2UgPSBcXFwiMVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcIiwgcmFua0lzUmV2ZXJzZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6cmFua01ldGhvZFxcXCIsIG5hbWUpO1xcblxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LCBuYW1lKVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgbGV0IHJhbmtNZXRob2RNYXAgPSB7XFxuICAgICAgICBcXFwi57O757ufXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICBcXFwi5aSn5bCPXFxcIjogXFxcInNpemVcXFwiLFxcbiAgICAgICAgXFxcIuWQjeensFxcXCI6IFxcXCJuYW1lXFxcIixcXG4gICAgICAgIFxcXCLml7bpl7RcXFwiOiBcXFwidGltZVxcXCJcXG4gICAgfTtcXG4gICAgbGV0IGJvb2tMaXN0ID0gW107XFxuICAgIGxldCBsaXN0ID0gcmFuayhGaWxlLmdldEZpbGVzKHBhdGgsIFxcXCJkaXJcXFwiKSwgcmFua01ldGhvZE1hcFtyYW5rTWV0aG9kXSk7XFxuICAgIGlmIChsaXN0Lmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgYm9va0xpc3QucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuWVpemDveayoeacieiAtlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgfVxcbiAgICBsZXQgcGFnZVVybCA9IHR5cGUgPT09IFxcXCJub3ZlbFxcXCIgPyBcXFwiaGlrZXI6Ly9wYWdlL05vdmVsQnJvd3Nlci52aWV3XFxcIiA6IFxcXCJoaWtlcjovL3BhZ2UvQ29taWNCcm93c2VyLnZpZXdcXFwiO1xcbiAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgIGxldCBwaWMgPSBmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgaXRlbS5nZXRQYXRoKCkgKyBcXFwiL1xcXCIgKyBpdGVtLmdldE5hbWUoKSArIFxcXCIuanBnXFxcIikgPyBpdGVtLmdldFBhdGgoKSArIFxcXCIvXFxcIiArIGl0ZW0uZ2V0TmFtZSgpICsgXFxcIi5qcGdcXFwiIDogQ29uZmlnLmRlZl9QaWM7XFxuICAgICAgICBib29rTGlzdC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5nZXROYW1lKCksXFxuICAgICAgICAgICAgcGljX3VybDogcGljLFxcbiAgICAgICAgICAgIHVybDogcGFnZVVybCArIFxcXCI/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTpjb2xfdHlwZSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxvbmdQcmVzcy5qc1xcXCIpLmRlbGV0ZUZpbGVGb3JCb29rKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaXRlbS5nZXRQYXRoKCkpXFxuICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICBpZDogaXRlbS5nZXRQYXRoKCksXFxuICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0uZ2V0UGF0aCgpLFxcbiAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLmdldE5hbWUoKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGlmIChyYW5rSXNSZXZlcnNlKSB7XFxuICAgICAgICBib29rTGlzdC5yZXZlcnNlKCk7XFxuICAgIH1cXG5cXG4gICAgc2V0UmVzdWx0KGxheW91dC5jb25jYXQoYm9va0xpc3QpKTtcXG59KSgpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiI2Yu5paH5Lu25o6S5bqPXCIsXCJwYXRoXCI6XCJmaWxlUmFuay5qc1wiLFwicnVsZVwiOlwianM6XFxuY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiRmlsZS5qc1xcXCIpO1xcbmxldCBjaG5OdW1DaGFyID0ge1xcbiAgICDpm7Y6IDAsXFxuICAgIOS4gDogMSxcXG4gICAg5LqMOiAyLFxcbiAgICDkuIk6IDMsXFxuICAgIOWbmzogNCxcXG4gICAg5LqUOiA1LFxcbiAgICDlha06IDYsXFxuICAgIOS4gzogNyxcXG4gICAg5YWrOiA4LFxcbiAgICDkuZ06IDlcXG59O1xcblxcbmxldC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AgICAgaW50ZXJ2YWxzID0gYy5pbnRlcnZhbHM7XFxuICAgICAgICAgICAgaGFzUHJlZmFjZSA9IGMuaGFzUHJlZmFjZTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YeN5paw6Kej5p6Q55uu5b2VXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTpcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pSjph43mlrDop6PmnpApPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBzaG93TG9hZGluZyhcXFwi5q2j5Zyo6Kej5p6Q55uu5b2VXFxcIik7XFxuICAgICAgICBsZXQgdHh0ID0gcmVxdWVzdChwYXRoLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAvL1xcXCJjb250ZW50LXR5cGVcXFwiOiBcXFwidGV4dC9wbGFpbjsgY2hhcnN0PVxcXCIgKyBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBwYXR0ZXJuID0gcmVncy5nZXRUb2NSdWxlKHR4dCk7XFxuICAgICAgICBpZiAoIXBhdHRlcm4pIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgbWF0Y2hlciA9IHBhdHRlcm4ubWF0Y2hlcih0eHQpO1xcbiAgICAgICAgbGV0IHBvaW50ZXIgPSAwO1xcbiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7XFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gbWF0Y2hlci5zdGFydCgpO1xcbiAgICAgICAgICAgIGxldCBlbmQgPSBtYXRjaGVyLmVuZCgpO1xcbiAgICAgICAgICAgIGxldCB0ID0gbWF0Y2hlci5ncm91cCgpO1xcbiAgICAgICAgICAgIGlmIChwb2ludGVyID09PSAwICYmIHN0YXJ0ID4gMzApIHtcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZSA9IHRydWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNoYXB0ZXJOYW1lcy5wdXNoKHQpO1xcbiAgICAgICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCBzdGFydF0pO1xcbiAgICAgICAgICAgIHBvaW50ZXIgPSBlbmQ7XFxuICAgICAgICB9XFxuICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgdHh0Lmxlbmd0aF0pO1xcbiAgICAgICAgaWYgKGlzQ2FjaGUpIHtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoY2FjaGVQYXRoLCBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lczogY2hhcHRlck5hbWVzLFxcbiAgICAgICAgICAgICAgICBpbnRlcnZhbHM6IGludGVydmFscyxcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZTogaGFzUHJlZmFjZVxcbiAgICAgICAgICAgIH0pKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgIH1cXG5cXG5cXG4gICAgaWYgKGhhc1ByZWZhY2UpIHtcXG4gICAgICAgIGxldCBpbnRlcnZhbCA9IGludGVydmFsc1swXTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuW6j+iogFxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9UWFRWaWV3ZXIudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWU6IFxcXCLluo/oqIBcXFwiLFxcbiAgICAgICAgICAgICAgICBzdGFydDogaW50ZXJ2YWxbMF0sXFxuICAgICAgICAgICAgICAgIGVuZDogaW50ZXJ2YWxbMV0sXFxuICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgIGNoYXJzdDogY2hhcnN0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFwdGVyTmFtZXMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGxldCBuYW1lID0gY2hhcHRlck5hbWVzW2ldO1xcbiAgIC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tcXFxcbiAgICAgICAgICAgICAgICBsZXQgbGVuID0gMDtcXFxcbiAgICAgICAgICAgICAgICB3aGlsZSAoKGxlbiA9IGlzLnJlYWQodGJ5cykpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRvcy53cml0ZSh0YnlzLCAwLCBsZW4pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpcy5jbG9zZSgpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHRvcy5jbG9zZSgpO1xcXFxuICAgICAgICAvL+inhOWImeabv+aNouinhOWImTtcXFxcbiAgICAgICAgbGV0IG91dEZpbGUgPSBuZXcgRmlsZShmaWxlT3V0KTtcXFxcbiAgICAgICAgaWYgKHR5cGVvZiBpbnRlcmNlcHQgPT09IFxcXFxcXFwiZnVuY3Rpb25cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgbGV0IHRpcyA9IG5ldyBGaWxlSW5wdXRTdHJlYW0odG1wRmlsZSk7XFxcXG4gICAgICAgICAgICBsZXQgb3MgPSBuZXcgQnVmZmVyZWRPdXRwdXRTdHJlYW0obmV3IEZpbGVPdXRwdXRTdHJlYW0ob3V0RmlsZSkpO1xcXFxuICAgICAgICAgICAgbGV0IGxlbiA9IDA7XFxcXG4gICAgICAgICAgICBsZXQgYnlzID0gQXJyYXkubmV3SW5zdGFuY2UoQnl0ZS5UWVBFLCBCVUZGRVJfU0laRSk7XFxcXG4gICAgICAgICAgICB3aGlsZSAoKGxlbiA9IHRpcy5yZWFkKGJ5cykpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IG5ieXMgPSBpbnRlcmNlcHQobmV3IFN0cmluZyhieXMsMCxsZW4pKTtcXFxcbiAgICAgICAgICAgICAgICBvcy53cml0ZShuYnlzLCAwLCBuYnlzLmxlbmd0aCk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB0bXBGaWxlLmR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iAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGxldCBwaWMgPSBUb29sLmhpa2VyUGljKHRhc2tQYXJhbS51cmwpO1xcXFxuICAgICAgICAgICAgICAgIFRvb2wucGljRG93bmxvYWQocGljWzBdLCB0YXNrUGFyYW0uY2hhcHRlclBhdGggKyAodGFza1BhcmFtLmkgKyAxKSArIFxcXFxcXFwiLmpwZ1xcXFxcXFwiLCBwaWNbMV0sIHRhc2tQYXJhbS5kZWNvZGUpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcih0YXNrUGFyYW0uTVlfSUQgKyBcXFxcXFxcIjpzdGF0dXNcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIikgPT09IFxcXFxcXFwiMVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0gPSAwO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpID09PSA5KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiB0YXNrUGFyYW0uQ0lEO1xcXFxuICAgIH1cXFxcbiAgICBsZXQgY291bnQgPSAwO1xcXFxuICAgIGxldCB0b3RhbENvdW50ID0gMDtcXFxcbiAgICBsZXQgc3VjY2Vzc0NJRCA9IFtdO1xcXFxuXFxcXG4gICAgZnVuY3Rpb24gbGlzdGVuZXIocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICB0b3RhbENvdW50Kys7XFxcXG5cXFxcbiAgICAgICAgICAgIGlmIChlcnJvciAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeS4i+i9veWksei0pe+8mlxcXFxcXFwiICsgaWQgKyBcXFxcXFxcIjxFUlJPUkAgXFxcXFxcXCIgKyBlcnJvciArIFxcXFxcXFwiPlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzdWx0ID09PSAtMSkge1xcXFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFxcXFxcIltsaXN0ZW5lcl3lt7LlgZzmraLvvJpcXFxcXFxcIiArIGlkKTtcXFxcbiAgICAgICAgICAgICAgICB0b3RhbENvdW50ID0gcGFyYW0ucGl2Q291bnQ7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGNvdW50Kys7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJhdGlvID0gKChjb3VudCAvIHBhcmFtLnBpdkNvdW50KSkudG9GaXhlZCg0KTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgc3RyaXBDb3VudCA9IE1hdGguY2VpbChyYXRpbyAqIDEwKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAocGFyYW0ucGl2Q291bnQgPT09IHRvdGFsQ291bnQgJiYgdG90YWxDb3VudCA9PT0gY291bnQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgc3VjY2Vzc0NJRC5wdXNoKHBhcmFtLkNJRCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLkuIvovb3ov5vluqbvvJpcXFxcXFxcIiArIChzdWNjZXNzQ0lELmxlbmd0aCkgKyBcXFxcXFxcIi9cXFxcXFxcIiArIHBhcmFtLnRvdGFsLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuKAnOKAnOKAneKAnVxcXFxcXFwiICsgXFxcXFxcXCLilodcXFxcXFxcIi5yZXBlYXQoc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXFxcXFwiI2ZmYWMyZFxcXFxcXFwiKSArIFxcXFxcXFwi4paHXFxcXFxcXCIucmVwZWF0KDEwIC0gc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXFxcXFwiI2U1ZTFlNFxcXFxcXFwiKSArIFxcXFxcXFwiIFxcXFxcXFwiICsgU3RyaW5nKChyYXRpbyAqIDEwMCkpLnNsaWNlKDAsIDUpICsgXFxcXFxcXCIlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFxcXFxcInx85LiL6L296L+b5bqmXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIC8vcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeW3suWujOaIkOS4i+i9ve+8mlxcXFxcXFwiICsgaWQpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgIT09IHBhcmFtLnBpdkNvdW50KSByZXR1cm47XFxcXG4gICAgICAgICAgICBpZiAodG90YWxDb3VudCA9PT0gY291bnQpIHtcXFxcbiAgICAgICAgICAgICAgICBGaWxlLnJlbmFtZUZpbGUocGFyYW0uY2hhcHRlclBhdGgsIHBhcmFtLkNJRCArIFxcXFxcXFwiJEEkXFxcXFxcXCIgKyBUb29sLnRleHRTaGllbGQocGFyYW0udGl0bGUpKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHRvdGFsQ291bnQgPSBjb3VudCA9IDA7XFxcXG4gICAgICA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gICAgICBwaWNMaXN0ID0gcGljTGlzdC5maWx0ZXIocCA9PiBwKTtcXFxcbiAgICAgICAgdmFyIHRhc2tUZWFtID0gcGljTGlzdC5tYXAoKHVybCwgaSkgPT4gKHtcXFxcbiAgICAgICAgICAgIGZ1bmM6IHRhc2ssXFxcXG4gICAgICAgICAgICBpZDogaSxcXFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgaTogaSxcXFxcbiAgICAgICAgICAgICAgICBjaGFwdGVyUGF0aDogY2hhcHRlclBhdGgsXFxcXG4gICAgICAgICAgICAgICAgTVlfSUQ6IE1ZX0lELFxcXFxuICAgICAgICAgICAgICAgIGRlY29kZTogaW5mby5kZWNvZGVcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSkpO1xcXFxuICAgICAgICBiZSh0YXNrVGVhbSwge1xcXFxuICAgICAgICAgICAgZnVuYzogbGlzdGVuZXIsXFxcXG4gICAgICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgICAgIHBpdkNvdW50OiBwaWNMaXN0Lmxlbmd0aCxcXFxcbiAgICAgICAgICAgICAgICB0b3RhbDogY2hhcHRlclRlYW0ubGVuZ3RoLFxcXFxuICAgICAgICAgICAgICAgIG9yZGVyOiBvcmRlcixcXFxcbiAgICAgICAgICAgICAgICBDSUQ6IGl0ZW0uQ0lELFxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgaWYgKGdldE15VmFyKE1ZX0lEICsgXFxcXFxcXCI6c3RhdHVzXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpID09PSBcXFxcXFxcIjFcXFxcXFxcIikge1xcXFxuICAgIC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ic3RyaW5nXFxcXFxcXCIgJiYgZGVjaXBoZS5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICBsZXQgaW5zdHJlYW07XFxcXG4gICAgICAgICAgICBsZXQgb3V0c3RyZWFtO1xcXFxuICAgICAgICAgICAgbGV0IGZpbGU7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGZpbGUgPSBuZXcgamF2YS5pby5GaWxlKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlLmV4aXN0cygpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbGV0IGRpciA9IGZpbGUuZ2V0UGFyZW50RmlsZSgpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChkaXIgIT0gbnVsbCAmJiAhZGlyLmV4aXN0cygpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRpci5ta2RpcnMoKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaW5zdHJlYW0gPSBmZXRjaCh1cmwsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgaW5wdXRTdHJlYW06IHRydWVcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIG91dHN0cmVhbSA9IG5ldyBqYXZhLmlvLkZpbGVPdXRwdXRTdHJlYW0ocGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHQgPSAkLmhpa2VyLmlucHV0LFxcXFxuICAgICAgICAgICAgICAgICAgICBjID0gJC5oaWtlci51cmw7XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IGluc3RyZWFtO1xcXFxuICAgICAgICAgICAgICAgICQuaGlrZXIudXJsID0gdXJsO1xcXFxuICAgICAgICAgICAgICAgIGxldCBwaWNpbiA9IChuZXcgRnVuY3Rpb24oXFxcXFxcXCJyZXR1cm4gXFxcXFxcXCIgKyBkZWNpcGhlKSkoKTtcXFxcbiAgICAgICAgICAgICAgICAkLmhpa2VyLmlucHV0ID0gdDtcXFxcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IGM7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGJ1ZiA9IGphdmEubGFuZy5yZWZsZWN0LkFycmF5Lm5ld0luc3RhbmNlKGphdmEubGFuZy5CeXRlLlRZUEUsIDEwMjQpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBsZW47XFxcXG4gICAgICAgICAgICAgICAgd2hpbGUgKChsZW4gPSBwaWNpbi5yZWFkKGJ1ZikpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG91dHN0cmVhbS53cml0ZShidWYsIDAsIGxlbik7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGUgaW5zdGFuY2VvZiBqYXZhLmlvLkZpbGUgJiYgZmlsZS5leGlzdHMoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmaWxlLmRlbGV0ZSgpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBsb2coXFxcXFxcXCI86Kej5a+G5LiL6L29RXJyb3I+XFxcXFxcXCIgKyBlLnRvU3RyaW5nKCkpXFxcXG4gICAgICAgICAgICAgICAgdGhyb3cgZTtcXFxcbiAgICAgICAgICAgIH0gZmlu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XFxcXFxcIik7XFxcXG4gICAgaWYgKHRhZy5sZW5ndGggPT09IDApIHtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiLFxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6K6+572uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL1NldHRpbmcudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8yXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIHZlcnNpb246IE1ZX1JVTEUudmVyc2lvblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzluK7liqnigJ3igJ1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvaGVscC52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjP2tleXdvcmQ9bm92ZWxDb21pY1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8yXFxcXFxcXCJcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiAnPGgxIHN0eWxlPVxcXFxcXFwidGV4dC1hbGlnbjogY2VudGVyO1xcXFxcXFwiPuWVpemDveayoeacieiA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G4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcXFxcXCIudGdudW1cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdC5wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL3BhZ2UvQm9va3JhY2sudmlldz9ydWxlPeacrOWcsOi1hOa6kOeuoeeQhiZydWxlTmFtZT1cXFxcXFxcIitpdC5uYW1lK1xcXFxcXFwiJnR5cGU9XFxcXFxcXCIrdHlwZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIGl0LCB0eXBlKVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4g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FxcXFwiICsgKGkgKyAxKSArIFxcXFxcXFwiLmpwZ1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInBpY3M6Ly9cXFxcXFxcIiArIHBpY2xpc3Quam9pbihcXFxcXFxcIiYmXFxcXFxcXCIpO1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXFxcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IGdldFRpdGxlKGl0ZW0ubmFtZSk7XFxcXG4gICAgICAgICAgICBhcnJheS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBpdGVtLnBhdGggKyBsYXp5LFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX1ZpZXdfU3R5bGUsXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbWhsaXN0KSB7XFxcXG4gICAgICAgICAgICBsZXQgdGl0bGUgPSBnZXRUaXRsZShpdGVtLm5hbWUpO1xcXFxuICAgICAgICAgICAgYXJyYXkucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvY29taWNDb21wYXRpYmxlLnZpZXcjYXV0b1BhZ2UjI3JlYWRUaGVtZSM/cGF0aD1cXFxcXFxcIitpdGVtLnBhdGgsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IENvbmZpZy5kZWZfVmlld19TdHlsZSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhdGgsXFxcXG4gICAgICAgICAgICAgICAgICAgI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XFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGF0aCxcXFxcbiAgICAgICAgICAgICAgICBkaXJQYXRoOiBwYXRoLFxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX1ZpZXdfU3R5bGVcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxufSBlbHNlIHtcXFxcbiAgICBmb3IgKGxldCBpdGVtIG9mIGNoYXB0ZXJMaXN0KSB7XFxcXG4gICAgICAgIGxldCBuYW1lID0gZ2V0VGl0bGUoaXRlbS5uYW1lKTtcXFxcbiAgICAgICAgYXJyYXkucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgIHVybDogJChcXFxcXFxcIuehruiupOWIoOmZpFtcXFxcXFxcIiArIG5hbWUgKyBcXFxcXFxcIl3vvJ9cXFxcXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbi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cXFxcXCJ0ZXh0XzNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChbXFxcXFxcXCLoh6rlrprkuYl1cmxcXFxcXFxcIiwgXFxcXFxcXCLpgInmi6nmlofku7bot6/lvoRcXFxcXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFxcXFxcIuiHquWumuS5iXVybFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwiXFxcXFxcXCIsIFxcXFxcXFwi6L6T5YWl5Zu+54mH55qE6Lev5b6E5oiW6ICF6ZO+5o6lXFxcXFxcXCIpLmlucHV0KCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgMCkgfHwgXFxcXFxcXCJ7fVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gaW5wdXQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIDApIHx8IFxcXFxcXFwie31cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlnLmRlZl9QaWMgPSBcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIFBBVEg7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcXFxcXCJjb25maWcuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcIjpkZWZhdWx0UGljQmFja1xcXFxcXFwiLCBcXFxcXFxcInRydWVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIuanBnfC5qcGVnfC5naWZ8LnBuZ3wuc3ZnfC5ibXBcX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WNlbWVudFxcXFxcXFwiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFxcXFxcInBhdHRlcm5cXFxcXFxcIikgfHwgIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcXFxcXCJuYW1lXFxcXFxcXCIpIHx8IChuZXdSdWxlLnNjb3BlQ29udGVudCA9PT0gdW5kZWZpbmVkID8gZmFsc2UgOiAhbmV3UnVsZS5zY29wZUNvbnRlbnQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSBuZXdSdWxlLmlkO1xcXFxuICAgICAgICAgICAgICAgICAgICBuZXdSdWxlLmlkID0gaWQgfHwgbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZEluZGV4ID0gcnVsZUxpc3QuZmluZEluZGV4KHJ1bGUgPT4gcnVsZS5pZCA9PT0gaWQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaWRJbmRleCA+IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCsrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3Quc3BsaWNlKGlkSW5kZXgsIDEsIG5ld1J1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q291bnQrKztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnB1c2gobmV3UnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1b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xcXFwiXSwgMSwgXFxcXFxcXCLop4TliJnlr7zlhaVcXFxcXFxcIikuc2VsZWN0KChpbXBvcnRSdWxlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFxcXFxcIuWklumDqOaWh+S7tlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImZpbGVTZWxlY3Q6Ly9cXFxcXFxcIiArICQudG9TdHJpbmcoaW1wb3J0UnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKGltcG9ydFJ1bGUsIHRydWUpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFxcXFxcIi5qc29uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcXFxcXCJjb25maXJtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXFxcXFwic2VsZWN0UGF0aENhY2hlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSwgaW1wb3J0UnVsZSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzNcXFxcXFxcIlxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBmb3IgKGxldCBpID0gMCwgbGVuID0gcnVsZUxpc3QubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcXFxcbiAgICAgICAgICAgIGxldCByZXBsYWNlUnVsZSA9IHJ1bGVMaXN0W2ldO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiByZXBsYWNlUnVsZS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaSxcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yig6ZmkXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKGlkLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnVsZUx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m9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjI25vUmVmcmVzaCM/aW5kZXg9XFxcXFxcXCIgKyBpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgXFxcXFxcXCJjb250ZW50c1xcXFxcXFwiOlxcXFxuICAgICAgICBsZXQgZiA9IHJlcXVpcmUoXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCIpO1xcXFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcXFxcXCLnm67lvZXorr7nva586K6+572uXFxcXFxcXCIpO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLpgInmi6nmlofku7blpLlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogSlNPTi5zdHJpbmdpZnkoZi5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBQQVRIXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcXFxuICAgICAgICAgICAgICAgIGluaXRpYWxQYXRoOiBDb25maWcuaG9tZVBhdGgsXFxcXG4gICAgICAgICAgICAgICAgcmVxdWlyZVVybDogXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgcGF0dGVybjogMVxcXFxuICAgICAgICAgICAgfSkpLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiaW5wdXRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi5pSv5oyBaGlrZXI6Ly9maWxlc+i3r+W+hCjor6Xmk43kvZzkuI3kvJrliJ3lp4vljJbnm67lvZUpXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogQ29uZmlnLmhvbWVQYXRoLFxcXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZ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vbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IGlucHV0LnJlcGxhY2UoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5a+85YWl5o+Q56S6XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXFxcXFxcXCLlt7LlrZjlnKhbXFxcXFxcXCIgKyBub3ZlbE5hbWUgKyBcXFxcXFxcIl3mmK/lkKbopobnm5Y/XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aENhY2hlKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5a+85YWl5oiQ5YqfXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcXFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzb25cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZU1hdGNoID0gUEFUSC5tYXRjaCgvXFxcXFxcXFwvKFteXFxcXFxcXFwvXSo/KShcXFxcXFxcXC50eHR8XFxcXFxcXFwuZXB1YikkL2kpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vdmVsTmFtZSA9IGZpbGVNYXRjaFsxXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGggPSBDb25maWcuZXh0ZXJuYWxJbXBvcnRQYXRoICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aENhY2hlID0gQ29uZmlnLmNvbnRlbnRzQ2FjaGUgKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IFBBVEg7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi5bey5a2Y5ZyoW1xcXFxcXFwiICsgbm92ZWxOYW1lICsgXFxcXFxcXCJd5piv5ZCm6KaG55uWP1xcXFxcXFwiKS5jb25maXJtKChwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aENhY2hlKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiByZXF1aXJlVXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIudHh0fC5lcHViXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFxcXFxcImNvbmZpcm1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFxcXFxcInNlbGVjdFBhdGhDYWNoZTFcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KSxcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxc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gICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgcGF0aCArIFxcXFxcXFwiLmpzb25cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHBhdGggKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYXRoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLpmIXor7tcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gKHR5cGU9PT1cXFxcXFxcIi50eHRcXFxcXFxcIj9cXFxcXFxcImhpa2VyOi8vcGFnZS90eHRQYXJzZXIudmlld1xcXFxcXFwiOlxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcXFxcXCIpK1xcXFxcXFwiP3J1bGU9XFxcXFxcXCIgKyBNWV9SVUxFLnRpdGxlO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgY2FzZSBcXFxcXFxcIuaJk+W8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JOYW1lcyA9IGMuY2hhcHRlck5hbWVzO1xcXFxuICAgICAgICAgICAgaW50ZXJ2YWxzID0gYy5pbnRlcnZhbHM7XFxcXG4gICAgICAgICAgICBoYXNQcmVmYWNlID0gYy5oYXNQcmVmYWNlO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIumHjeaWsOino+aekOebruW9lVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFxcXFxcIi5qc29uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOmZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6XFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcXFxuICAgICAgICAgICAgICAgIH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gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL1RYVFZpZXdlci52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lOiBcXFxcXFxcIuW6j+iogFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXFxcbiAgICAgICAgICAgICAgICBlbmQ6IGludGVydmFsWzFdLFxcXFxuICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgY2hhcnN0OiBjaGFyc3RcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhcHRlck5hbWVzLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgIGxldCBuYW1lID0gY2hhcHRlck5hbWVzW2ldO1xcXFxuICAgICAgICBsZXQgaW50ZXJ2YWwgPSBpbnRlcnZhbHNbaSArIDFdO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9UWFRWaWV3ZXIudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBzdGFydDogaW50ZXJ2YWxbMF0sXFxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXFxcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZTogbmFtZSxcXFxcbiAgICAgICAgICAgIC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GluZm8uYm9va05hbWUgKyBcXFxcXFxcIi5qcGdcXFxcXFxcIiwgYm9va1RvcFBpY1sxXSwgaW5mby5kZWNvZGUpO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBsb2coXFxcXFxcXCI85bCB6Z2i5LiL6L296ZSZ6K+vPiBcXFxcXFxcIiArIGUubWVzc2FnZSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG5cXFxcbiAgICBsZXQgZXJyb3JOdW0gPSAwO1xcXFxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgTDsgaSsrKSB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBsZXQgcGljID0gVG9vbC5oaWtlclBpYyhwaWNMaXN0W2ldKTtcXFxcbiAgICAgICAgICAgIFRvb2wucGljRG93bmxvYWQocGljWzBdLCBjaGFwdGVyUGF0aCArIChpICsgMSkgKyBcXFxcXFxcIi5qcGdcXFxcXFxcIiwgcGljWzFdLCBpbmZvLmRlY29kZSk7XFxcXG4gICAgICAgICAgICBpZiAoaW50ZXJydXB0ICYmIGdldE15VmFyKE1ZX0lEICsgXFxcXFxcXCI6c3RhdHVzXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpID09PSBcXFxcXFxcIjFcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGVycm9yTnVtID0gMDtcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgaWYgKGVycm9yTnVtIDwgMTApIHtcXFxcbiAgICAgICAgICAgICAgICBpLS07XFxcXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0rKztcXFxcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdGhyb3cgZTtcXFxcbiAgICAgIC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4gICAgICAgICAgICB0aXRsZWIgPSAhcmFua0lzUmV2ZXJzZSA/IFxcXFxcXFwi4oaTXFxcXFxcXCIgOiBcXFxcXFxcIuKGkVxcXFxcXFwiO1xcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgdGl0bGViID0gXFxcXFxcXCLihpVcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGVhICsgdGl0bGViLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChuYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJhbmtNZXRob2QgPSBnZXRJdGVtKFxcXFxcXFwiYm9va3JhY2s6cmFua01ldGhvZFxcXFxcXFwiLCBcXFxcXFxcIuezu+e7n1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmFua0lzUmV2ZXJzZSA9IGdldEl0ZW0oXFxcXFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgaWYgKHJhbmtNZXRob2QgPT09IG5hbWUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJhbmtJc1JldmVyc2UpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtJc1JldmVyc2UgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFua0lzUmV2ZXJzZSA9IFxcXFxcXFwiMVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAg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QaWM7XFxcXG4gICAgICAgIGJvb2tMaXN0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZ2V0TmFtZSgpLFxcXFxuICAgICAgICAgICAgcGljX3VybDogcGljLFxcXFxuICAgICAgICAgICAgdXJsOiBwYWdlVXJsICsgXFxcXFxcXCI/cnVsZT1cXFxcXFxcIiArIE1ZX1JVTEUudGl0bGUsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTpjb2xfdHlwZSxcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcXFxcXCJsb25nUHJlc3MuanNcXFxcXFxcIikuZGVsZXRlRmlsZUZvckJvb2socGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0uZ2V0UGF0aCgpKVxcXFxuICAgICAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICAgICAgICAgIGlkOiBpdGVtLmdldFBhdGgoKSxcXFxcbiAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLmdldFBhdGgoKSxcXFxcbiAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLmdldE5hbWUoKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG4gICAgaWYgKHJhbmtJc1JldmVyc2UpIHtcXFxcbiAgICAgICAgYm9va0xpc3QucmV2ZXJzZSgpO1xcXFxuICAgIH1cXFxcblxcXFxuICAgIHNldFJlc3VsdChsYXlvdXQuY29uY2F0KGJvb2tMaXN0KSk7XFxcXG59KSgpO1xcXCJ9LHtcXFwiY29sX3R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3RyKSB7XFxcXG4gICAgbGV0IHJ0biA9IDA7XFxcXG4gICAgbGV0IHNlY3Rpb24gPSAwO1xcXFxuICAgIGxldCBudW1iZXIgPSAwO1xcXFxuICAgIGxldCBzZWNVbml0ID0gZmFsc2U7XFxcXG4gICAgbGV0IHN0ciA9IGNoblN0ci5zcGxpdCgnJyk7XFxcXG5cXFxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHN0ci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICBsZXQgbnVtID0gY2huTnVtQ2hhcltzdHJbaV1dO1xcXFxuICAgICAgICBpZiAodHlwZW9mIG51bSAhPT0gJ3VuZGVmaW5lZCcpIHtcXFxcbiAgICAgICAgICAgIG51bWJlciA9IG51bTtcXFxcbiAgICAgICAgICAgIGlmIChpID09PSBzdHIubGVuZ3RoIC0gMSkge1xcXFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gKz0gbnVtYmVyO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgbGV0IHVuaXQgPSBjaG5OYW1lVmFsdWVbc3RyW2ldXS52YWx1ZTtcXFxcbiAgICAgICAgICAgIHNlY1VuaXQgPSBjaG5OYW1lVmFsdWVbc3RyW2ldXS5zZWNVbml0O1xcXFxuICAgICAgICAgICAgaWYgKHNlY1VuaXQpIHtcXFxcbiAgICAgICAgICAgICAgICBzZWN0aW9uID0gKHNlY3Rpb24gKyBudW1iZXIpICogdW5pdDtcXFxcbiAgICAgICAgICAgICAgICBydG4gKz0gc2VjdGlvbjtcXFxcbiAgICAgICAgICAgICAgICBzZWN0aW9uID0gMDtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiArPSAobnVtYmVyICogdW5pdCk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBudW1iZXIgPSAwO1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxu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cXFxcIiArIFBBVEg7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuaXoOazleaJk+W8gO+8jOaYr+WQpuS9v+eUqOWFtuS7luW6lOeUqOaJk+W8gO+8n1xcXFxcXFwiKS5jb25maXJtKHBhdGggPT4gXFxcXFxcXCJvcGVuRmlsZTovL2ZpbGU6Ly9cXFxcXFxcIiArIHBhdGgsIFBBVEgpO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSksXFxcXG4gICAgaW5pdGlhbFBhdGg6IENvbmZpZ1t0eXBlXSxcXFxcbiAgICByb290RGlyUGF0aDogQ29uZmlnLmhvbWVQYXRoLFxcXFxuICAgIC8vb25DbGlja1R5cGU6IFxcXFxcXFwiY29uZmlybVxcXFxcXFwiLFxcXFxuICAgIC8vbWVtb3J5OiBcXFxcXFxcIkZpbGVNYW5hZ2VtZW50Om1lbW9yeVxcXFxcXFwiLFxcXFxuICAgIHJlcXVpcmVVcmw6IHVybCxcXFxcbiAgICBmaWxlVHlwZTogXFxcXFxcXCJcXFxcXFxcXC50eHR8XFxcXFxcXFwuZXB1YnwuanBnXFxcXFxcXCIsXFxcXG4gICAgLy9jSG9tZVRpcHM6IFxcXFxcXFwi5piv5ZCm5L2/55So5rW36ZiU5bCP56iL5bqP5omT5byAWyR7bmFtZX1dP1xcXFxcXFwiLFxcXFxuICAgIC8vY1NlYXJjaFRpcHM6IFxcXFxcXFwi5piv5ZCm5L2/55So5rW36ZiU5bCP56iL5bqP5omT5byAWyR7cGF0aH1dP1xcXFxcXFwiXFxcXG59KTtcXFwifV1cIixcInByb3h5XCI6XCJcIn0iLCJ0aXRsZSI6Iua3sea1t+S9meeDrCDkvZzogIXvvJrov5znnrMudHh0In0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement