Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@4K电影馆☪︎@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6Ii5hbnRob2xvZ3ktbGlzdC1wbGF5JiZhLC0xJiZUZXh0LmpzOifmm7TmlrDoh7PvvJonK2lucHV0IiwidGl0bGUiOiI0S+eUteW9semmhuKYqu+4jiIsImF1dGhvciI6IlIiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IyNodHRwczovLzRrZHlnLnRvcC8iLCJ2ZXJzaW9uIjoyMDIzMTAwMSwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxudmFyIGQgPSBbXTtcblxuTVlfVVJMID0gTVlfVVJMLnJlcGxhY2UoJ2hpa2VyOi8vZW1wdHkjIycsICcnKTtcbnZhciBodG1sID0gZmV0Y2goTVlfVVJMKTtcbi8qXG5jb25zdCBob3N0ID0gJ2h0dHA6Ly9vZnRlbnMudG9wLyc7XG52YXIgaHRtbCA9IGZldGNoKGhvc3QsIHtcbiAgICBoZWFkZXJzOiB7XG4gICAgICAgICdVc2VyLUFnZW50JzogTU9CSUxFX1VBXG4gICAgfVxufSk7Ki9cblxuLy/moIfpopgs5o+P6L+wLOWbvueJhyzpk77mjqVcbnZhciDmoIfpopggPSAnYSYmdGl0bGUnO1xudmFyIOaPj+i/sCA9ICcuZnQ0JiZUZXh0JztcbnZhciDlm77niYcgPSAnaW1nfHwubGF6eSYmZGF0YS1zcmN8fGRhdGEtb3JpZ2luYWwnO1xudmFyIOmTvuaOpSA9ICdhJiZocmVmJztcblxuLy/ova7mk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pZiAoaHRtbC5pbmRleE9mKCfpqozor4HnoIEnKSA+IDApIHtcbiAgICBpdGVtcy5wdXNoKHtcbiAgICAgICAgdGl0bGU6ICfmnKzmrKHmkJzntKLpnIDopoHovpPlhaXpqozor4HnoIHpqozor4HmiJDlip/lkI7ov5Tlm57kuIvmi4nliLfmlrAnLFxuICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHknKS5ydWxlKCgpID0+IHtcbiAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xuICAgICAgICAgICAgLy92YXIgY29rID0gZmV0Y2goJ2hpa2VyOi8vZmlsZXMvY2FjaGUvSldfc3N0dkNvb2tpZS50eHQnLCB7fSk7XG4gICAgICAgICAgICB2YXIgY29rID0gSlNPTi5wYXJzZShmZXRjaENvb2tpZSgnaHR0cHM6Ly93d3cuZnJlZW9rLnZpcC9pbmRleC5waHAvdmVyaWZ5L2luZGV4Lmh0bWw/cj0nICsgTWF0aC5yYW5kb20oKSwge1xuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICAgICAgICAgJ1gtUmVxdWVzdGVkLVdpdGgnOiAnWE1MSHR0cFJlcXVlc3QnLFxuICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IE1PQklMRV9VQVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnR0VUJyxcbiAgICAgICAgICAgICAgICB3aXRoSGVhZGVyczogdHJ1ZVxuICAgICAgICAgICAgfSkpLmpvaW4oJzsnKTtcbiAgICAgICAgICAgIC8vbG9nKGNvayk7XG4gICAgICAgICAgICB2YXIgaW1nID0gJ2h0dHBzOi8vd3d3LmZyZWVvay52aXAvaW5kZXgucGhwL3ZlcmlmeS9pbmRleC5odG1sP3I9JyArIE1hdGgucmFuZG9tKCkgKyAnQFVzZXItQWdlbnQ9JyArIE1PQklMRV9VQSArICdAQ29va2llPScgKyBjb2s7XG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWZyZXNoUGFnZSgpO1xuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgIGRlc2M6ICcwJyxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxuICAgICAgICAgICAgICAgIHVybDogXCIndG9hc3Q6Ly/kvaDovpPlhaXnmoTmmK8nICsgaW5wdXRcIixcbiAgICAgICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogXCJwdXRWYXIoJ3Nz6aqM6K+B56CBJyxpbnB1dClcIixcbiAgICAgICAgICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCdcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WPkemAgScsXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgoY29rKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb2QgPSBnZXRWYXIoJ3Nz6aqM6K+B56CBJyk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBqc29uID0gSlNPTi5wYXJzZShmZXRjaCgnaHR0cHM6Ly93d3cuZnJlZW9rLnZpcC9pbmRleC5waHAvYWpheC92ZXJpZnlfY2hlY2s/dHlwZT1zZWFyY2gmdmVyaWZ5PScgKyBjb2QsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnWC1SZXF1ZXN0ZWQtV2l0aCc6ICdYTUxIdHRwUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBNT0JJTEVfVUEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0Nvb2tpZSc6IGNva1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6ICcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoanNvbi5jb2RlID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS9KV19mcmVlb2tDb29raWUudHh0JywgY29rKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJ0b2FzdDovL+mqjOivgeaIkOWKn+OAglwiXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJ0b2FzdDovL+mqjOivgeWksei0pe+8jOivt+mHjeivle+8gVwiXG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIH0sIGNvayksXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHNldEhvbWVSZXN1bHQoe1xuICAgICAgICAgICAgICAgIGRhdGE6IGl0ZW1zXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSksXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ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HVybDogaXRlbS51cmwsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBpZCsnYmFyJyxcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZSxcXG4gICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxcbiAgICAgICAgfVxcbiAgICB9KVxcblxcbiAgICBpZiAoc3RhcnQgPT0gZmFsc2UgfHwgZ2V0TXlWYXIoJ2JlbnN0YXJ0JywgJ3RydWUnKSA9PSAnZmFsc2UnKSB7XFxuICAgICAgICB1blJlZ2lzdGVyVGFzayhpZClcXG4gICAgICAgIHJldHVyblxcbiAgICB9XFxuICAgIFxcbiAgICAvL2xvZyhkYXRhKVxcblxcbiAgICBsZXQgb2JqID0ge1xcbiAgICAgICAgZGF0YTogZGF0YSxcXG4gICAgfTtcXG5cXG4gICAgcmVnaXN0ZXJUYXNrKGlkLCB0aW1lLCAkLnRvU3RyaW5nKChvYmosaWQpID0+IHtcXG4gICAgICAgIHZhciBkYXRhID0gb2JqLmRhdGE7XFxuICAgICAgICB2YXIgcnVtID0gZ2V0TXlWYXIoJ3JudW0nKTtcXG5cXG4gICAgICAgIHZhciBpID0gTnVtYmVyKGdldE15VmFyKCdiYW5uZXJpJywgJzAnKSk7XFxuICAgICAgICBpZiAocnVtICE9ICcnKSB7XFxuICAgICAgICAgICAgaSA9IE51bWJlcihydW0pICsgMVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3JudW0nKVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpID0gaSArIDE7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhpKVxcbiAgICAgICAgLy9sb2coZGF0YS5sZW5ndGgpXFxuXFxuICAgICAgICBpZiAoaSA+IGRhdGEubGVuZ3RoIC0gMSkge1xcbiAgICAgICAgICAgIGkgPSAwXFxuICAgICAgICB9XFxuICAgICAgICB2YXIgaXRlbSA9IGRhdGFbaV07XFxuICAgICAgICAvL2xvZyhpdGVtKVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKGlkKydiYXInLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnRpdGxlLFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IGl0ZW0udXJsLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgLy9uYW1lOiBpdGVtLnRpdGxlLnJlcGxhY2UoLzxbXj5dKz4vZywgJycpLFxcbiAgICAgICAgICAgICAgICAgICAgLy9zbmFtZTogaXRlbS5leHRyYS5zbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIC8vc3R5cGU6IGl0ZW0uZXh0cmEuc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAvL3N1cmw6IGl0ZW0udXJsLFxcbiAgICAgICAgICAgICAgICAgICAgLy9pbWc6aXRlbS5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAvL3BhZ2VUaXRsZTogaXRlbS50aXRsZS5yZXBsYWNlKC88W14+XSs+L2csICcnKSxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKGUubWVzc2FnZSlcXG4gICAgICAgICAgICB1blJlZ2lzdGVyVGFzayhpZClcXG4gICAgICAgIH1cXG4gICAgICAgIHB1dE15VmFyKCdiYW5uZXJpJywgaSk7XFxuXFxuICAgIH0sIG9iaixpZCkpXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pGg5LiA57qn6aG16Z2iXCIsXCJwYXRoXCI6XCJ5aVwiLFwicnVsZVwiOlwidmFyIEljb25fcHJlZml4ID0gJ2h0dHBzOi8vcmF3LmZhc3RnaXQub3JnL2xzMTI1NzgxMDAzL2xtdHViaWFvL21haW4vbW9yZS8nO1xcblxcblxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+ebtOaSrScsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL2xpdmU/cGFnZT1meXBhZ2Ujbm9IaXN0b3J5IycsXFxuICAgICAgICAgICAgcGljX3VybDogSWNvbl9wcmVmaXggKyAnMTQucG5nJyArIFxcXCJAUmVmZXJlcj1cXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl81XFxcIlxcbiAgICAgICAgfSk7XFxuXFxuLy/nrZvpgIlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfnrZvpgIknLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9zaGFpP3BhZ2U9ZnlwYWdlI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIHBpY191cmw6IEljb25fcHJlZml4ICsgJzMxLnBuZycgKyBcXFwiQFJlZmVyZXI9XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fNVxcXCJcXG4gICAgICAgIH0pO1xcblxcbi8v5pCc57SiXFxuICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9zcycsXFxuICAgICAgICAgICAgcGljX3VybDogSWNvbl9wcmVmaXggKyAnNy5wbmcnICsgXFxcIkBSZWZlcmVyPVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzVcXFwiXFxuICAgICAgICB9KTtcXG4vKlxcbi8v5pu05pawXFxuICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5pu05pawJyxcXG4gICAgICAgICAgICB1c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jogNyxcXG4gICAgICAgICAgICBcXFwi5LiAXFxcIjogMSxcXG4gICAgICAgICAgICBcXFwi5LqMXFxcIjogMixcXG4gICAgICAgICAgICBcXFwi5LiJXFxcIjogMyxcXG4gICAgICAgICAgICBcXFwi5ZubXFxcIjogNCxcXG4gICAgICAgICAgICBcXFwi5LqUXFxcIjogNSxcXG4gICAgICAgICAgICBcXFwi5YWtXFxcIjogNlxcbiAgICAgICAgfTtcXG4gICAgICAgIHJldHVybiBtYXBbd2tdXFxuICAgIH1cXG4gICAgbGV0IHdrX251bSA9IHdrVG9udW0oY2hvc2Vfd2Vlayk7XFxuLy9sb2cod2tfbnVtKVxcbmZvciAodmFyIGsgPSAxOyBrIDw9IDc7IGsrKykge1xcbiAgICBldmFsKCd2YXIgd2snICsgayArICc9cGRmYShodG1sLCBcXFwiI3dlZWstbW9kdWxlLScgKyAoaz09MD8wOmspICsgJyYmLnB1YmxpYy1saXN0LWJveCwwOjEyXFxcIik7Jyk7Ly/mmJ/mnJ/liJfooahcXG4gICAgaWYgKHdrX251bSA9PSBrKSB7XFxuICAgICAgICBldmFsKCd3aycraykuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICB2YXIgdXJsbCA9IE1ZX0hPTUUgKyBwZGZoKGl0ZW0sICdhJiZocmVmJykgKyAnI2ltbWVyc2l2ZVRoZW1lIyc7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwg5qCH6aKYKSxcXG4gICAgICAgICAgICAgICAgZGVzYzogcGRmaChpdGVtLCDmj4/ov7ApLFxcbiAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwg5Zu+54mHKSArIFxcXCJAUmVmZXJlcj1cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2UvZWojbm9IaXN0b3J5IyNpbW1lcnNpdmVUaGVtZSMnLFxcbiAgICAgICAgICAgICAgICBleHRyYTo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ykge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB1bmVzY2FwZShiYXNlNjREZWNvZGUodXJsKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICgvbTN1OHxtcDQvLnRlc3QodXJsKSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdXJsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ2aWRlbzovL1xcXCIgKyBpbnB1dFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInZpZGVvOi8vXFxcIiArIGlucHV0XFxuICAgICAgICB9XFxuICAgIH0pLFxcbiAgICB1cGRhdGE6IGZ1bmN0aW9uKHJ1bGUsIGhlYWRlcnMpIHtcXG4gICAgICAgIGhlYWRlcnMgPSBoZWFkZXJzICE9IHVuZGVmaW5lZCA/IGhlYWRlcnMgOiB7fTtcXG4gICAgICAgIHNldExhc3RDaGFwdGVyUnVsZSgnanM6JyArICQudG9TdHJpbmcoKHVybCwgcnVsZSwgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgIHZhciBodG1sID0gZmV0Y2godXJsLCBoZWFkZXJzKTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoZXZhbChydWxlKSlcXG4gICAgICAgIH0sIE1ZX1VSTCwgcnVsZSwgaGVhZGVycykpXFxuICAgIH0sXFxuICAgIGNsb3NlOiBmdW5jdGlvbihsaXN0LCBzb3J0cykge1xcbiAgICAgICAgYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCAkLnRvU3RyaW5nKChsaXN0LCBzb3J0cykgPT4ge1xcbiAgICAgICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdlcl8nICsgeCArICdmb2xkJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2VyXycgKyB4KTtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc29ydHM7IGkrKykge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdwbGF5bGlzdF8nICsgaSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2VyX3BsYXlsaXN0cycpO1xcbiAgICAgICAgfSwgbGlzdCwgc29ydHMpKVxcbiAgICB9LFxcbiAgICBkYXRhQ29udmVydDogZnVuY3Rpb24oZGF0YSkge1xcbiAgICAgICAgdmFyIG5ld2Nsc2xpc3QgPSBkYXRhLm1hcChmdW5jdGlvbihvYmopIHtcXG4gICAgICAgICAgICB2YXIgbmV3T2JqID0gT2JqZWN0LmFzc2lnbih7fSwgb2JqKTtcXG4gICAgICAgICAgICBpZiAobmV3T2JqLmhhc093blByb3BlcnR5KCd0eXBlJykpIHtcXG4gICAgICAgICAgICAgICAgbmV3T2JqLmNvbF90eXBlID0gbmV3T2JqLnR5cGU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBuZXdPYmo7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBuZXdjbHNsaXN0O1xcbiAgICB9LFxcbiAgICBwcmVMb2FkOiBmdW5jdGlvbihmdW5jKSB7XFxuICAgICAgICBsZXQgbXlmdW5jID0gbnVsbFxcbiAgICAgICAgaWYgKGZ1bmMgIT0gdW5kZWZpbmVkICYmIGZ1bmMuY29uc3RydWN0b3IgPT0gRnVuY3Rpb24pIHtcXG4gICAgICAgICAgICBteWZ1bmMgPSBmdW5jXFxuICAgICAgICB9XFxuICAgICAgICAkLmV4dGVuZCh7XFxuICAgICAgICAgICAgZGF0YUNvbnZlcnQ6IHRoaXMuZGF0YUNvbnZlcnQsXFxuICAgICAgICAgICAgbXNtOiBNZXRob2RzLk11bHRpU2VsZWN0TW9kZSxcXG4gICAgICAgICAgICBmdW5jOiBteWZ1bmMsXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBzbWFsbDogZnVuY3Rpb24oc3RyLCBjb2xvcikge1xcbiAgICAgICAgcmV0dXJuICfigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9XFxcIicgKyAoY29sb3IgfHwgJycpICsgJ1xcXCI+JyArIHN0ciArICc8L2ZvbnQ+PC9zbWFsbD4nO1xcbiAgICB9LFxcbiAgICDlo7DmmI46IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGhpcy5zbWFsbCgn5Lul5LiK5pWw5o2u5p2l5rqQ5LqO572R57uc77yM5aaC5oKo5Zac5qyi77yM6K+35pSv5oyB5a6Y5pa577yBJywgJyM4NzFGNzgnKSxcXG4gICAgICAgICAgICBkZXNjOiB0aGlzLnNtYWxsKCfmraTop4TliJnku4XpmZDlrabkuaDkuqTmtYHkvb/nlKjvvIzor7fkuo7lr7zlhaXlkI4yNOWwj+aXtuWGheWIoOmZpO+8jOS7u+S9lee7hOe7h+aIluS4quS6uuS4jeW+l+S7peS7u+S9leaWueW8j+aWueazleS8oOaSreatpOinhOWImeeahOaVtOS9k+aIlumDqOWIhu+8gScsICcjRjIwQzAwJyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICAgICAgfSk7XFxuICAgIH0sXFxuXFxuXFxuLy/nroDku4tcXG4gICAgc2V0RGVzYzogZnVuY3Rpb24oZGVzYywgbnVtKSB7XFxuICAgICAgICBkZXNjID0gZGVzYy5jb25zdHJ1Y3RvciA9PSBBcnJheSA/IGRlc2Muam9pbignPGJyPicpIDogZGVzYztcXG4gICAgICAgIGlmIChkZXNjLnJlcGxhY2UoLyg8YnI+fFxcXFxzKykvZywgJycpLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuXFxuICAgICAgICB9XFxuICAgICAgICB2YXIgaW5mbyA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9pbmZvJywgJ3t9JylcXG4gICAgICAgIGlmIChpbmZvWydkZXNjJ10gIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgaW5mb1snZGVzYyddID0gaW5mb1snZGVzYyddICsgJyDnroDku4s6JyArIGRlc2M7XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2VyX2luZm8nLCBpbmZvKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGNvbnN0IG1hcmsgPSAnZGVzYyc7XFxuICAgICAgICBudW0gPSB0eXBlb2YobnVtKSA9PSAndW5kZWZpbmVkJyA/IDkwIDogbnVtXFxuICAgICAgICBkZXNjID0gZGVzYy5zdGFydHNXaXRoKCfjgIDjgIAnKSA/IGRlc2MgOiAn44CA44CAJyArIGRlc2M7XFxuICAgICAgICBkZXNjID0gZGVzYy5yZXBsYWNlKC8nL2csIFxcXCImIzM5O1xcXCIpO1xcbiAgICAgICAgZGVzYyA9IGRlc2MucmVwbGFjZSgvXFxcXHJcXFxcbi9nLCBcXFwiPGJyPlxcXCIpO1xcblxcbiAgICAgICAgZnVuY3Rpb24gc3Vic3RyKHN0ciwgbWF4TGVuZ3RoKSB7XFxuICAgICAgICAgICAgbGV0IGxlbiA9IDA7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgaWYgKHN0ci5jaGFyQ29kZUF0KGkpID4gMjU1KSB7XFxuICAgICAgICAgICAgICAgICAgICBsZW4gKz0gMjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxlbisrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChsZW4gPiBtYXhMZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHIuc2xpY2UoMCwgaSkgKyAnLi4uJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gc3RyO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHNkZXNjID0gc3Vic3RyKGRlc2MsIG51bSk7XFxuICAgICAgICB2YXIgbGF6eSA9ICQoYCNub0xvYWRpbmcjYCkubGF6eVJ1bGUoKGRjLCBzZGMsIG0pID0+IHtcXG4gICAgICAgICAgICB2YXIgc2hvdyA9IHN0b3JhZ2UwLmdldEl0ZW0obSwgJzAnKTtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBmaW5kSXRlbSgnZGVzYycpLnRpdGxlO1xcbiAgICAgICAgICAgIHZhciByZSA9IC8oPFxcXFwvc21hbGw+PGJyPi4qPz4pLisvZztcXG4gICAgICAgICAgICB2YXIgZXhwID0gJ+WxleW8gDonO1xcbiAgICAgICAgICAgIHZhciByZXQgPSAn5pS26LW3Oic7XFxuICAgICAgICAgICAgaWYgKHNob3cgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2Rlc2MnLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZXQsIGV4cClcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZSwgJyQxJyArIHNkYyArICc8L3NtYWxsPicpXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLyg8XFxcXC9zbWFsbD48YnI+PGZvbnQgY29sb3I9XFxcIikuKj8oXFxcIj4pLywgJyQxIzhBMkJFMiQyJykvL+aUtui1t+minOiJslxcblxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKG0sICcwJyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgnZGVzYycsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKGV4cCwgcmV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKHJlLCAnJDEnICsgZGMgKyAnPC9zbWFsbD4nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oPFxcXFwvc21hbGw+PGJyPjxmb250IGNvbG9yPVxcXCIpLio/KFxcXCI+KS8sICckMSMwMDgwMDAkMicpLy/lsZXlvIDpopzoibJcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShtLCAnMScpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gYGhpa2VyOi8vZW1wdHlgXFxuICAgICAgICB9LCBkZXNjLCBzZGVzYywgbWFyaylcXG4gICAgICAgIHZhciBzYyA9IHN0b3JhZ2UwLmdldEl0ZW0obWFyaywgJzAnKSA9PSAnMCcgPyAn5bGV5byAOicgOiAn5pS26LW3Oic7XFxuICAgICAgICB2YXIgZGMgPSBzdG9yYWdlMC5nZXRJdGVtKG1hcmssICcwJykgPT0gJzAnID8gc2Rlc2MgOiBkZXNjO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJycgKyAnPGI+PGZvbnQgY29sb3I9XFxcIiMwOThBQzFcXFwiPuKItyAgICAgICAgICAgICAgICAgICAgICDliafmg4XnroDku4tcXHQ8L2ZvbnQ+PC9iPicgKyBcXFwiPHNtYWxsPjxhIHN0eWxlPSd0ZXh0LWRlY29yYXRpb246IG5vbmU7JyBocmVmPSdcXFwiICsgbGF6eSArIFxcXCInPlxcXCIgKyBzYyArICc8L2E+PC9zbWFsbD48YnI+PGZvbnQgY29sb3I9XFxcIiM4QTJCRTJcXFwiPicgKyBgJHtkY31gICsgJzwvc21hbGw+JywvL+m7mOiupOminOiJslxcbiAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0JyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogJ2Rlc2MnLFxcbiAgICAgICAgICAgICAgICBsaW5lU3BhY2luZzogNixcXG4gICAgICAgICAgICAgICAgdGV4dFNpemU6IDE1LFxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogdHJ1ZSxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9LFxcblxcblxcbi8v5rW35oqlXFxuICAgIHN0ckNvbnZlcnQ6IGZ1bmN0aW9uKGFycikge1xcbiAgICAgICAgcmV0dXJuIGFyci5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgc3RyID0geDtcXG4gICAgICAgICAgICBpZiAoLyjlr7zmvJR85Li75ryUfOexu+WeiynvvJovLnRlc3Qoc3RyKSkge1xcbiAgICAgICAgICAgICAgICBzdHIgPSBzdHIuc3BsaXQoJy8nKS5tYXAoKHZhbCwgaW5kZXgpID0+IChpbmRleCA9PT0gMCA/ICcnIDogJycpICsgdmFsKS5zbGljZSgwLCA1KS5qb2luKCcgJykucmVwbGFjZSgvICQvLCAnJyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBzdHJcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIHNldENvbnRlbnQ6IGZ1bmN0aW9uKG9iaikge1xcbiAgICAgICAgLy9sb2cob2JqKVxcbiAgICAgICAgdmFyIGNvbnRlbnRzID0gb2JqLm1haW47XFxuICAgICAgICB2YXIgc29ydE9yZGVyID0gb2JqLnNvcnQ7XFxuICAgICAgICB2YXIgaW1nID0gb2JqLmltZztcXG4gICAgICAgIHZhciB0ZXh0cyA9IGNvbnRlbnRzLm1hcCh4ID0+IHBkZmgoeCwgJ1RleHQnKSk7XFxuXFxuICAgICAgICB2YXIgYXJyYXkgPSB0ZXh0cy5zb3J0KChhLCBiKSA9PiB7XFxuICAgICAgICAgICAgY29uc3QgaW5kZXhBID0gc29ydE9yZGVyLmluZGV4T2YoYS5zdWJzdHIoMCwgMikpO1xcbiAgICAgICAgICAgIGNvbnN0IGluZGV4QiA9IHNvcnRPcmRlci5pbmRleE9mKGIuc3Vic3RyKDAsIDIpKTtcXG4gICAgICAgICAgICByZXR1cm4gaW5kZXhBIC0gaW5kZXhCO1xcbiAgICAgICAgfSlcXG4gICAgICAgIHZhciByZWdleCA9IG5ldyBSZWdFeHAoJygnICsgc29ydE9yZGVyLmpvaW4oJ3wnKSArICcpJyk7XFxuICAgICAgICBhcnJheSA9IGFycmF5LmZpbHRlcihmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHJlZ2V4LnRlc3QoaXRlbSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIC8vbG9nKGFycmF5KVxcblxcbiAgICAgICAgLy9hcnJheSA9IHNvcnRPcmRlci5sZW5ndGg9PTA/YXJyYXk6dGhpcy5zdHJDb252ZXJ0KGFycmF5KTtcXG4gICAgICAgIGFycmF5ID0gdGhpcy5zdHJDb252ZXJ0KGFycmF5KTtcXG5cXG4gICAgICAgIGlmIChhcnJheS5sZW5ndGggPiA2KSB7XFxuICAgICAgICAgICAgYXJyYXkgPSBhcnJheS5zbGljZSgwLCA2KTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHZhciB0aXRsZXMgPSBbXTtcXG4gICAgICAgIHZhciBkZXNjcyA9IFtdO1xcblxcbiAgICAgICAgc3dpdGNoIChhcnJheS5sZW5ndGgpIHtcXG4gICAgICAgICAgICBjYXNlIDQ6XFxuICAgICAgICAgICAgY2FzZSA1OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAyKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgyKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSA2OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAzKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgzKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignZXJfaW5mbycsIHtcXG4gICAgICAgICAgICBkZXNjOiBkZXNjcy5qb2luKCdcXFxcbicpLFxcbiAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICB0aXRsZTogIHRoaXMuc21hbGwoIHRpdGxlc1swXSArICdcXFxcbicgK3RpdGxlcy5zbGljZSgxLCAzKS5qb2luKCdcXFxcbicpLCdyZWQnKSxcXG4gICAgICAgICAgICBkZXNjOiB0aGlzLnNtYWxsKGRlc2NzLmpvaW4oJ1xcXFxuJyksJyNGRjdGMDAnKSxcXG4gICAgICAgICAgICAvL3RpdGxlOiAgdGhpcy5zbWFsbChwZGZoKGh0bWwsICcubW9kdWxlLWluZm8taXRlbTptYXRjaGVzKOWkh+azqO+8mnzov57ovb3vvJp86ZuG5pWw77yaKSYmVGV4dCcpICsgJ1xcXFxuJyArIHBkZmgoaHRtbCwgJy5tb2R1bGUtaW5mby10YWcmJlRleHQnKSwncmVkJyksXFxuICAgICAgICAgIC8vZGVzYzogdGhpcy5zbWFsbChwZGZoKGh0bWwsICcubW9kdWxlLWluZm8taXRlbTpjb250YWlucyjml7bpl7TvvJopJiZUZXh0JykgKyAnXFxcXG4nICsgcGRmaChodG1sLCAnLm1vZHVsZS1pbmZvLWl0ZW06Y29udGFpbnMo5a+85ryU77yaKSYmVGV4dCcpICsgJ1xcXFxuJyArIHBkZmgoaHRtbCwgJy5tb2R1bGUtaW5mby1pdGVtOmNvbnRhaW5zKOS4u+a8lO+8mikmJlRleHQnKSwnI0ZGN0YwMCcpLFxcbiAgICAgICAgICAgIHBpY191cmw6IGltZyArICdAUmVmZXJlcj0nLFxcbiAgICAgICAgICAgIHVybDogTVlfVVJMLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWNfYmx1cicsXFxuICAgICAgICB9KVxcbiAgICAgICAgaWYgKG9iai5kZXNjICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgIHRoaXMuc2V0RGVzYyhvYmouZGVzYyk7XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIHNldEN1c3RvbTogZnVuY3Rpb24ob2JqLCBpbWcpIHtcXG4gICAgICAgIHZhciBhcnJheSA9IFtdO1xcbiAgICAgICAgaWYgKG9iai5jb25zdHJ1Y3RvciA9PSBBcnJheSkge1xcbiAgICAgICAgICAgIGFycmF5ID0gb2JqO1xcbiAgICAgICAgfVxcbiAgICAgICAgYXJyYXkgPSB0aGlzLnN0ckNvbnZlcnQoYXJyYXkpO1xcbiAgICAgICAgdmFyIHRpdGxlcyA9IFtdO1xcbiAgICAgICAgdmFyIGRlc2NzID0gW107XFxuICAgICAgICBzd2l0Y2ggKGFycmF5Lmxlbmd0aCkge1xcbiAgICAgICAgICAgIGNhc2UgNDpcXG4gICAgICAgICAgICBjYXNlIDU6XFxuICAgICAgICAgICAgICAgIHRpdGxlcyA9IGFycmF5LnNsaWNlKDAsIDIpO1xcbiAgICAgICAgICAgICAgICBkZXNjcyA9IGFycmF5LnNsaWNlKDIpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlIDY6XFxuICAgICAgICAgICAgICAgIHRpdGxlcyA9IGFycmF5LnNsaWNlKDAsIDMpO1xcbiAgICAgICAgICAgICAgICBkZXNjcyA9IGFycmF5LnNsaWNlKDMpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdlcl9pbmZvJywge1xcbiAgICAgICAgICAgIGRlc2M6IGR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cblxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIodmFyaSArICdmb2xkJywgJzEnKSA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBidG4gPSBmaW5kSXRlbShzaHNvcnQgKyAnX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZvbGRzID0gWyc8Zm9udCBjb2xvcj1cXFwiI0QzRDNEM1xcXCI+4pi3JywgJzxmb250IGNvbG9yPVxcXCIjRkZBNTAwXFxcIj7imLAnXTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCAne30nKTtcXG4gICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbCA9IHBsaXN0W3Noc29ydF0uY29sX3R5cGU7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgY2xzID0gcGxpc3Rbc2hzb3J0XS5jbHM7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gcGxpc3Rbc2hzb3J0XS5waWM7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmEgPSBwbGlzdFtzaHNvcnRdLmV4dHJhO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coZXh0cmEpXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGJ0bi5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBidG4udGl0bGUucmVwbGFjZShmb2xkc1swXSwgZm9sZHNbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG5cXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHZhcmkgKyAnZm9sZCcsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAndG9hc3Q6Ly/lsZXlvIDmiY3og73mk43kvZwnO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsaXN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2VyX3BsYXlsaXN0cycsICd7fScpO1xcbiAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29sID0gcGxpc3Rbc2hzb3J0XS5jb2xfdHlwZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBjbHMgPSBwbGlzdFtzaHNvcnRdLmNscztcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBwbGlzdFtzaHNvcnRdLnBpYztcXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHRyYSA9IHBsaXN0W3Noc29ydF0uZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhleHRyYSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcih2YXJpLCBpKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIHhsaXN0ID0gbGlzdHNbaV07XFxuICAgICAgICAgICAgICAgIGlmICgkLmZ1bmMgIT0gdW5kZWZpbmVkICYmICQuZnVuYy5jb25zdHJ1Y3RvciA9PSBGdW5jdGlvbikge1xcbiAgICAgICAgICAgICAgICAgICAgeGxpc3QgPSAkLmZ1bmMoaSk7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX2xpc3QnLCB4bGlzdCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIHBsYXlzID0geGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogeC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHgudXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2wsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljOiBwaWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oe30sZXh0cmEse1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogeC51cmwucmVwbGFjZSgvQGxhenlSdWxlW1xcXFxzXFxcXFNdKy9nLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogY2xzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnKSA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlzLnJldmVyc2UoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgcGNmZyA9IHN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCArICdfcHVzaGNmZycsICd7fScpO1xcbiAgICAgICAgICAgICAgICBpZiAocGNmZ1sn5Y2V5o6oJ10pIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19wdXNoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwY2ZnWydvYmonXVsn5Y2V5o6oJ11bMF1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwY2ZnWyfljZXmjqgnXSA9IGZhbHNlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChwY2ZnWyfpgInmjqgnXSkge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX3B1c2hzJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwY2ZnWydvYmonXVsn6YCJ5o6oJ11bMF1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwY2ZnWyfpgInmjqgnXSA9IGZhbHNlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfcHVzaGNmZycsIHBjZmcpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIHBsYXlzKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIHRhYnggPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcbiAgICAgICAgICAgICAgICB0YWJ4LmZvckVhY2goKHgsIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB4LnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaWkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHguZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2UoLyMoXFxcXHcrKT8vZywgbGluZWMpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZSgvIyhcXFxcdyspPy9nLCAnIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip/vvIEnO1xcbiAgICAgICAgICAgIH0sIHZhcmksIHNoc29ydCwgaSwgY3VzdG9tLue6v+i3r+mAieS4rSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAoZ2V0TXlWYXIodmFyaSwgJzAnKSA9PSBpID8gdGFic1tpXS5mb250Y29sb3IoY3VzdG9tLue6v+i3r+mAieS4rSkgOiB0YWJzW2ldLmZvbnRjb2xvcignIycpKSxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjdXN0b20u57q/6Lev5qC35byPLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBzaHNvcnQgKyAnX3RhYicsXFxuICAgICAgICAgICAgICAgICAgICBpZDogc2hzb3J0ICsgJ190YWJfJyArIGksXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogY3VzdG9tLuWIhuWJsuagt+W8jyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogc2hzb3J0ICsgJ19saW5lJyxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBwdXNoVGFiOiBmdW5jdGlvbih2YXJpLCBzaHNvcnQpIHtcXG4gICAgICAgIGFkZExpc3RlbmVyKCdvblJlZnJlc2gnLCAkLnRvU3RyaW5nKChzaHNvcnQpID0+IHtcXG4gICAgICAgICAgICBjbGVhck15VmFyKHNoc29ydCArICdfcHVzaGNmZycpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoc2hzb3J0ICsgJ19kdW9zZWxlY3QnKTtcXG4gICAgICAgIH0sIHNoc29ydCkpXFxuICAgICAgICB2YXIgcG9iaiA9IHtcXG4gICAgICAgICAgICAn5Y2V5o6oJzogWyfipr/ljZXmjqgnLCAnPGI+4qa/5Y2V5o6oPC9iPicuZm9udGNvbG9yKCcjMDBGQTlBJyldLFxcbiAgICAgICAgICAgICfpgInmjqgnOiBbJ+KYkemAieaOqCcsICc8Yj7imJHpgInmjqg8L2I+Jy5mb250Y29sb3IoJyM0NjgyQjQnKV0sXFxuICAgICAgICB9XFxuXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oyYJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogc2hzb3J0ICsgJ19wdXNodGFiJyxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6IHBvYmpbJ+WNleaOqCddWzBdLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaHNvcnQsIHBvYmosIHZhcmkpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKHZhcmkgKyAnZm9sZCcsICcxJykgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bGV5byA5omN6IO95pON5L2cJztcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGVzID0gcG9ialsn5Y2V5o6oJ107XFxuICAgICAgICAgICAgICAgIHZhciBwY2ZnID0gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0ICsgJ19wdXNoY2ZnJywgJ3t9Jyk7XFxuICAgICAgICAgICAgICAgIHBjZmdbJ29iaiddID0gcG9iajtcXG4gICAgICAgICAgICAgICAgdmFyIOWNleaOqCA9IHBjZmdbJ+WNleaOqCddID8gcGNmZ1sn5Y2V5o6oJ10gOiBmYWxzZTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKOWNleaOqCkge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX3B1c2gnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlc1swXSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwY2ZnWyfljZXmjqgnXSA9IGZhbHNlO1xcbiAgICAgICAgICAgICAgICAgICAgcGNmZ1sncGxheWxpc3QnXS5tYXAoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHguZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB4LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19wdXNoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIHRpdGxlc1sxXSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCArICdfcHVzaHMnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBvYmpbJ+mAieaOqCddWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHBjZmdbJ+WNleaOqCddID0gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGxheWxpc3QgPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICAgICAgcGNmZ1sncGxheWxpc3QnXSA9IHBsYXlsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgZmluZEl0ZW1zQnlDbHMoc2hzb3J0KS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRwdXNoID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB4LnRpdGxlICsgJyQnICsgeC5leHRyYS5pZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHguZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgoZHB1c2gpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cnVsZT1YWVHmjqjpgIEmcHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KGRwdXNoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGRwdXNoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfcHVzaGNmZycsIHBjZmcpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJyArICjljZXmjqggPyAn5Y2V5o6o5byA5ZCvJyA6ICfljZXmjqjlhbPpl60nKTtcXG4gICAgICAgICAgICB9LCBzaHNvcnQsIHBvYmosIHZhcmkpLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX3B1c2gnLFxcbiAgICAgICAgICAgICAgICBjbHM6IHNoc29ydCArICdfcHVzaHRhYicsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIHRpdGxlOiBwb2JqWyfpgInmjqgnXVswXSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2hzb3J0LCBwb2JqLCB2YXJpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcih2YXJpICsgJ2ZvbGQnLCAnMScpID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WxleW8gOaJjeiDveaTjeS9nCc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlcyA9IHBvYmpbJ+mAieaOqCddO1xcbiAgICAgICAgICAgICAgICB2YXIgcGNmZyA9IHN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCArICdfcHVzaGNmZycsICd7fScpO1xcbiAgICAgICAgICAgICAgICBwY2ZnWydvYmonXSA9IHBvYmo7XFxuICAgICAgICAgICAgICAgIHZhciDpgInmjqggPSBwY2ZnWyfpgInmjqgnXSA/IHBjZmdbJ+mAieaOqCddIDogZmFsc2U7XFxuICAgICAgICAgICAgICAgIGlmICjpgInmjqgpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19wdXNocycsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVzWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICBwY2ZnWydwbGF5bGlzdCddLm1hcCgoeCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogeC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB4LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19wdXNodG8nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmjqjpgIHmnKzpobU9PlRWQm94JyxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihzaHNvcnQgKyAnX2R1b3NlbGVjdCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX3B1c2hzJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIHRpdGxlc1sxXSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwY2ZnWyfpgInmjqgnXSA9IHRydWU7XFxuICAgICAgICAgICAgICAgICAgICBwY2ZnWyfljZXmjqgnXSA9IGZhbHNlO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXlsaXN0ID0gZmluZEl0ZW1zQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J10gPSBwbGF5bGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBJZHMgPSBwbGF5bGlzdC5tYXAoaXQgPT4gaXQuZXh0cmEuaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgSWRzLmZvckVhY2goeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gZmluZEl0ZW0oeCkudGl0bGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJC5tc20odGl0bGUsIHgsIHNoc29ydCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19wdXNoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwb2JqWyfljZXmjqgnXVswXSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCArICdfcHVzaHRvJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB6YCJ5LitPT5UVkJveCcsXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX3B1c2hjZmcnLCBwY2ZnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycgKyAo6YCJ5o6oID8gJ+mAieaOqOW8gOWQrycgOiAn6YCJ5o6o5YWz6ZetJyk7XFxuICAgICAgICAgICAgfSwgc2hzb3J0LCBwb2JqLCB2YXJpKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogc2hzb3J0ICsgJ19wdXNocycsXFxuICAgICAgICAgICAgICAgIGNsczogc2hzb3J0ICsgJ19wdXNodGFiJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuaOqOmAgeacrOmhtT0+VFZCb3hcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaHNvcnQsIHZhcmkpID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIHBjZmcgPSBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQgKyAnX3B1c2hjZmcnLCAne30nKTtcXG4gICAgICAgICAgICAgICAgdmFyIOWNleaOqCA9IHBjZmdbJ+WNleaOqCddID8gcGNmZ1sn5Y2V5o6oJ10gOiBmYWxzZTtcXG4gICAgICAgICAgICAgICAgdmFyIOmAieaOqCA9IHBjZmdbJ+mAieaOqCddID8gcGNmZ1sn6YCJ5o6oJ10gOiBmYWxzZTtcXG4gICAgICAgICAgICAgICAgaWYgKCHljZXmjqggJiYgIemAieaOqCkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRhYnMgPSBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQgKyAnX3RhYnMnLCAnW10nKTtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBscyA9IHN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCArICdfbGlzdCcsICdbXScpLm1hcChsaSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsaS5tYXAoaXRlbSA9PiBpdGVtLnRpdGxlICsgJyQnICsgaXRlbS51cmwucmVwbGFjZSgvQGxhenlSdWxlW1xcXFxzXFxcXFNdKy9nLCAnJykpLmpvaW4oJyMnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJyQkJCcpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBscyA9IHN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCArIFxcXCJfbGlzdFxcXCIsICdbXScpLm1hcCh4ID0+IHgudGl0bGUgKyBcXFwiJFxcXCIgKyB4LnVybCkuam9pbihcXFwiI1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0YWJzID0gW3RhYnNbZ2V0TXlWYXIodmFyaSwgJzAnKV1dO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgLypsb2cocGxzKVxcbiAgICAgICAgICAgICAgICAgICAgbG9nKHRhYnMpKi9cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAo6YCJ5o6oKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGxzID0gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0ICsgXFxcIl9kdW9zZWxlY3RcXFwiLCAnW10nKS5tYXAoeCA9PiB4LnRpdGxlICsgXFxcIiRcXFwiICsgeC51cmwpLmpvaW4oXFxcIiNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwbHMubGVuZ3RoID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup5Li656m6JztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZhciB0YWJzID0gWyfmkq3mlL7liJfooagnXTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICB2YXIgaW5mbyA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9pbmZvJywgJ3t9Jyk7XFxuICAgICAgICAgICAgICAgIHZhciBkZXNjID0gaW5mb1snZGVzYyddO1xcbiAgICAgICAgICAgICAgICB2YXIg5o6o6YCBID0ge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjb250ZW50XFxcIjogZGVzYyB8fCAnJyxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwaWNcXFwiOiBpbmZvWydpbWcnXSB8fCAnJyxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJmcm9tXFxcIjogdGFicy5qb2luKCckJCQnKSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBwbHMsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy9sb2co5o6o6YCBKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSjmjqjpgIEpKVxcbiAgICAgICAgICAgIH0sIHNoc29ydCwgdmFyaSksXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHNoc29ydCArICdfcHVzaHRvJyxcXG4gICAgICAgICAgICAgICAgY2xzOiBzaHNvcnQgKyAnX3B1c2h0YWInXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogc2hzb3J0ICsgJ19wdXNodGFiJyxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBzZXRMb25nY2xpY2s6IGZ1bmN0aW9uKHNoc29ydCwgY3VzdG9tKSB7XFxuICAgICAgICByZXR1cm4gW3tcXG4gICAgICAgICAgICB0aXRsZTogJ+agt+W8j/CfjqgnLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaHNvcnQpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGFsbF9jb2xzID0gWycnXS5jb25jYXQoZ2V0Q29sVHlwZXMoKSk7XFxuICAgICAgICAgICAgICAgIGFsbF9jb2xzID0gYWxsX2NvbHMuZmlsdGVyKHggPT5cXG4gICAgICAgICAgICAgICAgICAgIC8odGV4dF98ZmxleCkuKi8udGVzdCh4KSAmJiB4ICE9ICd0ZXh0X2ljb24nKTtcXG4gICAgICAgICAgICAgICAgLy9sb2coYWxsX2NvbHMpXFxuICAgICAgICAgICAgICAgIGxldCBjbHMgPSBzdG9yYWdlMC5nZXRNeVZhcignZXJfcGxheWxpc3RzJywgJ3t9JykgfHxcXG4gICAgICAgICAgICAgICAgICAgICcnO1xcbiAgICAgICAgICAgICAgICBpZiAoY2xzW3Noc29ydF0gIT0gJycpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbCA9IGNsc1tzaHNvcnRdLmNvbF90eXBlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCDmjInpkq7moLflvI8gPSBhbGxfY29scy5tYXAoKGl0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXQgPT09IGNvbCA/ICfwn5GJJyArIGl0IDogaXQ7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBsZXQgdGlwcyA9ICfor7fpgInmi6npgInpm4bmjInpkq7moLflvI8nO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJCjmjInpkq7moLflvI8sIDIsIHRpcHMpLnNlbGVjdCgoc2hzb3J0LCBjbHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQucmVwbGFjZSgv8J+RiS9nLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICAvKnN0b3JhZ2UwLnNldEl0ZW0oJ+aMiemSruagt+W8jycsIGlucHV0KTsqL1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IG9sZElkcyA9IChmaW5kSXRlbXNCeUNscyhzaHNvcnQpIHx8IFtdKS5tYXAoaXQgPT4gaXQuZXh0cmEuaWQpOyAvL+iAgeWFg+e0oGlkc1xcbiAgICAgICAgICAgICAgICAgICAgb2xkSWRzLmZvckVhY2goeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5YiH5o2i6YCJ6ZuG5oyJ6ZKu5qC35byP5Li6OicgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgfSwgc2hzb3J0LCBjbHMpO1xcbiAgICAgICAgICAgIH0sIHNoc29ydCwgY3VzdG9tKVxcbiAgICAgICAgfV1cXG4gICAgfSxcXG4gICAgc2V0VGFiczogZnVuY3Rpb24odGFicywgdmFyaSwgc2hzb3J0LCBwYXJzZSkge1xcbiAgICAgICAgbGV0IGN1c3RvbSA9IHBhcnNlLuiHquWumuS5iTtcXG4gICAgICAgIGN1c3RvbSA9IHRoaXMuZ2V0UHJlc2V0KGN1c3RvbSk7XFxuICAgICAgICBzaHNvcnQgPSBzaHNvcnQgPyBzaHNvcnQgOiAnc2hzb3J0JztcXG4gICAgICAgIHZhciB0aXRsZSA9IChnZXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpID09ICcxJykgPyAnPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAnICsgY3VzdG9tLumAhuW6j+minOiJsiArICdcXFwiPumAhuW6jzwvc3Bhbj48L2I+JyA6ICc8Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICcgKyBjdXN0b20u5q2j5bqP6aKc6ImyICsgJ1xcXCI+5q2j5bqPPC9zcGFuPjwvYj4nXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB2YXJpICsgJzonICsgdGl0bGUsXFxuICAgICAgICAgICAgZGVzYzogJ+WFsScgKyBTdHJpbmcodGFicy5sZW5ndGgpLmZvbnRjb2xvcignIzQ2ODJCNCcpICsgJ+adoee6v+i3rycsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaHNvcnQsIHZhcmksIGN1c3RvbSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZiA9IGdldE15VmFyKHNoc29ydCArICdfc29ydCcsICcwJyk7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignZXJfJyArIHZhcmkgKyAnZm9sZCcsICcxJykgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bGV5byA5omN6IO95pON5L2cJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgY2xzbGlzdHMgPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICB2YXIgbmV3Y2xzbGlzdCA9ICQuZGF0YUNvbnZlcnQoY2xzbGlzdHMpO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGVzID0gW2Ake2N1c3RvbS7mraPluo/popzoibJ9XFxcIj7mraPluo9gLCBgJHtjdXN0b20u6YCG5bqP6aKc6ImyfVxcXCI+6YCG5bqPYF07XFxuXFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICBuZXdjbHNsaXN0LnJldmVyc2UoKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIG5ld2Nsc2xpc3QpO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInKVxcblxcbiAgICAgICAgICAgICAgICBpZiAoY29uZiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG9iai50aXRsZS5yZXBsYWNlKHRpdGxlc1sxXSwgdGl0bGVzWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2F2YXRhcicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzBdLCB0aXRsZXNbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcxJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaOkuW6j+aIkOWKnyc7XFxuICAgICAgICAgICAgfSwgc2hzb3J0LCB2YXJpLCBjdXN0b20pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6IGN1c3RvbS7lm77moIcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHNoc29ydCArICdfYXZhdGFyJyxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiB0aGlzLnNldExvbmdjbGljayhzaHNvcnQpLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICB2YXIg5oqY5Y+gID0gJ+KAnOKAnOKAneKAnTxiPicgKyAn4pi3Jy5mb250Y29sb3IoXFxcIiNEM0QzRDNcXFwiKTtcXG4gICAgICAgIHZhciDlsZXlvIAgPSAn4oCc4oCc4oCd4oCdPGI+JyArICfimLAnLmZvbnRjb2x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CArICdfY2xzJyk7XFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIob2JqLmV4dHJhLmlkLCBjcyk7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGJ0bi5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBidG4udGl0bGUucmVwbGFjZShmb2xkc1swXSwgZm9sZHNbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoZm9sZCA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKGZvbGRuYW1lLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBjbHMgPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGN4ID0gJC5kYXRhQ29udmVydChwY2xzKTtcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfY2xzJywgY3gpO1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGJ0bi5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBidG4udGl0bGUucmVwbGFjZShmb2xkc1sxXSwgZm9sZHNbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJyArIChmb2xkID09PSAnMScgPyAn5pS26LW3JyA6ICflsZXlvIAnKTtcXG4gICAgICAgICAgICB9LCBmb2xkbmFtZSwgc2hzb3J0KSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogc2hzb3J0ICsgJ19idXR0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ge1xcbiAgICAgICAgICAgIHZhciBwbCA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCAne30nKTtcXG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMocGwpLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgdmFyIGZvbGQgPSBnZXRNeVZhcihmb2xkbmFtZSwgJzEnKTtcXG4gICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInKVxcbiAgICAgICAgICAgIGlmIChmb2xkID09ICcxJykge1xcbiAgICAgICAgICAgICAgICB2YXIgYmNscyA9IGZpbmRJdGVtKHNoc29ydCArICdfYnV0dG9uJyk7XFxuICAgICAgICAgICAgICAgIHZhciB0Y2xzID0gZmluZEl0ZW1zQnlDbHMoc2hzb3J0ICsgJ190YWInKTtcXG4gICAgICAgICAgICAgICAgdmFyIGxjbHMgPSBmaW5kSXRlbShzaHNvcnQgKyAnX2xpbmUnKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIHBjbHMgPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICB2YXIgY3MgPSBbYmNsc10uY29uY2F0KHRjbHMsIFtsY2xzXSwgcGNscyk7XFxuXFxuICAgICAgICAgICAgICAgIGlmIChwdXNoKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGNscyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCArICdfcHVzaHRhYicpO1xcbiAgICAgICAgICAgICAgICAgICAgY3MgPSBwY2xzLmNvbmNhdChjcyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgdmFyIGN4ID0gJC5kYXRhQ29udmVydChjcyk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfY2xzJywgY3gpO1xcbiAgICAgICAgICAgICAgICBpZiAocHVzaCkge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHNoc29ydCArICdfcHVzaHRhYicpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oYmNscy5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHNoc29ydCArICdfbGluZScpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG5cXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShvYmouZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IG9iai5kZXNjLnJlcGxhY2UoJ+WxleW8gDxmb250IGNvbG9yPVxcXCIjRkZBNTAwXFxcIj7imLAnLCAn5oqY5Y+gPGZvbnQgY29sb3I9XFxcIiNEM0QzRDNcXFwiPuKYtycpLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZm9sZCA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGNzID0gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0ICsgJ19jbHMnKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfYXZhdGFyJywgY3MpO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKG9iai5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogb2JqLmRlc2MucmVwbGFjZSgn5oqY5Y+gPGZvbnQgY29sb3I9XFxcIiNEM0QzRDNcXFwiPuKYtycsICflsZXlvIA8Zm9udCBjb2xvcj1cXFwiI0ZGQTUwMFxcXCI+4piwJyksXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHB1dE15VmFyKGZvbGRuYW1lLCBmb2xkID09PSAnMScgPyAnMCcgOiAnMScpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgKGZvbGQgPT09ICcxJyA/ICfmlLbotbcnIDogJ+WxleW8gCcpO1xcbiAgICAgICAgfSwgZm9sZG5hbWUsIHNoc29ydCwgKHBhcnNlWyfmjqjpgIEnXSA/IHRydWUgOiBmYWxzZSkpO1xcbiAgICAgICAgdmFyIGRlc2MgPSAoZm9sZCA9PT0gJzAnID8g5oqY5Y+gIDog5bGV5byAKSArICdcXFxcdCc7XFxuXFxuICAgICAgICBpZiAoZXhwLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgdXJsID0gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIGRlc2MgPSAnJztcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHZhcmkgKyAnOlxcXFx0XFxcXHQnICsgJ+WFsScgKyBTdHJpbmcodGFicy5sZW5ndGgpLmZvbnRjb2xvcignIzQ2ODJCNCcpICsgJ+adoee6v+i3rycsXFxuICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBjdXN0b20u5Zu+5qCHLFxcbiAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2F2YXRhcicsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogdGhpcy5zZXRMb25nY2xpY2soc2hzb3J0KSxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgaWYgKHR5cGVvZihwYXJzZVsn5o6o6YCBJ10pICE9ICd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ZGF0ZUl0ZW0oc2hzb3J0ICsgJ19idXR0b24nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG9iai50aXRsZS5yZXBsYWNlKHRpdGxlc1sxXSwgdGl0bGVzWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2J1dHRvbicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzBdLCB0aXRsZXNbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcxJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmjpLluo/miJDlip8nXFxuICAgICAgICAgICAgfSwgdmFyaSwgc2hzb3J0LCBjdXN0b20pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBjdXN0b20u57q/6Lev5qC35byPLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2J1dHRvbicsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIHRoaXMuY3JlYXRlUExpc3QodGFicywgdmFyaSwgc2hzb3J0LCBjdXN0b20pO1xcbiAgICB9LFxcbiAgICBzZXRMaXN0czogZnVuY3Rpb24obGlzdHMsIGluZGV4LCBzaHNvcnQsIHBhcnNlKSB7XFxuXFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX2xpc3QnLCBsaXN0cyk7XFxuXFxuICAgICAgICBwYXJzZSA9IHBhcnNlID8gcGFyc2UgOiB7fTtcXG4gICAgICAgIHZhciDmoLflvI8gPSBwYXJzZS7moLflvI8gPyBwYXJzZS7moLflvI8gOiAnJztcXG4gICAgICAgIHZhciDlm77moIcgPSBwYXJzZS7lm77moIcgPyBwYXJzZS7lm77moIcgOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tb3ZpZS8xMy5zdmcnO1xcbiAgICAgICAgdmFyIGFqYXggPSBwYXJzZS5BamF4ID8gcGFyc2UuQWpheCA6IGZhbHNlO1xcblxcbiAgICAgICAgc2hzb3J0ID0gc2hzb3J0ID8gc2hzb3J0IDogJ3Noc29ydCc7XFxuXFxuICAgICAgICBpZiAoYWpheCkge1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gbGlzdHM7XFxuICAgICAgICAgICAgaWYgKGdldE15VmFyKHNoc29ydCArICdfc29ydCcpID09ICcxJyAmJiBsaXN0cy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0cy5yZXZlcnNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGxpc3RzW2luZGV4XTtcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JykgPT0gJzEnICYmIGxpc3RzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGxpc3RzW2luZGV4XS5yZXZlcnNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcblxcbiAgICAgICAgaWYgKOagt+W8jyA9PSAnJykge1xcbiAgICAgICAgICAgIOagt+W8jyA9IGxpc3QubGVuZ3RoID4gMyA/ICd0ZXh0XzQnIDogJ3RleHRfMidcXG4gICAgICAgIH1cXG4gICAgICAgIFxcbiAgICAgICAgdmFyIGV4dHJhID0gJyc7XFxuXFxuICAgICAgICBpZiAocGFyc2UuZXh0cmEgIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgZXh0cmEgPSBwYXJzZS5leHRyYVxcbiAgICAgICAgfVxcblxcbiAgICAgICAgaWYgKGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgIHZhciBwbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCAne30nKTtcXG4gICAgICAgICAgICBpZiAoIXBsaXN0Lmhhc093blByb3BlcnR5KHNoc29ydCkpIHtcXG4gICAgICAgICAgICAgICAgcGxpc3Rbc2hzb3J0XSA9IHt9O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBwbGlzdFtzaHNvcnRdWydjbHMnXSA9IHNoc29ydDtcXG4gICAgICAgICAgICBwbGlzdFtzaHNvcnRdWydjb2xfdHlwZSddID0g5qC35byPO1xcbiAgICAgICAgICAgIHBsaXN0W3Noc29ydF1bJ3BpYyddID0g5Zu+5qCHOyBcXG4gICAgICAgICAgICBwbGlzdFtzaHNvcnRdWydleHRyYSddPWV4dHJhOyAgICAgICAgICAgXFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2VyX3BsYXlsaXN0cycsIHBsaXN0KTtcXG4gICAgICAgIH1cXG4gICAgICAgIFxcblxcbiAgICAgICAgZm9yICh2YXIgaiBpbiBsaXN0KSB7XFxuICAgICAgICAgICAgbGV0IGx0ID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbGlzdFtqXS50aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBsaXN0W2pdLnVybCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IOagt+W8jyxcXG4gICAgICAgICAgICAgICAgcGljOiDlm77moIcsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogbGlzdFtqXS51cmwucmVwbGFjZSgvQGxhenlSdWxlW1xcXFxzXFxcXFNdKy9nLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IHNoc29ydCwgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGx0WydleHRyYSddID0gT2JqZWN0LmFzc2lnbih7fSwgbHRbJ2V4dHJhJ10sIGV4dHJhKTtcXG4gICAgICAgICAgICBkLnB1c2gobHQpO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBldmFsUmU6IGZ1bmN0aW9uKGlucHV0LCDlh73mlbApIHtcXG4gICAgICAgIGxldCByZXN1bHQgPSBpbnB1dDtcXG4gICAgICAgIHJlc3VsdCA9IGV2YWwoJ2lucHV0JyArIOWHveaVsCk7XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICB9LFxcbiAgICBnZXRUYWJzOiBmdW5jdGlvbihwYXJzZSkge1xcbiAgICAgICAgdmFyIHRhYnMgPSBbXTtcXG4gICAgICAgIHZhciBhcnRzID0gW107XFxuICAgICAgICBpZiAodHlwZW9mIHBhcnNlLue6v+i3ryA9PSAnb2JqZWN0Jykge1xcbiAgICAgICAgICAgIGFydHMgPSBwYXJzZS7nur/ot687XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoYXJ0cy5sZW5ndGggPT0gMCkge1xcbiAgICAgICAgICAgIGFydHMgPSBwZGZhKGh0bWwsIHBhcnNlLue6v+i3ryk7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIg57q/6Lev5ZCNID0gcGFyc2Uu57q/6Lev5ZCN56ewO1xcbiAgICAgICAgdmFyIOabv+aNouWHveaVsCA9ICcnO1xcbiAgICAgICAgaWYgKHBhcnNlLue6v+i3r+WQjeensC5pbmNsdWRlcygnQEAnKSkge1xcbiAgICAgICAgICAgIOe6v+i3r+WQjSA9IHBhcnNlLue6v+i3r+WQjeensC5zcGxpdCgnQEAnKVswXTtcXG4gICAgICAgICAgICDmm7/mjaLlh73mlbAgPSBwYXJzZS7nur/ot6/lkI3np7Auc3BsaXQoJ0BAJylbMV07XFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKHZhciBpIGluIGFydHMpIHtcXG4gICAgICAgICAgICBsZXQgbGluZW5hbWUgPSAnJztcXG4gICAgICAgICAgICBpZiAo57q/6Lev5ZCNID09ICcnKSB7XFxuICAgICAgICAgICAgICAgIGxpbmVuYW1lID0gYXJ0c1tpXTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsaW5lbmFtZSA9IHBkZmgoYXJ0c1tpXSwg57q/6Lev5ZCNKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKOabv+aNouWHveaVsCAhPSAnJykge1xcbiAgICAgICAgICAgICAgICBsaW5lbmFtZSA9IHRoaXMuZXZhbFJlKGxpbmVuYW1lLCDmm7/mjaLlh73mlbApO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0YWJzLnB1c2gobGluZW5hbWUpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRhYnM7XFxuICAgIH0sXFxuICAgIGdldExpc3RzOiBmdW5jdGlvbihwYXJzZSwgc2hzb3J0KSB7XFxuICAgICAgICBzaHNvcnQgPSBzaHNvcnQgPyBzaHNvcnQgOiAnc2hzb3J0JztcXG4gICAgICAgIHZhciBsaXN0cyA9IFtdO1xcbiAgICAgICAgdmFyIGNvbnRzID0gW107XFxuICAgICAgICBpZiAodHlwZW9mIHBhcnNlLumAiembhiA9PSAnb2JqZWN0Jykge1xcbiAgICAgICAgICAgIGNvbnRzID0gcGFyc2Uu6YCJ6ZuGO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgY29udHMgPSBwZGZhKGh0bWwsIHBhcnNlLumAiembhik7XFxuICAgICAgICAgICAgfSBjYXRjaCB7XFxuICAgICAgICAgICAgICAgIHRvYXN0KCfpgInpm4blrprkvY3mnInor68nKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGxldCDmm7/mjaLlh73mlbAgPSAnJztcXG4gICAgICAgIHZhciDpgInpm4blkI3np7AgPSBwYXJzZS7pgInpm4blkI3np7AgPyBwYXJzZS7pgInpm4blkI3np7AgOiAnYSYmVGV4dCc7XFxuICAgICAgICBpZiAo6YCJ6ZuG5ZCN56ewLmluY2x1ZGVzKCdAQCcpKSB7XFxuICAgICAgICAgICAg6YCJ6ZuG5ZCN56ewID0gcGFyc2Uu6YCJ6ZuG5ZCN56ewLnNwbGl0KCdAQCcpWzBdO1xcbiAgICAgICAgICAgIOabv+aNouWHveaVsCA9IHBhcnNlLumAiembhuWQjeensC5zcGxpdCgnQEAnKVsxXTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHZhciDpgInpm4bpk77mjqUgPSBwYXJzZS7pgInpm4bpk77mjqUgPyBwYXJzZS7pgInpm4bpk77mjqUgOiAnYSYmaHJlZic7XFxuICAgICAgICB2YXIg6Kej5p6QID0gcGFyc2Uu6Kej5p6QID8gcGFyc2Uu6Kej5p6QIDogJyc7XFxuICAgICAgICB2YXIgdGVtcCA9IFtdO1xcblxcbiAgICAgICAgZm9yICh2YXIgaSBpbiBjb250cykge1xcbiAgICAgICAgICAgIGlmIChwYXJzZS7pgInpm4bliJfooaggIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJzZS7pgInpm4bliJfooaggPT0gJ29iamVjdCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3RzLnB1c2goY29udHNbaV0ubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB4LnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHgudXJsICsg6Kej5p6QLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdHMucHVzaChwZGZhKGNvbnRzW2ldLCBwYXJzZS7pgInpm4bliJfooagpLm1hcCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaCh4LCDpgInpm4blkI3np7ApLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBkKHgsIOmAiembhumTvuaOpSkgKyDop6PmnpAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gcGQoY29udHNbaV0sIOmAiembhumTvuaOpSk7XFxuICAgICAgICAgICAgICAgIGlmICgh6YCJ6ZuG6ZO+5o6lLmluY2x1ZGVzKCdocmVmJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IHBkZmgoY29udHNbaV0sIOmAiembhumTvuaOpSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChjb250c1tpXSwg6YCJ6ZuG5ZCN56ewKTtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSDmm7/mjaLlh73mlbAgIT0gJycgPyB0aGlzLmV2YWxSZSh0aXRsZSwg5pu/5o2i5Ye95pWwKSA6IHRpdGxlO1xcbiAgICAgICAgICAgICAgICB0ZW1wLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwgKyDop6PmnpAsXFxuIC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Btb2RlID8gbW9kZSA6IDE7XFxuXFxuICAgICAgICBsZXQgcGUgPSBbMV07XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHBlID0gcGFyc2UubWFwKHggPT4gcGRmYShodG1sLCB4Lue6v+i3rykubGVuZ3RoKS5maWx0ZXIoeSA9PiB5ID4gMCk7XFxuICAgICAgICB9IGNhdGNoIHt9XFxuXFxuXFxuICAgICAgICBwYXJzZS5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHRhYnMgPSBbJ+S4u+e6vyddO1xcbiAgICAgICAgICAgIGlmIChpdGVtLue6v+i3ryAhPSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgdGFicyA9IHRoaXMuZ2V0VGFicyhpdGVtKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcHV0TXlWYXIocGxheSArIGkgKyAnX3RhYnMnLCB0YWJzKTtcXG4gICAgICAgICAgICBpZiAoaXRlbS5BamF4KSB7XFxuICAgICAgICAgICAgICAgIGlmIChtb2RlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGFicyh0YWJzLCBpdGVtLuexu+WeiywgcGxheSArIGksIGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRUYWJzMih0YWJzLCBpdGVtLuexu+WeiywgcGxheSArIGksIGl0ZW0sIHBlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignZXJfaHRtbCcsIGh0bWwpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignZXJfdXJsJywgTVlfVVJMKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIGxpc3RzID0gZnVuYyhnZXRNeVZhcignZXJfJyArIGl0ZW0u57G75Z6LLCAnMCcpLCBNWV9VUkwpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBsaXN0cyA9IHRoaXMuZ2V0TGlzdHMoaXRlbSwgcGxheSArIGkpO1xcblxcblxcbiAgICAgICAgICAgICAgICBpZiAobGlzdHMuc29tZSh4ID0+IHgubGVuZ3RoID4gMCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChtb2RlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFRhYnModGFicywgaXRlbS7nsbvlnossIHBsYXkgKyBpLCBpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRUYWJzMih0YWJzLCBpdGVtLuexu+WeiywgcGxheSArIGksIGl0ZW0sIHBlKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2VyXycgKyBpdGVtLuexu+WeiyArICdmb2xkJywgJzEnKSA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgdGhpcy5zZXRMaXN0cyhsaXN0cywgZ2V0TXlWYXIoJ2VyXycgKyBpdGVtLuexu+WeiywgJzAnKSwgcGxheSArIGksIGl0ZW0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9XFxufVxcblxcblxcbmxldCBNZXRob2RzID0ge1xcbiAgICAvL+WkmumAieaooeWdl1xcbiAgICBNdWx0aVNlbGVjdE1vZGU6IGZ1bmN0aW9uKG5hbWUsIGlkLCBzaHNvcnQpIHtcXG4gICAgICAgIHJldHVybiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChkYXRhdGl0bGUsIGRhdGF1cmwsIHNoc29ydCkgPT4ge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIHVuaXF1ZShhcnIpIHtcXG4gICAgICAgICAgICAgICAgY29uc3QgcmVzID0gbmV3IE1hcCgpXFxuICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmlsdGVyKChhKSA9PiAhcmVzLmhhcyhhLnVybCkgJiYgcmVzLnNldChhLnVybCwgMSkpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBkdW9zZWxlY3QgPSBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQgKyBcXFwiX2R1b3NlbGVjdFxcXCIpID8gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0ICsgXFxcIl9kdW9zZWxlY3RcXFwiKSA6IFtdO1xcbiAgICAgICAgICAgIGlmIChkdW9zZWxlY3QuZmluZEluZGV4KHggPT4geC51cmwgPT09IGRhdGF1cmwpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGR1b3NlbGVjdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBkYXRhdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGRhdGF1cmxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgZHVvc2VsZWN0ID0gdW5pcXVlKGR1b3NlbGVjdClcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShkYXRhdXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAnOKAnOKAneKAnTxzcGFuIHN0eWxlPVxcXCJjb2xvcjojRkY1NzMzXFxcIj5gICsgZGF0YXRpdGxlLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVCeVZhbHVlKGFyciwgdmFsKSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcnJbaV1bJ3VybCddID09IHZhbCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVtb3ZlQnlWYWx1ZShkdW9zZWxlY3QsIGRhdGF1cmwpXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oZGF0YXVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGRhdGF0aXRsZVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoc2hzb3J0ICsgXFxcIl9kdW9zZWxlY3RcXFwiLCBkdW9zZWxlY3QpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgIH0sIG5hbWUsIGlkLCBzaHNvcnQpXFxuICAgIH0sXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pO35LqM57qn5pCc57SiXCIsXCJwYXRoXCI6XCJ0b29sXCIsXCJydWxlXCI6XCIvL3ZhciB0aXRsZSA9IHBhcnNlRG9tRm9ySHRtbChodG1sLCDmkJzntKLmoIfnrb4pO1xcbnZhciB0aXRsZSA9IE1ZX1BBUkFNUy50aXRsZTtcXG5sb2codGl0bGUpXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjRkYwMDAwXFxcIj4g6IGa5b2x4oiaPC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwOi8vaW1hZ2UuY29vbG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HZhciB1cmw9J2EnXFxuICAgICAgICAgICAgICBpZih4LumTvuaOpS5pbmNsdWRlcygnQEAnKSl7ICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgc3RhdGU9eC7pk77mjqUuc3BsaXQoJ0BAJylbMF1cXG4gICAgICAgICAgICAgICAgICB2YWx1ZT1wZGZoKHEseC7pk77mjqUuc3BsaXQoJ0BAJylbMV0pO1xcbiAgICAgICAgICAgICAgICAgIGlmKHgu6L2s5o2iPT10cnVlKXtcXG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGA8bGkgZGF0YS10eXBlPVxcXCIke3N0YXRlfVxcXCIgZGF0YS12YWw9XFxcIiR7dmFsdWV9XFxcIj48YSBocmVmPVxcXCJcXFwiPiR7dGl0bGV9PC9hPjwvbGk+YFxcbiAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYDxhIHR5cGU9XFxcIkBleHRyYVxcXCIgc3RhdGU9XFxcIiR7c3RhdGV9XFxcIiB2YWx1ZT1cXFwiJHt2YWx1ZX1cXFwiPiR7dGl0bGV9PC9hPmA7XFxuICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgaHJlZj1wZChxLHgu6ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgICByZXR1cm4gYDxhIGhyZWY9XFxcIiR7aHJlZn1cXFwiPiR7dGl0bGV9PC9hPmA7XFxuICAgICAgICAgICAgICB9XFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgICByZXR1cm4g5a6a5L2NO1xcbiAgICAgICAgfSk7XFxuICAgICAgIGNhdGVnb3JpZXMucHVzaCjkuIDnuqcuam9pbignXFxcXG4nKSk7XFxuICAgICAgICAgICAgfSk7ICAgICAgIFxcbiAgICB9XFxyXFxufcKgZWxzZcKge8KgwqDCoMKgwqBcXHJcXG4gICAgY2F0ZWdvcmllcyA9IHBk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1ZGVzKCdAQEAnKTpcXG4gICAgICAgICAgICAgICAgICAgIGpzb249e1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVswXSksXFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpOlxcbiAgICAgICAgICAgICAgICAgICAganNvbj17XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAganNvbj1wZChpdGVtLOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgIC8qdmFyIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzFdKSxcXG4gICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICA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RWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBvYmouY2wuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICB9LCBvYmopLFxcbiAgICAgICAgfSxcXG4gICAgICBdO1xcbiAgICB9LFxcbiAgICBjaGVja1BhcmFtKCkge1xcbiAgICAgIHZhciBvYmogPSB7fTtcXG4gICAgICBpZiAodGhpcy5wYWdlID09IDAgJiYgdHlwZW9mIHBhZ2UgPT0gXFxcInVuZGVmaW5lZFxcXCIpIHtcXG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl6aG156CBXFxcIik7XFxuICAgICAgfSBlbHNlIHtcXG4gICAgICAgIGlmICh0eXBlb2YgcGFnZSA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICBvYmpbXFxcIumhteeggVxcXCJdID0gdGhpcy5wYWdlO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHBhZ2U7XFxuICAgICAgICB9XFxuICAgICAgfVxcbiAgICAgIGlmICh0aGlzLmh0bWwgPT0gXFxcImVtcHR5XFxcIiAmJiB0eXBlb2YgaHRtbCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLor7fkvKDlhaXmupDnoIFcXFwiKTtcXG4gICAgICB9IGVsc2Uge1xcbiAgICAgICAgaWYgKHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgIG9ialtcXFwi5rqQ56CBXFxcIl0gPSB0aGlzLmh0bWw7XFxuICAg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ub3QoYTpub3QoW2hyZWZdKSlcXFwiO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIGlmICh4LuWwj+exuy5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShzLCB4LuWwj+exuyk7XFxuICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgc2xpc3QgPSBwZGZhKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICB2YXIg5a6a5L2NID0gc2xpc3QubWFwKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gdGhpcy5nZXRUaXRsZShpdGVtLCB4Luagh+mimCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIHgpO1xcbiAgICAgICAgICAgIHZhciBvYmogPSB7IHRpdGxlOiB0aXRsZSwgdXJsOiB1cmwgfTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkob2JqKTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIHJldHVybiDlrprkvY07XFxuICAgICAgICB9KTtcXG4gICAgICAgIC8vbG9nKOS4gOe6pylcXG4gICAgICAgIC8vbG9nKOS4gOe6py5sZW5ndGgpXFxuICAgICAgICBpZiAo5LiA57qnLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgIGNhdGVnb3JpZXMucHVzaCjkuIDnuqcuam9pbihcXFwiXFxcXG5cXFwiKSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICDkuIDnuqcuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChpdGVtLmpvaW4oXFxcIixcXFwiKSk7XFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9sb2coY2F0ZWdvcmllcylcXG4gICAgICB9KTtcXG4gICAgICBpZiAo5oqY5Y+g54q25oCBKSB7XFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT09IFxcXCIxXFxcIiA/IOaKmOWPoCA6IOWxleW8gCxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoXFxuICAgICAgICAgICAgICAoZm9sZCwgdSwgYWxsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX1JVTEUuZ3JvdXAsIGZvbGQgPT09IFxcXCIxXFxcIiA/IFxcXCIwXFxcIiA6IFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgIC8qYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTsqL1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgZm9sZCxcXG4gICAgICAgICAgICAgIOeKtuaAgSxcXG4gICAgICAgICAgICAgIOWFqOa4hVxcbiAgICAgICAgICAgICksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgbG9uZ0NsaWNrOiB0aGlzLmFjdGlvbih7XFxuICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcbiAgICAgICAgICAgICAgICBjbDog5riF6ZmkLFxcbiAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9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ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3UmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQganNvbj0nJ1xcbiAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICBcXG4gICAgICAgICAgICBsZXQgcGFyYW1zID0ge1xcbiAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICBjbGVhcnM6IOa4hemZpCxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAvL2xldCB1cmwgPSBwZChpdGVtLCBf5aSn57G76ZO+5o6lKTtcXG4gICAgICAgICAgICBsZXQgdXJsID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxuICAgICAgICAgICAgICB1cmwgPSDkuIDnuqfliIbnsbvlpITnkIYodXJsKTtcXG4gICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAvL2xvZyh1cmwpXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmFsbGNsZWFycy5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpO1xcbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgfSwgcGFyYW1zKSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChmb2xkID09PSBcXFwiMVxcXCIgfHwg5oqY5Y+g54q25oCBID09IGZhbHNlKSB7XFxuICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgIHZhciBleHRyYXBvcyA9IGZhbHNlO1xcbiAgICAgICAgICAgIC8qaWYgKGl0ZW0uaW5jbHVkZXMoJ3R5cGU9XFxcIkBleHRyYVxcXCInKSkge1xcbiAgICAgICAgICAgICAgZXh0cmFwb3MgPSB0cnVlO1xcbiAgICAgICAgICAgICAgLy9sb2coJ+mZhOWKoOWumuS9jScpXFxuICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgaWYgKGV4dHJhcG9zKSB7XFxuICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICB2YXIganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgdHlwZTogcGRmaChpdGVtLCBcXFwiYSYmc3RhdGVcXFwiKSxcXG4gICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwgXFxcImEmJnZhbHVlXFxcIiksXFxuICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAvL3ZhciB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKTtcXG4gICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0udGl0bGU7XFxuICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICB2YXIganNvbiA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgLypzd2l0Y2ggKHRydWUpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgLy8ganNvbiA9IHBkKGl0ZW0sIOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgIC8qdmFyIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzFdKSxcXG4gICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcbiAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTsqL1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBsZXQgcGFyYW1zID0ge1xcbiAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxuICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICBqc29uOiBqc29uLFxcbiAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgIGFsbGNsZWFyczog5YWo5riFLFxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHlcXFwiICsgXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaGVhZC5jYXRlXFxcIiwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpO1xcbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LCBwYXJhbXMpLFxcbiAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgIH0pO1xcbiAgICB9XFxuICAgIH0sXFxuICB9O1xcbiAgb2JqLumihOiuvihvcHRpb25zKTtcXG4gIHJldHVybiBvYmo7XFxufVxcblxcbiAgLy8u54q25oCBKFxcXCJ1cmxcXFwiKVxcbiAgLy8u55WM6Z2iKGQpXFxuICAvLy7mupDnoIEoeGh0bWwpXFxuICAvLy7lhajmuIUoW1xcXCIxXFxcIiwgXFxcIjJcXFwiXSlcXG4gIC8vLua4hemZpCgpXFxuICAvLy7lvIDlkK/mipjlj6AoKVxcbiAgLy8u6aG156CBKHBhZ2UpXFxuICAvLy7liJvlu7rliqjmgIHliIbnsbso5a6a5L2N5YiX6KGoKTtcXG5cXG5mdW5jdGlvbiBnZXRPYmpmdWMob2JqKSB7XFxuICBjb25zdCBtZXRob2RzID0gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMob2JqKS5maWx0ZXIoXFxuICAgIChuYW1lKSA9PiB0eXBlb2Ygb2JqW25hbWVdID09PSBcXFwiZnVuY3Rpb25cXFwiXFxuICApO1xcbiAgaWYgKG1ldGhvZHMubGVuZ3RoID09IDApIHtcXG4gICAgY29uc29sZS5sb2cob2JqLnRvU3RyaW5nKCkpO1xcbiAgICByZXR1cm47XFxuIC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ZW0oXFxcInBhZ2VsaW5lXFxcIik7XFxuICAgICAgICB2YXIgaWQgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciBjbHMgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciB0aXRsZSA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLnRpdGxlKTtcXG4gICAgICAgIHZhciBkZXNjID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuZGVzYyk7XFxuICAgICAgICB2YXIgaW1nID0gdGhpcy5pbWdIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgIGlkID0gXFxcImxhc3RpZF9cXFwiICsgcGFnZTtcXG4gICAgICAgICAgY2xzID0gXFxcImxhc3RtYXJrXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICB1cmw6IHVybCtsYXp5LFxcbiAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcbiAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgaWQ6IGlkLFxcbiAgICAgICAgICAgIGNsczogY2xzLFxcbiAgICAgICAgICB9LFxcbiAgICAgICAgfSk7XFxuICAgICAgICBpZiAoaSA9PSBsaXN0Lmxlbmd0aCAtIDEgJiYgc2hvdykge1xcbiAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgIGlkOiBcXFwicGFnZWxpbmVcXFwiLFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHNtYWxsPuWKoOi9veS4rS4uLjwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICBpZDogXFxcInBhZ2VudW1cXFwiLFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgIH0pO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgIHVwZGF0ZUl0ZW0oXFxcInBhZ2VudW1cXFwiLCB7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5Yiw5bqV5LqGPC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgIGlkOiBcXFwibGFzdFxcXCIsXFxuICAgICAgICB9LFxcbiAgICAgIH0pO1xcbiAgICB9XFxuICAgIGlmIChsaXN0Lmxlbmd0aCA9PSAwICYmIHBhZ2UgPT0gMSkge1xcbiAgICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZT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VSZXN1bHQoe1xcbiAgICBkYXRhOiBkXFxufSk7XCJ9XSIsImljb24iOiJodHRwczovLzRrZHlnLnRvcC9zdGF0aWMvZHMzL2ltZy9sb2dvLnBuZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment