Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@来看点播@eyJmaXJzdEhlYWRlciI6ImNsYXNzIiwibGFzdF9jaGFwdGVyX3J1bGUiOiIiLCJ0aXRsZSI6Iuadpeeci+eCueaSrSIsImF1dGhvciI6IuW/g+mtlCIsInVybCI6Imhpa2VyOi8vZW1wdHkjI2h0dHBzOi8vbGt2b2QubWUvc2hvdy8xLS0tLS0tLS1meXBhZ2UtLS0uaHRtbCIsInZlcnNpb24iOjIsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidmlkZW8iLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG52YXIgZ2V0UmFuZ2VDb2xvcnMgPSBmdW5jdGlvbigpIHtcbiAgICByZXR1cm4gJyMnICsgKCcwMDAwMCcgKyAoTWF0aC5yYW5kb20oKSAqIDB4MTAwMDAwMCA8PCAwKS50b1N0cmluZygxNikpLnN1YnN0cigtNik7XG59XG5cbmNvbnN0IOWIhuexu+minOiJsiA9IGdldFJhbmdlQ29sb3JzKClcbmNvbnN0IOWkp+exu+WumuS9jSA9ICdib2R5JiYuaGVhZC1tb3JlJ1xuY29uc3Qg5ou85o6l5YiG57G7ID0gJ2JvZHkmJi5zd2lwZXItd3JhcHBlciwzOjgnXG5jb25zdCDlsI/nsbvlrprkvY0gPSAnYm9keSYmYTpub3QoOm1hdGNoZXMo6aaW6aG1fOS7iuaXpeabtOaWsHzng63mppx8QVBQfOemj+WIqXzng6185o6S6KGMfOeVmSkpJ1xuY29uc3Qg5YiG57G75qCH6aKYID0gJ2EmJlRleHQnXG5jb25zdCDliIbnsbvpk77mjqUgPSA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9tZ3R2fHNvaHUvLnRlc3QocGxheVVybCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybCArIFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApfVwiO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvYmlsaS8udGVzdChwbGF5VXJsKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwbGF5VXJsICsgXCI7e1VzZXItQWdlbnRATW96aWxsYS81LjAmJlJlZmVyZXJAaHR0cHM6Ly93d3cuYmlsaWJpbGkuY29tfVwiO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvaXhpZ3VhLy50ZXN0KHBsYXlVcmwpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmwgKyBcIiNpc1ZpZGVvPXRydWUjXCIgKyBcIiMubXA0O3tSZWZlcmVyQGh0dHBzOi8vd3d3Lml4aWd1YS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVwiO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBodG1sID0gcmVxdWVzdChpbnB1dCwge30pO1xuICAgICAgICB2YXIgcGxheWVyX2RhdGEgPSBKU09OLnBhcnNlKGh0bWwubWF0Y2goL3IgcGxheWVyXy4qPz0oLio/KTwvKVsxXSk7XG4gICAgICAgIHZhciBmcm8gPSBwbGF5ZXJfZGF0YS5mcm9tO1xuICAgICAgICB2YXIgcGxheVVybCA9IHBsYXllcl9kYXRhLnVybDtcblxuXG4gICAgICAgIGlmIChwbGF5ZXJfZGF0YS5lbmNyeXB0ID09ICcxJykge1xuICAgICAgICAgICAgcGxheVVybCA9IHVuZXNjYXBlKHBsYXllcl9kYXRhLnVybCk7XG4gICAgICAgIH0gZWxzZSBpZiAocGxheWVyX2RhdGEuZW5jcnlwdCA9PSAnMicpIHtcbiAgICAgICAgICAgIHBsYXlVcmwgPSB1bmVzY2FwZShiYXNlNjREZWNvZGUocGxheWVyX2RhdGEudXJsKSk7XG4gICAgICAgIH07XG4gICAgICAgIHZhciBleGNsdWRlID0gL3BsYXltM3U4fG0zdThcXC50dnxtaW5cXC5jc3N8NDA0XFwubTN1OHxcXC5jc3MvO1xuICAgICAgICB2YXIgY29udGFpbiA9IC9cXC5tcDR8XFwubTN1OHxcXC5mbHZ8XFwuYXZpfFxcLm1wZWd8XFwud212fFxcLm1vdnxcXC5ybXZifFxcLmRhdHxxcUJGZG93bmxvYWR8bWltZT12aWRlbyUyRnx2aWRlb19tcDQvO1xuICAgICAgICBpZiAoIWV4Y2x1ZGUudGVzdChwbGF5VXJsKSAmJiBjb250YWluLnRlc3QocGxheVVybCkpIHtcbiAgICAgICAgICAgIHJldHVybiB0b1VybChwbGF5VXJsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBqeFVybCA9ICcnO1xuICAgICAgICB2YXIganhIdG1sID0gcmVxdWVzdChqeFVybCwge1xuICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgIFwiVXNlci1BZ2VudFwiOiBcIk1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtZXRob2Q6IFwiR0VUXCJcbiAgICAgICAgfSk7XG4gICAgICAgIGV2YWwoanhIdG1sLm1hdGNoKC92YXIgY29uZmlnID0ge1tcXHNcXFNdKj99LylbMF0gKyBcIlwiKTtcbiAgICAgICAgdmFyIGFwaVVybCA9ICcnO1xuICAgICAgICB2YXIgYXBpSHRtbCA9IHJlcXVlc3QoYXBpVXJsLCB7XG4gICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgXCJVc2VyLUFnZW50XCI6IFwiTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMClcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJvZHk6IFwidXJsPVwiICsgY29uZmlnLnVybCArIFwiJnRpbWU9XCIgKyBjb25maWcudGltZSArIFwiJmtleT1cIiArIGNvbmZpZy5rZXksXG4gICAgICAgICAgICBtZXRob2Q6IFwiUE9TVFwiXG4gICAgICAgIH0pO1xuICAgICAgICB2YXIganNvbiA9IEpTT04ucGFyc2UoYXBpSHRtbCk7XG4gICAgICAgIGlmIChqc29uLmNvZGUgPT0gMjAwKSB7XG4gICAgICAgICAgICBwbGF5VXJsID0ganNvbi51cmw7XG4gICAgICAgICAgICByZXR1cm4gdG9VcmwocGxheVVybCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJyArIGpzb24ubXNnO1xuICAgICAgICB9XG5cbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIC8vc2V0RXJyb3IoZSk7XG4gICAgICAgIHNob3dMb2FkaW5nKFwi5q2j5Zyo6L+b6KGM5qOA57Si77yM6K+356iN5YCZLi4uXCIpO1xuICAgICAgICB2YXIgdmlkZW8gPSAneDVSdWxlOi8vJyArIGlucHV0ICsgJ0AnICsgJC50b1N0cmluZygoKSA9PiB7XG4gICAgICAgICAgICAvL2ZiYS5sb2coZmJhLmdldFVybHMoKSlcbiAgICAgICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKVxuICAgICAgICAgICAgdmFyIGV4Y2x1ZGUgPSAvcGxheW0zdTh8bTN1OFxcLnR2fG1pblxcLmNzc3w0MDRcXC5tM3U4fFxcLmNzcy87XG4gICAgICAgICAgICB2YXIgY29udGFpbiA9IC9cXC5tcDR8XFwubTN1OHxcXC5mbHZ8XFwuYXZpfFxcLm1wZWd8XFwud212fFxcLm1vdnxcXC5ybXZifFxcLmRhdHxxcUJGZG93bmxvYWR8bWltZT12aWRlbyUyRnx2aWRlb19tcDQvO1xuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiB1cmxzKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFleGNsdWRlLnRlc3QodXJsc1tpXSkgJiYgY29udGFpbi50ZXN0KHVybHNbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGZ5X2JyaWRnZV9hcHAubG9nKHVybHNbaV0pXG4gICAgICAgICAgICAgICAgICAgIGlmICgvbWd0dnxzb2h1Ly50ZXN0KHVybHNbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsc1tpXSArIFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApfVwiO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9iaWxpLy50ZXN0KHVybHNbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsc1tpXSArIFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wJiZSZWZlcmVyQGh0dHBzOi8vd3d3LmJpbGliaWxpLmNvbX1cIjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvaXhpZ3VhLy50ZXN0KHVybHNbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsc1tpXSArIFwiI2lzVmlkZW89dHJ1ZSNcIiArIFwiIy5tcDQ7e1JlZmVyZXJAaHR0cHM6Ly93d3cuaXhpZ3VhLmNvbS8mJlVzZXItQWdlbnRATW96aWxsYS81LjB9XCI7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsc1tpXVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZpZGVvO1xuICAgIH1cbn0pO1xuXG4vL+e6v+i3r+WQjeWIl+ihqOeahOWumuS9jVxudmFyIGFydHMgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5LS0uc3dpcGVy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AnYSYmVGV4dCcpLnJlcGxhY2UoL+esrHzpm4Z86K+dfOacny9nLCAnJyksXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJykgKyBsYXp5LFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGxpc3QubGVuZ3RoID4gNCA/ICd0ZXh0XzUnIDogJ3RleHRfMidcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSAnaGlrZXI6Ly9wYWdlL3B1c2g/cHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwibmFtZVwiOiBnZXRQYWdlVGl0bGUoKSArIHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAnYSYmVGV4dCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJwaWNcIjogcGFyc2VEb20oaHRtbCwgJy5sYXp5bG9hZCYmZGF0YS1zcmN8fGRhdGEtb3JpZ2luYWwnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiY29udGVudFwiOiBwYXJzZURvbUZvckh0bWwoaHRtbCwgJy52aWRlby1pbmZvLWNvbnRlbnQmJlRleHQnKS5yZXBsYWNlKCfmlLbotbcnLCAnJyksXG4gICAgICAgICAgICAgICAgICAgICAgICBcImZyb21cIjogZ2V0UGFnZVRpdGxlKCkgKyBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidXJsXCI6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJylcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJylcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKS5yZXBsYWNlKC/nrKx86ZuGfOivnXzmnJ8vZywgJycpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmx4LFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGxpc3QubGVuZ3RoID4gNCA/ICd0ZXh0XzUnIDogJ3RleHRfMicsXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmF4XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgICAgIHRpdGxlOiAn5rKh5pyJ6YCJ6ZuG5ZOf77yM5LiN5L+h54K55Zu+54mH5Y6755yL55yL8J+RgCcsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRmcHVzaCA9PSAnMCcpIHtcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKS5yZXBsYWNlKC/nrKx86ZuGfOivnXzmnJ8vZywgJycpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwYXJzZURvbShsaXN0W2pdLCAnYSYmaHJlZicpICsgbGF6eSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBsaXN0Lmxlbmd0aCA+IDQgPyAndGV4dF81JyA6ICd0ZXh0XzInXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmx4ID0gJ2hpa2VyOi8vcGFnZS9wdXNoP3B1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBcIm5hbWVcIjogZ2V0UGFnZVRpdGxlKCkgKyBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwicGljXCI6IHBhcnNlRG9tKGh0bWwsICcubGF6eWxvYWQmJmRhdGEtc3JjfHxkYXRhLW9yaWdpbmFsJyksXG4gICAgICAgICAgICAgICAgICAgICAgICBcImNvbnRlbnRcIjogcGFyc2VEb21Gb3JIdG1sKGh0bWwsICcudmlkZW8taW5mby1jb250ZW50JiZUZXh0JykucmVwbGFjZSgn5pS26LW3JywgJycpLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJmcm9tXCI6IGdldFBhZ2VUaXRsZSgpICsgcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdhJiZUZXh0JyksXG4gICAgICAgICAgICAgICAgICAgICAgICBcInVybFwiOiBwYXJzZURvbShsaXN0W2pdLCAnYSYmaHJlZicpXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYXJzZURvbShsaXN0W2pdLCAnYSYmaHJlZicpXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdhJiZUZXh0JykucmVwbGFjZSgv56ysfOmbhnzor5185pyfL2csICcnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJseCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBsaXN0Lmxlbmd0aCA+IDQgPyAndGV4dF81JyA6ICd0ZXh0XzInLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJheFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICfmsqHmnInpgInpm4blk5/vvIzkuI3kv6Hngrnlm77niYfljrvnnIvnnIvwn5GAJyxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgfVxufVxuc2V0VGFicyh0YWJzLCBNWV9VUkwpO1xuc2V0TGlzdHMobGlzdHMsIGdldFZhcihNWV9VUkwsICcwJykpO1xuZC5wdXNoKHtcbiAgICB0aXRsZTogJzxicj4nLFxuICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xufSk7XG5zZXRSZXN1bHQoZCk7Iiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6IioiLCJ1YSI6Im1vYmlsZSIsInByZVJ1bGUiOiIiLCJwYWdlcyI6Ilt7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwidHNcIixcInBhdGhcIjpcInB1c2hcIixcInJ1bGVcIjpcImpzOlxcbmxldCBpdGVtcyA9IFtdO1xcbmxldCBwdXNoaW4gPSBkZWNvZGVVUklDb21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NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogJyArIOWIhuexu+minOiJsiArICdcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChmb2xkID09PSAnMScpIHtcXG4gICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAnICsg5YiG57G76aKc6ImyICsgJ1xcXCI+JyArIHRpdGxlICsgJzwvc3Bhbj48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5cIn1dIiwiaWNvbiI6Imh0dHBzOi8vbGt2b2QudXMvbXh0aGVtZS9pbWFnZXMvZmF2aWNvbi5wbmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment