xiaomianao666

邀您一起看:咒怨系列

Jun 10th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥咒怨系列@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuinhOWImeWIl+ihqFwiLFwicGF0aFwiOlwiZGF0YVwiLFwicnVsZVwiOlwidmFyIHdyYXB1ID0gKHUpID0+IHtcXG4gICAgaWYgKGNvbmZpZy5tb2RlID09IFxcXCLmnKzlnLDovaznoIFcXFwiKSB7XFxuICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZSdcXG4gICAgfVxcbiAgICBpZiAoL2FsaXl1bmRyaXZlLy50ZXN0KHUpKSB7XFxuICAgICAgICBjb25zdCBbbGluaywgX3NoYXJlX3B3ZF0gPSB1LnNwbGl0KCc/c2hhcmVfcHdkPScpO1xcbiAgICAgICAgY29uc3QgW19saW5rLCBfZm9sZGVySURdID0gbGluay5zcGxpdCgnL2ZvbGRlci8nKTtcXG4gICAgICAgIGxldCBzaGFyZV9wd2QgPSAoX3NoYXJlX3B3ZCB8fCAnJyku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ICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAoc2hhcmUuaW5jbHVkZXMoXFxcInNoYXJlX2xpbmsgaXNcXFwiKSB8fCBzaGFyZS5pbmNsdWRlcyhcXFwic2hhcmVfbGluayBjYW5ub3RcXFwiKSkgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7fVxcbiAgICByZXR1cm4gdHJ1ZTtcXG59XFxuXFxubGV0IHJ1bGVzID0gW3tcXG4gICAgICAgIG5hbWU6IFxcXCLkupHnm5jotYTmupBcXFwiLFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXG4gICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcImh0dHBzOi8vcmVzLnl1bnBhbi53aW4vP1BhZ2VJbmRleD1cXFwiICsgcGFnZSArIFxcXCImUGFnZVNpemU9MTImS2V5d29yZD1cXFwiICsgcyArIFxcXCImVHlwZT0mVGFnPVxcXCI7XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3Jlcy55dW5wYW4ud2luL1xcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIGxldCBhcnIgPSBwZGZhKGh0bWwsIFxcXCJtYWluJiYuY2FyZFxcXCIpO1xcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgXFxcIi5jYXJkLWxpbmssMSYmb25jbGlja1xcXCIpLm1hdGNoKC9odHRwczpcXFxcL1xcXFwvKHd3d1xcXFwuYWxpeXVuZHJpdmVcXFxcLmNvbVxcXFwvc3xhbHl3cFxcXFwubmV0KVxcXFwvXFxcXHcqL2cpIHx8IFtdO1xcbiAgICAgICAgICAgICAgICB1ID0gdS5sZW5ndGggPiAwID8gdVswXSA6IHVybDtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0LCBcXFwiLmNhcmQtdGl0bGUmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBkKGl0LCBcXFwiaW1nJiZzcmNcXFwiLCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KHUpLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuS6keebmOi1hOa6kDwvZm9udD4mbmJzcDtcXFwiICsgKHBkZmgoaXQsIFxcXCIuY2FyZC10ZXh0LC0xJiZUZXh0XFxcIikpICsgXFxcIlxcXFxuXFxcIiArICh1KSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwiVVDkupHmkJxcXFwiLFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXG4gICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcImh0dHBzOi8vYXBpLnVweXVuc28yLmNvbS9zZWFyY2g/a2V5d29yZD1cXFwiICsgcyArIFxcXCImcGFnZT1cXFwiICsgcGFnZSArIFxcXCImc190eXBlPTFcXFwiO1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCh1cmwsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly93d3cudXB5dW5zby5jb21cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IFxcXCJjb2RlPTE5MTlcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAvL2xvZyhiYXNlNjREZWNvZGUoaHRtbCkpO1xcbiAgICAgICAgICAgIGxldCBhcnIgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZShodG1sKSkucmVzdWx0Lml0ZW1zO1xcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gaXQucGFnZV91cmw7XFxuICAgICAgICAgICAgICAgIC8vdSA9IHUubGVuZ3RoID4gMCA/IHVbMF0gOiB1cmw7XFxuICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFwiYWxpeXVuZHJpdmVcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT5VUOS6keaQnDwvZm9udD4mbmJzcDtcXFwiICsgXFxcIlxcXFxuXFxcIiArICh1KSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi54yr54u455uY5pCcXFxcIixcXG4gICAgICAgIHBhZ2U6IGZhbHNlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChcXFwiaHR0cHM6Ly93d3cuYWxpcGFuc291LmNvbS9zZWFyY2g/az1cXFwiICsgcywge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3d3dy5hbGlwYW5zb3UuY29tL3NlYXJjaD9rPVxcXCIgKyBzXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGRmYShodG1sLCBcXFwiI2FwcCYmYVxcXCIpO1xcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBcXFwiPGRpdj5cXFwiICsgYXJyW2ldICsgXFxcIjwvZGl2PlxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgXFxcImEmJmhyZWZcXFwiKTtcXG4gICAgICAgICAgICAgICAgLy9sb2codSk7XFxuICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFwiL3MvXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly93d3cuYWxpcGFuc291LmNvbVxcXCIgKyB1LnJlcGxhY2UoXFxcIi9zL1xcXCIsIFxcXCIvY3YvXFxcIik7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdCwgXFxcInRlbXBsYXRlJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQodSkubGF6eVJ1bGUoKHdyYXB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBcXFwibm9fc2hvd19kb25hdGU9MVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IGlucHV0LnJlcGxhY2UoXFxcIi9jdi9cXFwiLCBcXFwiL3MvXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaHRtbCA9IHBhcnNlRG9tRm9ySHRtbChodG1sLCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIF9saW5rcyA9IGh0bWwubWF0Y2goL2h0dHBzOlxcXFwvXFxcXC8od3d3XFxcXC5hbGl5dW5kcml2ZVxcXFwuY29tXFxcXC9zfGFseXdwXFxcXC5uZXQpXFxcXC9cXFxcdyovZykgfHwgW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coX2xpbmtzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaHRtbC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgX2xpbmtzWzBdICsgJz8/ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KGh0bWwpICsgJz8/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShodG1sKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgd3JhcHUpLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPueMq+eLuOebmOaQnDwvZm9udD4mbmJzcDtcXFwiICsgcGRmaChpdCwgXFxcInRlbXBsYXRlLDEmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi5piT5pCcXFxcIixcXG4gICAgICAgIHBhZ2U6IHRydWUsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBrZXllbihzdHIpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXCI0T1RvU2NVRk9hZVZUckhFXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBpdiA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXCI5Q0xHYW8xdkhLcW0xN096XFxcIik7XFxuICAgICAgICAgICAgICAgIHZhciBlbmNyeXB0ZWQgPSBDcnlwdG9KUy5BRVMuZGVjcnlwdCh7XFxuICAgICAgICAgICAgICAgICAgICBjaXBoZXJ0ZXh0OiBDcnlwdG9KUy5lbmMuQmFzZTY0LnBhcnNlKHN0cilcXG4gICAgICAgICAgICAgICAgfSwga2V5LCB7XFxuICAgICAgICAgICAgICAgICAgICBpdjogaXYsXFxuICAgICAgICAgICAgICAgICAgICBtb2RlOiBDcnlwdG9KUy5tb2RlLkNCQyxcXG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5Qa2NzN1xcbiAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBlbmNyeXB0ZWQ7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChcXFwiaHR0cHM6Ly95aXNvLmZ1bi9hcGkvc2VhcmNoP25hbWU9XFxcIiArIHMgKyBcXFwiJnBhZ2VObz1cXFwiICsgcGFnZSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3lpc28uZnVuL2luZm8/c2VhcmNoS2V5PVxcXCIgKyBzLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGdldEl0ZW0oJ3lpc291Y29va2UnLCAnJylcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcbiAgICAgICAgICAgIGlmIChodG1sLmluY2x1ZGVzKCfnmbvlvZXnlKjmiLfml6DpmZDliLYnKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgaSA9IDA7XFxuICAgICAgICAgICAgICAgIGRvIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0eWltZ2xpbiA9ICdodHRwczovL3lpc28uZnVuL2FwaS91c2VyL2xvZ2luL2NhcHRjaGE/dD0nICsgcGFyc2VJbnQobmV3IERhdGUoKS5nZXRUaW1lKCkpICsgJyc7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaW1nID0gY29udmVydEJhc2U2NEltYWdlKHR5aW1nbGluKS5zcGxpdCgnLCcpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvZCA9IHJlcXVlc3QoJ2h0dHBzOi8vYXBpLm5uLmNpL29jci9iNjQvdGV4dCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAndGV4dC9wbGFpbidcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdmVyID0gSlNPTi5wYXJzZShyZXF1ZXN0KCdodHRwczovL3lpc28uZnVuL2FwaS91c2VyL2xvZ2luJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZmVyZXInOiAnaHR0cHM6Ly95aXNvLmZ1bi9sb2dpbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdDb29raWUnOiBnZXRDb29raWUodHlpbWdsaW4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VyTmFtZVxcXCI6IFxcXCJ0dmJveDIwMjNcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBcXFwiVHZib3gyMDIzXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNvZGVcXFwiOiBjb2RcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodmVyLmNvZGUgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfmmJPmkJznmbvlhaXpqozor4HmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCd5aXNvdWNvb2tlJywgZ2V0Q29va2llKCdodHRwczovL3lpc28uZnVuJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgPSByZXF1ZXN0KFxcXCJodHRwczovL3lpc28uZnVuL2FwaS9zZWFyY2g/bmFtZT1cXFwiICsgcyArIFxcXCImcGFnZU5vPVxcXCIgKyBwYWdlLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8veWlzby5mdW4vaW5mbz9zZWFyY2hLZXk9XFxcIiArIHMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogZ2V0SXRlbSgneWlzb3Vjb29rZScsICcnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpKys7XFxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKGkgPCA0KTtcXG5cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGFyciA9IEpTT04ucGFyc2UoaHRtbCkuZGF0YS5saXN0O1xcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1ID0ga2V5ZW4oaXQudXJsKTtcXG4gICAgICAgICAgICAgICAgLy9sb2codSk7XFxuICAgICAgICAgICAgICAgIGlmICh1ID09IG51bGwgfHwgIXUuaW5jbHVkZXMoXFxcImFsaXl1blxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgaXQubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7mmJPmkJw8L2ZvbnQ+Jm5ic3A7XFxcIiArIChpdC5nbXRTaGFyZSB8fCBpdC5nbXRDcmVhdGUpICsgXFxcIlxcXFxuXFxcIiArICh1KSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi5om+6LWE5rqQXFxcIixcXG4gICAgICAgIHBhZ2U6IHRydWUsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0aHRtbCgpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KFxcXCJodHRwczovL3poYW96aXl1YW4ubGEvc28/ZmlsZW5hbWU9XFxcIiArIHMgKyBcXFwiJnBhZ2U9XFxcIiArIHBhZ2UsIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3poYW96aXl1YW4ubGEvc3RvcC5odG1sXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwib3JpZ2luXFxcIjogXFxcImh0dHBzOi8vemhhb3ppeXVhbi5sYVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGdldEl0ZW0oXFxcInp6eWNvb2tlXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cGdyYWRlLWluc2VjdXJlLXJlcXVlc3RzXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb250ZW50LXR5cGVcXFwiOiBcXFwiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGh0bWw7XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB2YXIgaHRtbCA9IGdldGh0bWwoKTtcXG4gICAgICAgICAgICBpZiAoIWh0bWwuaW5jbHVkZXMoXFxcInNlYXJjaF9ib3hcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgdXNlciA9ICdkWE5sY201aGJXVTllWEJxTWpBeU15WndZWE56ZDI5eVpEMTVjR295TURJeic7XFxuICAgICAgICAgICAgICAgIGxldCBjb29rID0gSlNPTi5wYXJzZShmZXRjaENvb2tpZSgnaHR0cHM6Ly96aGFveml5dWFuLmxhL2xvZ2l1Lmh0bWwnLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBNT0JJTEVfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmlnaW4nOiAnaHR0cHM6Ly96aGFveml5dWFuLmxhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3poYW96aXl1YW4ubGEvbG9naW4uaHRtbCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVwZ3JhZGUtaW5zZWN1cmUtcmVxdWVzdHNcXFwiOiBcXFwiMVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBiYXNlNjREZWNvZGUodXNlciksXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcXG4gICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgfSkpLmpvaW4oJzsnKTtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcXFwienp5Y29va2VcXFwiLCBjb29rKTtcXG4gICAgICAgICAgICAgICAgbG9nKFxcXCLmib7otYTmupDnmbvlhaVcXFwiKTtcXG4gICAgICAgICAgICAgICAgaHRtbCA9IGdldGh0bWwoKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJi5uZXdzTGlzdCYmbGk6bm90KDpmaXJzdC1jaGlsZClcXFwiKTtcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsIFxcXCJhJiZocmVmXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmICh1ID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly96aGFveml5dWFuLmxhL1xcXCIgKyB1O1xcbiAgICAgICAgICAgICAgICAvL2xvZyh1KTtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdCwgXFxcIi5uZXdzX3RleHQmJmgzJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5om+6LWE5rqQPC9mb250PiZuYnNwO1xcXCIgKyAocGRmaChpdCwgXFxcIi5uZXdzX3RleHQmJnAmJlRleHRcXFwiKSksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQodSkubGF6eVJ1bGUoKHdyYXB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2xpbmtzID0gaHRtbC5tYXRjaCgvaHR0cHM6XFxcXC9cXFxcLyh3d3dcXFxcLmFsaXl1bmRyaXZlXFxcXC5jb21cXFxcL3N8YWx5d3BcXFxcLm5ldClcXFxcL1xcXFx3Ki9nKSB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhfbGlua3MpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfbGlua3MubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIF9saW5rc1swXSArICc/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudChfbGlua3NbMF0pICsgJz8/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShfbGlua3NbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwdSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi5bCP57q45p2hXFxcIixcXG4gICAgICAgIHBhZ2U6IGZhbHNlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIGdldHRva2VuKCkge1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ3h6eXRva2VuJywgJycpLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9rZW4gPSBKU09OLnBhcnNlKHBvc3QoJ2h0dHBzOi8vZ2l0Y2FmZS5uZXQvdG9vbC9hbGlwYXBlci8nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3UuZ2l0Y2FmZS5uZXQvJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb246ICdnZXRfdG9rZW4nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneHp0dG9rZW4nLCB0b2tlbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIGdldE15VmFyKCd4enR0b2tlbicsICcnKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gY2F0X2NvZGUoYSkge1xcbiAgICAgICAgICAgICAgICB2YXIgZCwgZSwgYiA9IFtcXFwi5Y2O6K+t55S16KeGXFxcIiwgXFxcIuaXpemfqeeUteinhlxcXCIsIFxcXCLmrKfnvo7nlLXop4ZcXFwiLCBcXFwi5YW25LuW55S16KeGXFxcIiwgXFxcIuWNjuivreeUteW9sVxcXCIsIFxcXCLml6Xpn6nnlLXlvbFcXFwiLCBcXFwi5qyn576O55S15b2xXFxcIiwgXFxcIuWFtuS7lueUteW9sVxcXCIsIFxcXCLljY7or63liqjmvKtcXFwiLCBcXFwi5pel6Z+p5Yqo5ryrXFxcIiwgXFxcIuasp+e+juWKqOa8q1xcXCIsIFxcXCLnuqrlvZXniYdcXFwiLCBcXFwi57u86Im654mHXFxcIiwgXFxcIuaVmeiCsuWfueiurVxcXCIsIFxcXCLlhbbku5bop4bpopFcXFwiLCBcXFwi5Y2O6K+t6Z+z5LmQXFxcIiwgXFxcIuaXpemfqemfs+S5kFxcXCIsIFxcXCLmrKfnvo7pn7PkuZBcXFwiLCBcXFwi5Y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gICAgICAgICAgIGZvciAoZCA9IDAsIGUgPSBjLmxlbmd0aDsgZSA+IGQ7IGQrKylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjW2RdID09IGEpIHJldHVybiBiW2RdO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcG9zdChcXFwiaHR0cHM6Ly9naXRjYWZlLm5ldC90b29sL2FsaXBhcGVyL1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly91LmdpdGNhZmUubmV0LydcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBcXFwic2VhcmNoXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGZyb206IFxcXCJ3ZWJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdG9rZW46IGdldHRva2VuKCksXFxuICAgICAgICAgICAgICAgICAgICBrZXl3b3JkOiBzXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGxldCBsaXN0ID0gSlNPTi5wYXJzZShodG1sKTtcXG4gICAgICAgICAgICBpZiAobGlzdC5kYXRhKSB7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0LmRhdGE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBsaXN0W2ldXFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0LnRpdGxlO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IGl0LmFsaWtleTtcXG4gICAgICAgICAgICAgICAgaWYgKHUgPT0gbnVsbCkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IG11cmwgPSAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvJyArIHU7XFxuXFxuICAgICAgICAgICAgICAgIGlmICghY2hlY2thbGkobXVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICh0aXRsZS5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKImiBcXFwiICsgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuWwj+e6uOadoTwvZm9udD4mbmJzcDtcXFwiICsgY2F0X2NvZGUoaXQuY2F0KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXM6IGl0LmRlc1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD1odHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy8nICsgbXVybCArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdShtdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycgKyBtdXJsKSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIGQ7XFxuICAgICAgICB9XFxuICAgIH0sIHtcXG4gICAgICAgIG5hbWU6IFxcXCLnjqnlgbblk6Xlk6VcXFwiLFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXG4gICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcImh0dHA6Ly93b2dnLnh5ei9pbmRleC5waHAvdm9kc2VhcmNoL1xcXCIgKyBzICsgXFxcIi0tLS0tLS0tLS1cXFwiICsgcGFnZSArIFxcXCItLS0uaHRtbFxcXCI7XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge30pO1xcbiAgICAgICAgICAgIGxldCBhcnIgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICcubW9kdWxlLWl0ZW1zJiYubW9kdWxlLXNlYXJjaC1pdGVtJyk7XFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGxldCBiZXQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1dGl0bGUgPSBwYXJzZURvbUZvckh0bWwoaXQsICdoMyYmYSYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICBsZXQgdXNlcmlhbCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy52aWRlby1zZXJpYWwmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgbGV0IHVpbWFnZSA9IHBhcnNlRG9tKGl0LCAnLmxhenlsb2FkJiZkYXRhLXNyYycsICdodHRwOi8vd29nZy54eXovJyk7XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGFyc2VEb20oaXQsICdoMyYmYSYmaHJlZicsICdodHRwOi8vd29nZy54eXovJyk7XFxuICAgICAgICAgICAgICAgIC8vbGV0IGRldCA9IHJlcXVlc3QodSwge30pO1xcbiAgICAgICAgICAgICAgICBiZXQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdXRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgaW1hZ2U6IHVpbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHVzZXJpYWxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChiZXQubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICBsZXQgYmV0aCA9IGJhdGNoRmV0Y2goYmV0KTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiZXRoLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoYmV0aFtpXSwgJy5tb2R1bGUtcGxheWVyLWxpc3QmJnAnKVxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ3AmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXUuaW5jbHVkZXMoXFxcIi9zL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYmV0W2ldLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBiZXRbaV0uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7njqnlgbblk6Xlk6U8L2ZvbnQ+Jm5ic3A7XFxcIiArIChiZXRbaV0uZGVzYykgKyAnXFxcXG4nICsgdSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSwge1xcbiAgICAgICAgbmFtZTogXFxcIumYv+mHjOS6keebmOe9kVxcXCIsXFxuICAgICAgICBwYWdlOiB0cnVlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBcXFwiaHR0cHM6Ly93d3cuYWx5cHcuY24vc2VhcmNoLnBocD9xPVxcXCIgKyBzICsgXFxcIiZwYWdlPVxcXCIgKyBwYWdlO1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCh1cmwsIHt9KTtcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLmxpc3QmJmxpJyk7XFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGxldCBiZXQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1dGl0bGUgPSBwYXJzZURvbUZvckh0bWwoaXQsICdhJiZ0aXRsZScpO1xcbiAgICAgICAgICAgICAgICBsZXQgdXNlcmlhbCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy5mYS1jbG9jay1vJiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgIGxldCB1aW1hZ2UgPSBwYXJzZURvbShpdCwgJ2ltZyYmc3JjJywgJ2h0dHBzOi8vd3d3LmFseXB3LmNuLycpO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tKGl0LCAnYSYmaHJlZicsICdodHRwczovL3d3dy5hbHlwdy5jbi8nKTtcXG4gICAgICAgICAgICAgICAgLy9sZXQgZGV0ID0gcmVxdWVzdCh1LCB7fSk7XFxuICAgICAgICAgICAgICAgIGlmICghdXRpdGxlLmluY2x1ZGVzKHMpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBiZXQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdXRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgaW1hZ2U6IHVpbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHVzZXJpYWxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vbG9nKGJldCk7XFxuICAgICAgICAgICAgaWYgKGJldC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIGxldCBiZXRoID0gYmF0Y2hGZXRjaChiZXQpO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJldGgubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShiZXRoW2ldLCAnYm9keSYmYVtocmVmXj1odHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy9dJylcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYmV0W2ldLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBiZXRbaV0uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7pmL/ph4zkupHnm5jnvZE8L2ZvbnQ+Jm5ic3A7XFxcIiArIChiZXRbaV0uZGVzYykgKyAnXFxcXG4nICsgdSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgLyrlpLHmlYgge1xcbiAgICAgICAgICAgIG5hbWU6IFxcXCLlnJ/mi6jpvKBcXFwiLFxcbiAgICAgICAgICAgIHBhZ2U6IGZhbHNlLFxcbiAgICAgICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaCgnaHR0cHM6Ly93d3cudGJzZHkuY29tL3NlYXJjaC5odG1sP2tleXdvcmQ9JyArIHMgKyAnJmNhdGVnb3J5PTk4MzkyMCZkYXRhX3R5cGU9OTg3OTEwJywge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUFcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIGxldCBhcnIgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICcuc2VhcmNoX3Jlc3VsdF9uZXRkaXNrX2xpc3QmJmEnKTtcXG4gICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGl0KTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy5uZXRkaXNrX2l0ZW1fZGV0YWlsX25hbWUmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICghdGl0LmluY2x1ZGVzKHMpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyh1KTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyB1ICsgJz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5Zyf5ouo6byg5pCcPC9mb250PiZuYnNwO1xcXCIgKyBcXFwiXFxcXG5cXFwiICsgdSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sKi9cXG4gICAge1xcbiAgICAgICAgbmFtZTogXFxcIumYv+mHjOaQnFxcXCIsXFxuICAgICAgICBwYWdlOiB0cnVlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KCdodHRwczovL2FsaXNvLmNjL3MvJyArIHMgKyAnLScgKyBwYWdlICsgJy0wLmh0bWwnLCB7fSk7XFxuXFxuICAgICAgICAgICAgbGV0IGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICcuc2VhcmNoLXJlc3VsdCYmLnJlc291cmNlLWl0ZW0nKTtcXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBsaXN0W2pdO1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0ID0gcGFyc2VEb21Gb3JIdG1sKHUsICdoMyYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICBpZiAoIXRpdC5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXQsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQocGFyc2VEb20odSwgJ2gzJiZhJiZocmVmJywgJ2h0dHBzOi8vYWxpc28uY2MvJykpLmxhenlSdWxlKCh3cmFwdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZ2V0Q3J5cHRvSlMoKSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZGVjcnkoc3RyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBrZXkgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShcXFwiOUVCMjBEREZENkFGQkQ2OFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5jcnlwdGVkID0gQ3J5cHRvSlMuQUVTLmRlY3J5cHQoc3RyLCBrZXksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl2OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlOiBDcnlwdG9KUy5tb2RlLkNCQyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5Qa2NzN1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlbmNyeXB0ZWQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJ1dCA9IHBhcnNlRG9tKGh0bWwsICcuYnV0dG9uJiZocmVmJywgJ2h0dHBzOi8vYWxpc28uY2MvJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coYnV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ290ID0gcmVxdWVzdChidXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGdvdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChwYXJzZURvbUZvckh0bWwoZ290LCAnaGVhZCYmc2NyaXB0LDEmJkh0bWwnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdyYXB1KGRlY3J5KGJhc2U2NC5zcGxpdCgnIScpWzBdKSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwdSksXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+6Zi/6YeM5pCcPC9mb250PiZuYnNwO1xcXCIgKyBwYXJzZURvbUZvckh0bWwodSwgJy50aW1lJiZUZXh0JyksXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgLyrlpLHmlYh7XFxuICAgICAgICAgICBuYW1lOiBcXFwi5Zyf54uX5pCcXFxcIixcXG4gICAgICAgICAgIHBhZ2U6IGZhbHNlLFxcbiAgICAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCgnaHR0cHM6Ly93d3cudHVnb3Vzb3UuY29tL3NlYXJjaCcsIHtcXG4gICAgICAgICAgICAgICAgICAgYm9keTogJ2tleXdvcmQ9JyArIHMsXFxuICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgbGV0IGFyciA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJy5sYXl1aS1jb250YWluZXIsMSYmLmxheXVpLXJvdzpoYXMoYSknKTtcXG4gICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwYXJzZURvbUZvckh0bWwoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFwiL3MvXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgIC8vbG9nKHUpO1xcbiAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChpdCwgJ2EmJlRleHQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXG4gICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7lnJ/ni5fmkJw8L2ZvbnQ+Jm5ic3A7XFxcIiArIHBhcnNlRG9tRm9ySHRtbChpdCwgJ3AsLTEmJlRleHQnKSArIFxcXCJcXFxcblxcXCIgKyB1LFxcbiAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgcmV0dXJuIGQ7XFxuICAgICAgICAgICB9XFxuICAgICAgIH0sICovXFxuICAgIHtcXG4gICAgICAgIG5hbWU6IFxcXCLkupHnm5jliIbkuqvnpL5cXFwiLFxcbiAgICAgICAgcGFnZTogZmFsc2UsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBkZWNyeShzdHIpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXCI1RjZCMkFLMzNEQVNEMTIzXFxcIik7XFxuICAgICAgICAgICAgICAgIHZhciBlbmNyeXB0ZWQgPSBDcnlwdG9KUy5BRVMuZGVjcnlwdChzdHIsIGtleSwge1xcbiAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5FQ0IsXFxuICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczdcXG4gICAgICAgICAgICAgICAgfSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZW5jcnlwdGVkO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoJ2h0dHBzOi8vd3d3Lnl1bnBhbmZlbnhpYW5nLmNuL2FwaS9iYnMvYXBpL2dldGRhdGE/a2V5PScgKyBzICsgJyZ0eXBlPXZpZGVvJywge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3d3dy55dW5wYW5mZW54aWFuZy5jbi9cXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsZXQganNvbiA9IGRlY3J5KEpTT04ucGFyc2UoaHRtbCkuZGF0YSk7XFxuICAgICAgICAgICAgLy9sb2coanNvbik7XFxuICAgICAgICAgICAgbGV0IGFyciA9IEpTT04ucGFyc2UoanNvbik7IC8vWzBdLnJlc3VsdC5pdGVtcztcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcblxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgbGV0IGJldCA9IFtdO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGl0LnBpZDtcXG4gICAgICAgICAgICAgICAgYmV0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly93d3cueXVucGFuZmVueGlhbmcuY24vYXBpL2Jicy9hcGkvZ2V0YXJ0aWNsZT9pZD0nICsgdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly93d3cueXVucGFuZmVueGlhbmcuY24vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vbG9nKHUpO1xcbiAgICAgICAgICAgIGxldCBiZXRoID0gYmF0Y2hGZXRjaChiZXQpO1xcblxcbiAgICAgICAgICAgIC8vbG9nKGFydGljbGUpO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmV0aC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQganNvbiA9IEpTT04ucGFyc2UoYmV0aFtpXSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgLy9sb2coanNvbik7XFxuICAgICAgICAgICAgICAgIGxldCBsaXN0ID0ganNvbi5kb3dubG9hZC5zcGxpdCgnQCcpO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gbGlzdFtqXTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGpzb24udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycgKyB1KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5LqR55uY5YiG5Lqr56S+PC9mb250PiZuYnNwO1xcXCIgKyAoanNvbi5jcmVhdGV0aW1lKSArIFxcXCJcXFxcblxcXCIgKyAoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycgKyB1KSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi55uY5pCcXFxcIixcXG4gICAgICAgIHBhZ2U6IHRydWUsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgcGFnZSA9IChwYWdlIC0gMSkgKiAxMDtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcImh0dHBzOi8vd3d3LnBhbnNlYXJjaC5tZS9zZWFyY2g/a2V5d29yZD1cXFwiICsgcyArIFxcXCImb2Zmc2V0PVxcXCIgKyBwYWdlICsgXFxcIiZwYW49YWxpeXVuZHJpdmVcXFwiO1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCh1cmwsIHt9KTtcXG5cXG4gICAgICAgICAgICBsZXQgYXJyID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLmdyaWQmJi5zaGFkb3c6aGFzKGFbaHJlZl49aHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvXSknKTtcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJ2FbaHJlZl49aHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvXSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyh1KTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwoaXQsICcuYnJlYWstYWxsJiZUZXh0Jykuc3BsaXQoJ2h0dHAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBhcnNlRG9tRm9ySHRtbChpdCwgJ2ltZyYmc3JjJyksXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyB1ICsgJz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQodSkgKyAnPz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+55uY5pCcPC9mb250PiZuYnNwO1xcXCIgKyAocGFyc2VEb21Gb3JIdG1sKGl0LCAncCYmVGV4dCcpKSArIFxcXCJcXFxcblxcXCIgKyAodSksXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgbmFtZTogXFxcIkRPVljmkJxcXFwiLFxcbiAgICAgICAgcGFnZTogZmFsc2UsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgbGV0IHVybCA9IFxcXCJodHRwczovL2FwaS5kb3Z4LnRrL2FsaS9zZWFyY2g/d2Q9XFxcIiArIHM7XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge30pO1xcbiAgICAgICAgICAgIC8vbG9nKGJhc2U2NERlY29kZShodG1sKSk7XFxuICAgICAgICAgICAgbGV0IGFyciA9IEpTT04ucGFyc2UoaHRtbCkubGlzdDtcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IGl0LnZvZF9jb250ZW50O1xcbiAgICAgICAgICAgICAgICAvL3UgPSB1Lmxlbmd0aCA+IDAgPyB1WzBdIDogdXJsO1xcbiAgICAgICAgICAgICAgICBpZiAoIXUuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghY2hlY2thbGkodSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKImiBcXFwiICsgaXQudm9kX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC52b2RfcGljLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KHUpLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPkRPVljmkJw8L2ZvbnQ+Jm5ic3A7XFxcIiArIFxcXCJcXFxcblxcXCIgKyAodSksXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgbmFtZTogXFxcIuW/heW6lFxcXCIsXFxuICAgICAgICBwYWdlOiB0cnVlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBcXFwiaHR0cHM6Ly9jbi5iaW5nLmNvbS9zZWFyY2g/cT1cXFwiICsgcyArIFxcXCIrYWxpeXVuZHJpdmUmcXM9ZHMmZm9ybT1RQlJFXFxcIjtcXG4gICAgICAgICAgICBpZiAocGFnZSAhPSAxKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IGdldE15VmFyKFxcXCJiaW5nXFxcIiwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL2NuLmJpbmcuY29tL1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAvL1xcXCJYLVJlcXVlc3RlZC1XaXRoXFxcIjogXFxcImNvbS5leGFtcGxlLmhpa2Vydmlld1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiQWNjZXB0XFxcIjogXFxcInRleHQvaHRtbCxhcHBsaWNhdGlvbi94aHRtbCt4bWwsYXBwbGljYXRpb24veG1sO3E9MC45LGltYWdlL2F2aWYsaW1hZ2Uvd2VicCxpbWFnZS9hcG5nLCovKjtxPTAuOCxhcHBsaWNhdGlvbi9zaWduZWQtZXhjaGFuZ2U7dj1iMztxPTAuOVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxldCBhcnIgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZhXFxcIik7XFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBwZChpdCwgXFxcImEmJmhyZWZcXFwiLCB1cmwpO1xcbiAgICAgICAgICAgICAgICBsZXQgdCA9IHBkZmgoaXQsIFxcXCJhJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChpdC5pbmNsdWRlcyhcXFwiTmV4dCBwYWdlXFxcIikgfHwgaXQuaW5jbHVkZXMoXFxcIuS4i+S4gOmhtVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSBwZChpdCwgXFxcImEmJmhyZWZcXFwiLCB1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coXFxcIm5leHQgcGFnZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2codTIpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImJpbmdcXFwiLCB1Mik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHUgPT0gbnVsbCB8fCB0ID09IG51bGwgfHwgIWl0LmluY2x1ZGVzKHMpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIWl0LmluY2x1ZGVzKFxcXCLnvZHnm5hcXFwiKSAmJiAhaXQuaW5jbHVkZXMoXFxcIuS6keebmFxcXCIpICYmXFxuICAgICAgICAgICAgICAgICAgICAhaXQuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlXFxcIikgJiYgIWl0LmluY2x1ZGVzKFxcXCJ5dW5wYW5cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHUuc3RhcnRzV2l0aChcXFwiaHR0cHM6Ly9jbi5iaW5nLmNvbS9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGRvbSA9IGdldEhvbWUodSkucmVwbGFjZShcXFwiaHR0cDovL1xcXCIsIFxcXCJcXFwiKS5yZXBsYWNlKFxcXCJodHRwczovL1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IF9saW5rcyA9IHQubWF0Y2goL2h0dHBzOlxcXFwvXFxcXC8od3d3XFxcXC5hbGl5dW5kcml2ZVxcXFwuY29tXFxcXC9zfGFseXdwXFxcXC5uZXQpXFxcXC9cXFxcdyovZykgfHwgW107XFxuICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxuICAgICAgICAgICAgICAgIGxldCBjID0gbnVsbDtcXG4gICAgICAgICAgICAgICAgLy9sb2coX2xpbmtzKTtcXG4gICAgICAgICAgICAgICAgLy9pZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgLy9jID0gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KF9saW5rc1swXSkgKyAnPz8/ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgLy9jPXdyYXB1KF9saW5rc1swXSlcXG4gICAgICAgICAgICAgICAgLy99XFxuICAgICAgICAgICAgICAgIGlmIChfbGlua3MubGVuZ3RoID4gMSAmJiBfbGlua3NbMV0ucmVwbGFjZShfbGlua3NbMF0sIFxcXCJcXFwiKS5yZXBsYWNlKC9bYS16QS1aMC05XSsvZywgXFxcIlxcXCIpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBjID0gd3JhcHUoX2xpbmtzWzFdKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChfbGlua3MubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgYyA9IHdyYXB1KF9saW5rc1swXSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0LFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuW/heW6lDwvZm9udD4mbmJzcDtcXFwiICsgZG9tLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBjICE9IG51bGwgPyBjIDogJCh1KS5sYXp5UnVsZSgod3JhcHUsIG1vZGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBfbGlua3MgPSBodG1sLm1hdGNoKC9odHRwczpcXFxcL1xcXFwvKHd3d1xcXFwuYWxpeXVuZHJpdmVcXFxcLmNvbVxcXFwvc3xhbHl3cFxcXFwubmV0KVxcXFwvXFxcXHcqL2cpIHx8IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIF9saW5rc1swXSArICc/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KF9saW5rc1swXSkgKyAnPz8/ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX2xpbmtzLmxlbmd0aCA+IDEgJiYgX2xpbmtzWzFdLnJlcGxhY2UoX2xpbmtzWzBdLCBcXFwiXFxcIikucmVwbGFjZSgvW2EtekEtWjAtOV0rL2csIFxcXCJcXFwiKSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd3JhcHUoX2xpbmtzWzFdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKF9saW5rcy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShfbGlua3NbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBydWxlID0gTVlfUlVMRS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UveXNmeD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZyPVxcXCIgKyBydWxlICsgXFxcIiZtb2RlPVxcXCIgKyBtb2RlICsgXFxcIiMjXFxcIiArIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIHdyYXB1LCBjb25maWcubW9kZSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXTtcXG5cXG4vKlxcbmxldCBjY29mID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvY2NvZicpXFxucnVsZXMucHVzaChjY29mKVxcbiovXFxuLy/lubblj5Hop4TliJnmlbBcXG5sZXQgc2l6ZSA9IDEwO1xcblxcbiQuZXhwb3J0cyA9IGZ1bmN0aW9uKHBhZ2UsIHJ1bGUpIHtcXG4gICAgaWYgKCFwYWdlICYmICFydWxlKSB7XFxuICAgICAgICByZXR1cm4gcnVsZXMubWFwKGl0ID0+IGl0Lm5hbWUpO1xcbiAgICB9XFxuICAgIGlmIChydWxlICE9IG51bGwpIHtcXG4gICAgICAgIGlmIChwYWdlICE9IG51bGwgJiYgcGFnZSA+IDEpIHtcXG4gICAgICAgICAgICByZXR1cm4gcnVsZXMuZmlsdGVyKGkgPT4gaS5uYW1lID09IHJ1bGUgJiYgaS5wYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBydWxlcy5maWx0ZXIoaSA9PiBpLm5hbWUgPT0gcn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SXRlbShcXFwiZG1vZGVcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5a6Y5pa5QVBQXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn++8jOivt+ehruS/neaJi+acuuacieWuieijhemYv+mHjOS6keebmOWumOaWuUFQUFxcXCI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5Yqf44CCXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICBwaWNfdXJsOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbjFcXFwiXFxuICAgIH0pO1xcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcbiAgICAgICAgZGVzYzogJ+ivt+i+k+WFpeWFs+mUruivjScsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0LnN0YXJ0c1dpdGgoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoaW5wdXQpICsgJz8/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcH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gICAgc2V0SXRlbShcXFwiclxcXCIsIHIpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgaXQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogJ3lwai1sJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG59XFxubGV0IHMgPSBnZXRNeVZhcigncycsICcnKTtcXG5pZiAocyAhPSBcXFwiXFxcIikge1xcbiAgICBsZXQgcCA9IE1ZX1BBR0U7XFxuICAgIGxldCBkYXRhID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXCIpKHAsIHIgIT0gXFxcIlxcXCIgPyByIDogbnVsbCk7XFxuXFxuICAgIGxldCBwYWdlaWQgPSBcXFwieXBqLXBhZ2VcXFwiICsgcDtcXG4gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWKoOi9veesrFxcXCIgKyBwICsgXFxcIumhteS4re+8jOi/m+W6pu+8mjEvXFxcIiArIGRhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgIHVybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpO1xcbiAgICAvL2xvZyhkYXRhLmxlbmd0aCk7XFxuXFxuICAgIGlmIChkYXRhLmxlbmd0aCA+IDApIHtcXG4gICAgICAgIC8v5aSa57q/56iL5Yqg6L29ICAgICAgICBcXG4gICAgICAgIGxldCByZWFsUGFnZSA9IFxcXCJcXFwiID09IHIgPyAxIDogcDtcXG4gICAgICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihydWxlKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcnVsZS5maW5kKHMsIHJlYWxQYWdlKTtcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgcGFyYW06IGl0LFxcbiAgICAgICAgICAgICAgICBpZDogXFxcInJ1bGVAXFxcIiArIGl0Lm5hbWVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcbiAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAvL2xvZyhcXFwibGlzdGVuZXI6IFxcXCIgKyAocmVzdWx0IHx8IFtdKS5sZW5ndGgpXFxuICAgICAgICAgICAgICAgIHBhcmFtLmkgPSBwYXJhbS5pICsgMTtcXG4gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0uaiA9IHBhcmFtLmogKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnRpdGxlLmluY2x1ZGVzKFxcXCLigJzigJzigJ3igJ1cXFwiKSA/IGl0LnRpdGxlIDogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBpdC50aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAoXFxcIjxlbT58PC9lbT5cXFwiLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIikucmVwbGFjZShuZXcgUmVnRXhwKHMsIFxcXCJnXFxcIiksIFxcXCI8c3Ryb25nPjxzcGFuIHN0eWxlPVxcXFxcXFwiY29sb3I6ICMxRTkwRkZcXFxcXFxcIj5cXFwiICsgcyArIFxcXCI8L3NwYW4+PC9zdHJvbmc+XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBpdC5kZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LnBpY191cmwgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWMnIDogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmosXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLmkgPj0gcGFyYW0uYWxsKSB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBhbGw6IGRhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgICAgICBpOiAwLFxcbiAgICAgICAgICAgICAgICBqOiAtMVxcbiAgICAgICAgICAgIH1cXG4gICAgIC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AgICAgICAuZGF0YS5yb3dzXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgaXQgPSBsaXN0W2ldXFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gaXQuZmlsZU5hbWVcXG4gICAgICAgICAgICBsZXQgbXVybCA9IGl0LnVybFxcbiAgICAgICAgICAgIGxldCB0eXBlID0gaXQudHlwZS5yZXBsYWNlKC9mb2xkZXIvLCAn5paH5Lu25aS5JykucmVwbGFjZSgvZmlsZS8sICfmlofku7YnKVxcbiAgICAgICAgICAgIGlmICh0aXRsZS5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPkNDT0Y8L2ZvbnQ+Jm5ic3A7JyArICfmlofku7bnsbvlnovvvJonICsgdHlwZSArICfvvIzmlofku7blpKflsI/vvJonICsgYnl0ZXNUb1NpemUoaXQuc2l6ZSksXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyBtdXJsICsgJz8/ZnlwYWdlJ1xcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudChtdXJsKSArICc/Pz9meXBhZ2UnXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KG11cmwpXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGRcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpc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vc3Quc3BsaXQoXFxcIi5cXFwiKTtcXG4gICAgICAgIGlmIChob3N0cy5sZW5ndGggPiAyKSB7XFxuICAgICAgICAgICAgaG9zdCA9IGhvc3RzW2hvc3RzLmxlbmd0aCAtIDJdICsgXFxcIi5cXFwiICsgaG9zdHNbaG9zdHMubGVuZ3RoIC0gMV07XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwibWFnbmV0XFxcIikpIHtcXG4gICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmuKnppqjmj5DnpLpcXFwiLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBcXFwi5qOA5rWL5Yiw5paw55qE56OB6ZO+5Zyw5Z2A77yM54K55Ye756Gu5a6a5oyJ6ZKu5Y2z5Y+v5pKt5pS+77yM54K55Ye75Y+W5raI5oyJ6ZKu5Y+v5Lul5aSN5Yi26ZO+5o6lXFxcIixcXG4gICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygobWFnKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWFnO1xcbiAgICAgICAgICAgICAgICB9LCBpbnB1dCksXFxuICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygobWFnKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgbWFnXFxuICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCJhbGl5dW5kcml2ZS5jb21cXFwiKSAmJiBtb2RlICE9IFxcXCLlrpjmlrlBUFBcXFwiKSB7XFxuICAgICAgICAgICAgLy9sb2coaW5wdXQpO1xcbiAgICAgICAgICAgIGlmIChpbnB1dC5pbmNsdWRlcygnY2hlY2t1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0sIGlucHV0LCBydWxlKVxcbiAgICAgICAgfSBlbHNlIGlmICghaW5wdXQuaW5jbHVkZXMoaG9zdCkgJiYgaW5wdXQuc3RhcnRzV2l0aChcXFwiaHR0cFxcXCIpKSB7XFxuICAgICAgICAgICAgLy9sb2coaW5wdXQpO1xcbiAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUsIG1vZGUpID0+IHtcXG4gICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6K+m5oOFXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnI9XFxcIiArIHJ1bGUgKyBcXFwiJm1vZGU9XFxcIiArIG1vZGUgKyBcXFwiIyNcXFwiICsgdXJsLFxcbiAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICB9LCBpbnB1dCwgcnVsZSwgbW9kZSk7XFxuICAgICAgICB9IGVsc2UgaWYgKCFpbnB1dC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAvL2xvZyhpbnB1dCk7XFxuICAgICAgICAgICAgLy/og73llKTotbdBUFDnmoTnmb3lkI3ljZVcXG4gICAgICAgICAgICBsZXQgd2hpdGUgPSBbXFxuICAgICAgICAgICAgICAgIFxcXCJxa2xpbmtcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiYmRuZXRkaXNrXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInh1bmxlaWFwcFxcXCJcXG4gICAgICAgICAgICBdO1xcbiAgICAgICAgICAgIGxldCBpbldoaXRlID0gd2hpdGUuZmlsdGVyKGl0ID0+IGlucHV0LnN0YXJ0c1dpdGgoaXQpKS5sZW5ndGggPiAwO1xcbiAgICAgICAgICAgIGlmICghaW5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uaW5jbHVkZXMoXFxcInNoYXJlX2xpbmsgaXMgY2FuY2VsbGVkXFxcIikgfHwgZ2V0c2hhci5pbmNsdWRlcyhcXFwic2hhcmVfbGluayBpcyBleHBpcmVkXFxcIikpIHtcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfmnaXmmZrllabvvIzor6XliIbkuqvlt7LlpLHmlYjjgIInLFxcbiAgICAgICAgICAgICAgICB1cmw6IGRlY29kZVVSSUNvbXBvbmVudChnZXRSZXNDb2RlKCkuc3BsaXQoJyMjJylbMV0pLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoZ2V0c2hhci5pbmNsdWRlcyhcXFwic2hhcmVfbGluayBjYW5ub3QgYmUgZm91bmRcXFwiKSkge1xcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+S9oOaJk+W8gOeahOmTvuaOpeacieivr++8jOivt+mHjeivleOAgicsXFxuICAgICAgICAgICAgICAgIHVybDogZGVjb2RlVVJJQ29tcG9uZW50KGdldFJlc0NvZGUoKS5zcGxpdCgnIyMnKVsxXSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGxldCBwdXNobmFtZSA9IEpTT04ucGFyc2UoZ2V0c2hhcikuZmlsZV9pbmZvc1swXS5maWxlX25hbWU7XFxuXFxuICAgICAgICB2YXIgc2hhcmV0b2tlbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2h0dHBzOi8vYXBpLmFsaXl1bmRyaXZlLmNvbS92Mi9zaGFyZV9saW5rL2dldF9zaGFyZV90b2tlbicsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6ICd7XFxcInNoYXJlX3B3ZFxcXCI6XFxcIlxcXCIsXFxcInNoYXJlX2lkXFxcIjpcXFwiJyArIHNoYXJlSWQgKyAnXFxcIn0nLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KSkuc2hhcmVfdG9rZW47XFxuICAgICAgICAvL2xvZyhzaGFyZXRva2VuKTtcXG5cXG4gICAgICAgIGxldCBuZXh0ID0gZ2V0TXlWYXIoJ25leHRwYWdlJywgJycpICE9ICcnID8gJyxcXFwibWFya2VyXFxcIjpcXFwiJyArIGdldE15VmFyKCduZXh0cGFnZScpICsgJ1xcXCInIDogJyc7XFxuICAgICAgICBpZiAoIWRlY29kZVVSSUNvbXBvbmVudChyZWFsdXJsKS5pbmNsdWRlcygnL2ZvbGRlci8nKSkge1xcbiAgICAgICAgICAgIC8vaWYoIWxpc3R5cCA9PSAnZm9sZGVyJyl7XFxuICAgICAgICAgICAgdmFyIHJlc2NvZCA9IGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YzL2ZpbGUvbGlzdCcsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgICAgICdYLVNoYXJlLVRva2VuJzogc2hhcmV0b2tlblxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiAne1xcXCJzaGFyZV9pZFxcXCI6XFxcIicgKyBzaGFyZUlkICsgJ1xcXCIsXFxcInBhcmVudF9maWxlX2lkXFxcIjpcXFwicm9vdFxcXCIsXFxcImxpbWl0XFxcIjoxMDAsXFxcImltYWdlX3Rod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1cXG4gICAgICAgIH0gLy/lj5bmlofku7blpLlcXG4gICAgICAgIC8vbG9nKHJlc2NvZCk7XFxuXFxuXFxuICAgICAgICBpZiAoSlNPTi5wYXJzZShyZXNjb2QpLm5leHRfbWFya2VyKSB7XFxuICAgICAgICAgICAgbGV0IG1hcmtlciA9IEpTT04ucGFyc2UocmVzY29kKS5uZXh0X21hcmtlcjtcXG4gICAgICAgICAgICBpZiAobWFya2VyLmxlbmd0aCA+IDEwKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCduZXh0cGFnZScsIG1hcmtlcik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignbmV4dHBhZ2UnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgY29udHMgPSBKU09OLnBhcnNlKHJlc2NvZCkuaXRlbXM7XFxuICAgICAgICBpZiAoY29udHMubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+ivpeaWh+S7tuWkueS4i+ayoeacieWIhuS6q+eahOaWh+S7ticsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgZG9uZ3RhaSA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9sYXp5dXJsJywge30pKS5ydWxlLnRvU3RyaW5nKCk7XFxuXFxuICAgICAgICB2YXIgdHVpc29uZyA9IFtdO1xcbiAgICAgICAgdmFyIHppbXUgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGkgaW4gY29udHMpIHtcXG4gICAgICAgICAgICAvL3ZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcbiAgICAgICAgICAgIGlmIChjb250c1tpXS50eXBlICE9ICdmb2xkZXInKSB7XFxuICAgICAgICAgICAgICAgIGxldCBmbmFtZSA9IGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICAgICAgICAgIGxldCBmdHlwZSA9IGZuYW1lLnRvTG93ZXJDYXNlKCk7XFxuICAgICAgICAgICAgICAgIGxldCBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxuICAgICAgICAgICAgICAgIGlmIChmdHlwZS5lbmRzV2l0aCgnLnNydCcpIHx8IGZ0eXBlLmVuZHNXaXRoKCcudnR0JykgfHwgZnR5cGUuZW5kc1dpdGgoJy5hc3MnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgemltdS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXQ6IGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZihcXFwiLlxcXCIpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHQ6IGNvbnRzW2ldLmZpbGVfZXh0ZW5zaW9uLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpZDogY29udHNbaV0uZmlsZV9pZFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGlmIChjYXRlID09ICd2aWRlbycgfHwgY2F0ZSA9PSAnYXVkaW8nKSB7XFxuICAgICAgICAgICAgICAgICAgICB0dWlzb25nLnB1c2goXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm5hbWUucmVwbGFjZSgvXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcJC9nLCAnXycpICsgJyQnICsgY2F0ZSArICd8JyArIGNvbnRzW2ldLmZpbGVfaWRcXG4gICAgICAgICAgICAgICAgICAgICk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcblxcbiAgICAgICAgZm9yICh2YXIgaSBpbiBjb250cykge1xcbiAgICAgICAgICAgIHZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcbiAgICAgICAgICAgIGlmIChsaXN0eXAgIT0gJ2ZvbGRlcicpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGNhdGUgPSBjb250c1tpXS5jYXRlZ29yeTtcXG4gICAgICAgICAgICAgICAgdmFyIGZuYW1lID0gY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk7onICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdkb2MnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TlicgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2ltYWdlJykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/CflrwnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICd6aXAnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TpicgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gY29udHNbaV0ubmFtZVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8vIGlmIChjYXRlID09ICd2aWRlbycgfHwgY2F0ZSA9PSAnYXVkaW8nIHx8IGNhdGUgPT0gJ2ltYWdlJykge1xcbiAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChjb250c1tpXS5maWxlX2lkKS5sYXp5UnVsZSgoc2hhcmVJZCwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuLCB6aW11KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oJ3NpbmdsZXB1c2gnLCAnJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cnVsZT1YWVHmjqjpgIEmcHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IGZuYW1lLnJlcGxhY2UoL1xcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzaGFyZV9pZFxcXCI6IHNoYXJlSWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZG9uZ3RhaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuLCB6aW11KSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGZvcm1hdERhdGUoY29udHNbaV0udXBkYXRlZF9hdCkgKyAnICAnICsgZm9ybWF0U2l6ZShjb250c1tpXS5zaXplKSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+aOqOmAgeWIsFRWQm94JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNoYXJlSWQsIGZpbGVpZCwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBmbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBmbmFtZS5yZXBsYWNlKC9cXFxcIy9nLCAnXycpLnJlcGxhY2UoL1xcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgZmlsZWlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzaGFyZV9pZFxcXCI6IHNoYXJlSWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgY29udHNbaV0uZmlsZV9pZCwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBjb250c1tpXS5maWxlX2lkXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnXFxuXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAvKn0gZWxzZSBpZiAoaSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+W9k+WJjeaWh+S7tuWkueS4i+ayoeaciemfs+inhumikeaWh+S7ticsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0qL1xcblxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwn5OCJyArIGNvbnRzW2ldLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHknICsgY29udHNbaV0uZmlsZV9pZCArICc/Pz9meXBhZ2UnKS5ydWxlKChzaGFyZUlkLCBzaGFyZXRva2VuLCBwdXNobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3J1bGVsb29wJywge30pKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIHNoYXJldG9rZW4sIGNvbnRzW2ldLm5hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXG4gICAgICAgICAgICAgICAgfSk7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gPSBbXTtcXG4gICAgdmFyIHppbXUgPSBbXTtcXG4gICAgZm9yIChsZXQgaSBpbiBjb250cykge1xcbiAgICAgICAgLy92YXIgbGlzdHlwID0gY29udHNbaV0udHlwZTtcXG4gICAgICAgIGlmIChjb250c1tpXS50eXBlICE9ICdmb2xkZXInKSB7XFxuICAgICAgICAgICAgbGV0IGZuYW1lID0gY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICBsZXQgZnR5cGUgPSBmbmFtZS50b0xvd2VyQ2FzZSgpO1xcbiAgICAgICAgICAgIGxldCBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxuICAgICAgICAgICAgaWYgKGZ0eXBlLmVuZHNXaXRoKCcuc3J0JykgfHwgZnR5cGUuZW5kc1dpdGgoJy52dHQnKSB8fCBmdHlwZS5lbmRzV2l0aCgnLmFzcycpKSB7XFxuICAgICAgICAgICAgICAgIHppbXUucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXQ6IGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZihcXFwiLlxcXCIpKSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dDogY29udHNbaV0uZmlsZV9leHRlbnNpb24sXFxuICAgICAgICAgICAgICAgICAgICBmaWQ6IGNvbnRzW2ldLmZpbGVfaWRcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nIHx8IGNhdGUgPT0gJ2F1ZGlvJykge1xcbiAgICAgICAgICAgICAgICB0dWlzb25nLnB1c2goXFxuICAgICAgICAgICAgICAgICAgICBmbmFtZS5yZXBsYWNlKC9cXFxcIy9nLCAnXycpLnJlcGxhY2UoL1xcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgY29udHNbaV0uZmlsZV9pZFxcbiAgICAgICAgICAgICAgICApO1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgXFxuICAgIGZvciAodmFyIGkgaW4gY29udHMpIHtcXG4gICAgICAgIHZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcbiAgICAgICAgaWYgKGxpc3R5cCAhPSAnZm9sZGVyJykge1xcbiAgICAgICAgICAgIHZhciBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxuICAgICAgICAgICAgdmFyIGZuYW1lID0gY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5O6JyArIGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdkb2MnKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5OWJyArIGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/CflrwnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ3ppcCcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk6YnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBjb250c1tpXS5uYW1lXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vaWYgKGNhdGUgPT0gJ3ZpZGVvJyB8fCBjYXRlID09ICdhdWRpbycgfHwgY2F0ZSA9PSAnaW1hZ2UnKSB7XFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGNvbnRzW2ldLmZpbGVfaWQpLmxhenlSdWxlKChzaGFyZUlkLCBkb25ndGFpLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4semltdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oJ3NpbmdsZXB1c2gnLCAnJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPVhZUeaOqOmAgSZwdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGZuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogZm5hbWUucmVwbGFjZSgvXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcJC9nLCAnXycpICsgJyQnICsgY2F0ZSArICd8JyArIGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwic2hhcmVfaWRcXFwiOiBzaGFyZUlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGRvbmd0YWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lLCByZWZ0b2tlbix6aW11KSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZm9ybWF0RGF0ZShjb250c1tpXS51cGRhdGVkX2F0KSArICcgICcgKyBmb3JtYXRTaXplKGNvbnRzW2ldLnNpemUpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB5YiwVFZCb3gnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaGFyZUlkLCBmaWxlaWQsIGNhdGUsIGZuYW1lLCByZWZ0b2tlbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGZuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfdG9rZW5cXFwiOiByZWZ0b2tlbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBmbmFtZS5yZXBsYWNlKC9cXFxcIy9nLCAnXycpLnJlcGxhY2UoL1xcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgZmlsZWlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNoYXJlX2lkXFxcIjogc2hhcmVJZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgY29udHNbaV0uZmlsZV9pZCwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuKVxcbiAgICAgICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgICAgICBpZDogY29udHNbaV0uZmlsZV9pZFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXG5cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAg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KyAxKVxcbiAgICAgICAgICAgIGNvbnN0IGRkID0gbmV3IERhdGUoKS5nZXREYXRlKCkgPCAxMCA/ICcwJyArIG5ldyBEYXRlKCkuZ2V0RGF0ZSgpIDogbmV3IERhdGUoKS5nZXREYXRlKClcXG4gICAgICAgICAgICBjb25zdCBISCA9IG5ldyBEYXRlKCkuZ2V0SG91cnMoKSA8IDEwID8gJzAnICsgbmV3IERhdGUoKS5nZXRIb3VycygpIDogbmV3IERhdGUoKS5nZXRIb3VycygpXFxuICAgICAgICAgICAgY29uc3QgbW0gPSBuZXcgRGF0ZSgpLmdldE1pbnV0ZXMoKSA8IDEwID8gJzAnICsgbmV3IERhdGUoKS5nZXRNaW51dGVzKCkgOiBuZXcgRGF0ZSgpLmdldE1pbnV0ZXMoKVxcbiAgICAgICAgICAgIHJldHVybiB5eSArICcnICsgZGQgKyAnJyArIEhIICsgJycgKyBNTSArICcnICsgbW1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGxldCBzaGFyZXRva2VuID0gSlNPTi5wYXJzZShyZXF1ZXN0KCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vdjIvc2hhcmVfbGluay9nZXRfc2hhcmVfdG9rZW4nLCB7XFxuICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICBcXFwic2hhcmVfcHdkXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJzaGFyZV9pZFxcXCI6IHNoYXJlX2lkXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcXG4gICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICB9KSkuc2hhcmVfdG9rZW47XFxuXFxuICAgICAgICBsZXQgaGVhZGVycyA9IHtcXG4gICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb247Y2hhcnNldD1VVEYtOCcsXFxuICAgICAgICAgICAgXFxcIm9yaWdpblxcXCI6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5dW5kcml2ZS5jb20vdjIvYWNjb3VudC90b2tlbicsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfdG9rZW5cXFwiOiBhbGl0b2tlbixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJncmFudF90eXBlXFxcIjogXFxcInJlZnJlc2hfdG9rZW5cXFwiXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxcbiAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdhbGl1c2VyaW5mbycsIHVzZXJpbmZvKTtcXG4gICAgICAgICAgICBwdXRNeVZhcigndXNlcmluZm9DaGVja3RpbWUnLCBub3d0aW1lICsgJ3RpbWUnKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBhdXRob3JpemF0aW9uID0gJ0JlYXJlciAnICsgdXNlcmluZm8uYWNjZXNzX3Rva2VuO1xcbiAgICAgICAgbGV0IGRldmljZUlkID0gdXNlcmluZm8uZGV2aWNlX2lkO1xcbiAgICAgICAgbGV0IHVzZXJJZCA9IHVzZXJpbmZvLnVzZXJfaWQ7XFxuICAgICAgICBsZXQgc2lnbmF0dXJlO1xcblxcbiAgICAgICAgbGV0IGFzID0ganVzdFRlc3RTaWduKFxcXCI1ZGRlNGUxYmRmOWU0OTY2YjM4N2JhNThmNGIzZmRjM1xcXCIsIGRldmljZUlkLCB1c2VySWQpO1xcbiAgICAgICAgLy9sb2coYSk7XFxuICAgICAgICBsZXQgYnAgPSBhcy5zcGxpdChcXFwiIyNcXFwiKTtcXG4gICAgICAgIHZhciBzaWduID0gYnBbMF07XFxuICAgICAgICB2YXIgcHViS2V5ID0gYnBbYnAubGVuZ3RoIC0gMV07XFxuXFxuICAgICAgICBsZXQgaSA9IDA7XFxuICAgICAgICBkbyB7XFxuXFxuICAgICAgICAgICAgbGV0IHNlc3MgPSBmZXRjaCgnaHR0cHM6Ly9hcGkuYWxpeXVuZHJpdmUuY29tL3VzZXJzL3YxL3VzZXJzL2RldmljZS9jcmVhdGVfc2Vzc2lvbicsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXG4gICAgICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogYXV0aG9yaXphdGlvbixcXG4gICAgICAgICAgICAgICAgICAgICdYLVNoYXJlLVRva2VuJzogc2hhcmV0b2tlbixcXG4gICAgICAgICAgICAgICAgICAgICd4LWRldmljZS1pZCc6IGRldmljZUlkLFxcbiAgICAgICAgICAgICAgICAgICAgJ3gtc2lnbmF0dXJlJzogc2lnblxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiAne1xcXCJkZXZpY2VOYW1lXFxcIjpcXFwiQ2hyb21l5rWP6KeI5ZmoXFxcIixcXFwibW9kZWxOYW1lXFxcIjpcXFwiV2luZG93c+e9kemhteeJiFxcXCIsXFxcIm5vbmNlXFxcIjowLFxcXCJwdWJLZXlcXFwiOlxcXCInICsgcHViS2V5ICsgJ1xcXCIsXFxcInJlZnJlc2hUb2tlblxcXCI6XFxcIicgKyBhbGl0b2tlbiArICdcXFwifScsXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKHNlc3MuaW5jbHVkZXMoJ3N1Y2Nlc3MnK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cmVfaWRcXFwiOiBzaGFyZV9pZCxcXG4gICAgICAgICAgICBcXFwidGVtcGxhdGVfaWRcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBcXFwiZ2V0X3N1YnRpdGxlX2luZm9cXFwiOiB0cnVlXFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhkYXRhKTtcXG4gICAgICAgIGxldCBqc29uID0gSlNPTi5wYXJzZShyZXF1ZXN0KCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vdjIvZmlsZS9nZXRfc2hhcmVfbGlua192aWRlb19wcmV2aWV3X3BsYXlfaW5mbycsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgIGJvZHk6IGRhdGEsXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsXFxuICAgICAgICAgICAgdGltZW91dDogMzAwMFxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgYWxpeXVuVXJsID0ganNvbi52aWRlb19wcmV2aWV3X3BsYXlfaW5mby5saXZlX3RyYW5zY29kaW5nX3Rhc2tfbGlzdDtcXG4gICAgICAgIGFsaXl1blVybC5yZXZlcnNlKCk7XFxuXFxuICAgICAgICByZXR1cm4gYWxpeXVuVXJsO1xcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICBsb2coJ+agueaNruWFseS6q+mTvuaOpeiOt+WPluaSreaUvuWcsOWdgOWksei0pT4nICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIHJldHVybiBcXFwiXFxcIjtcXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiBnZXRBbGlVcmwoc2hhcmVfaWQsIGZpbGVfaWQsIGFsaXRva2VuKSB7XFxuICAgIHRyeSB7XFxuICAgICAgICBsZXQgdXJscyA9IFtdO1xcbiAgICAgICAgbGV0IG5hbWVzID0gW107XFxuICAgICAgICBsZXQgaGVhZHMgPSBbXTtcXG4gICAgICAgIGxldCB1ID0gc3RhcnRQcm94eVNlcnZlcigkLnRvU3RyaW5nKChhbGlTaGFyZVBsYXlVcmwsIGZpbGVfaWQsIHNoYXJlX2lkLCBhbGl0b2tlbikgPT4ge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIGdldHVybChmaWxlaWQsIGxpbmUpIHtcXG4gICAgICAgICAgICAgICAgLy/pooTliqDovb3ml7bkvJrlj5hmaWxlX2lkLOaJgOS7pXRz6L+H5pyf5pu05paw5pe26L+Y5Y+W5Y6f5p2l55qEaWRcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxMaXN0ID0gYWxpU2hhcmVQbGF5VXJsKHNoYXJlX2lkLCBmaWxlaWQsIGFsaXRva2VuKSB8fCBbXTtcXG4gICAgICAgICAgICAgICAgbGV0IGFsaXVybDtcXG4gICAgICAgICAgICAgICAgcGxheVVybExpc3QuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0udGVtcGxhdGVfaWQgPT0gbGluZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsaXVybCA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8qYWxpdXJsID0gSlNPTi5wYXJzZShyZXF1ZXN0KGl0ZW0udXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07Ki9cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgLy/kuIrpnaLmmK/ojrflj5bpmL/ph4znmoTmkq3mlL7lnLDlnYBcXG4gICAgICAgICAgICAgICAgLy9sb2coXFxcIuaIkeWcqOS7o+eQhlxcXCIgKyBhbGl1cmwpO1xcbiAgICAgICAgICAgICAgICBsZXQgaG9tZSA9IGFsaXVybC5zcGxpdCgnbWVkaWEubTN1OCcpWzBdO1xcbiAgICAgICAgICAgICAgICBsZXQgZiA9IGZldGNoKGFsaXVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICAgICAgICAgIH0pLnNwbGl0KFxcXCJcXFxcblxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgZmYgPSBmLm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXQuc3RhcnRzV2l0aChcXFwibWVkaWEtXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIi9wcm94eT91cmw9XFxcIiArIGJhc2U2NEVuY29kZShob21lICsgaXQpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0O1xcbiAgICAgICAgICAgICAgICB9KS5qb2luKFxcXCJcXFxcblxcXCIpO1xcbiAgICAgICAgICAgICAgICAvL2xvZygndWZpZC0nK2ZpbGVpZCk7XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS9fZmlsZVNlbGVjdF8nICsgZmlsZWlkICsgJy5tM3U4JywgZmYpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZmY7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCB1cmwgPSBiYXNlNjREZWNvZGUoTVlfUEFSQU1TLnVybCk7XFxuICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcyhcXFwiLnRzXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGZpZCA9IHVybC5zcGxpdCgnJmY9JylbMV0uc3BsaXQoJyYnKVswXTtcXG4gICAgICAgICAgICAgICAgLy9sb2coJ3NmaWQtJytmaWQpO1xcbiAgICAgICAgICAgICAgICBsZXQgZiA9IGZldGNoKCdoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0XycgKyBmaWQgKyAnLm0zdTgnKS5zcGxpdChcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICAgICAgZi5mb3JFYWNoKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdCAmJiBpdC5zdGFydHNXaXRoKCcvcHJveHk/dXJsPScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZ1cmwgPSBiYXNlNjREZWNvZGUoaXQucmVwbGFjZSgnL3Byb3h5P3VybD0nLCAnJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuc3Vic3RyKHVybC5pbmRleE9mKCcvbWVkaWEtJyksIHVybC5pbmRleE9mKCcudHMnKSkgPT0gZnVybC5zdWJzdHIoZnVybC5pbmRleE9mKCcvbWVkaWEtJyksIGZ1cmwuaW5kZXhPZignLnRzJykpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IGZ1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBsZXQgZXhwaXJlcyA9IHVybC5zcGxpdCgneC1vc3MtZXhwaXJlcz0nKVsxXS5zcGxpdCgnJicpWzBdO1xcbiAgICAgICAgICAgICAgICBjb25zdCBsYXN0dGltZSA9IHBhcnNlSW50KGV4cGlyZXMpIC0gRGF0ZS5ub3coKSAvIDEwMDA7XFxuICAgICAgICAgICAgICAgIGlmIChsYXN0dGltZSA8IDYwKSB7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZygn6L+H5pyf5pu05pawJylcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaW5lID0gdXJsLnNwbGl0KCcvbWVkaWEnKVswXTsgLy/lj5bkuYvliY3mkq3mlL7nmoR0c+autee6v+i3r1xcbiAgICAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmUuc3Vic3RyaW5nKGxpbmUubGFzdEluZGV4T2YoJy8nKSArIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGYgPSBnZXR1cmwoZmlkLCBsaW5lKS5zcGxpdChcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGYuZm9yRWFjaChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0ICYmIGl0LnN0YXJ0c1dpdGgoJy9wcm94eT91cmw9JykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZ1cmwgPSBiYXNlNjREZWNvZGUoaXQucmVwbGFjZSgnL3Byb3h5P3VybD0nLCAnJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLnN1YnN0cih1cmwuaW5kZXhPZignL21lZGlhLScpLCB1cmwuaW5kZXhPZignLnRzJykpID09IGZ1cmwuc3Vic3RyKGZ1cmwuaW5kZXhPZignL21lZGlhLScpLCBmdXJsLmluZGV4T2YoJy50cycpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gZnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZygn5pyq6L+H5pyfJylcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKFxcXCLku6PnkIZ0c++8mlxcXCIgKyB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXNDb2RlOiAzMDIsXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkxvY2F0aW9uXFxcIjogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgLy9sb2coJ+mmluasoeabtOaWsCcpXFxuICAgICAgICAgICAgICAgIGxldCBsaW5lID0gdXJsLnNwbGl0KCd8JylbMV07XFxuICAgICAgICAgICAgICAgIGxldCBmZiA9IGdldHVybChmaWxlX2lkLCBsaW5lKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZmO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIGFsaVNoYXJlUGxheVVybCwgZmlsZV9pZCwgc2hhcmVfaWQsIGFsaXRva2VuKSk7XFxuXFxuICAgICAgICBsZXQgcGxheVVybExpc3QgPSBhbGlTaGFyZVBsYXlVcmwoc2hhcmVfaWQsIGZpbGVfaWQsIGFsaXRva2VuKSB8fCBbXTtcXG5cXG4gICAgICAgIGlmIChwbGF5VXJsTGlzdC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgcGxheVVybExpc3QuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICB1cmxzLnB1c2godSArIFxcXCI/dXJsPVxcXCIgKyBiYXNlNjRFbmNvZGUoaXRlbS51cmwgKyBcXFwifFxcXCIgKyBpdGVtLnRlbXBsYXRlX2lkKSArIFxcXCIjLm0zdThcXFwiKTtcXG4gICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0cmFuc2NvZGluZ1tpdGVtLnRlbXBsYXRlX2lkXSA/IHRyYW5zY29kaW5nW2l0ZW0udGVtcGxhdGVfaWRdIDogaXRlbS50ZW1wbGF0ZV9oZWlnaHQpO1xcbiAgICAgICAgICAgICAgICBoZWFkcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHZhciBtdWx0ID0ge1xcbiAgICAgICAgICAgICAgICB1cmxzOiB1cmxzLFxcbiAgICAgICAgICAgICAgICBuYW1lczogbmFtZXMsXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRzXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZiAoemltdS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gemltdSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHppbXV0ID0gemltdVtpXS50aXQ7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZm5hbWUuaW5jbHVkZXMoemltdXQpIHx8IHppbXV0LmluY2x1ZGVzKGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZignLicpKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdWx0WydzdWJ0aXRsZSddID0gZ2V0c3ViKHppbXVbaV0uZmlkLCB6aW11W2ldLmV4dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgcmV0dXJuIG11bHQ7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGxvZygn5pyq6I635Y+W6Zi/6YeM5pKt5pS+5Zyw5Z2A77yM5bu66K6u6YeN6L+b6L2v5Lu25YaN6K+V5LiA5qyhJylcXG4gICAgICAgICAgICByZXR1cm4ge307XFxuICAgICAgICB9XFxuICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIGxvZygn6I635Y+W5YWx5Lqr6ZO+5o6l5pKt5pS+5Zyw5Z2A5aSx6LSlPicgKyBlLm1lc3NhZ2UpO1xcbiAgICAgICAgcmV0dXJuIHt9O1xcbiAgICB9XFxufVxcblxcbmlmIChjYXRlID09ICd2aWRlbycpIHtcXG4gICAgLy9sb2cocmVhY2Nlc3NUayk7IFxcbiAgICBpZiAoZ2V0SXRlbSgncXVhbGl0eScsICcnKSA9PSAnMScpIHtcXG4gICAgICAgIC8v5Y6f55S7XFxuICAgICAgICAvL2FjY2Vzc1RrKCk7XFxuXFxuICAgICAgICBmdW5jdGlvbiBvYXV0aFJlZGlyZWN0KGNvZGUpIHtcXG4gICAgICAgICAgICAvL2xvZyhjb2RlKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ29yZWQnLCAnMScpICE9ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9hcGkubm4uY2kvYWxpc3QvYWxpX29wZW4vY29kZScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb2RlXFxcIjogY29kZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImdyYW50X3R5cGVcXFwiOiBcXFwiYXV0aG9yaXphdGlvbl9jb2RlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfojrflj5ZSZWZyZXNoVG9rZW5PcGVuJyk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoanNvbi5pbmNsdWRlcygnVG9vIE1hbnkgUmVxdWVzdHMnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdvcmVkJywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6K+35rGC5aSq6aKR57mB77yM6KKr5bCB6ZmQ5Yi25LqGJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coJ+ivt+axguWkqumikee5ge+8jOiiq+WwgUlQ5LqGJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignb3JlZCcsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEpTT04ucGFyc2UoanNvbikucmVmcmVzaF90b2tlbikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2V0UmVmcmVzaFRva2VuT3BlbiA9IEpTT04ucGFyc2UoanNvbikucmVmcmVzaF90b2tlbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgT3BlblRva2VuLlJlZnJlc2hUb2tlbk9wZW4gPSBnZXRSZWZyZXNoVG9rZW5PcGVuO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2V0QWNjZXNzVG9rZW5PcGVuID0gSlNPTi5wYXJzZShqc29uKS50b2tlbl90eXBlICsgJyAnICsgSlNPTi5wYXJzZShqc29uKS5hY2Nlc3NfdG9rZW47XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9wZW5Ub2tlbi5BY2Nlc3NUb2tlbk9wZW4gPSBnZXRBY2Nlc3NUb2tlbk9wZW47XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9pY3kvaWN5LWFsaS1PcGVuVG9rZW4uanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KE9wZW5Ub2tlbikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncmVkaXJlY3QnLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICB9O1xcblxcbiAgICAgICAgZnVuY3Rpb24gb2F1dGhSZXF1ZXN0KCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0gZmV0Y2goJ2h0dHBzOi8vb3Blbi5hbGl5dW5kcml2ZS5jb20vb2F1dGgvdXNlcnMvYXV0aG9yaXplP2NsaWVudF9pZD0nICsgJzc2OTE3Y2NjY2Q0NDQxYzM5NDU3YTA0ZjYwODRmYjJmJyArICcmcmVkaXJlY3RfdXJpPWh0dHBzOi8vYWxpc3Qubm4uY2kvdG9vbC9hbGl5dW5kcml2ZS9jYWxsYmFjayZzY29wZT11c2VyOmJhc2UsZmlsZTphbGw6cmVhZCxmaWxlOmFsbDp3cml0ZSZzdGF0ZT0nLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aG9yaXphdGlvbic6IHJlYWNjZXNzVGssIC8vZ2V0QWNjZXNzVG9rZW5cXG4gICAgICAgICAgICAgICAgICAgICAgICAneC1jYW5hcnknOiAnY2xpZW50PXdlYixhcHA9c2hhcmUsdmVyc2lvbj12Mi4zLjEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4LXNoYXJlLXRva2VuJzogc2hhcmV0b2tlblxcblxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiYXV0aG9yaXplXFxcIjogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2NvcGVcXFwiOiBcXFwidXNlcjpiYXNlLGZpbGU6YWxsOnJlYWQsZmlsZTphbGw6d3JpdGVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKCdvYXV0aHJlcVxcXFxuJyArIGpzb24pO1xcbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IEpTT04ucGFyc2UoanNvbikucmVkaXJlY3RVcmkuc3BsaXQoXFxcImNvZGU9XFxcIilbMV07XFxuICAgICAgICAgICAgICAgIC8vbG9nKGNvZGUpO1xcbiAgICAgICAgICAgICAgICBvYXV0aFJlZGlyZWN0KGNvZGUpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgcmVhY2Nlc3NUayA9ICcnO1xcbiAgICAgICAgICAgICAgICBhY2Nlc3NUaygpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH07XFxuXFxuICAgICAgICBmdW5jdGlvbiByZWZyZXNoT3BlblRva2VuKCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcigncm90JywgJzEnKSAhPSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0gZmV0Y2goJ2h0dHBzOi8vYXBpLm5uLmNpL2FsaXN0L2FsaV9vcGVuL3Rva2VuJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYW50X3R5cGUnOiAncmVmcmVzaF90b2tlbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyZWZyZXNoX3Rva2VuJzogT3BlblRva2VuLlJlZnJlc2hUb2tlbk9wZW5cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIGxvZygn6I635Y+WQWNjZXNzVG9rZW5PcGVuJyk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoanNvbi5pbmNsdWRlcygnVG9vIE1hbnkgUmVxdWVzdHMnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdyb3QnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfor7fmsYLlpKrpopHnuYHvvIzooqvlsIHpmZDliLbkuoYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygn6K+35rGC5aSq6aKR57mB77yM6KKr5bCBSVDkuoYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJyc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdyb3QnLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChKU09OLnBhcnNlKGpzb24pLnJlZnJlc2hfdG9rZW4pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdldFJlZnJlc2hUb2tlbk9wZW4gPSBKU09OLnBhcnNlKGpzb24pLnJlZnJlc2hfdG9rZW47XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9wZW5Ub2tlbi5SZWZyZXNoVG9rZW5PcGVuID0gZ2V0UmVmcmVzaFRva2VuT3BlbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdldEFjY2Vzc1Rva2VuT3BlbiA9IEpTT04ucGFyc2UoanNvbikudG9rZW5fdHlwZSArICcgJyArIEpTT04ucGFyc2UoanNvbikuYWNjZXNzX3Rva2VuO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcGVuVG9rZW4uQWNjZXNzVG9rZW5PcGVuID0gZ2V0QWNjZXNzVG9rZW5PcGVuO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktT3BlblRva2VuLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShPcGVuVG9rZW4pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgfTtcXG5cXG4gICAgICAgIGZ1bmN0aW9uIGNvcHkoZmlsZUlkKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9hcGkuYWxpeXVuZHJpdmUuY29tL2Fkcml2ZS92Mi9iYXRjaCcsIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRob3JpemF0aW9uJzogcmVhY2Nlc3NUayxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2dldEFjY2Vzc1Rva2VuXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3gtY2FuYXJ5JzogJ2NsaWVudD13ZWIsYXBwPXNoYXJlLHZlcnNpb249djIuMy4xJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAneC1zaGFyZS10b2tlbic6IHNoYXJldG9rZW5cXG5cXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlcXVlc3RzXFxcIjogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImJvZHlcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZmlsZV9pZFxcXCI6IGZpbGVJZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzaGFyZV9pZFxcXCI6IHNoYXJlSWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiYXV0b19yZW5hbWVcXFwiOiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRvX3BhcmVudF9maWxlX2lkXFxcIjogXFxcInJvb3RcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRvX2RyaXZlX2lkXFxcIjogZGVmZHJpdmVpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaGVhZGVyc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb250ZW50LVR5cGVcXFwiOiBcXFwiYXBwbGljYXRpb24vanNvblxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlkXFxcIjogXFxcIjBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIlBPU1RcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogXFxcIi9maWxlL2NvcHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlc291cmNlXFxcIjogXFxcImZpbGVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKCdjb3B5XFxcXG4nICsganNvbik7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGpzb24pLnJlc3BvbnNlc1swXS5ib2R5LmZpbGVfaWQ7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfTtcXG5cXG4gICAgICAgIGZ1bmN0aW9uIG9wZW4oZmlsZUlkKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IGpzb24gPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgbGV0IG51bWJlciA9IDA7XFxuICAgICAgICAgICAgICAgIGRvIHtcXG4gICAgICAgICAgICAgICAgICAgIGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9vcGVuLmFsaXl1bmRyaXZlLmNvbS9hZHJpdmUvdjEuMC9vcGVuRmlsZS9nZXREb3dubG9hZFVybCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYXV0aG9yaXphdGlvbic6IE9wZW5Ub2tlbi5BY2Nlc3NUb2tlbk9wZW5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9nZXRBY2Nlc3NUb2tlbk9wZW5cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGVfaWQnOiBmaWxlSWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdkcml2ZV9pZCc6IGRlZmRyaXZlaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKCdvcGVuXFxcXG4nICsganNvbik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoanNvbi5pbmNsdWRlcygnXFxcInVybFxcXCI6XFxcImh0dHAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24uaW5jbHVkZXMoXFxcIlRvb01hbnlSZXF1ZXN0c1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9kZWxldGVlKGZpbGVJZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoJ1RvbyBNYW55IFJlcXVlc3RzJyk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ3JlZGlyZWN0JywgJzAnKSA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBvYXV0aFJlcXVlc3QoKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaE9wZW5Ub2tlbigpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbnVtYmVyKytcXG4gICAgICAgICAgICAgICAgfSB3aGlsZSAobnVtYmVyIDwgMik7XFxuICAgICAgICAgICAgICAgIC8vZGVsZXRlZShmaWxlSWQpO1xcbiAgICAgICAgICAgICAgICBpZiAoanNvbi5pbmNsdWRlcygnaHR0cCcpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShqc29uKS51cmwgKyAnI2lzVmlkZW89dHJ1ZSM7e1JlZmVyZXJAaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL30nO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKGpzb24pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9O1xcblxcbiAgICAgICAgZnVuY3Rpb24gZGVsZXRlZShmaWxlSWQpIHtcXG5cXG4gICAgICAgICAgICBmZXRjaCgnaHR0cHM6Ly9hcGkuYWxpeXVuZHJpdmUuY29tL2Fkcml2ZS92Mi9iYXRjaCcsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcbiAgICAgICAgICAgICAgICAgICAgJ2F1dGhvcml6YXRpb24nOiByZWFjY2Vzc1RrLFxcbiAgICAgICAgICAgICAgICAgICAgJ3gtY2FuYXJ5JzogJ2NsaWVudD13ZWIsYXBwPXNoYXJlLHZlcnNpb249djIuMy4xJyxcXG4gICAgICAgICAgICAgICAgICAgICd4LXNoYXJlLXRva2VuJzogc2hhcmV0b2tlblxcblxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicmVxdWVzdHNcXFwiOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJib2R5XFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZHJpdmVfaWRcXFwiOiBkZWZkcml2ZWlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZmlsZV9pZFxcXCI6IGZpbGVJZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb250ZW50LVR5cGVcXFwiOiBcXFwiYXBwbGljYXRpb24vanNvblxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpZFxcXCI6IGZpbGVJZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIlBPU1RcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBcXFwiL2ZpbGUvZGVsZXRlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgICAgICBcXFwicmVzb3VyY2VcXFwiOiBcXFwiZmlsZVxcXCJcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAvL2xvZygn5Yig6ZmkICcgKyBkZWwpO1xcbiAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgZmV0Y2goJ2h0dHBzOi8vb3Blbi5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YxLjAvb3BlbkZpbGUvZGVsZXRlJywge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcbiAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLycsXFxuICAgICAgICAgICAgICAgICAgICAnYXV0aG9yaXphdGlvbic6IGdldEl0ZW0oJ2dldEFjY2Vzc1Rva2VuT3BlbicsICcnKSxcXG4gICAgICAgICAgICAgICAgICAgICd4LXNoYXJlLXRva2VuJzogc2hhcmV0b2tlblxcblxcblxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiZHJpdmVfaWRcXFwiOiBkZWZkcml2ZWlkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImZpbGVfaWRcXFwiOiBmaWxlSWRcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAqL1xcbiAgICAgICAgICAgIC8vbG9nKCdkZWxlXFxcXG4nICsganNvbik7XFxuICAgICAgICB9O1xcblxcbiAgICAgICAgLy/lpITnkIbop4bpopEgIFxcbiAgICAgICAgdmFyIGRzaWQgPSBzaGFyZUlkO1xcbiAgICAgICAgdmFyIGRmaWQgPSBpbnB1dDtcXG5cXG4gICAgICAgIGxldCBmaWxlSWQgPSBjb3B5KGRmaWQpO1xcbiAgICAgICAgdmFyIHBsYXkgPSBvcGVuKGZpbGVJZCk7XFxuICAgICAgICBpZiAoZmlsZUlkLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICBkZWxldGVlKGZpbGVJZCk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoemltdS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB6aW11KSB7XFxuICAgICAgICAgICAgICAgIHZhciB6aW11dCA9IHppbXVbaV0udGl0O1xcbiAgICAgICAgICAgICAgICBpZiAoZm5hbWUuaW5jbHVkZXMoemltdXQpIHx8IHppbXV0LmluY2x1ZGVzKGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZignLicpKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHBsYXkgPSBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3BsYXkuc3BsaXQoJzt7JylbMF1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IGdldHN1Yih6aW11W2ldLmZpZCwgemltdVtpXS5leHQpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICAvL+aZrueUuyAgXFxuICAgICAgICB2YXIgZHNpZCA9IHNoYXJlSWQ7XFxuICAgICAgICB2YXIgZGZpZCA9IGlucHV0O1xcblxcbiAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xcbiAgICAgICAgICAgIHZhciBwbGF5ID0gSlNPTi5zdHJpbmdpZnkoZ2V0QWxpVXJsKFxcbiAgICAgICAgICAgICAgICBzaGFyZUlkLFxcbiAgICAgICAgICAgICAgICBpbnB1dCxcXG4gICAgICAgICAgICAgICAgcmVmdG9rZW5cXG4gICAgICAgICAgICApKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbn0gZWxzZSBpZiAoY2F0ZSA9PSAnaW1hZ2UnKSB7XFxuICAgIC8v5aSE55CG5paH5qGjXFxuICAgIC8vYWNjZXNzVGsoKTtcXG5cXG4gICAgdmFyIGpzb24gP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gICB2YXIgdG9rZW4gPSBKU09OLnBhcnNlKGxvY2FsU3RvcmFnZS5nZXRJdGVtKCd0b2tlbicpKVxcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4gJiYgdG9rZW4udXNlcl9pZCkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFsaXN0ZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2ljeS9pY3ktYWxpLXRva2VuLmpzb25cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbnRva2VuWzBdID0gdG9rZW47XFxuICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLndyaXRlRmlsZShhbGlzdGZpbGUsIEpTT04uc3RyaW5naWZ5KG50b2tlbikpO1xcbiAgICAgICAgICAgICAgICAgICAgbG9jYWxTdG9yYWdlLmNsZWFyKCk7XFxuICAgICAgICAgICAgICAgICAgICBhbGVydCgnVE9LRU7ojrflj5bmiJDlip/vvIzov5Tlm57lkI7liLfmlrDpobXpnaLvvIEnKTtcXG4gICAgICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAucGFyc2VMYXp5UnVsZShgaGlrZXI6Ly9lbXB0eUBsYXp5UnVsZT0uanM6cmVmcmVzaFg1V2ViVmlldygnJyk7YCk7XFxuICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLmJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHRva2VuX3RpbWVyKCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIHRva2VuX3RpbWVyID0gZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQodG9rZW5GdW5jdGlvbiwgNTAwKVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgdG9rZW5GdW5jdGlvbigpO1xcbiAgIC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lNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy9pY3kvaWN5LWFsaS10b2tlbi5qc29uJywge30pKTtcXG4gICAgICAgIGlmIChudG9rZW5bMF0ucmVmcmVzaF90b2tlbikge1xcbiAgICAgICAgICAgIHJlZnRva2VuID0gbnRva2VuWzBdLnJlZnJlc2hfdG9rZW47XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRvYXN0KCfnlKjmiLfkv6Hmga/ojrflj5blpLHotKXvvIzor7fnmbvlhaXotKblj7fjgIInKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBpZiAocmVmdG9rZW4ubGVuZ3RoID09IDMyKSB7XFxuICAgICAgICB2YXIgcmVmcmVzaCA9IGZldGNoKCdodHRwczovL2F1dGguYWxpeXVuZHJpdmUuY29tL3YyL2FjY291bnQvdG9rZW4nLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxcbiAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcbiAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogJ3tcXFwicmVmcmVzaF90b2tlblxcXCI6XFxcIicgKyByZWZ0b2tlbiArICdcXFwiLFxcXCJncmFudF90eXBlXFxcIjpcXFwicmVmcmVzaF90b2tlblxcXCJ9JyxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBudG9rZW5bMF0gPSBKU09OLnBhcnNlKHJlZnJlc2gpO1xcbiAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2ljeS9pY3ktYWxpLXRva2VuLmpzb25cXFwiLCBKU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bGVzID0gW3tcXFxcbiAgICAgICAgbmFtZTogXFxcXFxcXCLkupHnm5jotYTmupBcXFxcXFxcIixcXFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgbGV0IHVybCA9IFxcXFxcXFwiaHR0cHM6Ly9yZXMueXVucGFuLndpbi8/UGFnZUluZGV4PVxcXFxcXFwiICsgcGFnZSArIFxcXFxcXFwiJlBhZ2VTaXplPTEyJktleXdvcmQ9XFxcXFxcXCIgKyBzICsgXFxcXFxcXCImVHlwZT0mVGFnPVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJSZWZlcmVyXFxcXFxcXCI6IFxcXFxcXFwiaHR0cHM6Ly9yZXMueXVucGFuLndpbi9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGRmYShodG1sLCBcXFxcXFxcIm1haW4mJi5jYXJkXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXFxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsIFxcXFxcXFwiLmNhcmQtbGluaywxJiZvbmNsaWNrXFxcXFxcXCIpLm1hdGNoKC9odHRwczpcXFxcXFxcXC9cXFxcXFxcXC8od3d3XFxcXFxcXFwuYWxpeXVuZHJpdmVcXFxcXFxcXC5jb21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VDkupHmkJxcXFxcXFxcIixcXFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgbGV0IHVybCA9IFxcXFxcXFwiaHR0cHM6Ly9hcGkudXB5dW5zbzIuY29tL3NlYXJjaD9rZXl3b3JkPVxcXFxcXFwiICsgcyArIFxcXFxcXFwiJnBhZ2U9XFxcXFxcXCIgKyBwYWdlICsgXFxcXFxcXCImc190eXBlPTFcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCh1cmwsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiUmVmZXJlclxcXFxcXFwiOiBcXFxcXFxcImh0dHBzOi8vd3d3LnVweXVuc28uY29tXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29va2llXFxcXFxcXCI6IFxcXFxcXFwiY29kZT0xOTE5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIC8vbG9nKGJhc2U2NERlY29kZShodG1sKSk7XFxcXG4gICAgICAgICAgICBsZXQgYXJyID0gSlNPTi5wYXJzZShiYXNlNjREZWNvZGUoaHRtbCkpLnJlc3VsdC5pdGVtcztcXFxcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBpdC5wYWdlX3VybDtcXFxcbiAgICAgICAgICAgICAgICAvL3UgPSB1Lmxlbmd0aCA+IDAgPyB1WzBdIDogdXJsO1xcXFxuICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFxcXFxcImFsaXl1bmRyaXZlXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+VVDkupHmkJw8L2ZvbnQ+Jm5ic3A7XFxcXFxcXCIgKyBcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiICsgKHUpLFxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gZDtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0sIHtcXFxcbiAgICAgICAgbmFtZTogXFxcXFxcXCLnjKvni7jnm5jmkJxcXFxcXFxcIixcXFxcbiAgICAgICAgcGFnZTogZmFsc2UsXFxcXG4gICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXFxcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChcXFxcXFxcImh0dHBzOi8vd3d3LmFsaXBhbnNvdS5jb20vc2VhcmNoP2s9XFxcXFxcXCIgKyBzLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlJlZmVyZXJcXFxcXFxcIjogXFxcXFxcXCJodHRwczovL3d3dy5hbGlwYW5zb3UuY29tL3NlYXJjaD9rPVxcXFxcXFwiICsgc1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcXFxcXCIjYXBwJiZhXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXFxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IFxcXFxcXFwiPGRpdj5cXFxcXFxcIiArIGFycltpXSArIFxcXFxcXFwiPC9kaXY+XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBwZGZoKGl0LCBcXFxcXFxcImEmJmhyZWZcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgLy9sb2codSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCF1LmluY2x1ZGVzKFxcXFxcXFwiL3MvXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJodHRwczovL3d3dy5hbGlwYW5zb3UuY29tXFxcXFxcXCIgKyB1LnJlcGxhY2UoXFxcXFxcXCIvcy9cXFxcXFxcIiwgXFxcXFxcXCIvY3YvXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0LCBcXFxcXFxcInRlbXBsYXRlJiZUZXh0XFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQodSkubGF6eVJ1bGUoKHdyYXB1KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoaW5wdXQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29va2llXFxcXFxcXCI6IFxcXFxcXFwibm9fc2hvd19kb25hdGU9MVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlJlZmVyZXJcXFxcXFxcIjogaW5wdXQucmVwbGFjZShcXFxcXFxcIi9jdi9cXFxcXFxcIiwgXFxcXFxcXCIvcy9cXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBodG1sID0gcGFyc2VEb21Gb3JIdG1sKGh0bWwsICdhJiZocmVmJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBfbGlua3MgPSBodG1sLm1hdGNoKC9odHRwczpcXFxcXFxcXC9cXFxcXFxcXC8od3d3XFxcXFxcXFwuYWxpeXVuZHJpdmVcXFxcXFxcXC5jb21cXFxcXFxcXC9zfGFseXdwXFxcXFxcXFwubmV0KVxcXFxcXFxcL1xcXFxcXFxcdyovZykgfHwgW107XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhfbGlua3MpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGh0bWwubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgX2xpbmtzWzBdICsgJz8/ZnlwYWdlJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoaHRtbCkgKyAnPz8/ZnlwYWdlJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd3JhcHUoaHRtbCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpbnB1dDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgd3JhcHUpLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPueMq+eLuOebmOaQnDwvZm9udD4mbmJzcDtcXFxcXFxcIiArIHBkZmgoaXQsIFxcXFxcXFwidGVtcGxhdGUsMSYmVGV4dFxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBkO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSwge1xcXFxuICAgICAgICBuYW1lOiBcXFxcXFxcIuaYk+aQnFxcXFxcXFwiLFxcXFxuICAgICAgICBwYWdlOiB0cnVlLFxcXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgICAgICBldmFsKGdldENyeXB0b0pTKCkpO1xcXFxuXFxcXG4gICAgICAgICAgICBmdW5jdG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XFwiICsgcyxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJDb29raWVcXFxcXFxcIjogZ2V0SXRlbSgneWlzb3Vjb29rZScsICcnKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxcXG4gICAgICAgICAgICBpZiAoaHRtbC5pbmNsdWRlcygn55m75b2V55So5oi35peg6ZmQ5Yi2JykpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgaSA9IDA7XFxcXG4gICAgICAgICAgICAgICAgZG8ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdHlpbWdsaW4gPSAnaHR0cHM6Ly95aXNvLmZ1bi9hcGkvdXNlci9sb2dpbi9jYXB0Y2hhP3Q9JyArIHBhcnNlSW50KG5ldyBEYXRlKCkuZ2V0VGltZSgpKSArICcnO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaW1nID0gY29udmVydEJhc2U2NEltYWdlKHR5aW1nbGluKS5zcGxpdCgnLCcpWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29kID0gcmVxdWVzdCgnaHR0cHM6Ly9hcGkubm4uY2kvb2NyL2I2NC90ZXh0Jywge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAndGV4dC9wbGFpbidcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBpbWcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZlciA9IEpTT04ucGFyc2UocmVxdWVzdCgnaHR0cHM6Ly95aXNvLmZ1bi9hcGkvdXNlci9sb2dpbicsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyZWZlcmVyJzogJ2h0dHBzOi8veWlzby5mdW4vbG9naW4nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdDb29raWUnOiBnZXRDb29raWUodHlpbWdsaW4pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidXNlck5hbWVcXFxcXFxcIjogXFxcXFxcXCJ0dmJveDIwMjNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IFxcXFxcXFwiVHZib3gyMDIzXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJjb2RlXFxcXFxcXCI6IGNvZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZlci5jb2RlID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfmmJPmkJznmbvlhaXpqozor4HmiJDlip8nKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3lpc291Y29va2UnLCBnZXRDb29raWUoJ2h0dHBzOi8veWlzby5mdW4nKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBodG1sID0gcmVxdWVzdChcXFxcXFxcImh0dHBzOi8veWlzby5mdW4vYXBpL3NlYXJjaD9uYW1lPVxcXFxcXFwiICsgcyArIFxcXFxcXFwiJnBhZ2VObz1cXFxcXFxcIiArIHBhZ2UsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiUmVmZXJlclxcXFxcXFwiOiBcXFxcXFxcImh0dHBzOi8veWlzby5mdW4vaW5mbz9zZWFyY2hLZXk9XFxcXFxcXCIgKyBzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIkNvb2tpZVxcXFxcXFwiOiBnZXRJdGVtKCd5aXNvdWNvb2tlJywgJycpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBpKys7XFxcXG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoaSA8IDQpO1xcXFxuXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBsZXQgYXJyID0gSlNPTi5wYXJzZShodG1sKS5kYXRhLmxpc3Q7XFxcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcXFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1ID0ga2V5ZW4oaXQudXJsKTtcXFxcbiAgICAgICAgICAgICAgICAvL2xvZyh1KTtcXFxcbiAgICAgICAgICAgICAgICBpZiAodSA9PSBudWxsIHx8ICF1LmluY2x1ZGVzKFxcXFxcXFwiYWxpeXVuXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ1cXFxcXFxcIiArIGl0Lm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5piT5pCcPC9mb250PiZuYnNwO1xcXFxcXFwiICsgKGl0LmdtdFNoYXJlIHx8IGl0LmdtdENyZWF0ZSkgKyBcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiICsgKHUpLFxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gZDtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0sIHtcXFxcbiAgICAgICAgbmFtZTogXFxcXFxcXCLmib7otYTmupBcXFxcXFxcIixcXFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0aHRtbCgpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoXFxcXFxcXCJodHRwczovL3poYW96aXl1YW4ubGEvc28/ZmlsZW5hbWU9XFxcXFxcXCIgKyBzICsgXFxcXFxcXCImcGFnZT1cXFxcXFxcIiArIHBhZ2UsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJSZWZlcmVyXFxcXFxcXCI6IFxcXFxcXFwiaHR0cHM6Ly96aGFveml5dWFuLmxhL3N0b3AuaHRtbFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJvcmlnaW5cXFxcXFxcIjogXFxcXFxcXCJodHRwczovL3poYW96aXl1YW4ubGFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29va2llXFxcXFxcXCI6IGdldEl0ZW0oXFxcXFxcXCJ6enljb29rZVxcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidXBncmFkZS1pbnNlY3VyZS1yZXF1ZXN0c1xcXFxcXFwiOiBcXFxcXFxcIjFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiY29udGVudC10eXBlXFxcXFxcXCI6IFxcXFxcXFwiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBodG1sO1xcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIHZhciBodG1sID0gZ2V0aHRtbCgpO1xcXFxuICAgICAgICAgICAgaWYgKCFodG1sLmluY2x1ZGVzKFxcXFxcXFwic2VhcmNoX2JveFxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgIGxldCB1c2VyID0gJ2RYTmxjbTVoYldVOWVYQnFNakF5TXlad1lYTnpkMjl5WkQxNWNHb3lNREl6JztcXFxcbiAgICAgICAgICAgICAgICBsZXQgY29vayA9IEpTT04ucGFyc2UoZmV0Y2hDb29raWUoJ2h0dHBzOi8vemhhb3ppeXVhbi5sYS9sb2dpdS5odG1sJywge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IE1PQklMRV9VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmlnaW4nOiAnaHR0cHM6Ly96aGFveml5dWFuLmxhJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vemhhb3ppeXVhbi5sYS9sb2dpbi5odG1sJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidXBncmFkZS1pbnNlY3VyZS1yZXF1ZXN0c1xcXFxcXFwiOiBcXFxcXFxcIjFcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBiYXNlNjREZWNvZGUodXNlciksXFxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxcXFxuICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXFxcbiAgICAgICAgICAgICAgICB9KSkuam9pbignOycpO1xcXFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcXFxcXCJ6enljb29rZVxcXFxcXFwiLCBjb29rKTtcXFxcbiAgICAgICAgICAgICAgICBsb2coXFxcXFxcXCLmib7otYTmupDnmbvlhaVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgaHRtbCA9IGdldGh0bWwoKTtcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcXFxcXCJib2R5JiYubmV3c0xpc3QmJmxpOm5vdCg6Zmlyc3QtY2hpbGQpXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXFxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsIFxcXFxcXFwiYSYmaHJlZlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAodSA9PSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJodHRwczovL3poYW96aXl1YW4ubGEvXFxcXFxcXCIgKyB1O1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKHUpO1xcXFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXQsIFxcXFxcXFwiLm5ld3NfdGV4dCYmaDMmJlRleHRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuaJvui1hOa6kDwvZm9udD4mbmJzcDtcXFxcXFxcIiArIChwZGZoKGl0LCBcXFxcXFxcIi5uZXdzX3RleHQmJnAmJlRleHRcXFxcXFxcIikpLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQodSkubGF6eVJ1bGUoKHdyYXB1KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9saW5rcyA9IGh0bWwubWF0Y2goL2h0dHBzOlxcXFxcXFxcL1xcXFxcXFxcLyh3d3dcXFxcXFxcXC5hbGl5dW5kcml2ZVxcXFxcXFxcLmNvbVxcXFxcXFxcL3N8YWx5d3BcXFxcXFxcXC5uZXQpXFxcXFxcXFwvXFxcXFxcXFx3Ki9nKSB8fCBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIF9saW5rc1swXSArICc/P2Z5cGFnZSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KF9saW5rc1swXSkgKyAnPz8/ZnlwYWdlJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd3JhcHUoX2xpbmtzWzBdKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlucHV0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwdSlcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBkO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSwge1xcXFxuICAgICAgICBuYW1lOiBcXFxcXFxcIuWwj+e6uOadoVxcXFxcXFwiLFxcXFxuICAgICAgICBwYWdlOiBmYWxzZSxcXFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0dG9rZW4oKSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCd4enl0b2tlbicsICcnKS5sZW5ndGggPT0gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9rZW4gPSBKU09OLnBhcnNlKHBvc3QoJ2h0dHBzOi8vZ2l0Y2FmZS5uZXQvdG9vbC9hbGlwYXBlci8nLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly91LmdpdGNhZmUubmV0LydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiAnZ2V0X3Rva2VuJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3h6dHRva2VuJywgdG9rZW4pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0TXlWYXIoJ3h6dHRva2VuJywgJycpO1xcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICBmdW5jdGlvbiBjYXRf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cXFxcXCJ4c1xcXFxcXFwiLCBcXFxcXFxcImNic1xcXFxcXFwiLCBcXFxcXFxcInpzcHhcXFxcXFxcIiwgXFxcXFxcXCJxdHdkXFxcXFxcXCIsIFxcXFxcXFwiYnpcXFxcXFxcIiwgXFxcXFxcXCJyd1xcXFxcXFwiLCBcXFxcXFxcImZqXFxcXFxcXCIsIFxcXFxcXFwicXR0cFxcXFxcXFwiLCBcXFxcXFxcInF0XFxcXFxcXCJdO1xcXFxuICAgICAgICAgICAgICAgIGZvciAoZCA9IDAsIGUgPSBjLmxlbmd0aDsgZSA+IGQ7IGQrKylcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNbZF0gPT0gYSkgcmV0dXJuIGJbZF07XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgbGV0IGh0bWwgPSBwb3N0KFxcXFxcXFwiaHR0cHM6Ly9naXRjYWZlLm5ldC90b29sL2FsaXBhcGVyL1xcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3UuZ2l0Y2FmZS5uZXQvJ1xcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICBhY3Rpb246IFxcXFxcXFwic2VhcmNoXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGZyb206IFxcXFxcXFwid2ViXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHRva2VuOiBnZXR0b2tlbigpLFxcXFxuICAgICAgICAgICAgICAgICAgICBrZXl3b3JkOiBzXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIGxldCBsaXN0ID0gSlNPTi5wYXJzZShodG1sKTtcXFxcbiAgICAgICAgICAgIGlmIChsaXN0LmRhdGEpIHtcXFxcbiAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5kYXRhO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gbGlzdFtpXVxcXFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0LnRpdGxlO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1ID0gaXQuYWxpa2V5O1xcXFxuICAgICAgICAgICAgICAgIGlmICh1ID09IG51bGwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGxldCBtdXJsID0gJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycgKyB1O1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgaWYgKCFjaGVja2FsaShtdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKHRpdGxlLmluY2x1ZGVzKHMpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLiiJogXFxcXFxcXCIgKyB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5bCP57q45p2hPC9mb250PiZuYnNwO1xcXFxcXFwiICsgY2F0X2NvZGUoaXQuY2F0KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzOiBpdC5kZXNcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPWh0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycgKyBtdXJsICsgJz8/ZnlwYWdlJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUobXVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycgKyBtdXJsKSArICc/Pz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBkO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSwge1xcXFxuICAgICAgICBuYW1lOiBcXFxcXFxcIueOqeWBtuWTpeWTpVxcXFxcXFwiLFxcXFxuICAgICAgICBwYWdlOiB0cnVlLFxcXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcXFxcXCJodHRwOi8vd29nZy54eXovaW5kZXgucGhwL3ZvZHNlYXJjaC9cXFxcXFxcIiArIHMgKyBcXFxcXFxcIi0tLS0tLS0tLS1cXFxcXFxcIiArIHBhZ2UgKyBcXFxcXFxcIi0tLS5odG1sXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QodXJsLCB7fSk7XFxcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLm1vZHVsZS1pdGVtcyYmLm1vZHVsZS1zZWFyY2gtaXRlbScpO1xcXFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXFxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBsZXQgYmV0ID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXRpdGxlID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnaDMmJmEmJlRleHQnKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXNlcmlhbCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy52aWRlby1zZXJpYWwmJlRleHQnKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdWltYWdlID0gcGFyc2VEb20oaXQsICcubGF6eWxvYWQmJmRhdGEtc3JjJywgJ2h0dHA6Ly93b2dnLnh5ei8nKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tKGl0LCAnaDMmJmEmJmhyZWYnLCAnaHR0cDovL3dvZ2cueHl6LycpO1xcXFxuICAgICAgICAgICAgICAgIC8vbGV0IGRldCA9IHJlcXVlc3QodSwge30pO1xcXFxuICAgICAgICAgICAgICAgIGJldC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHV0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcXFxuICAgICAgICAgICAgICAgICAgICBpbWFnZTogdWltYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiB1c2VyaWFsXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAoYmV0Lmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgYmV0aCA9IGJhdGNoRmV0Y2goYmV0KTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJldGgubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGJldGhbaV0sICcubW9kdWxlLXBsYXllci1saXN0JiZwJylcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAncCYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF1LmluY2x1ZGVzKFxcXFxcXFwiL3MvXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBiZXRbaV0udGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogYmV0W2ldLmltYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQodSkgKyAnPz8/ZnlwYWdlJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KHUpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+546p5YG25ZOl5ZOlPC9mb250PiZuYnNwO1xcXFxcXFwiICsgKGJldFtpXS5kZXNjKSArICdcXFxcXFxcXG4nICsgdSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gZDtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0sIHtcXFxcbiAgICAgICAgbmFtZTogXFxcXFxcXCLpmL/ph4zkupHnm5jnvZFcXFxcXFxcIixcXFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgbGV0IHVybCA9IFxcXFxcXFwiaHR0cHM6Ly93d3cuYWx5cHcuY24vc2VhcmNoLnBocD9xPVxcXFxcXFwiICsgcyArIFxcXFxcXFwiJnBhZ2U9XFxcXFxcXCIgKyBwYWdlO1xcXFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge30pO1xcXFxuICAgICAgICAgICAgbGV0IGFyciA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJy5saXN0JiZsaScpO1xcXFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXFxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBsZXQgYmV0ID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXRpdGxlID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnYSYmdGl0bGUnKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXNlcmlhbCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy5mYS1jbG9jay1vJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHVpbWFnZSA9IHBhcnNlRG9tKGl0LCAnaW1nJiZzcmMnLCAnaHR0cHM6Ly93d3cuYWx5cHcuY24vJyk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBwYXJzZURvbShpdCwgJ2EmJmhyZWYnLCAnaHR0cHM6Ly93d3cuYWx5cHcuY24vJyk7XFxcXG4gICAgICAgICAgICAgICAgLy9sZXQgZGV0ID0gcmVxdWVzdCh1LCB7fSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCF1dGl0bGUuaW5jbHVkZXMocykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGJldC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHV0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcXFxuICAgICAgICAgICAgICAgICAgICBpbWFnZTogdWltYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiB1c2VyaWFsXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAvL2xvZyhiZXQpO1xcXFxuICAgICAgICAgICAgaWYgKGJldC5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGJldGggPSBiYXRjaEZldGNoKGJldCk7XFxcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiZXRoLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShiZXRoW2ldLCAnYm9keSYmYVtocmVmXj1odHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy9dJylcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2cobGlzdCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgbGlzdC5sZW5ndGg7IGorKykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJmhyZWYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGJldFtpXS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBiZXRbaV0uaW1hZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7pmL/ph4zkupHnm5jnvZE8L2ZvbnQ+Jm5ic3A7XFxcXFxcXCIgKyAoYmV0W2ldLmRlc2MpICsgJ1xcXFxcXFxcbicgKyB1LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBkO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSxcXFxcbiAgICAvKuWkseaViCB7XFxcXG4gICAgICAgICAgICBuYW1lOiBcXFxcXFxcIuWcn+aLqOm8oFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgcGFnZTogZmFsc2UsXFxcXG4gICAgICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaCgnaHR0cHM6Ly93d3cudGJzZHkuY29tL3NlYXJjaC5odG1sP2tleXdvcmQ9JyArIHMgKyAnJmNhdGVnb3J5PTk4MzkyMCZkYXRhX3R5cGU9OTg3OTEwJywge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIGxldCBhcnIgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICcuc2VhcmNoX3Jlc3VsdF9uZXRkaXNrX2xpc3QmJmEnKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJ2EmJmhyZWYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy5uZXRkaXNrX2l0ZW1fZGV0YWlsX25hbWUmJlRleHQnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aXQuaW5jbHVkZXMocykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKHUpO1xcXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5Zyf5ouo6byg5pCcPC9mb250PiZuYnNwO1xcXFxcXFwiICsgXFxcXFxcXCJcXFxcXFxcXG5cXFxcXFxcIiArIHUsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZDtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSwqL1xcXFxuICAgIHtcXFxcbiAgICAgICAgbmFtZTogXFxcXFxcXCLpmL/ph4zmkJxcXFxcXFxcIixcXFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCgnaHR0cHM6Ly9hbGlzby5jYy9zLycgKyBzICsgJy0nICsgcGFnZSArICctMC5odG1sJywge30pO1xcXFxuXFxcXG4gICAgICAgICAgICBsZXQgbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJy5zZWFyY2gtcmVzdWx0JiYucmVzb3VyY2UtaXRlbScpO1xcXFxuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBsaXN0W2pdO1xcXFxuICAgICAgICAgICAgICAgIGxldCB0aXQgPSBwYXJzZURvbUZvckh0bWwodSwgJ2gzJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCF0aXQuaW5jbHVkZXMocykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXQsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwYXJzZURvbSh1LCAnaDMmJmEmJmhyZWYnLCAnaHR0cHM6Ly9hbGlzby5jYy8nKSkubGF6eVJ1bGUoKHdyYXB1KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGdldENyeXB0b0pTKCkpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBkZWNyeShzdHIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIga2V5ID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UoXFxcXFxcXCI5RUIyMERERkQ2QUZCRDY4XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbmNyeXB0ZWQgPSBDcnlwdG9KUy5BRVMuZGVjcnlwdChzdHIsIGtleSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdjoga2V5LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlOiBDcnlwdG9KUy5tb2RlLkNCQyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlbmNyeXB0ZWQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgYnV0ID0gcGFyc2VEb20oaHRtbCwgJy5idXR0b24mJmhyZWYnLCAnaHR0cHM6Ly9hbGlzby5jYy8nKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGJ1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ290ID0gcmVxdWVzdChidXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coZ290KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwocGFyc2VEb21Gb3JIdG1sKGdvdCwgJ2hlYWQmJnNjcmlwdCwxJiZIdG1sJykpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdyYXB1KGRlY3J5KGJhc2U2NC5zcGxpdCgnIScpWzBdKSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgd3JhcHUpLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPumYv+mHjOaQnDwvZm9udD4mbmJzcDtcXFxcXFxcIiArIHBhcnNlRG9tRm9ySHRtbCh1LCAnLnRpbWUmJlRleHQnKSxcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuIGQ7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuICAgIC8q5aSx5pWIe1xcXFxuICAgICAgICAgICBuYW1lOiBcXFxcXFxcIuWcn+eLl+aQnFxcXFxcXFwiLFxcXFxuICAgICAgICAgICBwYWdlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KCdodHRwczovL3d3dy50dWdvdXNvdS5jb20vc2VhcmNoJywge1xcXFxuICAgICAgICAgICAgICAgICAgIGJvZHk6ICdrZXl3b3JkPScgKyBzLFxcXFxuICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgbGV0IGFyciA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJy5sYXl1aS1jb250YWluZXIsMSYmLmxheXVpLXJvdzpoYXMoYSknKTtcXFxcbiAgICAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXFxcbiAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJ2EmJmhyZWYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICBpZiAoIXUuaW5jbHVkZXMoXFxcXFxcXCIvcy9cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgIC8vbG9nKHUpO1xcXFxuICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwoaXQsICdhJiZUZXh0JyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5Zyf54uX5pCcPC9mb250PiZuYnNwO1xcXFxcXFwiICsgcGFyc2VEb21Gb3JIdG1sKGl0LCAncCwtMSYmVGV4dCcpICsgXFxcXFxcXCJcXFxcXFxcXG5cXFxcXFxcIiArIHUsXFxcXG4gICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICByZXR1cm4gZDtcXFxcbiAgICAgICAgICAgfVxcXFxuICAgICAgIH0sICovXFxcXG4gICAge1xcXFxuICAgICAgICBuYW1lOiBcXFxcXFxcIuS6keebmOWIhuS6q+ekvlxcXFxcXFwiLFxcXFxuICAgICAgICBwYWdlOiBmYWxzZSxcXFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gZGVjcnkoc3RyKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXFxcXFwiNUY2QjJBSzMzREFTRDEyM1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZW5jcnlwdGVkID0gQ3J5cHRvSlMuQUVTLmRlY3J5cHQoc3RyLCBrZXksIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5FQ0IsXFxcXG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5Qa2NzN1xcXFxuICAgICAgICAgICAgICAgIH0pLnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZW5jcnlwdGVkO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KCdodHRwczovL3d3dy55dW5wYW5mZW54aWFuZy5jbi9hcGkvYmJzL2FwaS9nZXRkYXRhP2tleT0nICsgcyArICcmdHlwZT12aWRlbycsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiUmVmZXJlclxcXFxcXFwiOiBcXFxcXFxcImh0dHBzOi8vd3d3Lnl1bnBhbmZlbnhpYW5nLmNuL1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsZXQganNvbiA9IGRlY3J5KEpTT04ucGFyc2UoaHRtbCkuZGF0YSk7XFxcXG4gICAgICAgICAgICAvL2xvZyhqc29uKTtcXFxcbiAgICAgICAgICAgIGxldCBhcnIgPSBKU09OLnBhcnNlKGpzb24pOyAvL1swXS5yZXN1bHQuaXRlbXM7XFxcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcXFxuXFxcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgbGV0IGJldCA9IFtdO1xcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGl0LnBpZDtcXFxcbiAgICAgICAgICAgICAgICBiZXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vd3d3Lnl1bnBhbmZlbnhpYW5nLmNuL2FwaS9iYnMvYXBpL2dldGFydGljbGU/aWQ9JyArIHVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiUmVmZXJlclxcXFxcXFwiOiBcXFxcXFxcImh0dHBzOi8vd3d3Lnl1bnBhbmZlbnhpYW5nLmNuL1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIC8vbG9nKHUpO1xcXFxuICAgICAgICAgICAgbGV0IGJldGggPSBiYXRjaEZldGNoKGJldCk7XFxcXG5cXFxcbiAgICAgICAgICAgIC8vbG9nKGFydGljbGUpO1xcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiZXRoLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGpzb24gPSBKU09OLnBhcnNlKGJldGhbaV0pLmRhdGE7XFxcXG4gICAgICAgICAgICAgICAgLy9sb2coanNvbik7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBqc29uLmRvd25sb2FkLnNwbGl0KCdAJyk7XFxcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gbGlzdFtqXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBqc29uLnRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KCdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy8nICsgdSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuS6keebmOWIhuS6q+ekvjwvZm9udD4mbmJzcDtcXFxcXFxcIiArIChqc29uLmNyZWF0ZXRpbWUpICsgXFxcXFxcXCJcXFxcXFxcXG5cXFxcXFxcIiArICgnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvJyArIHUpLFxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAg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FxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge30pO1xcXFxuICAgICAgICAgICAgLy9sb2coYmFzZTY0RGVjb2RlKGh0bWwpKTtcXFxcbiAgICAgICAgICAgIGxldCBhcnIgPSBKU09OLnBhcnNlKGh0bWwpLmxpc3Q7XFxcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcXFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1ID0gaXQudm9kX2NvbnRlbnQ7XFxcXG4gICAgICAgICAgICAgICAgLy91ID0gdS5sZW5ndGggPiAwID8gdVswXSA6IHVybDtcXFxcbiAgICAgICAgICAgICAgICBpZiAoIXUuaW5jbHVkZXMoXFxcXFxcXCJhbGl5dW5kcml2ZVxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKCFjaGVja2FsaSh1KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4oiaIFxcXFxcXFwiICsgaXQudm9kX25hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnZvZF9waWMsXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDog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yID0gcGQoaXQsIFxcXFxcXFwiYSYmaHJlZlxcXFxcXFwiLCB1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhcXFxcXFxcIm5leHQgcGFnZVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2codTIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImJpbmdcXFxcXFxcIiwgdTIpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAodSA9PSBudWxsIHx8IHQgPT0gbnVsbCB8fCAhaXQuaW5jbHVkZXMocykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmICghaXQuaW5jbHVkZXMoXFxcXFxcXCLnvZHnm5hcXFxcXFxcIikgJiYgIWl0LmluY2x1ZGVzKFxcXFxcXFwi5LqR55uYXFxcXFxcXCIpICYmXFxcXG4gICAgICAgICAgICAgICAgICAgICFpdC5pbmNsdWRlcyhcXFxcXFxcImFsaXl1bmRyaXZlXFxcXFxcXCIpICYmICFpdC5pbmNsdWRlcyhcXFxcXFxcInl1bnBhblxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKHUuc3RhcnRzV2l0aChcXFxcXFxcImh0dHBzOi8vY24uYmluZy5jb20vXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBsZXQgZG9tID0gZ2V0SG9tZSh1KS5yZXBsYWNlKFxcXFxcXFwiaHR0cDovL1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKS5yZXBsYWNlKFxcXFxcXFwiaHR0cH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AgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0LFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuW/heW6lDwvZm9udD4mbmJzcDtcXFxcXFxcIiArIGRvbSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBjICE9IG51bGwgPyBjIDogJCh1KS5sYXp5UnVsZSgod3JhcHUsIG1vZGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2xpbmtzID0gaHRtbC5tYXRjaCgvaHR0cHM6XFxcXFxcXFwvXFxcXFxcXFwvKHd3d1xcXFxcXFxcLmFsaXl1bmRyaXZlXFxcXFxcXFwuY29tXFxcXFxcXFwvc3xhbHl3cFxcXFxcXFxcLm5ldClcXFxcXFxcXC9cXFxcXFxcXHcqL2cpIHx8IFtdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coX2xpbmtzKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vaWYgKF9saW5rcy5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIF9saW5rc1swXSArICc/P2Z5cGFnZSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoX2xpbmtzWzBdKSArICc/Pz9meXBhZ2UnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9saW5rcy5sZW5ndGggPiAxICYmIF9saW5rc1sxXS5yZXBsYWNlKF9saW5rc1swXSwgXFxcXFxcXCJcXFxcXFxcIikucmVwbGFjZSgvW2EtekEtWjAtOV0rL2csIFxcXFxcXFwiXFxcXFxcXCIpID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd3JhcHUoX2xpbmtzWzFdKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd3JhcHUoX2xpbmtzWzBdKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGUgPSBNWV9SVUxFLnRpdGxlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcXFxcXCIgKyBydWxlICsgXFxcXFxcXCImcj1cXFxcXFxcIiArIHJ1bGUgKyBcXFxcXFxcIiZtb2RlPVxcXFxcXFwiICsgbW9kZSArIFxcXFxcXFwiIyNcXFxcXFxcIiArIGlucHV0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwdSwgY29uZmlnLm1vZGUpXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gZDtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbl07XFxcXG5cXFxcbi8qXFxcXG5sZXQgY2NvZiA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2Njb2YnKVxcXFxucnVsZXMucHVzaChjY29mKVxcXFxuKi9cXFxcbi8v5bm25Y+R6KeE5YiZ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ge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn++8jOivt+ehruS/neaJi+acuuacieWuieijhemYv+mHjOS6keebmOWumOaWuUFQUFxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5L+u5pS55oiQ5Yqf44CCXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9KSxcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiaWNvbl8yX3JvdW5kXFxcXFxcXCIsXFxcXG4gICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIHBpY191cmw6IFxcXFxcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbjFcXFxcXFxcIlxcXFxuICAgIH0pO1xcXFxuXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcXFxuICAgICAgICBkZXNjOiAn6K+36L6T5YWl5YWz6ZSu6K+NJyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxcXG4gICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aCgnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvJykpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KGlucHV0KSArICc/Pz9meXBhZ2UnO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigncycsIGlucHV0KTtcXFxc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iAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliqDovb3nrKxcXFxcXFxcIiArIHAgKyBcXFxcXFxcIumhteS4re+8jOi/m+W6pu+8mjEvXFxcXFxcXCIgKyBkYXRhLmxlbmd0aCxcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICBzZXRSZXN1bHQoZCk7XFxcXG4gICAgLy9sb2coZGF0YS5sZW5ndGgpO1xcXFxuXFxcXG4gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAvL+Wkmue6v+eoi+WKoOi9vSAgICAgICAgXFxcXG4gICAgICAgIGxldCByZWFsUGFnZSA9IFxcXFxcXFwiXFxcXFxcXCIgPT0gciA/IDEgOiBwO1xcXFxuICAgICAgICBsZXQgdGFza3MgPSBkYXRhLm1hcChpdCA9PiB7XFxcXG4gICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHJ1bGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuZmluZChzLCByZWFsUGFnZSk7XFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBwYXJhbTogaXQsXFxcXG4gICAgICAg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cImNvbG9yOiAjMUU5MEZGXFxcXFxcXFxcXFxcXFxcIj5cXFxcXFxcIiArIHMgKyBcXFxcXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0LmRlc2MsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQudXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCA/ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycgOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXFxcXFwiX19hcHBcXFxcXFxcIiArIE1ZX1BBR0UgKyBcXFxcXFxcIkBcXFxcXFxcIiArIHBhcmFtLmosXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWKoOi9veesrFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcXFxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBwYXJhbS5hbGwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgICAgIGFsbDogZGF0YS5sZW5ndGgsXFxcXG4gICAgICAgICAgICAgICAgaTogMCxcXFxcbiAgICAgICAgICAgICAgICBqOiAtMVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLmkJzntKLpobXpnaJcXFwiLFxcXCJwYXRoXFxcIjpcXFwic291cFxcXCIsXFxcInJ1bGVcXFwiOlxcXCJqczpcXFxcbnZhciBkID0gW107XFxcXG5pZiAoTVlfUE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cmV0dXJuIG1hZztcXFxcbiAgICAgICAgICAgICAgICB9LCBpbnB1dCksXFxcXG4gICAgICAgICAgICAgICAgY2FuY2VsOiAkLnRvU3RyaW5nKChtYWcpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiY29weTovL1xcXFxcXFwiICsgbWFnXFxcXG4gICAgICAgICAgICAgICAgfSwgaW5wdXQpXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxcXG4gICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuaW5jbHVkZXMoXFxcXFxcXCJhbGl5dW5kcml2ZS5jb21cXFxcXFxcIikgJiYgbW9kZSAhPSBcXFxcXFxcIuWumOaWuUFQUFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAvL2xvZyhpbnB1dCk7XFxcXG4gICAgICAgICAgICBpZiAoaW5wdXQuaW5jbHVkZXMoJ2NoZWNrdXJsP3VybD0nKSAmJiBpbnB1dC5pbmNsdWRlcygnJnVybHJlZmVyJykpIHtcXFxcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGRlY29kZVVSSUNvbXBvbmVudChpbnB1dC5zcGxpdCgnJnVybHJlZmVyJylbMF0uc3BsaXQoJ2NoZWNrdXJsP3VybD0nKVsxXSk7XFxcXG4gICAgICAgICAgICAgICAgLy9sb2coJ+i0tOWQpycraW5wdXQpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAub3BlbihKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIumYv+mHjOS6keebmFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvZGV0YWl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huS6q+W3suWkseaViOOAgicsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBkZWNvZGVVUklDb21wb25lbnQoZ2V0UmVzQ29kZSgpLnNwbGl0KCcjIycpWzFdKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAoZ2V0c2hhci5pbmNsdWRlcyhcXFxcXFxcInNoYXJlX2xpbmsgY2Fubm90IGJlIGZvdW5kXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+S9oOaJk+W8gOeahOmTvuaOpeacieivr++8jOivt+mHjeivleOAgicsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBkZWNvZGVVUklDb21wb25lbnQoZ2V0UmVzQ29kZSgpLnNwbGl0KCcjIycpWzFdKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgIGxldCBwdXNobmFtZSA9IEpTT04ucGFyc2UoZ2V0c2hhcikuZmlsZV9pbmZvc1swXS5maWxlX25hbWU7XFxcXG5cXFxcbiAgICAgICAgdmFyIHNoYXJldG9rZW4gPSBKU09OLnBhcnNlKGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vdjIvc2hhcmVfbGluay9nZXRfc2hhcmVfdG9rZW4nLCB7XFxcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIGJvZHk6ICd7XFxcXFxcXCJzaGFyZV9wd2RcXFxcXFx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RvLHdfMzAwXFxcXFxcXCIsXFxcXFxcXCJvcmRlcl9ieVxcXFxcXFwiOlxcXFxcXFwibmFtZVxcXFxcXFwiLFxcXFxcXFwib3JkZXJfZGlyZWN0aW9uXFxcXFxcXCI6XFxcXFxcXCJBU0NcXFxcXFxcIicgKyBuZXh0ICsgJ30nLFxcXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGlmIChyZXNjb2QuaW5jbHVkZXMoXFxcXFxcXCJQYXJhbUZsb3dFeGNlcHRpb25cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IC8v5Y+W5paH5Lu25aS5XFxcXG4gICAgICAgIC8vbG9nKHJlc2NvZCk7XFxcXG5cXFxcblxcXFxuICAgICAgICBpZiAoSlNPTi5wYXJzZShyZXNjb2QpLm5leHRfbWFya2VyKSB7XFxcXG4gICAgICAgICAgICBsZXQgbWFya2VyID0gSlNPTi5wYXJzZShyZXNjb2QpLm5leHRfbWFya2VyO1xcXFxuICAgICAgICAgICAgaWYgKG1hcmtlci5sZW5ndGggPiAxMCkge1xcXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCduZXh0cGFnZScsIG1hcmtlcik7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ25leHRwYWdlJyk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgdmFyIGNvbnRzID0gSlNPTi5wYXJzZShyZXNjb2QpLml0ZW1zO1xcXFxuICAgICAgICBpZiAoY29udHMubGVuZ3RoIDwgMSkge1xcXFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfor6Xmlofku7blpLnkuIvmsqHmnInliIbkuqvnmoTmlofku7YnLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHZhciBkb25ndGFpID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xhenl1cmwnLCB7fSkpLnJ1bGUudG9TdHJpbmcoKTtcXFxcblxcXFxuICAgICAgICB2YXIgdHVpc29uZyA9IFtdO1xcXFxuICAgICAgICB2YXIgemltdSA9IFtdO1xcXFxuICAgICAgICBmb3IgKGxldCBpIGluIGNvbnRzKSB7XFxcXG4gICAgICAgICAgICAvL3ZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcXFxuICAgICAgICAgICAgaWYgKGNvbnRzW2ldLnR5cGUgIT0gJ2ZvbGRlcicpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgZm5hbWUgPSBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgICAgIGxldCBmdHlwZSA9IGZuYW1lLnRvTG93ZXJDYXNlKCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGNhdGUgPSBjb250c1tpXS5jYXRlZ29yeTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZnR5cGUuZW5kc1dpdGgoJy5zcnQnKSB8fCBmdHlwZS5lbmRzV2l0aCgnLnZ0dCcpIHx8IGZ0eXBlLmVuZHNXaXRoKCcuYXNzJykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgemltdS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdDogZm5hbWUuc3Vic3RyaW5nKDAsIGZuYW1lLmxhc3RJbmRleE9mKFxcXFxcXFwiLlxcXFxcXFwiKSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHQ6IGNvbnRzW2ldLmZpbGVfZXh0ZW5zaW9uLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlkOiBjb250c1tpXS5maWxlX2lkXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJyB8fCBjYXRlID09ICdhdWRpbycpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdHVpc29uZy5wdXNoKFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm5hbWUucmVwbGFjZSgvXFxcXFxcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXFxcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgY29udHNbaV0uZmlsZV9pZFxcXFxuICAgICAgICAgICAgICAgICAgICApO1xcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgICAgICBmb3IgKHZhciBpIGluIGNvbnRzKSB7XFxcXG4gICAgICAgICAgICB2YXIgbGlzdHlwID0gY29udHNbaV0udHlwZTtcXFxcbiAgICAgICAgICAgIGlmIChsaXN0eXAgIT0gJ2ZvbGRlcicpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgY2F0ZSA9IGNvbnRzW2ldLmNhdGVnb3J5O1xcXFxuICAgICAgICAgICAgICAgIHZhciBmbmFtZSA9IGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TuicgKyBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F0ZSA9PSAnZG9jJykge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TlicgKyBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F0ZSA9PSAnaW1hZ2UnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5a8JyArIGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICd6aXAnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5OmJyArIGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gY29udHNbaV0ubmFtZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgIC8vIGlmIChjYXRlID09ICd2aWRlbycgfHwgY2F0ZSA9PSAnYXVkaW8nIHx8IGNhdGUgPT0gJ2ltYWdlJykge1xcXFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChjb250c1tpXS5maWxlX2lkKS5sYXp5UnVsZSgoc2hhcmVJZCwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuLCB6aW11KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbSgnc2luZ2xlcHVzaCcsICcnKSA9PSAnMScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBmbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWZyZXNoX3Rva2VuXFxcXFxcXCI6IHJlZnRva2VuLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInVybFxcXFxcXFwiOiBmbmFtZS5yZXBsYWNlKC9cXFxcXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcXFxcXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBpbnB1dCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJzaGFyZV9pZFxcXFxcXFwiOiBzaGFyZUlkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKGRvbmd0YWkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lLCByZWZ0b2tlbiwgemltdSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGZvcm1hdERhdGUoY29udHNbaV0udXBkYXRlZF9hdCkgKyAnICAnICsgZm9ybWF0U2l6ZShjb250c1tpXS5zaXplKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+aOqOmAgeWIsFRWQm94JyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2hhcmVJZCwgZmlsZWlkLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPVhZUeaOqOmAgSZwdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJuYW1lXFxcXFxcXCI6IGZuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWZyZXNoX3Rva2VuXFxcXFxcXCI6IHJlZnRva2VuLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1cmxcXFxcXFxcIjogZm5hbWUucmVwbGFjZSgvXFxcXFxcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXFxcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgZmlsZWlkLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJzaGFyZV9pZFxcXFxcXFwiOiBzaGFyZUlkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaGFyZUlkLCBjb250c1tpXS5maWxlX2lkLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBjb250c1tpXS5maWxlX2lkXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAvKn0gZWxzZSBpZiAoaSA9PSAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICflvZPliY3mlofku7blpLnkuIvmsqHmnInpn7Pop4bpopHmlofku7YnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH0qL1xcXFxuXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ/Cfk4InICsgY29udHNbaV0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5JyArIGNvbnRzW2ldLmZpbGVfaWQgKyAnPz8/ZnlwYWdlJykucnVsZSgoc2hhcmVJZCwgc2hhcmV0b2tlbiwgcHVzaG5hbWUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3J1bGVsb29wJywge30pKS5ydWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgc2hhcmV0b2tlbiwgY29udHNbaV0ubmFtZSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgICAgIH0gLy9lbmQgaWZcXFxcbiAgICAgICAgfSAvL2VuZCBmb3IgaVxcXFxuICAgICAgICAvL2xvZyh0dWlzb25nKTtcXFxcbiAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvcHVzaGNvZGUnLCB7fSkpLnJ1bGUpO1xcXFxuXFxcXG4g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ICAgICB0aXQ6IGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZihcXFxcXFxcIi5cXFxcXFxcIikpLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHQ6IGNvbnRzW2ldLmZpbGVfZXh0ZW5zaW9uLFxcXFxuICAgICAgICAgICAgICAgICAgICBmaWQ6IGNvbnRzW2ldLmZpbGVfaWRcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nIHx8IGNhdGUgPT0gJ2F1ZGlvJykge1xcXFxuICAgICAgICAgICAgICAgIHR1aXNvbmcucHVzaChcXFxcbiAgICAgICAgICAgICAgICAgICAgZm5hbWUucmVwbGFjZSgvXFxcXFxcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXFxcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgY29udHNbaV0uZmlsZV9pZFxcXFxuICAgICAgICAgICAgICAgICk7XFxcXG4gICAgICAgICAgICB9O1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIFxcXFxuICAgIGZvciAodmFyIGkgaW4gY29udHMpIHtcXFxcbiAgICAgICAgdmFyIGxpc3R5cCA9IGNvbnRzW2ldLnR5cGU7XFxcXG4gICAgICAgIGlmIChsaXN0eXAgIT0gJ2ZvbGRlcicpIHtcXFxcbiAgICAgICAgICAgIHZhciBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxcXG4gICAgICAgICAgICB2YXIgZm5hbWUgPSBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xcXFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5O6JyArIGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2RvYycpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TlicgKyBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+WvCcgKyBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICd6aXAnKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk6YnICsgY29udHNbaV0ubmFtZTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gY29udHNbaV0ubmFtZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgLy9pZiAoY2F0ZSA9PSAndmlkZW8nIHx8IGNhdGUgPT0gJ2F1ZGlvJyB8fCBjYXRlID09ICdpbWFnZScpIHtcXFxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoY29udHNbaV0uZmlsZV9pZCkubGF6eVJ1bGUoKHNoYXJlSWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lLCByZWZ0b2tlbix6aW11KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKCdzaW5nbGVwdXNoJywgJycpID09ICcxJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPVhZUeaOqOmAgSZwdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBmbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInJlZnJlc2hfdG9rZW5cXFxcXFxcIjogcmVmdG9rZW4sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1cmxcXFxcXFxcIjogZm5hbWUucmVwbGFjZSgvXFxcXFxcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXFxcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgaW5wdXQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJzaGFyZV9pZFxcXFxcXFwiOiBzaGFyZUlkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGRvbmd0YWkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lLCByZWZ0b2tlbix6aW11KSxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBmb3JtYXREYXRlKGNvbnRzW2ldLnVwZGF0ZWRfYXQpICsgJyAgJyArIGZvcm1hdFNpemUoY29udHNbaV0uc2l6ZSksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmjqjpgIHliLBUVkJveCcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2hhcmVJZCwgZmlsZWlkLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBmbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWZyZXNoX3Rva2VuXFxcXFxcXCI6IHJlZnRva2VuLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInVybFxcXFxcXFwiOiBmbmFtZS5yZXBsYWNlKC9cXFxcXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcXFxcXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBmaWxlaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwic2hhcmVfaWRcXFxcXFxcIjogc2hhcmVJZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIGNvbnRzW2ldLmZpbGVfaWQsIGNhdGUsIGZuYW1lLCByZWZ0b2tlbilcXFxcbiAgICAgICAgICAgICAgICAgICAgfV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBjb250c1tpXS5maWxlX2lkXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXFxcblxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAvL31cXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn8J+TgicgKyBjb250c1tpXS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eScgKyBjb250c1tpXS5maWx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ge1xcXFxuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxcXFxuICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBhdXRob3JpemF0aW9uLFxcXFxuICAgICAgICAgICAgICAgICAgICAnWC1TaGFyZS1Ub2tlbic6IHNoYXJldG9rZW4sXFxcXG4gICAgICAgICAgICAgICAgICAgICd4LWRldmljZS1pZCc6IGRldmljZUlkLFxcXFxuICAgICAgICAgICAgICAgICAgICAneC1zaWduYXR1cmUnOiBzaWduXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBib2R5OiAne1xcXFxcXFwiZGV2aWNlTmFtZVxcXFxcXFwiOlxcXFxcXFwiQ2hyb21l5rWP6KeI5ZmoXFxcXFxcXCIsXFxcXFxcXCJtb2RlbE5hbWVcXFxcXFxcIjpcXFxcXFxcIldpbmRvd3PnvZHpobXniYhcXFxcXFxcIixcXFxcXFxcIm5vbmNlXFxcXFxcXCI6MCxcXFxcXFxcInB1YktleVxcXFxcXFwiOlxcXFxcXFwiJyArIHB1YktleSArICdcXFxcXFxcIixcXFxcXFxcInJlZnJlc2hUb2tlblxcXFxcXFwiOlxcXFxcXFwiJyArIGFsaXRva2VuICsgJ1xcXFxcXFwifScsXFxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgaWYgKHNlc3MuaW5jbHVkZXMoJ3N1Y2Nlc3MnKSkge1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbG9nKCdjc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9pZCwgYWxpdG9rZW4pIHtcXFxcbiAgICB0cnkge1xcXFxuICAgICAgICBsZXQgdXJscyA9IFtdO1xcXFxuICAgICAgICBsZXQgbmFtZXMgPSBbXTtcXFxcbiAgICAgICAgbGV0IGhlYWRzID0gW107XFxcXG4gICAgICAgIGxldCB1ID0gc3RhcnRQcm94eVNlcnZlcigkLnRvU3RyaW5nKChhbGlTaGFyZVBsYXlVcmwsIGZpbGVfaWQsIHNoYXJlX2lkLCBhbGl0b2tlbikgPT4ge1xcXFxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0dXJsKGZpbGVpZCwgbGluZSkge1xcXFxuICAgICAgICAgICAgICAgIC8v6aKE5Yqg6L295pe25Lya5Y+YZmlsZV9pZCzmiYDku6V0c+i/h+acn+abtOaWsOaXtui/mOWPluWOn+adpeeahGlkXFxcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxMaXN0ID0gYWxpU2hhcmVQbGF5VXJsKHNoYXJlX2lkLCBmaWxlaWQsIGFsaXRva2VuKSB8fCBbXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgYWxpdXJsO1xcXFxuICAgICAgICAgICAgICAgIHBsYXlVcmxMaXN0LmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0udGVtcGxhdGVfaWQgPT0gbGluZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYWxpdXJsID0gaXRlbS51cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvKmFsaXVybCA9IEpTT04ucGFyc2UocmVxdWVzdChpdGVtLnVybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTsqL1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAvL+S4iumdouaYr+iOt+WPlumYv+mHjOeahOaSreaUvuWcsOWdgFxcXFxuICAgICAgICAgICAgICAgIC8vbG9nKFxcXFxcXFwi5oiR5Zyo5Luj55CGXFxcXFxcXCIgKyBhbGl1cmwpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBob21lID0gYWxpdXJsLnNwbGl0KCdtZWRpYS5tM3U4JylbMF07XFxcXG4gICAgICAgICAgICAgICAgbGV0IGYgPSBmZXRjaChhbGl1cmwsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDMwMDBcXFxcbiAgICAgICAgICAgICAgICB9KS5zcGxpdChcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgZmYgPSBmLm1hcChpdCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGl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Gl0LnN0YXJ0c1dpdGgoJy9wcm94eT91cmw9JykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmdXJsID0gYmFzZTY0RGVjb2RlKGl0LnJlcGxhY2UoJy9wcm94eT91cmw9JywgJycpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuc3Vic3RyKHVybC5pbmRleE9mKCcvbWVkaWEtJyksIHVybC5pbmRleE9mKCcudHMnKSkgPT0gZnVybC5zdWJzdHIoZnVybC5pbmRleE9mKCcvbWVkaWEtJyksIGZ1cmwuaW5kZXhPZignLnRzJykpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gZnVybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgbGV0IGV4cGlyZXMgPSB1cmwuc3BsaXQoJ3gtb3NzLWV4cGlyZXM9JylbMV0uc3BsaXQoJyYnKVswXTtcXFxcbiAgICAgICAgICAgICAgICBjb25zdCBsYXN0dGltZSA9IHBhcnNlSW50KGV4cGlyZXMpIC0gRGF0ZS5ub3coKSAvIDEwMDA7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGxhc3R0aW1lIDwgNjApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coJ+i/h+acn+abtOaWsCcpXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaW5lID0gdXJsLnNwbGl0KCcvbWVkaWEnKVswXTsgLy/lj5bkuYvliY3mkq3mlL7nmoR0c+autee6v+i3r1xcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lID0gbGluZS5zdWJzdHJpbmcobGluZS5sYXN0SW5kZXhPZignLycpICsgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmID0gZ2V0dXJsKGZpZCwgbGluZSkuc3BsaXQoXFxcXFxcXCJcXFxcXFxcXG5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGYuZm9yRWFjaChpdCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXQgJiYgaXQuc3RhcnRzV2l0aCgnL3Byb3h5P3VybD0nKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmdXJsID0gYmFzZTY0RGVjb2RlKGl0LnJlcGxhY2UoJy9wcm94eT91cmw9JywgJycpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLnN1YnN0cih1cmwuaW5kZXhPZignL21lZGlhLScpLCB1cmwuaW5kZXhPZignLnRzJykpID09IGZ1cmwuc3Vic3RyKGZ1cmwuaW5kZXhPZignL21lZGlhLScpLCBmdXJsLmluZGV4T2YoJy50cycpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBmdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcblxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKCfmnKrov4fmnJ8nKVxcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhcXFxcXFxcIuS7o+eQhnRz77yaXFxcXFxcXCIgKyB1cmwpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXNDb2RlOiAzMDIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiTG9jYXRpb25cXFxcXFxcIjogdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgIC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lbS50ZW1wbGF0ZV9pZF0gOiBpdGVtLnRlbXBsYXRlX2hlaWdodCk7XFxcXG4gICAgICAgICAgICAgICAgaGVhZHMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgdmFyIG11bHQgPSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsczogdXJscyxcXFxcbiAgICAgICAgICAgICAgICBuYW1lczogbmFtZXMsXFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZHNcXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICBpZiAoemltdS5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB6aW11KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB6aW11dCA9IHppbXVbaV0udGl0O1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZm5hbWUuaW5jbHVkZXMoemltdXQpIHx8IHppbXV0LmluY2x1ZGVzKGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZignLicpKSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG11bHRbJ3N1YnRpdGxlJ10gPSBnZXRzdWIoemltdVtpXS5maWQsIHppbXVbaV0uZXh0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICByZXR1cm4gbXVsdDtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGxvZygn5pyq6I635Y+W6Zi/6YeM5pKt5pS+5Zyw5Z2A77yM5bu66K6u6YeN6L+b6L2v5Lu25YaN6K+V5LiA5qyhJylcXFxcbiAgICAgICAgICAgIHJldHVybiB7fTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgbG9nKCfojrflj5blhbHkuqvpk77mjqXmkq3mlL7lnLDlnYDlpLHotKU+JyArIGUubWVzc2FnZSk7XFxcXG4gICAgICAgIHJldHVybiB7fTtcXFxcbiAgICB9XFxcXG59XFxcXG5cXFxcbmlmIChjYXRlID09ICd2aWRlbycpIHtcXFxcbiAgICAvL2xvZyhyZWFjY2Vzc1RrKTsgXFxcXG4gICAgaWYgKGdldEl0ZW0oJ3F1YWxpdHknLCAnJykgPT0gJzEnKSB7XFxcXG4gICAgICAgIC8v5Y6f55S7XFxcXG4gICAgICAgIC8vYWNjZXNzVGsoKTtcXFxcblxcXFxuICAgICAgICBmdW5jdGlvbiBvYXV0aFJlZGlyZWN0KGNvZGUpIHtcXFxcbiAgICAgICAgICAgIC8vbG9nKGNvZGUpO1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ29yZWQnLCAnMScpICE9ICcwJykge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IGZldGNoKCdodHRwczovL2FwaS5ubi5jaS9hbGlzdC9hbGlfb3Blbi9jb2RlJywge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImNvZGVcXFxcXFxcIjogY29kZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImdyYW50X3R5cGVcXFxcXFxcIjogXFxcXFxcXCJhdXRob3JpemF0aW9uX2NvZGVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2coJ+iOt+WPllJlZnJlc2hUb2tlbk9wZW4nKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24uaW5jbHVkZXMoJ1RvbyBNYW55IFJlcXVlc3RzJykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdvcmVkJywgJzAnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfor7fmsYLlpKrpopHnuYHvvIzooqvlsIHpmZDliLbkuoYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKCfor7fmsYLlpKrpopHnuYHvvIzooqvlsIFJUOS6hicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ29yZWQnLCAnMScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEpTT04ucGFyc2UoanNvbikucmVmcmVzaF90b2tlbikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZXRSZWZyZXNoVG9rZW5PcGVuID0gSlNPTi5wYXJzZShqc29uKS5yZWZyZXNoX3Rva2VuO1xcXFxuICAgICAgICAgICAgICAgICAgICAg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bGxiYWNrJnNjb3BlPXVzZXI6YmFzZSxmaWxlOmFsbDpyZWFkLGZpbGU6YWxsOndyaXRlJnN0YXRlPScsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGhvcml6YXRpb24nOiByZWFjY2Vzc1RrLCAvL2dldEFjY2Vzc1Rva2VuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAneC1jYW5hcnknOiAnY2xpZW50PXdlYixhcHA9c2hhcmUsdmVyc2lvbj12Mi4zLjEnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3gtc2hhcmUtdG9rZW4nOiBzaGFyZXRva2VuXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJhdXRob3JpemVcXFxcXFxcIjogMSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwic2NvcGVcXFxcXFxcIjogXFxcXFxcXCJ1c2VyOmJhc2UsZmlsZTphbGw6cmVhZCxmaWxlOmFsbDp3cml0ZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgLy9sb2coJ29hdXRocmVxXFxcXFxcXFxuJyArIGpzb24pO1xcXFxuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gSlNPTi5wYXJzZShqc29uKS5yZWRpcmVjdFVyaS5zcGxpdChcXFxcXFxcImNvZGU9XFxcXFxcXCIpWzFdO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKGNvZGUpO1xcXFxuICAgICAgICAgICAgICAgIG9hdXRoUmVkaXJlY3QoY29kZSk7XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgcmVhY2Nlc3NUayA9ICcnO1xcXFxuICAgICAgICAgICAgICAgIGFjY2Vzc1RrKCk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH07XFxcXG5cXFxcbiAgICAgICAgZnVuY3Rpb24gcmVmcmVzaE9wZW5Ub2tlbigpIHtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdyb3QnLCAnMScpICE9ICcwJykge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IGZldGNoKCdodHRwczovL2FwaS5ubi5jaS9hbGlzdC9hbGlfb3Blbi90b2tlbicsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdncmFudF90eXBlJzogJ3JlZnJlc2hfdG9rZW4nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyZWZyZXNoX3Rva2VuJzogT3BlblRva2VuLlJlZnJlc2hUb2tlbk9wZW5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICBsb2coJ+iOt+WPlkFjY2Vzc1Rva2VuT3BlbicpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoanNvbi5pbmNsdWRlcygnVG9vIE1hbnkgUmVxdWVzdHMnKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3JvdCcsICcwJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6K+35rGC5aSq6aKR57mB77yM6KKr5bCB6ZmQ5Yi25LqGJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygn6K+35rGC5aSq6aKR57mB77yM6KKr5bCBSVDkuoYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnJztcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdyb3QnLCAnMScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEpTT04ucGFyc2UoanNvbikucmVmcmVzaF90b2tlbikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZXRSZWZyZXNoVG9rZW5PcGVuID0gSlNPTi5wYXJzZShqc29uKS5yZWZyZXNoX3Rva2VuO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9wZW5Ub2tlbi5SZWZyZXNoVG9rZW5PcGVuID0gZ2V0UmVmcmVzaFRva2VuT3BlbjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2V0QWNjZXNzVG9rZW5PcGVuID0gSlNPTi5wYXJzZShqc29uKS50b2tlbl90eXBlICsgJyAnICsgSlNPTi5wYXJzZShqc29uKS5hY2Nlc3NfdG9rZW47XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgT3BlblRva2VuLkFjY2Vzc1Rva2VuT3BlbiA9IGdldEFjY2Vzc1Rva2VuT3BlbjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2ljeS9pY3ktYWxpLU9wZW5Ub2tlbi5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KE9wZW5Ub2tlbikpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgfTtcXFxcblxcXFxuICAgICAgICBmdW5jdGlvbiBjb3B5KGZpbGVJZCkge1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQganNvbiA9IGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YyL2JhdGNoJywge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLycsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aG9yaXphdGlvbic6IHJlYWNjZXNzVGssXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2dldEFjY2Vzc1Rva2VuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAneC1jYW5hcnknOiAnY2xpZW50PXdlYixhcHA9c2hhcmUsdmVyc2lvbj12Mi4zLjEnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3gtc2hhcmUtdG9rZW4nOiBzaGFyZXRva2VuXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZXF1ZXN0c1xcXFxcXFwiOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiYm9keVxcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZmlsZV9pZFxcXFxcXFwiOiBmaWxlSWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwic2hhcmVfaWRcXFxcXFxcIjogc2hhcmVJZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJhdXRvX3JlbmFtZVxcXFxcXFwiOiB0cnVlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInRvX3BhcmVudF9maWxlX2lkXFxcXFxcXCI6IFxcXFxcXFwicm9vdFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInRvX2RyaXZlX2lkXFxcXFxcXCI6IGRlZmRyaXZlaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiaGVhZGVyc1xcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29udGVudC1UeXBlXFxcXFxcXCI6IFxcXFxcXFwiYXBwbGljYXRpb24vanNvblxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImlkXFxcXFxcXCI6IFxcXFxcXFwiMFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibWV0aG9kXFxcXFxcXCI6IFxcXFxcXFwiUE9TVFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidXJsXFxcXFxcXCI6IFxcXFxcXFwiL2ZpbGUvY29weVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicmVzb3VyY2VcXFxcXFxcIjogXFxcXFxcXCJmaWxlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAvL2xvZygnY29weVxcXFxcXFxcbicgKyBqc29uKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShqc29uKS5yZXNwb25zZXNbMF0uYm9keS5maWxlX2lkO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9O1xcXFxuXFxcXG4gICAgICAgIGZ1bmN0aW9uIG9wZW4oZmlsZUlkKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0gXFxcXFxcXCJcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbnVtYmVyID0gMDtcXFxcbiAgICAgICAgICAgICAgICBkbyB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9vcGVuLmFsaXl1bmRyaXZlLmNvbS9hZHJpdmUvdjEuMC9vcGVuRmlsZS9nZXREb3dubG9hZFVybCcsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdhdXRob3JpemF0aW9uJzogT3BlblRva2VuLkFjY2Vzc1Rva2VuT3BlblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0QWNjZXNzVG9rZW5PcGVuXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGVfaWQnOiBmaWxlSWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2RyaXZlX2lkJzogZGVmZHJpdmVpZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZygnb3BlblxcXFxcXFxcbicgKyBqc29uKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24uaW5jbHVkZXMoJ1xcXFxcXFwidXJsXFxcXFxcXCI6XFxcXFxcXCJodHRwJykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChqc29uLmluY2x1ZGVzKFxcXFxcXFwiVG9vTWFueVJlcXVlc3RzXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2RlbGV0ZWUoZmlsZUlkKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCdUb28gTWFueSBSZXF1ZXN0cycpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcigncmVkaXJlY3QnLCAnMCcpID09ICcwJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgb2F1dGhSZXF1ZXN0KCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoT3BlblRva2VuKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgbnVtYmVyKytcXFxcbiAgICAgICAgICAgICAgICB9IHdoaWxlIChudW1iZXIgPCAyKTtcXFxcbiAgICAgICAgICAgICAgICAvL2RlbGV0ZWUoZmlsZUlkKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoanNvbi5pbmNsdWRlcygnaHR0cCcpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGpzb24pLnVybCArICcjaXNWaWRlbz10cnVlIzt7UmVmZXJlckBodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vfSc7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKGpzb24pO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfTtcXFxcblxcXFxuICAgICAgICBmdW5jdGlvbiBkZWxldGVlKGZpbGVJZCkge1xcXFxuXFxcXG4gICAgICAgICAgICBmZXRjaCgnaHR0cHM6Ly9hcGkuYWxpeXVuZHJpdmUuY29tL2Fkcml2ZS92Mi9iYXRjaCcsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcXFxuICAgICAgICAgICAgICAgICAgICAnYXV0aG9yaXphdGlvbic6IHJlYWNjZXNzVGssXFxcXG4gICAgICAgICAgICAgICAgICAgICd4LWNhbmFyeSc6ICdjbGllbnQ9d2ViLGFwcD1zaGFyZSx2ZXJzaW9uPXYyLjMuMScsXFxcXG4gICAgICAgICAgICAgICAgICAgICd4LXNoYXJlLXRva2VuJzogc2hhcmV0b2tlblxcXFxuXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicmVxdWVzdHNcXFxcXFxcIjogW3tcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiYm9keVxcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJkcml2ZV9pZFxcXFxcXFwiOiBkZWZkcml2ZWlkLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZmlsZV9pZFxcXFxcXFwiOiBmaWxlSWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImhlYWRlcnNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29udGVudC1UeXBlXFxcXFxcXCI6IFxcXFxcXFwiYXBwbGljYXRpb24vanNvblxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJpZFxcXFxcXFwiOiBmaWxlSWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIm1ldGhvZFxcXFxcXFwiOiBcXFxcXFxcIlBPU1RcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidXJsXFxcXFxcXCI6IFxcXFxcXFwiL2ZpbGUvZGVsZXRlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicmVzb3VyY2VcXFxcXFxcIjogXFxcXFxcXCJmaWxlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIC8vbG9nKCfliKDpmaQgJyArIGRlbCk7XFxcXG4gICAgICAgICAgICAvKlxcXFxuICAgICAgICAgICAgZmV0Y2goJ2h0dHBzOi8vb3Blbi5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YxLjAvb3BlbkZpbGUvZGVsZXRlJywge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLycsXFxcXG4gICAgICAgICAgICAgICAgICAgICdhdXRob3JpemF0aW9uJzogZ2V0SXRlbSgnZ2V0QWNjZXNzVG9rZW5PcGVuJywgJycpLFxcXFxuICAgICAgICAgICAgICAgICAgICAneC1zaGFyZS10b2tlbic6IHNoYXJldG9rZW5cXFxcblxcXFxuXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZHJpdmVfaWRcXFxcXFxcIjogZGVmZHJpdmVpZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJmaWxlX2lkXFxcXFxcXCI6IGZpbGVJZFxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgKi9cXFxcbiAgICAgICAgICAgIC8vbG9nKCdkZWxlXFxcXFxcXFxuJyArIGpzb24pO1xcXFxuICAgICAgICB9O1xcXFxuXFxcXG4gICAgICAgIC8v5aSE55CG6KeG6aKRICBcXFxcbiAgICAgICAgdmFyIGRzaWQgPSBzaGFyZUlkO1xcXFxuICAgICAgICB2YXIgZGZpZCA9IGlucHV0O1xcXFxuXFxcXG4gICAgICAgIGxldCBmaWxlSWQgPSBjb3B5KGRmaWQpO1xcXFxuICAgICAgICB2YXIgcGxheSA9IG9wZW4oZmlsZUlkKTtcXFxcbiAgICAgICAgaWYgKGZpbGVJZC5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICBkZWxldGVlKGZpbGVJZCk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaWYgKHppbXUubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB6aW11KSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHppbXV0ID0gemltdVtpXS50aXQ7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGZuYW1lLmluY2x1ZGVzKHppbXV0KSB8fCB6aW11dC5pbmNsdWRlcyhmbmFtZS5zdWJzdHJpbmcoMCwgZm5hbWUubGFzdEluZGV4T2YoJy4nKSkpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBsYXkgPSBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbcGxheS5zcGxpdCgnO3snKVswXV0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1YnRpdGxlOiBnZXRzdWIoemltdVtpXS5maWQsIHppbXVbaV0uZXh0KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICAvL+aZrueUuyAgXFxcXG4gICAgICAgIHZhciBkc2lkID0gc2hhcmVJZDtcXFxcbiAgICAgICAgdmFyIGRmaWQgPSBpbnB1dDtcXFxcblxcXFxuICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nKSB7XFxcXG4gICAgICAgICAgICB2YXIgcGxheSA9IEpTT04uc3RyaW5naWZ5KGdldEFsaVVybChcXFxcbiAgICAgICAgICAgICAgICBzaGFyZUlkLFxcXFxuICAgICAgICAgICAgICAgIGlucHV0LFxcXFxuICAgICAgICAgICAgICAgIHJlZnRva2VuXFxcXG4gICAgICAgICAgICApKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbn0gZWxzZSBpZiAoY2F0ZSA9PSAnaW1hZ2UnKSB7XFxcXG4gICAgLy/lpITnkIbmlofmoaNcXFxcbiAgICAvL2FjY2Vzc1RrKCk7XFxcXG5cXFxcbiAgICB2YXIganNvbiA9IGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vdjIvZmlsZS9nZXRfc2hhcmVfbGlua19kb3dubG9hZF91cmwnLCB7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KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5iYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB0b2tlbl90aW1lcigpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHZhciB0b2tlbl90aW1lciA9IGZ1bmN0aW9uKCkge1xcXFxuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQodG9rZW5GdW5jdGlvbiwgNTAwKVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIHRva2VuRnVuY3Rpb24oKTtcXFxcbiAgICAgICAgfSwgbnRva2VuKVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJyxcXFxcbiAgICAgICAgICAgIGRlc2M6ICcxMDAlJiZmbG9hdCcsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGNhbkJhY2s6IHRydWUsXFxcXG4gICAgICAgICAgICAgICAgdWE6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgIGpzOiBqc1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxcXG4gICAgfSksXFxcXG4gICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcXFxufSk7XFxcIn1dXCIsXCJwcm94eVwiOlwiXCJ9IiwidGl0bGUiOiLlkpLmgKjns7vliJcifQ==
Add Comment
Please, Sign In to add comment