Advertisement
xiaomianao666

邀您一起看:⚙️设置

Oct 11th, 2022
832
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥⚙️设置@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwi5rqQ55uu5b2VXCIsXCJwYXRoXCI6XCJzb3VyY2VcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxudmFyIG0gPSBNWV9QQVJBTVMucnVsZXNcXG52YXIgYmFzZXVybCA9IG0uYm9va1NvdXJjZVVybFxcbmlmIChtLnJ1bGVFeHBsb3JlLmJvb2tMaXN0KSB7XFxuICAgIHZhciBydWxlID0gbS5ydWxlRXhwbG9yZVxcbn0gZWxzZSB7XFxuICAgIHZhciBydWxlID0gbS5ydWxlU2VhcmNoXFxufVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi5pCc57SiXFxcIixcXG4gICAgZGVzYzogXFxcIuivt+i+k+WFpeaQnOe0ouWFs+mUruivjVxcXCIsXFxuICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICBwdXRNeVZhcihcXFwia3dcXFwiLCBpbnB1dCk7XFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9zZWFyY2g/cD1meXBhZ2Uma3c9XFxcI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maWxlcy95dWVkdS9saXN0Lmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShsaXN0KSlcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ID0gZmV0Y2goaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHQpXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvXFxcIiArIG1kNShuYW1lKSArIFxcXCIuanNvblxcXCIsIHQpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGxldCBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9saXN0Lmpzb25cXFwiKSlcXG4gICAgbGlzdC51cmxzLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICBkZXNjOiBpdGVtLnVybCxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLliKDpmaRcXFwiLCBcXFwi57yW6L6R5ZCN56ewXFxcIiwgXFxcIue8lui+keWcsOWdgFxcXCIsIFxcXCLmm7TmlrBcXFwiXSkuc2VsZWN0KChsaXMsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBsaXNcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliKDpmaRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu6K6k5Yig6Zmk77yfXFxcIikuY29uZmlybSgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvXFxcIiArIG1kNShsaXN0LnVybHNbaV0ubmFtZSkgKyBcXFwiLmpzb25cXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudXJscy5zcGxpY2UoaSwgMSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi57yW6L6R5ZCN56ewXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC51cmxzW2ldLm5hbWUgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9saXN0Lmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShsaXN0KSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09IFxcXCLnvJbovpHlnLDlnYBcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnVybHNbaV0udXJsID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBmZXRjaChsaXN0LnVybHNbaV0udXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UodClcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvXFxcIiArIG1kNShsaXN0LnVybHNbaV0ubmFtZSkgKyBcXFwiLmpzb25cXFwiLCB0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5pu05paw5oiQ5YqfXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5pu05paw5aSx6LSlXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGxpc3QsIGkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIlxcbiAgICAgICAgfSlcXG4gICAgfSlcXG59IGNhdGNoIChlKSB7XFxuICAg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gICAgICAgIGxldCByID0gcnVsZS5jb250ZW50LnJlcGxhY2UoXFxcIkBcXFwiLCBcXFwiJiZcXFwiKS5yZXBsYWNlKFxcXCJ0ZXh0XFxcIiwgXFxcIlRleHRcXFwiKS5yZXBsYWNlKC9cXFxcLlswLTldL2csIGZ1bmN0aW9uKGEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhLnJlcGxhY2UoXFxcIi5cXFwiLCBcXFwiLFxcXCIpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBsZXQgcjEgPSByLnNwbGl0KFxcXCImJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgcjIgPSByMS5zbGljZSgwLCByMS5sZW5ndGggLSAxKS5qb2luKFxcXCImJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyID0gcGRmYShyZXMsIFxcXCJib2R5JiZcXFwiICsgcjIpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgICAgICB2YXIgdHQgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGl0ID0gaXQucmVwbGFjZShuZXcgUmVnRXhwKFxcXCJcXFxcblxcXCIsIFxcXCJnXFxcIiksIFxcXCItLWJyLS1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGl0KTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ID0gcGRmaChpdCwgXFxcIlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHQgPSB0LnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiLS1ici0tXFxcIiwgXFxcImdcXFwiKSwgXFxcIjxicj5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxldCB0MiA9IHQuc3BsaXQoXFxcIjxicj5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0MiBvZiB0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDIgPT0gXFxcIlxcXCIgfHwgaXQyLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXQyLnN0YXJ0c1dpdGgoXFxcIuOAgFxcXCIpICYmICFpdDIuc3RhcnRzV2l0aChcXFwiJm5ic3A7Jm5ic3A7XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQyID0gXFxcIiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwO1xcXCIgKyBpdDIudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVsZS5yZXBsYWNlUmVnZXgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQyID0gaXQyLnJlcGxhY2UobmV3IFJlZ0V4cChydWxlLnJlcGxhY2VSZWdleC5yZXBsYWNlKFxcXCIjI1xcXCIsIFxcXCJcXFwiKSwgXFxcImdcXFwiKSwgXFxcIlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDIgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHQgKz0gaXQyICsgXFxcIlxcXFxuXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxu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vdmllXzNcIixcIm5hbWVcIjpcIui9rOaNolwiLFwicGF0aFwiOlwiY29udmVydGVyXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSB7XFxuICAgIGdldEFycmF5OiAoaHRtbCwgcnVsZSkgPT4ge1xcbiAgICAgICAgbGV0IHIxID0gcnVsZS5zcGxpdChcXFwiIVxcXCIpWzBdLnNwbGl0KFxcXCJ8fFxcXCIpO1xcbiAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJlxcXCIgKyByMVswXS5yZXBsYWNlKFxcXCIgXFxcIiwgXFxcIiYmXFxcIikucmVwbGFjZShcXFwiQFxcXCIsIFxcXCImJlxcXCIpKTtcXG4gICAgICAgIGlmIChyMS5sZW5ndGggPiAxKSB7XFxuICAgICAgICAgICAgbGV0IHIyID0gcjFbMV0uc3BsaXQoXFxcIjpcXFwiKTtcXG4gICAgICAgICAgICBsZXQgcjMgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByMikge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBwYXJzZUludChpdCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNOYU4oaSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHIzLnB1c2goaSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBhcnIyID0gW107XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgaWYgKHIzLmluZGV4T2YoaSkgPCAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIyLnB1c2goYXJyW2ldKTtcXG4gICAgICAgICAgICAgICAgfV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tcXG5pZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgIC8v5aSa57q/56iL5Yqg6L29XFxuICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXG4gICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gc2VhcmNoKHJ1bGUsIHMsIDEpO1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGFyYW06IGl0LFxcbiAgICAgICAgICAgIGlkOiBcXFwicnVsZUBcXFwiICsgaXQubmFtZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgYmF0Y2hFeGVjdXRlKHRhc2tzLCB7XFxuICAgICAgICBmdW5jOiBmdW5jdGlvbihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgICAgICAvL2xvZyhcXFwibGlzdGVuZXI6IFxcXCIgKyAocmVzdWx0IHx8IFtdKS5sZW5ndGgpXFxuICAgICAgICAgICAgcGFyYW0uaSA9IHBhcmFtLmkgKyAxO1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmogPSBwYXJhbS5qICsgMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2hNdXN0ID09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWl0LnRpdGxlIHx8ICFpdC50aXRsZS5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhID0gaXQuZXh0cmEgfHwge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuaWQgPSBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmo7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuYm9va05hbWUgPSBpdC50aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmNvdmVyID0gaXQucGljX3VybCB8fCBpdC5pbWdcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUuaW5jbHVkZXMoXFxcIuKAnOKAnOKAneKAnVxcXCIpID8gaXQudGl0bGUgOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIGl0LnRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiPGVtPnw8L2VtPlxcXCIsIFxcXCJnXFxcIiksIFxcXCJcXFwiKS5yZXBsYWNlKG5ldyBSZWdFeHAocywgXFxcImdcXFwiKSwgXFxcIjxzdHJvbmc+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjogIzFFOTBGRlxcXFxcXFwiPlxcXCIgKyBzICsgXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwgfHwgaXQuaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCB8fCBpdC5pbWcgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWMnIDogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxcXG4gICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICBpOiAwLFxcbiAgICAgICAgICAgIGo6IC0xXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQ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ICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwoaXRlbSwgbmFtZSksXFxuICAgICAgICAgICAgICAgIGltZzogcGFyc2VEb20oaXRlbSwgY292ZXIsIHVybCksXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9tZW51P3VybD1cXFwiICsgcGFyc2VEb20oaXRlbSwgYm9va3VybCwgdXJsKSArIFxcXCIjYXV0b0NhY2hlIyNpbW1lcnNpdmVUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBydWxlLmJvb2tTb3VyY2VOYW1lICsgXFxcIlxcXFxuXFxcIiArIHBhcnNlRG9tRm9ySHRtbChpdGVtLCBhdXRob3IpICsgXFxcIlxcXFxuXFxcIiArIHBhcnNlRG9tRm9ySHRtbChpdGVtLCBpbnRybyksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiVG9jXFxcIjogcnVsZS5ydWxlVG9jLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNvbnRlbnRcXFwiOiBydWxlLnJ1bGVDb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImJvb2tOYW1lXFxcIjogcGFyc2VEb21Gb3JIdG1sKGl0ZW0sIG5hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNvdmVyXFxcIjogcGFyc2VEb20oaXRlbSwgY292ZXIsIHVybClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBkO1xcbiAgICB9LFxcbiAgICBsaXN0UnVsZXM6IChwYWdlLCBydWxlKSA9PiB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIC8v5bm25Y+R5pWw6YePXFxuICAgICAgICAgICAgbGV0IHNpemUgPSAxMDtcXG4gICAgICAgICAgICBsZXQgZGF0YTEgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIpKVxcbiAgICAgICAgICAgIGxldCBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9cXFwiICsgbWQ1KGdldE15VmFyKFxcXCJ0YWJcXFwiLCBkYXRhMS51cmxzWzBdLm5hbWUpKSArIFxcXCIuanNvblxcXCIpKVxcbiAgICAgICAgICAgIGxldCBydWxlcyA9IFtdO1xcbiAgICAgICAgICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHMgPSBKU09OLnN0cmluZ2lmeShpdGVtKVxcbiAgICAgICAgICAgICAgICBpZiAocy5pbmNsdWRlcyhcXFwiPGpzPlxcXCIpIHx8IHMuaW5jbHVkZXMoXFxcIkBqczpcXFwiKSB8fCBzLmluY2x1ZGVzKFxcXCIkLlxcXCIpIHx8IHMuaW5jbHVkZXMoXFxcIvCflJ5cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5wdXNoKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKCFwYWdlICYmICFydWxlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBydWxlcy5tYXAoaXQgPT4gaXQubmFtZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChydWxlICE9IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGVzLmZpbHRlcihpID0+IGkubmFtZSA9PSBydWxlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gKHBhZ2UgLSAxKSAqIHNpemU7XFxuICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA8IHN0YXJ0ICsgMSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gW107XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBsZW4gPSBzaXplO1xcbiAgICAgICAgICAgIGlmIChydWxlcy5sZW5ndGggPCBwYWdlICogc2l6ZSkge1xcbiAgICAgICAgICAgICAgICBsZW4gPSBydWxlcy5sZW5ndGggLSBzdGFydFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgYWxsID0gcnVsZXMubGVuZ3RoO1xcbiAgICAgICAgICAgIGxldCB1c2UgPSAocGFnZSAtIDEpICogc2l6ZSArIGxlbjtcXG4gICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICBhbGw6IGFsbCxcXG4gICAgICAgICAgICAgICAgdXNlOiB1c2UsXFxuICAgICAgICAgICAgICAgIGRhdGE6IHJ1bGVzLnNsaWNlKHN0YXJ0LCBzdGFydCArIGxlbilcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIGFsbDogMCxcXG4gICAgICAgICAgICAgICAgdXNlOiAwLFxcbiAgICAgICAgICAgICAgICBkYXRhOiBbXVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfVxcbn1cIn1dLFwic2F2ZWRcIjpmYWxzZSxcInRpdGxlXCI6XCLmgqbor7tcIixcInZlcnNpb25cIjowLFwidXJsXCI6XCJoaWtlcjovL3BhZ2UvY29uZmlnXCIsXCJjb2xfdHlwZVwiOlwidGV4dF9jZW50ZXJfMVwiLFwiZmluZF9ydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbnRyeSB7XFxuICAgIGlmICghZmlsZUV4aXN0KFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIpKSB7XFxuICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgJ3tcXFwidXJsc1xcXCI6W119JylcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLmt7vliqDorqLpmIVcXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCJcXFwiLCBcXFwi6K6i6ZiF5ZCN56ewXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K6i6ZiF6ZO+5o6lXFxcIikuaW5wdXQoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIpKVxcbiAgICAgICAgICAgICAgICBsaXN0LnVybHMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBpbnB1dFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGZldGNoKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZSh0KVxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXCIgKyBtZDUobmFtZSkgKyBcXFwiLmpzb25cXFwiLCB0KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgfSwgaW5wdXQpXFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBsZXQgbGlzdCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIikpXFxuICAgIGxpc3QudXJscy5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgZGVzYzogaXRlbS51cmwsXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFwi5Yig6ZmkXFxcIiwgXFxcIue8lui+keWQjeensFxcXCIsIFxcXCLnvJbovpHlnLDlnYBcXFwiLCBcXFwi5pu05pawXFxcIl0pLnNlbGVjdCgobGlzLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gbGlzXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5Yig6ZmkXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWIoOmZpO+8n1xcXCIpLmNvbmZpcm0oKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXCIgKyBtZDUobGlzdC51cmxzW2ldLm5hbWUpICsgXFxcIi5qc29uXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnVybHMuc3BsaWNlKGksIDEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGxpc3QpKSAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gXFxcIue8lui+keWQjeensFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudXJsc1tpXS5uYW1lID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi57yW6L6R5Zyw5Z2AXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC51cmxzW2ldLnVybCA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGxpc3QpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ID0gZmV0Y2gobGlzdC51cmxzW2ldLnVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXCIgKyBtZDUobGlzdC51cmxzW2ldLm5hbWUpICsgXFxcIi5qc29uXFxcIiwgdClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuabtOaWsOaIkOWKn1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuabtOaWsOWksei0pVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBsaXN0LCBpKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCJcXG4gICAgICAgIH0pXFxuICAgIH0pXFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLplJnor6/vvJpcXFwiICsgZS5tZXNzYWdlLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgIH0pXFxufVxcbnNldFJlc3VsdChkKTtcIixcImdyb3VwXCI6XCJA54+N6JePXCIsXCJ1YVwiOlwibW9iaWxlXCIsXCJwcmVSdWxlXCI6XCJcIixcInBhZ2VzXCI6XCJbe1xcXCJjb2xfdHlwZVxcXCI6XFxcInRleHRfMVxcXCIsXFxcIm5hbWVcXFwiOlxcXCLmupDnm67lvZVcXFwiLFxcXCJwYXRoXFxcIjpcXFwic291cmNlXFxcIixcXFwicnVsZVxc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xldCBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaChcXFxcXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcXFxcXCIpKVxcXFxuICAgICAgICAgICAgICAgIGxpc3QudXJscy5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBpbnB1dFxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9saXN0Lmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpXFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBmZXRjaChpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZSh0KVxcXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXFxcXFwiICsgbWQ1KG5hbWUpICsgXFxcXFxcXCIuanNvblxcXFxcXFwiLCB0KVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeWksei0pVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgIH0sIGlucHV0KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG4gICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKGZldGNoKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9saXN0Lmpzb25cXFxcXFxcIikpXFxcXG4gICAgbGlzdC51cmxzLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICBkZXNjOiBpdGVtLnVybCxcXFxcbiAgICAgICAgICAgIHVybDogJChbXFxcXFxcXCLliKDpmaRcXFxcXFxcIiwgXFxcXFxcXCLnvJbovpHlkI3np7BcXFxcXFxcIiwgXFxcXFxcXCLnvJbovpHlnLDlnYBcXFxcXFxcIiwgXFxcXFxcXCLmm7TmlrBcXFxcXFxcIl0pLnNlbGVjdCgobGlzLCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBsaXNcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCLliKDpmaRcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruiupOWIoOmZpO+8n1xcXFxcXFwiKS5jb25maXJtKChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9cXFxcXFxcIiArIG1kNShsaXN0LnVybHNbaV0ubmFtZSkgKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnVybHMuc3BsaWNlKGksIDEpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShsaXN0KSkgICAgICAgICAgICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09IFxcXFxcXFwi57yW6L6R5ZCN56ewXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCJcXFxcXFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudXJsc1tpXS5uYW1lID0gaW5wdXRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFxcXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KGxpc3QpKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gXFxcXFxcXCLnvJbovpHlnLDlnYBcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC51cmxzW2ldLnVybCA9IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShsaXN0KSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBmZXRjaChsaXN0LnVybHNbaV0udXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZSh0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9cXFxcXFxcIiArIG1kNShsaXN0LnVybHNbaV0ubmFtZSkgKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIsIHQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuabtOaWsOaIkOWKn1xcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuabtOaWsOWksei0pVxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSwgbGlzdCwgaSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzFcXFxcXFxcIlxcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG59IGNhdGNoIChlKSB7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6IFxcXFxcXFwi6ZSZ6K+v77yaXFxcXFxcXCIgKyBlLm1lc3NhZ2UsXFxcXG4gICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgIH0pXFxcXG59XFxcXG5zZXRSZXN1bHQoZCk7XFxcIn0se1xcXCJjb2xfdHlwZVxcXCI6XFxcInRleHRfMVx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cXFxcXCJUZXh0XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0ID0gdC5yZXBsYWNlKG5ldyBSZWdFeHAoXFxcXFxcXCItLWJyLS1cXFxcXFxcIiwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIjxicj5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHQyID0gdC5zcGxpdChcXFxcXFxcIjxicj5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0MiBvZiB0Mikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0MiA9PSBcXFxcXFxcIlxcXFxcXFwiIHx8IGl0Mi5sZW5ndGggPT0gMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWl0Mi5zdGFydHNXaXRoKFxcXFxcXFwi44CAXFxcXFxcXCIpICYmICFpdDIuc3RhcnRzV2l0aChcXFxcXFxcIiZuYnNwOyZuYnNwO1xcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0MiA9IFxcXFxcXFwiJm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7XFxcXFxcXCIgKyBpdDIudHJpbSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1bGUucmVwbGFjZVJlZ2V4KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQyID0gaXQyLnJlcGxhY2UobmV3IFJlZ0V4cChydWxlLnJlcGxhY2VSZWdleC5yZXBsYWNlKFxcXFxcXFwiIyNcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIiksIFxcXFxcXFwiZ1xcXFxcXFwiKSwgXFxcXFxcXCJcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDIgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0dCArPSBpdDIgKyBcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHR0XFxcXG4gICAgICAgICAgICB9LCBNWV9QQVJBTVMpLFxcXFxuICAgICAgICAgICAgdHlwZTogXFxcXFxcXCJub3ZlbFxcXFxcXFwiXFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG59KVxcXFxuZC51bnNoaWZ0KHtcXFxcbiAgICB0aXRsZTogTVlfUEFSQU1TLmJvb2tOYW1lLFxcXFxuICAgIGltZzogTVlfUEFSQU1TLmNvdmVyLFxcXFxuICAgIHVybDogTVlfVVJMLFxcXFxuICAgIGNvbF90eXBlOiBcXFxcXFxcIm1vdmllXzFfdmVydGljYWxfcGljX2JsdXJcXFxcXFxcIlxcXFxufSlcXFxcbnNldFJlc3VsdChkKTtcXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLlhoXlrrlcXFwiLFxcXCJwYXRoXFxcIjpcXFwiY29udGVudFxcXCIsXFxcInJ1bGVcXFwiOlxcXCJqczpcXFxcbnZhciBkID0gW107XFxcXG52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yID0gcjFbMV0uc3BsaXQoXFxcXFxcXCI6XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgbGV0IHIzID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByMikge1xcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpID0gcGFyc2VJbnQoaXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNOYU4oaSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHIzLnB1c2goaSk7XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBhcnIyID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgIGlmIChyMy5pbmRleE9mKGkpIDwgMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBhcnIyLnB1c2goYXJyW2ldKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gYXJyMjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsb2coXFxcXFxcXCLojrflj5blpLHotKXvvIzlpLHotKXlrprkvY3vvJpcXFxcXFxcIiArIHIxWzBdLnJlcGxhY2UoXFxcXFxcXCIgXFxcXFxcXCIsIFxcXFxcXFwiJiZcXFxcXFxcIikucmVwbGFjZShcXFxcXFxcIkBcXFxcXFxcIiwgXFxcXFxcXCImJlxcXFxcXFwiKSlcXFxcbiAgICAgICAgcmV0dXJuIGFycjtcXFxcbiAgICB9LFxcXFxuICAgIGdldFRleHQ6IChodG1sLCBydWxlKSA9PiB7XFxcXG4gICAgICAgIHZh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FxcXFxcIiArIGl0Lm5hbWVcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuXFxcXG4gICAgYmF0Y2hFeGVjdXRlKHRhc2tzLCB7XFxcXG4gICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcXFxuICAgICAgICAgICAgLy9sb2coXFxcXFxcXCJsaXN0ZW5lcjogXFxcXFxcXCIgKyAocmVzdWx0IHx8IFtdKS5sZW5ndGgpXFxcXG4gICAgICAgICAgICBwYXJhbS5pID0gcGFyYW0uaSArIDE7XFxcXG4gICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgcmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5qID0gcGFyYW0uaiArIDE7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2hNdXN0ID09IFxcXFxcXFwiMVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpdC50aXRsZSB8fCAhaXQudGl0bGUuaW5jbHVkZXMocykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhID0gaXQuZXh0cmEgfHwge307XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYS5pZCA9IFxcXFxcXFwiX19hcHBcXFxcXFxcIiArIE1ZX1BBR0UgKyBcXFxcXFxcIkBcXFxcXFxcIiArIHBhcmFtLmo7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYS5ib29rTmFtZSA9IGl0LnRpdGxlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYS5jb3ZlciA9IGl0LnBpY191cmwgfHwgaXQuaW1nXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC50aXRsZS5pbmNsdWRlcyhcXFxcXFxcIuKAnOKAnOKAneKAnVxcXFxcXFwiKSA/IGl0LnRpdGxlIDogXFxcXFxcXCLigJzigJzigJ3igJ1cXFxcXFxcIiArIGl0LnRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cChcXFxcXFxcIjxlbT58PC9lbT5cXFxcXFxcIiwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIlxcXFxcXFwiKS5yZXBsYWNlKG5ldyBSZWdFeHAocywgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIjxzdHJvbmc+PHNwYW4gc3R5bGU9XFxcXFxcXFxcXFxcXFxcImNvbG9yOiAjMUU5MEZGXFxcXFxcXFxcXFxcXFxcIj5cXFxcXFxcIiArIHMgKyBcXFxcXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsIHx8IGl0LmltZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCB8fCBpdC5pbWcgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWMnIDogXFxcXFxcXCJ0ZXh0XzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAocGFyYW0uaSA+PSBwYXJhbS5hbGwpIHtcXFxcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWKoOi9veesrFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcXFxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBwYXJhbS5hbGwsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0sXFxcXG4gICAgICAgIHBhcmFtOiB7XFxcXG4gICAgICAgICAgICBhbGw6IGRhdGEubGVuZ3RoLFxcXFxuICAgICAgICAgICAgaTogMCxcXFxcbiAgICAgICAgICAgIGo6IC0xXFxcXG4gICA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gICAgICAgbGV0IHJ1bGVzID0gW107XFxcXG4gICAgICAgICAgICBsaXN0LmZvckVhY2goaXRlbSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHMgPSBKU09OLnN0cmluZ2lmeShpdGVtKVxcXFxuICAgICAgICAgICAgICAgIGlmIChzLmluY2x1ZGVzKFxcXFxcXFwiPGpzPlxcXFxcXFwiKSB8fCBzLmluY2x1ZGVzKFxcXFxcXFwiQGpzOlxcXFxcXFwiKSB8fCBzLmluY2x1ZGVzKFxcXFxcXFwiJC5cXFxcXFxcIikgfHwgcy5pbmNsdWRlcyhcXFxcXFxcIvCflJ5cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMucHVzaChpdGVtKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGlmICghcGFnZSAmJiAhcnVsZSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBydWxlcy5tYXAoaXQgPT4gaXQubmFtZSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAocnVsZSAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGVzLmZpbHRlcihpID0+IGkubmFtZSA9PSBydWxlKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBzdGFydCA9IChwYWdlIC0gMSkgKiBzaXplO1xcXFxuICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA8IHN0YXJ0ICsgMSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBsZW4gPSBzaXplO1xcXFxuICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA8IHBhZ2UgKiBzaXplKSB7XFxcXG4gICAgICAgICAgICAgICAgbGVuID0gcnVsZXMubGVuZ3RoIC0gc3RhcnRcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBhbGwgPSBydWxlcy5sZW5ndGg7XFxcXG4gICAgICAgICAgICBsZXQgdXNlID0gKHBhZ2UgLSAxKSAqIHNpemUgKyBsZW47XFxcXG4gICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgIGFsbDogYWxsLFxcXFxuICAgICAgICAgICAgICAgIHVzZTogdXNlLFxcXFxuICAgICAgICAgICAgICAgIGRhdGE6IHJ1bGVzLnNsaWNlKHN0YXJ0LCBzdGFydCArIGxlbilcXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgYWxsOiAwLFxcXFxuICAgICAgICAgICAgICAgIHVzZTogMCxcXFxcbiAgICAgICAgICAgICAgICBkYXRhOiBbXVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxufVxcXCJ9XVwiLFwicHJveHlcIjpcIlwifSIsInRpdGxlIjoi4pqZ77iP6K6+572uIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement