xiaomianao666

小程序:青豆

Mar 9th, 2024
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@青豆@eyJmaXJzdEhlYWRlciI6ImNsYXNzIiwibGFzdF9jaGFwdGVyX3J1bGUiOiJqczpcbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFwiaGlrZXI6Ly9wYWdlL21haW5cIikpLnJ1bGUpO1xubGV0IHR5cGUgPSBnZXRQYXJhbSgndHlwZScsICcnKSxcbiAgICBpZCA9IGdldFBhcmFtKCdpZCcsICcnKSxcbiAgICB0aXRsZSA9IGdldFBhcmFtKCd0aXRsZScsICcnKTtcbmxldCByZXMgPSBnZXREb3ViYW5SZXMoXCJodHRwczovL2Zyb2RvLmRvdWJhbi5jb20vYXBpL3YyL1wiICsgdHlwZSArIFwiL1wiICsgaWQpO1xubGV0IHVwZGF0ZSA9IFwiXCI7XG5pZiAodGl0bGUgPT0gJycpIHtcbiAgICBsZXQgbGVuZ3RoID0gcmVzLnZlbmRvcnMubGVuZ3RoO1xuICAgIHVwZGF0ZSArPSBsZW5ndGggPiAwID8gJ+WFsScgKyBsZW5ndGggKyAn5Liq54mH5rqQJyA6ICfmmoLml6DniYfmupAnO1xuICAgIGlmIChsZW5ndGggPiAwKSB7XG4gICAgICAgIGxldCBlID0gcmVzLnZlbmRvcnNbMF07XG4gICAgICAgIHVwZGF0ZSArPSBlLmVwaXNvZGVzX2luZm8gPyBcInxcIiArIGUuZXBpc29kZXNfaW5mbyA6IFwiXCI7XG4gICAgfVxufSBlbHNlIHtcbiAgICBmb3IgKGxldCBlIG9mIHJlcy52ZW5kb3JzKSB7XG4gICAgICAgIGlmIChlLnRpdGxlID09IHRpdGxlKSB7XG4gICAgICAgICAgICB1cGRhdGUgKz0gZS5lcGlzb2Rlc19pbmZvID8gZS5lcGlzb2Rlc19pbmZvIDogXCJcIjtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIC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CJcXFwiKSxcXG4gICAgICAgICAgICAgICAgdHlwZTogZGF0YS50eXBlID8gZGF0YS50eXBlIDogJycsXFxuICAgICAgICAgICAgICAgIGhlaWdodDogNSxcXG4gICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogJ3B1dE15VmFyKFxcXCInICsgZGF0YS5rZXkgKyAnXFxcIiwgaW5wdXQpJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5L+d5a2YJyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChjb25maWdLZXksIHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxuICAgICAgICAgICAgbGV0IG5hbWUgPSBnZXRNeVZhcihwYXJhbXMua2V5LCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgaWYobmFtZSA9PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazlee8lui+kSdcXG4gICAgICAgICAgICBjb25maWdbY29uZmlnS2V5XS51c2UgPSBuYW1lXFxuICAgICAgICAgICAgaWYgKCFjb25maWdbY29uZmlnS2V5XVtuYW1lXSkgY29uZmlnW2NvbmZpZ0tleV1bbmFtZV0gPSB7fVxcbiAgICAgICAgICAgIGxldCBkYXRhcyA9IHBhcmFtcy5kYXRhO1xcbiAgICAgICAgICAgIGxldCBkYXRhS2V5cyA9IE9iamVjdC5rZXlzKGRhdGFzKTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIGRhdGFLZXlzKSB7XFxuICAgICAgICAgICA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G4gICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXlkI3np7BcXFwiLFxcbiAgICAgICAgLy8gdHlwZTogJ2lucHV0J1xcbiAgICAgICAgZGF0YToge1xcbiAgICAgICAgICAgIGNvbmZpZzoge1xcbiAgICAgICAgICAgICAgICBrZXk6IFxcXCJpbnB1dF9jb2RlXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpemFjee9ruS7o+eggVxcXCIsXFxuICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0pXFxufVxcblxcbi8v6Ieq5a6a5LmJ6K+m5oOF6aG16Z2iLemFjee9rue8lui+kemhtemdolxcbmZ1bmN0aW9uIGRldGFpbFZpZXdNb2RlRWRpdFBhZ2UoZCkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICc8Zm9udCBjb2xvcj1cXFwiIzgwODA4MFxcXCI+JyArICfjgJDlhoXnva7lj5jph4/jgJEnICsgJzxicj4mbmJzcDsmbmJzcDsmbmJzcDtpZDog54mH5Y2VaWQnICsgJzxicj4mbmJzcDsmbmJzcDsmbmJzcDt0eXBlOiDniYfljZXnsbvlnosnICsgJzxicj4mbmJzcDsmbmJzcDsmbmJzcDt0aXRsZTog54mH5Y2V5qCH6aKYJyArICc8L2ZvbnQ+JyxcXG4gICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcbiAgICB9KVxcbiAgICBtb2RlRWRpdFBhZ2UoZCwgXFxcImRldGFpbHNWaWV3Q29uZmlnc1xcXCIsIHtcXG4gICAgICAgIGtleTogXFxcImlucHV0X25hbWVcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeWQjeensFxcXCIsXFxuICAgICAgICAvLyB0eXBlOiAnaW5wdXQnXFxuICAgICAgICBkYXRhOiB7XFxuICAgICAgICAgICAgY29uZmlnOiB7XFxuICAgICAgICAgICAgICAgIGtleTogXFxcImlucHV0X2NvZGVcXFwiLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl6YWN572u5Luj56CBXFxcIixcXG4gICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgc2V0dGluZzoge1xcbiAgICAgICAgICAgICAgICBrZXk6IFxcXCJpbnB1dF9zZXR0aW5nX2NvZGVcXFwiLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl6K6+572u6aG16Z2i5Luj56CBXFxcIixcXG4gICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSlcXG59XFxuXFxuLy/oh6rlrprkuYnop6PmnpAt57yW6L6R6aG16Z2iXFxuZnVuY3Rpb24gYW5hbHlzaXNNb2RlRWRpdFBhZ2UoZCkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICc8Zm9udCBjb2xvcj1cXFwiIzgwODA4MFxcXCI+JyArICfjgJDop6PmnpDku6PnoIHlhoXnva7lj5jph4/jgJEnICsgJzxicj4mbmJzcDsmbmJzcDsmbmJzcDtpbnB1dDog6KeG6aKR6ZO+5o6lJyArICc8L2ZvbnQ+JyxcXG4gICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcbiAgICB9KVxcbiAgICBtb2RlRWRpdFBhZ2UoZCwgXFxcImFuYWx5c2lzQ29uZmlnc1xcXCIsIHtcXG4gICAgICAgIGtleTogXFxcImlucHV0X25hbWVcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeWQjeensFxcXCIsXFxuICAgICAgICAvLyB0eXBlOiAnaW5wdXQnXFxuICAgICAgICBkYXRhOiB7XFxuICAgICAgICAgICAgY29uZmlnOiB7XFxuICAgICAgICAgICAgICAgIGtleTogXFxcImlucHV0X2NvZGVcXFwiLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl6Kej5p6Q5Luj56CBXFxcIixcXG4gICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAga2V5OiAnaW5wdXRfZXh0cmEnLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAn6K+36L6T5YWlZXh0cmHlsZ7mgKflgLwnLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBzZXR0aW5nOiB7XFxuICAgICAgICAgICAgICAgIGtleTogXFxcImlucHV0X3NldHRpbmdfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXorr7nva7pobXpnaLku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5cXG5sZXQgZCA9IFtdO1xcbmxldCB2aWV3ID0gZ2V0UGFyYW0oXFxcInZpZXdcXFwiLFxcXCJcXFwiKTtcXG5pZih2aWV3PT1cXFwiYW5hbHlzaXNNb2RlRWRpdFBhZ2VcXFwiKXtcXG4gICAgc2V0UGFnZVRpdGxlKFxcXCLoh6rlrprkuYnop6PmnpDnvJbovpFcXFwiKVxcbiAgICBhbmFseXNpc01vZGVFZGl0UGFnZShkKTtcXG59ZWxzZSBpZih2aWV3PT1cXFwiZGV0YWlsVmlld01vZGVFZGl0UGFnZVxcXCIpe1xcbiAgICBzZXRQYWdlVGl0bGUoXFxcIuiHquWumuS5ieivpuaDhemhtee8lui+kVxcXCIpXFxuICAgIGRldGFpbFZpZXdNb2RlRWRpdFBhZ2UoZCk7XFxufWVsc2UgaWYodmlldz09XFxcImhvbWVQYWdlTW9kZ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CdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXCJwbGF5bGlzdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IFxcXCJjb2xsZWN0aW9uXFxcIiB8fCB0eXBlID09IFxcXCJjaGFydFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YmplY3RDb2xsZWN0aW9uTGlzdChNWV9QQUdFLCA1MCwgaWQpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgZS50YXJnZXRfdHlwZSwgZS5pZCksXFxyXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGUuY292ZXJfdXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmNvdmVyX3VybFxcclxcbiAgICAgICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9IGVsc2UgaWYgKGRhdGEudGFyZ2V0X3R5cGUgPT0gJ2NoYXJ0Jykge1xcclxcbiAgICAgICAgICAgIGxldCBlID0gZGF0YS50YXJnZXQ7XFxyXFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBlLnRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJylcXHJcXG4gICAgICAgICAgICAgICAgICAgIC5ydWxlKCh0eXBlLCBpZCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IFxcXCJjb2xsZWN0aW9uXFxcIiB8fCB0eXBlID09IFxcXCJjaGFydFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViamVjdENvbGxlY3Rpb25MaXN0KE1ZX1BBR0UsIDUwLCBpZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgZGF0YS50YXJnZXRfdHlwZSwgZS5pZCksXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXJfdXJsXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnRhcmdldF90eXBlLFxcclxcbiAgICAgICAgICAgICAgICBpZCA9IGRhdGEudGFyZ2V0LmlkLFxcclxcbiAgICAgICAgICAgICAgICB0aXRsZSA9IGRhdGEudGFyZ2V0LnRpdGxlO1xcclxcbiAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZClcXHJcXG4gICAgICAgICAgICAgICAgICAgIC5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgaW1nOiBkYXRhLnRhcmdldC5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGRhdGEudGFyZ2V0LmNvdmVyX3VybCxcXHJcXG4gICAgICAgICAgICAgICAgZGVzYzogZGF0YS50eXBlX25hbWUsXFxyXFxuICAgICAgICAgICAgIC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UgKyAnKCcgKyBlLmNlcmVtb255LnllYXIgKyAnKScpLmJpZygpLmJvbGQoKSArICc8c21hbGw+KDxhIGhyZWY9XFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5I0BydWxlPWpzOmV2YWwoSlNPTi5wYXJzZShmZXRjaChgaGlrZXI6Ly9wYWdlL21haW5gKSkucnVsZSk7YXdhcmRWaWV3KGAnICsgZS5jZXJlbW9ueS5pZCArICdgLGAnICsgZS5jZXJlbW9ueS50aXRsZSArICdgKTtcXFwiPuafpeeci+ivpuaDhTwvYT4pPC9zbWFsbD4nICsgJzxici8+JztcXHJcXG4gICAgICAgIGUuY2F0ZWdvcmllcy5mb3JFYWNoKGl0ZW0gPT4ge1xcclxcbiAgICAgICAgICAgIHIyICs9IChpdGVtLmNhdGVnb3J5LnRpdGxlICsgKGl0ZW0uaXNfd29uID8gJycgOiAnKOaPkOWQjSknKSArICcmbmJzcDsnKS5mb250Y29sb3IoXFxcImdyZXlcXFwiKTtcXHJcXG4gICAgICAgICAgICByMiArPSBpdGVtLmNlbGVicml0aWVzLm1hcChjZWxlYnJpdHkgPT4gY2VsZWJyaXR5Lm5hbWUpLmpvaW4oJyZuYnNwOy8mbmJzcDsnKTtcXHJcXG4gICAgICAgICAgICByMiArPSAnPGJyLz4nO1xcclxcbiAgICAgICAgfSlcXHJcXG4gICAgICAgIHIyICs9ICc8YnIvPic7XFxyXFxuICAgIH0pXFxyXFxuXFxyXFxuICAgIGlmIChwYWdlID09IDEpIHtcXHJcXG4gICAgICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgICAgIGRhdGE6IFt7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiByICsgcjIsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgICAgIH1dXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9IGVsc2UgaWYocy5hd2FyZHMubGVuZ3RoID09IDApe1xcclxcbiAgICAgICAgc2V0UmVzdWx0KFtdKTtcXHJcXG4gICAgfSBlbHNle1xcclxcbiAgICAgICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICAgICAgZGF0YTogW3tcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIyLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgICAgICB9XVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcbn1cXHJcXG5cXHJcXG4vL+WllumhueivpuaDhemhtemdolxcclxcbmZ1bmN0aW9uIGF3YXJkVmlldyhpZCwgbmFtZSkge1xcclxcbiAgICBzZXRQYWdlVGl0bGUobmFtZSk7XFxyXFxuICAgIGxldCBzID0gZ2V0RG91YmFuUmVzKFxcXCJodHRwczovL2Zyb2RvLmRvdWJhbi5jb20vYXBpL3YyL2NlcmVtb255L1xcXCIgKyBpZCk7XFxyXFxuICAgIGxldCBhID0gW107XFxyXFxuICAgIGEucHVzaCh7XFxyXFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAocy50aXRsZSArICcoJyArIHMueWVhciArICcpJykuYmlnKCkuYm9sZCgpLFxcclxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcclxcbiAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSlcXHJcXG4gICAgcy5wbGF5bGlzdHMuZm9yRWFjaChlID0+IHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgZGVzYzogJ+WFsScgKyBlLml0ZW1zX2NvdW50ICsgJ+mDqCcsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArICdAUmVmZXJlcj0nICsgZS5jb3Zlcl91cmwsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMnKS5ydWxlKChpZCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQpO1xcclxcbiAgICAgICAgICAgIH0sIGUuaWQpXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgciA9ICcnO1xcclxcbiAgICBzLnByaXplcy5mb3JFYWNoKGUgPT4ge1xcclxcbiAgICAgICAgciArPSAnPGg0PuiOt+WlluWQjeWNlSgnICsgZS50aXRsZSArICcpPC9oND4nO1xcclxcbiAgICAgICAgZS5jYXRlZ29yaWVzLmZvckVhY2godCA9PiB7XFxyXFxuICAgICAgICAgICAgciArPSAodC50aXRsZSArICcmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsnKS5mb250Y29sb3IoXFxcImdyZXlcXFwiKS5ib2xkKCk7XFxyXFxuICAgICAgICAgICAgciArPSB0LnJlc3VsdHMubWFwKGl0ZW0gPT4gISFpdGVtLmluZm8gPyBpdGVtLmluZm8gKyAoJyZuYnNwOy0mbmJzcDsnICsgaXRlbS50aXRsZSArICcmbmJzcDsmbmJzcDsnKS5mb250Y29sb3IoXFxcImdyZXlcXFwiKSA6IGl0ZW0udGl0bGUpLmpvaW4oJyZuYnNwOy8mbmJzcDsnKS5ib2xkKCk7XFxyXFxuICAgICAgICAgICAgciArPSAnPGJyLz4nO1xcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfSlcXHJcXG4gICAgYS5wdXNoKHtcXHJcXG4gICAgICAgIHRpdGxlOiByLFxcclxcbiAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxyXFxuICAgIH0pXFxyXFxuXFxyXFxuICAgIGxldCBpID0gW107XFxyXFxuICAgIHMuY2VyZW1vbmllcy5mb3JFYWNoKGUgPT4ge1xcclxcbiAgICAgICAgaS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogZS50aXRsZSxcXHJcXG4gICAgICAgICAgICBkZXNjOiBlLnllYXIgKyAn5bm0JyxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcclxcbiAgICAgICAgICAgIGltZzogZS5waWMubm9ybWFsICsgJ0BSZWZlcmVyPScgKyBlLnBpYy5ub3JtYWwsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMnKS5ydWxlKChpZCwgbmFtZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGF3YXJkVmlldyhpZCwgbmFtZSk7XFxyXFxuICAgICAgICAgICAgfSwgZS5pZCwgZS50aXRsZSlcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0pXFxyXFxuICAgIGlmIChpLmxlbmd0aCA+IDApIHtcXHJcXG4gICAgICAgIGkudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+WOhuWxiuWbnumhvicuYmlnKCkuYm9sZCgpLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXHJcXG4gICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIHNldFJlc3VsdChhLmNvbmNhdChpKSk7XFxyXFxufVxcclxcblxcclxcbi8v5Ymn54Wn6aG16Z2iXFxyXFxuZnVuY3Rpb24gc3RpbGxzTGlzdCh0eXBlLCBpZCkge1xcclxcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICdjbGVhck15VmFyKFxcXCJwaG90b1xcXCIpJyk7XFxyXFxuICAgIGxldCBwYWdlID0gTVlfUEFHRTtcXHJcXG4gICAgbGV0IGl0ZW1zID0ge1xcclxcbiAgICAgICAg5Ymn54WnOiAncGhvdG9zJyxcXHJcXG4gICAgICAgIOa1t+aKpTogJ2NvdmVycydcXHJcXG4gICAgfTtcXHJcXG4gICAgbGV0IGEgPSBbXTtcXHJcXG4gICAgbGV0IHRlbXAgPSBnZXRNeVZhcigncGhvdG8nLCAncGhvdG9zJyk7XFxyXFxuICAgIGxldCBjb2xvciA9IGdldENvbmZpZygnY2hvb3NlQ29sb3InKTtcXHJcXG4gICAgZm9yIChsZXQgaSBpbiBpdGVtcykge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcCA9PSBpdGVtc1tpXSA/ICfigJzigJzigJ3igJ0nICsgaS5mb250Y29sb3IoY29sb3IpIDogaSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eScpLmxhenlSdWxlKCh0KSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdwaG90bycsIHQpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcclxcbiAgICAgICAgICAgIH0sIGl0ZW1zW2ldKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBsZXQgciA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkICs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cIiArIHIubiArIFxcXCLlvKAmbmJzcDvnsonkuJ3lm77niYfvvJpcXFwiICsgci5mICsgXFxcIuW8oDwvZm9udD48L3NtYWxsPlxcXCIsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPGJpZz7lhbE8c3Ryb25nPiBcXFwiICsgci50b3RhbCArIFxcXCI8L3N0cm9uZz7lvKDmtbfmiqU8L2JpZz5cXFwiLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgbCA9IGEuY29uY2F0KGwpO1xcclxcbiAgICB9XFxyXFxuICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgZGF0YTogbFxcclxcbiAgICB9KVxcclxcbn1cXHJcXG5cXHJcXG4vL+a8lOiBjOS6uuWRmOmhtemdolxcclxcbmZ1bmN0aW9uIGNyZWRpdHModHlwZSwgaWQpIHtcXHJcXG4gICAgbGV0IGkgPSBnZXREb3ViYW5SZXMoXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvXFxcIiArIHR5cGUgKyBcXFwiL1xcXCIgKyBpZCArIFxcXCIvY3JlZGl0c1xcXCIpO1xcclxcbiAgICBsZXQgciA9IFtdO1xcclxcbiAgICBpLmNyZWRpdHMuZm9yRWFjaCgoZSA9PiB7XFxyXFxuICAgICAgICByLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBlLnRpdGxlLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgfSk7XF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TtcXHJcXG4gICAgbGV0IGwgPSBbXTtcXHJcXG4gICAgbGV0IHN0YXJDb2xvciA9IGdldENvbmZpZygnc3RhckNvbG9yJyk7XFxyXFxuICAgIHIucmV2aWV3cy5mb3JFYWNoKChlID0+IHtcXHJcXG4gICAgICAgIGxldCB0ID0gXFxcIlxcXCI7XFxyXFxuICAgICAgICBpZiAoZS5yYXRpbmcpIHtcXHJcXG4gICAgICAgICAgICB0ID0gY29tcHV0ZVJhdGluZyhlLnJhdGluZy5tYXgsIGUucmF0aW5nLnZhbHVlKTtcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIGxldCBpID0gZS5jb21tZW50c19jb3VudCA/IGUuY29tbWVudHNfY291bnQgKyBcXFwi5Zue5aSNXFxcIiA6IFxcXCJcXFwiLFxcclxcbiAgICAgICAgICAgIHIgPSBlLnVzZWZ1bF9jb3VudCA/IGUudXNlZnVsX2NvdW50ICsgXFxcIuacieeUqFxcXCIgOiBcXFwiXFxcIixcXHJcXG4gICAgICAgICAgICBvID0gZS5yZXNoYXJlc19jb3VudCA/IGUucmVzaGFyZXNfY291bnQgKyBcXFwi6L2s5Y+RXFxcIiA6IFxcXCJcXFwiO1xcclxcblxcclxcbiAgICAgICAgciA9IGkgJiYgciA/IFxcXCLigKJcXFwiICsgciA6IHI7XFxyXFxuICAgICAgICBvID0gKGkgfHwgcikgJiYgbyA/IFxcXCLigKJcXFwiICsgbyA6IG87XFxyXFxuICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBlLnVzZXIubmFtZSxcXHJcXG4gICAgICAgICAgICBpbWc6IGUudXNlci5hdmF0YXIsXFxyXFxuICAgICAgICAgICAgdXJsOiBlLnVzZXIudXJsLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8c3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mVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgaW1nOiBlLnN1YmplY3QuY292ZXIubm9ybWFsLnVybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6IHJhdGluZyxcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIC8qYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogJ+afpeeci+abtOWkmicsXFxyXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9qb2tlci10eC5jb2RpbmcubmV0L3AvaGlrZXJpbWcvZC9oaWtlci9naXQvcmF3L21hc3Rlci9pbWcvbW9yZV92ZXIucG5nP2Rvd25sb2F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A9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgZWxlc3NhclBob3RvcyhwaWQpO1xcclxcbiAgICAgICAgICAgIH0sIHBpZCksXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfSlcXHJcXG5cXHJcXG4gICAgICAgIGxldCBwbGVuZ3RoID0gZTMucGhvdG9zLmxlbmd0aCA8PSAyID8gZTMucGhvdG9zLmxlbmd0aCA6IDI7XFxyXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHBsZW5ndGg7IGkrKykge1xcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIC8vdGl0bGU6IGUzLnBob3Rvc1swXS5kZXNjcmlwdGlvbixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdjYXJkX3BpY18yJyxcXHJcXG4gICAgICAgICAgICAgICAgZGVzYzogJzAnLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUzLnBob3Rvc1tpXS5pbWFnZS5ub3JtYWwudXJsICsgJ0BSZWZlcmVyPScgKyBlMy5waG90b3NbaV0uaW1hZ2Uubm9ybWFsLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiBlMy5waG90b3NbaV0uaW1hZ2Uubm9ybWFsLnVybCArICdAUmVmZXJlcj0nICsgZTMucGhvdG9zW2ldLmltYWdlLm5vcm1hbC51cmxcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcblxcclxcbiAgICAgICAgLyphLnB1c2goe1xcclxcbiAgICAgICAgICAgIC8vdGl0bGU6ICfmn6XnnIvmm7TlpJonLFxcclxcbiAgICAgIC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mZpZ3MnKTtcXHJcXG4gICAgaS5hd2FyZHMuZm9yRWFjaCh0ID0+IHtcXHJcXG4gICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6ICh0LnllYXIrXFxcIlxcXCIpLmJvbGQoKS5iaWcoKSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXHJcXG4gICAgICAgIH0pXFxyXFxuXFxyXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHQubW9kdWxlcy5sZW5ndGg7IGkrKykge1xcclxcbiAgICAgICAgICAgIGxldCBlID0gdC5tb2R1bGVzW2ldO1xcclxcbiAgICAgICAgICAgIGlmICghZS5jZXJlbW9ueSB8fCAhZS5jYXRlZ29yeSkge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgcmF0aW5nID0gXFxcIlxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGlmIChlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJhdGluZyA9IGNvbXB1dGVSYXRpbmcoZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLm1heCwgZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLnZhbHVlKSArIFxcXCIgXFxcIiArIGUuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZy52YWx1ZSArIFxcXCLliIZcXFwiO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZS5zdWJ0eXBlLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBlLmlkLFxcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBlLnRpdGxlO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcclxcbiAgICAgICAgICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXCJwbGF5bGlzdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZS5jb3Zlci5ub3JtYWwudXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmNvdmVyLm5vcm1hbC51cmwsXFxyXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiByYXRpbmcgKyAnXFxcXG4nICsgZS5leHRyYS5zaG9ydF9pbmZvLFxcclxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYVxcclxcbiAgICAgICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZS5jZXJlbW9ueS50aXRsZS5ib2xkKCkgKyAnPHNtYWxsPig8YSBocmVmPVxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSNAcnVsZT1qczpldmFsKEpTT04ucGFyc2UoZmV0Y2goYGhpa2VyOi8vcGFnZS9tYWluYCkpLnJ1bGUpO2F3YXJkVmlldyhgJyArIGUuY2VyZW1vbnkuaWQgKyAnYCxgJyArIGUuY2VyZW1vbnkudGl0bGUgKyAnYCk7XFxcIj7mn6XnnIvor6bmg4U8L2E+KTwvc21hbGw+JyArICc8YnIvPicgKyAoZS5jYXRlZ29yeS50aXRsZSArIChlLmlzX3dvbiA/ICcnIDogJyjmj5DlkI0pJykpLnNtYWxsKCksXFxyXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXHJcXG4gICAgICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9XFxyXFxuICAgIH0pXFxyXFxuXFxyXFxuICAgIGlmIChNWV9QQUdFID09IDEpIHtcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAg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F5bGlzdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlICsgeWVhcixcXHJcXG4gICAgICAgICAgICBpbWc6IGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLnN1YmplY3QuY292ZXIubm9ybWFsLnVybCxcXHJcXG4gICAgICAgICAgICBkZXNjOiBlLnJvbGVzLmpvaW4oXFxcIuKAolxcXCIpICsgXFxcIlxcXFxuXFxcIiArIHJhdGluZyArICdcXFxcbicgKyBlLnN1YmplY3QuZXh0cmEuc2hvcnRfaW5mbyxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJyxcXHJcXG4gICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfSkpXFxyXFxuXFxyXFxuICAgIGlmIChNWV9QQUdFID09IDEpIHtcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwiPGJpZz7lhbE8c3Ryb25nPiBcXFw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T0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmEsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zJyxcXHJcXG4gICAgICAgICAgICBpbWc6IGUucGljID8gZS5waWMubm9ybWFsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLnBpYy5ub3JtYWwgOiBlLmNvdmVyLnVybCArICdAUmVmZXJlcj0nICsgZS5jb3Zlci51cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogZS5udWxsX3JhdGluZ19yZWFzb24gfHwgZS5yYXRpbmcudmFsdWVcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSkpO1xcclxcblxcclxcbiAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgIGRhdGE6IGlcXHJcXG4gICAgfSlcXHJcXG59XFxyXFxuXFxyXFxuLy/lvbHniYfor6bmg4XpobXpnaJcXHJcXG5mdW5jdGlvbiBkZXRhaWxzVmlldyh0eXBlLCBpZCkge1xcclxcbiAgICBsZXQgaSA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkKTtcXHJ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gIH0pXFxyXFxuICAgICAgICAgICAgLypxdWlja1NlYXJjaEl0ZW1zLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxyXFxuICAgICAgICAgICAgfSkqL1xcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgZGF0YTogaW5mb0l0ZW1zLmNvbmNhdChyYXRpbmdJdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHJlbGF0ZWRJdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdChxdWlja1NlYXJjaEl0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHZpZGVvSXRlbXMpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQodmlkZW9SZWxhdGVkSXRlbXMpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoaW50cm9JdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJyxcXHJcXG4gICAgICAgICAgICAgICAgZXh0cmE6e1xcclxcbiAgICAgICAgICAgICAgICAgIGlkOiAncmVjb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XHJcXG4gICAgICAgICAgICBsZXQgcmVzID0gZ2V0RG91YmFuUmVzKG9iai51cmwpO1xcclxcbiAgICAgICAgICAgIFxcclxcbiAgICAgICAgICAgIGxldCBkZXRhaWxzVmlld0NvbmZpZ3MgPSBnZXRDb25maWcoJ2RldGFpbHNWaWV3Q29uZmlncycpO1xcclxcbiAgICAgICAgICAgIGxldCBsID0gW3Jlc1swXSxyZXNbMV0scmVzWzJdXTtcXHJcXG4gICAgICAgICAgICBsZXQgaSA9IGwubWFwKChlID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBlLnR5cGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICBpZCA9IGUuaWQsXFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZS5waWMgPyBlLnBpYy5ub3JtYWwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUucGljLm5vcm1hbCA6IGUuY292ZXIudXJsICsgJ0BSZWZlcmVyPScgKyBlLmNvdmVyLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGUubnVsbF9yYXRpbmdfcmVhc29uIHx8IGUucmF0aW5nLnZhbHVlXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KSk7XFxyXFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCdyZWNvbW1lbmRhdGlvbnMnLCBpWzJdKTtcXHJcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIGlbMV0pO1xcclxcbiAgICAgICAgICAgIGFkZEl0Z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gICAgICBsZXQgYmFzZVVybCA9IGUudHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIiA/ICdoaWtlcjovL2VtcHR5LyRwYWdle2Z5cGFnZX0nIDogJ2hpa2VyOi8vZW1wdHkjaW1tZXJzaXZlVGhlbWUjJztcXHJcXG4gICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcclxcbiAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXHJcXG4gICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoYmFzZVVybCArIFxcXCIjbm9IaXN0b3J5I1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJc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0aWMnLFxcclxcbiAgICAgICAgICAgIOeDreaSreasp+e+juWJpzogJ3R2X2FtZXJpY2FuJyxcXHJcXG4gICAgICAgICAgICDng63mkq3ml6Xliac6ICd0dl9qYXBhbmVzZScsXFxyXFxuICAgICAgICAgICAg54Ot5pKt6Z+p5YmnOiAndHZfa29yZWFuJyxcXHJcXG4gICAgICAgICAgICDng63mkq3liqjnlLs6ICd0dl9hbmltYXRpb24nXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAg57u86Im6OiB7XFxyXFxuICAgICAgICAgICAg54Ot5pKt57u86Im6OiAnc2hvd19ob3QnLFxcclxcbiAgICAgICAgICAgIOWbveWGhee7vOiJujogJ3Nob3dfZG9tZXN0aWMnLFxcclxcbiAgICAgICAgICAgIOWbveWklue7vOiJujogJ3Nob3dfZm9yZWlnbidcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCBpIGluIGl0ZW1zKSB7XFxyXFxuICAgICAgICBmb3IgKGxldCBqIGluIGl0ZW1zW2ldKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuaXRlbSA9PSBpdGVtc1tpXVtqXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaiArICcgPC9mb250PjwvYj4nIDogaixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdob3RMaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGVtcC5pdGVtID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdob3RMaXN0JywgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgfSwgaXRlbXNbaV1bal0pXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgbGV0IHNvcnQgPSB7XFxyXFxuICAgICAgICDng63luqbmjpLluo86ICdyZWNvbW1lbmQnLFxcclxcbiAgICAgICAg5pe26Ze05o6S5bqPOiAndGltZScsXFxyXFxuICAgICAgICDor4TliIbmjpLluo86ICdyYW5rJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gc29ydCkge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5zb3J0ID09IHNvcnRbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOiAvL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2hvdExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAuc29ydCA9IGU7XFxyXFxuICAgICAgICAgICA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1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUgKyBcXFwi77yIXFxcIiArIGUueWVhciArIFxcXCLvvIlcXFwiLFxcclxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgIGltZzogZS5waWMgPyBlLnBpYy5ub3JtYWwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUucGljLm5vcm1hbCA6IGUuY292ZXIudXJsICsgJ0BSZWZlcmVyPScgKyBlLmNvdmVyLnVybCxcXHJcXG4gICAgICAgICAgICBkZXNjOiAoZS50YWdzID8gZS50YWdzLm1hcCgoZSA9PiBlLm5hbWUpKS5qb2luKFxcXCIsXFxcIikgOiBlLmNhcmRfc3VidGl0bGUpICsgXFxcIlxcXFxuXFxcIiArIChlLnJhdGluZyA/IGNvbXB1dGVSYXRpbmcoZS5yYXRpbmcubWF4LCBlLnJhdGluZy52YWx1ZSkgKyBcXFwiIFxcXCIgKyBlLnJhdGluZy52YWx1ZS50b0ZpeGVkKDEpICsgXFxcIuWIhlxcXCIgOiBcXFwi5pqC5peg6K+E5YiGXFxcIilcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSkpO1xcclxcblxcclxcbiAgICByZXR1cm4gcGFnZSA+IDEgPyBpIDogYS5jb25jYXQoaSk7XFxyXFxufVxcclxcblxcclxcbi8v5YiG57G7XFxy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oJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0ZXh0LGl0ZW0pID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wW2l0ZW1dID0gdGV4dC5pbmRleE9mKFxcXCLlhajpg6hcXFwiKSAhPSAtMSA/IFxcXCJcXFwiIDogdGV4dDtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY2xhc3NsaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgaXRlbXNbaXRlbV1baV0sIGl0ZW0pO1xcclxcbiAgICAgICAgICAgIFxcclxcbiAgICAgICAgICAgIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXCLoh6rlrprkuYnlubTku71cXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgaWYodGVtcC55ZWFyID09IFxcXCLoh6rlrprkuYnlubTku71cXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieW5tOS7vTonICsgdGVtcC5jdXN0b21ZZWFyICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21ZZWFyLCAn55u05o6l6L6T5YWl5YW35L2T5bm05Lu9LOS+i+WmgjIwMDAnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA9PSA0KXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbVllYXIgPSBpbnB1dDtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnllYXIgPSBcXFwi6Ieq5a6a5LmJ5bm05Lu9XFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY2xhc3NsaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgfSk7XFxyXFxuICAgICAgICAgICAgfWVsc2UgaWYoaXRlbXNbaXRlbV1baV0gPT0gXFxcIuiHquWumuS5ieWcsOWMulxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICBpZih0ZW1wLmxvY2FsID09IFxcXCLoh6rlrprkuYnlnLDljLpcXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieWcsOWMujonICsgdGVtcC5jdXN0b21Mb2NhbCArICcgPC9mb250PjwvYj4nO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIFxcclxcbiAgICAgICAgICAgICAgICB1cmwgPSAkKHRlbXAuY3VzdG9tTG9jYWwsICfnm7TmjqXovpPlhaXlhbfkvZPlnLDljLos5L6L5aaC5Lit5Zu95aSn6ZmGJykuaW5wdXQoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbUxvY2FsID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5sb2NhbCA9IFxcXCLoh6rlrprkuYnlnLDljLpcXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9ZWxzZSBpZihpdGVtc1tpdGVtXVtpXSA9PSBcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcIil7XFxyXFxuICAgICAgICAgICAgICAgIGlmKHRlbXAudHlwZSA9PSBcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcIil7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnnsbvlnos6JyArIHRlbXAuY3VzdG9tVHlwZSArICcgPC9mb250PjwvYj4nO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIFxcclxcbiAgICAgICAgICAgICAgICB1cmwgPSAkKHRlbXAuY3VzdG9tVHlwZSwgJ+ebtOaOpei+k+WFpeWFt+S9k+exu+WeiyzkvovlpoLliafmg4UnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA+IDApe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tVHlwZSA9IGlucHV0O1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAudHlwZSA9IFxcXCLoh6rlrprkuYnnsbvlnotcXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9ZWxzZSBpZihpdGVtc1tpdGVtXVtpXSA9PSBcXFwi6Ieq5a6a5LmJ5qCH562+XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgIGlmKHRlbXAuY2xhc3MgPT0gXFxcIuiHquWumuS5ieagh+etvlxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5qCH562+OicgKyB0ZW1wLmN1c3RvbUNsYXNzICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21DbGFzcywgJ+ebtOaOpei+k+WFpeWFt+S9k+agh+etvizkvovlpoLnu4/lhbhcXFxcbuWPr+WGmeWkmuS4quagh+etvizkvb/nlKhcXFwi6Iux5paH6YCX5Y+3XFxcIuWIhumalCcpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID4gMCl7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21DbGFzcyA9IGlucHV0O1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY2xhc3MgPSBcXFwi6Ieq5a6a5LmJ5qCH562+XFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY2xhc3NsaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgfSk7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmxcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBsZXQgcmFuayA9IHtcXHJcXG4gICAgICAgIOm7mOiupOaOkuW6jzogXFxcIlVcXFwiLFxcclxcbiAgICAgICAg54Ot5bqmOiBcXFwiVFxcXCIsXFxyXFxuICAgICAgICDor4TliIY6IFxcXCJTXFxcIixcXHJcXG4gICAgICAgIOaXtumXtDogXFxcIlJcXFwiXFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgciBpbiByYW5rKSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0ZW1wLnJhbmsgPT09IHJhbmtbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOiAvL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZ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4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zJyxcXHJcXG4gICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXHJcXG4gICAgICAgICAgICBpbWc6IGUuY292ZXJfdXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmNvdmVyX3VybCxcXHJcXG4gICAgICAgICAgICBkZXNjOiBlLm51bGxfcmF0aW5nX3JlYXNvbiB8fCBlLnJhdGluZy52YWx1ZVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9KSk7XFxyXFxuXFxyXFxuICAgIHJldHVybiBwYWdlID4gMSA/IGkgOiBhLmNvbmNhdChpKTtcXHJcXG59XFxyXFxuXFxyXFxuLy/niYfljZVcXHJcXG5mdW5jdGlvbiBwbGF5TGlzdChwYWdlLCBjb3VudCkge1xcclxcbiAgICBpZiAoIWdldE15VmFyKCdwbGF5bGlzdCcpKSBwdXRNeVZhcigncGxheWxpc3QnLCAne1xcXCJzdWJ0eXBlXFxcIjpcXFwiXFxcIixcXFwidHlwZVxcXCI6XFxcImFsbFxcXCJ9Jyk7XFxyXFxuICAgIGxldCBhID0gW107XFxyXFxuICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncGxheWxpc3QnLCAne1xcXCJzdWJ0eXBlXFxcIjpcXFwiXFxcIixcXFwidHlwZVxcXCI6XFxcImFsbFxcXCJ9JykpO1xcclxcbiAgICBsZXQgY29sb3IgPSBnZXRDb25maWcoJ2Nob29zZUNvbG9yJyk7XFxyXFxuXFxyXFxuICAgIGxldCBpdGVtcyA9IHtcXHJcXG4gICAgICAgIHR5cGU6IHtcXHJcXG4gICAgICAgICAgICDlhajpg6g6IFxcXCJhbGxcXFwiLFxcclxcbiAgICAgICAgICAgIOixhueTo+eJh+WNlTogXFxcIm9mZmljaWFsXFxcIixcXHJcXG4gICAgICAgICAgICDnsr7pgIk6IFxcXCJzZWxlY3RlZFxcXCIsXFxyXFxuICAgICAgICAgICAg57uP5YW4OiBcXFwiY2xhc3NpY2FsXFxcIixcXHJcXG4gICAgICAgICAgICDojrflpZY6IFxcXCJwcml6ZVxcXCIsXFxyXFxuICAgICAgICAgICAg6auY5YiGOiBcXFwiaGlnaF9zY29yZVxcXCIsXFxyXFxuICAgICAgICAgICAg5qac5Y2VOiBcXFwibW92aWVfbGlzdFxcXCIsXFxyXFxuICAgICAgICAgICAg5Ya36Zeo5L2z54mHOiBcXFwiZGFya19ob3JzZVxcXCIsXFxyXFxuICAgICAgICAgICAg5Li76aKYOiBcXFwidG9waWNcXFwiLFxcclxcbiAgICAgICAgICAgIOWvvOa8lDogXFxcImRpcmVjdG9yXFxcIixcXHJcXG4gICAgICAgICAgICDmvJTlkZg6IFxcXCJhY3RvclxcXCIsXFxyXFxuICAgICAgICAgICAg57O75YiXOiBcXFwic2VyaWVzXFxcIixcXHJcXG4gICAgICAgICAgICDljY7or606IFxcXCJjaGluZXNlXFxcIixcXHJcXG4gICAgICAgICAgICDmrKfnvo46IFxcXCJ3ZXN0ZXJuXFxcIixcXHJcXG4gICAgICAgICAgICDml6XmnKw6IFxcXCJqYXBhbmVzZVxcXCIsXFxyXFxuICAgICAgICAgICAg6Z+p5Zu9OiBcXFwia29yZWFcXFwiLFxcclxcbiAgICAgICAgICAgIOWWnOWJpzogXFxcImNvbWVkeVxcXCIsXFxyXFxuICAgICAgICAgICAg5Yqo5L2cOiBcXFwiYWN0aW9uXFxcIixcXHJcXG4gICAgICAgICAgICDniLHmg4U6IFxcXCJsb3ZlXFxcIixcXHJcXG4gICAgICAgICAgICDnp5Hlubs6IFxcXCJzY2llbmNlX2ZpY3Rpb25cXFwiLFxcclxcbiAgICAgICAgICAgIOWKqOeUuzogXFxcImNhcnRvb25cXFwiLFxcclxcbiAgICAgICAgICAgIOaCrOeWkTogXFxcIm15c3RlcnlcXFwiLFxcclxcbiAgICAgICAgICAgIOaDiuaCmjogXFxcInBhbmljXFxcIixcXHJcXG4gICAgICAgICAgICDmgZDmgJY6IFxcXCJob3JyaWJsZVxcXCIsXFxyXFxuICAgICAgICAgICAg54qv572qOiBcXFwiY3JpbWluYWxcXFwiLFxcclxcbiAgICAgICAgICAgIOWQjOaApzogXFxcImxnYnRcXFwiLFxcclxcbiAgICAgICAgICAgIOaImOS6iTogXFxcIndhclxcXCIsXFxyXFxuICAgICAgICAgICAg5aWH5bm7OiBcXFwiZmFudGFzeVxcXCIsXFxyXFxuICAgICAgICAgICAgXFxcIlxcXFx1NjBjNVxcXFx1ODI3MlxcXCI6IFxcXCJlcm90aWNhXFxcIixcXHJcXG4gICAgICAgICAgICDpn7PkuZA6IFxcXCJtdXNpY1xcXCIsXFxyXFxuICAgICAgICAgICAg57qq5b2V54mHOiBcXFwiZG9jdW1lbnRhcnlcXFwiLFxcclxcbiAgICAgICAgICAgIOayu+aEiDogXFxcImN1cmVcXFwiLFxcclxcbiAgICAgICAgICAgIOiJuuacrzogXFxcImFydFxcXCIsXFxyXFxuICAgICAgICAgICAg6buR6Imy5bm96buYOiBcXFwiZGFya19odW1vclxcXCIsXFxyXFxuICAgICAgICAgICAg6Z2S5pilOiBcXFwieW91dGhcXFwiLFxcclxcbiAgICAgICAgICAgIOWls+aApzogXFxcImZlbWFsZVxcXCIsXFxyXFxuICAgICAgICAgICAg55yf5a6e5LqL5Lu25pS557yWOiBcXFwicmVhbF9ldmVudFxcXCIsXFxyXFxuICAgICAgICAgICAg5pq05YqbOiBcXFwidmlvbGVuY2VcXFwiLFxcclxcbiAgICAgICAgICAgIOm7keeZvTogXFxcImJsYWNrX3doaXRlXFxcIixcXHJcXG4gICAgICAgICAgICDnvo7po586IFxcXCJmb29kXFxcIixcXHJcXG4gICAgICAgICAgICDml4XooYw6IFxcXCJ0cmF2ZWxcXFwiLFxcclxcbiAgICAgICAgICAgIOWEv+erpTogXFxcImNoaWxkXFxcIixcXHJcXG4gICAgICAgICAgICDkurrmgKc6IFxcXCJodW1hbml0eVxcXCIsXFxyXFxuICAgICAgICAgICAg5a625bqtOiBcXFwiZmFtaWx5XFxcIixcXHJcXG4gICAgICAgICAgICDmlofoibo6IFxcXCJsaXRlcmFyeV9hcnRcXFwiLFxcclxcbiAgICAgICAgICAgIOWwj+ivtOaUuee8ljogXFxcIm5vdmVsXFxcIixcXHJcXG4gICAgICAgICAgICDmhJ/kuro6IFxcXCJtb3ZpbmdcXFwiLFxcclxcbiAgICAgICAgICAgIOWKseW/lzogXFxcImluc3BpcmF0aW9uXFxcIlxcclxcbiAgICAgICAgfSxcXHJcXG4gICAgICAgIHN1YnR5cGU6IHtcXHJcXG4gICAgICAgICAgICDlhajpg6g6IFxcXCJcXFwiLFxcclxcbiAgICAgICAgICAgIOeUteW9sTogXFxcIm1vdmllXFxcIixcXHJcXG4gICAgICAgICAgICDnlLXop4bliac6IFxcXCJ0dlxcXCJcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCBpIGluIGl0ZW1zKSB7XFxyXFxuICAgICAgICBmb3IgKGxldCBqIGluIGl0ZW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ICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgc3ViamVjdENvbGxlY3Rpb25MaXN0KE1ZX1BBR0UsIDUwLCBpZCk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCBlLnR5cGUsIGUuaWQpLFxcclxcbiAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgIGRlc2M6IFxcXCLlhbFcXFwiICsgZS50b3RhbCArIFxcXCLpg6hcXFwiXFxyXFxuICAgICAgICB9KSkpO1xcclxcbiAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgaSA9IGwubWFwKChlID0+ICh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6ICcnIC8qJ+KAnOKAnOKAneKAnScgKyBlLm1lZGl1bV9uYW1lICsgJ1xcXFxuJyArIGdldFN0cm9uZ1RleHQoZS50aXRsZSkqLyAsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdjYXJkX3BpY18yJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJykucnVsZSgodHlwZSwgaWQsIHN0aXRsZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUoc3RpdGxlKTtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAg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4gICAgICAgICAgICB0aXRsZTogdGVtcC50eXBlID09PSBpdGVtc1tpXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaSArICcgPC9mb250PjwvYj4nIDogaSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjb21pbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAudHlwZSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjb21pbmdcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9LCBpdGVtc1tpXSlcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG4gICAgbGV0IHJhbmsgPSB7XFxyXFxuICAgICAgICDng63luqY6ICcmc29ydGJ5PWhvdCcsXFxyXFxuICAgICAgICDml7bpl7Q6ICcnXFxyXFxuICAgIH1cXHJcXG4gICAgYS5wdXNoKHtcXHJcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgIH0pXFxyXFxuICAgIGZvciAobGV0IGkgaW4gcmFuaykge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5yYW5rID09PSByYW5rW2ldID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBpICsgJyA8L2ZvbnQ+PC9iPicgOiBpLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NvbWluZycpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC5yYW5rID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNvbWluZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIHJhbmtbaV0pXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuICAgIGxldCBsb2NhbCA9IHtcXHJcXG4gICAgICAgIOWbveWGhTogJ2RvbWVzdGljJyxcXHJcXG4gICAgICAgIOWFqOeQgzogJ2ludGVybmF0aW9uYWwnXFxyXFxuICAgIH1cXHJcXG4gICAgaWYgKHRlbXAudHlwZSA9PSAnbW92aWUnKSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgZm9yIChsZXQgaSBpbiBsb2NhbCkge1xcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0ZW1wLmxvY2FsID09PSBsb2NhbFtpXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaSArICcgPC9mb250PjwvYj4nIDogaSxcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjb21pbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLmxvY2FsID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjb21pbmdcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBsb2NhbFtpXSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGxldCBhcmVhID0ge1xcclxcbiAgICAgICAg5YWo6YOoOiAnJyxcXHJcXG4gICAgICAgIOe+juWbvTogJyZhcmVhX2ZpbHRlcj1hbWVyaWNhbicsXFxyXFxuICAgICAgICDmrKfmtLI6ICcmYXJlYV9maWx0ZXI9ZXVyb3BlJyxcXHJcXG4gICAgICAgIOaXpeacrDogJyZhcmVhX2ZpbHRlcj1qYXBhbmVzZScsXFxyXFxuICAgICAgICDpn6nlm706ICcmYXJlYV9maWx0ZXI9a29yZWFuJ1xcclxcbiAgICB9XFxyXFxuICAgIGlmICh0ZW1wLnR5cGUgPT0gJ21vdmllJyAmJiB0ZW1wLmxvY2FsID09ICdpbnRlcm5hdGlvbmFsJykge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgICAgIGZvciAobGV0IGkgaW4gYXJlYSkge1xcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0ZW1wLmFyZWEgPT09IGFyZWFbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGVtcC5hcmVhID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjb21pbmdcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBhcmVhW2ldKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgIH1cXHJcXG4gICAgbGV0IGZpbHRlciA9IHtcXHJcXG4gICAgICAgIOWFqOmDqDogJycsXFxyXFxuICAgICAgICDlm73kuqfliac6ICcmdHlwZV9maWx0ZXI9dHZfZG9tZXN0aWMnLFxcclxcbiAgICAgICAg5qyn576O5YmnOiAnJnR5cGVfZmlsdGVyPXR2X2FtZXJpY2FuJyxcXHJcXG4gICAgICAgIOaXpeWJpzogJyZ0eXBlX2ZpbHRlcj10dl9qYXBhbmVzZScsXFxyXFxuICAgICAgICDpn6nliac6ICcmdHlwZV9maWx0ZXI9dHZfa29yZWFuJyxcXHJcXG4gICAgICAgIOWKqOeUuzogJyZ0eXBlX2ZpbHRlcj10dl9hbmltYXRpb24nLFxcclxcbiAgICAgICAg5Zu95YaF57u86Im6OiAnJnR5cGVfZmlsdGVyPXNob3dfZG9tZXN0aWMnLFxcclxcbiAgICAgICAg5Zu95aSW57u86Im6OiAnJnR5cGVfZmlsdGVyPXNob3dfZm9yZWlnbidcXHJcXG4gICAgfVxcclxcbiAgICBpZiAodGVtcC50eXBlID09ICd0dicpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBmb3IgKGxldCBpIGluIGZpbHRlcikge1xcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0ZW1wLmZpbHRlciA9PT0gZmlsdGVyW2ldID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBpICsgJyA8L2ZvbnQ+PC9iPicgOiBpLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NvbWluZycpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAuZmlsdGVyID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjb21pbmdcXFwiLCBKU09OLnN0cmluZ2lmeSh0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JcXG4gICAgICAgICAgICDlrp7ml7bng63pl6jliafpm4Y6ICd0dl9yZWFsX3RpbWVfaG90ZXN0JyxcXHJcXG4gICAgICAgICAgICDljY7or63lj6PnopHliafpm4Y6ICd0dl9jaGluZXNlX2Jlc3Rfd2Vla2x5JyxcXHJcXG4gICAgICAgICAgICDlhajnkIPlj6PnopHliafpm4Y6ICd0dl9nbG9iYWxfYmVzdF93ZWVrbHknXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAg57u86Im6OiB7XFxyXFxuICAgICAgICAgICAg5Zu95YaF5Y+j56KR57u86Im6OiAnc2hvd19jaGluZXNlX2Jlc3Rfd2Vla2x5JyxcXHJcXG4gICAgICAgICAgICDlm73lpJblj6PnopHnu7zoibo6ICdzaG93X2dsb2JhbF9iZXN0X3dlZWtseSdcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCBpIGluIGl0ZW1zKSB7XFxyXFxuICAgICAgICBmb3IgKGxldCBqIGluIGl0ZW1zW2ldKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuaXRlbSA9PSBpdGVtc1tpXVtqXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaiArICcgPC9mb250PjwvYj4nIDogaixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdyYW5raW5nJykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGVtcC5pdGVtID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHB1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AgICBsZXQgcGxheWFibGUgPSB7XFxyXFxuICAgICAgICDlhajpg6jlvbHniYc6ICcwJyxcXHJcXG4gICAgICAgIOS7heacieeJh+a6kDogJzEnXFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgciBpbiBwbGF5YWJsZSkge1xcclxcbiAgICAgICAgaS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5wbGF5YWJsZSA9PSBwbGF5YWJsZVtyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignZG91TGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC5wbGF5YWJsZSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkb3VMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgcGxheWFibGVbcl0pXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGkucHVzaCh7XFxyXFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuivhOWIhuWMuumXtDonICsgdGVtcC5zY29yZSArICcgPC9mb250PjwvYj4nLFxcclxcbiAgICAgICAgY29sX3R5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pc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHJldHVybiB7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgIGltZzogZS5jb250ZW50LnN1YmplY3QucGljLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb250ZW50LnN1YmplY3QucGljLm5vcm1hbCxcXHJcXG4gICAgICAgICAgICBkZXNjOiBlLmNvbnRlbnQuc3ViamVjdC5jYXJkX3N1YnRpdGxlLnNwbGl0KFxcXCIvXFxcIikuZmlsdGVyKCgoZSwgdCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBpZiAodCA8IDMpIHJldHVybiBlXFxyXFxuICAgICAgICAgICAgfSkpLmpvaW4oXFxcIixcXFwiKSArIFxcXCJcXFxcblxcXCIgKyAoZS5jb250ZW50LnN1YmplY3QucmF0aW5nID8gY29tcHV0ZVJhdGluZyhlLmNvbnRlbnQuc3ViamVjdC5yYXRpbmcubWF4LCBlLmNvbnRlbnQuc3ViamVjdC5yYXRpbmcudmFsdWUpICsgXFxcIiBcXFwiICsgZS5jb250ZW50LnN1YmplY3QucmF0aW5nLnZhbHVlLnRvRml4ZWQoMSkgKyBcXFwi5YiGXFxcIiA6IFxcXCLmmoLml6Dor4TliIZcXFwiKVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9KSk7XFxyXFxuXFxyXFxuICAgIHNldEh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gICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5P2lkPScgKyBpZCArICcmdHlwZT0nICsgdHlwZSArICcmdGl0bGU9JyArIGUudGl0bGUpLnJ1bGUoKHJlcywgaWQsIGUsIGxhenksIGV4dHJhKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSByZXMudGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljID0gcmVzLnBpYy5ub3JtYWwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIHJlcy5waWMubm9ybWFsO1xcclxcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKGUudGl0bGUgKyAnLScgKyB0aXRsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VQaWNVcmwocGljKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJscyA9IGdldFR2VXJscyhpZCwgZS5pZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsYXp5ID0gJChcXFwiXFxcIikubGF6eVJ1bGUobGF6eSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdFVybCA9IFxcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxhenkuc3RhcnRzV2l0aChcXFwiKFxcXCIpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgbGF6eSlcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyAnKCgpID0+IHsnICsgbGF6eSArICd9KSgpJylcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKGUubWVzc2FnZSlcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFVybFxcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGF6eSlcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mKHVybHMpID09IFxcXCJvYmplY3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHVybHMubGVuZ3RoOyBpKyspIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn56ysJyArIChpICsgMSkgKyAn6ZuGJyxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF80JyxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogbGF6eSA/IHVybHNbaV0gKyBsYXp5IDogdXJsc1tpXSxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZih1cmxzKSA9PSBcXFwic3RyaW5nXFxcIiAmJiB1cmxzID09ICfooqvlsIFpcCcpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZSA9IEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL3JlbGVhc2VJUD9ydWxlPemdkuixhlxcXCIpKVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucnVsZTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKHJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YodXJscykgPT0gJ3N0cmluZycgJiYgdXJscyA9PSAn5rKh5pyJ5pS25b2VJykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfosYbnk6PmsqHmnInmlLblvZXmraTop4bpopHmupDnmoTor6bnu4bkv6Hmga8nLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn54K55oiR5Y+v5Lul5Y676KeG6aKR5rqQ572R56uZ55yL55yLJyxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBlLnVybFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9LCByZXMsIGlkLCBlLCBsYXp5LCBleHRyYSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAnbW92aWUnKSB7XFxyXFxuICAgICAgICAgICAgbGV0IG1MYXp5ID0gJChcXFwiXFxcIikubGF6eVJ1bGUobGF6eSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHRVcmwgPSBcXFwidG9hc3Q6Ly/op6PmnpDlpLHotKVcXFwiO1xcclxcbiAgICAgICAgICAgICAgICB0cnkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxhenkuc3RhcnRzV2l0aChcXFwiKFxcXCIpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArIGxhenkpXFxyXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyAnKCgpID0+IHsnICsgbGF6eSArICd9KSgpJylcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbG9nKGUubWVzc2FnZSlcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0VXJsXFxyXFxuICAgICAgICAgICAgfSwgbGF6eSlcXHJcXG4gICAgICAgICAgICBkLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogZS50aXRsZSArIChlLmVwaXNvZGVzX2luZm8gPyBcXFwi4oCiXFxcIiArIGUuZXBpc29kZXNfaW5mbyA6IFxcXCJcXFwiKSxcXHJcXG4gICAgICAgICAgICAgICAgaW1nOiBlLmljb24sXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xb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MoXFxcInNlYy5kb3ViYW5cXFwiKSkpIHtcXHJcXG4gICAgICAgIHJldHVybiAn6KKr5bCBaXAnO1xcclxcbiAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgbGV0IHMgPSB7XFxyXFxuICAgICAgICAgICAgcXE6IDEsXFxyXFxuICAgICAgICAgICAgeW91a3U6IDMsXFxyXFxuICAgICAgICAgICAgbGV0djogNixcXHJcXG4gICAgICAgICAgICBtZ3R2OiA3LFxcclxcbiAgICAgICAgICAgIGJpbGliaWxpOiA4LFxcclxcbiAgICAgICAgICAgIGlxaXlpOiA5LFxcclxcbiAgICAgICAgICAgIGNudHY6IDEyLFxcclxcbiAgICAgICAgICAgIGNjdHY2OiAxMyxcXHJcXG4gICAgICAgICAgICBtaWd1dmlkZW86IDE1LFxcclxcbiAgICAgICAgICAgIHhpZ3VhOiAxNyxcXHJcXG4gICAgICAgICAgICBhY2Z1bjogMTgsXFxyXFxuICAgICAgICAgICAgbWFpZHVpZHVpOiAxOVxcclxcbiAgICAgICAgfTtcXHJcXG4gICAgICAgIGxldCBudW0gPSBzW3VpZF07XFxyXFxuXFxyXFxuICAgICAgICB2YXIgc291cmNlcyA9IHt9O1xcclxcbiAgICAgICAgbGV0IHNsID0gaHRtbC5tYXRjaCgvc291cmNlc1xcXFxbWzEtOV17MSwyfVxcXFxdW1xcXFxzXFxcXFNdKj9cXFxcXS9nKTtcXHJcXG4gICAgICAgIGlmIChzbCkge1xcclxcbiAgICAgICAgICAgIGZvciAodmFyIGkgaW4gc2wpIHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChzbFtpXSk7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICBsZXQgc2NyaXB0X2xpc3QgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiZzY3JpcHRbc3JjXScpO1xcclxcbiAgICAgICAgICAgIGxldCBzb3VyY2VzX3VybCA9IFxcXCJcXFwiO1xcclxcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gc2NyaXB0X2xpc3QpIHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IHBhcnNlRG9tRm9ySHRtbChzY3JpcHRfbGlzdFtpXSwgJ3NjcmlwdCYmc3JjJyk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh1cmwuaW5kZXhPZignbWl4ZWRfc3RhdGljJykgIT09IC0xKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBzb3VyY2VzX3VybCA9IHVybDtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICBsZXQgc291cmNlc19saXN0ID0gcmVxdWVzdChzb3VyY2VzX3VybCkubWF0Y2goL3NvdXJjZXNcXFxcW1sxLTldezEsMn1cXFxcXVtcXFxcc1xcXFxTXSo/XFxcXF0vZyk7XFxyXFxuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBzb3VyY2VzX2xpc3QpIHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChzb3VyY2VzX2xpc3RbaV0pO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgIH1cXHJcXG5cXHJcXG4gICAgICAgIGxldCByZW4gPSBzb3VyY2VzW251bV07XFxyXFxuICAgICAgICBpZiAocmVuICYmIHJlbi5sZW5ndGggPiAwKSB7XFxyXFxuICAgICAgICAgICAgLyp2YXIgciA9IHJlbi5tYXAoZSA9PiB1bmVzY2FwZShlLnBsYXlfbGluay5yZXBsYWNlKC8oaHR0cHN8aHR0cCk6XFxcXC9cXFxcL3d3dy5kb3ViYW4uY29tXFxcXC9saW5rMlxcXFwvXFxcXD91cmw9LywgJycpXFxyXFxuICAgICAgICAgICAgICAgIC5zcGxpdCgnOycpWzBdLnNwbGl0KCcuaHRtbCcpWzBdICsgJy5odG1sJykpKi9cXHJcXG4gICAgICAgICAgICB2YXIgciA9IHJlbi5tYXAoZSA9PiB1bmVzY2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TG9hZGluZyNcXFwiKS5sYXp5UnVsZShjb25maWdLZXkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRldGFpbHNWaWV3Q29uZmlncy51c2UgPT09IGNvbmZpZ0tleSkge1xcbiAgICAgICAgICAgICAgICAgICAgLy9wdXRNeVZhcihcXFwiaW5wdXRfY29uZmlnX3R5cGVcXFwiLCAn5b2x54mH6K+m5oOF6aG16Z2i6YWN572uJylcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9uYW1lXFxcIiwgY29uZmlnS2V5KTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9jb2RlXFxcIiwgY29uZmlnLmRldGFpbHNWaWV3Q29uZmlnc1tjb25maWdLZXldLmNvbmZpZyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcIiwgY29uZmlnLmRldGFpbHNWaWV3Q29uZmlnc1tjb25maWdLZXldLnNldHRpbmcgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1kZXRhaWxWaWV3TW9kZUVkaXRQYWdlJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzLnVzZSA9IGNvbmZpZ0tleVxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICA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jkvb/nlKjvvIzml6Dms5XliKDpmaTvvIEnXFxuICAgICAgICAgICAgICAgIHJldHVybiAkKCfnoa7orqTliKDpmaRcXFwiJyArIGlucHV0ICsgJ1xcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3NbY29uZmlnS2V5XVxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Yig6ZmkJyArIGNvbmZpZ0tleSArICfmiJDlip8nXFxuICAgICAgICAgICAgICAgIH0sIGNvbmZpZywgaW5wdXQpXFxuICAgICAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhkZXRhaWxzVmlld0NvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyksIDIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgLy8gaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazlee8lui+ke+8gSdcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9uYW1lXFxcIiwgY29uZmlnS2V5KTtcXG4gICAgICAgICAgIC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ICAgICAgICBpZiAoZGV0YWlsVmlld1NldHRpbmcuc3RhcnRzV2l0aChcXFwiKFxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdCA9ICcgKyBkZXRhaWxWaWV3U2V0dGluZylcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHQgPSAnICsgJygoKSA9PiB7JyArIGRldGFpbFZpZXdTZXR0aW5nICsgJ30pKCknKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBcXFwidG9hc3Q6Ly/plJnor6/nmoTorr7nva7pobXpnaLku6PnoIEs6K+35YmN5b6AIOaXpeW/lyDmn6XnnIvplJnor6/ljp/lm6BcXFwiXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4pqZ77iPJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiByZXN1bHRcXG4gICAgfSlcXG59XFxuXFxuLy8g6aaW6aG16K6+572u5qih5Z2XXFxuZnVuY3Rpb24gaG9tZVBhZ2VTZXR0aW5nTW9kdWxlKGQpIHtcXG4gICAgbGV0IGhvbWVQYWdlQ29uZmlncyA9IGdldENvbmZpZygnaG9tZVBhZ2VDb25maWdzJyk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+iHquWumuS5iemmlumhtScuYm9sZCgpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxuICAgIH0pXFxuICAgIGZvciAobGV0IGNvbmZpZ0tleSBvZiBPYmplY3Qua2V5cyhob21lUGFnZUNvbmZpZ3MpKSB7XFxuICAgICAgICBpZiAoY29uZmlnS2V5ID09PSAndXNlJykgY29udGludWU7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBjb25maWdLZXkgPT09IGhvbWVQYWdlQ29uZmlncy51c2UgPyBcXFwi4oCc4oCcXFxcIiArIGNvbmZpZ0tleSArIFxcXCLigJ3igJ1cXFwiIDogY29uZmlnS2V5LFxcbiAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoY29uZmlnS2V5ID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5ob21lUGFnZUNvbmZpZ3MudXNlID09PSBjb25maWdLZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vcHV0TXlWYXIoXFxcImlucHV0X2NvbmZpZ190eXBlXFxcIiwgJ+mmlumhtemFjee9ricpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfbmFtZVxcXCIsIGNvbmZpZ0tleSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfY29kZVxcXCIsIGNvbmZpZy5ob21lUGFnZUNvbmZpZ3NbY29uZmlnS2V5XS5jb25maWcpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1ob21lUGFnZU1vZGVFZGl0UGFnZSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY29uZmlnLmhvbWVQYWdlQ29uZmlncy51c2UgPSBjb25maWdLZXlcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaIkOWKnydcXG4gICAgICAgICAgICB9LCBjb25maWdLZXkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfinpUnLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/dmlldz1ob21lUGFnZU1vZGVFZGl0UGFnZSdcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KelicsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhob21lUGFnZUNvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyAmJiBjb25maWdLZXkgIT09ICfpu5jorqQnKSwgMilcXG4gICAgICAgICAgICAuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBjb25maWcuaG9tZVBhZ2VDb25maWdzLnVzZSkgcmV0dXJuICd0b2FzdDovL+ivpemFjee9ruato+WcqOS9v+eUqO+8jOaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpFxcXCInICsgaW5wdXQgKyAnXFxcIu+8nycpLmNvbmZpcm0oKGNvbmZpZywgY29uZmlnS2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLmhvbWVQYWdlQ29uZmlnc1tjb25maWdLZXldXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXG4gICAgICAgICAgICAgICAgfSwgY29uZmlnLCBpbnB1dClcXG4gICAgICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5OdJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKE9iamVjdC5rZXlzKGhvbWVQYWdlQ29uZmlncykuZmlsdGVyKGNvbmZpZ0tleSA9PiBjb25maWdLZXkgIT09ICd1c2UnKSwgMikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAvLyBpZiAoaW5wdXQgPT09ICfpu5jorqQnKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6YWN572u5peg5rOV57yW6L6R77yBJ1xcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgIGxldCBjb25maWdLZXkgPSBpbnB1dDtcXG4gICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfbmFtZVxcXCIsIGNv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AgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU96Z2S6LGGJnZpZXc9aG9tZVBhZ2VNb2RlRWRpdFBhZ2UnO1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+TpCcsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhob21lUGFnZUNvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyksIDIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgLy8gaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazlee8lui+ke+8gSdcXG4gICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3V0aWxzJykpLnJ1bGUpXFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgIGxldCBzZWxlY3RDb25maWcgPSB7XFxuICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0LFxcbiAgICAgICAgICAgICAgICBkYXRhOiBjb25maWcuaG9tZVBhZ2VDb25maWdzW2lucHV0XVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJChDb25maWdUb29sLmVuY1R5cGVMaXN0LCAyKS5zZWxlY3QoKHNlbGVjdENvbmZpZykgPT4ge1xcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3V0aWxzJykpLnJ1bGUpXFxuICAgICAgICAgICAgICAgIHJldHVybiBDb25maWdUb29sLnRvQ2xpcGJvYXJkKENvbmZpZ1Rvb2wuZXhwb3J0KHNlbGVjdENvbmZpZy5uY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iAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X25hbWVcXFwiLCBjb25maWdLZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X2NvZGVcXFwiLCBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV0uY29uZmlnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9leHRyYVxcXCIsIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3NbY29uZmlnS2V5XS5leHRyYSB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcIiwgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldLnNldHRpbmcgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1hbmFseXNpc01vZGVFZGl0UGFnZSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY29uZmlnLmFuYWx5c2lzQ29uZmlncy51c2UgPSBjb25maWdLZXlcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaIkOWKnydcXG4gICAgICAgICAgICB9LCBjb25maWdLZXkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfinpUnLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1hbmFseXNpc01vZGVFZGl0UGFnZSdcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KelicsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhhbmFseXNpc0NvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyAmJiBjb25maWdLZXkgIT09ICfkuI3op6PmnpAnICYmIGNvbmZpZ0tleSAhPT0gJ+aWreaPkicpLCAyKVxcbiAgICAgICAgICAgIC5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09ICfkuI3op6PmnpAnICYmIGlucHV0ID09PSAn5pat5o+SJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOino+aekOaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBjb25maWcuYW5hbHlzaXNDb25maWdzLnVzZSkgcmV0dXJuICd0b2FzdDovL+ivpeino+aekOato+WcqOS9v+eUqO+8jOaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpFxcXCInICsgaW5wdXQgKyAnXFxcIu+8nycpLmNvbmZpcm0oKGNvbmZpZywgY29uZmlnS2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXG4gICAgICAgICAgICAgICAgfSwgY29uZmlnLCBpbnB1dClcXG4gICAgICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5OdJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKE9iamVjdC5rZXlzKGFuYWx5c2lzQ29uZmlncykuZmlsdGVyKGNvbmZpZ0tleSA9PiBjb25maWdLZXkgIT09ICd1c2UnKSwgMilcXG4gICAgICAgICAgICAuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgLy8gaWYgKGlucHV0ID09PSAn5LiN6Kej5p6QJyAmJiBpbnB1dCA9PT0gJ+aWreaPkicpIHJldHVybiAndG9hc3Q6Ly/pu5jorqTop6PmnpDml6Dms5XnvJbovpHvvIEnXFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnS2V5ID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9uYW1lXFxcIiwgY29uZmlnS2V5KTtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X2NvZGVcXFwiLCBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV0u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51c2VdLnNldHRpbmc7XFxuICAgIGxldCByZXN1bHQgPSBcXFwidG9hc3Q6Ly/or6Xmj5Lku7bml6Dorr7nva7pobXpnaJcXFwiO1xcbiAgICBpZiAoYW5hbHlzaXNTZXR0aW5nKSB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGlmIChhbmFseXNpc1NldHRpbmcuaW5kZXhPZigncmV0dXJuJykgPT0gLTEpIHRocm93IG5ldyBFcnJvcign5b+F6aG7IHJldHVybiBAcnVsZT1qczog5oiWICQoKS5ydWxlJyk7XFxuICAgICAgICAgICAgaWYgKGFuYWx5c2lzU2V0dGluZy5zdGFydHNXaXRoKFxcXCIoXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0ID0gJyArIGFuYWx5c2lzU2V0dGluZyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0ID0gJyArICcoKCkgPT4geycgKyBhbmFseXNpc1NldHRpbmcgKyAnfSkoKScpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBcXFwidG9hc3Q6Ly/plJnor6/nmoTorr7nva7pobXpnaLku6PnoIEs6K+35YmN5b6AIOaXpeW/lyDmn6XnnIvplJnor6/ljp/lm6BcXFwiXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4pqZ77iPJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiByZXN1bHRcXG4gICAgfSlcXG59XFxuXFxuLy/oh6rlrprkuYnlv6vpgJ/mkJzntKLmqKHlnZdcXG5mdW5jdGlvbiBxdWlja1NlYXJjaERJWU1vZHVsZShkLCBjb25maWcpIHtcXG4gICAgbGV0IHF1aWN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xldCBkdGV4dCA9IGlucHV0ICsgJ0BAJyArIHF1aWNrU2VhcmNoQ29uZmlnc1tpbnB1dF0ubmFtZSArICdAQCcgKyBxdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRdLnBpYztcXG4gICAgICAgICAgICByZXR1cm4gJChkdGV4dCwgJ+ivt+S/ruaUuScpLmlucHV0KChjb25maWcsIHJhdykgPT4ge1xcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnNwbGl0KCdAQCcpO1xcbiAgICAgICAgICAgICAgICBpZiAocmF3ICE9IGlucHV0WzBdKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YocmF3KTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXJbaW5kZXhdID0gaW5wdXRbMF07XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlnc1tyYXddO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YoaW5wdXRbMF0pID09IC0xKSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLnB1c2goaW5wdXRbMF0pO1xcbiAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW2lucHV0WzBdXSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0WzFdLFxcbiAgICAgICAgICAgICAgICAgICAgcGljOiBpbnB1dFsyXVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnyc7XFxuICAgICAgICAgICAgfSwgY29uZmlnLCBpbnB1dClcXG4gICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/CflIEnLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IycpLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIGFkZExpc3RlbmVyKCdvbkNsb3NlJywgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2pzb24nKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXG4gICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2pzb24nKSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICAgICAgbGV0IHF1aWNrU2VhcmNoQ29uZmlncyA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3M7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqc29uJywgSlNPTi5zdHJpbmdpZnkocXVpY2tTZWFyY2hDb25maWdzKSk7XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGxldCBvbGQgPSBKU09OLnBhcnNlKGdldE15VmFyKCdqc29uJykpO1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfliIbliKvngrnlh7vkuKTpobnku6XkuqTmjaLpobrluo9cXFxcbuKAmOKAmOaOkuW6j+WujOavleWQjueCueaIkeS/neWtmOaOkuW6jyzlkKbliJnmjpLluo/kuI3nlJ/mlYjigJnigJknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UoZmV0Y2goZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncyA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2pzb24nKSk7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnydcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIG9sZC5vcmRlci5mb3JFYWNoKCh2YWx1ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcignb3AnKSA9PSB2YWx1ZSA/IHZhbHVlICsgJ+KAmOKAmCjlvZPliY3pgInkuK0p4oCZ4oCZJyA6IHZhbHVlLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGtleSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3AgPSBnZXRNeVZhcignb3AnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3AgPT0gJycpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ29wJywga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3AgPT0ga2V5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ29wJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb2xkID0gSlNPTi5wYXJzZShnZXRNeVZhcignanNvbicpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld2EgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlOiBvbGQubW9kZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yZGVyOiBvbGQub3JkZXJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9waW5kZXggPSBuZXdhLm9yZGVyLmluZGV4T2Yob3ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMob3BpbmRleCAtIGluZGV4KSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyW29waW5kZXhdID0ga2V5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlcltpbmRleF0gPSBvcDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcGluZGV4ID4gaW5kZXgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuc3BsaWNlKG9waW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2UoaW5kZXgsIDAsIG9wKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuc3BsaWNlKG9waW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2UoaW5kZXggLSAxLCAwLCBvcCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5mb3JFYWNoKHZhbHVlID0+IG5ld2FbdmFsdWVdID0gb2xkW3ZhbHVlXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2pzb24nLCBKU09OLnN0cmluZ2lmeShuZXdhKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ29wJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCB2YWx1ZSwgaW5kZXgpXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1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Db2xvciA9IGlucHV0O1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7mm7TmlLnlt7Lkv53lrZhcXFwiO1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG5cXG4gICAgaG9tZVBhZ2VTZXR0aW5nTW9kdWxlKGQpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICB9KVxcblxcbiAgICBxdWlja1NlYXJjaERJWU1vZHVsZShkLCBjb25mKTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZSdcXG4gICAgfSlcXG5cXG4gICAgZGV0YWlsVmlld1NldHRpbmdNb2R1bGUoZCk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgIH0pXFxuXFxuICAgIGlmICh0cnVlLypnZXRJdGVtKCdwYXNzd29yZCcpID09ICd0cnVlJyovKSB7XFxuICAgICAgICBhbmFseXNpc1NldHRpbmdNb2R1bGUoZCk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfmgaLlpI3pu5jorqTorr7nva4nLmJvbGQoKSxcXG4gICAgICAgIGRlc2M6ICfph43nlJ8nLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgdXJsOiAkKFsn6YeN572u5pif5pif6aKc6ImyJywgJ+mHjee9rumAieS4reagh+etvuminOiJsicsICfph43nva7lv6vpgJ/mkJzntKInLCAn6YeN572u6aaW6aG15Li66buY6K6kJywgJ+mHjee9ruivpuaDhemhtScgLCAn5riF6Zmk5YWo6YOo6K6+572uJ10sIDEpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruWumuimgVxcXCIgKyBpbnB1dCArIFxcXCLvvJ9cXFwiKS5jb25maXJtKChzZWwpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGl0ZW0gPSAnJztcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChzZWwpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruaYn+aYn+minOiJsic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdzdGFyQ29sb3InO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u6YCJ5Lit5qCH562+6aKc6ImyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ2Nob29zZUNvbG9yJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruW/q+mAn+aQnOe0oic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdxdWlja1NlYXJjaENvbmZpZ3MnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u6aaW6aG15Li66buY6K6kJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ2hvbWVQYWdlQ29uZmlncyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7or6bmg4XpobUnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnZGV0YWlsVmlld0NvbmZpZ3MnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5riF6Zmk5YWo6YOo6K6+572uJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ2FsbCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8gZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9zZXR0aW5nUGFnZScpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgbGV0IGRlZmF1bHRDb25maWdzID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGVmYXVsdENvbmZpZ3NcXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYgKGl0ZW0gPT0gJ2FsbCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShkZWZhdWx0Q29uZmlncykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7JcXFwiICsgc2VsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYoaXRlbSA9PSBcXFwiaG9tZVBhZ2VDb25maWdzXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWdbaXRlbV1bXFxcIum7mOiupFxcXCJdID0gZGVmYXVsdENvbmZpZ3NbaXRlbV1bXFxcIum7mOiupFxcXCJdO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnW2l0ZW1dLnVzZSA9IFxcXCLpu5jorqRcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7JcXFwiICsgc2VsO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWdbaXRlbV0gPSBkZWZhdWx0Q29uZmlnc1tpdGVtXTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5beyXFxcIiArIHNlbDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgc2V0UmVzdWx0KGQpO1xcbn1cXG5cXG5sZXQgdmlldyA9IGdldFBhcmFtKFxcXCJ2aWV3XFxcIixcXFwiXFxcIik7XFxuaWYodmlldz09XFxcIlxcXCIpe1xcbiAgICBzZXRQYWdlVGl0bGUoXFxcIuiuvue9rlxcXCIpXFxuICAgIHNldHRpbmdQYWdlKCk7XFxufWVsc2UgaWYodmlldz09XFxcImFuYWx5c2lzU2V0dGluZ01vZHVsZVxcXCIpe1xcbiAgICBsZXQgZCA9IFtdO1xcbiAgICBzZXRQYWdlVGl0bGUoXFxcIuino+aekOiuvue9rlxcXCIpXFxuICAgIGFuYWx5c2lzU2V0dGluZ01vZHVsZShkKTtcXG4gICAgc2V0UmVz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U3RyaW5nKCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGlucHV0O1xcclxcbiAgICAgICAgICAgIH0pLFxcclxcbiAgICAgICAgICAgIHNldHRpbmc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K+l5o+S5Lu25peg6K6+572u6aG16Z2iXFxcIjtcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfSxcXHJcXG4gICAgICAgIFxcXCLmlq3mj5JcXFwiOiB7XFxyXFxuICAgICAgICAgICAgY29uZmlnOiAkLnRvU3RyaW5nKCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGUgPSBcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9EdWFuTmlhbi9NeVBhcnNlLmpzb25cXFwiO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgb2xkZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoZmlsZSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ2pzb249JyArIGZldGNoKGZpbGUpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IGpzb24uc2V0dGluZ3MuY2o7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKGlucHV0KTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmaWxlRXhpc3Qob2xkZmlsZSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IEpTT04ucGFyc2UoZmV0Y2gob2xkZmlsZSkpLmNqO1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShpbnB1dCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rKh5om+5Yiw5pat5o+S6YWN572u5paH5Lu2JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0pLFxcclxcbiAgICAgICAgICAgIHNldHRpbmc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL0R1YW5OaWFuL015UGFyc2UuanNvblxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGxldCBvbGRmaWxlID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChmaWxlKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgnanNvbj0nICsgZmV0Y2goZmlsZSkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0ganNvbi5zZXR0aW5ncy5jajtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRVcmw7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmlsZUV4aXN0KG9sZGZpbGUpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBKU09OLnBhcnNlKGZldGNoKG9sZGZpbGUpKS5jajtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRVcmw7XFxyXFxu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xcbmZ1bmN0aW9uIGdldENvbmZpZyhuYW1lLCByb290Q29uZmlnKSB7XFxyXFxuICAgIGxldCBjb25maWcgPSByb290Q29uZmlnID8gcm9vdENvbmZpZyA6IEpTT04ucGFyc2UoZmV0Y2goZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcclxcbiAgICBpZiAobmFtZSkge1xcclxcbiAgICAgICAgaWYgKGNvbmZpZ1tuYW1lXSA9PSBudWxsKSB7XFxyXFxuICAgICAgICAgICAgY29uZmlnID0gaW5pdENvbmZpZ3MobmFtZSwgY29uZmlnKTtcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHJldHVybiBjb25maWdbbmFtZV07XFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICByZXR1cm4gY29uZmlnO1xcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v57yW56CB5bel5YW357G7XFxyXFxubGV0IFppcFRvb2wgPSB7XFxyXFxuICAgIGRlcGVuZGVuY2U6ICdodHRwczovL3VucGtnLmNvbS9sei1zdHJpbmdAMS40LjQvbGlicy9sei1zdHJpbmcubWluLmpzJyxcXHJcXG4gICAgY29tcHJlc3M6IHtcXHJcXG4gICAgICAgIHNpemU6IHtcXHJcXG4gICAgICAgICAgICBrZXk6IFxcXCJ0ZXh0LWNvbXByZXNzLXNpemVcXFwiLFxcclxcbiAgICAgICAgICAgIHNldDogKG5ld1ZhbHVlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKHRoaXMua2V5LCBuZXdWYWx1ZS50b1N0cmluZygpKVxcclxcbiAgICAgICAgICAgIH0sXFxyXFxuICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUludChnZXRNeVZhcih0aGlzLmtleSwgXFxcIjBcXFwiKSlcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgZXhlYzogKGlucHV0KSA9PiB7XFxyXFxuICAgICAgICAgICAgZXZhbChyZXF1ZXN0KFppcFRvb2wuZGVwZW5kZW5jZSkpXFxyXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IExaU3RyaW5nLmNvbXByZXNzVG9FbmNvZGVkVVJJQ29tcG9uZW50KGlucHV0KVxcclxcbiAgICAgICAgICAgICAgICAvLyBaaXBUb29sLmNvbXByZXNzLnNpemUuc2V0KHJlc3VsdC5sZW5ndGggKiAyKVxcclxcbiAgICAgICAgICAgIHJldHVybiByZXN1bHRcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSxcXHJcXG4gICAgZGVjb21wcmVzczoge1xcclxcbiAgICAgICAgc2l6ZToge1xcclxcbiAgICAgICAgICAgIGdldDogKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0TXlWYXIoXFxcInRleHQtZGVjb21wcmVzc1xcXCIsIFxcXCIwXFxcIilcXHJcXG4gICAgICAgICAgICAgICAgICAgIC5sZW5ndGhcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgZXhlYzogKGlucHV0KSA9PiB7XFxyXFxuICAgICAgICAgICAgZXZhbChyZXF1ZXN0KFppcFRvb2wuZGVwZW5kZW5jZSkpXFxyXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IExaU3RyaW5nLmRlY29tcHJlc3NGcm9tRW5jb2RlZFVSSUNvbXBvbmVudChpbnB1dClcXHJcXG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0XFxyXFxuICAgICAgICB9XFxyXFxuICAgIH1cXHJcXG59XFxyXFxuXFxyXFxuLy8g6YWN572u6aG55bel5YW357G7XFxyXFxubGV0IENvbmZpZ1Rvb2wgPSB7XFxyXFxuICAgIGVuY1R5cGVMaXN0OiBbJ0Jhc2U2NCcsICdaaXBwZXInXS5jb25jYXQoZ2V0UGFzdGVzKCkpLFxcclxcbiAgICB0b0NsaXBib2FyZDogKGNvbm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PSBcXFwic3RyaW5nXFxcIikge1xcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IGNvbmZpZztcXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgdGhyb3cgXFxcIuWvvOWHuuaVsOaNruS4jeWQiOazlVxcXCJcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHN3aXRjaCAoZW5jVHlwZSkge1xcclxcbiAgICAgICAgICAgIGNhc2UgJ0Jhc2U2NCc6XFxyXFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGJhc2U2NEVuY29kZShyZXN1bHQpO1xcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICBjYXNlICdaaXBwZXInOlxcclxcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBaaXBUb29sLmNvbXByZXNzLmV4ZWMocmVzdWx0KVxcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICBkZWZhdWx0IDpcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGdldEFwcFZlcnNpb24oKSA+IDIwNzApIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHN5bWJvbCA9IFxcXCLpnZLosYblj6Pku6Tvv6VcXFwiICsgcmVtYXJrICsgXFxcIu+/pVxcXCIgKyBuYW1lXFxyXFxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBzaGFyZVBhc3RlKENvbmZpZ1Rvb2wuZXhwb3J0KG5hbWUsIGNvbmZpZywgcmVtYXJrLCAnWmlwcGVyJyksZW5jVHlwZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ1xcXFxuXFxcXG4nICsgc3ltYm9sXFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35pu05paw6KeG55WM54mI5pys6IezIEMyMDcwIOS7peS4iidcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHJlc3VsdCA9IHN5bWJvbCArIHJlc3VsdFxcclxcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcXHJcXG4gICAgfSxcXHJcXG4gICAgaW1wb3J0OiAoY29uZmlnQ29tbWFuZCkgPT4ge1xcclxcbiAgICAgICAgbGV0IHJlc3VsdCA9ICcnXFxyXFxuICAgICAgICBpZiAoY29uZmlnQ29tbWFuZC5zdGFydHNXaXRoKCfkupEnKSkge1xcclxcbiAgICAgICAgICAgIGlmIChnZXRBcHBWZXJzaW9uKCkgPiAyMDcwKSB7XFxyXFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNvbmZpZ0NvbW1hbmQuc3BsaXQoJ+mdkuixhicpWzBdLnJlcGxhY2UoL1xcXFxcXFxcbi8sICcnKVxcclxcbiAgICAgICAgICAgICAgICBjb25maWdDb21tYW5kID0gcGFyc2VQYXN0ZShyZXN1bHQpXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+abtOaWsOinhueVjOeJiOacrOiHsyBDMjA3MCDku6XkuIonXFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgdHJ5IHtcXHJcXG4gICAgICAgICAgICBsZXQgcmVzdWx0U3BsaXRzID0gY29uZmlnQ29tbWFuZC5zcGxpdChcXFwi77+lXFxcIilcXHJcXG4gICAgICAgICAgICBsZXQgZW5jVHlwZSA9IHJlc3VsdFNwbGl0c1szXVxcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdFNwbGl0c1s0XVxcclxcbiAgICAgICAgICAgIHN3aXRjaCAoZW5jVHlwZSkge1xcclxcbiAgICAgICAgICAgICAgICBjYXNlICdCYXNlNjQnOlxcclxcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gYmFzZTY0RGVjb2RlKHJlc3VsdCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICAgICAgY2FzZSAnWmlwcGVyJzpcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFppcFRvb2wuZGVjb21wcmVzcy5leGVjKHJlc3VsdClcXHJcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxyXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxyXFxuICAgICAgICAgICAgbG9nKGUubWVzc2FnZSlcXHJcXG4gICAgICAgICAgICB0aHJvdyBcXFwi5a+85YWl5pWw5o2u5LiN5ZCI5rOVXFxcIlxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcXHJcXG4gICAgfVxcclxcbn1cIn1dIiwiaWNvbiI6Imh0dHBzOi8vZ2l0Y29kZS5uZXQvcXFfNDE4NDY3NTYvaGlrZXIvLS9yYXcvbWFzdGVyL2ltZy/pnZLosYYucG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment