xiaomianao666

小程序:阅动漫

Jun 24th, 2024
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@阅动漫@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6ZiF5Yqo5ryrIiwiYXV0aG9yIjoi5bCP57Gz57KlIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSIsInZlcnNpb24iOjMxMCwiY29sX3R5cGUiOiJpY29uX3JvdW5kX3NtYWxsXzQiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6ImFsbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuY29uc3QgUUlOR19USVRMRSA9IGdldE15VmFyKCdteUNvbGxlY3Rpb24nKSxcbiAgICBuZXdXaW5kb3cgPSByZWFkRmlsZSgnbmV3V2luZG93JyksXG4gICAgdHlwZVNob3cgPSBnZXRNeVZhcigndHlwZVNob3cnLCAnQCcpLFxuICAgIHR5cGVzID0ge1xuICAgICAgICAnY2FydG9vbic6ICfwn5Su5ryr55S7JyxcbiAgICAgICAgJ3ZpZGVvJzogJ/CfjovkvJjotKgnLFxuICAgICAgICAnb3RoZXInOiAn8J+MvuS4gOiIrCcsXG4gICAgICAgICdhbGwnOiAn8J+NgOaWsOWinicsXG4gICAgICAgICdtdXNpYyc6ICfwn5K96Z+z5LmQJyxcbiAgICAgICAgJ2xpdmUnOiAn8J+Om+ebtOaSrScsXG4gICAgICAgICdyZWFkJzogJ/Cfk5nkuaYnLFxuICAgICAgICAncGljdHVyZSc6ICfwn5Oa5Zu+54mHJyxcbiAgICAgICAgJ25ld3MnOiAn8J+aq+aXoOaQnOe0oicsXG4gICAgICAgICd0b29sJzogJ/Cfk6Xk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ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2RhdGFMb2FkP3J1bGU9JyArIFFJTkdfVElUTEUpXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVTaG93WzBdID09ICdAJykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsdGVyS2V5ID0gdHlwZVNob3cuc2xpY2UoMSlcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbHRlcktleSkgcnVsZXMgPSBydWxlcy5maWx0ZXIoKHYpID0+IHYudGl0bGUuaW5jbHVkZXMoZmlsdGVyS2V5KSlcbiAgICAgICAgICAgICAgICB9IGVsc2UgcnVsZXMgPSBydWxlcy5maWx0ZXIoKHYpID0+IHYudHlwZSA9PSB0eXBlU2hvdyk7XG4gICAgICAgICAgICAgICAgbGV0IHl1eD1cInl1eFwiK0RhdGUubm93KCk7XG4gICAgICAgICAgICAgICAgbGV0IGVsID0gJC50b1N0cmluZygoUUlOR19USVRMRSwgeXV4KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGxldCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoaWphY2tFbFxuICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZnVuY1Rvb2xzP3J1bGU9JyArIFFJTkdfVElUTEUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFFJTkdfVElUTEU6UUlOR19USVRMRSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlzSW5kZXg6ICQuaGlrZXJbeXV4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgIE1ZX1JVTEU6TVlfUlVMRVxuICAgICAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgICAgICQuaGlrZXIuc2V0UmVzdWx0ID0gZnVuY3Rpb24ocGFyYW0wLCBwYXJhbTEsIHBhcmFtMiwgcGFyYW0zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbTEgPSBDQUxMQkFDS19LRVlcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtMiA9IE1ZX1JVTEVcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtMyA9IE1ZX1RZUEVcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHBhcmFtMC5kYXRhKSkgcGFyYW0wID0gcGFyYW0wLmRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtMCA9IHBhcmFtMC5tYXAoaGlqYWNrRWwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX3NldFJlc3VsdC5pbnZva2UoamF2YUNvbnRleHQsIHBhcmFtMCwgcGFyYW0xLCBwYXJhbTIsIHBhcmFtMylcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkLmhpa2VyLnNldEhvbWVSZXN1bHQgPSBzZXRSZXN1bHRcbiAgICAgICAgICAgICAgICAgICAgJC5oaWtlci5zZXRTZWFyY2hSZXN1bHQgPSBzZXRSZXN1bHRcbiAgICAgICAgICAgICAgICB9LCBRSU5HX1RJVExFLCB5dXgpO1xuICAgICAgICAgICAgICAgIHJ1bGVzID0gcnVsZXMubWFwKCh2LGkpPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAodi5zZWFyY2hGaW5kLnN0YXJ0c1dpdGgoJ2pzOicpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2LnNlYXJjaEZpbmQgPSBcImpzOiQuaGlrZXIuXCIreXV4K1wiPVwiK2krXCI7XCIgKyBlbCArIFwiO1wiICsgdi5zZWFyY2hGaW5kLnNsaWNlKDMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2O1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcylcbiAgICAgICAgICAgIH0sIFFJTkdfVElUTEUsIHR5cGVTaG93KSxcbiAgICAgICAgICAg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AgICAgICAgKyBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBNWV9SVUxFOiBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkocnVsZVRtcCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgUUlOR19USVRMRTogUUlOR19USVRMRVxuICAgICAgICAgICAgICAgICAgICB9KSArICcp77yb77ybaW5kZXhVcmwoaW5wdXQpOycgKyBwYXJhbUhhbmRsZSh1cmxQYXJhbSwgdi51YSksXG4gICAgICAgICAgICAgICAgUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHsgdGl0bGU6IHYudGl0bGUgfSkpLFxuICAgICAgICAgICAgICAgIGlzSW5kZXg6IHRydWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIGlmIChuZXdXaW5kb3cpIE9iamVjdC5hc3NpZ24oZC5leHRyYSwge1xuICAgICAgICBuZXdXaW5kb3c6IHRydWUsXG4gICAgICAgIHdpbmRvd0lkOiBRSU5HX1RJVExFICsgJ18nICsgZC50aXRsZVxuICAgIH0pXG4gICAgZWwucHVzaChkKVxufSlcbnNldFJlc3VsdChlbCkiLCJzZWFyY2hfdXJsIjoiaGlrZXI6Ly9lbXB0eT9rZXl3b3JkPSoqIiwiZ3JvdXAiOiLikaDmiJHnmoQiLCJzZWFyY2hGaW5kIjoianM6XG5zZXRSZXN1bHQoW3tcbiAgICB0aXRsZTogXCLngrnmiJHlvIDlp4vpmIXliqjmvKvigKLop4bnlYzogZrmkJxcIixcbiAgICB1cmw6IFwiaGlrZXI6Ly9zZWFyY2g/cz1cIiArIGdldFBhcmFtKFwia2V5d29yZFwiKSxcbiAgICBleHRyYToge1xuICAgICAgICBydWxlczogJC50b1N0cmluZygoKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBRSU5HX1RJVExFID0gZ2V0TXlWYXIoJ215Q29sbGVjdGlvbicpLFxuICAgICAgICAgICAgICAgIHR5cGVTaG93ID0gZ2V0TXlWYXIoJ3R5cGVTaG93JywgJ0AnKVxuICAgICAgICAgICAgbGV0IHJ1bGVzID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZGF0YUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRSlcbiAgICAgICAgICAgICAgICBpZiAodHlwZVNob3dbMF0gPT0gJ0AnKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWx0ZXJLZXkgPSB0eXBlU2hvdy5zbGljZSgxKVxuICAgICAgICAgICAgICAgICAgICBpZiAoZmlsdGVyS2V5KSBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gdi50aXRsZS5pbmNsdWRlcyhmaWx0ZXJLZXkpKVxuICAgICAgICAgICAgICAgIH0gZWxzZSBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gdi50eXBlID09IHR5cGVTaG93KTtcbiAgICAgICAgICAgICAgICBsZXQgeXV4PVwieXV4XCIrRGF0ZS5ub3coKTtcbiAgICAgICAgICAgICAgICBsZXQgZWwgPSAkLnRvU3RyaW5nKChRSU5HX1RJVExFLCB5dXgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpamFja0VsXG4gICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9mdW5jVG9vbHM/cnVsZT0nICsgUUlOR19USVRMRSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgUUlOR19USVRMRTpRSU5HX1RJVExFLFxuICAgICAgICAgICAgICAgICAgICAgICAgaXNJbmRleDogJC5oaWtlclt5dXhdLFxuICAgICAgICAgICAgICAgICAgICAgICAgTVlfUlVMRTpNWV9SVUxFXG4gICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgICAgJC5oaWtlci5zZXRSZXN1bHQgPSBmdW5jdGlvbihwYXJhbTAsIHBhcmFtMSwgcGFyYW0yLCBwYXJhbTMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtMSA9IENBTExCQUNLX0tFWVxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0yID0gTVlfUlVMRVxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0zID0gTVlfVFlQRVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkocGFyYW0wLmRhdGEpKSBwYXJhbTAgPSBwYXJhbTAuZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0wID0gcGFyYW0wLm1hcChoaWphY2tFbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfc2V0UmVzdWx0Lmludm9rZShqYXZhQ29udGV4dCwgcGFyYW0wLCBwYXJhbTEsIHBhcmFtMiwgcGFyYW0zKVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICQuaGlrZXIuc2V0SG9tZVJlc3VsdCA9IHNldFJlc3VsdFxuICAgICAgICAgICAgICAgICAgICAkLmhpa2VyLnNldFNlYXJjaFJlc3VsdCA9IHNldFJlc3VsdFxuICAgICAgICAgICAgICAgIH0sIFFJTkdfVElUTEUsIHl1eCk7XG4gICAgICAgICAgICAgICAgcnVsZXMgPSBydWxlcy5tYXAoKHYsaSk9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh2LnNlYXJjaEZpbmQuc3RhcnRzV2l0aCgnanM6JykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYuc2VhcmNoRmluZCA9IFwianM6JC5oaWtlci5cIit5dXgrXCI9XCIraStcIjtcIiArIGVsICsgXCI7XCIgKyB2LnNlYXJjaEZpbmQuc2xpY2UoMyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHY7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHJ1bGVzKV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NzKGlkKSlcXG4gICAgICAgICAgICBjbGFzc19uYW1lLmZvckVhY2goKG5hbWUsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGNsYXNzX3VybFtpXSxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXG4gICAgICAgICAgICAgICAgZWwucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogc2VsZWN0ZWQgPT0gbm93ID8gJ+KAnOKAnOKAneKAnScgKyBuYW1lLmZvbnRjb2xvcih0aGlzLmNvbG9yKS5ib2xkKCkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBzZWxlY3RlZCA9PSBub3cgPyAnaGlrZXI6Ly9lbXB0eScgOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBpZCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKHNpZ24gKyBpZCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBlbC5wdXNoKHsgY29sX3R5cGU6IHRoaXMuYm91bmRhcnkgfSlcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIGluaXQoY2xhc3NPYmplY3QpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbG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ZGF0YSkgPT4ge1xcbiAgICAgICAgbGV0IFt0aXRsZSwgaW1nLCBkZXNjLCB1cmxdID0gZmluZFJ1bGUubWFwKCh2LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodiA9PSAnKicpIHJldHVybiAnJ1xcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDMpID9cXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbShkYXRhLCB2KSA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAzKSB2ID0gcnVuQ29kZSh2KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgeyByZXR1cm4gJycgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIHJlcyA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYywgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgaWYgKHJlcy51cmwpIHtcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gcmVzLnVybC5pbmRleE9mKCcuanM6JylcXG4gICAgICAgICAgICAgICAgaWYgKHJlSW5kZXggPj0gMCkgcmVzLnVybCA9IHJlcy51cmwuc2xpY2UoMCwgcmVJbmRleCkgKyAnLmpzOicgKyBoaWphY2tMYXp5UnVsZSArICc7JyArIHJlcy51cmwuc2xpY2UocmVJbmRleCArIDQpXFxuICAgICAgICAgICAgfSBlbHNlICBpZiAoZGV0YWlsRmluZFJ1bGUpIHtcXG4gICAgICAgICAgICAgICAgcmVzLmV4dHJhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBnZW5FeFVybCh1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oZ2VuTXlSdWxlKCksIHsgZGV0YWlsX2ZpbmRfcnVsZTogZGV0YWlsRmluZFJ1bGUgfSkpKSxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXNJbmRleCAmJiB0aXRsZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlcy51cmwgPSAnaGlrZXI6Ly9wYWdlL2ZyYW1lTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChNWV9SVUxFLmRldGFpbF9maW5kX3J1bGUpIHtcXG4gICAgICAgICAgICAgICAgcmVzLmV4dHJhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBnZW5FeFVybCh1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGdlbk15UnVsZSgpKSksXFxuICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGlzSW5kZXggJiYgdGl0bGVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXMudXJsID0gJ2hpa2VyOi8vcGFnZS9mcmFtZUxvYWQ/cnVsZT0nICsgUUlOR19USVRMRVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIG15Q29sbF9lbC5wdXNoKHJlcylcXG4gICAgfSlcXG4gICAgc2V0UmVzdWx0KG15Q29sbF9lbClcXG59XFxuXCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsX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xcXCIpLmxhenlSdWxlKChqamlkLCBkZWNpZCwgZGVzX2Rlc2MpID0+IHtcXG4gICAgICAgIGlmIChnZXRNeVZhcihcXFwiampzXFxcIiwgXFxcIuaUtui1t1xcXCIpID09IFxcXCLmlLbotbdcXFwiKSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcImpqc1xcXCIsIFxcXCLlsZXlvIBcXFwiKTtcXG5cXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBqamlkXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5pu05paw6K+m5oOFIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuaUtui1tz48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjICsgJzwvc3Bhbj4nXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCJqanNcXFwiLCBcXFwi5pS26LW3XFxcIik7XFxuXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+abtOaWsOivpuaDhTxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuWxleW8gD48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjLnN1YnN0cigwLCAxNTApXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9XFxuXFxuICAgIH0sIE1ZX1JVTEUgKyBcXFwiX2pqaWRcXFwiLCBNWV9SVUxFICsgXFxcIl9kZWNpZFxcXCIsIGRlc19kZXNjKSxcXG4gICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgaWQ6IE1ZX1JVTEUgKyBcXFwiX2pqaWRcXFwiXFxuICAgIH1cXG59KTtcXG5cXG5pdGVtcy5wdXNoKHtcXG4gICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjLnN1YnN0cigwLCAxNTApLFxcbiAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCIsXFxuICAgIGV4dHJhOiB7XFx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XEuaW8vJywgJ2h0dHBzOi8vZ2l0aHViLmpldm9ucy52aXAvaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tLycsICdodHRwczovL2docHJveHkuY29tL2h0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS8nLCAnaHR0cHM6Ly9jZG4uc3RhdGljYWx5LmNvbS9naC8nLCAnaHR0cHM6Ly9naXRodWIuamV2b25zLnZpcC9odHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vJ11cXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlcXVpcmVsaXN0Lmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7IC8v6L+c56iL5L6d6LWW57Si5byVXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzID0gcmVxdWVzdChyZXF1aXJlbGlzdFtpXSArICdRUTE5OTNIVUFORy9ZTUovbWFpbi8nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTi5wYXJzZShyZXMpLnN0YXR1c0NvZGUgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdCh1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUodXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlRG93bmxvYWQocmVxdWlyZWxpc3RbaV0gKyAnUVExOTkzSFVBTkcvWU1KL21haW4nLHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlRG93bmxvYWQocmVxdWlyZWxpc3RbaV0gKyAnUVExOTkzSFVBTkcvWU1KL21haW4nLHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgYmFjayhmYWxzZSlcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5pu05pawJ1xcbiAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb240JyxcXG4gICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJ1xcbiAgICB9XSxcXG4gICAgdXBkYXRlSW50ZXJ2YWwgPSByZWFkRmlsZSgndXBkYXRlSW50ZXJ2YWwnKSB8fCAnMScsXFxuICAgIG5ld1dpbmRvdyA9IHJlYWRGaWxlKCduZXdXaW5kb3cnKSxcXG4gICAgdGFiRm9sZCA9IHJlYWRGaWxlKCd0YWJGb2xkJyksXFxuICAgIGRpc2FibGVDdXN0b20gPSByZWFkRmlsZSgnZGlzYWJsZUN1c3RvbScpLFxcbiAgICBlZGl0TW9kZSA9IGRpc2FibGVDdXN0b20gPyAn5a+85YWl5rW36ZiUJyA6IGdldE15VmFyKCdlZGl0TW9kZScsICflkK/nlKgv56aB55SoJylcXG5cXG5lbC5wdXNoKHtcXG4gICAgdGl0bGU6ICcgIPCfkqEg5pu05paw6aKR546HOiAnICsgKHVwZGF0ZUludGVydmFsID09IDAgPyAn5omL5YqoJyA6IHVwZGF0ZUludGVydmFsICsgJ+WkqScpICsgJyAgJyxcXG4gICAgdXJsOiAkKHVwZGF0ZUludGVydmFsLCAn6L6T5YWl5pu05paw6Ze06ZqU77yI5aSp77yJ77yM5Li6MOWImeaJi+WKqOabtOaWsFxcXFxu5pys5Zyw5pa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LnRpdGxlID0gKHYudmlzaWJsZSA/ICfwn5+iICAnIDogJ/CflLQgICcpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgcnVsZXNbaV0udmlzaWJsZSA9ICFydWxlc1tpXS52aXNpYmxlXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+mHjeaWsOaOkuW6jyc6XFxuICAgICAgICAgICAgbGV0IHNvcnRGbGFnID0gcGFyc2VJbnQoZ2V0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJykpXFxuICAgICAgICAgICAgZC50aXRsZSA9IChzb3J0RmxhZyA9PSBpID8gJ/CflIMgICcgOiAnJykgKyBkLnRpdGxlXFxuICAgICAgICAgICAgaWYgKHNvcnRGbGFnID09IC0xKVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsIGkudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mAieaLqeimgeenu+WKqOWIsOeahOS9jee9ridcXG4gICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgob2xkSW5kZXgsIG5ld0luZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzLnNwbGljZShuZXdJbmRleCwgMCwgcnVsZXMuc3BsaWNlKG9sZEluZGV4LCAxKVswXSlcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBzb3J0RmxhZywgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5pu05pS55Zu+5qCHJzpcXG4gICAgICAgICAgICBkLnVybCA9ICQodi5pY29uIHx8ICcnLCAn6L6T5YWl5paw5Zu+5qCH5Zyw5Z2A5oiW6aKc6Imy5Luj56CB77yaJykuaW5wdXQoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzW2ldLmljb24gPSBpbnB1dFxcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcnVsZXNbaV0uaWNvblxcbiAgICAgIC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ICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5pY29uID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJ1bGVzW2ldLmljb25cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5a+85YWl5rW36ZiUJzpcXG4gICAgICAgICAgICBkLnVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShkYX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FxkKyk/KFxcXFwveWVhclxcXFwvXFxcXGQrKT9cXFxcLmh0bWwvXFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnBhcmFtcy51cmxcXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKHJlZ0V4cCwgJyQxJyArIChcXFwiL3BhZ2UvXFxcIiArIHRoaXMucGFyYW1zLnBhZ2UpICsgJyQ4JyArIFxcXCIuaHRtbFxcXCIpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICBdXFxufVxcblxcbk9iamVjdC5hc3NpZ24oVXJsUHJvY2Vzc29yLnByb3RvdHlwZSwge1xcbiAgICBjb25zdHJ1Y3RvcjogVXJsUHJvY2Vzc29yLFxcbiAgICBjaGVja1BhcmFtcygpIHtcXG4gICAgICAgIGlmICghdGhpcy5wYXJhbXMudXJsKSB7XFxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLor7flhYjosIPnlKggLmJhc2VVcmwodXJsKSDkvKDlhaXpk77mjqXov5vooYzliJ3lp4vljJYhXFxcIilcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICghdGhpcy5wYXJhbXMucGFnZSkge1xcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35YWI6LCD55SoIC5wYWdlKHBhZ2UpIOS8oOWFpemhteeggei/m+ihjOWIneWni+WMliFcXFwiKVxcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBiYXNlVXJsKHVybCl7XFxuICAgICAgICB0aGlzLnBhcmFtcy51cmwgPSB1cmxcXG4gICAgICAgIHJldHVybiB0aGlzXFxuICAgIH0sXFxuICAgIHBhZ2UocGFnZSl7XFxuICAgICAgICB0aGlzLnBhcmFtcy5wYWdlID0gcGFnZVxcbiAgICAgICAgcmV0dXJuIHRoaXNcXG4gICAgfSxcXG4gICAgYWRkRXh0cmEocmVnRXhwKSB7XFxuICAgICAgICBpZiAocmVnRXhwLmNvbnN0cnVjdG9yID09PSBBcnJheSkge1xcbiAgICAgICAgICAgIHRoaXMucmVnZXhNYXAgPSB0aGlzLnJlZ2V4TWFwLmNvbmNhdChyZWdFeHApXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRoaXMucmVnZXhNYXAucHVzaChyZWdFeHApXFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAgZGVidWcoKSB7XFxuICAgICAgICB0aGlzLnBhcmFtcy5kZWJ1ZyA9IHRydWVcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICBleGVjKCkge1xcbiAgICAgICAgdGhpcy5jaGVja1BhcmFtcygpXFxuICAgICAgICBsZXQgdHJ1ZV91cmwgPSAnJ1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLnJlZ2V4TWFwLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgbGV0IHJlZ09iaiA9IHRoaXMucmVnZXhNYXBbaV07XFxuICAgICAgICAgICAgbGV0IHVybEV4cCA9IHJlZ09iai5yZWc7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmxFeHAgPT09ICdzdHJpbmcnKSB7XFxuICAgICAgICAgICAgICAgIHVybEV4cCA9IG5ldyBSZWdFeHAodXJsRXhwKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodXJsRXhwLnRlc3QodGhpcy5wYXJhbXMudXJsKSkge1xcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXJhbXMuZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh1cmxFeHAudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB0cnVlX3VybCA9IHJlZ09iai5leGVjKCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0cnVlX3VybCkge1xcb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ICAgICAgIGxldCBpbmplY3RJbmRleCA9IGxheW91dC5pbmplY3RJbmRleCB8fCBsYXlvdXRbJ+aKmOWPoOaMiemSruaPkuWFpeihjCddXFxuICAgICAgICAgICAgaWYgKGxheW91dC50aXRsZSB8fCBsYXlvdXQudXJsIHx8IGxheW91dC5jb2xfdHlwZSB8fCBpbmplY3RJbmRleCkge1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IGtleXNbaV1cXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XVtrZXldID0gbGF5b3V0W2tleV07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuivt+S8oOWFpeato+ehrueahOaKmOWPoOeVjOmdouWFg+e0oO+8gVxcXCIpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vIGluamVjdEluZGV4IOaKmOWPoOaMiemSruaPkuWFpeesrCBpbmplY3RJbmRleCDooYxcXG4gICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXgpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCEodHlwZW9mIChpbmplY3RJbmRleCkgPT09ICdudW1iZXInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLmipjlj6DmjInpkq7mj5LlhaXooYzor7fkvKDlhaXmlbDlrZfvvIFcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChpbmplY3RJbmRleCA8IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi5oqY5Y+g5oyJ6ZKu5o+S5YWl6KGM6K+35Lyg5YWl5aSn5LqOIDAg55qE5pW05pWw77yBXFxcIilcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoaW5qZWN0SW5kZXggPiB0aGlzW3N5bWJvbE1hcC5tRm9sZEluZGV4XSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLmipjlj6DmjInpkq7mj5LlhaXooYzkuI3lvpflpKfkuo7mmL7npLrmipjlj6DooYzmlbDvvIHor7fosIPnlKggLmZvbGRJbmRleChpbmRleCkg5oiWIC7nrKzlh6DooYzlvIDlp4vmipjlj6AoaW5kZXgpIOS8oOWFpeato+ehrueahOaYvuekuuaKmOWPoOihjOaVsFxcXCIpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUZvbGRMYXlvdXRdLmluamVjdEluZGV4ID0gaW5qZWN0SW5kZXggfHwgMTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5q2j56Gu55qE5oqY5Y+g55WM6Z2i5YWD57Sg77yBXFxcIilcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICAvLyDlvZPliY3mmK/lkKbmipjlj6BcXG4gICAgZm9sZChpc0ZvbGQpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgKGlzRm9sZCkgPT09ICdzdHJpbmcnKSB7XFxuICAgICAgICAgICAgaXNGb2xkID0gaXNGb2xkID09PSAnMSdcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChpc0ZvbGQpIHtcXG4gICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tRm9sZF0gPSAnMSc7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1Gb2xkXSA9ICcwJztcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB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nVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdGhpcy5ldmFsSlNSdWxlKHNyYywgbVVybFJ1bGUpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsUnVsZS5wYXJzZU9wdGlvbikge1xcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh1cmxSdWxlLnBhcnNlT3B0aW9uKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGFyc2VEb21cXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBkXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGFyc2VEb21Gb3JIdG1sXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwZGZoXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbUZvckh0bWw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodXJsUnVsZVtcXFwi6Kej5p6Q5pa55rOVXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodXJsUnVsZVtcXFwi6Kej5p6Q5pa55rOVXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwYXJzZURvbVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwYXJzZURvbUZvckh0bWxcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBkZmhcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tRm9ySHRtbDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB1cmwgPSBwYXJzZShzcmMsIG1VcmxSdWxlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuZGVhbFVybCkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB1cmxSdWxlLmRlYWxVcmwodXJsKVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodXJsUnVsZVsn5LqM5qyh5aSE55CGJ10pIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdXJsUnVsZVsn5LqM5qyh5aSE55CGJ10odXJsKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIHVybFJ1bGUpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7X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MuVkFSTUFQLkZPTEQsIHBhcmFtcy5pc0ZvbGQpID09PSAnMScgPyAnMCcgOiAnMScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhZzogbVRhZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNGb2xkOiB0aGlzW3N5bWJvbE1hcC5tRm9sZF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogdGhpc1tzeW1ib2xNYXAubUZvbGRMYXlvdXRdLmNvbF90eXBlIHx8IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goZm9sZExheW91dClcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAvL+WFt+S9k+WIl+ihqOS4i+eahOWIhuexu1xcbiAgICAgICAgICAgICAgICBsZXQgc3ViX2NhdGVnb3JpZXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgaWYgKGNhdGVnb3J5LnN1Ykxpc3RSdWxlLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSB0aGlzLmV2YWxKU1J1bGUoY2F0ZWdvcnkubGlzdCwgY2F0ZWdvcnkuc3ViTGlzdFJ1bGUpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHBhcnNlRG9tRm9yQXJyYXkoY2F0ZWdvcnkubGlzdCwgY2F0ZWdvcnkuc3ViTGlzdFJ1bGUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChpbmRleCA8ICh0aGlzW3N5bWJvbE1hcC5tRm9sZEluZGV4XSB8fCAxKSkge1xcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gdGhpcy5nZXRUaXRsZShpdGVtLCBjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgY2F0ZWdvcnkpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj0nICsgdGhpc1tzeW1ib2xNYXAubUNvbG9yXSArICc+JyArIHRpdGxlICsgJyA8L2ZvbnQ+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuaW5kZXggPT09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wLmZvckVhY2goKGNhdGUsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuQ0FURUdPUlksIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5pbmRleCA9PT0gMCA/IG5ld19jYXRlIDogcGFyYW1zLmNhdGVfdGVtcCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5VUkwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFnOiBtVGFnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiB0aGlzW3N5bWJvbE1hcC5tUGFnZV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXNbc3ltYm9sTWFwLm1Gb2xkXSA9PT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIGNhdGVnb3J5KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSB0aGlzLmdldFVybChpdGVtLCBjYXRlZ29yeSlcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxmb250IGNvbG9yPScgKyB0aGlzW3N5bWJvbE1hcC5tQ29sb3JdICsgJz4nICsgdGl0bGUgKyAnIDwvZm9udD48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLlVSTCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWc6IG1UYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHRoaXNbc3ltYm9sTWFwLm1QYWdlXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG4gICAg55WM6Z2iKGxheW91dCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMubGF5b3V0KGxheW91dClcXG4gICAgfSxcXG4gICAg5YiG57G76ZO+5o6lKHRydWVVcmwpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLnRydWVVcmwodHJ1ZVVybCk7XFxuICAgIH0sXFxuICAgIOmhteeggShwYWdlKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5wYWdlKHBhZ2UpO1xcbiAgICB9LFxcbiAgICDmupDnoIEoaHRtbCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuaHRtbChodG1sKTtcXG4gICAgfSxcXG4gICAg5a6a5L2N5LiA57qn5YiG57G7KGxpc3QpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmxpc3QobGlzdCk7XFxuICAgIH0sXFxuICAgIOWumuS9jeWtkOWIhuexuyhzdWJMaXN0KSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5zdWJMaXN0KHN1Ykxpc3QpO1xcbiAgICB9LFxcbiAgICDlrprkvY3liIbnsbvmoIfpopgodGl0bGUpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLnRpdGxlKHRpdGxlKTtcXG4gICAgfSxcXG4gICAg5a6a5L2N5YiG57G76ZO+5o6lKHVybCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMudXJsKHVybCk7XFxuICAgIH0sXFxuICAgIOW8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gICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhdGUucHVzaChpbmRleCA9PT0gMCA/IHBhcmFtcy5rZXkudG9TdHJpbmcoKSA6IFxcXCIwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09ICcxJykge1xcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimClcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZijmjpLpmaQpICE9ICd1bmRlZmluZWQnICYmIOaOkumZpCAhPSAnJykge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyB0aXRsZS5mb250Y29sb3Io5YiG57G76aKc6ImyKSA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS51cmwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfSlcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLlm77niYfop6Plr4YqXCIsXCJwYXRoXCI6XCJpbWdERVNcIixcInJ1bGVcIjpcIiQuZXhwb3J0cy5pbWdEZWNyeXB0ID0gZnVuY3Rpb24oKSB7XFxuICAgIHZhciBqYXZhSW1wb3J0ID0gbmV3IEphdmFJbXBvcnRlcigpO1xcbiAgICBqYXZhSW1wb3J0LmltcG9ydFBhY2thZ2UoXFxuICAgICAgICBQYWNrYWdlcy5jb20uZXhhbXBsZS5oaWtlcnZpZXcudXRpbHMsXFxuICAgICAgICBQYWNrYWdlcy5qYXZhLmxhbmcsXFxuICAgICAgICBQYWNrYWdlcy5qYXZhLnNlY3VyaXR5LFxcbiAgICAgICAgUGFja2FnZXMuamF2YS51dGlsLFxcbiAgICAgICAgUGFja2FnZXMuamF2YS5pbyxcXG4gICAgICAgIFBhY2thZ2VzLmphdmEudGV4dCxcXG4gICAgICAgIFBhY2thZ2VzLmphdmF4LmNyeXB0byxcXG4gICAgICAgIFBhY2thZ2VzLmphdmF4LmNyeXB0by5zcGVjXFxuICAgICk7XFxuICAgI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