Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_懒人专用,全网VIP视频免费破解去广告、全网音乐直接下载、知乎增@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICDmh5LkurrkuJPnlKjvvIzlhajnvZFWSVDop4bpopHlhY3otLnnoLTop6Pljrvlub/lkYrjgIHlhajnvZHpn7PkuZDnm7TmjqXkuIvovb3jgIHnn6XkuY7lop7lvLrjgIHnn63op4bpopHml6DmsLTljbDkuIvovb3jgIHnmb7luqbnvZHnm5jnm7TmjqXkuIvovb3nrYnlpJrlip/og73lt6XlhbfnrrHvvIzlip/og73lj6/ni6znq4vlvIDlhbPjgILplb/mnJ/mm7TmlrDvvIzmlL7lv4Pkvb/nlKjjgIJ2NgovLyBAbmFtZXNwYWNlIAkgbGFuaGFoYQovLyBAdmVyc2lvbiAgICAgIDYuNy4yCi8vIEBkZXNjcmlwdGlvbiAg6Ieq55So5aSa5Yqf6IO96ISa5pys5bel5YW3566x77yM5a6M5YWo5YWN6LS544CB5peg5bm/5ZGK44CB5peg6ZyA5YWz5rOo5YWs5LyX5Y+377yM6ZuG5ZCI5LqG5LyY6YW344CB54ix5aWH6Im644CB6IW+6K6v44CBQuermShiaWxpYmlsaSnjgIHoipLmnpznrYnlhajnvZFWSVDop4bpopEoUEMr56e75Yqo56uvKeWFjei0ueegtOino+WOu+W5v+WRiu+8jOe9keaYk+S6kemfs+S5kOOAgVFR6Z+z5LmQ44CB6YW354uX44CB6YW35oiR44CB6Jm+57Gz44CB6Jy76JyTRk3jgIHojZTmnp1GTeOAgeWWnOmprOaLiembheetiee9keermemfs+S5kOWSjOacieWjsOS5pumfs+mikeWFjeWuouaIt+err+S4i+i9ve+8jOefpeS5juWinuW8uijnn6XkuY7op4bpopHkuIvovb3jgIHljrvlub/lkYrjgIHlhbPplK7or43lsY/olL3jgIHljrvpmaTkvqfovrnmoI/nrYkp77yM6KeG6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Imh0dHBzOi8vanguYWlkb3Vlci5uZXQvP3VybD0ifSwKICAgICAgICAgICAgeyJuYW1lIjoiQ0hvayIsInVybCI6Imh0dHBzOi8vd3d3LmdhaTQuY29tLz91cmw9In0sCiAgICAgICAgICAgIHsibmFtZSI6Ik9LIiwidXJsIjoiaHR0cHM6Ly9va2p4LmNjLz91cmw9In0sCiAgICAgICAgICAgIHsibmFtZSI6IlJESEsiLCJ1cmwiOiJodHRwczovL2p4LnJkaGsubmV0Lz92PSJ9LAogICAgICAgICAgICB7Im5hbWUiOiLkurrkurrov7ciLCJ1cmwiOiJodHRwczovL2p4LmJsYm8uY2M6NDQzMy8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiLmgJ3lj6QzIiwidXJsIjoiaHR0cHM6Ly9qc2FwLmF0dGFraWRzLmNvbS8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiLlkKzkuZAiLCJ1cmwiOiJodHRwczovL2p4LmRqNnUuY29tLz91cmw9In0sCiAgICAgICAgXTsKCiAgICAgICAgbGV0IHVzZVdlYiA9IFsnbS5iaWxpYmlsaS5jb20nLCd5b3VrdS5jb20nLCd3d3cueW91a3UuY29tJywnbS55b3VrdS5jb20nLCdtLnYucXEuY29tJywnbS5pcWl5aS5jb20nLCdtLm1ndHYuY29tJywnbS50di5zb2h1LmNvbScsJ20uMTkwNS5jb20nLCdtLnBwdHYuY29tJywnbS5sZS5jb20nXTsKCiAgICAgICAgaWYodXNlV2ViLmluZGV4T2YobG9jYXRpb24uaG9zdCkgPT0gLTEpewogICAgICAgICAgICBjb25zb2xlLmxvZygn5LiN5piv5bqU55So572R56uZJyk7cmV0dXJuOwogICAgICAgIH0KCiAgICAgICAgZnVuY3Rpb24gc2V0Q29va2llKGNuYW1lLGN2YWx1ZSxleGRheXMpewoKICAgICAgICAgICAgdmFyIGQgPSBuZXcgRGF0ZSgpOwoKICAgICAgICAgICAgZC5zZXRUaW1lKGQuZ2V0VGltZSgpKyhleGRheXMqMjQqNjAqNjAqMTAwMCkpOwoKICAgICAgICAgICAgdmFyIGV4cGlyZXMgPSAiZXhwaXJlcz0iK2QudG9HTVRTdHJpbmcoKTsKCiAgICAgICAgICAgIGRvY3VtZW50LmNvb2tpZSA9IGNuYW1lKyI9IitjdmFsdWUrIjsgIitleHBpcmVzOwogICAgICAgIH0KCiAgICAgICAgZnVuY3Rpb24gZ2V0Q29va2llKGNuYW1lKXsKICAgICAgICAgICAgdmFyIG5hbWUgPSBjbmFtZSArICI9IjsKICAgICAgICAgICAgdmFyIGNhID0gZG9jdW1lbnQuY29va2llLnNwbGl0KCc7Jyk7CiAgICAgICAgICAgIGZvcih2YXIgaT0wOyBpPGNhLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICB2YXIgYyA9IGNhW2ldLnRyaW0oKTsKICAgICAgICAgICAgICAgIGlmIChjLmluZGV4T2YobmFtZSk9PTApIHsgcmV0dXJuIGMuc3Vic3RyaW5nKG5hbWUubGVuZ3RoLGMubGVuZ3RoKTsgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiAiIjsKICAgICAgICB9CgogICAgICAgIGZ1bmN0aW9uIGNyZWF0ZUVsZW1lbnQoZG9tLGRvbUlkKXsKCiAgICAgICAgICAgIHZhciByb290RWxlbWVudCA9IGRvY3VtZW50LmJvZHk7CgogICAgICAgICAgICB2YXIgbmV3RWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoZG9tKTsKCiAgICAgICAgICAgIG5ld0VsZW1lbnQuaWQgPSBkb21JZDsKCiAgICAgICAgICAgIHZhciBuZXdFbGVtZW50SHRtbENvbnRlbnQgPSBkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgnJyk7CgogICAgICAgICAgICByb290RWxlbWVudC5hcHBlbmRDaGlsZChuZXdFbGVtZW50KTsKCiAgICAgICAgICAgIG5ld0VsZW1lbnQuYXBwZW5kQ2hpbGQobmV3RWxlbWVudEh0bWxDb250ZW50KTsK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BkICogMTAwMCk7CgogICAgICAgICAgICB9LCBkdXJhdGlvbik7CgogICAgICAgIH0KCiAgICAgICAgZnVuY3Rpb24gcGxheVZpZGVvRnVuYygpewogICAgICAgICAgICAvL2NzcwogICAgICAgICAgICBsZXQgcGxheVZpZGVvU3R5bGUgPSBgCiAgICAgICAgICAgIC56aG1fcGxheV92aWRvZV9pY29uewogICAgICAgICAgICAgICAgcGFkZGluZy10b3A6MnB4O2N1cnNvcjpwb2ludGVyOwogICAgICAgICAgICAgICAgei1pbmRleDo5OTk5OTk5OwogICAgICAgICAgICAgICAgZGlzcGxheTpibG9jazsKICAgICAgICAgICAgICAgIHBvc2l0aW9uOmZpeGVkO2xldDowcHg7dG9wOjM2MHB4O3RleHQtYWxpZ246Y2VudGVyO292ZXJmbG93OnZpc2libGU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX3dyYXB7CiAgICAgICAgICAgICAgICBwb3NpdGlvbjpmaXhlZDtsZWZ0OjQwcHg7dG9wOjM2MHB4OwogICAgICAgICAgICAgICAgei1pbmRleDo5OTk5OTk5OwogICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgICAgIHdpZHRoOjMwMHB4OwogICAgICAgICAgICB9CiAgICAgICAgICAgIC56aG1fcGxheV92aWRlb19saW5lewogICAgICAgICAgICAgICAgd2lkdGg6MzIwcHg7CiAgICAgICAgICAgICAgICBoZWlnaHQ6MzE2cHg7CiAgICAgICAgICAgICAgICBvdmVyZmxvdy15OnNjcm9sbDsKICAgICAgICAgICAgICAgIG92ZXJmbG93LXg6aGlkZGVuOwogICAgICAgICAgICB9CiAgICAgICAgICAgIC56aG1fcGxheV92aWRlX2xpbmVfdWx7CiAgICAgICAgICAgICAgICB3aWR0aDozMDBweDsKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtc3RhcnQ7CiAgICAgICAgICAgICAgICBmbGV4LWZsb3c6IHJvdyB3cmFwOwogICAgICAgICAgICAgICAgbGlzdC1zdHlsZTogbm9uZTsKICAgICAgICAgICAgICAgIHBhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgbWFyZ2luOjBweDsKCiAgICAgICAgICAgIH0KICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGl7CiAgICAgICAgICAgICAgICBwYWRkaW5nOjRweCAwcHg7CiAgICAgICAgICAgICAgICBtYXJnaW46MnB4OwogICAgICAgICAgICAgICAgd2lkdGg6MzAlOwogICAgICAgICAgICAgICAgY29sb3I6I0ZGRjsKICAgICAgICAgICAgICAgIHRleHQtYWxpZ246Y2VudGVyOwogICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZjI0NDQzOwogICAgICAgICAgICAgICAgYm94LXNoYWRvdzowcHggMHB4IDEwcHggI2ZmZjsKICAgICAgICAgICAgICAgIGZvbnQtc2l6ZToxNHB4OwogICAgICAgICAgICB9CiAgICAgICAgICAgIC56aG1fcGxheV92aWRlb19saW5lX3VsX2xpOmhvdmVyewogICAgICAgICAgICAgICAgY29sb3I6IzI2MDAzMzsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZjYzBjMAogICAgICAgICAgICB9CiAgICAgICAgICAgIC56aG1fbGluZV9zZWxlY3RlZHsKICAgICAgICAgICAgICAgIGNvbG9yOiMyNjAwMzM7CiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiNmY2MwYzAKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2p4ewogICAgICAgICAgICAgICAgd2lkdGg6MTAwJTsKICAgICAgICAgICAgICAgIGhlaWdodDoxMDAlOwogICAgICAgICAgICAgICAgei1pbmRleDo5OTk5OTk7CiAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7dG9wOjBweDtwYWRk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XZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgbGV0IGp4VmlkZW9XZWIgPSBqeFZpZGVvRGF0YS5maWx0ZXIoZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NhdGlvbi5ocmVmLm1hdGNoKGl0ZW0ubWF0Y2gpOwoKICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgaWYoanhWaWRlb1dlYi5sZW5ndGggPT0gMCl7CgogICAgICAgICAgICAgICAgICAgIHRvYXN0KCfor7flnKjop4bpopHmkq3mlL7pobXngrnlh7vlm77moIcnKTsKCiAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgdmFyIHtmdW5jTmFtZSxtYXRjaDpub3dNYXRjaCxub2RlOm5vd05vZGUsbmFtZTpub3dOYW1lfSA9IGp4VmlkZW9XZWJbMF07CgogICAgICAgICAgICAgICAgICAgIGxldCBwbGF5TGluZURpdiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy56aG1fcGxheV92aWRlb193cmFwJyk7CgogICAgICAgICAgICAgICAgICAgIGxldCBwbGF5U2hvdyA9IHBsYXlMaW5lRGl2LnN0eWxlLmRpc3BsYXk7CgogICAgICAgICAgICAgICAgICAgIHBsYXlTaG93ID09ICdub25lJz8gcGxheUxpbmVEaXYuc3R5bGUuZGlzcGxheSA9ICdibG9jayc6cGxheUxpbmVEaXYuc3R5bGUuZGlzcGxheSA9ICdub25lJzsKCiAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXlMaW5lVGQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcucGxheUxpbmVUZCcpOwoKICAgICAgICAgICAgICAgICAgICBwbGF5TGluZVRkLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlMaW5lVGQuZm9yRWFjaChmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5zZXRBdHRyaWJ1dGUoJ2NsYXNzJywncGxheUxpbmVUZCB6aG1fcGxheV92aWRlb19saW5lX3VsX2xpJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QXR0cmlidXRlKCdjbGFzcycsJ3BsYXlMaW5lVGQgemhtX3BsYXlfdmlkZW9fbGluZV91bF9saSB6aG1fbGluZV9zZWxlY3RlZCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldENvb2tpZSgncGxheUxpbmVBY3Rpb24nLHRoaXMuZ2V0QXR0cmlidXRlKCd1cmwnKSwzMCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vd1dlYk5vZGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKG5vd05vZGUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG5vd1dlYk5vZGUpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub3dXZWJOb2RlLmlubmVySFRNTCA9IHBsYXlKeEh0bWw7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5SWZyYW1lID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BsYXlJZnJhbWUnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheUlmcmFtZS5zcmM9IGl0ZW0uZ2V0QXR0cmlidXRlKCd1cmwnKStsb2NhdGlvbi5ocmVmOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn6KeG6aKR572R56uZ57uT54K55LiN5a2Y5ZyoJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9TZWxlY3QgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuJytqeFZpZGVvV2ViWzBdLmFyZWFDbGFzc05hbWUpOwoKICAgICAgICAgICAgICAgICAgICB2aWRlb1NlbGVjdC5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oZSl7CgogICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZj1sb2NhdGlvbi5ocmVmOwoKICAgICAgICAgICAgICAgICAgICAgICAgfSwxMDAwKQoKICAgICAgICAgICAgICAgICAgICB9KTsKCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfSkKCiAgICAgICAgICAgIGxldCB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgbGV0IGp4VmlkZW9XZWIgPSBqeFZpZGVvRGF0YS5maWx0ZXIoZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NhdGlvbi5ocmVmLm1hdGNoKGl0ZW0ubWF0Y2gpOwoKICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgaWYoanhWaWRlb1dlYi5sZW5ndGg+MCl7CgogICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb1NlbGVjdCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy4nK2p4VmlkZW9XZWJbMF0uYXJlYUNsYXNzTmFtZSk7CgogICAgICAgICAgICAgICAgICAgIGlmKHZpZGVvU2VsZWN0KXsKCiAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvU2VsZWN0LmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGUudGFyZ2V0LnBhcmVudE5vZGUuaHJlZik7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWxvY2F0aW9uLmhyZWY7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwxMDAwKQoKICAgICAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9LDEwMDApCgogICAgICAgIH0KCiAgICAgICAgcGxheVZpZGVvRnVuYygpOwoKICAgIH1lbHNlewogICAgICAgIC8qLS1jb25maWctLSovCiAgICAgICAgdmFyIENvbmZpZyA9ewoKICAgICAgICBjb3Vwb25Vcmw6d2luZG93LmxvY2F0aW9uLmhyZWYsCgogICAgICAgIGNvdXBvbkhvc3Q6d2luZG93LmxvY2F0aW9uLmhvc3QsCgogICAgICAgIHdlYlVybDonaHR0cDovL211c2ljLmxpdXpoaWppbi5jbi8nLAoKICAgICAgICBpY29uVmlwVG9wOjM2MCwKCiAgICAgICAgaWNvblZpcFBvc2l0aW9uIDogJ2xlZnQnLAoKICAgICAgICBpY29uVmlwV2lkdGggOiA0MCwKCiAgICAgICAgY291cG9uVGltZXJOdW0gOiAxMDAsLy8xMDDmrKHnrYnkuo4xMOenkgoKICAgICAgICBjb3Vwb25XYWl0VGltZSA6IDEwMCwKCiAgICAgICAgaWNvbldhaXRUaW1lIDogMTAwLAoKICAgICAgICBpY29uVmlwT3BhY2l0eToxMDAsCgogICAgICAgIHNlbGVjdGVkTGVmdDonc2VsZWN0ZWQnLAoKICAgICAgICBzZWxlY3RlZFJpZ2h0OicnLAoKICAgICAgICB2aWRlb1BsYXlMaW5lQWRkOkdNX2dldFZhbHVlKCd2aWRlb1BsYXlMaW5lQWRkJywwKSwKCiAgICAgICAgZHlWaWRlb0Rvd25sb2FkOkdNX2dldFZhbHVlKCdkeVZpZGVvRG93bmxvYWQnLDIyKSwKCiAgICAgICAga3NWaWRlb0Rvd25sb2FkOkdNX2dldFZhbHVlKCdrc1ZpZGVvRG93bmxvYWQnLDIyKSwKCiAgICAgICAgeGlndWFWaWRlb0Rvd25sb2FkOkdNX2dldFZhbHVlKCd4aWd1YVZpZGVvRG93bmxvYWQnLDIyKSwKCiAgICAgICAgYmlsaVZpZGVvRG93bmxvYWQ6R01fZ2V0VmFsdWUoJ2JpbGlWaWRlb0Rvd25sb2FkJywyMiksCgogICAgICAgIHlvdXR1YmVWaWRlb0Rvd25sb2FkOkdNX2dldFZhbHVlKCd5b3V0dWJlVmlkZW9Eb3dubG9hZCcsMjIpLAogICAgICAgIH0KCiAgICAgICAgdmFyIHtjb3Vwb25VcmwsCiAgICAgICAgICAgIGNvdXBvbkhvc3QsCiAgICAgICAgICAgIHdlYlVybCwKICAgICAgICAgICAgaWNvblZpcFRvcCwKICAgICAgICAgICAgaWNvblZpcFBvc2l0aW9uLAogICAgICAgICAgICBpY29uVmlwV2lkdGgsCiAgICAgICAgICAgIGljb25WaXBPcGFjaXR5LAogICAgICAgICAgICBjb3Vwb25UaW1lck51bSwKICAgICAgICAgICAgY291cG9uV2FpdFRpbWUsCiAgICAgICAgICAgIGljb25XYWl0VGltZSwKICAgICAgICAgICAgc2VsZWN0ZWRMZWZ0LAogICAgICAgICAgICBzZWxlY3RlZFJpZ2h0LAogICAgICAgICAgICB2aWRlb1BsYXlMaW5lQWRkLAogICAgICAgICAgICBkeVZpZGVvRG93bmxvYWQsCiAgICAgICAgICAgIGtzVmlkZW9Eb3dubG9hZCwKICAgICAgICAgICAgeGlndWFWaWRlb0Rvd25sb2FkLAogICAgICAgICAgICBiaWxpVmlkZW9Eb3dubG9hZCwKICAgICAgICAgICAgeW91dHViZVZpZGVvRG93bmxvYWQKICAgICAgICB9ID0gQ29uZmlnOwogICAgICAgIC8qLS1sYW5nLS0qLwogICAgICAgIHZhciBsYW5nID0gewogICAgICAgICAgICBzZXQ6J+iuvue9ricsCiAgICAgICAgICAgIGljb25Qb3NpdGlvbjon5Zu+5qCH5L2N572uJywKICAgICAgICAgICAgcGxheVZpZGVvOifop4bpopHop6PmnpAnLAogICAgICAgICAgICBwbGF5TXVzaWM6J+mfs+S5kOS4i+i9vScsCiAgICAgICAgICAgIHpoTmljZTon55+l5LmO5aKe5by6JywKICAgICAgICAgICAgdmlkZW9Eb3dubG9hZDon6KeG6aKR5LiL6L29JywKICAgICAgICAgICAgYmFpZHVEb3dubG9hZDon55m+5bqm5LiL6L29JywKICAgICAgICAgICAgaWNvbkhlaWdodDon5Zu+5qCH6auY5bqmJywKICAgICAgICAgICAgaWNvbldpZHRoOiflm77moIflpKflsI8nLAogICAgICAgICAgICBpY29uTGluZTon5rC05bmz5L2N572uJywKICAgICAgICAgICAgaWNvbldhaXRUaW1lOifnrYnlvoXml7bpl7QnLAogICAgICAgICAgICBpY29uTGVmdDon6Z2g5bemJywKICAgICAgICAgICAgaWNvblJpZ2h0OifpnaDlj7MnLAogICAgICAgICAgICB0aXBJY29uSGVpZ2h0Oifpu5jorqQzNjAs5bu66K6uMX41MDAnLAogICAgICAgICAgICB0aXBJY29uV2lkdGg6J+m7mOiupDQwLOW7uuiurjIwfjUwJywKICAgICAgICAgICAgdGlwSWNvbk9wYWNpdHk6J+ivt+Whq+WGmTAtMTAw55qE5pW05pWwJywKICAgICAgICAgICAgdGlwRXJyb3JJY29uSGVpZ2h0Oic85Zu+5qCH5L2N572uPuS4reeahDzlm77moIfpq5jluqY+5bqU5Li6MTAwMOS7peWGheato+aVtOaVsO+8jOW7uuiurjF+NTAwJywKICAgICAgICAgICAgdGlwRXJyb3JJY29uV2lkdGg6Jzzlm77moIfkvY3nva4+5Lit55qEPOWbvuagh+Wkp+Wwjz7lupTkuLoxMDDku6XlhoXmraPmlbTmlbDvvIzlu7rorq4yMH41MCcsCiAgICAgICAgICAgIHRpcEVycm9ySWNvbk9wYWNpdHk6J+Whq+WGmeaVsOWtl+S4jeato+ehricsCiAgICAgICAgICAgIHNldFBsYXlWaWRlbzon6Kej5p6Q6K6+572uJywKICAgICAgICAgICAgcGxheVZpZGVvTGluZUFkZDon56uZ5aSW6Kej5p6QJywKICAgICAgICAgICAgdGlwUGxheVZpZGVvTGluZUFkZDon6K+35aGr5YWl57q/6Lev5ZCN56ew5ZKM5Zyw5Z2A77yM5Lit6Ze055So5Y2K6KeS6YCX5Y+36ZqU5byA77yM5q+P57q/6Lev5LiA6KGM44CCJywKICAgICAgICAgICAgemhTZXQ6J+efpeS5juiuvue9ricsCiAgICAgICAgICAgIHpoVmlkZW9DbG9zZTon5bGP6JS96KeG6aKRJywKICAgICAgICAgICAgemhWaWRlb0Rvd25sb2FkOifop4bpopHkuIvovb0nLAogICAgICAgICAgICB6aEFEQ2xvc2U6J+Wxj+iUveW5v+WRiicsCiAgICAgICAgICAgIHpoQ2xvc2VMZWZ0OiflhbPpl63kvqfovrnmoI8nLAogICAgICAgICAgICB6aENoYW5nZUxpbms6J+mTvuaOpeebtOaOpei3s+i9rCcsCiAgICAgICAgICAgIHNwZWNpYWxDb2x1bW46J+agh+iusOaWh+eroCcsCiAgICAgICAgICAgIHZpZGVvVGl0bGU6J+agh+iusOinhumikScsCiAgICAgICAgICAgIHpoS2V5d29yZENsb3NlOiflsY/olL3lhbPplK7or40nLAogICAgICAgICAgICB0aXBLZXl3b3JkOifor7fovpPlhaXlhbPplK7or40s55SoIiwi5Y+36ZqU5byAJywKICAgICAgICAgICAgYXV0aG9yTmFtZUNsb3NlOiflsY/olL3nlKjmiLcnLAogICAgICAgICAgICB0aXBBdXRob3JOYW1lOifor7fovpPlhaXnlKjmiLflkI0s55SoIiwi5Y+36ZqU5byAJywKICAgICAgICAgICAgeWFueHV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9tXC5tZ3R2XC5jb21cL2IvfSwKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbWF0Y2g6L21ndHZcLmNvbS8sYXJlYUNsYXNzTmFtZTonZXBpc29kZS1pdGVtcyBjbGVhcmZpeCd9LAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIueC1jb3Zlci1wbGF5YnRuLXdyYXAiLG5vZGVUeXBlOidjbGFzcycsbWF0Y2g6Ly50dlwuc29odVwuY29tL30sCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6InBsYXlWaWRlbyIsIG5vZGU6Ii54LWNvdmVyLXBsYXlidG4td3JhcCIsbm9kZVR5cGU6J2NsYXNzJyxtYXRjaDovbVwudHZcLnNvaHVcLmNvbS99LAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjcGxheWVyV3JhcCIsbm9kZVR5cGU6J2lkJyxtYXRjaDovZmlsbVwuc29odVwuY29tL30sCgogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBtYXRjaDovdHVkb3VcLmNvbS99LAoKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIixtYXRjaDovbGVcLmNvbS99LAoKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIixtYXRjaDovcHB0dlwuY29tL30sCgogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLG1hdGNoOi8xOTA1XC5jb20vfSwKCiAgICAgICAgICAgIF19XSwKCiAgICAgICAgICAgIGp4TXVzaWM6W3tpc09wZW46R01fZ2V0VmFsdWUoJ211c2ljTGlzdCcsJzIyJyksd2ViOlsKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheU11c2ljIixuYW1lOiduZXRlYXNlJyxtYXRjaDovXmh0dHBzPzpcL1wvbXVzaWNcLjE2M1wuY29tLyx0aXA6J+ivt+WcqOmfs+S5kOWNleabsumhteeCueWHu+Wbvuagh+S4i+i9vSd9LAoKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheU11c2ljIixuYW1lOidxcScsbWF0Y2g6L15odHRwcz86XC9cL3lcLnFxXC5jb20vLHRpcDon6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM5Zyo5pKt5pS+6aG154K55Ye75Zu+5qCH5LiL6L29J30sCgogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5TXVzaWMiLG5hbWU6J2t1Z291JyxtYXRjaDova3Vnb3VcLmNvbS8sdGlwOifor7fngrnlh7vmkq3mlL7pnIDopoHkuIvovb3nmoTmrYzmm7LvvIznhLblkI7lnKjnvZHpobXkuIvmlrnmkq3mlL7lmajlhoXngrnlh7si5LiL6L29Iid9LAoKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheU11c2ljIixuYW1lOidrdXdvJyxtYXRjaDova3V3b1wuY24vLHRpcDon6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSInfSwKCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6InBsYXlNdXNpYyIsbmFtZToneGltYWxheWEnLG1hdGNoOi9eaHR0cHM/OlwvXC93d3dcLnhpbWFsYXlhXC5jb20vLHRpcDon6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSInfQogICAgICAgICAgICBdfV0sCgogICAgICAgICAgICBwbGF5TGluZTpbCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLnuq/lh4AxIiwidXJsIjoiaHR0cHM6Ly9pbTE5MDcudG9wLz9qeD0iLCJtb2JpbGUiOjF9LAogICAgICAgICAgICAgICAgeyJuYW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bWUiOiLop6PmnpAiLCJ1cmwiOiJodHRwczovL2NrbW92LmNjeWpqZC5jb20vY2ttb3YvP3VybD0iLCJtb2JpbGUiOjB9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoi6Kej5p6QbGEiLCJ1cmwiOiJodHRwczovL2FwaS5qaWV4aS5sYS8/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLogIHmnb8iLCJ1cmwiOiJodHRwczovL3ZpcC5sYW9iYW5kcS5jb20vamlleGkucGhwP3VybD0iLCJtb2JpbGUiOjB9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoiTUFPIiwidXJsIjoiaHR0cHM6Ly93d3cubXRvc3ouY29tL20zdTgucGhwP3VybD0iLCJtb2JpbGUiOjB9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoiTTNVOCIsInVybCI6Imh0dHBzOi8vangubTN1OC50di9qaWV4aS8/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLor7rorq8iLCJ1cmwiOiJodHRwczovL3d3dy5ueGZsdi5jb20vP3VybD0iLCJtb2JpbGUiOjB9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoiT0siLCJ1cmwiOiJodHRwczovL29ranguY2MvP3VybD0iLCJtb2JpbGUiOjF9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoiUE0iLCJ1cmwiOiJodHRwczovL3d3dy5wbGF5bTN1OC5jbi9qaWV4aS5waHA/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLnm5jlj6QiLCJ1cmwiOiJodHRwczovL3d3dy5wYW5ndWppZXhpLmNjL2ppZXhpLnBocD91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IuS4g+WTpSIsInVybCI6Imh0dHBzOi8vangubm54di5jbi90di5waHA/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAg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gICAgICAgICAgaWNvblZpcE9wYWNpdHkgPSBHTV9nZXRWYWx1ZSgnaWNvbk9wYWNpdHknKSB8fCBHTV9nZXRWYWx1ZSgnaWNvbk9wYWNpdHknKSA9PSAwP0dNX2dldFZhbHVlKCdpY29uT3BhY2l0eScpOmljb25WaXBPcGFjaXR5OwoKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBHTV9yZWdpc3Rlck1lbnVDb21tYW5kKCLorr7nva4iLCAoKSA9PiB0aGlzLm1lbnVTZXQoKSk7CgogICAgICAgICAgICB9CgogICAgICAgICAgICBtZW51U2V0KCl7CgogICAgICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpczsKCiAgICAgICAgICAgICAgICBsZXQgbWVudVNldFN0eWxlID0gYAogICAgICAgICAgICAgICAgICAgICAgICAuemhtTWFza3sKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHotaW5kZXg6OTk5OTk5OTk5OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojMDAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGZpeGVkO3RvcDogMDtyaWdodDogMDtib3R0b206IDA7bGVmdDogMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wYWNpdHk6MC44OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC53cmFwLWJveHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHotaW5kZXg6MTAwMDAwMDAwMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOmZpeGVkOzt0b3A6IDUwJTtsZWZ0OiA1MCU7dHJhbnNmb3JtOiB0cmFuc2xhdGUoLTUwJSwgLTIwMHB4KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAzMDBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiAjNTU1OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDVweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OmhpZGRlbjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQ6MTZweCBudW1Gb250LFBpbmdGYW5nU0MtUmVndWxhcixUYWhvbWEsTWljcm9zb2Z0IFlhaGVpLHNhbnMtc2VyaWYgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OjQwMCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRXcmFwSGVhZHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2YyNDQ0MztoZWlnaHQ6NDBweDtjb2xvcjojZmZmO3RleHQtYWxpZ246Y2VudGVyO2xpbmUtaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNldFdyYXBMaXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7cGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNldFdyYXBMaSBsaXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOjFweCBzb2xpZCAjZWVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luOjBweCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzoxMnB4IDIwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO2FsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LXN0eWxlOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAuc2V0V3JhcExpQ29udGVudHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7anVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO2FsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNldFdyYXBTYXZlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246YWJzb2x1dGU7dG9wOi0ycHg7cmlnaHQ6MTBweDtmb250LXNpemU6MjRweDtjdXJzb3I6cG9pbnRlcgogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5pY29uU2V0Rm9vdHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOmFic29sdXRlO2JvdHRvbTowcHg7cGFkZGluZzoxMHB4IDIwcHg7d2lkdGg6MTAwJTsKICAgICAgICAgICAgICAgICAgICAgICAgei1pbmRleDoxMDAwMDAwMDA5O2JhY2tncm91bmQ6I2ZlZjllZjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldEZvb3RMaXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7cGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIC5pY29uU2V0Rm9vdExpIGxpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWZsZXg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjBweCAycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTJweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldEZvb3RMaSBsaSBhewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IzU1NTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldEZvb3RMaSBhOmhvdmVyIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmZTZkNzM7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLmljb25TZXRQYWdlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgei1pbmRleDoxMDAwMDAwMDAxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246YWJzb2x1dGU7dG9wOjBweDtsZWZ0OjMwMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZDojZmZmOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6MTAwJTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldFVsSGVhZHsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLmljb25TZXRQYWdlSGVhZHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206MXB4IHNvbGlkICNjY2M7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6NDBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZlNmQ3MzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDE1cHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLmljb25TZXRQYWdlTGl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5pY29uU2V0UGFnZUxpIGxpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC1zdHlsZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6OHB4IDIwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOjFweCBzb2xpZCAjZWVlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aGlodVNldFBhZ2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OjEwMDAwMDAwMDI7cG9zaXRpb246YWJzb2x1dGU7dG9wOjBweDtsZWZ0OjMwMHB4O2JhY2tncm91bmQ6I2ZmZjt3aWR0aDozMDBweDtoZWlnaHQ6MTAwJTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldFBhZ2VJbnB1dHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXggIWltcG9ydGFudDtqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhpaHVTZXRQYWdlTGl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OjMwMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3cteTogc2Nyb2xsOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAuemhpaHVTZXRQYWdlQ29udGVudHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXggIWltcG9ydGFudDtqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgLmNpcmN1bGFyewogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDQwcHg7aGVpZ2h0OiAyMHB4O2JvcmRlci1yYWRpdXM6IDE2cHg7dHJhbnNpdGlvbjogLjNzO2N1cnNvcjogcG9pbnRlcjtib3gtc2hhZG93OiAwIDAgM3B4ICM5OTkgaW5zZXQ7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnJvdW5kLWJ1dHRvbnsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAyMHB4O2hlaWdodDogMjBweDs7Ym9yZGVyLXJhZGl1czogNTAlO2JveC1zaGFkb3c6IDAgMXB4IDVweCByZ2JhKDAsMCwwLC41KTt0cmFuc2l0aW9uOiAuM3M7cG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5iYWNrewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiBzb2xpZCAjRkZGOyBib3JkZXItd2lkdGg6IDAgM3B4IDNweCAwOyBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHBhZGRpbmc6IDNweDt0cmFuc2Zvcm06IHJvdGF0ZSgxMzVkZWcpOyAgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgxMzVkZWcpO21hcmdpbi1sZWZ0OjEwcHg7Y3Vyc29yOnBvaW50ZXI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnRvLXJpZ2h0ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luLWxlZnQ6MjBweDsgZGlzcGxheTogaW5saW5lLWJsb2NrOyBwYWRkaW5nOiAzcHg7dHJhbnNmb3JtOiByb3RhdGUoLTQ1ZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgtNDVkZWcpO2N1cnNvcjpwb2ludGVyOwoKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldFNhdmV7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MjRweDtjdXJzb3I6cG9pbnRlcjttYXJnaW4tcmlnaHQ6NXB4O21hcmdpbi1ib3R0b206NHB4O2NvbG9yOiNGRkY7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnpobV9zZXRfcGFnZXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHotaW5kZXg6MTAwMDAwMDAwMzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOmFic29sdXRlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOjBweDtsZWZ0OjMwMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZDojZmZmOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6MTAwJTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2hlYWRlcnsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206MXB4IHNvbGlkICNjY2M7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6NDBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZlNmQ3MzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDE1cHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnpobV9zZXRfcGFnZV9jb250ZW50ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleCAhaW1wb3J0YW50O2p1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjthbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7cGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDI4MHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3cteTogc2Nyb2xsOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2xpc3Q6Oi13ZWJraXQtc2Nyb2xsYmFyIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8q5rua5Yqo5p2h5pW05L2T5qC35byPKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoIDogMHB4OyAgLyrpq5jlrr3liIbliKvlr7nlupTmqKrnq5bmu5rliqjmnaHnmoTlsLrlr7gqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnpobV9zZXRfcGFnZV9saXN0Ojotd2Via2l0LXNjcm9sbGJhci10aHVtYiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoemHjOmdouWwj+aWueWdlyovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzICAgOiAycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmU2ZDczOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXItdHJhY2sgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLyrmu5rliqjmnaHph4zpnaLovajpgZMqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdyAgIDogaW5zZXQgMCAwIDVweCByZ2JhKDAsIDAsIDAsIDAuMik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kICAgOiAjZWRlZGVkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogMTBweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2xpc3QgbGl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmJvcmRlci1ib3R0b206MXB4IHNvbGlkICNjY2M7Ki8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MTJweCAyMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTpibG9jazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206MXB4IHNvbGlkICNlZWU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgbGk6bGFzdC1jaGlsZHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206bm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3Njcm9sbHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXk6IHNjcm9sbCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsOjotd2Via2l0LXNjcm9sbGJhciB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoeaVtOS9k+agt+W8jyovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA6IDBweDsgIC8q6auY5a695YiG5Yir5a+55bqU5qiq56uW5rua5Yqo5p2h55qE5bC65a+4Ki8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMXB4OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsOjotd2Via2l0LXNjcm9sbGJhci10aHVtYiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoemHjOmdouWwj+aWueWdlyovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzICAgOiAycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmU2ZDczOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsOjotd2Via2l0LXNjcm9sbGJhci10cmFjayB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoemHjOmdoui9qOmBkyovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93ICAgOiBpbnNldCAwIDAgNXB4IHJnYmEoMCwgMCwgMCwgMC4yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQgICA6ICNlZGVkZWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAxMHB4OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC8qLWZvcm0tKi8KICAgICAgICAgICAgICAgICAgICAgICAgOnJvb3QgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLS1iYXNlLWNvbG9yOiAjNDM0YTU2OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLS13aGl0ZS1jb2xvci1wcmltYXJ5OiAjZjdmOGY4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLS13aGl0ZS1jb2xvci1zZWNvbmRhcnk6ICNmZWZlZmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLWdyYXktY29sb3ItcHJpbWFyeTogI2MyYzJjMjs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KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDE2cHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodDowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OiAwOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC13ZWJraXQtYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1tb3otYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkIHZhcigtLWdyYXktY29sb3ItcHJpbWFyeSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEuN2VtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDEuNzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAycHggMWVtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDAuM3M7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDo1NSU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keTotbXMtaW5wdXQtcGxhY2Vob2xkZXIgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IHZhcigtLWdyYXktY29sb3Itc2Vjb25kYXJ5KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keTo6LW1vei1wbGFjZWhvbGRlciB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5OjpwbGFjZWhvbGRlciB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICosIDo6YWZ0ZXIsIDo6YmVmb3JlIHsKICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogaW5pdGlhbCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5W2RhdGEtaXMtdmFsaWRdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmctcmlnaHQ6IDFlbTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keVtkYXRhLWlzLXZhbGlkPXRydWVdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tdmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5W2RhdGEtaXMtdmFsaWQ9ZmFsc2VdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93OiBpbnNldCAwIDAgMCAxcHggdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHk6Zm9jdXMgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1hY3RpdmUtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRsaW5lOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5Oi13ZWJraXQtYXV0b2ZpbGwgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbi1kZWxheTogOTk5OXM7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd2Via2l0LXRyYW5zaXRpb24tcHJvcGVydHk6IGJhY2tncm91bmQtY29sb3I7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uLXByb3BlcnR5OiBiYWNrZ3JvdW5kLWNvbG9yOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X192YWxpZGF0b3IgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1wb3NpdGlvbjogcmlnaHQgMC41ZW0gY2VudGVyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1yZXBlYXQ6IG5vLXJlcGVhdDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtc2l6ZTogMS41ZW07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OiAtMTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keVtkYXRhLWlzLXZhbGlkPWZhbHNlXSArIC50ZXh0LWlucHV0X192YWxpZGF0b3IgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1pbWFnZTogdmFyKC0taW52YWxpZC1pY29uKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBpbmhlcml0OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNnB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbjogYmFja2dyb3VuZC1jb2xvciAwLjVzIGVhc2Utb3V0OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6OTBweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveDo6YWZ0ZXIgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1ncmF5LWNvbG9yLXNlY29uZGFyeSkgdHJhbnNwYXJlbnQgdHJhbnNwYXJlbnQgdHJhbnNwYXJlbnQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItc3R5bGU6IHNvbGlkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXdpZHRoOiA2cHggNHB4IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3R0b206IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAiIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjogYXV0byAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlci1ldmVudHM6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodDogLTcycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHotaW5kZXg6IDE7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdC1ib3hfX2JvZHkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogaW5oZXJpdDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC13ZWJraXQtYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1tb3otYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkIHZhcigtLWdyYXktY29sb3ItcHJpbWFyeSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3I6IHBvaW50ZXI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEuN2VtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDEuNzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMWVtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZy1yaWdodDogY2FsYygxZW0gKyAxNnB4KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxNDAlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjE0cHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLXRvcDoycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLWJvdHRvbToycHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdC1ib3hfX2JvZHlbZGF0YS1pcy12YWxpZD10cnVlXSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLXZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS12YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdC1ib3hfX2JvZHlbZGF0YS1pcy12YWxpZD1mYWxzZV0gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveF9fYm9keS5mb2N1cy12aXNpYmxlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tYWN0aXZlLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1hY3RpdmUtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0bGluZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveF9fYm9keTotd2Via2l0LWF1dG9maWxsIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb24tZGVsYXk6IDk5OTlzOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC10cmFuc2l0aW9uLXByb3BlcnR5OiBiYWNrZ3JvdW5kLWNvbG9yOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbi1wcm9wZXJ0eTogYmFja2dyb3VuZC1jb2xvcjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC1hcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLW1vei1hcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiAxcHggc29saWQgdmFyKC0tZ3JheS1jb2xvci1wcmltYXJ5KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udDogaW5oZXJpdDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXR0ZXItc3BhY2luZzogaW5oZXJpdDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAxZW07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNpemU6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDAuNXMgZWFzZS1vdXQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnRleHRhcmVhX19ib2R5Om9ubHktY2hpbGQgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzaXplOiB2ZXJ0aWNhbDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHk6Zm9jdXMgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1hY3RpdmUtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRsaW5lOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0YXJlYV9fYm9keVtkYXRhLWlzLXZhbGlkPXRydWVdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tdmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLXZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHlbZGF0YS1pcy12YWxpZD1mYWxzZV0gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgLnRleHRhcmVhIC5fZHVtbXktYm94IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbi1oZWlnaHQ6IDI0MHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXdyYXA6IGJyZWFrLXdvcmQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAxZW07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aXNpYmlsaXR5OiBoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGl0ZS1zcGFjZTogcHJlLXdyYXA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b3JkLXdyYXA6IGJyZWFrLXdvcmQ7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnRvTGVmdE1vdmV7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuaW1hdGlvbjptb3ZlVG9MZWZ0IDAuNXMgaW5maW5pdGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjptb3ZlVG9MZWZ0IDAuNXMgaW5maW5pdGU7IC8qU2FmYXJpIGFuZCBDaHJvbWUqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLWl0ZXJhdGlvbi1jb3VudDoxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLWZpbGwtbW9kZTogZm9yd2FyZHM7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIEBrZXlmcmFtZXMgbW92ZVRvTGVmdHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20ge2xlZnQ6MjAwcHg7fQogICAgICAgICAgICAgICAgICAgICAgICAgICAgdG8ge2xlZnQ6MHB4O30KICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgQC13ZWJraXQta2V5ZnJhbWVzIG1vdmVUb0xlZnQgLypTYWZhcmkgYW5kIENocm9tZSovewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSB7bGVmdDoyMDBweDt9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAudG9SaWdodE1vdmV7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuaW1hdGlvbjptb3ZlVG9SaWdodCAycyBpbmZpbml0ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC13ZWJraXQtYW5pbWF0aW9uOm1vdmVUb1JpZ2h0IDJzIGluZmluaXRlOyAvKlNhZmFyaSBhbmQgQ2hyb21lKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi1pdGVyYXRpb24tY291bnQ6MTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi1maWxsLW1vZGU6IGZvcndhcmRzOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIEBrZXlmcmFtZXMgbW92ZVRvUmlnaHR7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tIHtsZWZ0OjBweDt9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDoyMDAwcHg7fQogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgbW92ZVRvUmlnaHQgLypTYWZhcmkgYW5kIENocm9tZSovewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgICAgICAgICAgICAgdG8ge2xlZnQ6MjAwcHg7fQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgYDsKCiAgICAgICAgICAgICAgICBkb21TdHlsZSAuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUobWVudVNldFN0eWxlKSk7CgogICAgICAgICAgICAgICAgZG9tSGVhZC5hcHBlbmRDaGlsZChkb21TdHlsZSk7CgogICAgICAgICAgICAgICAgdmFyIHNldExpc3RKc29uPSBbCiAgICAgICAgICAgICAgICAgICAgeydsaXN0TmFtZSc6bGFuZy5pY29uUG9zaXRpb24sJ3NldExpc3RJRCc6J2ljb25Qb3NpdGlvblNldFBhZ2UnLCdzZXRQYWdlSUQnOidtb3ZpZUljb25TZXRQYWdlJywndGFrZVBsYWNlJzonMHB4J30sCiAgICAgICAgICAgICAgICAgICAgeydsaXN0TmFtZSc6bGFuZy5wbGF5VmlkZW8sJ3NldExpc3RJRCc6J21vdmllTGlzdCcsJ3NldFBhZ2VJRCc6J21vdmllVmlkZW9TZXRQYWdlJywndGFrZVBsYWNlJzonMHB4J30sCiAgICAgICAgICAgICAgICAgICAgeydsaXN0TmFtZSc6bGFuZy5wbGF5TXVzaWMsJ3NldExpc3RJRCc6J211c2ljTGlzdCcsJ3NldFBhZ2VJRCc6JycsJ3Rha2VQbGFjZSc6JzBweCd9LAogICAgICAgICAgICAgICAgICAgIHsnbGlzdE5hbWUnOmxhbmcuemhOaWNlLCdzZXRMaXN0SUQnOid6aGlodUxpc3QnLCdzZXRQYWdlSUQnOid6aGlodUljb25TZXRQYWdlJywndGFrZVBsYWNlJzonMHB4J30sCiAgICAgICAgICAgICAgICAgICAgeydsaXN0TmFtZSc6bGFuZy52aWRlb0Rvd25sb2FkLCdzZXRMaXN0SUQnOid2aWRlb0Rvd25sb2FkTGlzdCcsJ3NldFBhZ2VJRCc6J3ZpZGVvRG93bmxvYWRTZXRQYWdlJywndGFrZVBsYWNlJzonMHB4J30sCiAgICAgICAgICAg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sYW5nLnpoS2V5d29yZENsb3NlLCdvcHRpb25JRCc6J3JlbW92ZUtleXdvcmQnLCdkZWZhdWx0JzonMCd9LAogICAgICAgICAgICAgICAgICAgIHsnb3B0aW9uTmFtZSc6bGFuZy5hdXRob3JOYW1lQ2xvc2UsJ29wdGlvbklEJzoncmVtb3ZlQXV0aG9yTmFtZScsJ2RlZmF1bHQnOicwJ30sCiAgICAgICAgICAgICAgICAgICAgeydvcHRpb25OYW1lJzpsYW5nLnlhbnh1YW5DbG9zZSwnb3B0aW9uSUQnOidyZW1vdmVZYW54dWFuJywnZGVmYXVsdCc6JzAnfQogICAgICAgICAgICAgICAgXTsKCiAgICAgICAgICAgICAgICB2YXIgcGxheVZpZGVvT3B0aW9uSnNvbiA9ewogICAgICAgICAgICAgICAgICAgICdvcHRpb25OYW1lJzpsYW5nLnBsYXlWaWRlb0xpbmVBZGQsCiAgICAgICAgICAgICAgICAgICAgJ29wdGlvbklEJzondmlkZW9QbGF5TGluZUFkZCcsCiAgICAgICAgICAgICAgICAgICAgJ2RlZmF1bHQnOnZpZGVvUGxheUxpbmVBZGQsCiAgICAgICAgICAgICAgICAgICAgJ3RleHRhcmVhJzondmlkZW9QbGF5TGluZUFkZFRleHRhcmVhJywKICAgICAgICAgICAgICAgICAgICAndGV4dGFyZWFJZCc6J3BsYXlWaWRlb0xpbmVUZXh0YXJlYScsCiAgICAgICAgICAgICAgICAgICAgJ3RpcCc6CmDnuq/lh4AxLGh0dHBzOi8vaW0xOTA3LnRvcC8/ang9CkLnq5kxLGh0dHBzOi8vanguanNvbnBsYXllci5jb20vcGxheWVyLz91cmw9CueIseixhixodHRwczovL2p4LmFpZG91ZXIubmV0Lz91cmw9CkJMLGh0dHBzOi8vdmlwLmJsamlleC5jb20vP3Y9CuWGsOixhixodHRwczovL2FwaS5xaWFucWkubmV0L3ZpcC8/dXJsPQrnmb7ln58saHR0cHM6Ly9qeC42MThnLmNvbS8/dXJsPQpDSyxodHRwczovL3d3dy5ja3BsYXllci52aXAvamlleGkvP3VybD0KQ0hvayxodHRwczovL3d3dy5nYWk0LmNvbS8/dXJsPQpja21vdixodHRwczovL3d3dy5ja21vdi52aXAvYXBpLnBocD91cmw9Ckg4LGh0dHBzOi8vd3d3Lmg4anguY29tL2ppZXhpLnBocD91cmw9CkpZLGh0dHBzOi8vangucGxheWVyankuY29tLz91cmw9Cuino+aekCxodHRwczovL2NrbW92LmNjeWpqZC5jb20vY2ttb3YvP3VybD0K6Kej5p6QbGEsaHR0cHM6Ly9hcGkuamlleGkubGEvP3VybD0K6ICB5p2/LGh0dHBzOi8vdmlwLmxhb2JhbmRxLmNvbS9qaWV4aS5waHA/dXJsPQpNQU8saHR0cHM6Ly93d3cubXRvc3ouY29tL20zdTgucGhwP3VybD0KTTNVOCxodHRwczovL2p4Lm0zdTgudHYvamlleGkvP3VybD0K6K+66K6vLGh0dHBzOi8vd3d3Lm54Zmx2LmNvbS8/dXJsPQpPSyxodHRwczovL29ranguY2MvP3VybD0KUE0saHR0cHM6Ly93d3cucGxheW0zdTguY24vamlleGkucGhwP3VybD0K55uY5Y+kLGh0dHBzOi8vd3d3LnBhbmd1amlleGkuY2MvamlleGkucGhwP3VybD0K5LiD5ZOlLGh0dHBzOi8vangubm54di5jbi90di5waHA/dXJsPQpSREhLLGh0dHBzOi8vangucmRoay5uZXQvP3Y9CuS6uuS6uui/tyxodHRwczovL2p4LmJsYm8uY2M6NDQzMy8/dXJsPQrmgJ3kupEsaHR0cHM6Ly9qeC5hcDJwLmNuLz91cmw9CuaAneWPpDMsaHR0cHM6Ly9qc2FwLmF0dGFraWRzLmNvbS8/dXJsPQrlkKzkuZAsaHR0cHM6Ly9qeC5kajZ1LmNvbS8/dXJsPQrnu7TlpJosaHR0cHM6Ly9qeC5pdml0by5jbi8/dXJsPQromb7nsbMsaHR0cHM6Ly9qeC54bWZsdi5jb20vP3VybD0K5LqR56uvLGh0dHBzOi8vc2IuNWdzZW8ubmV0Lz91cmw9CuS6keaekCxodHRwczov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Eh0bWwgKz0iPHVsIGNsYXNzPSd6aG1fc2V0X3BhZ2VfbGlzdCc+IjsKCiAgICAgICAgICAgICAgICBmb3IobGV0IGk9MDtpPHZpZGVvRG93bmxvYWRPcHRpb25Kc29uLmxlbmd0aDtpKyspewoKICAgICAgICAgICAgICAgICAgICBsZXQgYmFja0NvbG9yLHN3aXRjaEJhY2tDb3Jsb3IsZGlzcGxheTsKCiAgICAgICAgICAgICAgICAgICAgbGV0IG9wdGlvblZhbHVlID0gR01fZ2V0VmFsdWUodmlkZW9Eb3dubG9hZE9wdGlvbkpzb25baV0ub3B0aW9uSUQsdmlkZW9Eb3dubG9hZE9wdGlvbkpzb25baV0uZGVmYXVsdCk7CgogICAgICAgICAgICAgICAgICAgIGlmKG9wdGlvblZhbHVlICE9ICcyMicpewoKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZmYnOwoKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZGJzsKCiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXkgPSAnbm9uZSc7CgogICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZTZkNzMnOwoKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZFNUU1JzsKCiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXkgPSAnYmxvY2snOwoKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGxpPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nemhtX3NldF9wYWdlX2NvbnRlbnQnPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0gIjxzcGFuPiIrdmlkZW9Eb3dubG9hZE9wdGlvbkpzb25baV0ub3B0aW9uTmFtZSsiPC9zcGFu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GxldCBiYWNrQ29sb3Isc3dpdGNoQmFja0NvcmxvcixkaXNwbGF5OwoKICAgICAgICAgICAgICAgICAgICBsZXQgb3B0aW9uVmFsdWUgPSBHTV9nZXRWYWx1ZShwbGF5VmlkZW9PcHRpb25Kc29uLm9wdGlvbklELHBsYXlWaWRlb09wdGlvbkpzb24uZGVmYXVsdCk7CgogICAgICAgICAgICAgICAgICAgIGlmKG9wdGlvblZhbHVlICE9ICcyMicpewoKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZmYnOwoKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZGJzsKCiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICBiYWNrQ29sb3IgPSAnI2ZlNmQ3Myc7CgogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hCYWNrQ29ybG9yID0gJyNGRkU1RTUnOwoKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGxpPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nemhtX3NldF9wYWdlX2NvbnRlbnQnPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0gIjxzcGFuIGNsYXNzPSdwbGF5VmlkZW9PcHRpb25OYW1lJz4iK3BsYXlWaWRlb09wdGlvbkpzb24ub3B0aW9uTmFtZSsiPC9zcGFuPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nY2lyY3VsYXInIHN0eWxlPSdiYWNrZ3JvdW5kLWNvbG9yOiIrc3dpdGNoQmFja0NvcmxvcisiJyBpZD0nIitwbGF5VmlkZW9PcHRpb25Kc29uLm9wdGlvbklEKyInPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0ncm91bmQtYnV0dG9u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gICAgICAgc2V0SHRtbCArPSI8L2Rpdj4iCgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nemhpaHVTZXRQYWdlJyBpZD0nemhpaHVJY29uU2V0UGFnZSc+IjsKCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8dWwgY2xhc3M9J2ljb25TZXRVbEhlYWQnPjxsaSBjbGFzcz0naWNvblNldFBhZ2VIZWFkJz48c3BhbiBjbGFzcz0nYmFjayc+PC9zcGFuPjxzcGFuPiIrbGFuZy56aFNldCsiPC9zcGFuPjxzcGFuICBjbGFzcz0naWNvblNldFNhdmUnPsOXPC9saT48L3VsPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPHVsIGNsYXNzPSd6aG1fc2V0X3BhZ2VfbGlzdCcgc3R5bGU9J2hlaWdodDozMDBweCc+IjsKCiAgICAgICAgICAgICAgICBmb3IodmFyIG9wdGlvbk49MDtvcHRpb25OPHpoaWh1T3B0aW9uSnNvbi5sZW5ndGg7b3B0aW9uTisrKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tDb2xvcixzd2l0Y2hCYWNrQ29ybG9yOwoKICAgICAgICAgICAgICAgICAgICBsZXQgb3B0aW9uVmFsdWUgPSBHTV9nZXRWYWx1ZSh6aGlodU9wdGlvbkpzb25bb3B0aW9uTl0ub3B0aW9uSUQsemhpaHVPcHRpb25Kc29uW29wdGlvbk5dLmRlZmF1bHQpOwoKICAgICAgICAgICAgICAgICAgICBpZihvcHRpb25WYWx1ZSAhPSAnMjInKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tDb2xvciA9ICcjZmZmJzsKCiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaEJhY2tDb3Jsb3IgPSAnI0ZGRic7CgogICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZTZkNzMnOwoKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZFNUU1JzsKCiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjxsaSA+PGRpdiBjbGFzcz0nemhpaHVTZXRQYWdlQ29udGVudCc+PHNwYW4+Iit6aGlodU9wdGlvbkpzb25bb3B0aW9uTl0ub3B0aW9uTmFtZSsiPC9zcGFuPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nY2lyY3VsYXInIHN0eWxlPSdiYWNrZ3JvdW5kLWNvbG9yOiAiK3N3aXRjaEJhY2tDb3Jsb3IrIjsnIGlkPSIremhpaHVPcHRpb25Kc29uW29wdGlvbk5dLm9wdGlvbklEKyI+PGRpdiBjbGFzcz0ncm91bmQtYnV0dG9uJyBzdHlsZT0nYmFja2dyb3VuZDogIitiYWNrQ29sb3IrIjtsZWZ0OiAiK29wdGlvblZhbHVlKyJweDsnPjwvZGl2PjwvZGl2PjwvZGl2PiI7CgogICAgICAgICAgICAgICAgICAgIGlmKHpoaWh1T3B0aW9uSnNvbltvcHRpb25OXS5vcHRpb25JRCA9PSAncmVtb3ZlS2V5d29yZCcpewoKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleXdvcmRTaG93OwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoR01fZ2V0VmFsdWUoJ3JlbW92ZUtleXdvcmQnLCcwJykgPT0gJzIyJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5d29yZFNob3cgPSAnYmxvY2snOwoKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXl3b3JkU2hvdyA9ICdub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IHN0eWxlPSdtYXJnaW4tdG9wOjEwcHg7ZGlzcGxheToiK2tleXdvcmRTaG93KyI7cGFkZGluZzo1cHggMHB4OycgaWQ9J3poaWh1S2V5d29yZCc+PHNwYW4gY2xhc3M9J3RleHQtaW5wdXQnPjxpbnB1dCB2YWx1ZT0nIitHTV9nZXRWYWx1ZSgnaW5wdXRaaEtleXdvcmQnLCcnKSsiJyBpZD0naW5wdXRaaEtleXdvcmQnIGNsYXNzPSd0ZXh0LWlucHV0X19ib2R5JyBwbGFjZWhvbGRlcj0nIitsYW5nLnRpcEtleXdvcmQrIicgc3R5bGU9J3dpZHRoOjg4JSc+PHNwYW4+PC9kaXY+IjsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGlmKHpoaWh1T3B0aW9uSnNvbltvcHRpb25OXS5vcHRpb25JRCA9PSAncmVtb3ZlQXV0aG9yTmFtZScpewoKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF1dGhvck5hbWVTaG93OwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoR01fZ2V0VmFsdWUoJ3JlbW92ZUF1dGhvck5hbWUnLCcwJykgPT0gJzIyJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aG9yTmFtZVNob3cgPSAnYmxvY2snOwoKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRob3JOYW1lU2hvdyA9ICdub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IHN0eWxlPSdtYXJnaW4tdG9wOjEwcHg7ZGlzcGxheToiK2F1dGhvck5hbWVTaG93KyI7cGFkZGluZzo1cHggMHB4OycgaWQ9J3poaWh1QXV0aG9yTmFtZSc+PHNwYW4gY2xhc3M9J3RleHQtaW5wdXQnPjxpbnB1dCB2YWx1ZT0nIitHTV9nZXRWYWx1ZSgnaW5wdXRaaEF1dGhvck5hbWUnLCcnKSsiJyBpZD0naW5wdXRaaEF1dGhvck5hbWUnIGNsYXNzPSd0ZXh0LWlucHV0X19ib2R5JyBwbGFjZWhvbGRlcj0nIitsYW5nLnRpcEF1dGhvck5hbWUrIicgc3R5bGU9J3dpZHRoOjg4JSc+PHNwYW4+PC9kaXY+IjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8L2xpPiI7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8L3VsPiIKCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjwvZGl2PiI7CgogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8dWwgY2xhc3M9J2ljb25TZXRVbEhlYWQnPjxsaSBjbGFzcz0naWNvblNldFBhZ2VIZWFkJz48c3Bhbj48L3NwYW4+PHNwYW4+IitsYW5nLnNldCsiPC9zcGFuPjxzcGFuIGNsYXNzPSdpY29uU2V0U2F2ZSc+w5c8L3NwYW4+PC9saT48L3VsPiI7CgogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8dWwgY2xhc3M9J3NldFdyYXBMaSc+IjsKCiAgICAgICAgICAgICAgICBmb3IodmFyIHNldE49MDtzZXROPHNldExpc3RKc29uLmxlbmd0aDtzZXROKyspewoKICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdFZhbHVlID0gR01fZ2V0VmFsdWUoc2V0TGlzdEpzb25bc2V0Tl0uc2V0TGlzdElELCcyMicpOwoKICAgICAgICAgICAgICAgICAgICBsZXQgYmFja0NvbG9yLGFycm93Q29sb3Isc3dpdGNoQmFja0NvcmxvcjsKCiAgICAgICAgICAgICAgICAgICAgaWYobGlzdFZhbHVlICE9IDIyKXsKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZmYnOwogICAgICAgICAgICAgICAgICAgICAgICBhcnJvd0NvbG9yPSAnI0VFRSc7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaEJhY2tDb3Jsb3IgPSAnI0ZGRic7CgogICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICBiYWNrQ29sb3IgPSAnI2ZlNmQ3Myc7CiAgICAgICAgICAgICAgICAgICAgICAgIGFycm93Q29sb3IgPSAnI0NDQyc7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaEJhY2tDb3Jsb3IgPSAnI0ZGRTVFNSc7CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBpZihzZXRMaXN0SnNvbltzZXROXS5zZXRQYWdlSUQgPT0gJycpewogICAgICAgICAgICAgICAgICAgICAgICBhcnJvd0NvbG9yID0gJyNFRUUnOwogICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8bGk+PHNwYW4+IitzZXRMaXN0SnNvbltzZXROXS5saXN0TmFtZSsiPC9zcGFuPiI7CgogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nc2V0V3JhcExpQ29udGVudCc+IjsKCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IGNsYXNzPSdjaXJjdWxhcicgaWQ9JyIrc2V0TGlzdEpzb25bc2V0Tl0uc2V0TGlzdElEKyInIHN0eWxlPSdiYWNrZ3JvdW5kLWNvbG9yOiAiK3N3aXRjaEJhY2tDb3Jsb3IrIjsnPjxkaXYgY2xhc3M9J3JvdW5kLWJ1dHRvbicgc3R5bGU9J2JhY2tncm91bmQ6ICIrYmFja0NvbG9yKyI7bGVmdDogIitsaXN0VmFsdWUrInB4Jz48L2Rpdj48L2Rpdj4iOwoKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjxzcGFuIGNsYXNzPSd0by1yaWdodCcgZGF0YT0nIitzZXRMaXN0SnNvbltzZXROXS5zZXRQYWdlSUQrIicgdGFrZVBsYWNlPSciK3NldExpc3RKc29uW3NldE5dLnRha2VQbGFjZSsiJyBzdHlsZT0nYm9yZGVyOiBzb2xpZCAiK2Fycm93Q29sb3IrIjsgYm9yZGVyLXdpZHRoOiAwIDNweCAzcHggMDsnPjwvc3Bhbj48L2Rpdj48L2xpPiI7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8L3VsPiI7CgogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IHN0eWxlPSdoZWlnaHQ6NDBweDsnIGlkPSd6aG1UYWtlUGxhY2UnPjwvZGl2PiI7CgogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IGNsYXNzPSdpY29uU2V0Rm9vdCcgc3R5bGU9Jyc+IjsKCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9Ijx1bCBjbGFzcz0naWNvblNldEZvb3RMaSc+IjsKCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjxsaT48L2xpPiI7CgogICAgICAgICAgICAgICAgc2V0SHRtbCArPSc8L3VsPic7CgogICAgICAgICAgICAgICAgc2V0SHRtbCArPSc8L2Rpdj4nOwoKICAgICAgICAgICAgICAgIHNldEh0bWwgKz0gIjwvZGl2PiI7CgogICAgICAgICAgICAgICAgaWYoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3NldE1hc2snKSkgcmV0dXJuOwoKICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlRWxlbWVudCgnZGl2JywnemhtTWVudScpOwoKICAgICAgICAgICAgICAgIGxldCB6aG1NZW51ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3pobU1lbnUnKTsKCiAgICAgICAgICAgICAgICB6aG1NZW51LmlubmVySFRNTCA9IHNldEh0bWw7CgogICAgICAgICAgICAgICAgbGV0IHRpbWVyWmhtSWNvbiA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtTWVudScpKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXJaaG1JY29uKTsgLy8g5Y+W5raI5a6a5pe25ZmoCgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2lyY3VsYXIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuY2lyY3VsYXInKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNpcmN1bGFyLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIGZ1bmN0aW9uKF9lKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJ1dHRvblN0eWxlID0gaXRlbS5jaGlsZHJlblswXS5zdHlsZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxlZnQgPSBidXR0b25TdHlsZS5sZWZ0OwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gcGFyc2VJbnQobGVmdCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaXN0TGVmdFZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihsZWZ0PT0wKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlLmxlZnQgPSAnMjJweCc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidXR0b25TdHlsZS5iYWNrZ3JvdW5kID0gJyNmZTZkNzMnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5zdHlsZS5iYWNrZ3JvdW5kPScjZmZFNUU1JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ubmV4dFNpYmxpbmcgJiYgaXRlbS5uZXh0U2libGluZy5nZXRBdHRyaWJ1dGUoJ2RhdGEnKSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5uZXh0U2libGluZy5zZXRBdHRyaWJ1dGUoJ3N0eWxlJywnYm9yZGVyOiBzb2xpZCAjY2NjO2JvcmRlci13aWR0aDogMCAzcHggM3B4IDA7JykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdExlZnRWYWx1ZSA9IDIyOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlLmxlZnQgPSAnMHB4JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlLmJhY2tncm91bmQgPSAnI2ZmZic7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlLmJhY2tncm91bmQ9JyNmZmYnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbS5uZXh0U2libGluZyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5uZXh0U2libGluZy5zZXRBdHRyaWJ1dGUoJ3N0eWxlJywnYm9yZGVyOiBzb2xpZCAjRUVFO2JvcmRlci13aWR0aDogMCAzcHggM3B4IDA7JykKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RMZWZ0VmFsdWUgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNldExpc3RJRCA9IGl0ZW0uaWQ7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNldExpc3RJRCA9PSAncmVtb3ZlS2V5d29yZCcgJiYgbGlzdExlZnRWYWx1ZT09MjIpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3poaWh1S2V5d29yZCcpLnN0eWxlLmRpc3BsYXk9J2Jsb2NrJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobVRha2VQbGFjZScpLnN0eWxlPSAnaGVpZ2h0OjIyMHB4JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNldExpc3RJRCA9PSAncmVtb3ZlS2V5d29yZCcgJiYgbGlzdExlZnRWYWx1ZT09MCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhpaHVLZXl3b3JkJykuc3R5bGUuZGlzcGxheT0nbm9uZSc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2RvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1UYWtlUGxhY2UnKS5zdHlsZT0gJ2hlaWdodDoxODBweCc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzZXRMaXN0SUQgPT0gJ3JlbW92ZUF1dGhvck5hbWUnICYmIGxpc3RMZWZ0VmFsdWU9PTIyKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aGlodUF1dGhvck5hbWUnKS5zdHlsZS5kaXNwbGF5PSdibG9jayc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2V0TGlzdElEID09ICdyZW1vdmVBdXRob3JOYW1lJyAmJiBsaXN0TGVmdFZhbHVlPT0wKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aGlodUF1dGhvck5hbWUnKS5zdHlsZS5kaXNwbGF5PSdub25lJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKHNldExpc3RJRCxsaXN0TGVmdFZhbHVlKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9SaWdodCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy50by1yaWdodCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgdG9SaWdodC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxlZnQgPSBpdGVtLnByZXZpb3VzU2libGluZy5jaGlsZHJlblswXS5zdHlsZS5sZWZ0OwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gcGFyc2VJbnQobGVmdCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxlZnQgIT0gMjIpIHJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNldFBhZ2VJRCA9IGl0ZW0uZ2V0QXR0cmlidXRlKCdkYXRhJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYWdlSWQgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChzZXRQYWdlSUQpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlSWQuY2xhc3NOYW1lPSdpY29uU2V0UGFnZSB0b0xlZnRNb3ZlJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/nn6XkuY7orr7nva7mmoLkvY3pq5jluqYKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2V0UGFnZUlEPT0nemhpaHVJY29uU2V0UGFnZScpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobVRha2VQbGFjZScpLnN0eWxlPSBgaGVpZ2h0OjY4cHhgOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/lrp7ml7blm77moIfpq5jluqYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzZXRQYWdlSUQgPT0gJ21vdmllSWNvblNldFBhZ2UnKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNpY29uVG9wJykudmFsdWU9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI3pobWxvZ28iKS5vZmZzZXRUb3A7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b0JhY2sgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuYmFjaycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgdG9CYWNrLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIGZ1bmN0aW9uKGUpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyZW50RG9tID0gaXRlbS5wYXJlbnROb2RlLnBhcmVudE5vZGUucGFyZW50Tm9kZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50RG9tLmNsYXNzTmFtZT0naWNvblNldFBhZ2UgdG9SaWdodE1vdmUnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtVGFrZVBsYWNlJykuc3R5bGU9J2hlaWdodDo0MHB4OycKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZXRTYXZlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLmljb25TZXRTYXZlJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBzZXRTYXZlLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsKCk9PnsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb25Ub3AgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvblRvcCcpLnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvbk9wYWNpdHk9ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25PcGFjaXR5JykudmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uUG9zaXRpb24gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvblBvc2l0aW9uJykudmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uV2lkdGggPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvbldpZHRoJykudmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uV2FpdFRpbWUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvbldhaXRUaW1lJykudmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5VmlkZW9MaW5lVGV4dCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNwbGF5VmlkZW9MaW5lVGV4dGFyZWEnKS52YWx1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVZpZGVvTGluZUxlZnQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdmlkZW9QbGF5TGluZUFkZCcpLmNoaWxkcmVuWzBdLnN0eWxlLmxlZnQ7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbnB1dFpoS2V5d29yZCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpbnB1dFpoS2V5d29yZCcpLnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5wdXRBdXRob3JOYW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2lucHV0WmhBdXRob3JOYW1lJykudmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25Ub3AgIT0gJycpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoISgvKF5bMC05XVswLTldezAsMn0kKS8udGVzdChpY29uVG9wKSkpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KGxhbmcudGlwRXJyb3JJY29uSGVpZ2h0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdpY29uVG9wJyxpY29uVG9wKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25PcGFjaXR5ICE9ICcnKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoL14oPzowfFsxLTldWzAtOV0/fDEwMCkkLy50ZXN0KGljb25PcGFjaXR5KSkpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KGxhbmcudGlwRXJyb3JJY29uT3BhY2l0eSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaWNvbk9wYWNpdHknLGljb25PcGFjaXR5KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25Qb3NpdGlvbiAhPSAnJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaWNvblBvc2l0aW9uJyxpY29uUG9zaXRpb24pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWNvbldhaXRUaW1lICE9ICcnKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdpY29uV2FpdFRpbWUnLGljb25XYWl0VGltZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpY29uV2lkdGggIT0nJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighKC8oXihbMS05XVswLTldPykkKS8udGVzdChpY29uV2lkdGgpKSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxlcnQobGFuZy50aXBFcnJvckljb25XaWR0aCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaWNvbldpZHRoJyxpY29uV2lkdGgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoR01fZ2V0VmFsdWUoJ3ZpZGVvUGxheUxpbmVBZGQnKSA9PSAyMil7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwbGF5VmlkZW9MaW5lVGV4dCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpbmVPYmogPSBfdGhpcy5nZXRMaW5lKHBsYXlWaWRlb0xpbmVUZXh0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihsaW5lT2JqLmxlbmd0aD4wKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ3BsYXlWaWRlb0xpbmVUZXh0JyxwbGF5VmlkZW9MaW5lVGV4dCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxlcnQoJ+e6v+i3r+i+k+WFpeS4jeato+ehricpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdwbGF5VmlkZW9MaW5lVGV4dCcsJycpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ3BsYXlWaWRlb0xpbmVUZXh0JyxwbGF5VmlkZW9MaW5lVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpbnB1dFpoS2V5d29yZCAhPSAnJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaW5wdXRaaEtleXdvcmQnLGlucHV0WmhLZXl3b3JkKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihHTV9nZXRWYWx1ZSgnaW5wdXRaaEtleXdvcmQnKSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fZGVsZXRlVmFsdWUoJ2lucHV0WmhLZXl3b3JkJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpbnB1dEF1dGhvck5hbWUgIT0gJycpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2lucHV0WmhBdXRob3JOYW1lJyxpbnB1dEF1dGhvck5hbWUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCdpbnB1dFpoQXV0aG9yTmFtZScpKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9kZWxldGVWYWx1ZSgnaW5wdXRaaEF1dGhvck5hbWUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpc3RvcnkuZ28oMCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25Ub3AnKS5hZGRFdmVudExpc3RlbmVyKCdjaGFuZ2UnLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb25Ub3AgPSB0aGlzLnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoLyheWzEtOV1cZCokKS8udGVzdChpY29uVG9wKSkpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgnZGF0YS1pcy12YWxpZCcsJ2ZhbHNlJykKCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QXR0cmlidXRlKCdkYXRhLWlzLXZhbGlkJywndHJ1ZScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwoKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpY29uV2lkdGgnKS5hZGRFdmVudExpc3RlbmVyKCdjaGFuZ2UnLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb25XaWR0aCA9IHRoaXMudmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoISgvKF5bMS05XVxkKiQpLy50ZXN0KGljb25XaWR0aCkpKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBdHRyaWJ1dGUoJ2RhdGEtaXMtdmFsaWQnLCdmYWxzZScpCgoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgnZGF0YS1pcy12YWxpZCcsJ3RydWUnKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgIC8v6IW+6K6v6KeG6aKR5b+r5o236ZSu5Yay56qBCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNvdXBvblVybC5tYXRjaCgvdlwucXFcLmNvbVwveFwvY292ZXIvKSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGFkZExpbmVUZXh0ID1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjcGxheVZpZGVvTGluZVRleHRhcmVhJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTGluZVRleHQuYWRkRXZlbnRMaXN0ZW5lcigna2V5ZG93bicsZnVuY3Rpb24oZSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdGFydFBvcyA9IGFkZExpbmVUZXh0LnNlbGVjdGlvblN0YXJ0OwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZW5kUG9zID0gYWRkTGluZVRleHQuc2VsZWN0aW9uRW5kOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RhcnRQb3MgPT09IHVuZGVmaW5lZCB8fCBlbmRQb3MgPT09IHVuZGVmaW5lZCkgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlDb2RlLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlLmtleUNvZGUgPT0gaXRlbS5jb2RlICYmIGUuc2hpZnRLZXk9PWl0ZW0uaXNTaGlmdCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRleHRWYWx1ZSA9IGFkZExpbmVUZXh0LnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdGFydFZhbHVlID0gdGV4dFZhbHVlLnN1YnN0cmluZygwLHN0YXJ0UG9zKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZW5kVmFsdWUgPSB0ZXh0VmFsdWUuc3Vic3RyaW5nKHN0YXJ0UG9zKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYWxsVmFsdWUgPSBzdGFydFZhbHVlK2l0ZW0udmFsdWUrZW5kVmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTGluZVRleHQudmFsdWU9YWxsVmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTGluZVRleHQuc2VsZWN0aW9uU3RhcnQgPSBzdGFydFBvcysxOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZExpbmVUZXh0LnNlbGVjdGlvbkVuZCA9IGVuZFBvcysxOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGNyZWF0ZUVsZW1lbnQoZG9tLGRvbUlkKXsKCiAgICAgICAgICAgICAgICB2YXIgcm9vdEVsZW1lbnQgPSBkb2N1bWVudC5ib2R5OwoKICAgICAgICAgICAgICAgIHZhciBuZXdFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChkb20pOwoKICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuaWQgPSBkb21JZDsKCiAgICAgICAgICAgICAgICB2YXIgbmV3RWxlbWVudEh0bWxDb250ZW50ID0gZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoJycpOwoKICAgICAgICAgICAgICAgIHJvb3RFbGVtZW50LmFwcGVuZENoaWxkKG5ld0VsZW1lbnQpOwoKICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuYXBwZW5kQ2hpbGQobmV3RWxlbWVudEh0bWxDb250ZW50KTsKCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHJlcXVlc3QobWV0aG9kLHVybCxkYXRhLGlzQ29va2llPScnKXsKCiAgICAgICAgICAgICAgICBsZXQgcmVxdWVzdCA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpOwoKICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSxyZWplY3QpPT57CgogICAgICAgICAgICAgICAgICAgIHJlcXVlc3Qub25yZWFkeXN0YXRlY2hhbmdlPWZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihyZXF1ZXN0LnJlYWR5U3RhdGU9PTQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHJlcXVlc3Quc3RhdHVzPT0yMDApewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcXVlc3QucmVzcG9uc2VUZXh0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHJlcXVlc3Quc3RhdHVzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIHJlcXVlc3Qub3BlbihtZXRob2QsdXJsKTsKICAgICAgICAgICAgICAgICAgICBpZihpc0Nvb2tpZSl7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3Qud2l0aENyZWRlbnRpYWxzID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5zZXRSZXF1ZXN0SGVhZGVyKCdDb250ZW50LVR5cGUnLCAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyk7CiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5zZW5kKGRhdGEpOwoKICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICB9CgogICAgICAgICAgICBzZXRDb29raWUoY25hbWUsY3ZhbHVlLGV4ZGF5cyl7CgogICAgICAgICAgICAgICAgdmFyIGQgPSBuZXcgRGF0ZSgpOwoKICAgICAgICAgICAgICAgIGQuc2V0VGltZShkLmdldFRpbWUoKSsoZXhkYXlzKjI0KjYwKjYwKjEwMDApKTsKCiAgICAgICAgICAgICAgICB2YXIgZXhwaXJlcyA9ICJleHBpcmVzPSIrZC50b0dNVFN0cmluZygpOwoKICAgICAgICAgICAgICAgIGRvY3VtZW50LmNvb2tpZSA9IGNuYW1lKyI9IitjdmFsdWUrIjsgIitleHBpcmVzOwogICAgICAgICAgICB9CgogICAgICAgICAgICBnZXRDb29raWUoY25hbWUpewogICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBjbmFtZSArICI9IjsKICAgICAgICAgICAgICAgIHZhciBjYSA9IGRvY3VtZW50LmNvb2tpZS5zcGxpdCgnOycpOwogICAgICAgICAgICAgICAgZm9yKHZhciBpPTA7IGk8Y2EubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICB2YXIgYyA9IGNhW2ldLnRyaW0oKTsKICAgICAgICAgICAgICAgICAgICBpZiAoYy5pbmRleE9mKG5hbWUpPT0wKSB7IHJldHVybiBjLnN1YnN0cmluZyhuYW1lLmxlbmd0aCxjLmxlbmd0aCk7IH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiAiIjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZ2V0UXVlcnlTdHJpbmcoZSkgewogICAgICAgICAgICAgICAgdmFyIHQgPSBuZXcgUmVnRXhwKCIoXnwmKSIgKyBlICsgIj0oW14mXSopKCZ8JCkiKTsKICAgICAgICAgICAgICAgIHZhciBhID0gd2luZG93LmxvY2F0aW9uLnNlYXJjaC5zdWJzdHIoMSkubWF0Y2godCk7CiAgICAgICAgICAgICAgICBpZiAoYSAhPSBudWxsKSByZXR1cm4gYVsyXTsKICAgICAgICAgICAgICAgIHJldHVybiAiIjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZ2V0VXJsUGFyYW1zKHVybCl7CiAgICAgICAgICAgICAgICBsZXQgcmVnID0gLyhbXj8mKyNdKyk9KFtePyYrI10rKS9nOwogICAgICAgICAgICAgICAgbGV0IG9iaj17fTsKICAgICAgICAgICAgICAgIHVybC5yZXBsYWNlKHJlZywocmVzLCQxLCQyKT0+e29ialskMV09JDJ9KTsKICAgICAgICAgICAgICAgIHJldHVybiBvYmo7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGdldExpbmUodGV4dCl7CgogICAgICAgICAgICAgICAgbGV0IHRleHRBcnIgPSB0ZXh0LnNwbGl0KCdcbicpOwoKICAgICAgICAgICAgICAgIGlmKHRleHRBcnIubGVuZ3RoID4gMCl7CgogICAgICAgICAgICAgICAgICAgIGxldCBsaW5lT2JqID0gW107CgogICAgICAgICAgICAgICAgICAgIGxldCBtYXRjaCA9IC9eKC4rKShodHRwcz86XC9cLy4rKSQvOwoKICAgICAgICAgICAgICAgICAgICB0ZXh0QXJyLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gaXRlbS5yZXBsYWNlKC9ccyosKi9nLCcnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFpdGVtKSByZXR1cm4gdHJ1ZTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaW5lTWF0Y2ggPSBpdGVtLm1hdGNoKG1hdGNoKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxpbmVNYXRjaCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZU9iai5wdXNoKHsnbmFtZSc6bGluZU1hdGNoWzFdLnN1YnN0cmluZygwLDQpLCd1cmwnOmxpbmVNYXRjaFsyXX0pOwoKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZU9iaj1bXTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpbmVPYmo7CgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICBzdGF0aWMgZ2V0RWxlbWVudChjc3MpewoKICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSxyZWplY3QpPT57CgogICAgICAgICAgICAgICAgICAgIGxldCBudW0gPSAwOwoKICAgICAgICAgICAgICAgICAgICBsZXQgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgbnVtKysKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKGNzcyk7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihkb20pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoZG9tKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG51bT09MjApe2NsZWFySW50ZXJ2YWwodGltZXIpO3Jlc29sdmUoZmFsc2UpO30KICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICB9LDMwMCkKCiAgICAgICAgICAgICAgICAgICAgfSkKCgogICAgICAgICAgICB9CgogICAgICAgICAgICBzdGF0aWMgdG9hc3QobXNnLGR1cmF0aW9uKXsKCiAgICAgICAgICAgICAgICBkdXJhdGlvbj1pc05hTihkdXJhdGlvbik/MzAwMDpkdXJhdGlvbjsKCiAgICAgICAgICAgICAgICBsZXQgdG9hc3REb20gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsKCiAgICAgICAgICAgICAgICB0b2FzdERvbS5pbm5lckhUTUwgPSBtc2c7CgogICAgICAgICAgICAgICAgLy90b2FzdERvbS5zdHlsZS5jc3NUZXh0PSJ3aWR0aDogNjAlO21pbi13aWR0aDogMTUwcHg7b3BhY2l0eTogMC43O2hlaWdodDogMzBweDtjb2xvcjogcmdiKDI1NSwgMjU1LCAyNTUpO2xpbmUtaGVpZ2h0OiAzMHB4O3RleHQtYWxpZ246IGNlbnRlcjtib3JkZXItcmFkaXVzOiA1cHg7cG9zaXRpb246IGZpeGVkO3RvcDogNDAlO2xlZnQ6IDIwJTt6LWluZGV4OiA5OTk5OTk7YmFja2dyb3VuZDogcmdiKDAsIDAsIDApO2ZvbnQtc2l6ZTogMTJweDsiOwogICAgICAgICAgICAgICAgdG9hc3REb20uc3R5bGUuY3NzVGV4dD0ncGFkZGluZzoycHggMTVweDttaW4taGVpZ2h0OiAzNnB4O2xpbmUtaGVpZ2h0OiAzNnB4O3RleHQtYWxpZ246IGNlbnRlcjt0cmFuc2Zvcm06IHRyYW5zbGF0ZSgtNTAlKTtib3JkZXItcmFkaXVzOiA0cHg7Y29sb3I6IHJnYigyNTUsIDI1NSwgMjU1KTtwb3NpdGlvbjogZml4ZWQ7dG9wOiA1MCU7bGVmdDogNTAlO3otaW5kZXg6IDk5OTk5OTk7YmFja2dyb3VuZDogcmdiKDAsIDAsIDApO2ZvbnQtc2l6ZTogMTZweDsnCgogICAgICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZCh0b2FzdERvbSk7CgogICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKCiAgICAgICAgICAgICAgICAgICAgdmFyIGQgPSAwLjU7CgogICAgICAgICAgICAgICAgICAgIHRvYXN0RG9tLnN0eWxlLndlYmtpdFRyYW5zaXRpb24gPSAnLXdlYmtpdC10cmFuc2Zvcm0gJyArIGQgKyAncyBlYXNlLWluLCBvcGFjaXR5ICcgKyBkICsgJ3MgZWFzZS1pbic7CgogICAgICAgICAgICAgICAgICAgIHRvYXN0RG9tLnN0eWxlLm9wYWNpdHkgPSAnMCc7CgogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7IGRvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQodG9hc3REb20pIH0sIGQgKiAxMDAwKTsKCiAgICAgICAgICAgICAgICB9LCBkdXJhdGlvbik7CgogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vY3JlYXRlIHpobUxvZ29JY29uCiAgICAgICAgICAgIHpobUxvZ28oKXsKCiAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwoKICAgICAgICAgICAgICAgIGxldCBzb3J0RGl2ID0gaWNvblZpcFBvc2l0aW9uPT0nbGVmdCc/J3Jvdyc6J3Jvdy1yZXZlcnNlJzsKCiAgICAgICAgICAgICAgICBsZXQgcGxheVZpZGVvU3R5bGUgPSBgCiAgICAgICAgICAgICAgICAuemhtX3BsYXlfdmlkb2VfaWNvbnsKICAgICAgICAgICAgICAgICAgIHBhZGRpbmctdG9wOjJweDsKICAgICAgICAgICAgICAgICAgIGN1cnNvcjpwb2ludGVyOwogICAgICAgICAgICAgICAgICAgei1pbmRleDo5OTk5OTk7CiAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjpmaXhlZDske2ljb25WaXBQb3NpdGlvbn06NXB4O3RvcDoke2ljb25WaXBUb3B9cHg7CiAgICAgICAgICAgICAgICAgICB0ZXh0LWFsaWduOmNlbnRlcjsKICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OnZpc2libGU7CiAgICAgICAgICAgICAgICAgICBkaXNwbGF5OmZsZXg7CiAgICAgICAgICAgICAgICAgICBmbGV4LWRpcmVjdGlvbjoke3NvcnREaXZ9OwogICAgICAgICAgICAgICAgICAgd2lkdGg6YXV0bzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fcGxheV92aWRlb193cmFwewogICAgICAgICAgICAgICAgICAgei1pbmRleDo5OTk5OTk5OwogICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgICAgICAgIHdpZHRoOjMwMHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLmljb25Mb2dvewogICAgICAgICAgICAgICAgICAgIG9wYWNpdHk6JHtpY29uVmlwT3BhY2l0eS8xMDB9OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmV7CiAgICAgICAgICAgICAgICAgICB3aWR0aDozMjBweDsKICAgICAgICAgICAgICAgICAgIGhlaWdodDozMTZweDsKICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXk6c2Nyb2xsOwogICAgICAgICAgICAgICAgICAgb3ZlcmZsb3cteDpoaWRkZW47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX3BsYXlfdmlkZV9saW5lX3VsewogICAgICAgICAgICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBmbGV4LXN0YXJ0OwogICAgICAgICAgICAgICAgICAgZmxleC1mbG93OiByb3cgd3JhcDsKICAgICAgICAgICAgICAgICAgIGxpc3Qtc3R5bGU6IG5vbmU7CiAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjBweDsKICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7CgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGl7CiAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjRweCAwcHg7CiAgICAgICAgICAgICAgICAgICBtYXJnaW46MnB4OwogICAgICAgICAgICAgICAgICAgd2lkdGg6MzAlOwogICAgICAgICAgICAgICAgICAgY29sb3I6I0ZGRjsKICAgICAgICAgICAgICAgICAgIHRleHQtYWxpZ246Y2VudGVyOwogICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZjI0NDQzOwogICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzowcHggMHB4IDEwcHggI2ZmZjsKICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZToxNHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGk6aG92ZXJ7CiAgICAgICAgICAgICAgICAgICBjb2xvcjojMjYwMDMzOwogICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZmNjMGMwCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2xpbmVfc2VsZWN0ZWR7Ci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nlaV1Z1Vkc5SGFXWUFPdz09Jz4iCgogICAgICAgICAgICAgICAgIHBsYXlXcmFwSHRtbCArPSAiPGRpdj4iOwoKICAgICAgICAgICAgICAgICBfdGhpcy5jcmVhdGVFbGVtZW50KCdkaXYnLCd6aG1JY29uJyk7CgogICAgICAgICAgICAgICAgIGxldCB6aG1QbGF5ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3pobUljb24nKTsKCiAgICAgICAgICAgICAgICAgemhtUGxheS5pbm5lckhUTUwgPSBwbGF5V3JhcEh0bWw7CgogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy/lt6bplK7mjInkuIvmi5bliqgKICAgICAgICAgICAgIC8vdHlwZTrmoLnmja7kuI3lkIznsbvlnovvvIzlpITnkIblm77moIfljZXlh7vkuovliqEKICAgICAgICAgICAgIHpobUxvZ29EcmFnKHR5cGUsd2ViKXsKCiAgICAgICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpczsKCiAgICAgICAgICAgICAgICAgdmFywqB6aG1Mb2dvRHJhZz1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjemhtbG9nbyIpOwoKICAgICAgICAgICAgICAgICB2YXIgemhtTG9nb0ljb24gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIuaWNvbkxvZ28iKTsKCiAgICAgICAgICAgICAgICAgaWYoIXpobUxvZ29EcmFnIHx8ICF6aG1Mb2dvSWNvbilyZXR1cm47CgogICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLm9ubW91c2Vkb3duID0gZnVuY3Rpb24oZXZlbnQpewoKICAgICAgICAgICAgICAgICAgICAgaWYoZXZlbnQud2hpY2g9PTMpcmV0dXJuIGZhbHNlOy8v5bGP6JS95Y+z6ZSuCgogICAgICAgICAgICAgICAgICAgICBsZXQgc2Vkb3duVG9wID0gemhtTG9nb0RyYWcub2Zmc2V0VG9wOwoKICAgICAgICAgICAgICAgICAgICAgbGV0IHpobUxvZ29JY29uSGVpZ2h0ID0gemhtTG9nb0ljb24ub2Zmc2V0SGVpZ2h0OwoKICAgICAgICAgICAgICAgICAgICAgbGV0IGJvdHRvbVNwYWNlID0gMTA7CgogICAgICAgICAgICAgICAgICAgICBpZihldmVudC50YXJnZXQuY2xhc3NOYW1lICE9ICdpY29uTG9nbycpcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgLy9sZXTCoHNoaWZ0WMKgPcKgZXZlbnQuY2xpZW50WMKgLcKgemhtTG9nb0RyYWcuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkubGVmdDsKICAgICAgICAgICAgICAgICAgICAgbGV0IHNoaWZ0eCA9IDU7CgogICAgICAgICAgICAgICAgICAgICBsZXTCoHNoaWZ0WSA9IGV2ZW50LmNsaWVudFktemhtTG9nb0RyYWcuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkudG9wOwoKICAgICAgICAgICAgICAgICAgICAgemhtTG9nb0RyYWcuc3R5bGUucG9zaXRpb27CoD3CoCdmaXhlZCc7CgogICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5zdHlsZS56SW5kZXjCoD3CoDk5OTk5OTk7CgogICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZCh6aG1Mb2dvRHJhZyk7CgogICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbsKgb25Nb3VzZU1vdmUoZXZlbnQpewoKICAgICAgICAgICAgICAgICAgICAgICAgIC8vemhtTG9nb0RyYWcuc3R5bGUubGVmdMKgPcKgcGFnZVjCoC3CoHNoaWZ0WMKgK8KgJ3B4JzsKICAgICAgICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLmxlZnTCoD3CoCc1cHgnOwoKICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoZWlnaHQgPSB3aW5kb3cuaW5uZXJIZWlnaHQgLSB6aG1Mb2dvSWNvbkhlaWdodC1ib3R0b21TcGFjZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgeSA9IGV2ZW50LnBhZ2VZLXNoaWZ0WTsKCiAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gTWF0aC5taW4oTWF0aC5tYXgoMCwgeSksIGhlaWdodCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgemhtTG9nb0RyYWcuc3R5bGUudG9wID0geSsncHgnOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIC8v5ZyobW91c2Vtb3Zl5LqL5Lu25LiK56e75Yqo5Zu+5qCHCiAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNlbW92ZScsb25Nb3VzZU1vdmUpOwogICAgICAgICAgICAgICAgICAgICAvL+advuW8gOS6i+S7tgogICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5vbm1vdXNldXAgPSBmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaWNvblRvcCcsemhtTG9nb0RyYWcub2Zmc2V0VG9wKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5yZW1vdmVFdmVudExpc3RlbmVyKCdtb3VzZW1vdmUnLMKgb25Nb3VzZU1vdmUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLm9ubW91c2V1cMKgPcKgbnVsbDsKCiAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaGVpZ2h0ID0gemhtTG9nb0RyYWcub2Zmc2V0VG9wK3pobUxvZ29JY29uSGVpZ2h0K2JvdHRvbVNwYWNlOwoKICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHpobUxvZ29EcmFnLm9mZnNldFRvcCA8IDApewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5zdHlsZS50b3AgPScwcHgnOwogICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5pbm5lckhlaWdodCA8IGhlaWdodCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLnRvcCA9d2luZG93LmlubmVySGVpZ2h0LXpobUxvZ29JY29uSGVpZ2h0LWJvdHRvbVNwYWNlKydweCc7CgogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgLy9jbGlja+S6i+S7tuWkhOeQhgogICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoKHR5cGUpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd2aWRlbyc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih6aG1Mb2dvRHJhZy5vZmZzZXRUb3A9PXNlZG93blRvcCAmJiB3ZWIubGVuZ3RoID09IDAgJiYgemhtTG9nb0RyYWcub2Zmc2V0VG9wPjAgJiYgd2luZG93LmlubmVySGVpZ2h0ID4gaGVpZ2h0KXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivt+WcqOinhumikeaSreaUvumhteeCueWHu+WbvuaghycpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdtdXNpYyc6CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih6aG1Mb2dvRHJhZy5vZmZzZXRUb3A9PXNlZG93blRvcCAmJiBlLnRhcmdldC5jbGFzc05hbWUgPT0gJ2ljb25Mb2dvJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9kb2N1bWVudC5yZW1vdmVFdmVudExpc3RlbmVyKCdtb3VzZW1vdmUnLMKgb25Nb3VzZU1vdmUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vemhtTG9nb0RyYWcub25tb3VzZXVwwqA9wqBudWxsOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtdXNpY1VybERhdGEgPSBbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC9tdXNpY1wuMTYzXC5jb21cLyNcLyg/OnNvbmd8ZGopXD9pZC99LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHttYXRjaDovXmh0dHBzPzpcL1wveVwubXVzaWNcLjE2M1wuY29tXC9tXC8oPzpzb25nfGRqKVw/aWQvfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L15odHRwcz86XC9cL211c2ljXC4xNjNcLmNvbVwvKD86c29uZ3xkailcP2lkL30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC95XC5xcVwuY29tXC9uXC9yeXFxXC9wbGF5ZXIvfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L2t1Z291XC5jb20vfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L2t1d29cLmNuL30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC93d3dcLnhpbWFsYXlhXC5jb20vfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbXVzaWNVcmwgPSBtdXNpY1VybERhdGEuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbG9jYXRpb24uaHJlZi5tYXRjaChpdGVtLm1hdGNoKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG11c2ljVXJsLmxlbmd0aD09MCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCh3ZWJbMF0udGlwKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCh3ZWJbMF0ubmFtZSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbmV0ZWFzZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldGVhc2VGdW4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncXEnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxcUZ1bigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdrdWdvdSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGt1Z291RnVuKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2t1d28nOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrdXdvRnVuKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3hpbWFsYXlhJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeGltYWxheWFGdW4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gbmV0ZWFzZUZ1bigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0gX3RoaXMuZ2V0VXJsUGFyYW1zKGxvY2F0aW9uLmhyZWYpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih1cmxQYXJhbXMuaWQgPT0gdW5kZWZpbmVkKSByZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXRlYXNlVXJsRW5jb2RlID0gZW5jb2RlVVJJQ29tcG9uZW50KCdodHRwczovL211c2ljLjE2My5jb20vc29uZz9pZD0nK3VybFBhcmFtcy5pZCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcGVuVXJsID0gd2ViVXJsKyc/dXJsPScrbmV0ZWFzZVVybEVuY29kZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Lm9wZW4ob3BlblVybCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHFxRnVuKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBxcVNvbmdNYXRjaDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiLnBsYXllcl9tdXNpY19faW5mbyIpKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFxU29uZ01hdGNoID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiLnBsYXllcl9tdXNpY19faW5mbyIpLmNoaWxkTm9kZXNbMF0uaHJlZi5tYXRjaCgvc29uZ0RldGFpbFwvKFxTKilcPy8pOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZihkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjc2ltX3NvbmdfaW5mbyIpKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFxU29uZ01hdGNoID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI3NpbV9zb25nX2luZm8iKS5jaGlsZE5vZGVzWzBdLmhyZWYubWF0Y2goL3NvbmdcLyhcUyopLmh0bWwvKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxcVNvbmdNYXRjaCA9ICcnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXFxU29uZ01hdGNoWzFdKXtjb25zb2xlLmxvZygn5rKh5pyJ6I635Y+W5Yiw5q2M5puySUQnKTsgcmV0dXJufTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGF1ZGlvTGluayA9IGVuY29kZVVSSUNvbXBvbmVudChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJhdWRpbyIpLnNyYyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcGVuVXJsID0gd2ViVXJsKyc/aWQ9JytxcVNvbmdNYXRjaFsxXSsnJnR5cGU9cXEmcGxheVVybD0nK2F1ZGlvTGluazsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Lm9wZW4ob3BlblVybCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGt1Z291RnVuKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdWRpb01vZHVsZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNhdWRpb01vZHVsZScpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhdWRpb01vZHVsZSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYXVkaW9Nb2R1bGUnKS5zdHlsZT0nYm90dG9tOjBweDsnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3Nob3dIaWRlX3BsYXliYXInKS5jbGFzc05hbWUgPSAnaWNvbiBzaG93LXBsYXliYXItYnRuJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSInLDIwMDApCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGt1d29GdW4oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnBsYXlDb250cm9sJykuc3R5bGU9J2JvdHRvbTowcHgnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOeEtuWQjuWcqOe9kemhteS4i+aWueaSreaUvuWZqOWGheeCueWHuyLkuIvovb0iJywyMDAwKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB4aW1hbGF5YUZ1bigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcueG0tcGxheWVyJykuc3R5bGU9J2JvdHRvbTowcHgnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOeEtuWQjuWcqOe9kemhteS4i+aWueaSreaUvuWZqOWGheeCueWHuyLkuIvovb0iJywyMDAwKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd5b3V0dWJlJzoKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoKICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgIH07CgogICAgICAgICAgICAgICAgIH07CgogICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLm9uZHJhZ3N0YXJ0wqA9wqBmdW5jdGlvbigpewogICAgICAgICAgICAgICAgICAgICByZXR1cm7CoGZhbHNlOwogICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICB9CgogICAgICAgICAgICAgLy/kuIvovb0KICAgICAgICAgICAgc3RhdGljIExSX2Rvd25sb2FkKHVybCxmaWxlbmFtZSl7CgogICAgICAgICAgICAgICAgbGV0IHVhID0gbmF2aWdhdG9yLnVzZXJBZ2VudC50b0xvd2VyQ2FzZSgpOwogICAgICAgICAgICAgICAgY29uc29sZS5sb2codWEubWF0Y2goL3ZlcnNpb25cLyhbXGQuXSspLipzYWZhcmkvKSk7CgogICAgICAgICAgICAgICAgaWYodWEubWF0Y2goL3ZlcnNpb25cLyhbXGQuXSspLipzYWZhcmkvKSl7CgogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKHVybCk7CgogICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgIEdNX2Rvd25sb2FkKHVybCxmaWxlbmFtZSk7CiAgICAgICAgICAgICAgICB9CgoKICAgICAgICAgICAgfQoKICAgICAgICB9CgogICAgICAgIGNsYXNzIENvdXBvbkNsYXNzIGV4dGVuZHMgQmFzZUNsYXNzewoKICAgICAgICAgICAgY29uc3RydWN0b3IoKXsKCiAgICAgICAgICAgICAgICBzdXBlcigpOwoKICAgICAgICAgICAgICAgIHRoaXMuZGl2RWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpOwoKICAgICAgICAgICAgICAgIHRoaXMuZGl2RWxlbWVudC5pZD0nemhtX2Rpdl9zJzsKCiAgICAgICAgICAgIH0KICAgICAgICAgICAgdGFvYmFvKCl7CgogICAgICAgICAgICAgICAgbGV0IG5vZGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjSl9qdVZhbGlkJyk7CgogICAgICAgICAgICAgICAgbm9kZS5zdHlsZT0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ICAgICAgIGxldCBub2RlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnRtLW1zZy1ib3gnKTsKCiAgICAgICAgICAgICAgICBsZXQgY2xhc3NOYW1lID0gJ3pobV90YWJfdG1hbGwnOwoKICAgICAgICAgICAgICAgIHRoaXMuZ2V0Q291cG9uSW5mbyhub2RlLGNsYXNzTmFtZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgamQoKXsKICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoKCk9PnsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGpkR29vZHNJZCA9IGNvdXBvblVybC5tYXRjaCgvamRcLihoa3xjb20pXC8oXFMqKS5odG1sLyk7CgogICAgICAgICAgICAgICAgICAgIGxldCBub2RlPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjY2hvb3NlLWJ0bnMnKTsKCiAgICAgICAgICAgICAgICAgICAgbm9kZS5iZWZvcmUodGhpcy5kaXZFbGVtZW50KTsKCiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXF1ZXN0KCdnZXQnLGBodHRwczovL2FwaS50eXBlY2hyb21lLmNvbS9pbmRleF9qZF9uZXcucGhwP2dvb2RzX2lkPSR7amRHb29kc0lkWzJdfWApLnRoZW4oKHJlc3VsdCk9PnsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXNwPSBKU09OLnBhcnNlKHJlc3VsdCk7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbD0nJzsKCiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3AuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBodG1sICs9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYAogICAgICAgIDxkaXYgY2xhc3M9InpobV9jb3Vwb24iIHN0eWxlPSJtYXJnaW4tbGVmdDoxMHB4OyI+CiAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9sZWZ0Ij4KIC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AgICAgICAgICAgICB9KQoKCgogICAgICAgICAgICAgICAgfSxjb3Vwb25XYWl0VGltZSkKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZ2V0Q291cG9uSW5mbyhub2RlLGNsYXNzTmFtZSl7CgogICAgICAgICAgICAgICAgc2V0VGltZW91dCgoKT0+ewoKICAgICAgICAgICAgICAgICAgICBsZXQgZ29vZHNfaWQgPSB0aGlzLmdldFF1ZXJ5U3RyaW5nKCdpZCcpOwoKICAgICAgICAgICAgICAgICAgICBpZighZ29vZHNfaWQpe2NvbnNvbGUubG9nKCdnb29kc19pZCcpO3JldHVybn07CgogICAgICAgICAgICAgICAgICAgIGlmKGNsYXNzTmFtZSA9PSAnemhtX3RhYl90YW9iYW8nKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUucXVlcnlTZWxlY3RvcignZGl2Om50aC1vZi10eXBlKDEpJykuYmVmb3JlKHRoaXMuZGl2RWxlbWVudCk7CgogICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICBub2RlLmJlZm9yZSh0aGlzLmRpdkVsZW1lbnQpOwogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXF1ZXN0KCdnZXQnLGBodHRwczovL2FwaS50eXBlY2hyb21lLmNvbS9pbmRleF9uZXcucGhwP2dvb2RzX2lkPSR7Z29vZHNfaWR9YCkudGhlbigocmVzdWx0KT0+ewoKICAgICAgICAgICAgICAgICAgICAgICAgaWYocmVzdWx0KXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzcD0gSlNPTi5wYXJzZShyZXN1bHQpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgCiAgICAgICAgPGRpdiBjbGFzcz0iemhtX2NvdXBvbiI+CiAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9sZWZ0Ij4KICA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1cERqRytISXJuYTNtOTF2bENPVTJaRHVkUDlSM2E2Y01UQzVDTzk0RVZMZXZpVUZ2ZXBkcjBIYXExZUhjQ1c5NHAwdWZmMTIzL2pLbHlEMFBhL284bXZjOW01REhrdDBoNElYek9EOHlLTm5lQ013Y050N0lMOWErTUlZWGhDaEpKemJlb1J5dUNueTczOWI5V0VRLzFLMUl4Wklaa3hzcGNpa21DRGxhQ09MdjRYRkZ3K2tRdG53MURHdVlWclNoc2ttMnFDcGpjbGhyV1BJaXpsRlByS05DZkl5UWtIMUlHUGpTem1YVE9KbWNhT0o5ZGdHYWxGTTVZR1VFcXpaS0FjK1JuUVBjdkJZZ0QybHNqbFcwMlVONWJZNXhJaGRNanI2OTlwbzFMakxCeEdITXJXMFN6empzbGhhVWhRdi9Wd1Fkb0EwUmNDZzZKUUpIUnROS2JORkh2MU1RQUFBSWY0VlRXRmtaU0IzYVhSb0lGTmpjbVZsYmxSdlIybG1BRHM9IiA+ICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9jb250ZW50Ij4KICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fbW9uZXkiPgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fYW1vdW50X21vbmV5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9tb25leV9zaWduIj7CpTwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX21vbmV5X251bSI+JHtyZXNwLnlvdWh1aXF1YW59PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fY29uZGl0aW9uIj4ke3Jlc3AuY291cG9uX2luZm99PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX3RpbWUiPgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fdGVybSI+5pyJ5pWI5pyfPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9kYXRlIj4ke3Jlc3AuY291cG9uX2VuZF90aW1lfTwvZGl2PgogICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fY2lyY2xlIj48L2Rpdj4KICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2xpbmtfY291cG9uIiBzdHlsZT0ibWFyZ2luLXJpZ2h0OiI+CiAgICAgICAgICAgIDxhIGNsYXNzPSJ6aG1fbGlua190ZXh0Ij7miavnoIHpooblj5Y8L2E+CiAgICAgICAgICAgIDxkaXYgaWQ9InRicXJjb2RlIiBjbGFzcz0iemhtX3FyY29kZSI+PC9kaXY+CiAgICAgICAgICAgIDwvZGl2PgogICAgICAgIDwvZGl2PgogICAgICAgIGA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnemhtX2Rpdl9zJykuaW5uZXJIVE1MPWh0bWw7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHFyY29kZSA9IG5ldyBRUkNvZGUoInRicXJjb2RlIiwgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiA2NywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDY3LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yRGFyayA6ICIjMTIxMjEyIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvckxpZ2h0IDogIiNmZmZmZmYiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvcnJlY3RMZXZlbCA6IFFSQ29kZS5Db3JyZWN0TGV2ZWwuTQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgcXJjb2RlLm1ha2VDb2RlKHJlc3AuY29kZV91cmwpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5BY3Rpb25zLS1yb290LS1od0V1amdjJykpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuQWN0aW9ucy0tcm9vdC0taHdFdWpnYycpLnN0eWxlPSJwb3NpdGlvbjp1bnNldCI7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgIH0sY291cG9uV2FpdFRpbWUpOwogICAgICAgICAgICB9CgogICAgICAgIH0KCiAgICAgICAgY2xhc3MgUGxheVZpZGVvQ2xhc3MgZXh0ZW5kcyBCYXNlQ2xhc3N7CiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCl7CiAgICAgICAgICAgICAgICBzdXBlcigpOwogICAgICAgICAgICB9CgogICAgICAgIH0KCiAgICAgICAgY2xhc3MgUGxheU11c2ljQ2xhc3MgZXh0ZW5kcyBCYXNlQ2xhc3N7CiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCl7CiAgICAgICAgICAgICAgICBzdXBlcigpOwogICAgICAgICAgICB9CgogICAgICAgICAgICB4bWx5Q3JlYXRlQ2hlY2tib3goKXsKCiAgICAgICAgICAgICAgICBsZXQgc291bmRMaXN0bGkgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuc291bmQtbGlzdCB1bCBsaScpOwoKICAgICAgICAgICAgICAgIHNvdW5kTGlzdGxpLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgIGxldCBjaGVja2JveGVkID0gaXRlbS5xdWVyeVNlbGVjdG9yKCdpbnB1dCcpOwoKICAgICAgICAgICAgICAgICAgICBpZihjaGVja2JveGVkKXsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gaXRlbS5xdWVyeVNlbGVjdG9yKCcudGV4dCcpOwoKICAgICAgICAgICAgICAgICAgICBpZighdGl0bGUpewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgfTsKCiAgICAgICAgICAgICAgICAgICAgdGl0bGUuc3R5bGUgPSAid2lkdGg6MzYwcHgiOwoKICAgICAgICAgICAgICAgICAgICBsZXQgc3JjID0gdGl0bGUucXVlcnlTZWxlY3RvcignYScpLmdldEF0dHJpYnV0ZSgnaHJlZicpOwoKICAgICAgICAgICAgICAgICAgICBsZXQgZmlyc3REb20gPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJy5pY29uLXdyYXBwZXInKTsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGlucHV0RG9tID0gZmlyc3REb20uY2xvbmVOb2RlKHRydWUpOwoKICAgICAgICAgICAgICAgICAgICBpbnB1dERvbS5zdHlsZT0gJ21pbi13aWR0aDogMHB4Oyc7CgogICAgICAgICAgICAgICAgICAgIGlucHV0RG9tLmlubmVySFRNTCA9ICI8aW5wdXQgdHlwZT0nY2hlY2tib3gnIG5hbWU9J3pobUNoZWNrYm94JyB2YWx1ZT0iK3NyYysiID4iOwoKICAgICAgICAgICAgICAgICAgICBmaXJzdERvbS5iZWZvcmUoaW5wdXREb20pOwoKICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBjbGFzcyBaaENsYXNzIGV4dGVuZHMgQmFzZUNsYXNzewoKICAgICAgICAgICAgY29uc3RydWN0b3IoKXsKICAgICAgICAgICAgICAgIHN1cGVyKCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2hvd1NwZWNpYWxDb2x1bW4oKXsKCiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmID09ICdodHRwczovL3d3dy56aGlodS5jb20vJyl7CgogICAgICAgICAgICAgICAgICAgIGxldCBjYXJkUmVjb21tZW5kID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkZlZWQnKTsKCiAgICAgICAgICAgICAgICAgICAgaWYoY2FyZFJlY29tbWVuZC5sZW5ndGggPjApewoKICAgICAgICAgICAgICAgICAgICAgICAgY2FyZFJlY29tbWVuZC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ucXVlcnlTZWxlY3RvcignLnNwZWNpYWxDb2x1bW4nKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhWm9wID0gSlNPTi5wYXJzZShpdGVtLmdldEF0dHJpYnV0ZSgnZGF0YS16YS1leHRyYS1tb2R1bGUnKSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWRhdGFab3ApcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZGF0YVpvcC5jYXJkLmNvbnRlbnQudHlwZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlID09ICdQb3N0Jyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0ZW0ucXVlcnlTZWxlY3RvcignZGl2PmRpdj5oMj5zcGFuPmEnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXRpdGxlKXJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld0VsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdidXR0b24nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RWxlbWVudC5jbGFzc05hbWUgPSAnc3BlY2lhbENvbHVtbiBCdXR0b24gVm90ZUJ1dHRvbiBWb3RlQnV0dG9uLS11cCc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuc3R5bGUgPSAnbGluZS1oZWlnaHQ6MjBweDtwYWRkaW5nOjBweCA1cHg7bWFyZ2luLXJpZ2h0OjVweDtib3JkZXItcmFkaXVzOjJweDsnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmlubmVyVGV4dCA9ICfmlofnq6AnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZS5iZWZvcmUobmV3RWxlbWVudCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5tYXRjaCgvaHR0cHM/OlwvXC93d3cuemhpaHUuY29tXC9zZWFyY2gvKSl7CiAgICAgICAgICAgICAgICAgICAgbGV0IG49MDsKCiAgICAgICAgICAgICAgICAgICAgbGV0IHRpbWVyPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNhcmRTZWFyY2ggPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuU2VhcmNoUmVzdWx0LUNhcmQnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKG4rKz42MDApewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNhcmRTZWFyY2gubGVuZ3RoID4wKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXJkU2VhcmNoLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ucXVlcnlTZWxlY3RvcignLnNwZWNpYWxDb2x1bW4nKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhWm9wID0gSlNPTi5wYXJzZShpdGVtLmdldEF0dHJpYnV0ZSgnZGF0YS16YS1leHRyYS1tb2R1bGUnKSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFkYXRhWm9wKXJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhWm9wLmNhcmQuY29udGVudC50eXBlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlID09ICdQb3N0Jyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJ2Rpdj5kaXY+aDI+c3Bhbj5kaXY+YScpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXRpdGxlKXJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYnV0dG9uJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmNsYXNzTmFtZSA9ICdzcGVjaWFsQ29sdW1uIEJ1dHRvbiBWb3RlQnV0dG9uIFZvdGVCdXR0b24tLXVwJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuc3R5bGUgPSAnbGluZS1oZWlnaHQ6MjBweDtwYWRkaW5nOjBweCA1cHg7bWFyZ2luLXJpZ2h0OjVweDsnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RWxlbWVudC5pbm5lclRleHQgPSAn5paH56ugJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlLmJlZm9yZShuZXdFbGVtZW50KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgfQoKCiAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2hvd1ZpZGVvVGl0bGUoKXsKCiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmID09ICdodHRwczovL3d3dy56aGlodS5jb20vJyl7CgogICAgICAgICAgICAgICAgICAgIGxldCBjYXJkUmVjb21tZW5kID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkZlZWQnKTsKCiAgICAgICAgICAgICAgICAgICAgaWYoY2FyZFJlY29tbWVuZC5sZW5ndGggPjApewoKICAgICAgICAgICAgICAgICAgICAgICAgY2FyZFJlY29tbWVuZC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ucXVlcnlTZWxlY3RvcignLnZpZGVvVGl0bGUnKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhWm9wID0gSlNPTi5wYXJzZShpdGVtLmdldEF0dHJpYnV0ZSgnZGF0YS16YS1leHRyYS1tb2R1bGUnKSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWRhdGFab3ApcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoYXNWaWRlbyA9IGRhdGFab3AuY2FyZC5oYXNfdmlkZW87CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaGFzVmlkZW8gPT0gdHJ1ZSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbS5xdWVyeVNlbGVjdG9yKCdkaXY+ZGl2PmgyPmRpdj5hJykpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJ2Rpdj5kaXY+aDI+ZGl2PmEnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoaXRlbS5xdWVyeVNlbGVjdG9yKCdkaXY+ZGl2PmgyPnNwYW4+YScpKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gaXRlbS5xdWVyeVNlbGVjdG9yKCdkaXY+ZGl2PmgyPnNwYW4+YScpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYnV0dG9uJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuY2xhc3NOYW1lID0gJ3ZpZGVvVGl0bGUnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LnN0eWxlID0gJ2JhY2tncm91bmQ6IHJnYmEoMjU1LCAxMzEsIDg2LCAwLjEyKTtjb2xvcjogcmdiKDI1NSwgNzMsIDEyKTtsaW5lLWhlaWdodDoyMHB4O3BhZGRpbmc6MXB4IDZweDttYXJnaW4tcmlnaHQ6NXB4O2JvcmRlci1yYWRpdXM6MnB4O2ZvbnQtc2l6ZToxNHB4Oyc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuaW5uZXJUZXh0ID0gJ+inhumikSc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlLmJlZm9yZShuZXdFbGVtZW50KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLm1hdGNoKC9odHRwcz86XC9cL3d3dy56aGlodS5jb21cL3NlYXJjaC8pKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IG49MDsKCiAgICAgICAgICAgICAgICAgICAgbGV0IHRpbWVyPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNhcmRTZWFyY2ggPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuU2VhcmNoUmVzdWx0LUNhcmQnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKG4rKz42MDApewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNhcmRTZWFyY2gubGVuZ3RoID4wKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXJkU2VhcmNoLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ucXVlcnlTZWxlY3RvcignLnZpZGVvVGl0bGUnKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhWm9wID0gSlNPTi5wYXJzZShpdGVtLmdldEF0dHJpYnV0ZSgnZGF0YS16YS1leHRyYS1tb2R1bGUnKSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFkYXRhWm9wKXJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhWm9wLmNhcmQuY29udGVudC50eXBlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlID09ICdadmlkZW8nICl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJ2Rpdj5kaXY+aDI+c3Bhbj5kaXY+YScpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXRpdGxlKXJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYnV0dG9uJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmNsYXNzTmFtZSA9ICd2aWRlb1RpdGxlJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuc3R5bGUgPSAnYmFja2dyb3VuZDogcmdiYSgyNTUsIDEzMSwgODYsIDAuMTIpO2NvbG9yOiByZ2IoMjU1LCA3MywgMTIpO2xpbmUtaGVpZ2h0OjIwcHg7cGFkZGluZzoxcHggNnB4O21hcmdpbi1yaWdodDo1cHg7Ym9yZGVyLXJhZGl1czoycHg7Zm9udC1zaXplOjE0cHg7JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuaW5uZXJUZXh0ID0gJ+inhumikSc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZS5iZWZvcmUobmV3RWxlbWVudCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCgogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfQogICAgICAgICAgICByZW1vdmVWaWRlbygpewoKICAgICAgICAgICAgICAgIGxldCBjYXJkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkZlZWQnKTsKCiAgICAgICAgICAgICAgICBjYXJkLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgIGxldCBkYXRhWm9wID0gSlNPTi5wYXJzZShpdGVtLmdldEF0dHJpYnV0ZSgnZGF0YS16YS1leHRyYS1tb2R1bGUnKSk7CgogICAgICAgICAgICAgICAgICAgIGxldCB2aWRlbyA9IGRhdGFab3AuY2FyZC5jb250ZW50LnZpZGVvX2lkOwoKICAgICAgICAgICAgICAgICAgICBpZih2aWRlbyl7CgogICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnBhcmVudE5vZGUuc3R5bGU9J2Rpc3BsYXk6bm9uZTsnOwoKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgfQogICAgICAgICAgICByZW1vdmVBRCgpewoKICAgICAgICAgICAgICAgIGxldCB6aEhpZGVBRCA9IGAuUGMtY2FyZCwuUGMtd29yZHtkaXNwbGF5Om5vbmUgIWltcG9ydGFudDt9LlRvcHN0b3J5SXRlbS0tYWR2ZXJ0Q2FyZHtkaXNwbGF5Om5vbmUgIWltcG9ydGFudH1gOwoKICAgICAgICAgICAgICAgIGRvbVN0eWxlIC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSh6aEhpZGVBRCkpOwoKICAgICAgICAgICAgICAgIGRvbUhlYWQuYXBwZW5kQ2hpbGQoZG9tU3R5bGUpOwoKICAgICAgICAgICAgfQogICAgICAgICAgICBkb3dubG9hZFZpZGVvKCl7CgogICAgICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpczsKICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLm1hdGNoKC9odHRwczpcL1wvd3d3XC56aGlodVwuY29tXC96dmlkZW9cLy4rLykpewoKICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuemhtRG93bmxvYWQnKSlyZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9Eb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCd2aWRlbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ3ZpZGVvJykpOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJ1dHRvbiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5fZTI5NnBnJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihidXR0b24ubGVuZ3RoPDIpcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRvd25sb2FkQnV0ID0gYnV0dG9uWzFdLmNsb25lTm9kZSh0cnVlKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFkb3dubG9hZEJ1dC5xdWVyeVNlbGVjdG9yKCcuXzF0ZzhvaXInKSlyZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEJ1dC5xdWVyeVNlbGVjdG9yKCcuXzF0ZzhvaXInKS5pbm5lclRleHQ9J+S4i+i9vSc7CgogICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEJ1dC5zZXRBdHRyaWJ1dGUoJ2lkJywnZG93bmxvYWRWaWRlbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgYnV0dG9uWzFdLmJlZm9yZShkb3dubG9hZEJ1dCk7CgogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjZG93bmxvYWRWaWRlbycpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWRlb0lkOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5aVmlkZW8tcGxheWVyJykpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgelZpZGVvID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLlpWaWRlbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9EYXRhID0gSlNPTi5wYXJzZSh6VmlkZW8uZ2V0QXR0cmlidXRlKCdkYXRhLXphLWV4dHJhLW1vZHVsZScpKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9JZCA9IHZpZGVvRGF0YS5jYXJkLmNvbnRlbnQudmlkZW9faWQ7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb1VybCA9IHdpbmRvdy5sb2NhdGlvbi5ocmVmOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9PYmogPSB2aWRlb1VybC5zcGxpdCgnPycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb0lkID0gdmlkZW9PYmpbMF0uc3BsaXQoJy8nKS5wb3AoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9JZCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+acquiOt+WPluinhumikWlkJyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpoRG93bmxvYWQodmlkZW9JZCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgIH0sMjAwMCk7CgogICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ0RPTU5vZGVJbnNlcnRlZCcsKGUpID0+IHsKCiAgICAgICAgICAgICAgICAgICAgaWYoIWUucmVsYXRlZE5vZGUucXVlcnlTZWxlY3RvcikgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICB2YXIgcGxheUJhciA9IGUucmVsYXRlZE5vZGUucXVlcnlTZWxlY3RvcignOnNjb3BlID4gZGl2Omxhc3QtY2hpbGQgPiBkaXY6Zmlyc3QtY2hpbGQgPiBkaXY6bnRoLW9mLXR5cGUoMiknKTsKCiAgICAgICAgICAgICAgICAgICAgaWYoIXBsYXlCYXIgfHwgcGxheUJhci5xdWVyeVNlbGVjdG9yKCcuemhtRG93bmxvYWQnKSkgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICBpZihwbGF5QmFyLmNsYXNzTmFtZSAhPSAnY3NzLTE5OXF4N20nKXJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlCdXQ9IHBsYXlCYXIucGFyZW50Tm9kZS5xdWVyeVNlbGVjdG9yKCcuXzFjMWN2dWcnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5QnV0TGkgPSBwbGF5QnV0LnF1ZXJ5U2VsZWN0b3IoJzpzY29wZSA+IGRpdjpsYXN0LWNoaWxkID4gZGl2OmZpcnN0LWNoaWxkJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBpZighcGxheUJ1dExpKSByZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgICB2YXIgZG93bmxvYWRCdXQgPSBwbGF5QnV0TGkuY2xvbmVOb2RlKHRydWUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRCdXQuY2xhc3NOYW1lID0gcGxheUJ1dExpLmNsYXNzTmFtZSArICcgemhtRG93bmxvYWQnOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWRvd25sb2FkQnV0LnF1ZXJ5U2VsZWN0b3IoJy5fMXRnOG9pcicpKSByZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEJ1dC5xdWVyeVNlbGVjdG9yKCcuXzF0ZzhvaXInKS5pbm5lclRleHQ9J+S4i+i9vSc7CgogICAgICAgICAgICAgICAgICAgICAgICBwbGF5QnV0TGkuYmVmb3JlKGRvd25sb2FkQnV0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGRvd25sb2FkQnV0LmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWRlb0lkOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGdldFZpZGVvRGF0YShkb20pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyZW50RG9tID0gZG9tLnBhcmVudE5vZGUKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFyZW50RG9tLmNsYXNzTmFtZSAmJiBwYXJlbnREb20uY2xhc3NOYW1lPT0nRmVlZCcpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2cocGFyZW50RG9tLmNsYXNzTmFtZSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9EYXRhID0gSlNPTi5wYXJzZShwYXJlbnREb20uZ2V0QXR0cmlidXRlKCdkYXRhLXphLWV4dHJhLW1vZHVsZScpKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvSWQgPSB2aWRlb0RhdGEuY2FyZC5jb250ZW50LnZpZGVvX2lkOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldFZpZGVvRGF0YShwYXJlbnREb20pOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0VmlkZW9EYXRhKHBsYXlCdXQpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2codmlkZW9JZCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXZpZGVvSWQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5pyq6I635Y+W6KeG6aKRaWQnKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgemhEb3dubG9hZCh2aWRlb0lkKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgIH0sMTAwMCk7CgogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgZnVuY3Rpb24gemhEb3dubG9hZCh2aWRlb0lkKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICdodHRwczovL2xlbnMuemhpaHUuY29tL2FwaS92NC92aWRlb3MvJyt2aWRlb0lkOwoKICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZXF1ZXN0KCdnZXQnLHVybCkudGhlbigocmVzdWx0KT0+ewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBKU09OLnBhcnNlKHJlc3VsdCk7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihkYXRhLnBsYXlsaXN0ICE9IHVuZGVmaW5lZCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlfdXJsID0gZGF0YS5wbGF5bGlzdC5MRC5wbGF5X3VybDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9OYW1lID0gdmlkZW9JZCsiLm1wNCI7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2cocGxheV91cmwpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy5MUl9kb3dubG9hZChwbGF5X3VybCx2aWRlb05hbWUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfkuIvovb3lpLHotKXvvIEnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmVtb3ZlUmlnaHQoKXsKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYubWF0Y2goL15odHRwcz86XC9cL3d3d1wuemhpaHVcLmNvbVwvcGVvcGxlXC8uKi8pKXsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgbGV0IHpoRnVsbFNjcmVlbiA9IGAuR2xvYmFsU2lkZUJhciB7ZGlzcGxheTogbm9uZSAhaW1wb3J0YW50O30KICAgICAgICAgICAgICAgICAgICAuY3NzLTFxeXl0ajd7ZGlzcGxheTogbm9uZSAhaW1wb3J0YW50O30KICAgICAgICAgICAgICAgICAgICAuUXVlc3Rpb24tc2lkZUNvbHVtbntkaXNwbGF5Om5vbmUgIWltcG9ydGFudH0KICAgICAgICAgICAgICAgICAgICAuVG9wc3RvcnktbWFpbkNvbHVtbnt3aWR0aDoxMDAlICFpbXBvcnRhbnR9CiAgICAgICAgICAgICAgICAgICAgLlF1ZXN0aW9uLW1haW5Db2x1bW57d2lkdGg6MTAwMHB4ICFpbXBvcnRhbnR9CiAgICAgICAgICAgICAgICAgICAgLmNzcy1jYXpnNDh7bWFyZ2luOiAwcHggMTZweCAwcHggMHB4ICFpbXBvcnRhbnQ7fQogICAgICAgICAgICAgICAgICAgIC5RdWVzdGlvbldhaXRpbmctbWFpbkNvbHVtbnt3aWR0aDoxMDAlICFpbXBvcnRhbnQ7fQogICAgICAgICAgICAgICAgICAgIC5jc3MtMWo1ZDNsbHtwYWRkaW5nLWxlZnQ6MTBweDt9CiAgICAgICAgICAgICAgICAgICAgLmNzcy15aGp3b2V7anVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuICFpbXBvcnRhbnQ7fQogICAgICAgICAgICAgICAgICAgIC5BdXRob3JJbmZve21heC13aWR0aDoxMDAwcHggIWltcG9ydGFudDt9OwogICAgICAgICAgICAgICAgICAgIGA7CiAgICAgICAgICAgICAgICBkb21TdHlsZSAuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoemhGdWxsU2NyZWVuKSk7CgogICAgICAgICAgICAgICAgZG9tSGVhZC5hcHBlbmRDaGlsZChkb21TdHlsZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgY2hhbmdlTGluaygpewoKICAgICAgICAgICAgICAgIGlmKGNvdXBvblVybC5pbmRleE9mKCd0YXJnZXQnKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgIGxldCBvYmogPSB0aGlzLmdldFVybFBhcmFtcyhjb3Vwb25VcmwpOwoKICAgICAgICAgICAgICAgICAgICBpZihvYmoudGFyZ2V0ID09IHVuZGVmaW5lZCkgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICBsZXQgbGluayA9IGRlY29kZVVSSUNvbXBvbmVudChvYmoudGFyZ2V0KTsKCiAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZj1saW5rOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJlbW92ZUtleXdvcmQoKXsKCiAgICAgICAgICAgICAgICB2YXIgR01LZXl3b3JkID0gR01fZ2V0VmFsdWUoJ2lucHV0WmhLZXl3b3JkJywnMCcpOwoKICAgICAgICAgICAgICAgIGlmKEdNS2V5d29yZCA9PSAnMCcgfHwgR01LZXl3b3JkID09ICcnKSByZXR1cm47CgogICAgICAgICAgICAgICAgbGV0IGtleXdvcmQgPSBHTUtleXdvcmQuc3BsaXQoJywnKTsKCiAgICAgICAgICAgICAgICBsZXQgY29udGVudCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5Db250ZW50SXRlbScpOwoKICAgICAgICAgICAgICAgIGtleXdvcmQuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgY29udGVudC5mb3JFYWNoKGZ1bmN0aW9uKHZhbHVlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhWm9wID0gSlNPTi5wYXJzZSh2YWx1ZS5nZXRBdHRyaWJ1dGUoJ2RhdGEtem9wJykpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGF0YVpvcCAmJiBkYXRhWm9wLnRpdGxlLmluZGV4T2YoaXRlbSkgIT0gLTEpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpdGVtQ2FyZCA9IHZhbHVlLnBhcmVudE5vZGUucGFyZW50Tm9kZS5wYXJlbnROb2RlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpdGVtQ2FyZENsYXNzPSBpdGVtQ2FyZC5jbGFzc05hbWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbUNhcmRDbGFzcy5pbmRleE9mKCdUb3BzdG9yeUl0ZW0taXNSZWNvbW1lbmQnKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1DYXJkLnN0eWxlPSdkaXNwbGF5Om5vbmUnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJlbW92ZUF1dGhvck5hbWUoKXsKCiAgICAgICAgICAgICAgICB2YXIgR01BdXRob3JOYW1lID0gR01fZ2V0VmFsdWUoJ2lucHV0WmhBdXRob3JOYW1lJywnMCcpOwoKICAgICAgICAgICAgICAgIGlmKEdNQXV0aG9yTmFtZSA9PSAnMCcgfHwgR01BdXRob3JOYW1lID09ICcnKSByZXR1cm47CgogICAgICAgICAgICAgICAgbGV0IGF1dGhvck5hbWUgPSBHTUF1dGhvck5hbWUuc3BsaXQoJywnKTsKCiAgICAgICAgICAgICAgICAvL+aQnOe0oumhtQogICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5tYXRjaCgvXmh0dHBzPzpcL1wvd3d3LnpoaWh1LmNvbVwvc2VhcmNoLykpewoKICAgICAgICAgICAgICAgICAgICBsZXQgbj0wOwoKICAgICAgICAgICAgICAgICAgICBsZXQgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICBsZXQgdXNlckxpbmsgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuQ2FyZCcpOwoKICAgICAgICAgICAgICAgICAgICBpZih1c2VyTGluay5sZW5ndGggPiA1KXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwoKICAgICAgICAgICAgICAgICAgICAgICAgdXNlckxpbmsuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdXRob3IgPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJ2InKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1dGhvcil7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0aG9yTmFtZS5pbmRleE9mKGF1dGhvci5pbm5lclRleHQpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5zdHlsZSA9ICdkaXNwbGF5Om5vbmUnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZihuPjMwKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4rKzsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICB9LDEwMCkKCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAvL+WbnuetlOmhtQogICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5tYXRjaCgvXmh0dHBzPzpcL1wvd3d3LnpoaWh1LmNvbVwvcXVlc3Rpb25cLy4qLykpewoKICAgICAgICAgICAgICAgICAgICBsZXQgaXRlbURvbSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5MaXN0LWl0ZW0nKTsKCiAgICAgICAgICAgICAgICAgICAgaWYoaXRlbURvbS5sZW5ndGg+MCl7CgogICAgICAgICAgICAgICAgICAgICAgICBpdGVtRG9tLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbnRlbnQgPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJy5Db250ZW50SXRlbScpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNvbnRlbnQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVpvcCA9IEpTT04ucGFyc2UoY29udGVudC5nZXRBdHRyaWJ1dGUoJ2RhdGEtem9wJykpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhdXRob3JOYW1lLmluZGV4T2YoZGF0YVpvcC5hdXRob3JOYW1lKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlID0gJ2Rpc3BsYXk6bm9uZSc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy/nrYnkvaDlm57nrZTpobUKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYgPT0gJ2h0dHBzOi8vd3d3LnpoaWh1LmNvbS9xdWVzdGlvbi93YWl0aW5nJyl7CgogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBxdWVzdGlvbkxpc3QgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuanNOYXZpZ2FibGUnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHF1ZXN0aW9uTGlzdC5sZW5ndGg+MCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVlc3Rpb25MaXN0LmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdXRob3JEb21UZXh0ID0gaXRlbS5xdWVyeVNlbGVjdG9yKCcuY3NzLXRuc2F4aCcpLmlubmVyVGV4dDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0aG9yRG9tVGV4dCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXV0aG9yID0gYXV0aG9yRG9tVGV4dC5yZXBsYWNlKCciJywnJykucmVwbGFjZSgn55qE5o+Q6ZeuJywnJykucmVwbGFjZSgvKF5ccyspfChccyskKS9nLCcnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1dGhvcil7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0aG9yTmFtZS5pbmRleE9mKGF1dGhvcikgIT0gLTEpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlPSdkaXNwbGF5Om5vbmU7JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICB9LDMwMCkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC8v5o6o6I2Q6aG1CiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmID09ICdodHRwczovL3d3dy56aGlodS5jb20vJyl7CgogICAgICAgICAgICAgICAgICAgIGxldCBjb250ZW50ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkNvbnRlbnRJdGVtJyk7CgogICAgICAgICAgICAgICAgICAgIGNvbnRlbnQuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVpvcCA9IEpTT04ucGFyc2UodmFsdWUuZ2V0QXR0cmlidXRlKCdkYXRhLXpvcCcpKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1dGhvck5hbWUuaW5kZXhPZihkYXRhWm9wLmF1dGhvck5hbWUpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaXRlbUNhcmQgPSB2YWx1ZS5wYXJlbnROb2RlLnBhcmVudE5vZGUucGFyZW50Tm9kZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtQ2FyZCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1DYXJkLnN0eWxlPSdkaXNwbGF5Om5vbmUnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfQoKICAgICAgICAgICAgcmVtb3ZlWWFueHVhbigpewoKICAgICAgICAgICAgICAgIC8v5Zue562U6aG1CiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLm1hdGNoKC9eaHR0cHM/OlwvXC93d3cuemhpaHUuY29tXC9xdWVzdGlvblwvLiovKSl7CgogICAgICAgICAgICAgICAgICAgIGxldCBpdGVtRG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkxpc3QtaXRlbScpOwoKICAgICAgICAgICAgICAgICAgICBpZihpdGVtRG9tLmxlbmd0aD4wKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1Eb20uZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udGVudCA9IGl0ZW0ucXVlcnlTZWxlY3RvcignLktmZUNvbGxlY3Rpb24tT3JkaW5hcnlMYWJlbC1jb250ZW50Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoY29udGVudCAmJiBjb250ZW50LmlubmVyVGV4dC5pbmRleE9mKCfnm5DpgIknKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGUgPSAnZGlzcGxheTpub25lJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgbGV0IGFuc3dlckNhcmQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuQW5zd2VyQ2FyZCcpOwoKICAgICAgICAgICAgICAgICAgICBpZihhbnN3ZXJDYXJkKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250ZW50ID0gYW5zd2VyQ2FyZC5xdWVyeVNlbGVjdG9yKCcuS2ZlQ29sbGVjdGlvbi1PcmRpbmFyeUxhYmVsLWNvbnRlbnQnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNvbnRlbnQgJiYgY29udGVudC5pbm5lclRleHQuaW5kZXhPZign55uQ6YCJJykgIT0gLTEpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuc3dlckNhcmQuc3R5bGUgPSAnZGlzcGxheTpub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgLy/mkJzntKLpobUKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYubWF0Y2goL15odHRwcz86XC9cL3d3dy56aGlodS5jb21cL3NlYXJjaC8pKXsKCiAgICAgICAgICAgICAgICAgICBsZXQgbnVtID0gMDsKCiAgICAgICAgICAgICAgICAgICBsZXQgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNhcmRMaXN0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkNhcmQnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNhcmRMaXN0Lmxlbmd0aCA+IDUpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcmRMaXN0LmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0eXBlID0gaXRlbS5xdWVyeVNlbGVjdG9yKCcuS2ZlQ29sbGVjdGlvbi1QY0NvbGxlZ2VDYXJkLXR5cGUnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZSAmJiB0eXBlLmlubmVyVGV4dC5pbmRleE9mKCfnm5DpgInkuJPmoI8nKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlID0gJ2Rpc3BsYXk6bm9uZSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXV0aG9yID0gaXRlbS5xdWVyeVNlbGVjdG9yKCdiJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdXRob3JZYW54dWFuID0gWyfmlYXkuovmoaPmoYjlsYAnLCAn55uQ6YCJ5o6o6I2QJywgJ+ebkOmAieenkeaZricsICfnm5DpgInmiJDplb/orqHliJInLCAn55+l5LmO55uQ6YCJ5Lya5ZGYJywgJ+efpeS5juebkOmAieWIm+S9nOiAhScsICfnm5DpgInlv4PnkIYnLCAn55uQ6YCJ5YGl5bq35b+F5L+u6K++JywgJ+ebkOmAieWlh+WmmeeJqeivrScsICfnm5DpgInnlJ/mtLvppoYnLCAn55uQ6YCJ6IGM5Zy6JywgJ+ebkOmAieaWh+WtpueUhOmAiScsICfnm5DpgInkvZzogIXlsI/nrqHlrrYnLCAn55uQ6YCJ5Y2a54mp6aaGJywgJ+ebkOmAieeCuemHkScsICfnm5DpgInmtYvor4TlrqQnLCAn55uQ6YCJ56eR5oqA5YmN5rK/JywgJ+ebkOmAieS8muWRmOeyvuWTgScsICfljoblj7Lnjq/muLjorrAnXTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0aG9yICYmIGF1dGhvcllhbnh1YW4uaW5kZXhPZihhdXRob3IuaW5uZXJUZXh0KSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlID0gJ2Rpc3BsYXk6bm9uZSc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYobnVtPjMwKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bSsrOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIH0sMTAwKQoKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAvL+aOqOiNkOmhtQogICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZiA9PSAnaHR0cHM6Ly93d3cuemhpaHUuY29tLycpewoKICAgICAgICAgICAgICAgICAgICBsZXQgY29udGVudCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5Db250ZW50SXRlbScpOwoKICAgICAgICAgICAgICAgICAgICBjb250ZW50LmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udGVudCA9IGl0ZW0ucXVlcnlTZWxlY3RvcignLktmZUNvbGxlY3Rpb24tT3JkaW5hcnlMYWJlbC1jb250ZW50Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihjb250ZW50ICYmIGNvbnRlbnQuaW5uZXJUZXh0LmluZGV4T2YoJ+ebkOmAiScpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlID0gJ2Rpc3BsYXk6bm9uZSc7CgogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgfQoKICAgICAgICBjbGFzcyBWaWRlb0Rvd25sb2FkQ2xhc3MgZXh0ZW5kcyBCYXNlQ2xhc3N7CgogICAgICAgICAgICBjb25zdHJ1Y3RvcigpewoKICAgICAgICAgICAgICAgIHN1cGVyKCk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGR5VmlkZW9Eb3dubG9hZCgpewoKICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7CgogICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGdldENvbnRyb2xzKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9Eb20gPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgnLnhnLXZpZGVvLWNvbnRhaW5lcicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXZpZGVvRG9tKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdnNOYXYgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuZnV5X3dtY3Q6bnRoLW9mLXR5cGUoNSknKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICBpZihjb3Vwb25VcmwuaW5kZXhPZigndnNkZXRhaWwnKSAhPSAtMSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn57u86Im65qCP55uu5YWz6Zet5LiL6L29Jyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jcmVhdGVEeVZpZGVvRG93bmxvYWQoKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb1BsYXlEb21BbGwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCd2aWRlbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvSW5kZXggPSB2aWRlb1BsYXlEb21BbGwubGVuZ3RoPjE/dmlkZW9QbGF5RG9tQWxsLmxlbmd0aC0yOnZpZGVvUGxheURvbUFsbC5sZW5ndGgtMTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb1BsYXlEb20gPSB2aWRlb1BsYXlEb21BbGxbdmlkZW9JbmRleF07CgogICAgICAgICAgICAgICAgICAgICAgICAvL2xldCB2aWRlb1BsYXlEb20gPSB2aWRlb1BsYXlEb21BbGwubGVuZ3RoPjE/dmlkZW9QbGF5RG9tQWxsW3ZpZGVvUGxheURvbUFsbC5sZW5ndGgtMl06dmlkZW9QbGF5RG9tQWxsW3ZpZGVvUGxheURvbUFsbC5sZW5ndGgtMV07CgogICAgICAgICAgICAgICAgICAgICAgICB2aWRlb1BsYXlEb20uYWRkRXZlbnRMaXN0ZW5lcignZW5kZWQnLGZ1bmN0aW9uKCl7IC8v57uT5p2fCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuaSreaUvue7k+adnyIpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdXRvUGxheSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy54Zy1zd2l0Y2gtY2hlY2tlZCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1dG9QbGF5KXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udHJvbHMoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9LCBmYWxzZSk7CgogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdG9Eb3dubG9hZCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn5q2j5Zyo5LiL6L296K+356iN5L6vJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGluZm8gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuUHo4dDJtZVAnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZW5hbWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaW5mby5sZW5ndGg+MCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gaW5mb1t2aWRlb0luZGV4XS5pbm5lclRleHQ7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IHRpdGxlQXJyID0gaW5mb1t2aWRlb0luZGV4KjIrMV0uaW5uZXJUZXh0LnNwbGl0KCcjJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2dCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy54aERvcGNRXycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSB2dFt2aWRlb0luZGV4XS5pbm5lclRleHQuc3BsaXQoJyMnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZW5hbWUgPSB0aXRsZVswXT90aXRsZVswXSthY2NvdW50OnRpdGxlWzFdK2FjY291bnQrJy5tcDQnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlbmFtZSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpKycubXA0JwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MuTFJfZG93bmxvYWQodmlkZW9QbGF5RG9tLmNoaWxkcmVuWzBdLnNyYyxmaWxlbmFtZSk7CgogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3RvQ29weScpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn5bey5aSN5Yi25Yiw5Ymq6LS05p2/Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0Q2xpcGJvYXJkKHZpZGVvUGxheURvbS5jaGlsZHJlblswXS5zcmMpOwogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnRvTGluaycpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKHZpZGVvUGxheURvbS5jaGlsZHJlblswXS5zcmMpOwoKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CgogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJ3aGVlbCIsZ2V0Q29udHJvbHMpOwoKICAgICAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigna2V5ZG93bicsZnVuY3Rpb24oZSl7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihlLmNvZGU9PSdBcnJvd0Rvd24nIHx8IGUuY29kZT09J0Fycm93VXAnKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRDb250cm9scygpOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGluc2VydGVkRG9tKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9Eb20gPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgndmlkZW8nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCF2aWRlb0RvbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ayoeacieaJvuWIsERPTScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9Eb20uYWRkRXZlbnRMaXN0ZW5lcignRE9NTm9kZUluc2VydGVkJywoZSkgPT4gewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CgogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGluc2VydGVkRG9tKCk7CgogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZ2V0Q29udHJvbHMpOwoKICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICB9CgogICAgICAgICAgICBjcmVhdGVEeVZpZGVvRG93bmxvYWQoKXsKCiAgICAgICAgICAgICAgICBsZXQgY29udHJvbEFsbCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy54Zy1yaWdodC1ncmlkJyk7CgogICAgICAgICAgICAgICAgbGV0IGNvbnRyb2xzID0gY29udHJvbEFsbC5sZW5ndGg+MT9jb250cm9sQWxsW2NvbnRyb2xBbGwubGVuZ3RoLTJdOmNvbnRyb2xBbGxbY29udHJvbEFsbC5sZW5ndGgtMV07CgogICAgICAgICAgICAgICAgbGV0IHZpZGVvRG93bmxvYWREb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtRG91eWluRG93bmxvYWQnKTsKCiAgICAgICAgICAgICAgICBpZih2aWRlb0Rvd25sb2FkRG9tKXsKCiAgICAgICAgICAgICAgICAgICAgdmlkZW9Eb3dubG9hZERvbS5wYXJlbnROb2RlLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQodmlkZW9Eb3dubG9hZERvbS5wYXJlbnROb2RlKTsKCiAgICAgICAgICAgICAgICAgICAgLy92aWRlb0Rvd25sb2FkRG9tLnBhcmVudE5vZGUucGFyZW50Tm9kZS5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHZpZGVvRG93bmxvYWREb20ucGFyZW50Tm9kZS5wYXJlbnROb2RlKQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGxldCBwbGF5U2V0aW5nID0gY29udHJvbHMucXVlcnlTZWxlY3RvcignLnhncGxheWVyLXBsYXliYWNrLXNldHRpbmcnKTsKCiAgICAgICAgICAgICAgICBs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XRBdHRyaWJ1dGUoJ2RhdGEtdXJsJyxsaW5rVXJsKTsKCiAgICAgICAgICAgICAgICBkb3dubG9hZFRleHQucmVtb3ZlQXR0cmlidXRlKCd0YXJnZXQnKTsKCiAgICAgICAgICAgICAgICBkb3dubG9hZFRleHQuc2V0QXR0cmlidXRlKCdocmVmJywnamF2YXNjcmlwdDp2b2lkKDApOycpOwoKICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLm9ubW91c2VvdmVyPWZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLmNsYXNzTmFtZT0neGdwbGF5ZXItcGxheWJhY2stc2V0dGluZyBzbGlkZS1zaG93JzsKCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgZG93bmxvYWREb20ub25tb3VzZW91dD1mdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICBkb3dubG9hZERvbS5jbGFzc05hbWU9J3hncGxheWVyLXBsYXliYWNrLXNldHRpbmcnOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZEh0bWwgPSAnJzsKCiAgICAgICAgICAgICAgICBkb3dubG9hZE9wdGlvbi5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEh0bWwgKz0gYDxkaXYgY2xhc3M9InhncGxheWVyLXBsYXlyYXRpby1pdGVtICR7aXRlbS5pZH0iIGlkPSIke2l0ZW0uaWR9Ij4ke2l0ZW0ubmFtZX08L2Rpdj5gOwoKICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgZG93bmxvYWREb20ucXVlcnlTZWxlY3RvcignLnhncGxheWVyLXBsYXlyYXRpby13cmFwJykuaW5uZXJIVE1MID0gZG93bmxvYWRIdG1sOwoKICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLnF1ZXJ5U2VsZWN0b3IoJy54Z3BsYXllci1zbGlkZXInKS5zdHlsZT0nd2lkdGg6NjBweCBpbXBvcnRhbnQ7JzsKCiAgICAgICAgICAgICAgICBsZXQgYXV0b1BsYXkgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcueGdwbGF5ZXItYXV0b3BsYXktc2V0dGluZycpOwoKICAgICAgICAgICAgICAgIGF1dG9QbGF5LmFmdGVyKGRvd25sb2FkRG9tKTsKCiAgICAgICAgICAgICAgICBsZXQgZGl2RG9tID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7CgogICAgICAgICAgICAgICAgZGl2RG9tLnN0eWxlPSJwb3NpdGlvbjogYWJzb2x1dGU7ei1pbmRleDotOTk5O2hlaWdodDo4MHB4O3dpZHRoOjQwcHg7bWFyZ2luLXRvcDotODBweDsiCgogICAgICAgICAgICAgICAgZG93bmxvYWREb20uYXBwZW5kQ2hpbGQoZGl2RG9tKTsKCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGtzVmlkZW9Eb3dubG9hZCgpewoKICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7CgogICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGdldENvbnRyb2xzKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9Eb20gPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgnLnBsYXllci12aWRlbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXZpZGVvRG9tKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgaWYodmlkZW9Eb20uZ2V0QXR0cmlidXRlKCdzcmMnKS5tYXRjaCgvXmJsb2IvKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnYmxvYuinhumikeaXoOazleS4i+i9vScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3JlYXRlS3NWaWRlb0Rvd25sb2FkKHZpZGVvRG9tKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvRG9tLmFkZEV2ZW50TGlzdGVuZXIoJ3BsYXlpbmcnLGZ1bmN0aW9uKCl7IC8v5pKt5pS+5LitCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygi5pKt5pS+5LitIik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9Eb20uYWRkRXZlbnRMaXN0ZW5lcignZW5kZWQnLGZ1bmN0aW9uKCl7IC8v57uT5p2fCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuaSreaUvue7k+adnyIpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdXRvUGxheSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5hdXRvLXdhcnBwZXInKS5nZXRBdHRyaWJ1dGUoJ2F1dG9wbGF5Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0b1BsYXkpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGZhbHNlKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN0b0Rvd25sb2FkJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfmraPlnKjkuIvovb3or7fnqI3kvq8nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVRpbWVUb3RhbCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy50b3RhbCcpLmlubmVyVGV4dDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2Vjb25kID0gcGxheVRpbWVUb3RhbC5tYXRjaCgvKC4rKTooLispLyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNlY29uZFRvdGFsID0gc2Vjb25kWzFdKjYwK3BhcnNlSW50KHNlY29uZFsyXSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGFVcmwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtS3NEb3dubG9hZCcpLmdldEF0dHJpYnV0ZSgnZGF0YS11cmwnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5wcm9maWxlLXVzZXItbmFtZS10aXRsZScpP2RvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5wcm9maWxlLXVzZXItbmFtZS10aXRsZScpLmlubmVyVGV4dDpkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuZmVlZC1hdXRob3InKS5pbm5lclRleHQ7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnZpZGVvLWluZm8tdGl0bGUnKT9kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcudmlkZW8taW5mby10aXRsZScpLmlubmVyVGV4dDpuZXcgRGF0ZSgpLmdldFRpbWUoKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9GaWxlTmFtZSA9IChhY2NvdW50ICYmIHRpdGxlKT9hY2NvdW50KyctJyt0aXRsZSsnLm1wNCc6bmV3IERhdGUoKS5nZXRUaW1lKCkrJy5tcDQnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy5MUl9kb3dubG9hZChkYXRhVXJsLHZpZGVvRmlsZU5hbWUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN0b0NvcHknKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+W3suWkjeWItuWIsOWJqui0tOadvycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldENsaXBib2FyZCh2aWRlb0RvbS5nZXRBdHRyaWJ1dGUoJ3NyYycpKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN0b0xpbmsnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub3Blbih2aWRlb0RvbS5nZXRBdHRyaWJ1dGUoJ3NyYycpKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgZ2V0Q29udHJvbHMoKTsKCiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKGUpewoKICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udHJvbHMoKTsKCiAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoIndoZWVsIixnZXRDb250cm9scyk7CgogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJyxmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGUuY29kZT09J0Fycm93RG93bicgfHwgZS5jb2RlPT0nQXJyb3dVcCcpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCgogICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgfSkKCgogICAgICAgICAgICB9CgogICAgICAgICAgICBjcmVhdGVLc1ZpZGVvRG93bmxvYWQodmlkZW9Eb20pewoKICAgICAgICAgICAgICAgIGxldCBtYXRjaCA9IC9eaHR0cHM/OlwvXC93d3dcLmt1YWlzaG91XC5jb21cLyguKykvOwoKICAgICAgICAgICAgICAgIGxldCByZXNwID0gbG9jYXRpb24uaHJlZi5tYXRjaChtYXRjaCk7CgogICAgICAgICAgICAgICAgaWYoIXJlc3AgfHwgKHJlc3BbMV0uaW5kZXhPZignc2hvcnQtdmlkZW8nKSA9PSAtMSAmJiByZXNwWzFdLmluZGV4T2YoJ3ZpZGVvJykgPT0tMSAmJiByZXNwWzFdLmluZGV4T2YoJ25ldy1yZWNvJykgPT0gLTEpKXsKCiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+W9k+WJjeS4jeaYr+inhumikeaSreaUvumhtScpO3JldHVybjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBpZihyZXNwWzFdLmluZGV4T2YoJ3Nob3J0LXZpZGVvJykgIT0gLTEpewoKICAgICAgICAgICAgICAgICAgICBsZXQgcGxheWVyQXJlYSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy52aWRlby1jb250YWluZXItcGxheWVyJyk7CgogICAgICAgICAgICAgICAgICAgIGxldCBwbGF5ZXJBcmVhV2lkdGggPSBwbGF5ZXJBcmVhLnN0eWxlLndpZHRoLm1hdGNoKC8oLispcHgvKTsKCiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXllckJhclByb2dyZXNzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnBsYXllci1iYXItcHJvZ3Jlc3MnKTsKCiAgICAgICAgICAgICAgICAgICAgcGxheWVyQmFyUHJvZ3Jlc3Muc3R5bGUud2lkdGggPSBwbGF5ZXJBcmVhV2lkdGhbMV0tMzAwKydweCc7CgogICAgICAgICAgICAgICAgICAgIGxldCB0aW1lVG90YWwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcudG90YWwnKTsKCiAgICAgICAgICAgICAgICAgICAgdGltZVRvdGFsLnN0eWxlLnJpZ2h0PScxNjBweCc7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgbGV0IGNvbnRyb2xzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnJpZ2h0Jyk7CgogICAgICAgICAgICAgICAgbGV0IHZpZGVvRG93bmxvYWREb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtS3NEb3dubG9hZCcpOwoKICAgICAgICAgICAgICAgIGlmKHZpZGVvRG93bmxvYWREb20pewoKICAgICAgICAgICAgICAgICAgICB2aWRlb0Rvd25sb2FkRG9tLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQodmlkZW9Eb3dubG9hZERvbSk7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgbGV0IGRldGFpbERvbSA9IGNvbnRyb2xzLnF1ZXJ5U2VsZWN0b3IoJ2RpdjpudGgtb2YtdHlwZSgxKScpOwoKICAgICAgICAgICAgICAgIGxldCB4Z0ljb24gPSBkZXRhaWxEb20uY2xvbmVOb2RlKHRydWUpOwoKICAgICAgICAgICAgICAgIGxldCBsaW5rVXJsID0gdmlkZW9Eb20uZ2V0QXR0cmlidXRlKCdzcmMnKTsKCiAgICAgICAgICAgICAgICB4Z0ljb24ucXV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+5pON5L2c5oyJ6ZKuCgogICAgICAgICAgICAgICAgbGV0IHpobUtzQnV0dG9uID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobUtzQnV0dG9uJyk7CgogICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyh6aG1Lc0J1dHRvbik7CgogICAgICAgICAgICAgICAgaWYoemhtS3NCdXR0b24pewoKICAgICAgICAgICAgICAgICAgICAvL3pobUtzQnV0dG9uLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoemhtS3NCdXR0b24pOwoKICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgbGV0IGJ1dHRvbkljb24gPSBkZXRhaWxEb20uY2xvbmVOb2RlKHRydWUpOwogICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhidXR0b25JY29uKTsKICAgICAgICAgICAgICAgIGJ1dHRvbkljb24uc2V0QXR0cmlidXRlKCdpZCcsJ3pobUtzQnV0dG9uJyk7CgogICAgICAgICAgICAgICAgbGV0IGJ1dHRvbkljb25JbWcgPSBidXR0b25JY29uLnF1ZXJ5U2VsZWN0b3IoJy51bm11dGVkLWljb24nKTsKCiAgICAgICAgICAgICAgICBpZihidXR0b25JY29uSW1nKXsKICAgICAgICAgICAgICAgICAgICBidXR0b25JY29uSW1nLnN0eWxlID0gJ2JhY2tncm91bmQ6IHVybChodHRwczovL3MyLTEwNjIzLmt3aW1ncy5jb20vdWRhdGEvcGtnL2Nsb3VkY2RuL2ltZy9wbGF5ZXItc2V0dGluZy5hZDFmNWNlOC5zdmcpIG5vLXJlcGVhdCc7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgZGV0YWlsRG9tLmFmdGVyKGJ1dHRvbkljb24pOwoKICAgICAgICAgICAgICAgIGxldCBwbFNsaWRlciA9IGJ1dHRvbkljb24ucXVlcnlTZWxlY3RvcignLnBsLXNsaWRlcicpOwoKICAgICAgICAgICAgICAgIHBsU2xpZGVyLnN0eWxlPSd3aWR0aDphdXRvO3BhZGRpbmc6MTBweCAxMHB4IDI1cHggMTBweDsnOwoKICAgICAgICAgICAgICAgIHBsU2xpZGVyLmlubmVySFRNTCA9ICIiOwoKICAgICAgICAgICAgICAgIGxldCBidXR0b25Gb3VyID0gY29udHJvbHMucXVlcnlTZWxlY3RvcignZGl2Om50aC1vZi10eXBlKDQpJyk7CgogICAgICAgICAgICAgICAgYnV0dG9uRm91ci5zdHlsZS5tYXJnaW49JzBweCc7CgogICAgICAgICAgICAgICAgbGV0IGF1dG9QbGF5ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnBsYXktc2V0dGluZy1jb250YWluZXInKTsKCiAgICAgICAgICAgICAgICBpZihhdXRvUGxheSl7CiAgICAgICAgICAgICAgICAgICAgYXV0b1BsYXkuc3R5bGUubWFyZ2luPScwcHggNDBweCAwcHggMHB4JzsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBsZXQgYnV0dG9uRml2ZSA9IGNvbnRyb2xzLnF1ZXJ5U2VsZWN0b3IoJ2RpdjpudGgtb2YtdHlwZSg1KScpOwoKICAgICAgICAgICAgICAgIGlmKGJ1dHRvbkZpdmUpewoKICAgICAgICAgICAgICAgICAgICBidXR0b25GaXZlLnN0eWxlLm1hcmdpbj0nMTVweCAwcHgnOwoKICAgICAgICAgICAgICAgICAgICBidXR0b25GaXZlLm9ubW91c2VvdmVyPWZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvb2xUaXAgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcua3dhaS1wbGF5ZXItcm90YXRlLXRvb2x0aXAnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0b29sVGlwKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbFRpcC5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHRvb2xUaXApOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKCiAgICAgICAgICAgICAgICAgICAgICAgIH0sMzApCgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgcGxTbGlkZXIuYXBwZW5kQ2hpbGQoYnV0dG9uRml2ZSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBsZXQgYnV0dG9uU2l4ID0gY29udHJvbHMucXVlcnlTZWxlY3RvcignZGl2Om50aC1vZi10eXBlKDYpJyk7CgogICAgICAgICAgICAgICAgaWYoYnV0dG9uU2l4KXsKCiAgICAgICAgICAgICAgICAgICAgYnV0dG9uU2l4LnN0eWxlLm1hcmdpbj0nMTVweCAwcHgnOwoKICAgICAgICAgICAgICAgICAgICBsZXQgdG9vbFRpcCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5rd2FpLXBsYXllci1mdWxsc2NyZWVuLXRvb2x0aXAnKTsKCiAgICAgICAgICAgICAgICAgICAgYnV0dG9uU2l4Lm9ubW91c2VvdmVyPWZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvb2xUaXAgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcua3dhaS1wbGF5ZXItZnVsbHNjcmVlbi10b29sdGlwJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodG9vbFRpcCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xUaXAucGFyZW50Tm9kZS5yZW1vdmVDaGlsZCh0b29sVGlwKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9LDMwKQoKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIHBsU2xpZGVyLmFwcGVuZENoaWxkKGJ1dHRvblNpeCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBwbFNsaWRlci5hcHBlbmRDaGlsZChidXR0b25Gb3VyKTsKCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHhpZ3VhVmlkZW9Eb3dubG9hZCgpewoKICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7CgogICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGdldENvbnRyb2xzKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9Eb20gPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgndmlkZW8nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCF2aWRlb0RvbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ayoeacieaJvuWIsERPTScpO3JldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmNyZWF0ZVhpZ3VhVmlkZW9Eb3dubG9hZCgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgR01feG1saHR0cFJlcXVlc3QoewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogImdldCIsCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaHR0cDovLzQ3Ljk5LjE1OC4xMTgvdmlkZW8tY3JhY2svdjIvcGFyc2U/Y29udGVudD0nK2VuY29kZVVSSUNvbXBvbmVudChsb2NhdGlvbi5ocmVmKSwKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiAnJywKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7J0FjY2VwdCc6ICd0ZXh0L3BsYWluLCB0ZXh0L2h0bWwsYXBwbGljYXRpb24vanNvbid9LAoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ubG9hZDogZnVuY3Rpb24ocmVzKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocmVzLnN0YXR1cz09MjAwKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXNwID0gSlNPTi5wYXJzZShyZXMucmVzcG9uc2VUZXh0KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvU3JjID0gJyc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihyZXNwLmNvZGUgPT0gMCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb1NyYyA9IHJlc3AuZGF0YS51cmw7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3RvRG93bmxvYWQnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXZpZGVvU3JjKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+l6KeG6aKR5peg5rOV5LiL6L29Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9UaXRsZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy52aWRlb1RpdGxlIGgxJykuaW5uZXJUZXh0OwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9BdXRob3IgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuYXV0aG9yX191c2VyTmFtZScpLnRpdGxlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ato+WcqOS4i+i9veivt+eojeS+rycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MuTFJfZG93bmxvYWQodmlkZW9TcmMsdmlkZW9UaXRsZSsnQCcrdmlkZW9BdXRob3IrJy5tcDQnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdG9Db3B5JykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCF2aWRlb1NyYyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivpeinhumikeS4jeiDveWkjeWItuWcsOWdgCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCflt7LlpI3liLbliLDliarotLTmnb8nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0Q2xpcGJvYXJkKHZpZGVvU3JjKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3RvTGluaycpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9TcmMpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfor6Xop4bpopHkuI3og73nm7TmjqXmiZPlvIAnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKHZpZGVvU3JjKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wYXRoLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtLmNsYXNzTmFtZSA9PSAneGdwbGF5ZXItY29udHJvbC1pdGVtIGNvbnRyb2xfcGxheW5leHQgY29tbW9uLWNvbnRyb2wtaXRlbScpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24ucmVsb2FkKCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDEwMDApCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqTGluayA9IHt9OwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnBhdGguZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0uaHJlZil7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqTGluay5ocmVmID0gaXRlbS5ocmVmP2l0ZW0uaHJlZjonJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmpMaW5rLnRhcmdldCA9IGl0ZW0udGFyZ2V0P2l0ZW0udGFyZ2V0OicnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihvYmpMaW5rLmhyZWYgJiYgb2JqTGluay50YXJnZXQgIT0gJ19ibGFuaycpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZiA9IG9iakxpbmsuaHJlZjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgb25lcnJvciA6IGZ1bmN0aW9uKGVycil7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ2Vycm9yJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhlcnIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcigndmlkZW8nKS5hZGRFdmVudExpc3RlbmVyKCdlbmRlZCcsZnVuY3Rpb24oKXsgLy/nu5PmnZ8KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygi5pKt5pS+57uT5p2fIik7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDU1MDApOwoKICAgICAgICAgICAgICAgICAgICAgICAgfSwgZmFsc2UpOwoKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9CgogICAgICAgICAgICBjcmVhdGVYaWd1YVZpZGVvRG93bmxvYWQoKXsKCiAgICAgICAgICAgICAgICBsZXQgcmlnaHRHcmlkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnhnLXJpZ2h0LWdyaWQnKTsKCiAgICAgICAgICAgICAgICBsZXQgcGxheUNvbnRyb2wgPSByaWdodEdyaWQucXVlcnlTZWxlY3RvcignZGl2Om50aC1vZi10eXBlKDIpJyk7CgogICAgICAgICAgICAgICAgbGV0IGNvbnRyb2wgPSBwbGF5Q29udHJvbC5jbG9uZU5vZGUodHJ1ZSk7CgogICAgICAgICAgICAgICAgbGV0IGVudHJ5PSBjb250cm9sLnF1ZXJ5U2VsZWN0b3IoJy54Z3BsYXllci1jb250cm9sLWl0ZW1fX2VudHJ5Jyk7CgogICAgICAgICAgICAgICAgZW50cnkuaW5uZXJIVE1MID0gJzxkaXYgY2xhc3M9InhncGNQbGF5ZXJfdGV4dEVudHJ5Ij48c3Bhbj7kuIvovb08L3NwYW4+PC9kaXY+JzsKCiAgICAgICAgICAgICAgICBsZXQgcG9wb3ZlciA9IGNvbnRyb2wucXVlcnlTZWxlY3RvcignLnhncGxheWVyLWNvbnRyb2wtaXRlbV9fcG9wb3ZlcicpOwoKICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZExpc3QgPSAnPHVsPic7CgogICAgICAgICAgICAgICAgZG93bmxvYWRPcHRpb24uZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRMaXN0ICs9IGA8bGkgdGFiaW5kZXg9IjAiIHJvbGU9Im1lbnVpdGVtcmFkaW8iIGFyaWEtY2hlY2tlZD0iZmFsc2UiIGlkPSIke2l0ZW0uaWR9Ij4ke2l0ZW0ubmFtZX08L2xpPmA7CgogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICBkb3dubG9hZExpc3QgKz0gJzwvdWw+JzsKCiAgICAgICAgICAgICAgICBwb3BvdmVyLmlubmVySFRNTCA9IGRvd25sb2FkTGlzdDsKCiAgICAgICAgICAgICAgICBwbGF5Q29udHJvbC5iZWZvcmUoY29udHJvbCk7CgogICAgICAgICAgICAgICAgbGV0IGRpdkRvbSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpOwoKICAgICAgICAgICAgICAgIGRpdkRvbS5zdHlsZT0id2lkdGg6IDgwcHg7IGhlaWdodDogMTQwcHg7cG9zaXRpb246YWJzb2x1dGU7Ym90dG9tOjQwcHg7bGVmdDoyMHB4O3otaW5kZXg6LTEiOwoKICAgICAgICAgICAgICAgIGNvbnRyb2wuYXBwZW5kQ2hpbGQoZGl2RG9tKTsKCiAgICAgICAgICAgICAgICBjb250cm9sLm9ubW91c2VvdmVyPWZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgIHBvcG92ZXIuc3R5bGUuZGlzcGxheT0nYmxvY2snOwoKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBjb250cm9sLm9ubW91c2VvdXQ9ZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgcG9wb3Zlci5zdHlsZS5kaXNwbGF5PSdub25lJzsKCiAgICAgICAgICAgICAgICB9CgoKICAgICAgICAgICAgfQoKICAgICAgICAgICAgYmlsaVZpZGVvRG93bmxvYWQoKXsKCiAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwoKICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdsb2FkJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICBhc3luYyBmdW5jdGlvbiBnZXRDb250cm9scygpewoKICAgICAgICAgICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5pbmRleE9mKCdiYW5ndW1pJykgIT0gLTEpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByaWdodENvbnRyb2wgPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgnLnNxdWlydGxlLWNvbnRyb2xsZXItd3JhcC1yaWdodCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFyaWdodENvbnRyb2wpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmNyZWF0ZUJpbGlWaWRlb0Rvd25sb2FkKCk7CgogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbj0wOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuYmlsaWJpbGktcGxheWVyLXZpZGVvLWJ0bi1xdWFsaXR5Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkb21PdGhlciA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5icHgtcGxheWVyLWN0cmwtcXVhbGl0eScpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkb20pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jcmVhdGVCaWxpVmlkZW9Eb3dubG9hZCgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZihkb21PdGhlcil7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmNyZWF0ZUJpbGlWaWRlb0Rvd25sb2FkT3RoZXIoKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG4rKz4zMCljbGVhckludGVydmFsKHRpbWVyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwxMDApCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgLy9fdGhpcy5jcmVhdGVCaWxpVmlkZW9Eb3dubG9hZCgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpbWVyWmhtSWNvbiA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvRG9tID0gW3tuYW1lOid2aWRlbycsdHlwZTonZG9tJ30se25hbWU6J2J3cF92aWRlbycsdHlwZTonZG9tJ30se25hbWU6Jy5iaWxpYmlsaS1wbGF5ZXItdmlkZW8nLHR5cGU6J2NsYXNzJ31dOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSA9IDA7aTx2aWRlb0RvbS5sZW5ndGg7aSsrKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvID0gdmlkZW9Eb21baV0udHlwZSA9PSAnZG9tJz9kb2N1bWVudC5xdWVyeVNlbGVjdG9yKHZpZGVvRG9tW2ldLm5hbWUpOmRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IodmlkZW9Eb21baV0ubmFtZSkuZmlyc3RDaGlsZDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodmlkZW8pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lclpobUljb24pOyAvL+WPlua2iOWumuaXtuWZqAoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8uYWRkRXZlbnRMaXN0ZW5lcigncGxheScsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygi5pKt5pS+5byA5aeLIik7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3JlYXRlQmlsaVZpZGVvRG93bmxvYWQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby5hZGRFdmVudExpc3RlbmVyKCdlbmRlZCcsZnVuY3Rpb24oKXsgLy/nu5PmnZ8KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLmluZGV4T2YoJ2Jhbmd1bWknKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiaWxpRG93bmxvYWQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYmlsaURvd25sb2FkJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGJpbGlEb3dubG9hZCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpbGlEb3dubG9hZC5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKGJpbGlEb3dubG9hZCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwoKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgZ2V0Q29udHJvbHMoKTsKCiAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgfQoKICAgICAgICAgICAgY3JlYXRlQmlsaVZpZGVvRG93bmxvYWQoKXsKCiAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwoKICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGdldENvbnRyb2xzKCl7CgogICAgICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZEljb24gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYmlsaURvd25sb2FkJyk7CgogICAgICAgICAgICAgICAgICAgIGlmKGRvd25sb2FkSWNvbil7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfkuIvovb3mjInpkq7lt7LlrZjlnKgnKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLmluZGV4T2YoJ2Jhbmd1bWknKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcXVhbGl0eSA9IGF3YWl0IEJhc2VDbGFzcy5nZXRFbGVtZW50KCcuc3F1aXJ0bGUtcXVhbGl0eS13cmFwJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBpZighcXVhbGl0eSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ayoeacieaJvuWIsERPTScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbnRyb2wgPSBxdWFsaXR5LmNsb25lTm9kZSh0cnVlKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wucXVlcnlTZWxlY3RvcignLnNxdWlydGxlLXZpZGVvLXF1YWxpdHktdGV4dCcpLmlubmVyVGV4dD0n5LiL6L29JzsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wuc2V0QXR0cmlidXRlKCdpZCcsJ2JpbGlEb3dubG9hZCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eS5iZWZvcmUoY29udHJvbCk7CgogICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKGxvY2F0aW9uLmhyZWYuaW5kZXhPZigndmlkZW8nKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXV0b0ljb25Eb20gPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgnLmJpbGliaWxpLXBsYXllci12aWRlby1idG4tcXVhbGl0eScpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWF1dG9JY29uRG9tKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbnRyb2wgPSBhdXRvSWNvbkRvbS5jbG9uZU5vZGUodHJ1ZSk7CgogICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sLnN0eWxlPSdtYXJnaW4tcmlnaHQ6MjBweDsnOwoKICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuYnVpLXNlbGVjdC1yZXN1bHQnKS5pbm5lclRleHQ9J+S4i+i9vSc7CgogICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sLnF1ZXJ5U2VsZWN0b3IoJy5idWktc2VsZWN0LXJlc3VsdCcpLnNldEF0dHJpYnV0ZSgnaWQnLCdiaWxpRG93bmxvYWQnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9JY29uRG9tLmJlZm9yZShjb250cm9sKTsKCiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5b2T5YmN6aG16Z2i5LiN5piv6KeG6aKR5oiW55Wq5YmnJyk7cmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNiaWxpRG93bmxvYWQnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBidmlkID0gJycsYXZpZD0nJzsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYuaW5kZXhPZignYmFuZ3VtaScpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidmlkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmF2LWxpbmsnKS5pbm5lclRleHQ7CgogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZihsb2NhdGlvbi5ocmVmLmluZGV4T2YoJ3ZpZGVvJykgIT0gLTEpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSBsb2NhdGlvbi5ocmVmLm1hdGNoKC9odHRwczpcL1wvd3d3LmJpbGliaWxpLmNvbVwvdmlkZW9cLyguKylcPy8pOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBhcmFtc1sxXS5pbmRleE9mKCdhdicpICE9LTEpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmlkID0gcGFyYW1zWzFdLnJlcGxhY2UoJ2F2JywnJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ2aWQgPSBwYXJhbXNbMV0uc3Vic3RyaW5nKHBhcmFtc1sxXS5sZW5ndGgtMSk9PScvJz9wYXJhbXNbMV0uc3Vic3RyaW5nKDAscGFyYW1zWzFdLmxlbmd0aC0xKTpwYXJhbXNbMV07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+W9k+WJjemhtemdouaXoOazleS4i+i9vScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWJ2aWQgJiYgIWF2aWQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmnKrojrflj5Zidmlk5oiWYXZpZCcpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICJodHRwczovL2FwaS5iaWxpYmlsaS5jb20veC93ZWItaW50ZXJmYWNlL3ZpZXc/YnZpZD0iK2J2aWQrIiZhaWQ9IithdmlkOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVyaSA9IF90aGlzLnJlcXVlc3QoJ2dldCcsdXJsKS50aGVuKChyZXN1bHQpPT57CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3AgPSBKU09OLnBhcnNlKHJlc3VsdCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocmVzcC5jb2RlIDwgMCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+l6KeG6aKR5peg5rOV5LiL6L29Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop4bpopHkv6Hmga/mjqXlj6Pov5Tlm57mlbDmja7plJnor68nKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/pgInpm4ZjaWQKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFnZUlkID0gX3RoaXMuZ2V0UXVlcnlTdHJpbmcoJ3AnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2lkID0gJyc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFnZUlkKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lkID0gcmVzcC5kYXRhLnBhZ2VzW3BhZ2VJZC0xXS5jaWQ7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpZCA9IHJlc3AuZGF0YS5jaWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coY2lkKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGluayA9ICdodHRwczovL2FwaS5iaWxpYmlsaS5jb20veC9wbGF5ZXIvcGxheXVybD9hdmlkPScrcmVzcC5kYXRhLmFpZCsnJmNpZD0nK2NpZCsnJnFuPTExMic7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IF90aGlzLnJlcXVlc3QoJ2dldCcsbGluaykudGhlbigocmVzdWx0KT0+ewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IEpTT04ucGFyc2UocmVzdWx0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGF0YS5jb2RlIDwgMCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+l6KeG6aKR5peg5rOV5LiL6L29Jyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop4bpopHlnLDlnYDmjqXlj6Pov5Tlm57mlbDmja7plJnor68nKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZG93bmxvYWRVcmwgPSBkYXRhLmRhdGEuZHVybFswXS51cmw7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vR01fZG93bmxvYWQoZG93bmxvYWRVcmwpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub3Blbihkb3dubG9hZFVybCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBnZXRDb250cm9scygpOwoKICAgICAgICAgICAgfQoKICAgICAgICAgICAgY3JlYXRlQmlsaVZpZGVvRG93bmxvYWRPdGhlcigpewoKICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7CgogICAgICAgICAgICAgICAgYXN5bmMgZnVuY3Rpb24gZ2V0Q29udHJvbHMoKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGRvd25sb2FkSWNvbiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNiaWxpRG93bmxvYWQnKTsKCiAgICAgICAgICAgICAgICAgICAgaWYoZG93bmxvYWRJY29uKXsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+S4i+i9veaMiemSruW3suWtmOWcqCcpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYuaW5kZXhPZignYmFuZ3VtaScpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBxdWFsaXR5ID0gYXdhaXQgQmFzZUNsYXNzLmdldEVsZW1lbnQoJy5zcXVpcnRsZS1xdWFsaXR5LXdyYXAnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFxdWFsaXR5KXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udHJvbCA9IHF1YWxpdHkuY2xvbmVOb2RlKHRydWUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuc3F1aXJ0bGUtdmlkZW8tcXVhbGl0eS10ZXh0JykpOwoKICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuc3F1aXJ0bGUtdmlkZW8tcXVhbGl0eS10ZXh0JykuaW5uZXJUZXh0PSfkuIvovb0nOwoKICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5zZXRBdHRyaWJ1dGUoJ2lkJywnYmlsaURvd25sb2FkJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5LmJlZm9yZShjb250cm9sKTsKCiAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYobG9jYXRpb24uaHJlZi5pbmRleE9mKCd2aWRlbycpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdXRvSWNvbkRvbSA9IGF3YWl0IEJhc2VDbGFzcy5nZXRFbGVtZW50KCcuYnB4LXBsYXllci1jdHJsLXF1YWxpdHknKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFhdXRvSWNvbkRvbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ayoeacieaJvuWIsERPTScpO3JldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9sID0gYXV0b0ljb25Eb20uY2xvbmVOb2RlKHRydWUpOwoKICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5zdHlsZT0nbWFyZ2luLXJpZ2h0OjIwcHg7JzsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wucXVlcnlTZWxlY3RvcignLmJweC1wbGF5ZXItY3RybC1xdWFsaXR5LXJlc3VsdCcpLmlubmVyVGV4dD0n5LiL6L29JzsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wucXVlcnlTZWxlY3RvcignLmJweC1wbGF5ZXItY3RybC1xdWFsaXR5LW1lbnUnKS5zZXRBdHRyaWJ1dGUoJ2lkJywnYmlsaURvd25sb2FkJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWVudUl0ZW1zID0gY29udHJvbC5xdWVyeVNlbGVjdG9yQWxsKCcuYnB4LXBsYXllci1jdHJsLXF1YWxpdHktbWVudS1pdGVtJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBtZW51SXRlbXMuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVZhbHVlID0gaXRlbS5nZXRBdHRyaWJ1dGUoJ2RhdGEtVmFsdWUnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkYXRhVmFsdWUgIT0gMTYgJiYgZGF0YVZhbHVlICE9IDgwKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKGl0ZW0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAgICAgICAgICAgICBhdXRvSWNvbkRvbS5iZWZvcmUoY29udHJvbCk7CgogICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sLm9ubW91c2VvdmVyPSgpPT57CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuYnB4LXBsYXllci1jdHJsLXF1YWxpdHktbWVudScpLnN0eWxlLmRpc3BsYXk9J2Jsb2NrJzsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wub25tb3VzZW91dD0oKT0+ewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuYnB4LXBsYXllci1jdHJsLXF1YWxpdHktbWVudScpLnN0eWxlLmRpc3BsYXk9J25vbmUnOwoKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCflvZPliY3pobXpnaLkuI3mmK/op4bpopHmiJbnlarliacnKTtyZXR1cm47CgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2JpbGlEb3dubG9hZCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiaWxpRGF0YVZhbHVlID0gZS50YXJnZXQuZ2V0QXR0cmlidXRlKCdkYXRhLVZhbHVlJyk/ZS50YXJnZXQuZ2V0QXR0cmlidXRlKCdkYXRhLVZhbHVlJyk6Jyc7CgogICAgICAgICAgICAgICAgICAgICAgICBpZighYmlsaURhdGFWYWx1ZSlyZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgYnZpZCA9ICcnLGF2aWQ9Jyc7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLmluZGV4T2YoJ2Jhbmd1bWknKSAhPSAtMSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnZpZCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5hdi1saW5rJykuaW5uZXJUZXh0OwoKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYobG9jYXRpb24uaHJlZi5pbmRleE9mKCd2aWRlbycpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm93VXJsID0gbG9jYXRpb24uaHJlZi5zcGxpdCgnPycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSBub3dVcmxbMF0ubWF0Y2goL2h0dHBzOlwvXC93d3cuYmlsaWJpbGkuY29tXC92aWRlb1wvKC4rKS8pOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBhcmFtc1sxXS5pbmRleE9mKCdhdicpICE9LTEpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmlkID0gcGFyYW1zWzFdLnJlcGxhY2UoJ2F2JywnJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ2aWQgPSBwYXJhbXNbMV0uc3Vic3RyaW5nKHBhcmFtc1sxXS5sZW5ndGgtMSk9PScvJz9wYXJhbXNbMV0uc3Vic3RyaW5nKDAscGFyYW1zWzFdLmxlbmd0aC0xKTpwYXJhbXNbMV07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+W9k+WJjemhtemdouaXoOazleS4i+i9vScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWJ2aWQgJiYgIWF2aWQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmnKrojrflj5Zidmlk5oiWYXZpZCcpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICJodHRwczovL2FwaS5iaWxpYmlsaS5jb20veC93ZWItaW50ZXJmYWNlL3ZpZXc/YnZpZD0iK2J2aWQrIiZhaWQ9IithdmlkOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVyaSA9IF90aGlzLnJlcXVlc3QoJ2dldCcsdXJsKS50aGVuKChyZXN1bHQpPT57CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3AgPSBKU09OLnBhcnNlKHJlc3VsdCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocmVzcC5jb2RlIDwgMCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+l6KeG6aKR5peg5rOV5LiL6L29Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop4bpopHkv6Hmga/mjqXlj6Pov5Tlm57mlbDmja7plJnor68nKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/pgInpm4ZjaWQKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFnZUlkID0gX3RoaXMuZ2V0UXVlcnlTdHJpbmcoJ3AnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2lkID0gJyc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFnZUlkKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lkID0gcmVzcC5kYXRhLnBhZ2VzW3BhZ2VJZC0xXS5jaWQ7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpZCA9IHJlc3AuZGF0YS5jaWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpbmsgPSAnaHR0cHM6Ly9hcGkuYmlsaWJpbGkuY29tL3gvcGxheWVyL3BsYXl1cmw/YXZpZD0nK3Jlc3AuZGF0YS5haWQrJyZjaWQ9JytjaWQrJyZxbj0nK2JpbGlEYXRhVmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IF90aGlzLnJlcXVlc3QoJ2dldCcsbGluaywnJyx0cnVlKS50aGVuKChyZXN1bHQpPT57CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gSlNPTi5wYXJzZShyZXN1bHQpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkYXRhLmNvZGUgPCAwKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfor6Xop4bpopHml6Dms5XkuIvovb0nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+inhumikeWcsOWdgOaOpeWPo+i/lOWbnuaVsOaNrumUmeivrycpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZFVybCA9IGRhdGEuZGF0YS5kdXJsWzBdLnVybDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9HTV9kb3dubG9hZChkb3dubG9hZFVybCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKGRvd25sb2FkVXJsKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CgogICAgICAgICAgICB9CgogICAgICAgICAgICB5b3V0dWJlVmlkZW9Eb3dubG9hZCgpewoKICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7CgogICAgICAgICAgICAgICAgbGV0IHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGxvY2F0aW9uLmhyZWYubWF0Y2goL15odHRwcz86XC9cL3d3d1wueW91dHViZVwuY29tXC8od2F0Y2hcP3Y9Lit8c2hvcnRzXC8uKykvKTsKCiAgICAgICAgICAgICAgICAgICAgaWYodXJsKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5b3V0dWJlSWNvbiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1sb2dvJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBpZih5b3V0dWJlSWNvbil7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5b3V0dWJlSWNvbi5zdHlsZS5vcGFjaXR5PTE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy56aG1Mb2dvKCk7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVdyYXBIdG1sID0gIjxkaXYgY2xhc3M9J3pobV9wbGF5X3ZpZGVvX2xpbmUnPiI7CgogICAgICAgICAgICAgICAgICAgICAgICBwbGF5V3JhcEh0bWwgKz0iPHVsIGNsYXNzPSd6aG1fcGxheV92aWRlX2xpbmVfdWwnPiI7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheUxpbmUgPSBbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bmFtZTon5LiL6L2957q/6LevMScsdXJsOidodHRwczovL3poLnNhdmVmcm9tLm5ldC8xNzYvI3VybD0nfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtuYW1lOifkuIvovb3nur/ot68yJyx1cmw6J2h0dHBzOi8vbXlkb3duZG93bi5jb20veTIjJ30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bmFtZTon5LiL6L2957q/6LevMycsdXJsOidodHRwczovL3d3dy55dGRvd25may5jb20vc2VhcmNoP3VybD0nfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtuYW1lOifkuIvovb3nur/ot680Jyx1cmw6J2h0dHBzOi8veW91dC5jb20vdmlkZW8vP3VybD0nfQogICAgICAgICAgICAgICAgICAgICAgICBdOwoKICAgICAgICAgICAgICAgICAgICAgICAgcGxheUxpbmUuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5V3JhcEh0bWwgKz1gPGxpIGNsYXNzPSdwbGF5TGluZVRkIHpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGknIHVybD0nJHtpdGVtLnVybH0nID4ke2l0ZW0ubmFtZX08L2xpPmA7CgogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgcGxheVdyYXBIdG1sICs9IjwvdWw+PC9kaXY+IjsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6aG1QbGF5ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3pobWxvZ28nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5TGluZURvbSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgcGxheUxpbmVEb20uY2xhc3NOYW1lID0gJ3BsYXlMaW5lRGl2IHpobV9wbGF5X3ZpZGVvX3dyYXAnOwoKICAgICAgICAgICAgICAgICAgICAgICAgcGxheUxpbmVEb20uc3R5bGUuZGlzcGxheSA9ICdub25lJzsKCiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlMaW5lRG9tLmlubmVySFRNTCA9IHBsYXlXcmFwSHRtbDsKCiAgICAgICAgICAgICAgICAgICAgICAgIHpobVBsYXkuYXBwZW5kQ2hpbGQocGxheUxpbmVEb20pOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlMaW5lVGQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcucGxheUxpbmVUZCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgcGxheUxpbmVUZC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKGl0ZW0uZ2V0QXR0cmlidXRlKCd1cmwnKStsb2NhdGlvbi5ocmVmKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5wbGF5QnV0dG9uJykub25tb3VzZW92ZXI9KCk9PnsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIucGxheUxpbmVEaXYiKS5zdHlsZS5kaXNwbGF5PSdibG9jayc7CgogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGxheUJ1dHRvbicpLm9ubW91c2VvdXQ9KCk9PnsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIucGxheUxpbmVEaXYiKS5zdHlsZS5kaXNwbGF5PSdub25lJzsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnpobUxvZ29EcmFnKCd5b3V0dWJlJywnJyk7CgogICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobUljb24gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtSWNvbicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoemhtSWNvbil7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgemhtSWNvbi5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHpobUljb24pOwogICAgICAgICAgICAgICAgICAgICAgICB9CgoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobWxvZ28gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtbG9nbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoemhtbG9nbyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy96aG1sb2dvLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoemhtbG9nbyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgemhtbG9nby5zdHlsZS5vcGFjaXR5PTA7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIH0sNTAwKQoKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgdmFyIGFsbFdlYiA9IFsuLi5nZXRDb3Vwb24sLi4uanhWaWRlbywuLi5qeE11c2ljLC4uLnpoTmljZSwuLi50YW9iYW8sLi4udmlkZW9Eb3dubG9hZCwuLi5iYWlkdV07CgogICAgICAgIHZhciBub3dXZWI9W107CgogICAgICAgIGFsbFdlYi5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgaWYoaXRlbS5pc09wZW4gPT0gMCkgcmV0dXJuIHRydWU7CgogICAgICAgICAgICBpdGVtLndlYi5mb3JFYWNoKGZ1bmN0aW9uKHZhbCl7CgogICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IGxvY2F0aW9uLmhyZWYubWF0Y2godmFsLm1hdGNoKTsKCiAgICAgICAgICAgICAgICBpZihyZXN1bHQpewoKICAgICAgICAgICAgICAgICAgICBub3dXZWIucHVzaCh2YWwpOwoKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSkKCiAgICAgICAgfSkKCiAgICAgICAgaWYobm93V2ViLmxlbmd0aD09MCl7CgogICAgICAgICAgICBsZXQgYmFzZUNsYXNzID0gbmV3IEJhc2VDbGFzcygpOwoKICAgICAgICAgICAgY29uc29sZS5sb2coJ+ayoeacieWMuemFjeivpee9keermeaIluivpeaooeWdl+W3suWFs+mXrScpO3JldHVybjsKICAgICAgICB9CgogICAgICAgIG5vd1dlYi5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgc3dpdGNoKGl0ZW0uZnVuY05hbWUpewogICAgICAgICAgICAgICAgY2FzZSAnY291cG9uJzoKCiAgICAgICAgICAgICAgICAgICAgY291cG9uRnVuYyhpdGVtKTsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJ3BsYXlWaWRlbyc6CiAgICAgICAgICAgICAgICAgICAgcGxheVZpZGVvRnVuYygpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAncGxheU11c2ljJzoKICAgICAgICAgICAgICAgICAgICBwbGF5TXVzaWNGdW5jKGl0ZW0pOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnemhOaWNlJzoKICAgICAgICAgICAgICAgICAgICB6aE5pY2VGdW5jKCk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICdiYWlkdSc6CiAgICAgICAgICAgICAgICAgICAgdmFyIGJhc2VDbGFzcyA9IG5ldyBCYXNlQ2xhc3M7CiAgICAgICAgICAgICAgICAgICAgYmFpZHVGdW5jKCk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICd2aWRlb0Rvd25sb2FkJzoKCiAgICAgICAgICAgICAgICAgICAgdmFyIHZpZGVvRG93bmxvYWRDbGFzcyA9IG5ldyBWaWRlb0Rvd25sb2FkQ2xhc3MoKTsKCiAgICAgICAgICAgICAgICAgICAgdmFyIHtmdW5jTmFtZSxtYXRjaDpub3dNYXRjaCxub2RlOm5vd05vZGUsbmFtZTpub3dOYW1lfSA9IGl0ZW07CgogICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0uaXNXZWJPcGVuID09IDApewoKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coaXRlbS5uYW1lKyflt7LlhbPpl60nKTtyZXR1cm47CgogICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9Eb3dubG9hZENsYXNzW25vd05hbWVdKCk7CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgICAgICBjYXNlICd0YW9iYW9TZWFyY2gnOgogICAgICAgICAgICAgICAgICAgIHRhb2Jhb1NlYXJjaEZ1bmMoaXRlbSkKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgogICAgICAgICAgICB9CgogICAgICAgIH0pCgogICAgICAgIGZ1bmN0aW9uIGNvdXBvbkZ1bmMoaXRlbSl7CgogICAgICAgICAgICB2YXIgY291cG9uQ2xhc3MgPSBuZXcgQ291cG9uQ2xhc3MoKTsKCiAgICAgICAgICAgIHZhciB7ZnVuY05hbWUsbWF0Y2g6bm93TWF0Y2gsbm9kZTpub3dOb2RlLG5hbWU6bm93TmFtZX0gPSBpdGVtOwoKICAgICAgICAgICAgdmFyIGNvdXBvblN0eWxlID1gCiAgICAgICAgICAgICAgICAgICAgaHRtbHsKICAgICAgICAgICAgICAgICAgICAtLXJpZ2h0OjEwMCU7CiAgICAgICAgICAgICAgICAgICAgLS1sZWZ0OjEwMCU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2NvdXBvbnsKICAgICAgICAgICAgICAgICAgICB3aWR0aDpmaXQtY29udGVudDsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOnJvdzsKICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47CiAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6ZmxleC1zdGFydDsKICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luLWJvdHRvbToxNXB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9sZWZ0ewogICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAgZmxleC1kaXJlY3Rpb246cm93OwogICAgICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDpmbGV4LXN0YXJ0OwogICAgICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjE0cHg7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZDogcmFkaWFsLWdyYWRpZW50KGNpcmNsZSBhdCByaWdodCB0b3AsIHRyYW5zcGFyZW50IDhweCwjZmZmIDApIHRvcCBsZWZ0IC92YXIoLS1yaWdodCkgNTElIG5vLXJlcGVhdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYWRpYWwtZ3JhZGllbnQoY2lyY2xlIGF0IHJpZ2h0IGJvdHRvbSwgdHJhbnNwYXJlbnQgOHB4LCAjZmZmIDApIGJvdHRvbSBsZWZ0IC92YXIoLS1yaWdodCkgNTElIG5vLXJlcGVhdDsKICAgICAgICAgICAgICAgICAgICBmaWx0ZXI6IGRyb3Atc2hhZG93KDJweCAycHggM3B4ICM4ODgpOwogICAgICAgICAgICAgICAgICAgIGhlaWdodDo4NHB4OwogICAgICAgICAgICAgICAgICAgIHdpZHRoOjEwMCU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2ltZ19pY29uewogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6NHB4IDBweCAwcHggNXB4OwogICAgICAgICAgICAgICAgICAgIG1hcmdpbi1yaWdodDo1cHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2ltZ19pY29uIGltZ3sKICAgICAgICAgICAgICAgICAgICB3aWR0aDo0N3B4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9jb250ZW50ewogICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAgZmxleC1kaXJlY3Rpb246Y29sdW1uOwogICAgICAgICAgICAgICAgICAgIG1hcmdpbi1yaWdodDogMThweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fbW9uZXl7CiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgICAgICAgICAgICBmbGV4LWRpcmVjdGlvbjpyb3c7CiAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBmbGV4LXN0YXJ0OwogICAgICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2Ftb3VudF9tb25leXsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBmbGV4LXN0YXJ0OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9tb25leV9zaWduewogICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmMjMwMzA7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAyMHB4OwogICAgICAgICAgICAgICAgICAgIGZvbnQtZmFtaWx5OiBBcmlhbDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fbW9uZXlfbnVtewogICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmMjMwMzA7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjM2cHg7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luLWxlZnQ6IDJweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fY29uZGl0aW9uewogICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmYjBmM2E7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjRlYzsKICAgICAgICAgICAgICAgICAgICBtYXJnaW4tdG9wOjVweDsKICAgICAgICAgICAgICAgICAgICBtYXJnaW4tbGVmdDogNXB4OwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MnB4IDVweDsKICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTJweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fdGltZXsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOnJvdzsKICAgICAgICAgICAgICAgICAgICBtYXJnaW4tdG9wOiAtNXB4OwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MnB4IDRweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fdGVybXsKICAgICAgICAgICAgICAgICAgICBjb2xvcjojZmIwZjNhOwogICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkICNmYjBmM2E7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czoycHg7CiAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjBweCA0cHg7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjEycHg7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxOHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9kYXRlewogICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTRweDsKICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogNTAwOwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDo4cHg7CgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9jaXJjbGV7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZDogI2ZiMGYzYSB1cmwoZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFBZ0FBQUFJQ0FZQUFBREVENzZMQUFBQUNYQklXWE1BQUFzU0FBQUxFZ0hTM1g3OEFBQUF6VWxFUVZRWWxTM05NVW9EUVJpRzRYY211OWxBWEJRYnErMUNDcXVjd3NiT08zZ0FTMjloNFFtOGdSZElNS1ZnbFFWQkZpU0ZqWUtCcVdaMmQvN1BJdllQUEU2U01DSHZjRDhIdUx6QlVzSUtEeVk4QU40UlUrSjkvOG5IOG9MWUozd1djaHhCakpIdFprTjFmc2JwOW9tdmh6djZjY0RqUUpMYXRsWFhkWklrNWF3a0tWemRLazlXOGdCRlVWRFhOUUEyakpUQTdHU09tUjJMcG1rSUlXQTU0NnNwdk81d0wyOVF6M0dTQkJDSG5ud0l6TzRmMGZNYVlvS3kvQWNtOEE2K2Z4a1gxNUFOcWltWThRZW1DbTkyMHIxYVVBQUFBQUJKUlU1RXJrSmdnZz09KSByZXBlYXQteTsKICAgICAgICAgICAgICAgICAgICBtYXJnaW4tdG9wOjEwcHg7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDEwcHg7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OjY2cHg7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICAgICAgICAgIHJpZ2h0Ojk3cHg7CiAgICAgICAgICAgICAgICAgICAgei1pbmRleDoyOwogICAgICAgICAgICAgICAgICAgIGZpbHRlcjpub25lOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9saW5rX2NvdXBvbnsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOnJvdzsKICAgICAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczpjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgZmlsdGVyOiBkcm9wLXNoYWRvdygycHggMnB4IDNweCAjODg4KTsKICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kOiByYWRpYWwtZ3JhZGllbnQoY2lyY2xlIGF0IGxlZnQgdG9wLCB0cmFuc3BhcmVudCA4cHgsICNmYjA1M2EgMCkgdG9wIHJpZ2h0IC92YXIoLS1sZWZ0KSA1MCUgbm8tcmVwZWF0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhZGlhbC1ncmFkaWVudChjaXJjbGUgYXQgbGVmdCBib3R0b20sIHRyYW5zcGFyZW50IDhweCwgI2ZiMDUzYSAwKSBib3R0b20gcmlnaHQgL3ZhcigtLWxlZnQpIDUwJSBuby1yZXBlYXQ7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiA4NHB4OwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MHB4IDZweCAwcHggNHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9saW5rX3RleHR7CiAgICAgICAgICAgICAgICAgICAgY3Vyc29yOnBvaW50ZXI7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luLXRvcDogMHB4OwogICAgICAgICAgICAgICAgICAgIHdyaXRpbmctbW9kZTp2ZXJ0aWNhbC1scjsKICAgICAgICAgICAgICAgICAgICBsZXR0ZXItc3BhY2luZzowcHg7CiAgICAgICAgICAgICAgICAgICAgY29sb3I6ICNmZmYgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgICAgICAgICAgICAgICBmb250LWZhbWlseToiTWljcm9zb2Z0IFlhSGVpIjsKICAgICAgICAgICAgICAgICAgICB0ZXh0LWRlY29yYXRpb246bm9uZTsKICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kOiByYWRpYWwtZ3JhZGllbnQoY2lyY2xlIGF0IGxlZnQgdG9wLCB0cmFuc3BhcmVudCA4cHgsICNmYjA1M2EgMCkgdG9wIHJpZ2h0IC92YXIoLS1sZWZ0KSA1MCUgbm8tcmVwZWF0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhZGlhbC1ncmFkaWVudChjaXJjbGUgYXQgbGVmdCBib3R0b20sIHRyYW5zcGFyZW50IDhweCwgI2ZiMDUzYSAwKSBib3R0b20gcmlnaHQgL3ZhcigtLWxlZnQpIDUwJSBuby1yZXBlYXQ7CgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9saW5rX3RleHQ6aG92ZXJ7CiAgICAgICAgICAgICAgICB0ZXh0LWRlY29yYXRpb246bm9uZTsKICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OjgwMDsKICAgICAgICAgICAgICAgIGZvbnQtZmFtaWx5OiJNaWNyb3NvZnQgWWFIZWkiOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9xcmNvZGV7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyOjNweCBzb2xpZCAjZmZmOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGA7CgogICAgICAgICAgICBkb21TdHlsZSAuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoY291cG9uU3R5bGUpKTsKCiAgICAgICAgICAgIGRvbUhlYWQuYXBwZW5kQ2hpbGQoZG9tU3R5bGUpOwoKICAgICAgICAgICAgbGV0IG49MDsKCiAgICAgICAgICAgIGxldCBjb3Vwb25UaW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgbisrOwoKICAgICAgICAgICAgICAgIGxldCBwYWdlTm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3Iobm93Tm9kZSkKCiAgICAgICAgICAgICAgICBpZihwYWdlTm9kZSl7CgogICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoY291cG9uVGltZXIpOwoKICAgICAgICAgICAgICAgICAgICBjb3Vwb25DbGFzc1tub3dOYW1lXSgpOwoKICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICBpZihuPT1jb3Vwb25UaW1lck51bSkgY2xlYXJJbnRlcnZhbChjb3Vwb25UaW1lcik7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9LDEwMCkKICAgICAgICAgICAgfQoKICAgICAgICBmdW5jdGlvbiBwbGF5VmlkZW9GdW5jKCl7CgogICAgICAgICAgICB2YXIgcGxheVZpZGVvQ2xhc3MgPSBuZXcgUGxheVZpZGVvQ2xhc3MoKTsKCiAgICAgICAgICAgIHBsYXlWaWRlb0NsYXNzLnpobUxvZ28oKTsKCiAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCdwbGF5VmlkZW9MaW5lVGV4dCcpKXsKCiAgICAgICAgICAgICAgICBsZXQgbGluZU9iaiA9IHBsYXlWaWRlb0NsYXNzLmdldExpbmUoR01fZ2V0VmFsdWUoJ3BsYXlWaWRlb0xpbmVUZXh0JykpOwoKICAgICAgICAgICAgICAgIGlmKGxpbmVPYmopewoKICAgICAgICAgICAgICAgICAgICBwbGF5TGluZSA9IGxpbmVPYmoKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vdGVtcGxhdGU6aWNvbixwbGF5TGluZTsKICAgICAgICAgICAgbGV0IHBsYXlXcmFwSHRtbCA9ICI8ZGl2IGNsYXNzPSd6aG1fcGxheV92aWRlb19saW5lJz4iOwoKICAgICAgICAgICAgcGxheVdyYXBIdG1sICs9IjxkaXY+PHVsIGNsYXNzPSd6aG1fcGxheV92aWRlX2xpbmVfdWwnPiI7CgogICAgICAgICAgICBwbGF5TGluZS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgIGxldCBzZWxlY3RlZCA9ICcnOwoKICAgICAgICAgICAgICAgIGlmKHBsYXlWaWRlb0NsYXNzLmdldENvb2tpZSgncGxheUxpbmVBY3Rpb24nKSA9PSBpdGVtLnVybCl7CgogICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gJ3pobV9saW5lX3NlbGVjdGVkJzsKCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgcGxheVdyYXBIdG1sICs9YDxsaSBjbGFzcz0ncGxheUxpbmVUZCB6aG1fcGxheV92aWRlb19saW5lX3VsX2xpICR7c2VsZWN0ZWR9JyB1cmw9JyR7aXRlbS51cmx9JyA+JHtpdGVtLm5hbWV9PC9saT5gOwoKICAgICAgICAgICAgfSkKCiAgICAgICAgICAgIHBsYXlXcmFwS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nxsXC9bMC05XS8sYXJlYUNsYXNzTmFtZTonZXBpc29kZS1pdGVtcyd9LAoKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbm9kZToiLngtcGxheWVyIixub2RlVHlwZTonY2xhc3MnLG1hdGNoOi90dlwuc29odVwuY29tXC92LyxhcmVhQ2xhc3NOYW1lOidzZXJpZXMtdGFiX3BhbmUnfSwKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbm9kZToiI3BsYXllcldyYXAiLG5vZGVUeXBlOidpZCcsbWF0Y2g6L2ZpbG1cLnNvaHVcLmNvbVwvYWxidW1cLy99LAoKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbm9kZToiI2xlX3BsYXlib3giLG5vZGVUeXBlOidpZCcsbWF0Y2g6L2xlXC5jb21cL3B0dlwvdnBsYXlcLy8sYXJlYUNsYXNzTmFtZTonanVqaV9ncmlkJ30sCgogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjcGxheWVyIixub2RlVHlwZTonaWQnLG1hdGNoOi9wbGF5XC50dWRvdVwuY29tXC92X3Nob3dcL2lkXy99LAoKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbm9kZToiI3BwdHZfcGxheXBhZ2VfYm94Iixub2RlVHlwZTonaWQnLG1hdGNoOi92XC5wcHR2XC5jb21cL3Nob3dcLy99LAoKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbm9kZToiI3BsYXllciIsbm9kZVR5cGU6J2lkJyxtYXRjaDovdmlwXC4xOTA1LmNvbVwvcGxheVwvL30sCgogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjdm9kUGxheWVyIixub2RlVHlwZTonaWQnLG1hdGNoOi93d3dcLjE5MDUuY29tXC92b2RcL3BsYXlcLy99LAogICAgICAgICAgICBdOwoKICAgICAgICAgICAgbGV0IGp4VmlkZW9XZWIgPSBqeFZpZGVvRGF0YS5maWx0ZXIoZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgcmV0dXJuIGxvY2F0aW9uLmhyZWYubWF0Y2goaXRlbS5tYXRjaCk7CgogICAgICAgICAgICB9KQoKICAgICAgICAgICAgcGxheVZpZGVvQ2xhc3MuemhtTG9nb0RyYWcoJ3ZpZGVvJyxqeFZpZGVvV2ViKTsKCiAgICAgICAgICAgIC8v5piv5ZCm5Zyo5pKt5pS+6aG1CiAgICAgICAgICAgIGlmKGp4VmlkZW9XZWIubGVuZ3RoID4gMCl7CgogICAgICAgICAgICAgICAgdmFyIHtmdW5jTmFtZSxtYXRjaDpub3dNYXRjaCxub2RlOm5vd05vZGUsbmFtZTpub3dOYW1lfSA9IGp4VmlkZW9XZWJbMF07CgogICAgICAgICAgICAgICAgLy/pvKDmoIfnu4/ov4fmmL7npLrnur/ot68KICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5wbGF5QnV0dG9uJykub25tb3VzZW92ZXI9KCk9PnsKCiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiLnBsYXlMaW5lRGl2Iikuc3R5bGUuZGlzcGxheT0nYmxvY2snOwoKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGxheUJ1dHRvbicpLm9ubW91c2VvdXQ9KCk9PnsKCiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiLnBsYXlMaW5lRGl2Iikuc3R5bGUuZGlzcGxheT0nbm9uZSc7CgogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC8v6YCJ5oup57q/6Lev6Kej5p6Q5pKt5pS+CgogICAgICAgICAgICAgICAgdmFyIHBsYXlMaW5lVGQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcucGxheUxpbmVUZCcpOwoKICAgICAgICAgICAgICAgIHBsYXlMaW5lVGQuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgaXRlbS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlMaW5lVGQuZm9yRWFjaChmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnNldEF0dHJpYnV0ZSgnY2xhc3MnLCdwbGF5TGluZVRkIHpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGknKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QXR0cmlidXRlKCdjbGFzcycsJ3BsYXlMaW5lVGQgemhtX3BsYXlfdmlkZW9fbGluZV91bF9saSB6aG1fbGluZV9zZWxlY3RlZCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgcGxheVZpZGVvQ2xhc3Muc2V0Q29va2llKCdwbGF5TGluZUFjdGlvbicsdGhpcy5nZXRBdHRyaWJ1dGUoJ3VybCcpLDMwKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCd2aWRlb1BsYXlMaW5lQWRkJykgIT0gMjIpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3dXZWJOb2RlID0gZG9jdW1lbnQucXVlcnlTZWxlY3Rvcihub3dOb2RlKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihub3dXZWJOb2RlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm93V2ViTm9kZS5pbm5lckhUTUwgPSBwbGF5SnhIdG1sOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheUlmcmFtZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNwbGF5SWZyYW1lJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlJZnJhbWUuc3JjPSBpdGVtLmdldEF0dHJpYnV0ZSgndXJsJykrbG9jYXRpb24uaHJlZjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+inhumikee9keermee7k+eCueS4jeWtmOWcqCcpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Lm9wZW4oaXRlbS5nZXRBdHRyaWJ1dGUoJ3VybCcpK2xvY2F0aW9uLmhyZWYpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAvKi0t54m55q6K5aSE55CGLS0qLwogICAgICAgICAgICAgICAgLy/kvJjphbfljrvlub/lkYoKICAgICAgICAgICAgICAgIGlmKG5vd05vZGU9PSIjcGxheWVyIil7CgogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5b3VrdUFkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmFkdmVydGlzZS1sYXllcicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHlrQWQgPSB5b3VrdUFkLmxhc3RDaGlsZDsKCiAgICAgICAgICAgICAgICAgICAgICAgIHlrQWQucGFyZW50Tm9kZS5yZW1vdmVDaGlsZCh5a0FkKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5rdWktZGFzaGJvYXJkLTAnKS5zdHlsZT0nZGlzcGxheTpmbGV4JzsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5VmlkZW8gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcudmlkZW8tbGF5ZXIgdmlkZW8nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlWaWRlby5wbGF5KCk7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgbj0wOwoKICAgICAgICAgICAgICAgICAgICAgICAgLy/mmoLlgZwKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmt1aS1wbGF5LWljb24tMCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlbyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy52aWRlby1sYXllciB2aWRlbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG4rKyUyID09IDApewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby5wYXVzZSgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby5wbGF5KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9KTsKCiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlWaWRlby5hZGRFdmVudExpc3RlbmVyKCd0aW1ldXBkYXRlJyxmdW5jdGlvbigpeyAvL+aSreaUvuaXtumXtOaUueWPmAoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5b3VrdUFkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmFkdmVydGlzZS1sYXllcicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5a0FkID0geW91a3VBZC5sYXN0Q2hpbGQ7CgoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHlrQWQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5a0FkLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoeWtBZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmt1aS1kYXNoYm9hcmQtMCcpLnN0eWxlPSdkaXNwbGF5OmZsZXgnOwogICAgICAgICAgICAgICAgICAgICAgICB9KTsKCiAgICAgICAgICAgICAgICAgICAgfSwzMDAwKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy/niLHlpYfoibrljrvlub/lkYoKICAgICAgICAgICAgICAgIGlmKG5vd05vZGU9PSIjZmxhc2hib3giKXsKCiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRvbSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5za2lwcGFibGUtYWZ0ZXInKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9tLmNsaWNrKCk7CgogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIH0sMzAwMCkKCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgLy/ohb7orq/ljrt2aXDlvLnnqpcKICAgICAgICAgICAgICAgIGlmKG5vd05vZGU9PSIjcGxheWVyLWNvbnRhaW5lciIpewoKICAgICAgICAgICAgICAgICAgICBsZXQgbiA9IDA7CgogICAgICAgICAgICAgICAgICAgIGxldCB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihuKysgPCAxMDApewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYW5lbFRpcFZpcCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5wYW5lbC1vdmVybGF5Jyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFuZWxUaXBWaXApewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYW5lbFRpcFZpcC5zdHlsZS5kaXNwbGF5PSdub25lJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgfSwxMDApCgoKCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy/kuZDop4bpgInpm4blpITnkIYKICAgICAgICAgICAgICAgIGlmKG5vd05vZGUgPT0gIiNsZV9wbGF5Ym94Iil7CgogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqQmxvY2sgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcual9ibG9jaycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWpCbG9jaykgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpPTA7aTxqQmxvY2subGVuZ3RoO2krKyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvSWQgPSBqQmxvY2tbaV0uZ2V0QXR0cmlidXRlKCdkYXRhLXZpZCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaW5rID0gYGh0dHBzOi8vd3d3LmxlLmNvbS9wdHYvdnBsYXkvJHt2aWRlb0lkfS5odG1sYDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqQmxvY2tbaV0uZmlyc3RDaGlsZC5zZXRBdHRyaWJ1dGUoJ2hyZWYnLGxpbmspOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSwzMDAwKQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC8vQuermeWkp+S8muWRmHVybOWkhOeQhu+8jOmhtemdomNsYXNz5LiN5LiA6Ie0CiAgICAgICAgICAgICAgICBpZihub3dOb2RlID09ICIucGxheWVyLWNvbnRhaW5lciIpewoKICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICBpZighZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnBsYXllci1jb250YWluZXInKSAmJiAhZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmJweC1wbGF5ZXItY29udGFpbmVyJykpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vd05vZGUgPSAnLnBsYXllci1tYXNrJzsKCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vd05vZGUgPSAnLmJweC1wbGF5ZXItY29udGFpbmVyJzsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICB9LDMwMDApCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgLyrohb7orq/op4bpopHngrnlh7vlhbblroPop4bpopHot7PovawqLwogICAgICAgICAgICAgICAgaWYobm93TmFtZT09J3FxUEMnKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGZpZ3VyZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5maWd1cmUnKTsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGZpZ3VyZURldGFpbCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5maWd1cmVfZGV0YWlsJyk7CgogICAgICAgICAgICAgICAgICAgIGxldCBsaXN0SXRlbSA9IFsuLi5maWd1cmUsLi4uZmlndXJlRGV0YWlsXTsKCiAgICAgICAgICAgICAgICAgICAgaWYobGlzdEl0ZW0ubGVuZ3RoID4gMCl7CgogICAgICAgICAgICAgICAgICAgICAgICBsaXN0SXRlbS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaW5rID0gdGhpcy5nZXRBdHRyaWJ1dGUoJ2hyZWYnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobGluayl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmID0gbGluazsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9TZWxlY3QgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuJytqeFZpZGVvV2ViWzBdLmFyZWFDbGFzc05hbWUpOwoKICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9TZWxlY3Qpe2NvbnNvbGUubG9nKCfor6XnvZHnq5nmkq3mlL7ljLrnsbvlkI3mlLnlj5gnKTtyZXR1cm47fQoKICAgICAgICAgICAgICAgICAgICB2aWRlb1NlbGVjdC5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oZSl7CgogICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGUudGFyZ2V0LnBhcmVudE5vZGUuaHJlZik7CgogICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZj1sb2NhdGlvbi5ocmVmOwoKICAgICAgICAgICAgICAgICAgICAgICAgfSwxMDAwKQoKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0sMjAwMCk7CiAgICAgICAgICAgIH0KCiAgICAgICAgfQoKICAgICAgICBmdW5jdGlvbiBwbGF5TXVzaWNGdW5jKCl7CgogICAgICAgICAgICBpZihzZWxmLmZyYW1lRWxlbWVudCAmJiBzZWxmLmZyYW1lRWxlbWVudC50YWdOYW1lID09ICJJRlJBTUUiKXsKCiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHZhciBwbGF5TXVzaWNDbGFzcyA9IG5ldyBQbGF5TXVzaWNDbGFzcygpOwoKICAgICAgICAgICAgdmFyIG11c2ljSWQgPSBNYXRoLmNlaWwoTWF0aC5yYW5kb20oKSoxMDAwMDAwMDApOwoKICAgICAgICAgICAgLy9uZXRlYXNlIOi3r+eUseS4pOasoe+8jOmcgOmHjeWumuS5iQogICAgICAgICAgICB2YXIgbmV3VXJsID0gbG9jYXRpb24uaHJlZjsKCiAgICAgICAgICAgIGxldCBqeE11c2ljV2ViID0ganhNdXNpY1swXS53ZWIuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgIHJldHVybiBuZXdVcmwubWF0Y2goaXRlbS5tYXRjaCk7CgogICAgICAgICAgICB9KQoKICAgICAgICAgICAgaWYoanhNdXNpY1dlYi5sZW5ndGgpewoKICAgICAgICAgICAgICAgIGxldCB0aW1lclpobUljb24gPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobUljb24nKSl7CgogICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyWmhtSWNvbik7IC8vIOWPlua2iOWumuaXtuWZqAoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoanhNdXNpY1dlYlswXS5uYW1lPT0na3V3bycpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbnRyb2wgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuaWNvbi1iYXJfaWNvbl9kb3dubG9hZF8nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb24gPSBjb250cm9sLmNsb25lTm9kZSh0cnVlKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWNvbi5jbGFzc05hbWUgPSAnJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWNvbi5zdHlsZT0nbWFyZ2luLWxlZnQ6MTBweDsnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpY29uLmlubmVySFRNTCA9ICI8YSBzdHlsZT0nZm9udC1zaXplOjEwcHg7d2hpdGUtc3BhY2U6IG5vd3JhcDtjdXJzb3I6cG9pbnRlcjtjb2xvcjojNTU1OycgaWQ9J2t1d29Eb3dubG9hZCc+5LiL6L29PC9hPiI7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9scyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5jb2xfcicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9scy5iZWZvcmUoaWNvbik7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNrdXdvRG93bmxvYWQnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdWRpb1NyYyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoImF1ZGlvIikuc3JjOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNvbmdOYW1lID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmNvbnRyb2wgLnNvbmdfbmFtZScpLnRpdGxlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGFydGlzdCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5jb250cm9sIC5hcnRpc3QnKS50aXRsZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy5MUl9kb3dubG9hZChhdWRpb1NyYyxzb25nTmFtZSsnLScrYXJ0aXN0KycubXAzJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwyMDAwKQogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBpZihqeE11c2ljV2ViWzBdLm5hbWU9PSd4aW1hbGF5YScpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+aSreaUvuWZqOWIm+W7uuS4i+i9vWljb24KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgeG1Db250cm9scyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy54bS1wbGF5ZXItb3ByYXRpb25zJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9sID0geG1Db250cm9scy5xdWVyeVNlbGVjdG9yKCdhOm50aC1vZi10eXBlKDIpJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uID0gY29udHJvbC5jbG9uZU5vZGUodHJ1ZSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGljb24uaW5uZXJIVE1MID0gIjxzcGFuIHN0eWxlPSdmb250LXNpemU6MTBweDt3aGl0ZS1zcGFjZTogbm93cmFwO2N1cnNvcjpwb2ludGVyO2NvbG9yOiNGRkY7JyBpZD0neGltYURvd25sb2FkJz7kuIvovb08L3NwYW4+IjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeG1Db250cm9scy5zdHlsZT0ncG9zaXRpb246IHJlbGF0aXZlO21hcmdpbi1sZWZ0Oi0yMHB4Oyc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy54bS1wbGF5ZXItcHJvZ3Jlc3MnKS5zdHlsZS53aWR0aD0nNDUwcHgnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcueG0tcGxheWVyLXBsYXl0aW1lJykuc3R5bGU9J3Bvc2l0aW9uOiBhYnNvbHV0ZTtyaWdodDo0MHB4Oyc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhtQ29udHJvbHMucHJlcGVuZChpY29uKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+aSreaUvuWZqOS4i+i9veS6i+S7tgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN4aW1hRG93bmxvYWQnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmbVRpdGxlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmZtLXRpdGxlJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZm1UaXRsZU1hdGNoID0gZm1UaXRsZS5ocmVmLm1hdGNoKC9eaHR0cHM/OlwvXC93d3dcLnhpbWFsYXlhXC5jb21cL3NvdW5kXC8oXFMqKSQvKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSAnaHR0cHM6Ly9tb2JpbGUueGltYWxheWEuY29tL21vYmlsZS1wbGF5cGFnZS90cmFjay92My9iYXNlSW5mby8nK25ldyBEYXRlKCkuZ2V0VGltZSgpKyc/ZGV2aWNlPXdlYiZ0cmFja0lkPScrZm1UaXRsZU1hdGNoWzFdOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheU11c2ljQ2xhc3MucmVxdWVzdCgnZ2V0Jyx1cmwpLnRoZW4oKHJlc3VsdCk9PnsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IEpTT04ucGFyc2UocmVzdWx0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVVybCA9IGRhdGEudHJhY2tJbmZvLnBsYXlVcmxMaXN0WzFdLnVybDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3RyMSA9IHBsYXlVcmwucmVwbGFjZUFsbCgnLScsJysnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3RyMiA9IHN0cjEucmVwbGFjZUFsbCgnXycsJy8nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbnVtID0gc3RyMi5sZW5ndGglNDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihudW0pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHIyICs9ICc9PT09Jy5zdWJzdHIobnVtKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGVjcnlwdGVkID0gQ3J5cHRvSlMuQUVTLmRlY3J5cHQoewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXBoZXJ0ZXh0OiBDcnlwdG9KUy5lbmMuQmFzZTY0LnBhcnNlKHN0cjIpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgQ3J5cHRvSlMuZW5jLkhleC5wYXJzZSgiYWFhZDNlNGZkNTQwYjBmNzlkY2E5NTYwNmU3MmJmOTMiKSwgewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlOiBDcnlwdG9KUy5tb2RlLkVDQiwKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGRlY3J5cHRlZCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGVjcnlwdGVkKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLkxSX2Rvd25sb2FkKGRlY3J5cHRlZCxkYXRhLnRyYWNrSW5mby50aXRsZSsnLm1wMycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop6Plr4blnLDlnYDlpLHotKUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v6aG16Z2i5YiX6KGo5Yib5bu65om56YeP5LiL6L29CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybE1hdGNoID0gbmV3VXJsLm1hdGNoKC9eaHR0cHM6XC9cL3d3dy54aW1hbGF5YS5jb21cL2FsYnVtXC9bMC05XSsvKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodXJsTWF0Y2gpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNvdW5kTGlzdCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNhbmNob3Jfc291bmRfbGlzdCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc291bmRMaXN0KXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc291bmRMaXN0SGVhZCA9IHNvdW5kTGlzdC5xdWVyeVNlbGVjdG9yKCcuaGVhZCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb3VuZExpc3RIZWFkVGl0bGUgPSBzb3VuZExpc3RIZWFkLnF1ZXJ5U2VsZWN0b3IoJy5zb3J0JykubGFzdENoaWxkOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gW3tuYW1lOifmibnph4/kuIvovb0nLGlkOidiYXRjaERvd25sb2FkJ30se25hbWU6J+mHjee9ricsaWQ6J3Jlc2V0J30se25hbWU6J+WFqOmAiScsaWQ6J3NlbGVjdEFsbCd9XTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9sID0gc291bmRMaXN0SGVhZFRpdGxlLmNsb25lTm9kZSh0cnVlKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5zZXRBdHRyaWJ1dGUoJ2lkJyxpdGVtLmlkKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5pbm5lclRleHQgPSBpdGVtLm5hbWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdW5kTGlzdEhlYWRUaXRsZS5hZnRlcihjb250cm9sKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5iZWZvcmUoIiB8ICIpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlNdXNpY0NsYXNzLnhtbHlDcmVhdGVDaGVja2JveCgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNzZWxlY3RBbGwnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobUNoZWNrYm94ID0gc291bmRMaXN0LnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W25hbWU9J3pobUNoZWNrYm94J10iKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemhtQ2hlY2tib3guZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFpdGVtLmNoZWNrZWQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uY2hlY2tlZD10cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3Jlc2V0JykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6aG1DaGVja2JveCA9IHNvdW5kTGlzdC5xdWVyeVNlbGVjdG9yQWxsKCJpbnB1dFtuYW1lPSd6aG1DaGVja2JveCddIik7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpobUNoZWNrYm94LmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLmNoZWNrZWQgPSBmYWxzZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNiYXRjaERvd25sb2FkJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQmFzZUNsYXNzLnRvYXN0KCflt7LkuIvovb3vvIzor7fnqI3lgJknKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobUNoZWNrYm94ID0gc291bmRMaXN0LnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W25hbWU9J3pobUNoZWNrYm94J10iKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemhtQ2hlY2tib3guZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0uY2hlY2tlZCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNjck1hdGNoID0gaXRlbS52YWx1ZS5tYXRjaCgvXC9zb3VuZFwvKFswLTldKykvKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gJ2h0dHBzOi8vbW9iaWxlLnhpbWFsYXlhLmNvbS9tb2JpbGUtcGxheXBhZ2UvdHJhY2svdjMvYmFzZUluZm8vJytuZXcgRGF0ZSgpLmdldFRpbWUoKSsnP2RldmljZT13ZWImdHJhY2tJZD0nK3Njck1hdGNoWzFdOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlNdXNpY0NsYXNzLnJlcXVlc3QoJ2dldCcsdXJsKS50aGVuKChyZXN1bHQpPT57CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gSlNPTi5wYXJzZShyZXN1bHQpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVVybCA9IGRhdGEudHJhY2tJbmZvLnBsYXlVcmxMaXN0WzFdLnVybDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0cjEgPSBwbGF5VXJsLnJlcGxhY2VBbGwoJy0nLCcrJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdHIyID0gc3RyMS5yZXBsYWNlQWxsKCdfJywnLycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbnVtID0gc3RyMi5sZW5ndGglNDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobnVtKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cjIgKz0gJz09PT0nLnN1YnN0cihudW0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlY3J5cHRlZCA9IENyeXB0b0pTLkFFUy5kZWNyeXB0KHsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcGhlcnRleHQ6IENyeXB0b0pTLmVuYy5CYXNlNjQucGFyc2Uoc3RyMikKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgQ3J5cHRvSlMuZW5jLkhleC5wYXJzZSgiYWFhZDNlNGZkNTQwYjBmNzlkY2E5NTYwNmU3MmJmOTMiKSwgewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5FQ0IsCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczcKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGRlY3J5cHRlZCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRlY3J5cHRlZCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MuTFJfZG93bmxvYWQoZGVjcnlwdGVkLGRhdGEudHJhY2tJbmZvLnRpdGxlKycubXAzJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn6Kej5a+G5Zyw5Z2A5aSx6LSlJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+ato+W6j+WAkuW6j+S6i+S7tgoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdW5kTGlzdEhlYWQucXVlcnlTZWxlY3RvcignLnNvcnQnKS5maXJzdENoaWxkLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5TXVzaWNDbGFzcy54bWx5Q3JlYXRlQ2hlY2tib3goKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwyMDAwKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdW5kTGlzdEhlYWRUaXRsZS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheU11c2ljQ2xhc3MueG1seUNyZWF0ZUNoZWNrYm94KCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMjAwMCkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+e/u+mhteS6i+S7tgoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYWdlQmFyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnBhZ2luYXRpb24tcGFnZScpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VCYXIuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlNdXNpY0NsYXNzLnhtbHlDcmVhdGVDaGVja2JveCgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDIwMDApCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v6Lez6aG15LqL5Lu2CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdidXR0b25bdHlwZT1zdWJtaXRdJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlNdXNpY0NsYXNzLnhtbHlDcmVhdGVDaGVja2JveCgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDEwMDApCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygndXJs5Zyw5Z2A6ZSZ6K+vJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/lhajlsYDngrnlh7vkuovku7YKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iakxpbmsgPSB7fTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wYXRoLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtLmhyZWYpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iakxpbmsuaHJlZiA9IGl0ZW0uaHJlZj9pdGVtLmhyZWY6Jyc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqTGluay50YXJnZXQgPSBpdGVtLnRhcmdldD9pdGVtLnRhcmdldDonJzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYob2JqTGluay5ocmVmICYmIG9iakxpbmsudGFyZ2V0ICE9ICdfYmxhbmsnKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLmhyZWYgPSBvYmpMaW5rLmhyZWY7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGp4TXVzaWNXZWJbMF0ubmFtZT09J2t1Z291Jyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGFEb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCdhJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgYURvbS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YU9iaiA9IGl0ZW0uZ2V0QXR0cmlidXRlKCdkYXRhb2JqJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRhdGFPYmopewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5yZW1vdmVBdHRyaWJ1dGUoJ2RhdGFvYmonKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc2V0QXR0cmlidXRlKCd0YXJnZXQnLCdfYmxhbmsnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhkYXRhT2JqKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihjb3Vwb25VcmwuaW5kZXhPZignbWl4c29uZycpIT0tMSB8fCBjb3Vwb25VcmwuaW5kZXhPZignc29uZycpICE9IC0xIHx8IGNvdXBvblVybC5pbmRleE9mKCdzaGFyZScpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZvbHVtZURvbSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN2b2x1bWUnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZERvbSA9IHZvbHVtZURvbS5jbG9uZU5vZGUodHJ1ZSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZERvbS5yZW1vdmVBdHRyaWJ1dGUoJ2lkJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZERvbS5zdHlsZT0nbWFyZ2luLXRvcDozMHB4JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLmlubmVySFRNTCA9ICI8YSBzdHlsZT0nY29sb3I6I2ZmZjtmb250LXNpemU6MTBweDt3aGl0ZS1zcGFjZTpub3dyYXA7Y3Vyc29yOnBvaW50ZXI7JyBpZD0na3Vnb3VEb3dubG9hZCcgamF2YXNjcmlwdDp2b2lkKDApOz7kuIvovb08L2E+IjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvbHVtZURvbS5iZWZvcmUoZG93bmxvYWREb20pOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9sdW1lRG9tLnN0eWxlPSdsZWZ0OjUwcHg7JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNtb2RlJykuc3R5bGU9J21hcmdpbi1sZWZ0OjkwcHg7JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNwYl9kb3dubG9hZCcpLnN0eWxlPSdtYXJnaW4tbGVmdDoxMzBweDsnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BiX3NoYXJlJykuc3R5bGU9J21hcmdpbi1sZWZ0OjE3MHB4Oyc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjbGlzdCcpLnN0eWxlPSdyaWdodDotMjBweDsnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2t1Z291RG93bmxvYWQnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXVkaW8gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjbXlBdWRpbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdWRpb1NyYyA9IGF1ZGlvLmdldEF0dHJpYnV0ZSgnc3JjJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNpbmdlck5hbWUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuc2luZ2VyTmFtZScpLnRpdGxlOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb25nTmFtZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNzb25nTmFtZVRlbXAnKS50aXRsZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MuTFJfZG93bmxvYWQoYXVkaW9TcmMsc29uZ05hbWUrJy0nK3Npbmdlck5hbWUuc3Vic3RyKDAsc2luZ2VyTmFtZS5sZW5ndGgtMSkrJy5tcDMnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGNvdXBvblVybCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGp4TXVzaWNXZWJbMF0ubmFtZT09J25ldGVhc2UnICYmIGxvY2F0aW9uLmhyZWYgPT0gJ2h0dHBzOi8vbXVzaWMuMTYzLmNvbS9zdC9kb3dubG9hZCcpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobVBsYXkgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnemhtSWNvbicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlNdXNpY0NsYXNzLnpobUxvZ28oKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5TXVzaWNDbGFzcy56aG1Mb2dvRHJhZygnbXVzaWMnLGp4TXVzaWNXZWIpOwoKICAgICAgICAgICAgICAgICAgICAgICAgfSxpY29uV2FpdFRpbWUpOwoKICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlNdXNpY0NsYXNzLmNyZWF0ZUVsZW1lbnQoJ2RpdicsJ3pobUljb24nKTsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IHpobVBsYXlEb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtSWNvbicpOwoKICAgICAgICAgICAgICAgICAgICBpZih6aG1QbGF5RG9tKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIHpobVBsYXlEb20ucGFyZW50Tm9kZS5yZW1vdmVDaGlsZCh6aG1QbGF5RG9tKTsKCiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5b2T5YmN6Z+z6aKR572R5Z2A5rKh5pyJ5re75Yqg5Yy56YWN5oiW5Yy56YWN6ZSZ6K+vJyk7CgogICAgICAgICAgICAgICAgfQoKICAgICAgICB9CgogICAgICAgIGZ1bmN0aW9uIHpoTmljZUZ1bmMoKXsKCiAgICAgICAgICAgIHZhciB6aENsYXNzID0gbmV3IFpoQ2xhc3MoKTsKCiAgICAgICAgICAgIC8v5YWz6Zet55m75b2V5by55qGGCiAgICAgICAgICAgIChhc3luYyBmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgIGxldCBsb2dpbk1vZGFsV3JhcHBlciA9IGF3YWl0IEJhc2VDbGFzcy5nZXRFbGVtZW50KCIuTW9kYWwtd3JhcHBlciIpOwoKICAgICAgICAgICAgICAgIGlmKGxvZ2luTW9kYWxXcmFwcGVyKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGNsb3NlQnV0dG9uID0gbG9naW5Nb2RhbFdyYXBwZXIucXVlcnlTZWxlY3RvcignLk1vZGFsLWNsb3NlQnV0dG9uJyk7CgogICAgICAgICAgICAgICAgICAgIGlmKGNsb3NlQnV0dG9uKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlQnV0dG9uLmNsaWNrKCk7CgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9KSgpCgogICAgICAgICAgICB2YXIgemhEYXRhID0gWwogICAgICAgICAgICAgICAge2Z1bmM6J3JlbW92ZVZpZGVvJyxpc09wZW46R01fZ2V0VmFsdWUoJ3JlbW92ZVZpZGVvJywnMCcpLGlzT25zY3JvbGw6MSxvbmxvYWQ6MX0sCiAgICAgICAgICAgICAgICB7ZnVuYzoncmVtb3ZlQUQnLGlzT3BlbjpHTV9nZXRWYWx1ZSgncmVtb3ZlQUQnLCcyMicpLGlzT25zY3JvbGw6MCxvbmxvYWQ6MH0sCiAgICAgICAgICAgICAgICB7ZnVuYzonZG93bmxvYWRWaWRlbycsaXNPcGVuOkdNX2dldFZhbHVlKCdkb3dubG9hZFZpZGVvJywnMjInKSxpc09uc2Nyb2xsOjAsb25sb2FkOjB9LAogICAgICAgICAgICAgICAge2Z1bmM6J3JlbW92ZVJpZ2h0Jyxpc09wZW46R01fZ2V0VmFsdWUoJ3JlbW92ZVJpZ2h0JywnMCcpLGlzT25zY3JvbGw6MCxvbmxvYWQ6MH0sCiAgICAgICAgICAgICAgICB7ZnVuYzonY2hhbmdlTG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hY2goZnVuY3Rpb24oaXRlbSl7CiAgICAgICAgICAgICAgICAgICAgaWYoaXRlbS5pc09wZW49PTIyICYmIGl0ZW0ub25sb2FkPT0xKXsKICAgICAgICAgICAgICAgICAgICAgICAgemhDbGFzc1tpdGVtLmZ1bmNdKCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgfQogICAgICAgICAgICB3aW5kb3cub25zY3JvbGwgPSBmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgIHZhciBzY3JvbGxUb3AgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc2Nyb2xsVG9wOwoKICAgICAgICAgICAgICAgIGlmKHNjcm9sbFRvcCA+IDIwMCl7CgogICAgICAgICAgICAgICAgICAgIHpoRGF0YS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtLmlzT3Blbj09MjIgJiYgaXRlbS5pc09uc2Nyb2xsPT0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aENsYXNzW2l0ZW0uZnVuY10oKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfQoKICAgICAgICB9CgogICAgICAgIGZ1bmN0aW9uIHRhb2Jhb1NlYXJjaEZ1bmMoaXRlbSl7CgogICAgICAgICAgICBsZXQgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewoKICAgICAgICAgICAgICAgIGxldCB0YW9iYW9JY29uRG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3Rhb2Jhb0ljb25TZWxlY3QnKTsKCiAgICAgICAgICAgICAgICBsZXQgYmFzZUNsYXNzID0gbmV3IEJhc2VDbGFzcygpOwoKICAgICAgICAgICAgICAgIGxldCBmaWx0ZXJUbWFsbCA9IGJhc2VDbGFzcy5nZXRRdWVyeVN0cmluZygnZmlsdGVyX3RpYW5tYW8nKTsKCiAgICAgICAgICAgICAgICBpZighdGFvYmFvSWNvbkRvbSl7CgogICAgICAgICAgICAgICAgICAgIGxldCBmaWx0ZXJzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLmZpbHRlcnMgPmEnKTsKCiAgICAgICAgICAgICAgICAgICAgaWYoZmlsdGVycy5sZW5ndGg+MCl7CgogICAgICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGk9MDtpPGZpbHRlcnMubGVuZ3RoO2krKyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGFWYWx1ZSA9IGZpbHRlcnNbaV0uZ2V0QXR0cmlidXRlKCdkYXRhLXZhbHVlJyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGF0YVZhbHVlID09ICd0bWFsbCcpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGRhdGFWYWx1ZSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0YW9iYW9Eb20gPSBmaWx0ZXJzW2ldLmNsb25lTm9kZSh0cnVlKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFvYmFvRG9tLnF1ZXJ5U2VsZWN0b3IoJy50ZXh0JykuaW5uZXJUZXh0PSfmt5jlrp0nOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9Eb20uc2V0QXR0cmlidXRlKCdpZCcsJ3Rhb2Jhb0ljb25TZWxlY3QnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFvYmFvRG9tLnNldEF0dHJpYnV0ZSgnZGF0YS12YWx1ZScsJ3Rhb2JhbycpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihmaWx0ZXJUbWFsbD09J3Rhb2JhbycpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9Eb20uc2V0QXR0cmlidXRlKCdkYXRhLWFjdGlvbicsJ3JlbW92ZScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9Eb20uY2xhc3NOYW1lPSdmaWx0ZXIgaWNvbi10YWcgSl9BamF4IGljb24taG92ZXInOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9Eb20ucmVtb3ZlQXR0cmlidXRlKCdkYXRhLWFjdGlvbicpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9Eb20uY2xhc3NOYW1lPSdmaWx0ZXIgaWNvbi10YWcgSl9BamF4JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcnNbaV0uYmVmb3JlKHRhb2Jhb0RvbSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICBpZihmaWx0ZXJUbWFsbD09J3Rhb2JhbycpewogICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9JY29uRG9tLnNldEF0dHJpYnV0ZSgnZGF0YS1hY3Rpb24nLCdyZW1vdmUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgdGFvYmFvSWNvbkRvbS5jbGFzc05hbWU9J2ZpbHRlciBpY29uLXRhZyBKX0FqYXggaWNvbi1ob3Zlcic7CiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgIHRhb2Jhb0ljb25Eb20ucmVtb3ZlQXR0cmlidXRlKCdkYXRhLWFjdGlvbicpOwogICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9JY29uRG9tLmNsYXNzTmFtZT0nZmlsdGVyIGljb24tdGFnIEpfQWpheCc7CiAgICAgICAgICAgICAgICAgICAgfQoKCiAgICAgICAgICAgICAgICB9CgoKCiAgICAgICAgICAgICAgICBpZihmaWx0ZXJUbWFsbD09J3Rhb2JhbycpewoKICAgICAgICAgICAgICAgICAgICBsZXQgZ29vZHNMaXN0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLml0ZW1zID4gLml0ZW0nKTsKCiAgICAgICAgICAgICAgICAgICAgZ29vZHNMaXN0LmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvbkxpQ2xhc3MgPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJy5pY29ucz5saT5hPnNwYW4nKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjbGFzc05hbWVUbT1bJ2ljb24tc2VydmljZS10aWFubWFvJywnaWNvbi1zZXJ2aWNlLXRpYW5tYW9ndW9qaSddOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWNvbkxpQ2xhc3MgJiYgY2xhc3NOYW1lVG0uaW5kZXhPZihpY29uTGlDbGFzcy5jbGFzc05hbWUpICE9IC0xKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlPSdkaXNwbGF5Om5vbmU7JzsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgLy9jbGVhckludGVydmFsKHRpbWVyKTsKCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9LDUwMCkKCiAgICAgICAgfQoKICAgICAgICBmdW5jdGlvbiBiYWlkdUZ1bmMoKXsKICAgICAgICBsZXQgcHQgPSAnJywgc2VsZWN0TGlzdCA9IFtdLCBwYXJhbXMgPSB7fSwgbW9kZSA9ICcnLCB3aWR0aCA9IDgwMCwgcGFuID0ge30sIGNvbG9yID0gJycsCiAgICAgICAgZG9jID0gJChkb2N1bWVudCksIHByb2dyZXNzID0ge30sIHJlcXVlc3QgPSB7fSwgaW5zID0ge30sIGlkbSA9IHt9OwogICAgICAgIGNvbnN0IHZlcnNpb24gPSAnNi4wLjMnOwogICAgICAgIGNvbnN0IGF1dGhvciA9ICdHcmVhc3lGb3JrJzsKICAgICAgICBjb25zdCBuYW1lID0gJ+e9keebmOebtOmTvuS4i+i9veWKqeaJiyc7CiAgICAgICAgY29uc3QgY3VzdG9tQ2xhc3MgPSB7CiAgICAgICAgcG9wdXA6ICdwbC1wb3B1cCcsCiAgICAgICAgaGVhZGVyOiAncGwtaGVhZGVyJywKICAgICAgICB0aXRsZTogJ3BsLXRpdGxlJywKICAgICAgICBjbG9zZUJ1dHRvbjogJ3BsLWNsb3NlJywKICAgICAgICBjb250ZW50OiAncGwtY29udGVudCcsCiAgICAgICAgaW5wdXQ6ICdwbC1pbnB1dCcsCiAgICAgICAgZm9vdGVyOiAncGwtZm9vdGVyJwogICAgfTsKCiAgICBjb25zdCB0ZXJtaW5hbFR5cGUgPSB7CiAgICAgICAgd2M6ICJXaW5kb3dzIENNRCIsCiAgICAgICAgd3A6ICJXaW5kb3dzIFBvd2VyU2hlbGwiLAogICAgICAgIGx0OiAiTGludXgg57uI56uvIiwKICAgICAgICBsczogIkxpbnV4IFNoZWxsIiwKICAgICAgICBtdDogIk1hY09TIOe7iOerryIsCiAgICB9OwoKICAgIGxldCB0b2FzdCA9IFN3YWwubWl4aW4oewogICAgICAgIHRvYXN0OiB0cnVlLAogICAgICAgIHBvc2l0aW9uOiAndG9wJywKICAgICAgICBzaG93Q29uZmlybUJ1dHRvbjogZmFsc2UsCiAgICAgICAgdGltZXI6IDM1MDAsCiAgICAgICAgdGltZXJQcm9ncmVzc0JhcjogZmFsc2UsCiAgICAgICAgZGlkT3BlbjogKHRvYXN0KSA9PiB7CiAgICAgICAgICAgIHRvYXN0LmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNlZW50ZXInLCBTd2FsLnN0b3BUaW1lcik7CiAgICAgICAgICAgIHRvYXN0LmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNlbGVhdmUnLCBTd2FsLnJlc3VtZVRpbWVyKTsKICAgICAgICB9CiAgICB9KTsKCiAgICBjb25zdCBtZXNzYWdlID0gewogICAgICAgIHN1Y2Nlc3M6ICh0ZXh0KSA9PiB7CiAgICAgICAgICAgIHRvYXN0LmZpcmUoe3RpdGxlOiB0ZXh0LCBpY29uOiAnc3VjY2Vzcyd9KTsKICAgICAgICB9LAogICAgICAgIGVycm9yOiAodGV4dCkgPT4gewogICAgICAgICAgICB0b2FzdC5maXJlKHt0aXRsZTogdGV4dCwgaWNvbjogJ2Vycm9yJ30pOwogICAgICAgIH0sCiAgICAgICAgd2FybmluZzogKHRleHQpID0+IHsKICAgICAgICAgICAgdG9hc3QuZmlyZSh7dGl0bGU6IHRleHQsIGljb246ICd3YXJuaW5nJ30pOwogICAgICAgIH0sCiAgICAgICAgaW5mbzogKHRleHQpID0+IHsKICAgICAgICAgICAgdG9hc3QuZmlyZSh7dGl0bGU6IHRleHQsIGljb246ICdpbmZvJ30pOwogICAgICAgIH0sCiAgICAgICAgcXVlc3Rpb246ICh0ZXh0KSA9PiB7CiAgICAgICAgICAgIHRvYXN0LmZpcmUoe3RpdGxlOiB0ZXh0LCBpY29uOiAncXVlc3Rpb24nfSk7CiAgICAgICAgfQogICAgfTsKCiAgICBsZXQgYmFzZSA9IHsKCiAgICAgICAgZ2V0Q29va2llKG5hbWUpIHsKICAgICAgICAgICAgbGV0IGFyciA9IGRvY3VtZW50LmNvb2tpZS5yZXBsYWNlKC9ccy9nLCAiIikuc3BsaXQoJzsnKTsKICAgICAgICAgICAgZm9yIChsZXQgaSA9IDAsIGwgPSBhcnIubGVuZ3RoOyBpIDwgbDsgaSsrKSB7CiAgICAgICAgICAgICAgICBsZXQgdGVtcEFyciA9IGFycltpXS5zcGxpdCgnPScpOwogICAgICAgICAgICAgICAgaWYgKHRlbXBBcnJbMF0gPT09IG5hbWUpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGVjb2RlVVJJQ29tcG9uZW50KHRlbXBBcnJbMV0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9LAoKICAgICAgICBpc1R5cGUob2JqKSB7CiAgICAgICAgICAgIHJldHVybiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKS5yZXBsYWNlKC9eXFtvYmplY3QgKC4rKVxdJC8sICckMScpLnRvTG93ZXJDYXNlKCk7CiAgICAgICAgfSwKCiAgICAgICAgZ2V0VmFsdWUobmFtZSkgewogICAgICAgICAgICByZXR1cm4gR01fZ2V0VmFsdWUobmFtZSk7CiAgICAgICAgfSwKCiAgICAgICAgc2V0VmFsdWUobmFtZSwgdmFsdWUpIHsKICAgICAgICAgICAgR01fc2V0VmFsdWUobmFtZSwgdmFsdWUpOwogICAgICAgIH0sCgogICAgICAgIGdldFN0b3JhZ2Uoa2V5KSB7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShsb2NhbFN0b3JhZ2UuZ2V0SXRlbShrZXkpKTsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGxvY2FsU3RvcmFnZS5nZXRJdGVtKGtleSk7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBzZXRTdG9yYWdlKGtleSwgdmFsdWUpIHsKICAgICAgICAgICAgaWYgKHRoaXMuaXNUeXBlKHZhbHVlKSA9PT0gJ29iamVjdCcgfHwgdGhpcy5pc1R5cGUodmFsdWUpID09PSAnYXJyYXknKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gbG9jYWxTdG9yYWdlLnNldEl0ZW0oa2V5LCBKU09OLnN0cmluZ2lmeSh2YWx1ZSkpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiBsb2NhbFN0b3JhZ2Uuc2V0SXRlbShrZXksIHZhbHVlKTsKICAgICAgICB9LAoKICAgICAgICBzZXRDbGlwYm9hcmQodGV4dCkgewogICAgICAgICAgICBHTV9zZXRDbGlwYm9hcmQodGV4dCwgJ3RleHQnKTsKICAgICAgICB9LAoKICAgICAgICBlKHN0cikgewogICAgICAgICAgICByZXR1cm4gYnRvYSh1bmVzY2FwZShlbmNvZGVVUklDb21wb25lbnQoc3RyKSkpOwogICAgICAgIH0sCgogICAgICAgIGQoc3RyKSB7CiAgICAgICAgICAgIHJldHVybiBkZWNvZGVVUklDb21wb25lbnQoZXNjYXBlKGF0b2Ioc3RyKSkpOwogICAgICAgIH0sCgogICAgICAgIGdldEV4dGVuc2lvbihuYW1lKSB7CiAgICAgICAgICAgIGNvbnN0IHJlZyA9IC8oPyFcLilcdyskLzsKICAgICAgICAgICAgaWYgKHJlZy50ZXN0KG5hbWUpKSB7CiAgICAgICAgICAgICAgICBsZXQgbWF0Y2ggPSBuYW1lLm1hdGNoKHJlZyk7CiAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hbMF0udG9VcHBlckNhc2UoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfSwKCiAgICAgICAgc2l6ZUZvcm1hdCh2YWx1ZSkgewogICAgICAgICAgICBpZiAodmFsdWUgPT09ICt2YWx1ZSkgewogICAgICAgICAgICAgICAgbGV0IHVuaXQgPSBbIkIiLCAiS0IiLCAiTUIiLCAiR0IiLCAiVEIiLCAiUEIiLCAiRUIiLCAiWkIiLCAiWUIiXTsKICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IE1hdGguZmxvb3IoTWF0aC5sb2codmFsdWUpIC8gTWF0aC5sb2coMTAyNCkpOwogICAgICAgICAgICAgICAgbGV0IHNpemUgPSB2YWx1ZSAvIE1hdGgucG93KDEwMjQsIGluZGV4KTsKICAgICAgICAgICAgICAgIHNpemUgPSBzaXplLnRvRml4ZWQoMSk7CiAgICAgICAgICAgICAgICByZXR1cm4gc2l6ZSArIHVuaXRbaW5kZXhdOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9LAoKICAgICAgICBzb3J0QnlOYW1lKGFycikgewogICAgICAgICAgICBjb25zdCBoYW5kbGUgPSAoKSA9PiB7CiAgICAgICAgICAgICAgICByZXR1cm4gKGEsIGIpID0+IHsKICAgICAgICAgICAgICAgICAgICBjb25zdCBwMSA9IGEuZmlsZW5hbWUgPyBhLmZpbGVuYW1lIDogYS5zZXJ2ZXJfZmlsZW5hbWU7CiAgICAgICAgICAgICAgICAgICAgY29uc3QgcDIgPSBiLmZpbGVuYW1lID8gYi5maWxlbmFtZSA6IGIuc2VydmVyX2ZpbGVuYW1lOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBwMS5sb2NhbGVDb21wYXJlKHAyLCAiemgtQ04iKTsKICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIGFyci5zb3J0KGhhbmRsZSgpKTsKICAgICAgICB9LAoKICAgICAgICBibG9iRG93bmxvYWQoYmxvYiwgZmlsZW5hbWUpIHsKICAgICAgICAgICAgaWYgKGJsb2IgaW5zdGFuY2VvZiBCbG9iKSB7CiAgICAgICAgICAgICAgICBjb25zdCB1cmwgPSBVUkwuY3JlYXRlT2JqZWN0VVJMKGJsb2IpOwogICAgICAgICAgICAgICAgY29uc3QgYSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2EnKTsKICAgICAgICAgICAgICAgIGEuaHJlZiA9IHVybDsKICAgICAgICAgICAgICAgIGEuZG93bmxvYWQgPSBmaWxlbmFtZTsKICAgICAgICAgICAgICAgIGEuY2xpY2soKTsKICAgICAgICAgICAgICAgIFVSTC5yZXZva2VPYmplY3RVUkwodXJsKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIHBvc3QodXJsLCBkYXRhLCBoZWFkZXJzLCB0eXBlKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzVHlwZShkYXRhKSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgIGRhdGEgPSBKU09OLnN0cmluZ2lmeShkYXRhKTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4gewogICAgICAgICAgICAgICAgR01feG1saHR0cFJlcXVlc3QoewogICAgICAgICAgICAgICAgICAgIG1ldGhvZDogIlBPU1QiLCB1cmwsIGhlYWRlcnMsIGRhdGEsCiAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2VUeXBlOiB0eXBlIHx8ICdqc29uJywKICAgICAgICAgICAgICAgICAgICBvbmxvYWQ6IChyZXMpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9PT0gJ2Jsb2InID8gcmVzb2x2ZShyZXMpIDogcmVzb2x2ZShyZXMucmVzcG9uc2UgfHwgcmVzLnJlc3BvbnNlVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICBvbmVycm9yOiAoZXJyKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnIpOwogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKCiAgICAgICAgZ2V0KHVybCwgaGVhZGVycywgdHlwZSwgZXh0cmEpIHsKICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgICAgIGxldCByZXF1ZXN0T2JqID0gR01feG1saHR0cFJlcXVlc3QoewogICAgICAgICAgICAgICAgICAgIG1ldGhvZDogIkdFVCIsIHVybCwgaGVhZGVycywKICAgICAgICAgICAgICAgICAgICByZXNwb25zZVR5cGU6IHR5cGUgfHwgJ2pzb24nLAogICAgICAgICAgICAgICAgICAgIG9ubG9hZDogKHJlcykgPT4gewogICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzLnN0YXR1cyA9PT0gMjA0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0T2JqLmFib3J0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZG1bZXh0cmEuaW5kZXhdID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ2Jsb2InKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuc3RhdHVzID09PSAyMDAgJiYgYmFzZS5ibG9iRG93bmxvYWQocmVzLnJlc3BvbnNlLCBleHRyYS5maWxlbmFtZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcyk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcy5yZXNwb25zZSB8fCByZXMucmVzcG9uc2VUZXh0KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgICAgb25wcm9ncmVzczogKHJlcykgPT4gewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXh0cmEgJiYgZXh0cmEuZmlsZW5hbWUgJiYgZXh0cmEuaW5kZXgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy50b3RhbCA+IDAgPyBwcm9ncmVzc1tleHRyYS5pbmRleF0gPSAocmVzLmxvYWRlZCAqIDEwMCAvIHJlcy50b3RhbCkudG9GaXhlZCgyKSA6IHByb2dyZXNzW2V4dHJhLmluZGV4XSA9IDAuMDA7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgIG9ubG9hZHN0YXJ0KCkgewogICAgICAgICAgICAgICAgICAgICAgICBleHRyYSAmJiBleHRyYS5maWxlbmFtZSAmJiBleHRyYS5pbmRleCAmJiAocmVxdWVzdFtleHRyYS5pbmRleF0gPSByZXF1ZXN0T2JqKTsKICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgIG9uZXJyb3I6IChlcnIpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGVycik7CiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9KTsKICAgICAgICB9LAoKICAgICAgICBnZXRGaW5hbFVybCh1cmwsIGhlYWRlcnMpIHsKICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgICAgIGxldCByZXF1ZXN0T2JqID0gR01feG1saHR0cFJlcXVlc3QoewogICAgICAgICAgICAgICAgICAgIG1ldGhvZDogIkdFVCIsIHVybCwgaGVhZGVycywKICAgICAgICAgICAgICAgICAgICBvbmxvYWQ6IChyZXMpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXMuZmluYWxVcmwpOwogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgICAgb25lcnJvcjogKGVycikgPT4gewogICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyKTsKICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0pOwogICAgICAgIH0sCgogICAgICAgIGFkZFN0eWxlKGlkLCB0YWcsIGNzcykgewogICAgICAgICAgICB0YWcgPSB0YWcgfHwgJ3N0eWxlJzsKICAgICAgICAgICAgbGV0IGRvYyA9IGRvY3VtZW50LCBzdHlsZURvbSA9IGRvYy5nZXRFbGVtZW50QnlJZChpZCk7CiAgICAgICAgICAgIGlmIChzdHlsZURvbSkgcmV0dXJuOwogICAgICAgICAgICBsZXQgc3R5bGUgPSBkb2MuY3JlYXRlRWxlbWVudCh0YWcpOwogICAgICAgICAgICBzdHlsZS5yZWwgPSAnc3R5bGVzaGVldCc7CiAgICAgICAgICAgIHN0eWxlLmlkID0gaWQ7CiAgICAgICAgICAgIHRhZyA9PT0gJ3N0eWxlJyA/IHN0eWxlLmlubmVySFRNTCA9IGNzcyA6IHN0eWxlLmhyZWYgPSBjc3M7CiAgICAgICAgICAgIGRvYy5nZXRFbGVtZW50c0J5VGFnTmFtZSgnaGVhZCcpWzBdLmFwcGVuZENoaWxkKHN0eWxlKTsKICAgICAgICB9LAoKICAgICAgICBmaW5kUmVhY3QoZG9tLCB0cmF2ZXJzZVVwID0gMCkgewogICAgICAgICAgICBjb25zdCBrZXkgPSBPYmplY3Qua2V5cyhkb20pLmZpbmQoa2V5ID0+IHsKICAgICAgICAgICAgICAgIHJldHVybiBrZXkuc3RhcnRzV2l0aCgiX19yZWFjdEZpYmVyJCIpCiAgICAgICAgICAgICAgICAgICAgfHwga2V5LnN0YXJ0c1dpdGgoIl9fcmVhY3RJbnRlcm5hbEluc3RhbmNlJCIpOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgY29uc3QgZG9tRmliZXIgPSBkb21ba2V5XTsKICAgICAgICAgICAgaWYgKGRvbUZpYmVyID09IG51bGwpIHJldHVybiBudWxsOwoKICAgICAgICAgICAgaWYgKGRvbUZpYmVyLl9jdXJyZW50RWxlbWVudCkgewogICAgICAgICAgICAgICAgbGV0IGNvbXBGaWJlciA9IGRvbUZpYmVyLl9jdXJyZW50RWxlbWVudC5fb3duZXI7CiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRyYXZlcnNlVXA7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGNvbXBGaWJlciA9IGNvbXBGaWJlci5fY3VycmVudEVsZW1lbnQuX293bmVyOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBGaWJlci5faW5zdGFuY2U7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGNvbnN0IEdldENvbXBGaWJlciA9IGZpYmVyID0+IHsKICAgICAgICAgICAgICAgIGxldCBwYXJlbnRGaWJlciA9IGZpYmVyLnJldHVybjsKICAgICAgICAgICAgICAgIHdoaWxlICh0eXBlb2YgcGFyZW50RmliZXIudHlwZSA9PSAic3RyaW5nIikgewogICAgICAgICAgICAgICAgICAgIHBhcmVudEZpYmVyID0gcGFyZW50RmliZXIucmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIHBhcmVudEZpYmVyOwogICAgICAgICAgICB9OwogICAgICAgICAgICBsZXQgY29tcEZpYmVyID0gR2V0Q29tcEZpYmVyKGRvbUZpYmVyKTsKICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmF2ZXJzZVVwOyBpKyspIHsKICAgICAgICAgICAgICAgIGNvbXBGaWJlciA9IEdldENvbXBGaWJlcihjb21wRmliZXIpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiBjb21wRmliZXIuc3RhdGVOb2RlIHx8IGNvbXBGaWJlcjsKICAgICAgICB9LAoKICAgICAgICBpbml0RGVmYXVsdENvbmZpZygpIHsKICAgICAgICAgICAgbGV0IHZhbHVlID0gW3sKICAgICAgICAgICAgICAgIG5hbWU6ICdzZXR0aW5nX3JwY19kb21haW4nLAogICAgICAgICAgICAgICAgdmFsdWU6ICdodHRwOi8vbG9jYWxob3N0JwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBuYW1lOiAnc2V0dGluZ19ycGNfcG9ydCcsCiAgICAgICAgICAgICAgICB2YWx1ZTogJzE2ODAwJwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBuYW1lOiAnc2V0dGluZ19ycGNfcGF0aCcsCiAgICAgICAgICAgICAgICB2YWx1ZTogJy9qc29ucnBjJwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBuYW1lOiAnc2V0dGluZ19ycGNfdG9rZW4nLAogICAgICAgICAgICAgICAgdmFsdWU6ICcnCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIG5hbWU6ICdzZXR0aW5nX3JwY19kaXInLAogICAgICAgICAgICAgICAgdmFsdWU6ICdEOicKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgbmFtZTogJ3NldHRpbmdfdGVybWluYWxfdHlwZScsCiAgICAgICAgICAgICAgICB2YWx1ZTogJ3djJwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBuYW1lOiAnc2V0dGluZ190aGVtZV9jb2xvcicsCiAgICAgICAgICAgICAgICB2YWx1ZTogJyMwOUFBRkYnCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIG5hbWU6ICdzZXR0aW5nX2luaXRfY29kZScsCiAgICAgICAgICAgICAgICB2YWx1ZTogJycKICAgICAgICAgICAgfV07CgogICAgICAgICAgICB2YWx1ZS5mb3JFYWNoKCh2KSA9PiB7CiAgICAgICAgICAgICAgICBiYXNlLmdldFZhbHVlKHYubmFtZSkgPT09IHVuZGVmaW5lZCAmJiBiYXNlLnNldFZhbHVlKHYubmFtZSwgdi52YWx1ZSk7CiAgICAgICAgICAgIH0pOwogICAgICAgIH0sCgogICAgICAgIHNob3dTZXR0aW5nKCkgewogICAgICAgICAgICBsZXQgZG9tID0gJycsIGJ0biA9ICcnLAogICAgICAgICAgICAgICAgY29sb3JMaXN0ID0gWycjMDlBQUZGJywgJyNjYzMyMzUnLCAnIzUyNmVmYScsICcjNTE4YzE3JywgJyNlZDk0NGInLCAnI2Y5NjlhNScsICcjYmNhMjgwJ107CiAgICAgICAgICAgIGRvbSArPSBgPGxhYmVsIGNsYXNzPSJwbC1zZXR0aW5nLWxhYmVsIj48ZGl2IGNsYXNzPSJwbC1sYWJlbCI+UlBD5Li75py6PC9kaXY+PGlucHV0IHR5cGU9InRleHQiICBwbGFjZWhvbGRlcj0i5Li75py65Zyw5Z2A77yM6ZyA5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VsZWN0ZWQnIDogJyd9PiR7dGVybWluYWxUeXBlW2tdfTwvb3B0aW9uPmA7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkb20gKz0gYDwvc2VsZWN0PjwvbGFiZWw+YDsKICAgICAgICAgICAgZG9tICs9IGA8bGFiZWwgY2xhc3M9InBsLXNldHRpbmctbGFiZWwiPjxkaXYgY2xhc3M9InBsLWxhYmVsIj7kuLvpopjpopzoibI8L2Rpdj4gPGRpdiBjbGFzcz0icGwtY29sb3IiPiR7YnRufTxkaXY+PC9sYWJlbD5gOwogICAgICAgICAgICBkb20gPSAnPGRpdj4nICsgZG9tICsgJzwvZGl2Pic7CgogICAgICAgICAgICBTd2FsLmZpcmUoewogICAgICAgICAgICAgICAgdGl0bGU6ICfliqnmiYvphY3nva4nLAogICAgICAgICAgICAgICAgaHRtbDogZG9tLAogICAgICAgICAgICAgICAgaWNvbjogJ2luZm8nLAogICAgICAgICAgICAgICAgc2hvd0Nsb3NlQnV0dG9uOiB0cnVlLAogICAgICAgICAgICAgICAgc2hvd0NvbmZpcm1CdXR0b246IGZhbHNlLAogICAgICAgICAgICAgICAgZm9vdGVyOiBwYW4uZm9vdGVyLAogICAgICAgICAgICB9KS50aGVuKCgpID0+IHsKICAgICAgICAgICAgICAgIG1lc3NhZ2Uuc3VjY2Vzcygn6K6+572u5oiQ5Yqf77yBJyk7CiAgICAgICAgICAgICAgICBoaXN0b3J5LmdvKDApOwogICAgICAgICAgICB9KTsKCiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLWNvbG9yJywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfdGhlbWVfY29sb3InLCBlLnRhcmdldC5kYXRhc2V0LmNvbG9yKTsKICAgICAgICAgICAgICAgIG1lc3NhZ2Uuc3VjY2Vzcygn6K6+572u5oiQ5Yqf77yBJyk7CiAgICAgICAgICAgICAgICBoaXN0b3J5LmdvKDApOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdpbnB1dCcsICcubGlzdGVuZXItZG9tYWluJywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RvbWFpbicsIGUudGFyZ2V0LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignaW5wdXQnLCAnLmxpc3RlbmVyLXBvcnQnLCBhc3luYyAoZSkgPT4gewogICAgICAgICAgICAgICAgYmFzZS5zZXRWYWx1ZSgnc2V0dGluZ19ycGNfcG9ydCcsIGUudGFyZ2V0LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignaW5wdXQnLCAnLmxpc3RlbmVyLXBhdGgnLCBhc3luYyAoZSkgPT4gewogICAgICAgICAgICAgICAgYmFzZS5zZXRWYWx1ZSgnc2V0dGluZ19ycGNfcGF0aCcsIGUudGFyZ2V0LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignaW5wdXQnLCAnLmxpc3RlbmVyLXRva2VuJywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfcnBjX3Rva2VuJywgZS50YXJnZXQudmFsdWUpOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdpbnB1dCcsICcubGlzdGVuZXItZGlyJywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RpcicsIGUudGFyZ2V0LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2hhbmdlJywgJy5saXN0ZW5lci10ZXJtaW5hbCcsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBiYXNlLnNldFZhbHVlKCdzZXR0aW5nX3Rlcm1pbmFsX3R5cGUnLCBlLnRhcmdldC52YWx1ZSk7CiAgICAgICAgICAgIH0pOwogICAgICAgIH0sCgogICAgICAgIHJlZ2lzdGVyTWVudUNvbW1hbmQoKSB7CiAgICAgICAgICAgIEdNX3JlZ2lzdGVyTWVudUNvbW1hbmQoJ+Kame+4jyDorr7nva4nLCAoKSA9PiB7CiAgICAgICAgICAgICAgICB0aGlzLnNob3dTZXR0aW5nKCk7CiAgICAgICAgICAgIH0pOwogICAgICAgIH0sCgogICAgICAgIGNyZWF0ZVRpcCgpIHsKICAgICAgICAgICAgJCgnYm9keScpLmFwcGVuZCgnPGRpdiBjbGFzcz0icGwtdG9vbHRpcCI+PC9kaXY+Jyk7CgogICAgICAgICAgICBkb2Mub24oJ21vdXNlZW50ZXIgbW91c2VsZWF2ZScsICcubGlzdGVuZXItdGlwJywgKGUpID0+IHsKICAgICAgICAgICAgICAgIGlmIChlLnR5cGUgPT09ICdtb3VzZWVudGVyJykgewogICAgICAgICAgICAgICAgICAgIGxldCBmaWxlbmFtZSA9IGUuY3VycmVudFRhcmdldC5pbm5lclRleHQ7CiAgICAgICAgICAgICAgICAgICAgbGV0IHNpemUgPSBlLmN1cnJlbnRUYXJnZXQuZGF0YXNldC5zaXplOwogICAgICAgICAgICAgICAgICAgIGxldCB0aXAgPSBgJHtmaWxlbmFtZX08c3BhbiBzdHlsZT0ibWFyZ2luLWxlZnQ6IDEwcHg7Y29sb3I6ICNmNTZjNmM7Ij4ke3NpemV9PC9zcGFuPmA7CiAgICAgICAgICAgICAgICAgICAgJChlLmN1cnJlbnRUYXJnZXQpLmNzcyh7b3BhY2l0eTogJzAuNSd9KTsKICAgICAgICAgICAgICAgICAgICAkKCcucGwtdG9vbHRpcCcpLmh0bWwodGlwKS5jc3MoewogICAgICAgICAgICAgICAgICAgICAgICAnbGVmdCc6IGUucGFnZVggKyAxMCArICdweCcsCiAgICAgICAgICAgICAgICAgICAgICAgICd0b3AnOiBlLnBhZ2VZIC0gZS5jdXJyZW50VGFyZ2V0Lm9mZnNldFRvcCA+IDE0ID8gZS5wYWdlWSArICdweCcgOiBlLnBhZ2VZICsgMjAgKyAncHgnCiAgICAgICAgICAgICAgICAgICAgfSkuc2hvdygpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAkKGUuY3VycmVudFRhcmdldCkuY3NzKHtvcGFjaXR5OiAnMSd9KTsKICAgICAgICAgICAgICAgICAgICAkKCcucGwtdG9vbHRpcCcpLmhpZGUoMCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgIH0sCgogICAgICAgIGNyZWF0ZUxvYWRpbmcoKSB7CiAgICAgICAgICAgIHJldHVybiAkKCc8ZGl2IGNsYXNzPSJwbC1sb2FkaW5nIj48ZGl2IGNsYXNzPSJwbC1sb2FkaW5nLWJveCI+PGRpdj48ZGl2PjwvZGl2PjxkaXY+PC9kaXY+PC9kaXY+PC9kaXY+PC9kaXY+Jyk7CiAgICAgICAgfSwKCiAgICAgICAgY3JlYXRlRG93bmxvYWRJZnJhbWUoKSB7CiAgICAgICAgICAgIGxldCAkZGl2ID0gJCgnPGRpdiBzdHlsZT0icGFkZGluZzowO21hcmdpbjowO2Rpc3BsYXk6YmxvY2siPjwvZGl2PicpOwogICAgICAgICAgICBsZXQgJGlmcmFtZSA9ICQoJzxpZnJhbWUgc3JjPSJqYXZhc2NyaXB0OjsiIGlkPSJkb3dubG9hZElmcmFtZSIgc3R5bGU9ImRpc3BsYXk6bm9uZSI+PC9pZnJhbWU+Jyk7CiAgICAgICAgICAgICRkaXYuYXBwZW5kKCRpZnJhbWUpOwogICAgICAgICAgICAkKCdib2R5JykuYXBwZW5kKCRkaXYpOwogICAgICAgIH0sCgogICAgICAgIGdldE1pcnJvckxpc3QobGluaywgbWlycm9yLCB0aHJlYWQgPSAyKSB7CiAgICAgICAgICAgIGxldCBob3N0ID0gbmV3IFVSTChsaW5rKS5ob3N0OwogICAgICAgICAgICBsZXQgbWlycm9ycyA9IFtdOwogICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1pcnJvci5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0aHJlYWQ7IGorKykgewogICAgICAgICAgICAgICAgICAgIGxldCBpdGVtID0gbGluay5yZXBsYWNlKGhvc3QsIG1pcnJvcltpXSkgKyAnJicucmVwZWF0KGopOwogICAgICAgICAgICAgICAgICAgIG1pcnJvcnMucHVzaChpdGVtKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gbWlycm9ycy5qb2luKCdcbicpOwogICAgICAgIH0sCgogICAgICAgIGFkZFBhbkxpbmtlclN0eWxlKCkgewogICAgICAgICAgICBjb2xvciA9IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfdGhlbWVfY29sb3InKTsKICAgICAgICAgICAgbGV0IGNzcyA9IGAKICAgICAgICAgICAgYm9keTo6LXdlYmtpdC1zY3JvbGxiYXIgeyBkaXNwbGF5OiBub25lIH0KICAgICAgICAgICAgOjotd2Via2l0LXNjcm9sbGJhciB7IHdpZHRoOiA2cHg7IGhlaWdodDogMTBweCB9CiAgICAgICAgICAgIDo6LXdlYmtpdC1zY3JvbGxiYXItdHJhY2sgeyBib3JkZXItcmFkaXVzOiAwOyBiYWNrZ3JvdW5kOiBub25lIH0KICAgICAgICAgICAgOjotd2Via2l0LXNjcm9sbGJhci10aHVtYiB7IGJhY2tncm91bmQtY29sb3I6IHJnYmEoODUsODUsODUsLjQpIH0KICAgICAgICAgICAgOjotd2Via2l0LXNjcm9sbGJhci10aHVtYiw6Oi13ZWJraXQtc2Nyb2xsYmFyLXRodW1iOmhvdmVyIHsgYm9yZGVyLXJhZGl1czogNXB4OyAtd2Via2l0LWJveC1zaGFkb3c6IGluc2V0IDAgMCA2cHggcmdiYSgwLDAsMCwuMikgfQogICAgICAgICAgICA6Oi13ZWJraXQ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2tmYWNlLXZpc2liaWxpdHk6IGhpZGRlbjt0cmFuc2Zvcm0tb3JpZ2luOiAwIDA7fQogICAgICAgICAgICAucGwtbG9hZGluZy1ib3ggZGl2IHsgYm94LXNpemluZzogY29udGVudC1ib3g7IH0KICAgICAgICAgICAgLnN3YWwyLWNvbnRhaW5lciB7IHotaW5kZXg6MTAwMDAwIWltcG9ydGFudDsgfQogICAgICAgICAgICBib2R5LnN3YWwyLWhlaWdodC1hdXRvIHsgaGVpZ2h0OiBpbmhlcml0IWltcG9ydGFudDsgfQogICAgICAgICAgICBgOwogICAgICAgICAgICB0aGlzLmFkZFN0eWxlKCdwYW5saW5rZXItc3R5bGUnLCAnc3R5bGUnLCBjc3MpOwogICAgICAgIH0sCgogICAgICAgIGFzeW5jIGluaXREaWFsb2coKSB7CiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgU3dhbC5maXJlKHsKICAgICAgICAgICAgICAgICAgICB0aXRsZTogIuivt+aUr+aMgeWOn+WImyIsCiAgICAgICAgICAgICAgICAgICAgaHRtbDogYDxkaXY+PGltZyBzdHlsZT0id2lkdGg6IDI1MHB4O21hcmdpbi1ib3R0b206IDEwcHg7IiBzcmM9IiR7cGFuLmltZ30iIGFsdD0iJHtwYW4uaW1nfSI+PGlucHV0IGNsYXNzPSJzd2FsMi1pbnB1dCIgaWQ9ImluaXQiIHR5cGU9InRleHQiIHBsYWNlaG9sZGVyPSLor7fpmo/kvr/ovpPlhaXmmpflj7ciPjwvZGl2PmAsCiAgICAgICAgICAgICAgICAgICAgYWxsb3dPdXRzaWRlQ2xpY2s6IGZhbHNlLAogICAgICAgICAgICAgICAgICAgIHNob3dDbG9zZUJ1dHRvbjogdHJ1ZSwKICAgICAgICAgICAgICAgICAgICBjb25maXJtQnV0dG9uVGV4dDogJ+egtOinoycKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5pc0Rpc21pc3NlZCAmJiByZXN1bHQuZGlzbWlzcyA9PT0gJ2Nsb3NlJykgcmV0dXJuOwogICAgICAgICAgICAgICAgaWYgKHBhbi5udW0gPT0gcGFuLm51bSkgewogICAgICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfaW5pdF9jb2RlJywgcGFuLm51bSk7CiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZS5zdWNjZXNzKCLmmpflj7fmraPnoa4iKTsKICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgaGlzdG9yeS5nbygwKTsKICAgICAgICAgICAgICAgICAgICB9LCAxNTAwKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgYXdhaXQgU3dhbC5maXJlKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6Iuaal+WPt+S4jeato+ehriIsCiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6ICLmmpflj7fkuI3mraPnoa4iLAogICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtQnV0dG9uVGV4dDogJ+mHjeaWsOi+k+WFpScsCiAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlVXJsOiBwYW4uaW1nLAogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaW5pdERpYWxvZygpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgIH07CgogICAgbGV0IGJhaWR1ID0gewoKICAgICAgICBfZ2V0RXh0cmEoKSB7CiAgICAgICAgICAgIGxldCBzZUtleSA9IGRlY29kZVVSSUNvbXBvbmVudChiYXNlLmdldENvb2tpZSgnQkRDTE5EJykpOwogICAgICAgICAgICByZXR1cm4gJ3snICsgJyJzZWtleSI6IicgKyBzZUtleSArICciJyArICJ9IjsKICAgICAgICB9LAoKICAgICAgICBfZ2V0U3VybCgpIHsKCiAgICAgICAgICAgICAgICBsZXQgcmVzcCA9IGxvY2F0aW9uLmhyZWYubWF0Y2goL2h0dHBzPzpcL1wvLitcLmJhaWR1XC5jb21cLyhzXC98c3VybD0pKC4rKVw/Lyk7CgogICAgICAgICAgICAgICAgaWYgKHJlc3ApIHsKICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKHJlc3BbMl0sJ3Jlc3AnKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3BbMl07CgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICByZXR1cm4gJyc7CgogICAgICAgIH0sCgogICAgICAgIF9nZXRGaWRMaXN0KCkgewogICAgICAgICAgICBsZXQgZmlkbGlzdCA9IFtdOwogICAgICAgICAgICBzZWxlY3RMaXN0LmZvckVhY2godiA9PiB7CiAgICAgICAgICAgICAgICBpZiAoK3YuaXNkaXIgPT09IDEpIHJldHVybjsKICAgICAgICAgICAgICAgIGZpZGxpc3QucHVzaCh2LmZzX2lkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIHJldHVybiAnWycgKyBmaWRsaXN0ICsgJ10nOwogICAgICAgIH0sCgogICAgICAgIF9yZXNldERhdGEoKSB7CiAgICAgICAgICAgIHByb2dyZXNzID0ge307CiAgICAgICAgICAgICQuZWFjaChyZXF1ZXN0LCAoa2V5KSA9PiB7CiAgICAgICAgICAgICAgICAocmVxdWVzdFtrZXldKS5hYm9ydCgpOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgJC5lYWNoKGlucywgKGtleSkgPT4gewogICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnNba2V5XSk7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBpZG0gPSB7fTsKICAgICAgICAgICAgaW5zID0ge307CiAgICAgICAgICAgIHJlcXVlc3QgPSB7fTsKICAgICAgICB9LAoKICAgICAgICBzZXRCRFVTUygpIHsKICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIEdNX2Nvb2tpZSAmJiBHTV9jb29raWUoJ2xpc3QnLCB7bmFtZTogJ0JEVVNTJ30sIChjb29raWVzLCBlcnJvcikgPT4gewogICAgICAgICAgICAgICAgICAgIGlmICghZXJyb3IpIHsKICAgICAgICAgICAgICAgICAgICAgICAgYmFzZS5zZXRTdG9yYWdlKCJiYWlkdXl1blBsdWdpbl9CRFVTUyIsIHtCRFVTUzogY29va2llc1swXS52YWx1ZX0pOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBnZXRCRFVTUygpIHsKICAgICAgICAgICAgbGV0IGJhaWR1eXVuUGx1Z2luX0JEVVNTID0gYmFzZS5nZXRTdG9yYWdlKCdiYWlkdXl1blBsdWdpbl9CRFVTUycpID8gYmFzZS5nZXRTdG9yYWdlKCdiYWlkdXl1blBsdWdpbl9CRFVTUycpIDogJ3siYmFpZHV5dW5QbHVnaW5fQkRVU1MiOiIifSc7CiAgICAgICAgICAgIHJldHVybiBiYWlkdXl1blBsdWdpbl9CRFVTUy5CRFVTUyB8fCAnJzsKICAgICAgICB9LAoKICAgICAgICBjb252ZXJ0TGlua1RvQXJpYShsaW5rLCBmaWxlbmFtZSwgdWEpIHsKICAgICAgICAgICAgbGV0IEJEVVNTID0gdGhpcy5nZXRCRFVTUygpOwogICAgICAgICAgICBpZiAoISFCRFVTUykgewogICAgICAgICAgICAgICAgZmlsZW5hbWUgPSBmaWxlbmFtZS5yZXBsYWNlKCcgJywgJ18nKTsKICAgICAgICAgICAgICAgIHJldHVybiBlbmNvZGVVUklDb21wb25lbnQoYGFyaWEyYyAiJHtsaW5rfSIgLS1vdXQgIiR7ZmlsZW5hbWV9IiAtLWhlYWRlciAiVXNlci1BZ2VudDogJHt1YX0iIC0taGVhZGVyICJDb29raWU6IEJEVVNTPSR7QkRVU1N9ImApOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICBsaW5rOiBwYW4uYXNzaXN0YW50LAogICAgICAgICAgICAgICAgdGV4dDogcGFuLmluaXRbNV0KICAgICAgICAgICAgfTsKICAgICAgICB9LAoKICAgICAgICBjb252ZXJ0TGlua1RvQkMobGluaywgZmlsZW5hbWUsIHVhKSB7CiAgICAgICAgICAgIGxldCBCRFVTUyA9IHRoaXMuZ2V0QkRVU1MoKTsKICAgICAgICAgICAgaWYgKCEhQkRVU1MpIHsKICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSBgQkRVU1M9JHtCRFVTU31gOwogICAgICAgICAgICAgICAgbGV0IGJjID0gYEFBLyR7ZW5jb2RlVVJJQ29tcG9uZW50KGZpbGVuYW1lKX0vP3VybD0ke2VuY29kZVVSSUNvbXBvbmVudChsaW5rKX0mY29va2llPSR7ZW5jb2RlVVJJQ29tcG9uZW50KGNvb2tpZSl9JnVzZXJfYWdlbnQ9JHtlbmNvZGVVUklDb21wb25lbnQodWEpfVpaYDsKICAgICAgICAgICAgICAgIHJldHVybiBlbmNvZGVVUklDb21wb25lbnQoYGJjOi8vaHR0cC8ke2Jhc2UuZShiYyl9YCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgIGxpbms6IHBhbi5hc3Npc3RhbnQsCiAgICAgICAgICAgICAgICB0ZXh0OiBwYW4uaW5pdFs1XQogICAgICAgICAgICB9OwogICAgICAgIH0sCgogICAgICAgIGNvbnZlcnRMaW5rVG9DdXJsKGxpbmssIGZpbGVuYW1lLCB1YSkgewogICAgICAgICAgICBsZXQgQkRVU1MgPSB0aGlzLmdldEJEVVNTKCk7CiAgICAgICAgICAgIGlmICghIUJEVVNTKSB7CiAgICAgICAgICAgICAgICBsZXQgdGVybWluYWwgPSBiYXNlLmdldFZhbHVlKCdzZXR0aW5nX3Rlcm1pbmFsX3R5cGUnKTsKICAgICAgICAgICAgICAgIGZpbGVuYW1lID0gZmlsZW5hbWUucmVwbGFjZSgnICcsICdfJyk7CiAgICAgICAgICAgICAgICByZXR1cm4gZW5jb2RlVVJJQ29tcG9uZW50KGAke3Rlcm1pbmFsICE9PSAnd3AnID8gJ2N1cmwnIDogJ2N1cmwuZXhlJ30gLUwgIiR7bGlua30iIC0tb3V0cHV0ICIke2ZpbGVuYW1lfSIgLUEgIiR7dWF9IiAtYiAiQkRVU1M9JHtCRFVTU30iYCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgIGxpbms6IHBhbi5hc3Npc3RhbnQsCiAgICAgICAgICAgICAgICB0ZXh0OiBwYW4uaW5pdFs1XQogICAgICAgICAgICB9OwogICAgICAgIH0sCgogICAgICAgIGFkZFBhZ2VMaXN0ZW5lcigpIHsKICAgICAgICAgICAgZnVuY3Rpb24gX2ZhY3RvcnkoZSkgewogICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9ICQoZS50YXJnZXQpOwogICAgICAgICAgICAgICAgbGV0IGl0ZW0gPSB0YXJnZXQucGFyZW50cygnLnBsLWl0ZW0nKTsKICAgICAgICAgICAgICAgIGxldCBsaW5rID0gaXRlbS5maW5kKCcucGwtaXRlbS1saW5rJyk7CiAgICAgICAgICAgICAgICBsZXQgcHJvZ3Jlc3MgPSBpdGVtLmZpbmQoJy5wbC1pdGVtLXByb2dyZXNzJyk7CiAgICAgICAgICAgICAgICBsZXQgdGlwID0gaXRlbS5maW5kKCcucGwtaXRlbS10aXAnKTsKICAgICAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICAgICAgaXRlbSwgbGluaywgcHJvZ3Jlc3MsIHRpcCwgdGFyZ2V0LAogICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZnVuY3Rpb24gX3Jlc2V0KGkpIHsKICAgICAgICAgICAgICAgIGluc1tpXSAmJiBjbGVhckludGVydmFsKGluc1tpXSk7CiAgICAgICAgICAgICAgICByZXF1ZXN0W2ldICYmIHJlcXVlc3RbaV0uYWJvcnQoKTsKICAgICAgICAgICAgICAgIHByb2dyZXNzW2ldID0gMDsKICAgICAgICAgICAgICAgIGlkbVtpXSA9IGZhbHNlOwogICAgICAgICAgICB9CgogICAgICAgICAgICBkb2Mub24oJ21vdXNlZW50ZXIgbW91c2VsZWF2ZSBjbGljaycsICcucGwtYnV0dG9uLmctZHJvcGRvd24tYnV0dG9uJywgKGUpID0+IHsKICAgICAgICAgICAgICAgIGlmIChlLnR5cGUgPT09ICdtb3VzZWxlYXZlJykgewogICAgICAgICAgICAgICAgICAgICQoZS5jdXJyZW50VGFyZ2V0KS5yZW1vdmVDbGFzcygnYnV0dG9uLW9wZW4nKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgJChlLmN1cnJlbnRUYXJnZXQpLmFkZENsYXNzKCdidXR0b24tb3BlbicpOwogICAgICAgICAgICAgICAgICAgICQoZS5jdXJyZW50VGFyZ2V0KS5maW5kKCcucGwtZHJvcGRvd24tbWVudScpLnNob3coKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignbW91c2VsZWF2ZScsICcucGwtYnV0dG9uLmctZHJvcGRvd24tYnV0dG9uIC5wbC1kcm9wZG93bi1tZW51JywgKGUpID0+IHsKICAgICAgICAgICAgICAgICQoZS5jdXJyZW50VGFyZ2V0KS5oaWRlKCk7CiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcucGwtYnV0dG9uLW1vZGUnLCAoZSkgPT4gewogICAgICAgICAgICAgICAgbW9kZSA9IGUudGFyZ2V0LmRhdGFzZXQubW9kZTsKICAgICAgICAgICAgICAgIFN3YWwuc2hvd0xvYWRpbmcoKTsKICAgICAgICAgICAgICAgIHRoaXMuZ2V0UENTTGluaygpOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItbGluay1hcGknLCBhc3luYyAoZSkgPT4gewogICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOwogICAgICAgICAgICAgICAgbGV0IG8gPSBfZmFjdG9yeShlKTsKICAgICAgICAgICAgICAgIGxldCAkd2lkdGggPSBvLml0ZW0uZmluZCgnLnBsLXByb2dyZXNzLWlubmVyJyk7CiAgICAgICAgICAgICAgICBsZXQgJHRleHQgPSBvLml0ZW0uZmluZCgnLnBsLXByb2dyZXNzLWlubmVyLXRleHQnKTsKICAgICAgICAgICAgICAgIGxldCBmaWxlbmFtZSA9IG8ubGlua1swXS5kYXRhc2V0LmZpbGVuYW1lOwogICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gby5saW5rWzBdLmRhdGFzZXQuaW5kZXg7CiAgICAgICAgICAgICAgICBfcmVzZXQoaW5kZXgpOwogICAgICAgICAgICAgICAgYmFzZS5nZXQoby5saW5rWzBdLmRhdGFzZXQubGluaywgeyJVc2VyLUFnZW50IjogcGFuLnVhfSwgJ2Jsb2InLCB7ZmlsZW5hbWUsIGluZGV4fSk7CiAgICAgICAgICAgICAgICBpbnNbaW5kZXhdID0gc2V0SW50ZXJ2YWwoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIGxldCBwcm9nID0gK3Byb2dyZXNzW2luZGV4XSB8fCAwOwogICAgICAgICAgICAgICAgICAgIGxldCBpc0lETSA9IGlkbVtpbmRleF0gfHwgZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgaWYgKGlzSURNKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG8udGlwLmhpZGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgby5wcm9ncmVzcy5oaWRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIG8ubGluay50ZXh0KCflt7LmiJDlip/llKTotbdJRE3vvIzor7fmn6XnnItJRE3kuIvovb3moYbvvIEnKS5hbmltYXRlKHtvcGFjaXR5OiAnMC41J30sICJzbG93Iikuc2hvdygpOwogICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGluc1tpbmRleF0pOwogICAgICAgICAgICAgICAgICAgICAgICBpZG1baW5kZXhdID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgby5saW5rLmhpZGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgby50aXAuaGlkZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBvLnByb2dyZXNzLnNob3coKTsKICAgICAgICAgICAgICAgICAgICAgICAgJHdpZHRoLmNzcygnd2lkdGgnLCBwcm9nICsgJyUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgJHRleHQudGV4dChwcm9nICsgJyUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByb2cgPT09IDEwMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnNbaW5kZXhdKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzW2luZGV4XSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLml0ZW0uZmluZCgnLnBsLXByb2dyZXNzLXN0b3AnKS5oaWRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLml0ZW0uZmluZCgnLnBsLXByb2dyZXNzLXRpcCcpLmh0bWwoJ+S4i+i9veWujOaIkO+8jOato+WcqOW8ueWHuua1j+iniOWZqOS4i+i9veahhu+8gScpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwgNTAwKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLXJldHJ5JywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGxldCBvID0gX2ZhY3RvcnkoZSk7CiAgICAgICAgICAgICAgICBvLnRpcC5oaWRlKCk7CiAgICAgICAgICAgICAgICBvLmxpbmsuc2hvdygpOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItaG93JywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGxldCBvID0gX2ZhY3RvcnkoZSk7CiAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBvLmxpbmtbMF0uZGF0YXNldC5pbmRleDsKICAgICAgICAgICAgICAgIGlmIChyZXF1ZXN0W2luZGV4XSkgewogICAgICAgICAgICAgICAgICAgIHJlcXVlc3RbaW5kZXhdLmFib3J0KCk7CiAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnNbaW5kZXhdKTsKICAgICAgICAgICAgICAgICAgICBvLnByb2dyZXNzLmhpZGUoKTsKICAgICAgICAgICAgICAgICAgICBvLnRpcC5zaG93KCk7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItc3RvcCcsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBsZXQgbyA9IF9mYWN0b3J5KGUpOwogICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gby5saW5rWzBdLmRhdGFzZXQuaW5kZXg7CiAgICAgICAgICAgICAgICBpZiAocmVxdWVzdFtpbmRleF0pIHsKICAgICAgICAgICAgICAgICAgICByZXF1ZXN0W2luZGV4XS5hYm9ydCgpOwogICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaW5zW2luZGV4XSk7CiAgICAgICAgICAgICAgICAgICAgby50aXAuaGlkZSgpOwogICAgICAgICAgICAgICAgICAgIG8ucHJvZ3Jlc3MuaGlkZSgpOwogICAgICAgICAgICAgICAgICAgIG8ubGluay5zaG93KDApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItYmFjaycsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBsZXQgbyA9IF9mYWN0b3J5KGUpOwogICAgICAgICAgICAgICAgby50aXAuaGlkZSgpOwogICAgICAgICAgICAgICAgby5saW5rLnNob3coKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLWxpbmstYXJpYSwgLmxpc3RlbmVyLWNvcHktYWxsJywgKGUpID0+IHsKICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKICAgICAgICAgICAgICAgIGlmICghZS50YXJnZXQuZGF0YXNldC5saW5rKSB7CiAgICAgICAgICAgICAgICAgICAgJChlLnRhcmdldCkucmVtb3ZlQ2xhc3MoJ2xpc3RlbmVyLWNvcHktYWxsJykuYWRkQ2xhc3MoJ3BsLWJ0bi1kYW5nZXInKS5odG1sKGAke3Bhbi5pbml0WzVdffCfkYk8YSBocmVmPSIke3Bhbi5hc3Npc3RhbnR9IiB0YXJnZXQ9Il9ibGFuayIgY2xhc3M9InBsLWEiPueCueWHu+atpOWkhOWuieijhTwvYT7wn5GIYCk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGJhc2Uuc2V0Q2xpcGJvYXJkKGRlY29kZVVSSUNvbXBvbmVudChlLnRhcmdldC5kYXRhc2V0LmxpbmspKTsKICAgICAgICAgICAgICAgICAgICAkKGUudGFyZ2V0KS50ZXh0KCflpI3liLbmiJDlip/vvIzlv6vljrvnspjotLTlkKfvvIEnKS5hbmltYXRlKHtvcGFjaXR5OiAnMC41J30sICJzbG93Iik7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkb2Mub24oJ2NsaWNrJywgJy5saXN0ZW5lci1saW5rLXJwYycsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gJChlLmN1cnJlbnRUYXJnZXQpOwogICAgICAgICAgICAgICAgdGFyZ2V0LmZpbmQoJy5pY29uJykucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICB0YXJnZXQuZmluZCgnLnBsLWxvYWRpbmcnKS5yZW1vdmUoKTsKICAgICAgICAgICAgICAgIHRhcmdldC5wcmVwZW5kKGJhc2UuY3JlYXRlTG9hZGluZygpKTsKICAgICAgICAgICAgICAgIGxldCByZXMgPSBhd2FpdCB0aGlzLnNlbmRMaW5rVG9SUEMoZS5jdXJyZW50VGFyZ2V0LmRhdGFzZXQuZmlsZW5hbWUsIGUuY3VycmVudFRhcmdldC5kYXRhc2V0LmxpbmspOwogICAgICAgICAgICAgICAgaWYgKHJlcyA9PT0gJ3N1Y2Nlc3MnKSB7CiAgICAgICAgICAgICAgICAgICAgJCgnLmxpc3RlbmVyLXJwYy10YXNrJykuc2hvdygpOwogICAgICAgICAgICAgICAgICAgIHRhcmdldC5yZW1vdmVDbGFzcygncGwtYnRuLWRhbmdlcicpLmh0bWwoJ+WPkemAgeaIkOWKn++8jOW/q+WOu+eci+eci+WQp++8gScpLmFuaW1hdGUoe29wYWNpdHk6ICcwLjUnfSwgInNsb3ciKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzID09PSAnYXNzaXN0YW50JykgewogICAgICAgICAgICAgICAgICAgIHRhcmdldC5hZGRDbGFzcygncGwtYnRuLWRhbmdlcicpLmh0bWwoYCR7cGFuLmluaXRbNV198J+RiTxhIGhyZWY9IiR7cGFuLmFzc2lzdGFudH0iIHRhcmdldD0iX2JsYW5rIiBjbGFzcz0icGwtYSI+54K55Ye75q2k5aSE5a6J6KOFPC9hPvCfkYhgKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LmFkZENsYXNzKCdwbC1idG4tZGFuZ2VyJykudGV4dCgn5Y+R6YCB5aSx6LSl77yM6K+35qOA5p+l5oKo55qEUlBD6YWN572u5L+h5oGv77yBJykuYW5pbWF0ZSh7b3BhY2l0eTogJzAuNSd9LCAic2xvdyIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItc2VuZC1ycGMnLCAoZSkgPT4gewogICAgICAgICAgICAgICAgJCgnLmxpc3RlbmVyLWxpbmstcnBjJykuY2xpY2soKTsKICAgICAgICAgICAgICAgICQoZS50YXJnZXQpLnRleHQoJ+WPkemAgeWujOaIkO+8jOWPkemAgee7k+aenOingeS4iuaWueaMiemSru+8gScpLmFuaW1hdGUoe29wYWNpdHk6ICcwLjUnfSwgInNsb3ciKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLW9wZW4tc2V0dGluZycsICgpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2hvd1NldHRpbmcoKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLXJwYy10YXNrJywgKCkgPT4gewogICAgICAgICAgICAgICAgbGV0IHJwYyA9IEpTT04uc3RyaW5naWZ5KHsKICAgICAgICAgICAgICAgICAgICBkb21haW46IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RvbWFpbicpLAogICAgICAgICAgICAgICAgICAgIHBvcnQ6IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX3BvcnQnKSwKICAgICAgICAgICAgICAgIH0pLCB1cmwgPSBgJHtwYW4uZH0vP3JwYz0ke2Jhc2UuZShycGMpfSMke2Jhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX3Rva2VuJyl9YDsKICAgICAgICAgICAgICAgIEdNX29wZW5JblRhYih1cmwsIHthY3RpdmU6IHRydWV9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5hZGRFdmVudExpc3RlbmVyKCdtb3VzZXVwJywgKGUpID0+IHsKICAgICAgICA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XAgPSAkKHBhbi5idG4uc2hhcmUpOwogICAgICAgICAgICAkdG9vbFdyYXAucHJlcGVuZCgkYnV0dG9uKTsKICAgICAgICAgICAgJGJ1dHRvbi5jbGljaygoKSA9PiBiYXNlLmluaXREaWFsb2coKSk7CiAgICAgICAgfSwKCiAgICAgICAgYXN5bmMgZ2V0UENTTGluaygpIHsKICAgICAgICAgICAgc2VsZWN0TGlzdCA9IHRoaXMuZ2V0U2VsZWN0ZWRMaXN0KCk7CiAgICAgICAgICAgIGxldCBmaWRMaXN0ID0gdGhpcy5fZ2V0RmlkTGlzdCgpLCB1cmwsIHJlczsKCiAgICAgICAgICAgIGlmIChwdCA9PT0gJ2hvbWUnIHx8IHB0ID09PSAnbWFpbicpIHsKICAgICAgICAgICAgICAgIGlmIChzZWxlY3RMaXN0Lmxlbmd0aCA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBtZXNzYWdlLmVycm9yKCfmj5DnpLrvvJror7flhYjli77pgInopoHkuIvovb3nmoTmlofku7bvvIEnKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmIChmaWRMaXN0Lmxlbmd0aCA9PT0gMikgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBtZXNzYWdlLmVycm9yKCfmj5DnpLrvvJror7fmiZPlvIDmlofku7blpLnlkI7li77pgInmlofku7bvvIEnKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGZpZExpc3QgPSBlbmNvZGVVUklDb21wb25lbnQoZmlkTGlzdCk7CiAgICAgICAgICAgICAgICB1cmwgPSBgJHtwYW4ucGNzWzBdfSZmc2lkcz0ke2ZpZExpc3R9YDsKICAgICAgICAgICAgICAgIHJlcyA9IGF3YWl0IGJhc2UuZ2V0KHVybCwgeyJVc2VyLUFnZW50IjogcGFuLnVhfSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKHB0ID09PSAnc2hhcmUnKSB7CiAgICAgICAgICAgICAgICB0aGlzLmdldFNoYXJlRGF0YSgpOwogICAgICAgICAgICAgICAgaWYgKHNlbGVjdExpc3QubGVuZ3RoID09PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1lc3NhZ2UuZXJyb3IoJ+aPkOekuu+8muivt+WFiOWLvumAieimgeS4i+i9veeahOaWh+S7tu+8gScpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKGZpZExpc3QubGVuZ3RoID09PSAyKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1lc3NhZ2UuZXJyb3IoJ+aPkOekuu+8muivt+aJk+W8gOaWh+S7tuWkueWQjuWLvumAieaWh+S7tu+8gScpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKCFwYXJhbXMuc2lnbikgewogICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBgJHtwYW4ucGNzWzJdfSZzdXJsPSR7cGFyYW1zLnN1cmx9JmxvZ2lkPSR7cGFyYW1zLmxvZ2lkfWA7CiAgICAgICAgICAgICAgICAgICAgbGV0IHIgPSBhd2FpdCBiYXNlLmdldCh1cmwpOwogICAgICAgICAgICAgICAgICAgIGlmIChyLmVycm5vID09PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5zaWduID0gci5kYXRhLnNpZ247CiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy50aW1lc3RhbXAgPSByLmRhdGEudGltZXN0YW1wOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkaWFsb2cgPSBhd2FpdCBTd2FsLmZpcmUoewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3Q6IHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpY29uOiAnaW5mbycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOaPkOekuu+8muivt+WwhuaWh+S7tjxzcGFuIGNsYXNzPSJ0YWctZGFuZ2VyIj5b5L+d5a2Y5Yiw572R55uYXTwvc3Bhbj7wn5GJ5YmN5b6APHNwYW4gY2xhc3M9InRhZy1kYW5nZXIiPlvmiJHnmoTnvZHnm5hdPC9zcGFuPuS4reS4i+i9ve+8gWAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93Q29uZmlybUJ1dHRvbjogdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm1CdXR0b25UZXh0OiAn54K55Ye75L+d5a2YJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiAndG9wJywKICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaWFsb2cuaXNDb25maXJtZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoJy50b29scy1zaGFyZS1zYXZlLWhiJylbMF0uY2xpY2soKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKCFwYXJhbXMuYmRzdG9rZW4pIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWVzc2FnZS5lcnJvcign5o+Q56S677ya6K+35YWI55m75b2V572R55uY77yBJyk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBsZXQgZm9ybURhdGEgPSBuZXcgRm9ybURhdGEoKTsKICAgICAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZCgnZW5jcnlwdCcsIHBhcmFtcy5lbmNyeXB0KTsKICAgICAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZCgncHJvZHVjdCcsIHBhcmFtcy5wcm9kdWN0KTsKICAgICAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZCgndWsnLCBwYXJhbXMudWspOwogICAgICAgICAgICAgICAgZm9ybURhdGEuYXBwZW5kKCdwcmltYXJ5aWQnLCBwYXJhbXMucHJpbWFyeWlkKTsKICAgICAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZCgnZmlkX2xpc3QnLCBmaWRMaXN0KTsKICAgICAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZCgnbG9naWQnLCBwYXJhbXMubG9naWQpOwogICAgICAgICAgICAgICAgcGFyYW1zLnNoYXJlVHlwZSA9PT0gJ3NlY3JldCcgPyBmb3JtRGF0YS5hcHBlbmQoJ2V4dHJhJywgcGFyYW1zLmV4dHJhKSA6ICcnOwogICAgICAgICAgICAgICAgdXJsID0gYCR7cGFuLnBjc1sxXX0mc2lnbj0ke3BhcmFtcy5zaWdufSZ0aW1lc3RhbXA9JHtwYXJhbXMudGltZXN0YW1wfWA7CiAgICAgICAgICAgICAgICByZXMgPSBhd2FpdCBiYXNlLnBvc3QodXJsLCBmb3JtRGF0YSwgeyJVc2VyLUFnZW50IjogcGFuLnVhfSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKHJlcy5lcnJubyA9PT0gMCkgewogICAgICAgICAgICAgICAgbGV0IGh0bWwgPSB0aGlzLmdlbmVyYXRlRG9tKHJlcy5saXN0KTsKICAgICAgICAgICAgICAgIHRoaXMuc2hvd01haW5EaWFsb2cocGFuW21vZGVdWzBdLCBodG1sLCBwYW5bbW9kZV1bMV0pOwogICAgICAgICAgICB9IGVsc2UgaWYgKHJlcy5lcnJubyA9PT0gMTEyKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gbWVzc2FnZS5lcnJvcign5o+Q56S677ya6aG16Z2i6L+H5pyf77yM6K+35Yi35paw6YeN6K+V77yBJyk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBtZXNzYWdlLmVycm9yKCfmj5DnpLrvvJrojrflj5bkuIvovb3pk77mjqXlpLHotKXvvIHor7fliLfmlrDnvZHpobXlkI7ph43or5XvvIEnKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIGdlbmVyYXRlRG9tKGxpc3QpIHsKICAgICAgICAgICAgbGV0IGNvbnRlbnQgPSAnPGRpdiBjbGFzcz0icGwtbWFpbiI+JzsKICAgICAgICAgICAgbGV0IGFsaW5rQWxsVGV4dCA9ICcnOwogICAgICAgICAgICBiYXNlLnNvcnRCeU5hbWUobGlzdCk7CiAgICAgICAgICAgIGxpc3QuZm9yRWFjaCgodiwgaSkgPT4gewogICAgICAgICAgICAgICAgaWYgKHYuaXNkaXIgPT09IDEpIHJldHVybjsKICAgICAgICAgICAgICAgIGxldCBmaWxlbmFtZSA9IHYuc2VydmVyX2ZpbGVuYW1lIHx8IHYuZmlsZW5hbWU7CiAgICAgICAgICAgICAgICBsZXQgZXh0ID0gYmFzZS5nZXRFeHRlbnNpb24oZmlsZW5hbWUpOwogICAgICAgICAgICAgICAgbGV0IHNpemUgPSBiYXNlLnNpemVGb3JtYXQodi5zaXplKTsKICAgICAgICAgICAgICAgIGxldCBkbGluayA9IHYuZGxpbms7CiAgICAgICAgICAgICAgICBpZiAobW9kZSA9PT0gJ2FwaScpIHsKICAgICAgICAgICAgICAgICAgICBjb250ZW50ICs9IGA8ZGl2IGNsYXNzPSJwbC1pdGVtIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1pdGVtLW5hbWUgbGlzdGVuZXItdGlwIiBkYXRhLXNpemU9IiR7c2l6ZX0iPiR7ZmlsZW5hbWV9PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgY2xhc3M9InBsLWl0ZW0tbGluayBwbC1hIGxpc3RlbmVyLWxpbmstYXBpIiBocmVmPSIke2RsaW5rfSIgZGF0YS1maWxlbmFtZT0iJHtmaWxlbmFtZX0iIGRhdGEtbGluaz0iJHtkbGlua30iIGRhdGEtaW5kZXg9IiR7aX0iPiR7ZGxpbmt9PC9hPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLWl0ZW0tdGlwIiBzdHlsZT0iZGlzcGxheTogbm9uZSI+PHNwYW4+6Iul5rKh5pyJ5by55Ye6SURN5LiL6L295qGG77yM5om+5YiwSURNIDxiPumAiemhuTwvYj4gLT4gPGI+5paH5Lu257G75Z6LPC9iPiAtPiA8Yj7nrKzkuIDkuKrmoYY8L2I+IOS4rea3u+WKoOWQjue8gCA8c3BhbiBjbGFzcz0icGwtZXh0Ij4ke2V4dH08L3NwYW4+77yMPGEgaHJlZj0iJHtwYW4uaWRtfSIgdGFyZ2V0PSJfYmxhbmsiIGNsYXNzPSJwbC1hIj7or6bop4HmraTlpIQ8L2E+PC9zcGFuPiA8c3BhbiBjbGFzcz0icGwtYmFjayBsaXN0ZW5lci1iYWNrIj7ov5Tlm548L3NwYW4+PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0icGwtaXRlbS1wcm9ncmVzcyIgc3R5bGU9ImRpc3BsYXk6IG5vbmUiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1wcm9ncmVzcyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1wcm9ncmVzcy1vdXRlciI+PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1wcm9ncmVzcy1pbm5lciIgc3R5bGU9IndpZHRoOjUlIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0icGwtcHJvZ3Jlc3MtaW5uZXItdGV4dCI+MCU8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9InBsLXByb2dyZXNzLXN0b3AgbGlzdGVuZXItc3RvcCI+5Y+W5raI5LiL6L29PC9zcGFuPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz0icGwtcHJvZ3Jlc3MtdGlwIj7mnKrlj5HnjrBJRE3vvIzkvb/nlKjoh6rluKbmtY/op4jlmajkuIvovb08L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPSJwbC1wcm9ncmVzcy1ob3cgbGlzdGVuZXItaG93Ij7lpoLkvZXllKTotbdJRE3vvJ88L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+PC9kaXY+YDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmIChtb2RlID09PSAnYXJpYScpIHsKICAgICAgICAgICAgICAgICAgICBsZXQgYWxpbmsgPSB0aGlzLmNvbnZlcnRMaW5rVG9BcmlhKGRsaW5rLCBmaWxlbmFtZSwgcGFuLnVhKTsKICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIChhbGluaykgPT09ICdvYmplY3QnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gYDxkaXYgY2xhc3M9InBsLWl0ZW0iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLWl0ZW0tbmFtZSBsaXN0ZW5lci10aXAiIGRhdGEtc2l6ZT0iJHtzaXplfSI+JHtmaWxlbmFtZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBjbGFzcz0icGwtaXRlbS1saW5rIHBsLWEiIHRhcmdldD0iX2JsYW5rIiBocmVmPSIke2FsaW5rLmxpbmt9IiB0aXRsZT0i54K55Ye75aSN5Yi2YXJpYTJj6ZO+5o6lIiBkYXRhLWZpbGVuYW1lPSIke2ZpbGVuYW1lfSIgZGF0YS1saW5rPSIke2FsaW5rLmxpbmt9Ij4ke2RlY29kZVVSSUNvbXBvbmVudChhbGluay50ZXh0KX08L2E+IDwvZGl2PmA7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgYWxpbmtBbGxUZXh0ICs9IGFsaW5rICsgJ1xyXG4nOwogICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50ICs9IGA8ZGl2IGNsYXNzPSJwbC1pdGVtIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1pdGVtLW5hbWUgbGlzdGVuZXItdGlwIiBkYXRhLXNpemU9IiR7c2l6ZX0iPiR7ZmlsZW5hbWV9PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgY2xhc3M9InBsLWl0ZW0tbGluayBwbC1hIGxpc3RlbmVyLWxpbmstYXJpYSIgaHJlZj0iJHthbGlua30iIHRpdGxlPSLngrnlh7vlpI3liLZhcmlhMmPpk77mjqUiIGRhdGEtZmlsZW5hbWU9IiR7ZmlsZW5hbWV9IiBkYXRhLWxpbms9IiR7YWxpbmt9Ij4ke2RlY29kZVVSSUNvbXBvbmVudChhbGluayl9PC9hPiA8L2Rpdj5gOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmIChtb2RlID09PSAncnBjJykgewogICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gYDxkaXYgY2xhc3M9InBsLWl0ZW0iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLWl0ZW0tbmFtZSBsaXN0ZW5lci10aXAiIGRhdGEtc2l6ZT0iJHtzaXplfSI+JHtmaWxlbmFtZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPSJwbC1pdGVtLWxpbmsgbGlzdGVuZXItbGluay1ycGMgcGwtYnRuLXByaW1hcnkgcGwtYnRuLWluZm8iIGRhdGEtZmlsZW5hbWU9IiR7ZmlsZW5hbWV9IiBkYXRhLWxpbms9IiR7ZGxpbmt9Ij48ZW0gY2xhc3M9Imljb24gaWNvbi1kZXZpY2UiPjwvZW0+PHNwYW4gc3R5bGU9Im1hcmdpbi1sZWZ0OiA1cHg7Ij7mjqjpgIHliLAgUlBDIOS4i+i9veWZqDwvc3Bhbj48L2J1dHRvbj48L2Rpdj5gOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKG1vZGUgPT09ICdjdXJsJykgewogICAgICAgICAgICAgICAgICAgIGxldCBhbGluayA9IHRoaXMuY29udmVydExpbmtUb0N1cmwoZGxpbmssIGZpbGVuYW1lLCBwYW4udWEpOwogICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgKGFsaW5rKSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCArPSBgPGRpdiBjbGFzcz0icGwtaXRlbSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0icGwtaXRlbS1uYW1lIGxpc3RlbmVyLXRpcCIgZGF0YS1zaXplPSIke3NpemV9Ij4ke2ZpbGVuYW1lfTwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIGNsYXNzPSJwbC1pdGVtLWxpbmsgcGwtYSIgdGFyZ2V0PSJfYmxhbmsiIGhyZWY9IiR7YWxpbmsubGlua30iIHRpdGxlPSLngrnlh7vlpI3liLZjdXJs6ZO+5o6lIiBkYXRhLWZpbGVuYW1lPSIke2ZpbGVuYW1lfSIgZGF0YS1saW5rPSIke2FsaW5rLmxpbmt9Ij4ke2RlY29kZVVSSUNvbXBvbmVudChhbGluay50ZXh0KX08L2E+IDwvZGl2PmA7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgYWxpbmtBbGxUZXh0ICs9IGFsaW5rICsgJ1xyXG4nOwogICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50ICs9IGA8ZGl2IGNsYXNzPSJwbC1pdGVtIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1pdGVtLW5hbWUgbGlzdGVuZXItdGlwIiBkYXRhLXNpemU9IiR7c2l6ZX0iPiR7ZmlsZW5hbWV9PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgY2xhc3M9InBsLWl0ZW0tbGluayBwbC1hIGxpc3RlbmVyLWxpbmstYXJpYSIgaHJlZj0iJHthbGlua30iIHRpdGxlPSLngrnlh7vlpI3liLZjdXJs6ZO+5o6lIiBkYXRhLWZpbGVuYW1lPSIke2ZpbGVuYW1lfSIgZGF0YS1saW5rPSIke2FsaW5rfSI+JHtkZWNvZGVVUklDb21wb25lbnQoYWxpbmspfTwvYT4gPC9kaXY+YDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAobW9kZSA9PT0gJ2JjJykgewogICAgICAgICAgICAgICAgICAgIGxldCBhbGluayA9IHRoaXMuY29udmVydExpbmtUb0JDKGRsaW5rLCBmaWxlbmFtZSwgcGFuLnVhKTsKICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIChhbGluaykgPT09ICdvYmplY3QnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gYDxkaXYgY2xhc3M9InBsLWl0ZW0iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLWl0ZW0tbmFtZSBsaXN0ZW5lci10aXAiIGRhdGEtc2l6ZT0iJHtzaXplfSI+JHtmaWxlbmFtZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBjbGFzcz0icGwtaXRlbS1saW5rIHBsLWEiIGhyZWY9IiR7ZGVjb2RlVVJJQ29tcG9uZW50KGFsaW5rLmxpbmspfSIgdGl0bGU9IueCueWHu+eUqOavlOeJueW9l+aYn+S4i+i9vSIgZGF0YS1maWxlbmFtZT0iJHtmaWxlbmFtZX0iIGRhdGEtbGluaz0iJHthbGlua30iPiR7ZGVjb2RlVVJJQ29tcG9uZW50KGFsaW5rLnRleHQpfTwvYT4gPC9kaXY+YDsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBhbGlua0FsbFRleHQgKz0gYWxpbmsgKyAnXHJcbic7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gYDxkaXYgY2xhc3M9InBsLWl0ZW0iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLWl0ZW0tbmFtZSBsaXN0ZW5lci10aXAiIGRhdGEtc2l6ZT0iJHtzaXplfSI+JHtmaWxlbmFtZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBjbGFzcz0icGwtaXRlbS1saW5rIHBsLWEiIGhyZWY9IiR7ZGVjb2RlVVJJQ29tcG9uZW50KGFsaW5rKX0iIHRpdGxlPSLngrnlh7vnlKjmr5TnibnlvZfmmJ/kuIvovb0iIGRhdGEtZmlsZW5hbWU9IiR7ZmlsZW5hbWV9IiBkYXRhLWxpbms9IiR7YWxpbmt9Ij4ke2RlY29kZVVSSUNvbXBvbmVudChhbGluayl9PC9hPiA8L2Rpdj5gOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGNvbnRlbnQgKz0gJzwvZGl2Pic7CiAgICAgICAgICAgIGlmIChtb2RlID09PSAnYXJpYScpCiAgICAgICAgICAgICAgICBjb250ZW50ICs9IGA8ZGl2IGNsYXNzPSJwbC1leHRyYSI+PGJ1dHRvbiBjbGFzcz0icGwtYnRuLXByaW1hcnkgbGlzd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hdGEtbGluaz0iJHthbGlua0FsbFRleHR9Ij7lpI3liLblhajpg6jpk77mjqU8L2J1dHRvbj48YnV0dG9uIGNsYXNzPSJwbC1idG4tcHJpbWFyeSBwbC1idG4td2FybmluZyBsaXN0ZW5lci1vcGVuLXNldHRpbmciIHN0eWxlPSJtYXJnaW4tbGVmdDogMTBweDsiPuiuvue9rue7iOerr+exu+Wei++8iOW9k+WJjeS4uu+8miR7dGVybWluYWxUeXBlW2Jhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfdGVybWluYWxfdHlwZScpXX3vvIk8L2J1dHRvbj48L2Rpdj5gOwogICAgICAgICAgICByZXR1cm4gY29udGVudDsKICAgICAgICB9LAoKICAgICAgICBhc3luYyBzZW5kTGlua1RvUlBDKGZpbGVuYW1lLCBsaW5rKSB7CiAgICAgICAgICAgIGxldCBycGMgPSB7CiAgICAgICAgICAgICAgICBkb21haW46IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RvbWFpbicpLAogICAgICAgICAgICAgICAgcG9ydDogYmFzZS5nZXRWYWx1ZSgnc2V0dGluZ19ycGNfcG9ydCcpLAogICAgICAgICAgICAgICAgcGF0aDogYmFzZS5nZXRWYWx1ZSgnc2V0dGluZ19ycGNfcGF0aCcpLAogICAgICAgICAgICAgICAgdG9rZW46IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX3Rva2VuJyksCiAgICAgICAgICAgICAgICBkaXI6IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RpcicpLAogICAgICAgICAgICB9OwogICAgICAgICAgICBsZXQgQkRVU1MgPSB0aGlzLmdldEJEVVNTKCk7CiAgICAgICAgICAgIGlmICghQkRVU1MpIHJldHVybiAnYXNzaXN0YW50JzsKCiAgICAgICAgICAgIGxldCB1cmwgPSBgJHtycGMuZG9tYWlufToke3JwYy5wb3J0fSR7cnBjLnBhdGh9YDsKICAgICAgICAgICAgbGV0IHJwY0RhdGEgPSB7CiAgICAgICAgICAgICAgICBpZDogbmV3IERhdGUoKS5nZXRUaW1lKCksCiAgICAgICAgICAgICAgICBqc29ucnBjOiAnMi4wJywKICAgICAgICAgICAgICAgIG1ldGhvZDogJ2FyaWEyLmFkZFVyaScsCiAgICAgICAgICAgICAgICBwYXJhbXM6IFtgdG9rZW46JHtycGMudG9rZW59YCwgW2xpbmtdLCB7CiAgICAgICAgICAgICAgICAgICAgZGlyOiBycGMuZGlyLAogICAgICAgICAgICAgICAgICAgIG91dDogZmlsZW5hbWUsCiAgICAgICAgICAgICAgICAgICAgaGVhZGVyOiBbYFVzZXItQWdlbnQ6ICR7cGFuLnVhfWAsIGBDb29raWU6IEJEVVNTPSR7QkRVU1N9YF0KICAgICAgICAgICAgICAgIH1dCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBsZXQgcmVzID0gYXdhaXQgYmFzZS5wb3N0KHVybCwgcnBjRGF0YSwgeyJVc2VyLUFnZW50IjogcGFuLnVhfSwgJycpOwogICAgICAgICAgICAgICAgaWYgKHJlcy5yZXN1bHQpIHJldHVybiAnc3VjY2Vzcyc7CiAgICAgICAgICAgICAgICByZXR1cm4gJ2ZhaWwnOwogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJ2ZhaWwnOwogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgZ2V0U2VsZWN0ZWRMaXN0KCkgewogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgcmV0dXJuIHJlcXVpcmUoJ3N5c3RlbS1jb3JlOmNvbnRleHQvY29udGV4dC5qcycpLmluc3RhbmNlRm9yU3lzdGVtLmxpc3QuZ2V0U2VsZWN0ZWQoKTsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy53cC1zLWNvcmUtcGFuJykuX192dWVfXy5zZWxlY3RlZExpc3Q7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBnZXRMb2dpZCgpIHsKICAgICAgICAgICAgbGV0IHV0ID0gcmVxdWlyZSgic3lzdGVtLWNvcmU6Y29udGV4dC9jb250ZXh0LmpzIikuaW5zdGFuY2VGb3JTeXN0ZW0udG9vbHMuYmFzZVNlcnZpY2U7CiAgICAgICAgICAgIHJldHVybiB1dC5iYXNlNjRFbmNvZGUoYmFzZS5nZXRDb29raWUoIkJBSURVSUQiKSk7CiAgICAgICAgfSwKCiAgICAgICAgZ2V0U2hhcmVEYXRhKCkgewogICAgICAgICAgICBsZXQgcmVzID0gbG9jYWxzLmR1bXAoKTsKICAgICAgICAgICAgcGFyYW1zLnNoYXJlVHlwZSA9ICdzZWNyZXQnOwogICAgICAgICAgICBwYXJhbXMuc2lnbiA9ICcnOwogICAgICAgICAgICBwYXJhbXMudGltZXN0YW1wID0gJyc7CiAgICAgICAgICAgIHBhcmFtcy5iZHN0b2tlbiA9IHJlcy5iZHN0b2tlbi52YWx1ZTsKICAgICAgICAgICAgcGFyYW1zLmNoYW5uZWwgPSAnY2h1bmxlaSc7CiAgICAgICAgICAgIHBhcmFtcy5jbGllbnR0eXBlID0gMDsKICAgICAgICAgICAgcGFyYW1zLndlYiA9IDE7CiAgICAgICAgICAgIHBhcmFtcy5hcHBfaWQgPSAyNTA1Mjg7CiAgICAgICAgICAgIHBhcmFtcy5lbmNyeXB0ID0gMDsKICAgICAgICAgICAgcGFyYW1zLnByb2R1Y3QgPSAnc2hhcmUnOwogICAgICAgICAgICBwYXJhbXMubG9naWQgPSB0aGlzLmdldExvZ2lkKCk7CiAgICAgICAgICAgIHBhcmFtcy5wcmltYXJ5aWQgPSByZXMuc2hhcmVpZC52YWx1ZTsKICAgICAgICAgICAgcGFyYW1zLnVrID0gcmVzLnNoYXJlX3VrLnZhbHVlOwogICAgICAgICAgICBwYXJhbXMuc2hhcmVUeXBlID09PSAnc2VjcmV0JyAmJiAocGFyYW1zLmV4dHJhID0gdGhpcy5fZ2V0RXh0cmEoKSk7CiAgICAgICAgICAgIHBhcmFtcy5zdXJsID0gdGhpcy5fZ2V0U3VybCgpOwogICAgICAgIH0sCgogICAgICAgIGRldGVjdFBhZ2UoKSB7CiAgICAgICAgICAgIGxldCBwYXRoID0gbG9jYXRpb24ucGF0aG5hbWU7CiAgICAgICAgICAgIGlmICgvXlwvZGlza1wvaG9tZS8udGVzdChwYXRoKSkgcmV0dXJuICdob21lJzsKICAgICAgICAgICAgaWYgKC9eXC9kaXNrXC9tYWluLy50ZXN0KHBhdGgpKSByZXR1cm4gJ21haW4nOwogICAgICAgICAgICBpZiAoL15cLyhzfHNoYXJlKVwvLy50ZXN0KHBhdGgpKSByZXR1cm4gJ3NoYXJlJzsKICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfSwKCiAgICAgICAgc2hvd01haW5EaWFsb2codGl0bGUsIGh0bWwsIGZvb3RlcikgewogICAgICAgICAgICBTd2FsLmZpcmUoewogICAgICAgICAgICAgICAgdGl0bGUsCiAgICAgICAgICAgICAgICBodG1sLAogICAgICAgICAgICAgICAgZm9vdGVyLAogICAgICAgICAgICAgICAgYWxsb3dPdXRzaWRlQ2xpY2s6IGZhbHNlLAogICAgICAgICAgICAgICAgc2hvd0Nsb3NlQnV0dG9uOiB0cnVlLAogICAgICAgICAgICAgICAgc2hvd0NvbmZpcm1CdXR0b246IGZhbHNlLAogICAgICAgICAgICAgICAgcG9zaXRpb246ICd0b3AnLAogICAgICAgICAgICAgICAgd2lkdGgsCiAgICAgICAgICAgICAgICBwYWRkaW5nOiAnMTVweCAyMHB4IDVweCcsCiAgICAgICAgICAgICAgICBjdXN0b21DbGFzcywKICAgICAgICAgICAgfSkudGhlbigoKSA9PiB7CiAgICAgICAgICAgICAgICB0aGlzLl9yZXNldERhdGEoKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKCiAgICAgICAgYXN5bmMgaW5pdFBhbkxpbmtlcigpIHsKICAgICAgICAgICAgYmFzZS5pbml0RGVmYXVsdENvbmZpZygpOwogICAgICAgICAgICBiYXNlLmFkZFBhbkxpbmtlclN0eWxlKCk7CiAgICAgICAgICAgIHB0ID0gdGhpcy5kZXRlY3RQYWdlKCk7CiAgICAgICAgICAgIGxldCByZXMgPSBhd2FpdCBiYXNlLnBvc3QKICAgICAgICAgICAgKGBodHRwczovL2FwaS55b3V4aWFvaG91LmNvbS9jb25maWc/dmVyPSR7dmVyc2lvbn0mYT0ke2F1dGhvcn1gLCB7fSwge30sICd0ZXh0Jyk7CiAgICAgICAgICAgIHBhbiA9IEpTT04ucGFyc2UoYmFzZS5kKHJlcykpOwogICAgICAgICAgICBPYmplY3QuZnJlZXplICYmIE9iamVjdC5mcmVlemUocGFuKTsKICAgICAgICAgICAgY29uc29sZS5sb2cocGFuKTsKICAgICAgICAgICAgcGFuLm51bSA9PT0gYmFzZS5nZXRWYWx1ZSgnc2V0dGluZ19pbml0X2NvZGUnKSA/IHRoaXMuYWRkQnV0dG9uKCkgOiB0aGlzLmFkZEluaXRCdXR0b24oKTsKICAgICAgICAgICAgYmFzZS5jcmVhdGVUaXAoKTsKICAgICAgICAgICAgYmFzZS5yZWdpc3Rlck1lbnVDb21tYW5kKCk7CiAgICAgICAgfQogICAgfTsKCiAgICBsZXQgbWFpbiA9IHsKICAgICAgICBpbml0KCkgewogICAgICAgICAgICBpZiAoLyhwYW58eXVuKS5iYWlkdS5jb20vLnRlc3QobG9jYXRpb24uaG9zdCkpIHsKICAgICAgICAgICAgICAgIGJhaWR1LmluaXRQYW5MaW5rZXIoKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH07CgogICAgbWFpbi5pbml0KCk7CiAgICB9CiAgICB9Cn0pKCk7
Add Comment
Please, Sign In to add comment