Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_随手小说下载@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICDpmo/miYvlsI/or7TkuIvovb0KLy8gQG5hbWVzcGFjZSAgICB5dGhvbmcKLy8gQHZlcnNpb24gICAgICAwLjQuMS42Ci8vIEBkZXNjcmlwdGlvbiAg5bim5Zu+5b2i5YyW55WM6Z2i55qE5bCP6K+05LiL6L295Zmo44CC5Lu75oSP572R56uZ77yM6Ieq5Yqo6K+G5Yir5Lu75L2V55uu5b2V5YiX6KGo77yM6Ieq5Yqo6K+G5Yir5q2j5paH77yM6Ieq55Sx5LiL6L2977yM566A5Y2V55u06KeC44CCCi8vIEBhdXRob3IgICAgICAgeXRob25nCi8vIEBtYXRjaCAgICAgICAgaHR0cDovLyovKgovLyBAbWF0Y2ggICAgICAgIGh0dHBzOi8vKi8qCi8vIEByZXF1aXJlICAgICAgaHR0cHM6Ly9ncmVhc3lmb3JrLm9yZy9zY3JpcHRzLzQ1MDgyOS1udW1iZXJkaWdpdC9jb2RlL251bWJlckRpZ2l0LmpzP3ZlcnNpb249MTA5MDMxMAovLyBAcmVxdWlyZSAgICAgIGh0dHBzOi8vZ3JlYXN5Zm9yay5vcmcvc2NyaXB0cy80NTA5NDgtcmVhZGVyL2NvZGUvUmVhZGVyLmpzP3ZlcnNpb249MTA5ODYyNwovLyBAcmVxdWlyZSAgICAgIGh0dHBzOi8vZ3JlYXN5Zm9yay5vcmcvc2NyaXB0cy80NTIwODUtbXltZDUvY29kZS9teU1kNS5qcz92ZXJzaW9uPTEwOTgyNjYKLy8gQHJlcXVpcmUgICAgICBodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9jb2RlbWlycm9yLzUuMzIuMC9jb2RlbWlycm9yLm1pbi5qcwovLyBAcmVxdWlyZSAgICAgIGh0dHBzOi8vY2RuanMuY2xvdWR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tZS50b0xvY2FsZUxvd2VyQ2FzZSgpOwogICAgICAgIC8vICAgICAgICBpZiAoZWxlLmlkKSB7CiAgICAgICAgLy8gICAgICAgICAgICByZXR1cm4gJyMnICsgZ2V0UmlnaHRJZChlbGUuaWQpOwogICAgICAgIC8vICAgICAgICB9IGVsc2UgewogICAgICAgIHJldHVybiB0YWcgKyBnZXRDc3NDbGFzcyhlbGUuY2xhc3NOYW1lKTsKICAgICAgICAvLyAgICAgICAgfQogICAgfQogICAgZnVuY3Rpb24gZ2V0QW5jZXN0b3JXaXRoTW9zdFNpbWlsYXJEZXNjZW5kYW50KGVsZSwgdGFnKSB7CiAgICAgICAgdmFyIHNlbGVjdG9yID0gdGFnOwogICAgICAgIHZhciBtYXhFbGUsIG1heFNlbGVjdG9yLCBjb3VudCA9IDA7CiAgICAgICAgd2hpbGUgKHRydWUpIHsKICAgICAgICAgICAgZWxlID0gZWxlLnBhcmVudEVsZW1lbnQ7CiAgICAgICAgICAgIGlmICghZWxlIHx8IGVsZS50YWdOYW1lID09ICdIVE1MJykgYnJlYWs7CiAgICAgICAgICAgIHZhciBhYSA9IGVsZS5xdWVyeVNlbGVjdG9yQWxsKCc6c2NvcGU+JyArIHNlbGVjdG9yKTsKICAgICAgICAgICAgaWYgKGFhLmxlbmd0aCA+IGNvdW50KSB7CiAgICAgICAgICAgICAgICBjb3VudCA9IGFhLmxlbmd0aDsKICAgICAgICAgICAgICAgIG1heEVsZSA9IGVsZTsKICAgICAgICAgICAgICAgIG1heFNlbGVjdG9yID0gc2VsZWN0b3I7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VsZWN0b3IgPSBnZXRFbGVtZW50VGhpc1NlbGVjdG9yKGVsZSkgKyAiPiIgKyBzZWxlY3RvcjsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIFttYXhFbGUsIG1heFNlbGVjdG9yLCBjb3VudF07CiAgICB9CiAgICBmdW5jdGlvbiBnZXRBbmNlc3RvcldpdGhNb3N0U2ltaWxhcl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PSBkb2MucXVlcnlTZWxlY3RvckFsbCgiYSIpLCBuZXh0UGFnZSA9IG51bGw7CiAgICAgICAgZm9yIChsZXQgZWxlIG9mIGVsZXMpIHsKICAgICAgICAgICAgaWYgKG5leHRMaXN0UmVnLnRlc3QoZWxlLmlubmVyVGV4dCkgJiYgZWxlLmhyZWYuaW5kZXhPZigiamF2YXNjcmlwdCIpID09IC0xKSByZXR1cm4gZWxlOwogICAgICAgIH0KICAgICAgICBlbGVzID0gZG9jLnF1ZXJ5U2VsZWN0b3JBbGwoInNwYW4iKQogICAgICAgIGZvciAobGV0IGVsZSBvZiBlbGVzKSB7CiAgICAgICAgICAgIGlmIChuZXh0TGlzdFJlZy50ZXN0KGVsZS5pbm5lclRleHQpKSByZXR1cm4gZWxlOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBnZXRSZXN0TGlzdChkb2MpewogICAgICAgIGZ1bmN0aW9uIGNoYW5nZVJlc3RMaXN0VGV4dChzdHIpewogICAgICAgICAgICBpZihzdHIpewogICAgICAgICAgICAgICAgZ2V0UmVzdExpc3QuaW5uZXJUZXh0PWDnrKwke25leHRMaXN0Q291bnR96aG1YDsKICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoKCk9PnsKICAgICAgICAgICAgICAgICAgICBhbGVydChzdHIpOwogICAgICAgICAgICAgICAgICAgIGdldFJlc3RMaXN0LmlubmVyVGV4dD0n57ut6aG155uu5b2VJzsKICAgICAgICAgICAgICAgICAgICBnZXRSZXN0TGlzdC5kaXNhYmxlZD1mYWxzZTsKICAgICAgICAgICAgICAgIH0sMTAwKTsKICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICBnZXRSZXN0TGlzdC5pbm5lclRleHQ9YOesrCR7bmV4dExpc3RDb3VudH3pobVgOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGZ1bmN0aW9uIHdhaXRHZXRMaXN0KCl7CiAgICAgICAgICAgIGZ1bmN0aW9uIGdldExpc3RMb29wKCl7CiAgICAgICAgICAgICAgICBpZihjb3VudD4xMCkgcmV0dXJuIGNoYW5nZVJlc3RMaXN0VGV4dCgi6I635Y+W57ut6aG157uT5p2fIikKICAgICAgICAgICAgICAgIGNvdW50Kz0xOwogICAgICAgICAgICAgICAgdmFyIGFkZENvdW50PWdldExpc3QoZG9jKTsKICAgICAgICAgICAgICAgIGlmKGFkZENvdW50KXsKICAgICAgICAgICAgICAgICAgICBuZXh0TGlzdENvdW50Kz0xOwogICAgICAgICAgICAgICAgICAgIGNoYW5nZVJlc3RMaXN0VGV4dCgpOwogICAgICAgICAgICAgICAgICAgIG5leHRMaXN0PWdldE5leHRMaXN0KGRvYyk7CiAgICAgICAgICAgICAgICAgICAgaWYobmV4dExpc3QpewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0TGlzdC5jbGljaygpOwogICAgICAgICAgICAgICAgICAgICAgICB3YWl0R2V0TGlzdCgpOwogICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2hhbmdlUmVzdExpc3RUZXh0KCLmib7kuI3liLDkuIvkuIDpobXvvIzojrflj5bnu63pobXnu5PmnZ8iKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgc2V0VGltZW91dChnZXRMaXN0TG9vcCwgbmV4dExpc3REZWxheSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIG5leHRMaXN0RGVsYXk9c2V0dGluZy5uZXh0TGlzdERlbGF5fHwyMDA7CiAgICAgICAgICAgIG5leHRMaXN0RGVsYXk9TnVtYmVyKG5leHRMaXN0RGVsYXkpOwogICAgICAgICAgICB2YXIgY291bnQ9MDsKICAgICAgICAgICAgc2V0VGltZW91dChnZXRMaXN0TG9vcCxuZXh0TGlzdERlbGF5KTsKICAgICAgICB9CiAgICAgICAgZnVuY3Rpb24gZG93bkdldExpc3QoZG9jKXsKICAgICAgICAgICAgaWYoIWRvYykgcmV0dXJuIGNoYW5nZVJlc3RMaXN0VGV4dCgi5LiL5LiA6aG16I635Y+W5aSx6LSlLOiOt+WPlue7remhtee7k+adnyIpCiAgICAgICAgICAgIHZhciBhZGRDb3VudD1nZXRMaXN0KGRvYyk7CiAgICAgICAgICAgIGlmKCFhZGRDb3VudCkgcmV0dXJuIGNoYW5nZVJlc3RMaXN0VGV4dCgi5aKe5Yqg55uu5b2V5pWw5Li6MO+8jOiOt+WPlue7remhtee7k+adnyIpCiAgICAgICAgICAgIG5leHRMaXN0Q291bnQrPTE7CiAgICAgICAgICAgIGNoYW5nZVJlc3RMaXN0VGV4dCgpOwogICAgICAgICAgICB2YXIgbmV4dExpc3Q9Z2V0TmV4dExpc3QoZG9jKTsKICAgICAgICAgICAgaWYoIW5leHRMaXN0KXJldHVybiBjaGFuZ2VSZXN0TGlzdFRleHQoIuaJvuS4jeWIsOS4i+S4gOmhte+8jOiOt+WPlue7remhtee7k+adnyIpCiAgICAgICAgICAgIG5leHRMaXN0SHJlZj1uZXh0TGlzdC5ocmVmOwogICAgICAgICAgICBpZighbmV4dExpc3RIcmVmKXJldHVybiBjaGFuZ2VSZXN0TGlzdFRleHQoIuS4i+S4gOmhteaXoOe9keWdgO+8jOiOt+WPlue7remhtee7k+adnyIpCiAgICAgICAgICAgIGRvd25sb2FkKG5leHRMaXN0SHJlZiwwLGRvd25HZXRMaXN0KQogICAgICAgIH0KICAgICAgICB2YXIgZ2V0UmVzdExpc3Q9cm9vdC5xdWVyeVNlbGVjdG9yKCIjZ2V0UmVzdExpc3QiKTsKICAgICAgICBnZXRSZXN0TGlzdC5kaXNhYmxlZD10cnVlOwogICAgICAgIGlmKCFuZXh0TGlzdEhyZWYpewogICAgICAgICAgICBpZighZG9jKXJldHVybiBjaGFuZ2VSZXN0TGlzdFRleHQoIuS4i+S4gOmhteiOt+WPluWksei0pSzojrflj5bnu63pobXnu5PmnZ8iKQogICAgICAgICAgICB2YXIgbmV4dExpc3Q9Z2V0TmV4dExpc3QoZG9jKTsKICAgICAgICAgICAgaWYoIW5leHRMaXN0KXJldHVybiBjaGFuZ2VSZXN0TGlzdFRleHQoIuaJvuS4jeWIsOS4i+S4gOmhte+8jOiOt+WPlue7remhtee7k+adnyIpCiAgICAgICAgICAgIG5leHRMaXN0SHJlZj1uZXh0TGlzdC5ocmVmOwogICAgICAgIH0KICAgICAgICBpZihuZXh0TGlzdEhyZWYgJiYgbmV4dExpc3RIcmVmLmluZGV4T2YoImphdmFzY3JpcHQiKSA9PSAtMSl7CiAgICAgICAgICAgIGRvd25sb2FkKG5leHRMaXN0SHJlZiwwLGRvd25HZXRMaXN0KQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIG5leHRMaXN0PWdldE5leHRMaXN0KGRvYyk7CiAgICAgICAgICAgIGlmKG5leHRMaXN0KXsKICAgICAgICAgICAgICAgIG5leHRMaXN0LmNsaWNrKCk7CiAgICAgICAgICAgICAgICB3YWl0R2V0TGlzdCgpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgZnVuY3Rpb24gZ2V0TGlzdChkb2MpIHsKICAgICAgICB2YXIgcHJlQ2hhcHRlck5vID0gMDsKICAgICAgICB2YXIgcHJlSHJlZk5vID0gMDsKICAgICAgICBmdW5jdGlvbiBnZXRDaGFwdGVyTm8ocykgewogICAgICAgICAgICB2YXIgZm91bmQgPSBzLm1hdGNoKC9cZCt8W+mbtuS4gOWjueS6jOi0sOS4pOS4ieWPgeWbm+iChuS6lOS8jeWFremZhuS4g+afkuWFq+aNjOS5neeOluWNgeaLvueZvuS9sOWNg+S7n+S4h+S6v10rL2cpOwogICAgICAgICAgICBpZiAoZm91bmQpIHsKICAgICAgICAgICAgICAgIHZhciBuID0gcGFyc2VJbnQoZm91bmRbMF0pOwogICAgICAgICAgICAgICAgaWYgKGlzTmFOKG4pKSB7CiAgICAgICAgICAgICAgICAgICAgbiA9IG51bWJlckRpZ2l0KGZvdW5kWzBdKTsKICAgICAgICAgICAgICAgICAgICBpZiAobiAhPSAtMSkgcmV0dXJuIG47CiAgICAgICAgICAgICAgICB9IGVsc2UgcmV0dXJuIG47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHByZUNoYXB0ZXJObzsKICAgICAgICB9CiAgICAgICAgZnVuY3Rpb24gZ2V0SHJlZk5vKHMpIHsKICAgICAgICAgICAgdmFyIGZvdW5kID0gcy5tYXRjaCgvXGQrL2cpOwogICAgICAgICAgICByZXR1cm4gZm91bmQgPyBwYXJzZUludChmb3VuZC5wb3AoKSkgOiBwcmVIcmVmTm87CiAgICAgICAgfQogICAgICAgIGZ1bmN0aW9uIGFkZFRvQ2hhcHRlcnMoZWxlbWVudHMpIHsKICAgICAgICAgICAgdmFyIGNvdW50PTA7CiAgICAgICAgICAgIGZvciAodmFyIGUgb2YgZWxlbWVudHMpIHsKICAgICAgICAgICAgICAgIGlmIChjdXN0b21JdGVtRnVuYykgY3VzdG9tSXRlbUZ1bmMoZG9jLCBlKTsKICAgICAgICAgICAgICAgIGlmICghZS5ocmVmIHx8IGUuaHJlZi5pbmRleE9mKCJqYXZhc2NyaXB0IikgIT0gLTEpIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgLy9pZihpc0hpZGUod2luZG93LGUpKWNvbnRpbnVlOwogICAgICAgICAgICAgICAgdmFyIGlDaGFwdGVycz1nZXRJbmRleE9mT2JqZWN0QXJyYXkoY2hhcHRlcnMsICJocmVmIiwgZS5ocmVmKTsKICAgICAgICAgICAgICAgIGlmIChpQ2hhcHRlcnMgIT0gLTEpeyAvL+acgOaWsOeroOiKggogICAgICAgICAgICAgICAgICAgIGNoYXB0ZXJzSW5kZXguc3BsaWNlKGNoYXB0ZXJzSW5kZXguaW5kZXhPZihpQ2hhcHRlcnMpLCAxKTsKICAgICAgICAgICAgICAgICAgICBjaGFwdGVyc0luZGV4LnB1c2goaUNoYXB0ZXJzKTsKICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGNvdW50Kz0xOwogICAgICAgICAgICAgICAgdmFyIHRpdGxlPWUudGV4dHx8ZS5pbm5lclRleHQ7CiAgICAgICAgICAgICAgICB2YXIgbGVuZ3RoID0gY2hhcHRlcnMucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgaHJlZjogZS5ocmVmLAogICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSwKICAgICAgICAgICAgICAgICAgICBjaGFwdGVyTm86IGdldENoYXB0ZXJObyh0aXRsZSksCiAgICAgICAgICAgICAgICAgICAgaHJlZk5vOiBnZXRIcmVmTm8oZS5ocmVmKSwKICAgICAgICAgICAgICAgICAgICB0ZXh0OiAiIiwgLy/mraPmlocKICAgICAgICAgICAgICAgICAgICBuZXh0Q291bnQ6IDAsIC8v5pys56ug55qE5LiL5LiA6aG15pWw6YePCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIHByZUNoYXB0ZXJObyA9IGNoYXB0ZXJzW2xlbmd0aCAtIDFdLmNoYXB0ZXJObzsKICAgICAgICAgICAgICAgIHByZUhyZWZObyA9IGNoYXB0ZXJzW2xlbmd0aCAtIDFdLmhyZWZObzsKICAgICAgICAgICAgICAgIGNoYXB0ZXJzSW5kZXgucHVzaChsZW5ndGggLSAxKTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gY291bnQKICAgICAgICB9CiAgICAgICAgc2V0dGluZyA9IGdldFNldHRpbmcoKTsKICAgICAgICBpZiAodHlwZW9mIHNldHRpbmcgIT0gJ29iamVjdCcpIHJldHVybjsKICAgICAgICB2YXIgbGlzdFNlbGVjdG9yPXNldHRpbmcubGlzdFNlbGVjdG9yOwogICAgICAgIGlmICghbGlzdFNlbGVjdG9yfHxsaXN0U2VsZWN0b3I9PSctLScpIHsKICAgICAgICAgICAgdmFyIFttb3N0QW5jZXN0b3IsIG1vc3RTZWxlY3RvciwgbW9zdENvdW50XSA9IGdldEFuY2VzdG9yV2l0aE1vc3RTaW1pbGFyVGFnKGRvYywiYTpub3QoW2hyZWYqPSdqYXZhc2NyaXB0J10pIik7CiAgICAgICAgICAgIGlmKCFtb3N0QW5jZXN0b3IpcmV0dXJuIGNvbnNvbGUubG9nKCfmib7kuI3liLDnm67lvZUnKTsKICAgICAgICAgICAgbGlzdFNlbGVjdG9yID0gZ2V0RWxlbWVudFNlbGVjdG9yKG1vc3RBbmNlc3RvciwgZG9jKSArICc+JyArIG1vc3RTZWxlY3RvcjsKICAgICAgICAgICAgaWYoc2V0dGluZy5saXN0U2VsZWN0b3IhPSctLScpewogICAgICAgICAgICAgICAgc2V0dGluZy5saXN0U2VsZWN0b3IgPSBsaXN0U2VsZWN0b3I7CiAgICAgICAgICAgICAgICBkaXNwbGF5U2V0dGluZygpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHZhciBjb3VudD0wOwogICAgICAgIGlmIChjdXN0b21MaXN0RnVuYykgewogICAgICAgICAgICB2YXIgY3VzdG9tUmVzdWx0ID0gY3VzdG9tTGlzdEZ1bmMoZG9jLCBsaXN0U2VsZWN0b3IpOwogICAgICAgICAgICBpZiAoY3VzdG9tUmVzdWx0WzBdIGluc3RhbmNlb2YgRG9jdW1lbnQpIHsKICAgICAgICAgICAgICAgIFtkb2MsIGxpc3RTZWxlY3Rvcl0gPSBjdXN0b21SZXN1bHQ7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBjb3VudD1hZGRUb0NoYXB0ZXJzKGN1c3RvbVJlc3VsdCk7CiAgICAgICAgICAgICAgICBpZihjb3VudCljcmVhdGVUcigpOwogICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgbGlzdFNlbGVjdG9yPShsaXN0U2VsZWN0b3J8fCcnKS50cmltKCkucmVwbGFjZSgvXG4vLCcsJyk7CiAgICAgICAgY291bnQ9YWRkVG9DaGFwdGVycyhkb2MucXVlcnlTZWxlY3RvckFsbChsaXN0U2VsZWN0b3IpKTsKICAgICAgICBjcmVhdGVUcigpOyAvL2NvdW505Li6MOaXtuS5n+imgeWIt+aWsO+8jOWboOS4uuWPr+iDvemDveaYr+acgOaWsOeroOiKgueahAogICAgICAgIHJldHVybiBjb3VudDsKICAgIH0KICAgIGZ1bmN0aW9uIGNyZWF0ZVRyKCkgewogICAgICAgIHZhciB0YWJsZUJvZHkgPSByb290LnF1ZXJ5U2VsZWN0b3IoInRhYmxlIHRib2R5Iik7CiAgICAgICAgdGFibGVCb2R5LmlubmVySFRNTCA9ICIiOwogICAgICAgIGZvciAodmFyIGkgb2YgY2hhcHRlcnNJbmRleCkgewogICAgICAgICAgICB2YXIgdHIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJ0ciIpOwogICAgICAgICAgICBjaGFwdGVyc1tpXS50ciA9IHRyCiAgICAgICAgICAgIHZhciB0ZCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoInRkIik7CiAgICAgICAgICAgIHRkLmNsYXNzTmFtZSA9ICJzZXJpYWwiOwogICAgICAgICAgICB0ci5hcHBlbmRDaGlsZCh0ZCk7CiAgICAgICAgICAgIHRkID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgidGQiKTsKICAgICAgICAgICAgdmFyIGEgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJhIik7CiAgICAgICAgICAgIGEudGV4dCA9IGNoYXB0ZXJzW2ldLnRpdGxlOwogICAgICAgICAgICBhLmhyZWYgPSBjaGFwdGVyc1tpXS5ocmVmOwogICAgICAgICAgICBhLnRhcmdldD0iX2JsYW5rIjsKICAgICAgICAgICAgdGQudGl0bGUgPSBg56ug6IqC5Y+3JHtjaGFwdGVyc1tpXS5jaGFwdGVyTm9977yM572R5Z2A5Y+3JHtjaGFwdGVyc1tpXS5ocmVmTm99YDsKICAgICAgICAgICAgdGQuYXBwZW5kQ2hpbGQoYSk7CiAgICAgICAgICAgIH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pIHsKICAgICAgICAgICAgY2hhcHRlcnNJbmRleCA9IG5ldyBBcnJheShsZW5ndGgpOwogICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICBjaGFwdGVyc0luZGV4W2ldID0gaTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBzd2l0Y2ggKHZhbHVlKSB7CiAgICAgICAgICAgIGNhc2UgIuWOn+Wni+WNh+W6jyI6CiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgY2hhcHRlcnNJbmRleFtpXSA9IGk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAi5Y6f5aeL6ZmN5bqPIjoKICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICBjaGFwdGVyc0luZGV4W2ldID0gbGVuZ3RoIC0gaSAtIDE7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAi56ug6IqC5Y+35Y2H5bqPIjoKICAgICAgICAgICAgICAgIGNoYXB0ZXJzSW5kZXguc29ydCgoYSwgYikgPT4gY2hhcHRlcnNbYV0uY2hhcHRlck5vIC0gY2hhcHRlcnNbYl0uY2hhcHRlck5vKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICLnq6DoioLlj7fpmY3luo8iOgogICAgICAgICAgICAgICAgY2hhcHRlcnNJbmRleC5zb3J0KChhLCBiKSA9PiBjaGFwdGVyc1tiXS5jaGFwdGVyTm8gLSBjaGFwdGVyc1thXS5jaGFwdGVyTm8pOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIue9keWdgOWNh+W6jyI6CiAgICAgICAgICAgICAgICBjaGFwdGVyc0luZGV4LnNvcnQoKGEsIGIpID0+IGNoYXB0ZXJzW2FdLmhyZWZObyAtIGNoYXB0ZXJzW2JdLmhyZWZObyk7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAi572R5Z2A6ZmN5bqPIjoKICAgICAgICAgICAgICAgIGNoYXB0ZXJzSW5kZXguc29ydCgoYSwgYikgPT4gY2hhcHRlcnNbYl0uaHJlZk5vIC0gY2hhcHRlcnNbYV0uaHJlZk5vKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBjcmVhdGVUcigpOwogICAgfQogICAgLy8jZW5kcmVnaW9uIExpc3QKICAgIC8vI3JlZ2lvbiBoZWxwZXIKICAgIGZ1bmN0aW9uIGdldEVsZW1lbnRTZWxlY3RvcihlbGVtZW50LCBkb2MpIHsKICAgICAgICBmdW5jdGlvbiBnZXRSaWdodElkKGlkKSB7CiAgICAgICAgICAgIHZhciBmaXJzdENvZGUgPSBpZC5jaGFyQ29kZUF0KDApOwogICAgICAgICAgICBpZiAoZmlyc3RDb2RlID49IDQ4ICYmIGZpcnN0Q29kZSA8PSA1NykgcmV0dXJuICJcXDMiICsgaWRbMF0gKyAiICIgKyBpZC5zdWJzdHIoMSwgaWQubGVuZ3RoKTsKICAgICAgICAgICAgZWxzZSByZXR1cm4gaWQ7CiAgICAgICAgfQogICAgICAgIGxldCBkb21QYXRoID0gW107CiAgICAgICAgdmFyIGUgPSBlbGVtZW50OwogICAgICAgIHdoaWxlIChlICYmIGUubm9kZU5hbWUudG9Mb3dlckNhc2UoKSAhPT0gImh0bWwiKSB7CiAgICAgICAgICAgIHZhciB0YWcgPSBlLnRhZ05hbWUudG9Mb2NhbGVMb3dlckNhc2UoKTsKICAgICAgICAgICAgaWYgKGUuaWQpIHsKICAgICAgICAgICAgICAgIGRvbVBhdGgudW5zaGlmdCgnIycgKyBnZXRSaWdodElkKGUuaWQpK2dldENzc0NsYXNzKGUuY2xhc3NOYW1lKSk7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgfSBlbHNlIGlmICh0YWcgPT0gImJvZHkiKSB7CiAgICAgICAgICAgICAgICBkb21QYXRoLnVuc2hpZnQodGFnKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IDA7CiAgICAgICAgICAgICAgICB2YXIgaXNPbmVUYWcgPSB0cnVlOwogICAgICAgICAgICAgICAgdmFyIGlzT25lQ2xhc3MgPSBlLmNsYXNzTGlzdC5sZW5ndGggPiAwOwogICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBlLnBhcmVudE5vZGUuY2hpbGRFbGVtZW50Q291bnQ7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGlmIChlLnBhcmVudE5vZGUuY2hpbGRyZW5baV0gPT0gZSkgewogICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IGk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLnBhcmVudE5vZGUuY2hpbGRyZW5baV0udGFnTmFtZSA9PSBlLnRhZ05hbWUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgaXNPbmVUYWcgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuY2xhc3NMaXN0Lmxlbmd0aCA+IDAgJiYgZS5wYXJlbnROb2RlLmNoaWxkcmVuW2ldLmNsYXNzTGlzdC50b1N0cmluZygpID09IGUuY2xhc3NMaXN0LnRvU3RyaW5nKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzT25lQ2xhc3MgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmIChpc09uZVRhZykgewogICAgICAgICAgICAgICAgICAgIGRvbVBhdGgudW5zaGlmdCh0YWcpOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpc09uZUNsYXNzKSB7CiAgICAgICAgICAgICAgICAgICAgZG9tUGF0aC51bnNoaWZ0KHRhZyArIGdldENzc0NsYXNzKGUuY2xhc3NOYW1lKSk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGRvbVBhdGgudW5zaGlmdCh0YWcgKyAnOm50aC1jaGlsZCgnICsgKGluZGV4ICsgMSkgKyAnKScpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHZhciBzZWxlY3RvciA9IGRvbVBhdGgudG9TdHJpbmcoKS5yZXBsYWNlKC8sL2csICc+Jyk7CiAgICAgICAgICAgIHZhciBlbGVzID0gZG9jLnF1ZXJ5U2VsZWN0b3JBbGwoc2VsZWN0b3IpOwogICAgICAgICAgICBpZiAoZWxlcy5sZW5ndGggPT0gMSAmJiBlbGVzWzBdID09IGVsZW1lbnQpIGJyZWFrOwogICAgICAgICAgICBlID0gZS5wYXJlbnROb2RlOwogICAgICAgIH0KICAgICAgICByZXR1cm4gZG9tUGF0aC50b1N0cmluZygpLnJlcGxhY2UoLywvZywgJz4nKTsKICAgIH0gLy9nZXRFbGVtZW50U2VsZWN0b3IKICAgIC8vI2VuZHJlZ2lvbiBoZWxwZXIKICAgIC8vI3JlZ2lvbiBUZXh0CiAgICBmdW5jdGlvbiBnZXRDb250ZW50RWxlbWVudChkb2MpIHsgLy/lj4LogIPigJzmgKDmg7DlsI/or7TkuIvovb3lmajigJ0KICAgICAgICBmdW5jdGlvbiBnZXRFZmZlY3RpdmVUZXh0KHRleHQpIHsKICAgICAgICAgICAgcmV0dXJuIHRleHQucmVwbGFjZSgvXHMrL2csICcnKTsKICAgICAgICB9CiAgICAgICAgdmFyIGxhcmdlc3RDb250ZW50LCBjb250ZW50cyA9IGRvYy5xdWVyeVNlbGVjdG9yQWxsKCJzcGFuLGRpdixhcnRpY2xlLHNlY3Rpb24scCx0ZCIpLCBsYXJnZXN0TnVtID0gMDsKICAgICAgICBmb3IgKGxldCBjb250ZW50IG9mIGNvbnRlbnRzKSB7CiAgICAgICAgICAgIHZhciBjdXJOdW0gPSAwOwogICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGNvbnRlbnQuY2hpbGROb2RlcykgewogICAgICAgICAgICAgICAgaWYgKGl0ZW0ubm9kZVR5cGUgPT0gMykgeyAvL+e6r+aWh+acrAogICAgICAgICAgICAgICAgICAgIGlmICghL15ccyokLy50ZXN0KGl0ZW0uZGF0YSkpIGN1ck51bSArPSBnZXRFZmZlY3RpdmVUZXh0KGl0ZW0uZGF0YSkubGVuZ3RoOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpdGVtLm5vZGVUeXBlID09IDgpIHsgLy/lv73nlaXms6jph4oKICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL14oSXxBfFNUUk9OR3xCfEZPTlR8UHxETHxERHxIXGR8U0VDVElPTikkLy50ZXN0KGl0ZW0udGFnTmFtZSkpIHsgLy/mnInov5nkupvlrZDoioLngrkKICAgICAgICAgICAgICAgICAgICBjdXJOdW0gKz0gZ2V0RWZmZWN0aXZlVGV4dChpdGVtLmlubmVyVGV4dCkubGVuZ3RoOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChjdXJOdW0gPiBsYXJnZXN0TnVtKSB7CiAgICAgICAgICAgICAgICBsYXJnZXN0TnVtID0gY3VyTnVtOwogICAgICAgICAgICAgICAgbGFyZ2VzdENvbnRlbnQgPSBjb250ZW50CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgLy9jb25zb2xlLmxvZyhsYXJnZXN0Q29udGVudCwgbGFyZ2VzdE51bSwgZ2V0RWZmZWN0aXZlVGV4dChsYXJnZXN0Q29udGVudC5pbm5lclRleHQpKTsKICAgICAgICByZXR1cm4gbGFyZ2VzdENvbnRlbnQ7CiAgICB9CiA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BsYWNlKC8gKy9nLCAiICAiKS5yZXBsYWNlKC8oW15ccl18XilcbihbXlxyXXwkKS9naSwgIiQxXHJcbiQyIik7CiAgICAgICAgfQogICAgICAgIHJldHVybiByZXN1bHQ7CiAgICB9CiAgICBmdW5jdGlvbiBkb3dubG9hZFRleHQoaHJlZiwgaW5kZXgsIGNhbGxiYWNrKXsKICAgICAgICBpZihzZXR0aW5nLmhhc093blByb3BlcnR5KCJmcmFtZVRleHQiKSkgZnJhbWVEb2MoaHJlZiwgaW5kZXgsIGNhbGxiYWNrKTsKICAgICAgICBlbHNlIGRvd25sb2FkKGhyZWYsIGluZGV4LCBjYWxsYmFjayk7CiAgICB9CiAgICBmdW5jdGlvbiBmcmFtZURvYyhocmVmLCBpbmRleCwgY2FsbGJhY2spIHsKICAgICAgICBpZiAodHlwZW9mIGluZGV4ID09ICd1bmRlZmluZWQnKSByZXR1cm47CiAgICAgICAgaWYgKGluZGV4IDwgMCB8fCBpbmRleCA+PSBjaGFwdGVycy5sZW5ndGgpIHJldHVybjsKICAgICAgICBpZiAoaHJlZiA9PSBudWxsKSB7CiAgICAgICAgICAgIGhyZWYgPSBjaGFwdGVyc1tpbmRleF0uaHJlZjsKICAgICAgICAgICAgY2hhcHRlcnNbaW5kZXhdLnRleHQgPSAnJzsKICAgICAgICAgICAgY2hhcHRlcnNbaW5kZXhdLnN0YXRlID0gJyc7CiAgICAgICAgICAgIGNoYXB0ZXJzW2luZGV4XS5uZXh0Q291bnQgPSAwOwogICAgICAgIH0KICAgICAgICBpZihkb2N1bWVudC5sb2NhdGlvbi5wcm90b2NvbD09Imh0dHBzOiIpIGhyZWY9aHJlZi5yZXBsYWNlKC9eaHR0cDovLCdodHRwczonKTsKICAgICAgICB2YXIgZnJhbWU9aWZyYW1lcy5zaGlmdCgpOwogICAgICAgIGlmKCFmcmFtZSl7CiAgICAgICAgICAgIGZyYW1lPWRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2lmcmFtZScpOwogICAgICAgICAgICByb290LmdldEVsZW1lbnRCeUlkKCJpZnJhbWVzV2FycHBlciIpLmFwcGVuZENoaWxkKGZyYW1lKTsKICAgICAgICAgICAgZnJhbWUub25sb2FkPWZ1bmN0aW9uIChyZXN1bHQpIHsKICAgICAgICAgICAgICAgIHZhciBkb2MgPSBmcmFtZS5jb250ZW50RG9jdW1lbnQ7CiAgICAgICAgICAgICAgICBpZihkb2MpewogICAgICAgICAgICAgICAgICAgIGRvYy5ocmVmID0gaHJlZjsgLy/orrDkuIvlvZPliY3pobXpnaLnmoTnvZHlnYDvvIzoh6rlt7HnlJ/miJDnmoTmsqHmnInnvZHlnYDjgIIKICAgICAgICAgICAgICAgICAgICBjb25zdCBlbGVtZW50ID0gZG9jLmRvY3VtZW50RWxlbWVudAogICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuc2Nyb2xsVG9wID0gMDsKICAgICAgICAgICAgICAgICAgICBjb25zdCBpbnRlcnZhbCA9IHNldEludGVydmFsKCgpPT57CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGVsZW1lbnQuc2Nyb2xsVG9wICsgZWxlbWVudC5jbGllbnRIZWlnaHQgLCBlbGVtZW50LnNjcm9sbEhlaWdodCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LnNjcm9sbFRvcCArIGVsZW1lbnQuY2xpZW50SGVpZ2h0ID09IGVsZW1lbnQuc2Nyb2xsSGVpZ2h0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGludGVydmFsKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCgoKT0+ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUVsZW1lbnRCeVNlbGVjdG9yKGRvYywnaW1nJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRWxlbWVudEJ5U2VsZWN0b3IoZG9jLCAnKltzdHlsZSo9ImRpc3BsYXk6bm9uZSJdJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSGlkZUVsZW1lbnQoZG9jKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhkb2MsIGluZGV4KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnNjcm9sbFRvcCArPTIwMDAwMDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0sIDIwMCkKICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybigiZXJyb3I6IiwgaHJlZik7CiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sobnVsbCwgaW5kZXgpOwogICAgICAgICAgICAgICAgICAgIGZyYW1lLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwogICAgICAgICAgICBmcmFtZS5vbmVycm9yPShlKT0+ewogICAgICAgICAgICAgICAgY29uc29sZS53YXJuKCJlcnJvcjoiLCBocmVmKTsKICAgICAgICAgICAgICAgIGNhbGxiYWNrKG51bGwsIGluZGV4KTsKICAgICAgICAgICAgICAgIGZyYW1lLnJlbW92ZSgpOwogICAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgICBmcmFtZS5zcmM9aHJlZjsKICAgIH0KICAgIGZ1bmN0aW9uIGRvd25sb2FkKGhyZWYsIGluZGV4LCBjYWxsYmFjaykgewogICAgICAgIGlmICh0eXBlb2YgaW5kZXggPT0gJ3VuZGVmaW5lZCcpIHJldHVybjsKICAgICAgICBpZiAoaW5kZXggPCAwIHx8IGluZGV4ID49IGNoYXB0ZXJzLmxlbmd0aCkgcmV0dXJuOwogICAgICAgIGlmIChocmVmID09IG51bGwpIHsKICAgICAgICAgICAgaHJlZiA9IGNoYXB0ZXJzW2luZGV4XS5ocmVmOwogICAgICAgICAgICBjaGFwdGVyc1tpbmRleF0udGV4dCA9ICcnOwogICAgICAgICAgICBjaGFwdGVyc1tpbmRleF0uc3RhdGUgPSAnJzsKICAgICAgICAgICAgY2hhcHRlcnNbaW5kZXhdLm5leHRDb3VudCA9IDA7CiAgICAgICAgfQogICAgICAgIGxldCByZXF1ZXN0Qm9keSA9IHsKICAgICAgICAgICAgbWV0aG9kOiAnR0VUJywKICAgICAgICAgICAgdXJsOiBocmVmLAogICAgICAgICAgICBoZWFkZXJzOiB7CiAgICAgICAgICAgICAgICByZWZlcmVyOiBocmVmLAogICAgICAgICAgICAgICAgIkNvbnRlbnQtVHlwZSI6ICJ0ZXh0L2h0bWw7Y2hhcnNldD0iICsgZG9jdW1lbnQuY2hhcnNldCwKICAgICAgICAgICAgfSwKICAgICAgICAgICAgdGltZW91dDogMTUwMDAsCiAgICAgICAgICAgIG92ZXJyaWRlTWltZVR5cGU6ICJ0ZXh0L2h0bWw7Y2hhcnNldD0iICsgZG9jdW1lbnQuY2hhcnNldCwKICAgICAgICAgICAgb25sb2FkOiBmdW5jdGlvbiAocmVzdWx0KSB7CiAgICAgICAgICAgICAgICB2YXIgZG9jID0gZ2V0RG9jKHJlc3VsdC5yZXNwb25zZVRleHQpOwogICAgICAgICAgICAgICAgZG9jLmhyZWYgPSBocmVmOyAvL+iusOS4i+W9k+WJjemhtemdoueahOe9keWdgO+8jOiHquW3seeUn+aIkOeahOayoeaciee9keWdgOOAggogICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgZGVsZXRlU29tZVRhZyhkb2MsICdzY3JpcHQnKTsKICAgICAgICAgICAgICAgIGRlbGV0ZVNvbWVUYWcoZG9jLCAnc3R5bGUnKTsKICAgICAgICAgICAgICAgIGRlbGV0ZVNvbWVUYWcoZG9jLCAnaW1nJyk7CiAgICAgICAgICAgICAgICBkZWxldGVFbGVtZW50QnlTZWxlY3Rvcihkb2MsICcqW3N0eWxlKj0iZGlzcGxheTpub25lIl0nKTsKICAgICAgICAgICAgICAgIGRlbGV0ZUhpZGVFbGVtZW50KGRvYyk7CiAgICAgICAgICAgICAgICBjYWxsYmFjayhkb2MsIGluZGV4KTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgb25lcnJvcjogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgY29uc29sZS53YXJuKCJlcnJvcjoiLCBocmVmKTsKICAgICAgICAgICAgICAgIGNhbGxiYWNrKG51bGwsIGluZGV4KTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgb250aW1lb3V0OiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oInRpbWVvdXQ6ICIsIGhyZWYpOwogICAgICAgICAgICAgICAgY2FsbGJhY2sobnVsbCwgaW5kZXgpOwogICAgICAgICAgICB9CiAgICAgICAgfTsKICAgICAgICBHTV94bWxodHRwUmVxdWVzdChyZXF1ZXN0Qm9keSk7CiAgICB9IC8vZ2V0RG9jQnlIcmVmCiAgICBmdW5jdGlvbiBkZWxldGVIaWRlRWxlbWVudChkb2MpIHsKICAgICAgICBpZiAoIWRvYy5kZWZhdWx0VmlldykgcmV0dXJuOyAvL+ebtOaOpeS4i+i9vee9kemhteeahOayoeaciWRvYy5kZWZhdWx0VmlldwogICAgICAgIHZhciBlbGVtZW50cyA9IGRvYy5xdWVyeVNlbGVjdG9yQWxsKCJzcGFuLGRpdix1bCxsaSIpCiAgICAgICAgLy92YXIgZWxlbWVudHMgPSBkb2MucXVlcnlTZWxlY3RvckFsbCgibGkiKQogICAgICAgIGZvciAodmFyIGkgPSBlbGVtZW50cy5sZW5ndGggLSAxOyBpID49IDA7IGktLSkgewogICAgICAgICAgICB2YXIgZWxlID0gZWxlbWVudHNbaV07CiAgICAgICAgICAgIHZhciB0aGlzU3R5bGUgPSBkb2MuZGVmYXVsdFZpZXcuZ2V0Q29tcHV0ZWRTdHlsZShlbGUpOwogICAgICAgICAgICBpZiAodG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b2MKICAgIGZ1bmN0aW9uIGdldE5leHRQYWdlKGRvYykgewogICAgICAgIGxldCBlbGVzID0gZG9jLnF1ZXJ5U2VsZWN0b3JBbGwoImEiKTsKICAgICAgICBmb3IgKGxldCBlbGUgb2YgZWxlcykgewogICAgICAgICAgICBpZiAobmV4dFBhZ2VSZWcudGVzdChlbGUuaW5uZXJUZXh0KSAmJiBlbGUuaHJlZi5pbmRleE9mKCJqYXZhc2NyaXB0IikgPT0gLTEpIHJldHVybiBlbGU7CiAgICAgICAgICAgIGlmKHNldHRpbmcuYWRkZWROZXh0UGFnZVJlZyl7CiAgICAgICAgICAgICAgICBpZiAoc2V0dGluZy5hZGRlZE5leHRQYWdlUmVnLnRlc3QoZWxlLmlubmVyVGV4dCkgJiYgZWxlLmhyZWYuaW5kZXhPZigiamF2YXNjcmlwdCIpID09IC0xKSByZXR1cm4gZWxlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgLy/ojrflvpfmraPmlofvvIzlpoLmnpzmnInkuIvkuIDpobXnvZHlnYDkuI3lnKjnq6DoioLnvZHlnYDvvIznu6fnu63ojrflj5bvvIzlubbov5Tlm55OZXh0CiAgICBmdW5jdGlvbiBnZXRUZXh0RnJvbURvYyhkb2MsIGluZGV4LCBjYWxsYmFjaykgewogICAgICAgIGZ1bmN0aW9uIGFkZFRleHR0b0NoYXB0ZXIodGV4dCkgewogICAgICAgICAgICBjaGFwdGVyc1tpbmRleF0udGV4dCArPQogICAgICAgICAgICAgICAgKChkb2MuaHJlZiA9PSBjaGFwdGVyc1tpbmRleF0uaHJlZikgPyAiIiA6IGA+PiR7ZG9jLnRpdGxlfVxuYCkgKyB0ZXh0OwogICAgICAgIH0KICAgICAgICBpZiAoZG9jKSB7CiAgICAgICAgICAgIHZhciBuZXh0UGFnZWhyZWY9IiI7CiAgICAgICAgICAgIGlmIChjdXN0b21OZXh0UGFnZUZ1bmMpIHsKICAgICAgICAgICAgICAgIG5leHRQYWdlaHJlZj1jdXN0b21OZXh0UGFnZUZ1bmMoZG9jLGNoYXB0ZXJzW2luZGV4XS5ocmVmKTsKICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICB2YXIgbmV4dFBhZ2UgPSBnZXROZXh0UGFnZShkb2MpOwogICAgICAgICAgICAgICAgbmV4dFBhZ2VocmVmID0gbmV4dFBhZ2UgPyBuZXh0UGFnZS5ocmVmIDogIiI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZGVsZXRlU29tZVRhZyhkb2MsICdzY3JpcHQnKTsKICAgICAgICAgICAgdmFyIGphbW1lclNlbGVjdG9yPShzZXR0aW5nLmphbW1lclNlbGVjdG9yfHwnJykudHJpbSgpLnJlcGxhY2UoL1xuLywnLCcpOwogICAgICAgICAgICBpZiAoamFtbWVyU2VsZWN0b3IpIGRlbGV0ZUVsZW1lbnRCeVNlbGVjdG9yKGRvYywgamFtbWVyU2VsZWN0b3IpOwogICAgICAgICAgICB2YXIgY29udGVudDsKICAgICAgICAgICAgdmFyIHRleHRTZWxlY3Rvcj1zZXR0aW5nLnRleHRTZWxlY3RvcjsKICAgICAgICAgICAgaWYgKCF0ZXh0U2VsZWN0b3J8fHRleHRTZWxlY3Rvcj09Jy0tJykgewogICAgICAgICAgICAgICAgY29udGVudCA9IGdldENvbnRlbnRFbGVtZW50KGRvYyk7CiAgICAgICAgICAgICAgICB0ZXh0U2VsZWN0b3IgPSBnZXRFbGVtZW50U2VsZWN0b3IoY29udGVudCwgZG9jKTsKICAgICAgICAgICAgICAgIGlmKHNldHRpbmcudGV4dFNlbGVjdG9yIT0nLS0nKXsKICAgICAgICAgICAgICAgICAgICBzZXR0aW5nLnRleHRTZWxlY3RvciA9IHRleHRTZWxlY3RvcjsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5U2V0dGluZygpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChjdXN0b21UZXh0RnVuYykgewogICAgICAgICAgICAgICAgdmFyIGN1c3RvbVJlc3VsdCA9IGN1c3RvbVRleHRGdW5jKGRvYywgdGV4dFNlbGVjdG9yKTsKICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGN1c3RvbVJlc3VsdCkpIHsKICAgICAgICAgICAgICAgICAgICBbZG9jLCB0ZXh0U2VsZWN0b3JdID0gY3VzdG9tUmVzdWx0OwogICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgY3VzdG9tUmVzdWx0ID09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgYWRkVGV4dHRvQ2hhcHRlcihjdXN0b21SZXN1bHQrJ1xuJyk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdPSyc7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHJldHVybiAnTm8nCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdGV4dFNlbGVjdG9yPSh0ZXh0U2VsZWN0b3J8fCcnKS50cmltKCkucmVwbGFjZSgvXG4vLCcsJyk7CiAgICAgICAgICAgIHZhciBlVGV4dHMgPSBkb2MucXVlcnlTZWxlY3RvckFsbCh0ZXh0U2VsZWN0b3IpOwogICAgICAgICAgICBpZihlVGV4dHMubGVuZ3RoPT0wKSByZXR1cm4gJ05vJzsKICAgICAgICAgICAgdmFyIHRleHQ9JycKICAgICAgICAgICAgZm9yICh2YXIgZVRleHQgb2YgZVRleHRzKSB7CiAgICAgICAgICAgICAgICB0ZXh0Kz1nZXRFbGVtZW50VGV4dChlVGV4dCkrJ1xuJzsKICAgICAgICAgICAgfQogICAgICAgICAgICBhZGRUZXh0dG9DaGFwdGVyKHRleHQpOwoKICAgICAgICAgICAgaWYgKG5leHRQYWdlaHJlZikgewogICAgICAgICAgICAgICAgdmFyIGhyZWYyID0gbmV4dFBhZ2VocmVmLnNsaWNlKDAsIDYpID09ICdodHRwczonID8gJ2h0dHA6JyArIG5leHRQYWdlaHJlZi5zbGljZSg2KSA6ICdodHRwcycgKyBuZXh0UGFnZWhyZWYuc2xpY2UoNSk7CiAgICAgICAgICAgICAgICBpZiAobmV4dFBhZ2VocmVmID09IGRvY3VtZW50LmxvY2F0aW9uLmhyZWYgfHwgaHJlZjIgPT0gZG9jdW1lbnQubG9jYXRpb24uaHJlZikgcmV0dXJuICdPSyc7IC8vIOWmguaenGHlhYPntKDnmoRocmVm5Li656m677yM6L+U5Zue55qE5piv55uu5b2V6aG155qE5Zyw5Z2ACiAgICAgICAgICAgICAgICBpZiAobmV4dFBhZ2VocmVmID09IGRvYy5ocmVmIHx8IGhyZWYyID09IGRvYy5ocmVmKSByZXR1cm4gJ09LJzsKICAgICAgICAgICAgICAgIGlmIChnZXRJbmRleE9mT2JqZWN0QXJyYXkoY2hhcHRlcnMsICJocmVmIiwgbmV4dFBhZ2VocmVmLHRydWUpID09IC0xICYmIGdldEluZGV4T2ZPYmplY3RBcnJheShjaGFwdGVycywgImhyZWYiLCBocmVmMix0cnVlKSA9PSAtMSkgewogICAgICAgICAgICAgICAgICAgIGlmIChjaGFwdGVyc1tpbmRleF0ubmV4dENvdW50ID4gbmV4dENvdW50TGltaXQgLSAxKSB7IC8v56ys5LiA5Liq5LiL5LiA6aG15Li6MAogICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29udGludWVEb3dubG9hZCB8fCBjb25maXJtKGDnm67lvZXigJwke2NoYXB0ZXJzW2luZGV4XS50aXRsZX3igJ3nmoTkuIvkuIDpobXmlbDph4/otoXov4fmnIDlpKflgLwke25leHRDb3VudExpbWl0fe+8jOS9oOimgeiuqeS7peWQjueahOS4i+S4gOmhtee7p+e7reWQl++8n1xu57un57ut5Y+v6IO95Lya5LiL6L295aSq5aSa6ZO+5o6l77yM6K+36LCo5oWO57un57ut77yBYCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlRG93bmxvYWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICc+Tic7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKGNoYXB0ZXJzW2luZGV4XS5uZXh0Q291bnQgPiBtYXhOZXh0Q291bnQgLSAxKSByZXR1cm4gJz4+TicKICAgICAgICAgICAgICAgICAgICBkb3dubG9hZFRleHQobmV4dFBhZ2VocmVmLCBpbmRleCwgY2FsbGJhY2spOwogICAgICAgICAgICAgICAgICAgIHJldHVybiAnTmV4dCc7CiAgICAgICAgICAgICAgICB9IGVsc2UgcmV0dXJuICdPSyc7CiAgICAgICAgICAgIH0gZWxzZSByZXR1cm4gJ09LJzsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gJ0VyJzsKICAgICAgICB9CiAgICB9IC8vZ2V0VGV4dEZyb21Eb2MKICAgIGZ1bmN0aW9uIHNob3dDaGFwdGVyVGV4dChpbmRleCkgewogICAgICAgIGZ1bmN0aW9uIHNob3dPckRvd25sb2FkKGluZGV4KSB7CiAgICAgICAgICAgIGlmIChpc0Rvd25sb2FkZWQoaW5kZXgpKSB7CiAgICAgICAgICAgICAgICBzaG93Q2hhcHRlclRleHQoaW5kZXgpCiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBkb3dubG9hZFRleHQobnVsbCwgaW5kZXgsIGdldFRleHRDYWxsYmFjaykKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZWFkZXIuc2V0UmVhZGVyKGNoYXB0ZXJzW2luZGV4XS50ZXh0LCBjaGFwdGVyc1tpbmRleF0udGl0bGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAoaW5kZXggLSAxID49IDAgJiYgaW5kZXggLSAxIDwgY2hhcHRlcnMubGVuZ3RoKSA/ICc8JyA6ICcnLCAoKSA9PiB7CiAgICAgICAgICAgIHNob3dPckRvd25sb2FkKGluZGV4IC0gMSkKICAgICA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XJzW2luZGV4XS50ZXh0ID8gIuWQjue7remhtSIgOiAiIn3mib7kuI3liLDmraPmlofpgInmi6nlmajmjIflrprnmoTlhYPntKDvvIzmuIXnqbrmraPmlofpgInmi6nlmajph43mlrDojrflj5bjgIJgKSkgewogICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBzZXR0aW5nLnRleHRTZWxlY3RvcjsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5U2V0dGluZygpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ0VyJzogYWxlcnQoYCR7Y2hhcHRlcnNbaW5kZXhdLmhyZWZ95LiL6L295Ye66ZSZYCk7IGJyZWFrOwogICAgICAgICAgICBjYXNlICdOZXh0JzoKICAgICAgICAgICAgICAgIGNoYXB0ZXJzW2luZGV4XS5uZXh0Q291bnQgKz0gMTsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgY2hhcHRlcnNbaW5kZXhdLnN0YXRlID0gc3RhdGU7CiAgICAgICAgc2hvd1N0YXRlKGluZGV4KTsKICAgICAgICBpZiAoY2hhcHRlcnNbaW5kZXhdLnRleHQpIHNob3dDaGFwdGVyVGV4dChpbmRleCk7CiAgICB9CiAgICB2YXIgZ2V0VGV4dCA9IGUgPT4gewogICAgICAgIHNldHRpbmcgPSBnZXRTZXR0aW5nKCk7CiAgICAgICAgaWYgKHR5cGVvZiBzZXR0aW5nICE9ICdvYmplY3QnKSByZXR1cm47CiAgICAgICAgdmFyIHRyID0gZS50YXJnZXQucGFyZW50RWxlbWVudC5wYXJlbnRFbGVtZW50OwogICAgICAgIHZhciBpbmRleCA9IGdldEluZGV4T2ZPYmplY3RBcnJheShjaGFwdGVycywgInRyIiwgdHIpOwogICAgICAgIGlmIChpc0Rvd25sb2FkZWQoaW5kZXgpKSBzaG93Q2hhcHRlclRleHQoaW5kZXgpOwogICAgICAgIGVsc2UgZG93bmxvYWRUZXh0KG51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Ck7CiAgICAgICAgZnVuY3Rpb24gdXBsb2FkSW5mbygpIHsKICAgICAgICAgICAgZnVuY3Rpb24gc2V0VmFsdWUobWQ1LGluZm8pewogICAgICAgICAgICAgICAgZmV0Y2godXJsKycvJyttZDUsIHsKICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICJQT1NUIiwKICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLAogICAgICAgICAgICAgICAgICAgIGJvZHk6SlNPTi5zdHJpbmdpZnkoaW5mbyksCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGZ1bmN0aW9uIHB1c2hEb3duaW5mbyhtZDUsZG93bmluZm8pewogICAgICAgICAgICAgICAgZmV0Y2godXJsKycvJyttZDUrJy9kb3duaW5mbycsIHsKICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICJQQVRDSCIsCiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycywKICAgICAgICAgICAgICAgICAgICBib2R5OkpTT04uc3RyaW5naWZ5KGRvd25pbmZvKSwKICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIG1kNSA9IG1kNXMuc2xpY2UoMCwgbWQ1dHlwZSkuam9pbignJyk7CiAgICAgICAgICAgIGlmIChtZDV0eXBlID4gNCkgbWQ1ICs9IChtZDV0eXBlIC0gNCk7CiAgICAgICAgICAgIGZldGNoKHVybCsnLycrbWQ1LCB7CiAgICAgICAgICAgICAgICBtZXRob2Q6ICJHRVQiLAogICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycywKICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbihyZXNwb25zZSkgewogICAgICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlLmpzb24oKQogICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uKGpzb24pIHsKICAgICAgICAgICAgICAgIGlmICghanNvbikgewogICAgICAgICAgICAgICAgICAgIHNldFZhbHVlKG1kNSwgaW5mbykKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24udXJsID09IGluZm8udXJsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdGltZT1qc29uLmRvd25pbmZvLnNsaWNlKC0xKVswXVsyXTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGl0aW1lPWluZm8uZG93bmluZm9bMF1bMl07CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3RpbWUgJiYgIWl0aW1lKXt9CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN0aW1lICYmIGl0aW1lICYmIE1hdGguYWJzKGl0aW1lIC0gc3RpbWUpPDAuMDA2MCl7fQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHB1c2hEb3duaW5mbyhtZDUsaW5mby5kb3duaW5mb1swXSk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgbWQ1dHlwZSArPSAxOwogICAgICAgICAgICAgICAgICAgICAgICB1cGxvYWRJbmZvKCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KQogICAgICAgIH0KICAgIH0KICAgIGZ1bmN0aW9uIHNhdmVBbGxUZXh0KCkgewogICAgICAgIHZhciBhbGxUZXh0ID0gJycsIGE7CiAgICAgICAgZm9yICh2YXIgaSBvZiBjaGFwdGVyc0luZGV4KSB7CiAgICAgICAgICAgIGFsbFRleHQgKz0gJ1xuIyMnICsgY2hhcHRlcnNbaV0udGl0bGUudHJpbSgpLnJlcGxhY2UoL1xzKy9nLCcgJykgKyAnXG4nICsgY2hhcHRlcnNbaV0udGV4dDsKICAgICAgICB9CiAgICAgICAgdmFyIGRkPW5ldyBEYXRlKCk7CiAgICAgICAgdmFyIHRpbWU9ZGQuZ2V0RnVsbFllYXIoKSoxMDAwMCsoZGQuZ2V0TW9udGgoK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XVsdFZpZXcmJmRvYy5kZWZhdWx0Vmlldy5mcmFtZUVsZW1lbnQmJmRvYy5kZWZhdWx0Vmlldy5mcmFtZUVsZW1lbnQucmVtb3ZlKCk7CiAgICAgICAgc3dpdGNoIChzdGF0ZSkgewogICAgICAgICAgICBjYXNlICdObyc6IGRvd25sb2FkZWRObyArPSAxOyBicmVhazsKICAgICAgICAgICAgY2FzZSAnRXInOiBkb3dubG9hZGVkRXJyICs9IDE7IGJyZWFrOwogICAgICAgICAgICBjYXNlICc+Tic6CiAgICAgICAgICAgIGNhc2UgJz4+Tic6IGRvd25sb2FkZWRFeGNlZWROZXh0ICs9IDE7IGJyZWFrOwogICAgICAgICAgICBjYXNlICdOZXh0JzoKICAgICAgICAgICAgICAgIGNoYXB0ZXJzW2luZGV4XS5uZXh0Q291bnQgKz0gMTsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgY2hhcHRlcnNbaW5kZXhdLnN0YXRlID0gc3RhdGU7CiAgICAgICAgc2hvd1N0YXRlKGluZGV4KTsKICAgICAgICBkb3dubG9hZFRleHQobnVsbCwgY2hhcHRlcnNJbmRleFtkb3dubG9hZEluZGV4XSwgZ2V0QWxsVGV4dENhbGxiYWNrKTsKICAgICAgICBkb3dubG9hZEluZGV4ID0gZ2V0TmV4dFVuZG93bmxvYWRJbmRleChkb3dubG9hZEluZGV4ICsgMSk7CiAgICAgICAgZG93bmxvYWRlZENvdW50ICs9IDE7CiAgICAgICAgcm9vdC5xdWVyeVNlbGVjdG9yKCcjZG93bmxvYWROdW1iZXJzJykudGV4dENvbnRlbnQgPSBgJHtjaGFwdGVycy5sZW5ndGh9LyR7ZG93bmxvYWRlZENvdW50fS8ke2Rvd25sb2FkZWROb30vJHtkb3dubG9hZGVkRXJyfS8ke2Rvd25sb2FkZWRFeGNlZWROZXh0fWA7CiAgICAgICAgaWYgKGRvd25sb2FkZWRDb3VudCA+PSBjaGFwdGVycy5sZW5ndGgpIHsKICAgICAgICAgICAgaWYgKGRvd25sb2FkZWRObyA9PSAwICYmIGRvd25sb2FkZWRFcnIgPT0gMCkgewogICAgICAgICAgICAgICAgc2F2ZUFsbFRleHQoKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGlmIChjb25maXJtKGAke2Rvd25sb2FkZWROb33kuKrmib7kuI3liLDmraPmloflhYPntKDvvIwke2Rvd25sb2FkZWRFcnJ95Liq5LiL6L295aSx6LSl44CCXG7mmK/lkKbkv53lrZjlt7LkuIvovb3nmoTmlofmnKzjgIJgKSkgewogICAgICAgICAgICAgICAgICAgIHNhdmVBbGxUZXh0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9IC8vZ2V0QWxsVGV4dENhbGxiYWNrCiAgICBmdW5jdGlvbiBpc0Rvd25sb2FkZWQoaW5kZXgpIHsKICAgICAgICB2YXIgc3RhdGUgPSBjaGFwdGVyc1tpbmRleF0uc3RhdGU7CiAgICAgICAgcmV0dXJuIHN0YXRlID09ICdPSycKICAgIH0KICAgIGZ1bmN0aW9uIGdldE5leHRVbmRvd25sb2FkSW5kZXgoaW5kZXgpIHsKICAgICAgICB3aGlsZSAoaW5kZXggPCBjaGFwdGVyc0luZGV4Lmxlbmd0aCAmJiBpc0Rvd25sb2FkZWQoY2hhcHRlcnNJbmRleFtpbmRleF0pKSB7CiAgICAgICAgICAgIGRvd25sb2FkZWRDb3VudCArPSAxOwogICAgICAgICAgICBpbmRleCArPSAxOwogICAgICAgIH0KICAgICAgICByZXR1cm4gaW5kZXg7CiAgICB9CiAgICBmdW5jdGlvbiBnZXRBbGxUZXh0KCkgewogICAgICAgIGlmIChjaGFwdGVycy5sZW5ndGggPCAxKSBhbGVydCgi5rKh5pyJ55uu5b2V77yM6K+35YWI6I635Y+W55uu5b2V5YaN5LiL6L295YWo6YOo5paH5pys44CCIik7CiAgICAgICAgZG93bmxvYWRlZENvdW50ID0gMDsgLy/lt7LkuIvovb3mlbDph48KICAgICAgICBkb3dubG9hZGVkRXJyID0gMDsgLy/kuIvovb3lpLHotKXmlbDph48KICAgICAgICBkb3dubG9hZGVkTm8gPSAwOyAvL+S4i+i9veeroOiKguaJvuS4jeWIsOmAieaLqeWZqOWvueW6lOWFg+e0oOeahOaVsOmHjwogICAgICAgIGRvd25sb2FkSW5kZXggPSAwOyAvL+W9k+WJjeW+heS4i+i9veW6j+WPtwoKICAgICAgICBkb3dubG9hZEluZGV4ID0gZ2V0TmV4dFVuZG93bmxvYWRJbmRleChkb3dubG9hZEluZGV4KTsKICAgICAgICBpZiAoZG93bmxvYWRJbmRleCA+PSBjaGFwdGVycy5sZW5ndGgpIHNhdmVBbGxUZXh0KCk7IC8v5bey57uP6I635Y+W5YWo6YOo5paH5pysCiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgTWF4VGhyZWFkOyBpKyspIHsKICAgICAgICAgICAgICAgIGRvd25sb2FkVGV4dChudWxsLCBjaGFwdGVyc0luZGV4W2Rvd25sb2FkSW5kZXhdLCBnZXRBbGxUZXh0Q2FsbGJhY2spOwogICAgICAgICAgICAgICAgZG93bmxvYWRJbmRleCA9IGdldE5leHRVbmRvd25sb2FkSW5kZXgoZG93bmxvYWRJbmRleCArIDEpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgdmFyIGRlbGV0ZVJvdyA9IGUgPT4gewogICAgICAgIHZhciB0ciA9IGUudGFyZ2V0LnBhcmVudEVsZW1lbnQucGFyZW50RWxlbWVudDsKICAgICAgICB2YXIgaW5kZXggPSBnZXRJbmRleE9mT2JqZWN0QXJyYXkoY2hhcHRlcnMsICJ0ciIsIHRyKTsKICAgICAgICB0ci5yZW1vdmUoKTsKICAgICAgICBjaGFwdGVycy5zcGxpY2UoaW5kZXgsIDEpOwogICAgICAgIGNoYXB0ZXJzSW5kZXguc3BsaWNlKGNoYXB0ZXJzSW5kZXguaW5kZXhPZihpbmRleCksIDEpO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YgbGluZXMpIHsKICAgICAgICAgICAgaWYgKCFsaW5lLnRyaW0oKSkgY29udGludWU7CiAgICAgICAgICAgIGlmIChsaW5lLnNsaWNlKDAsIDIpID09ICckJCcpIHsKICAgICAgICAgICAgICAgIGlmIChrZXk9PSdmcmFtZVRleHQnKSByZXN1bHRba2V5XT0nJzsKICAgICAgICAgICAgICAgIGlmIChrZXk9PSdub3RVcGxvYWRTYXZlaW5mbycpIHJlc3VsdFtrZXldPScnOwogICAgICAgICAgICAgICAgZWxzZSBpZiAoa2V5ICYmIHZhbHVlKSByZXN1bHRba2V5XSA9IHZhbHVlLnRyaW0oKTsKICAgICAgICAgICAgICAgIGtleSA9IGxpbmUuc2xpY2UoMik7CiAgICAgICAgICAgICAgICB2YWx1ZSA9ICcnOwogICAgICAgICAgICAgICAgaWYgKFNFVFRJTkdfS0VZUy5pbmRleE9mKGtleSkgPT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWxlcnQoYOe9keermemFjee9rui+k+WFpeahhuS4re+8jOmUruWAvCR7a2V5feS4jeWQiOazle+8jOivt+S/ruaUueOAgmApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdmFsdWUgKz0gKHZhbHVlID8gJ1xuJyA6ICcnKSArIGxpbmU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKGtleT09J2ZyYW1lVGV4dCcpIHJlc3VsdFtrZXldPScnOwogICAgICAgIGlmIChrZXk9PSdub3RVcGxvYWRTYXZlaW5mbycpIHJlc3VsdFtrZXldPScnOwogICAgICAgIGVsc2UgaWYgKGtleSAmJiB2YWx1ZSkgcmVzdWx0W2tleV0gPSB2YWx1ZS50cmltKCk7CiAgICAgICAgaWYgKGlzU2V0Q3Vuc3RvbUZ1bikgewogICAgICAgICAgICBjdXN0b21MaXN0RnVuYyA9IHJlc3VsdC5jdXN0b21MaXN0RnVuYyA/IEZ1bmN0aW9uKCJkb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AgICBpZiAodHlwZW9mIHNldHRpbmcgIT0gJ29iamVjdCcpIHJldHVybjsKICAgICAgICBpZiAoaXNTYW1lT2JqZWN0KHNldHRpbmcsIHt9KSkgewogICAgICAgICAgICBHTV9kZWxldGVWYWx1ZShsb2NhdGlvbi5ob3N0KTsKICAgICAgICAgICAgYWxlcnQoIuW3suWIoOmZpOivpee9keermemFjee9riIpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIEdNX3NldFZhbHVlKGxvY2F0aW9uLmhvc3QsIHNldHRpbmcpOwogICAgICAgICAgICBhbGVydCgi5bey5L+d5a2Y6K+l572R56uZ6YWN572uIik7CiAgICAgICAgfQogICAgICAgIHNldFNhdmVTaXRlU2V0dGluZ0NsYXNzKCk7CiAgICB9CiAgICBmdW5jdGlvbiBpc1NhbWVPYmplY3Qob2JqZWN0MSwgb2JqZWN0MikgewogICAgICAgIGlmICghb2JqZWN0MSB8fCAhb2JqZWN0MikgcmV0dXJuIGZhbHNlOwogICAgICAgIHZhciBzczEgPSBPYmplY3QuZW50cmllcyhvYmplY3QxKS50b1N0cmluZygpOwogICAgICAgIHZhciBzczIgPSBPYmplY3QuZW50cmllcyhvYmplY3QyKS50b1N0cmluZygpOwogICAgICAgIHJldHVybiBzczEgPT09IHNzMjsKICAgIH0KICAgIGZ1bmN0aW9uIHNldFJlc3RMaXN0Q2xhc3MoKXsKICAgICAgICB2YXIgbmV4dExpc3Q9Z2V0TmV4dExpc3QoZG9jdW1lbnQpOwogICAgICAgIHJvb3QucXVlcnlTZWxlY3RvcigiI2dldFJlc3RMaXN0IikuZGlzYWJsZWQ9IW5leHRMaXN0OwogICAgfQogICAgZnVuY3Rpb24gc2V0U2F2ZVNpdGVTZXR0aW5nQ2xhc3MoKSB7CiAgICAgICAgdGVtcFNldHRpbmcgPSBnZXRTZXR0aW5nKGZhbHNlKTsKICAgICAgICBpZiAodHlwZW9mIHRlbXBTZXR0aW5nID09ICdvYmplY3QnKSB7CiAgICAgICAgICAgI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NtOwogICAgICAgIHl0aGVkaXRvciA9IGNtCiAgICAgICAgU0VUVElOR19LRVlTLmZvckVhY2god29yZHMgPT4gewogICAgICAgICAgICAvL0NvZGVNaXJyb3IucmVzb2x2ZU1vZGUoImphdmFzY3JpcHQiKS5rZXl3b3Jkc1t3b3Jkc10gPSB0cnVlOwogICAgICAgIH0pOwoKICAgIH0KICAgIGZ1bmN0aW9uIGRvd25sb2FkRmlsZShibG9iLCBmaWxlTmFtZSkgewogICAgICAgIHZhciBsaW5rID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpOwogICAgICAgIGxpbmsuaHJlZiA9IHdpbmRvdy5VUkwuY3JlYXRlT2JqZWN0VVJMKGJsb2IpOwogICAgICAgIGxpbmsuZG93bmxvYWQgPSBmaWxlTmFtZTsKICAgICAgICBsaW5rLmNsaWNrKCk7CiAgICAgICAgbGluay5yZW1vdmUoKTsKICAgICAgICB3aW5kb3cuVVJMLnJldm9rZU9iamVjdFVSTChsaW5rLmhyZWYpOwogICAgfQogICAgZnVuY3Rpb24gYWRkU2l0ZVNldHRpbmdzKHNpdGVTZXR0aW5ncykgewogICAgICAgIGZvciAodmFyIG5hbWUgaW4gc2l0ZVNldHRpbmdzKSB7CiAgICAgICAgICAgIHZhciBzZXR0aW5nID0gc2l0ZVNldHRpbmdzW25hbWVdOwogICAgICAgICAgICB2YXIgdG1wU2V0dGluZyA9IHt9OwogICAgICAgICAgICBmb3IgKHZhciBrZXkgb2YgU0VUVElOR19LRVlTKSB7CiAgICAgICAgICAgICAgICBpZiAoc2V0dGluZy5oYXNPd25Qcm9wZXJ0eShrZXkpKSB0bXBTZXR0aW5nW2tleV0gPSBzZXR0aW5nW2tleV07CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKCFpc1NhbWVPYmplY3QodG1wU2V0dGluZywge30pKSBHTV9zZXRWYWx1ZShuYW1lLCB0bXBTZXR0aW5nKTsKICAgICAgICB9CiAgICB9CiAgICBmdW5jdGlvbiBzZW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ICdvYmplY3QnKSByZXR1cm47CiAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInl0aExpc3QiKS5zdHlsZS5kaXNwbGF5PSdub25lJzsKICAgICAgICBzZXRUaW1lb3V0KCgpPT57CiAgICAgICAgICAgIGRvY3VtZW50LmJvZHkuYWRkRXZlbnRMaXN0ZW5lcigibW91c2VvdmVyIiwgc2VsTW91c2VvdmVyKTsKICAgICAgICAgICAgLy8gICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFkZEV2ZW50TGlzdGVuZXIoIm1vdXNlZG93biIsIHNlbENsaWNrKTsKICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hZGRFdmVudExpc3RlbmVyKCJjbGljayIsIHNlbENsaWNrLCB0cnVlKTsKICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hZGRFdmVudExpc3RlbmVyKCJ0b3VjaGVuZCIsIHNlbENsaWNrLCB0cnVlKTsKICAgICAgICB9LDIwMCk7CiAgICB9CiAgICBmdW5jdGlvbiBhZGREaXYoKSB7CiAgICAgICAgR01fYWRkU3R5bGUoYAogICAgICAgICN5dGhMaXN0ewogICAgICAgICAgcG9zaXRpb246Zml4ZWQ7CiAgICAgICAgICByaWdodDowcHg7CiAgICAgICAgICB6LWluZGV4OiA5OTk5OTk5OTk5OTsKICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNjY2M7CiAgICAgICAgICB0b3A6IDA7CiAgICAgICAgfQogICAgICAgIC55dGhIaWdobGlnaHR7CiAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiM4Y2UhaW1wb3J0YW50OwoJICAgICAgY3Vyc29yOnBvaW50ZXIhaW1wb3J0YW50OwoJICAgICAgb3V0bGluZTo0cHggc29saWQgIzAxNiFpbXBvcnRhbnQ7CiAgICAgICAgfQogICAgICAgIGApOwogICAgICAgIHZhciBzaGFkb3dDc3MgPSBgCjxzdHlsZT4KdGV4dGFyZWF7CiAgICB3aGl0ZS1zcGFjZTogb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CAiUmVhZGVyQXR0YWNoZWQiKSA6IG51bGw7CgogICAgICAgIHJvb3QucXVlcnlTZWxlY3RvcigiI3NvcnQiKS5hZGRFdmVudExpc3RlbmVyKCJjaGFuZ2UiLCAoZSkgPT4gewogICAgICAgICAgICBzb3J0TGlzdChlLnRhcmdldC52YWx1ZSk7CiAgICAgICAgfSk7CiAgICAgICAgZW5hYmxlQ29kZU1pcnJvdygpOwoKICAgICAgICBzZXR0aW5nID0gR01fZ2V0VmFsdWUobG9jYXRpb24uaG9zdCk7CiAgICAgICAgaWYgKCFzZXR0aW5nKSBzZXR0aW5nID0ge307CiAgICAgICAgZGlzcGxheVNldHRpbmcoKTsKICAgICAgICB2YXIgZUdldExpc3QgPSByb290LnF1ZXJ5U2VsZWN0b3IoIiNnZXRMaXN0Iik7CiAgICAgICAgZUdldExpc3Qub25jbGljayA9ICgpID0+IHsKICAgICAgICAgICAgZ2V0TGlzdChkb2N1bWVudCk7CiAgICAgICAgfTsKICAgICAgICBlR2V0TGlzdC5jbGljaygpOwogICAgICAgIHJvb3QucXVlcnlTZWxlY3RvcigiI2dldFJlc3RMaXN0IikuYWRkRXZlbnRMaXN0ZW5lcigiY2xpY2siLCAoKSA9PiB7CiAgICAgICAgICAgIGdldFJlc3RMaXN0KGRvY3VtZW50KTsKICAgICAgICB9KTsKICAgICAgICAvLyAgICAgICAgc2V0U2F2ZVNpdGVTZXR0aW5nQ2xhc3MoKTsKCiAgICAgICAgdmFyIHJlc2l6ZSA9IHJvb3QucXVlcnlTZWxlY3RvcigiI3Jlc2l6ZSIpOwogICAgICAgIHJlc2l6ZS5hZGRFdmVudExpc3RlbmVyKCJjbGljayIsIChlKSA9PiB7CiAgICAgICAgICAgIHZhciBlbGUgPSByZXNpemU7CiAgICAgICAgICAgIGlmIChlbGUudGl0bGUgPT0gJ+aUvuWkpycpIHsKICAgICAgICAgICAgICAgIGVsZS50aXRsZSA9ICfnvKnlsI8nOwogICAgICAgICAgICAgICAgZWxlLmlubmVySFRNTCA9IHNocmlua1N2ZzsKICAgICAgICAgICAgICAgIGNtLnNldFNpemUoQ29kZU1pcnJvclNpemVbMF0gKiAyLCBDb2RlTWlycm9yU2l6ZVsxXSAqIDIpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgZWxlLnRpdGxlID0gJ+aUvuWkpyc7CiAgICAgICAgICAgICAgICBlbGUuaW5uZXJIVE1MID0gZXhwYW5kU3ZnOwogICAgICAgICAgICAgICAgY20uc2V0U2l6ZShDb2RlTWlycm9yU2l6ZVswXSwgQ29kZU1pcnJvclNpemVbMV0pOwogICAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICAgICAgcmVzaXplLmNsaWNrKCk7CgogICAgICAgIHZhciBpbnB1dEZpbGVzID0gcm9vdC5xdWVyeVNlbGVjdG9yKCIjaW5wdXRGaWxlcyIpOwogICAgICAgIGlucHV0RmlsZXMuYWRkRXZlbnRMaXN0ZW5lcigiY2hhbmdlIiwgKGUpID0+IHsKICAgICAgICAgICAgdmFyIGZpbGUgPSBlLnRhcmdldC5maWxlc1swXTsKICAgICAgICAgICAgaWYgKCFmaWxlKSByZXR1cm47CiAgICAgICAgICAgIHZhciByZWFkZXIgPSBuZXcgRmlsZVJlYWRlcigpOwogICAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChmaWxlKTsKICAgICAgICAgICAgcmVhZGVyLm9ubG9hZCA9IGZ1bmN0aW9uIChlKSB7CiAgICAgICAgICAgICAgICB2YXIgc2l0ZVNldHRpbmdzID0gSlNPTi5wYXJzZSh0aGlzLnJlc3VsdCk7CiAgICAgICAgICAgICAgICBhZGRTaXRlU2V0dGluZ3Moc2l0ZVNldHRpbmdzKTsKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIHJvb3QucXVlcnlTZWxlY3RvcigiI2ZvY3VzIikuYWRkRXZlbnRMaXN0ZW5lcigiY2xpY2siLCAoZSkgPT4gewogICAgICAgICAgICBnZXRDbGlja2VkRWxlbWVudFNlbG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mFtZSBvZiBuYW1lcykgewogICAgICAgICAgICAgICAgaWYgKG5hbWUgPT0gJ1JlYWRlclN0eWxlJykgY29udGludWU7CiAgICAgICAgICAgICAgICBHTV9kZWxldGVWYWx1ZShuYW1lKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBhbGVydCgi5bey5Yig6Zmk546w5pyJ5YWo6YOo572R56uZ6YWN572u5L+h5oGvIik7CiAgICAgICAgfSk7CiAgICAgICAgcm9vdC5xdWVyeVNlbGVjdG9yKCIjc2F2ZVNpdGVTZXR0aW5nIikuYWRkRXZlbnRMaXN0ZW5lcigiY2xpY2siLCAoZSkgPT4gewogICAgICAgICAgICBzYXZlU2l0ZVNldHRpbmcoKTsKICAgICAgICB9KTsKICAgICAgICB2YXIgY29udGFpbmVyID0gcm9vdC5xdWVyeVNlbGVjdG9yKCIjY29udGFpbmVyIikKICAgICAgICBjb250YWluZXIuc3R5bGUuaGVpZ2h0ID0gJzEwMHZoJzsKICAgICAgICByb290LnF1ZXJ5U2VsZWN0b3IoIiN0b2dnbGUiKS5hZGRFdmVudExpc3RlbmVyKCJjbGljayIsIChlKSA9PiB7CiAgICAgICAgICAgIGlmIChlLnRhcmdldC50ZXh0Q29udGVudCA9PSAn77mAJykgewogICAgICAgICAgICAgICAgZS50YXJnZXQudGV4dENvbnRlbnQgPSAn77i/JzsKICAgICAgICAgICAgICAgIHZhciBuZXh0PWUudGFyZ2V0LnBhcmVudEVsZW1lbnQubmV4dEVsZW1lbnRTaWJsaW5nOwogICAgICAgICAgICAgICAgd2hpbGUobmV4dCl7CiAgICAgICAgICAgICAgICAgICAgbmV4dC5zdHlsZS5kaXNwbGF5ID0gJyc7CiAgICAgICAgICAgICAgICAgICAgbmV4dD1uZXh0Lm5leHRFbGVtZW50U2libGluZzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGNvbnRhaW5lci5zdHlsZS5oZWlnaHQgPSAnMTAwdmgnOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgZS50YXJnZXQudGV4dENvbnRlbnQgPSAn77mAJzsKICAgICAgICAgICAgICAgIG5leHQ9ZS50YXJnZXQucGFyZW50RWxlbWVudC5uZXh0RWxlbWVudFNpYmxpbmc7CiAgICAgICAgICAgICAgICB3aGlsZShuZXh0KXsKICAgICAgICAgICAgICAgICAgICBuZXh0LnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CiAgICAgICAgICAgICAgICAgICAgbmV4dD1uZXh0Lm5leHRFbGVtZW50U2libGluZzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGNvbnRhaW5lci5zdHlsZS5oZWlnaHQgPSAnJzsKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIHJvb3QucXVlcnlTZWxlY3RvcigiI0RlbGV0ZU5vVGV4dCIpLm9uY2xpY2sgPSAoKSA9PiB7CiAgICAgICAgICAgIGZvciAobGV0IGkgPSBjaGFwdGVycy5sZW5ndGggLSAxOyBpID49IDA7IGktLSkgewogICAgICAgICAgICAgICAgaWYgKCFjaGFwdGVyc1tpXS50ZXh0KSB7CiAgICAgICAgICAgICAgICAgICAgY2hhcHRlcnMuc3BsaWNlKGksIDEpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGNoYXB0ZXJzSW5kZXggPSBudWxsOwogICAgICAgICAgICBzb3J0TGlzdChyb290LnF1ZXJ5U2VsZWN0b3IoIiNzb3J0IikudmFsdWUpOwogICAgICAgIH07CiAgICAgICAgcm9vdC5xdWVyeVNlbGVjdG9yKCIjY2xlYXJMaXN0Iikub25jbGljayA9ICgpID0+IHsKICAgICAgICAgICAgcm9vdC5xdWVyeVNlbGVjdG9yKCJ0YWJsZSB0Ym9keSIpLmlubmVySFRNTCA9ICIiOwogICAgICAgICAgICBjaGFwdGVycyA9IFtdOwogICAgICAgICAgICBjaGFwdGVyc0luZGV4ID0gW107CiAgICAgICAgfTsKICAgICAgICByb290LnF1ZXJ5U2VsZWN0b3IoIiNnZXRBbGxUZXh0Iikub25jbGljayA9ICgpID0+IHsKICAgICAgICAgICAgc2V0dGluZyA9IGdldFNldHRpbmcoKTsKICAgICAgICAgICAgaWYgKHR5cGVvZiBzZXR0aW5nID09ICdvYmplY3QnKSBnZXRBbGxUZXh0KCk7CiAgICAgICAgfTsKICAgIH0KICAgIEdNX3JlZ2lzdGVyTWVudUNvbW1hbmQoIuW8gOWniyIsIGFkZERpdik7Cn0pKCk7IC8vYWRkRGl2
Add Comment
Please, Sign In to add comment