xiaomianao666

小程序:轻合集.藍凋

Nov 1st, 2024
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@轻合集.藍凋@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6L275ZCI6ZuGLuiXjeWHiyIsImF1dGhvciI6Iui9u+WQiOmbhueUn+aIkOWZqCIsInVybCI6Imhpa2VyOi8vZW1wdHkiLCJ2ZXJzaW9uIjoxMDAsImNvbF90eXBlIjoiaWNvbl9yb3VuZF9zbWFsbF80IiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJhbGwiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbi8v5YWz6Zet6Ieq5a6a5LmJ5YiG57G777yfXG5jb25zdCBkZWZhdWx0RGlzVGFiTW9kaWZ5ID0gdHJ1ZTtcbmNvbnN0IFFJTkdfVElUTEUgPSBnZXRNeVZhcignbXlDb2xsZWN0aW9uJyksXG4gICAgbmV3V2luZG93ID0gcmVhZEZpbGUoJ25ld1dpbmRvdycpLFxuICAgIHR5cGVTaG93ID0gZ2V0TXlWYXIoJ3R5cGVTaG93JywgJycpO1xubGV0IGRpc1RhYk1vZGlmeSA9IHJlYWRGaWxlKCdkaXNUYWJNb2RpZnknKTtcbmlmKGRpc1RhYk1vZGlmeT09PScnKXtcbiAgICBzYXZlRmlsZSgnZGlzVGFiTW9kaWZ5JywgZGVmYXVsdERpc1RhYk1vZGlmeSsnJyk7XG4gICAgZGlzVGFiTW9kaWZ5ID0gZGVmYXVsdERpc1RhYk1vZGlmeTtcbn1lbHNlIGlmKC90cnVlfGZhbHNlLy50ZXN0KGRpc1RhYk1vZGlmeSkpe1xuICAgIGRpc1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ICBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gdi50eXBlID09PSB0eXBlU2hvdyk7XG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoIWRpc1RhYk1vZGlmeSl7XG4gICAgICAgICAgICAgICAgICAgIHR5cGVOb3cgPSB0eXBlU2hvdyB8fCAn5YWo6YOoJztcbiAgICAgICAgICAgICAgICAgICAgaWYodHlwZU5vdz09PSflhbbku5YnKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gcnVsZXMuZmlsdGVyKCh2KSA9PiAhdi5zb3J0X3VybCk7XG4gICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKHR5cGVOb3chPT0n5YWo6YOoJyl7XG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gdi5zb3J0X3VybD09PXR5cGVOb3cpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcylcbiAgICAgICAgICAgIH0sIFFJTkdfVElUTEUsIHR5cGVTaG93LGRpc1RhYk1vZGlmeSksXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdzZWFyY2hLZXknLCAnJyksXG4gICAgICAgICAgICBvbkNoYW5nZTogXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcIlxuICAgICAgICB9XG4gICAgfV0sXG4gICAgcnVsZXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9kYXRhTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFKSgpO1xuXG5pZihkaXNUYWJNb2RpZnkpIHtcbiAgICB0eXBlcyA9IHsgJyc6ICflhajpg6gnLCAnYWxsJzogJ+iBmuWQiCcsICd2aWRlbyc6ICfop4bpopEnLCAnbXVzaWMnOiAn6Z+z6aKRJywgJ2xpdmUnOiAn55u05pKtJywgJ2NhcnRvb24nOiAn5ryr55S7JywgJ3JlYWQnOiAn6ZiF6K+7JywgJ3BpY3R1cmUnOiAn5Zu+6ZuGJywgJ25ld3MnOiAn6LWE6K6vJywgJ3Rvb2wnOiAn5bel5YW3JywgJ290aGVyJzogJ+WFtuWugycgfTtcbiAgICBmb3IgKGxldCBrIGluIHR5cGVzKSB7XG4gICAgICAgIGlmICghayB8fCBydWxlcy5maW5kKCh2KSA9PiB2LnR5cGUgPT09IGspKSB7XG4gICAgICAgICAgICBsZXQgdGl0bGUgPSAn4oCc4oCc4oCd4oCdJyArIChrID09PSB0eXBlU2hvdyA/IHR5cGVzW2tdLmJvbGQoKS5mb250Y29sb3IoJyMxMmI2NjgnKSA6IHR5cGVzW2tdKTtcbiAgICAgICAgICAgIGxldCBjbnQgPSBydWxlcy5maWx0ZXIoaXQgPT4gIWsgfHwgaXQudHlwZSA9PT0gaykubGVuZ3RoO1xuICAgICAgICAgICAgZWwucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlICsgJyAnICsgY29sb3IoY250LCAnI2ZmNzAwMCcpLFxuICAgICAgICAgICAgICAgIHVybDogayA9PT0gdHlwZVNob3cgPyAnaGlrZXI6Ly9lbXB0eScgOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChrKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd0eXBlU2hvdycsIGspXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICAgICAgfSwgayksXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xuICAgICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICh0eXBlU2hvdykge1xuICAgICAgICBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gdi50eXBlID09PSB0eXBlU2hvdyk7XG4gICAgfVxufWVsc2V7XG4gICAgdHlwZXMgPSBydWxlcy5tYXAoaXQgPT4gaXQuc29ydF91cmwgfHwgXCLlhbbku5ZcIik7XG4gICAgdHlwZXMudW5zaGlmdCgn5YWo6YOoJyk7XG4gICAgdHlwZXMgPSB1bmlxdWUyKHR5cGVzKTtcbiAgICB0eXBlTm93ID0gdHlwZVNob3cgfHwgJ+WFqOmDqCc7XG4gICAgZm9yIChsZXQgayBpbiB0eXBlcykge1xuICAgICAgICBsZXQgaXRzID0gdHlwZXNba107XG4gICAgICAgIGxldCB0aXRsZSA9ICfigJzigJzigJ3igJ0nICsgKGl0cyA9PT0gdHlwZU5vdyA/IGl0cy5ib2xkKCkuZm9udGNvbG9yKCcjMTJiNjY4JykgOiBpdHMpO1xuICAgICAgICBsZXQgY250O1xuICAgICAgICBpZiAoaXRzID09PSAn5YWo6YOoJykge1xuICAgICAgICAgICAgY250ID0gcnVsZXMubGVuZ3RoXG4gICAgICAgIH0gZWxzZSBpZiAoaXRzID09PSAn5YW25LuWJykge1xuICAgICAgICAgICAgY250ID0gcnVsZXMuZmlsdGVyKGl0ID0+ICFpdC5zb3J0X3VybCkubGVuZ3RoO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY250ID0gcnVsZXMuZmlsdGVyKGl0ID0+IGl0LnNvcnRfdXJsID09PSBpdHMpLmxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgICBlbC5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArICcgJyArIGNvbG9yKGNudCwgJyNmZjcwMDAnKSxcbiAgICAgICAgICAgIHVybDogaXRzID09PSB0eXBlTm93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaXRzKSA9PiB7XG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3R5cGVTaG93JywgaXRzKTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmY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ogJzEnLFxuICAgICAgICBkb21haW4gPSAoLyhodHRwcz86XFwvXFwvLis/KSg/OlxcL3wkKS9pLmV4ZWMocnVsZVRtcC51cmwpIHx8IFssICdoaWtlcjovL2VtcHR5J10pWzFdLFxuICAgICAgICBkID0ge1xuICAgICAgICAgICAgdGl0bGU6IHYudGl0bGUsXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2UvZnJhbWVMb2FkJyxcbiAgICAgICAgICAgIGltZzogdi5pY29uIHx8ICdoaWtlcjovL2ltYWdlcy9pY29uMScsXG4gICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgIHVybDogZG9tYWluICsgJy8jbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjIyMjJyArIEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHJ1bGVUbXApKSxcbiAgICAgICAgICAgICAgICAgICAgcGFnZU51bTogZnlwYWdlLFxuICAgICAgICAgICAgICAgICAgICBRSU5HX1RJVExFOiBnZXRNeVZhcignbXlDb2xsZWN0aW9uJylcbiAgICAgICAgICAgICAgICB9KSArICcuanM6ZXZhbChKU09OLnBhcnNlKGZldGNoKFwiaGlrZXI6Ly9wYWdlL3VybFBhcnNl77yf77yfcnVsZT0nICsgUUlOR19USVRMRSArICdcIikpLnJ1bGUp77yb77ybaW5kZXhVcmwoaW5wdXQpOycgKyBwYXJhbUhhbmRsZSh1cmxQYXJhbSwgdi51YSksXG4gICAgICAgICAgICAgICAgUlVMRTogeyB0aXRsZTogdi50aXRsZSB9LFxuICAgICAgICAgICAgICAgIGlzSW5kZXg6IHRydWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIGlmIChuZXdXaW5kb3cpIE9iamVjdC5hc3NpZ24oZC5leHRyYSwge1xuICAgICAgICBuZXdXaW5kb3c6IHRydWUsXG4gICAgICAgIHdpbmRvd0lkOiBRS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gZGlzVGFiTW9kaWZ5ID0gSlNPTi5wYXJzZShkaXNUYWJNb2RpZnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHJ1bGVzID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZGF0YUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRSkoKTtcbiAgICAgICAgICAgIGlmIChkaXNUYWJNb2RpZnkmJnR5cGVTaG93KSB7XG4gICAgICAgICAgICAgICAgcnVsZXMgPSBydWxlcy5maWx0ZXIoKHYpID0+IHYudHlwZSA9PT0gdHlwZVNob3cpO1xuICAgICAgICAgICAgfWVsc2UgaWYoIWRpc1RhYk1vZGlmeSl7XG4gICAgICAgICAgICAgICAgdHlwZU5vdyA9IHR5cGVTaG93IHx8ICflhajpg6gnO1xuICAgICAgICAgICAgICAgIGlmKHR5cGVOb3c9PT0n5YW25LuWJyl7XG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gcnVsZXMuZmlsdGVyKCh2KSA9PiAhdi5zb3J0X3VybCk7XG4gICAgICAgICAgICAgICAgfWVsc2UgaWYodHlwZU5vdyE9PSflhajpg6gnKXtcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSBydWxlcy5maWx0ZXIoKHYpID0+IHYuc29ydF91cmw9PT10eXBlTm93KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocnVsZXMpXG4gICAgICAgIH0pXG4gICAgfVxufV0pOyIsImRldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJkZXRhaWxfZmluZF9ydWxlIjoiIiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6IiIsInVhIjoiYXV0byIsInByZVJ1bGUiOiJwdXRNeVZhcignbXlDb2xsZWN0aW9uJywgTVlfUlVMRS50aXRsZSk7XG5wdXRNeVZhcigncmVtb3RlVX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1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2ZvbGRfJyArIHNpZ24sIHsgJyc6ICdUJywgJ1QnOiAnJyB9IFtmb2xkZWRdKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgZm9sZGVkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IGFyciA9IGZvbGRlZCA/IFt0aGlzLmFyclswXV0gOiB0aGlzLmFyclxcbiAgICAgICAgYXJyLmZvckVhY2goKHYpID0+IHtcXG4gICAgICAgICAgICBsZXQgeyBpZCwgY2xhc3NfbmFtZSwgY2xhc3NfdXJsIH0gPSB2LFxcbiAgICAgICAgICAgIHNlbGVjdGVkID0gSlNPTi5zdHJpbmdpZnkodGhpcy5nZXRDbGFzcyhpZCkpXFxuICAgICAgICAgICAgY2xhc3NfbmFtZS5mb3JFYWNoKChuYW1lLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBjbGFzc191cmxbaV0sXFxuICAgICAgICAgICAgICAgICAgICBub3cgPSBKU09OLnN0cmluZ2lmeSh7IG5hbWU6IG5hbWUsIHVybDogdXJsIH0pXFxuICAgICAgICAgICAgICAgIGVsLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ0nICsgbmFtZS5mb250Y29sb3IodGhpcy5jb2xvcikuYm9sZCgpIDogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc2VsZWN0ZWQgPT0gbm93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICB9LCB0aGlzLnNpZ24sIGlkLCBub3cpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZWwucHVzaCh7IGNvbF90eXBlOiB0aGlzLmJvdW5kYXJ5IH0pXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBpbml0KGNsYXNzT2JqZWN0KSB7XFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX25hbWUgPT0gJ3N0cmluZycpXFxuICAgICAgICAgICAgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9IGNsYXNzT2JqZWN0LmNsYXNzX25hbWUuc3BsaXQoJyYnKVxcbiAgICAgICAgaWYgKHR5cGVvZiBjbGFzc09iamVjdC5jbGFzc191cmwgPT0gJ3N0cmluZycpXFxuICAgICAgICAgICAgY2xhc3NPYmplY3QuY2xhc3NfdXJsID0gY2xhc3NPYmplY3QuY2xhc3NfdXJsLnNwbGl0KCcmJykubWFwKCh2KSA9PiB2LnRyaW0oKSlcXG4gICAgICAgIHJldHVybiBjbGFzc09iamVjdFxcbiAgICB9LFxcbiAgICBwdXNoKGNsYXNzT2JqZWN0KSB7XFxuICAgICAgICB0aGlzLmFyci5wdXNoKHRoaXMuaW5pdChjbGFzc09iamVjdCkpXFxuICAgIH0sXFxuICAgIGdldENsYXNzKGlkKSB7XFxuICAgICAgICBsZXQgZGVmYXVsdENsYXNzID0gdGhpcy5hcnIuZmluZChpdGVtID0+IGl0ZW0uaWQgPT0gaWQpXFxuICA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ICAgIGN1c3RvbURhdGEgPSByZWFkRmlsZSgnY3VzdG9tRGF0YScpXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShpbnB1dCwgSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSW50ZXJ2YWw6IHVwZGF0ZUludGVydmFsLFxcbiAgICAgICAgICAgICAgICAgICAgbmV3V2luZG93OiBuZXdXaW5kb3csXFxuICAgICAgICAgICAgICAgICAgICB0YWJGb2xkOiB0YWJGb2xkLFxcbiAgICAgICAgICAgICAgICAgICAgZGlzYWJsZUN1c3RvbTogZGlzYWJsZUN1c3RvbSxcXG4gICAgICAgICAgICAgICAgICAgIGN1c3RvbURhdGE6IGN1c3RvbURhdGEsXFxuICAgICAgICAgICAgICAgICAgICBydWxlczogcnVsZXNcXG4gICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LlpIfku73vvIzms6jmhI/oi6Xku5PlupPkuLrlrZDpobXpnaLliJnkuI3lpIfku70nXFxuICAgICAgICAgICAgfSwgdXJsLCB1cGRhdGVJbnRlcnZhbCwgbmV3V2luZG93LCB0YWJGb2xkLCBkaXNhYmxlQ3VzdG9tKVxcbiAgICAgICAgZWxzZSByZXR1cm4gJCgnaGlrZXI6Ly9maWxlcy90bXAvJyArIFFJTkdfVElUTEUgKyAnX2JhY2t1cC5qc29uJywgJ+i+k+WFpeWkh+S7vei3r+W+hCcpLmlucHV0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICBsZXQgeyB1cGRhdGVJbnRlcnZhbCwgbmV3V2luZG93LCB0YWJGb2xkLCBkaXNhYmxlQ3VzdG9tLCBjdXN0b21EYXRhLCBydWxlcyB9ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KSlcXG4gICAgICAgICAgICBzYXZlRmlsZSgndXBkYXRlSW50ZXJ2YWwnLCB1cGRhdGVJbnRlcnZhbClcXG4gICAgICAgICAg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GF0YSA6IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKSkuZm9yRWFjaCgodiwgaSkgPT4ge1xcbiAgICBsZXQgZCA9IHsgdGl0bGU6IHYudGl0bGUsIGltZzogZGF0YVtpXS5pY29uIH1cXG4gICAgc3dpdGNoIChlZGl0TW9kZSkge1xcbiAgICAgICAgY2FzZSAn5ZCv55SoL+emgeeUqCc6XFxuICAgICAgICAgICAgZC50aXRsZSA9ICh2LnZpc2libGUgPyAn8J+foiAgJyA6ICfwn5S0ICAnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgIHJ1bGVzW2ldLnZpc2libGUgPSAhcnVsZXNbaV0udmlzaWJsZVxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5pY29uID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJ1bGVzW2ldLmljb25cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5a+85YWl5rW36ZiUJzpcXG4gICAgICAgICAgICBkLnVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShkYXRhW2ldKSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICB9XFxuICAgIGVsLnB1c2goZClcXG59KVxcbnNldFJlc3VsdChlbClcXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIumhtemdoui9veWFpVwiLFwicGF0aFwiOlwiZnJhbWVMb2FkXCIsXCJydWxlXCI6XCJqczpcXG5jb25zdCBRSU5HX1RJVExFID0gZ2V0TXlWYXIoJ215Q29sbGVjdGlvbicpXFxubGV0IG15Q29sbGVjdGlvbl9lbCA9IFtdLFxcbiAgICB7IFJVTEUsIGlzSW5kZXgsIHBhZ2VUaXRsZSB9ID0gTVlfUEFSQU1TLFxcbiAgICB0aGlzUlVMRSA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2RhdGFMb2FkP3J1bGU9JyArIFFJTkdfVElUTEUpKCkuZmluZCgodikgPT4gdi50aXRsZSA9PSBS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yYW1zOiB2LmV4dHJhIHx8IHt9IH0pXFxuICAgICAgICAgICAgdi5jb2xfdHlwZSA9IHYuY29sX3R5cGUgfHwgTVlfUlVMRS5jb2xfdHlwZVxcblxcbiAgICAgICAgICAgIGlmICghdi51cmwgfHwgWydydWxlJywgJ3BpY3MnLCAndG9hc3QnLCAnaW5wdXQnLCAnY29weScsICdlZGl0RmlsZScsICd4NScsICd4NVdlYlZpZXcnLCAneDVQbGF5JywgJ3dlYicsICdzZWxlY3QnLCAneDVSdWxlJywgJ3dlYlJ1bGUnLCAnZG93bmxvYWQnLCAnc2hhcmUnXS5maW5kKCh2dikgPT4gdi51cmwuc3RhcnRzV2l0aCh2diArICc6Ly8nKSkgfHwgWyd4NV93ZWJ2aWV3X3NpbmdsZScsICdpbnB1dCddLmZpbmQoKHZ2KSA9PiB2LmNvbF90eXBlID09IHZ2KSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodi51cmwuaW5jbHVkZXMoJ0BydWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCBbXywgdXJsLCBydWxlXSA9IHYudXJsLm1hdGNoKC9eKFtcXFxcc1xcXFxTXSo/KUBydWxlPShbXFxcXHNcXFxcU10qKSQvKVxcbiAgICAgICAgICAgICAgICB2LnVybCA9IHVybFxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfZmluZF9ydWxlID0gcnVsZVxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfY29sX3R5cGUgPSBNWV9SVUxFLmNvbF90eXBlXFxuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5zdGFydHNXaXRoKCdoaWtlcjovL3BhZ2UvJykpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHYudXJsLmluY2x1ZGVzKCdydWxlPScpIHx8ICh2LmV4dHJhIHx8IHt9KS5ydWxlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICAgICAgbGV0IFtfLCBwYXRoLCBmbGFnLCBwYXJhbXNdID0gdi51cmwubWF0Y2goL15oaWtlcjpcXFxcL1xcXFwvcGFnZVxcXFwvKC4rPykoIy4qPyk/KD86XFxcXD8oLiopKT8kLyksXFxuICAgICAgICAgICAgICAgICAgICBzdWJQYWdlID0gTVlfUlVMRS5wYWdlTGlzdC5maW5kKCh2KSA9PiB2LnBhdGggPT0gcGF0aCksXFxuICAgICAgICAgICAgICAgICAgICBzdWJVcmwgPSAocGFyYW1zIHx8ICcnKS5zcGxpdCgnJicpLmZpbmQoKHYpID0+IHYuc3RhcnRzV2l0aCgndXJsPScpKVxcbiAgICAgICAgICAgICAgICB2LnVybCA9IChzdWJVcmwgPyBzdWJVcmwuc2xpY2UoNCkucmVwbGFjZSgv77yf77yfL2csICc/JykucmVwbGFjZSgv77yG77yGL2csICcmJykgOiAodi5leHRyYSB8fCB7fSkudXJsKSB8fCAnaGlrZXI6Ly9lbXB0eScgKyBmbGFnICsgJz8nICsgKHBhcmFtcyB8fCAnJylcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSA9IHN1YlBhZ2UucnVsZVxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfY29sX3R5cGUgPSBzdWJQYWdlLmNvbF90eXBlXFxuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gdi51cmwuaW5kZXhPZignLmpzOicpXFxuICAgICAgICAgICAgICAgIGlmIChyZUluZGV4ID49IDApIHYudXJsID0gdi51cmwuc2xpY2UoMCwgcmVJbmRleCkgKyAnLmpzOlxcXFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsICcgKyBhc3NpZ25MYXp5UnVsZSArICcpOycgKyB2LnVybC5zbGljZShyZUluZGV4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bmRSdWxlID0gZmluZFJ1bGUuc3BsaXQoJzsnKVxcbiAgICBwYXJzZURvbUZvckFycmF5KGdldFJlc0NvZGUoKSwgZmluZFJ1bGUuc2hpZnQoKSkuZm9yRWFjaCgoZGF0YSkgPT4ge1xcbiAgICAgICAgbGV0IFt0aXRsZSwgaW1nLCBkZXNjLCB1cmxdID0gZmluZFJ1bGUubWFwKCh2LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodiA9PSAnKicpIHJldHVybiAnJ1xcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDMpID9cXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbShkYXRhLCB2KSA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAzKSB2ID0gcnVuQ29kZSh2KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgeyByZXR1cm4gJycgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIHJlcyA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYywgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgaWYgKHJlcy51cmwpIHtcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gcmVzLnVybC5pbmRleE9mKCcuanM6JylcXG4gICAgICAgICAgICAgICAgaWYgKHJlSW5kZXggPj0gMCkgcmVzLnVybCA9IHJlcy51cmwuc2xpY2UoMCwgcmVJbmRleCkgKyAnLmpzOlxcXFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsICcgKyBhc3NpZ25MYXp5UnVsZSArICcpOycgKyByZXMudXJsLnNsaWNlKHJlSW5kZXggKyA0KVxcbiAgICAgICAgICAgIH0gZWxzZSAgaWYgKGRldGFpbEZpbmRSdWxlKSB7XFxuICAgICAgICAgICAgICAgIHJlcy5leHRyYSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZ2VuRXhVcmwodXJsKSxcXG4gICAgICAgICAgICAgICAgICAgIFJVTEU6IE9iamVjdC5hc3NpZ24oZ2VuTXlSdWxlKCksIHsgZGV0YWlsX2ZpbmRfcnVsZTogZGV0YWlsRmluZFJ1bGUgfSksXFxuICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGlzSW5kZXggJiYgdGl0bGVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXMudXJsID0gJ2hpa2VyOi8vcGFnZS9mcmFtZUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoTVlfUlVMRS5kZXRhaWxfZmluZF9ydWxlKSB7XFxuICAgICAgICAgICAgICAgIHJlcy5leHRyYSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZ2VuRXhVcmwodXJsKSxcXG4gICAgICAgICAgICAgICAgICAgIFJVTEU6IGdlbk15UnVsZSgpLFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpc0luZGV4ICYmIHRpdGxlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9ICdoaWtlcjovL3BhZ2UvZnJhbWVMb2FkP3J1bGU9JyArIFFJTkdfVElUTEVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBteUNvbGxlY3Rpb25fZWwucHVz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Cc4oCd4oCdXFxcIiwgXFxcIlxcXCIpO1xcbiAgICB9XFxuICAgIHJldHVybiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCI8XFxcIiArIHRhZyArIFxcXCI+XFxcIiArIHRleHQgKyBcXFwiPC9cXFwiICsgdGFnICsgXFxcIj5cXFwiO1xcblxcbn1cXG5cXG5mdW5jdGlvbiBnZXROb3dGb3JtYXREYXRlKCkge1xcbiAgICAgICAgICAgIGxldCBkYXRlID0gbmV3IERhdGUoKTtcXG4gICAgICAgICAgICBsZXQgc2VwZXJhdG9yMSA9IFxcXCItXFxcIjtcXG4gICAgICAgICAgICBsZXQgc2VwZXJhdG9yMiA9IFxcXCI6XFxcIjtcXG4gICAgICAgICAgICBsZXQgbW9udGggPSBkYXRlLmdldE1vbnRoKCkgKyAxO1xcbiAgICAgICAgICAgIGxldCBzdHJEYXRlID0gZGF0ZS5nZXREYXRlKCk7XFxuICAgICAgICAgICAgbGV0IHN0ckhvdXJzID0gZGF0ZS5nZXRIb3VycygpO1xcbiAgICAgICAgICAgIGxldCBzdHJNaW51dGVzID0gZGF0ZS5nZXRNaW51dGVzKCk7XFxuICAgICAgICAgICAgbGV0IHN0clNlY29uZHMgPSBkYXRlLmdldFNlY29uZHMoKSsxO1xcbiAgICAgICAgICAgIGlmIChtb250aCA+PSAxICYmIG1vbnRoIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgbW9udGggPSBcXFwiMFxcXCIgKyBtb250aFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyRGF0ZSA+PSAwICYmIHN0ckRhdGUgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJEYXRlID0gXFxcIjBcXFwiICsgc3RyRGF0ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RySG91cnMgPj0gMCAmJiBzdHJIb3VycyA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckhvdXJzID0gXFxcIjBcXFwiICs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