Advertisement
xiaomianao666

邀您一起看:奇妙工具箱-图片提取器

Dec 21st, 2024
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥奇妙工具箱-图片提取器@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcInBpY1wiLFwicGF0aFwiOlwicGljXCIsXCJydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbmxldCB4ID0gZ2V0TXlWYXIoXFxcInhcXFwiLCBcXFwi5ZCmXFxcIik7XFxubGV0IGRlc2MgPSB4ID09IFxcXCLmmK9cXFwiID8gXFxcImZsb2F0JiYzMDBcXFwiIDogXFxcImZsb2F0JiYxXFxcIjtcXG5kLnB1c2goe1xcbiAgICBjb2xfdHlwZTogXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcIixcXG4gICAgdXJsOiBcXFwiXFxcIixcXG4gICAgZGVzYzogZGVzYyxcXG4gICAgdGl0bGU6IFxcXCJcXFwiLFxcbiAgICBleHRyYToge1xcbiAgICAgICAganM6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIGdldGltZ3MoKSB7XFxuICAgICAgICAgICAgICAgIHZhciB2aWRlb0VsZW1lbnRzID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoXFxcImltZ1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAodmlkZW9FbGVtZW50cyA9PSBudWxsKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHVybHMgPSBbXTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB2aWRlb0VsZW1lbnRzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodmlkZW9FbGVtZW50c1tpXS53aWR0aCA+IDcwICYmIHZpZGVvRWxlbWVudHNbaV0uaGVpZ2h0ID4gNzApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcmMgPSB2aWRlb0VsZW1lbnRzW2ldLnNyYztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3JjID09IG51bGwgfHwgc3JjLmxlbmd0aCA8IDUgfHwgdXJscy5pbmNsdWRlcyhzcmMpIHx8IHNyYy5pbmRleE9mKFxcXCJkYXRhOlxcXCIpID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKHNyYyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKG5ldyBVUkwoc3JjKS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gdXJscztcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2soKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJscyA9IGdldGltZ3MoKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhcXFwiZ2V0aW1nc++8mlxcXCIgKyB1cmxzLmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAod2luZG93LmNoZWNrZWRVcmxzID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2hlY2tlZFVybHMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxldCBjaGVja2VkVXJscyA9IHdpbmRvdy5jaGVja2VkVXJscztcXG4gICAgICAgICAgICAgICAgICAgIHVybHMgPSB1cmxzLmZpbHRlcihpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICFjaGVja2VkVXJscy5pbmNsdWRlcyhpdClcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHVybHMubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwaWNzID0gdXJscy5maWx0ZXIoaXQgPT4gaXQgIT0gbnVsbCAmJiBpdCAhPSBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IGZiYS5nZXRIZWFkZXJVcmwoaXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHV1ID0gdS5zcGxpdChcXFwiO1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBpYyA9IHU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXUubGVuZ3RoID4gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1MSA9IHV1WzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1MiA9IHV1WzFdLnNsaWNlKDEsIC0xKS5zcGxpdChcXFwiJiZcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVmZXJlciA9IG51bGw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVhID0gbnVsbDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29va2llMCA9IG51bGw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaWkgb2YgdTIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGl0MiA9IGlpLnNwbGl0KFxcXCJAXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDJbMF0gPT0gXFxcIlJlZmVyZXJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZlcmVyID0gaXQyWzFdLnJlcGxhY2UoL++8m++8my9nLCBcXFwiO1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDJbMF0gPT0gXFxcIlVzZXItQWdlbnRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1YSA9IGl0MlsxXS5yZXBsYWNlKC/vvJvvvJsvZywgXFxcIjtcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXQyWzBdID09IFxcXCJDb29raWVcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWUwID0gaXQyWzFdLnJlcGxhY2UoL++8m++8my9nLCBcXFwiO1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IHUxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWZlcmVyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IHBpYyArIFxcXCJAUmVmZXJlcj1cXFwiICsgcmVmZXJlcjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVhKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IHBpYyArIFxcXCJAVXNlci1BZ2VudD1cXFwiICsgdWE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IHBpYyArIFxcXCJAQ29va2llPVxcXCIgKyBjb29raWUwXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWMgPSBpdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljOiBwaWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2cocGljcy5sZW5ndGggKyBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLnBhcnNlTGF6eVJ1bGVBc3luYygkJCQoKS5sYXp5UnVsZSgodXJscykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh1cmxzKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IHVybHMubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImNhcmRfcGljXzNcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcInBpY3NcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShcXFwicGljX2xpbmVcXFwiLCBhcnIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBpY3MpLCBmdW5jdGlvbigpIHtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja2VkVXJscy5wdXNoKGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGNoZWNrLCAzMDApO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjaGVjaygpO1xcbiAgICAgICAgfSlcXG4gICAgfVxcbn0pO1xcblxcblxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi5o+Q5Y+WXFxcIixcXG4gICAgdXJsOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgIHB1dE15VmFyKFxcXCJpXFxcIiwgaW5wdXQpO1xcbiAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKFxcXCJwaWNzXFxcIik7XFxuICAgICAgICByZWZyZXNoWDVXZWJWaWV3KGlucHV0KTtcXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICBkZXNjOiBcXFwi6K+36L6T5YWl572R6aG15Zyw5Z2AXFxcIixcXG4gICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJpXFxcIiwgXFxcIlxcXCIpXFxuICAgIH1cXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIuaYvuekuue9kemhtee7hOS7tu+8mlxcXCIgKyB4LFxcbiAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4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BnZXRNeVZhcihcXFwieFxcXCIsIFxcXCLlkKZcXFwiKTtcXG5sZXQgZGVzYyA9IHggPT0gXFxcIuaYr1xcXCIgPyBcXFwiZmxvYXQmJjMwMFxcXCIgOiBcXFwiZmxvYXQmJjFcXFwiO1xcbmQucHVzaCh7XFxuICAgIGNvbF90eXBlOiBcXFwieDVfd2Vidmlld19zaW5nbGVcXFwiLFxcbiAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICBkZXNjOiBkZXNjLFxcbiAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBqczogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0aW1ncygpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHZpZGVvRWxlbWVudHMgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZShcXFwiaW1nXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmICh2aWRlb0VsZW1lbnRzID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgdXJscyA9IFtdO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHZpZGVvRWxlbWVudHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh2aWRlb0VsZW1lbnRzW2ldLndpZHRoID4gNzAgJiYgdmlkZW9FbGVtZW50c1tpXS5oZWlnaHQgPiA3MCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNyYyA9IHZpZGVvRWxlbWVudHNbaV0uc3JjO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcmMgPT0gbnVsbCB8fCBzcmMubGVuZ3RoIDwgNSB8fCB1cmxzLmluY2x1ZGVzKHNyYykgfHwgc3JjLmluZGV4T2YoXFxcImRhdGE6XFxcIikgPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coc3JjKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2gobmV3IFVSTChzcmMpLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmxzO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBjaGVjaygpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmxzID0gZ2V0aW1ncygpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKFxcXCJnZXRpbWdz77yaXFxcIiArIHVybHMubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh3aW5kb3cuY2hlY2tlZFVybHMgPT0gbnVsbCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja2VkVXJscyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNoZWNrZWRVcmxzID0gd2luZG93LmNoZWNrZWRVcmxzO1xcbiAgICAgICAgICAgICAgICAgICAgdXJscyA9IHVybHMuZmlsdGVyKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gIWNoZWNrZWRVcmxzLmluY2x1ZGVzKGl0KVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICBpZiAodXJscy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBpY3MgPSB1cmxzLmZpbHRlcihpdCA9PiBpdCAhPSBudWxsICYmIGl0ICE9IFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1ID0gZmJhLmdldEhlYWRlclVybChpdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXUgPSB1LnNwbGl0KFxcXCI7XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGljID0gdTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1dS5sZW5ndGggPiAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUxID0gdXVbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUyID0gdXVbMV0uc2xpY2UoMSwgLTEpLnNwbGl0KFxcXCImJlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWZlcmVyID0gbnVsbDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdWEgPSBudWxsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb29raWUwID0gbnVsbDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpaSBvZiB1Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaXQyID0gaWkuc3BsaXQoXFxcIkBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0MlswXSA9PSBcXFwiUmVmZXJlclxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZmVyZXIgPSBpdDJbMV0ucmVwbGFjZSgv77yb77ybL2csIFxcXCI7XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0MlswXSA9PSBcXFwiVXNlci1BZ2VudFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVhID0gaXQyWzFdLnJlcGxhY2UoL++8m++8my9nLCBcXFwiO1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDJbMF0gPT0gXFxcIkNvb2tpZVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tpZTAgPSBpdDJbMV0ucmVwbGFjZSgv77yb77ybL2csIFxcXCI7XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljID0gdTE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlZmVyZXIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljID0gcGljICsgXFxcIkBSZWZlcmVyPVxcXCIgKyByZWZlcmVyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodWEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljID0gcGljICsgXFxcIkBVc2VyLUFnZW50PVxcXCIgKyB1YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZTApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljID0gcGljICsgXFxcIkBDb29raWU9XFxcIiArIGNvb2tpZTBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IGl0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWM6IHBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhwaWNzLmxlbmd0aCArIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZUFzeW5jKCQkJCgpLmxhenlSdWxlKCh1cmxzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKHVybHMpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gdXJscy5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC5waWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaXQucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiY2FyZF9waWNfM1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFwicGljc1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKFxcXCJwaWNfbGluZVxcXCIsIGFycik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGljcyksIGZ1bmN0aW9uKCkge1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrZWRVcmxzLnB1c2goaXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2ssIDMwMCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNoZWNrKCk7XFxuICAgICAgICB9KVxcbiAgICB9XFxufSk7XFxuXFxuXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLmj5Dlj5ZcXFwiLFxcbiAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgcHV0TXlWYXIoXFxcImlcXFwiLCBpbnB1dCk7XFxuICAgICAgICBkZWxldGVJdGVtQnlDb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MoKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHZpZGVvRWxlbWVudHMgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZShcXFxcXFxcImltZ1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAodmlkZW9FbGVtZW50cyA9PSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbGV0IHVybHMgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHZpZGVvRWxlbWVudHMubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZpZGVvRWxlbWVudHNbaV0ud2lkdGggPiA3MCAmJiB2aWRlb0VsZW1lbnRzW2ldLmhlaWdodCA+IDcwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcmMgPSB2aWRlb0VsZW1lbnRzW2ldLnNyYztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcmMgPT0gbnVsbCB8fCBzcmMubGVuZ3RoIDwgNSB8fCB1cmxzLmluY2x1ZGVzKHNyYykgfHwgc3JjLmluZGV4T2YoXFxcXFxcXCJkYXRhOlxcXFxcXFwiKSA9PSAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhzcmMpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKG5ldyBVUkwoc3JjKS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdXJscztcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2soKSB7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybHMgPSBnZXRpbWdzKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhcXFxcXFxcImdldGltZ3PvvJpcXFxcXFxcIiArIHVybHMubGVuZ3RoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHdpbmRvdy5jaGVja2VkVXJscyA9PSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2hlY2tlZFVybHMgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgY2hlY2tlZFVybHMgPSB3aW5kb3cuY2hlY2tlZFVybHM7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVybHMgPSB1cmxzLmZpbHRlcihpdCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gIWNoZWNrZWRVcmxzLmluY2x1ZGVzKGl0KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAodXJscy5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGljcyA9IHVybHMuZmlsdGVyKGl0ID0+IGl0ICE9IG51bGwgJiYgaXQgIT0gXFxcXFxcXCJcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKGl0ID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBmYmEuZ2V0SGVhZGVyVXJsKGl0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHV1ID0gdS5zcGxpdChcXFxcXFxcIjtcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwaWMgPSB1O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXUubGVuZ3RoID4gMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUxID0gdXVbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSB1dVsxXS5zbGljZSgxLCAtMSkuc3BsaXQoXFxcXFxcXCImJlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWZlcmVyID0gbnVsbDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1YSA9IG51bGw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29va2llMCA9IG51bGw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpaSBvZiB1Mikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpdDIgPSBpaS5zcGxpdChcXFxcXFxcIkBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0MlswXSA9PSBcXFxcXFxcIlJlZmVyZXJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZlcmVyID0gaXQyWzFdLnJlcGxhY2UoL++8m++8my9nLCBcXFxcXFxcIjtcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDJbMF0gPT0gXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWEgPSBpdDJbMV0ucmVwbGFjZSgv77yb77ybL2csIFxcXFxcXFwiO1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0MlswXSA9PSBcXFxcXFxcIkNvb2tpZVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tpZTAgPSBpdDJbMV0ucmVwbGFjZSgv77yb77ybL2csIFxcXFxcXFwiO1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWMgPSB1MTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWZlcmVyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljID0gcGljICsgXFxcXFxcXCJAUmVmZXJlcj1cXFxcXFxcIiArIHJlZmVyZXI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodWEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWMgPSBwaWMgKyBcXFxcXFxcIkBVc2VyLUFnZW50PVxcXFxcXFwiICsgdWE7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IHBpYyArIFxcXFxcXFwiQENvb2tpZT1cXFxcXFxcIiArIGNvb2tpZTBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljID0gaXQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpYzogcGljLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2cocGljcy5sZW5ndGggKyBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5wYXJzZUxhenlSdWxlQXN5bmMoJCQkKCkubGF6eVJ1bGUoKHVybHMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh1cmxzKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSB1cmxzLm1hcChpdCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQucGljLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaXQucGljLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiY2FyZF9waWNfM1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXFxcXFwicGljc1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKFxcXFxcXFwicGljX2xpbmVcXFxcXFxcIiwgYXJyKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBpY3MpLCBmdW5jdGlvbigpIHtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiB1cmxzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrZWRVcmxzLnB1c2goaXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChjaGVjaywgMzAwKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGNoZWNrKCk7XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxufSk7XFxcXG5cXFxcblxcXFxuZC5wdXNoKHtcXFxcbiAgICB0aXRsZTogXFx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