Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥豌豆PRO@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcInlzZnhcIixcInBhdGhcIjpcInlzZnhcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxubGV0IHJ1bGUgPSBnZXRQYXJhbShcXFwiclxcXCIpLnNwbGl0KFxcXCIjI1xcXCIpWzBdO1xcbmxldCB1cmwgPSBNWV9VUkwuc3BsaXQoXFxcIiMjXFxcIilbMV07XFxubGV0IGl0ZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3VcXFwiKShydWxlLCBnZXRIb21lKHVybCkpO1xcbmxldCBqcyA9ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICB0cnkge1xcbiAgICAgICAgaWYgKGRvY3VtZW50LnRpdGxlICYmIGRvY3VtZW50LnRpdGxlLmxlbmd0aCkge1xcbiAgICAgICAgICAgIGxldCByID0gJCQkKCkubGF6eVJ1bGUoKHQpID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKHQpO1xcbiAgICAgICAgICAgIH0sIGRvY3VtZW50LnRpdGxlKTtcXG4gICAgICAgICAgICBmeV9icmlkZ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cmlnaW4pIHtcXG4gICAgcmV0dXJuICQudG9TdHJpbmcoKHJ1bGUsIG9yaWdpbikgPT4ge1xcbiAgICAgICAgbGV0IGhvc3QgPSBvcmlnaW4ucmVwbGFjZShuZXcgUmVnRXhwKFxcXCJodHRwOi8vfGh0dHBzOi8vXFxcIiksIFxcXCJcXFwiKS5zcGxpdChcXFwiL1xcXCIpWzBdO1xcbiAgICAgICAgbGV0IGhvc3RzID0gaG9zdC5zcGxpdChcXFwiLlxcXCIpO1xcbiAgICAgICAgaWYgKGhvc3RzLmxlbmd0aCA+IDIpIHtcXG4gICAgICAgICAgICBob3N0ID0gaG9zdHNbaG9zdHMubGVuZ3RoIC0gMl0gKyBcXFwiLlxcXCIgKyBob3N0c1tob3N0cy5sZW5ndGggLSAxXTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChpbnB1dC5zdGFydHNXaXRoKFxcXCJtYWduZXRcXFwiKSkge1xcbiAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4qemmqOaPkOekulxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXCLmo4DmtYvliLDmlrDnmoTno4Hpk77lnLDlnYDvvIzngrnlh7vnoa7lrprmjInpkq7ljbPlj6/mkq3mlL7vvIzngrnlh7vlj5bmtojmjInpkq7lj6/ku6XlpI3liLbpk77mjqVcXFwiLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChtYWcpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYWc7XFxuICAgICAgICAgICAgICAgIH0sIGlucHV0KSxcXG4gICAgICAgICAgICAgICAgY2FuY2VsOiAkLnRvU3RyaW5nKChtYWcpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyBtYWdcXG4gICAgICAgICAgICAgICAgfSwgaW5wdXQpXFxuICAgICAgICAgICAgfSlcXG4g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bU52YkY5MGVYQmxYQ0k2WENKdGIzWnBaVjh6WENJc1hDSnVZVzFsWENJNlhDTGt1S3JrdXJybnZaSG5tNWpvcjZibWc0VmNJaXhjSW5CaGRHaGNJanBjSW1SeWFYWmxYQ0lzWENKeWRXeGxYQ0k2WENKcWN6cGNYRzVsZG1Gc0tHWmxkR05vS0Nkb2FXdGxjam92TDJacGJHVnpMM0oxYkdWekwybGplUzloYkdrdWFuTW5LU2s3WEZ4dVlXeHBMbWx1YVhSRGIyNW1hV2NvS1R0Y1hHNWhiR2t1YlhsQmJHbFNkV3hsS0NrN1hDSjlYU0lzSW1samIyNGlPaUpvZEhSd2N6b3ZMMmRwZEdWbExtTnZiUzltYkhreE16azNMMmhwYTJWeUxXbGplUzl5WVhjdmJXRnpkR1Z5TDJGc2FYbDFiaTV3Ym1jaWZRPT1cXFwiXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5rip6aao5o+Q56S6JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICfmnKzop4TliJnkvp3otZbkupHnm5jmsYflvbHop4TliJnvvIzngrnlh7vkuIvpnaLnmoTnoa7lrprmjInpkq7lr7zlhaXvvIzms6jmhI/lr7zlhaXlkI7kuIDlrpropoHlnKjkupHnm5jmsYflvbHnmbvlvZXpmL/ph4zkupHnm5jotKblj7fvvIzlkKbliJnkuI3og73nlKgnLFxcbiAgICAgICAgICAgICAgICAgICAgY29uZmlybTogcnUsXFxuICAgICAgICAgICAgICAgICAgICBjYW5jZWw6IHJ1XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxvZyhcXFwiaW5wdXRcXFwiKTtcXG4gICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAub3BlbihKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumYv+mHjOS6keebmFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD1cXFwiICsgdXJsICsgJz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpXFxuICAgICAgICB9IGVsc2UgaWYgKC9cXFxcLihtcDN8ZmxhY3xtNGEpJC8udGVzdChpbnB1dCkpIHtcXG4gICAgICAgICAgICBsb2coaW5wdXQpO1xcbiAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5wbGF5VmlkZW8odXJsKTtcXG4gICAgICAgICAgICB9LCBpbnB1dCwgcnVsZSlcXG4gICAgICAgIH0gZWxzZSBpZiAoIWlucHV0LmluY2x1ZGVzKGhvc3QpICYmIGlucHV0LnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgIGxvZyhpbnB1dCk7XFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgd2hpdGUgPSBbXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZG91eWluXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkb3ViYW5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIml4aWd1YS5jb21cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImt1YWlzaG91XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJiaWxpYmlsaVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwid2VpYm9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIndlaXhpblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYmFpZHVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInptay5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInN1YmhkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0aHVuZGVyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ4aW5qdWNcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImdyYWI0a1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiL2J0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJqc3IxMFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYXNzcnRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInF1YXJrXFxcIlxcbiAgICAgICAgICAgICAgICBdO1xcbiAgICAgICAgICAgICAgICBsZXQgaW5XaGl0ZSA9IHdoaXRlLmZpbHRlcihpdCA9PiB1cmwuaW5jbHVkZXMoaXQpKS5sZW5ndGggPiAwO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5XaGl0ZSkge1xcbiAgICAgICAgICAgICAgICAgICAgLy/ot7PnvZHpobVcXG4gICAgICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAub3BlbihKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLor6bmg4VcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnI9XFxcIiArIHJ1bGUgKyBcXFwiIyNcXFwiICsgdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAvL0FJ6Kej5p6QXFxuICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBkb2N1bWVudC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZyPVxcXCIgKyBydWxlICsgXFxcIiZ1PVxcXCIgKyBmeV9icmlkZ2VfYXBwLmJhc2U2NEVuY29kZSh1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbnB1dCwgcnVsZSk7XFxuICAgICAgICB9IGVsc2UgaWYgKCFpbnB1dC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICBsb2coaW5wdXQpO1xcbiAgICAgICAgICAgIC8v6IO95ZSk6LW3QVBQ55qE55m95ZCN5Y2VXFxuICAgICAgICAgICAgbGV0IHdoaXRlID0gW1xcbiAgICAgICAgICAgICAgICBcXFwicWtsaW5rXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcImJkbmV0ZGlza1xcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJ4dW5sZWlhcHBcXFwiXFxuICAgICAgICAgICAgXTtcXG4gICAgICAgICAgICBsZXQgaW5XaGl0ZSA9IHdoaXRlLmZpbHRlcihpdCA9PiBpbnB1dC5zdGFydHNXaXRoKGl0KSkubGVuZ3RoID4gMDtcXG4gICAgICAgICAgICBpZiAoIWluV2hpdGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAub3BlblRoaXJkQXBwICYmIGZ5X2JyaWRnZV9hcHAub3BlblRoaXJkQXBwKHVybCk7XFxuICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGxldCB3aGl0ZSA9IFtcXG4gICAgICAgICAgICAgICAgXFxcInVybD1cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiZnNvdS5jb21cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiYmluZy5cXFwiLCAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICBdO1xcbiAgICAgICAgICAgIGxldCBpbldoaXRlID0gd2hpdGUuZmlsdGVyKGl0ID0+IGlucHV0LmluY2x1ZGVzKGl0KSkubGVuZ3RoID4gMDtcXG4gICAgICAgICAgICBpZiAoaW5XaGl0ZSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCByZWcgPSBuZXcgUmVnRXhwKFxcXCJbXFxcXHU0ZTAwLVxcXFx1OWZhNV0rXFxcIiwgXFxcImdcXFwiKTtcXG4gICAgICAgICAgICBsZXQgciA9IGRlY29kZVVSSUNvbXBvbmVudChpbnB1dCk7XFxuICAgICAgICAgICAgaWYgKHJlZy50ZXN0KHIpIHx8IChpbnB1dC5zdGFydHNXaXRoKG9yaWdpbikgJiYgaW5wdXQubGVuZ3RoIC0gb3JpZ2luLmxlbmd0aCA+IDIpKSB7XFxuICAgICAgICAgICAgICAgIC8v5pyJ5Lit5paH77yM5bqU6K+l5piv5Zyo5pCc57Si77yM6Lez5paw6aG16Z2iXFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAub3BlbihKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0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XCIpKGdldFBhcmFtKFxcXCJyXFxcIiksIGdldEhvbWUodXJsKSk7XFxuICAgIGxldCBqcyA9ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBpZiAoZG9jdW1lbnQudGl0bGUgJiYgZG9jdW1lbnQudGl0bGUubGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgIGxldCByID0gJCQkKCkubGF6eVJ1bGUoKHQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSh0KTtcXG4gICAgICAgICAgICAgICAgfSwgZG9jdW1lbnQudGl0bGUpO1xcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLnBhcnNlTGF6eVJ1bGUocik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAubG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBsZXQganMyID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UveDVhaVxcXCIpKGdldFBhcmFtKFxcXCJyXFxcIiksIHVybCk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwieDVfd2Vidmlld19zaW5nbGVcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcImZsb2F0JiYxMDAlXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBqczoganMgKyBcXFwiO1xcXFxuXFxcIiArIGpzMixcXG4gICAgICAgICAgICB1cmxJbnRlcmNlcHRvcjogaXRlLFxcbiAgICAgICAgICAgIGNhbkJhY2s6IHRydWUsXFxuICAgICAgICAgICAgZmxvYXRWaWRlbzogdHJ1ZSxc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JldHVybiAtMTtcXG4gICAgICAgIH1cXG4gICAgICAgIGl0ID0gcGFyc2VJbnQoaXQpO1xcbiAgICAgICAgaWYgKGlzTmFOKGl0KSkge1xcbiAgICAgICAgICAgIHJldHVybiAtMTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChpdCA+IDE5MDAgJiYgaXQgPCAyMTAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIC0xO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGl0O1xcbiAgICB9XFxuXFxuICAgIGZ1bmN0aW9uIGlzQ2hhcHRlcjAoaXQsIGJyb3RoZXIpIHtcXG4gICAgICAgIC8qaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgbG9nKHtcXG4gICAgICAgICAgICAgICAgaXQ6IGl0LFxcbiAgICAgICAgICAgICAgICBicm90aGVyOiBicm90aGVyXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9Ki9cXG4gICAgICAgIGl0ID0gZ2V0Q2hhcHRlck51bShpdCk7XFxuICAgICAgICAvL2lmIChkZWJ1ZykgbG9nKGl0KTtcXG4gICAgICAgIGlmIChpdCA8IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICBicm90aGVyID0gZ2V0Q2hhcHRlck51bShicm90aGVyKTtcXG4gICAgICAgIC8vaWYgKGRlYnVnKSBsb2coYnJvdGhlcik7XFxuICAgICAgICBpZiAoYnJvdGhlciA8IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaXQgLSBicm90aGVyIDwgMiAmJiBpdCAtIGJyb3RoZXIgPiAtMjtcXG4gICAgfVxcblxcbiAgICBsZXQgX3dlYiA9ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgbGV0IHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgbGV0IHJlZyA9IC9cXFxcLmh0bWx8XFxcXC5jc3N8XFxcXC5qcy87XFxuICAgICAgICBmb3IgKGxldCBrIGluIHVybHMpIHtcXG4gICAgICAgICAgICBpZiAoIXJlZy50ZXN0KHVybHNba10pICYmIHVybHNba10ubWF0Y2goL1xcXFwubXA0fFxcXFwubTN1OC8pKSB7XFxuICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAubG9nKHVybHNba10pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcIlxcXCIpKSArIFxcXCIjaWdub3JlSW1nPXRydWUjXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgbGV0IHQgPSBpdC50ZXh0O1xcbiAgICAgICAgaWYgKCFpdC5ocmVmIHx8IGl0LmhyZWYgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwcmUgPSBpID09IDAgPyBudWxsIDogYXJyW2kgLSAxXTtcXG4gICAgICAgIGxldCBuZXh0ID0gaSA9PSAoYXJyLmxlbmd0aCAtIDEpID8gbnVsbCA6IGFycltpICsgMV07XFxuICAgICAgICBpZiAoaXNDaGFwdGVyKGl0LCBwcmUsIG5leHQpKSB7XFxuICAgICAgICAgICAgaWYgKHdlYikge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJseCA9IFxcXCJ3ZWJSdWxlOi8vXFxcIiArIGl0LmhyZWYgKyBcXFwiQFxcXCIgKyBfd2ViO1xcbiAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAganNMb2FkaW5nSW5qZWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5tNGEnLCAnLm1wMycsICcuZmx2JywgJy5hdmknLCAnLjNncCcsICcubXBlZycsICcud212JywgJy5tb3YnLCAnLnJtdmInLCAnLmdpZicsICcuanBlZycsICcucG5nJywgJy5pY28nLCAnLnN2ZyddXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybHggPSBcXFwidmlkZW86Ly9cXFwiICsgaXQuaHJlZjtcXG4gICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0LFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybHgsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJheFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGlmIChkLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICByZXR1cm4gZDtcXG4gICAgfSBlbHNlIHtcXG5cXG4gICAgICAgIGQuc3BsaWNlKDAsIDAsIHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIvCflJdcXFwiICsgdXJsLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnI9XFxcIiArIHJ1bGUgKyBcXFwiIyNcXFwiICsgdXJsLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIlxcbiAgICAgICAgfSk7XFxuXFxuXFxuICAgICAgICAvL+S4uue6v+i3r+WKoOWIhuWJsue6v1xcbiAgICAgICAgbGV0IGQyID0gW107XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGQubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBkMi5wdXNoKGRbaV0pO1xcbiAgICAgICAgICAgIGlmIChpIDwgZC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGRbaV07XFxuICAgICAgICAgICAgICAgIGxldCB0MSA9IHBhcnNlSW50KGNsZWFyVGV4dChpdC50aXRsZSkpO1xcbiAgICAgICAgICAgICAgICBsZXQgbmV4dCA9IGRbaSArIDFdO1xcbiAgICAgICAgICAgICAgICBsZXQgdDIgPSBwYXJzZUludChjbGVhclRleHQobmV4dC50aXRsZSkpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIgLSB0MSA+IDEgfHwgdDEgLSB0MiA+IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWMuemFjeacieivr++8n+eCueaIkeS4jeWGjeWMuemFjeatpOmhtemdolxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4qemmqOaPkOekulxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBcXFwi5aaC5p6c5Y+q5piv5Y2V5qyh5Yy56YWN5aSx6LSl77yM54K55Ye75LiL5pa55Y+W5raI5oyJ6ZKu5Yi35paw6aG16Z2i6YeN5paw5Yy56YWN77yM5aaC5p6c56Gu6K6k5peg5rOV5Yy56YWN77yM54K55Ye75LiL5pa556Gu5a6a5oyJ6ZKu5Yqg5YWl55m95ZCN5Y2VXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNhbmNlbDogXFxcInJlZnJlc2hQYWdlKClcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJ3aGl0ZVxcXCIsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnB1c2godXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJ3aGl0ZVxcXCIsIGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWKoOWFpeeZveWQjeWNlVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICB9LCB1cmwpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9hY2NvdW50XFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICByZXR1cm4gZDI7XFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJ4NUFJXCIsXCJwYXRoXCI6XCJ4NWFpXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSBmdW5jdGlvbihydWxlLCBhbmNob3JJZCkge1xcbiAgICByZXR1cm4gJC50b1N0cmluZygocnVsZSwgYW5jaG9ySWQsIHdoaXRlKSA9PiB7XFxuICAgICAgICBpZiAod2luZG93LmNoZWNrMCA9PSBudWxsKSB7XFxuICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2swKCkge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJodG1sXFxcIikuaW5uZXJIVE1MO1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLnB1dFZhcihcXFwiaHRtbDBcXFwiLCBodG1sKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5wYXJzZUxhenlSdWxlQXN5bmMoJCQkKCkubGF6eVJ1bGUoKHJ1bGUsIHVybCwgYW5jaG9ySWQsIHdoaXRlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBnZXRWYXIoXFxcImh0bWwwXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhclZhcihcXFwiaHRtbDBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHdlYiA9IGZhbHNlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgd2hpdGUyID0gW1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImZzb3UuY29tXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJiaW5nLlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbldoaXRlID0gd2hpdGUyLmZpbHRlcihpdCA9PiB1cmwuaW5jbHVkZXMoaXQpKS5sZW5ndGggPiAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpbldoaXRlICYmICF3aGl0ZS5pbmNsdWRlcyh1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyc2UgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9wYXJzZT9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBwYXJzZShydWxlLCB3ZWIsIHVybCwgaHRtbCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpbldoaXRlICYmIGQubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gcGRmYShodG1sLCBcXFwiYm9keSYmaWZyYW1lXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyci5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzcmMgPSBwZGZoKGFyclswXSwgXFxcImlmcmFtZSYmc3JjXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhcXFwi6I635Y+W5YiwaWZyYW1l77yaXFxcIiArIHNyYyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghd2hpdGUuaW5jbHVkZXMoc3JjKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNyYyAmJiBzcmMuc3RhcnRzV2l0aChcXFwiaHR0cFxcXCIpICYmICFzcmMubWF0Y2goL1xcXFwubXA0fFxcXFwubTN1OHxcXFxcLm1wM3xcXFxcLmZsdnxcXFxcLm1rdi8pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHRtbCA9IHJlcXVlc3Qoc3JjKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gcGFyc2UocnVsZSwgd2ViLCBzcmMsIGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhcXFwi5bCd6K+V6I635Y+WaWZyYW1l5aSx6LSlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFswXS51cmwgPSAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChhbmNob3JJZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZXNjID0gZ2V0VmFyKGFuY2hvcklkLCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZXNjID09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoWDVEZXNjKFxcXCJmbG9hdCYmc2NyZWVuLTE3MFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoYW5jaG9ySWQsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFg1RGVzYyhcXFwiZmxvYXQmJjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKGFuY2hvcklkLCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgYW5jaG9ySWQgKyBcXFwieDVcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbMF0udGl0bGUgPSBcXFwi5bGV5byAL+aUtui1t1xcXCIgKyBkWzBdLnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKGFuY2hvcklkICsgXFxcIng1XFxcIiwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hYNURlc2MoXFxcImZsb2F0JiYwXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBkKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhID0gaXQuZXh0cmEgfHwge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuY2xzID0gXFxcIng1YWlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0LmV4dHJhID0gZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoXFxcIng1YWlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihhbmNob3JJZCwgZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwiQUnljLnphY3miJDlip9cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coXFxcInBhcnNlTGF6eVJ1bGVBc3luYzpcXFwiICsgZC5sZW5ndGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkLmxlbmd0aCA+IDAgPyBcXFwiMVxcXCIgOiBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBydWxlLCBsb2NhdGlvbi5ocmVmLCBhbmNob3JJZCwgd2hpdGUpLCAkJCQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwiMFxcXCIgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrYyA9IHdpbmRvdy5jaGVja2MgKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmlmICh3aW5kb3cuY2hlY2tjID4gMTIwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmiafooYzotoXov4czMOenku+8jOaXoOazleino+aekFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQod2luZG93LmNoZWNrMCwgMjUwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy99XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrdXJsID0gbG9jYXRpb24uaHJlZjtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2t1MCgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3aW5kb3cuY2hlY2t1cmwgIT0gbG9jYXRpb24uaHJlZikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaGFzaOWPkeeUn+S6huWPmOWMllxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja2MgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVjazAoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAyMDAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChjaGVja3UwLCAyNTApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrdTAoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQod2luZG93LmNoZWNrMCwgMjUwKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB3aW5kb3cuY2hlY2tjID0gMDtcXG4gICAgICAgICAgICB3aW5kb3cuY2hlY2swID0gY2hlY2swO1xcbiAgICAgICAgICAgIGNoZWNrMCgpO1xcbiAgICAgICAgfVxcbiAgICB9LCBydWxlLCBhbmNob3JJZCwgc3RvcmFnZTAuZ2V0SXRlbShcXFwid2hpdGVcXFwiLCBbXSkpO1xcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIummlumhtVwiLFwicGF0aFwiOlwiaG9tZVwiLFwicnVsZVwiOlwidmFyIGQgPSBbXTtcXG5sZXQgdXJsID0g572R56uZO1xcbmxldCBhbmNob3JJZCA9IHVybDtcXG5sZXQganMgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZ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WumuimgeWcqOS6keebmOaxh+W9seeZu+W9lemYv+mHjOS6keebmOi0puWPt++8jOWQpuWImeS4jeiDveeUqCcsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06IHJ1LFxcXFxuICAgICAgICAgICAgICAgICAgICBjYW5jZWw6IHJ1XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbG9nKFxcXFxcXFwiaW5wdXRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6Zi/6YeM5LqR55uYXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD1cXFxcXFxcIiArIHVybCArICc/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgfSkpXFxcXG4gICAgICAgICAgICB9LCBpbnB1dCwgcnVsZSlcXFxcbiAgICAgICAgfSBlbHNlIGlmICgvXFxcXFxcXFwuKG1wM3xmbGFjfG00YSkkLy50ZXN0KGlucHV0KSkge1xcXFxuICAgICAgICAgICAgbG9nKGlucHV0KTtcXFxcbiAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLnBsYXlWaWRlbyh1cmwpO1xcXFxuICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpXFxcXG4gICAgICAgIH0gZWxzZSBpZiAoIWlucHV0LmluY2x1ZGVzKGhvc3QpICYmIGlucHV0LnN0YXJ0c1dpdGgoXFxcXFxcXCJodHRwXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICBsb2coaW5wdXQpO1xcXFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB3aGl0ZSA9IFtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJkb3V5aW5cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJkb3ViYW5cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJpeGlndWEuY29tXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwia3VhaXNob3VcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJiaWxpYmlsaVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIndlaWJvXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwid2VpeGluXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiYmFpZHVcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ6bWsuXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwic3ViaGRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ0aHVuZGVyXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwieGluanVjXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZ3JhYjRrXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiL2J0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwianNyMTBcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJhc3NydFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInF1YXJrXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICBdO1xcXFxuICAgICAgICAgICAgICAgIGxldCBpbldoaXRlID0gd2hpdGUuZmlsdGVyKGl0ID0+IHVybC5pbmNsdWRlcyhpdCkpLmxlbmd0aCA+IDA7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGluV2hpdGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy/ot7PnvZHpobVcXFxcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuivpuaDhVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcXFxcXCIgKyBydWxlICsgXFxcXFxcXCImcj1cXFxcXFxcIiArIHJ1bGUgKyBcXFxcXFxcIiMjXFxcXFxcXCIgKyB1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vQUnop6PmnpBcXFxcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBkb2N1bWVudC50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXFxcXFwiICsgcnVsZSArIFxcXFxcXFwiJnI9XFxcXFxcXCIgKyBydWxlICsgXFxcXFxcXCImdT1cXFxcXFxcIiArIGZ5X2JyaWRnZV9hcHAuYmFzZTY0RW5jb2RlKHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIGlucHV0LCBydWxlKTtcXFxcbiAgICAgICAgfSBlbHNlIGlmICghaW5wdXQuc3RhcnRzV2l0aChcXFxcXFxcImh0dHBcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgIGxvZyhpbnB1dCk7XFxcXG4gICAgICAgICAgICAvL+iDveWUpOi1t0FQUOeahOeZveWQjeWNlVxcXFxuICAgICAgICAgICAgbGV0IHdoaXRlID0gW1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwicWtsaW5rXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJiZG5ldGRpc2tcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBcXFxcXFxcInh1bmxlaWFwcFxcXFxcXFwiXFxcXG4gICAgICAgICAgICBdO1xcXFxuICAgICAgICAgICAgbGV0IGluV2hpdGUgPSB3aGl0ZS5maWx0ZXIoaXQgPT4gaW5wdXQuc3RhcnRzV2l0aChpdCkpLmxlbmd0aCA+IDA7XFxcXG4gICAgICAgICAgICBpZiAoIWluV2hpdGUpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5vcGVuVGhpcmRBcHAgJiYgZnlfYnJpZGdlX2FwcC5vcGVuVGhpcmRBcHAodXJsKTtcXFxcbiAgICAgICAgICAgIH0sIGlucHV0LCBydWxlKVxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgbGV0IHdoaXRlID0gW1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwidXJsPVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwiZnNvdS5jb21cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBcXFxcXFxcImJpbmcuXFxcXFxcXCIsICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgXTtcXFxcbiAgICAgICAgICAgIGxldCBpbldoaXRlID0gd2hpdGUuZmlsdGVyKGl0ID0+IGlucHV0LmluY2x1ZGVzKGl0KSkubGVuZ3RoID4gMDtcXFxcbiAgICAgICAgICAgIGlmIChpbldoaXRlKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IHJlZyA9IG5ldyBSZWdFeHAoXFxcXFxcXCJbXFxcXFxcXFx1NGUwMC1cXFxcXFxcXHU5ZmE1XStcXFxcXFxcIiwgXFxcXFxcXCJnXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgbGV0IHIgPSBkZWNvZGVVUklDb21wb25lbnQoaW5wdXQpO1xcXFxuICAgICAgICAgICAgaWYgKHJlZy50ZXN0KHIpIHx8IChpbnB1dC5zdGFydHNXaXRoKG9yaWdpbikgJiYgaW5wdXQubGVuZ3RoIC0gb3JpZ2luLmxlbmd0aCA+IDIpKSB7XFxcXG4gICAgICAgICAgICAgICAgLy/mnInkuK3mlofvvIzlupTor6XmmK/lnKjmkJzntKLvvIzot7PmlrDpobXpnaJcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAub3BlbihKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLor6bmg4VcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybD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JjlhYjmjpLpmaRcXFxcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICAvL+WIpOaWreaYr+S4jeaYr+eUteW9sVxcXFxuICAgICAgICBpZiAoaXNNb3ZpZShpdCkpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiBpc0NoYXB0ZXIwKGl0LCBwcmUpIHx8IGlzQ2hhcHRlcjAoaXQsIG5leHQpO1xcXFxuICAgIH1cXFxcblxcXFxuICAgIGZ1bmN0aW9uIGdldENoYXB0ZXJOdW0oaXQpIHtcXFxcbiAgICAgICAgaWYgKGl0ID09IG51bGwgfHwgaXQudGV4dCA9PSBudWxsKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaXQgPSBpdC50ZXh0IHx8IFxcXFxcXFwiXFxcXFxcXCI7XFxcXG4gICAgICAgIGlmIChpdCA9PSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaXQgPSBjbGVhclRleHQoaXQpO1xcXFxuICAgICAgICBsZXQgcmVnID0gL15bMC05XSokLztcXFxcbiAgICAgICAgaWYgKCFyZWcudGVzdChpdCkpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiAtMTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpdCA9IHBhcnNlSW50KGl0KTtcXFxcbiAgICAgICAgaWYgKGlzTmFOKGl0KSkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIC0xO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGlmIChpdCA+IDE5MDAgJiYgaXQgPCAyMTAwKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgcmV0dXJuIGl0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cXFxuICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5tNGEnLCAnLm1wMycsICcuZmx2JywgJy5hdmknLCAnLjNncCcsICcubXBlZycsICcud212JywgJy5tb3YnLCAnLnJtdmInLCAnLmdpZicsICcuanBlZycsICcucG5nJywgJy5pY28nLCAnLnN2ZyddXFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHVybHggPSBcXFxcXFxcInZpZGVvOi8vXFxcXFxcXCIgKyBpdC5ocmVmO1xcXFxuICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmXFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHQsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmx4LFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfM1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYXhcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIGlmIChkLmxlbmd0aCA9PSAwKSB7XFxcXG4gICAgICAgIHJldHVybiBkO1xcXFxuICAgIH0gZWxzZSB7XFxcXG5cXFxcbiAgICAgICAgZC5zcGxpY2UoMCwgMCwge1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi8J+Ul1xcXFxcXFwiICsgdXJsLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcXFxcXCIgKyBydWxlICsgXFxcXFxcXCImcj1cXFxcXFxcIiArIHJ1bGUgKyBcXFxcXFxcIiMjXFxcXFxcXCIgKyB1cmwsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFxcXFxcIlxcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuXFxcXG5cXFxcbiAgICAgICAgLy/kuLrnur/ot6/liqDliIblibLnur9cXFxcbiAgICAgICAgbGV0IGQyID0gW107XFxcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgZDIucHVzaChkW2ldKTtcXFxcbiAgICAgICAgICAgIGlmIChpIDwgZC5sZW5ndGggLSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gZFtpXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdDEgPSBwYXJzZUludChjbGVhclRleHQoaXQudGl0bGUpKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbmV4dCA9IGRbaSArIDFdO1xcXFxuICAgICAgICAgICAgICAgIGxldCB0MiA9IHBhcnNlSW50KGNsZWFyVGV4dChuZXh0LnRpdGxlKSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHQyIC0gdDEgPiAxIHx8IHQxIC0gdDIgPiAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJpZ19ibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBkMi5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWMuemFjeacieivr++8n+eCueaIkeS4jeWGjeWMuemFjeatpOmhtemdolxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmuKnppqjmj5DnpLpcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogXFxcXFxcXCLlpoLmnpzlj6rmmK/ljZXmrKHljLnphY3lpLHotKXvvIzngrnlh7vkuIvmlrnlj5bmtojmjInpkq7liLfmlrDpobXpnaLph43mlrDljLnphY3vvIzlpoLmnpznoa7orqTml6Dms5XljLnphY3vvIzngrnlh7vkuIvmlrnnoa7lrprmjInpkq7liqDlhaXnmb3lkI3ljZVcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FuY2VsOiBcXFxcXFxcInJlZnJlc2hQYWdlKClcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcXFxcXCJ3aGl0ZVxcXFxcXFwiLCBbXSk7XFxcXG4gICAgIC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biAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXFxcXFwiaHRtbFxcXFxcXFwiKS5pbm5lckhUTUw7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5wdXRWYXIoXFxcXFxcXCJodG1sMFxcXFxcXFwiLCBodG1sKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZmJhLnBhcnNlTGF6eVJ1bGVBc3luYygkJCQoKS5sYXp5UnVsZSgocnVsZSwgdXJsLCBhbmNob3JJZCwgd2hpdGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGdldFZhcihcXFxcXFxcImh0bWwwXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyVmFyKFxcXFxcXFwiaHRtbDBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHdlYiA9IGZhbHNlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3aGl0ZTIgPSBbXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZnNvdS5jb21cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJiaW5nLlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGluV2hpdGUgPSB3aGl0ZTIuZmlsdGVyKGl0ID0+IHVybC5pbmNsdWRlcyhpdCkpLmxlbmd0aCA+IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaW5XaGl0ZSAmJiAhd2hpdGUuaW5jbHVkZXModXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyc2UgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvcGFyc2U/cnVsZT1cXFxcXFxcIiArIHJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gcGFyc2UocnVsZSwgd2ViLCB1cmwsIGh0bWwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWluV2hpdGUgJiYgZC5sZW5ndGggPCAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gcGRmYShodG1sLCBcXFxcXFxcImJvZHkmJmlmcmFtZVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcnIubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzcmMgPSBwZGZoKGFyclswXSwgXFxcXFxcXCJpZnJhbWUmJnNyY1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coXFxcXFxcXCLojrflj5bliLBpZnJhbWXvvJpcXFxcXFxcIiArIHNyYyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF3aGl0ZS5pbmNsdWRlcyhzcmMpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcmMgJiYgc3JjLnN0YXJ0c1dpdGgoXFxcXFxcXCJodHRwXFxcXFxcXCIpICYmICFzcmMubWF0Y2goL1xcXFxcXFxcLm1wNHxcXFxcXFxcXC5tM3U4fFxcXFxcXFxcLm1wM3xcXFxcXFxcXC5mbHZ8XFxcXFxcXFwubWt2LykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgPSByZXF1ZXN0KHNyYyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gcGFyc2UocnVsZSwgd2ViLCBzcmMsIGh0bWwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coXFxcXFxcXCLlsJ3or5Xojrflj5ZpZnJhbWXlpLHotKVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWzBdLnVybCA9ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoYW5jaG9ySWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZXNjID0gZ2V0VmFyKGFuY2hvcklkLCBcXFxcXFxcIjBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVzYyA9PSBcXFxcXFxcIjBcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hYNURlc2MoXFxcXFxcXCJmbG9hdCYmc2NyZWVuLTE3MFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoYW5jaG9ySWQsIFxcXFxcXFwiMVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFg1RGVzYyhcXFxcXFxcImZsb2F0JiYwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihhbmNob3JJZCwgXFxcXFxcXCIwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBhbmNob3JJZCArIFxcXFxcXFwieDVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbMF0udGl0bGUgPSBcXFxcXFxcIuWxleW8gC/mlLbotbdcXFxcXFxcIiArIGRbMF0udGl0bGU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihhbmNob3JJZCArIFxcXFxcXFwieDVcXFxcXFxcIiwgXFxcXFxcXCIwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoWDVEZXNjKFxcXFxcXFwiZmxvYXQmJjBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGl0LmV4dHJhIHx8IHt9O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuY2xzID0gXFxcXFxcXCJ4NWFpXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdC5leHRyYSA9IGV4dHJhO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFxcXFxcIng1YWlcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihhbmNob3JJZCwgZCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwiQUnljLnphY3miJDlip9cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKFxcXFxcXFwicGFyc2VMYXp5UnVsZUFzeW5jOlxcXFxcXFwiICsgZC5sZW5ndGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC5sZW5ndGggPiAwID8gXFxcXFxcXCIxXFxcXFxcXCIgOiBcXFxcXFxcIjBcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgcnVsZSwgbG9jYXRpb24uaHJlZiwgYW5jaG9ySWQsIHdoaXRlKSwgJCQkLnRvU3RyaW5nKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFxcXFxcIjBcXFxcXFxcIiA9PSBpbnB1dCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja2MgPSB3aW5kb3cuY2hlY2tjICsgMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmlmICh3aW5kb3cuY2hlY2tjID4gMTIwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCLmiafooYzotoXov4czMOenku+8jOaXoOazleino+aekFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyovXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCh3aW5kb3cuY2hlY2swLCAyNTApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2hlY2t1cmwgPSBsb2NhdGlvbi5ocmVmO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2t1MCgpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdpbmRvdy5jaGVja3VybCAhPSBsb2NhdGlvbi5ocmVmKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2hhc2jlj5HnlJ/kuoblj5jljJZcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrYyA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2swKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAyMDAwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2t1MCwgMjUwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja3UwKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCh3aW5kb3cuY2hlY2swLCAyNTApO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHdpbmRvdy5jaGVja2MgPSAwO1xcXFxuICAgICAgICAgICAgd2luZG93LmNoZWNrMCA9IGNoZWNrMDtcXFxcbiAgICAgICAgICAgIGNoZWNrMCgpO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSwgcnVsZSwgYW5jaG9ySWQsIHN0b3JhZ2UwLmdldEl0ZW0oXFxcXFxcXCJ3aGl0ZVxcXFxcXFwiLCBbXSkpO1xcXFxufVxcXCJ9LHtcXFwiY29sX3R5cGVcXFwiOlxcXCJtb3ZpZV8zXFxcIixcXFwibmFtZVxcXCI6XFxcIummlumh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