xiaomianao666

小程序:Alist

Sep 7th, 2022
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@Alist@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiQWxpc3QiLCJhdXRob3IiOiJKb2Um6YGT6ZW/6a2U5pS5IiwidXJsIjoiaGlrZXI6Ly9lbXB0eSIsInZlcnNpb24iOjMwLCJjb2xfdHlwZSI6InBpY18xIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ0b29sIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG4gICAgdmFyIGQgPSBbXTtcbmlmIChnZXRBcHBWZXJzaW9uKCkgPCAzMjA0KSB7XG4gICAgc2V0UmVzdWx0KFt7XG4gICAgICAgIHRpdGxlOiBcIuaCqOW9k+WJjeeJiOacrOS4jeaUr+aMgeacrOWwj+eoi+W6j++8jOivt+abtOaWsOiHs+acgOaWsOeJiOacrFwiLFxuICAgICAgICB1cmw6IFwiaHR0cHM6Ly9oYWlrdW8ubGFuem91aS5jb20vdS9Hb2xkUml2ZXJcIlxuICAgIH1dKVxufSBlbHNlIHtcbiAgICBjb25zdCB7XG4gICAgICAgIGdldEZpbGVzLFxuICAgICAgICBnZXRMaW5rXG4gICAgfSA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2FwaScpO1xuICAgIGNvbnN0IHtjb2xvcixzbWFsbH09JC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvdXRpbHMnKTtcbiAgICB2YXIgcGF0aCA9IGdldE15VmFyKFwicGF0aFwiLCBcIlwiKTtcbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTogJ+Kame+4j+iuvue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ICAgICAgICAgICAgIGNsZWFyTXlWYXIoXCJwYXRoXCIpO1xuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gXCJ0b2FzdDovL+WIh+aNouaIkOWKn1wiXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIlxuICAgICAgICB9KTtcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICBjb2xfdHlwZTogXCJibGFua19ibG9ja1wiXG4gICAgfSk7XG4gICAgZC5wdXNoKHtcbiAgICAgICAgdGl0bGU6IFwi4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj0nIzFFOTBGRic+Li4uPC9mcm9udD48L3N0cm9uZz5cIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXRoKSA9PiB7XG4gICAgICAgICAgICAvLyDov5Tlm57kuIrnuqdcbiAgICAgICAgICAgIHBhdGgucG9wKCk7XG4gICAgICAgICAgICBwdXRNeVZhcihcInBhdGhcIiwgcGF0aC5qb2luKFwiL1wiKSk7XG4gICAgICAgICAgICBpZihnZXRJdGVtKCdjbGVhcl9jaGFuZ2UnLCcnKSl7XG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoJywnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgfSwgcGF0aC5zcGxpdChcIi9cIikpLFxuICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTogXCLwn4+g6aaW6aG1XCIsXG4gICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcbiAgICAgICAgICAgIHB1dE15VmFyKFwicGF0aFwiLCBcIlwiKTtcbiAgICAgICAgICAgIGlmKGdldEl0ZW0oJ2NsZWFyX3JlZnJlc2gnLCcnKSl7XG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoJywnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgfSksXG4gICAgfSk7XG4gICAgbGV0IHBhdGhzID0gXCJcIjtcbiAgICBmb3IgKGl0ZW0gb2YgcGF0aC5zcGxpdChcIi9cIikpIHtcbiAgICAgICAgaWYgKGl0ZW0gIT09IFwiXCIpIHtcbiAgICAgICAgICAgIHBhdGhzICs9IFwiL1wiICsgaXRlbTtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0sXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGF0aHMpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXCJwYXRoXCIsIHBhdGhzKTtcbiAgICAgICAgICAgICAgICAgICAgaWYoZ2V0SXRlbSgnY2xlYXJfY2hhbmdlJywnJykpe1xuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoJywnJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgICAgICAgICB9LCBwYXRocylcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICB9XG4gICAgbGV0IHNvcnRzID0gW1wi5ZCN56ewXCIsIFwi57G75Z6LXCIsIFwi5aSn5bCPXCIsICfml7bpl7QnXTtcbiAgICBsZXQgbnNvcnQgPSBnZXRNeVZhcignc29ydCcsICflkI3np7AnKTtcbiAgICBsZXQgbnNlYXJjaCA9IGdldE15VmFyKCdzZWFyY2gnLCcnKTtcbiAgICBzb3J0cy5mb3JFYWNoKGl0ZW0gPT4ge1xuICAgICAgICBsZXQgY2MgPSBuc29ydCA9PT0gaXRlbSArIFwiLVwiO1xuICAgICAgICBsZXQgaXNDbGlja2VkID0gbnNvcnQgPT09IGl0ZW07XG4gICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogY2MgfHwgaXNDbGlja2VkID8gXCLigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPScjMUU5MEZGJz5cIiArIGl0ZW0gKyAoY2MgPyBcIuKIp1wiIDogXCLiiKhcIikgKyBcIjwvZnJvbnQ+PC9zdHJvbmc+XCIgOiBpdGVtLFxuICAgICAgICAgICAgY29sX3R5cGU6IFwiZmxleF9idXR0b25cIixcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaXRlbSwgaXNDbGlja2VkKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGlzQ2xpY2tlZCkge1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcInNvcnRcIiwgaXRlbSArIFwiLVwiKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcInNvcnRcIiwgaXRlbSk7XG4gICAgICAgICAgICAgICAgICAgIGlmKGdldEl0ZW0oJ2NsZWFyX2NoYW5nZScsJycpKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaCcsJycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAg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ICAgICAgaWYoaW5wdXQ9PT0n6Ieq5a6a5LmJ6L+H5rukJyl7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc3VwZXJTZXR0aW5ncyNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZihmaWx0ZXJPcHRpb24hPT1pbnB1dCl7XG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnZmlsdGVyT3B0aW9uJyxpbnB1dCk7XG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xuICAgICAgICB9LGZpbHRlck9wdGlvbiksXG4gICAgfSk7XG4gICAgZC5wdXNoKHtcbiAgICAgICAgdGl0bGU6bnNlYXJjaD9cIvCflI1cIitzbWFsbChjb2xvcignOicrbnNlYXJjaCwnIzEyYjY2OCcpKTon8J+UjScsXG4gICAgICAgIGNvbF90eXBlOidmbGV4X2J1dHRvbicsXG4gICAgICAgIHVybDokKG5zZWFyY2gsJ+i+k+WFpeimgeaQnOe0oueahOWGheWuueOAguaUr+aMgeato+WImeOAguWmglxcXFwuanMnKS5pbnB1dCgobnNlYXJjaCk9PntcbiAgICAgICAgICAgIGlmKGlucHV0IT09bnNlYXJjaCl7XG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaCcsaW5wdXQpO1xuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAgICAgfSxuc2VhcmNoKSxcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTogY29sb3IoXCLwn5WT5Y6G5Y+yXCIsXCIjZDk2NzE1XCIpLFxuICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL2hpc3Rvcnkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXCIsXG4gICAgICAgIGNvbF90eXBlOiBcImZsZXhfYnV0dG9uXCJcbiAgICB9KTtcbiAgICBsZXQgZGlySW5mbyA9IGdldEZpbGVzKHBhdGgsZmlsdGVyT3B0aW9uKTtcbiAgICBpZihkaXJJbmZvLmNhbl91cGxvYWQpe1xuICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgdGl0bGU6IGNvbG9yKFwi4puF6K6/5a6iXCIsXCIjMTVhYjIxXCIpLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS91cGxvYWQjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXCIsXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJmbGV4X2J1dHRvblwiXG4gICAgICAgIH0pO1xuICAgIH1cbiAgICAvLyBsb2cobm93U3ViKTtcbiAgICBpZihwYXRoLnNwbGl0KCcvJykubGVuZ3RoPjEmJm5vd1N1YiYmbm93U3ViLndlYmRhdiYmbm93U3ViLndlYmRhdi51c2VyKXtcbiAgICAgICAgbGV0IHdlYl9kYXYgPSBub3dTdWIud2ViZGF2O1xuICAgICAgICAvLyBsb2cod2ViZGF2KTtcbiAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBjb2xvcihcIvCfk4LliJvlu7pcIixcIiMxNWFiMjFcIiksXG4gICAgICAgICAgICB1cmw6ICQoJycsJ+ivt+i+k+WFpeW+heWIm+W7uueahOaWh+S7tuWkueWQjeensCcpLmlucHV0KCh1c2VyLHB3ZCxiYXNlX3BhdGgscGF0aCk9PntcbiAgICAgICAgICAgICAgICBpZihpbnB1dCl7XG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBiYXNlX3BhdGggKycvZGF2JytwYXRoO1xuICAgICAgICAgICAgICAgICAgICBsb2codXJsKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHdlYmRhdiA9IG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An5omT5byAJyk7XG4gICAgbGV0IHNob3daaW11ID0gZ2V0SXRlbSgnc2hvd1ppbXUnLCflvIAnKTtcbiAgICBkaXJJbmZvLnJlc3VsdC5mb3JFYWNoKGl0ZW0gPT4ge1xuICAgICAgICBpZiAoaXRlbS51cmwpIHtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udGl0bGUsXG4gICAgICAgICAgICAgICAgaW1nOiBpdGVtLmltZyxcbiAgICAgICAgICAgICAgICB1cmw6IGl0ZW0udXJsLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdGVtLmNvbF90eXBlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBsZXQgaXRfdHlwZSA9IGl0ZW0uZXh0cmEudHlwZTtcbiAgICAgICAgICAgIGxldCBpdF90eXBlID0gaXRlbS50eXBlO1xuICAgICAgICAgICAgbGV0IHVybCA9ICdoaWtlcjovL2VtcHR5JztcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0ZW0uZXh0cmEubmFtZSB8fCBpdGVtLnRpdGxlO1xuICAgICAgICAgICAgbGV0IGlkPWl0ZW0uZXh0cmEuaWQ7XG4gICAgICAgICAgICBpZiAoaXRfdHlwZSA9PT0gMSkge1xuICAgICAgICAgICAgICAgIHVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGl0ZW0sIHRpdGxlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFwicGF0aFwiLCAkLnJzdHJpcChnZXRNeVZhcihcInBhdGhcIiwgXCJcIiksJy8nICkrIFwiL1wiICsgdGl0bGUpO1xuICAgICAgICAgICAgICAgICAgICBpZihnZXRJdGVtKCdjbGVhcl9jaGFuZ2UnLCcnKSl7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2gnLCcnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcImhpa2VyOi8vZW1wdHlcIlxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIHRpdGxlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXRfdHlwZSA9PT0gMyB8fCAvXFwubTN1OCQvLnRlc3QodGl0bGUpKSB7IC8vM+aYr+WqkuS9kyznpoHnlKjkuIvovb3lkozot7PovaxcbiAgICAgICAgICAgICAgICB1cmwgPSBnZXRMaW5rKHRpdGxlLCBudWxsLCfmiZPlvIAnLCBzaG93WmltdSwnI2lzVmlkZW89dHJ1ZSMnKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXRfdHlwZSA9PT0gNikge1xuICAgICAgICAgICAgICAgIHVybCA9IGdldExpbmsodGl0bGUsIG51bGwsJ+aJk+W8gCcsIHNob3daaW11LFwiIy5qcGdcIik7XG4gICAgICAgICAgICB9IGVsc2UgeyAvL+i3n+maj+ezu+e7n+mihOiniOWSjOS4i+i9vVxuICAgICAgICAgICAgICAgIHVybCA9IGdldExpbmsodGl0bGUsIG51bGwsY2xpY2tPcHRpb24sc2hvd1ppbXUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZSxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdGVtLmNvbF90eXBlLFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgIGlkOmlkLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBpdF90eXBlLFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfS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ZpbmQoeD0+eC5uYW1lPT09ZmlsdGVyT3B0aW9uKTtcXG4gICAgICAgICAgICAgICAgaWYoZmlsdGVyX3J1bGUmJmZpbHRlcl9ydWxlLnJ1bGUpe1xcbiAgICAgICAgICAgICAgICAgICAgaWYoZmlsdGVyX3J1bGUucnVsZS5zdGFydHNXaXRoKCchJykpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0LmZpbHRlcih4PT4hKG5ldyBSZWdFeHAoZmlsdGVyX3J1bGUucnVsZS5zbGljZSgxKSkpLnRlc3QoeC5uYW1lKSk7XFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5maWx0ZXIoeD0+KG5ldyBSZWdFeHAoZmlsdGVyX3J1bGUucnVsZSkpLnRlc3QoeC5uYW1lKSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgaWYoc2VhcmNoKXtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QuZmlsdGVyKHg9PihuZXcgUmVnRXhwKHNlYXJjaCkpLnRlc3QoeC5uYW1lKSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKFsn5aSn5bCPJywgJ+exu+WeiycsICflkI3np7AnLCAn5pe26Ze0J10uaW5jbHVkZXMoc29ydCkpIHtcXG4gICAgICAgICAgICAgICAgc29ydHMobGlzdCwgc29ydCk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgc29ydHMobGlzdCwgc29ydC5yZXBsYWNlKCctJywgJycpKS5yZXZlcnNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGV4dCA9IGl0ZW0ubmFtZS5zcGxpdCgnLicpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgbGV0IGltZyA9IGl0ZW0udHlwZSA9PT0gMSA/IGljb25fZGljdFsnMSddIDogKGljb25zW2V4dF0gfHwgaWNvbl9kaWN0W2l0ZW0udHlwZSArICcnXSk7XFxuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IGl0ZW0udHlwZSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6YmFzZXVybCtwYXRoK2l0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBpdGVtLnR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTppdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoc2hvd0RldGFpbCkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGUgPSBnZXRUaW1lKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNpemUgPSBpdGVtLnNpemVfc3RyO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzaXplIHx8IHNpemUgPT09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IGl0ZW0uc2l6ZSA9PT0gMCA/IFxcXCIvXFxcIiA6IGJ5dGVzVG9TaXplKGl0ZW0uc2l6ZSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGlmIChzaXplICYmIHNpemUgIT09IFxcXCJcXFwiICYmIHNpemUgIT09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gXFxcIiZuYnNwOyZuYnNwOyZuYnNwO1xcXCIgKyBzaXplO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZGVzYyA9IGRhdGUgKyBzaXplO1xcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IGl0ZW0udHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogc21hbGwoY29sb3IoZGVzYywgJyNhYWFhYWEnKSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOmJhc2V1cmwrcGF0aCtpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IGl0ZW0udHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAobXNnID09PSBcXFwiV3JvbmcgcGFzc3dvcmRcXFwiKSB7XFxuICAgICAgICAgICAgcmVzdWx0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIueCueaIkei+k+WFpeWvhueggVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGdldE15VmFyKFxcXCJwYXNzd29yZFxcXCIsIFxcXCJcXFwiKSkuaW5wdXQoKHBhdGgsIGJhc2V1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWJfdXJscyA9ICQuZ2V0X3N1Yl91cmxzKCk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWRleCA9IHN1Yl91cmxzLmZpbmRJbmRleCh4ID0+IHgudXJsLmluY2x1ZGVzKGJhc2V1cmwpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpZGV4ID4gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXN1Yl91cmxzW2lkZXhdLnBhc3N3b3JkKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl91cmxzW2lkZXhdLnBhc3N3b3JkID0ge31cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX3VybHNbaWRleF0ucGFzc3dvcmRbcGF0aF0gPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInBhc3N3b3JkXFxcIiwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mnKrojrflj5bliLDpk77mjqXkuLo6JyArIGJhc2V1cmwgKyAn55qE57Si5byVJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIC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O1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJCgn5qOA5rWL5Yiw5pys5Zyw5pyJ6YeN5aSN55qEJyArIGFfbmFtZSArICcs5piv5ZCm6KaG55uWPycpLmNvbmZpcm0oKHN1Yl91cmxzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5L+d5a2YJ1xcbiAgICAgICAgICAgICAgICB9LCBzdWJfdXJscylcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rKh5pyJ5pON5L2cJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgc3ViX3VybHMudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgIG5hbWU6IGFfbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBhX3VybCxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7Lkv53lrZgnXFxuICAgICAgICB9XFxuICAgIH1lbHNlIGlmKHNhdmVfbW9kZSA9PT0gJ+aJuemHjycpe1xcbiAgICAgICAgbGV0IGFkZF9kYXRhID0gW107XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGFkZF9kYXRhID0gZXZhbChhX3VybCk7XFxuICAgICAgICAgICAgSlNPTi5zdHJpbmdpZnkoYWRkX2RhdGEpO1xcbiAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aJuemHj+a3u+WKoOagvOW8j+acieivryzor7flj4LogIPpooTlpITnkIbnmoRqc29u5qC85byP44CC5ZCN56ew6YeN5aSN5Lya55u05o6l6KaG55uW5L+d5a2YJ1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHN1Yl91cmxzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnc3ViX3VybHMuanNvbicsIDApIHx8ICdbXScpO1xcbiAgICAgICAgbGV0IHN1Yl9jbnQgPSBzdWJfdXJscy5sZW5ndGg7XFxuICAgICAgICBsZXQgbmV3X2FkZF9kYXRhID0gW107IC8vIOiHquWKqOWOu+mHjVxcbiAgICAgICAgYWRkX2RhdGEgPSBhZGRfZGF0YS5maWx0ZXIoeD0+eC5uYW1lJiZ4LnVybCk7XFxuICAgICAgICBpZighQXJyYXkuaXNBcnJheShhZGRfZGF0YSkgfHwgYWRkX2RhdGEubGVuZ3RoIDwgMSl7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WvvOWFpeeahOS4nOilv+eci+i1t+adpeayoeWvueWRoiEnXFxuICAgICAgICB9XFxuICAgICAgICBhZGRfZGF0YS5mb3JFYWNoKChpdCk9PntcXG4gICAgICAgICAgICBsZXQgaWRleCA9IG5ld19hZGRfZGF0YS5maW5kSW5kZXgoeD0+JC5yc3RyaXAoeC51cmwpID09PSAkLnJzdHJpcChpdC51cmwpKTtcXG4gICAgICAgICAgICBpZGV4Pi0xP25ld19hZGRfZGF0YVtpZGV4XSA9IGl0Om5ld19hZGRfZGF0YS51bnNoaWZ0KGl0KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgLy8gbG9nKCflh4blpIfmlrDlop7liJfooag6Jyk7XFxuICAgICAgICAvLyBsb2cobmV3X2FkZF9kYXRhKTtcXG4gICAgICAgIG5ld19hZGRfZGF0YS5mb3JFYWNoKChpdCk9PntcXG4gICAgICAgICAgIC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AgIGlmIChpbnB1dCA9PT0gJ+e9rumhticpIHtcXG4gICAgICAgICAgICAgICAgc3ViX3VybHMuc3BsaWNlKGlkZXgsIDEpO1xcbiAgICAgICAgICAgICAgICBzdWJfdXJscy51bnNoaWZ0KGl0KTtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKFxcXCJiYXNldXJsXFxcIiwgXFxcIlxcXCIpICE9PSBpdC51cmwpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJiYXNldXJsXFxcIiwgaXQudXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcInBhdGhcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBlbHNlIGlmIChpbnB1dCA9PT0gJ+WIoOmZpCcpIHtcXG4gICAgICAgICAgICAgICAgc3ViX3VybHMuc3BsaWNlKGlkZXgsIDEpO1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcImJhc2V1cmxcXFwiLCBcXFwiXFxcIikgPT09IGl0LnVybCkge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImJhc2V1cmxcXFwiLCBzdWJfdXJsc1swXS51cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwicGF0aFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2UgaWYgKGlucHV0ID09PSAn5L+u5pS55ZCN56ewJykge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChpdC5uYW1lLCfnu5nmraTorqLpmIXmlLnkuKrlkI3lrZflkKcnKS5pbnB1dCgoc3ViX3VybHMsaWRleCk9PntcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl91cmxzW2lkZXhdLm5hbWUgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55aSx6LSlJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LHN1Yl91cmxzLGlkZXgpO1xcbiAgICAgICAgICAgIH1lbHNlIGlmIChpbnB1dCA9PT0gJ+S/ruaUueWcsOWdgCcpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoaXQudXJsLCfnu5nmraTorqLpmIXmlLnkuKrlnLDlnYDlkKcnKS5pbnB1dCgoc3ViX3VybHMsaWRleCk9PntcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQmJi9eaHR0cC8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl91cmxzW2lkZXhdLnVybCA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdzdWJfdXJscy5qc29uJywgSlNPTi5zdHJpbmdpZnkoc3ViX3VybHMpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnydcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnlpLHotKUnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sc3ViX3VybHMsaWRleCk7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PT0gJ+W/q+aNt+i+k+WFpScpIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImFsaXN0X25hbWVcXFwiLGl0Lm5hbWUpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiYWxpc3RfdXJsXFxcIixpdC51cmwpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9ZWxzZSBpZiAoaW5wdXQgPT09ICflr4bnoIHnrqHnkIYnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3Bhc3N3b3JkTWFuYWdlP2lkZXg9JytpZGV4XFxuICAgICAgICAgICAgfWVsc2UgaWYgKC/liIbkuqsvLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgIGlmKGlucHV0LmluY2x1ZGVzKCfml6Dlr4bnoIEnKSl7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgaXQucGFzc3dvcmQ7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSAnQWxpc3TorqLpmIXnvJbnoIHliIbkuqsgJytpdC5uYW1lKyc6XFxcXG4nK2Jhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShbaXRdKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnY29weTovLycrY29kZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKS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MDAwMDAwMCxcXG4gICAgICAgIHNlY1VuaXQ6IHRydWVcXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiBDaGluZXNlVG9OdW1iZXIoY2huU3RyKSB7XFxuICAgIGxldCBydG4gPSAwO1xcbiAgICBsZXQgc2VjdGlvbiA9IDA7XFxuICAgIGxldCBudW1iZXIgPSAwO1xcbiAgICBsZXQgc2VjVW5pdCA9IGZhbHNlO1xcbiAgICBsZXQgc3RyID0gY2huU3RyLnNwbGl0KCcnKTtcXG5cXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGxldCBudW0gPSBjaG5OdW1DaGFyW3N0cltpXV07XFxuICAgICAgICBpZiAodHlwZW9mIG51bSAhPT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICBudW1iZXIgPSBudW07XFxuICAgICAgICAgICAgaWYgKGkgPT09IHN0ci5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gKz0gbnVtYmVyO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbGV0IHVuaXQgPSBjaG5OYW1lVmFsdWVbc3RyW2ldXS52YWx1ZTtcXG4gICAgICAgICAgICBzZWNVbml0ID0gY2huTmFtZVZhbHVlW3N0cltpXV0uc2VjVW5pdDtcXG4gICAgICAgICAgICBpZiAoc2VjVW5pdCkge1xcbiAgICAgICAgICAgICAgICBzZWN0aW9uID0gKHNlY3Rpb24gKyBudW1iZXIpICogdW5pdDtcXG4gICAgICAgICAgICAgICAgcnRuICs9IHNlY3Rpb247XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gPSAwO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gKz0gKG51bWJlciAqIHVuaXQpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBudW1iZXIgPSA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GhcXG4gICAgdmFyIG4gPSBzLmxlbmd0aFxcbiAgICB2YXIgbSA9IHQubGVuZ3RoXFxuICAgIHZhciBkID0gW11cXG4gICAgZiA9IGYgfHwgMlxcbiAgICB2YXIgbWluID0gZnVuY3Rpb24gKGEsIGIsIGMpIHtcXG4gICAgICAgIHJldHVybiBhIDwgYiA/IChhIDwgYyA/IGEgOiBjKSA6IChiIDwgYyA/IGIgOiBjKVxcbiAgICB9XFxuICAgIHZhciBpLCBqLCBzaSwgdGosIGNvc3RcXG4gICAgaWYgKG4gPT09IDApIHJldHVybiBtXFxuICAgIGlmIChtID09PSAwKSByZXR1cm4gblxcbiAgICBmb3IgKGkgPSAwOyBpIDw9IG47IGkrKykge1xcbiAgICAgICAgZFtpXSA9IFtdXFxuICAgICAgICBkW2ldWzBdID0gaVxcbiAgICB9XFxuICAgIGZvciAoaiA9IDA7IGogPD0gbTsgaisrKSB7XFxuICAgICAgICBkWzBdW2pdID0galxcbiAgICB9XFxuICAgIGZvciAoaSA9IDE7IGkgPD0gbjsgaSsrKSB7XFxuICAgICAgICBzaSA9IHMuY2hhckF0KGkgLSAxKVxcbiAgICAgICAgZm9yIChqID0gMTsgaiA8PSBtOyBqKyspIHtcXG4gICAgICAgICAgICB0aiA9IHQuY2hhckF0KGogLSAxKVxcbiAgICAgICAgICAgIGlmIChzaSA9PT0gdGopIHtcXG4gICAgICAgICAgICAgICAgY29zdCA9IDBcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjb3N0ID0gMVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkW2ldW2pdID0gbWluKGRbaSAtIDFdW2pdICsgMSwgZFtpXVtqIC0gMV0gKyAxLCBkW2kgLSAxXVtqIC0gMV0gKyBjb3N0KVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxldCByZXMgPSAoMSAtIGRbbl1bbV0gLyBsKSAqMTAwXFxuICAgIHJldHVybiByZXMudG9GaXhlZChmKVxcb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0gW107XFxuc2V0UGFnZVRpdGxlKCdBbGlzdOWvhueggeeuoeeQhicpO1xcbmNvbnN0IHtjb2xvcixzbWFsbH0gPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS91dGlscycpO1xcbmxldCBpZGV4ID0gZ2V0UGFyYW0oJ2lkZXgnLCBNWV9QQVJBTVMuaWRleHx8XFxcIlxcXCIpO1xcbmlmKCFpZGV4KXtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifntKLlvJXojrflj5blpLHotKUs5peg5rOV566h55CG5a+G56CBJyxcXG4gICAgICAgIGNvbF90eXBlOid0ZXh0XzEnLFxcbiAgICAgICAgdXJsOidoaWtlcjovL2VtcHR5J1xcbiAgICB9KTtcXG59ZWxzZXtcXG4gICAgaWRleCA9IE51bWJlcihpZGV4KTtcXG4gICAgbGV0IHN1Yl91cmxzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnc3ViX3VybHMuanNvbicsIDApIHx8ICdbXScpO1xcbiAgICBsZXQgbm93U3ViID0gc3ViX3VybHNbaWRleF07XFxuICAgIGxldCBuYW1lID0gY29sb3Iobm93U3ViLm5hbWUsJyNkOTY3MTUnKTtcXG4gICAgbGV0IHBhc3N3b3JkID0gbm93U3ViLnBhc3N3b3JkO1xcbiAgICBsZXQgd2ViZGF2ID0gbm93U3ViLndlYmRhdnx8e307XFxuICAgIGlmKCFwYXNzd29yZCl7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiforqLpmIUnK25hbWUrJ+aaguaXoOWvhueggScsXFxuICAgICAgICAgICAgY29sX3R5cGU6J3RleHRfMScsXFxuICAgICAgICAgICAgdXJsOidoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSk7XFxuICAgIH1lbHNle1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTon6K6i6ZiFJytuYW1lKyflr4bnoIHlpoLkuIsnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOid0ZXh0XzEnLFxcbiAgICAgICAgICAgIHVybDonaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTpKU09OLnN0cmluZ2lmeShwYXNzd29yZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6J2xvbmdfdGV4dCcsXFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICB0aXRsZTonPGJpZz48c3Ryb25nPndlYmRhdumFjee9rjxiaWc+PHN0cm9uZz4nLFxcbiAgICAgICBjb2xfdHlwZToncmljaF90ZXh0JyxcXG4gICAgfSk7XFxuICAgIGxldCB3ZWJkYXZfcGF0aCA9ICQucnN0cmlwKG5vd1N1Yi51cmwsJy8nKSsnL2Rhdic7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTond2ViZGF25Zyw5Z2AJyxcXG4gICAgICAgIGRlc2M6d2ViZGF2X3BhdGgsXFxuICAgICAgICBjb2xfdHlwZTondGV4dF8xJyxcXG4gICAgICAgIHVybDonY29weTovLycrd2ViZGF2X3BhdGhcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+i0puWPtycsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKHVzZXIpPT57XFxuICAgICAgICAgICAgY29weSh1c2VyfHxnZXRNeVZhcignd2ViZGF2X3VzZXInLCcnKSk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSx3ZWJkYXYudXNlciksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCJ3ZWJkYXbnmbvlvZXotKblj7dcXFwiLFxcbiAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOndlYmRhdi51c2VyfHxnZXRNeVZhcignd2ViZGF2X3VzZXInLCcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTpcXFwicHV0TXlWYXIoJ3dlYmRhdl91c2VyJyxpbnB1dClcXFwiLFxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5a+G56CBJyxcXG4gICAgICAgIHVybDogJC50b1N0cmluZygocHdkKT0+e1xcbiAgICAgICAgICAgIGNvcHkocHdkfHxnZXRNeVZhcignd2ViZGF2X3B3ZCcsJycpKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB9LHdlYmRhdi5wd2QpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwid2ViZGF255m75b2V5a+G56CBXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgIHR5cGU6J3Bhc3N3b3JkJyxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6d2ViZGF2LnB3ZHx8Z2V0TXlWYXIoJ3dlYmRhdl9wd2QnLCcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTpcXFwicHV0TXlWYXIoJ3dlYmRhdl9wd2QnLGlucHV0KVxcXCIsXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J+mqjOivgeW5tuS/neWtmCcsXFxuICAgICAgICBjb2xfdHlwZTondGV4dF9jZW50ZXJfMScsXFxuICAgICAgICB1cmw6JCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgod2ViZGF2X3BhdGgsaWRleCk9PntcXG4gICAgICAgICAgICBzaG93TG9hZGluZygn55m75b2V6aqM6K+B5LitLOivt+eojeetiS4uLicpO1xcbiAgICAgICAgICAgIGxldCB1cmwg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1dCA9PT0gJ+WIoOmZpCcpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlck9wdGlvbiA9IGdldEl0ZW0oJ2ZpbHRlck9wdGlvbicsJ+WFqOmDqCcpO1xcbiAgICAgICAgICAgICAgICBpZihmaWx0ZXJPcHRpb249PT1pdC5uYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbSgnZmlsdGVyT3B0aW9uJylcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmaWx0ZXJfcnVsZXMuc3BsaWNlKGlkZXgsIDEpO1xcbiAgICAgICAgICAgIH1lbHNlIGlmIChpbnB1dCA9PT0gJ+S/ruaUueWQjeensCcpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoaXQubmFtZSwn57uZ5q2k6KeE5YiZ5pS55Liq5ZCN5a2X5ZCnJykuaW5wdXQoKGZpbHRlcl9ydWxlcyxpZGV4KT0+e1xcbiAgICAgICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC50cmltKCk7XFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyX3J1bGVzW2lkZXhdLm5hbWUgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnZmlsdGVyX3J1bGVzLmpzb24nLCBKU09OLnN0cmluZ2lmeShmaWx0ZXJfcnVsZXMpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnydcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnlpLHotKUnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sZmlsdGVyX3J1bGVzLGlkZXgpO1xcbiAgICAgICAgICAgIH1lbHNlIGlmIChpbnB1dCA9PT0gJ+S/ruaUueinhOWImScpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoaXQucnVsZSwn57uZ5q2k6KeE5YiZ5pS55Liq5Yy56YWN5YaF5a655ZCnJykuaW5wdXQoKGZpbHRlcl9ydWxlcyxpZGV4KT0+e1xcbiAgICAgICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC50cmltKCk7XFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyX3J1bGVzW2lkZXhdLnJ1bGUgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnZmlsdGVyX3J1bGVzLmpzb24nLCBKU09OLnN0cmluZ2lmeShmaWx0ZXJfcnVsZXMpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnydcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnlpLHotKUnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sZmlsdGVyX3J1bGVzLGlkZXgpO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09ICflv6vmjbfovpPlhaUnKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJmaWx0ZXJfbmFtZVxcXCIsaXQubmFtZSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJmaWx0ZXJfcnVsZVxcXCIsaXQucnVsZSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH1lbHNlIGlmIChpbnB1dCA9PT0gJ+WQr+eUqCcpIHtcXG4gICAgICAgICAgICAgICAgZmlsdGVyX3J1bGVzW2lkZXhdLmFjdGl2ZSA9IHRydWU7XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdmaWx0ZXJfcnVsZXMuanNvbicsIEpTT04uc3RyaW5naWZ5KGZpbHRlcl9ydWxlcyksIDApO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LlkK/nlKgnXFxuICAgICAgICAgICAgfWVsc2UgaWYgKGlucHV0ID09PSAn56aB55SoJykge1xcbiAgICAgICAgICAgICAgICBmaWx0ZXJfcnVsZXNbaWRleF0uYWN0aXZlID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdmaWx0ZXJfcnVsZXMuanNvbicsIEpTT04uc3RyaW5naWZ5KGZpbHRlcl9ydWxlcyksIDApO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LnpoHnlKgnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHNhdmVGaWxlKCdmaWx0ZXJfcnVsZXMuanNvbicsIEpTT04uc3RyaW5naWZ5KGZpbHRlcl9ydWxlcyksIDApO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5beyJyArIGlucHV0XFxuICAgICAgICB9LCBpdCwgZmlsdGVyX3J1bGVzLCBpZGV4KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICBpZGV4OmlkZXgrJydcXG4gICA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b3J5LmZvckVhY2goKGl0KT0+e1xcbiAgICAgICAgaXQuY29sX3R5cGUgPSAndGV4dF8xJztcXG4gICAgICAgIGlmKG9wdGlvbj09PSfliKDpmaQnKXtcXG4gICAgICAgICAgICBpdC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpZCk9PntcXG4gICAgICAgICAgICAgICAgbGV0IHZpZXdfaGlzdG9yeSA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ3ZpZXdfaGlzdG9yeS5qc29uJywgMCkgfHwgJ1tdJyk7XFxuICAgICAgICAgICAgICAgIGxldCBpZGV4ID0gdmlld19oaXN0b3J5LmZpbmRJbmRleCh4PT54LmV4dHJhLmlkID09PSBpZCk7XFxuICAgICAgICAgICAgICAgIHZpZXdfaGlzdG9yeS5zcGxpY2UoaWRleCwxKTtcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ3ZpZXdfaGlzdG9yeS5qc29uJywgSlNPTi5zdHJpbmdpZnkodmlld19oaXN0b3J5KSwwKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSxpdC5leHRyYS5pZCk7XFxuICAgICAgICB9XFxuICAgICAgICBkLnB1c2goaXQpO1xcbiAgICB9KTtcXG59ZWxzZXtcXG4gIGQucHVzaCh7XFxuICAgICAgdGl0bGU6J+aaguaXoOinguW9seiusOW9lSzlhYjljrvop4LnnIvkuIDkuKrop4bpopHlkKchJyxcXG4gICAgICBjb2xfdHlwZTondGV4dF9jZW50ZXJfMScsXFxuICAgICAgdXJsOidoaWtlcjovL2VtcHR5J1xcbiAgfSk7XFxufVxcbnNldFJlc3VsdChkKTtcIn0se1wibmFtZVwiOlwi5paH5Lu25LiK5LygXCIsXCJwYXRoXCI6XCJ1cGxvYWRcIixcInJ1bGVcIjpcImpzOlxcbnNldFBhZ2VUaXR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ZXcgWE1MSHR0cFJlcXVlc3QoKTtcXG4gICAgICAgICAgICAvL3hoci5zZXRSZXF1ZXN0SGVhZGVyKCdDb250ZW50LVR5cGUnLCAnYXBwbGljYXRpb24vanNvbicpO1xcbiAgICAgICAgICAgIHZhciBhY3Rpb24gPSBvYmouYmFzZV91cmwgKyBcXFwiL2FwaS9wdWJsaWMvdXBsb2FkXFxcIjsgLy/kuIrkvKDmjqXlj6NcXG4gICAgICAgICAgICAvLyBmYmEubG9nKFxcXCLmraPlnKjkuIrkvKBcXFwiKTtcXG4gICAgICAgICAgICB4aHIub25sb2FkID0gZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgIGZiYS5oaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICBpZiAoeGhyLnJlYWR5U3RhdGUgPT09IDQgJiYgeGhyLnN0YXR1cyA9PT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0T2JqID0gSlNPTi5wYXJzZSh4aHIucmVzcG9uc2VUZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coeGhyLnJlc3BvbnNlVGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICBhbGVydChcXFwi5LiK5Lyg5oiQ5YqfXFxcXG5cXFwiICsgcmVzdWx0T2JqLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgYWxlcnQoXFxcIuS4iuS8oOWksei0pVxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHhoci5vcGVuKFxcXCJQT1NUXFxcIiwgYWN0aW9uKTtcXG4gICAgICAgICAgICB4aHIuc2VuZChmb3JtKTsgLy/lj5HpgIHooajljZXmlbDmja5cXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICB3aW5kb3cuZWFzeV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cXG4gICAgICAgIGxldCBzaG93WmltdSA9IGdldEl0ZW0oJ3Nob3daaW11JywgJ+W8gCcpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+S4u+mhtTonICsgc21hbGwoY29sb3IoYmFzZXVybCwgJyNhYWFhYWEnKSksXFxuICAgICAgICAgICAgZGVzYzogJ+i3r+W+hDonICsgc21hbGwoY29sb3IocGF0aCwgJyNhYWFhYWEnKSksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnXFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IHBhc3N3b3JkID0gc3ViX3VybHMuZmluZCh4ID0+IHgudXJsLmluY2x1ZGVzKGJhc2V1cmwpKS5wYXNzd29yZCB8fCB7fTtcXG4gICAgICAgICAgICBsZXQgcmVzID0gSlNPTi5wYXJzZShwb3N0KGJhc2V1cmwgKyBcXFwiL2FwaS9wdWJsaWMvc2VhcmNoXFxcIiwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiQ29udGVudC1UeXBlXFxcIjogXFxcImFwcGxpY2F0aW9uL2pzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImF1dGhvcml6YXRpb25cXFwiOiBnZXRJdGVtKFxcXCJhdXRob3JpemF0aW9uXFxcIiwgXFxcIlxcXCIpXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgICAgICBrZXl3b3JkOiBuc2VhcmNoLFxcbiAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmQ6IHBhc3N3b3JkW3BhdGhdIHx8ICcnXFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICB0aW1lb3V0OiAkLmdldFRpbWVPdXQoKSxcXG4gICAgICAgICAgICB9KSk7XFxuXFxuICAgICAgICAgICAgbGV0IGxpc3QgPSByZXMuZGF0YTtcXG4gICAgICAgICAgICBpZiAobGlzdC5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgIHNlYXJjaFJlc3VsdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5om+5LiN5Yiw5L2g5oOz6KaB55qEypXCt+G0pcK3ypRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYoZmlsdGVyT3B0aW9uPT09J+aWh+S7ticpe1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QuZmlsdGVyKHg9PngudHlwZSE9PTEpXFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKGZpbHRlck9wdGlvbj09PSfmlofku7blpLknKXtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0LmZpbHRlcih4PT54LnR5cGU9PT0xKVxcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZihmaWx0ZXJPcHRpb24hPT0n5YWo6YOoJyl7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsdGVyX3J1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnZmlsdGVyX3J1bGVzLmpzb24nLCAwKSB8fCAnW10nKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWx0ZXJfcnVsZSA9IGZpbHRlcl9ydWxlcy5maW5kKHg9PngubmFtZT09PWZpbHRlck9wdGlvbik7XFxuICAgICAgICAgICAgICAgICAgICBpZihmaWx0ZXJfcnVsZSYmZmlsdGVyX3J1bGUucnVsZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoZmlsdGVyX3J1bGUucnVsZS5zdGFydHNXaXRoKCchJykpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5maWx0ZXIoeD0+IShuZXcgUmVnRXhwKGZpbHRlcl9ydWxlLnJ1bGUuc2xpY2UoMSkpKS50ZXN0KHgubmFtZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5maWx0ZXIoeD0+KG5ldyBSZWdFeHAoZmlsdGVyX3J1bGUucnVsZSkpLnRlc3QoeC5uYW1lKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHNob3dMb2FkaW5nKCfmkJzntKLliLAnICsgbGlzdC5sZW5ndGggKyAn5p2h57uT5p6cLOWKoOi9veS4rScpO1xcbiAgICAgICAgICAgICAgICBsaXN0LmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpdF90eXBlID0gaXRlbS50eXBlOy8v6LWE5rqQ57G75Z6LXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gaXRlbS5uYW1lOy8v6LWE5rqQ5ZCN56ewXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IGl0ZW0ucGF0aDsvL+i1hOa6kOi3r+W+hFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZXVybCArIHBhdGggKyB0aXRsZTsvL+i1hOa6kOWUr+S4gOagh+W/l1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGV4dCA9IHRpdGxlLnNwbGl0KCcuJykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGltZyA9IGl0X3R5cGUgPT09IDEgPyBpY29uX2RpY3RbJzEnXSA6IChpY29uc1tleHRdIHx8IGljb25fZGljdFtpdF90eXBlICsgJyddKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdF90eXBlID09PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicGF0aFxcXCIsIGl0ZW0ucGF0aCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGl0X3R5cGUgPT09IDMgfHwgL1xcXFwubTN1OCQvLnRlc3QodGl0bGUpKSB7IC8vM+aYr+WqkuS9kyznpoHnlKjkuIvovb3lkozot7PovaxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBnZXRMaW5rKHRpdGxlLHBhdGgsICfmiZPlvIAnLCBzaG93WmltdSwgJyNpc1ZpZGVvPXRydWUjJyx0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaXRfdHlwZSA9PT0gNikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IGdldExpbmsodGl0bGUscGF0aCwgJ+aJk+W8gCcsIHNob3daaW11LCBcXFwiIy5qcGdcXFwiLHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsgLy/ot5/pmo/ns7vnu5/pooTop4jlkozkuIvovb1cXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBnZXRMaW5rKHRpdGxlLHBhdGgsIGNsaWNrT3B0aW9uLCBzaG93WmltdSx0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHNlYXJjaFJlc3VsdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBpdF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc2hvd0RldGFpbCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRlID0gKGl0ZW0udXBkYXRlZF9hdCB8fCBpdGVtLnRpbWVfc3RyKSA/IGdldFRpbWUoaXRlbSkgOiAnXFxcXHRcXFxcdFxcXFx0XFxcXHQnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzaXplID0gaXRlbS5zaXplX3N0cjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNpemUgfHwgc2l6ZSA9PT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IGl0ZW0uc2l6ZSA9PT0gMCA/IFxcXCIvXFxcIiA6IGJ5dGVzVG9TaXplKGl0ZW0uc2l6ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpemUgJiYgc2l6ZSAhPT0gXFxcIlxcXCIgJiYgc2l6ZSAhPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gXFxcIiZuYnNwOyZuYnNwOyZuYnNwO1xcXCIgKyBzaXplO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlc2MgPSBkYXRlICsgc2l6ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2hSZXN1bHQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6dGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBzbWFsbChjb2xvcihkZXNjLCAnI2FhYWFhYScpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IGl0X3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgdG9hc3QoJ+aQnOe0oue7k+adn++8jOWNs+WwhuWKoOi9veWujOavlS4uLicpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBwdXRNeVZhcignbGFzdFNlYXJjaCcsIGxhc3RTZWFyY2gpO1xcbiAgICAgICAgICAgIGlmKCFzaG93RGV0YWlsKXsvL+mdnuivpue7huaooeW8j+aJjeiHquWKqOaMieWQjeensOaOkuW6j1xcbiAgICAgICAgICAgICAgICBzb3J0cyhzZWFyY2hSZXN1bHQsJ+WQjeensCcpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzYXZlRmlsZSgnc2VhcmNoX3Jlc3VsdHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHNlYXJjaFJlc3VsdCksIDApO1xcblxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHNlYXJjaFJlc3VsdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlpb3lg4/kuI3og73mkJzntKIs54K55Ye76L+U5ZueXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogZS5tZXNzYWdlLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdsYXN0U2VhcmNoJywgbGFzdFNlYXJjaCk7XFxuICAgICAgICAgICAgc2F2ZUZpbGUoJ3NlYXJjaF9yZXN1bHRzLmpzb24nLCBKU09OLnN0cmluZ2lmeShzZWFyY2hSZXN1bHQpLCAwKTtcXG4gICAgICAgICAgICAvLyBsb2coZS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lmIChjbGlja09wdGlvbiA9PT0gJ+aJk+W8gCcpIHtcXG4gICAgICAgICAgICBpZihleHQmJi9pc1ZpZGVvLy50ZXN0KGV4dCkmJnNob3daaW11PT09J+W8gCcpey8v5Yik5pat5omT5byA55qE5piv5aqS5L2T5paH5Lu25omN6LWw5a2X5bmV6YC76L6RXFxuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2V1cmwgKyBucGF0aDsvL+W9k+WJjeaWh+S7tueahOWUr+S4gOagh+ivhlxcbiAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOmlkLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB2YXIgbm93X2ZpbGVzID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcIm5vd19maWxlc1xcXCIsW10pOy8v6I635Y+W57yT5a2Y55qELOmBv+WFjeS6jOasoeivt+axglxcbiAgICAgICAgICAgICAgICAvLyBsb2coJ+WQjOebruW9leaWh+S7tuaVsOS4ujonK25vd19maWxlcy5sZW5ndGgpO1xcbiAgICAgICAgICAgICAgICBpZihub3dfZmlsZXMubGVuZ3RoIDwgMXx8IHJlbG9hZCl7Ly/ku47mkJzntKLov5vljrvnmoQs5Y+q6IO96YeN5paw6I635Y+W5LqGXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCB7Z2V0RmlsZXN9ID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvYXBpJyk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZGlySW5mbyA9IGdldEZpbGVzKHBhdGgsJ+aWh+S7ticpO1xcbiAgICAgICAgICAgICAgICAgICAgbm93X2ZpbGVzID0gZGlySW5mby5yZXN1bHR8fFtdO1xcbiAgICAgICAgICAgICAgICAgICAgLy8gbG9nKCfph43mlrDojrflj5blkIznm67lvZXmlofku7Y6Jytub3dfZmlsZXMubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZXM7XFxuICAgICAgICAgICAgICAgIGlmKHJlbG9hZCl7XFxuICAgICAgICAgICAgICAgICAgICBmaWxlcyA9IG5vd19maWxlcy5maWx0ZXIoeD0+eC50eXBlIT09MSYmL1xcXFwuc3J0JHxcXFxcLnZ0dCR8XFxcXC5hc3MkfFxcXFwuc3NhJC8udGVzdCh4LnRpdGxlKSkubWFwKHg9PngudGl0bGUpOyAvLyDnrZvpgInmlofku7blubbkuJTlkI3np7DlkKvlrZfluZXlkI7nvIDnmoRcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICBmaWxlcyA9IG5vd19maWxlcy5maWx0ZXIoeD0+eC50eXBlIT09MSYmL1xcXFwuc3J0JHxcXFxcLnZ0dCR8XFxcXC5hc3MkfFxcXFwuc3NhJC8udGVzdCh4Lm5hbWUpKS5tYXAoeD0+eC5uYW1lKTsgLy8g562b6YCJ5paH5Lu25bm25LiU5ZCN56ew5ZCr5a2X5bmV5ZCO57yA55qEXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8gbG9nKG5vd19maWxlcyk7XFxuICAgICAgICAgICAgICAgIGlmKGZpbGVzLmxlbmd0aCA+IDApey8v5b2T5YmN55uu5b2V5pyJ5a2X5bmV5paH5Lu2XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYmVzdEZpbGUgPSBmaWxlcy5maW5kKHg9PiQucmVtb3ZlRXh0KGlucHV0KS5pbmNsdWRlcygkLnJlbW92ZUV4dCh4KSkpOy8v6KeG6aKR5paH5Lu25Y675o6J5ZCO57yA5a6M576O5YyF5ZCr5a2X5bmV5paH5Lu25Y675ZCO57yAXFxuICAgICAgICAgICAgICAgICAgICBpZihiZXN0RmlsZSl7Ly/mib7liLDkuobmnIDnrKblkIjnmoTmlofku7blkI3np7BcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coYCR7aW5wdXR96Ieq5Yqo5Yy56YWN5pyA5L2z5aSW5oyC5a2X5bmV5paH5Lu2OiR7YmVzdEZpbGV9YCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlYWxVcmwgPSBiYXNldXJsICsgJy9kJyArIHBhdGggKyBiZXN0RmlsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnVybCA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogcmVhbFVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICQuc2F2ZUhpc3RvcnkoaWQsZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogcmVhbFVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZXMgPSBmaWxlcy5maWx0ZXIoeD0+JC5zaW1pbGFyKCQucmVtb3ZlRXh0KGlucHV0KSwkLnJlbW92ZUV4dCh4KSk+PTMwKTsvL+etm+mAieebuOS8vOW6pj4zMOeahOaWh+S7tlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlcy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzLnVuc2hpZnQoJ+S4jemcgOimgeWtl+W5lScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChmaWxlcywgMSwgXFxcIuivt+mAieaLqeWtl+W5lVxcXCIpLnNlbGVjdCgoYmFzZXVybCwgcGF0aCwgdSxleHQsaWQscGxheVVybCxkYXRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpbnB1dD09PSfkuI3pnIDopoHlrZfluZUnKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnVybCA9IHU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5zYXZlSGlzdG9yeShpZCxkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlYWxVcmwgPSBiYXNldXJsICsgJy9kJyArIHBhdGggKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEudXJsID0gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1XSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogcmVhbFVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnNhdmVIaXN0b3J5KGlkLGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBiYXNldXJsLCBwYXRoLCB1LGV4dCxpZCxwbGF5VXJsLGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEudXJsID0gdTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5zYXZlSGlzdG9yeShpZCxkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgZGF0YS51cmwgPSB1O1xcbiAgICAgICAgICAgICAgICAgICAgJC5zYXZlSGlzdG9yeShpZCxkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9ZWxzZSBpZihleHQmJi9pc1ZpZGVvLy50ZXN0KGV4dCkmJnNob3daaW11IT09J+W8gCcpe1xcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNldXJsICsgbnBhdGg7Ly/lvZPliY3mlofku7bnmoTllK/kuIDmoIfor4ZcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgIHVybDp1LFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOmlkLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAkLnNhdmVIaXN0b3J5KGlkLGRhdGEpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdVxcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChjbGlja09wdGlvbiA9PT0gJ+aJk+W8gCcpIHtcXG4gICAgICAgICAgICByZXR1cm4gdVxcbiAgICAgICAgfSBlbHNlIGlmIChjbGlja09wdGlvbiA9PT0gJ+S4i+i9vScpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVcXG4gICAgICAgIH1cXG4gICAgfWVsc2V7XFxuXFxuICAgICAgICByZXR1cm4gJChbJ+aJk+W8gCcsICfkuIvovb0nLCAn6aKE6KeIJywgJ+WkjeWItuebtOmTviddLCAyLCAn6K+36YCJ5oupMeS4quaWh+S7tuaTjeS9nCcpLnNlbGVjdCgoYmFzZXVybCwgbnBhdGgsZXh0KSA9PiB7XFxuICAgICAgICAgICAgbGV0IHU9JC5nZXRVKGJhc2V1cmwsbnBhdGgsZXh0KTtcXG4gICAgICAgICAgICBpZigvdG9hc3Q6Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHJlYWxVcmwgPSBiYXNldXJsICsgJy9kJyArIG5wYXRoO1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gJ+aJk+W8gCcpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHU7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PT0gJ+S4i+i9vScpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PT0gJ+WkjeWItuebtOmTvicpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdjb3B5Oi8vJyArIHJlYWxVcmxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09PSAn6aKE6KeIJykge1xcbiAgICAgICAgICAgICAgICBpZiAoL1xcXFwubWQkLy50ZXN0KHJlYWxVcmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZW5kZXJUZXh0KHJlYWxVcmwsJ21kJyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFwuaHRtbCR8XFxcXC5qc29uJHxcXFxcLmpzJHxcXFxcLmNzcyR8XFxcXC5weSR8XFxcXC5waHAkfFxcXFwuZ28kLy50ZXN0KHJlYWxVcmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZW5kZXJUZXh0KHJlYWxVcmwsJ2NvZGUnKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXC50eHQkLy50ZXN0KHJlYWxVcmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZW5kZXJUZXh0KHJlYWxVcmwsJ3R4dCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcLnBkZiQvLnRlc3QocmVhbFVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwieDU6Ly9odHRwczovL2FsaXN0LW9yZy5naXRodWIuaW8vcGRmLmpzL3dlYi92aWV3ZXIuaHRtbD9maWxlPVxcXCIgKyByZWFsVXJsXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5pc09mZmljZShyZWFsVXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ4NTovL2h0dHBzOi8vdmlldy5vZmZpY2VhcHBzLmxpdmUuY29tL29wL3ZpZXcuYXNweD9zcmM9XFxcIiArIHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWJfdXJscyA9ICQuZ2V0X3N1Yl91cmxzKCk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGFzc3dvcmQgPSBzdWJfdXJscy5maW5kKHggPT4geC51cmwuaW5jbHVkZXMoYmFzZXVybCkpLnBhc3N3b3JkIHx8IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocG9zdChiYXNldXJsICsgXFxcIi9hcGkvcHVibGljL3ByZXZpZXdcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29udGVudC1UeXBlXFxcIjogXFxcImFwcGxpY2F0aW9uL2pzb25cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IG5wYXRoLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDogcGFzc3dvcmRbbnBhdGhdIHx8IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6ICQuZ2V0VGltZU91dCgpLFxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcy5kYXRhKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5kYXRhLnByZXZpZXdfdXJsICsgJyZhY2Nlc3NfdG9rZW49JyArIHJlcy5kYXRhLmFjY2Vzc190b2tlbjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycgKyByZXMubWVzc2FnZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0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JlYScsXFxuICAgICAgICBpZDond2ViZGF2X3BhdGgnLFxcbiAgICAgICAgZGVmYXVsdFZhbHVlOmdldE15VmFyKCd3ZWJkYXZfcGF0aCcsJycpLFxcbiAgICAgICAgb25DaGFuZ2U6XFxcInB1dE15VmFyKCd3ZWJkYXZfcGF0aCcsaW5wdXQpXFxcIixcXG4gICAgfVxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi6YCJ5oup5paH5Lu26Lev5b6EXFxcIixcXG4gICAgdXJsOiQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCk9PntcXG4gICAgICAgIGxldCBmcD1jb25maWcubGliLmZpbGVTZWxlY3Q7XFxuICAgICAgICBsZXQgZj0kLnJjKGZwKTtcXG4gICAgICAgIHJldHVybiBmLmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKFxcXCJ3ZWJkYXZfcGF0aFxcXCIpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJ3ZWJkYXZfcGF0aFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd3ZWJkYXZfcGF0aCcsUEFUSCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG9uQ2xpY2tUeXBlOidjb25maXJtJyxcXG4gICAgICAgICAgICBmaWxlVHlwZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGF0dGVybjogMCxcXG4gICAgICAgICAgICByZXF1aXJlVXJsOmZwLFxcbiAgICAgICAgICAgIGluaXRpYWxQYXRoOmdldFBhdGgoJ2hpa2VyOi8vZmlsZXMvJykuc2xpY2UoNyksXFxuICAgICAgICAgICAgbWVtb3J5Oid0cnVlJyxcXG4gICAgICAgIH0pO1xcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG59KTtcXG5cXG5zZXRSZXN1bHQoZClcIn1dIiwiaWNvbiI6Imh0dHBzOi8vY2RuLmpzZGVsaXZyLm5ldC9naC9hbGlzdC1vcmcvbG9nb0BtYWluL2Nhbl9jaXJjbGUuc3ZnIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment