Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥⚙ 聚漫设置 ⚙@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwiQ2xhc3NUYWJcIixcInBhdGhcIjpcIkNsYXNzVGFiXCIsXCJydWxlXCI6XCJ2YXIge1xcbiAgICBRSU5HX1RJVExFLCB0aXRsZSwgdXJsLFxcbiAgICBjbGFzc19uYW1lLCBjbGFzc191cmwsXFxuICAgIGFyZWFfbmFtZSwgYXJlYV91cmwsXFxuICAgIHllYXJfbmFtZSwgeWVhcl91cmwsXFxuICAgIHNvcnRfbmFtZSwgc29ydF91cmxcXG59ID0gJC5pbXBvcnRQYXJhbVxcbmNvbnN0IENsYXNzVGFiID0gZnVuY3Rpb24oY2xhc3NBcnJheSwgcGFyYW1zKSB7XFxuICAgIE9iamVjdC5hc3NpZ24odGhpcywgcGFyYW1zKVxcbiAgICB0aGlzLmFyciA9IGNsYXNzQXJyYXkubWFwKHYgPT4gdGhpcy5pbml0KHYpKVxcbiAgICB0aGlzLnNpZ24gPSAnJCcgKyBRSU5HX1RJVExFICsgJ18nICsgKHRoaXMubmFtZSB8fCAnJykgKyAnXydcXG4gICAgdGhpcy5jb2xvciA9IHRoaXMuY29s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FzcyhpZCkpXFxuICAgICAgICAgICAgY2xhc3NfbmFtZS5mb3JFYWNoKChuYW1lLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBjbGFzc191cmxbaV0sXFxuICAgICAgICAgICAgICAgICAgICBub3cgPSBKU09OLnN0cmluZ2lmeSh7IG5hbWU6IG5hbWUsIHVybDogdXJsIH0pXFxuICAgICAgICAgICAgICAgIGVsLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ0nICsgbmFtZS5mb250Y29sb3IodGhpcy5jb2xvcikuYm9sZCgpIDogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc2VsZWN0ZWQgPT0gbm93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICB9LCB0aGlzLnNpZ24sIGlkLCBub3cpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZWwucHVzaCh7IGNvbF90eXBlOiB0aGlzLmJvdW5kYXJ5IH0pXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBpbml0KGNsYXNzT2JqZWN0KSB7XFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX25hbWUgPT0gJ3N0cmluZycpXFxuICAgICAgICAgICAgY2xhc3NPYmplY3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RlbnQuY29tLyddXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByZXF1aXJlbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICB0cnkgeyAvL+i/nOeoi+S+nei1lue0ouW8lVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IHJlcXVlc3QocmVxdWlyZWxpc3RbaV0gKyAnRHJlYW1Pek8vSk0vbWFpbi9KTScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIGlmIChKU09OLnBhcnNlKHJlcykuc3RhdHVzQ29kZSA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZSh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVEb3dubG9hZChyZXF1aXJlbGlzdFtpXSArICdEcmVhbU96Ty9KTS9tYWluL0pNJyx1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZURvd25sb2FkKHJlcXVpcmVsaXN0W2ldICsgJ0RyZWFtT3pPL0pNL21haW4vSk0nLHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgYmFjayhmYWxzZSlcXG4gICAgICAgIC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mUnIH0sIHtcXG4gICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ/Cfk50nLnNtYWxsKCkgKyAnJm5ic3Ag6IGa5ryr6Ieq5a6a5LmJICZuYnNwJy5ib2xkKCkuZm9udGNvbG9yKCcjNzU3NTc1JykgKyAoZGlzYWJsZUN1c3RvbSA/ICfinYwnIDogJ+KtlScpLnNtYWxsKCksXFxuICAgIHVybDogJChbKGRpc2FibGVDdXN0b20gPyAn5ZCv55SoJyA6ICfnpoHnlKgnKSArICflkIjpm4boh6rlrprkuYknLCAn5riF6Zmk6Ieq5a6a5LmJ5pWw5o2uJywgJ+e8lui+kUpTT04nXSwgMSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgIHN3aXRjaCAoaW5wdXQuc2xpY2UoMCwgMikpIHtcXG4gICAgICAgICAgICBjYXNlICfmuIXpmaQnOlxcbiAgICAgICAgICAgICAgICBkZWxldGVGaWxlKCdjdXN0b21EYXRhJylcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICflkK/nlKgnOlxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnZGlzYWJsZUN1c3RvbScsICcnKVxcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIGNhc2UgJ+emgeeUqCc6XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdkaXNhYmxlQ3VzdG9tJywgJ1QnKVxcbiAgICAgICAgICAgICAgICBpbnB1dCArPSAnXFxcXG7lsI/nqIvluo/lkK/nlKgv56aB55So44CB6YeN5paw5o6S5bqP562J5pON5L2c5Z2H5LiN5Lya5L2T546w5Zyo6aaW6aG15bCP56iL5bqP5YiX6KGo5LitJ1xcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIGNhc2UgJ+e8lui+kSc6XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBnZXRNeVZhcigncmVtb3RlVXJsJylcXG4gICAgICAgICAgICAgICAgaWYgKC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lID0gIXJ1bGVzW2ldLnZpc2libGVcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXG4gICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMuc3BsaWNlKG5ld0luZGV4LCAwLCBydWxlcy5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaV0uaWNvbiA9IGlucHV0XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBydWxlc1tpXS5pY29uXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+WvvOWFpea1t+mYlCc6XFxuICAgICAgICAgICAgZC51c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AgbGV0IHNvcnRGbGFnID0gcGFyc2VJbnQoZ2V0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJykpXFxuICAgICAgICAgICAgZC50aXRsZSA9IChzb3J0RmxhZyA9PSBpID8gJ/CflIMgICcgOiAnJykgKyBkLnRpdGxlXFxuICAgICAgICAgICAgaWYgKHNvcnRGbGFnID09IC0xKVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsIGkudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mAieaLqeimgeenu+WKqOWIsOeahOS9jee9ridcXG4gICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgob2xkSW5kZXgsIG5ld0luZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzLnNwbGljZShuZXdJbmRleCwgMCwgcnVsZXMuc3BsaWNlKG9sZEluZGV4LCAxKVswXSlcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBzb3J0RmxhZywgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5pu05pS55Zu+5qCHJzpcXG4gICAgICAgICAgICBkLnVybCA9ICQodi5pY29uIHx8ICcnLCAn6L6T5YWl5paw5Zu+5qCH5Zyw5Z2A5oiW6aKc6Imy5Luj56CB77yaJykuaW5wdXQoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzW2ldLmljb24gPSBpbnB1dFxcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcnVsZXNbaV0uaWNvblxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICflr7zlhaXmtbfpmJQnOlxcbiAgICAgICAgICAgIGQudXJsID0gJ3J1bGU6Ly8nICsgYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGRhdGFbaV0pKTtcXG4gICAgICAgICAgICBicmVha1xcbiAgICB9XFxuICAgIGVsLnB1c2goZClcXG59KVxcbnNldFJlc3VsdChlbClcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIumhtemdoui9veWFpVwiLFwicGF0aFwiOlwiZnJhbWVMb2FkXCIsXCJydWxlXCI6XCJqczpcXG5jb25zdCBRSU5HX1RJVExFID0gZ2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AgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLCBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlSW5kZXggPSByZXMudXJsLmluZGV4T2YoJy5qczonKVxcbiAgICAgICAgICAgICAgICBpZiAocmVJbmRleCA+PSAwKSByZXMudXJsID0gcmVzLnVybC5zbGljZSgwLCByZUluZGV4KSArICcuanM6JyArIGhpamFja0xhenlSdWxlICsgJzsnICsgcmVzLnVybC5zbGljZShyZUluZGV4ICsgNClcXG4gICAgICAgICAgICB9IGVsc2UgIGlmIChkZXRhaWxGaW5kUnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGdlbkV4VXJsKHVybCksXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihnZW5NeVJ1bGUoKSwgeyBkZXRhaWxfZmluZF9ydWxlOiBkZXRhaWxGaW5kUnVsZSB9KSkpLFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpc0luZGV4ICYmIHRpdGxlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9ICdoaWtlcjovL3BhZ2UvZnJhbWVMb2FkP3J1bGU9JyArIFFJTkdfVElUTEVcXG4gICAgICAgIC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ICAgICAgIHVybDogJ2hpa2VyOi8vc2VhcmNoP3M9JytNWV9QQVJBTVMueXRpdGxlKycmcnVsZT3ogZrmvKvwn5SuJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljX2JsdXInXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICAvL3ZhciBqaiA9IGdldE15VmFyKFxcXCJqanNcXFwiLCBcXFwi5pS26LW3XFxcIik7XFxuICAgICAgICAvL3ZhciBqanVybCA9ICdoaWtlcjovL2VtcHR5QGxhenlSdWxlPS5qczpnZXRNeVZhcihcXFwiampzXFxcIikgPT0gXFxcIuaUtui1t1xcXCI/cHV0TXlWYXIoXFxcImpqc1xcXCIsXFxcIuWxleW8gFxcXCIpOnB1dE15VmFyKFxcXCJqanNcXFwiLFxcXCLmlLbotbdcXFwiKTtcXFwiaGlrZXI6Ly9lbXB0eVxcXCInO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+eugOS7iyA8c21hbGw+PHNtYWxsPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjojMTlCODlEXFxcIj7lsZXlvIA+PC9zcGFuPjwvc21hbGw+PC9zbWFsbD4nLFxcbiAgICAgICAgICAgIGltZzogXFxcImh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzE5Ny5wbmdcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoamppZCwgZGVjaWQsIGRlc19kZXNjKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihcXFwiampzXFxcIiwgXFxcIuaUtui1t1xcXCIpID09IFxcXCLmlLbotbdcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiampzXFxcIiwgXFxcIuWxleW8gFxcXCIpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGpqaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn566A5LuLIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuaUtui1tz48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiM4MDgwODBcXFwiPicgKyBkZXNfZGVzYyArICcuLi48L3NwYW4+J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJqanNcXFwiLCBcXFwi5pS26LW3XFxcIik7XFxuXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnroDku4sgPHNtYWxsPjxzbWFsbD48c3BhbiBzdHlsZT1cXFwiY29sb3I6IzE5Qjg5RFxcXCI+5bGV5byAPjwvc3Bhbj48L3NtYWxsPjwvc21hbGw+J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG5cXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBkZWNpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjLnN1YnN0cigwLCAzMCkgKyAnLi4uPC9zcGFuPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB9LCBNWV9SVUxFICsgXFxcIl9qamlkXFxcIiwgTVlfUlVMRSArIFxcXCJfZGVjaWRcXFwiLCBkZXNfZGVzYyksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBNWV9SVUxFICsgXFxcIl9qamlkXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgZC5wdXNoKHtc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gICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZG93bmxvYWQudmlldyNub1JlY29yZEhpc3RvcnkjI25vUmVmcmVzaCM/cnVsZT3mnKzlnLDotYTmupDnrqHnkIZcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlckxpc3Q6IGRvTGlzdCxcXG4gICAgICAgICAgICAgICAgaW5mbzoge1xcbiAgICAgICAgICAgICAgICAgICAgYm9va05hbWU6IHBkZmgoaHRtbCwgVGl0bGUpLFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZU5hbWU6IE1ZX1JVTEUudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBib29rVG9wUGljOiBwZChodG1sLCBjaGFwdGVyUGljKSxcXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlQ29kZTogZG93bmxvYWRsYXp5XFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWaWV3OiBcXFwiMVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSk7XFxuICAgIH0gY2F0Y2ggKGUpIHt9XFxufVxcblxcbmZ1bmN0aW9uIGNoYXB0ZXIoY2hhcHRlckxpc3QsIGNoYXB0ZXJUaXRsZSwgY2hhcHRlclVybCwgZGVmYXVsdE9yZGVyLCBoYXNMaW5lKSB7XFxuICAgIHZhciBsaXN0ID0gY2hhcHRlckxpc3Q7XFxuICAgIHZhciBvcmlnaW5hbCA9IFt7XFxuICAgICAgICB1cmw6IE1ZX1VSTCxcXG4gICAgICAgIG9yZGVyOiBkZWZhdWx0T3JkZXJcXG4gICAgfV07XFxuICAgICFmaWxlRXhpc3QoJ2hpa2VyOi8vZmlsZX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gXFxcIuKAmOKAmDrliIfmjaJcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgodmFyS2V5LCBsaW5lSW5kZXgsIGxpbmVUaXRsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIodmFyS2V5LCBsaW5lSW5kZXgudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgICAgIC8vIGxvZyhNWV9SVUxFLnVybClcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKChNWV9SVUxFLnRpdGxlICsgJyNsaW5lLXRpdGxlJyksIGxpbmVUaXRsZSlcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhNWV9SVUxFLnRpdGxlICsgZ2V0TXlWYXIoKE1ZX1JVTEUudGl0bGUgKyAnI2xpbmUtdGl0bGUnKSkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5YiH5o2i6IezXFxcIiArIGxpbmVUaXRsZVxcbiAgICAgICAgICAgICAgICB9LCB2YXJLZXksIGksIGxpbmVUaXRsZSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXG4gICAgICAgICAgICB9KTtcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLop6PmnpBb5YyFXSpcIixcInBhdGhcIjpcImJ6anNcIixcInJ1bGVcIjpcInZhciDmvKvnlLvop6PmnpAgPSAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgdmFyIGlkID0gdHJ1ZTtcXG4gICAgdmFyIGNvZGUgPSByZXF1ZXN0KGlucHV0KVxc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bGUuZm9udGNvbG9yKOWIhuexu+minOiJsikgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkobmV3X2NhdGUpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX1JVTEUudXJsLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAoZm9sZCA9PT0gJzEnKSB7XFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mKOaOkumZpCkgIT0gJ3VuZGVmaW5lZCcgJiYg5o6S6ZmkICE9ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHRpdGxlLmZvbnRjb2xvcijliIbnsbvpopzoibIpIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQocGQoaXRlbSwg5YiG57G76ZO+5o6lKSArICcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLnRpdGxlLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWKqOaAgVvkuIBdKlwiLFwicGF0aFwiOlwiY2F0ZWdvcmllcy1oZWFkZXJcIixcInJ1bGVcIjpcIi8qKlxcbiAqIOacrOWcsOe9kemhteaPkuS7tumTvuaOpSBoaWtlcjovL2ZpbGVzL3J1bGVzL2pzL2NhdGVnb3JpZXMtaGVhZGVyLmpzXFxuICog5a2Q6aG16Z2i6ZO+5o6lIGhpa2VyOi8vcGFnZS9jYXRlZ29yaWVzLWhlYWRlclxcbiAqIOmBk+mVv+S7k+W6k+mTvuaOpSBodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD0yNzA1XFxuICog56CB5LqRIEdpdGVlIOmTvuaOpSBodHRwczovL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Wyfmipjlj6DmjInpkq7mj5LlhaXooYwnXVxcbiAgICAgICAgICAgIGlmIChsYXlvdXQudGl0bGUgfHwgbGF5b3V0LnVybCB8fCBsYXlvdXQuY29sX3R5cGUgfHwgaW5qZWN0SW5kZXgpIHtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBrZXlzW2ldXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF1ba2V5XSA9IGxheW91dFtrZXldO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLor7fkvKDlhaXmraPnoa7nmoTmipjlj6DnlYzpnaLlhYPntKDvvIFcXFwiKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvLyBpbmplY3RJbmRleCDmipjlj6DmjInpkq7mj5LlhaXnrKwgaW5qZWN0SW5kZXgg6KGMXFxuICAgICAgICAgICAgaWYgKGluamVjdEluZGV4KSB7XFxuICAgICAgICAgICAgICAgIGlmICghKHR5cGVvZiAoaW5qZWN0SW5kZXgpID09PSAnbnVtYmVyJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi5oqY5Y+g5oyJ6ZKu5o+S5YWl6KGM6K+35Lyg5YWl5pWw5a2X77yBXFxcIilcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeWkp+S6jiAwIOeahOaVtOaVsO+8gVxcXCIpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgIC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zOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIG1VcmxSdWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsZXQgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgaWYgKHVybFJ1bGUucGFyc2VPcHRpb24pIHtcXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodXJsUnVsZS5wYXJzZU9wdGlvbikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwZFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tRm9ySHRtbFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRmaFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb21Gb3JIdG1sO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHVybFJ1bGVbXFxcIuino+aekOaWueazlVxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHVybFJ1bGVbXFxcIuino+aekOaWueazlVxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGFyc2VEb21cXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBkXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGFyc2VEb21Gb3JIdG1sXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwZGZoXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbUZvckh0bWw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdXJsID0gcGFyc2Uoc3JjLCBtVXJsUnVsZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh1cmxSdWxlLmRlYWxVcmwpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdXJsUnVsZS5kZWFsVXJsKHVybClcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHVybFJ1bGVbJ+S6jOasoeWkhOeQhiddKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVybFJ1bGVbJ+S6jOasoeWkhOeQhiddKHVybClcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmICh1cmxSdWxlLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCB1cmxSdWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cmwgPSBwYXJzZURvb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WxlKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsIGxpc3RSdWxlKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvLyBsb2cobGlzdClcXG4gICAgICAgICAgICBsaXN0Lm1hcChjYXRlZ29yeSA9PiB7XFxuICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0OiBjYXRlZ29yeSxcXG4gICAgICAgICAgICAgICAgICAgIHN1Ykxpc3RSdWxlOiBydWxlT2JqLnN1Ykxpc3RSdWxlIHx8IHJ1bGVPYmpbXFxcIuWtkOWIhuexu1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGVSdWxlOiBydWxlT2JqLnRpdGxlUnVsZSB8fCBydWxlT2JqW1xcXCLliIbnsbvmoIfpophcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIHVybFJ1bGU6IHJ1bGVPYmoudXJsUnVsZSB8fCBydWxlT2JqW1xcXCLliIbnsbvpk77mjqVcXFwiXSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuXFxuICAgICAgICAvLyBsb2coJC5zdHJpbmdpZnkoY2F0ZWdvcmllcykpXFxuXFxuICAgICAgICBsZXQgaW5pdF9jYXRlID0gW11cXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMjA7IGkrKykge1xcbiAgICAgICAgICAgIGluaXRfY2F0ZS5wdXNoKFxcXCIwXFxcIilcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGNvbnN0IGNhdGVfdGVtcF9qc29uID0gZ2V0TXlWYXIobVRhZyArIHRoaXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShpbml0X2NhdGUpKVxcbiAgICAgICAgY29uc3QgY2F0ZV90ZW1wID0gSlNPTi5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xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UYWc6IG1UYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRm9sZDogdGhpc1tzeW1ib2xNYXAubUZvbGRdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XS5jb2xfdHlwZSB8fCBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKGZvbGRMYXlvdXQpXFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy/lhbfkvZPliJfooajkuIvnmoTliIbnsbtcXG4gICAgICAgICAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgICAgIGlmIChjYXRlZ29yeS5zdWJMaXN0UnVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gdGhpcy5ldmFsSlNSdWxlKGNhdGVnb3J5Lmxpc3QsIGNhdGVnb3J5LnN1Ykxpc3RSdWxlKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwYXJzZURvbUZvckFycmF5KGNhdGVnb3J5Lmxpc3QsIGNhdGVnb3J5LnN1Ykxpc3RSdWxlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoaW5kZXggPCAodGhpc1tzeW1ib2xNYXAubUZvbGRJbmRleF0gfHwgMSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIGNhdGVnb3J5KVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9JyArIHRoaXNbc3ltYm9sTWFwLm1Db2xvcl0gKyAnPicgKyB0aXRsZSArICcgPC9mb250PjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmluZGV4ID09PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuaW5kZXggPT09IDAgPyBuZXdfY2F0ZSA6IHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuVVJMLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZzogbVRhZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzW3N5bWJvbE1hcC5tRm9sZF0gPT09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gdGhpcy5nZXRUaXRsZShpdGVtLCBjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgY2F0ZWdvcnkpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj0nICsgdGhpc1tzeW1ib2xNYXAubUNvbG9yXSArICc+JyArIHRpdGxlICsgJyA8L2ZvbnQ+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5DQVRFR09SWSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5VUkwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFnOiBtVGFnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiB0aGlzW3N5bWJvbE1hcC5tUGFnZV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuICAgIOeVjOmdoihsYXlvdXQpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmxheW91dChsYXlvdXQpXFxuICAgIH0sXFxuICAgIOWIhuexu+mTvuaOpSh0cnVlVXJsKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy50cnVlVXJsKHRydWVVcmwpO1xcbiAgICB9LFxcbiAgICDpobXnoIEocGFnZSkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMucGFnZShwYWdlKTtcXG4gICAgfSxcXG4gICAg5rqQ56CBKGh0bWwpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmh0bWwoaHRtbCk7XFxuICAgIH0sXFxuICAgIOWumuS9jeS4gOe6p+WIhuexuyhsaXN0KSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5saXN0KGxpc3QpO1xcbiAgICB9LFxcbiAgICDlrprkvY3lrZDliIbnsbsoc3ViTGlzdCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuc3ViTGlzdChzdWJMaXN0KTtcXG4gICAgfSxcXG4gICAg5a6a5L2N5YiG57G75qCH6aKYKHRpdGxlKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy50aXRsZSh0aXRsZSk7XFxuICAgIH0sXFxuICAgIOWumuS9jeWIhuexu+mTvuaOpSh1cmwpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLnVybCh1cmwpO1xcbiAgICB9LFxcbiAgICDlvIDlkK/lhoXnva7mipjlj6Dlip/og70oKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5mb2xkSW5uZXIodH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KSB7XFxuICAgICAgICAgICAgdGhpcy5yZWdleE1hcCA9IHRoaXMucmVnZXhNYXAuY29uY2F0KHJlZ0V4cClcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdGhpcy5yZWdleE1hcC5wdXNoKHJlZ0V4cClcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICBkZWJ1ZygpIHtcXG4gICAgICAgIHRoaXMucGFyYW1zLmRlYnVnID0gdHJ1ZVxcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIGV4ZWMoKSB7XFxuICAgICAgICB0aGlzLmNoZWNrUGFyYW1zKClcXG4gICAgICAgIGxldCB0cnVlX3VybCA9ICcnXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMucmVnZXhNYXAubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgcmVnT2JqID0gdGhpcy5yZWdleE1hcFtpXTtcXG4gICAgICAgICAgICBsZXQgdXJsRXhwID0gcmVnT2JqLnJlZztcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHVybEV4cCA9PT0gJ3N0cmluZycpIHtcXG4gICAgICAgICAgICAgICAgdXJsRXhwID0gbmV3IFJlZ0V4cCh1cmxFeHApXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh1cmxFeHAudGVzdCh0aGlzLnBhcmFtcy51cmwpKSB7XFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnBhcmFtcy5kZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHVybEV4cC50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRydWVfdXJsID0gcmVnT2JqLmV4ZWMoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHRydWVfdXJsKSB7X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A9IE9iamVjdC5rZXlzKHNvdXJjZSlcXG4gICAgZm9yIChsZXQgaSBpbiBrZXlzKSB7XFxuICAgICAgICB0YXJnZXRba2V5c1tpXV0gPSBzb3VyY2Vba2V5c1tpXV1cXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiDkuIDnuqcob2JqKSB7XFxuICAgIHZhciBkID0gW107XFxuICAgIGlmICgkLnR5cGUob2JqKSA9PSBcXFwic3RyaW5nXFxcIikge1xcbiAgICAgICAgb2JqID0gY29udmVydDEob2JqKVxcbiAgICB9XFxuICAgIGlmIChvYmou6KeE5YiZKSB7XFxuICAgICAgICBsZXQgYyA9IGNvbnZlcnQxKG9iai7op4TliJkpXFxuICAgICAgICBtZXJnZShjLCBvYmopXFxuICAgIH1cXG4gICAgbGV0IGFyciA9IHBkZmEoZ2V0UmVzQ29kZSgpLCBvYmou5YiX6KGoKTtcXG4gICAgICAgaWYgKG9iai7liJfooajlpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIGFyciA9IG9iai7pk77mjqXlpITnkIYoYXJyKVxcbiAgICAgICAgfVxcbiAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXG4gICAgICAgIGxldCB1cmwgPSBwZChpdCwgb2JqLumTvuaOpSlcXG4gICAgICAgIGlmIChvYmou6ZO+5o6l5aSE55CGICE9IG51bGwpIHtcXG4gICAgICAgICAgICB1cmwgPSBvYmou6ZO+5o6l5aSE55CGKHVybClcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXQsIG9iai7moIfpopgpXFxuICAgICAgICBpZiAob2JqLuagh+mimOWkhOeQhiAhPSBudWxsKSB7XFxuICAgICAgICAgICAgdGl0bGUgPSBvYmou5qCH6aKY5aSE55CGKHRpdGxlKVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHBpYyA9IHBkKGl0LCBvYmou5Zu+54mHKVxcbiAgICAgICAgaWYgKG9iai7lm77niYflpITnkIYgIT0gbnVsb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HtcXG4gICAgICAgICAgICAgICAgICAgIGJvb2tOYW1lOiBib29rTmFtZSwgLy/mvKvnlLvlkI3np7AsXFxuICAgICAgICAgICAgICAgICAgICBydWxlTmFtZTogTVlfUlVMRS50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGJvb2tUb3BQaWM6IOWbvueJhyxcXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlQ29kZTog5ryr55S76Kej5p6QLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmlldzogXFxcIjFcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICByZXR1cm4g56ug6IqCanNvblxcbn1cXG5cXG5cXG5mdW5jdGlvbiDmt7vliqDlpLTpg6jliJfooagoZCwg5qCH6aKYLCDlm77niYcsIOaPj+i/sCwg5L2c6ICFLCDml7bpl7QsIOWIhuexuyzpobVVUkwpIHtcXG5cXG4gICAg5qCH6aKYID0gIeagh+mimCA/ICcnIDog5qCH6aKYICsgJ1xcXFxuJ1xcbiAgICDlm77niYcgPSAh5Zu+54mHID8gJycgOiDlm77niYdcXG4gICAg5o+P6L+wID0gIeaPj+i/sCA/ICcnIDog5o+P6L+wLnJlcGxhY2UoXFxcIuabtOaWsOiHs++8mlxcXCIsICcnKVxcblxcbiAgICDkvZzogIUgPSAh5L2c6ICFID8gJycgOiAnXFxcXG4nICsg5L2c6ICFXFxuICAgIOaXtumXtCA9ICHml7bpl7QgPyAnJyA6ICdcXFxcbicgKyDml7bpl7RcXG4gICAg5YiG57G7ID0gIeWIhuexuyA/ICcnIDogJ1xcXFxuJyArIOWIhuexu1xcblxcblxcbiAgICB2YXIg5aS06YOodGl0bGUgPSBbJ+KAmOKAmOKAmeKAmTxiPicsJzwvYj4gPHNtYWxsPjxmb250IGNvbG9yPSNGQTcyOTg+JywnPC9mb250PicsJzwvc21hbGw+J11cXG4gICAgdmFyIOWktOmDqGRlc2MgPSBbJ+KA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1xcbiAgICAgICAgdmFyIGpzYmwgPSDlvZPliY1VUkwgKyBcXFwi566A5LuL5pS2XFxcIjtcXG4gICAgICAgIHZhciBqaiA9IGdldE15VmFyKOW9k+WJjVVSTCArIFxcXCLnroDku4vmlLZcXFwiLCBcXFwi5bey5pS26LW3XFxcIik7XFxuICAgICAgICBqaiA9IGpqID09IFxcXCLlt7LmlLbotbdcXFwiID8gXFxcIuWxleW8gFxcXCIgOiBcXFwi5bey5pS26LW3XFxcIjtcXG4gICAgICAgIHB1dE15VmFyKGpzYmwsIGpqKVxcbiAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IOW9k+WJjVVSTCArIFxcXCJfYnRcXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB0aXRsZTog5pS2LnJlcGxhY2UoXFxcIueugOS7i+aUtlxcXCIsIGpqKVxcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiDlvZPliY1VUkwgKyBcXFwiX216XFxcIlxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgdGl0bGU6IGpqID09IFxcXCLlt7LmlLbotbdcXFwiID8g5pS25YaF5a65LnJlcGxhY2UoXFxcIueugOS7i1xcXCIsIOeugOS7i+WGheWuueaUtikgOiDmlLblhoXlrrkucmVwbGFjZShcXFwi566A5LuLXFxcIiwg566A5LuL5YaF5a65KVxcbiAgICAgICAgfSlcXG4gICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgfSwg566A5LuL5YaF5a65LCDnroDku4vlhoXlrrnmlLYsIGJ0dGl0bGUsIG16dGV4dCwg6aG1VVJMKVxcblxcblxcbiAgICAvL+agh+mimFxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGJ0dGl0bGUucmVwbGFjZShcXFwi566A5LuL5pS2XFxcIiwgamopLFxcbiAgICAgICAgdXJsOiBqanVybCxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgIHBpY191cmw6IOWbvueJhyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJfYnRcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICAvL+eugOS7i1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGpqID09IFxcXCLlt7LmlLbotbdcXFwiID8gbXp0ZXh0LnJlcGxhY2UoXFxcIueugOS7i1xcXCIsIOeugOS7i+WGheWuueaUtikgOiBtenRleHQucmVwbGFjZShcXFwi566A5LuLXFxcIiwg566A5LuL5YaF5a65KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJfbXpcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbn1cXG5cXG5mdW5jdGlvbiDmt7vliqDliJfooajnq6DoioIoZCwg5qCH6aKY5pWw5o2uLCDliJfooajmlbDmja4sIOino+aekOS7o+eggSwg6aG1VVJMLCDlm77niYcpIHtcXG5cXG5cXG4gICAgLy9k5LiO5aSW55WMZO+8jOS4uuWQjOWGheWtmOWcsOWdgO+8jOS4jeeUqOi/lOWbnlxcbiAgICAvL+agh+mimOaVsOaNriAg5Y2z5qCH6aKY5ZCN5a2XXFxuICAgIC8v5YiX6KGo5pWw5o2u5b+F6aG75pivSlNPTiAg5qC85byP5pivW3t0aXRsZTonJyx1cmw6JycsfSwuLi4uLl0gIOS4lHVybOW/hemhu+acieWJjee8gFxcblxcbiAgICAvL+Wbvuagh+iOt+WPllxcbiAgICBpZiAoIeWbvueJhykge1xcbiAgICAgICAg5Zu+54mHID0gJ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Lev57q/Jywg5qCH6aKY5pWw5o2uKS5yZXBsYWNlKCfmjpLluo8nLCDmj5DnpLopXFxuICAgICAgICB9KVxcblxcblxcbiAgICAgICAgaWYgKOaPkOekuiA9PSAn5YCS5bqPJykge1xcbiAgICAgICAgICAgIOWIl+ihqOaVsOaNri5yZXZlcnNlKClcXG4gICAgICAgIH1cXG4gICAgICAgIOWIl+ihqOaVsOaNri5mb3JFYWNoKGZ1bmN0aW9uKGRhdGEsIHNzaWQpIHtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGRhdGEudGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogZGF0YS51cmwgKyDop6PmnpDku6PnoIEsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDog6aG1VVJMICsgXFxcIl/pgInpm4ZcXFwiICsgc3NpZFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG5cXG5cXG4gICAgICAgIHB1dE15VmFyKOmhtVVSTCArIFxcXCLnq6DoioLmjpLluo9cXFwiLCDmj5DnpLopXFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgIH0sIOagh+mimOWQjSwg5qCH6aKY5pWw5o2uLCDliJfooajmlbDmja4sIOino+aekOS7o+eggSwg6aG1VVJMKVxcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IOagh+mimOWQjS5yZXBsYWNlKCfot6/nur8nLCDmoIfpopjmlbDmja4pLnJlcGxhY2UoJ+aOkuW6jycsIOaOkuW6jyksXFxuICAgICAgICBwaWNfdXJsOiDlm77niYcsXFxuICAgICAgICB1cmw6IOaOkuW6j3VybCxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IOm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iB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGRhdGEsICdhJiZUZXh0JyksXFxuICAgICAgICAgICAgICAgIHVybDogcGQoZGF0YSwgJ2EmJmhyZWYnKSArIGxhenksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8yJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogTVlfVVJMICsgXFxcIl/pgInpm4ZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkZWxldGVJdGVtQnlDbHMoTVlfVVJMICsgXFxcIl/pgInpm4ZcXFwiKTtcXG4gICAgICAgIGFkZEl0ZW1CZWZvcmUoTVlfVVJMICsgXFxcImZvb3RlclxcXCIsIGNwKTtcXG4gICAgICAgIHB1dE15VmFyKE1ZX1VSTCArIFxcXCLnq6DoioLmjpLluo9cXFwiLCDmj5DnpLopXFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgIH0sIOaOkuW6j+WQjSwgbGF6eSksXFxuICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBpZDogTVlfVVJMICsgXFxcIl/mjpLluo9cXFwiXFxuICAgIH1cXG59KVxcbnRhYnMuZm9yRWFjaCgoZGF0YSwgaWQpID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBnZXRNeVZhcihNWV9VUkwsICcwJykgPT0gaWQgPyAn4oCc4oCcJyArIGRhdGEgKyAn4oCd4oCdJyA6IGRhdGEsXFxuICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKOe6v+i3rywgbGF6eSwgaWQpID0+IHtcXG4gICAgICAgICAgICB2YXIgbGlzdHMgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwibGlzdHNcXFwiKTtcXG4gICAgICAgICAgICB2YXIg5o6S5bqPID0gZ2V0TXlWYXIoTVlfVVJMICsgXFxcIueroOiKguaOkuW6j1xcXCIsICcjMWFhZDE5XFxcIj7mraPluo8nKTtcXG4gICAgICAgICAgICB2YXIg5o+Q56S6ID0g5o6S5bqPID09ICcjRkYwMDAwXFxcIj7lgJLluo8nID8gJyMxYWFkMTlcXFwiPuato+W6jycgOiAnI0ZGMDAwMFxcXCI+5YCS5bqPJztcXG5cXG4gICAgICAgICAgICDnur/ot68uZm9yRWFjaCgoZGF0YSwgeGxpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpZCA9PSB4bGlkID8gJ+KAnOKAnCcgKyBkYXRhICsgJ+KAneKAnScgOiBkYXRhLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfVVJMICsgXFxcIl/nur/ot69cXFwiICsgeGxpZFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHB1dE15VmFyKE1ZX1VSTCwgaWQpXFxuICAgICAgICAgICAgdmFyIOeroOiKgiA9IGxpc3RzW2dldE15VmFyKE1ZX1VSTCwgJzAnKV07XFxuICAgICAgICAgICAgaWYgKOaOkuW6jyA9PSAnI0ZGMDAwMFxcXCI+5YCS5bqPJykge1xcbiAgICAgICAgICAgICAgICDnq6DoioIucmV2ZXJzZSgpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBjcCA9IOeroOiKgi5tYXAoKGRhdGEsIHNzaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGRhdGEsICdhJiZUZXh0JyksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHBkKGRhdGEsICdhJiZocmVmJykgKyBsYXp5LFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1VSTCArIFxcXCJf6YCJ6ZuGXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhNWV9VUkwgKyBcXFwiX+mAiembhlxcXCIpO1xcbiAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUoTVlfVVJMICsgXFxcImZvb3RlclxcXCIsIGNwKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9LCB0YWJzLCBsYXp5LCBpZCksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogTVlfVVJMICsgXFxcIl/nur/ot69cXFwiICsgaWRcXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSlcXG5cXG5pZiAo5o6S5bqPID09ICcjRkYwMDAwXFxcIj7lgJLluo8nKSB7XFxuICAgIGxpc3QucmV2ZXJzZSgpXFxufVxcbmxpc3QuZm9yRWFjaCgoZGF0YSwgaWQpID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBwZGZoKGRhdGEsICdhJiZUZXh0JyksXFxuICAgICAgICB1cmw6IHBkKGRhdGEsICdhJiZocmVmJykgKyBsYXp5LFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBjbHM6IE1ZX1VSTCArIFxcXCJf6YCJ6ZuGXFxcIl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gICAgaW5kZXhVcmw6IGluZGV4VXJsLFxcbiAgICBwYXJhbUhhbmRsZTogcGFyYW1IYW5kbGUsXFxuICAgIHJ1blByZVJ1bGU6IHJ1blByZVJ1bGUsXFxuICAgIGdlbk15UnVsZTogZ2VuTXlSdWxlLFxcbiAgICBnZW5FeFVybDogZ2VuRXhVcmwsXFxuICAgIGhpamFja0xhenlSdWxlOiBoaWphY2tMYXp5UnVsZSxcXG4gICAgaGlqYWNrRWw6IGhpamFja0VsXFxufVxcblwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi54ix57Gz5o6o57G76Kej5p6QKlwiLFwicGF0aFwiOlwianNcIixcInJ1bGVcIjpcInZhciDmvKvnlLvop6PmnpAgPSAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICB2YXIgdXJsID0gaW5wdXQucmVwbGFjZSgnbScsJ3d3dycpO1xcbiAgICAgICAgICAgIGV2YWwocGRmaChmZXRjaFBDKHVybCksIFxcXCJib2R5JiZzY3JpcHQmJkh0bWxcXFwiKSk7XFxuICAgICAgICAgICAgdmFyIHBpY3MgPSBbXTtcXG4gICAgICAgICAgICBpZiAoY2hhcHRlckltYWdlcy5sZW5ndGggPiAxKSB7XFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJJbWFnZXMuZm9yRWFjaChpbWcgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcGljcy5wdXNoKGltZysnQFJlZmVyZXI9Jyt1cmwpXFxuICAgICAgICAgICAgICAgIH0pfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJ2JvZHkmJi5zY3JvbGwtaXRlbScpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZpcnN0ID0gcGRmYShodG1sLCAnYm9keSYmI2ltYWdlJyk7XFxuICAgICAgIC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TcucG5nXFxcIixcXG4gICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChqamlkLCBkZWNpZCwgZGVzX2Rlc2MpID0+IHtcXG4gICAgICAgIGlmIChnZXRNeVZhcihcXFwiampzXFxcIiwgXFxcIuaUtui1t1xcXCIpID09IFxcXCLmlLbotbdcXFwiKSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcImpqc1xcXCIsIFxcXCLlsZXlvIBcXFwiKTtcXG5cXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBqamlkXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5pu05paw6K+m5oOFIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuaUtui1tz48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjICsgJzwvc3Bhbj4nXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCJqanNcXFwiLCBcXFwi5pS26LW3XFxcIik7XFxuXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+abtOaWsOivpuaDhTxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuWxleW8gD48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjLnN1YnN0cigwLCAxNTApXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9XFxuXFxuICAgIH0sIE1ZX1JVTEUgKyBcXFwiX2pqaWRcXFwiLCBNWV9SVUxFICsgXFxcIl9kZWNpZFxcXCIsIGRlc19kZXNjKSxcXG4gICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgaWQ6IE1ZX1JVTEUgKyBcXFwiX2pqaWRcXFwiXFxuICAgIH1cXG59KTtcXG5cXG5pdGVtcy5wdXNoKHtcXG4gICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjLnN1YnN0cigwLCAxNTApLFxcbiAgICBjb2xfd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oXCI6XCJzZWFyY2hcIixcInJ1bGVcIjpcImZ1bmN0aW9uIGNvbnZlcnQxKHN0cikge1xcbiAgICBsZXQgYyA9IHN0ci5zcGxpdChcXFwiO1xcXCIpXFxuICAgIHJldHVybiB7XFxuICAgICAgICDliJfooag6IGNbMF0sXFxuICAgICAgICDmoIfpopg6IGNbMV0sXFxuICAgICAgICDpk77mjqU6IGNbMl0sXFxuICAgICAgICDmj4/ov7A6IGNbM10sXFxuICAgICAgICDor6bmg4U6IGNbNF0sXFxuICAgICAgICDlm77niYc6IGNbNV1cXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiBtZXJnZShzb3VyY2UsIHRhcmdldCkge1xcbiAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzKHNvdXJjZSlcXG4gICAgZm9yIChsZXQgaSBpbiBrZXlzKSB7XFxuICAgICAgICB0YXJnZXRba2V5c1tpXV0gPSBzb3VyY2Vba2V5c1tpXV1cXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiDmkJzntKIob2JqKSB7XFxuICAgIHZhciBkID0gW107XFxuICAgIGlmICgkLnR5cGUob2JqKSA9PSBcXFwic3RyaW5nXFxcIikge1xcbiAgICAgICAgb2JqID0gY29udmVydDEob2JqKVxcbiAgICB9XFxuICAgIGlmIChvYmou6KeE5YiZKSB7XFxuICAgICAgICBsZXQgYyA9IGNvbnZlcnQxKG9iai7op4TliJkpXFxuICAgICAgICBtZXJnZShjLCBvYmopXFxuICAgIH1cXG4gICAgbGV0IGFyciA9IHBkZmEoZ2V0UmVzQ29kZSgpLCBvYmou5YiX6KGoKTtcXG4gICAgICAgaWYgKG9iai7liJfooajlpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIGFyciA9IG9iai7pk77mjqXlpITnkIYoYXJyKVxcbiAgICAgICAgfVxcbiAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXG4gICAgICAgIGxldCB1cmwgPSBwZChpdCwgb2JqLumTvuaOpSlcXG4gICAgICAgIGlmIChvYmou6ZO+5o6l5aSE55CGICE9IG51bGwpIHtcXG4gICAgICAgICAgICB1cmwgPSBvYmou6ZO+5o6l5aSE55CGKHVybClcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXQsIG9iai7moIfpopgpXFxuICAgICAgICBpZiAob2JqLuagh+mimOWkhOeQhiAhPSBudWxsKSB7XFxuICAgICAgICAgICAgdGl0bGUgPSBvYmou5qCH6aKY5aSE55CGKHRpdGxlKVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHBpYyA9IHBkKGl0LCBvYmou5Zu+54mHKVxcbiAgICAgICAgaWYgKG9iai7lm77niYflpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIHBpYyA9IG9iai7lm77niYflpITnkIYocGljKVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogb2JqLuagh+mimCA/IHBkZmgoaXQsIG9iai7moIfpopgpIDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgdXJsOiB1cmwrJyNhdXRvQ2FjaGUjJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgZGVzYzogb2JqLuaPj+i/sCA/IHBkZmgoaXQsIG9iai7mj4/ov7ApIDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgY29udGVudDogb2JqLuivpuaDhSA/IHBkZmgoaXQsIG9iai7or6bmg4UpIDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGljX3VybDogcGljLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHl0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHlwaWM6IHBpYyxcXG4gICAgICAgICAgICAgICAgeXVybDogdXJsLnJlcGxhY2UoJ2hpa2VyOi8vZW1wdHkjIycsJycpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuIC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gICBsZXQgcmVxdWlyZWxpc3QgPSBbJ2h0dHBzOi8vcmF3LmlxaXEuaW8vJywgJ2h0dHBzOi8vZ2hwcm94eS5uZXQvaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tLycsICdodHRwczovL2docHJveHkuY29tL2h0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS8nLCAnaHR0cHM6Ly9jZG4uc3RhdGljYWx5LmNvbS9naC8nLCAnaHR0cHM6Ly9naXRodWIuamV2b25zLnZpcC9odHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vJ11cXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlcXVpcmVsaXN0Lmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7IC8v6L+c56iL5L6d6LWW57Si5byVXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzID0gcmVxdWVzdChyZXF1aXJlbGlzdFtpXSArICdEcmVhbU96Ty9KTS9tYWluL0pNJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhTdGF0dXNDb2RlOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKEpTT04ucGFyc2UocmVzKS5zdGF0dXNDb2RlID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QodXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZURvd25sb2FkKHJlcXVpcmVsaXN0W2ldICsgJ0RyZWFtT3pPL0pNL21haW4vSk0nLHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1a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n56aB55SoJzpcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2Rpc2FibGVDdXN0b20nLCAnVCcpXFxuICAgICAgICAgICAgICAgIGlucHV0ICs9ICdcXFxcbuWwj+eoi+W6j+WQr+eUqC/npoHnlKjjgIHph43mlrDmjpLluo/nrYnmk43kvZzlnYfkuI3kvJrkvZPnjrDlnKjpppbpobXlsI/nqIvluo/liJfooajkuK0nXFxuICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgY2FzZSAn57yW6L6RJzpcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGdldE15VmFyKCdyZW1vdGVVcmwnKVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybC5zdGFydHNXaXRoKCdoaWtlcjovL2ZpbGVzLycpICYmICF1cmwuc3RhcnRzV2l0aCgnZmlsZTovLycpKVxcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2hpa2VyOi8vZmlsZXMvbGlicy8nICsgbWQ1KHVybCkgKyAnLmpzJ1xcbiAgICAgICAgICAgICAgICByZXR1cm4gICdoaWtlcjovL3BhZ2UvaW50ZXJmYWNlI25vUmVmcmVzaCMjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU9SlNPTue8lui+keWZqCZKc29uPScrYmFzZTY0RW5jb2RlKHVybClcXG4gICAgICAgIH1cXG4gICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3sicgKyBpbnB1dFxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgZXh0cmE6IHsgbGluZVZpc2libGU6IGZhbHNlIH1cXG59KTsvKlxcbihkaXNhYmxlQ3VzdG9tID8gWyflr7zlhaXmtbfpmJQnXSA6IFsn5ZCv55SoL+emgeeUqCcsICfph43mlrDmjpLluo8nLCAn5pu05pS55Zu+5qCHJywgJ+WvvOWFpea1t+mYlCddKS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S5pY29uIH1cXG4gICAgc3dpdGNoIChlZGl0TW9kZSkge1xcbiAgICAgICAgY2FzZSAn5ZCv55SoL+emgeeUqCc6XFxuICAgICAgICAgICAgZC50aXRsZSA9ICh2LnZpc2libGUgPyAn8J+foiAgJyA6ICfwn5S0ICAnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgIHJ1bGVzW2ldLnZpc2libGUgPSAhcnVsZXNbaV0udmlzaWJsZVxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5pY29uID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJ1bGVzW2ldLmljb25cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5a+85YWl5rW36ZiUJzpcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9kYXRhTG9hZD9ydWxlPScgKyBnZXRNeVZhcignbXlDb2xsZWN0aW9uJyksIHRydWUpXFxuICAgICAgICAgICAgICAgIHJldHVybiAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoZGF0YVtpXSkpXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICB9XFxuICAgIGVsLnB1c2goZClcXG59KSovXFxuKGRpc2FibGVDdXN0b20gPyBbJ+WvvOWFpea1t+mYlCddIDogWyflkK/nlKgv56aB55SoJywgJ+mHjeaWsOaOkuW6jycsICfmm7TmlLnlm77moIcnLCAn5a+85YWl5rW36ZiUJ10pLmZvckVhY2goKHYpID0+IHtcXG4gICAgZWwucHVzaCh7XFxuICAgICAgICB0aXRsZTogdiA9PSBlZGl0TW9kZSA/ICfigJzigJzigJ3igJ0nICsgdi5ib2xkKCkuZm9udGNvbG9yKCcjMTJiNjY4JykgOiB2LFxcbiAgICAgICAgdXJsOiB2ID09IGVkaXRNb2RlID8gJ2hpa2VyOi8vZW1wdHknIDogJ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ICAgICAgICAgICAgICBydWxlc1tpXS52aXNpYmxlID0gIXJ1bGVzW2ldLnZpc2libGVcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXG4gICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMuc3BsaWNlKG5ld0luZGV4LCAwLCBydWxlcy5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaV0uaWNvbiA9IGlucHV0XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBydWxlc1tpXS5pY29uXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+WvvOW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8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKHNpZ24gKyBpZCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIGVsLnB1c2goeyBjb2xfdHlwZTogdGhpcy5ib3VuZGFyeSB9KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0sXFxcXG4gICAgaW5pdChjbGFzc09iamVjdCkge1xcXFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX25hbWUgPT0gJ3N0cmluZycpXFxcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc19uYW1lID0gY2xhc3NPYmplY3QuY2xhc3NfbmFtZS5zcGxpdCgnJicpXFxcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfdXJsID09ICdzdHJpbmcnKVxcXFxuICAgICAgICAgICAgY2xhc3NPYmplY3QuY2xhc3NfdXJsID0gY2xhc3NPYmplY3QuY2xhc3NfdXJsLnNwbGl0KCcmJykubWFwKCh2KSA9PiB2LnRyaW0oKSlcXFxcbiAgICAgICAgcmV0dXJuIGNsYXNzT2JqZWN0XFxcXG4gICAgfSxcXFxcbiAgICBwdXNoKGNsYXNzT2JqZWN0KSB7XFxcXG4gICAgICAgIHRoaXMuYXJyLnB1c2godGhpcy5pbml0KGNsY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AgICAgICAgICAgICAgICAgICBsZXQgcmVzID0gcmVxdWVzdChyZXF1aXJlbGlzdFtpXSArICdEcmVhbU96Ty9KTS9tYWluL0pNJywge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKEpTT04ucGFyc2UocmVzKS5zdGF0dXNDb2RlID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdCh1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZSh1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZURvd25sb2FkKHJlcXVpcmVsaXN0W2ldICsgJ0RyZWFtT3pPL0pNL21haW4vSk0nLHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlRG93bmxvYWQocmVxdWlyZWxpc3RbaV0gKyAnRHJlYW1Pek8vSk0vbWFpbi9KTScsdXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXFxcbiAgICAgICAgICAgIGJhY2soZmFsc2UpXFxcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5pu05pawJ1xcXFxuICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9p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xcbiAgICBzd2l0Y2ggKGVkaXRNb2RlKSB7XFxcXG4gICAgICAgIGNhc2UgJ+WQr+eUqC/npoHnlKgnOlxcXFxuICAgICAgICAgICAgZC50aXRsZSA9ICh2LnZpc2libGUgPyAn8J+foiAgJyA6ICfwn5S0ICAnKSArIGQudGl0bGVcXFxcbiAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcXFxuICAgICAgICAgICAgICAgIHJ1bGVzW2ldLnZpc2libGUgPSAhcnVsZXNbaV0udmlzaWJsZVxcXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgIH0sIGkpXFxcXG4gICAgICAgICAgICBicmVha1xcXFxuICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcXFxuICAgICAgICAgICAgbGV0IHNvcnRGbGFnID0gcGFyc2VJbnQoZ2V0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJykpXFxcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGQudGl0bGVcXFxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXFxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mAieaLqeimgeenu+WKqOWIsOeahOS9jee9ridcXFxcbiAgICAgICAgICAgICAgICB9LCBpKVxcXFxuICAgICAgICAgICAgZWxzZVxcXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgob2xkSW5kZXgsIG5ld0luZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcXFxuICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgY2FzZSAn5pu05pS55Zu+5qCHJzpcXFxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaV0uaWNvbiA9IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgZWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcnVsZXNbaV0uaWNvblxcXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgIH0sIGkpXFxcXG4gICAgICAgICAgICBicmVha1xcXFxuICAgICAgICBjYXNlICflr7zlhaXmtbfpmJQnOlxcXFxuICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9kYXRhTG9hZD9ydWxlPScgKyBnZXRNeVZhcignbXlDb2xsZWN0aW9uJyksIHRydWUpXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShkYXRhW2ldKSlcXFxcbiAgICAgICAgICAgIH0sIGkpXFxcXG4gICAgICAgICAgICBicmVha1xcXFxuICAgIH1cXFxcbiAgICBlbC5wdXNoKGQpXFxcXG59KSovXFxcXG4oZGlzYWJsZUN1c3RvbSA/IFsn5a+85YWl5rW36ZiUJ10gOiBbJ+WQr+eUqC/npoHnlKgnLCAn6YeN5paw5o6S5bqPJywgJ+abtOaUueWbvuaghycsICflr7zlhaXmtbfpmJQnXSkuZm9yRWFjaCgodikgPT4ge1xcXFxuICAgIGVsLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogdiA9PSBlZG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qCc6XFxcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHYudmlzaWJsZSA/ICfwn5+iICAnIDogJ/CflLQgICcpICsgZC50aXRsZVxcXFxuICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxcXG4gICAgICAgICAgICAgICAgcnVsZXNbaV0udmlzaWJsZSA9ICFydWxlc1tpXS52aXNpYmxlXFxcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgfSwgaSlcXFxcbiAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgIGNhc2UgJ+mHjeaWsOaOkuW6jyc6XFxcXG4gICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXFxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcXFxuICAgICAgICAgICAgaWYgKHNvcnRGbGFnID09IC0xKVxcXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxcXG4gICAgICAgICAgICBlbHNlXFxcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzLnNwbGljZShuZXdJbmRleCwgMCwgcnVsZXMuc3BsaWNlKG9sZEluZGV4LCAxKVswXSlcXFxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxcXG4gICAgICAgICAgICBicmVha1xcXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcXFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5p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ICAgfSksXFxcXG4gICAgICAgICAgICByZXMgPSB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLCBpbWc6IGltZyxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogTVlfUlVMRS5jb2xfdHlwZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICBpZiAocmVzLnVybCkge1xcXFxuICAgICAgICAgICAgaWYgKHJlcy51cmwuaW5jbHVkZXMoJ0BsYXp5UnVsZT0nKSkge1xcXFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gcmVzLnVybC5pbmRleE9mKCcuanM6JylcXFxcbiAgICAgICAgICAgICAgICBpZiAocmVJbmRleCA+PSAwKSByZXMudXJsID0gcmVzLnVybC5zbGljZSgwLCByZUluZGV4KSArICcuanM6JyArIGhpamFja0xhenlSdWxlICsgJzsnICsgcmVzLnVybC5zbGljZShyZUluZGV4ICsgNClcXFxcbiAgICAgICAgICAgIH0gZWxzZSAgaWYgKGRldGFpbEZpbmRSdWxlKSB7XFxcXG4gICAgICAgICAgICAgICAgcmVzLmV4dHJhID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGdlbkV4VXJsKHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgIFJVTEU6IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKGdlbk15UnVsZSgpLCB7IGRldGFpbF9maW5kX3J1bGU6IGRldGFpbEZpbmRSdWxlIH0pKSksXFxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXNJbmRleCAmJiB0aXRsZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXMudXJsID0gJ2hpa2VyOi8vcGFnZS9mcmFtZUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRVxcXFxuICAgICAgICAgICAgfSBlb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XFxuICAgICAgICAgICAgaW1nOiBcXFxcXFxcImh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzE5Ny5wbmdcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChqamlkLCBkZWNpZCwgZGVzX2Rlc2MpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcXFxcXCJqanNcXFxcXFxcIiwgXFxcXFxcXCLmlLbotbdcXFxcXFxcIikgPT0gXFxcXFxcXCLmlLbotbdcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImpqc1xcXFxcXFwiLCBcXFxcXFxcIuWxleW8gFxcXFxcXFwiKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGpqaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+eugOS7iyA8c21hbGw+PHNtYWxsPjxzcGFuIHN0eWxlPVxcXFxcXFwiY29sb3I6IzE5Qjg5RFxcXFxcXFwiPuaUtui1tz48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBkZWNpZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojODA4MDgwXFxcXFxcXCI+JyArIGRlc19kZXNjICsgJy4uLjwvc3Bhbj4nXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiampzXFxcXFxcXCIsIFxcXFxcXFwi5pS26LW3XFxcXFxcXCIpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn566A5LuLIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojMTlCODlEXFxcXFxcXCI+5bGV5byAPjwvc3Bhbj48L3NtYWxsPjwvc21hbGw+J1xcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGRlY2l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FxcXFxcIuWIh+aNojrigJjigJhcXFxcXFxcIiArIGxpbmVUaXRsZSArIFxcXFxcXFwiXFxcXFxcXCIgOiBsaW5lVGl0bGUgKyBcXFxcXFxcIuKAmOKAmDrliIfmjaJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgodmFyS2V5LCBsaW5lSW5kZXgsIGxpbmVUaXRsZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcih2YXJLZXksIGxpbmVJbmRleC50b1N0cmluZygpKVxcXFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coTVlfUlVMRS51cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKChNWV9SVUxFLnRpdGxlICsgJyNsaW5lLXRpdGxlJyksIGxpbmVUaXRsZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKE1ZX1JVTEUudGl0bGUgKyBnZXRNeVZhcigoTVlfUlVMRS50aXRsZSArICcjbGluZS10aXRsZScpKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3suWIh+aNouiHs1xcXFxcXFwiICsgbGluZVRpdGxlXFxcXG4gICAgICAgICAgICAgICAgfSwgdmFyS2V5LCBpLCBsaW5lVGl0bGUpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICB9XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxcXG4gICAgICAgICAgICB9KTtcXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLop6P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9jSk7XFxcXG4gICAgICAgIGlmIChpbmRleCA9PT0gMCkge1xcXFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpXFxcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZijmjpLpmaQpICE9ICd1bmRlZmluZWQnICYmIOaOkumZpCAhPSAnJykge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXFxcXFwiZ1xcXFxcXFwiKSwgXFxcXFxcXCJcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gXFxcXFxcXCLigJzigJzigJ3igJ1cXFxcXFxcIiArIHRpdGxlLmZvbnRjb2xvcijliIbnsbvpopzoibIpIDogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW11cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcXFxcXCIwXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkobmV3X2NhdGUpKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS51cmwsIGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09ICcxJykge1xcXFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpXFxcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZijmjpLpmaQpICE9ICd1bmRlZmluZWQnICYmIOaOkumZpCAhPSAnJykge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXFxcXFwiZ1xcXFxcXFwiKSwgXFxcXFxcXCJcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gXFxcXFxcXCLigJzigJzigJ3igJ1cXFxcXFxcIiArIHRpdGxlLmZvbnRjb2xvcijliIbnsbvpopzoibIpIDogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS51cmwsIGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcXFxuIC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AgICB9XFxcXG4gICAgICAgICAgICAvLyBpbmplY3RJbmRleCDmipjlj6DmjInpkq7mj5LlhaXnrKwgaW5qZWN0SW5kZXgg6KGMXFxcXG4gICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXgpIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoISh0eXBlb2YgKGluamVjdEluZGV4KSA9PT0gJ251bWJlcicpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeaVsOWtl++8gVxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXggPCAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeWkp+S6jiAwIOeahOaVtOaVsO+8gVxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXggPiB0aGlzW3N5bWJvbE1hcC5tRm9sZEluZGV4XSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcXFxcXCLmipjlj6DmjInpkq7mj5LlhaXooYzkuI3lvpflpKfkuo7mmL7npLrmipjlj6DooYzmlbDvvIHor7fosIPnlKggLmZvbGRJbmRleChpbmRleCkg5oiWIC7nrKzlh6DooYzlvIDlp4vmipjlj6AoaW5kZXgpIOS8oOWFpeato+ehrueahOaYvuekuuaKmOWPoOihjOaVsFxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0uaW5qZWN0SW5kZXggPSBpbmplY3RJbmRleCB8fCAxO1xcXFxuICAgICAgICAgICAgfV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zZU9wdGlvbikge1xcXFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHVybFJ1bGUucGFyc2VPcHRpb24pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwYXJzZURvbVxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBkXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwYXJzZURvbUZvckh0bWxcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwZGZoXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbUZvckh0bWw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHVybFJ1bGVbXFxcXFxcXCLop6PmnpDmlrnms5VcXFxcXFxcIl0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh1cmxSdWxlW1xcXFxcXFwi6Kej5p6Q5pa55rOVXFxcXFxcXCJdKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwicGFyc2VEb21cXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwZFxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwicGFyc2VEb21Gb3JIdG1sXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwicGRmaFxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb21Gb3JIdG1sO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHVybCA9IHBhcnNlKHNyYywgbVVybFJ1bGUpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuZGVhbFVybCkge1xcXFxuICAgICAgICAgICAgICAgIHVybCA9IHVybFJ1bGUuZGVhbFVybCh1cmwpXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHVybFJ1bGVbJ+S6jOasoeWkhOeQhiddKSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsID0gdXJsUnVsZVsn5LqM5qyh5aSE55CGJ10odXJsKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuc3RhcnRzV2l0aChcXFxcXFxcIkBqczpcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCB1cmxSdWxlKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAg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W91dF0udXJsIHx8ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSNcXFxcXFxcIikubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5tVGFnICsgcGFyYW1zLlZBUk1BUC5GT0xELCBnZXRNeVZhcihwYXJhbXMubVRhZyArIHBhcmFtcy5WQVJNQVAuRk9MRCwgcGFyYW1zLmlzRm9sZCkgPT09ICcxJyA/ICcwJyA6ICcxJylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhZzogbVRhZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZvbGQ6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0uY29sX3R5cGUgfHwgXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaChmb2xkTGF5b3V0KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgIC8v5YW35L2T5YiX6KGo5LiL55qE5YiG57G7XFxcXG4gICAgICAg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gJyA8L2ZvbnQ+PC9iPicgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuaW5kZXggPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcXFxcXCIwXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuaW5kZXggPT09IDAgPyBuZXdfY2F0ZSA6IHBhcmFtcy5jYXRlX3RlbXApKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5VUkwsIGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZzogbVRhZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHRoaXNbc3ltYm9sTWFwLm1QYWdlXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpc1tzeW1ib2xNYXAubUZvbGRdID09PSAnMCcpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIGNhdGVnb3J5KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIGNhdGVnb3J5KVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9JyArIHRoaXNbc3ltYm9sTWFwLm1Db2xvcl0gKyAnPicgKyB0aXRsZSArICcgPC9mb250PjwvYj4nIDogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5DQVRFR09SWSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLlVSTCwgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFnOiBtVGFnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuXFxcXG4gICAg55WM6Z2iKGxheW91dCkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy5sYXlvdXQobGF5b3V0KVxcXFxuICAgIH0sXFxcXG4gICAg5YiG57G76ZO+5o6lKHRydWVVcmwpIHtcXFxcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1ZVVybCh0cnVlVX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O1xcXFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmxFeHAgPT09ICdzdHJpbmcnKSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsRXhwID0gbmV3IFJlZ0V4cCh1cmxFeHApXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAodXJsRXhwLnRlc3QodGhpcy5wYXJhbXMudXJsKSkge1xcXFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnBhcmFtcy5kZWJ1Zykge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2codXJsRXhwLnRvU3RyaW5nKCkpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHRydWVfdXJsID0gcmVnT2JqLmV4ZWMoKTtcXFxcbiAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAodHJ1ZV91cmwpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiB0cnVlX3VybDtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnBhcmFtcy51cmxcXFxcbiAgICAgICAgfVxcXFxuICAgIH0sXFxcXG4gICAg6I635Y+W5aSE55CG57uT5p6cKCkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy5leGVjKClcXFxcbiAgICB9LFxcXFxuICAgIOmTvuaOpSh1cmwpIHtcXFxcbiAgICAgICAgcmV0dXJuIHRoaXMuYmFzZVVybCh1cmwpXFxcXG4gICAgfSxcXFxcbiAgICDpobXnoIEocGFnZSkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy5wYWdlKHBhZ2UpXFxcXG4gICAgfSxcXFxcbiAgICDmj5LlhaXmlrDlpITnkIbop4TliJkocmVnRXhwKSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLmFkZEV4dHJhKHJlZ0V4cClcXFxcbiAgICB9LFxcXFxuICAgIOiwg+ivleaooeW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qLuinhOWImSlcXFxcbiAgICAgICAgbWVyZ2UoYywgb2JqKVxcXFxuICAgIH1cXFxcbiAgICBsZXQgYXJyID0gcGRmYShnZXRSZXNDb2RlKCksIG9iai7liJfooagpO1xcXFxuICAgICAgIGlmIChvYmou5YiX6KGo5aSE55CGICE9IG51bGwpIHtcXFxcbiAgICAgICAgICAgIGFyciA9IG9iai7pk77mjqXlpITnkIYoYXJyKVxcXFxuICAgICAgICB9XFxcXG4gICAgZm9yIChsZXQgaXQgb2YgYXJyKSB7XFxcXG4gICAgICAgIGxldCB1cmwgPSBwZChpdCwgb2JqLumTvuaOpSlcXFxcbiAgICAgICAgaWYgKG9iai7pk77mjqXlpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgdXJsID0gb2JqLumTvuaOpeWkhOeQhih1cmwpXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdCwgb2JqLuagh+mimClcXFxcbiAgICAgICAgaWYgKG9iai7moIfpopjlpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgdGl0bGUgPSBvYmou5qCH6aKY5aSE55CGKHRpdGxlKVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBwaWMgPSBwZChpdCwgb2JqLuWbvueJhylcXFxcbiAgICAgICAgaWYgKG9iai7lm77niYflpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgcGljID0gb2JqLuWbvueJh+WkhOeQhihwaWMpXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBvYmou5qCH6aKYID8gcGRmaChpdCwgb2JqLuagh+mimCkgOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiB1cmwrJyNhdXRvQ2FjaGUjJyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgIC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RvTGlzdHVybFxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgIHZhciBib29rTmFtZSA9ICHlpJrot6/nur/lkKYgPyDmoIfpopggOiDmoIfpopggKyAnLScgKyDliJfooajlkI1baV1cXFxcblxcXFxuICAgICAgICDnq6DoioJqc29uLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IOWIl+ihqOWQjVtpXSxcXFxcbiAgICAgICAgICAgIGxpc3Q6IGRvTGlzdCxcXFxcbiAgICAgICAgICAgIHNqc3M6IHtcXFxcbiAgICAgICAgICAgICAgICBjaGFwdGVyTGlzdDogZG9MaXN0LFxcXFxuICAgICAgICAgICAgICAgIGluZm86IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgYm9va05hbWU6IGJvb2tOYW1lLCAvL+a8q+eUu+WQjeensCxcXFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZU5hbWU6IE1ZX1JVTEUudGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGJvb2tUb3BQaWM6IOWbvueJhyxcXFxcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VDb2RlOiDmvKvnlLvop6PmnpAsXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmlldzogXFxcXFxcXCIxXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSlcXFxcbiAgICB9XFxcXG4gICAgcmV0dXJuIOeroOiKgmpzb25cXFxcbn1cXFxcblxcXFxuXFxcXG5mdW5jdGlvbiDmt7vliqDlpLTpg6jliJfooagoZCwg5qCH6aKYLCDlm77niYcsIOaPj+i/sCwg5L2c6ICFLCDml7bpl7QsIOWIhuexuyzpobVVUkwpIHtcXFxcblxcXFxuICAgIOagh+mimCA9ICHmoIfpopggPyAnJyA6IOagh+mimCArICdcXFxcXFxcXG4nXFxcXG4gICAg5Zu+54mHID0gIeWbvueJhyA/ICcn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XFxcXCIgPyBcXFxcXFxcIuWxleW8gFxcXFxcXFwiIDogXFxcXFxcXCLlt7LmlLbotbdcXFxcXFxcIjtcXFxcbiAgICAgICAgcHV0TXlWYXIoanNibCwgamopXFxcXG4gICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBpZDog5b2T5YmNVVJMICsgXFxcXFxcXCJfYnRcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHRpdGxlOiDmlLYucmVwbGFjZShcXFxcXFxcIueugOS7i+aUtlxcXFxcXFwiLCBqailcXFxcbiAgICAgICAgfSlcXFxcblxcXFxuICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgaWQ6IOW9k+WJjVVSTCArIFxcXFxcXFwiX216XFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICB0aXRsZTogamogPT0gXFxcXFxcXCLlt7LmlLbotbdcXFxcXFxcIiA/IOaUtuWGheWuuS5yZXBsYWNlKFxcXFxcXFwi566A5LuLXFxcXFxcXCIsIOeugOS7i+WGheWuueaUtikgOiDmlLblhoXlrrkucmVwbGFjZShcXFxcXFxcIueugOS7i1xcXFxcXFwiLCDnroDku4vlhoXlrrkpXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgIH0sIOeugOS7i+WGheWuuSwg566A5LuL5YaF5a655pS2LCBidHRpdGxlLCBtenRleHQsIOmhtVVSTClcXFxcblxcXFxuXFxcXG4gICAgLy/moIfpophcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogYnR0aXRsZS5yZXBsYWNlKFxcXFxcXFwi566A5LuL5pS2XFxcXFxcXCIsIGpqKSxcXFxcb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luo8nID8gJ+ato+W6jycgOiAn5YCS5bqPJztcXFxcbiAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiDpobVVUkwgKyBcXFxcXFxcIl/mjpLluo9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHRpdGxlOiDmoIfpopjlkI0ucmVwbGFjZSgn6Lev57q/Jywg5qCH6aKY5pWw5o2uKS5yZXBsYWNlKCfmjpLluo8nLCDmj5DnpLopXFxcXG4gICAgICAgIH0pXFxcXG5cXFxcblxcXFxuICAgICAgICBpZiAo5o+Q56S6ID09ICflgJLluo8nKSB7XFxcXG4gICAgICAgICAgICDliJfooajmlbDmja4ucmV2ZXJzZSgpXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAg5YiX6KGo5pWw5o2uLmZvckVhY2goZnVuY3Rpb24oZGF0YSwgc3NpZCkge1xcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGRhdGEudGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBkYXRhLnVybCArIOino+aekOS7o+eggSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDog6aG1VVJMICsgXFxcXFxcXCJf6YCJ6ZuGXFxcXFxcXCIgKyBzc2lkXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0pO1xcXFxuXFxcXG5cXFxcbiAgICAgICAgcHV0TXlWYXIo6aG1VVJMICsgXFxcXFxcXCLnq6DoioLmjpLluo9cXFxcXFxcIiwg5o+Q56S6KVxcXFxuICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICB9LCDmoIfpopjlkI0sIOagh+mimOaVsOaNriwg5Yi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fooag8L2ZvbnQ+IO+8micsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwidG9hc3Q6Ly/ngrnmiJHlubLllaXlkaJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxcXG4gICAgICAgIH0pO1xcXFxuXFxcXG5cXFxcbiAgICAgICAg6Lev57q/5pWw5o2uLmZvckVhY2goZnVuY3Rpb24oZGF0YSwgaWQpIHtcXFxcblxcXFxuICAgICAgICAgICAgdmFyIGpqdXJsID0gJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKCjpobVVUkwsaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBzZXRJdGVtKOmhtVVSTCArICfpgInmi6nliJfooagnLGlkKycnKTtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSzpobVVUkwsaWQpO1xcXFxuXFxcXG4gICAgICAgICAgICB2YXIg5qCH6aKY5ZCNID0gaWQgPT0g6YCJ5oup5YiX6KGoID8g6Lev57q/6YCJ5LitLnJlcGxhY2UoJ+mAieS4rScsIGRhdGEudGl0bGUpIDogZGF0YS50aXRsZTtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IOagh+mimOWQjSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IGpqdXJsLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiDpobVVUkwgKyBcXFxcXFxcIl/ot6/nur9cXFxcXFxcIiArIGlkXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuIC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GMDAwMFxcXFxcXFwiPuWAkuW6jycgPyAnIzFhYWQxOVxcXFxcXFwiPuato+W6jycgOiAnI0ZGMDAwMFxcXFxcXFwiPuWAkuW6jyc7XFxcXG5cXFxcbiAgICAgICAgICAgIOe6v+i3ry5mb3JFYWNoKChkYXRhLCB4bGlkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpZCA9PSB4bGlkID8gJ+KAnOKAnCcgKyBkYXRhICsgJ+KAneKAnScgOiBkYXRhLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1VSTCArIFxcXFxcXFwiX+e6v+i3r1xcXFxcXFwiICsgeGxpZFxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgcHV0TXlWYXIoTVlfVVJMLCBpZClcXFxcbiAgICAgICAgICAgIHZhciDnq6DoioIgPSBsaXN0c1tnZXRNeVZhcihNWV9VUkwsICcwJyldO1xcXFxuICAgICAgICAgICAgaWYgKOaOkuW6jyA9PSAnI0ZGMDAwMFxcXFxcXFwiPuWAkuW6jycpIHtcXFxcbiAgICAgICAgICAgICAgICDnq6DoioIucmV2ZXJzZSgpXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBsZXQgY3AgPSDnq6DoioIubWFwKChkYXRhLCBzc2lkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoZGF0YSwgJ2EmJlRleHQnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBwZChkYXRhLCAnYSYmaHJlZicpICsgbGF6eSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IC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cXFxuICAgIHRpdGxlOiAn5pu05paw6K+m5oOFIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojMTlCODlEXFxcXFxcXCI+5bGV5byAPjwvc3Bhbj48L3NtYWxsPjwvc21hbGw+JyxcXFxcbiAgICBpbWc6IFxcXFxcXFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMTk3LnBuZ1xcXFxcXFwiLFxcXFxuICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChqamlkLCBkZWNpZCwgZGVzX2Rlc2MpID0+IHtcXFxcbiAgICAgICAgaWYgKGdldE15VmFyKFxcXFxcXFwiampzXFxcXFxcXCIsIFxcXFxcXFwi5pS26LW3XFxcXFxcXCIpID09IFxcXFxcXFwi5pS26LW3XFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiampzXFxcXFxcXCIsIFxcXFxcXFwi5bGV5byAXFxcXFxcXCIpO1xcXFxuXFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDor6bmg4UgPHNtYWxsPjxzbWFsbD48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiMxOUI4OURcXFxcXFxcIj7mlLbotbc+PC9zcGFuPjwvc21hbGw+PC9zbWFsbD4nXFxcXG4gICAgICAgICAgICB9KVxcXFxuXFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcXFxuICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojODA4MDgwXFxcXFxcXCI+JyArIGRlc19kZXNjICsgJzwvc3Bhbj4nXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImpqc1xcXFxcXFwiLCBcXFxcXFxcIuaUtui1t1xcXFxcXFwiKTtcXFxcblxcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGpqaWRcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5pu05paw6K+m5oOFPHNtYWxsPjxzbWFsbD48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiMxOUI4OURcXFxcXFxcIj7lsZXlvIA+PC9zcGFuPjwvc21hbGw+PC9zbWFsbD4nXFxcXG4gICAgICAgICAgICB9KVxcXFxuXFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcXFxuICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojODA4MDgwXFxcXFx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jWzNdLFxcXFxuICAgICAgICDor6bmg4U6IGNbNF0sXFxcXG4gICAgICAgIOWbvueJhzogY1s1XVxcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxuZnVuY3Rpb24gbWVyZ2Uoc291cmNlLCB0YXJnZXQpIHtcXFxcbiAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzKHNvdXJjZSlcXFxcbiAgICBmb3IgKGxldCBpIGluIGtleXMpIHtcXFxcbiAgICAgICAgdGFyZ2V0W2tleXNbaV1dID0gc291cmNlW2tleXNbaV1dXFxcXG4gICAgfVxcXFxufVxcXFxuXFxcXG5mdW5jdGlvbiDmkJzntKIob2JqKSB7XFxcXG4gICAgdmFyIGQgPSBbXTtcXFxcbiAgICBpZiAoJC50eXBlKG9iaikgPT0gXFxcXFxcXCJzdHJpbmdcXFxcXFxcIikge1xcXFxuICAgICAgICBvYmogPSBjb252ZXJ0MShvYmopXFxcXG4gICAgfVxcXFxuICAgIGlmIChvYmou6KeE5YiZKSB7XFxcXG4gICAgICAgIGxldCBjID0gY29udmVydDEob2JqLuinhOWImSlcXFxcbiAgICAgICAgbWVyZ2UoYywgb2JqKVxcXFxuICAgIH1cXFxcbiAgICBsZXQgYXJyID0gcGRmYShnZXRSZXNDb2RlKCksIG9iai7liJfooagpO1xcXFxuICAgICAgIGlmIChvYmou5YiX6KGo5aSE55CGICE9IG51bGwpIHtcXFxcbiAgICAgICAgICAgIGFyciA9IG9iai7pk77mjqXlpITnkIYoYXJyKVxcXFxuICAgICAgICB9XFxcXG4gICAgZm9yIChsZXQgaXQgb2YgYXJyKSB7XFxcXG4gICAgICAgIGxldCB1cmwgPSBwZChpdCwgb2JqLumTvuaOpSlcXFxcbiAgICAgICAgaWYgKG9iai7pk77mjqXlpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgdXJsID0gb2JqLumTvuaOpeWkhOeQhih1cmwpXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdCwgb2JqLuagh+mimClcXFxcbiAgICAgICAgaWYgKG9iai7moIfpopjlpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgdGl0bGUgPSBvYmou5qCH6aKY5aSE55CGKHRpdGxlKVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBwaWMgPSBwZChpdCwgb2JqLuWbvueJhylcXFxcbiAgICAgICAgaWYgKG9iai7lm77niYflpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgcGljID0gb2JqLuWbvueJh+WkhOeQhihwaWMpXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBvYmou5qCH6aKYID8gcGRmaChpdCwgb2JqLuagh+mimCkgOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiB1cmwrJyNhdXRvQ2FjaGUjJyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZGVzYzogb2JqLuaPj+i/sCA/IHBkZmgoaXQsIG9iai7mj4/ov7ApIDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IG9iai7or6bmg4UgPyBwZGZoKGl0LCBvYmou6K+m5oOFKSA6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBwaWNfdXJsOiBwaWMsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIHl0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgeXBpYzogcGljLFxcXFxuICAgICAgICAgICAgICAgIHl1cmw6IHVybC5yZXBsYWNlKCdoaWtlcjovL2VtcHR5IyMnLCcnKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcblxcXFxuICAgIH1cXFxcbiAgICBzZXRSZXN1bHQoZCk7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