Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥「宅男女神」@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuW3peWFt1wiLFwicGF0aFwiOlwidXRpbGl5XCIsXCJydWxlXCI6XCJqczpcXG5sZXQgaG9zdCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3NcXFwiO1xcbi8vbGV0IGhvc3QgPSBcXFwiaHR0cDovLzE5Mi4xNjguMzEuNDk6ODA3OVxcXCI7XFxubGV0IGhvbWUgPSBiYXNlNjREZWNvZGUoXFxcImFHbHJaWEk2THk5b2IyMWxcXFwiKTtcXG52YXIgYXBpID0ge1xcbiAgICBob3N0OiBob3N0K1xcXCIvaGlrZXJ1bGVcXFwiLFxcbiAgICBub3RpY2VVcmw6XFxcIi9ub3RpY2UvZ2V0XFxcIiwvL+iOt+WPluS7k+W6k+WFrOWRilxcbiAgICB1c2Vyc1VybDogXFxcIi9kZXYvdXNlcnM/b3JkZXI9XFxcIiwgLy/nlKjmiLfliJfooahcXG4gICAgcnVsZUNvdW50VXJsOiBcXFwiL2Rldi9ydWxlY291bnRcXFwiLCAvL+iOt+WPluinhOWImeaVsOmHj1xcbiAgICBydWxlc1VybDogXFx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dG9yMSA9IFxcXCItXFxcIjtcXG4gICAgICAgICAgICBsZXQgc2VwZXJhdG9yMiA9IFxcXCI6XFxcIjtcXG4gICAgICAgICAgICBsZXQgbW9udGggPSBkYXRlLmdldE1vbnRoKCkgKyAxO1xcbiAgICAgICAgICAgIGxldCBzdHJEYXRlID0gZGF0ZS5nZXREYXRlKCk7XFxuICAgICAgICAgICAgbGV0IHN0ckhvdXJzID0gZGF0ZS5nZXRIb3VycygpO1xcbiAgICAgICAgICAgIGxldCBzdHJNaW51dGVzID0gZGF0ZS5nZXRNaW51dGVzKCk7XFxuICAgICAgICAgICAgbGV0IHN0clNlY29uZHMgPSBkYXRlLmdldFNlY29uZHMoKSsxO1xcbiAgICAgICAgICAgIGlmIChtb250aCA+PSAxICYmIG1vbnRoIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgbW9udGggPSBcXFwiMFxcXCIgKyBtb250aFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyRGF0ZSA+PSAwICYmIHN0ckRhdGUgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJEYXRlID0gXFxcIjBcXFwiICsgc3RyRGF0ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RySG91cnMgPj0gMCAmJiBzdHJIb3VycyA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckhvdXJzID0gXFxcIjBcXFwiICsgc3RySG91cnNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0ck1pbnV0ZXMgPj0gMCAmJiBzdHJNaW51dGVzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyTWludXRlcyA9IFxcXCIwXFxcIiArIHN0ck1pbnV0ZXNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0clNlY29uZHMgPj0gMCAmJiBzdHJTZWNvbmRzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyU2Vjb25kcyA9IFxcXCIw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gICAgIHVybDogJCgpLmxhenlSdWxlKChkYXRhSXRlbSxzdWJVcmwpPT57XFxuICAgICAgICAgICAgICAgIC8vIGxldCB0aXRsZSA9IFxcXCJILVxcXCIrZGF0YUl0ZW0ubmFtZStcXFwiLlxcXCIrZGF0YUl0ZW0uYXV0aG9yO1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBcXFwiSi1cXFwiK2RhdGFJdGVtLm5hbWUuc3BsaXQoJy4nKVswXTtcXG4gICAgICAgICAgICAgICAgbGV0IHN1Yk9iaiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc3ViVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvXFxcIit0aXRsZStcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBhY3RpdmU6IGZhbHNlLC8v56aB55So5bm25Y+R5pu05pawXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHNoYXJlVGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShzdWJPYmopKTtcXG4gICAgICAgICAgICAgICAgdmFyIHBhc3RlcyA9IGdldFBhc3RlcygpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShzaGFyZVRleHQscGFzdGVzLnNsaWNlKC0xKVswXSk7XFxuICAgICAgICAgICAgICAgIGxldCBpbXBvcnRfcnVsZT0gXFxcIui9u+WQiOmbhuiuoumYhe+8mlxcXCIrdGl0bGUrJ1xcXFxuJyt1cmw7XFxuICAgICAgICAgICAgICAgIGNvcHkoaW1wb3J0X3J1bGUpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gJ2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvc3ViLmpzb24nO1xcbiAgICAgICAgICAgICAgICAkLnJjKGNvbmZpZy5saWIuc3ViKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIOiuoumYheWvvOWFpShwYXRoKVxcbiAgICAgICAgICAgIH0sZGF0YUl0ZW0sc3ViVXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbmlmIChydWxlQ29kZSkge1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLliIbkuqvop4TliJlcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiY29weTovL1xcXCIgKyBydWxlQ29kZSxcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICB9KTtcXG59XFxuXFxuZnVuY3Rpb24gc2V0U2V0dGluZ0l0ZW0oYmFzaWMsIHBhdHRlcm4pIHtcXG4gICAgbGV0IHRlbXAgPSB7XFxuICAgICAgICB0aXRsZTogYmFzaWMudGl0bGUsXFxuICAgICAgICBjb2xfdHlwZTogYmFzaWMuY29sX3R5cGUsXFxuICAgICAgICB1cmw6ICQoYmFzaWMuY29uZmlybSkuY29uZmlybSgodXJsLCBtc2csIHBhdHRlcm4pID0+IHtcXG4gICAgICAgICAgICBsZXQgYmFja0EgPSByZXF1ZXN0KHVybCk7XFxuICAgICAgICAgICAgbGV0IHJldCA9IEpTT04ucGFyc2UoYmFja0EpO1xcbiAgICAgICAgICAgIGlmIChyZXQuc3RhdHVzID09IDApIHtcXG4gICAgICAgICAgICAgICAgcGF0dGVybiA/IGJhY2soKSA6IHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyBtc2dbMF07XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgIC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YWNrKTtcXG4gICAgICAgICAgICBpZiAocmV0LnN0YXR1cyA9PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sueUn+aIkOmaj+acuuWvhueggVxcXFxuXFxcIiArIHJldC5yZXN1bHRcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+maj+acuuWvhueggeeUn+aIkOWksei0pVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9KTtcXG4gICAgbGV0IHRpbWVPdmVyID0ge1xcbiAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlXFxuICAgIH07XFxuICAgIGlmIChkYXRhSXRlbS50aW1lX292ZXIpIHtcXG4gICAgICAgIHRpbWVPdmVyLnRpdGxlID0gc21hbGwoY29sb3IoXFxcIuefreaXtuWvhumSpVxcXCIsIFxcXCJncmVlblxcXCIpICsgY29sb3IoXFxcIijihpLmsLjkuYUpXFxcIiwgXFxcInJlZFxcXCIpKTtcXG4gICAgICAgIHRpbWVPdmVyLnVybCA9IGdldEFwaShcXFwidGltZW92ZXJcXFwiKSArIHJlcUJ5R2V0ICsgXFxcIiZmbGFnPTFcXFwiO1xcbiAgICAgICAgdGltZU92ZXIuY29uZmlybSA9IFxcXCLmmK/lkKbnoa7orqTku6XlkI7nmoTnp4Hol4/op4TliJnliIbkuqvkuI3ov4fmnJ8/XFxcIjtcXG4gICAgICAgIHRpbWVPdmVyLm1zZyA9IFtcXFwi5bey6K6+5Li65rC45LmFXFxcIiwgXFxcIuiuvuS4uuawuOS5heWksei0pVxcXCJdO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgdGltZU92ZXIudGl0bGUgPSBzbWFsbChjb2xvcihcXFwi5r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4jXFxcIiArIGl0ZW0uaWQgKyBcXFwiPC9zbWFsbD48Zm9udD5cXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvUmVwbHlcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICAgICAgcnVsZUlkOiBkYXRhSXRlbS5pZCxcXG4gICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBwYXNzd29yZDogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgIHVzZXJuYW1lOiB1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgcmVwbHlJZDppdGVtLmlkXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5kaXNjdXNzX3RleHQsXFxuICAgICAgICAgICAgZGVzYzogUmVwbHkraXRlbS5jcmVhdGVfZGF0ZSArIFxcXCLCt1xcXCIgKyBpY29uW2l0ZW0uZGlzY3Vzc190eXBlXSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2luZm9cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgdHlwZTogXFxcImxvbmdfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgIHRleHQ6IGl0ZW0uZGlzY3Vzc190ZXh0XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xc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G4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUFcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjYW5fdXBsb2FkXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+aq+emgeatouS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKCfnpoHmraLor6XlvIDlj5HogIXkuIrkvKDop4TliJk/5L2g55q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GF0YUl0ZW0uaWQ7XFxuLy8gZGF0YUl0ZW0uaXNfc2FmZTtcXG5pZihnZXRWYXIoJ2hvdXNlLmlzX21hbmFnZXInKSl7XFxuICAgIGZ1bmN0aW9uIHNldElzU2FmZShmbGFnLG1hbl9ydWxlX3NhZmUpIHtcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgY29kZSA9IGZldGNoKG1hbl9ydWxlX3NhZmUsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlzX3NhZmVcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZnVuY3Rpb24gc2V0SXNHb29kKGZsYWcsbWFuX3J1bGVfZ29vZCkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfZ29vZCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfZ29vZFxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/Cfmqvpo47pmaknLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumjjumZqT/po47pmanop4TliJnml6Dms5Xooqvlr7zlhaUnKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKGZhbHNlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pyF5q2j5bi4JyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrmraPluLg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfc2FmZSxzZXRJc1NhZmUpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzU2FmZSh0cnVlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pml6Z2e5LyY6LSoJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrpnZ7kvJjotKg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzR29vZChmYWxzZSxtYW5fcnVsZV9nb29kKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytyZXRcXG4gICAgICAgIH0sZGF0YUl0ZW0uaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpXFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/CfkpbkvJjotKgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNHb29kKHRydWUsbWFuX3J1bGVfZ29vZCk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV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mmLXnp7DkuI3og73kuLrnqbpcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcIuato+WcqOaPkOS6pOeUs+ivt+ihqFxcXCIpO1xcbiAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJyZWFzb25cXFwiOiBkZXNjcmlwdGlvbixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ3Bvc3QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgaWRyZXN1bHQgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0SWQgKyBcXFwiP3FxPVxcXCIgKyB1c2VybmFtZSkpO1xcbiAgICAgICAgaWYgKGlkcmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgaWRyZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpemCrueusemqjOivgeeggVxcXFxuXFxcIiArIHJlc3VsdC5kZXRhaWwpLmlucHV0KChjb25maXJtLCBpZCwgYWNjb3VudCkgPT4ge1xcbiAgICAgICAgICAgIHNob3dMb2FkaW5nKFxcXCLor7fogJDlv4PnrYnlvoVcXFwiKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChjb25maXJtLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVnaXN0X2lkXFxcIjogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ5em1cXFwiOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VVc2VybmFtZVxcXCIsIGFjY291bnRbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VQYXNzd29yZFxcXCIsIGFjY291bnRbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/miJDlip/mj5DkuqTms6jlhozms6jlhoxcXFxcblxcXCIrcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WHuumUmeS6huWRkFxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgY29uZmlybSwgaWRyZXN1bHQucmVzdWx0LCBbdXNlcm5hbWUsIHBhc3N3b3JkXSk7XFxuICAgIH0sIGdldEFwaShcXFwibmV3X2dldElkXFxcIiksIGdldEFwaShcXFwibmV3X2NvbmZpcm1cXFwiKSksXFxuICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG59KTtcXG5zZXRSZXN1bHQoZGF0YSk7XCJ9LHtcImNvbF90eXBlXCI6XCJ0ZXh0XzFcIixcIm5hbWVcIjpcIuS4quS6uui1hOaWmVwiLFwicGF0aFwiOlwiUGVyc29uYWxEYXRhXCIsXCJydWxlXCI6XCJqczpcXG5zZXRQYWdlVGl0bGUoXFxcIuS4quS6uui1hOaWm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WUgPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnBldE5hbWUnLCAnJyk7XFxuICAgICAgICAgICAgaWYgKG5ld1BldE5hbWUgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWhq+WViiFcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCArIFxcXCImbmFtZT1cXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KG5ld1BldE5hbWUpKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgIH0pO1xcbn1cXG5cXG5mdW5jdGlvbiBtX2F2YXRhcigpIHtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXmlrDnmoTlpLTlg4/pk77mjqVcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICA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XG5cXG5mdW5jdGlvbiBtX3B3ZCgpIHtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTpcXFwi5Y6f5a+G56CBXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeWOn+WvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQueScsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm0uUGFzc3dvcmQueVxcXCIsaW5wdXQpJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTpcXFwi5paw5a+G56CBXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeaWsOWvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQueCcsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm0uUGFzc3dvcmQueFxcXCIsaW5wdXQpJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZ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yZCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Y6f5a+G56CB6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYobmV3X3Bhc3N3b3JkPT09XFxcIlxcXCIpe1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K+36L6T5YWl5paw5a+G56CBXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYobmV3X3Bhc3N3b3JkIT09bmV3X3Bhc3N3b3JkX2FnYWluKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4pOasoeWvhueggeS4jeWQjFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJm5ld19wYXNzd29yZD1cXFwiICsgbmV3X3Bhc3N3b3JkK1xcXCImbmV3X3Bhc3N3b3JkX3JlPVxcXCIrbmV3X3Bhc3N3b3JkX2FnYWluKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXCIsSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXNlcm5hbWU6dXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDpuZXdfcGFzc3dvcmRcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICA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iAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJub3RlXFxcIjpub3Rlc1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgfSwgdXNlcm5hbWUsIHBhc3N3b3JkKVxcbn0pO1xcbnNldFJlc3VsdChkYXRhKTtcIn0se1wiY29sX3R5cGVcIjpcImxpbmVcIixcIm5hbWVcIjpcIuivhOiuuuWIl+ihqFwiLFwicGF0aFwiOlwiQ29tbWVudFwiLFwicnVsZVwiOlwianM6XFxuc2V0UGFnZVRpdGxlKFxcXCLor4TorrrliJfooahcXFwiKTtcXG5jb25zdCB7XFxuICAgIGFwaVxcbn0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlsaXlcXFwiKTtcXG5sZXQgZGF0YSA9IFtdO1xcbmxldCB7XFxuICAgIHRvdGFsU3VtLFxcbiAgICBpZCxcXG4gICAgbm9fYWN0aXZlLFxcbiAgICB1c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sO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOlxcXCJ0ZXh0XzJcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6XFxcIuWIoOmZpOivhOiuulxcXCIsXFxuICAgICAgICAgICAgdXJsOiQoXFxcIuehruiupOWIoOmZpOivpeivhOiuuj9cXFwiKS5jb25maXJtKChpbnB1dCk9PntcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdD1KU09OLnBhcnNlKHJlcXVlc3QoaW5wdXQpKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiK3Jlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfSxhcGkuZGlzX2Rldl9jb250cm9sK3BpZCtcXFwiP3FxPVxcXCIgKyB1c2VybmFtZSArIFxcXCImcGFzc3dvcmQ9XFxcIiArIHBhc3N3b3JkK1xcXCImZGVsZXRlPTFcXFwiKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTpcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOlxcXCJsaW5lXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOlxcXCJsaW5lXFxcIlxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuaWYgKHRvdGFsU3VtID09PSAwKSB7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIjxoNSBzdHlsZT0ndGV4dC1hbGlnbjpjZW50ZXInPuS4gOadoeivhOiuuuS5n+ayoeacie+8jOW/q+adpeaKouaymeWPkeWQp++8gTwvaDU+XFxcIixcXG4gICAgICAgIGNvbF90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HlwZT13cGEmdWluPVxcXCIraXRlbS5xcSxcXG4gICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgIHJ1bGVJZDogaWQsXFxuICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgcGFzc3dvcmQ6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICB1c2VybmFtZTogdXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgIHJlcGx5SWQ6aXRlbS5pZFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZGlzY3Vzc190ZXh0LFxcbiAgICAgICAgICAgIGRlc2M6IFJlcGx5K2l0ZW0uY3JlYXRlX2RhdGUgKyBcXFwiwrdcXFwiICsgaWNvbltpdGVtLmRpc2N1c3NfdHlwZV0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9pbmZvXFxcIixcXG4gICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgIG5hbWU6aXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICB0eXBlOlxcXCJsb25nX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICB0ZXh0Oml0ZW0uZGlzY3Vzc190ZXh0XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgY29udHJvbChpdGVtLmlkLGl0ZW0uYWN0aXZlKTtcXG4gICAgfVxcbiAgICBpZiAoY29tbWVudExpc3QubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICA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XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGZ1bmN0aW9uIHIocCkge1xcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkocCksXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcCA9IHtcXG4gICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc190ZXh0XFxcIjogdGV4dCxcXG4gICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXEsXFxuICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX3R5cGVcXFwiOiB0eXBlLFxcbiAgICAgICAgICAgICAgICBcXFwiYXV0aF9jb2RlXFxcIjogYXV0aF9jb2RlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHJlc3VsdCA9IHIocCk7XFxuICAgICAgICBpZihyZXN1bHQuc3RhdHVzPT09MCl7XFxuICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIityZXN1bHQuZGV0YWlsO1xcblxcbiAgICB9LHVzZXIpXFxufSk7XFxuXFxuc2V0UmVzdWx0KGRhdGEpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Lyq55So5oi35rOo5YaMXCIsXCJwYXRoXCI6XC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xcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHloavllYohXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXCLojrflj5bkuK0uLi5cXFwiKVxcbiAgICAgICAgcmV0dXJuICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHFxLCBhLCBiKSA9PiB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGEsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQyID0gSlNPTi5wYXJzZShyZXF1ZXN0KGIgKyBcXFwiP3FxPVxcXCIgKyBxcSkpO1xcbiAgICAgIC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mJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsyLjxzPumqjOivgeeggeacieaViOacn+aMgee7reS4gOWRqOW3puWPszwvcz4o5pqC5pe25LiN5Lya77yM5b+Y6K6w6aqM6K+B56CB5Y+v6YCa6L+HUVHlj7fojrflj5YpPC9zbWFsbD5cXFwiXFxufSk7XFxuXFxubGV0IHVzZXJMaXN0ID0gZ2V0VXNlckRhdGUoKTtcXG5kYXRhLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIumqjOivgS/nmbvlvZVcXFwiLFxcbiAgICB1cmw6ICQoXFxcIuehruWumuS/neWtmO+8jOmqjOivgeeggeWhq+mUme+8jOaXoOazleivhOiuuuWTplxcXCIpLmNvbmZpcm0oKGYsIGwsIGxvZ2luKSA9PiB7XFxuICAgICAgICBsZXQgcXEgPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnFxJywgJycpO1xcbiAgICAgICAgbGV0IHl6bSA9IGdldFZhcignV2FyZWhvdXNlLm0ueXptJywgJycpO1xcbiAgICAgICAgaWYgKHFxID09IFxcXCJcXFwiIHx8IHl6bSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9xceaIlumqjOivgeeggeS4uuepulxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChsb2dpbiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXEsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYXV0aF9jb2RlXFxcIjogeXptXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICBmLnVzZXIgPSBbcXEsIHl6bV07XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGYpKTtcXG4gICAgICAgICAgICBsZXQgaW5kZXggPSBsLmZpbmRJbmRleChpdGVtID0+IGl0ZW1bMF0gPT09IHFxKTtcXG4gICAgICAgICAgICBpZiAoaW5kZXggPiAtMSkge1xcbiAgICAgICAgICAgICAgICBsLnNwbGljZShpbmRleCwgMSwgW3FxLCB5em1dKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGwubGVuZ3RoIDwgNikge1xcbiAgICAgICAgICAgICAgICBsLnB1c2goW3FxLCB5em1dKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsLnNwbGljZSgwLCAxKTtcXG4gICAgICAgICAgICAgICAgbC5wdXNoKFtxcSwgeXptXSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9XYXJlaG91c2VVU0VSQS5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobCkpO1xcbiAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6aqM6K+B5oiQ5YqfXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG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FwiLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICB1cmw6ICQoYXBpLmRpc19yZXBseSArIHJ1bGVJZCkubGF6eVJ1bGUoKHBhc3N3b3JkLCB1c2VybmFtZSwgcnVsZUlkKSA9PiB7XFxuICAgICAgICBsZXQgdGV4dCA9IGdldFZhcignV2FyZWhvdXNlLmNvbW1lbnQudGV4dCcsICcnKTtcXG4gICAgICAgIGlmIChwYXNzd29yZCA9PSBcXFwiXFxcIiB8fCB1c2VybmFtZSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mnKrnmbvlvZXotKblj7dcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHRleHQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L2g6L+Y5LuA5LmI6YO95rKh5YaZ5ZWKXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc190ZXh0XFxcIjogdGV4dCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc19pZFxcXCI6IHJ1bGVJZFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgIC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XB0LCAqLyo7IHE9MC4wMScsXFxuICAgICAgICAgICAgICAgICdBY2NlcHQtTGFuZ3VhZ2UnOid6aC1DTicsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZih3ZWJfdXJsX2Fyci5sZW5ndGg+PTMmJndlYl91cmxfYXJyWzJdLmxlbmd0aD4yKXsgLy/orr7nva7nvJbnoIFcXG4gICAgICAgICAgICAgICAgaGVhZGVyc1snY29udGVudC10eXBlJ10gPSAnY2hhcnNldD0nK3dlYl91cmxfYXJyWzJdLnRvVXBwZXJDYXNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7aGVhZGVyczpoZWFkZXJzLHdpdGhIZWFkZXJzOmZhbHNlLHJlZGlyZWN0OmZhbHNlfTtcXG4gICAgICAgICAgICBpZih3ZWJfdXJsX2Fyci5sZW5ndGg+PTImJndlYl91cmxfYXJyWzFdLmxlbmd0aD4yKXsgLy8g6K6+572u6K+35rGC5pa55rOVXFxuICAgICAgICAgICAgICAgIHBhcmFtc1snbWV0aG9kJ10gPSB3ZWJfdXJsX2FyclsxXS50b1VwcGVyQ2FzZSgpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsb2coJ+W8gOWni+iOt+WPlua6kOeggScpO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgICAgIHJlcXVlc3RBc3luYyh3ZWJfdXJsLHBhcmFtcyxmdW5jdGlvbiAoa2V5LGNvZGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBjb2RlO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bliLDnqbrmlofmnKzvvIznlpHkvLzkvaDmsqHmnInmraTmlofku7YhJztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICovXFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBnZXRJdGVtKCdob3VzZS5maWxlX3VhJyk9PT0n55S16ISRJz9mZXRjaCh3ZWJfdXJsLHBhcmFtcyk6cmVxdWVzdCh3ZWJfdXJsLHBhcmFtcyk7XFxuICAgICAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApe1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPluWIsOepuuaWh+acrO+8jOeWkeS8vOS9oOayoeacieatpOaWh+S7tiEnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvY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xcXCIsXFxuICAgIHVybDokKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpPT57XFxuICAgICAgICAvKlxcbiAgICAgICAgbGV0IGZwID0gJ2h0dHBzOi8vZ2l0Y29kZS5uZXQvcXFfMzIzOTQzNTEvZHIvLS9yYXcvbWFzdGVyL2pzL2ZpbGVTZWxlY3QuanMnO1xcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKGZwKTtcXG4gICAgICAgICovXFxuICAgICAgICBsZXQgZnA9Y29uZmlnLmxpYi5maWxlU2VsZWN0O1xcbiAgICAgICAgbGV0IGY9JC5yYyhmcCk7XFxuICAgICAgICByZXR1cm4gZi5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShcXFwiZmlsZVBhdGhcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShcXFwiZmlsZVBhdGhcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih0YXJnZXQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLndlYl91cmwnLFBBVEgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBvbkNsaWNrVHlwZTonY29uZmlybScsXFxuICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIuanN8LnR4dHwuaGlrZXJ8Lmpzb258Lmh0bWxcXFwiLFxcbiAgICAgICAgICAgIHBhdHRlcm46IDAsXFxuICAgICAgICAgICAgcmVxdWlyZVVybDpmcCxcXG4gICAgIC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ZSc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ+OAjCcpWzFdLnNwbGl0KCfjgI0nKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3NpbmdsZSc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ+OAjCcpWzFdLnNwbGl0KCfjgI0nKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdqc191cmwnOlxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfvv6UnKVsyXS5zcGxpdCgnQCcpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOe9kemhtemTvuaOpeaXoOWGheWuuSEnO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHVhID0gZ2V0SXRlbSgnaG91c2UuZmlsZV91YScpPT09J+eUteiEkSc/J01vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS84OC4wLjQzMjQuMTQ2IFNhZmFyaS81MzcuMzYnOidNb3ppbGxhLzUuMCAoTGludXg7IEFuZHJvaWQgOTsgTUkgNikgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzg5LjAuNDM4OS45MCBNb2JpbGUgU2FmYXJpLzUzNy4zNic7XFxuICAgICAgICBsZXQgaGVhZGVycyA9IHtcXG4gICAgICAgICAgICAnUmVmZXJlcic6J2h0dHBzOi8v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AgcGxheVVybCs9XFxcIjt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgfWVsc2UgaWYoL2l4aWd1YVxcXFwuY29tLy50ZXN0KHBsYXlVcmwpKXtcXG4gICAgICAgICAgICAgICAgcGxheVVybCs9XFxcIiNpc3ZpZGVvPXRydWUjO3tSZWZlcmVyQGh0dHBzOi8vd3d3Lml4aWd1YS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGVsc2UgaWYoL21ndHZcXFxcLmNvbXxieXRlYW1vbmUvLnRlc3QocGxheVVybCkpe1xcbiAgICAgICAgICAgICAgICBwbGF5VXJsKz1cXFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgfWVsc2UgaWYoL3B0d29cXFxcLndrZmlsZVxcXFwuY29tLy50ZXN0KHBsYXlVcmwpJiYvdXJsPS8udGVzdChwbGF5VXJsKSl7XFxuICAgICAgICAgICAgICAgIHBsYXlVcmw9cGxheVVybC5zcGxpdChcXFwidXJsPVxcXCIpWzFdK1xcXCI7e1JlZmVyZXJAaHR0cHM6Ly9mYW50dWFuLnR2fVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8g5aSE55CG5aSn5biI5YWE5LmL57G755qEYXBwXFxuICAgICAgICAgICAgLy8gZWxzZXtcXG4gICAgICAgICAgICAvLyAgICAgcGxheVVybCs9XFxcIjt7VXNlci1BZ2VudEBNb3ppbGxhLzUuMH1cXFwiO1xcbiAgICAgICAgICAgIC8vIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHBsYXlVcmw9cmVjaGFuZ2UocGxheVVybCk7XFxuICAgICAgICBpZighLyNpc1ZpZGVvPXRydWUjLy50ZXN0KHBsYXlVcmwpKXtcXG4gICAgICAgICAgIC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KT0+e1xcbiAgICAgICAgICAgIGNvbnN0IHtsYXp5UGFyc2V9ID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZ2xvYmFsUGFyc2U/cnVsZT3pgZPplb/ku5PlupNQcm8nKTtcXG4gICAgICAgICAgICByZXR1cm4gbGF6eVBhcnNlKGlucHV0KVxcbiAgICAgICAgfSk7XFxuICAgICAgICBmb3IobGV0IGkgaW4gbGlzdCl7XFxuICAgICAgICAgICAgbGV0IF9waWMgPSB0WzJdP3BkKGxpc3RbaV0sdFsyXSk6Jyc7XFxuICAgICAgICAgICAgaWYoaXNQaWMoX3BpYykmJiEvQFJlZmVyZXI9Ly50ZXN0KF9waWMpKXtcXG4gICAgICAgICAgICAgICAgX3BpYys9J0BSZWZlcmVyPSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGl0PXtcXG4gICAgICAgICAgICAgICAgdGl0bGU6cGRmaChsaXN0W2ldLHRbMV0pLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOl9waWMsXFxuICAgICAgICAgICAgICAgIGRlc2M6cGRmaChsaXN0W2ldLHRbM10pLFxcbiAgICAgICAgICAgICAgICB1cmw6ZWo/cGQobGlzdFtpXSx0WzRdKTpwZChsaXN0W2ldLHRbNF0pK2xhenlcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGlmKHQubGVuZ3RoPjUpey8v5YaF5a6577yM55So5LqO5pCc57SiXFxuICAgICAgICAgICAgICAgIGl0LmNvbnRlbnQ9cGRmaChsaXN0W2ldLHRbNV0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaChpdCk7XFxuICAgICAgICB9XFxuICAgICAgICBpZihvbmx5YmFjayl7XFxuICAgICAgICAgICAgcmV0dXJuIGRcXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHNldFJlc3VsdChkKVxcbiAgICAgICAgfVxcbiAgICB9LHBhclN0cixlaixvbmx5YmFjayxodG1sLGlzUGljK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pbChtcy8yNTApO1xcbiAgICAgICAgbG9nKFxcXCLmnKzmrKHll4XmjqLotoXml7Y6XFxcIittcytcXFwi5YWx6K6h5b6F5oqT5YyFOlxcXCIrbWF4X2NvdW50K1xcXCLmrKFcXFwiKTtcXG4gICAgICAgIHNob3dMb2FkaW5nKCfll4XmjqLkuK3vvIzoi6XlpLHotKXlsLHliIfmjaJ3ZWLll4XmjqIuLi4nKTtcXG4gICAgICAgIGxldCBfeDUgPSAkLnRvU3RyaW5nKChpc1ZpZGVvLHJlY2hhbmdlLHBsYXlVcmwsbWF4X2NvdW50LFBDX1VBLGlzQmFkVmlkZW8pPT57XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYSk9PSd1bmRlZmluZWQnfHwhZmJhKXtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBmYmEgPSBmeV9icmlkZ2VfYXBwO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVxdWVzdCk9PSd1bmRlZmluZWQnfHwhcmVxdWVzdCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmYmEuZ2V0SW50ZXJuYWxKcygpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZmJhLnB1dFZhcihcXFwiX3g1anhVcmxcXFwiLHBsYXlVcmwpO1xcbiAgICAgICAgICAgICAgICBpZih3aW5kb3cuY291bnQgPT0gbnVsbCl7XFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQ9MTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgdGV4dD0nJztcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcbiAgICAgICAgICAgICAgICBpZigv6Kem5Y+R5LqG6Ziy55uX6ZO+fOacquaOiOadg3zmjqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09PTEpe1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvY2F0aW9uLnJlbG9hZCgpO1xcbiAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZj1mYmEuZ2V0VmFyKFxcXCJfeDVqeFVybFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudCsrO1xcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonK3dpbmRvdy5jb3VudCsnLG1heF9jb3VudDonK21heF9jb3VudCk7XFxuICAgICAgICAgICAgICAgIGlmKCB3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KXtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIui2hei/h1xcXCIrbWF4X2NvdW50KjI1MCtcXFwi5q+r56eS5pyq6I635Y+W5Yiw6LWE5rqQ5Zyw5Z2A77yM6Lez5Yiw5rqQ572R6aG1LOS7peS4i+aYr+WKoOi9vei/h+eahOWcsOWdgFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2codGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKEpTT04uc3RyaW5naWZ5KF9nZXRVcmxzKCkpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYmEuZ2V0VmFyKFxcXCJfeDVqeFVybFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG11dGVNZShlbGVtKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0ucGF1c2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIHZpZGVvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcInZpZGVvXFxcIiksIGF1ZGlvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImF1ZGlvXFxcIiksIHYyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiZW1iZWRcXFwiKSwgdjMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCIjcGxheWVyXFxcIik7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwoYXVkaW9zLCBmdW5jdGlvbiAoYXVkaW8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUoYXVkaW8pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjIsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhKU09OLnN0cmluZ2lmeSh1cmxzKSk7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGkgaW4gdXJscykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3VybD1cXFxcLy8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0ID0gdS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBob3N0K3Uuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ2aWTliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFwvLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwidmlk5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwXFxcIit1LnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5YW25LuW5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vfGluZGV4XFxcXC5tM3U4JFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFwvMVxcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB1PXUucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVmlkZW8odSxyZWNoYW5nZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlYWxVcmwpPT0nc3RyaW5nJyYmIWlzQmFkVmlkZW8odSkpey8v6L+H5ruk5ZCK5q+b6KeG6aKRXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZnlfYnJpZGdlX2FwcC5zZXRXZWJVYShQQ19VQSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihmYmEuZ2V0SGVhZGVyVXJsKSE9PSd1bmRlZmluZWQnJiZ0eXBlb2YocmVjaGFuZ2UpIT09J2Z1bmN0aW9uJyl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXQgYmFja1VybCA9IGZiYS5nZXRIZWFkZXJVcmwodS5yZXBsYWNlKFxcXCI7e1xcXCIsXFxcIiNpc1ZpZGVvPXRydWUjO3tcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYmFja1VybCA9IGZiYS5nZXRIZWFkZXJVcmwodXJsc1tpXSkucmVwbGFjZSgnO3snLCcjaWdub3JlSW1nPXRydWUjI2lzVmlkZW89dHJ1ZSM7eycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUxID0gYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUyID0gJyNpZ25vcmVJbWcnK2JhY2tVcmwuc3BsaXQoJyNpZ25vcmVJbWcnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFwvLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1cXFxcLy8udGVzdCh1MSkmJi9cXFxcLm0zdTgvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdDEgPSB1MS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBob3N0MSt1MS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gXFxcImh0dHBcXFwiK3UxLnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tVcmwgPSB1MSArIHUyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZygn6L+U5Zue6Ieq5Yqo5YqgY29va2ll6ZO+5o6lOicrYmFja1VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKCfov5Tlm57pk77mjqU6Jyt1Kyflubboh6rliqjliqDkuoZjb29raWUs5YW35L2TY29va2ll5Zyo6KeG6aKR5pKt5pS+5aSE5p+l55yLJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFja1VybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi6L+U5Zue5LuT5bqTeDXlhY3ll4Xnu5Pmnpw6XFxcIityZWFsVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFsVXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgLy8gZnlfYnJpZGdlX2FwcC5sb2coJ3g15aSn6IyD5Zu06ZSZ6K+vOicrZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgYWxlcnQoJ3g15aSn6IyD5Zu06ZSZ6K+vOicrZS5tZXN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gICAgICAgICAgZXZhbChmYmEuZ2V0SW50ZXJuYWxKcygpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgaWYgKHdpbmRvdy5jb3VudCA9PSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudCA9IDE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgaWYoL+inpuWPkeS6humYsuebl+mTvnzmnKrmjojmnYN85o6l5Y+j6Ziy55uXLy50ZXN0KHRleHQpJiZ3aW5kb3cuY291bnQ9PTEpe1xcbiAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHdpbmRvdy5jb3VudCsrO1xcbiAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50OicgKyB3aW5kb3cuY291bnQgKyAnLG1heF9jb3VudDonICsgbWF4X2NvdW50KTtcXG4gICAgICAgICAgICBpZiAod2luZG93LmNvdW50ID49IG1heF9jb3VudCkge1xcbiAgICAgICAgICAgICAgICBmYmEuY2xlYXJWYXIoJ3g1TGlzdCcpO1xcbiAgICAgICAgICA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IFtdLmZvckVhY2guY2FsbChhdWRpb3MsIGZ1bmN0aW9uIChhdWRpbykge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUoYXVkaW8pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjIsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYzLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgdXJscyA9IF9nZXRVcmxzKCk7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gdXJscykge1xcbiAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcbiAgICAgICAgICAgICAgICAvL3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO1xcbiAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cFxcXCIrdS5zcGxpdCgvXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coXFxcIuWFtuS7luWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvXFxcXC8xXFxcXC5tM3U4JC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB1PXUucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXG4gICAgICAgICAgICAgICAgbGV0IHJlYWxVcmwgPSBpc1ZpZGVvKHUpO1xcbiAgICAgICAgICAgICAgICBpZiAocmVhbFVybCYmIWlzQmFkVmlkZW8odSkpIHsvL+i/h+a7pOWQiuavm1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5LuT5bqTeDXlhY3ll4Xnu5Pmnpw6XFxcIiArIHJlYWxVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmNsZWFyVmFyKCd4NUxpc3QnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFsVXJsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpXFxuICAgICAgICB9XFxuICAgIH0sIGlzVmlkZW8sIG1heF9jb3VudCx4NVRpbWVvdXQsaXNCYWRWaWRlbyk7XFxuICAgIGNvbnN0IGxzZz0kLnJlcXVpcmUo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nVlO1xcbiAgICAgICAgfWVsc2UgaWYoLyNFWFRJTkYvLnRlc3QoYmFja2NvZGUpKXtcXG4gICAgICAgICAgICAvL2xldCBsY2FjaGU9XFxcIi9zdG9yYWdlL2VtdWxhdGVkLzAvQW5kcm9pZC9kYXRhL2NvbS5leGFtcGxlLmhpa2Vydmlldy9maWxlcy9Eb2N1bWVudHMvY2FjaGUvdmlkZW9fXFxcIit0bmFtZStcXFwiLm0zdThcXFwiO1xcbiAgICAgICAgICAgIC8vd3JpdGVGaWxlKGxjYWNoZSxiYWNrY29kZSk7XFxuICAgICAgICAgICAgLy92aWRlb3MucHVzaChsY2FjaGUpO1xcbiAgICAgICAgICAgIGxldCBwVXJsPWNhY2hlTTN1OCh0dXJsKTtcXG4gICAgICAgICAgICB2aWRlb3MucHVzaChwVXJsKTtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IHVybCA9IEpTT04ucGFyc2UoYmFja2NvZGUpLnVybDtcXG4gICAgICAgICAgICBpZigvXmh0dHAvLnRlc3QodXJsKSl7XFxuICAgICAgICAgICAgICAgIGxldCByZWFsVmlkZW8gPSBpc1ZpZGVvKHVybCk7XFxuICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVmlkZW8pPT0nc3RyaW5nJyl7XFxuICAgICAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+W3suino+aekOWHuuinhumikTonK3JlYWxWaWRlbyk7XFxuICAgICAgICAgICAgICAgICAgICBpZihqbmFtZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVhbFZpZGVvKz1cXFwi4piFXFxcIitqbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmlkZW9zLnB1c2gocmVhbFZpZGVvKTtcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+ino+aekOWHuuS4jeefpemBk+S7gOS5iOS4nOilvzonK3VybCk7XFxuICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCIjaXNWaWRlbz10cnVlI1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICBpZihqbmFtZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsKz1cXFwi4piFXFxcIitqbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmlkZW9zLnB1c2godXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+S4umpzb27mjqXlj6PkuJTml6Dov5Tlm57op4bpopHlnLDlnYDmlbDmja46JytwbGF5VXJsTGlzdFtpXSsnXFxcXG4nK2JhY2tjb2RlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2codG5hbWUrJ+S4ung15o6l5Y+jLOWKoOWFpXg15ZeF5o6i5YiX6KGoJyk7XFxuICAgICAgICAgICAgeDVsaXN0LnB1c2gocGxheVVybExpc3RbaV0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIC8vIGxvZyh2aWRlb3MpO1xcbiAgICBpZih2aWRlb3MubGVuZ3RoPjApe1xcbiAgICAgICAgaWYoZ2V0VmFyKCdkcC5jYWNoZVZpZGVvJywndHJ1ZScpPT09J3RydWUnJiZwYXJzZUludChnZXRBcHBWZXJzaW9uKCkpPj0yMjU1KVxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGxvZyhcXFwi5bCK5pWs55qE6a2U5pat55So5oi377yM6KeG6aKR57yT5a2Y5bey5ZCv55So77yM6K+35bC95oOF5Lqr5Y+X55yL5Ymn5pe25YWJXFxcIik7XFxuICAgICAgICAgICAgbGV0IHZpZGVvc0NhY2hlPXZpZGVvcy5tYXAoKGl0KT0+e1xcbiAgICAgICAgICAgICAgICBsZXQgaGVhZGVycz17fTtcXG4gICAgICAgICAgICAgICAgaWYoaXQuc3BsaXQoXFxcIjtcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaGVhZCA9IGl0LnNwbGl0KCc7JylbMV07XFxuICAgICAgICAgICAgICAgICAgICBpZigvQC8udGVzdChoZWFkKSYmL3t8fS8udGVzdChoZWFkKSl7XFxuLy9oZWFkID0gaGVhZC5yZXBsYWNlKC97fH0vZywnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoXFxcIntcXFwiKVsxXS5zcGxpdChcXFwifVxcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQgPSBoZWFkLnNwbGl0KCcmJicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiBoZWFkKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGtleSA9IGhlYWRbaV0uc3BsaXQoJ0AnKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID1oZWFkW2ldLnNwbGl0KCdAJylbMV0ucmVwbGFjZSgvOy8sJzsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1trZXldID0gdmFsdWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6aXQuc3BsaXQoXFxcIjtcXFwiKVswXS5zcGxpdChcXFwi4piFXFxcIilbMF0sXFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOntcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOmhlYWRlcnNcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHZhciBkYXRhPWJhdGNoQ2FjaGVNM3U4KHZpZGVvc0NhY2hlKTtcXG4gICAgICAgICAgICBkYXRhPWRhdGEubWFwKChpdCxpZCk9PntcXG4gICAgICAgICAgICAgICAgbGV0IGV4dHJhPVxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICBpZih2aWRlb3NbaWRdLnNwbGl0KFxcXCI7XFxcIikubGVuZ3RoPjEpe1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE9XFxcIjtcXFwiK3ZpZGVvc1tpZF0uc3BsaXQoXFxcIjtcXFwiKVsxXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYodmlkZW9zW2lkXS5zcGxpdChcXFwi4piFXFxcIikubGVuZ3RoPjEpe1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE9XFxcIuKYhVxcXCIrdmlkZW9zW2lkXS5zcGxpdChcXFwi4piFXFxcIilbMV07XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgaWYoaXQrXFxcIlxcXCIhPVxcXCJudWxsXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXQrZXh0cmFcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmlkZW9zW2lkXVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgLy9sb2coZGF0YSk7XFxuICAgICAgICAgICAgcmV0dXJuIGRhdGFcXG4gICAgICAgICAgICAvL3JldHVybiB2aWRlb3NcXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHJldHVybiB2aWRlb3NcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBsb2coJ+WFseaciScreDVsaXN0Lmxlbmd0aCsn5LiqeDXlnLDlnYDov5vooYzova7mtYHll4XmjqInKTtcXG4gICAgLy/msqHmnInnmoTor53lsLHlvIDlp4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24nXFxuICAgICAgICB9LFxcbiAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJkYXRhXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiB0YXNrLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicHljb2RlXFxcIjogdGFzay5weWNvZGUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibm90ZVxcXCI6IHRhc2subm90ZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0ZXN0X2NvZGVcXFwiOiB0YXNrLnRlc3RfY29kZSxcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgXFxcImF1dGhcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGhvdXNlX2RhdGEudXNlcm5hbWV8fFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogaG91c2VfZGF0YS5wYXNzd29yZHx8XFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pLFxcbiAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgfSk7XFxuICAgIHJldHVybiBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbn1cXG5cXG5mdW5jdGlvbiB0YXNrX2NhbGwoaWQsZnVuYyxwYXJhbXMpe1xcbiAgICBjb25zdCB7YXBpfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3V0aWxpeT9ydWxlPemBk+mVv+S7k+W6k1Byb1xcXCIpO1xcbiAgICBsZXQgdGFza19hcGkgPSBhcGkuaG9zdCsnL2hpa2VydWxlL3Rhc2svcnVuLycraWQ7XFxuICAgIGxldCB0YXNrID0ge1xcbiAgICAgICAgbW9kZTonY2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PVVURi04JywnVXNlci1BZ2VudCc6ZGV2X3NldF9pbmZvWzNdfSxib2R5OkpTT04uc3RyaW5naWZ5KHNlbmRfZGF0YSksbWV0aG9kOidQT1NUJ307XFxuICAgICAgICAgICAgLy8gcGFyMiA9IEpTT04uc3RyaW5naWZ5KHBhcjIpOyAvL3g16YeM6Z2i6K+35rGC5omN6ZyA6KaB57yW56CBXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IGJhY2tfcmV0ID0gcmVxdWVzdChpbmZvX3NldF91cmwsIHBhcjIpO1xcbiAgICAgICAgICAgICAgICBiYWNrX3JldCA9IEpTT04ucGFyc2UoYmFja19yZXQpLnJlc3VsdDtcXG4gICAgICAgICAgICAgICAgaWYoYmFja19yZXQuc3RhdHVzPT09MCl7XFxuICAgICAgICAgICAgICAgICAgICAvLyByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/neWtmOaIkOWKn1xcXFxuJytiYWNrX3JldC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/neWtmOWksei0pVxcXFxuJytiYWNrX3JldC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr1xcXFxuJytlLm1lc3NhZ2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgY29uZmlybSh7dGl0bGU6J+mBk+mVv+aPkOekuicsY29udGVudDon6Jm954S25L2g5b6I5oeS77yM5L2G5piv5YWs5ZGK6Iez5bCR5YaZNOS4quWtl+WQp++8gSd9KTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB9XFxuICAgIH0pXF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LeeCueWHu+ehruWumuWPr+S7peWvvOWFpScsXFxuICAgICAgICAgICAgY29udGVudDogJ+ivt+WwneivleeCueWHu+S7k+W6k+S4u+mhteeahOWNh+e6p+S7k+W6k+aXgei+ueeahOaMiemSruWNh+e6pyTmianlsZXvvIzlkKbliJnmn5Dkupvlip/og73kuI3og73mraPluLjkvb/nlKgnLFxcbiAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKCk9PntcXG4gICAgICAgICAgICAgICAgY29uc3Qge2dldEFwaX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlsaXk/cnVsZT3pgZPplb/ku5PlupNQcm9cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVIZWFkID0gJ+a1t+mYlOinhueVjO+8jOe9kemhteaPkuS7tu+/pWpzX3VybO+/pSRoaWtlckAnO1xcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gZ2V0QXBpKCdpbXBvcnRVcmwnKStcXFwiNTExMVxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCBpbXBvcnRVcmwgPSAncnVsZTovLycrYmFzZTY0RW5jb2RlKHJ1bGVIZWFkK3VybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBpbXBvcnRVcmxcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKCk9PntcXG5cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgIH0pXFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJJbXBvcnTor6bnu4ZcIixcInBhdGhcIjpcInJ1bGVEZXRhaWxJbXBvcnRcIixcInJ1bGVcIjpcImpzOlxcbiQuZXhwb3J0cyA9IFxcXCJoaWtlcjovL3BhZ2UvcnVsZURldGFpbD9ydWxlPemBk+mVv+S7k+W6k1BybyZpZD1cXFwiICsgJC5pbXBvcnRQYXJhbTtcXG5cIn0se1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V4dENvbnRhaW5lcicpO1xcbiAgICAgICAgICAgICAgICBjb25zdCB0ZXh0ID0gdGV4dENvbnRhaW5lci5pbm5lckhUTUw7XFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIub25jbGljaz1mdW5jdGlvbigpe1xcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmx8fFxcXCJhYm91dDpibGFuay9ub3RpY2VcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIOiuvue9ruaWh+acrOWuueWZqOWuveW6puS4uuaWh+acrOWGheWuueeahOWuveW6plxcbiAgICAgICAgICAgICAgICB0ZXh0Q29udGFpbmVyLnN0eWxlLndpZHRoID0gYCR7dGV4dENvbnRhaW5lci5vZmZzZXRXaWR0aH1weGA7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOWkjeWItuaWh+acrOWGheWuueW5tui/veWKoOWIsOaWh+acrOWuueWZqOWQjumdolxcbiAgICAgICAgICAgICAgICB0ZXh0Q29udGFpbmVyLmlubmVySFRNTCArPSAnICcgKyB0ZXh0O1xcblxcbiAgICAgICAgICAgICAgICAvLyDliqjmgIHorqHnrpfliqjnlLvmjIHnu63ml7bpl7RcXG4gICAgICAgICAgICAgICAgY29uc3QgZHVyYXRpb24gPSAodGV4dENvbnRhaW5lci5vZmZzZXRXaWR0aCAvIHRleHRDb250YWluZXIucGFyZW50RWxlbWVudC5vZmZzZXRXaWR0aCkgKiAxMDtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIHN0eWxlRWxlbWVudHMgPSBkb2N1bWVudC5oZWFkLmdldEVsZW1lbnRzQnlUYWdOYW1lKCdzdHlsZScpO1xcblxcblxcbiAgICAgICAgICAgICAgICBzdHlsZUVsZW1lbnRzWzJdLmlubmVySFRNTCA9IGAubWFycXVlZSBzcGFuIHtcXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcXG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMTAwJTtcXG4gICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogbWFycXVlZSAke2R1cmF0aW9ufXMgbGluZWFyIGluZmluaXRlXFxuICAgICAgICAgICAgICAgIH1gO1xcblxcbiAgICAgICAgICAgIH0sIGh0bWwsIHVybCksXFxuICAgICAgICAgICAgdXJsSW50ZXJjZXB0b3I6ICQudG9TdHJpbmcoKGNvbnRlbnQpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0PT09XFxcImFib3V0OmJsYW5rL25vdGljZVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKChjb250ZW50KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWFrOWRilxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHkjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZFJ1bGU6IFxcXCJqczpcXFwiICsgJCQkLnRvU3RyaW5nKChjb250ZW50KSA9PiBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XSksY29udGVudClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBjb250ZW50KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGNvbnRlbnQgfHwgdGV4dCksXFxuICAgICAgICB9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gICAgICAgIHVybDogJCgpLmxhenlSdWxlKChkYXRhSXRlbSxzdWJVcmwpPT57XFxuICAgICAgICAgICAgICAgIC8vIGxldCB0aXRsZSA9IFxcXCJILVxcXCIrZGF0YUl0ZW0ubmFtZStcXFwiLlxcXCIrZGF0YUl0ZW0uYXV0aG9yO1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBcXFwiSi1cXFwiK2RhdGFJdGVtLm5hbWUuc3BsaXQoJy4nKVswXTtcXG4gICAgICAgICAgICAgICAgbGV0IHN1Yk9iaiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc3ViVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvXFxcIit0aXRsZStcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBhY3RpdmU6IGZhbHNlLC8v56aB55So5bm25Y+R5pu05pawXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHNoYXJlVGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShzdWJPYmopKTtcXG4gICAgICAgICAgICAgICAgdmFyIHBhc3RlcyA9IGdldFBhc3RlcygpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShzaGFyZVRleHQscGFzdGVzLnNsaWNlKC0xKVswXSk7XFxuICAgICAgICAgICAgICAgIGxldCBpbXBvcnRfcnVsZT0gXFxcIui9u+WQiOmbhuiuoumYhe+8mlxcXCIrdGl0bGUrJ1xcXFxuJyt1cmw7XFxuICAgICAgICAgICAgICAgIGNvcHkoaW1wb3J0X3J1bGUpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gJ2h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2FmZSkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfc2FmZSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfc2FmZVxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBmdW5jdGlvbiBzZXRJc0dvb2QoZmxhZyxtYW5fcnVsZV9nb29kKSB7XFxuICAgICAgICBmbGFnID0gZmxhZyB8fCAnJztcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChtYW5fcnVsZV9nb29kLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpc19nb29kXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+mjjumZqScsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn5qCH6K6w6K+l6KeE5YiZ5Li66aOO6ZmpP+mjjumZqeinhOWImeaXoOazleiiq+WvvOWFpScpLmNvbmZpcm0oKGlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKT0+e1xcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc1NhZmUoZmFsc2UsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifinIXmraPluLgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuato+W4uD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKHRydWUsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifimaXpnZ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XFxcXFxcIjtcXFxcbiAgICAgICAgfSksXFxcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcXFxuICAgIH0sIHtcXFxcbiAgICAgICAgdGl0bGU6IFxcXFxcXFwi6ZqP5py65a+G6ZKlXFxcXFxcXCIsXFxcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZSxcXFxcbiAgICAgICAgdXJsOiAkKGdldEFwaShcXFxcXFxcImdlbkF1dGhcXFxcXFxcIikgKyByZXFCeUdldCArIFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGJhY2sgPSByZXF1ZXN0KGlucHV0KTtcXFxcbiAgICAgICAgICAgIGxldCByZXQgPSBKU09OLnBhcnNlKGJhY2spO1xcXFxuICAgICAgICAgICAgaWYgKHJldC5zdGF0dXMgPT0gMCkge1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3sueUn+aIkOmaj+acuuWvhueggVxcXFxcXFxcblxcXFxcXFwiICsgcmV0LnJlc3VsdFxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+maj+acuuWvhueggeeUn+aIkOWksei0pVxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSk7XFxcXG4gICAgbGV0IHRpbWVPdmVyID0ge1xcXFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXFxcbiAgICB9O1xcXFxuICAgIGlmIChkYXRhSXRlbS50aW1lX292ZXIpIHtcXFxcbiAgICAgICAgdGltZU92ZXIudGl0bGUgPSBzbW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hcignaG91c2UudXNlcm5hbWUnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGFzc3dvcmRcXFxcXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJjYW5fdXBsb2FkXFxcXFxcXCI6ICEhZmxhZ1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBkYXRhLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJ/CfmqvnpoHmraLkuIrkvKAnLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6ICQoJ+emgeatouivpeW8gOWPkeiAheS4iuS8oOinhOWImT/kvaDnmoTmk43kvZzlsIbooqvns7vnu5/orrDlvZUnKS5jb25maXJtKChpZCwgY2FuX3VwbG9hZF9hcGksIHNldFVwbG9hZCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldFVwbG9hZChmYWxzZSwgY2FuX3VwbG9hZF9hcGkpO1xcXFxuICAgICA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2FmZVxcXFxcXFwiOiAhIWZsYWdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXFxcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIGZ1bmN0aW9uIHNldElzR29vZChmbGFnLG1hbl9ydWxlX2dvb2QpIHtcXFxcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBsZXQgY29kZSA9IGZldGNoKG1hbl9ydWxlX2dvb2QsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IE1PQklMRV9VQX0sXFxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhcmFtc1xcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidXNlcm5hbWVcXFxcXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGFzc3dvcmRcXFxcXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiaXNfZ29vZFxcXFxcXFwiOiAhIWZsYWdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXFxcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIGRhdGEucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOifwn5qr6aOO6ZmpJyxcXFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6JCgn5qCH6K6w6K+l6KeE5YiZ5Li66aOO6ZmpP+mjjumZqeinhOWImeaXoOazleiiq+WvvOWFpScpLmNvbmZpcm0oKGlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKT0+e1xcXFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzU2FmZShmYWxzZSxtYW5fcnVsZV9zYWZlKTtcXFxcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhb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1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXFxcXFwi5q2j5Zyo5o+Q5Lqk55Sz6K+36KGoXFxcXFxcXCIpO1xcXFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInJlYXNvblxcXFxcXFwiOiBkZXNjcmlwdGlvbixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJuYW1lXFxcXFxcXCI6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGFzc3dvcmRcXFxcXFxcIjogcGFzc3dvcmQsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicXFcXFxcXFxcIjogdXNlcm5hbWVcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIG1ldGhvZDogJ3Bvc3QnXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcXFxuICAgICAgICBoaWRlTG9hZGluZygpO1xcXFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9cXFxcXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IGlkcmVzdWx0ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldElkICsgXFxcXFxcXCI/cXE9XFxcXFxcXCIgKyB1c2VybmFtZSkpO1xcXFxuICAgICAgICBpZiAoaWRyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL1xcXFxcXFwiICsgaWRyZXN1bHQuZGV0YWlsO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIFxcXFxuICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIui+k+WFpemCrueusemqjOivgeeggVxcXFxcXFxcblxcXFxcXFwiICsgcmVzdWx0LmRldGFpbCkuaW5wdXQoKGNvbmZpcm0sIGlkLCBhY2NvdW50KSA9PiB7XFxcXG4gICAgICAgICAgICBzaG93TG9hZGluZyhcXFxcXFxcIuivt+iAkOW/g+etieW+hVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoY29uZmlybSwge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGFyYW1zXFxcXFxcXCI6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInJlZ2lzdF9pZFxcXFxcXFwiOiBpZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInl6bVxcXFxcXFwiOiBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcXFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8vXFxcXFxcXCIgKyByZXN1bHQuZGV0YWlsO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcihcXFxcXFxcIldhcmVob3VzZVVzZXJuYW1lXFxcXFxcXCIsIGFjY291bnRbMF0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcXFxcXCJXYXJlaG91c2VQYXNzd29yZFxcXFxcXFwiLCBhY2NvdW50WzFdKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+aIkOWKn+aPkOS6pOazqOWGjOazqOWGjFxcXFxcXFxcblxcXFxcXFwiK3Jlc3VsdC5kZXRhaWw7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lh7rplJnkuoblkZBcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSwgY29uZmlybSwgaWRyZXN1bHQucmVzdWx0LCBbdXNlc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ICAgICAgICB1c2VybmFtZTogdXNlcm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgcmVwbHlJZDppdGVtLmlkXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBkYXRhLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZGlzY3Vzc190ZXh0LFxcXFxuICAgICAgICAgICAgZGVzYzogUmVwbHkraXRlbS5jcmVhdGVfZGF0ZSArIFxcXFxcXFwiwrdcXFxcXFxcIiArIGljb25baXRlbS5kaXNjdXNzX3R5cGVdLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2luZm9cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOntcXFxcbiAgICAgICAgICAgICAgICBuYW1lOml0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICB0eXBlOlxcXFxcXFwibG9uZ190ZXh0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdGV4dDppdGVtLmRpc2N1c3NfdGV4dFxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyX3VybFxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgY29udHJvbChpdGVtLmlkLGl0ZW0uYWN0aXZlKTtcXFxcbiAgICB9XFxcXG4gICAgaWYgKGNvbW1lbnRMaXN0Lmxlbmd0aCA9PT0gMCkge1xcXFxuICAgICAgICBkYXRhLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxuc2V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xuICAgICAgICBsZXQgdGV4dCA9IGdldFZhcignV2FyZWhvdXNlLmNvbW1lbnQudGV4dCcsICcnKTtcXFxcbiAgICAgICAgbGV0IFtxcSxhdXRoX2NvZGVdID0gQWNjb3VudDtcXFxcbiAgICAgICAgbGV0IHR5cGUgPSBnZXRWYXIoJ1dhcmVob3VzZS5jb21tZW50LnR5cGUnKSB8fCAnZ29vZCc7XFxcXG4gICAgICAgIHFxPXFxfHxcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICBhdXRoX2NvZGU9YXV0aF9jb2RlfHxcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICBpZihxcT09XFxcXFxcXCJcXFxcXFxcInx8YXV0aF9jb2RlPT1cXFxcXFxcIlxcXFxcXFwiKXtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5pyq55m75b2V6LSm5Y+3XFxcXFxcXCI7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaWYodGV4dD09XFxcXFxcXCJcXFxcXFxcIil7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWGmeWVilxcXFxcXFwiO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGZ1bmN0aW9uIHIocCkge1xcXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHApLFxcXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhc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XG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWhq+WViiFcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBzaG93TG9hZGluZyhcXFxcXFxcIuiOt+WPluS4rS4uLlxcXFxcXFwiKVxcXFxuICAgICAgICByZXR1cm4gJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChxcSwgYSwgYikgPT4ge1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoYSwge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhcmFtc1xcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInFxXFxcXFxcXCI6IHFxXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcXFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8vXFxcXFxcXCIgKyByZXN1bHQuZGV0YWlsO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtc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uICAgICAgICB9XFxcXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGxvZ2luLCB7XFxcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICBcXFxcXFxcInBhcmFtc1xcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicXFcXFxcXFxcIjogcXEsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiYXV0aF9jb2RlXFxcXFxcXCI6IHl6bVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxcXG4gICAgICAgICAgICBmLnVzZXIgPSBbcXEsIHl6bV07XFxcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcXFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShmKSk7XFxcXG4gICAgICAgICAgICBsZXQgaW5kZXggPSBsLmZpbmRJbmRleChpdGVtID0+IGl0ZW1bMF0gPT09IHFxKTtcXFxcbiAgICAgICAgICAgIGlmIChpbmRleCA+IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgbC5zcGxpY2UoaW5kZXgsIDEsIFtxcSwgeXptXSk7XFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGwubGVuZ3RoIDwgNikge1xcXFx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od2ViX3VybCxwYXJhbXMsZnVuY3Rpb24gKGtleSxjb2RlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBjb2RlO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5Ys5bm26YOo5YiG5o+S5YWl5Yiw5paH5pys5Yy65Z+fJ1xcXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bliLDnqbrmlofmnKzvvIznlpHkvLzkvaDmsqHmnInmraTmlofku7YhJztcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICovXFxcXG4gICAgICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IGdldEl0ZW0oJ2hvdXNlLmZpbGVfdWEnKT09PSfnlLXohJEnP2ZldGNoKHdlYl91cmwscGFyYW1zKTpyZXF1ZXN0KHdlYl91cmwscGFyYW1zKTtcXFxcbiAgICAgICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5Ys5bm26YOo5YiG5o+S5YWl5Yiw5paH5pys5Yy65Z+fJ1xcXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgbG9nKGUubWVzc2FnZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WPkeeUn+S6humUmeivrzpcXFxcXFxcXG4nK2UubWVzc2FnZTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfWVsc2UgaWYoL+S4u+mimO+/pXzlhYPntKDvv6UvLnRlc3QoaW5wdXQpKXtcXFxcbiAgICAgICAgICAgIGxvZygn5Li76aKY6ZO+5o6lJyk7XFxcXG4gICAgICAgICAgICBsZXQgd2ViX3VybF9hcnIgPSBpbnB1dC5zcGxpdCgn77+lJyk7XFxcXG4gICAgICAgICAgICBsZXQgd2ViX3VybCA9IHdlYl91cmxfYXJyW3dlYl91cmxfYXJyLmxlbmd0aC0xXTtcXFxcbiAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBwYXJzZVBhc3RlKHdlYl91cmwpO1xcXFxuICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCkge1xcXFxuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxcXG4gICAgICA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5YmFjayxodG1sLGlzUGljKT0+e1xcXFxuICAgICAgICBsZXQgdD1wYXJTdHIuc3BsaXQoXFxcXFxcXCI7XFxcXFxcXCIpO1xcXFxuICAgICAgICBsZXQgZD1bXTtcXFxcbiAgICAgICAgLy8gbGV0IGxpc3Q9cGRmYShnZXRSZXNDb2RlKCksdFswXSk7XFxcXG4gICAgICAgIGxldCBsaXN0PXBkZmEoaHRtbCx0WzBdKTtcXFxcbiAgICAgICAgbGV0IGxhenkgPSAkKCcnKS5sYXp5UnVsZSgoKT0+e1xcXFxuICAgICAgICAgICAgY29uc3Qge2xhenlQYXJzZX0gPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9nbG9iYWxQYXJzZT9ydWxlPemBk+mVv+S7k+W6k1BybycpO1xcXFxuICAgICAgICAgICAgcmV0dXJuIGxhenlQYXJzZShpbnB1dClcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGZvcihsZXQgaSBpbiBsaXN0KXtcXFxcbiAgICAgICAgICAgIGxldCBfcGljID0gdFsyXT9wZChsaXN0W2ldLHRbMl0pOicnO1xcXFxuICAgICAgICAgICAgaWYoaXNQaWMoX3BpYykmJiEvQFJlZmVyZXI9Ly50ZXN0KF9waWMpKXtcXFxcbiAgICAgICAgICAgICAgICBfcGljKz0nQFJlZmVyZXI9J1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IGl0PXtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTpwZGZoKGxpc3RbaV0sdFsxXSksXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDpfcGljLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6cGRmaChsaXN0W2ldLHRbM10pLFxcXFxuICAgICAgICAgICAgICAgIHVybDplaj9wZChsaXN0W2ldLHRbNF0pOnBkKGxpc3RbaV0sdFs0XSkrbGF6eVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIGlmKHQubGVuZ3RoPjUpey8v5Y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Iul5aSx6LSl5bCx5YiH5o2id2Vi5ZeF5o6iLi4uJyk7XFxcXG4gICAgICAgIGxldCBfeDUgPSAkLnRvU3RyaW5nKChpc1ZpZGVvLHJlY2hhbmdlLHBsYXlVcmwsbWF4X2NvdW50LFBDX1VBLGlzQmFkVmlkZW8pPT57XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGlmKHR5cGVvZihmYmEpPT0ndW5kZWZpbmVkJ3x8IWZiYSl7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBmYmEgPSBmeV9icmlkZ2VfYXBwO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVxdWVzdCk9PSd1bmRlZmluZWQnfHwhcmVxdWVzdCl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZiYS5nZXRJbnRlcm5hbEpzKCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZmJhLnB1dFZhcihcXFxcXFxcIl94NWp4VXJsXFxcXFxcXCIscGxheVVybCk7XFxcXG4gICAgICAgICAgICAgICAgaWYod2luZG93LmNvdW50ID09IG51bGwpe1xcXFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQ9MTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRleHQ9Jyc7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXFxcXFwiYm9keVxcXFxcXFwiKS5pbm5lclRleHQ7XFxcXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcXFxuICAgICAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT09MSl7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9jYXRpb24ucmVsb2FkKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLmhyZWY9ZmJhLmdldFZhcihcXFxcXFxcIl94NWp4VXJsXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQrKztcXFxcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonK3dpbmRvdy5jb3VudCsnLG1heF9jb3VudDonK21heF9jb3VudCk7XFxcXG4gICAgICAgICAgICAgICAgaWYoIHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpe1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXFxcXFwi6LaF6L+HXFxcXFxcXCIrbWF4X2NvdW50KjI1MCtcXFxcXFxcIuavq+enkuacquiOt+WPluWIsOi1hOa6kOWcsOWdgO+8jOi3s+WIsOa6kOe9kemhtSzku6XkuIvmmK/liqDovb3ov4fnmoTlnLDlnYBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXFxcXFwiYm9keVxcXFxcXFwiKS5pbm5lclRleHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKHRleHQpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkoX2dldFVybHMoKSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmJhLmdldFZhcihcXFxcXFxcIl94NWp4VXJsXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBtdXRlTWUoZWxlbSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgdmFyIHZpZGVvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcXFxcXCJ2aWRlb1xcXFxcXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFxcXFxcImF1ZGlvXFxcXFxcXCIpLCB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcXFxcXCJlbWJlZFxcXFxcXFwiKSwgdjMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXFxcXFwiI3BsYXllclxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2aWRlbyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUoYXVkaW8pO1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG4gICAgICAgICAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcXFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkodXJscykpO1xcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiB1cmxzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcXFxcXCJ1cmw9XFxcXFxcXCIpLnNsaWNlKC0xKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXFxcXFwidXJs5YiG5YmyOlxcXFxcXFwiK3UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3VybD1cXFxcXFxcXC8vLnRlc3QodSkmJi9cXFxcXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcXFxcXC9cXFxcXFxcXC8oLio/KVxcXFxcXFxcLy8pWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBob3N0K3Uuc3BsaXQoXFxcXFxcXCJ1cmw9XFxcXFxcXCIpLnNsaWNlKC0xKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXFxcXFwidXJs5YiG5YmyOlxcXFxcXFwiK3UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXFxcXFwidmlkPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFxcXFxcInZpZOWIhuWJsjpcXFxcXFxcIit1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXFxcXFwvLy50ZXN0KHUpJiYvXFxcXFxcXFwubTN1OC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXFxcXFwvXFxcXFxcXFwvKC4qPylcXFxcXFxcXC8vKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXFxcXFwidmlkPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFxcXFxcInZpZOWIhuWJsjpcXFxcXFxcIit1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFxcXFxcPyguKik9aHR0cC8udGVzdCh1KSYmL1xcXFxcXFxcLm0zdTgvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFxcXFxcImh0dHBcXFxcXFxcIit1LnNwbGl0KC9cXFxcXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFxcXFxcIuWFtuS7luWIhuWJsjpcXFxcXFxcIit1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vfGluZGV4XFxcXFxcXFwubTN1OCRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFxcXFxcLzFcXFxcXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlYWxVcmwgPSBpc1ZpZGVvKHUscmVjaGFuZ2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlYWxVcmwpPT0nc3RyaW5nJyYmIWlzQmFkVmlkZW8odSkpey8v6L+H5ruk5ZCK5q+b6KeG6aKRXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9meV9icmlkZ2VfYXBwLnNldFdlYlVhKFBDX1VBKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YoZmJhLmdldEhlYWRlclVybCkhPT0ndW5kZWZpbmVkJyYmdHlwZW9mKHJlY2hhbmdlKSE9PSdmdW5jdGlvbicpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXQgYmFja1VybCA9IGZiYS5nZXRIZWFkZXJVcmwodS5yZXBsYWNlKFxcXFxcXFwiO3tcXFxcXFxcIixcXFxcXFxcIiNpc1ZpZGVvPXRydWUjO3tcXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYmFja1VybCA9IGZiYS5nZXRIZWFkZXJVcmwodXJsc1tpXSkucmVwbGFjZSgnO3snLCcjaWdub3JlSW1nPXRydWUjI2lzVmlkZW89dHJ1ZSM7eycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTEgPSBiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1MiA9ICcjaWdub3JlSW1nJytiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUxKSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnNwbGl0KFxcXFxcXFwidXJsPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXFxcXFwvLy50ZXN0KHUxKSYmL1xcXFxcXFxcLm0zdTgvLnRlc3QodTEpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXFxcXFwvXFxcXFxcXFwvKC4qPylcXFxcXFxcXC8vKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcXFxcXCJ1cmw9XFxcXFxcXCIpLnNsaWNlKC0xKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcXFxcXCJ1cmzliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodTEpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcXFxcXCJ2aWQ9XFxcXFxcXCIpLnNsaWNlKC0xKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1cXFxcXFxcXC8vLnRlc3QodTEpJiYvXFxcXFxcXFwubTN1OC8udGVzdCh1MSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QxID0gdTEubWF0Y2goLyguKilcXFxcXFxcXC9cXFxcXFxcXC8oLio/KVxcXFxcXFxcLy8pWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBob3N0MSt1MS5zcGxpdChcXFxcXFxcInZpZD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFxcXFxcPyguKik9aHR0cC8udGVzdCh1MSkmJi9cXFxcXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IFxcXFxcXFwiaHR0cFxcXFxcXFwiK3UxLnNwbGl0KC9cXFxcXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja1VybCA9IHUxICsgdTI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coJ+i/lOWbnuiHquWKqOWKoGNvb2tpZemTvuaOpTonK2JhY2tVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKCfov5Tlm57pk77mjqU6Jyt1Kyflubboh6rliqjliqDkuoZjb29raWUs5YW35L2TY29va2ll5Zyo6KeG6aKR5pKt5pS+5aSE5p+l55yLJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrVXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNle1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXFxcXFwi6L+U5Zue5LuT5bqTeDXlhY3ll4Xnu5Pmnpw6XFxcXFxcXCIrcmVhbFVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFsVXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIC8vIGZ5X2JyaWRnZV9hcHAubG9nKCd4NeWkp+iMg+WbtOmUmeivrzonK2UubWVzc2FnZSk7XFxcXG4gICAgICAgICAgICAgICAgYWxlcnQoJ3g15aSn6IyD5Zu06ZSZ6K+vOicrZS5tZXNzYWdlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5oql6ZSZ57uT5p2feDUnXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0saXNWaWRlbyxyZWNoYW5nZSxwbGF5VXJsLG1heF9jb3VudCxQQ19VQSxpc0JhZFZpZGVvKTtcXFxcbiAgICAgICAgbGV0IHVzZVdlYj1sc2cuZ2V0SXRlbShcXFxcXFxcIumAmuWFjVxcXFxcXFwiLFxcXFxcXFwiWDVcXFxcXFxcIik9PT1cXFxcXFxcIldFQlxcXFxcXFwiO1xcXFxuICAgICAgICAvL2xvZyhcXFxcXFxcIuS7k+W6k+S9v+eUqHdlYumAmuWFjeabv+S7o3g1OlxcXFxc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AgICBpZiAod2luZG93LmNvdW50ID09IG51bGwpIHtcXFxcbiAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQgPSAxO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IHRleHQ9Jyc7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFxcXFxcImJvZHlcXFxcXFxcIikuaW5uZXJUZXh0O1xcXFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcXFxuICAgICAgICAgICAgaWYoL+inpuWPkeS6humYsuebl+mTvnzmnKrmjojmnYN85o6l5Y+j6Ziy55uXLy50ZXN0KHRleHQpJiZ3aW5kb3cuY291bnQ9PTEpe1xcXFxuICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpO1xcXFxuICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB3aW5kb3cuY291bnQrKztcXFxcbiAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50OicgKyB3aW5kb3cuY291bnQgKyAnLG1heF9jb3VudDonICsgbWF4X2NvdW50KTtcXFxcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KSB7XFxcXG4gICAgICAgICAgICAgICAgZmJhLmNsZWFyVmFyKCd4NUxpc3QnKTtcXFxcbiAgICAgICAgICAgICAgICBmYmEuaGlkZUxvYWRpbmcoKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgZm1zZyA9ICfpgZPplb/ku5PlupPpgJrlhY3op6PmnpDlpLHotKUs5Y6f5ZugOui2heaXticreDVUaW1lb3V0Kyfmr6vnp5InO1xcXFxuICAgICAgICAgICA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ICAgICAgICAgICBtdXRlTWUoYXVkaW8pO1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYyLCBmdW5jdGlvbiAodikge1xcXFxuICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXFxcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gdXJscykge1xcXFxuICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxcXG4gICAgICAgICAgICAgICAgLy91PWRlY29kZVVSSUNvbXBvbmVudCh1KTtcXFxcbiAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcXFxuICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFxcXFxcInVybD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXFxcXFwidmlkPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFxcXFxcPyguKik9aHR0cC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFxcXFxcImh0dHBcXFxcXFxcIit1LnNwbGl0KC9cXFxcXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhcXFxcXFxcIuWFtuS7luWIhuWJsjpcXFxcXFxcIit1KTtcXFxcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvXFxcXFxcXFwvMVxcXFxcXFxcLm0zdTgkLy50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcXFxuICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1KTtcXFxcbiAgICAgICAgICAgICAgICBpZiAocmVhbFVybCYmIWlzQmFkVmlkZW8odSkpIHsvL+i/h+a7pOWQiuavm1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXFxcXFwi5LuT5bqTeDXlhY3ll4Xnu5Pmnpw6XFxcXFxcXCIgKyByZWFsVXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZmJhLmNsZWFyVmFyKCd4NUxpc3QnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWxVcmxcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWd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AgICAgICAgICAgICBsZXQgcmVhbFZpZGVvID0gaXNWaWRlbyh1cmwpO1xcXFxuICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVmlkZW8pPT0nc3RyaW5nJyl7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5bey6Kej5p6Q5Ye66KeG6aKROicrcmVhbFZpZGVvKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYoam5hbWUpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVhbFZpZGVvKz1cXFxcXFxcIuKYhVxcXFxcXFwiK2puYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgdmlkZW9zLnB1c2gocmVhbFZpZGVvKTtcXFxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKHRuYW1lKyfop6PmnpDlh7rkuI3nn6XpgZPku4DkuYjkuJzopb86Jyt1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYoam5hbWUpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsKz1cXFxcXFxcIuKYhVxcXFxcXFwiK2puYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgdmlkZW9zLnB1c2godXJsKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+S4umpzb27mjqXlj6PkuJTml6Dov5Tlm57op4bpopHlnLDlnYDmlbDmja46JytwbGF5VXJsTGlzdFtpXSsnXFxcXFxcXFxuJytiYWNrY29kZSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1jYXRjaCAoZSkge1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c3BsaXQoJyYmJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGkgaW4gaGVhZCl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGtleSA9IGhlYWRbaV0uc3BsaXQoJ0AnKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPWhlYWRbaV0uc3BsaXQoJ0AnKVsxXS5yZXBsYWNlKC87LywnOycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDppdC5zcGxpdChcXFxcXFxcIjtcXFxcXFxcIilbMF0uc3BsaXQoXFxcXFxcXCLimIVcXFxcXFxcIilbMF0sXFxcXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6e1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczpoZWFkZXJzXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIHZhciBkYXRhPWJhdGNoQ2FjaGVNM3U4KHZpZGVvc0NhY2hlKTtcXFxcbiAgICAgICAgICAgIGRhdGE9ZGF0YS5tYXAoKGl0LGlkKT0+e1xcXFxuICAgICAgICAgICAgICAgIGxldCBleHRyYT1cXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcXFxcXCI7XFxcXFxcXCIpLmxlbmd0aD4xKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE9XFxcXFxcXCI7XFxcXFxcXCIr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RkJztcXFxcbiAgICBsZXQgaG91c2VfZGF0YSA9IGhvdXNlRmlsZSgpO1xcXFxuICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGFwaV91cmwsIHtcXFxcbiAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcXFxuICAgICAgICB9LFxcXFxuICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICBcXFxcXFxcInBhcmFtc1xcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJkYXRhXFxcXFxcXCI6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJuYW1lXFxcXFxcXCI6IHRhc2submFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJweWNvZGVcXFxcXFxcIjogdGFzay5weWNvZGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibm90ZVxcXFxcXFwiOiB0YXNrLm5vdGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidGVzdF9jb2RlXFxcXFxcXCI6IHRhc2sudGVzdF9jb2RlLFxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJhdXRoXFxcXFxcXCI6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJuYW1lXFxcXFxcXCI6IGhvdXNlX2RhdGEudXNlcm5hbWV8fFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGFzc3dvcmRcXFxcXFxcIjogaG91c2VfZGF0YS5wYXNzd29yZHx8XFxcXFxcXCJcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSksXFxcXG4gICAgICAgIG1ldGhv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H07XFxcXG4gICAgICAgICAgICAvLyBsb2coc2VuZF9kYXRhKTtcXFxcbiAgICAgICAgICAgIGxldCBwYXIyID0ge2hlYWRlcnM6eydjb250ZW50LXR5cGUnOidhcHBsaWNhdGlvbi9qc29uO2NoYXJzZXQ9VVRGLTgnLCdVc2VyLUFnZW50JzpkZXZfc2V0X2luZm9bM119LGJvZHk6SlNPTi5zdHJpbmdpZnkoc2VuZF9kYXRhKSxtZXRob2Q6J1BPU1QnfTtcXFxcbiAgICAgICAgICAgIC8vIHBhcjIgPSBKU09OLnN0cmluZ2lmeShwYXIyKTsgLy94NemHjOmdouivt+axguaJjemcgOimgee8lueggVxcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgYmFja19yZXQgPSByZXF1ZXN0KGluZm9fc2V0X3VybCwgcGFyMik7XFxcXG4gICAgICAgICAgICAgICAgYmFja19yZXQgPSBKU09OLnBhcnNlKGJhY2tfcmV0KS5yZXN1bHQ7XFxcXG4gICAgICAgICAgICAgICAgaWYoYmFja19yZXQuc3RhdHVzPT09MCl7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjmiJDlip9cXFxcXFxcXG4nK2JhY2tfcmV0LmRldGFpbDtcXFxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/neWtmOWksei0pVxcXFxcXFxcbicrYmFja19yZXQuZGV0YWlsO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor69cXFxcXFxcXG4nK2UubWVzc2FnZTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfWVsc2V7XFxcXG4gICA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9IHRleHRDb250YWluZXIuaW5uZXJIVE1MO1xcXFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIub25jbGljaz1mdW5jdGlvbigpe1xcXFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cubG9jYXRpb24uaHJlZiA9IHVybHx8XFxcXFxcXCJhYm91dDpibGFuay9ub3RpY2VcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgLy8g6K6+572u5paH5pys5a655Zmo5a695bqm5Li65paH5pys5YaF5a6555qE5a695bqmXFxcXG4gICAgICAgICAgICAgICAgdGV4dENvbnRhaW5lci5zdHlsZS53aWR0aCA9IGAke3RleHRDb250YWluZXIub2Zmc2V0V2lkdGh9cHhgO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgLy8g5aSN5Yi25paH5pys5YaF5a655bm26L+95Yqg5Yiw5paH5pys5a655Zmo5ZCO6Z2iXFxcXG4gICAgICAgICAgICAgICAgdGV4dENvbnRhaW5lci5pbm5lckhUTUwgKz0gJyAnICsgdGV4dDtcXFxcblxcXFxuICAgICAgICAgICAgICAgIC8vIOWKqOaAgeiuoeeul+WKqOeUu+aMgee7reaXtumXtFxcXFxuICAgICAgICAgICAgICAgIGNvbnN0IGR1cmF0aW9uID0gKHRleHRDb250YWluZXIub2Zmc2V0V2lkdGggLyB0ZXh0Q29udGFpbmVyLnBhcmVudEVsZW1lbnQub2Zmc2V0V2lkdGgpICogMTA7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICB2YXIgc3R5bGVFbGVtZW50cyA9IGRvY3VtZW50LmhlYWQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ3N0eWxlJyk7XFxcXG5cXFxcblxcXFxuICAgICAgICAgICAgICAgIHN0eWxlRWxlbWVudHNbMl0uaW5uZXJIVE1MID0gYC5tYXJxdWVlIHNwYW4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMTAwJTtcXFxcbiAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uOiBtYXJxdWVlICR7ZHVyYXRpb259cyBsaW5lYXIgaW5maW5pdGVcXFxcbiAgICAgICAgICAgICAgICB9YDtcXFxcblxcXFxuICAgICAgICAgICAgfSwgaHRtbCwgdXJsKSxcXFxcbiAgICAgICAgICAgIHVybEludGVyY2VwdG9yOiAkLnRvU3RyaW5nKChjb250ZW50KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0PT09XFxcXFxcXCJhYm91dDpibGFuay9ub3RpY2VcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygoY29udGVudCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWFrOWRilxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHkjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5kUnVsZTogXFxcXFxcXCJqczpcXFxcXFxcIiArICQkJC50b1N0cmluZygoY29udGVudCkgPT4gc2V0UmVzdWx0KFt7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBjb250ZW50LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJyaWNoX3RleHRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XSksY29udGVudClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgY29udGVudCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSwgY29udGVudCB8fCB0ZXh0KSxcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxufVxcXCJ9XVwiLFwicHJveHlcIjpcIlwifSIsInBpY1VybCI6Imh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3ZpZS8zMC5zdmciLCJ0aXRsZSI6IuOAjOWuheeUt+Wls+elnuOAjSJ9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement