Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@追更周历@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6L+95pu05ZGo5Y6GIiwiYXV0aG9yIjoi6ZqP6aOOIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjIiwidmVyc2lvbiI6MjAyMzEyMTAsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoiYWxsIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG4kLnJlcXVpcmUoXCJob21lXCIpLkhvbWUoKTsiLCJzZWFyY2hfdXJsIjoiIiwiZ3JvdXAiOiLikaBB5b2xIiwic2VhcmNoRmluZCI6IiIsImRldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJkZXRhaWxfZmluZF9ydWxlIjoiIiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6IiIsInVhIjoibW9iaWxlIiwicHJlUnVsZSI6ImxldCBkYXRldGltZSA9ICQucmVxdWlyZShcInpob3VcIikueW1kaG0oKTtcbmlmIChkYXRldGltZS5zcGxpdChcIiNcIilbMF0ucmVwbGFjZSgvLS9nLCBcIlwiKSA+IGdldEl0ZW0oJC5yZXF1aXJlKFwiemhvdVwiKS5XZWVrRGF5KCkpLnJlcGxhY2UoLy0vZywgXCJcIikpIHtcbiAgICAkLnJlcXVpcmUoXCJnb25nXCIpLlVwZGF0ZShkYXRldGltZS5zcGxpdChcIiNcIilbMF0sIFwi5ZGo5pu0XCIpO1xufTtcbmlmIChkYXRldGltZS5zcGxpdChcIiNcIilbMF0ucmVwbGF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ICAgICAgICAgIGlmIChsZXhpID09IFxcXCLov73mm7TlkajljoZcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInpodWlnZW5cXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJ6dWlnZW5cXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcImlkX3pq5pu0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIjxiPlxcXCIgKyBnZXRJdGVtKFxcXCJ6dWlnZW5cXFwiLCBcXFwi5Yqo5ryrXFxcIikuZm9udGNvbG9yKFxcXCIjMTlCODlEXFxcIikgKyBcXFwiPC9iPlxcXFx0XFxcIixcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIGxldCBodG1sID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcInpqaHRtbFxcXCIpIHx8IFtdO1xcbiAgICAgICAgICAgICAgICBsZXQgbGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgempneChsZCwgaHRtbCk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFwiY2xzX3rov5FcXFwiKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKFxcXCJpZF966L+RXFxcIiwgbGQpO1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignc3dpdGNoJyk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgIH0sIGdldE15VmFyKFxcXCJsZWl4aW5cXFwiLCBcXFwi6L+95pu05ZGo5Y6GXFxcIikgPT0gXFxcIuacgOi/keabtOaWsFxcXCIgPyB6amd4IDogXFxcIlxcX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zdE51bSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAvLyDmo4Dmn6XmmK/lkKbmnInnrKzkuozkuKrljLnphY3liLDnmoTmlbDlrZfvvIzoi6XmsqHmnInliJnot7Pov4fmr5TovoPpg6jliIZcXG4gICAgICAgICAgICAgICAgbGV0IHNlY29uZE51bSA9IC0xO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBrID0gZmlyc3ROdW0gKyAxOyBrIDwgbmFtZVBhcnRzLmxlbmd0aDsgaysrKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKG5hbWVQYXJ0c1trXSkgJiYgayAhPSBmaXJzdE51bSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlY29uZE51bSA9IGs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgaWYgKChwYXJzZUludChuYW1lUGFydHNbZmlyc3ROdW1dKSA+PSBwYXJzZUludChuYW1lUGFydHNbc2Vjb25kTnVtXSkpICYmIHNlY29uZE51bSAhPT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGxldCBudW0gPSBwYXJzZUludChuYW1lUGFydHNbZmlyc3ROdW1dKTtcXG4gICAgICAgICAgICAgICAgLy8g5Yik5pat5piv5ZCm6LaF6L+H5ZCO6Z2i5om+5Yiw55qE5pWw5a2XXFxuICAgICAgICAgICAgICAgIGlmICgobnVtICsgcGFyc2VJbnQoRGF5cykgKiBwYXJzZUludChnanMpID49IHBhcnNlSW50KG5hbWVQYXJ0c1tzZWNvbmROdW1dKSkgJiYgc2Vjb25kTnVtICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICBudW0gPSBwYXJzZUludChuYW1lUGFydHNbc2Vjb25kTnVtXSk7XF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cIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAvL2xvZyhjb25BcnJheSk7XFxuICAgICAgICAgICAgICAgIGNvbkFycmF5ID0gY29uQXJyYXkubWFwKGZ1bmN0aW9uKGl0ZW0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdGVtWyduYW1lJ10gPT0gTmFtZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXRlbVsnaW1nJ10gfHwgaXRlbVsnaW1nJ10gPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHJlcXVlc3QoJ2h0dHBzOi8vbS5kb3ViYW4uY29tL3NlYXJjaC8/cXVlcnk9JyArIGVuY29kZVVSSUNvbXBvbmVudChOYW1lLnNwbGl0KFxcXCIsXFxcIilbMF0pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBwZGZhKHVybCwgXFxcIi5zZWFyY2gtcmVzdWx0cyYmaW1nXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwaWMgPSBwZGZoKGxpc3RbMF0sIFxcXCJpbWcmJnNyY1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtWydpbWcnXSA9IHBpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgLy9sb2coY29uQXJyYXkpXFxuICAgICAgICAgICAgICAgIGxldCBnZW4gPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gXFxcInpodWlcXFwiIDogXFxcInJpXFxcIjtcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvY2FjaGUvWkdaTC8nICsgZ2Vu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cpIHtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCA0OyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oJ2FkZCcpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3N3aXRjaCcsICflhbMnKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBhZGRBcnJheSA9IFt7XFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi56S65L6L77ya5rKn5YWD5Zu+LDI0LDI2XFxcXG5cXFxcbuekuuS+i+ivtOaYju+8mlxcXFxu5b2x6KeG5ZCN77yM5pu05paw6IezMjTpm4bvvIzlhbEyNumbhuOAglxcXFxu5oC76ZuG5pWw5Y+v5LiN5YaZ77yM6ZuG5pWw5b+F6aG75Li65pWw5a2X44CCXFxcXG7pl7TpmpTnrKblj7cgLCDnlKjoi7HmlofnrKblj7fjgIJcXFxcbuWkmuadoeWPr+aNouihjO+8jOS4gOadoeS4gOihjOOAglxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogLTEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9oaWdobGlnaHQ6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignbmFtZWF5JyxpbnB1dClcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiAnYWRkJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gKFxcXCLnpLrkvovvvJpcXFwiICsgZ2V0TXlWYXIoXFxcImxpXFxcIiwgRGF5KSArIFxcXCIsMSwxMFxcXFxuXFxcXG7npLrkvovor7TmmI7vvJpcXFxcbuWRqFxcXCIgKyBnZXRNeVZhcihcXFwibGlcXFwiLCBEYXkpICsgXFxcIuabtOaWsO+8jOavj+WRqOabtOaWsDHpm4bvvIwxMDowMOabtOaWsOOAglxcXFxu5aaC5LiN5YaZ77yM6buY6K6k5Li65b2T5YmN5ZGo77yM5pu05pawMembhu+8jDEwOjAw5pu05paw44CCXFxcXG4wOOS4ujg6MDDvvIwxMOS4ujEwOjAw77yMMDgzMOS4ujg6MzDjgIJcXFxcbuaMieeFp+ekuuS+i+agvOW8j+WGmeWFpeOAglxcXFxu5aSa5p2h6ZyA5LiO5LiK5qGG55u45a+55bqU44CCXFxcIikgOiAoXFxcIuekuuS+i++8mjEsMTBcXFxcblxcXFxu56S65L6L6K+05piO77yaXFxcXG7mm7TmlrAx6ZuG77yMMTA6MDDmm7TmlrDjgIJcXFxcbum7mOiupOS4uuabtOaWsDHpm4bvvIwxMDowMOabtOaWsOOAglxcXFxuMDjkuLo4OjAw77yMMTDkuLoxMDowMO+8jDA4MzDkuLo4OjMw44CCXFxcXG7mjInnhafnpLrkvovmoLzlvI/lhpnlhaXjgIJcXFxcbuWkmuadoemcgOS4juS4iuahhuebuOWvueW6lOOAglxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IC0xLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vaGlnaGxpZ2h0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ3VybGF5JyxpbnB1dClcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiAnYWRkJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZW5nID0gZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu6K6k5Yig6Zmk5omA5pyJ5bey5re75YqgXFxcIiArIGdlbmcgKyBcXFwiIO+8n1xcXCIpLmNvbmZpcm0oKGdlbmcpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdlbiA9IGdlbmcgPT0gXFxcIuWRqOabtFxcXCIgPyBcXFwiemh1aVxcXCIgOiBcXFwicmlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1pHWkwvJyArIGdlbiArICcuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKFxcXCJhZGRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwic3dpdGNoXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWIoOmZpFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgZ2VuZylcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogJ2FkZCdcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv53lrZhcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChEYXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lQXJyYXkgPSBnZXRNeVZhcignbmFtZWF5Jykuc3BsaXQoL1xcXFxyXFxcXG58XFxcXG58XFxcXHIvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmxBcnJheSA9IGdldE15VmFyKCd1cmxheScpLnNwbGl0KC9cXFxcclxcXFxufFxcXFxufFxcXFxyLyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUxlbmd0aCA9IG5hbWVBcnJheS5sZW5ndGggPiB1cmxBcnJheS5sZW5ndGggPyBuYW1lQXJyYXkubGVuZ3RoIDogdXJsQXJyYXkubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZGF0YUxlbmd0aCA9IG5hbWVBcnJheS5sZW5ndGg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdlbmcgPSBnZXRJdGVtKFxcXCJ6aHVpZ2VuXFxcIiwgXFxcIuWRqOabtFxcXCIpO1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EsMSwxMFxcXCIgOiAvKFxcXFxkKSwoXFxcXGQrKS8udGVzdCh1cmxBcnJheVtpXSkgPyBcXFwiMSxcXFwiICsgdXJsQXJyYXlbaV0gOiAvKFxcXFxkKS8udGVzdCh1cmxBcnJheVtpXSkgPyBcXFwiMSxcXFwiICsgdXJsQXJyYXlbaV0gKyBcXFwiLDEwXFxcIiA6IFxcXCIxLFxcXCIgKyB1cmxBcnJheVtpXSkpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdBcnJheS51bnNoaWZ0KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IE5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWVrOiB6aG91LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeXVybDogXFxcImVtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiZ29uZ1xcXCIpLmFkZGl0aW9uKE5hbWUsIHpob3UsIGNvbmZpZ0FycmF5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9hO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgRGF5KSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdhZGQnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcignYWRkRnVuY3Rpb24nLCBhZGRBcnJheSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzd2l0Y2gnLCAn5byAJyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBXZWVrRGF5KSxcXG4gICAgICAgIGltZzogXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vY2lyY2xlLzQ5Ni5wbmdcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIjxiPua3u+WKoFxcXFx0PC9iPlxcXCIuZm9udGNvbG9yKFxcXCIjNkVCODk3XFxcIiksXFxuICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiAnYWRkRnVuY3Rpb24nLFxcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlvZPliY3kuLogXFxcIiArIGdldEl0ZW0oXFxcInhnZ2tcXFwiLCBcXFwi6KeC55yLXFxcIikgKyBcXFwiIOaooeW8j1xcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInhnZ2tcXFwiLCBnZXRJdGVtKFxcXCJ4Z2drXFxcIiwgXFxcIuingueci1xcXCIpID09IFxcXCLop4LnnItcXFwiID8gXFxcIuS/ruaUuVxcXCIgOiBcXFwi6KeC55yLXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5YiH5o2i5Li6XFxcIiArIGdldEl0ZW0oXFxcInhnZ2tcXFwiLCBcXFwi6KeC55yLXFxcIikgKyBcXFwi5qih5byPXFxcIjtcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XVxcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiXFxuICAgIH0pO1xcbn07XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1l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ICAgICAgICBkZXNjOiBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gXFxcIuWRqFxcXCIgKyBnZXRNeVZhcihcXFwibGlcXFwiLCBEYXkpICsgXFxcIui/mOayoeacieaDs+i/veeahOWJp1xcXCIgOiBcXFwi6L+Y5rKh5pyJ5oOz6L+955qE5YmnXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogXFxcImNsc196ZHl6Z1xcXCIsXFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9O1xcbiAgICBsZXQganNvbiA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vaGlzdG9yeVxcXCIpKTtcXG5cXG4gICAgZm9yIChsZXQgaSBpbiBsaXN0KSB7XFxuICAgICAgICBsZXQgbGkgPSBsaXN0W2ldO1xcbiAgICAgICAgbGV0IHdlayA9IGxpLndlZWsuc3BsaXQoXFxcIixcXFwiKVswXTtcXG4gICAgICAgIGlmIChnZXRNeVZhcihcXFwibGlcXFwiLCBEYXkpID09IHdlayB8fCBnZW5nICE9IFxcXCLlkajmm7RcXFwiKSB7XFxuICAgICAgICAgICAgbGV0IGppc3UgPSBsaS53ZWVrLnNwbGl0KFxcXCIsXFxcIilbMV07XFxuICAgICAgICAgICAgbGV0IGl0ZSA9IGxpLndlZWsuc3BsaXQoXFxcIixcXFwiKVsyXTtcXG4gICAgICAgICAgICBsZXQgaXRlbSA9IGl0ZS5sZW5ndGggPT0gMiA/IGl0ZSArIFxcXCI6MDBcXFwiIDogaXRlLnNsaWNlKDAsIDIpICsgJzonICsgaXRlLnNsaWNlKC0yKTtcXG4gICAgICAgICAgICBsZXQgdGl0ID0gbGkubmFtZTtcXG4gICAgICAgICAgICBsZXQgdGl0MSA9IHRpdC5zcGxpdChcXFwiLFxcXCIpWzBdO1xcbiAgICAgICAgICAgIGxldCB0aXQyID0gdGl0LnNwbGl0KFxcXCIsXFxcIilbMV07XFxuICAgICAgICAgICAgbGV0IHRpdDMgPSB0aXQuc3BsaXQoXFxcIixcXFwiKVsyXTtcXG4gICAgICAgICAgICBsZXQgZGVzID0gL14oXFxcXGQrKSQvLnRlc3QodGl0Myk7XFxuICAgICAgICAgICAgbGV0IGRlZXMgPSAkLnJlcXVpcmUoXFxcImd1YW5cXFwiKS5IaXN0b3J5KGpzb24sIHRpdDEpO1xcbiAgICAgICAgICAgIGxldCBuZXdBcnIgPSBsaXN0Lm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICAgICAgICAgIGlmIChpdGVtWyduYW1lJ10gPT0gdGl0KSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoKHBhcnNlSW50KGl0ZW1bJ3p1amknXSkgPCBwYXJzZUludChkZWVzKSkgfHwgaXRlbVsnenVqaSddID09IFxcXCLml6DorrDlvZVcXFwiIHx8ICFpdGVtWyd6dWppJ10pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtWyd6dWppJ10gPSBkZWVzO1xcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gaXRlbTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzYXZlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS9aR1pMLycgKyBnZW4gKyAnLmpzJywgSlNPTi5zdHJpbmdpZnkobmV3QXJyKSk7XFxuICAgICAgICAgICAgLy9sb2cocGFyc2VJbnQobGkuenVqaSkpXFxuICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhuZXdBcnIpO1xcbiAgICAgICAgICAgIGxldCBUSiA9IGdlbmcgPT0gXFxcIuWRq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xcXCLkv67mlLlcXFwiLCBcXFwi5Yig6ZmkXFxcIiwgXFxcIuenu+WKqFxcXCIsIFxcXCLotrPov7lcXFwiLCBcXFwi5p+l55yLXFxcIl0sIDIpLnNlbGVjdCgoaSwgdGl0MSwgdGl0LCBpbWcsIHl1cmwsIHdlaywgenVqaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmkJzntKJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuU291KHRpdDEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWwgemdolxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1nICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLmo4DmtYvliLDlt7Llr7zlhaXlsIHpnaLvvIzmmK/lkKbmm7TmjaLvvJ9cXFwiKS5jb25maXJtKChpLCB0aXQxLCB0aXQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwieGl1XFxcIikuRm1zaGUoaSwgdGl0MSwgdGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaSwgdGl0MSwgdGl0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwieGl1XFxcIikuRm1zaGUoaSwgdGl0MSwgdGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIumTvuaOpVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2FsaShwYW58eXVuZHJpdmUpfGh0dHB8aGlrZXIvLnRlc3QoeXVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuajgOa1i+WIsOW3suWvvOWFpemTvuaOpe+8jOaYr+WQpuabtOaNou+8n1xcXCIpLmNvbmZpcm0oKHRpdCwgeXVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuTGlhbmppZSh0aXQsIHl1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0aXQsIHl1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLkxpYW5qaWUodGl0LCB5dXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuS/ruaUuVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5YaXVnYWkodGl0LCB3ZWspO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWIoOmZpFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5TaGFuY2h1KHRpdCwgd2VrKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLnp7vliqhcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuWWlkb25nKHRpdCwgd2VrKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi6Laz6L+5XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLlp1amkodGl0KTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmn6XnnItcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHl1cmwgPT0gXFxcImVtcHR5XFxcIiA/ICQucmVxdWlyZShcXFwieGl1XFxcIikuU291KHRpdDEpIDogeXVybFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgfSwgaSwgdGl0MSwgdGl0LCBsaS5pbWcsIHl1cmwsIGxpLndlZWssIGxpLnp1amkpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogbGkuaW1nICE9IG51bGwgPyBcXFwibW92aWVfMV92ZXJ0aWNhbF9waWNcXFwiIDogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHt9LCBzdG9yYWdlMC5nZXRNeVZhcihcXFwiZXh0cmFcXFwiKSwge1xcbiAgICAgICAgICAgICAgICAgICAgLy9uZXdXaW5kb3c6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCJjbHNfemR5emdcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJpZF9mbXh6XFxcIiArIGksXFxuICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IHRpdDEsXFxuICAgICAgICAgICAgICAgICAgICBzZWFyY2hUZXJtczogdGl0MSxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaQnOe0olxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHRpdDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuU291KHRpdDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRpdDEpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlsIHpnaJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpLCBrZXksIHRpdCwgaW1nKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbWcgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLmo4DmtYvliLDlt7Llr7zlhaXlsIHpnaLvvIzmmK/lkKbmm7TmjaLvvJ9cXFwiKS5jb25maXJtKChpLCBrZXksIHRpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwieGl1XFxcIikuRm1zaGUoaSwga2V5LCB0aXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaSwga2V5LCB0aXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLkZtc2hlKGksIGtleSwgdGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpLCB0aXQxLCB0aXQsIGxpLmltZylcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumTvuaOpVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHRpdCwgeXVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2FsaShwYW58eXVuZHJpdmUpfGh0dHB8aGlrZXIvLnRlc3QoeXVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLmo4DmtYvliLDlt7Llr7zlhaXpk77mjqXvvIzmmK/lkKbmm7TmjaLvvJ9cXFwiKS5jb25maXJtKCh0aXQsIHl1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5MaWFuamllKHRpdCwgeXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0aXQsIHl1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuTGlhbmppZSh0aXQsIHl1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRpdCwgeXVybClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS/ruaUuVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHRpdCwgd2VrKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLlhpdWdhaSh0aXQsIHdlayk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdGl0LCBsaS53ZWVrKVxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodGl0LCB3ZWspID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuU2hhbmNodSh0aXQsIHdlayk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdGl0LCBsaS53ZWVrKVxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi56e75YqoXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodGl0LCB3ZWspID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuWWlkb25nKHRpdCwgd2VrKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB0aXQsIGxpLndlZWspXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLotrPov7lcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0aXQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuWnVqaSh0aXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRpdClcXG4gICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH07XFxuICAgIH07XFxufTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWRqOWOhlwiLFwicGF0aFwiOlwiemhvdVwiLFwicnVsZVwiOlwiLy8kLmV4cG9ydHMuRGF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FwiaWRf5ZGo5Y6GXFxcIiArIGosIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogRGF5ID09IGdldE15VmFyKFxcXCJsaVxcXCIpICYmIERheSA9PSBsaWsgPyBcXFwi4oCY4oCY4oCZ4oCZPGI+XFxcIiArIChcXFwi5ZGoXFxcIiArIGxpaykuZm9udGNvbG9yKFxcXCIjRkE3Mjk4XFxcIikgKyBcXFwiPC9iPlxcXCIgOiBnZXRNeVZhcihcXFwibGlcXFwiKSA9PSBsaWsgPyBcXFwi4oCY4oCY4oCZ4oCZPGI+5ZGoXFxcIiArIGxpayArIFxcXCI8L2I+XFxcIiA6IGxpayxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBsZXQgZGF0ZXRpbWUgPSAkLnJlcXVpcmUoXFxcInpob3VcXFwiKS55bWRobSgpO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJhZGRGdW5jdGlvblxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBkYXRldGltZS5zcGxpdChcXFwiI1xcXCIpWzFdXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcImxlaXhpblxcXCIsIFxcXCLov73mm7TlkajljoZcXFwiKSA9PSBcXFwi5ZGo5pu05YiX6KGoXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3RzID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcIuWRqGxpc3RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWVrMShsZCwgbGlzdHMsIGRhdGV0aW1lLnNwbGl0KFxcXCIjXFxcIilbMl0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLmnKrliqDovb3lrozmiJDvvIzor7fph43or5VcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFwiY2xzX+WRqFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKFxcXCJpZF/lkajmlrBcXFwiLCBsZCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcImxlaXhpblxcXCIsIFxcXCLov73mm7TlkajljoZcXFwiKSA9PSBcXFwi6L+95pu05ZGo5Y6GXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHpnID0gW107XFxuICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImxpc3RcXFwiKS5jdXN0emcoemcpO1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKFxcXCJjbHNfemR5emdcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihcXFwiaWRfemR5emdcXFwiLCB6Zyk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSwgbGksIGksIHdlZWssIHdlZWsxKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBcXFwiaWRf5ZGo5Y6GXFxcIiArIGlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfTtcXG59O1wifSx7XCJjb2xfd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F07XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcihcXFwibGVpeGluXFxcIiwgXFxcIui/veabtOWRqOWOhlxcXCIpLnJlcGxhY2UoL+aIkeeahOaUtuiXj3zop4LnnIvorrDlvZUvLCBcXFwi5pS26JeP6K6w5b2VXFxcIikucmVwbGFjZSgv5ZGo5pu05YiX6KGofOacgOi/keabtOaWsC8sIFxcXCLmnIDov5Hlkajmm7RcXFwiKSA9PSBsaSA/IFxcXCLigJjigJjigJnigJk8Yj5cXFwiICsgKGxpLnJlcGxhY2UoL+aUtuiXj+iusOW9lS8sIGdldE15VmFyKFxcXCJsZWl4aW5cXFwiKSkucmVwbGFjZSgv5pyA6L+R5ZGo5pu0LywgZ2V0TXlWYXIoXFxcImxlaXhpblxcXCIpKSArIFxcXCI8L2I+XFxcIikuZm9udGNvbG9yKFxcXCIjRkE3Mjk4XFxcIikgOiBsaSxcXG4gICAgICAgICAgICBwaWM6IGFwaWkgKyBsZWl0dVt4XSArIFxcXCIucG5nXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fM19maWxsXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGxpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChsaSA9PSBcXFwi5pS26JeP6K6w5b2VXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLmiJHnmoTmlLbol49cXFwiLCBcXFwi6KeC55yL6K6w5b2VXFxcIl0sIDEpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImxlaXhpblxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgIGlmIChsaSA9PSBcXFwi5pyA6L+R5ZGo5pu0XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLlkajmm7TliJfooahcXFwiLCBcXFwi5pyA6L+R5pu05pawXFxcIl0sIDEpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImxlaXhpblxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJsZWl4aW5cXFwiLCBsaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIC8vc2V0SXRlbShcXFwibGVpeGluXFxcIiwgbGkpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzd2l0Y2gnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LCBsaSlcXG4gICAgICAgIH0pXFxuICAgIH07XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImJpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgfSwge1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICB9KTtcXG5cXG4gICAgbGV0IHp1cmwgPSBcXFwiaHR0cDovL3d3dy55YXR1LnR2OjIwODIvemhvdWxpLmFzcFxcXCI7XFxuICAgIGxldCBndXJsID0gXFxcImh0dHA6Ly93d3cueWF0dS50djoyMDgyL3p1aWppbi5hc3BcXFwiO1xcblxcbiAgICBmdW5jdGlvbiBXZWVrKHVybCwgZCkge1xcblxcbiAgICAgICAgLy/lkajmm7TliJfooahcXG4gICAgICAgIGZ1bmN0aW9uIHdlZWsxKGQsIGxpc3RzLCBudW0pIHtcXG4gICAgICAgICAgICBsZXQgbGwgPSBnZXRNeVZhcihcXFwic1xcXCIsIEpTT04uc3RyaW5naWZ5KHBhcnNlSW50KG51bSkgKyAobnVtID09IDAgPyArNiA6IC0xKSkpO1xcbiAgICAgICAgICAgIGxldCBsaXN0ID0gcGRmYShsaXN0c1tsbF0sIFxcXCJib2R5JiZ0cjpndCgxKVxcXCIpO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJpZF/lkajmlrBcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBmb3IgKGxldCBqIGluIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGxpID0gSlNPTi5zdHJpbmdpZnkobGlzdFtqXSkucmVwbGFjZSgvdGQvZywgXFxcInRkX3RkXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgobGksIFxcXCJ0ZF90ZCwzJiZhJiZUZXh0XFxcIikucmVwbGFjZSgvXFxcXHMvZywgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgamlzdSA9IHBkZmgobGksIFxcXCJ0ZF90ZCwzLS1hLS1mb250JiZUZXh0XFxcIikucmVwbGFjZSgvXFxcXHMvZywgXFxcIlxcXCIpXFxuICAgICAgICAgICAgICAgIGxldCDng60gPSBwZGZoKGxpLCBcXFwidGRfdGQsNCYmVGV4dFxcXCIpLnJlcGxhY2UoL+KEgy9nLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCByZWR1ID0gXFxcIuKAmOKAmOKAmeKAmVxcXCIgKyAo54OtID4gNjUgPyAoXFxcIlxcXFx0XFxcXHRcXFxcdOeDreW6pjogXFxcIiArIOeDrSArIFxcXCIlXFxcIikuZm9udGNvbG9yKFxcXCIjZmYxMTAwXFxcIikgOiDng60gPCAzNCA/IFxcXCJcXFxcdFxcXFx0XFxcXHTng63luqY6IFxcXCIgKyDng60gKyBcXFwiJVxcXCIgOiAoXFxcIlxcXFx0XFxcXHRcXFxcdOeDreW6pjogXFxcIiArIOeDrSArIFxcXCIlXFxcIikuZm9udGNvbG9yKFxcXCIjMDBjYzk5XFxcIikpO1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlICsgXFxcIuKAmOKAmOKAmeKAmTxzbWFsbD5cXFwiICsgKFxcXCJcXFxcdFxcXFx0XFxcXHTmm7TmlrA6IFxcXCIgKyBqaXN1KS5mb250Y29sb3IoXFxcIiM2QTVBQ0RcXFwiKSArIFxcXCI8L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiAoXFxcIuaXpeacnzogXFxcIiArIHBkZmgobGksIFxcXCJmb250JiZUZXh0XFxcIikpLmZvbnRjb2xvcihcXFwiIzI3NGM1ZVxcXCIpICsgcmVkdSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChbXFxcIuWKoOWFpei/veabtFxcXCIsIFxcXCLosIPnlKjmkJzntKJcXFwiXSwgMSkuc2VsZWN0KCh0aXRsZSwgamlzdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi6LCD55So5pCc57SiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5Tb3UodGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZW5nID0gZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGppcyA9IGppc3UubWF0Y2goLyhcXFxcZCspKD866ZuGXFxcXEQrKFxcXFxkKynpm4YpPy8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgamlzaHUgPSBqaXMgPyAoXFxcIixcXFwiICsgamlzWzFdKSArIChqaXNbMl0gPyBcXFwiLFxcXCIgKyBqaXNbMl0gOiBcXFwiXFxcIikgOiBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGlucHUgPSB0aXRsZSArIGppc2h1ICsgXFxcIlxcXFxuXFxcIiArIChnZW5nID09IFxcXCLlkajmm7RcXFwiID8gZ2V0TXlWYXIoXFxcImxpXFxcIiwgJC5yZXF1aXJlKFxcXCJ6aG91XFxcIikuV2Vla0RheSgpKSArIFxcXCIsXFxcIiA6IFxcXCJcXFwiKSArIFxcXCIxXFxcIiArIFxcXCIsMTBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpbnB1KS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZW5nID0gZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmFtZSA9IGlucHV0LnNwbGl0KFxcXCJcXFxcblxcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3ZWVrID0gZ2VuZyA9PSBcXFwi5ZGo5pu0XFxcIiA/IGlucHV0LnNwbGl0KFxcXCJcXFxcblxcXCIpWzFdIDogXFxcIjEsXFxcIiArIGlucHV0LnNwbGl0KFxcXCJcXFxcblxcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZW4gPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gXFxcInpodWlcXFwiIDogXFxcInJpXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdsZXQgYXJyID0nICsgcmVhZEZpbGUoJ2hpa2VyOi8vZmlsZXMvY2FjaGUvWkdaTC8nICsgZ2VuICsgJy5qcycpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIndlZWtcXFwiOiB3ZWVrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwieXVybFxcXCI6IFxcXCJlbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiZ29uZ1xcXCIpLmFkZGl0aW9uKG5hbWUsIHdlZWssIGFycik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+i+k+WFpeacieivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRvYTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdGl0bGUsIGppc3UpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCJjbHNf5ZGoXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlYXJjaFRlcm1zOiB0aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfTtcXG5cXG4gICAgICAgIGxldCB6Z3psID0gW1xcXCLliqjmvKtcXFwiLCBcXFwi5Ymn6ZuGXFxcIl07XFxuICAgICAgICBsZXQgempsZWkgPSBnZXRJdGVtKFxcXCJ6bGtleVxcXCIsIFxcXCLliqjmvKtcXFwiKTtcXG4gICAgICAgICQucmVxdWlyZShcXFwiZ29uZ1xcXCIpLlhpYW9sZWkoZCwgemd6bCwgempsZWksIGRhdGV0aW1lLnNwbGl0KFxcXCIjXFxcIilbMF0pO1xcbiAgICAgICAgLy/lkajljobooahcXG4gICAgICAgICQucmVxdWlyZShcXFwiemhvdVxcXCIpLlpob3UoZCwgd2VlazEpO1xcbiAgICAgICAgbGV0IHp1cmwgPSB6amxlaSA9PSBcXFwi5Yqo5ryrXFxcIiA/IHVybCA6IHVybCArIFxcXCI/dHlwZT10dlxcXCI7XFxuXFxuICAgICAgICBsZXQgaHRtbCA9IGZldGNoUEMoenVybCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uOyBjaGFyc2V0PUdCSydcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxldCBsaXN0cyA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJi56bHRhYjpndCgwKVxcXCIpO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcIuWRqGxpc3RcXFwiLCBsaXN0cyk7XFxuICAgICAgICB3ZWVrMShkLCBsaXN0cywgZGF0ZXRpbWUuc3BsaXQoXFxcIiNcXFwiKVsyXSk7XFxuICAgIH07XFxuXFxuICAgIC8v5pyA6L+R5pu05pawXFxuICAgIGZ1bmN0aW9uIHp1aWppbih1cmwsIGQpIHtcXG4gICAgICAgIGZ1bmN0aW9uIHpqZ3goZCwgaHRtbCkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogXFxcImlkX3rov5FcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsZXQgemdObyA9IGdldEl0ZW0oXFxcInp1aWdlblxcXCIsIFxcXCLliqjmvKtcXFwiKTtcXG4gICAgICAgICAgICBsZXQgTm8gPSB6Z05vID09IFxcXCLliqjmvKtcXFwiID8gXFxcIjFcXFwiIDogemdObyA9PSBcXFwi55S15b2xXFxcIiA/IFxcXCIyXFxcIiA6IFxcXCIzXFxcIjtcXG4gICAgICAgICAgICBsZXQgbGlzdCA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJiNzaW5cXFwiICsgcGFyc2VJbnQoTm8pICsgXFxcIiYmdHI6Z3QoMClcXFwiKTtcXG5cXG4gICAgICAgICAgICBmb3IgKGxldCBrIGluIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGxpc3MgPSBKU09OLnN0cmluZ2lmeShsaXN0W2tdKS5yZXBsYWNlKC90ZC9nLCBcXFwidGRfdGRcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IGxpcyA9IHBkZmEobGlzcywgXFxcImJvZHkmJnRkX3RkXFxcIik7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gbGlzKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGkgPSBsaXNbaV07XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGxpLCBcXFwiYSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVwID0gcGRmaChsaSwgXFxcInNwYW4sMSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJpcSA9IHBkZmgobGksIFxcXCJzcGFuLDImJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByaXFzID0gL1xcXFw6Ly50ZXN0KHJpcSkgPyBcXFwi4oCY4oCY4oCZ4oCZXFxcIiArIChcXFwiXFxcXHRcXFxcdFxcXFx05pel5pyfOiBcXFwiICsgcmlxKS5mb250Y29sb3IoXFxcIiMwMGNjOTlcXFwiKSA6IFxcXCJcXFxcdFxcXFx0XFxcXHTml6XmnJ86IFxcXCIgKyByaXE7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaG90ID0gL1xcXFwuZ2lmLy50ZXN0KHBkZmgobGksIFxcXCJpbWcmJnNyY1xcXCIpKSA/IFxcXCLigJjigJjigJnigJlcXFwiICsgKFxcXCI8Yj48c21hbGw+PHNtYWxsPkhPVDwvc21hbGw+PC9zbWFsbD48L2I+XFxcIikuZm9udGNvbG9yKFxcXCIjZmYxMTAwXFxcIikgOiBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgobGksIFxcXCJzcGFuLDAmJlRleHRcXFwiKSArIFxcXCJcXFxcdFxcXFx0XFxcIiArIHRpdGxlICsgXFxcIlxcXFx0XFxcXHRcXFwiICsgaG90LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJjigJjigJnigJlcXFwiICsgKFxcXCLmm7TmlrA6IFxcXCIgKyB1cCkuZm9udGNvbG9yKFxcXCIjNkE1QUNEXFxcIikgKyByaXFzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChbXFxcIuWKoOWFpei/veabtFxcXCIsIFxcXCLosIPnlKjmkJzntKJcXFwiXSwgMSkuc2VsZWN0KCh0aXRsZSwgamlzdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi6LCD55So5pCc57SiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5Tb3UodGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZW5nID0gZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGppcyA9IGppc3UucmVwbGFjZSgvLirlraN8LirmnIgvZywgXFxcIlxcXCIpLm1hdGNoKC8oXFxcXGQrKSg/OumbhlxcXFxEKyhcXFxcZCsp6ZuGKT8vKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGppc2h1ID0gamlzID8gKFxcXCIsXFxcIiArIGppc1sxXSkgKyAoamlzWzJdID8gXFxcIixcXFwiICsgamlzWzJdIDogXFxcIlxcXCIpIDogXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbnB1ID0gdGl0bGUgKyBqaXNodSArIFxcXCJcXFxcblxcXCIgKyAoZ2VuZyA9PSBcXFwi5ZGo5pu0XFxcIiA/IGdldE15VmFyKFxcXCJsaVxcXCIsICQucmVxdWlyZShcXFwiemhvdVxcXCIpLldlZWtEYXkoKSkgKyBcXFwiLFxcXCIgOiBcXFwiXFxcIikgKyBcXFwiMVxcXCIgKyBcXFwiLDEwXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaW5wdSkuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2VuZyA9IGdldEl0ZW0oXFxcInpodWlnZW5cXFwiLCBcXFwi5ZGo5pu0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBpbnB1dC5zcGxpdChcXFwiXFxcXG5cXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgd2VlayA9IGdlbmcgPT0gXFxcIuWRqOabtFxcXCIgPyBpbnB1dC5zcGxpdChcXFwiXFxcXG5cXFwiKVsxXSA6IFxcXCIxLFxcXCIgKyBpbnB1dC5zcGxpdChcXFwiXFxcXG5cXFwiKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2VuID0gZ2VuZyA9PSBcXFwi5ZGo5pu0XFxcIiA/IFxcXCJ6aHVpXFxcIiA6IFxcXCJyaVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgnbGV0IGFyciA9JyArIHJlYWRGaWxlKCdoaWtlcjovL2ZpbGVzL2NhY2hlL1pHWkwvJyArIGdlbiArICcuanMnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnVuc2hpZnQoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ3ZWVrXFxcIjogd2VlayxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInl1cmxcXFwiOiBcXFwiZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImdvbmdcXFwiKS5hZGRpdGlvbihuYW1lLCB3ZWVrLCBhcnIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ovpPlhaXmnInor69cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2E7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRpdGxlLCB1cCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcImNsc1966L+RXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoVGVybXM6IHRpdGxlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KTtcXG5cX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JFxcXCIgKyBleHRyYSkucmVwbGFjZSgvTVlfUlVMRS50aXRsZS9nLCBgJyR7cHJlUnVsZX0nYCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuiwg+eUqOaQnOe0olxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLlNvdSh0aXRsZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIueCueWHu+afpeeci1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAvYWxpKHBhbnx5dW58eXVuZHJpdmUpLy50ZXN0KHl1cmwpID8geXVybCArIFxcXCIjbm9SZWNvcmRIaXN0b3J5IyZydWxlPVxcXCIgKyBwcmVSdWxlIDogdXJsLnJlcGxhY2UoLztnZXQ7LywgXFxcIiNub1JlY29yZEhpc3RvcnkjO2dldDtcXFwiKS5yZXBsYWNlKC9NWV9SVUxFLnRpdGxlL2csIGAnJHtwcmVSdWxlfSdgKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBnZW5nID0gZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqaXMgPSBqaXN1Lm1hdGNoKC8oXFxcXGQrKSg/OumbhlxcXFxEKyhcXFxcZCsp6ZuGKT8vKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqaXNodSA9IGppcyA/IChcXFwiLFxcXCIgKyBqaXNbMV0pICsgKGppc1syXSA/IFxcXCIsXFxcIiArIGppc1syXSA6IFxcXCJcXFwiKSA6IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlucHUgPSB0aXRsZSArIGppc2h1ICsgXFxcIlxcXFxuXFxcIiArIChnZW5nID09IFxcXCLlkajmm7RcXFwiID8gZ2V0TXlWYXIoXFxcImxpXFxcIiwgJC5yZXF1aXJlKFxcXCJ6aG91XFxcIikuV2Vla0RheSgpKSArIFxcXCIsXFxcIiA6IFxcXCJcXFwiKSArIFxcXCIxXFxcIiArIFxcXCIsMTBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaW5wdSkuaW5wdXQoKHVybCwgeXVybCwgZXh0cmEsIHBpYywgcHJlUnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZW5nID0gZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBpbnB1dC5zcGxpdChcXFwiXFxcXG5cXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHdlZWsgPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gaW5wdXQuc3BsaXQoXFxcIlxcXFxuXFxcIilbMV0gOiBcXFwiMSxcXFwiICsgaW5wdXQuc3BsaXQoXFxcIlxcXFxuXFxcIilbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZW4gPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gXFxcInpodWlcXFwiIDogXFxcInJpXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgnbGV0IGFyciA9JyArIHJlYWRGaWxlKCdoaWtlcjovL2ZpbGVzL2NhY2hlL1pHWkwvJyArIGdlbiArICcuanMnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci51bnNoaWZ0KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ3ZWVrXFxcIjogd2VlayxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpbWdcXFwiOiBwaWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwieXVybFxcXCI6IC9hbGkocGFufHl1bnx5dW5kcml2ZSkvLnRlc3QoeXVybCkgPyB5dXJsLnJlcGxhY2UoLyNub1JlY29yZEhpc3RvcnkjO2dldDsvLCBcXFwiO2dldDtcXFwiKSArIFxcXCImcnVsZT1cXFwiICsgcHJlUnVsZSArIFxcXCImJCRcXFwiICsgZXh0cmEgOiAodXJsLnJlcGxhY2UoLyNub1JlY29yZEhpc3RvcnkjO2dldDsvLCBcXFwiO2dldDtcXFwiKSArIFxcXCIkJFxcXCIgKyBleHRyYSkucmVwbGFjZSgvTVlfUlVMRS50aXRsZS9nLCBgJyR7cHJlUnVsZX0nYClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJnb25nXFxcIikuYWRkaXRpb24obmFtZSwgd2VlaywgYXJyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ovpPlhaXmnInor69cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRvYTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCwgeXVybCwgZXh0cmEsIHBpYywgcHJlUnVsZSlcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9LCB0aXRsZSwgc3RhdHVzICE9IHVuZGVmaW5lZCA/IHN0YXR1cyA6IGNsaWNrLCB1cmwsIHBhci51cmwsIGV4dHJhLCBwaWNVcmwsIHByZVJ1bGUpLFxcbiAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHt9LCBzdG9yYWdlMC5nZXRNeVZhcihcXFwiZXh0cmFcXFwiKSwge1xcbiAgICAgICAgICAgICAgICBzZWFyY2hUZXJtczogdGl0bGUsXFxuICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzFfdmVydGljYWxfcGljXFxcIlxcbiAgICAgICAgfSlcXG4gICAgfTtcXG59O1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5L+u5pS5XCIsXCJwYXRoXCI6XCJ4aXVcIixcInJ1bGVcIjpcIi8v5pCc57SiXFxuJC5leHBvcnRzLlNvdSA9ICh0aXQxKSA9PiB7XFxuICAgIHJldHVybiAkKFtcXFwi5LqR566AXFxcIiwgXFxcIumjjuW9sVxcXCIsIFxcXCLogZrlvbFcXFwiLCBcXFwi6IGa6ZiFXFxcIiwgXFxcIummmeW9sVxcXCJdLCAyKS5zZWxlY3QoKHRpdDEpID0+IHtcXG4gICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5LqR566AXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3NvdSNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSM/cnVsZT3kupHnm5jlkJsu566AXFxcIjtcXG4gICAgICAgIH0gZWxzZVxcbiAgICAgICAgaWYgKGlucHV0ID09IFxcXCLpo47lvbFcXFwiKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZGVsZXRlKGNvbmZpZy7kvp3otZYpO1xcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vaG9tZUDpo47lvbFcXFwiKSkucHJlUnVsZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aXQxICsgJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKGNvbmZpZy7kvp3otZYpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNvdXJsKClcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5pyq5qOA5rWL5Yiw6aOO5b2x5bCP56iL5bqP77yM56Gu6K6k5a+85YWl77yfXFxcIikuY29uZmlybSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VQYXN0ZShcXFwi5LqRNm9vb29sZS94eHh4eHgvZXZ0aTl2bW9lazRiYWptdFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSBlbHNlXFxuICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuiBmuW9sVxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vc2VhcmNoP3M9XFxcIiArIHRpdDEgKyBcXFwiJnJ1bGU96IGa5b2x4oiaXFxcIjtcXG4gICAgICAgIH0gZWxzZVxcbiAgICAgICAgaWYgKGlucHV0ID09IFxcXCLogZrpmIVcXFwiKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZGVsZXRlKGNvbmZpZy7kvp3otZYpO1xcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vaG9tZUDogZrpmIXiiJpcXFwiKSkucHJlUnVsZSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJTcmNKdV9zb3VzdW9OYW1lXFxcIiwgdGl0MSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vUmVmcmVzaCMjb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QgPSBbXTtcXG4gICAgZm9yIChsZXQgaSBpbiBsaXN0KSB7XFxuICAgICAgICBsZXQgcGljID0gcGRmaChsaXN0W2ldLCBcXFwiaW1nJiZzcmNcXFwiKTtcXG4gICAgICAgIExpc3QucHVzaCh7XFxuICAgICAgICAgICAgcGljOiBwaWMsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwaWMsIHRpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgZ2VuZyA9IGdldEl0ZW0oXFxcInpodWlnZW5cXFwiLCBcXFwi5ZGo5pu0XFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBnZW4gPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gXFxcInpodWlcXFwiIDogXFxcInJpXFxcIjtcXG4gICAgICAgICAgICAgICAgZXZhbCgnbGV0IGFyciA9JyArIHJlYWRGaWxlKCdoaWtlcjovL2ZpbGVzL2NhY2hlL1pHWkwvJyArIGdlbiArICcuanMnKSk7XFxuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgb2JqID0gYXJyW2ldO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9iai5uYW1lID09PSB0aXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnJbaV0gPSBPYmplY3QuYXNzaWduKHt9LCBvYmosIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwaWNcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhhcnIpO1xcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS9aR1pMLycgKyBnZW4gKyAnLmpzJywgSlNPTi5zdHJpbmdpZnkoYXJyKSk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3N3aXRjaCcpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7miJDlip/vvIFcXFwiXFxuICAgICAgICAgICAgfSwgcGljLCB0aXQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicGljXzJfY2FyZFxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiBcXFwiY2xzX2Ztc2NcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH07XFxuICAgIExpc3QucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIueCueWHu+S4iuaWueWbvueJh+abtOaNouWwgemdolxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGNsczogXFxcImNsc19mbXNjXFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZGVsZXRlSXRlbUJ5Q2xzKFxcXCJjbHNfZm1zY1xcXCIpO1xcbiAgICBhZGRJdGVtQWZ0ZXIoXFxcImlkX2ZteHpcXFwiICsgaSwgTGlzdCk7XFxufTtcXG5cXG4vL+enu+WKqFxcbiQuZXhwb3J0cy5ZaWRvbmcgPSAodGl0LCB3ZWspID0+IHtcXG4gICAgcmV0dXJuICQoXFxcIlxcXCIpLmlucHV0KCh0aXQsIHdlaykgPT4ge1xcbiAgICAgICAgaWYgKCEvXlsxLTldXFxcXGQqJC8udGVzdChpbnB1dCkpIHJldHVybiBcXFwidG9hc3Q6Ly/pnIDovpPlhaXkuI3kuLow55qE5pWw5a2XXFxcIjtcXG4gICAgICAgIGxldCBnZW5nID0gZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgIGxldCBnZW4gPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gXFxcInpodWlcXFwiIDogXFxcInJpXFxcIjtcXG4gICAgICAgIGV2YWwoJ2xldCBhcnIgPScgKyByZWFkRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS9aR1pMLycgKyBnZW4gKyAnLmpzJykpO1xcbiAgICAgICAgLy8g6K6h566X5Lul5ZGo5pWw5byA5aS055qE5YWD57Sg5pWw6YePXFxuICAgICAgICBsZXQgY291biA9IGFyci5maWx0ZXIoaXRlbSA9PiBpdGVtLndlZWsuc3RhcnRzV2l0aCh3ZWsuc3BsaXQoXFxcIixcXFwiKVswXSkpLmxlbmd0aDtcXG4gICAgICAgIGlucHV0ID0gcGFyc2VJbnQoaW5wdXQpID4gcGFyc2VJbnQoY291bikgPyBwYXJzZUludChjb3VuKSAtIDEgOiBwYXJzZUludChpbnB1dCkgLSAxO1xcblxcbiAgICAgICAgbGV0IHRhcmdldCA9IGFyci5maW5kKGl0ZW0gPT4gaXRlbS5uYW1lID09IHRpdCk7XFxuICAgICAgICBsZXQgdGFyZ2V0SW5kZXggPSAtMTtcXG4gICAgICAgIGxldCBjb3VudCA9IDA7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGlmIChhcnJbaV0ud2VlayA9PSB3ZWspIHtcXG4gICAgICAgICAgICAgICAgaWYgKGNvdW50ID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICB0YXJnZXRJbmRleCA9IGk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjb3VudCsrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH07XFxu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tcXG4gICAgICAgICAgICB2YWx1ZTogMTAwMDAsXFxuICAgICAgICAgICAgc2VjVW5pdDogdHJ1ZVxcbiAgICAgICAgfSxcXG4gICAgICAgIOS6vzoge1xcbiAgICAgICAgICAgIHZhbHVlOiAxMDAwMDAwMDAsXFxuICAgICAgICAgICAgc2VjVW5pdDogdHJ1ZVxcbiAgICAgICAgfVxcbiAgICB9O1xcblxcbiAgICBmdW5jdGlvbiBDaGluZXNlVG9OdW1iZXIoY2huU3RyKSB7XFxuICAgICAgICB2YXIgcnRuID0gMDtcXG4gICAgICAgIHZhciBzZWN0aW9uID0gMDtcXG4gICAgICAgIHZhciBudW1iZXIgPSAwO1xcbiAgICAgICAgdmFyIHNlY1VuaXQgPSBmYWxzZTtcXG4gICAgICAgIHZhciBzdHIgPSBjaG5TdHIuc3BsaXQoJycpO1xcblxcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICB2YXIgbnVtID0gY2huTnVtQ2hhcltzdHJbaV1dO1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbnVtICE9PSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgICAgICBudW1iZXIgPSBudW07XFxuICAgICAgICAgICAgICAgIGlmIChpID09PSBzdHIubGVuZ3RoIC0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgc2VjdGlvbiArPSBudW1iZXI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdW5pdCA9IGNobk5hbWVWYWx1ZVtzdHJbaV1dLnZhbHVlO1xcbiAgICAgICAgICAgICAgICBzZWNVbml0ID0gY2huTmFtZVZhbHVlW3N0cltpXV0uc2VjVW5pdDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5re75Yqg5Lul5LiL5Luj56CB5p2l5aSE55CG5Y2V5Liq5Y2V5L2N5a2X56ym55qE5oOF5Ya1XFxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDAgJiYgIXNlY1VuaXQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHNlY3Rpb24gPSB1bml0O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgc2VjdGlvbiArPSAobnVtYmVyICogdW5pdCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc2VjVW5pdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ0biArPSBzZWN0aW9uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlY3Rpb24gPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIG51bWJlciA9IDA7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHJ0biArIHNlY3Rpb247XFxuICAgIH07XFxuXFxuICAgIGZ1bmN0aW9uIHN0cihzdHIpIHtcXG4gICAgICAgIHJldHVybiBzdHIucmVwbGFjZSgvW14oXFxcXHU0ZTAwLVxcXFx1OWZhNSl8W2EtekEtWjAtOV0vZywgJycpO1xcbiAgICB9O1xcblxcbiAgICBsZXQgcm5hbWUgPSBSZWdFeHAoc3RyKE5hbWUpKTtcXG4gICAgbGV0IGNsaWNrID0gL+esrChcXFxcRCspKD866K+dfOWbnnzpm4Z85pyffOWNt3znq6ApLztcXG4gICAgdmFyIG1heE51bWJlcnMgPSBbXTtcXG4gICAgZm9yIChsZXQgbGkgb2YganNvbikge1xcbiAgICAgICAgbGV0IHRpdGxlID0gIWxpLm1UaXRsZSA/IGxpLnRpdGxlIDogbGkubVRpdGxlO1xcbiAgICAgICAgaWYgKHR5cGVvZiBsaS5sYXN0Q2xpY2sgIT0gJ3VuZGVmaW5lZCcgJiYgIS8oXFxcXGQrKS0oXFxcXGQrKembhi8udGVzdChsaS5sYXN0Q2xpY2spKSB7XFxuICAgICAgICAgICAgbGV0IGxpbGFzdCA9IGxpLmxhc3RDbGljay5yZXBsYWNlKC9AQC4qLywgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIGlmIChybmFtZS50ZXN0KHN0cih0aXRsZSkpIHx8IHJuYW1lLnRlc3Qoc3RyKGxpbGFzdCkpKSB7XFxuICAgICAgICAgICAgICAgIC8vbG9nKGxpbGFzdCk7XFxuICAgICAgICAgICAgICAgIGxldCBudW1iZXJzO1xcbiAgICAgICAgICAgICAgICBpZiAoY2xpY2sudGVzdChsaWxhc3QpKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGFzdCA9IGxpbGFzdC5tYXRjaChjbGljaylbMV07XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIS/ljYF855m+fOWNg3zkuIcvLnRlc3QobGFzdCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhc3QubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRpZ2l0ID0gY2huTnVtQ2hhcltsYXN0W2ldXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpZ2l0ICE9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdCAqIDEwICsgZGlnaXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBudW1iZXJzID0gW1N0cmluZyhyZXN1bHQpXTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVycyA9IFtTdHJpbmcoQ2hpbmVzZVRvTnVtYmVyKGxhc3QpKV07XFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGppO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9TRVxcXFxkK1xcXFwuXFxcXGQrLy50ZXN0KGxpbGFzdCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqaSA9IGxpbGFzdC5tYXRjaCgvU0VcXFxcZCtcXFxcLihcXFxcZCspLylbMV07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGppID0gbGlsYXN0Lm1hdGNoKC9cXFxcWyg/IVxcXFxkezR9fFxcXFxEfFxcXFxkK1thLXpBLVpdK1xcXFxkKilcXFxcZCtcXFxcXXwoPzp8XylcXFxcZCsoPz1ffFxcXFwuKXw+Lio/KFxcXFxkKykuKj88fChcXFxcZCspXFxcXC5cXFxcdyt8KFxcXFxkKykoPzrpm4Z86K+dfOWbnnzmnJ985Y23fOeroCl8Xig/IVxcXFxkKy1cXFxcZCspXFxcXEQqXFxcXGQrXFxcXHMrfF4oXFxcXGQrKSQvKTtcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICBsZXQgamlsdSA9IGppICE9IG51bGwgPyBKU09OLnN0cmluZ2lmeShqaSkgOiBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhqaWx1KTtcXG4gICAgICAgICAgICAgICAgICAgIG51bWJlcnMgPSBqaWx1LnJlcGxhY2UoLyhcXFxcZCspXFxcXC4uKi8sIFxcXCIkMVxcXCIpLm1hdGNoKC9cXFxcZCsvZyk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIC8vbG9nKG51bWJlcnMpO1xcbiAgICAgICAgICAgICAgICBtYXhOdW1iZXJzLnB1c2gobnVtYmVyc1swXSk7XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgIH07XFxuICAgIH07XFxuICAgIGxldCBtYXhOdW1iZXIgPSBNYXRoLm1heC5hcHBseShudWxsLCBtYXhOdW1iZXJzKTtcXG4gICAgLy9sb2cobWF4TnVtYmVyKTtcXG4gICAgbGV0IE51bWJlciA9IEpTT04uc3RyaW5naWZ5KG1heE51bWJlcik7XFxuICAgIHJldHVybiBOdW1iZXIgIT0gXFxcIm51bGxcXFwiICYmIE51bWJlciAhPSBcXFwiMFxcXCIgPyBtYXhOdW1iZXIgOiBcXFwi5peg6K6w5b2VXFxcIjtcXG59O1wifV0iLCJpY29uIjoiaHR0cHM6Ly9pbWcuc2hvdWppLmNvbS5jbi9zaW1nLzIwMTgxMDEyLzIwMTgxMDEyMDIxOTExMDEucG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment