Advertisement
xiaomianao666

邀您一起看:本地资源管理|设置-文件管理

Dec 29th, 2022
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥本地资源管理|设置-文件管理@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLkZpbGXlt6XlhbdcIixcInBhdGhcIjpcIkZpbGUuanNcIixcInJ1bGVcIjpcImNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3Qge1xcbiAgICBGaWxlcyxcXG4gICAgUGF0aHMsXFxuICAgIFN0YW5kYXJkQ29weU9wdGlvbixcXG4gICAgU3RhbmRhcmRPcGVuT3B0aW9uXFxufSA9IGphdmEubmlvLmZpbGU7XFxuY29uc3QgamF2YVN0cmluZyA9IGphdmEubGFuZy5TdHJpbmc7XFxubGV0IGphdmFTY29wZSA9IG5ldyBKYXZhSW1wb3J0ZXIoamF2YS5pbywgamF2YS5sYW5nLCBqYXZhLmxhbmcucmVmbGVjdCwgamF2YS51dGlsLlZlY3Rvcik7XFxuXFxuZnVuY3Rpb24gZGVsZXRlRmlsZXMoZmlsZU5hbWUpIHtcXG4gICAgbGV0IGZpbGUgPSBuZXcgRmlsZShmaWxlTmFtZSk7XFxuICAgIG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XJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChNWV9JRCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSBnZXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICBpZiAoc3RhdHVzID09PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJb5q2j5Zyo5YGc5q2iLi4uXVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mraPlnKjlj5bmtojkuIvovb3ku7vliqFcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSBcXFwiMVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ato+WcqOaaguWBnC4uLlxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09IFxcXCIyXFxcIikge1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7LpgIDlh7rkuIvovb3lmahcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoW1xcXCIzXFxcIiwgXFxcIjRcXFwiXS5pbmNsdWRlcyhzdGF0dXMpKSB7XFxuICAgICAgICAgICAgICAgI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iIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3ov5vluqZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlrozmiJDkuIvovb3vvJpcXFwiICsgaWQpO1xcbiAgICAgICAgfSBlbHNlIGlmIChDSUQgPT09IC0xKSB7XFxuICAgICAgICAgICAgZmFpbE5hbWUucHVzaChpZCk7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICBjb3VudCA9IHRhc2tDb3VudDtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmICh0YXNrQ291bnQgIT09IGNvdW50KSByZXR1cm47XFxuICAgICAgICBpZiAoc3VjY2Vzc0NJRC5sZW5ndGggPT09IHRhc2tDb3VudCkge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCLilodcXFwiLnJlcGVhdCgxMCkuZm9udGNvbG9yKFxcXCIjMDBmZjAwXFxcIikgKyBcXFwiIDEwMCVcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L296L+b5bqmXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgYmF0Y2hUZWFtID0gSlNPTi5wYXJzZShnZXRNeVZhcihNWV9JRCArIFxcXCI6YmF0Y2hUZWFtXFxcIi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Lu75Yqh77yM5L2G5bey5pyJ6L+b5bqm5LiN5Lya5raI5aSxI1xcXCIpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvph43mlrDlvIDlp4tdXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiYnJlYWtcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjJcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIuS4i+i9veS7u+WKoVtcXFwiICsgaW5mby5ib29rTmFtZSArIFxcXCJd5bey5YWo6YOo5oiQ5Yqf5a6M5oiQXFxcIik7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+i/lOWbnl1cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICB0b2FzdChcXFwi5LiL6L295Lu75YqhW1xcXCIgKyBpbmZvLmJvb2tOYW1lICsgXFxcIl3lt7LlrozmiJBcXFwiKTtcXG4gICAgfVxcbiAgICBsZXQgdGFza1RlYW1DaHVuayA9IFtdO1xcbiAgICBpZiAoQ29uZmlnLnRocmVhZE51bSA+IDApIHtcXG4gICAgICAgIHRhc2tUZWFtQ2h1bmsgPSBUb29sLmNodW5rKHRhc2tUZWFtLCBD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D5cXFwiICsgdGV4dCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwiI2xvZyNcXFwiICsgbG9nQ291bnRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxvZ0NvdW50Kys7XFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gdGFzayh0YXNrUGFyYW0pIHtcXG4gICAgICAgIGNvbnN0IFRvb2wgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Ub29sLmpzXFxcIik7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDEwOyBpKyspIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgcGljID0gVG9vbC5oaWtlclBpYyh0YXNrUGFyYW0udXJsKTtcXG4gICAgICAgICAgICAgICAgVG9vbC5waWNEb3dubG9hZChwaWNbMF0sIHRhc2tQYXJhbS5jaGFwdGVyUGF0aCArICh0YXNrUGFyYW0uaSArIDEpICsgXFxcIi5qcGdcXFwiLCBwaWNbMV0sIHRhc2tQYXJhbS5kZWNvZGUpO1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIodGFza1BhcmFtLk1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiXFxcIikgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGVycm9yTnVtID0gMDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBpZiAoaSA9PT0gOSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB0YXNrUGFyYW0uQ0lEO1xcbiAgICB9XFxuICAgIGxldCBjb3VudCA9IDA7XFxuICAgIGxldCB0b3RhbENvdW50ID0gMDtcXG4gICAgbGV0IHN1Y2Nlc3NDSUQgPSBbXTtcXG5cXG4gICAgZnVuY3Rpb24gbGlzdGVuZXIocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICB0cnl7XFxuICAgICAgICB0b3RhbENvdW50Kys7XFxuICAgICAgICBcXG4gICAgICAgIGlmIChlcnJvciAhPSBudWxsKSB7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5LiL6L295aSx6LSl77yaXFxcIiArIGlkICsgXFxcIjxFUlJPUkAgXFxcIiArIGVycm9yICsgXFxcIj5cXFwiKTtcXG4gICAgICAgIH0gZWxzZSBpZiAocmVzdWx0ID09PSAtMSkge1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeW3suWBnOatou+8mlxcXCIgKyBpZCk7XFxuICAgICAgICAgICAgdG90YWxDb3VudCA9IHBhcmFtLnBpdkNvdW50O1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBjb3VudCsrO1xcbiAgICAgICAgICAgIGxldCByYXRpbyA9ICgoY291bnQgLyBwYXJhbS5waXZDb3VudCkpLnRvRml4ZWQoNCk7XFxuICAgICAgICAgICAgbGV0IHN0cmlwQ291bnQgPSBNYXRoLmNlaWwocmF0aW8gKiAxMCk7XFxuICAgICAgICAgICAgaWYgKHBhcmFtLnBpdkNvdW50PT09dG90YWxDb3VudCYmdG90YWxDb3VudCA9PT0gY291bnQpe1xcbiAgICAgICAgICAgICAgICBzdWNjZXNzQ0lELnB1c2gocGFyYW0uQ0lEKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiL6L296L+b5bqm77yaXFxcIiArIChzdWNjZXNzQ0lELmxlbmd0aCkgKyBcXFwiL1xcXCIgKyBwYXJhbS50b3RhbCxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi4paHXFxcIi5yZXBlYXQoc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZmZhYzJkXFxcIikgKyBcXFwi4paHXFxcIi5yZXBlYXQoMTAgLSBzdHJpcENvdW50KS5mb250Y29sb3IoXFxcIiNlNWUxZTRcXFwiKSArIFxcXCIgXFxcIiArIFN0cmluZygocmF0aW8gKiAxMDApKS5zbGljZSgwLCA1KSArIFxcXCIlXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9vei/m+W6plxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIC8vcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5a6M5oiQ5LiL6L2977yaXFxcIiArIGlkKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0b3RhbENvdW50ICE9PSBwYXJhbS5waXZDb3VudCkgcmV0dXJuO1xcbiAgICAgICAgaWYgKHRvdGFsQ291bnQgPT09IGNvdW50KXtcXG4gICAgICAgICAgICBGaWxlLnJlbmFtZUZpbGUocGFyYW0uY2hhcHRlclBhdGgsIHBhcmFtLkNJRCArIFxcXCIkQSRcXFwiICsgVG9vbC50ZXh0U2hpZWxkKHBhcmFtLnRpdGxlKSk7XFxuICAgICAgICB9XFxuICAgICAgICB0b3RhbENvdW50ID0gY291bnQgPSAwO1xcbiAgICAgICAgcmV0dXJuIFxcXCJicmVha1xcXCI7XFxuICAgICAgICB9Y2F0Y2goZSl7XFxuICAgICA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nB1dFxcXCIsIFxcXCJ1cmxcXFwiLCBcXFwicmV0dXJuXFxcIiArIGluZm8ucGFyc2VDb2RlKTtcXG4gICAgICAgICAgICBwaWNMaXN0ID0gZ2V0UGljTGlzdChpdGVtLnVybCwgaXRlbS51cmwpO1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcGljTGlzdCA9PT0gXFxcInN0cmluZ1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgcGljTGlzdCA9IHBpY0xpc3QucmVwbGFjZShcXFwicGljczovL1xcXCIsIFxcXCJcXFwiKS5zcGxpdChcXFwiJiZcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCI85ryr55S75Zu+54mH6Kej5p6Q6ZSZ6K+vPiBcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChwaWNMaXN0Lmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwiPOa8q+eUu+WbvueJh+ino+aekOmUmeivr++8muWbvueJh+mTvuaOpei/lOWbnuS4uuepuj5cXFwiKTtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB0YXNrVGVhbSA9IHBpY0xpc3QubWFwKCh1cmwsIGkpID0+ICh7XFxuICAgICAgICAgICAgZnVuYzogdGFzayxcXG4gICAgICAgICAgICBpZDogaSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgaTogaSxcXG4gICAgICAgICAgICAgICAgY2hhcHRlclBhdGg6IGNoYXB0ZXJQYXRoLFxcbiAgICAgICAgICAgICAgICBNWV9JRDogTVlfSUQsXFxuICAgICAgICAgICAgICAgIGRlY29kZTogaW5mby5kZWNvZGVcXG4gICAgICAgICAgICB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xcIikgfHwga2V5LmluY2x1ZGVzKFxcXCI/XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgcGljVXJsICs9IFxcXCJAXFxcIiArIGtleSArICh2YWx1ZSA/IFxcXCI9XFxcIiArIHZhbHVlIDogXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5ICE9PSBcXFwianNcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBbcGljVXJsLCBoZWFkZXJzXTtcXG4gICAgfSxcXG4gICAgcmFuZ2Uoc3RhcnQsIGVuZCkge1xcbiAgICAgICAgcmV0dXJuIEFycmF5KGVuZCAtIHN0YXJ0KS5maWxsKDApLm1hcCgoZWwsIGkpID0+IHN0YXJ0ICsgaSk7XFxuICAgIH0sXFxuICAgIHBpY0Rvd25sb2FkKHVybCwgcGF0aCwgaGVhZGVycywgZGVjaXBoZSkge1xcbiAgICAgICAgaWYgKHR5cGVvZiBkZWNpcGhlID09PSBcXFwic3RyaW5nXFxcIiAmJiBkZWNpcGhlLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICBsZXQgaW5zdHJlYW07XFxuICAgICAgICAgICAgbGV0IG91dHN0cmVhbTtcXG4gICAgICAgICAgICBsZXQgZmlsZTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBmaWxlID0gbmV3IGphdmEuaW8uRmlsZShwYXRoKTtcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGUuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgZGlyID0gZmlsZS5nZXRQYXJlbnRGaWxlKCk7XFxuICAgICAgICAgICAgICAgIGlmIChkaXIgIT0gbnVsbCAmJiAhZGlyLmV4aXN0cygpKSB7XFxuICAgICAgICAgICAgICAgICAgICBkaXIubWtkaXJzKCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaW5zdHJlYW0gPSBmZXRjaCh1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICBpbnB1dFN0cmVhbTogdHJ1ZVxcbiAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgb3V0c3RyZWFtID0gbmV3IGphdmEuaW8uRmlsZU91dHB1dFN0cmVhbShwYXRoKTtcXG4gICAgICAgICAgICAgICAgbGV0IHQgPSAkLmhpa2VyLmlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgYyA9ICQuaGlrZXIudXJsO1xcbiAgICAgICAgICAgICAgICAkLmhpa2VyLmlucHV0ID0gaW5zdHJlYW07XFxuICAgICAgICAgICAgICAgICQuaGlrZXIudXJsID0gdXJsO1xcbiAgICAgICAgICAgICAgICBsZXQgcGljaW4gPSAobmV3IEZ1bmN0aW9uKFxcXCJyZXR1cm4gXFxcIiArIGRlY2lwaGUpKSgpO1xcbiAgICAgICAgICAgICAgICAkLmhpa2VyLmlucHV0ID0gdDtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSBjO1xcbiAgICAgICAgICAgICAgICBsZXQgYnVmID0gamF2YS5sYW5nLnJlZmxlY3QuQXJyYXkubmV3SW5zdGFuY2UoamF2YS5sYW5nLkJ5dGUuVFlQRSwgMTAyNCk7XFxuICAgICAgICAgICAgICAgIGxldCBsZW47XFxuICAgICAgICAgICAgICAgIHdoaWxlICgobGVuID0gcGljaW4ucmVhZChidWYpKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgb3V0c3RyZWFtLndyaXRlKGJ1ZiwgMCwgbGVuKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGUgaW5zdGFuY2VvZiBqYXZhLmlvLkZpbGUgJiYgZmlsZS5leGlzdHMoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmlsZS5kZWxldGUoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsb2coXFxcIjzop6Plr4bkuIvovb1FcnJvcj5cXFwiICsgZS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICB0aHJvdyBlO1xcbiAgICAgICAgICAgIH0gZmluYWxseSB7XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXF1aXJlRG93bmxvYWQodXJsLCBwYXRoLCBoZWFkZXJzKTtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgdGV4dFNoaWVsZCh0ZXh0KSB7XFxuICAgICAgICBsZXQgZSA9IC8jfDp8JnxcXFxcfHxcXFxcXnxAfFxcXFw8fFxcXFw+fCV8XFxcXC98XFxcXD8vZztcXG4gICAgICAgIHJldHVybiB0ZXh0LnJlcGxhY2UoZSwgXFxcIl9cXFwiKTtcXG4gICAgfVxcbiAgICBcXG59XFxuXFxuJC5leHBvcnRzID0gdjtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNqLkNvbmZpZ1wiLFwicGF0aFwiOlwiQ29uZmlnLmpzb25cIixcInJ1bGVcIjpcImpzOlxcbmNvbnN0IEZpbGUgP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dHlwZSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCJcXG4gICAgfSk7XFxuICAgIGlmICh0eXBlID09PSBcXFwidHh0XFxcIikge1xcbiAgICAgICAgdHh0VmlldyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2V4dGVybmFsaW1wb3J0VHh0LnZpZXdcXFwiKTtcXG4gICAgICAgIHJldHVybiB0eHRWaWV3KGxheW91dCk7XFxuICAgIH1cXG4gICAgbGV0IHRhZyA9IEZpbGUuZ2V0RmlsZVBhdGgoQ29uZmlnW3R5cGUgKyBcXFwiUGF0aFxcXCJdLCBcXFwiZGlyXFxcIik7XFxuICAgIGlmICh0YWcubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIixcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6K6+572uXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvU2V0dGluZy52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmVyc2lvbjogTVlfUlVMRS52ZXJzaW9uXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzluK7liqnigJ3igJ1cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9oZWxwLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSM/a2V5d29yZD1ub3ZlbENvbWljXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGgxIHN0eWxlPVxcXCJ0ZXh0LWFsaWduOiBjZW50ZXI7XFxcIj7llaXpg73msqHmnInogLY8L2gxPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBzZXRSZXN1bHQobGF5b3V0KTtcXG4gICAgfVxcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB1cmw6ICdcXFwiaGlrZXI6Ly9zZWFyY2g/cz1cXFwiK2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLmkJzkvaDmg7PopoHnmoQjXFxcIiArIHR5cGUgKyBcXFwiIy4uLi4uLlxcXCIsXFxuICAgICAgICB0aXRsZTogXFxcIvCflI1cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHJ1bGVzOiAkLnRvU3RyaW5nKCh0YWcsIHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGFycjEgPSBbXTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0YWcubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGFycjEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogdGFnW2ldLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF91cmxcXFwiOiBcXFwiaGlrZXI6Ly9lbXB0eT9pc0FsbD0xJnNlYXJjaFRlcm1zPSoqJnR5cGU9XFxcIiArIHR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaEZpbmRcXFwiOiBcXFwianM6JC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvU2VhcmNoLnZpZXc/cnVsZT0nK01ZX1JVTEUuX3RpdGxlKTtcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoYXJyMSk7XFxuICAgICAgICAgICAgfSwgdGFnLCB0eXBlKSxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdzZWFyY2hLZXknLCAnJyksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuKAmOKAmOKameiuvue9ruKAmeKAmVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1NldHRpbmcudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHZlcnNpb246IE1ZX1JVTEUudmVyc2lvblxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG5cXG4gICAgZm9yIChsZXQgaSBpbiB0YWcpIHtcXG4gICAgICAgIGxldCBpdCA9IHRhZ1tpXTtcXG4gICAgICAgIGlmICh0Z251bSA9PT0gaSkge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJxcXFwiICsgaXQubmFtZSArIFxcXCLigJ3igJ1cXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoW1xcXCLliKDpmaTor6Xnm67lvZVcXFwiLCBcXFwi6Lez6L2s5bCP56iL5bqPXFxcIiwgXFxcIuaJk+W8gOS5puaetlxcXCJdLCAxLCBcXFwi6YCJ5oup5pON5L2cXFxcIikuc2VsZWN0KChpdCwgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLot7PovazlsI/nqIvluo9cXFwiID09PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9ob21lQFxcXCIgKyBpdC5uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKFxcXCLliKDpmaTor6Xnm67lvZVcXFwiPT09aW5wdXQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIHRoZW4oW1xcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnInmvKvnlLvlsIbooqvliKDpmaRcXFwiXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuivpeaTjeS9nOS4jeS8muWIoOmZpOWwj+eoi+W6j++8jOS9huivpeWwj+eoi+W6j+S4i+i9veeahOaJgOaciSDmvKvnlLsv5bCP6K+0IOWwhuiiq+WIoOmZpFxcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcIi50Z251bVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdC5wYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL0Jvb2tyYWNrLnZpZXc/cnVsZT3mnKzlnLDotYTmupDnrqHnkIYmcnVsZU5hbWU9XFxcIitpdC5uYW1lK1xcXCImdHlwZT1cXFwiK3R5cGU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0LCB0eXBlKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoaSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiLnRnbnVtXFxcIiwgaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIj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1BpYztcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgIHBpY191cmw6IHBpYyxcXG4gICAgICAgICAgICB1cmw6IHBhZ2VVcmwgKyBcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUsXFxuICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oaXRlbSwge1xcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxvbmdQcmVzcy5qc1xcXCIpLmRlbGV0ZUZpbGVGb3JCb29rKHBhdGgpXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLnBhdGgpXFxuICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICBpZDogaXRlbS5wYXRoXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIHNldFJlc3VsdChsYXlvdXQpO1xcbn1cXG5cXG5tYWluKCk7XCJ9LHtcImNvbF90eXBlXCI6XCJ0ZXh0XzFcIixcIm5hbWVcIjpcIiN2Lua8q+eUu+eroOiKguWIl+ihqFwiLFwicGF0aFwiOlwiQ29taWNCcm93c2VyLnZpZXdcIixcInJ1bGVcIjpcImpzOlxcbmlmIChnZXRQYXJhbShcXFwiaGFzUGFyYW1zXFxcIikgPT09IFxcXCJ0cnVlXFxcIikge1xcbiAgICBNWV9QQVJBTVMgPSB7XFxuICAgICAgICBwYXRoOiBkZWNvZGVVUklDb21wb25lbnQoZ2V0UGFyYW0oXFxcInBhdGhcXFwiKSksXFxuICAgICAgICBuYW1lOiBkZWNvZGVVUklDb21wb25lb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AgICBsZXQgdGl0bGUgPSBnZXRUaXRsZShpdGVtLm5hbWUpO1xcbiAgICAgICAgICAgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb21pY0NvbXBhdGlibGUudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lIz9wYXRoPVxcXCIraXRlbS5wYXRoLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9WaWV3X1N0eWxlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXRoLFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldFRpdGxlMihpdGVtLm5hbWUpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbn0gZWxzZSB7XFxuICAgIGZvciAobGV0IGl0ZW0gb2YgbWhsaXN0KSB7XFxuICAgICAgICBsZXQgbmFtZSA9IGdldFRpdGxlMihpdGVtLm5hbWUpO1xcbiAgICAgICAgYXJyYXkucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTliKDpmaRbXFxcIiArIG5hbWUgKyBcXFwiXe+8n1xcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoO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gICAgICAgICB1cGRhdGVJdGVtKHRpZCArIFxcXCIj6K6+572uX+abtOaWsFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5bey57uP5piv5pyA5paw54mI5pys5LqGXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sue7j+aYr+acgOaWsOeJiOacrOS6hlxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh0aWQgKyBcXFwiI+iuvue9rl/mm7TmlrBcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuacieaWsOeJiOacrOi/mOacquabtOaWsFxcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLmnInmlrDniYjmnKzov5jmnKrmm7TmlrBcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJydWxlOi8vNXJXMzZaaVU2S2VHNTVXTTc3K2xhRzl0WlY5eWRXeGxYM1Z5Yk8rL3BXaDBkSEE2THk5b2FXdGxjaTV1YjJ0cFlTNXdjbVZ6Y3k5b2FXdGxjblZzWlM5eWRXeGxiR2x6ZEM1cWMyOXVQMmxrUFRNMU5Uaz1cXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHRpZCArIFxcXCIj6K6+572uX+abtOaWsFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv6Hmga/ojrflj5blpLHotKVcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+abtOaWsOS/oeaBr+iOt+WPluWksei0pVxcXCI7XFxuICAgICAgICB9XFxuICAgIH0sIE1ZX1BBUkFN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W1cXFwiLCBcXFwiXFxcIiArIGlucHV0TnVtKTtcXG4gICAgICAgICAgICBjb25zdCBib29rSW5mbyA9IEpTT04ucGFyc2UocmVxdWVzdChcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIikgfHwgXFxcInt9XFxcIik7XFxuICAgICAgICAgICAgYm9va0luZm8uZm9vdCA9IGlucHV0TnVtO1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoYm9va0luZm8pKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICB9LCB2aWV3UGFnZUNvdW50LCBwYWdlTnVtLCBwYXRoKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF81XFxcIlxcbiAgICB9KTtcXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLkuIrkuIDpobVcXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYWdlTnVtLCBwYXRoKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGlucHV0TnVtID0gcGFnZU51bSAtIDE7XFxuICAgICAgICAgICAgaWYgKGlucHV0TnVtIDwgMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5piv56ys5LiA6aG15LqGXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcIi5wYWdlTnVtXFxcIiwgXFxcIlxcXCIgKyBpbnB1dE51bSk7XFxuICAgICAgICAgICAgY29uc3QgYm9va0luZm8gPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIpIH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W07XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShib29rSW5mbykpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfSwgdmlld1BhZ2VDb3VudCwgcGFnZU51bSwgcGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfNVxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5pyr6aG1XFxcIixcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgodmlld1BhZ2VDb3VudCwgcGFnZU51bSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBpbnB1dE51bSA9IHZpZXdQYWdlQ291bnQgLSAxO1xcbiAgICAgICAgICAgIGlmIChwYWdlTnVtID09PSBpbnB1dE51bSB8fCBpbnB1dE51bSA9PT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sue7j+aYr+acgOWQjuS4gOmhteS6hlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCIucGFnZU51bVxcXCIsIFxcXCJcXFwiICsgaW5wdXROdW0pO1xcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICBib29rSW5mby5mb290ID0gaW5wdXROdW07XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWx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dGxlKGl0ZW0ubmFtZSk7XFxuICAgICAgICBhcnJheS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvTm92ZWxNYWluQm9keSNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXRoLFxcbiAgICAgICAgICAgICAgICBkaXJQYXRoOiBwYXRoLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX1ZpZXdfU3R5bGVcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufSBlbHNlIHtcXG4gICAgZm9yIChsZXQgaXRlbSBvZiBjaGFwdGVyTGlzdCkge1xcbiAgICAgICAgbGV0IG5hbWUgPSBnZXRUaXRsZShpdGVtLm5hbWUpO1xcbiAgICAgICAgYXJyYXkucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTliKDpmaRbXFxcIiArIG5hbWUgKyBcXFwiXe+8n1xcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1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4gICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOa4hemZpOWFqOmDqOe8k+WtmOaVsOaNrj9cXFwiKS5jb25maXJtKGNsZWFuQ2FjaGUsIENvbmZpZy5ob21lUGF0aClcXG4gICAgICAgIH0pO1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgXFxcImRlZmF1bHRQaWNcXFwiOlxcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXCLpu5jorqTlsIHpnaJ86K6+572uXFxcIik7XFxuICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcIjpkZWZhdWx0UGljQmFja1xcXCIpKSB7XFxuICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcIjpkZWZhdWx0UGljQmFja1xcXCIpO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgZnVuY3Rpb24gc2V0RGVmYXVsdFBpYyh1cmwpIHtcXG4gICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCAwKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IHVybDtcXG4gICAgICAgICAgICBzYXZlRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXG4gICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgc3RhcnQgPSAxO1xcbiAgICAgICAgaWYgKHR5cGVvZihNWV9OQU1FKSAhPT0gXFxcInVuZGVmaW5lZFxcXCIgJiYgTVlfTkFNRSA9PT0gXFxcIuWXheiniea1j+iniOWZqFxcXCIpIHtcXG4gICAgICAgICAgICBzdGFydCA9IDQ7XFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBpID0gc3RhcnQ7IGkgPD0gNDsgaSsrKSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWbvueJh1xcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzNcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaG9tZV9waWNcXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKHNldERlZmF1bHRQaWMsIFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX3BpY1xcXCIgKyBpKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6Ieq5a6a5LmJ4p6VXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFwi6Ieq5a6a5LmJdXJsXFxcIiwgXFxcIumAieaLqeaWh+S7tui3r+W+hFxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLoh6rlrprkuYl1cmxcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpeWbvueJh+eahOi3r+W+hOaIluiAhemTvuaOpVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCAwKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9IHJlcXVpcmUocmVxdWlyZVVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIDApIHx8IFxcXCJ7fVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IFxcXCJmaWxlOi8vXFxcIiArIFBBVEg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiOmRlZmF1bHRQaWNCYWNrXFxcIiwgXFxcInRydWVcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiByZXF1aXJlVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLmpwZ3wuanBlZ3wuZ2lmfC5wbmd8LnN2Z3wuYm1wXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lbW9yeTogXFxcInNlbGVjdFBhdGhDYWNoZTJcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIFxcXCJyZXBsYWNlUnVsZVxcXCI6XFxuICAgICAgICBpZiAoTVlfUEFSQU1TLmlzUmVmcmVzaCkge1xcbiAgICAgICAgICAgIGFkZExpc3RlbmVyKFxcXCJvbkNsb3NlXFxcIiwgJC50b1N0cmluZygoKSA9PiByZWZyZXNoUGFnZSgpKSk7XFxuICAgICAgICB9XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuabv+aNouinhOWImXzorr7nva5cXFwiKTtcXG4gICAgICAgIGxldCBydWxlTGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiKSB8fCBcXFwiW11cXFwiKTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuaWsOW7uuabv+aNolxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2Vk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ZW50ID09PSB1bmRlZmluZWQgPyBmYWxzZSA6ICFuZXdSdWxlLnNjb3BlQ29udGVudCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZCA9IG5ld1J1bGUuaWQ7XFxuICAgICAgICAgICAgICAgICAgICBuZXdSdWxlLmlkID0gaWQgfHwgbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWRJbmRleCA9IHJ1bGVMaXN0LmZpbmRJbmRleChydWxlID0+IHJ1bGUuaWQgPT09IGlkKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpZEluZGV4ID4gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCsrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnNwbGljZShpZEluZGV4LCAxLCBuZXdSdWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q291bnQrKztcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5wdXNoKG5ld1J1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlzYmFjaykge1xcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsb2coXFxcIlxcXFxu6Lev5b6E77yaXFxcIiArIGlucHV0ICsgXFxcIlxcXFxu5oC76KeE5YiZ5pWw77yaXFxcIiArIG5ld1J1bGVMaXN0Lmxlbmd0aCArIFxcXCJcXFxcbuabtOaWsOinhOWImSBcXFwiICsgdXBkYXRlQ291bnQgKyBcXFwiIOadoVxcXFx05paw5aKe6KeE5YiZIFxcXCIgKyBuZXdDb3VudCArIFxcXCIg5p2hXFxcIik7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoaXNiYWNrKSBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXlpLHotKVcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLlr7zlhaXop4TliJlcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChbXFxcIuWklumDqOaWh+S7tlxcXCIsIFxcXCLlhoXpg6jmlofku7ZcXFwiXSwgMSwgXFxcIuinhOWImeWvvOWFpVxcXCIpLnNlbGVjdCgoaW1wb3J0UnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLlpJbpg6jmlofku7ZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImZpbGVTZWxlY3Q6Ly9cXFwiICsgJC50b1N0cmluZyhpbXBvcnRSdWxlKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoaW1wb3J0UnVsZSwgdHJ1ZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qc29uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lbW9yeTogXFxcInNlbGVjdFBhdGhDYWNoZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgaW1wb3J0UnVsZSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBsZW4gPSBydWxlTGlzdC5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xcbiAgICAgICAgICAgIGxldCByZXBsYWNlUnVsZSA9IHJ1bGVMaXN0W2ldO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHJlcGxhY2VSdWxlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZyA9IHJ1bGVMaXN0LnNwbGljZShpbmRleCwgMSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAvL2RlbGV0ZUl0ZW1CeUNscyhpZCArIFxcXCIuXFxcIiArIGluZGV4KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLliKDpmaTmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGlkLCBpKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnvJbovpFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZWRpdFJlcGxhY2VSdWxlLnZpZXcjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjI25vUmVmcmVzaCM/aW5kZXg9XFxcIiArIGksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSBcXFwiY29udGVudHNcXFwiOlxcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIik7XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuebruW9leiuvue9rnzorr7nva5cXFwiKTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIumAieaLqeaWh+S7tuWkuVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeShmLmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShpZCkuZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxuICAgICAgICAgICAgICAgIGluaXRpYWxQYXRoOiBDb25maWcuaG9tZVBhdGgsXFxuICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIixcXG4gICAgICAgICAgICAgICAgcGF0dGVybjogMVxcbiAgICAgICAgICAgIH0pKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwi5pSv5oyBaGlrZXI6Ly9maWxlc+i3r+W+hCjor6Xmk43kvZzkuI3kvJrliJ3lp4vljJbnm67lvZUpXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IENvbmZpZy5ob21lUGF0aCxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRN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gIHJldHVybiBcXFwidG9hc3Q6Ly/lt7LlhbPpl61cXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjb25zdCBib29rSW5mbyA9IE9iamVjdC5hc3NpZ24oe1xcbiAgICAgICAgICAgICAgICBzZWxlY3RlZDogW11cXG4gICAgICAgICAgICB9LCBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIpIHx8IFxcXCJ7fVxcXCIpKTtcXG4gICAgICAgICAgICBib29rSW5mby5zZWxlY3RlZC5zcGxpY2UoYm9va0luZm8uc2VsZWN0ZWQuaW5kZXhPZihyZXBsYWNlUnVsZS5pZCksIDEpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJGlkLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4peLXFxcIiArIHJlcGxhY2VSdWxlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpc1RydWU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICRpZCxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShib29rSW5mbykpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCArIGksIHJlcGxhY2VSdWxlLCBNWV9QQVJBTVMucGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIGNvbF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ZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcInNlYXJjaEtleUJ5VHh0XFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ3NlYXJjaEtleUJ5VHh0JyxpbnB1dClcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuWvvOWFpeWwj+ivtFxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCIsXFxuICAgICAgICB1cmw6ICQoW1xcXCLns7vnu5/pgInmi6nlmahcXFwiLCBcXFwi5rW36ZiU6YCJ5oup5ZmoXFxcIl0sIDEsIFxcXCLpgInmi6nlmajnsbvlnotcXFwiKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIuezu+e7n+mAieaLqeWZqFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJmaWxlU2VsZWN0Oi8vXFxcIiArICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEvKFxcXFwudHh0fC5lcHViKSQvaS50ZXN0KGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLpgInmi6nkuobplJnor6/nmoTmlofku7bnsbvlnotcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IGlucHV0Lm1hdGNoKC9cXFxcLyhbXlxcXFwvXSo/KShcXFxcLnR4dHxcXFxcLmVwdWIpJC9pKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV0ucmVwbGFjZShcXFwiX2ZpbGVTZWxlY3RfXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoQ2FjaGUgPSBDb25maWcuY29udGVudHNDYWNoZSArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXRoID0gaW5wdXQucmVwbGFjZShcXFwiZmlsZTovL1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWvvOWFpeaPkOekulxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXCLlt7LlrZjlnKhbXFxcIiArIG5vdmVsTmFtZSArIFxcXCJd5piv5ZCm6KaG55uWP1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9IHJlcXVpcmUocmVxdWlyZVVybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc29uXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IFBBVEgubWF0Y2goL1xcXFwvKFteXFxcXC9dKj8pKFxcXFwudHh0fFxcXFwuZXB1YikkL2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aENhY2hlID0gQ29uZmlnLmNvbnRlbnRzQ2FjaGUgKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBQQVRIO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5bey5a2Y5ZyoW1xcXCIgKyBub3ZlbE5hbWUgKyBcXFwiXeaYr+WQpuimhueblj9cXFwiKS5jb25maXJtKChwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLnR4dHwuZXB1YlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFwic2VsZWN0UGF0aENhY2hlMVxcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgbGV0IG9wdGlvbnMgPSBbXFxcIumYheivu1xcXCIsIFxcXCLliIbkuqtcXFwiLCBcXFwi5Yig6ZmkXFxcIiwgXFxcIuaJk+W8gOaWueW8j1xcXCJdO1xcblxcbiAgICBsZXQgcGF0dGVybiA9IGdldE15VmFyKFxcXCI6dHh0UGF0dGVyblxcXCIsIG9wdGlvbnNbMF0pO1xcbiAgICBsZXQgaWQgPSBEYXRlLm5vdygpICsgXFxcIjrmqKHlvI9cXFwiO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgIC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XCJzaGFyZTovL1xcXCIgKyBwYXRoO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlIFxcXCLliKDpmaRcXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu6K6k5Yig6ZmkW1xcXCIgKyBuYW1lICsgXFxcIl1cXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiLmpzb25cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHBhdGggKyBcXFwiLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGF0aClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlIFxcXCLpmIXor7tcXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gKHR5cGU9PT1c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gICAgaXNDYWNoZTogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5vdmVsLm5hbWUsXFxuICAgICAgICAgICAgICAgIGlkOiBub3ZlbC5wYXRoLFxcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcInNoYXJlOi8vXFxcIiArIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6ZiF6K+7XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeSgodHlwZT09PVxcXCIudHh0XFxcIj9cXFwiaGlrZXI6Ly9wYWdlL3R4dFBhcnNlci52aWV3XFxcIjpcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcIikrXFxcIj9ydWxlPVxcXCIgKyBNWV9SVUxFLnRpdGxlKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaJk+W8gOaWueW8j1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXCIgKyBub3ZlbC5wYXRoKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxvbmdQcmVzcy5qc1xcXCIpLmRlbGV0ZUZpbGVGb3JUeHQocGF0aClcXG4gICAgICAgICAgICAgICAgICAgIH0sIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgaWYgKGZpbGVzLmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6K6+572uXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvU2V0dGluZy52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmVyc2lvbjogTVlfUlVMRS52ZXJzaW9uXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzluK7liqnigJ3igJ1cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9oZWxwLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSM/a2V5d29yZD10eHRcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8aDEgc3R5bGU9XFxcInRleHQtYWxpZ246IGNlbnRlcjtcXFwiPuWVpemDveayoeacieiAtjwvaDE+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIHNldFJlc3VsdChsYXlvdXQpO1xcbn1cXG5pZiAoJC5pbXBvcnRQYXJh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4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTpcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pSjph43mlrDop6PmnpApPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBzaG93TG9hZGluZyhcXFwi5q2j5Zyo6Kej5p6Q55uu5b2VXFxcIik7XFxuICAgICAgICBsZXQgdHh0ID0gcmVxdWVzdChwYXRoLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAvL1xcXCJjb250ZW50LXR5cGVcXFwiOiBcXFwidGV4dC9wbGFpbjsgY2hhcnN0PVxcXCIgKyBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBwYXR0ZXJuID0gcmVncy5nZXRUb2NSdWxlKHR4dCk7XFxuICAgICAgICBpZiAoIXBhdHRlcm4pIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgbWF0Y2hlciA9IHBhdHRlcm4ubWF0Y2hlcih0eHQpO1xcbiAgICAgICAgbGV0IHBvaW50ZXIgPSAwO1xcbiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7XFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gbWF0Y2hlci5zdGFydCgpO1xcbiAgICAgICAgICAgIGxldCBlbmQgPSBtYXRjaGVyLmVuZCgpO1xcbiAgICAgICAgICAgIGxldCB0ID0gbWF0Y2hlci5ncm91cCgpO1xcbiAgICAgICAgICAgIGlmIChwb2ludGVyID09PSAwICYmIHN0YXJ0ID4gMzApIHtcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZSA9IHRydWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNoYXB0ZXJOYW1lcy5wdXNoKHQpO1xcbiAgICAgICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCBzdGFydF0pO1xcbiAgICAgICAgICAgIHBvaW50ZXIgPSBlbmQ7XFxuICAgICAgICB9XFxuICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgdHh0Lmxlbmd0aF0pO1xcbiAgICAgICAgaWYgKGlzQ2FjaGUpIHtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoY2FjaGVQYXRoLCBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lczogY2hhcHRlck5hbWVzLFxcbiAgICAgICAgICAgICAgICBpbnRlcnZhbHM6IGludGVydmFscyxcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZTogaGFzUHJlZmFjZVxcbiAgICAgICAgICAgIH0pKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgIH1cXG5cXG5cXG4gICAgaWYgKGhhc1ByZWZhY2UpIHtcXG4gICAgICAgIGxldCBpbnRlcnZhbCA9IGludGVydmFsc1swXTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuW6j+iogFxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9UWFRWaWV3ZXIudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWU6IFxcXCLluo/oqIBcXFwiLFxcbiAgICAgICAgICAgICAgICBzdGFydDogaW50ZXJ2YWxbMF0sXFxuICAgICAgICAgICAgICAgIGVuZDogaW50ZXJ2YWxbMV0sXFxuICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgIGNoYXJzdDogY2hhcnN0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFwdGVyTmFtZXMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGxldCBuYW1lID0gY2hhcHRlck5hbWVzW2ldO1xcbiAgICAgICAgbGV0IGludGVydmFsID0gaW50ZXJ2YWxzW2kgKyAxXTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1RYVFZpZXdlci52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBzdGFydDogaW50ZXJ2YWxbMF0sXFxuICAgICAgICAgICAgICAgIGVuZDogaW50ZXJ2YWxbMV0sXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lOiBuYW1lLFxcbiAgICAgICAgICAgICAgIC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+eUu+WbvueJh+ino+aekOmUmeivr++8muWbvueJh+mTvuaOpei/lOWbnuS4uuepuj5cXFwiKTtcXG4gICAgfVxcbiAgICBpZiAoaW5mby5ib29rVG9wUGljKSB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBib29rVG9wUGljID0gVG9vbC5oaWtlclBpYyhpbmZvLmJvb2tUb3BQaWMpO1xcbiAgICAgICAgICAgIFRvb2wucGljRG93bmxvYWQoYm9va1RvcFBpY1swXSwgbWFpblBhdGggKyBpbmZvLmJvb2tOYW1lICsgXFxcIi5qcGdcXFwiLCBib29rVG9wUGljWzFdLCBpbmZvLmRlY29kZSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKFxcXCI85bCB6Z2i5LiL6L296ZSZ6K+vPiBcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbiAgICBsZXQgZXJyb3JOdW0gPSAwO1xcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IEw7IGkrKykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgcGljID0gVG9vbC5oaWtlclBpYyhwaWNMaXN0W2ldKTtcXG4gICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKHBpY1swXSwgY2hhcHRlclBhdGggKyAoaSArIDEpICsgXFxcIi5qcGdcXFwiLCBwaWNbMV0sIGluZm8uZGVjb2RlKTtcXG4gICAgICAgICAgICBpZiAoaW50ZXJydXB0ICYmIGdldE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiXFxcIikgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGVycm9yTnVtID0gMDtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBpZiAoZXJyb3JOdW0gPCAxMCkge1xcbiAgIC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AgICAgICAgICBcXFwic2VhcmNoX3VybFxcXCI6IFxcXCJoaWtlcjovL2VtcHR5P2lzQWxsPTEmc2VhcmNoVGVybXM9KiomdHlwZT1cXFwiICsgdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoRmluZFxcXCI6IFxcXCJqczokLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9TZWFyY2gudmlldz9ydWxlPScrTVlfUlVMRS5fdGl0bGUpO1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1dO1xcbiAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGFycjEpO1xcbiAgICAgICAgICAgIH0sIHJ1bGVOYW1lLCB0eXBlKSxcXG4gICAgICAgICAgICAvKmRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3NlYXJjaEtleScsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdzZWFyY2hLZXknLGlucHV0KVxcXCIqL1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLwn6epXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgdXJsOiAkKGNvbFR5cGVzLm1hcCh2PT52PT09Y29sX3R5cGU/XFxcIuKAnOKAnFxcXCIrditcXFwi4oCd4oCdXFxcIjp2KSkuc2VsZWN0KChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgaWYoL+KAnOKAnC4qP+KAneKAnS8udGVzdChpbnB1dCkpIHJldHVybjtcXG4gICAgICAgICAgICBzZXRJdGVtKFxcXCJib29rcmFjazpjb2xfdHlwZVxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGZvciAobGV0IG5hbWUgb2YgcmFua01ldGhvZHMpIHtcXG4gICAgICAgIGxldCBhID0gcmFua01ldGhvZCA9PT0gbmFtZTtcXG4gICAgICAgIGxldCB0aXRsZWEgPSBhID8gXFxcIuKAmOKAmFxcXCIgKyBuYW1lICsgXFxcIuKAmeKAmVxcXCIgOiBuYW1lO1xcbiAgICAgICAgbGV0IHRpdGxlYiA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKGEpIHtcXG4gICAgICAgICAgICB0aXRsZWIgPSAhcmFua0lzUmV2ZXJzZSA/IFxcXCLihpNcXFwiIDogXFxcIuKGkVxcXCI7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRpdGxlYiA9IFxcXCLihpVcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZWEgKyB0aXRsZWIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCByYW5rTWV0aG9kID0gZ2V0SXRlbShcXFwiYm9va3JhY2s6cmFua01ldGhvZFxcXCIsIFxcXCLns7vnu59cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IHJhbmtJc1JldmVyc2UgPSBnZXRJdGVtKFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcIiwgXFxcIlxcXCIpO1xcblxcbiAgICAgICAgICAgICAgICBpZiAocmFua01ldGhvZCA9PT0gbmFtZSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJhbmtJc1JldmVyc2UpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5rSXNSZXZlcnNlID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtJc1JldmVyc2UgPSBcXFwiMVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcIiwgcmFua0lzUmV2ZXJzZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6cmFua01ldGhvZFxcXCIsIG5hbWUpO1xcblxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LCBuYW1lKVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgbGV0IHJhbmtNZXRob2RNYXAgPSB7XFxuICAgICAgICBcXFwi57O757ufXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICBcXFwi5aSn5bCPXFxcIjogXFxcInNpemVcXFwiLFxcbiAgICAgICAgXFxcIuWQjeensFxcXCI6IFxcXCJuYW1lXFxcIixcXG4gICAgICAgIFxcXCLml7bpl7RcXFwiOiBcXFwidGltZVxcXCJcXG4gICAgfTtcXG4gICAgbGV0IGJvb2tMaXN0ID0gW107XFxuICAgIGxldCBsaXN0ID0gcmFuayhGaWxlLmdldEZpbGVzKHBhdGgsIFxcXCJkaXJcXFwiKSwgcmFua01ldGhvZE1hcFtyYW5rTWV0aG9kXSk7XFxuICAgIGlmIChsaXN0Lmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgYm9va0xpc3QucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuWVpemDveayoeacieiAtlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgfVxcbiAgICBsZXQgcGFnZVVybCA9IHR5cGUgPT09IFxcXCJub3ZlbFxcXCIgPyBcXFwiaGlrZXI6Ly9wYWdlL05vdmVsQnJvd3Nlci52aWV3XFxcIiA6IFxcXCJoaWtlcjovL3BhZ2UvQ29taWNCcm93c2VyLnZpZXdcXFwiO1xcbiAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgIGxldCBwaWMgPSBmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgaXRlbS5nZXRQYXRoKCkgKyBcXFwiL1xcXCIgKyBpdGVtLmdldE5hbWUoKSArIFxcXCIuanBnXFxcIikgPyBpdGVtLmdldFBhdGgoKSArIFxcXCIvXFxcIiArIGl0ZW0uZ2V0TmFtZSgpICsgXFxcIi5qcGdcXFwiIDogQ29uZmlnLmRlZl9QaWM7XFxuICAgICAgICBib29rTGlzdC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5nZXROYW1lKCksXFxuICAgICAgICAgICAgcGljX3VybDogcGljLFxcbiAgICAgICAgICAgIHVybDogcGFnZVVybCArIFxcXCI/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTpjb2xfdHlwZSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxvbmdQcmVzcy5qc1xcXCIpLmRlbGV0ZUZpbGVGb3JCb29rKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaXRlbS5nZXRQYXRoKCkpXFxuICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICBpZDogaXRlbS5nZXRQYXRoKCksXFxuICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0uZ2V0UGF0aCgpLFxcbiAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLmdldE5hbWUoKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGlmIChyYW5rSXNSZXZlcnNlKSB7XFxuICAgICAgICBib29rTGlzdC5yZXZlcnNlKCk7XFxuICAgIH1cXG5cXG4gICAgc2V0UmVzdWx0KGxheW91dC5jb25jYXQoYm9va0xpc3QpKTtcXG59KSgpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiI2Yu5paH5Lu25o6S5bqPXCIsXCJwYXRoXCI6XCJmaWxlUmFuay5qc1wiLFwicnVsZVwiOlwianM6XFxuY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiRmlsZS5qc1xcXCIpO1xcbmxldCBjaG5OdW1DaGFyID0ge1xcbiAgICDpm7Y6IDAsXFxuICAgIOS4gDogMSxcXG4gICAg5LqMOiAyLFxcbiAgICDkuIk6IDMsXFxuICAgIOWbmzogNCxcXG4gICAg5LqUOiA1LFxcbiAgICDlha06IDYsXFxuICAgIOS4gzogNyxcXG4gICAg5YWrOiA4LFxcbiAgICDkuZ06IDlcXG59O1xcblxcbmxldCBjaG5OYW1lVmFsdWUgPSB7XFxuICAgIOWNgToge1xcbiAgIC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guQmlnSW50ZWdlcihzcGxpdDJbaV0pKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmIChjbXAgPT09IDApIHtcXG4gICAgICAgICAgICBsZXQgcmVnZXggPSAvW2EtekEtWjAtOV0vXFxuICAgICAgICAgICAgbGV0IHMxID0gU3RyaW5nKHNwbGl0MVtpXSlcXG4gICAgICAgICAgICBsZXQgczIgPSBTdHJpbmcoc3BsaXQyW2ldKVxcbiAgICAgICAgICAgIGlmIChyZWdleC50ZXN0KHMxKSB8fCByZWdleC50ZXN0KHMyKSkge1xcbiAgICAgICAgICAgICAgICBjbXAgPSBuZXcgamF2YS5sYW5nLlN0cmluZyhzcGxpdDFbaV0pLmNvbXBhcmVUbyhuZXcgamF2YS5sYW5nLlN0cmluZyhzcGxpdDJbaV0pKTtcXG4gICAgICAgICAgICAgICAgLy8gY21wID0gczEubG9jYWxlQ29tcGFyZShzMiwgJ2VuJylcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjbXAgPSBzMS5sb2NhbGVDb21wYXJlKHMyLCAnemgnKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmIChjbXAgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gY21wO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxldCBsZW5ndGhDbXAgPSBzcGxpdDEubGVuZ3RoIC0gc3BsaXQyLmxlbmd0aDtcXG4gICAgLy8gaWYgKGxlbmd0aENtcCAhPT0gMCkgbGVuZ3RoQ21wID0gbGVuZ3RoQ21wID4gMCA/IC0xIDogMTtcXG4gICAgcmV0dXJuIGxlbmd0aENtcDtcXG59XFxuXFxuZnVuY3Rpb24gcmFuayhsaXN0LCBtKSB7XFxuICAgIHN3aXRjaCAobSkge1xcbiAgICAgICAgY2FzZSBcXFwidHlwZVxcXCI6XFxuICAgICAgICAgICAgcmV0dXJuIGxpc3Q7XFxuICAgICAgICBjYXNlIFxcX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IiBcXFxcXFxcIiArIFN0cmluZygocmF0aW8gKiAxMDApKS5zbGljZSgwLCA1KSArIFxcXFxcXFwiJVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXFxcXFwifHzkuIvovb3ov5vluqZcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeW3suWujOaIkOS4i+i9ve+8mlxcXFxcXFwiICsgaWQpO1xcXFxuICAgICAgICB9IGVsc2UgaWYgKENJRCA9PT0gLTEpIHtcXFxcbiAgICAgICAgICAgIGZhaWxOYW1lLnB1c2goaWQpO1xcXFxuICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeW3suWBnOatou+8mlxcXFxcXFwiICsgaWQpO1xcXFxuICAgICAgICAgICAgY291bnQgPSB0YXNrQ291bnQ7XFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgICAgICBpZiAodGFza0NvdW50ICE9PSBjb3VudCkgcmV0dXJuO1xcXFxuICAgICAgICBpZiAoc3VjY2Vzc0NJRC5sZW5ndGggPT09IHRhc2tDb3VudCkge1xcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLigJzigJzigJ3igJ1cXFxcXFxcIiArIFxcXFxcXFwi4paHXFxcXFxcXCIucmVwZWF0KDEwKS5mb250Y29sb3IoXFxcXFxcXCIjMDBmZjAwXFxcXFxcXCIpICsgXFxcXFxcXCIgMTAwJVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXFxcXFwifHzkuIvovb3ov5vluqZcXFxcXFxcIlxcXFxu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FxcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXFxcXFwiI2xvZyNcXFxcXFxcIiArIGxvZ0NvdW50XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsb2dDb3VudCsrO1xcXFxuICAgIH1cXFxcblxcXFxuICAgIGZ1bmN0aW9uIHRhc2sodGFza1BhcmFtKSB7XFxcXG4gICAgICAgIGNvbnN0IFRvb2wgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvVG9vbC5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGxldCBwaWMgPSBUb29sLmhpa2VyUGljKHRhc2tQYXJhbS51cmwpO1xcXFxuICAgICAgICAgICAgICAgIFRvb2wucGljRG93bmxvYWQocGljWzBdLCB0YXNrUGFyYW0uY2hhcHRlclBhdGggKyAodGFza1BhcmFtLmkgKyAxKSArIFxcXFxcXFwiLmpwZ1xcXFxcXFwiLCBwaWNbMV0sIHRhc2tQYXJhbS5kZWNvZGUpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcih0YXNrUGFyYW0uTVlfSUQgKyBcXFxcXFxcIjpzdGF0dXNcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIikgPT09IFxcXFxcXFwiMVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0gPSAwO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpID09PSA5KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiB0YXNrUGFyYW0uQ0lEO1xcXFxuICAgIH1cXFxcbiAgICBsZXQgY291bnQgPSAwO1xcXFxuICAgIGxldCB0b3RhbENvdW50ID0gMDtcXFxcbiAgICBsZXQgc3VjY2Vzc0NJRCA9IFtdO1xcXFxuXFxcXG4gICAgZnVuY3Rpb24gbGlzdGVuZXIocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxcXG4gICAgICAgIHRyeXtcXFxcbiAgICAgICAgdG90YWxDb3VudCsrO1xcXFxuICAgICAgICBcXFxcbiAgICAgICAgaWYgKGVycm9yICE9IG51bGwpIHtcXFxcbiAgICAgICAgICAgIHB1dExvZyhcXFxcXFxcIltsaXN0ZW5lcl3kuIvovb3lpLHotKXvvJpcXFxcXFxcIiArIGlkICsgXFxcXFxcXCI8RVJST1JAIFxcXFxcXFwiICsgZXJyb3IgKyBcXFxcXFxcIj5cXFxcXFxcIik7XFxcXG4gICAgICAgIH0gZWxzZSBpZiAocmVzdWx0ID09PSAtMSkge1xcXFxuICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeW3suWBnOatou+8mlxcXFxcXFwiICsgaWQpO1xcXFxuICAgICAgICAgICAgdG90YWxDb3VudCA9IHBhcmFtLnBpdkNvdW50O1xcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgY291bnQrKztcXFxcbiAgICAgICAgICAgIGxldCByYXRpbyA9ICgoY291bnQgLyBwYXJhbS5waXZDb3VudCkpLnRvRml4ZWQoNCk7XFxcXG4gICAgICAgICAgICBsZXQgc3RyaXBDb3VudCA9IE1hdGguY2VpbChyYXRpbyAqIDEwKTtcXFxcbiAgICAgICAgICAgIGlmIChwYXJhbS5waXZDb3VudD09PXRv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cXFxuICAgICAgICB9XFxcXG4gICAgICAgIGlmIChwaWNMaXN0Lmxlbmd0aCA9PT0gMCkge1xcXFxuICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiPOa8q+eUu+WbvueJh+ino+aekOmUmeivr++8muWbvueJh+mTvuaOpei/lOWbnuS4uuepuj5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB2YXIgdGFza1RlYW0gPSBwaWNMaXN0Lm1hcCgodXJsLCBpKSA9PiAoe1xcXFxuICAgICAgICAgICAgZnVuYzogdGFzayxcXFxcbiAgICAgICAgICAgIGlkOiBpLFxcXFxuICAgICAgICAgICAgcGFyYW06IHtcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBpOiBpLFxcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aCxcXFxcbiAgICAgICAgICAgICAgICBNWV9JRDogTVlfSUQsXFxcXG4gICAgICAgICAgICAgICAgZGVjb2RlOiBpbmZvLmRlY29kZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KSk7XFxcXG4gICAgICAgIGJlKHRhc2tUZWFtLCB7XFxcXG4gICAgICAgICAgICBmdW5jOiBsaXN0ZW5lcixcXFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxcXG4gICAgICAgICAgICAgICAgcGl2Q291bnQ6IHBpY0xpc3QubGVuZ3RoLFxcXFxuICAgICAgICAgICAgICAgIHRvdGFsOiBjaGFwdGVyVGVhbS5sZW5ndGgsXFxcXG4gICAgICAgICAgICAgICAgb3JkZXI6IG9yZGVyLFxcXFxuICAgICAgICAgICAgICAgIENJRDogaXRlbS5DSUQsXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6aXRlbS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICBjaGFwdGVyUGF0aDpjaGFwdGVyUGF0aFxcX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V0dXJuIEFycmF5KGVuZCAtIHN0YXJ0KS5maWxsKDApLm1hcCgoZWwsIGkpID0+IHN0YXJ0ICsgaSk7XFxcXG4gICAgfSxcXFxcbiAgICBwaWNEb3dubG9hZCh1cmwsIHBhdGgsIGhlYWRlcnMsIGRlY2lwaGUpIHtcXFxcbiAgICAgICAgaWYgKHR5cGVvZiBkZWNpcGhlID09PSBcXFxcXFxcInN0cmluZ1xcXFxcXFwiICYmIGRlY2lwaGUubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgbGV0IGluc3RyZWFtO1xcXFxuICAgICAgICAgICAgbGV0IG91dHN0cmVhbTtcXFxcbiAgICAgICAgICAgIGxldCBmaWxlO1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBmaWxlID0gbmV3IGphdmEuaW8uRmlsZShwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZmlsZS5leGlzdHMoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGxldCBkaXIgPSBmaWxlLmdldFBhcmVudEZpbGUoKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZGlyICE9IG51bGwgJiYgIWRpci5leGlzdHMoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBkaXIubWtkaXJzKCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGluc3RyZWFtID0gZmV0Y2godXJsLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICBvdXRzdHJlYW0gPSBuZXcgamF2YS5pby5GaWxlT3V0cHV0U3RyZWFtKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgIGxldCB0ID0gJC5oaWtlci5pbnB1dCxcXFxcbiAgICAgICAgICAgICAgICAgICAgYyA9ICQuaGlrZXIudXJsO1xcXFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSBpbnN0cmVhbTtcXFxcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IHVybDtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcGljaW4gPSAobmV3IEZ1bmN0aW9uKFxcXFxcXFwicmV0dXJuIFxcXFxcXFwiICsgZGVjaXBoZSkpKCk7XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IHQ7XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSBjO1xcXFxuICAgICAgICAgICAgICAgIGxldCBidWYgPSBqYXZhLmxhbmcucmVmbGVjdC5BcnJheS5uZXdJbnN0YW5jZShqYXZhLmxhbmcuQnl0ZS5UWVBFLCAxMDI0KTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbGVuO1xcXFxuICAgICAgICAgICAgICAgIHdoaWxlICgobGVuID0gcGljaW4ucmVhZChidWYpKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBvdXRzdHJlYW0ud3JpdGUoYnVmLCAwLCBsZW4pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlIGluc3RhbmNlb2YgamF2YS5pby5GaWxlICYmIGZpbGUuZXhpc3RzKCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICA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52aWV3XFxcXFxcXCIpO1xcXFxuICAgICAgICByZXR1cm4gdHh0VmlldyhsYXlvdXQpO1xcXFxuICAgIH1cXFxcbiAgICBsZXQgdGFnID0gRmlsZS5nZXRGaWxlUGF0aChDb25maWdbdHlwZSArIFxcXFxcXFwiUGF0aFxcXFxcXFwiXSwgXFxcXFxcXCJkaXJcXFxcXFxcIik7XFxcXG4gICAgaWYgKHRhZy5sZW5ndGggPT09IDApIHtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiLFxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6K6+572uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL1NldHRpbmcudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8yXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIHZlcnNpb246IE1ZX1JVTEUudmVyc2lvblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzluK7liqnigJ3igJ1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvaGVscC52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjP2tleXdvcmQ9bm92ZWxDb21pY1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6I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ICAgICAgICByZXR1cm4gJChcXFxcXFxcIuivpeaTjeS9nOS4jeS8muWIoOmZpOWwj+eoi+W6j++8jOS9huivpeWwj+eoi+W6j+S4i+i9veeahOaJgOaciSDmvKvnlLsv5bCP6K+0IOWwhuiiq+WIoOmZpFxcXFxcXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcXFxcXCIudGdudW1cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdC5wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL3BhZ2UvQm9va3JhY2sudmlldz9ydWxlPeacrOWcsOi1hOa6kOeuoeeQhiZydWxlTmFtZT1cXFxcXFxcIitpdC5uYW1lK1xcXFxcXFwiJnR5c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bSh0aWQgKyBcXFxcXFxcIiPorr7nva5f5pu05pawXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5bey57uP5piv5pyA5paw54mI5pys5LqGXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3sue7j+aYr+acgOaWsOeJiOacrOS6hlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHRpZCArIFxcXFxcXFwiI+iuvue9rl/mm7TmlrBcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmnInmlrDniYjmnKzov5jmnKrmm7TmlrBcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5pyJ5paw54mI5pys6L+Y5pyq5pu05pawXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInJ1bGU6Ly81clczNlppVTZLZUc1NVdNNzcrbGFHOXRaVjl5ZFd4bFgzVnliTysvcFdoMGRIQTZMeTlvYVd0bGNpNXViMnRwWVM1d2NtVnpjeTlvYVd0bGNuVnNaUzl5ZFd4bGJHbHpkQzVxYzI5dVAybGtQVE0xTlRrPVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHRpZCArIFxcXFxcXFwiI+iuvue9rl/mm7TmlrBcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuS/oeaBr+iOt+WPluWksei0pVxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICA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AgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIDApIHx8IFxcXFxcXFwie31cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IHVybDtcXFxcbiAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxcXG4gICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBzdGFydCA9IDE7XFxcXG4gICAgICAgIGlmICh0eXBlb2YoTVlfTkFNRSkgIT09IFxcXFxcXFwidW5kZWZpbmVkXFxcXFxcXCIgJiYgTVlfTkFNRSA9PT0gXFxcXFxcXCLll4Xop4nmtY/op4jlmahcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgc3RhcnQgPSA0O1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGZvciAobGV0IGkgPSBzdGFydDsgaSA8PSA0OyBpKyspIHtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLlm77niYdcXFxcXFxcIiArIGksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibW92aWVfM1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiaGlrZXI6Ly9pbWFnZXMvaG9tZV9waWNcXFxcXFxcIiArIGksXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoc2V0RGVmYXVsdFBpYywgXFxcXFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX3BpY1xcXFxcXFwiICsgaSlcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuiHquWumuS5ieKelVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8zXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXFxcXFwi6Ieq5a6a5LmJdXJsXFxcXFxcXCIsIFxcXFxcXFwi6YCJ5oup5paH5Lu26Lev5b6EXFxcXFxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcXFxcXCLoh6rlrprkuYl1cmxcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIui+k+WFpeWbvueJh+eahOi3r+W+hOaIluiAhemTvuaOpVxcXFxcXFwiKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIDApIHx8IFxcXFxcXFwie31cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IGlucHV0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcXFxcXCJjb25maWcuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcXFxcXCJjb25maWcuanNvblxcXFxcXFwiLCAwKSB8fCBcXFxcXFxcInt9XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyBQQVRIO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCI6ZGVmYXVsdFBpY0JhY2tcXFxcXFxcIiwgXFxcXFxcXCJ0cnVlXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+S/ruaUueaI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FxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gbmV3UnVsZUxpc3QpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5ld1J1bGUgPSBuZXdSdWxlTGlzdFtpXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFuZXdSdWxlLmhhc093blByb3BlcnR5KFxcXFxcXFwicmVwbGFjZW1lbnRcXFxcXFxcIikgfHwgIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcXFxcXCJwYXR0ZXJuXFxcXFxcXCIpIHx8ICFuZXdSdWxlLmhhc093blByb3BlcnR5KFxcXFxcXFwibmFtZVxcXFxcXFwiKSB8fCAobmV3UnVsZS5zY29wZUNvbnRlbnQgPT09IHVuZGVmaW5lZCA/IGZhbHNlIDogIW5ld1J1bGUuc2NvcGVDb250ZW50KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gbmV3UnVsZS5pZDtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmV3UnVsZS5pZCA9IGlkIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWRJbmRleCA9IHJ1bGVMaXN0LmZpbmRJbmRleChydWxlID0+IHJ1bGUuaWQgPT09IGlkKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlkSW5kZXggPiAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQrKztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnNwbGljZShpZEluZGV4LCAxLCBuZXdSdWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NvdW50Kys7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5wdXNoKG5ld1J1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwicmVwbGFjZVJ1bGUuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChpc2JhY2spIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGxvZyhcXFxcXFxcIlxcXFxcXFxcbui3r+W+hO+8mlxcXFxcXFwiICsgaW5wdXQgKyBcXFxcXFxcIlxcXFxcXFxcbuaAu+inhOWImeaVsO+8mlxcXFxcXFwiICsgbmV3UnVsZUxpc3QubGVuZ3RoICsgXFxcXFxcXCJcXFxcXFxcXG7mm7TmlrDop4TliJkgXFxcXFxcXCIgKyB1cGRhdGVDb3VudCArIFxcXFxcXFwiIOadoVxcXFxcXFxcdOaWsOWinuinhOWImSBcXFxcXFxcIiArIG5ld0NvdW50ICsgXFxcXFxcXCIg5p2hXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5a+85YWl5oiQ5YqfXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChpc2JhY2spIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuWvvOWFpeWksei0pVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLlr7zlhaXop4TliJlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChbXFxcXFxcXCLlpJbpg6jmlofku7ZcXFxcXFxcIiwgXFxcXFxcXCLlhoXpg6jmlofku7ZcXFxcXFxcIl0sIDEsIFxcXFxcXFwi6KeE5YiZ5a+85YWlXFxcXFxcXCIpLnNlbGVjdCgoaW1wb3J0UnVsZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcXFxcXCLlpJbpg6jmlofku7ZcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJmaWxlU2VsZWN0Oi8vXFxcXFxcXCIgKyAkLnRvU3RyaW5nKGltcG9ydFJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZyhpbXBvcnRSdWxlLCB0cnVlKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIuanNvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXFxcXFwiY29uZmlybVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFxcXFxcInNlbGVjdFBhdGhDYWNoZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIGltcG9ydFJ1bGUpLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8zXFxcXFxcXCJcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGxlbiA9IHJ1bGVMaXN0Lmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XFxcXG4gICAgICAgICAgICBsZXQgcmVwbGFjZVJ1bGUgPSBydWxlTGlzdFtpXTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogcmVwbGFjZVJ1bGUubmFtZSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGksXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWIoOmZpFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChpZCwgaW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFxcXFxcInJlcGxhY2VSdWxlLmpzb25cXFxcXFxcIikgfHwgXFxcXFxcXCJbXVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGcgPSBydWxlTGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwicmVwbGFjZVJ1bGUuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2RlbGV0ZUl0ZW1CeUNscyhpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaW5kZXgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5Yig6Zmk5oiQ5YqfXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgaWQsIGkpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLnvJbovpFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2luZGV4PVxcXFxcXFwiICsgaSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcXFxcXCIuXFxcXFxcXCIgKyBpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBicmVhaztcXFxcbiAgICBjYXNlIFxcXFxcXFwiY29udGVudHNcXFxcXFxcIjpcXFxcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiKTtcXFxcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXFxcXFwi55uu5b2V6K6+572ufOiuvue9rlxcXFxcXFwiKTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6YCJ5oup5paH5Lu25aS5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IEpTT04uc3RyaW5naWZ5KGYuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShpZCkuZXh0cmE7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcXFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXFxcbiAgICAgICAgICAgICAgICBpbml0aWFsUGF0aDogQ29uZmlnLmhvbWVQYXRoLFxcXFxuICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHBhdHRlcm46IDFcXFxcbiAgICAgICAgICAgIH0pKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImlucHV0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuaUr+aMgWhpa2VyOi8vZmlsZXPot6/lvoQo6K+l5pON5L2c5LiN5Lya5Yid5aeL5YyW55uu5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9PiB7XFxcXG4gICAgICAgICAgICBpZiAoZmluZEl0ZW0oJGlkKS5leHRyYS5pc1RydWUpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3suW8gOWQr1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgY29uc3QgYm9va0luZm8gPSBPYmplY3QuYXNzaWduKHtcXFxcbiAgICAgICAgICAgICAgICBzZWxlY3RlZDogW11cXFxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHBhdGggKyBcXFxcXFxcIi9ib29rSW5mby5qc29uXFxcXFxcXCIpIHx8IFxcXFxcXFwie31cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgYm9va0luZm8uc2VsZWN0ZWQucHVzaChyZXBsYWNlUnVsZS5pZCk7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCRpZCwge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuKXj1xcXFxcXFwiICsgcmVwbGFjZVJ1bGUubmFtZSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpc1RydWU6IHRydWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAkaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgcGF0aCArIFxcXFxcXFwiL2Jvb2tJbmZvLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkoYm9va0luZm8pKTtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxc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91dC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6IFxcXFxcXFwi5a+85YWl5bCP6K+0XFxcXFxcXCIsXFxcXG4gICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfM1xcXFxcXFwiLFxcXFxuICAgICAgICB1cmw6ICQoW1xcXFxcXFwi57O757uf6YCJ5oup5ZmoXFxcXFxcXCIsIFxcXFxcXFwi5rW36ZiU6YCJ5oup5ZmoXFxcXFxcXCJdLCAxLCBcXFxcXFxcIumAieaLqeWZqOexu+Wei1xcXFxcXFwiKS5zZWxlY3QoKCkgPT4ge1xcXFxuICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFxcXFxcIuezu+e7n+mAieaLqeWZqFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZmlsZVNlbGVjdDovL1xcXFxcXFwiICsgJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICghLyhcXFxcXFxcXC50eHR8LmVwdWIpJC9pLnRlc3QoaW5wdXQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIumAieaLqeS6humUmeivr+eahOaWh+S7tuexu+Wei1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzb25cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlTWF0Y2ggPSBpbnB1dC5tYXRjaCgvXFxcXFxcXFwvKFteXFxcXFxcXFwvXSo/KShcXFxcXFxcXC50eHR8XFxcXFxcXFwuZXB1YikkL2kpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgbm92ZWxOYW1lID0gZm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AgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuWvvOWFpeaIkOWKn1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IFBBVEgubWF0Y2goL1xcXFxcXFxcLyhbXlxcXFxcXFxcL10qPykoXFxcXFxcXFwudHh0fFxcXFxcXFxcLmVwdWIpJC9pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBQQVRIO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuW3suWtmOWcqFtcXFxcXFxcIiArIG5vdmVsTmFtZSArIFxcXFxcXFwiXeaYr+WQpuimhueblj9cXFxcXFxcIikuY29uZmlybSgocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aENhY2hlKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXFxcXFwiLnR4dHwuZXB1YlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcXFxcXCJjb25maXJtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIG1lbW9yeTogXFxcXFxcXCJzZWxlY3RQYXRoQ2FjaGUxXFxcXFxcX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ucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHBhdGggKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyhwYXRoICsgXFxcXFxcXCIuanNvblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGF0aClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICBjYXNlIFxcXFxcXFwi6ZiF6K+7XFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICh0eXBlPT09XFxcXFxcXCIudHh0XFxcXFxcXCI/XFxcXFxcXCJoaWtlcjovL3BhZ2UvdHh0UGFyc2VyLnZpZXdcXFxcXFxcIjpcXFxcXFxcImhpa2VyOi8vcGFnZS9lcHViUGFyc2VyLnZpZXcjYXV0b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gICAgICAgICAgICAgIHBhdGg6IG5vdmVsLnBhdGgsXFxcXG4gICAgICAgICAgICAgICAgaXNDYWNoZTogdHJ1ZSxcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXFxcbiAgICAgICAgICAgICAgICBpZDogbm92ZWwucGF0aCxcXFxcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWIhuS6q1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcXFxcXCJzaGFyZTovL1xcXFxcXFwiICsgbm92ZWwucGF0aClcXFxcbiAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIumYheivu1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoKHR5cGU9PT1cXFxcXFxcIi50eHRcXFxcXFxcIj9cXFxcXFxcImhpa2VyOi8vcGFnZS90eHRQYXJzZXIudmlld1xcXFxcXFwiOlxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcXFxcXCIpK1xcXFxcXFwiP3J1bGU9XFxcXFxcXCIgKyBNWV9SVUxFLnRpdGxlKVxcXFxuICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5omT5byA5pa55byPXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFxcXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXFxcXFwiICsgbm92ZWwucGF0aClcXFxcbiAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWIoOmZpFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFxcXFxcImxvbmdQcmVzcy5qc1xcXFxcXFwiKS5kZWxldGVGaWxlRm9yVHh0KHBhdGgpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIG5vdmVsLnBhdGgpXFxcXG4gICAgICAgICAgICAgICAgfV1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIGlmIChmaWxlcy5sZW5ndGggPT09IDApIHtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6K6+572uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL1NldHRpbmcudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8yXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIHZlcnNpb246IE1ZX1JVTEUudmVyc2lvblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzluK7liqnigJ3igJ1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvaGVscC52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjP2tleXdvcmQ9dHh0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogX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hY2hlUGF0aCkpIHtcXFxcbiAgICAgICAgdHJ5IHtcXFxcblxcXFxuICAgICAgICAgICAgbGV0IGMgPSBKU09OLnBhcnNlKHJlcXVlc3QoY2FjaGVQYXRoKSk7XFxcXG4gICAgICAgICAgICBjaGFwdGVyTmFtZXMgPSBjLmNoYXB0ZXJOYW1lcztcXFxcbiAgICAgICAgICAgIGludGVydmFscyA9IGMuaW50ZXJ2YWxzO1xcXFxuICAgICAgICAgICAgaGFzUHJlZmFjZSA9IGMuaGFzUHJlZmFjZTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLph43mlrDop6PmnpDnm67lvZVcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcXFxcXCIuanNvblxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOlxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pSjph43mlrDop6PmnpApPC9zdHJvbmc+XFxcXFxcXCIuYmlnKCksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUocGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoK1xcXFxcXFwiLmpzb25cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfV0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICB9XFxcXG5cXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICBzaG93TG9hZGluZyhcXFxcXFxcIuato+WcqOino+aekOebruW9lVxcXFxcXFwiKTtcXFxcbiAgICAgICAgbGV0IHR4dCA9IHJlcXVlc3QocGF0aCwge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgIC8vXFxcXFxcXCJjb250ZW50LXR5cGVcXFxcXFxcIjogXFxcXFxcXCJ0ZXh0L3BsYWluOyBjaGFyc3Q9XFxcXFxcXCIgKyBjaGFyc3RcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGxldCBwYXR0ZXJuID0gcmVncy5nZXRUb2NSdWxlKHR4dCk7XFxcXG4gICAgICAgIGlmICghcGF0dGVybikge1xcXFxuICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXFxcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlPC9zdHJvbmc+XFxcXFxcXCIuYmlnKCksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XSk7XFxcXG4gICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IG1hdGNoZXIgPSBwYXR0ZXJuLm1hdGNoZXIodHh0KTtcXFxcbiAgICAgICAgbGV0IHBvaW50ZXIgPSAwO1xcXFxuICAgICAgICB3aGlsZSAobWF0Y2hlci5maW5kKCkpIHtcXFxcbiAgICAgICAgICAgIGxldCBzdGFydCA9IG1hdGNoZXIuc3RhcnQoKTtcXFxcbiAgICAgICAgICAgIGxldCBlbmQgPSBtYXRjaGVyLmVuZCgpO1xcXFxuICAgICAgICAgICAgbGV0IHQgPSBtYXRjaGVyLmdyb3VwKCk7XFxcXG4gICAgICAgICAgICBpZiAocG9pbnRlciA9PT0gMCAmJiBzdGFydCA+IDMwKSB7XFxcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZSA9IHRydWU7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBjaGFwdGVyTmFtZXMucHVzaCh0KTtcXFxcbiAgICAgICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCBzdGFydF0pO1xcXFxuICAgICAgICAgICAgcG9pbnRlciA9IGVuZDtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgdHh0Lmxlbmd0aF0pO1xcXFxuICAgICAgICBpZiAoaXNDYWNoZSkge1xcXFxuICAgICAgICAgICAgd3JpdGVGaWxlKGNhY2hlUGF0aCwgSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lczogY2hhcHRlck5hbWVzLFxcXFxuICAgICAgICAgICAgICAgIGludGVydmFsczogaW50ZXJ2YWxzLFxcXFxuICAgICAgICAgICAgICAgIGhhc1ByZWZhY2U6IGhhc1ByZWZhY2VcXFxcbiAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBoaWRlTG9hZGluZygpO1xcXFxuICAgIH1cXFxcblxcXFxuXFxcXG4gICAgaWYgKGhhc1ByZWZhY2UpIHtcXFxcbiAgICAgICAgbGV0IGludGVydmFsID0gaW50ZXJ2YWxzWzBdO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXC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dGgoKSArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5nZXROYW1lKCkgKyBcXFxcXFxcIi5qcGdcXFxcXFxcIiA6IENvbmZpZy5kZWZfUGljO1xcXFxuICAgICAgICBib29rTGlzdC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLmdldE5hbWUoKSxcXFxcbiAgICAgICAgICAgIHBpY191cmw6IHBpYyxcXFxcbiAgICAgICAgICAgIHVybDogcGFnZVVybCArIFxcXFxcXFwiP3J1bGU9XFxcXFxcXCIgKyBNWV9SVUxFLnRpdGxlLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6Y29sX3R5cGUsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yig6ZmkXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXFxcXFwibG9uZ1ByZXNzLmpzXFxcXFxcXCIpLmRlbGV0ZUZpbGVGb3JCb29rKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLmdldFBhdGgoKSlcXFxcbiAgICAgICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgICAgICBpZDogaXRlbS5nZXRQYXRoKCksXFxcXG4gICAgICAgICAgICAgICAgcGF0aDogaXRlbS5nZXRQYXRoKCksXFxcXG4gICAgICAgICAgICAgICAgbmFtZTogaXRlbS5nZXROYW1lKClcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIGlmIChyYW5rSXNSZXZlcnNlKSB7XFxcXG4gICAgICAgIGJvb2tMaXN0LnJldmVyc2UoKTtcXFxcbiAgIC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