Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥哈皮父子全集@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczpcXG52YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcXG52YXIgY29udHMgPSBwZGZhKGh0bWwsICdib2R5JiYuZXBpc29kZS1saXN0JylbMF07XFxudmFyIGxpc3QgPSBwZGZhKGNvbnRzLCAnYm9keSYmYScpO1xcbnZhciBpID0gbGlzdC5sZW5ndGhcXG5pZiAoaT4wKXtcXG52YXIgdGl0bGUgPSBwZGZoKGxpc3RbaSxpLTFdLCAnYSYmVGV4dCcpO1xcbnNldFJlc3VsdChcXFwi5pu05paw6IezOiBcXFwiICsgdGl0bGUpO31cIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKTuOmAmueUqOino+aekFwiLFwicGF0aFwiOlwibGF6eVwiLFwicnVsZVwiOlwidmFyIGxhenkgPSAkKCcnKS5sYXp5UnVsZSgoTVlfSE9NRSkgPT4ge1xcbiAgZXZhbChnZXRDcnlwdG9KUygpKVxcbiAgXFxuICAgIHZhciB1cmwgPSByZXF1ZXN0KGlucHV0KS5tYXRjaCgvd2luZG93LndoYXRUTUR3aGF0VE1EUFBQUCA9ICcoLio/KSc7LylbMV1cXG4gICAgbG9nICh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FxudmFyIGh0bWwgPSBmZXRjaChiYXNlX3VybCwge1xcbiAgICBoZWFkZXJzOiB7XFxuICAgICAgICAnVXNlci1BZ2VudCc6IE1PQklMRV9VQVxcbiAgICB9XFxufSk7XFxuXFxudmFyIEljb25fcHJlZml4ID0gJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbW9yZS8nO1xcblxcbmQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfov5Tlm54nLFxcbiAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTsgICAgIFxcbiAgICAgICAgICAgICAgICBiYWNrKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+i/lOWbnuinhOWImemmlumhtVxcXCIgIFxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIHBpY191cmw6IEljb25fcHJlZml4ICsgJzQ3LnBuZycrIFxcXCJAUmVmZXJlcj1cXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl9zbWFsbF8zXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgfSk7XFxuXFxuXFxuZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+etm+mAiScsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL3NoYWk/cGFnZT1meXBhZ2Ujbm9IaXN0b3J5IycsXFxuICAgICAgICAgICAgcGljX3VybDogSWNvbl9wcmVmaXggKyAnMjEzLnBuZycgKyBcXFwiQFJlZmVyZXI9XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCJcXG4gICAgICAgIH0pO1xcblxcbmQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfljoblj7InLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vaG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IHZhciBkYXRhID0gb2JqLmRhdGE7XFxuICAgICAgICB2YXIgcnVtID0gZ2V0TXlWYXIoJ3JudW0nKTtcXG5cXG4gICAgICAgIHZhciBpID0gTnVtYmVyKGdldE15VmFyKCdiYW5uZXJpJywgJzAnKSk7XFxuICAgICAgICBpZiAocnVtICE9ICcnKSB7XFxuICAgICAgICAgICAgaSA9IE51bWJlcihydW0pICsgMVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3JudW0nKVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpID0gaSArIDE7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhpKVxcbiAgICAgICAgLy9sb2coZGF0YS5sZW5ndGgpXFxuXFxuICAgICAgICBpZiAoaSA+IGRhdGEubGVuZ3RoIC0gMSkge1xcbiAgICAgICAgICAgIGkgPSAwXFxuICAgICAgICB9XFxuICAgICAgICB2YXIgaXRlbSA9IGRhdGFbaV07XFxuICAgICAgICAvL2xvZyhpdGVtKVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKGlkKydiYXInLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnRpdGxlLFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IGl0ZW0udXJsLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgLy9uYW1lOiBpdGVtLnRpdGxlLnJlcGxhY2UoLzxbXj5dKz4vZywgJycpLFxcbiAgICAgICAgICAgICAgICAgICAgLy9zbmFtZTogaXRlbS5leHRyYS5zbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIC8vc3R5cGU6IGl0ZW0uZXh0cmEuc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAvL3N1cmw6IGl0ZW0udXJsLFxcbiAgICAgICAgICAgICAgICAgICAgLy9pbWc6aXRlbS5pbWcsX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xcbmxldCBjaG9zZV93ZWVrID0gZ2V0TXlWYXIoJ3dlZWsnLCBub3dfV2Vlayk7XFxudmFyIHdrVG9udW0gPSBmdW5jdGlvbih3aykge1xcbiAgICAgICAgaWYgKC/lkah85pif5pyfLy50ZXN0KHdrKSkge1xcbiAgICAgICAgICAgIHdrID0gd2sucmVwbGFjZSgv5ZGofOaYn+acny8sIFxcXCJcXFwiKVxcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIG1hcCA9IHtcXG4gICAgICAgICAgICBcXFwi5pelXFxcIjogNyxcXG4gICAgICAgICAgICBcXFwi5LiAXFxcIjogMSxcXG4gICAgICAgICAgICBcXFwi5LqMXFxcIjogMixcXG4gICAgICAgICAgICBcXFwi5LiJXFxcIjogMyxcXG4gICAgICAgICAgICBcXFwi5ZubXFxcIjogNCxcXG4gICAgICAgICAgICBcXFwi5LqUXFxcIjogNSxcXG4gICAgICAgICAgICBcXFwi5YWtXFxcIjogNlxcbiAgICAgICAgfTtcXG4gICAgICAgIHJldHVybiBtYXBbd2tdXFxuICAgIH1cXG4gICAgbGV0IHdrX251bSA9IHdrVG9udW0oY2hvc2Vfd2Vlayk7XFxuLy9sb2cod2tfbnVtKVxcbmZvciAodmFyIGsgPSAxOyBrIDw9IDc7IGsrKykge1xcbiAgICBldmFsKCd2YXIgd2snICsgayArICc9cGRmYShodG1sLCBcXFwiLmhsLWxpc3Qtd3JhcCwnICsgKGs9PTA/MDprKSArICcmJi5obC1saXN0LWl0ZW1cXFwiKTsnKTsvL+aYn+acn+WIl+ihqFxcbiAgICBpZiAod2tfbnVtID09IGspIHtcXG4gICAgICAgIGV2YWwoJ3drJytrKS5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIHZhciB1cmxsID0gcGQoaXRlbSwgJ2EmJmhyZWYnKSArICcjaW1tZXJzaXZlVGhlbWUjJztcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtL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ICAgICAgIH1cXG5cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGAke3RpdGxlfWAsXFxuICAgICAgICAgICAgY29sX3R5cGU6IHNlbGVzLmNvbF90eXBlLFxcbiAgICAgICAgICAgIGltZzogZXZhbChzZWxlcy5pbWcpLFxcbiAgICAgICAgICAgIGhvdDogIGV2YWwoc2VsZXMuZDEpLFxcbiAgICAgICAgICAgIGRlc2M6IGV2YWwoc2VsZXMuZDIpLFxcbiAgICAgICAgICAgIHVybDogZXZhbChzZWxlcy51cmwpICsgJyNpbW1lcnNpdmVUaGVtZSMnKydAcnVsZT1qczokLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9lalxcXCIpJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogc3RpdGxlLFxcbiAgICAgICAgICAgICAgICBzdGF0ZTpkZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH0pXFxufVxcblxcbnZhciBJY29uX3ByZWZpeCA9ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3JlZC8nO1xcblxcbnZhciBjYXRlZ29yeV9JY29uID0gWycxMS5wbmcnLCAnMzkucG5nJywgJzIzLnBuZycsJzU0LnBuZycsJzM4LnBuZyddO1xcblxcbnZhciByYW5rcyA9IFsn5YWo6YOoJywgJ+aWsOaXp+eVquWJpycsICfok53lhYnml6Dkv64nLCAn5Yqo5ryr5Ymn5Zy6Jywn5qyn576O5Yqo5ryrJ11cXG5cXG52YXIgcmluZGV4ID0gZ2V0TXlWYXIoJ3JpbmRleCcsICcwJylcXG5cXG5yYW5rcy5tYXAoKHgsIGkpID0+IHtcXG4gICAgdmFyIHRpdGxlID0gaSA9PSByaW5kZXggPyBg4oCc4oCc4oCd4oCdPHNtYWxsPjxiPjxmb250IGNvbG9yPVxcXCIjMUU5MEZGXFxcIj4ke3h9PC9mb250PjwvYj48L3NtYWxsPmAgOiBg4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cXG4gICAgICAgICAgICAgICAgdGhpc1twcm9wZXJ0eV0gPSB2YWx1ZTtcXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHByb3BlcnR5ICsgXFxcIjpcXFwiICsgdmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9LFxcbiAgICAgICAgZXZhbEpTUnVsZShpdGVtLFxcbiAgICAgICAgICAgIGpzUnVsZSkge1xcbiAgICAgICAgICAgIGxldCBydWxlID0ganNSdWxlLnJlcGxhY2UoXFxcIkBqczpcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiXFxcIik7XFxuICAgICAgICAgICAgcnVsZSA9IHJ1bGUudHJpbSgpO1xcbiAgICAgICAgICAgIC8vbG9nKCQuc3RyaW5naWZ5KHJ1bGUpKVxcbiAgICAgICAgICAgIGxldCBpbnB1dCA9IGl0ZW07XFxuICAgICAgICAgICAgaWYgKHJ1bGUuc3RhcnRzV2l0aChcXFwiKFxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoXFxcInJlc3VsdCA9IFxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAvKipcXG4gICAgICAgICAgICAgICAgICog6L+Y5Y6f5oiQICQudG9TdHJpbmcoLi4uKSDnmoTmnIDnu4jnu5PmnpzvvIzovr7liLDmnIDnu4jlpITnkIbmlrnlvI/ot5/kuIrpnaLnmoQgaWYg5LiA6Ie055qE55uu55qEXFxuICAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICBldmFsKFxcXCJyZXN1bHQgPSBcXFwiICsgXFxcIigoKSA9PiB7XFxcIiArIHJ1bGUgKyBcXFwifSkoKVxcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0IHx8IFxcXCJcXF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5o6l5aSE55CGKHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgfHwgXFxcIlxcXCI7XFxuICAgICAgICB9LFxcbiAgICAgICAgaXNOdWxsKHBhcmFtKSB7XFxuICAgICAgICAgICAgaWYgKHBhcmFtID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH0sXFxuICAgICAgICBpc0Jvb2xlYW4odmFyaWFibGUpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhcmlhYmxlICE9PSBcXFwiYm9vbGVhblxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLlvIDlkK/mipjlj6Dor7fkvKDlhaXluIPlsJTlgLxcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAg5riF6ZmkKGxpc3QpIHtcXG4gICAgICAgICAgICBpZiAodGhpcy5pc051bGwobGlzdCkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChsaXN0LmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIua4hemZpOaKpemUmTror7fkvKDliJfooahcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5jbGVhcnMgPSBsaXN0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWFqOa4hShsaXN0KSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgYyA9IHRoaXMuY2xlYXJhbGw7XFxuICAgICAgICAgICAgbGlzdCA9IGMuY29uY2F0KGxpc3QpO1xcbiAgICAgICAgICAgIHRoaXMuY2xlYXJhbGwgPSBsaXN0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOa6kOeggShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMuaHRtbCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOeVjOmdoihpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMubGF5b3V0ID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAg6aG156CBKGlucHV0KSB7XFxuICAgICAgICAgICAgdGhpcy5wYWdlID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAg54q25oCBKGlucHV0KSB7XFxuICAgICAgICAgICAgdGhpcy5zdGF0ZSA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOW8gOWQr+aQnOe0oihpbnB1dCkge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0aGlzLnNlYXJjaCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOW8gOWQr+aKmOWPoChpbnB1dCkge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0aGlzLmlzQm9vbGVhbihpbnB1dCk7XFxuICAgICAgICAgICAgdGhpcy5vcGVuID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAgc2V0VGl0bGUoaywgaSwgdCkge1xcbiAgICAgICAgICAgIHJldHVybiBrID09IGkgPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHQuZm9udGNvbG9yKHRoaXMu5YiG57G76aKc6ImyKSA6IHQ7XFxuICAgICAgICB9LFxcbiAgICAgICAgYWN0aW9uKG9iaikge1xcbiAgICAgICAgICAgIHJldHVybiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhvYmopO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihvYmouc3RhdGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmNsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICB9LCBvYmopLFxcbiAgICAgICAgICAgIH0sIF07XFxuICAgICAgICB9LFxcbiAgICAgICAgY2hlY2tQYXJhbSgpIHtcXG4gICAgICAgICAgICB2YXIgb2JqID0ge307XFxuICAgICAgICAgICAgaWYgKHRoaXMucGFnZSA9PSAwICYmIHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl6aG156CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIumhteeggVxcXCJdID0gdGhpcy5wYWdlO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMuaHRtbCA9PSBcXFwiZW1wdHlcXFwiICYmIHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5rqQ56CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIua6kOeggVxcXCJdID0gdGhpcy5odG1sO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLmupDnoIFcXFwiXSA9IGh0bWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMubGF5b3V0ID09IFxcXCJ1bmRlZmluZWRcXFwiICYmIHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl55WM6Z2iXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gdGhpcy5sYXlvdXQ7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gZDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gb2JqO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWIm+W7uuWKqOaAgeWIhuexuyhydWxlT2JqKSB7XFxuICAgICAgICAgICAgbGV0IGl0ZW1zID0gW107XFxuICAgICAgICAgICAgbGV0IGNhdGVzID0gW107XFxuICAgICAgICAgICAgaWYgKHJ1bGVPYmogPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIHJ1bGVPYmogPSBbXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy/liJ3lp4vljJblj5jph4/lvIDlp4tcXG4gICAgICAgICAgICBjb25zdCBwYXJhbSA9IHRoaXMuY2hlY2tQYXJhbSgpO1xcbiAgICAgICAgICAgIGNvbnN0IHBhZ2UgPSBwYXJhbS7pobXnoIE7XFxuICAgICAgICAgICAgY29uc3QgaHRtbCA9IHBhcmFtLua6kOeggTtcXG4gICAgICAgICAgICBjb25zdCBkID0gcGFyYW0u55WM6Z2iO1xcbiAgICAgICAgICAgIGNvbnN0IOeKtuaAgSA9IHRoaXMuc3RhdGU7XFxuICAgICAgICAgICAgY29uc3Qgc2VhcmNoID0gdGhpcy5zZWFyY2g7XFxuICAgICAgICAgICAgY29uc3QgZW1wdHkgPSBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgY29uc3Qg5oqY5Y+g54q25oCBID0gdGhpcy5vcGVuO1xcbiAgICAgICAgICAgIHZhciDlsZXlvIAgPSB0aGlzLuWxleW8gDtcXG4gICAgICAgICAgICB2YXIg5oqY5Y+gID0gdGhpcy7mipjlj6A7XFxuICAgICAgICAgICAgdmFyIOWFqOa4hSA9IHRoaXMuY2xlYXJhbGw7XFxuICAgICAgICAgICAgdmFyIOa4hemZpCA9IHRoaXMuY2xlYXJzO1xcbiAgICAgICAgICAgIC8v5Yid5aeL5YyW5Y+Y6YeP57uT5p2fXFxuICAgICAgICAgICAgbGV0IGluaXRfY2F0ZSA9IG5ldyBBcnJheSgyMCkuZmlsbChcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgIGNvbnN0IGZvbGQgPSBnZXRNeVZhcihNWV9SVUxFLmdyb3VwLCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgIGNvbnN0IGNhdGVfdGVtcCA9IEpTT04ucGFyc2UoXFxuICAgICAgICAgICAgICAgIGdldE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShpbml0X2NhdGUpKVxcbiAgICAgICAgICAgICk7XFxuICAgICAgICAgICAgaWYgKHNlYXJjaCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCInaGlrZXI6Ly9zZWFyY2g/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZSArIFxcXCImcz0nK2lucHV0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLmkJzntKLlhbPplK7or41cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcImtleXdvcmRcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwia2V5d29yZFxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjb25zdCBjYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgcnVsZU9iai5mb3JFYWNoKCh4KSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgIC8vbG9nKHgpXFxuICAgICAgICAgICAgICAgIGlmICh4Lmpzb24gIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgICAgICB4Lmpzb24ubWFwKGsgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChKU09OLnN0cmluZ2lmeShrKS5yZXBsYWNlKC9eXFxcXFt8XFxcXF0kL2csICcnKSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAvL2NhdGVnb3JpZXMucHVzaCh4Lmpzb24pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHgu5LiA57qn5a6a5L2NKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7kuIDnuqflrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCB4LuS4gOe6p+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh4LuWkp+exu+WumuS9jS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKGh0bWwsIHgu5aSn57G75a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IFtwZGZhKGh0bWwsIHgu5aSn57G75a6a5L2NKS5qb2luKCdcXFxcbicpXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLy0t6aKd5aSW5aSE55CGLS1cXG4gICAgICAgICAgICAgICAgaWYgKCgn5aKe5YqgJyBpbiB4KSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu5aKe5YqgLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHgu5aKe5YqgID0gZXZhbCh4LuWinuWKoCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHgu5aKe5YqgLmNvbmNhdChzbGlzdCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCgn6KGl5YWFJyBpbiB4KSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu6KGl5YWFLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHgu6KGl5YWFID0gZXZhbCh4LuihpeWFhSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHNsaXN0LmNvbmNhdCh4LuihpeWFhSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8tLemineWkluWkhOeQhi0tXFxuICAgICAgICAgICAgICAgIHZhciDkuIDnuqcgPSBsaXN0Lm1hcCgocykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIShcXFwi5bCP57G7XFxcIiBpbiB4KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHgu5bCP57G7ID0gXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7lsI/nsbsuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2xpc3QgPSB0aGlzLmV2YWxKU1J1bGUocywgeC7lsI/nsbspO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIOWumuS9jSA9IHNsaXN0Lm1hcCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgeC7moIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSB0aGlzLmdldFVybChpdGVtLCB4KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkob2JqKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIOWumuS9jTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKOS4gOe6pylcXG4gICAgICAgICAgICAgICAgLy9sb2co5LiA57qnLmxlbmd0aClcXG4gICAgICAgICAgICAgICAgaWYgKOS4gOe6py5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXCJcXFxcblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIOS4gOe6py5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFwiLFxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3JpZXMpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKOaKmOWPoOeKtuaAgSkge1xcbiAgICAgICAgICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcIjFcXFwiID8g5oqY5Y+gIDog5bGV5byALFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRpdGxlLCBmb2xkLCB1LCBhbGwsIGV4cHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb2xkID0gZ2V0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgW+WxleW8gCwg5oqY5Y+gXSA9IGV4cHM7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN4ID0gZmluZEl0ZW1zQnlDbHModGl0bGUgKyAnY2F0ZV9idXR0b24nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignY2F0ZV9idXR0b24nLCBjeCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHRpdGxlICsgJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjeCA9IHN0b3JhZ2UwLmdldE15VmFyKCdjYXRlX2J1dHRvbicsIFtdKS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhbJ2NvbF90eXBlJ10gPSB4Wydjb2xfdHlwZSddID8geFsnY29sX3R5cGUnXSA6IHhbJ3R5cGUnXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHRpdGxlICsgJ2NhdGVfbGluZScsIGN4KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyphbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0odGl0bGUgKyAnY2F0ZV9leHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT0gMSA/IOWxleW8gCA6IOaKmOWPoCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLmdyb3VwLCBmb2xkID09PSBcXFwiMVxcXCIgPyBcXFwiMFxcXCIgOiBcXFwiMVxcXCIpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9SVUxFLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOWFqOa4hSwgW+WxleW8gCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOaKmOWPoFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfUlVMRS50aXRsZSArICdjYXRlX2V4cCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogdGhpcy5hY3Rpb24oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2w6IOa4hemZpCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5mb3JFYWNoKChjYXRlZ29yeSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3J5KVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgICAgICAgICAvKmlmICjlsI/nsbvlrprkvY0uaW5jbHVkZXMoXFxcIjtcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jS5zcGxpdChcXFwiO1xcXCIpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgaWYgKHN1Yl9jYXRlZ29yaWVzLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVsxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ki9cXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGluZGV4KVxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBKU09OLnBhcnNlKGBbJHtjYXRlZ29yeX1dYCk7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhzdWJfY2F0ZWdvcmllcylcXG4gICAgICAgICAgICAgICAgICAgIC8vIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/lpKfnsbtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIF/lpKfnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnRpdGxlO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXdSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSAnJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdXJsID0gcGQoaXRlbSwgX+Wkp+exu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0g5LiA57qn5YiG57G75aSE55CGKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiZHRfXFxcIiArIHBhcmFtcy5qc29uLnR5cGUsIHBhcmFtcy5qc29uLnZhbHVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9saW5lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL+Wwj+exu1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmFwb3MgPSBmYWxzZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAoaXRlbS5pbmNsdWRlcygndHlwZT1cXFwiQGV4dHJhXFxcIicpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFwb3MgPSB0cnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKCfpmYTliqDlrprkvY0nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4dHJhcG9zKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwgXFxcImEmJnN0YXRlXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwgXFxcImEmJnZhbHVlXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNvbiA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLypzd2l0Y2ggKHRydWUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8ganNvbiA9IHBkKGl0ZW0sIOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qdmFyIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzFdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU65YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpOyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhcmFtcyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGhpcy5zZXRUaXRsZShrZXkudG9TdHJpbmcoKSwgY2F0ZV90ZW1wW2luZGV4XSwgdGl0bGUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5XFxcIiArIFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmFsbGNsZWFycy5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignY2F0ZV9idXR0b24nKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaGVhZC5jYXRlXFxcIiwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3RhdGUsIHBhcmFtcy5qc29uKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogTVlfUlVMRS50aXRsZSArICdjYXRlX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogTVlfUlVMRS50aXRsZSArICdjYXRlX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChmb2xkID09PSBcXFwiMVxcXCIgfHwg5oqY5Y+g54q25oCBID09IGZhbHNlKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zID0gaXRlbXMuY29uY2F0KGNhdGVzKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGZvbGQgPT09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignY2F0ZV9idXR0b24nLCBjYXRlcylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiBzZXRQcmVSZXN1bHQgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMgPSBkLmNvbmNhdChpdGVtcyk7XFxuICAgICAgICAgICAgICAgIC8v5riF56m657un5om/5pWw57uEXFxuICAgICAgICAgICAgICAgIGQubGVuZ3RoID0gMDtcXG4gICAgICAgICAgICAgICAgc2V0UHJlUmVzdWx0KGl0ZW1zKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpdGVtcy5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sXFxuICAgIH07XFxuICAgIG9iai7pooTorr4ob3B0aW9ucyk7XFxuICAgIHJldHVybiBvYmo7XFxufVxcblxcbnZhciDnirbmgIEgPVxcbiAgICB0eXBlb2Yg54q25oCB5qCH6K6wICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOeKtuaAgeagh+iusCAhPSBcXFwiXFxcIiA/IOeKtuaAgeagh+iusCA6IE1ZX1JVTEUudXJsO1xcblxcbmxldCBkdF9kZWJ1ZyA9IGZhbHNlO1xcblxcbmFkZExpc3RlbmVyKFxcbiAgICBcXFwib25DbG9zZVxcXCIsXFxuICAgICQudG9TdHJpbmcoKCkgPT4ge30pXFxuKTtcXG5cXG52YXIgQ3JlYXRlID0ge1xcbiAgICBuZXh0UGFnZTogZnVuY3Rpb24oKSB7XFxuICAgICAgICB2YXIgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBuZXh0ID0gZXZhbCjkuIvkuIDpobUpO1xcbiAgICAgICAgICAgIC8vbG9nKCduOicrbmV4dClcXG4gICAgICAgICAgICBpZiAobmV4dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ+S4i+S4gOmhtemTvuaOpeS4uuepuicpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlc3VsdCA9IHRydWU7XFxuICAgICAgICAgICAgaWYgKHRydWVfdXJsID09IG5leHQpIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIC8vbG9nKFxcXCLlj6/og73kuI3lrZjlnKjkuIvkuIDpobXmiJbogIXkuIvkuIDpobXlrprkvY3mnInpl67pophcXFwiKTtcXG4gICAgICAgICAgICBsb2coXFxcIumUmeivr+S/oeaBrzpcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICgobmV4dCA9PSBcXFwiXFxcIiB8fCBuZXh0ID09IHVuZGVmaW5lZCkgJiYgcGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgbmV4dCA9IHRydWVfdXJsO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvL3Jlc3VsdD1mYWxzZTtcXG4gICAgICAgICAgICBuZXh0ID0gZ2V0TXlWYXIo54q25oCBKTtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vbG9nKCdsJyt0cnVlX3VybClcXG4gICAgICAgIC8vbG9nKCduJytuZXh0KVxcbiAgICAgICAgaWYgKHBhZ2UgIT0gMSkge1xcbiAgICAgICAgICAgIGlmICh0cnVlX3VybCA9PSBuZXh0ICYmICFyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICAgICAgLy9wdXRNeVZhcijnirbmgIEsIG5leHQpO1xcbiAgICB9LFxcbiAgICBnZXRCYWNrSW1hZ2U6IGZ1bmN0aW9uKGltZ3VybCkge1xcbiAgICAgICAgdmFyIHJlc3VsdCA9IGltZ3VybDtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgcmVzdWx0ID0gL3VybCg/OlxcXFxzKyk/XFxcXCgoLio/KVxcXFwpL2dcXG4gICAgICAgICAgICAgICAgLmV4ZWMoaW1ndXJsKVsxXVxcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvKCd8XFxcInwmcXVvdDspL2dtLCBcXFwiXFxcIik7XFxuICAgICAgICB9IGNhdGNoIHt9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICB9LFxcbiAgICBodHRwSGFuZGxlOiBmdW5jdGlvbihpbnB1dCkge1xcbiAgICAgICAgaWYgKGlucHV0LnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgIHJldHVybiBpbnB1dDtcXG4gICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwiLy9cXFwiKSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6XFxcIiArIGlucHV0O1xcbiAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5zdGFydHNXaXRoKFxcXCIvXFxcIikpIHtcXG4gICAgICAgICAgICByZXR1cm4gTVlfSE9NRSArIGlucHV0O1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBpbWdIYW5kbGU6IGZ1bmN0aW9uKGl0ZW0sIHJ1bGUpIHtcXG4gICAgICAgIHZhciBpbWcgPSBcXFwiXFxcIjtcXG4gICAgICAgIGlmIChydWxlLmltZy5zdGFydHNXaXRoKFxcXCJwZFxcXCIpKSB7XFxuICAgICAgICAgICAgaW1nID0gZXZhbChydWxlLmltZyk7XFxuICAgICAgICB9IGVsc2UgaWYgKHJ1bGUuYmFja2ltZykge1xcbiAgICAgICAgICAgIGltZyA9IHBkZmgoaXRlbSwgcnVsZS5pbWcpO1xcbiAgICAgICAgICAgIGltZyA9IHRoaXMuZ2V0QmFja0ltYWdlKGltZyk7XFxuICAgICAgICAgICAgaW1nID0gdGhpcy5odHRwSGFuZGxlKGltZyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGltZyA9IHBkZmgoaXRlbSwgcnVsZS5pbWcpO1xcbiAgICAgICAgICAgIGlmICghaW1nLnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBpbWcgPSBwZChpdGVtLCBydWxlLmltZyk7XFxuICAgICAgICAgICAgICAgIGltZyA9IHRoaXMuaHR0cEhhbmRsZShpbWcpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpbWcgKyBydWxlLnJlZjtcXG4gICAgfSxcXG4gICAgdXJsSGFuZGxlOiBmdW5jdGlvbihpdGVtLCBydWxlKSB7XFxuICAgICAgICB2YXIgaHJlZiA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKHJ1bGUudXJsLnN0YXJ0c1dpdGgoXFxcInBkXFxcIikpIHtcXG4gICAgICAgICAgICBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGhyZWYgPSBwZChpdGVtLCBydWxlLnVybCk7XFxuICAgICAgICB9XFxuICAgICAgICBocmVmID0gcnVsZS5pbXQgPyBocmVmICsgXFxcIiNpbW1lcnNpdmVUaGVtZSNcXFwiIDogaHJlZjtcXG4gICAgICAgIHJldHVybiBocmVmO1xcbiAgICB9LFxcbiAgICBzZXRDb250ZW50OiBmdW5jdGlvbihpdGVtLCBpbnB1dCkge1xcbiAgICAgICAgbGV0IG91dHB1dCA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKGlucHV0ID09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgIHJldHVybiBvdXRwdXQ7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwicGRcXFwiKSkge1xcbiAgICAgICAgICAgIG91dHB1dCA9IGV2YWwoaW5wdXQpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBvdXRwdXQgPSBwZGZoKGl0ZW0sIGlucHV0KTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBvdXRwdXQ7XFxuICAgIH0sXFxuICAgIHJlZnJlc2g6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgYWRkTGlzdGVuZXIoXFxuICAgICAgICAgICAgXFxcIm9uUmVmcmVzaFxcXCIsXFx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gICAgICAgIGBcXFxcblxcXFx0aW1n5a6a5L2NOiAgJHtydWxlLmltZ30gIC0tLT4g57uT5p6cOiAgJHtvYmouaW1nfWAgK1xcbiAgICAgICAgICAgIChydWxlLmNvbnRlbnQgIT0gdW5kZWZpbmVkID8gYFxcXFxuXFxcXHRjb250ZW505a6a5L2NOiAgJHtydWxlLmNvbnRlbnR9ICAtLS0+IOe7k+aenDogICR7b2JqLmNvbnRlbnR9YCA6ICcnKSArXFxuICAgICAgICAgICAgYFxcXFxuXFxcXHR1cmzlrprkvY06ICAke3J1bGUudXJsfSAgLS0tPiDnu5Pmnpw6ICAke29iai51cmx9YFxcbiAgICAgICAgKTtcXG4gICAgICAgIGxvZygnLS0tLS0tLS0tLScgKyAoaSArIDEpICsgJzrosIPor5Xnu5PmnZ8tLS0tLS0tLS0tJyk7XFxuICAgIH0sXFxuICAgIGpzb25MaXN0OiBmdW5jdGlvbihhcnIsIGpzb24sIHJ1bGUpIHtcXG4gICAgICAgIGlmIChqc29uLmNvbnN0cnVjdG9yICE9IE9iamVjdCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGpzb24gPSBKU09OLnBhcnNlKGpzb24pO1xcbiAgICAgICAgICAgIH0gY2F0Y2gge31cXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChqc29uW3J1bGUubGlzdF0gPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgYXJyLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5peg5YaF5a65PC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7fSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgZGVidWcgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmRlYnVnLCBmYWxzZSk7XFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXG4gICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgIGxvZygn5a6a5L2N5YiX6KGoOicgKyBydWxlLmxpc3QpO1xcbiAgICAgICAgfVxcbiAgICAgICAganNvbltydWxlLmxpc3RdLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBldmFsKHJ1bGUudGl0bGUpO1xcbiAgICAgICAgICAgIHZhciBkZXNjID0gZXZhbChydWxlLmRlc2MpO1xcbiAgICAgICAgICAgIHZhciBjb250ZW50ID0gZXZhbChydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgICAgIHZhciBpbWcgPSBldmFsKHJ1bGUuaW1nKSArIHJ1bGUucmVmO1xcbiAgICAgICAgICAgIHZhciBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHJ1bGUuaW10ID8gaHJlZiArIFxcXCIjaW1tZXJzaXZlVGhlbWUjXFxcIiA6IGhyZWY7XFxuICAgICAgICAgICAgdmFyIGxhenkgPSBydWxlLmxhenkgPyBydWxlLmxhenkgOiBcXFwiXFxcIjtcXG5cXG4gICAgICAgICAgICB2YXIgZGQgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgICAgIHZhciByeCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIGltZyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICB1cmxcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgdGhpcy5kZWJ1Z2xvZyhpLCBpdGVtLCBydWxlLCByeCk7XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGlmIChsYXp5ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGRkW1xcXCJ1cmxcXFwiXSA9IGhyZWYgKyBsYXp5O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnIucHVzaChkZCk7XFxuICAgICAgICB9KTtcXG4gICAgfSxcXG4gICAgcnVsZUxpc3Q6IGZ1bmN0aW9uKGFyciwgaHRtbCwgcnVsZSkge1xcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsXFxuICAgICAgICAgICAgcnVsZS5saXN0KTtcXG4gICAgICAgIHZhciBkZWJ1ZyA9IHRoaXMuZ2V0Qm9vbGVhblZhbHVlKHJ1bGUuZGVidWcsXFxuICAgICAgICAgICAgZmFsc2UpO1xcbiAgICAgICAgdmFyIGVtcHR5ID0gdGhpcy5nZXRCb29sZWFuVmFsdWUocnVsZS5lbXB0eSk7XFxuICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICBsb2coJ+WumuS9jeWIl+ihqDonICsgcnVsZS5saXN0KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxpc3QuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgIHZhciB0aXRsZSA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLnRpdGxlKTtcXG4gICAgICAgICAgICB2YXIgZGVzYyA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmRlc2MpO1xcbiAgICAgICAgICAgIHZhciBpbWcgPSB0aGlzLmltZ0hhbmRsZShpdGVtLCBydWxlKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS5jb250ZW50KTtcXG5cXG4gICAgICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHJ4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIHVybFxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB0aGlzLmRlYnVnbG9nKGksIGl0ZW0sIHJ1bGUsIHJ4KTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgdmFyIGxhenkgPSBydWxlLmxhenkgPyBydWxlLmxhenkgOiBcXFwiXFxcIjtcXG4gICAgICAgICAgICB2YXIgZGQgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgaWYgKGxhenkgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgZGRbXFxcInVybFxcXCJdID0gdXJsICsgbGF6eTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyLnB1c2goZGQpO1xcbiAgICAgICAgfSk7XFxuICAgIH0sXFxuICAgIExpc3Q6IGZ1bmN0aW9uKGFyciwgaHRtbCwgcnVsZSwgcGFyYW0pIHtcXG4gICAgICAgIHBhcmFtID0gcGFyYW0gPyBwYXJhbSA6IHt9O1xcbiAgICAgICAgdmFyIGF1dG8gPSBwYXJhbS5hdXRvID8gcGFyYW0uYXV0byA6IGZhbHNlO1xcbiAgICAgICAgdmFyIHNob3cgPSBwYXJhbS5zaG93ID8gcGFyYW0uc2hvdyA6IGZhbHNlO1xcbiAgICAgICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgICAgICAgIC8vdGhpcy5zcGFnZS5zZXQodHJ1ZV91cmwpO1xcbiAgICAgICAgfVxcbiAgICAgICAgdGhpcy5yZWZyZXNoKCk7XFxuICAgICAgICB2YXIgZGVidWcgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmRlYnVnLCBmYWxzZSk7XFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCBydWxlLmxpc3QpO1xcbiAgICAgICAgaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgbG9nKCflrprkvY3liJfooag6JyArIHJ1bGUubGlzdCk7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyh0aGlzLm5leHRQYWdlKCkpXFxuICAgICAgICBpZiAoKHN0b3JhZ2UwLmdldE15VmFyKCd5aV9pc25leHQnLCAndCcpID09ICd0JyAmJiBsaXN0Lmxlbmd0aCA+IDApIHx8IHBhZ2UgPT0gMSkge1xcbiAgICAgICAgICAgIGxpc3QuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKFxcXCJwYWdlbnVtXFxcIik7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oXFxcInBhZ2VsaW5lXFxcIik7XFxuICAgICAgICAgICAgICAgIHZhciBpZCA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICB2YXIgY2xzID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgdmFyIGRlc2MgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS5kZXNjKTtcXG4gICAgICAgICAgICAgICAgdmFyIGltZyA9IHRoaXMuaW1nSGFuZGxlKGl0ZW0sIHJ1bGUpLnJlcGxhY2UoXFxcImh0dHBzOi8vd3d3Lmtla2U4LmFwcFxcXCIsXFxcImh0dHBzOi8vdnJlcy5taXhpbWl4aS5tZVxcXCIpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICAgICAgICAgIHZhciBjb250ZW50ID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuY29udGVudCk7XFxuXFxuICAgICAgICAgICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJ4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWJ1Z2xvZyhpLCBpdGVtLCBydWxlLCByeCk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZCA9IFxcXCJsYXN0aWRfXFxcIiArIHBhZ2U7XFxuICAgICAgICAgICAgICAgICAgICBjbHMgPSBcXFwibGFzdG1hcmtcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1nLnJlcGxhY2UoLy4qP3VybFxcXFw9KC4qPykvLFxcXCIkMVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAoZW1wdHkgPyBcXFwiaGlrZXI6Ly9lbXB0eSMjXFxcIiA6ICcnKSArIHVybCArICdAcnVsZT1qczokLnJlcXVpcmUoXFxcImVqXFxcIiknLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogY2xzLFxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSAmJiBzaG93KSB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJwYWdlbGluZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzbWFsbD7liqDovb3kuK0uLi48L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcInBhZ2VudW1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJwYWdlbnVtXFxcIiwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5Yiw5bqV5LqGPC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogXFxcImxhc3RcXFwiLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGxpc3QubGVuZ3RoID09IDAgJiYgcGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5peg5YaF5a65PC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7fSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0aGlzLm5leHRQYWdlKCkpIHtcXG4gICAgICAgICAgICAvL2xvZygndCcpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCd5aV9pc25leHQnLCAndCcpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvL2xvZygnZicpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCd5aV9pc25leHQnLCAnZicpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGF1dG8pIHtcXG4gICAgICAgICAgICAvL2NyZWF0ZU5leHRQYWdlKCk7XFxuICAgICAgICAgICAgYXV0b1BhZ2UoKTtcXG4gICAgICAgIH1cXG4gICAgfSxcXG59O1xcblxcbnZhciBleHRNZXRob2QgPSB7XFxuICAgIFRvUGFyYW1zOiBmdW5jdGlvbigpIHtcXG4gICAgICAgIHZhciBqc29uID0gYXJndW1lbnRzWzBdO1xcbiAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKGpzb24pXFxuICAgICAgICAgICAgLm1hcCgoa2V5KSA9PiBrZXkgKyBcXFwiPVxcXCIgKyBqc29uW2tleV0pXFxuICAgICAgICAgICAgLmpvaW4oXFxcIiZcXFwiKTtcXG4gICAgfSxcXG4gICAgdXJsUGFyc2U6IGZ1bmN0aW9uKHUpIHtcXG4gICAgICAgIHZhciBkaWN0ID0ge307XFxuICAgICAgICBkaWN0LlNvdXJjZSA9IHU7XFxuICAgICAgICBsZXQgcGFyYW1zID0gKHVybCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBxdWVyeVBhcmFtcyA9IHt9O1xcbiAgICAgICAgICAgIGxldCByZWcgPSAvKFtePz0mXSspPShbXj89Jl0rKS9nO1xcbiAgICAgICAgICAgIHVybC5yZXBsYWNlKHJlZywgZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgIHF1ZXJ5UGFyYW1zW2FyZ3VtZW50c1sxXV0gPSBhcmd1bWVudHNbMl07XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIHF1ZXJ5UGFyYW1zO1xcbiAgICAgICAgfTtcXG4gICAgICAgIHZhciBqYXZhVXJsID0gSmF2YUltcG9ydGVyKGphdmEubmV0LlVSTCk7XFxuICAgICAgICB3aXRoKGphdmFVcmwpIHtcXG4gICAgICA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AobGV0IGkgPSAwOyBpIDwgc3RyMi5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGlmIChzdHIxW2ldICE9PSBzdHIyW2ldKSB7XFxuICAgICAgICAgICAgICAgIGRpZmZDaGFycy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGluZGV4OiBpLFxcbiAgICAgICAgICAgICAgICAgICAgczE6IHN0cjFbaV0sXFxuICAgICAgICAgICAgICAgICAgICBzMjogc3RyMltpXSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGRpZmZDaGFycztcXG4gICAgfSxcXG4gICAgcmVwbGFjZUNoYXJBdDogZnVuY3Rpb24oc3RyLCBpbmRleCwgcmVwbGFjZW1lbnQpIHtcXG4gICAgICAgIGlmIChpbmRleCA8IDAgfHwgaW5kZXggPj0gc3RyLmxlbmd0aCkge1xcbiAgICAgICAgICAgIHJldHVybiBzdHI7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhpbmRleClcXG4gICAgICAgIGNvbnN0IGFyciA9IHN0ci5zcGxpdChcXFwiXFxcIik7XFxuICAgICAgICBhcnJbaW5kZXhdID0gcmVwbGFjZW1lbnQ7XFxuICAgICAgICByZXR1cm4gYXJyLmpvaW4oXFxcIlxcXCIpO1xcbiAgICB9LFxcbiAgICBnZXRPYmplY3RLZXlzRGlmZjogZnVuY3Rpb24ob2JqMSwgb2JqMikge1xcbiAgICAgICAgY29uc3QgZGlmZmVyZW50S2V5cyA9IFtdO1xcbiAgICAgICAgZm9yIChsZXQga2V5IGluIG9iajEpIHtcXG4gICAgICAgICAgICBpZiAoIW9iajIuaGFzT3duUHJvcGVydHkoa2V5KSB8fCBvYmoxW2tleV0gIT09IG9iajJba2V5XSkge1xcbiAgICAgICAgICAgICAgICBkaWZmZXJlbnRLZXlzLnB1c2goa2V5KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAg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h1MS5QYXJhbXMsIHUyLlBhcmFtcykpIHtcXG4gICAgICAgICAgICAgICAgaWYgKGR0X2RlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2codTEuUGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICBsb2codTIuUGF0aCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGRmID0gdGhpcy5maW5kRGlmZmVyZW50SW5kZXgoU3RyaW5nKHUxLlBhdGgpLCBTdHJpbmcodTIuUGF0aCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoZHRfZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhkZik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGRmLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSBkZlswXS5pbmRleDtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBmID0gZGYuZmlsdGVyKCh4KSA9PiAvXFxcXGQrLy50ZXN0KHguczIpKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZSA9IGZbMF0uaW5kZXg7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGVxID0gdGhpcy5yZXBsYWNlQ2hhckF0KFN0cmluZyh1Mi5QYXRoKSwgcmUsIFxcXCJmeXBhZ2VcXFwiKTtcXG4gICAgICAgICAgICAgICAgbmV4dHVybCA9IHUyLkhvc3RzICsgZXEgKyBjYSArIHRoaXMuVG9QYXJhbXModTIuUGFyYW1zKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgZXAgPSB0aGlzLmdldE9iamVjdEtleXNEaWZmKHUxLlBhcmFtcywgdTIuUGFyYW1zKVxcbiAgICAgICAgICAgICAgICBpZiAoZXAubGVuZ3RoID09IDEpIHtcXG4gICAgICAgIC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9IHVuZXNjYXBlKHVybCk7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChodG1sLmVuY3J5cHQgPT0gJzInKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVuZXNjYXBlKGJhc2U2NERlY29kZSh1cmwpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKC9tM3U4fG1wNC8udGVzdCh1cmwpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInZpZGVvOi8vXFxcIiArIGlucHV0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidmlkZW86Ly9cXFwiICsgaW5wdXRcXG4gICAgICAgIH1cXG4gICAgfSksXFxuICAgIHVwZGF0YTogZnVuY3Rpb24ocnVsZSkge1xcbiAgICAgICAgc2V0TGFzdENoYXB0ZXJSdWxlKCdqczonICsgJC50b1N0cmluZygodXJsLHJ1bGUpID0+IHtcXG4gICAgICAgICAgICB2YXIgaHRtbD1mZXRjaCh1cmwpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChldmFsKHJ1bGUpKVxcbiAgICAgICAgfSxNWV9VUkwsIHJ1bGUpKVxcbiAgICB9LFxcbiAgICBjbG9zZTogZnVuY3Rpb24obGlzdCwgc29ydHMpIHtcXG4gICAgICAgIGFkZExpc3RlbmVyKCdvbkNsb3NlJywgJC50b1N0cmluZygobGlzdCwgc29ydHMpID0+IHtcXG4gICAgICAgICAgICBsaXN0Lm1hcCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignZXJfJyArIHggKyAnZm9sZCcpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdlcl8nK3gpO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzb3J0czsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3BsYXlsaXN0XycgKyBpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignZXJfcGxheWxpc3RzJyk7XFxuICAgICAgICB9LCBsaXN0LCBzb3J0cykpXFxuICAgIH0sXFxuICAgIGRhdGFDb252ZXJ0OiBmdW5jdGlvbihkYXRhKSB7XFxuICAgICAgICB2YXIgbmV3Y2xzbGlzdCA9IGRhdGEubWFwKGZ1bmN0aW9uKG9iaikge1xcbiAgICAgICAgICAgIHZhciBuZXdPYmogPSBPYmplY3QuYXNzaWduKHt9LCBvYmopO1xcbiAgICAgICAgICAgIGlmIChuZXdPYmouaGFzT3duUHJvcGVydHkoJ3R5cGUnKSkge1xcbiAgICAgICAgICAgICAgICBuZXdPYmouY29sX3R5cGUgPSBuZXdPYmoudHlwZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIG5ld09iajtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIG5ld2Nsc2xpc3Q7XFxuICAgIH0sXFxuICAgIHByZUxvYWQ6IGZ1bmN0aW9uKGZ1bmMpIHtcXG4gICAgICAgIGxldCBteWZ1bmM9bnVsbFxcbiAgICAgICAgaWYoZnVuYyE9dW5kZWZpbmVkJiZmdW5jLmNvbnN0cnVjdG9yPT1GdW5jdGlvbil7XFxuICAgICAgICAgICAgbXlmdW5jPWZ1bmNcXG4gICAgICAgIH1cXG4gICAgICAgICQuZXh0ZW5kKHtcXG4gICAgICAgICAgICBkYXRhQ29udmVydDogdGhpcy5kYXRhQ29udmVydCxcXG4gICAgICAgICAgICBtc206TWV0aG9kcy5NdWx0aVNlbGVjdE1vZGUsXFxuICAgICAgICAgICAgZnVuYzpteWZ1bmMsXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBzbWFsbDogZnVuY3Rpb24oc3RyLCBjb2xvcikge1xcbiAgICAgICAgcmV0dXJuICfigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9XFxcIicgKyAoY29sb3IgfHwgJycpICsgJ1xcXCI+JyArIHN0ciArICc8L2ZvbnQ+PC9zbWFsbD4nO1xcbiAgICB9LFxcbiAgICDlo7DmmI46IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGhpcy5zbWFsbCgn5Lul5LiK5pWw5o2u5p2l5rqQ5LqO572R57uc77yM5aaC5oKo5Zac5qyi77yM6K+35pSv5oyB5a6Y5pa577yBJywgJyM4NzFGNzgnKSxcXG4gICAgICAgICAgICBkZXNjOiB0aGlzLnNtYWxsKCfmraTop4TliJnku4XpmZDlrabkuaDkuqTmtYHkvb/nlKjvvIzor7fkuo7lr7zlhaXlkI4yNOWwj+aXtuWGheWIoOmZpO+8jOS7u+S9lee7hOe7h+aIluS4quS6uuS4jeW+l+S7peS7u+S9leaWueW8j+aWueazleS8oOaSreatpOinhOWImeeahOaVtOS9k+aIlumDqOWIhu+8gScsICcjRjIwQzAwJyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICAgICAgfSk7XFxuICAgIH0sXFxuXFxuXFxuLy/nroDku4tcXG4gICAgc2V0RGVzYzogZnVuY3Rpb24oZGVzYywgbnVtKSB7XFxuICAgICAgICBkZXNjID0gZGVzYy5jb25zdHJ1Y3RvciA9PSBBcnJheSA/IGRlc2Muam9pbignPGJyPicpIDogZGVzYztcXG4gICAgICAgIGlmIChkZXNjLnJlcGxhY2UoLyg8YnI+fFxcXFxzKykvZywgJycpLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuXFxuICAgICAgICB9XFxuICAgICAgICB2YXIgaW5mbz1zdG9yYWdlMC5nZXRNeVZhcignZXJfaW5mbycsJ3t9JylcXG4gICAgICAgIGlmKGluZm9bJ2Rlc2MnXSE9dW5kZWZpbmVkKXtcXG4gICAgICAgICAgaW5mb1snZGVzYyddPWluZm9bJ2Rlc2MnXSsnIOeugOS7izonK2Rlc2M7XFxuICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdlcl9pbmZvJyxpbmZvKTtcXG4gICAgICAgIH1cXG4gICAgICAgIFxcbiAgICAgICAgY29uc3QgbWFyayA9ICdkZXNjJztcXG4gICAgICAgIG51bSA9IHR5cGVvZihudW0pID09ICd1bmRlZmluZWQnID8gOTAgOiBudW1cXG4gICAgICAgIGRlc2MgPSBkZXNjLnN0YXJ0c1dpdGgoJ+OAgOOAgCcpID8gZGVzYyA6ICfjgIDjgIAnICsgZGVzYztcXG4gICAgICAgIGRlc2MgPSBkZXNjLnJlcGxhY2UoLycvZywgXFxcIiYjMzk7XFxcIilcXG5cXG4gICAgICAgIGZ1bmN0aW9uIHN1YnN0cihzdHIsIG1heExlbmd0aCkge1xcbiAgICAgICAgICAgIGxldCBsZW4gPSAwO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc3RyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGlmIChzdHIuY2hhckNvZGVBdChpKSA+IDI1NSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGVuICs9IDI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZW4rKztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gbWF4TGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RyLnNsaWNlKDAsIGkpICsgJy4uLic7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHN0cjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBzZGVzYyA9IHN1YnN0cihkZXNjLCBudW0pO1xcbiAgICAgICAgdmFyIGxhenkgPSAkKGAjbm9Mb2FkaW5nI2ApLmxhenlSdWxlKChkYywgc2RjLCBtKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHNob3cgPSBzdG9yYWdlMC5nZXRJdGVtKG0sICcwJyk7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gZmluZEl0ZW0oJ2Rlc2MnKS50aXRsZTtcXG4gICAgICAgICAgICB2YXIgcmUgPSAvKDxcXFxcL3NtYWxsPjxicj4uKj8+KS4rL2c7XFxuICAgICAgICAgICAgdmFyIGV4cCA9ICflsZXlvIA6JztcXG4gICAgICAgICAgICB2YXIgcmV0ID0gJ+aUtui1tzonO1xcbiAgICAgICAgICAgIGlmIChzaG93ID09ICcxJykge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCdkZXNjJywge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UocmV0LCBleHApXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UocmUsICckMScgKyBzZGMgKyAnPC9zbWFsbD4nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oPFxcXFwvc21hbGw+PGJyPjxmb250IGNvbG9yPVxcXCIpLio/KFxcXCI+KS8sICckMSM4QTJCRTIkMicpLy/mlLbotbfpopzoibJcXG5cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShtLCAnMCcpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2Rlc2MnLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShleHAsIHJldClcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZSwgJyQxJyArIGRjICsgJzwvc21hbGw+JylcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvKDxcXFxcL3NtYWxsPjxicj48Zm9udCBjb2xvcj1cXFwiKS4qPyhcXFwiPikvLCAnJDEjMDA4MDAwJDInKS8v5bGV5byA6aKc6ImyXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0obSwgJzEnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIGBoaWtlcjovL2VtcHR5YFxcbiAgICAgICAgfSwgZGVzYywgc2Rlc2MsIG1hcmspXFxuICAgICAgICB2YXIgc2MgPSBzdG9yYWdlMC5nZXRJdGVtKG1hcmssICcwJykgPT0gJzAnID8gJ+WxleW8gDonIDogJ+aUtui1tzonO1xcbiAgICAgICAgdmFyIGRjID0gc3RvcmFnZTAuZ2V0SXRlbShtYXJrLCAnMCcpID09ICcwJyA/IHNkZXNjIDogZGVzYztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJycgKyAnPGI+PGZvbnQgY29sb3I9XFxcIiMwOThBQzFcXFwiPuKItyAg5Ymn5oOF566A5LuLXFx0PC9mb250PjwvYj4nICsgXFxcIjxzbWFsbD48YSBzdHlsZT0ndGV4dC1kZWNvcmF0aW9uOiBub25lOycgaHJlZj0nXFxcIiArIGxhenkgKyBcXFwiJz5cXFwiICsgc2MgKyAnPC9hPjwvc21hbGw+PGJyPjxmb250IGNvbG9yPVxcXCIjOEEyQkUyXFxcIj4nICsgYCR7ZGN9YCArICc8L3NtYWxsPicsLy/pu5jorqTpopzoibJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6ICdkZXNjJyxcXG4gICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDYsXFxuICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNSxcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IHRydWUsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSxcXG5cXG4vL+a1t+aKpVxcbiAgICBzdHJDb252ZXJ0OiBmdW5jdGlvbihhcnIpIHtcXG4gICAgICAgIHJldHVybiBhcnIubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHN0ciA9IHg7XFxuICAgICAgICAgICAgaWYgKC8o5a+85ryUfOS4u+a8lHznsbvlnosp77yaLy50ZXN0KHN0cikpIHtcXG4gICAgICAgICAgICAgICAgc3RyID0gc3RyLnNwbGl0KCcvJykubWFwKCh2YWwsIGluZGV4KSA9PiAoaW5kZXggPT09IDAgPyAnJyA6ICcnKSArIHZhbCkuc2xpY2UoMCwgNSkuam9pbignICcpLnJlcGxhY2UoLyAkLywgJycpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gc3RyXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBzZXRDb250ZW50OiBmdW5jdGlvbihvYmopIHtcXG4gICAgICAgIHZhciBjb250ZW50cyA9IG9iai5tYWluO1xcbiAgICAgICAgdmFyIHNvcnRPcmRlciA9IG9iai5zb3J0O1xcbiAgICAgICAgdmFyIGltZyA9IG9iai5pbWc7XFxuICAgICAgICB2YXIgdGV4dHMgPSBjb250ZW50cy5tYXAoeCA9PiBwZGZoKHgsICdUZXh0JykpO1xcbiAgICAgICAgdmFyIGFycmF5ID0gdGV4dHMuc29ydCgoYSwgYikgPT4ge1xcbiAgICAgICAgICAgIGNvbnN0IGluZGV4QSA9IHNvcnRPcmRlci5pbmRleE9mKGEuc3Vic3RyKDAsIDIpKTtcXG4gICAgICAgICAgICBjb25zdCBpbmRleEIgPSBzb3J0T3JkZXIuaW5kZXhPZihiLnN1YnN0cigwLCAyKSk7XFxuICAgICAgICAgICAgcmV0dXJuIGluZGV4QSAtIGluZGV4QjtcXG4gICAgICAgIH0pXFxuICAgICAgICB2YXIgcmVnZXggPSBuZXcgUmVnRXhwKCcoJyArIHNvcnRPcmRlci5qb2luKCd8JykgKyAnKScpO1xcbiAgICAgICAgYXJyYXkgPSBhcnJheS5maWx0ZXIoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgICAgIHJldHVybiByZWdleC50ZXN0KGl0ZW0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBhcnJheSA9IHRoaXMuc3RyQ29udmVydChhcnJheSlcXG4gICAgICAgIHZhciB0aXRsZXMgPSBbXTtcXG4gICAgICAgIHZhciBkZXNjcyA9IFtdO1xcbiAgICAgICAgc3dpdGNoIChhcnJheS5sZW5ndGgpIHtcXG4gICAgICAgICAgICBjYXNlIDQ6XFxuICAgICAgICAgICAgY2FzZSA1OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAyKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgyKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSA2OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAzKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgzKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignZXJfaW5mbycse1xcbiAgICAgICAgICBkZXNjOmRlc2NzLmpvaW4oJ1xcXFxuJyksXFxuICAgICAgICAgIGltZzppbWcsXFxuICAgICAgICB9KVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAvL3RpdGxlOiB0aXRsZXNbMF0gKyAnXFxcXG4nICsgdGhpcy5zbWFsbCh0aXRsZXMuc2xpY2UoMSwgMykuam9pbignXFxcXG4nKSksXFxuICAgICB0aXRsZTogIHRoaXMuc21hbGwodGl0bGVzWzBdICsgJ1xcXFxuJyArIHRpdGxlcy5zbGljZSgxLCAzKS5qb2luKCdcXFxcbicpLCdyZWQnKSxcXG4gICAgICAgICAgIGRlc2M6IHRoaXMuc21hbGwoZGVzY3Muam9pbignXFxcXG4nKSwnI0ZGN0YwMCcpLFxcbiAgICAgLy9kZXNjOiB0aGlzLnNtYWxsKHBkZmgoaHRtbCwgJy5jb250ZXh0JiYud2lkZ2V0JiZUZXh0JyksJyNGRjdGMDAnKSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpbWcgKyAnQFJlZmVyZXI9JyxcXG4gICAgICAgICAgICB1cmw6IE1ZX1VSTCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljX2JsdXInLFxcbiAgICAgICAgfSlcXG4gICAgICAgIGlmIChvYmouZGVzYyAhPSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICB0aGlzLnNldERlc2Mob2JqLmRlc2MpO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBzZXRDdXN0b206IGZ1bmN0aW9uKG9iaiwgaW1nKSB7XFxuICAgICAgICB2YXIgYXJyYXkgPSBbXTtcXG4gICAgICAgIGlmIChvYmouY29uc3RydWN0b3IgPT0gQXJyYXkpIHtcXG4gICAgICAgICAgICBhcnJheSA9IG9iajtcXG4gICAgICAgIH1cXG4gICAgICAgIGFycmF5ID0gdGhpcy5zdHJDb252ZXJ0KGFycmF5KTtcXG4gICAgICAgIHZhciB0aXRsZXMgPSBbXTtcXG4gICAgICAgIHZhciBkZXNjcyA9IFtdO1xcbiAgICAgICAgc3dpdGNoIChhcnJheS5sZW5ndGgpIHtcXG4gICAgICAgICAgICBjYXNlIDQ6XFxuICAgICAgICAgICAgY2FzZSA1OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAyKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgyKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSA2OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAzKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgzKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignZXJfaW5mbycse1xcbiAgICAgICAgICBkZXNjOmRlc2NzLmpvaW4oJ1xcXFxuJyksXFxuICAgICAgICAgIGltZzppbWcsXFxuICAgICAgICB9KVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGVzWzBdICsgJ1xcXFxuJyArIHRoaXMuc21hbGwodGl0bGVzLnNsaWNlKDEsIDMpLmpvaW4oJ1xcXFxuJykpLFxcbiAgICAgICAgICAgIGRlc2M6IHRoaXMuc21hbGwoZGVzY3Muam9pbignXFxcXG4nKSksXFxuICAgICAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgdXJsOiBNWV9VUkwsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpY19ibHVyJyxcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuXFxuXFxuLy/nur/ot69cXG4gICAgaXNDb2xvcjpmdW5jdGlvbih0ZXh0KSB7XFxuICAgICBjb25zdCByZWdleCA9IC9eIyhbMC05QS1GYS1mXXszfXxbMC05QS1GYS1mXXs2fSkkfF4oW2Etel0rKSQvaTtcXG4gICAgIHJldHVybiByZWdleC50ZXN0KHRleHQpO1xcbiAgICB9LFxcbiAgICBnZXRQcmVzZXQ6ZnVuY3Rpb24oY3VzdG9tKXtcXG4gICAgICBpZih0eXBlb2YgY3VzdG9tZGF0YT09J29iamVjdCcmJiFjdXN0b20pe1xcbiAgICAgICAgY3VzdG9tPWN1c3RvbWRhdGE7XFxuICAgICAgfWVsc2V7XF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XJpKydmb2xkJywnMScpPT0nMCcpe1xcbiAgICAgICAgICAgICAgICB2YXIgYnRuPWZpbmRJdGVtKHNoc29ydCsnX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICB2YXIgZm9sZHM9Wyc8Zm9udCBjb2xvcj1cXFwiI0QzRDNEM1xcXCI+4pi3JywnPGZvbnQgY29sb3I9XFxcIiNGRkE1MDBcXFwiPuKYsCddO1xcbiAgICAgICAgICAgICAgICAgIHZhciBwbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCAne30nKTtcXG4gICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICB2YXIgY29sID0gcGxpc3Rbc2hzb3J0XS5jb2xfdHlwZTtcXG4gICAgICAgICAgICAgICAgICB2YXIgY2xzID0gcGxpc3Rbc2hzb3J0XS5jbHM7XFxuICAgICAgICAgICAgICAgICAgdmFyIHBpYz1wbGlzdFtzaHNvcnRdLnBpYztcXG4gICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGJ0bi5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGJ0bi50aXRsZS5yZXBsYWNlKGZvbGRzWzBdLCBmb2xkc1sxXSksXFxuICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcih2YXJpKydmb2xkJywnMScpO1xcbiAgICAgICAgICAgICAgLy9yZXR1cm4gJ3RvYXN0Oi8v5bGV5byA5omN6IO95pON5L2cJztcXG4gICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsaXN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2VyX3BsYXlsaXN0cycsICd7fScpO1xcbiAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29sID0gcGxpc3Rbc2hzb3J0XS5jb2xfdHlwZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBjbHMgPSBwbGlzdFtzaHNvcnRdLmNscztcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWM9cGxpc3Rbc2hzb3J0XS5waWM7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIodmFyaSwgaSk7XFxuXFxuICAgICAgICAgICAgICAgIHZhciB4bGlzdD1saXN0c1tpXTtcXG4gICAgICAgICAgICAgICAgaWYoJC5mdW5jIT11bmRlZmluZWQmJiQuZnVuYy5jb25zdHJ1Y3Rvcj09RnVuY3Rpb24pe1xcbiAgICAgICAgICAgICAgICAgICAgeGxpc3Q9JC5mdW5jKGkpO1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX2xpc3QnLCB4bGlzdCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIHBsYXlzID0geGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogeC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHgudXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2wsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljOnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogeC51cmwucmVwbGFjZSgvQGxhenlSdWxlW1xcXFxzXFxcXFNdKy9nLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogY2xzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKHNoc29ydCArICdfc29ydCcpID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgcGxheXMucmV2ZXJzZSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBwY2ZnPXN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLCd7fScpO1xcbiAgICAgICAgICAgICAgICBpZihwY2ZnWyfljZXmjqgnXSl7XFxuICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNoJyx7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTpwY2ZnWydvYmonXVsn5Y2V5o6oJ11bMF1cXG4gICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgIHBjZmdbJ+WNleaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKHBjZmdbJ+mAieaOqCddKXtcXG4gICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2hzJyx7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTpwY2ZnWydvYmonXVsn6YCJ5o6oJ11bMF1cXG4gICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLHBjZmcpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIHBsYXlzKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIHRhYnggPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcbiAgICAgICAgICAgICAgICB0YWJ4LmZvckVhY2goKHgsIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB4LnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaWkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHguZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2UoLyMoXFxcXHcrKT8vZywgbGluZWMpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZSgvIyhcXFxcdyspPy9nLCAnIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip/vvIEnO1xcbiAgICAgICAgICAgIH0sIHZhcmksIHNoc29ydCwgaSxjdXN0b20u57q/6Lev6YCJ5LitKVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIChnZXRNeVZhcih2YXJpLCAnMCcpID09IGkgPyB0YWJzW2ldLmZvbnRjb2xvcihjdXN0b20u57q/6Lev6YCJ5LitKSA6IHRhYnNbaV0uZm9udGNvbG9yKCcjJykpLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogc2hzb3J0ICsgJ190YWInLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHNoc29ydCArICdfdGFiXycgKyBpLFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6J2JsYW5rX2Jsb2NrJywgLy8nYmxhbmtfYmxvY2snLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2xpbmUnLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIHB1c2hUYWI6ZnVuY3Rpb24odmFyaSxzaHNvcnQpe1xcbiAgICAgIGFkZExpc3RlbmVyKCdvblJlZnJlc2gnLCAkLnRvU3RyaW5nKChzaHNvcnQpID0+IHtcXG4gICAgICAgIGNsZWFyTXlWYXIoc2hzb3J0KydfcHVzaGNmZycpO1xcbiAgICAgICAgY2xlYXJNeVZhcihzaHNvcnQrJ19kdW9zZWxlY3QnKTtcXG4gICAgICAgIH0sIHNoc29ydCkpXFxuICAgICAgIHZhciBwb2JqPXtcXG4gICAgICAgJ+WNleaOqCc6Wyfipr/ljZXmjqgnLCc8Yj7ipr/ljZXmjqg8L2I+Jy5mb250Y29sb3IoJyMwMEZBOUEnKV0sXFxuICAgICAgICfpgInmjqgnOlsn4piR6YCJ5o6oJywnPGI+4piR6YCJ5o6oPC9iPicuZm9udGNvbG9yKCcjNDY4MkI0JyldLFxcbiAgICAgIH1cXG4gICAgICBcXG4gICAgICBkLnB1c2goe1xcbiAgICAgICAgICB0aXRsZTon4oyYJyxcXG4gICAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICB1cmw6J2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgY2xzOnNoc29ydCsnX3B1c2h0YWInLFxcbiAgICAgICAgICB9XFxuICAgICAgICB9LHtc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gICAgICAgICAgdGl0bGU6J+KAnOKAnOKAneKAnScrdGl0bGVzWzFdLFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNocycse1xcbiAgICAgICAgICAgICAgdGl0bGU6cG9ialsn6YCJ5o6oJ11bMF0sXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBwY2ZnWyfljZXmjqgnXT10cnVlO1xcbiAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgIHZhciBwbGF5bGlzdD1maW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J109cGxheWxpc3Q7XFxuICAgICAgICAgICAgZmluZEl0ZW1zQnlDbHMoc2hzb3J0KS5tYXAoeD0+e1xcbiAgICAgICAgICAgICAgdmFyIGRwdXNoPXtcXG4gICAgICAgICAgICAgICAgbmFtZTpnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgICAgICAgICAgdXJsOngudGl0bGUrJyQnK3guZXh0cmEuaWRcXG4gICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCx7XFxuICAgICAgICAgICAgICAgIHVybDokKCcnKS5sYXp5UnVsZSgoZHB1c2gpPT57XFxuICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeShkcHVzaCkpO1xcbiAgICAgICAgICAgICAgICB9LGRwdXNoKVxcbiAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICB9XFxuICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLHBjZmcpO1xcbiAgICAgICAgICByZXR1cm4gJ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gICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCx7XFxuICAgICAgICAgICAgICAgICB0aXRsZTp4LnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgdXJsOngudXJsLFxcbiAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2h0bycsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB5pys6aG1PT5UVkJveCcsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihzaHNvcnQrJ19kdW9zZWxlY3QnKTtcXG4gICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaHMnLHtcXG4gICAgICAgICAgICAgIHRpdGxlOifigJzigJzigJ3igJ0nK3RpdGxlc1sxXSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPXRydWU7XFxuICAgICAgICAgICAgcGNmZ1sn5Y2V5o6oJ109ZmFsc2U7XFxuICAgICAgICAgICAgdmFyIHBsYXlsaXN0PWZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgcGNmZ1sncGxheWxpc3QnXT1wbGF5bGlzdDtcXG4gICAgICAgICAgICBsZXQgSWRzPXBsYXlsaXN0Lm1hcChpdCA9PiBpdC5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgIElkcy5mb3JFYWNoKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gZmluZEl0ZW0oeCkudGl0bGU7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQubXNtKHRpdGxlLCB4LHNoc29ydCksXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgIC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106ZmFsc2U7XFxuICAgICAgICAgIGlmKCHljZXmjqgmJiHpgInmjqgpe1xcbiAgICAgICAgICB2YXIgdGFicz1zdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQrJ190YWJzJywnW10nKTtcXG4gICAgICAgICAgdHJ5e1xcbiAgICAgICAgICB2YXIgcGxzPXN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCsnX2xpc3QnLCdbXScpLm1hcChsaSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpLm1hcChpdGVtID0+IGl0ZW0udGl0bGUgKyAnJCcgKyBpdGVtLnVybCkuam9pbignIycpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJyQkJCcpO1xcbiAgICAgICAgICB9Y2F0Y2h7XFxuICAgICAgICAgIHZhciBwbHM9c3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0K1xcXCJfbGlzdFxcXCIsJ1tdJykubWFwKHggPT4geC50aXRsZSArIFxcXCIkXFxcIiArIHgudXJsKS5qb2luKFxcXCIjXFxcIik7XFxuICAgICAgICAgIHZhciB0YWJzPVt0YWJzW2dldE15VmFyKHZhcmksJzAnKV1dO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIC8qbG9nKHBscylcXG4gICAgICAgICAgbG9nKHRhYnMpKi9cXG4gICAgICAgICAgfVxcbiAgICAgICAgICBpZijpgInmjqgpe1xcbiAgICAgICAgICB2YXIgcGxzPXN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCtcXFwiX2R1b3NlbGVjdFxcXCIsJ1tdJykubWFwKHggPT4geC50aXRsZSArIFxcXCIkXFxcIiArIHgudXJsKS5qb2luKFxcXCIjXFxcIik7XFxuICAgICAgICAgIGlmKHBscy5sZW5ndGg9PTApe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nkuLrnqbonO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIHZhciB0YWJzPVsn5pKt5pS+5YiX6KGoJ107XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgXFxuICAgICAgICAgIHZhciBpbmZvPXN0b3JhZ2UwLmdldE15VmFyKCdlcl9pbmZvJywne30nKTtcXG4gICAgICAgICAgdmFyIGRlc2MgPWluZm9bJ2Rlc2MnXTtcXG4gICAgICAgICAgdmFyIOaOqOmAgSA9IHtcXG4gICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZ2V0UGFnZVRpdGxlKCksXFxuICAgICAgICAgICAgICAgICBcXFwiY29udGVudFxcXCI6IGRlc2N8fCcnLFxcbiAgICAgICAgICAgICAgICAgXFxcInBpY1xcXCI6IGluZm9bJ2ltZyddIHx8ICcnLFxcbiAgICAgICAgICAgICAgICAgXFxcImZyb21cXFwiOiB0YWJzLmpvaW4oJyQkJCcpLFxcbiAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IHBscyxcXG4gICAgICAgICAgIH1cXG4gICAgICAgICAgLy9sb2co5o6o6YCBKVxcbiAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPVhZUeaOqOmAgSZwdXNodXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnko5o6o6YCBKSlcXG4gICAgICAgICAgfSxzaHNvcnQsdmFyaSksXFxuICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICBpZDpzaHNvcnQrJ19wdXNodG8nLFxcbiAgICAgICAgICAgIGNsczpzaHNvcnQrJ19wdXNodGFiJ1xcbiAgICAgICAgICB9XFxuICAgICAgICB9LHtcXG4gICAgICAgICAgY29sX3R5cGU6J2JsYW5rX2Jsb2NrJyxcXG4gICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgIGNsczpzaHNvcnQrJ19wdXNodGFiJyxcXG4gICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSxcXG4gICAgc2V0TG9uZ2NsaWNrOmZ1bmN0aW9uKHNoc29ydCxjdXN0b20pe1xcbiAgICAgIHJldHVybiBbe3RpdGxlOifmoLflvI/wn46oJyxqczogJC50b1N0cmluZygoc2hzb3J0KT0+e1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFsbF9jb2xzID0gWycnXS5jb25jYXQoZ2V0Q29sVHlwZXMoKSk7XFxuICAgICAgICAgICAgICAgICAgICBhbGxfY29scz1hbGxfY29scy5maWx0ZXIoeD0+XFxuICAgICAgICAgICAgICAgICAgICAgIC8odGV4dF98ZmxleCkuKi8udGVzdCh4KSYmeCE9J3RleHRfaWNvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhhbGxfY29scylcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjbHMgPSBzdG9yYWdlMC5nZXRNeVZhcignZXJfcGxheWxpc3RzJywne30nKVxcbiAgICAgICAgICAgICAgICAgICAgfHwgJyc7XFxuICAgICAgICAgICAgICAgICAgICBpZihjbHNbc2hzb3J0XSE9Jycpe1xcbiAgICAgICAgICAgICAgICAgICAgICBjb2w9Y2xzW3Noc29ydF0uY29sX3R5cGU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQg5oyJ6ZKu5qC35byPID0gYWxsX2NvbHMubWFwKChpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdCA9PT0gY29sID8gJ/CfkYknICsgaXQ6IGl0O1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGlwcyA9ICfor7fpgInmi6npgInpm4bmjInpkq7moLflvI8nO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQo5oyJ6ZKu5qC35byPLCAyLCB0aXBzKS5zZWxlY3QoKHNoc29ydCxjbHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5yZXBsYWNlKC/wn5GJL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvKnN0b3JhZ2UwLnNldEl0ZW0oJ+aMiemSruagt+W8jycsIGlucHV0KTsqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvbGRJZHMgPSAoZmluZEl0ZW1zQnlDbHMoc2hzb3J0KSB8fCBbXSkubWFwKGl0PT5pdC5leHRyYS5pZCk7IC8v6ICB5YWD57SgaWRzXFxuICAgICAgICAgICAgICAgICAgICAgICAgb2xkSWRzLmZvckVhY2goeD0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWIh+aNoumAiembhuaMiemSruagt+W8j+S4ujonICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICB9LHNoc29ydCxjbHMpO1xcbiAgICAgICAgICAgICAgICB9LHNoc29ydCxjdXN0b20pfV1cXG4gICAgfSxcXG4gICAgc2V0VGFiczogZnVuY3Rpb24odGFicywgdmFyaSwgc2hzb3J0LHBhcnNlKSB7XFxuICAgICAgICBsZXQgY3VzdG9tPXBhcnNlLuiHquWumuS5iTtcXG4gICAgICAgIGN1c3RvbSA9dGhpcy5nZXRQcmVzZXQoY3VzdG9tKTtcXG4gICAgICAgIHNoc29ydCA9IHNoc29ydCA/IHNoc29ydCA6ICdzaHNvcnQnO1xcbiAgICAgICAgdmFyIHRpdGxlID0gKGdldE15VmFyKHNoc29ydCArICdfc29ydCcsICcwJykgPT0gJzEnKSA/ICc8Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICcrY3VzdG9tLumAhuW6j+minOiJsisnXFxcIj7pgIbluo88L3NwYW4+PC9iPicgOiAnPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAnK2N1c3RvbS7mraPluo/popzoibIrJ1xcXCI+5q2j5bqPPC9zcGFuPjwvYj4nXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB2YXJpICsgJzonICsgdGl0bGUsXFxuICAgICAgICAgICAgZGVzYzogJ+WFsScgKyBTdHJpbmcodGFicy5sZW5ndGgpLmZvbnRjb2xvcignIzQ2ODJCNCcpICsgJ+adoee6v+i3rycsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaHNvcnQsdmFyaSxjdXN0b20pID0+IHtcXG4gICAgICAgICAgICAgIGxldCBjb25mID0gZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JywgJzAnKTtcXG4gICAgICAgICAgICAgIGlmKGdldE15VmFyKCdlcl8nK3ZhcmkrJ2ZvbGQnLCcxJyk9PScwJyl7XFxuICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bGV5byA5omN6IO95pON5L2cJztcXG4gICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGNsc2xpc3RzID0gZmluZEl0ZW1zQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgdmFyIG5ld2Nsc2xpc3QgPSAkLmRhdGFDb252ZXJ0KGNsc2xpc3RzKTtcXG4gICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICB2YXIgdGl0bGVzPVtgJHtjdXN0b20u5q2j5bqP6aKc6ImyfVxcXCI+5q2j5bqPYCxgJHtjdXN0b20u6YCG5bqP6aKc6ImyfVxcXCI+6YCG5bqPYF07XFxuICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICBuZXdjbHNsaXN0LnJldmVyc2UoKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIG5ld2Nsc2xpc3QpO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInKVxcblxcbiAgICAgICAgICAgICAgICBpZiAoY29uZiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG9iai50aXRsZS5yZXBsYWNlKHRpdGxlc1sxXSwgdGl0bGVzWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2F2YXRhcicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzBdLCB0aXRsZXNbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcxJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaOkuW6j+aIkOWKnyc7XFxuICAgICAgICAgICAgfSwgc2hzb3J0LHZhcmksY3VzdG9tKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBjdXN0b20u5Zu+5qCHICxcXG4gICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICBpZDpzaHNvcnQrJ19hdmF0YXInLFxcbiAgICAgICAgICAgICAgbG9uZ0NsaWNrOnRoaXMuc2V0TG9uZ2NsaWNrKHNoc29ydCksXFxuICAgICAg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AgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgaWYoZm9sZD09JzAnKXtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoZm9sZG5hbWUsICAnMScpO1xcbiAgICAgICAgICAgICAgICB2YXIgY3MgPSBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQgKyAnX2NscycpO1xcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIob2JqLmV4dHJhLmlkLCBjcyk7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oYnRuLmV4dHJhLmlkLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogYnRuLnRpdGxlLnJlcGxhY2UoZm9sZHNbMF0sIGZvbGRzWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKGZvbGQ9PScxJyl7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoZm9sZG5hbWUsICAnMCcpO1xcbiAgICAgICAgICAgICAgICB2YXIgcGNscyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIHZhciBjeCA9ICQuZGF0YUNvbnZlcnQocGNscyk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfY2xzJywgY3gpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShidG4uZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBidG4udGl0bGUucmVwbGFjZShmb2xkc1sxXSwgZm9sZHNbMF0pLFxcbiAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJyArIChmb2xkID09PSAnMScgPy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dmFyIGZvbGQgPSBnZXRNeVZhcihmb2xkbmFtZSwgJzEnKTtcXG5cXG4gICAgICAgIHZhciB1cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChmb2xkbmFtZSwgc2hzb3J0LHB1c2gpID0+IHtcXG4gICAgICAgICAgICB2YXIgcGwgPSBzdG9yYWdlMC5nZXRNeVZhcignZXJfcGxheWxpc3RzJywgJ3t9Jyk7XFxuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzKHBsKS5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIHZhciBmb2xkID0gZ2V0TXlWYXIoZm9sZG5hbWUsICcxJyk7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IGZpbmRJdGVtKHNoc29ydCArICdfYXZhdGFyJylcXG4gICAgICAgICAgICBpZiAoZm9sZCA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGJjbHMgPSBmaW5kSXRlbShzaHNvcnQgKyAnX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICB2YXIgdGNscyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCArICdfdGFiJyk7XFxuICAgICAgICAgICAgICAgIHZhciBsY2xzID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19saW5lJyk7XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICB2YXIgcGNscyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIHZhciBjcyA9IFtiY2xzXS5jb25jYXQodGNscywgW2xjbHNdLCBwY2xzKTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGlmKHB1c2gpe1xcbiAgICAgICAgICAgICAgICAgIHZhciBwY2xzPWZpbmRJdGVtc0J5Q2xzKHNoc29ydCsnX3B1c2h0YWInKTtcXG4gICAgICAgICAgICAgICAgICBjcz1wY2xzLmNvbmNhdChjcyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgdmFyIGN4ID0gJC5kYXRhQ29udmVydChjcyk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfY2xzJywgY3gpO1xcbiAgICAgICAgICAgICAgICBpZihwdXNoKXtcXG4gICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KydfcHVzaHRhYicpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oYmNscy5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHNoc29ydCArICdfbGluZScpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG5cXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShvYmouZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IG9iai5kZXNjLnJlcGxhY2UoJ+WxleW8gDxmb250IGNvbG9yPVxcXCIjRkZBNTAwXFxcIj7imLAnLCAn5oqY5Y+gPGZvbnQgY29sb3I9XFxcIiNEM0QzRDNcXFwiPuKYtycpLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZm9sZCA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGNzID0gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0ICsgJ19jbHMnKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfYXZhdGFyJywgY3MpO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKG9iai5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogb2JqLmRlc2MucmVwbGFjZSgn5oqY5Y+gPGZvbnQgY29sb3I9XFxcIiNEM0QzRDNcXFwiPuKYtycsICflsZXlvIA8Zm9udCBjb2xvcj1cXFwiI0ZGQTUwMFxcXCI+4piwJyksXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHB1dE15VmFyKGZvbGRuYW1lLCBmb2xkID09PSAnMScgPyAnMCcgOiAnMScpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgKGZvbGQgPT09ICcxJyA/ICfmlLbotbcnIDogJ+WxleW8gCcpO1xcbiAgICAgICAgfSwgZm9sZG5hbWUsIHNoc29ydCwocGFyc2VbJ+aOqOmAgSddP3RydWU6ZmFsc2UpKTtcXG4gICAgICAgIHZhciBkZXNjID0gKGZvbGQgPT09ICcwJyA/IOaKmOWPoCA6IOWxleW8gCkgKyAnXFxcXHQnO1xcblxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdmFyaSArICc6XFxcXHRcXFxcdCcgKyAn5YWxJyArIFN0cmluZyh0YWJzLmxlbmd0aCkuZm9udGNvbG9yKCcjNDY4MkI0JykgKyAn5p2h57q/6LevJyxcXG4gICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6IGN1c3RvbS7lm77moIcsXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHNoc29ydCArICdfYXZhdGFyJyxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOnRoaXMuc2V0TG9uZ2NsaWNrKHNoc29ydCksXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIGlmKHR5cGVvZihwYXJzZVsn5o6o6YCBJ10pIT0ndW5kZWZpbmVkJyYmcGFyc2VbJ+aOqOmAgSddKVxcbiAgICAgICAgdGhpcy5wdXNoVGFiKCdlcl8nK3Zhcmksc2hzb3J0KTtcXG4gICAgICAgIFxcbiAgICAgICAgaWYgKGZvbGQgPT0gJzAnKSB7XFxuICAgICAgICAgICAgcmV0dXJuXFxuICAgICAgICB9XFxuXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIHRpdGxlLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodmFyaSwgc2hzb3J0LGN1c3RvbSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZiA9IGdldE15VmFyKHNoc29ydCArICdfc29ydCcsICcwJyk7XFxuICAgICAgICAgICAgICAgIHZhciBjbHNsaXN0cyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIHZhciBuZXdjbHNsaXN0ID0gJC5kYXRhQ29udmVydChjbHNsaXN0cyk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICBuZXdjbHNsaXN0LnJldmVyc2UoKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIG5ld2Nsc2xpc3QpO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19idXR0b24nKVxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGVzPVtgJHtjdXN0b20u5q2j5bqP6aKc6ImyfVxcXCI+5q2j5bqPYCxgJHtjdXN0b20u6YCG5bqP6aKc6ImyfVxcXCI+6YCG5bqPYF07XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICBpZiAoY29uZiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19idXR0b24nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG9iai50aXRsZS5yZXBsYWNlKHRpdGxlc1sxXSwgdGl0bGVzWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2J1dHRvbicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzBdLCB0aXRsZXNbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcxJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmjpLluo/miJDlip8nXFxuICAgICAgICAgICAgfSwgdmFyaSwgc2hzb3J0LGN1c3RvbSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogc2hzb3J0ICsgJ19idXR0b24nLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICB0aGlzLmNyZWF0ZVBMaXN0KHRhYnMsdmFyaSxzaHNvcnQsY3VzdG9tKTtcXG4gICAgfSxcXG4gICAgc2V0TGlzdHM6IGZ1bmN0aW9uKGxpc3RzLCBpbmRleCwgc2hzb3J0LHBhcnNlKSB7XFxuXFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX2xpc3QnLCBsaXN0cyk7XFxuICAgICAgICBcXG4gICAgICAgIHBhcnNlPXBhcnNlP3BhcnNlOnt9O1xcbiAgICAgICAgdmFyIOagt+W8jz1wYXJzZS7moLflvI8/cGFyc2Uu5qC35byPOicnO1xcbiAgICAgICAgdmFyIOWbvuaghz1wYXJzZS7lm77moIc/cGFyc2Uu5Zu+5qCHOidodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vdmllLzEzLnN2Zyc7XFxuICAgICAgICB2YXIgYWpheD1wYXJzZS5BamF4P3BhcnNlLkFqYXg6ZmFsc2U7XFxuXFxuICAgICAgICBzaHNvcnQgPSBzaHNvcnQgPyBzaHNvcnQgOiAnc2hzb3J0JztcXG5cXG4gICAgICAgIGlmKGFqYXgpe1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gbGlzdHM7XFxuICAgICAgICAgICAgaWYgKGdldE15VmFyKHNoc29ydCArICdfc29ydCcpID09ICcxJyAmJiBsaXN0cy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0cy5yZXZlcnNlKCk7XFxuICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGxpc3RzW2luZGV4XTtcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JykgPT0gJzEnICYmIGxpc3RzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGxpc3RzW2luZGV4XS5yZXZlcnNlKCk7XFxuICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBcXG4gICAgICAgIGlmKOagt+W8jz09Jycpe1xcbiAgICAgICAgICDmoLflvI89bGlzdC5sZW5ndGggPiAzID8gJ3RleHRfNCcgOiAndGV4dF8yJ1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICBpZihsaXN0Lmxlbmd0aCA+IDApe1xcbiAgICAgICAgdmFyIHBsaXN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2VyX3BsYXlsaXN0cycsICd7fScpO1xcbiAgICAgICAgaWYoIXBsaXN0Lmhhc093blByb3BlcnR5KHNoc29ydCkpe1xcbiAgICAgICAgICAgICBwbGlzdFtzaHNvcnRdPXt9O1xcbiAgICAgICAgfVxcbiAgICAgICAgcGxpc3Rbc2hzb3J0XVsnY2xzJ109c2hzb3J0O1xcbiAgICAgICAgcGxpc3Rbc2hzb3J0XVsnY29sX3R5cGUnXT3moLflvI87XFxuICAgICAgICBwbGlzdFtzaHNvcnRdWydwaWMnXT3lm77moIc7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignZXJfcGxheWxpc3RzJywgcGxpc3QpO1xcbiAgICAgICAgfSAgIFxcbiAgICAgICAgXFxuICAgICAgICBcXG4gICAgICAgIGZvciAodmFyIGogaW4gbGlzdCkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBsaXN0W2pdLnRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IGxpc3Rbal0udXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTog5qC35byPLFxcbiAgICAgICAgICAgICAgICBwaWM65Zu+5qCHLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGxpc3Rbal0udXJsLnJlcGxhY2UoL0BsYXp5UnVsZVtcXFxcc1xcXFxTXSsvZywgJycpLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBzaHNvcnQsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgZ2V0VGFiczogZnVuY3Rpb24ocGFyc2UpIHtcXG4gICAgICAgIHZhciB0YWJzID0gW107XFxuICAgICAgICB2YXIgYXJ0cyA9IHBkZmEoaHRtbCwgcGFyc2Uu57q/6LevKTtcXG4gICAgICAgIHZhciDnur/ot6/lkI0gPSBwYXJzZS7nur/ot6/lkI3np7A7XFxuICAgICAgICB2YXIg5pu/5o2i5Ye95pWwID0gJyc7XFxuICAgICAgICBpZiAocGFyc2Uu57q/6Lev5ZCN56ewLmluY2x1ZGVzKCdAQCcpKSB7XFxuICAgICAgICAgICAg57q/6Lev5ZCNID0gcGFyc2Uu57q/6Lev5ZCN56ewLnNwbGl0KCdAQCcpWzBdO1xcbiAgICAgICAgICAgIOabv+aNouWHveaVsCA9IHBhcnNlLue6v+i3r+WQjeensC5zcGxpdCgnQEAnKVsxXTtcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAodmFyIGkgaW4gYXJ0cykge1xcbiAgICAgICAgICAgIHZhciBsaW5lbmFtZSA9IHBkZmgoYXJ0c1tpXSwg57q/6Lev5ZCNKTtcXG4gICAgICAgICAgICBpZiAo5pu/5o2i5Ye95pWwICE9ICcnKSB7XFxuICAgICAgICAgICAgICAgIGxpbmVuYW1lID0gZXZhbCgnbGluZW5hbWUnICsg5pu/5o2i5Ye95pWwKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGFicy5wdXNoKGxpbmVuYW1lKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB0YWJzO1xcbiAgICB9LFxcbiAgICBnZXRMaXN0czogZnVuY3Rpb24ocGFyc2Usc2hzb3J0KSB7XFxuICAgICAgICBzaHNvcnQgPSBzaHNvcnQgPyBzaHNvcnQgOiAnc2hzb3J0JztcXG4gICAgICAgIHZhciBsaXN0cyA9IFtdO1xcbiAgICAgICAgdmFyIGNvbnRzID0gcGRmYShodG1sLCBwYXJzZS7pgInpm4YpO1xcbiAgICAgICAgdmFyIOmAiembhuWQjeensCA9IHBhcnNlLumAiembhuWQjeensCA/IHBhcnNlLumAiembhuWQjeensCA6ICdhJiZUZXh0JztcXG4gICAgICAgIHZhciDpgInpm4bpk77mjqUgPSBwYXJzZS7pgInpm4bpk77mjqUgPyBwYXJzZS7pgInpm4bpk77mjqUgOiAnYSYmaHJlZic7XFxuICAgICAgICB2YXIg6Kej5p6QID0gcGFyc2Uu6Kej5p6QID8gcGFyc2Uu6Kej5p6QIDogJyc7XFxuICAgICAgICB2YXIgdGVtcCA9IFtdO1xcbiAgICAgICAgZm9yICh2YXIgaSBpbiBjb250cykge1xcbiAgICAgICAgICAgIGlmIChwYXJzZS7pgInpm4bliJfooaggIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGxpc3RzLnB1c2gocGRmYShjb250c1tpXSwgcGFyc2Uu6YCJ6ZuG5YiX6KGoKS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKHgsIOmAiembhuWQjeensClcXG4ucmVwbGFjZShcXFwi56ysXFxcIixcXFwiXFxcIilcXG4ucmVwbGFjZShcXFwi6ZuGXFxcIixcXFwiXFxcIilcXG4ucmVwbGFjZShcXFwi5pyfXFxcIixcXFwiXFxcIilcXG4ucmVwbGFjZShcXFwi6K+dXFxcIixcXFwiXFxcIilcXG4ucmVwbGFjZShcXFwi5pyA5pawXFxcIixcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwZCh4LCDpgInpm4bpk77mjqUpICsg6Kej5p6QLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gcGQoY29udHNbaV0sIOmAiembhumTvuaOpSk7XFxuICAgICAgICAgICAgICAgIGlmICgh6YCJ6ZuG6ZO+5o6lLmluY2x1ZGVzKCdocmVmJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IHBkZmgoY29udHNbaV0sIOmAiembhumTvuaOpSk7XFxuICAgICAgICAgICAgICAgIH1cXG4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xpc3RfJztcXG4gICAgICAgIHRoaXMucHJlTG9hZChmdW5jKTtcXG4gICAgICAgIHRoaXMuY2xvc2UocGFyc2UubWFwKHggPT4geC7nsbvlnospLCBwYXJzZS5sZW5ndGgpO1xcbiAgICAgICAgbW9kZSA9IG1vZGUgPyBtb2RlIDogMTtcXG4gICAgICAgIHBhcnNlLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICB2YXIgdGFicyA9IFsn5Li757q/J107XFxuICAgICAgICAgICAgaWYgKGl0ZW0u57q/6LevICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICB0YWJzID0gdGhpcy5nZXRUYWJzKGl0ZW0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBwdXRNeVZhcihwbGF5K2krJ190YWJzJyx0YWJzKTtcXG4gICAgICAgICAgICBpZihpdGVtLkFqYXgpe1xcbiAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFRhYnModGFicywgaXRlbS7nsbvlnossIHBsYXkgKyBpLGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGFiczIodGFicywgaXRlbS7nsbvlnossIHBsYXkgKyBpLGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2VyX2h0bWwnLGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2VyX3VybCcsTVlfVVJMKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIGxpc3RzPWZ1bmMoZ2V0TXlWYXIoJ2VyXycraXRlbS7nsbvlnossJzAnKSxNWV9VUkwpO1xcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHZhciBsaXN0cyA9IHRoaXMuZ2V0TGlzdHMoaXRlbSwgcGxheStpKTtcXG4gICAgICAgICAgICAvL2xvZyhsaXN0cylcXG4gICAgICAgICAgICBpZiAobGlzdHMuc29tZSh4ID0+IHgubGVuZ3RoID4gMCkpIHtcXG4gICAgICAgICAgICAgICAgaWYgKG1vZGUgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRUYWJzKHRhYnMsIGl0ZW0u57G75Z6LLCBwbGF5ICsgaSxpdGVtKTtcXG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFRhYnMyKHRhYnMsIGl0ZW0u57G75Z6LLCBwbGF5ICsgaSxpdGVtKTtcXG4gICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2VyXycgKyBpdGVtLuexu+WeiyArICdmb2xkJywgJzEnKSA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgdGhpcy5zZXRMaXN0cyhsaXN0cywgZ2V0TXlWYXIoJ2VyXycraXRlbS7nsbvlnossICcwJyksIHBsYXkgKyBpLGl0ZW0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9XFxufVxcblxcblxcbmxldCBNZXRob2RzPXtcXG4gICAgLy/lpJrpgInmqKHlnZdcXG4gICAgTXVsdGlTZWxlY3RNb2RlOmZ1bmN0aW9uKG5hbWUsaWQsc2hzb3J0KXtcXG4gICAgICAgIHJldHVybiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChkYXRhdGl0bGUsIGRhdGF1cmwsc2hzb3J0KSA9PiB7XFxuICAgICAgICAgICAgZnVuY3Rpb24gdW5pcXVlKGFycikge1xcbiAgICAgICAgICAgIGNvbnN0IHJlcyA9IG5ldyBNYXAoKVxcbiAgICAgICAgICAgIHJldHVybiBhcnIuZmlsdGVyKChhKSA9PiAhcmVzLmhhcyhhLnVybCkgJiYgcmVzLnNldChhLnVybCwgMSkpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBkdW9zZWxlY3QgPSBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQrXFxcIl9kdW9zZWxlY3RcXFwiKSA/IHN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCtcXFwiX2R1b3NlbGVjdFxcXCIpIDogW107XFxuICAgICAgICAgICAgaWYgKGR1b3NlbGVjdC5maW5kSW5kZXgoeCA9PiB4LnVybCA9PT0gZGF0YXVybCkgPT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgZHVvc2VsZWN0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGRhdGF0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZGF0YXVybFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBkdW9zZWxlY3QgPSB1bmlxdWUoZHVvc2VsZWN0KVxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGRhdGF1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBg4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNGRjU3MzNcXFwiPmAgKyBkYXRhdGl0bGUsXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZUJ5VmFsdWUoYXJyLCB2YWwpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFycltpXVsndXJsJ10gPT0gdmFsKSB7XFxuICAgICAgICAgICAgICAgICAg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Z2lzdGVyVGFzayhpZCwgdGltZSwgJC50b1N0cmluZygob2JqLGlkKSA9PiB7XFxcXG4gICAgICAgIHZhciBkYXRhID0gb2JqLmRhdGE7XFxcXG4gICAgICAgIHZhciBydW0gPSBnZXRNeVZhcigncm51bScpO1xcXFxuXFxcXG4gICAgICAgIHZhciBpID0gTnVtYmVyKGdldE15VmFyKCdiYW5uZXJpJywgJzAnKSk7XFxcXG4gICAgICAgIGlmIChydW0gIT0gJycpIHtcXFxcbiAgICAgICAgICAgIGkgPSBOdW1iZXIocnVtKSArIDFcXFxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3JudW0nKVxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgaSA9IGkgKyAxO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIC8vbG9nKGkpXFxcXG4gICAgICAgIC8vbG9nKGRhdGEubGVuZ3RoKVxcXFxuXFxcXG4gICAgICAgIGlmIChpID4gZGF0YS5sZW5ndGggLSAxKSB7XFxcXG4gICAgICAgICAgICBpID0gMFxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHZhciBpdGVtID0gZGF0YVtpXTtcXFxcbiAgICAgICAgLy9sb2coaXRlbSlcXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQrJ2JhcicsIHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxcXFxuICAgICAgICAgICAgICAgIHVybDogaXRlbS51cmwsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9uYW1lOiBpdGVtLnRpdGxlLnJlcGxhY2UoLzxbXj5dKz4vZywgJycpLFxcXFxuICAgICAgICAgICAgICAgICAgICAvL3NuYW1lOiBpdGVtLmV4dHJhLnNuYW1lLFxcXFxuICAgICAgICA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FtID09IHVuZGVmaW5lZCkge1xcXFxuICAgICAgICAgICAgICAgIHBhcmFtID0gW107XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhwYXJhbSkuZm9yRWFjaCgocHJvcGVydHkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAvLyDlr7nmr4/kuKrlsZ7mgKflkI3miafooYzmk43kvZxcXFxcbiAgICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IHBhcmFtW3Byb3BlcnR5XTsgLy8g6I635Y+W5bGe5oCn5YC8XFxcXG4gICAgICAgICAgICAgICAgLy8g5Zyo6L+Z6YeM5omn6KGM5oKo55qE5pON5L2cXFxcXG4gICAgICAgICAgICAgICAgdGhpc1twcm9wZXJ0eV0gPSB2YWx1ZTtcXFxcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5kZWJ1Zykge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhwcm9wZXJ0eSArIFxcXFxcXFwiOlxcXFxcXFwiICsgdmFsdWUpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9LFxcXFxuICAgICAgICBldmFsSlNSdWxlKGl0ZW0sXFxcXG4gICAgICAgICAgICBqc1J1bGUpIHtcXFxcbiAgICAgICAgICAgIGxldCBydWxlID0ganNSdWxlLnJlcGxhY2UoXFxcXFxcXCJAanM6XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICBydWxlID0gcnVsZS50cmltKCk7XFxcXG4gICAgICAgICAgICAvL2xvZygkLnN0cmluZ2lmeShydWxlKSlcXFxcbiAgICAgICAgICAgIGxldCBpbnB1dCA9IGl0ZW07XFxcXG4gICAgICAgICAgICBpZiAocnVsZS5zdGFydHNXaXRoKFxcXFxcXFwiKFxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAg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GxlIHx8IFxcXFxcXFwiXFxcXFxcXCI7XFxcXG4gICAgICAgIH0sXFxcXG4gICAgICAgIGdldFVybChzcmMsIGNhdGVnb3J5KSB7XFxcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcXFxcXCJcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIGxldCB1cmxSdWxlID0gY2F0ZWdvcnku6ZO+5o6lIHx8IFxcXFxcXFwiYSYmaHJlZlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuc3RhcnRzV2l0aChcXFxcXFxcIkBqczpcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCB1cmxSdWxlKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsID0gcGQoc3JjLCB1cmxSdWxlKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmICh0eXBlb2YgY2F0ZWdvcnku6ZO+5o6l5aSE55CGID09IFxcXFxcXFwiZnVuY3Rpb25cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHVybCA9IGNhdGVnb3J5LumTvuaOpeWkhOeQhih1cmwpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuIHVybCB8fCBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICB9LFxcXFxuICAgICAgICBpc051bGwocGFyYW0pIHtcXFxcbiAgICAgICAgICAgIGlmIChwYXJhbSA9PSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxcXG4gICAgICAgIH0sXFxcXG4gICAgICAgIGlzQm9vbGVhbih2YXJpYWJsZSkge1xcXFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB2YXJpYWJsZSAhPT0gXFxcXFxcXCJib29sZWFuXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcXFxcXCLlvIDlkK/mipjlj6Dor7fkvKDlhaXluIPlsJTlgLxcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0sXFxcXG4gICAgICAgIOa4hemZpChsaXN0KSB7XFxcXG4gICAgICAgICAgICBpZiAodGhpcy5pc051bGwobGlzdCkpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcztcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChsaXN0LmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcXFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIua4hemZpOaKpemUmTror7fkvKDliJfooahcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB0aGlzLmNsZWFycyA9IGxpc3Q7XFxcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAg5YWo5riFKGxpc3QpIHtcXFxcbiAgICAgICAgICAgIGlmICh0aGlzLmlzTnVsbChsaXN0KSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgdmFyIGMgPSB0aGlzLmNsZWFyYWxsO1xcXFxuICAgICAgICAgICAgbGlzdCA9IGMuY29uY2F0KGxpc3QpO1xcXFxuICAgICAgICAgICAgdGhpcy5jbGVhcmFsbCA9IGxpc3Q7XFxcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAg5rqQ56CBKGlucHV0KSB7XFxcXG4gICAgICAgICAgICB0aGlzLmh0bWwgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcXFxuICAgICAgICB9LFxcXFxuICAgICAgICDnlYzpnaIoaW5wdXQpIHtcXFxcbiAgICAgICAgICAgIHRoaXMubGF5b3V0ID0gaW5wdXQ7XFxcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAg6aG156CBKGlucHV0KSB7XFxcXG4gICAgICAgICAgICB0aGlzLnBhZ2UgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcXFxuICAgICAgICB9LFxcXFxuICAgICAgICDnirbmgIEoaW5wdXQpIHtcXFxcbiAgICAgICAgICAgIHRoaXMuc3RhdGUgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcXFxuICAgICAgICB9LFxcXFxuICAgICAgICDlvIDlkK/mkJzntKIoaW5wdXQpIHtcXFxcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXFxcbiAgICAgICAgICAgICAgICBpbnB1dCA9IHRydWU7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB0aGlzLnNlYXJjaCA9IGlucHV0O1xcXFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxcXG4gICAgICAgIH0sXFxcXG4gICAgICAgIOW8gOWQr+aKmOWPoChpbnB1dCkge1xcXFxuICAgICAgICAgICAgaWYgKGlucHV0ID09IHVuZGVmaW5lZCkge1xcXFxuICAgICAgICAgICAgICAgIGlucHV0ID0gdHJ1ZTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHRoaXMuaXNCb29sZWFuKGlucHV0KTtcXFxcbiAgICAgICAgICAgIHRoaXMub3BlbiA9IGlucHV0O1xcXFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxcXG4gICAgICAgIH0sXFxcXG4gICAgICAgIHNldFRpdGxlKGssIGksIHQpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiBrID09IGkgPyBcXFxcXFxcIuKAnOKAnOKAneKAnVxcXFxcXFwiICsgdC5mb250Y29sb3IodGhpcy7liIbnsbvpopzoibIpIDogdDtcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAgYWN0aW9uKG9iaikge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFt7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5riF6Zmk54q25oCBXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKG9iaikgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2cob2JqKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihvYmouc3RhdGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXFxcXFwiaGVhZC5jYXRlXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcXFxuICAgICAgICAgICAgICAgICAgICBvYmouYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBvYmouY2wuZm9yRWFjaCgoaXRlbSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgfSwgb2JqKSxcXFxcbiAgICAgICAgICAgIH0sIF07XFxcXG4gICAgICAgIH0sXFxcXG4gICAgICAgIGNoZWNrUGFyYW0oKSB7XFxcXG4gICAgICAgICAgICB2YXIgb2JqID0ge307XFxcXG4gICAgICAgICAgICBpZiAodGhpcy5wYWdlID09IDAgJiYgdHlwZW9mIHBhZ2UgPT0gXFxcXFxcXCJ1bmRlZmluZWRcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIuivt+S8oOWFpemhteeggVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYWdlID09IFxcXFxcXFwidW5kZWZpbmVkXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXFxcXFwi6aG156CBXFxcXFxcXCJdID0gdGhpcy5wYWdlO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG9ialtcXFxcXFxcIumhteeggVxcXFxcXFwiXSA9IHBhZ2U7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHRoaXMuaHRtbCA9PSBcXFxcXFxcImVtcHR5XFxcXFxcXCIgJiYgdHlwZW9mIGh0bWwgPT0gXFxcXFxcXCJ1bmRlZmluZWRcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIuivt+S8oOWFpea6kOeggVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBodG1sID09IFxcXFxcXFwidW5kZWZpbmVkXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXFxcXFwi5rqQ56CBXFxcXFxcXCJdID0gdGhpcy5odG1sO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG9ialtcXFxcXFxcIua6kOeggVxcXFxcXFwiXSA9IGh0bWw7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHRoaXMubGF5b3V0ID09IFxcXFxcXFwidW5kZWZpbmVkXFxcXFxcXCIgJiYgdHlwZW9mIGQgPT0gXFxcXFxcXCJ1bmRlZmluZWRcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIuivt+S8oOWFpeeVjOmdolxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkID09IFxcXFxcXFwidW5kZWZpbmVkXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXFxcXFwi55WM6Z2iXFxcXFxcXCJdID0gdGhpcy5sYXlvdXQ7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXFxcXFwi55WM6Z2iXFxcXFxcXCJdID0gZDtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gb2JqO1xcXFxuICAgICAgICB9LFxcXFxuICAgICAgICDliJvlu7rliqjmgIHliIbnsbsocnVsZU9iaikge1xcXFxuICAgICAgICAgICAgbGV0IGl0ZW1zID0gW107XFxcXG4gICAgICAgICAgICBsZXQgY2F0ZXMgPSBbXTtcXFxcbiAgICAgICAgICAgIGlmIChydWxlT2JqID09IHVuZGVmaW5lZCkge1xcXFxuICAgICAgICAgICAgICAgIHJ1bGVPYmogPSBbXTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIC8v5Yid5aeL5YyW5Y+Y6YeP5byA5aeLXFxcXG4gICAgICAgICAgICBjb25zdCBwYXJhbSA9IHRoaXMuY2hlY2tQYXJhbSgpO1xcXFxuICAgICAgICAgICAgY29uc3QgcGFnZSA9IHBhcmFtLumhteeggTtcXFxcbiAgICAgICAgICA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ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcIidoaWtlcjovL3NlYXJjaD9ydWxlPVxcXFxcXFwiICsgTVlfUlVMRS50aXRsZSArIFxcXFxcXFwiJnM9JytpbnB1dFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuaQnOe0ouWFs+mUruivjVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJpbnB1dFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihcXFxcXFxcImtleXdvcmRcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJrZXl3b3JkXFxcXFxcXCIsIGlucHV0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgY29uc3QgY2F0ZWdvcmllcyA9IFtdO1xcXFxuICAgICAgICAgICAgcnVsZU9iai5mb3JFYWNoKCh4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAvL2xvZyh4KVxcXFxuICAgICAgICAgICAgICAgIGlmICh4Lmpzb24gIT0gdW5kZWZpbmVkKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHguanNvbi5tYXAoayA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLnB1c2goSlNPTi5zdHJpbmdpZnkoaykucmVwbGFjZSgvXlxcXFxcXFxcW3xcXFxcXFxcXF0kL2csICcnKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9jYXRlZ29yaWVzLnB1c2goeC5qc29uKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoeC7kuIDnuqflrprkvY0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu5LiA57qn5a6a5L2NLnN0YXJ0c1dpdGgoXFxcXFxcXCJAanM6XFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu5aSn57G75a6a5L2NLnN0YXJ0c1dpdGgoXFxcXFxcXCJAanM6XFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKGh0bWwsIHgu5aSn57G75a6a5L2NKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBbcGRmYShodG1sLCB4LuWkp+exu+WumuS9jSkuam9pbignXFxcXFxcXFxuJyldO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIC8vLS3pop3lpJblpITnkIYtLVxcXFxuICAgICAgICAgICAgICAgIGlmICgoJ+WinuWKoCcgaW4geCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu5aKe5YqgLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgeC7lop7liqAgPSBldmFsKHgu5aKe5YqgKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHgu5aKe5YqgLmNvbmNhdChzbGlzdCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmICgoJ+ihpeWFhScgaW4geCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu6KGl5YWFLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgeC7ooaXlhYUgPSBldmFsKHgu6KGl5YWFKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHNsaXN0LmNvbmNhdCh4LuihpeWFhSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIC8vLS3pop3lpJblpITnkIYtLVxcXFxuICAgICAgICAgICAgICAgIHZhciDkuIDnuqcgPSBsaXN0Lm1hcCgocykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgc2xpc3QgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEoXFxcXFxcXCLlsI/nsbtcXFxcXFxcIiBpbiB4KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgeC7lsI/nsbsgPSBcXFxcXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICh4LuWwj+exuy5zdGFydHNXaXRoKFxcXFxcXFwiQGpzOlxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2xpc3QgPSB0aGlzLmV2YWxKU1J1bGUocywgeC7lsI/nsbspO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2xpc3QgPSBwZGZhKHMsIHgu5bCP57G7KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIg5a6a5L2NID0gc2xpc3QubWFwKChpdGVtKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIHgu5qCH6aKYKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSB0aGlzLmdldFVybChpdGVtLCB4KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvYmogPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KG9iaik7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4g5a6a5L2NO1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKOS4gOe6pylcXFxcbiAgICAgICAgICAgICAgICAvL2xvZyjkuIDnuqcubGVuZ3RoKVxcXFxuICAgICAgICAgICAgICAgIGlmICjkuIDnuqcubGVuZ3RoID09IDEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXFxcXFwiXFxcXFxcXFxuXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICDkuIDnuqcuZm9yRWFjaCgoaXRlbSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFxcXFxcIixcXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgLy9sb2coY2F0ZWdvcmllcylcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgaWYgKOaKmOWPoOeKtuaAgSkge1xcXFxuICAgICAgICAgICAgICAgIGlmIChwYWdlID09IDEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcXFxcXCIxXFxcXFxcXCIgPyDmipjlj6AgOiDlsZXlvIAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZShcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGl0bGUsIGZvbGQsIHUsIGFsbCwgZXhwcykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZm9sZCA9IGdldE15VmFyKE1ZX1JVTEUuZ3JvdXAsIGZvbGQpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBb5bGV5byALCDmipjlj6BdID0gZXhwcztcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZCA9PSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3ggPSBmaW5kSXRlbXNCeUNscyh0aXRsZSArICdjYXRlX2J1dHRvbicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2NhdGVfYnV0dG9uJywgY3gpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHRpdGxlICsgJ2NhdGVfYnV0dG9uJyk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjeCA9IHN0b3JhZ2UwLmdldE15VmFyKCdjYXRlX2J1dHRvbicsIFtdKS5tYXAoeCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeFsnY29sX3R5cGUnXSA9IHhbJ2NvbF90eXBlJ10gPyB4Wydjb2xfdHlwZSddIDogeFsndHlwZSddO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIodGl0bGUgKyAnY2F0ZV9saW5lJywgY3gpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7Ki9cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh0aXRsZSArICdjYXRlX2V4cCcsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBmb2xkID09IDEgPyDlsZXlvIAgOiDmipjlj6AsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCA9PT0gXFxcXFxcXCIxXFxcXFxcXCIgPyBcXFxcXFxcIjBcXFxcXFxcIiA6IFxcXFxcXFwiMVxcXFxcXFwiKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfUlVMRS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xkLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOeKtuaAgSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDlhajmuIUsIFvlsZXlvIAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOaKmOWPoFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfUlVMRS50aXRsZSArICdjYXRlX2V4cCcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiB0aGlzLmFjdGlvbih7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbDog5riF6ZmkLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHBhZ2UgPT0gMSkge1xcXFxuICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMuZm9yRWFjaCgoY2F0ZWdvcnksIGluZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3J5KVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgc3ViX2NhdGVnb3JpZXMgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLyppZiAo5bCP57G75a6a5L2NLmluY2x1ZGVzKFxcXFxcXFwiO1xcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NLnNwbGl0KFxcXFxcXFwiO1xcXFxcXFwiKVswXSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgaWYgKHN1Yl9jYXRlZ29yaWVzLmxlbmd0aCA9PSAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jS5zcGxpdChcXFxcXFxcIjtcXFxcXFxcIilbMV0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsqL1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhpbmRleClcXFxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBKU09OLnBhcnNlKGBbJHtjYXRlZ29yeX1dYCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKHN1Yl9jYXRlZ29yaWVzKVxcXFxuICAgICAgICAgICAgICAgICAgICAvLyBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vfVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5aSn57G7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IHRpdGxlID0gcGRmaChpdGVtLCBf5aSn57G75qCH6aKYKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnRpdGxlO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcXFxcXCJ1bmRlZmluZWRcXFxcXFxcIiAmJiDmjpLpmaQgIT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3UmVnRXhwKOaOkumZpCwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSAnJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJzOiDmuIXpmaQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IGpzb24sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbGNsZWFyczog5YWo5riFLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xldCB1cmwgPSBwZChpdGVtLCBf5aSn57G76ZO+5o6lKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaXRlbS51cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSDkuIDnuqfliIbnsbvlpITnkIYodXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcXFxcXCIwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiaGVhZC5jYXRlXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5qc29uLmNvbnN0cnVjdG9yID09PSBPYmplY3QpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJkdF9cXFxcXFxcIiArIHBhcmFtcy5qc29uLnR5cGUsIHBhcmFtcy5qc29uLnZhbHVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3RhdGUsIHBhcmFtcy5qc29uKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9saW5lJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5bCP57G7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmFwb3MgPSBmYWxzZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmlmIChpdGVtLmluY2x1ZGVzKCd0eXBlPVxcXFxcXFwiQGV4dHJhXFxcXFxcXCInKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFwb3MgPSB0cnVlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coJ+mZhOWKoOWumuS9jScpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXh0cmFwb3MpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gcGRmaChpdGVtLCBcXFxcXFxcImEmJlRleHRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXFxcXFwidW5kZWZpbmVkXFxcXFxcXCIgJiYg5o6S6ZmkICE9IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKOaOkumZpCwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNvbiA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwgXFxcXFxcXCJhJiZzdGF0ZVxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIFxcXFxcXFwiYSYmdmFsdWVcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0udGl0bGU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXFxcXFwidW5kZWZpbmVkXFxcXFxcXCIgJiYg5o6S6ZmkICE9IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKOaOkumZpCwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBqc29uID0gXFxcXFxcXCJcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLypzd2l0Y2ggKHRydWUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFxcXFxcIkBAQFxcXFxcXFwiKTpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXFxcXFwiQEBAXFxcXFxcXCIpWzBdKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXFxcXFwiQEBAXFxcXFxcXCIpWzFdKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFxcXFxcIkBAXFxcXFxcXCIpOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTog5YiG57G76ZO+5o6lLnNwbGl0KFxcXFxcXFwiQEBcXFxcXFxcIilbMF0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFxcXFxcIkBAXFxcXFxcXCIpWzFdKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8ganNvbiA9IHBkKGl0ZW0sIOWIhuexu+mTvuaOpSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyp2YXIganNvbj3liIbnsbvpk77mjqUuaW5jbHVkZXMoJ0BAQCcpP3tcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVswXSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzFdKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEAnKT97XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU65YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzBdLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzFdKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTsqL1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uOiBqc29uLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGhpcy5zZXRUaXRsZShrZXkudG9TdHJpbmcoKSwgY2F0ZV90ZW1wW2luZGV4XSwgdGl0bGUpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIgKyBcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiaGVhZC5jYXRlXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImR0X1xcXFxcXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBNWV9SVUxFLnRpdGxlICsgJ2NhdGVfYnV0dG9uJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKGZvbGQgPT09IFxcXFxcXFwiMVxcXFxcXFwiIHx8IOaKmOWPoOeKtuaAgSA9PSBmYWxzZSkge1xcXFxuICAgICAgICAgICAgICAgIGl0ZW1zID0gaXRlbXMuY29uY2F0KGNhdGVzKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChmb2xkID09PSBcXFxcXFxcIjBcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdjYXRlX2J1dHRvbicsIGNhdGVzKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHR5cGVvZiBzZXRQcmVSZXN1bHQgIT0gJ3VuZGVmaW5lZCcpIHtcXFxcbiAgICAgICAgICAgICAgICBpdGVtcyA9IGQuY29uY2F0KGl0ZW1zKTtcXFxcbiAgICAgICAgICAgICAgICAvL+a4heepuue7p+aJv+aVsOe7hFxcXFxuICAgICAgICAgICAgICAgIGQubGVuZ3RoID0gMDtcXFxcbiAgICAgICAgICAgICAgICBzZXRQcmVSZXN1bHQoaXRlbXMpO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBpdGVtcy5mb3JFYWNoKGl0ZW0gPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSxcXFxcbiAgICB9O1xcXFxuICAgIG9iai7pooTorr4ob3B0aW9ucyk7XFxcXG4gICAgcmV0dXJuIG9iajtcXFxcbn1cXFxcblxcXFxudmFyI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B7XFxcXG4gICAgICAgIGlmIChqc29uLmNvbnN0cnVjdG9yICE9IE9iamVjdCkge1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBqc29uID0gSlNPTi5wYXJzZShqc29uKTtcXFxcbiAgICAgICAgICAgIH0gY2F0Y2gge31cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAoanNvbltydWxlLmxpc3RdID09IHVuZGVmaW5lZCkge1xcXFxuICAgICAgICAgICAgYXJyLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcXFxcXCJncmV5XFxcXFxcXCI+PHNtYWxsPuaXoOWGheWuuTwvc21hbGw+PC9mb250PicsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHt9LFxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgdmFyIGRlYnVnID0gdGhpcy5nZXRCb29sZWFuVmFsdWUocnVsZS5kZWJ1ZywgZmFsc2UpO1xcXFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXFxcbiAgICAgICAgaWYgKGRlYnVnKSB7XFxcXG4gICAgICAgICAgICBsb2coJ+WumuS9jeWIl+ihqDonICsgcnVsZS5saXN0KTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBqc29uW3J1bGUubGlzdF0uZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gZXZhbChydWxlLnRpdGxlKTtcXFxcbiAgICAgICAgICAgIHZhciBkZXNjID0gZXZhbChydWxlLmRlc2MpO1xcXFxuICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSBldmFsKHJ1bGUuY29udGVudCk7XFxcXG4gICAgICAgICAgICB2YXIgaW1nID0gZXZhbChydWxlLmltZykgKyBydWxlLnJlZjtcXFxcbiAgICAgICAgICAgIHZhciBocmVmID0gZXZhbChydWxlLnVybCk7XFxcXG4gICAgICAgICAgICB2YXIgdXJsID0gcnVsZS5pbXQgPyBocmVmICsgXFxcXFxcXCIjaW1tZXJzaXZlVGhlbWUjXFxcXFxcXCIgOiBocmVmO1xcXFxuICAgICAgICAgICAgdmFyIGxhenkgPSBydWxlLmxhenkgPyBydWxlLmxhenkgOiBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuXFxcXG4gICAgICAgICAgICB2YXIgZGQgPSB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxcXG4gICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAoZW1wdHkgPyBcXFxcXFxcImhpa2VyOi8vZW1wdHkjI1xcXFxcXFwiIDogJycpICsgdXJsLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICB9O1xcXFxuXFxcXG4gICAgICAgICAgICBpZiAoZGVidWcpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjLFxcXFxuICAgICAgICAgICAgICAgICAgICBpbWcsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybFxcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgdGhpcy5kZWJ1Z2xvZyhpLCBpdGVtLCBydWxlLCByeCk7XFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGlmIChsYXp5ICE9IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICBkZFtcXFxcXFxcInVybFxcXFxcXFwiXSA9IGhyZWYgKyBsYXp5O1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgYXJyLnB1c2goZGQpO1xcXFxuICAgICAgICB9KTtcXFxcbiAgICB9LFxcXFxuICAgIHJ1bGVMaXN0OiBmdW5jdGlvbihhcnIsIGh0bWwsIHJ1bGUpIHtcXFxcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsXFxcXG4gICAgICAgICAgICBydWxlLmxpc3QpO1xcXFxuICAgICAgICB2YXIgZGVidWcgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmRlYnVnLFxcXFxuICAgICAgICAgICAgZmFsc2UpO1xcXFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXFxcbiAgICAgICAgaWYgKGRlYnVnKSB7XFxcXG4gICAgICAgICAgICBsb2coJ+WumuS9jeWIl+ihqDonICsgcnVsZS5saXN0KTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsaXN0LmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXFxcbiAgICAgICAgICAgIHZhciB0aXRsZSA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLnRpdGxlKTtcXFxcbiAgICAgICAgICAgIHZhciBkZXNjID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuZGVzYyk7XFxcXG4gICAgICAgICAgICB2YXIgaW1nID0gdGhpcy5pbWdIYW5kbGUoaXRlbSwgcnVsZSk7XFxcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxcXG4gICAgICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcXFxuXFxcXG4gICAgICAgICAgICBpZiAoZGVidWcpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjLFxcXFxuICAgICAgICAgICAgICAgICAgICBpbWcsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybFxcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgdGhpcy5kZWJ1Z2xvZyhpLCBpdGVtLCBydWxlLCByeCk7XFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIHZhciBsYXp5ID0gcnVsZS5sYXp5ID8gcnVsZS5sYXp5IDogXFxcXFxcXCJcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIHZhciBkZCA9IHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAoZW1wdHkgPyBcXFxcXFxcImhpa2VyOi8vZW1wdHkjI1xcXFxcXFwiIDogJycpICsgdXJsLFxcXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHJ1bGUuY29sX3R5cGU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ICAgIGlmIChkZWJ1Zykge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2MsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGVidWdsb2coaSwgaXRlbSwgcnVsZSwgcngpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZCA9IFxcXFxcXFwibGFzdGlkX1xcXFxcXFwiICsgcGFnZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzID0gXFxcXFxcXCJsYXN0bWFya1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGltZy5yZXBsYWNlKC8uKj91cmxcXFxcXFxcXD0oLio/KS8sXFxcXFxcXCIkMVxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAoZW1wdHkgPyBcXFxcXFxcImhpa2VyOi8vZW1wdHkjI1xcXFxcXFwiIDogJycpICsgdXJsICsgJ0BydWxlPWpzOiQucmVxdWlyZShcXFxcXFxcImVqXFxcXFxcXCIpJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IHJ1bGUuY29sX3R5cGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogY2xzLFxcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSAmJiBzaG93KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFxcXFxcInBhZ2VsaW5lXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPHNtYWxsPuWKoOi9veS4rS4uLjwvc21hbGw+XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcXFxcXCJwYWdlbnVtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcXFxcXCJwYWdlbnVtXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXFxcXFwiZ3JleVxcXFxcXFwiPjxzbWFsbD7liLDlupXkuoY8L3NtYWxsPjwvZm9udD4nLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBcXFxcXFxcImxhc3RcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaWYgKGxpc3QubGVuZ3RoID09IDAgJiYgcGFnZSA9PSAxKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXFxcXFwiZ3JleVxcXFxcXFwiPjxzbWFsbD7ml6DlhoXlrrk8L3Nt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0gcGFyYW1zKHUpO1xcXFxuICAgICAgICByZXR1cm4gZGljdDtcXFxcbiAgICB9LFxcXFxuICAgIGlzRXF1YWw6IGZ1bmN0aW9uKHgsIHkpIHtcXFxcbiAgICAgICAgY29uc3Qgb2sgPSBPYmplY3Qua2V5cyxcXFxcbiAgICAgICAgICAgIHR4ID0gdHlwZW9mIHgsXFxcXG4gICAgICAgICAgICB0eSA9IHR5cGVvZiB5O1xcXFxuICAgICAgICByZXR1cm4geCAmJiB5ICYmIHR4ID09PSBcXFxcXFxcIm9iamVjdFxcXFxcXFwiICYmIHR4ID09PSB0eSA/XFxcXG4gICAgICAgICAgICBvayh4KS5sZW5ndGggPT09IG9rKHkpLmxlbmd0aCAmJlxcXFxuICAgICAgICAgICAgb2soeCkuZXZlcnkoKGtleSkgPT4gdGhpcy5pc0VxdWFsKHhba2V5XSwgeVtrZXldKSkgOiB4ID09PSB5O1xcXFxuICAgIH0sXFxcXG4gICAgZmluZERpZmZlcmVudEluZGV4OiBmdW5jdGlvbihzdHIxLCBzdHIyKSB7XFxcXG4gICAgICAgIGNvbnN0IGRpZmZDaGFycyA9IFtdO1xcXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHN0cjIubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgIGlmIChzdHIxW2ldICE9PSBzdHIyW2ldKSB7XFxcXG4gICAgICAgICAgICAgICAgZGlmZkNoYXJzLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogaSxcXFxcbiAgICAgICAgICAgICAgICAgICAgczE6IHN0cjFbaV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHMyOiBzdHIyW2ldLFxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiBkaWZmQ2hhcnM7XFxcXG4gICAgfSxcXFxcbiAgICByZXBsYWNlQ2hhckF0OiBmdW5jdGlvbihzdHIsIGluZGV4LCByZXBsYWNlbWVudCkge1xcXFxuICAgICAgICBpZiAoaW5kZXggPCAwIHx8IGluZGV4ID49IHN0ci5sZW5ndGgpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiBzdHI7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgLy9sb2coaW5kZXgpXFxcXG4gICAgICAgIGNvbnN0IGFyciA9IHN0ci5zcGxpdChcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgYXJyW2luZGV4XSA9IHJlcGxhY2VtZW50O1xcXFxuICAgICAgICByZXR1cm4gYXJyLmpvaW4oXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgfSxcXFxcbiAgICBnZXRPYmplY3RLZXlzRGlmZjogZnVuY3Rpb24ob2JqMSwgb2JqMikge1xcXFxuICAgICAgICBjb25zdCBkaWZmZXJlbnRLZXlzID0gW107XFxcXG4gICAgICAgIGZvciAobGV0IGtleSBpbiBvYmoxKSB7XFxcXG4gICAgICAgICAgICBpZiAoIW9iajIuaGFzT3duUHJvcGVydHkoa2V5KSB8fCBvYmoxW2tleV0gIT09IG9iajJba2V5XSkge1xcXFxuICAgICAgICAgICAgICAgIGRpZmZlcmVudEtleXMucHVzaChrZXkpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGZvciAobGV0IGtleSBpbiBvYmoyKSB7XFxcXG4gICAgICAgICAgICBpZiAoIW9iajEuaGFzT3duUHJvcGVydHkoa2V5KSkge1xcXFxuICAgICAgICAgICAgICAgIGRpZmZlcmVudEtleXMucHVzaChrZXkpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiBkaWZmZXJlbnRLZXlzO1xcXFxuICAgIH0sXFxcXG4gICAgZ2V0TmV4dFVybDogZnVuY3Rpb24oc291cmNlLCB0YXJnZXQsIHBhcmFtcykge1xcXFxuICAgICAgICB2YXIgdTEgPSB0aGlzLnVybF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B0aGlzLmZpbmREaWZmZXJlbnRJbmRleChTdHJpbmcodTEuUGF0aCksIFN0cmluZyh1Mi5QYXRoKSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGR0X2RlYnVnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhkZik7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmIChkZi5sZW5ndGggPT0gMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSBkZlswXS5pbmRleDtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZiA9IGRmLmZpbHRlcigoeCkgPT4gL1xcXFxcXFxcZCsvLnRlc3QoeC5zMikpO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSBmWzBdLmluZGV4O1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB2YXIgZXEgPSB0aGlzLnJlcGxhY2VDaGFyQXQoU3RyaW5nKHUyLlBhdGgpLCByZSwgXFxcXFxcXCJmeXBhZ2VcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgbmV4dHVybCA9IHUyLkhvc3RzICsgZXEgKyBjYSArIHRoaXMuVG9QYXJhbXModTIuUGFyYW1zKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGVwID0gdGhpcy5nZXRPYmplY3RLZXlzRGlmZih1MS5QYXJhbXMsIHUyLlBhcmFtcylcXFxcbiAgICAgICAgICAgICAgICBpZiAoZXAubGVuZ3RoID09IDEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdTEuUGFyYW1zW2VwWzBdXSA9ICdmeXBhZ2UnXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKGVwKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxc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4gXFxcXG5sZXQgRXJqaSA9IHtcXFxcbiAgICDpgJrlhY06ICQoJycpLmxhenlSdWxlKCgpID0+IHtcXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KS5tYXRjaCgvciBwbGF5ZXJfLio/PSguKj8pPC8pWzFdKVxcXFxuICAgICAgICAgICAgdmFyIHVybCA9IGh0bWwudXJsXFxcXG4gICAgICAgICAgICBpZiAoaHRtbC5lbmNyeXB0ID09ICcxJykge1xcXFxuICAgICAgICAgICAgICAgIHVybCA9IHVuZXNjYXBlKHVybCk7XFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuZW5jcnlwdCA9PSAnMicpIHtcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSB1bmVzY2FwZShiYXNlNjREZWNvZGUodXJsKSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAoL20zdTh8bXA0Ly50ZXN0KHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdXJsXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInZpZGVvOi8vXFxcXFxcXCIgKyBpbnB1dFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ2aWRlbzovL1xcXFxcXFwiICsgaW5wdXRcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pLFxcXFxuICAgIHVwZGF0YTogZnVuY3Rpb24ocnVsZSkge1xcXFxuICAgICAgICBzZXRMYXN0Q2hhcHRlclJ1bGUoJ2pzOicgKyAkLnRvU3RyaW5nKCh1cmwscnVsZSkgPT4ge1xcXFxuICAgICAgICAgICAgdmFyIGh0bWw9ZmV0Y2godXJsKTtcXFxcbiAgICAgICAgICAgIHNldFJlc3VsdChldmFsKHJ1bGUpKVxcXFxuICAgICAgICB9LE1ZX1VSTCwgcnVsZSkpXFxcXG4gICAgfSxcXFxcbiAgICBjbG9zZTogZnVuY3Rpb24obGlzdCwgc29ydHMpIHtcXFxcbiAgICAgICAgYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCAkLnRvU3RyaW5nKChsaXN0LCBzb3J0cykgPT4ge1xcXFxuICAgICAgICAgICAgbGlzdC5tYXAoeCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignZXJfJyArIHggKyAnZm9sZCcpO1xcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2VyXycreCk7XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzb3J0czsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcigncGxheWxpc3RfJyArIGkpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgY2xlYXJNeVZhcignZXJfcGxheWxpc3RzJyk7XFxcXG4gICAgICAgIH0sIGxpc3QsIHNvcnRzKSlcXFxcbiAgICB9LFxcXFxuICAgIGRhdGFDb252ZXJ0OiBmdW5jdGlvbihkYXRhKSB7XFxcXG4gICAgICAgIHZhciBuZXdjbHNsaXN0ID0gZGF0YS5tYXAoZnVuY3Rpb24ob2JqKSB7XFxcXG4gICAgICAgICAgICB2YXIgbmV3T2JqID0gT2JqZWN0LmFzc2lnbih7fSwgb2JqKTtcXFxcbiAgICAgICAgICAgIGlmIChuZXdPYmouaGFzT3duUHJvcGVydHkoJ3R5cGUnKSkge1xcXFxuICAgICAgICAgICAgICAgIG5ld09iai5jb2xfdHlwZSA9IG5ld09iai50eXBlO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuIG5ld09iajtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIHJldHVybiBuZXdjbHNsaXN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XFxcIiYjMzk7XFxcXFxcXCIpXFxcXG5cXFxcbiAgICAgICAgZnVuY3Rpb24gc3Vic3RyKHN0ciwgbWF4TGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICBsZXQgbGVuID0gMDtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc3RyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHN0ci5jaGFyQ29kZUF0KGkpID4gMjU1KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxlbiArPSAyO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxlbisrO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gbWF4TGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHIuc2xpY2UoMCwgaSkgKyAnLi4uJztcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gc3RyO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBzZGVzYyA9IHN1YnN0cihkZXNjLCBudW0pO1xcXFxuICAgICAgICB2YXIgbGF6eSA9ICQoYCNub0xvYWRpbmcjYCkubGF6eVJ1bGUoKGRjLCBzZGMsIG0pID0+IHtcXFxcbiAgICAgICAgICAgIHZhciBzaG93ID0gc3RvcmFnZTAuZ2V0SXRlbShtLCAnMCcpO1xcXFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gZmluZEl0ZW0oJ2Rlc2MnKS50aXRsZTtcXFxcbiAgICAgICAgICAgIHZhciByZSA9IC8oPFxcXFxcXFxcL3NtYWxsPjxicj4uKj8+KS4rL2c7XFxcXG4gICAgICAgICAgICB2YXIgZXhwID0gJ+WxleW8gDonO1xcXFxuICAgICAgICAgICAgdmFyIHJldCA9ICfmlLbotbc6JztcXFxcbiAgICAgICAgICAgIGlmIChzaG93ID09ICcxJykge1xcXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2Rlc2MnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UocmV0LCBleHApXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZSwgJyQxJyArIHNkYyArICc8L3NtYWxsPicpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvKDxcXFxcXFxcXC9zbWFsbD48YnI+PGZvbnQgY29sb3I9XFxcXFxcXCIpLio/KFxcXFxcXFwiPikvLCAnJDEjOEEyQkUyJDInKS8v5pS26LW36aKc6ImyXFxcXG5cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0obSwgJzAnKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgnZGVzYycsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShleHAsIHJldClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKHJlLCAnJDEnICsgZGMgKyAnPC9zbWFsbD4nKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLyg8XFxcXFxcXFwvc21hbGw+PGJyPjxmb250IGNvbG9yPVxcXFxcXFwiKS4qPyhcXFxcXFxcIj4pLywgJyQxIzAwODAwMCQyJykvL+WxleW8gOminOiJslxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShtLCAnMScpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJ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ByZXR1cm4gYXJyLm1hcCh4ID0+IHtcXFxcbiAgICAgICAgICAgIHN0ciA9IHg7XFxcXG4gICAgICAgICAgICBpZiAoLyjlr7zmvJR85Li75ryUfOexu+WeiynvvJovLnRlc3Qoc3RyKSkge1xcXFxuICAgICAgICAgICAgICAgIHN0ciA9IHN0ci5zcGxpdCgnLycpLm1hcCgodmFsLCBpbmRleCkgPT4gKGluZGV4ID09PSAwID8gJycgOiAnJykgKyB2YWwpLnNsaWNlKDAsIDUpLmpvaW4oJyAnKS5yZXBsYWNlKC8gJC8sICcnKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBzdHJcXFxcbiAgICAgICAgfSlcXFxcbiAgICB9LFxcXFxuICAgIHNldENvbnRlbnQ6IGZ1bmN0aW9uKG9iaikge1xcXFxuICAgICAgICB2YXIgY29udGVudHMgPSBvYmoubWFpbjtcXFxcbiAgICAgICAgdmFyIHNvcnRPcmRlciA9IG9iai5zb3J0O1xcXFxuICAgICAgICB2YXIgaW1nID0gb2JqLmltZztcXFxcbiAgICAgICAgdmFyIHRleHRzID0gY29udGVudHMubWFwKHggPT4gcGRmaCh4LCAnVGV4dCcpKTtcXFxcbiAgICAgICAgdmFyIGFycmF5ID0gdGV4dHMuc29ydCgoYSwgYikgPT4ge1xcXFxuICAgICAgICAgICAgY29uc3QgaW5kZXhBID0gc29ydE9yZGVyLmluZGV4T2YoYS5zdWJzdHIoMCwgMikpO1xcXFxuICAgICAgICAgICAgY29uc3QgaW5kZXhCID0gc29ydE9yZGVyLmluZGV4T2YoYi5zdWJzdHIoMCwgMikpO1xcXFxuICAgICAgICAgICAgcmV0dXJuIGluZGV4QSAtIGluZGV4QjtcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgdmFyIHJlZ2V4ID0gbmV3IFJlZ0V4cCgnKCcgKyBzb3J0T3JkZXIuam9pbignfCcpICsgJyknKTtcXFxcbiAgICAgICAgYXJyYXkgPSBhcnJheS5maWx0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gICAgICBkZXNjcyA9IGFycmF5LnNsaWNlKDIpO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgY2FzZSA2OlxcXFxuICAgICAgICAgICAgICAgIHRpdGxlcyA9IGFycmF5LnNsaWNlKDAsIDMpO1xcXFxuICAgICAgICAgICAgICAgIGRlc2NzID0gYXJyYXkuc2xpY2UoMyk7XFxcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2VyX2luZm8nLHtcXFxcbiAgICAgICAgICBkZXNjOmRlc2NzLmpvaW4oJ1xcXFxcXFxcbicpLFxcXFxuICAgICAgICAgIGltZzppbWcsXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGVzWzBdICsgJ1xcXFxcXFxcbicgKyB0aGlzLnNtYWxsKHRpdGxlcy5zbGljZSgxLCAzKS5qb2luKCdcXFxcXFxcXG4nKSksXFxcXG4gICAgICAgICAgICBkZXNjOiB0aGlzLnNtYWxsKGRlc2NzLmpvaW4oJ1xcXFxcXFxcbicpKSxcXFxcbiAgICAgICAgICAgIHBpY191cmw6IGltZyArICdAUmVmZXJlcj0nLFxcXFxuICAgICAgICAgICAgdXJsOiBNWV9VUkwsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljX2JsdXInLFxcXFxuICAgICAgICB9KVxcXFxuICAgIH0sXFxcXG5cXFxcblxcXFxuLy/nur/ot69cXFxcbiAgICBpc0NvbG9yOmZ1bmN0aW9uKHRleHQpIHtcXFxcbiAgICAgY29uc3QgcmVnZXggPSAvXiMoWzAtOUEtRmEtZl17M318WzAtOUEtRmEtZl17Nn0pJHxeKFthLXpdKykkL2k7XFxcXG4gICAgIHJldHVybiByZWdleC50ZXN0KHRleHQpO1xcXFxuICAgIH0sXFxc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UoKHZhcmksIHNoc29ydCwgaSxsaW5lYykgPT4ge1xcXFxuICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgdmFyIGxpc3RzID0gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0ICsgJ19saXN0JywgJ1tdJyk7XFxcXG4gICAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAgIGlmKGdldE15VmFyKHZhcmkrJ2ZvbGQnLCcxJyk9PScwJyl7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGJ0bj1maW5kSXRlbShzaHNvcnQrJ19idXR0b24nKTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZm9sZHM9Wyc8Zm9udCBjb2xvcj1cXFxcXFxcIiNEM0QzRDNcXFxcXFxcIj7imLcnLCc8Zm9udCBjb2xvcj1cXFxcXFxcIiNGRkE1MDBcXFxcXFxcIj7imLAnXTtcXFxcbiAgICAgICAgICAgICAgICAgIHZhciBwbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCAne30nKTtcXFxcbiAgICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgICAgdmFyIGNvbCA9IHBsaXN0W3Noc29ydF0uY29sX3R5cGU7XFxcXG4gICAgICAgICAgICAgICAgICB2YXIgY2xzID0gcGxpc3Rbc2hzb3J0XS5jbHM7XFxcXG4gICAgICAgICAgICAgICAgICB2YXIgcGljPXBsaXN0W3Noc29ydF0ucGljO1xcXFxuICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShidG4uZXh0cmEuaWQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGJ0bi50aXRsZS5yZXBsYWNlKGZvbGRzWzBdLCBmb2xkc1sxXSksXFxcXG4gICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcih2YXJpKydmb2xkJywnMScpO1xcXFxuICAgICAgICAgICAgICAvL3JldHVybiAndG9hc3Q6Ly/lsZXlvIDmiY3og73mk43kvZwnO1xcXFxuICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsaXN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2VyX3BsYXlsaXN0cycsICd7fScpO1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbCA9IHBsaXN0W3Noc29ydF0uY29sX3R5cGU7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBjbHMgPSBwbGlzdFtzaHNvcnRdLmNscztcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBpYz1wbGlzdFtzaHNvcnRdLnBpYztcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIodmFyaSwgaSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICB2YXIgeGxpc3Q9bGlzdHNbaV07XFxcXG4gICAgICAgICAgICAgICAgaWYoJC5mdW5jIT11bmRlZmluZWQmJiQuZnVuYy5jb25zdHJ1Y3Rvcj09RnVuY3Rpb24pe1xcXFxuICAgICAgICAgICAgICAgICAgICB4bGlzdD0kLmZ1bmMoaSk7XFxcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoc2hzb3J0ICsgJ19saXN0JywgeGxpc3QpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB2YXIgcGxheXMgPSB4bGlzdC5tYXAoeCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogeC50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogeC51cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljOnBpYyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHgudXJsLnJlcGxhY2UoL0BsYXp5UnVsZVtcXFxcXFxcXHNcXFxcXFxcXFNdKy9nLCAnJyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBjbHMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnKSA9PSAnMScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGxheXMucmV2ZXJzZSgpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB2YXIgcGNmZz1zdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQrJ19wdXNoY2ZnJywne30nKTtcXFxcbiAgICAgICAgICAgICAgICBpZihwY2ZnWyfljZXmjqgnXSl7XFxcXG4gICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2gnLHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6cGNmZ1snb2JqJ11bJ+WNleaOqCddWzBdXFxcXG4gICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgcGNmZ1sn5Y2V5o6oJ109ZmFsc2U7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmKHBjZmdbJ+mAieaOqCddKXtcXFxcbiAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaHMnLHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6cGNmZ1snb2JqJ11bJ+mAieaOqCddWzBdXFxcXG4gICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgcGNmZ1sn6YCJ5o6oJ109ZmFsc2U7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLHBjZmcpO1xcXFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQpO1xcXFxuICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihzaHNvcnQgKyAnX2xpbmUnLCBwbGF5cyk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICB2YXIgdGFieCA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCArICdfdGFiJyk7XFxcXG4gICAgICAgICAgICAgICAgdGFieC5mb3JFYWNoKCh4LCBpaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB4LnRpdGxlO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpaSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LmV4dHJhLmlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2UoLyMoXFxcXFxcXFx3Kyk/L2csIGxpbmVjKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHguZXh0cmEuaWQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZSgvIyhcXFxcXFxcXHcrKT8vZywgJyMnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip/vvIEnO1xcXFxuICAgICAgICAgICAgfSwgdmFyaSwgc2hzb3J0LCBpLGN1c3RvbS7nur/ot6/pgInkuK0pXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIChnZXRNeVZhcih2YXJpLCAnMCcpID09IGkgPyB0YWJzW2ldLmZvbnRjb2xvcihjdXN0b20u57q/6Lev6YCJ5LitKSA6IHRhYnNbaV0uZm9udGNvbG9yKCcjJykpLFxcXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBzaHNvcnQgKyAnX3RhYicsXFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX3RhYl8nICsgaSxcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTonYmxhbmtfYmxvY2snLCAvLydibGFua19ibG9jaycsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2xpbmUnLFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0sXFxcXG4gICAgcHVzaFRhYjpmdW5jdGlvbih2YXJpLHNoc29ydCl7XFxcXG4gICAgICBhZGRMaXN0ZW5lcignb25SZWZyZXNoJywgJC50b1N0cmluZygoc2hzb3J0KSA9PiB7XFxcXG4gICAgICAgIGNsZWFyTXlWYXIoc2hzb3J0KydfcHVzaGNmZycpO1xcXFxuICAgICAgICBjbGVhck15VmFy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sJ3t9Jyk7XFxcXG4gICAgICAgICAgcGNmZ1snb2JqJ109cG9iajtcXFxcbiAgICAgICAgICB2YXIg5Y2V5o6oPXBjZmdbJ+WNleaOqCddP3BjZmdbJ+WNleaOqCddOmZhbHNlO1xcXFxuICAgICAgICAgIFxcXFxuICAgICAgICAgIGlmKOWNleaOqCl7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2gnLHtcXFxcbiAgICAgICAgICAgICAgdGl0bGU6dGl0bGVzWzBdLFxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIHBjZmdbJ+WNleaOqCddPWZhbHNlO1xcXFxuICAgICAgICAgICAgcGNmZ1sncGxheWxpc3QnXS5tYXAoKHgpPT57XFxcXG4gICAgICAgICAgICAgICB1cGRhdGVJdGVtKHguZXh0cmEuaWQse1xcXFxuICAgICAgICAgICAgICAgICB1cmw6eC51cmwsXFxcXG4gICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaCcse1xcXFxuICAgICAgICAgICAgICB0aXRsZTon4oCc4oCc4oCd4oCdJyt0aXRsZXNbMV0sXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNocycse1xcXFxuICAgICAgICAgICAgICB0aXRsZTpwb2JqWyfpgInmjqgnXVswXSxcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBwY2ZnWyfljZXmjqgnXT10cnVlO1xcXFxuICAgICAgICAgICAgcGNmZ1sn6YCJ5o6oJ109ZmFsc2U7XFxcXG4gICAgICAgICAgICB2YXIgcGxheWxpc3Q9ZmluZEl0ZW1zQnlDbHMoc2hzb3J0KTtcXFxcbiAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J109cGxheWxpc3Q7XFxcXG4gICAgICAgICAgICBmaW5kSXRlbXNCeUNscyhzaHNvcnQpLm1hcCh4PT57XFxcXG4gICAgICAgICAgICAgIHZhciBkcHVzaD17XFxcXG4gICAgICAgICAgICAgICAgbmFtZTpnZXRQYWdlVGl0bGUoKSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6eC50aXRsZSsnJCcreC5leHRyYS5pZFxcXFxuICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCx7XFxcXG4gICAgICAgICAgICAgICAgdXJsOiQoJycpLmxhenlSdWxlKChkcHVzaCk9PntcXFxcbiAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPVhZUeaOqOmAgSZwdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoZHB1c2gpKTtcXFxcbiAgICAgICAgICAgICAgICB9LGRwdXNoKVxcXFxuICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICB9XFxcXG4gICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoc2hzb3J0KydfcHVzaGNmZycscGNmZyk7XFxcXG4gICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrKOWNleaOqD8n5Y2V5o6o5byA5ZCvJzon5Y2V5o6o5YWz6ZetJyk7XFxcXG4gICAgICAgICAgfSxzaHNvcnQscG9iaix2YXJpKSxcXFxcbiAgICAgICAgICBleHRyYTp7XFxcXG4gICAgICAgICAgICBpZDpzaHNvcnQrJ19wdXNoJyxcXFxcbiAgICAgICAgICAgIGNsczpzaHNvcnQrJ19wdXNodGFiJyxcXFxcbiAgICAgICAgICB9XFxcXG4gICAgICAgIH0se1xcXFxuICAgICAgICAgIHRpdGxlOnBvYmpbJ+mAieaOqCddWzBdLFxcXFxuICAgICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgICB1cmw6JCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2hzb3J0LHBvYmosdmFyaSk9PntcXFxcbiAgICAgICAgICBpZihnZXRNeVZhcih2YXJpKydmb2xkJywnMScpPT0nMCcpe1xcXFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WxleW8gOaJjeiDveaTjeS9nCc7XFxcXG4gICAgICAgICAgfVxcXFxuICAgICAgICAgIHZhciB0aXRsZXM9cG9ialsn6YCJ5o6oJ107XFxcXG4gICAgICAgICAgdmFyIHBjZmc9c3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0KydfcHVzaGNmZycsJ3t9Jyk7XFxcXG4gICAgICAgICAgcGNmZ1snb2JqJ109cG9iajtcXFxcbiAgICAgICAgICB2YXIg6YCJ5o6oPXBjZmdbJ+mAieaOqCddP3BjZmdbJ+mAieaOqCddOmZhbHNlO1xcXFxuICAgICAgICAgIGlmKOmAieaOqCl7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2hzJyx7XFxcXG4gICAgICAgICAgICAgIHRpdGxlOnRpdGxlc1swXSxcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBwY2ZnWyfpgInmjqgnXT1mYWxzZTtcXFxcbiAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J10ubWFwKCh4KT0+e1xcXFxuICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LmV4dHJhLmlkLHtcXFxcbiAgICAgICAgICAgICAgICAgdGl0bGU6eC50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgdXJsOngudXJsLFxcXFxuICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2h0bycsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmjqjpgIHmnKzpobU9PlRWQm94JyxcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgY2xlYXJNeVZhcihzaHNvcnQrJ19kdW9zZWxlY3QnKTtcXFxcbiAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2hzJyx7XFxcXG4gICAgICAgICAgICAgIHRpdGxlOifigJzigJzigJ3igJ0nK3RpdGxlc1sxXSxcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBwY2ZnWyfpgInmjqgnXT10cnVlO1xcXFxuICAgICAgICAgICAgcGNmZ1sn5Y2V5o6oJ109ZmFsc2U7XFxcXG4gICAgICAgICAgICB2YXIgcGxheWxpc3Q9ZmluZEl0ZW1zQnlDbHMoc2hzb3J0KTtcXFxcbiAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J109cGxheWxpc3Q7XFxcXG4gICAgICAgICAgICBsZXQgSWRzPXBsYXlsaXN0Lm1hcChpdCA9PiBpdC5leHRyYS5pZCk7XFxcXG4gICAgICAgICAgICAgICAgSWRzLmZvckVhY2goeCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGZpbmRJdGVtKHgpLnRpdGxlO1xcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJC5tc20odGl0bGUsIHgsc2hzb3J0KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2gnLHtcXFxcbiAgICAgICAgICAgICAgdGl0bGU6cG9ialsn5Y2V5o6oJ11bMF0sXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNodG8nLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpd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gdmFyIHBscz1zdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQrJ19saXN0JywnW10nKS5tYXAobGkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpLm1hcChpdGVtID0+IGl0ZW0udGl0bGUgKyAnJCcgKyBpdGVtLnVybCkuam9pbignIycpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuam9pbignJCQkJyk7XFxcXG4gICAgICAgICAgfWNhdGNoe1xcXFxuICAgICAgICAgIHZhciBwbHM9c3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0K1xcXFxcXFwiX2xpc3RcXFxcXFxcIiwnW10nKS5tYXAoeCA9PiB4LnRpdGxlICsgXFxcXFxcXCIkXFxcXFxcXCIgKyB4LnVybCkuam9pbihcXFxcXFxcIiNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgdmFyIHRhYnM9W3RhYnNbZ2V0TXlWYXIodmFyaSwnMCcpXV07XFxcXG4gICAgICAgICAgfVxcXFxuICAgICAgICAgIC8qbG9nKHBscylcXFxcbiAgICAgICAgICBsb2codGFicykqL1xcXFxuICAgICAgICAgIH1cXFxcbiAgICAgICAgICBpZijpgInmjqgpe1xcXFxuICAgICAgICAgIHZhciBwbHM9c3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0K1xcXFxcXFwiX2R1b3NlbGVjdFxcXFxcXFwiLCdbXScpLm1hcCh4ID0+IHgudGl0bGUgKyBcXFxcXFxcIiRcXFxcXFxcIiArIHgudXJsKS5qb2luKFxcXFxcXFwiI1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICBpZihwbHMubGVuZ3RoPT0wKXtcXFxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nkuLrnqbonO1xcXFxuICAgICAgICAgIH1cXFxcbiAgICAgICAgICB2YXIgdGFicz1bJ+aSreaUvuWIl+ihqCddO1xcXFxuICAgICAgICAgIH1cXFxcbiAgICAgICAgICBcXFxcbiAgICAgICAgICB2YXIgaW5mbz1zdG9yYWdlMC5nZXRNeVZhcignZXJfaW5mbycsJ3t9Jyk7XFxcXG4gICAgICAgICAgdmFyIGRlc2MgPWluZm9bJ2Rlc2MnXTtcXFxcbiAgICAgICAgICB2YXIg5o6o6YCBID0ge1xcXFxuICAgICAgICAgICAgICAgICBcXFxcXFxcIm5hbWVcXFxcXFxcIjogZ2V0UGFnZVRpdGxlKCksXFxcXG4gICAgICAgICAgICAgICAgIFxcXFxcXFwiY29udGVudFxcXFxcXFwiOiBkZXNjfHwnJyxcXFxcbiAgICAgICAgICAgICAgICAgXFxcXFxcXCJwaWNcXFxcXFxcIjogaW5mb1snaW1nJ10gfHwgJycsXFxcXG4gICAgICAgICAgICAgICAgIFxcXFxcXFwiZnJvbVxcXFxcXFwiOiB0YWJzLmpvaW4oJyQkJCcpLFxcXFxuICAgICAgICAgICAgICAgICBcXFxcXFxcInVybFxcXFxcXFwiOiBwbHMsXFxcXG4gICAgICAgICAgIH1cXFxcbiAgICAgICAgICAvL2xvZyjmjqjpgIEpXFxcXG4gICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9XFxcXFxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnko5o6o6YCBKSlcXFxcbiAgICAgICAgICB9LHNoc29ydCx2YXJpKSxcXFxcbiAgICAgICAgICBleHRyYTp7XFxcXG4gICAgICAgICAgICBpZDpzaHNvcnQrJ19wdXNodG8nLFxcXFxuICAgICAgICAgICAgY2xzOnNoc29ydCsnX3B1c2h0YWInXFxcXG4gICAgICAgICAgfVxcXFxuICAgICAgICB9LHtcXFxcbiAgICAgICAgICBjb2xfdHlwZTonYmxhbmtfYmxvY2snLFxcXFxuICAgICAgICAgIGV4dHJhOntcXFxcbiAgICAgICAgICAgIGNsczpzaHNvcnQrJ19wdXNodGFiJyxcXFxcbiAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSxcXFxcbiAgICBzZXRMb25nY2xpY2s6ZnVuY3Rpb24oc2hzb3J0LGN1c3RvbSl7XFxcXG4gICAgICByZXR1cm4gW3t0aXRsZTon5qC35byP8J+OqCcsanM6ICQudG9TdHJpbmcoKHNoc29ydCk9PntcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFsbF9jb2xzID0gWycnXS5jb25jYXQoZ2V0Q29sVHlwZXMoKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGFsbF9jb2xzPWFsbF9jb2xzLmZpbHRlcih4PT5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAvKHRleHRffGZsZXgpLiovLnRlc3QoeCkmJnghPSd0ZXh0X2ljb24nKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhhbGxfY29scylcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNscyA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCd7fScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHx8ICcnO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZihjbHNbc2hzb3J0XSE9Jycpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgIGNvbD1jbHNbc2hzb3J0XS5jb2xfdHlwZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQg5oyJ6ZKu5qC35byPID0gYWxsX2NvbHMubWFwKChpdCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0ID09PSBjb2wgPyAn8J+RiScgKyBpdDogaXQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGlwcyA9ICfor7fpgInmi6npgInpm4bmjInpkq7moLflvI8nO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCjmjInpkq7moLflvI8sIDIsIHRpcHMpLnNlbGVjdCgoc2hzb3J0LGNscykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQucmVwbGFjZSgv8J+RiS9nLCAnJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvKnN0b3JhZ2UwLnNldEl0ZW0oJ+aMiemSruagt+W8jycsIGlucHV0KTsqL1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9sZElkcyA9IChmaW5kSXRlbXNCeUNscyhzaHNvcnQpIHx8IFtdKS5tYXAoaXQ9Pml0LmV4dHJhLmlkKTsgLy/ogIHlhYPntKBpZHNcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9sZElkcy5mb3JFYWNoKHg9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5YiH5o2i6YCJ6ZuG5oyJ6ZKu5qC35byP5Li6OicgKyBpbnB1dDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSxzaHNvcnQsY2xzKTtcXFxcbiAgICAgICAgICAgICAgICB9LHNoc29ydCxjdXN0b20pfV1cXFxcbiAgICB9LFxcXFxuICAgIHNldFRhYnM6IGZ1bmN0aW9uKHRhYnMsIHZhcmksIHNoc29ydCxwYXJzZSkge1xcXFxuICAgICAgICBsZXQgY3VzdG9tPXBhcnNlLuiHquWumuS5iTtcXFxcbiAgICAgICAgY3VzdG9tID10aGlzLmdldFByZXNldChjdXN0b20pO1xcXFxuICAgICAgICBzaHNvcnQgPSBzaHNvcnQgPyBzaHNvcnQgOiAnc2hzb3J0JztcXFxc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1cXFxcXFxcIj7mraPluo9gLGAke2N1c3RvbS7pgIbluo/popzoibJ9XFxcXFxcXCI+6YCG5bqPYF07XFxcXG4gICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXFxcbiAgICAgICAgICAgICAgICBuZXdjbHNsaXN0LnJldmVyc2UoKTtcXFxcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoc2hzb3J0ICsgJ19saW5lJywgbmV3Y2xzbGlzdCk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInKVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmYgPT0gJzEnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzFdLCB0aXRsZXNbMF0pLFxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzBdLCB0aXRsZXNbMV0pLFxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMScpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYX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jbm9Mb2FkaW5nIycpLmxhenlSdWxlKChmb2xkbmFtZSxzaHNvcnQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgIGZvbGQgPSBnZXRNeVZhcihmb2xkbmFtZSwgJzEnKTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0KydfbGluZScpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBidG49ZmluZEl0ZW0oc2hzb3J0KydfYnV0dG9uJyk7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGZvbGRzPVsnPGZvbnQgY29sb3I9XFxcXFxcXCIjRDNEM0QzXFxcXFxcXCI+4pi3JywnPGZvbnQgY29sb3I9XFxcXFxcXCIjRkZBNTAwXFxcXFxcXCI+4piwJ107XFxcXG4gICAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgaWYoZm9sZD09JzAnKXtcXFxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihmb2xkbmFtZSwgICcxJyk7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGNzID0gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0ICsgJ19jbHMnKTtcXFxcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIob2JqLmV4dHJhLmlkLCBjcyk7XFxcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShidG4uZXh0cmEuaWQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGJ0bi50aXRsZS5yZXBsYWNlKGZvbGRzWzBdLCBmb2xkc1sxXSksXFxcXG4gICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZihmb2xkPT0nMScpe1xcXFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoZm9sZG5hbWUsICAnMCcpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBwY2xzID0gZmluZEl0ZW1zQnlDbHMoc2hzb3J0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kSXRlbShzaHNvcnQgKyAnX2F2YXRhcicpXFxcXG4gICAgICAgICAgICBpZiAoZm9sZCA9PSAnMScpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgYmNscyA9IGZpbmRJdGVtKHNoc29ydCArICdfYnV0dG9uJyk7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRjbHMgPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBsY2xzID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19saW5lJyk7XFxcXG4gICAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgdmFyIHBjbHMgPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBjcyA9IFtiY2xzXS5jb25jYXQodGNscywgW2xjbHNdLCBwY2xzKTtcXFxcbiAgICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICBpZihwdXNoKXtcXFxcbiAgICAgICAgICAgICAgICAgIHZhciBwY2xzPWZpbmRJdGVtc0J5Q2xzKHNoc29ydCsnX3B1c2h0YWInKTtcXFxcbiAgICAgICAgICAgICAgICAgIGNzPXBjbHMuY29uY2F0KGNzKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICB2YXIgY3ggPSAkLmRhdGFDb252ZXJ0KGNzKTtcXFxcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX2NscycsIGN4KTtcXFxcbiAgICAgICAgICAgICAgICBpZihwdXNoKXtcXFxcbiAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQrJ19wdXNodGFiJyk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oYmNscy5leHRyYS5pZCk7XFxcXG4gICAgICAgICAgICAgICAgZGV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gIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyB0aXRsZSxcXFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodmFyaSwgc2hzb3J0LGN1c3RvbSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBjb25mID0gZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JywgJzAnKTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgY2xzbGlzdHMgPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBuZXdjbHNsaXN0ID0gJC5kYXRhQ29udmVydChjbHNsaXN0cyk7XFxcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHNoc29ydCk7XFxcXG4gICAgICAgICAgICAgICAgbmV3Y2xzbGlzdC5yZXZlcnNlKCk7XFxcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIG5ld2Nsc2xpc3QpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgdmFyIG9iaiA9IGZpbmRJdGVtKHNoc29ydCArICdfYnV0dG9uJylcXFxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGVzPVtgJHtjdXN0b20u5q2j5bqP6aKc6ImyfVxcXFxcXFwiPuato+W6j2AsYCR7Y3VzdG9tLumAhuW6j+minOiJsn1cXFxcXFxcIj7pgIbluo9gXTtcXFxcbiAgICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICBpZiAoY29uZiA9PSAnMScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2J1dHRvbicsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBvYmoudGl0bGUucmVwbGFjZSh0aXRsZXNbMV0sIHRpdGxlc1swXSksXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcwJyk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2J1dHRvbicsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBvYmoudGl0bGUucmVwbGFjZSh0aXRsZXNbMF0sIHRpdGxlc1sxXSksXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcxJyk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIC8vcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmjpLluo/miJDlip8nXFxcXG4gICAgICAgICAgICB9LCB2YXJpLCBzaHNvcnQsY3VzdG9tKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2J1dHRvbicsXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIHRoaXMuY3JlYXRlUExpc3QodGFicyx2YXJpLHNoc29ydCxjdXN0b20pO1xcXFxuICAgIH0sXFxcXG4gICAgc2V0TGlzdHM6IGZ1bmN0aW9uKGxpc3RzLCBpbmRleCwgc2hzb3J0LHBhcnNlKSB7XFxcXG5cXFxcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoc2hzb3J0ICsgJ19saXN0JywgbGlzdHMpO1xcXFxuICAgICAgICBcXFxcbiAgICAgICAgcGFyc2U9cGFyc2U/cGFyc2U6e307XFxcXG4gICAgICAgIHZhciDmoLflvI89cGFyc2Uu5qC35byPP3BhcnNlLuagt+W8jzonJztcXFxcbiAgICAgICAgdmFyIOWbvuaghz1wYXJzZS7lm77moIc/cGFyc2Uu5Zu+5qCHOidodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vdmllLzEzLnN2Zyc7XFxcXG4gICAgICAgIHZhciBhamF4PXBhcnNlLkFqYXg/cGFyc2UuQWpheDpmYWxzZTtcXFxcblxcXFxuICAgICAgICBzaHNvcnQgPSBzaHNvcnQgPyBzaHNvcnQgOiAnc2hzb3J0JztcXFxcblxcXFxuICAgICAgICBpZihhamF4KXtcXFxcbiAgICAgICAgICAgIHZhciBsaXN0ID0gbGlzdHM7XFxcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JykgPT0gJzEnICYmIGxpc3RzLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdHMucmV2ZXJzZSgpO1xcXFxuICAgICAgICAgICB9XFxcXG4gICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgdmFyIGxpc3QgPSBsaXN0c1tpbmRleF07XFxcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JykgPT0gJzEnICYmIGxpc3RzLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdHNbaW5kZXhdLnJldmVyc2UoKTtcXFxcbiAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIFxcXFxuICAgICAgICBpZijmoLflvI89PScnKXtcXFxcbiAgICAgICAgICDmoLflvI89bGlzdC5sZW5ndGggPiAzID8gJ3RleHRfNCcgOiAndGV4dF8yJ1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIFxcXFxuICAgICAgICBpZihsaXN0Lmxlbmd0aCA+IDApe1xcXFxuICAgICAgICB2YXIgcGxpc3QgPSBzdG9yYWdlMC5nZXRNeVZhcignZXJfcGxheWxpc3RzJywgJ3t9Jyk7XFxcXG4gICAgICAgIGlmKCFwbGlzdC5oYXNPd25Qcm9wZXJ0eShzaHNvcnQpKXtcXFxcbiAgICAgICAgICAgICBwbGlzdFtzaHNvcnRdPXt9O1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHBsaXN0W3Noc29ydF1bJ2NscyddPXNoc29ydDtcXFxcbiAgICAgICAgcGxpc3Rbc2hzb3J0XVsnY29sX3R5cGUnXT3moLflvI87XFxcXG4gICAgICAgIHBsaXN0W3Noc29ydF1bJ3BpYyddPeWbvuaghztcXFxcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2VyX3BsYXlsaXN0cycsIHBsaXN0KTtcXFxcbiAgICAgICAgfSAgIFxcXFxuICAgICAgICBcXFxcbiAgICAgICAgXFxcXG4gICAgICAgIGZvciAodmFyIGogaW4gbGlzdCkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbGlzdFtqXS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IGxpc3Rbal0udXJsLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiDmoLflvI8sXFxcXG4gICAgICAgICAgICAgICAgcGljOuWbvuaghyxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogbGlzdFtqXS51cmwucmVwbGFjZSgvQGxhenlSdWxlW1xcXFxcXFxcc1xcXFxcXFxcU10rL2csICcnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBzaHNvcnQsXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuICAgIGdldFRhYnM6IGZ1bmN0aW9uKHBhcnNlKSB7XFxcXG4gICAgICAgIHZhciB0YWJzID0gW107XFxcXG4gICAgICAgIHZ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LumAiembhuWQjeensCA6ICdhJiZUZXh0JztcXFxcbiAgICAgICAgdmFyIOmAiembhumTvuaOpSA9IHBhcnNlLumAiembhumTvuaOpSA/IHBhcnNlLumAiembhumTvuaOpSA6ICdhJiZocmVmJztcXFxcbiAgICAgICAgdmFyIOino+aekCA9IHBhcnNlLuino+aekCA/IHBhcnNlLuino+aekCA6ICcnO1xcXFxuICAgICAgICB2YXIgdGVtcCA9IFtdO1xcXFxuICAgICAgICBmb3IgKHZhciBpIGluIGNvbnRzKSB7XFxcXG4gICAgICAgICAgICBpZiAocGFyc2Uu6YCJ6ZuG5YiX6KGoICE9IHVuZGVmaW5lZCkge1xcXFxuICAgICAgICAgICAgICAgIGxpc3RzLnB1c2gocGRmYShjb250c1tpXSwgcGFyc2Uu6YCJ6ZuG5YiX6KGoKS5tYXAoeCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaCh4LCDpgInpm4blkI3np7ApXFxcXG4ucmVwbGFjZShcXFxcXFxcIuesrFxcXFxcXFwiLFxcXFxcXFwiXFxcXFxcXCIpXFxcXG4ucmVwbGFjZShcXFxcXFxcIumbhlxcXFxcXFwiLFxcXFxcXFwiXFxcXFxcXCIpXFxcXG4ucmVwbGFjZShcXFxcXFxcIuacn1xcXFxcXFwiLFxcXFxcXFwiXFxcXFxcXCIpXFxcXG4ucmVwbGFjZShcXFxcXFxcIuivnVxcXFxcXFwiLFxcXFxcXFwiXFxcXFxcXCIpXFxcXG4ucmVwbGFjZShcXFxcXFxcIuacgOaWsFxcXFxcXFwiLFxcXFxcXFwiXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwZCh4LCDpgInpm4bpk77mjqUpICsg6Kej5p6QLFxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSkpXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBwZChjb250c1tpXSwg6YCJ6ZuG6ZO+5o6lKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoIemAiembhumTvuaOpS5pbmNsdWRlcygnaHJlZicpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IHBkZmgoY29udHNbaV0sIOmAiembhumTvuaOpSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHRlbXAucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGNvbnRzW2ldLCDpgInpm4blkI3np7ApLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCArIOino+aekCxcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCDlgJLluo8gPSBwYXJzZS7lgJLluo8gPyBwYXJzZS7lgJLluo8gOiBmYWxzZTtcXFxcbiAgICAgICAgdmFyIHJlc3VsdHMgPSBsaXN0cy5sZW5ndGggPyBsaXN0cyA6IFt0ZW1wXTtcXFxcbiAgICAgICAgaWYgKOWAkuW6jykge1xcXFxuICAgICAgICAgICAgcmVzdWx0cyA9IHJlc3VsdHMubWFwKHggPT4geC5yZXZlcnNlKCkpO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHZhciBwbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCAne30nKTtcXFxcbiAgICAgICAgaWYgKHJlc3VsdHMuc29tZSh4ID0+IHgubGVuZ3RoID4gMCkpIHtcXFxcbiAgICAgICAgICAgaWYoIXBsaXN0Lmhhc093blByb3BlcnR5KHNoc29ydCkpe1xcXFxuICAgICAgICAgICAgIHBsaXN0W3Noc29ydF09e307XFxcXG4gICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgcGxpc3Rbc2hzb3J0XVsnbGVuZ3RoJ109cmVzdWx0cy5sZW5ndGg7XFxcXG4gICAgICAgIH07XFxcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdlcl9wbGF5bGlzdHMnLCBwbGlzdCk7XFxcXG4gICAgICAgIHJldHVybiByZXN1bHRzO1xcXFxuICAgIH0sXFxcXG4gICAgZ2V0UGxheWVyczogZnVuY3Rpb24ocGFyc2UsIG1vZGUsZnVuYykge1xcXFxuICAgICAgICAvL2xvZyhtb2RlKVxcXFxuICAgICAgICB2YXIgcGxheSA9ICdlcl9wbGF5bGlzdF8nO1xcXFxuICAgICAgICB0aGlzLnByZUxvYWQoZnVuYyk7XFxcXG4gICAgICAgIHRoaXMuY2xvc2UocGFyc2UubWFwKHggPT4geC7nsbvlnospLCBwYXJzZS5sZW5ndGgpO1xcXFxuICAgICAgICBtb2RlID0gbW9kZSA/IG1vZGUgOiAxO1xcXFxuICAgICAgICBwYXJzZS5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxcXG4gICAgICAgICAgICB2YXIgdGFicyA9IFsn5Li757q/J107XFxcXG4gICAgICAgICAgICBpZiAoaXRlbS7nur/ot68gIT0gdW5kZWZpbmVkKSB7XFxcXG4gICAgICAgICAgICAgICAgdGFicyA9IHRoaXMuZ2V0VGFicyhpdGVtKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHB1dE15VmFyKHBsYXkraSsnX3RhYnMnLHRhYnMpO1xcXFxuICAgICAgICAgICAgaWYoaXRlbS5BamF4KXtcXFxcbiAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGFicyh0YWJzLCBpdGVtLuexu+WeiywgcGxheSArIGksaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGFiczIodGFicywgaXRlbS7nsbvlnossIHBsYXkgKyBpLGl0ZW0pO1xcXFxuICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgIHB1dE15VmFyKCdlcl9odG1sJyxodG1sKTtcXFxcbiAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2VyX3VybCcsTVlfVVJMKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIHZhciBsaXN0cz1mdW5jKGdldE15VmFyKCdlcl8nK2l0ZW0u57G75Z6LLCcwJyksTVlfVVJMKTtcXFxcbiAgICAgICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgdmFyIGxpc3RzID0gdGhpcy5nZXRMaXN0cyhpdGVtLCBwbGF5K2kpO1xcXFxuICAgICAgICAgICAgLy9sb2cobGlzdHMpXFxcXG4gICAgICAgICAgICBpZiAobGlzdHMuc29tZSh4ID0+IHgubGVuZ3RoID4gMCkpIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGFicyh0YWJzLCBpdGVtLuexu+WeiywgcGxheSArIGksaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGFiczIodGFicywgaXRlbS7nsbvlnossIHBsYXkgKyBpLGl0ZW0pO1xcXFxuICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKGdldE15VmFyKCdlcl8nICsgaXRlbS7nsbvlnosgKyAnZm9sZCcsICcxJykgPT0gJzEnKSB7XFxcXG4gICAgICAgICAgICAgICAgdGhpcy5zZXRMaXN0cyhsaXN0cywgZ2V0TXlWYXIoJ2VyXycraXRlbS7nsbvlnossICcwJyksIHBsYXkgKyBpLGl0ZW0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgIC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GR1b3NlbGVjdClcXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGRhdGF1cmwsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGDigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiNGRjU3MzNcXFxcXFxcIj5gICsgZGF0YXRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVCeVZhbHVlKGFyciwgdmFsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyW2ldWyd1cmwnXSA9PSB2YWwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIuc3BsaWNlKGksIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJlbW92ZUJ5VmFsdWUoZHVvc2VsZWN0LCBkYXRhdXJsKVxcXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oZGF0YXVybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZGF0YXRpdGxlXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQrXFxcXFxcXCJfZHVvc2VsZWN0XFxcXFxcXCIsIGR1b3NlbGVjdCk7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbi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