xiaomianao666

小程序:福利吧Ⓜ️

Oct 6th, 2023
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@福利吧Ⓜ️@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi56aP5Yip5ZCn4pOC77iPIiwiYXV0aG9yIjoiIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSNmeUFsbCNmeXBhZ2UjaHR0cHM6Ly9mdWxpYmEyMDIzLm5ldCIsInZlcnNpb24iOjEsImNvbF90eXBlIjoibW92aWVfMV92ZXJ0aWNhbF9waWMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6ImFsbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuLy/ku6XkuIvmmK8g5YiX6KGo6Kej5p6Q6KeE5YiZ77yISlPvvIlcbnZhciByZXMgPSB7fTtcbnZhciBpdGVtID0gW107XG5cbi8vIHZhciB0eXBlPU1ZX1VSTC5zcGxpdCgnIycpWzFdO1xudmFyIHBhZ2U9TVlfVVJMLnNwbGl0KCcjJylbMl07XG52YXIgbVVybD1NWV9VUkwuc3BsaXQoJyMnKVszXTtcblxuaWYoZ2V0TXlWYXIoJ2Z1bGliYS50aXRsZUNvbG9yJyk9PVwiXCIpIHB1dE15VmFyKCdmdWxpYmEudGl0bGVDb2xvcicsXCIjRkE3Mjk4XCIpO1xuaWYoZ2V0TXlWYXIoJ2Z1bGliYS5kZXNjQ29sb3InKT09XCJcIikgcHV0TXlWYXIoJ2Z1bGliYS5kZXNjQ29sb3InLFwiIzcwODA5MFwiKTtcblxuaWYoZ2V0TXlWYXIoJ2Z1bGliYS5jYXRlZ29yeU51bScpPT1cIlwiKSBwdXR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VxuICAgICAgICAgICAgLnJlcGxhY2VXaXRoQ2FsbGJhY2soLzwoc291cmNlfHZpZGVvKShbXFxzXFxTXSo/KTxcXC8oc291cmNlfHZpZGVvKT4vZywgJzx2aWRlbyBkYXRhLXY+JywgdmlkZW9UYWdSZXBsYWNlbWVudDIpO1xuICAgICAgICAgICAgLy8gLnJlcGxhY2UoLzxwPjxcXC9wPi9nLCcnKTtcblxuXG5cbiAgICAgICAgbGV0IHRlbXAgPSBwYXJzZURvbUZvckh0bWwoZ2V0TmV3VGV4dChxdW90ZUNvbnRlbnQsJ2RpdicpLCAnVGV4dCcpO1xuICAgICAgICBpZihnZXRNeVZhcignZnVsaWJhLnNob3dNb2RlJyk9PSczJyl7XG4gICAgICAgICAgICBpZighdGVtcC5tYXRjaCgvXlxccyokLykpIGh0bWxMaXN0ICs9ICfil4cmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsnICsgdGVtcCArICc8YnI+JztcbiAgICAgICAgICAgIGlmKGo9PWNvbnRlbnRsaXN0Lmxlbmd0aC0xICYmIGh0bWxMaXN0ICE9PSAnJyl7XG4gICAgICAgICAgICAgICAgZC5wdXNoKHt0aXRsZTogaHRtbExpc3QsXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiBzaXplLFxuICAgICAgICAgICAgICAgICAgICBjbGljazogdHJ1ZVxuICAgICAgICAgICAgICAgIH19KTtcbiAgICAgICAgICAgICAgICBodG1sTGlzdCA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgIGlmKCF0ZW1wLm1hdGNoKC9eXFxzKiQvKSB8fCBxdW90ZUNvbnRlbnQuaW5jbHVkZXMoJ2Jsb2NrcXVvdGU+JykgfHwgKHF1b3RlQ29udGVudC5pbmNsdWRlcygnZGl2PicpICYmIHF1b3RlQ29udGVudC5tYXRjaCgvPChkaXYpKFtcXHNcXFNdKj8pPFxcLyhkaXYpPi9nKSA9PSBudWxsKSkgaHRtbExpc3QgKz0gcXVvdGVDb250ZW50O1xuICAgICAgICAgICAgaWYoaW1nbGlzdC5sZW5ndGggPiAwIHx8IGo9PWNvbnRlbnRsaXN0Lmxlbmd0aC0xKXtcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IHBhcnNlRG9tRm9ySHRtbChnZXROZXdUZXh0KGh0bWxMaXN0LCdkaXYnKSwgJ1RleHQnKTtcbiAgICAgICAgICAgICAgICBpZighdGVtcC5tYXRjaCgvXlxccyokLykgJiYgZ2V0TXlWYXIoJ2Z1bGliYS5zaG93TW9kZScpIT09JzEnKSBkLnB1c2goe3RpdGxlOiBodG1sTGlzdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IHNpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpY2s6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgIH19KTtcbiAgICAgICAgICAgICAgICBodG1sTGlzdCA9ICcnO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgaW1nbGlzdC5sZW5ndGg7IGsrKyl7XG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOmltZ2xpc3Rba10sXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6Z2V0TXlWYXIoJ2Z1bGliYS5icm93c2VyTGluaycpK2ltZ2xpc3Rba10sXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTpnZXRNeVZhcignZnVsaWJhLmJpZ0ltZycpLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGljazogdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9ICAgXG5cbiAgICAvL+WkjeadguaWh+acrC3nlLFIdG1s5qC85byPLeabv+aNouaOieWbvueJhy0tLeinhumikemTvuaOpeS5n+abv+aNouaOieeUqOafpeeci+inhumikeabv+S7oy0tLee9keermeWcsOWdgOS4jeeUqOabv+aNou+8jOebtOaOpeeUqFxuICAgIC8vIHF1b3RlQ29udGVudCA9IGdldE5ld1RleHQocXVvdGVDb250ZW50LCdkaXYnKTtcbiAgICAvLyBsZXQgdGVtcCA9IHBhcnNlRG9tRm9ySHRtbChnZXROZXdUZXh0KHF1b3RlQ29udGVudCwnZGl2JyksICdUZXh0Jyk7XG4gICAgLy8gaWYoIXF1b3RlQ29udGVudC5pbmNsdWRlcygnPVwiaHR0cCcpKSBxdW90ZUNvbnRlbnQgPSB0ZW1wO1xuICAgIC8vIGlmKCF0ZW1wLm1hdGNoKC9eXFxzKiQvKSkgZC5wdXNoKHt0aXRsZTogcXVvdGVDb250ZW50fSk7XG5cbiAgICAvL+a8q+eUu+aooeW8j1xuICAgIC8vIHZhciBwaWNzPVtdO1xuICAgIC8vZm9yIChsZXQgayA9IDA7IGsgPCBpbWdsaXN0Lmxlbmd0aDsgaysrKXtcbiAgICAvLyAgICAgcGljcy5wdXNoKGltZ2xpc3Rba10pO1xuICAgIC8vIH1cbiAgICAvLyBcInBpY3M6Ly9cIitwaWNzLmpvaW4oXCImJlwiKTtcblxuICAgIC8vIGlmKGltZ2xpc3QubGVuZ3RoPT0wKSBjb250aW51ZTtcbiAgICAvLyBmb3IgKGxldCBrID0gMDsgayA8IGltZ2xpc3QubGVuZ3RoOyBrKyspe1xuICAgIC8vICAgICBkLnB1c2goe1xuICAgIC8vICAgICAgICAgcGljX3VybDppbWdsaXN0W2tdLFxuICAgIC8vICAgICAgICAgdXJsOmltZ2xpc3Rba10sXG4gICAgLy8gICAgICAgICBjb2xfdHlwZTpnZXRNeVZhcignZnVsaWJhLmJpZ0ltZycpXG4gICAgLy8gICAgIH0pO1xuICAgIC8vIH1cbn1lbHNle1xuICAgIC8vIGlmKGdldE15VmFyKCdmdWxpYmEuc2hvd01vZGUnKT09JzEnKSBjb250ZW50ID0gR2V0SW1nVGFnQXJyYXkoY29udGVudCwvPGltZyhbXFxzXFxTXSo/KT4vZyk7XG4gICAgaWYoZ2V0TXlWYXIoJ2Z1bGliYS5zaG93TW9kZScpPT0nMScpe1xuICAgICAgICBsZXQgbWF0Y2hBcnJheSA9IGNvbnRlbnQubWF0Y2goLzxpbWcoW1xcc1xcU10qPyk+L2cpO1xuICAgICAgICBsZXQgaW1nbGlzdCA9ICcnO1xuICAgICAgICBpZiAobWF0Y2hBcnJheSAhPSBudWxsKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hdGNoQXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcGljID0gbWF0Y2hBcnJheVtpXSAucmVwbGFjZVdpdGhDYWxsYmFjaygvPGltZyhbXFxzXFxTXSo/KT4vZywgJzxpbWcgZGF0YS12PicsIGltZ1RhZ1JlcGxhY2VtZW50T25lKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC88c2hvd2ltZy9nLCAnPGltZycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYoZ2V0TXlWYXIoJ2Z1bGliYS5oaWRlSW1nJykgPT0gJzAnKSBkLnB1c2goe3RpdGxlOiBwaWMsXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiBzaXplLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICB9fSk7XG4gICAgICAgICAgICAgICAgaW1nbGlzdCArPSBwaWM7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYoZ2V0TXlWYXIoJ2Z1bGliYS5oaWRlSW1nJykgPT0gJzEnKSBkLnB1c2goe3RpdGxlOiBpbWdsaXN0LFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGljazogdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgfX0pO1xuICAgIH1lbHNle1xuICAgICAgICBjb250ZW50ID0gY29udGVudC5yZXBsYWNlV2l0aENhbGxiYWNrKC88aW1nKFtcXHNcXFNdKj8pPi9nLCAnPGltZyBkYXRhLXY+JywgaW1nVGFnUmVwbGFjZW1lbnRPbmUpXG4gICAgICAgICAgICAucmVwbGFjZSgvPHNob3dpbWcvZywgJzxpbWcnKVxuICAgICAgICAgICAgLnJlcGxhY2VXaXRoQ2FsbGJhY2soLzwoaWZyYW1lKShbXFxzXFxTXSo/KTxcXC8oaWZyYW1lKT4vZywgJzxsaW5rIGRhdGEtdj4nLCBsaW5rVGFnUmVwbGFjZW1lbnQyKVxuICAgICAgICAgICAgLnJlcGxhY2VXaXRoQ2FsbGJhY2soLzwoc291cmNlfHZpZGVvKShbXFxzXFxTXSo/KTxcXC8oc291cmNlfHZpZGVvKT4vZywgJzx2aWRlbyBkYXRhLXY+JywgdmlkZW9UYWdSZXBsYWNlbWVudDIpO1xuXG4gICAgICAgIGxldCBjb250ZW50bGlzdCA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICBsZXQgaHRtbExpc3QgPSAnJztcbiAgICAgICAgZm9yKGxldCBqPTA7ajxjb250ZW50bGlzdC5sZW5ndGg7aisrKXtcbiAgICAgICAgICAgIGxldCBxdW90ZUNvbnRlbnQgPSBjb250ZW50bGlzdFtqXTtcblxuICAgICAgICAgICAgbGV0IHRlbXAgPSBwYXJzZURvbUZvckh0bWwoZ2V0TmV3VGV4dChxdW90ZUNvbnRlbnQsJ2RpdicpLCAnVGV4dCcpO1xuICAgICAgICAgICAgaWYoZ2V0TXlWYXIoJ2Z1bGliYS5zaG93TW9kZScpPT0nMycpe1xuICAgICAgICAgICAgICAgIGlmKCF0ZW1wLm1hdGNoKC9eXFxzKiQvKSkgaHRtbExpc3QgKz0gJzxwPiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOycgKyB0ZW1wICsgJzwvcD4nO1xuICAgICAgICAgICAgICAgIGlmKGo9PWNvbnRlbnRsaXN0Lmxlbmd0aC0xICYmIGh0bWxMaXN0ICE9PSAnJyl7XG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7dGl0bGU6IGh0bWxMaXN0LFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiBzaXplLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xpY2s6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgfX0pO1xuICAgICAgICAgICAgICAgICAgICBodG1sTGlzdCA9ICcnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1lbHNle1xuICAgICAgICAgICAgICAgIGlmKCF0ZW1wLm1hdGNoKC9eXFxzKiQvKSB8fCBxdW90ZUNvbnRlbnQuaW5jbHVkZXMoJ2Jsb2NrcXVvdGU+JykgfHwgKHF1b3RlQ29udGVudC5pbmNsdWRlcygnZGl2PicpICYmIHF1b3RlQ29udGVudC5tYXRjaCgvPChkaXYpKFtcXHNcXFNdKj8pPFxcLyhkaXYpPi9nKSA9PSBudWxsKSkgaHRtbExpc3QgKz0gcXVvdGVDb250ZW50O1xuXG4gICAgICAgICAgICAgICAgaWYocXVvdGVDb250ZW50Lm1hdGNoKC88aW1nKFtcXHNcXFNdKj8pPi9nKSAhPT0gbnVsbCB8fCBqPT1jb250ZW50bGlzdC5sZW5ndGgtMSl7XG4gICAgICAgICAgICAgICAgICAgIGlmKGdldE15VmFyKCdmdWxpYmEuc2hvd01vZGUnKSE9PScxJyAmJiBodG1sTGlzdCAhPT0gJycpIGQucHVzaCh7dGl0bGU6IGh0bWxMaXN0LFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiBzaXplLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xpY2s6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgfX0pO1xuICAgICAgICAgICAgICAgICAgICBodG1sTGlzdCA9ICcnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZihxdW90ZUNvbnRlbnQubWF0Y2goLzxpbWcoW1xcc1xcU10qPyk+L2cpICE9PSBudWxsKSBkLnB1c2goe3RpdGxlOiBxdW90ZUNvbnRlbnQsXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiBzaXplLFxuICAgICAgICAgICAgICAgICAgICBjbGljazogdHJ1ZVxuICAgICAgICAgICAgICAgIH19KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cblxuXG5kLnB1c2goe2NvbF90eXBlOiAnbGluZV9ibGFuayd9KTtcbmxldCB0aXBzID0gJ+ivpeaWh+eroOadpea6kOS6juemj+WIqeWQp++8jOWmguaCqOWWnOasou+8jOivt+i/m+WFpeemj+WIqeWQp+e9kemhteeJiCc7XG5sZXQgd2FybmluZyA9ICfmraTop4TliJnku4XpmZDlrabkuaDkvb/nlKjvvIzlpoLmnInkuI3lpqXvvIzor7fmnKzlkKfkuLvogZTns7vmiJHliKDpmaQnO1xuXG4vLyBpZihnZXRNeVZhcignZnVsaWJhLnNob3dNb2RlJyk9PScwJyB8fCBnZXRNeVZhcignZnVsaWJhLnNob3dNb2RlJyk9PScyJyl7XG5pZihnZXRNeVZhcignZnVsaWJhLm9wZW5Db21tZW50Jyk9PScwJyl7XG4gICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXCJoaWtlcjovL3BhZ2UvY29tbWVudFwiKSkucnVsZSk7XG5cbiAgICBkLnB1c2goe3RpdGxlOiBHZXRUaXBzKHRpcHMsd2FybmluZyksXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiBzaXplLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICB9fSk7XG4gICAgZC5wdXNoKHtjb2xfdHlwZTogJ2xpbmVfYmxhbmsnfSk7XG5cbiAgICBpZihjb21tZW50Lmxlbmd0aCA+IDApe1xuICAgICAgICBsZXQgY29tbWVudE51bSA9IHBhcnNlRG9tRm9ySHRtbChodG1sLCcuYXJ0aWNsZS1tZXRhJiZzcGFuLDImJlRleHQnKS5yZXBsYWNlKCfor4TorronLCfwn5Oi54Ot6K+E5pWwJyk7XG4gICAgICAgIGNvbW1lbnROdW0gPSBHZXRIb21lKDMpK2dldFN0cm9uZ1RleHQoZ2V0QmlnVGV4dChjb21tZW50TnVtKSk7XG4gICAgICAgIGZvciAobGV0IGwgPSAwOyBsIDwgY29tbWVudC5sZW5ndGg7IGwrKyl7XG4gICAgICAgICAgICBsZXQgbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoY29tbWVudFtsXSwnLmNvbW1lbnQnKTtcbiAgICAgICAgICAgIGQucHVzaCh7Y29sX3R5cGU6ICdsaW5lJ30pO1xuXG4gICAgICAgICAgICBmb3IgKGxldCBtID0gMDsgbSA8IGxpc3QubGVuZ3RoOyBtKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgZmxvb3IgPSAnJzsgbGV0IG1haW4gPSAnJzsgIGxldCBhdXRvciA9ICcnOyBsZXQgdGltZSA9ICcnO1xuICAgICAgICAgICAgICAgIHRyeXtcbiAgICAgICAgICAgICAgICAgICAgaWYobT09MCkgZmxvb3IgPSAn8J+PoicgKyBwYXJzZURvbUZvckh0bWwobGlzdFttXSwnLmNvbXQtZiYmVGV4dCcpLnJlcGxhY2UoJyMnLCcnKSsn5qW8JztcbiAgICAgICAgICAgICAgICB9Y2F0Y2goZSl7XG4gICAgICAgICAgICAgICAgICAgIGZsb29yID0gbCsn5qW85bGC6ZSZ6K+vISEhJyttXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRyeXtcbiAgICAgICAgICAgICAgICAgICAgbWFpbiA9ICBwYXJzZURvbUZvckh0bWwobGlzdFttXSwnLmNvbXQtbWFpbiYmcCYmVGV4dCcpO1xuICAgICAgICAgICAgICAgIH1jYXRjaChlKXtcbiAgICAgICAgICAgICAgICAgICAgbWFpbiA9IGwrJ+WbnuWkjeWGheWuuemUmeivryEhIScrbVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0cnl7XG4gICAgICAgICAgICAgICAgICAgIGF1dG9yID0gJ/CfkbEnICsgcGFyc2VEb21Gb3JIdG1sKGxpc3RbbV0sJy5jb210LWF1dGhvciYmVGV4dCcpO1xuICAgICAgICAgICAgICAgIH1jYXRjaChlKXtcbiAgICAgICAgICAgICAgICAgICAgYXV0b3IgPSBsKyfkvZzogIXlkI3np7DplJnor68hISEnK21cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdHJ5e1xuICAgICAgICAgICAgICAgICAgICB0aW1lID0gJ/CflaInICsgcGFyc2VEb21Gb3JIdG1sKGxpc3RbbV0sJy5jb210LW1ldGEtLXNwYW4mJlRleHQnKS5yZXBsYWNlKCflm57lpI0nLCcnKTtcbiAgICAgICAgICAgICAgICB9Y2F0Y2goZSl7XG4gICAgICAgICAgICAgICAgICAgIHRpbWUgPSBsKyfml7bpl7TplJnor68hISEnK21cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsZXQgY29tbWVudFRleHQgPSBHZXRDb21tZW50KG1haW4sYXV0b3IsdGltZSxmbG9vcik7XG4gICAgICAgICAgICAgICAgaWYobD09MCAmJiBtPT0wKSBjb21tZW50VGV4dCA9IGNvbW1lbnROdW0gKyc8YnI+PGJyPicrIGNvbW1lbnRUZXh0O1xuXG4gICAgICAgICAgICAgICAgY29tbWVudFRleHQ9Y29tbWVudFRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZVdpdGhDYWxsYmFjaygvKGh0dHA6XFwvXFwvfGZ0cDpcXC9cXC98aHR0cHM6XFwvXFwvfClbXFx3XFwtX10rKFxcLltcXHdcXC1fXSspKyhbXFx3XFwtXFwuLEA/Xj0lJmFtcDs6L35cXCsjXSpbXFx3XFwtXFxAP149JSZhbXA7L35cXCsjXSk/L2csICc8biBkYXRhLXY+JywgbnVsbFRhZ1JlcGxhY2VtZW50MilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZVdpdGhDYWxsYmFjaygvPGEoLio/KSBocmVmPVwiKC4qPylhbGl5dW5kcml2ZSguKj8pXCIoLio/KTxcXC9hPi9nLCAnPGEgZGF0YS12PicsIGFUYWdSZXBsYWNlbWVudDIpO1xuICAgICAgICAgICAgICAgIGQucHVzaCh7dGl0bGU6IGNvbW1lbnRUZXh0LFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgY2xpY2s6IHRydWVcbiAgICAgICAgICAgICAgICB9fSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59XG5cbnJlcy5kYXRhPWQ7XG5zZXRIb21lUmVzdWx0KHJlcyk7Iiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6IioiLCJ1YSI6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