xiaomianao666

小程序:6V新版α

Nov 23rd, 2023
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@6V新版α@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxudmFyIGNocCA9IFtdO1xudHJ5IHtcbiAgICB2YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcbiAgICB2YXIgY29udHMgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiYuc3R1aS1jb250ZW50X19wbGF5bGlzdCcpO1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29udHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGNvbnRzW2ldLCAnYm9keSYmbGknKTtcbiAgICAgICAgY2hwLnB1c2gobGlzdC5sZW5ndGgpO1xuICAgIH0gICAgIFxufSBjYXRjaCAoZSkge31cbnNldFJlc3VsdCgn5pu05paw6IezOicgKyAoTWF0aC5tYXguYXBwbHkobnVsbCwgY2hwKSkpOyIsInRpdGxlIjoiNlbmlrDniYjOsSIsImF1dGhvciI6IlIiLCJ1cmwiOiJodHRwOi8vd3d3LnhiNnYuY29tL2Z5QWxsL2luZGV4X2Z5cGFnZS5odG1sW2ZpcnN0UGFnZT1odHRwOi8vd3d3LnhiNnYuY29tL2Z5QWxsXSIsInZlcnNpb24iOjIwMjMwNjI3LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoi5o6o6I2QJuWWnOWJp+eJhybliqjkvZzniYcm54ix5oOF54mHJuenkeW5u+eJhybmgZDmgJbniYcm5Ymn5oOF54mHJuaImOS6ieeJhyIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiZ4aWp1cGlhbiZkb25nenVvcGlhbiZhaXFpbmdwaWFuJmtlaHVhbnBpYW4ma29uZ2J1cGlhbiZqdXFpbmdwaWFuJnpoYW56aGVuZ3BpYW4iLCJh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mNoaWQnKTtcbiAgICBsZXQgYm9keSA9IHtcbiAgICAgICAgc2hvdzogJ3RpdGxlJyxcbiAgICAgICAgdGVtcGlkOiAxLFxuICAgICAgICB0Ym5hbWU6ICdhcnRpY2xlJyxcbiAgICAgICAgbWlkOiAxLFxuICAgICAgICBkb3Bvc3Q6ICdzZWFyY2gnLFxuICAgICAgICBzdWJtaXQ6ICcnLFxuICAgICAgICBrZXlib2FyZDoga2V5LFxuICAgIH1cblxuICAgIHZhciByZXN1bHQgPSBwb3N0KCdodHRwOi8vd3d3LnhiNnYuY29tL2Uvc2VhcmNoL2luZGV4LnBocCcsIHtcbiAgICAgICAgYm9keTogYm9keSxcbiAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgb3JpZ2luOiAnaHR0cDovL3d3dy54YjZ2LmNvbScsXG4gICAgICAgICAgICByZWZlcmVyOiAnaHR0cDovL3d3dy54YjZ2LmNvbScsXG4gICAgICAgIH0sXG4gICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlLFxuICAgIH0pXG4gICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpO1xuICAgIGlmICghcmVzdWx0LnVybC5pbmNsdWRlcygnc2VhcmNoaWQnKSkge1xuICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgdGl0bGU6ICfml6DnrKblkIjnu5PmnpwnLFxuICAgICAgICB9KVxuICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hpZCcpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHB1dE15VmFyKCdzZWFyY2hpZCcsIHJlc3VsdC51cmwpO1xuICAgIH1cbn1cblxudmFyIHVybCA9IGdldE15VmFyKCdzZWFyY2hpZCcsICcnKTtcbmlmICh1cmwgIT0gJycpIHtcbiAgICB2YXIgcCA9IE1ZX1BBR0UgPiAxID8gJyZwYWdlPScgKyBNWV9QQUdFIDogJyc7XG4gICAgbG9nKHVybCtwKVxuICAgIHZhciBodG1sID0gZmV0Y2godXJsICsgcCk7X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G9tKS5mb3JFYWNoKChrKT0+IHtcXG4gICAgICB0aGlzW2tdPWN1c3RvbVtrXSA7XFxuICAgIH0pXFxufVxcbiBcXG5sZXQgRXJqaSA9IHtcXG4gICAg6YCa5YWNOiAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KS5tYXRjaCgvciBwbGF5ZXJfLio/PSguKj8pPC8pWzFdKVxcbiAgICAgICAgICAgIHZhciB1cmwgPSBodG1sLnVybFxcbiAgICAgICAgICAgIGlmIChodG1sLmVuY3J5cHQgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVuZXNjYXBlKHVybCk7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChodG1sLmVuY3J5cHQgPT0gJzInKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVuZXNjYXBlKGJhc2U2NERlY29kZSh1cmwpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKC9tM3U4fG1wNC8udGVzdCh1cmwpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInZpZGVvOi8vXFxcIiArIGlucHV0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidmlkZW86Ly9cXFwiICsgaW5wdXRcXG4gICAgICAgIH1cXG4gICAgfSksXFxuICAgIHVwZGF0YTogZnVuY3Rpb24ocnVsZSkge1xcbiAgICAgICAgc2V0TGFzdENoYXB0ZXJSdWxlKCdqczonICsgJC50b1N0cmluZygodXJsLHJ1bGUpID0+IHtcXG4gICAgICAgICAgICB2YXIgaHRtbD1mZXRjaCh1cmwpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChldmFsKHJ1bGUpKVxcbiAgICAgICAgfSxNWV9VUkwsIHJ1bGUpKVxcbiAgICB9LFxcbiAgICBjbG9zZTogZnVuY3Rpb24obGlzdCwgc29ydHMpIHtcXG4gICAgICAgIGFkZExpc3RlbmVyKCdvbkNsb3NlJywgJC50b1N0cmluZygobGlzdCwgc29ydHMpID0+IHtcXG4gICAgICAgICAgICBsaXN0Lm1hcCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignZXJfJyArIHggKyAnZm9sZCcpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdlcl8nK3gpO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzb3J0czsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3BsYXlsaXN0XycgKyBpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignZXJfcGxheWxpc3RzJyk7XFxuICAgICAgICB9LCBsaXN0LCBzb3J0cykpXFxuICAgIH0sXFxuICAgIGRhdGFDb252ZXJ0OiBmdW5jdGlvbihkYXRhKSB7XFxuICAgICAgICB2YXIgbmV3Y2xzbGlzdCA9IGRhdGEubWFwKGZ1bmN0aW9uKG9iaikge1xcbiAgICAgICAgICAgIHZhciBuZXdPYmogPSBPYmplY3QuYXNzaWduKHt9LCBvYmopO1xcbiAgICAgICAgICAgIGlmIChuZXdPYmouaGFzT3duUHJvcGVydHkoJ3R5cGUnKSkge1xcbiAgICAgICAgICAgICAgICBuZXdPYmouY29sX3R5cGUgPSBuZXdPYmoudHlwZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIG5ld09iajtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIG5ld2Nsc2xpc3Q7XFxuICAgIH0sXFxuICAgIHByZUxvYWQ6IGZ1bmN0aW9uKGZ1bmMpIHtcXG4gICAgICAgIGxldCBteWZ1bmM9bnVsbFxcbiAgICAgICAgaWYoZnVuYyE9dW5kZWZpbmVkJiZmdW5jLmNvbnN0cnVjdG9yPT1GdW5jdGlvbil7XFxuICAgICAgICAgICAgbXlmdW5jPWZ1bmNcXG4gICAgICAgIH1cXG4gICAgICAgICQuZXh0ZW5kKHtcXG4gICAgICAgICAgICBkYXRhQ29udmVydDogdGhpcy5kYXRhQ29udmVydCxcXG4gICAgICAgICAgICBtc206TWV0aG9kcy5NdWx0aVNlbGVjdE1vZGUsXFxuICAgICAgICAgICAgZnVuYzpteWZ1bmMsXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBzbWFsbDogZnVuY3Rpb24oc3RyLCBjb2xvcikge1xcbiAgICAgICAgcmV0dXJuICfigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9XFxcIicgKyAoY29sb3IgfHwgJycpICsgJ1xcXCI+JyArIHN0ciArICc8L2ZvbnQ+PC9zbWFsbD4nO1xcbiAgICB9LFxcbiAgICDlo7DmmI46IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGhpcy5zbWFsbCgn5Lul5LiK5pWw5o2u5p2l5rqQ5LqO572R57uc77yM5aaC5oKo5Zac5qyi77yM6K+35pSv5oyB5a6Y5pa577yBJywgJyM4NzFGNzgnKSxcXG4gICAgICAgICAgICBkZXNjOiB0aGlzLnNtYWxsKCfmraTop4TliJnku4XpmZDlrabkuaDkuqTmtYHkvb/nlKjvvIzor7fkuo7lr7zlhaXlkI4yNOWwj+aXtuWGheWIoOmZpO+8jOS7u+S9lee7hOe7h+aIluS4quS6uuS4jeW+l+S7peS7u+S9leaWueW8j+aWueazleS8oOaSreatpOinhOWImeeahOaVtOS9k+aIlumDqOWIhu+8gScsICcjRjIwQzAwJyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2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ChpKSA+IDI1NSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGVuICs9IDI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZW4rKztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gbWF4TGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RyLnNsaWNlKDAsIGkpICsgJy4uLic7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHN0cjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBzZGVzYyA9IHN1YnN0cihkZXNjLCBudW0pO1xcbiAgICAgICAgdmFyIGxhenkgPSAkKGAjbm9Mb2FkaW5nI2ApLmxhenlSdWxlKChkYywgc2RjLCBtKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHNob3cgPSBzdG9yYWdlMC5nZXRJdGVtKG0sICcwJyk7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gZmluZEl0ZW0oJ2Rlc2MnKS50aXRsZTtcXG4gICAgICAgICAgICB2YXIgcmUgPSAvKDxcXFxcL3NtYWxsPjxicj4uKj8+KS4rL2c7XFxuICAgICAgICAgICAgdmFyIGV4cCA9ICflsZXlvIA6JztcXG4gICAgICAgICAgICB2YXIgcmV0ID0gJ+aUtui1tzonO1xcbiAgICAgICAgICAgIGlmIChzaG93ID09ICcxJykge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCdkZXNjJywge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UocmV0LCBleHApXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UocmUsICckMScgKyBzZGMgKyAnPC9zbWFsbD4nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oPFxcXFwvc21hbGw+PGJyPjxmb250IGNvbG9yPVxcXCIpLio/KFxcXCI+KS8sICckMSM4QTJCRTIkMicpLy/mlLbotbfpopzoibJcXG5cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShtLCAnMCcpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2Rlc2MnLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShleHAsIHJldClcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZSwgJyQxJyArIGRjICsgJzwvc21hbGw+JylcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvKDxcXFxcL3NtYWxsPjxicj48Zm9udCBjb2xvcj1cXFwiKS4qPyhcXFwiPikvLCAnJDEjMDA4MDAwJDInKS8v5bGV5byA6aKc6ImyXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0obSwgJzEnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIGBoaWtlcjovL2VtcHR5YFxcbiAgICAgICAgfSwgZGVzYywgc2Rlc2MsIG1hcmspXFxuICAgICAgICB2YXIgc2MgPSBzdG9yYWdlMC5nZXRJdGVtKG1hcmssICcwJykgPT0gJzAnID8gJ+WxleW8gDonIDogJ+aUtui1tzonO1xcbiAgICAgICAgdmFyIGRjID0gc3RvcmFnZTAuZ2V0SXRlbShtYXJrLCAnMCcpID09ICcwJyA/IHNkZXNjIDogZGVzYztcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJycgKyAnPGI+PGZvbnQgY29sb3I9XFxcIiMwOThBQzFcXFwiPuKItyAg5Ymn5oOF566A5LuLXFx0PC9mb250PjwvYj4nICsgXFxcIjxzbWFsbD48YSBzdHlsZT0ndGV4dC1kZWNvcmF0aW9uOiBub25lOycgaHJlZj0nXFxcIiArIGxhenkgKyBcXFwiJz5cXFwiICsgc2MgKyAnPC9hPjwvc21hbGw+PGJyPjxmb250IGNvbG9yPVxcXCIjOEEyQkUyXFxcIj4nICsgYCR7ZGN9YCArICc8L3NtYWxsPicsLy/pu5jorqTpopzoibJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6ICdkZXNjJyxcXG4gICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDYsXFxuICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNSxcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IHRydWUsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSxcXG5cXG4vL+a1t+aKpVxcbiAgICBzdHJDb252ZXJ0OiBmdW5jdGlvbihhcnIpIHtcXG4gICAgICAgIHJldHVybiBhcnIubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHN0ciA9IHg7XFxuICAgICAgICAgICAgaWYgKC8o5a+85ryUfOS4u+a8lHznsbvlnosp77yaLy50ZXN0KHN0cikpIHtcXG4gICAgICAgICAgICAgICAgc3RyID0gc3RyLnNwbGl0KCcvJykubWFwKCh2YWwsIGluZGV4KSA9PiAoaW5kZXggPT09IDAgPyAnJyA6ICcnKSArIHZhbCkuc2xpY2UoMCwgNSkuam9pbignICcpLnJlcGxhY2UoLyAkLywgJycpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gc3RyXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBzZXRDb250ZW50OiBmdW5jdGlvbihvYmopIHtcXG4gICAgICAgIHZhciBjb250ZW50cyA9IG9iai5tYWluO1xcbiAgICAgICAgdmFyIHNvcnRPcmRlciA9IG9iai5zb3J0O1xcbiAgICAgICAgdmFyIGltZyA9IG9iai5pbWc7XFxuICAgICAgICB2YXIgdGV4dHMgPSBjb250ZW50cy5tYXAoeCA9PiBwZGZoKHgsICdUZXh0JykpO1xcbiAgICAgICAgdmFyIGFycmF5ID0gdGV4dHMuc29ydCgoYSwgYikgPT4ge1xcbiAgICAgICAgICAgIGNvbnN0IGluZGV4QSA9IHNvcnRPcmRlci5pbmRleE9mKGEuc3Vic3RyKDAsIDIpKTtcXG4gICAgICAgICAgICBjb25zdCBpbmRleEIgPSBzb3J0T3JkZXIuaW5kZXhPZihiLnN1YnN0cigwLCAyKSk7XFxuICAgICAgICAgICAgcmV0dXJuIGluZGV4QSAtIGluZGV4QjtcXG4gICAgICAgIH0pXFxuICAgICAgICB2YXIgcmVnZXggPSBuZXcgUmVnRXhwKCcoJyArIHNvcnRPcmRlci5qb2luKCd8JykgKyAnKScpO1xcbiAgICAgICAgYXJyYXkgPSBhcnJheS5maWx0ZXIoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgICAgIHJldHVybiByZWdleC50ZXN0KGl0ZW0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBhcnJheSA9IHRoaXMuc3RyQ29udmVydChhcnJheSlcXG4gICAgICAgIHZhciB0aXRsZXMgPSBbXTtcXG4gICAgICAgIHZhciBkZXNjcyA9IFtdO1xcbiAgICAgICAgc3dpdGNoIChhcnJheS5sZW5ndGgpIHtcXG4gICAgICAgICAgICBjYXNlIDQ6XFxuICAgICAgICAgICAgY2FzZSA1OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAyKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgyKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSA2OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAzKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgzKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignZXJfaW5mbycse1xcbiAgICAgICAgICBkZXNjOmRlc2NzLmpvaW4oJ1xcXFxuJyksXFxuICAgICAgICAgIGltZzppbWcsXFxuICAgICAgICB9KVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAvL3RpdGxlOiB0aXRsZXNbMF0gKyAnXFxcXG4nICsgdGhpcy5zbWFsbCh0aXRsZXMuc2xpY2UoMSwgMykuam9pbignXFxcXG4nKSksXFxuICAgICB0aXRsZTogIHRoaXMuc21hbGwocGRmaChodG1sLCAnI3Bvc3RfY29udGVudCYmVGV4dCcpLnJlcGxhY2UoL1xcXFxzL2csJycpLCdyZWQnKSxcXG4gICAgICAgICAgIC8vIGRlc2M6IHRoaXMuc21hbGwoZGVzY3Muam9pbignXFxcXG4nKSksXFxuICAgICBkZXNjOiB0aGlzLnNtYWxsKHBkZmgoaHRtbCwgJy5jb250ZXh0JiYud2lkZ2V0JiZUZXh0JyksJyNGRjdGMDAnKSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpbWcgKyAnQFJlZmVyZXI9JyxcXG4gICAgICAgICAgICB1cmw6IE1ZX1VSTCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljX2JsdXInLFxcbiAgICAgICAgfSlcXG4gICAgICAgIGlmIChvYmouZGVzYyAhPSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICB0aGlzLnNldERlc2Mob2JqLmRlc2MpO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBzZXRDdXN0b206IGZ1bmN0aW9uKG9iaiwgaW1nKSB7XFxuICAgICAgICB2YXIgYXJyYXkgPSBbXTtcXG4gICAgICAgIGlmIChvYmouY29uc3RydWN0b3IgPT0gQXJyYXkpIHtcXG4gICAgICAgICAgICBhcnJheSA9IG9iajtcXG4gICAgICAgIH1cXG4gICAgICAgIGFycmF5ID0gdGhpcy5zdHJDb252ZXJ0KGFycmF5KTtcXG4gICAgICAgIHZhciB0aXRsZXMgPSBbXTtcXG4gICAgICAgIHZhciBkZXNjcyA9IFtdO1xcbiAgICAgICAgc3dpdGNoIChhcnJheS5sZW5ndGgpIHtcXG4gICAgICAgICAgICBjYXNlIDQ6XFxuICAgICAgICAgICAgY2FzZSA1OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAyKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgyKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSA2OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAzKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgzKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignZXJfaW5mbycse1xcbiAgICAgICAgICBkZXNjOmRlc2NzLmpvaW4oJ1xcXFxuJyksXFxuICAgICAgICAgIGltZzppbWcsXFxuICAgICAgICB9KVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGVzWzBdICsgJ1xcXFxuJyArIHRoaXMuc21hbGwodGl0bGVzLnNsaWNlKDEsIDMpLmpvaW4oJ1xcXFxuJykpLFxcbiAgICAgICAgICAgIGRlc2M6IHRoaXMuc21hbGwoZGVzY3Muam9pbignXFxcXG4nKSksXFxuICAgICAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgdXJsOiBNWV9VUkwsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpY19ibHVyJyxcXG4gICAgICAgIH0pXFx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zdG9tKXtcXG4gICAgICB2YXJpPVxcXCJlcl9cXFwiK3Zhcmk7XFxuICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0YWJzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgdmFyIHVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHZhcmksIHNoc29ydCwgaSxsaW5lYykgPT4ge1xcbiAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICB2YXIgbGlzdHMgPSBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQgKyAnX2xpc3QnLCAnW10nKTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICBpZihnZXRNeVZhcih2YXJpKydmb2xkJywnMScpPT0nMCcpe1xcbiAgICAgICAgICAgICAgICB2YXIgYnRuPWZpbmRJdGVtKHNoc29ydCsnX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICB2YXIgZm9sZHM9Wyc8Zm9udCBjb2xvcj1cXFwiI0QzRDNEM1xcXCI+4pi3JywnPGZvbnQgY29sb3I9XFxcIiNGRkE1MDBcXFwiPuKYsCddO1xcbiAgICAgICAgICAgICAgICAgIHZhciBwbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCAne30nKTtcXG4gICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICB2YXIgY29sID0gcGxpc3Rbc2hzb3J0XS5jb2xfdHlwZTtcXG4gICAgICAgICAgICAgICAgICB2YXIgY2xzID0gcGxpc3Rbc2hzb3J0XS5jbHM7XFxuICAgICAgICAgICAgICAgICAgdmFyIHBpYz1wbGlzdFtzaHNvcnRdLnBpYztcXG4gICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGJ0bi5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGJ0bi50aXRsZS5yZXBsYWNlKGZvbGRzWzBdLCBmb2xkc1sxXSksXFxuICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcih2YXJpKydmb2xkJywnMScpO1xcbiAgICAgICAgICAgICAgLy9yZXR1cm4gJ3RvYXN0Oi8v5bGV5byA5omN6IO95pON5L2cJztcXG4gICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsaXN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2VyX3BsYXlsaXN0cycsICd7fScpO1xcbiAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29sID0gcGxpc3Rbc2hzb3J0XS5jb2xfdHlwZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBjbHMgPSBwbGlzdFtzaHNvcnRdLmNscztcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWM9cGxpc3Rbc2hzb3J0XS5waWM7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIodmFyaSwgaSk7XFxuXFxuICAgICAgICAgICAgICAgIHZhciB4bGlzdD1saXN0c1tpXTtcXG4gICAgICAgICAgICAgICAgaWYoJC5mdW5jIT11bmRlZmluZWQmJiQuZnVuYy5jb25zdHJ1Y3Rvcj09RnVuY3Rpb24pe1xcbiAgICAgICAgICAgICAgICAgICAgeGxpc3Q9JC5mdW5jKGkpO1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX2xpc3QnLCB4bGlzdCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIHBsYXlzID0geGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogeC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHgudXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2wsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljOnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogeC51cmwucmVwbGFjZSgvQGxhenlSdWxlW1xcXFxzXFxcXFNdKy9nLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogY2xzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKHNoc29ydCArICdfc29ydCcpID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgcGxheXMucmV2ZXJzZSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBwY2ZnPXN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLCd7fScpO1xcbiAgICAgICAgICAgICAgICBpZihwY2ZnWyfljZXmjqgnXSl7XFxuICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNoJyx7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTpwY2ZnWydvYmonXVsn5Y2V5o6oJ11bMF1cXG4gICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgIHBjZmdbJ+WNleaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKHBjZmdbJ+mAieaOqCddKXtcXG4gICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2hzJyx7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTpwY2ZnWydvYmonXVsn6YCJ5o6oJ11bMF1cXG4gICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLHBjZmcpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIHBsYXlzKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIHRhYnggPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcbiAgICAgICAgICAgICAgICB0YWJ4LmZvckVhY2goKHgsIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB4LnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaWkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHguZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2UoLyMoXFxcXHcrKT8vZywgbGluZWMpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZSgvIyhcXFxcdyspPy9nLCAnIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip/vvIEnO1xcbiAgICAgICAgICAgIH0sIHZhcmksIHNoc29ydCwgaSxjdXN0b20u57q/6Lev6YCJ5LitKVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIChnZXRNeVZhcih2YXJpLCAnMCcpID09IGkgPyB0YWJzW2ldLmZvbnRjb2xvcihjdXN0b20u57q/6Lev6YCJ5LitKSA6IHRhYnNbaV0uZm9udGNvbG9yKCcjJykpLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogc2hzb3J0ICsgJ190YWInLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHNoc29ydCArICdfdGFiXycgKyBpLFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6J2JsYW5rX2Jsb2NrJywgLy8nYmxhbmtfYmxvY2snLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2xpbmUnLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIHB1c2hUYWI6ZnVuY3Rpb24odmFyaSxzaHNvcnQpe1xcbiAgICAgIGFkZExpc3RlbmVyKCdvblJlZnJlc2gnLCAkLnRvU3RyaW5nKChzaHNvcnQpID0+IHtcXG4gICAgICAgIGNsZWFyTXlWYXIoc2hzb3J0KydfcHVzaGNmZycpO1xcbiAgICAgICAgY2xlYXJNeVZhcihzaHNvcnQrJ19kdW9zZWxlY3QnKTtcXG4gICAgICAgIH0sIHNoc29ydCkpXFxuICAgICAgIHZhciBwb2JqPXtcXG4gICAgICAgJ+WNleaOqCc6Wyfipr/ljZXmjqgnLCc8Yj7ipr/ljZXmjqg8L2I+Jy5mb250Y29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cse1xcbiAgICAgICAgICAgICAgdGl0bGU6dGl0bGVzWzBdLFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcGNmZ1sn5Y2V5o6oJ109ZmFsc2U7XFxuICAgICAgICAgICAgcGNmZ1sncGxheWxpc3QnXS5tYXAoKHgpPT57XFxuICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LmV4dHJhLmlkLHtcXG4gICAgICAgICAgICAgICAgIHVybDp4LnVybCxcXG4gICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaCcse1xcbiAgICAgICAgICAgICAgdGl0bGU6J+KAnOKAnOKAneKAnScrdGl0bGVzWzFdLFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNocycse1xcbiAgICAgICAgICAgICAgdGl0bGU6cG9ialsn6YCJ5o6oJ11bMF0sXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBwY2ZnWyfljZXmjqgnXT10cnVlO1xcbiAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgIHZhciBwbGF5bGlzdD1maW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J109cGxheWxpc3Q7XFxuICAgICAgICAgICAgZmluZEl0ZW1zQnlDbHMoc2hzb3J0KS5tYXAoeD0+e1xcbiAgICAgICAgICAgICAgdmFyIGRwdXNoPXtcXG4gICAgICAgICAgICAgICAgbmFtZTpnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgICAgICAgICAgdXJsOngudGl0bGUrJyQnK3guZXh0cmEuaWRcXG4gICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCx7XFxuICAgICAgICAgICAgICAgIHVybDokKCcnKS5sYXp5UnVsZSgoZHB1c2gpPT57XFxuICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeShkcHVzaCkpO1xcbiAgICAgICAgICAgICAgICB9LGRwdXNoKVxcbiAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICB9XFxuICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLHBjZmcpO1xcbiAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJyso5Y2V5o6oPyfljZXmjqjlvIDlkK8nOifljZXmjqjlhbPpl60nKTtcXG4gICAgICAgICAgfSxzaHNvcnQscG9iaix2YXJpKSxcXG4gICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgIGlkOnNoc29ydCsnX3B1c2gnLFxcbiAgICAgICAgICAgIGNsczpzaHNvcnQrJ19wdXNodGFiJyxcXG4gICAgICAgICAgfVxcbiAgICAgICAgfSx7XFxuICAgICAgICAgIHRpdGxlOnBvYmpbJ+mAieaOqCddWzBdLFxcbiAgICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgIHVybDokKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaHNvcnQscG9iaix2YXJpKT0+e1xcbiAgICAgICAgICBpZihnZXRNeVZhcih2YXJpKydmb2xkJywnMScpPT0nMCcpe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lsZXlvIDmiY3og73mk43kvZwnO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIHZhciB0aXRsZXM9cG9ialsn6YCJ5o6oJ107XFxuICAgICAgICAgIHZhciBwY2ZnPXN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLCd7fScpO1xcbiAgICAgICAgICBwY2ZnWydvYmonXT1wb2JqO1xcbiAgICAgICAgICB2YXIg6YCJ5o6oPXBjZmdbJ+mAieaOqCddP3BjZmdbJ+mAieaOqCddOmZhbHNlO1xcbiAgICAgICAgICBpZijpgInmjqgpe1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaHMnLHtcXG4gICAgICAgICAgICAgIHRpdGxlOnRpdGxlc1swXSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J10ubWFwKCh4KT0+e1xcbiAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCx7XFxuICAgICAgICAgICAgICAgICB0aXRsZTp4LnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgdXJsOngudXJsLFxcbiAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2h0bycsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB5pys6aG1PT5UVkJveCcsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihzaHNvcnQrJ19kdW9zZWxlY3QnKTtcXG4gICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaHMnLHtcXG4gICAgICAgICAgICAgIHRpdGxlOifigJzigJzigJ3igJ0nK3RpdGxlc1sxXSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPXRydWU7XFxuICAgICAgICAgICAgcGNmZ1sn5Y2V5o6oJ109ZmFsc2U7XFxuICAgICAgICAgICAgdmFyIHBsYXlsaXN0PWZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgcGNmZ1sncGxheWxpc3QnXT1wbGF5bGlzdDtcXG4gICAgICAgICAgICBsZXQgSWRzPXBsYXlsaXN0Lm1hcChpdCA9PiBpdC5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgIElkcy5mb3JFYWNoKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gZmluZEl0ZW0oeCkudGl0bGU7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQubXNtKHRpdGxlLCB4LHNoc29ydCksXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNoJyx7XFxuICAgICAgICAgICAgICB0aXRsZTpwb2JqWyfljZXmjqgnXVswXSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaHRvJywge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmjqjpgIHpgInkuK09PlRWQm94JyxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQrJ19wdXNoY2ZnJyxwY2ZnKTtcXG4gICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrKOmAieaOqD8n6YCJ5o6o5byA5ZCvJzon6YCJ5o6o5YWz6ZetJyk7XFxuICAgICAgICAgIH0sc2hzb3J0LHBvYmosdmFyaSksXFxuICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICBpZDpzaHNvcnQrJ19wdXNocycsXFxuICAgICAgICAgICAgY2xzOnNoc29ydCsnX3B1c2h0YWInXFxuICAgICAgICAgIH1cXG4gICAgICAgIH0se1xcbiAgICAgICAgICB0aXRsZTogXFxcIuaOqOmAgeacrOmh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G4gICAgICAgICAgbG9nKHRhYnMpKi9cXG4gICAgICAgICAgfVxcbiAgICAgICAgICBpZijpgInmjqgpe1xcbiAgICAgICAgICB2YXIgcGxzPXN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCtcXFwiX2R1b3NlbGVjdFxcXCIsJ1tdJykubWFwKHggPT4geC50aXRsZSArIFxcXCIkXFxcIiArIHgudXJsKS5qb2luKFxcXCIjXFxcIik7XFxuICAgICAgICAgIGlmKHBscy5sZW5ndGg9PTApe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nkuLrnqbonO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIHZhciB0YWJzPVsn5pKt5pS+5YiX6KGoJ107XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgXFxuICAgICAgICAgIHZhciBpbmZvPXN0b3JhZ2UwLmdldE15VmFyKCdlcl9pbmZvJywne30nKTtcXG4gICAgICAgICAgdmFyIGRlc2MgPWluZm9bJ2Rlc2MnXTtcXG4gICAgICAgICAgdmFyIOaOqOmAgSA9IHtcXG4gICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZ2V0UGFnZVRpdGxlKCksXFxuICAgICAgICAgICAgICAgICBcXFwiY29udGVudFxcXCI6IGRlc2N8fCcnLFxcbiAgICAgICAgICAgICAgICAgXFxcInBpY1xcXCI6IGluZm9bJ2ltZyddIHx8ICcnLFxcbiAgICAgICAgICAgICAgICAgXFxcImZyb21cXFwiOiB0YWJzLmpvaW4oJyQkJCcpLFxcbiAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IHBscyxcXG4gICAgICAgICAgIH1cXG4gICAgICAgICAgLy9sb2co5o6o6YCBKVxcbiAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPVhZUeaOqOmAgSZwdXNodXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnko5o6o6YCBKSlcXG4gICAgICAgICAgfSxzaHNvcnQsdmFyaSksXFxuICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICBpZDpzaHNvcnQrJ19wdXNodG8nLFxcbiAgICAgICAgICAgIGNsczpzaHNvcnQrJ19wdXNodGFiJ1xcbiAgICAgICAgICB9XFxuICAgICAgICB9LHtcXG4gICAgICAgICAgY29sX3R5cGU6J2JsYW5rX2Jsb2NrJyxcXG4gICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgIGNsczpzaHNvcnQrJ19wdXNodGFiJyxcXG4gICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSxcXG4gICAgc2V0TG9uZ2NsaWNrOmZ1bmN0aW9uKHNoc29ydCxjdXN0b20pe1xcbiAgICAgIHJldHVybiBbe3RpdGxlOifmoLflvI/wn46oJyxqczogJC50b1N0cmluZygoc2hzb3J0KT0+e1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFsbF9jb2xzID0gWycnXS5jb25jYXQoZ2V0Q29sVHlwZXMoKSk7XFxuICAgICAgICAgICAgICAgICAgICBhbGxfY29scz1hbGxfY29scy5maWx0ZXIoeD0+XFxuICAgICAgICAgICAgICAgICAgICAgIC8odGV4dF98ZmxleCkuKi8udGVzdCh4KSYmeCE9J3RleHRfaWNvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhhbGxfY29scylcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjbHMgPSBzdG9yYWdlMC5nZXRNeVZhcignZXJfcGxheWxpc3RzJywne30nKVxcbiAgICAgICAgICAgICAgICAgICAgfHwgJyc7XFxuICAgICAgICAgICAgICAgICAgICBpZihjbHNbc2hzb3J0XSE9Jycpe1xcbiAgICAgICAgICAgICAgICAgICAgICBjb2w9Y2xzW3Noc29ydF0uY29sX3R5cGU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQg5oyJ6ZKu5qC35byPID0gYWxsX2NvbHMubWFwKChpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdCA9PT0gY29sID8gJ/CfkYknICsgaXQ6IGl0O1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGlwcyA9ICfor7fpgInmi6npgInpm4bmjInpkq7moLflvI8nO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQo5oyJ6ZKu5qC35byPLCAyLCB0aXBzKS5zZWxlY3QoKHNoc29ydCxjbHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5yZXBsYWNlKC/wn5GJL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvKnN0b3JhZ2UwLnNldEl0ZW0oJ+aMiemSruagt+W8jycsIGlucHV0KTsqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvbGRJZHMgPSAoZmluZEl0ZW1zQnlDbHMoc2hzb3J0KSB8fCBbXSkubWFwKGl0PT5pdC5leHRyYS5pZCk7IC8v6ICB5YWD57SgaWRzXFxuICAgICAgICAgICAgICAgICAgICAgICAgb2xkSWRzLmZvckVhY2goeD0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWIh+aNoumAiembhuaMiemSruagt+W8j+S4ujonICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICB9LHNoc29ydCxjbHMpO1xcbiAgICAgICAgICAgICAgICB9LHNoc29ydCxjdXN0b20pfV1cXG4gICAgfSxcXG4gICAgc2V0VGFiczogZnVuY3Rpb24odGFicywgdmFyaSwg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ld2Nsc2xpc3QgPSAkLmRhdGFDb252ZXJ0KGNsc2xpc3RzKTtcXG4gICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICB2YXIgdGl0bGVzPVtgJHtjdXN0b20u5q2j5bqP6aKc6ImyfVxcXCI+5q2j5bqPYCxgJHtjdXN0b20u6YCG5bqP6aKc6ImyfVxcXCI+6YCG5bqPYF07XFxuICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICBuZXdjbHNsaXN0LnJldmVyc2UoKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIG5ld2Nsc2xpc3QpO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInKVxcblxcbiAgICAgICAgICAgICAgICBpZiAoY29uZiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19hdmF0YXInLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG9iai50aXRsZS5yZXBsYWNlKHRpdGxlc1sxXSwgdGl0bGVzWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2F2YXRhcicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzBdLCB0aXRsZXNbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcxJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaOkuW6j+aIkOWKnyc7XFxuICAgICAgICAgICAgfSwgc2hzb3J0LHZhcmksY3VzdG9tKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBjdXN0b20u5Zu+5qCHICxcXG4gICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICBpZDpzaHNvcnQrJ19hdmF0YXInLFxcbiAgICAgICAgICAgICAgbG9uZ0NsaWNrOnRoaXMuc2V0TG9uZ2NsaWNrKHNoc29ydCksXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIHZhciDmipjlj6AgPSAn4oCc4oCc4oCd4oCdPGI+JyArICfimLcnLmZvbnRjb2xvcihcXFwiI0QzRDNEM1xcXCIpO1xcbiAgICAgICAgdmFyIOWxleW8gCA9ICfigJzigJzigJ3igJ08Yj4nICsgJ+KYsCcuZm9udGNvbG9yKFxcXCIjRkZBNTAwXFxcIik7XFxuICAgICAgICB2YXIgZm9sZG5hbWUgPSAnZXJfJyt2YXJpICsgJ2ZvbGQnO1xcbiAgICAgICAgdmFyICBmb2xkID0gZ2V0TXlWYXIoZm9sZG5hbWUsICcxJyk7XFxuICAgICAgICBpZih0eXBlb2YocGFyc2VbJ+aOqOmAgSddKSE9J3VuZGVmaW5lZCcmJnBhcnNlWyfmjqjpgIEnXSlcXG4gICAgICAgIHRoaXMucHVzaFRhYignZXJfJyt2YXJpLHNoc29ydCk7XFxuICAgICAgICBcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT09ICcwJyA/IOaKmOWPoCA6IOWxleW8gCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZm9sZG5hbWUsc2hzb3J0KSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciAgZm9sZCA9IGdldE15VmFyKGZvbGRuYW1lLCAnMScpO1xcbiAgICAgICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0KydfbGluZScpO1xcbiAgICAgICAgICAgICAgICB2YXIgYnRuPWZpbmRJdGVtKHNoc29ydCsnX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICB2YXIgZm9sZHM9Wyc8Zm9udCBjb2xvcj1cXFwiI0QzRDNEM1xcXCI+4pi3JywnPGZvbnQgY29sb3I9XFxcIiNGRkE1MDBcXFwiPuKYsCddO1xcbiAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgaWYoZm9sZD09JzAnKXtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoZm9sZG5hbWUsICAnMScpO1xcbiAgICAgICAgICAgICAgICB2YXIgY3MgPSBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQgKyAnX2NscycpO1xcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIob2JqLmV4dHJhLmlkLCBjcyk7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oYnRuLmV4dHJhLmlkLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogYnRuLnRpdGxlLnJlcGxhY2UoZm9sZHNbMF0sIGZvbGRzWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKGZvbGQ9PScxJyl7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoZm9sZG5hbWUsICAnMCcpO1xcbiAgICAgICAgICAgICAgICB2YXIgcGNscyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIHZhciBjeCA9ICQuZGF0YUNvbnZlcnQocGNscyk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfY2xzJywgY3gpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShidG4uZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBidG4udGl0bGUucmVwbGFjZShmb2xkc1sxXSwgZm9sZHNbMF0pLFxcbiAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJyArIChmb2xkID09PSAnMScgPyAn5pS26LW3JyA6ICflsZXlvIAnKTtcXG4gICAgICAgICAgICB9LCBmb2xkbmFtZSxzaHNvcnQpLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2J1dHRvbicsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIHRoaXMuY3JlYXRlUExpc3QodGFicyx2YXJpLHNoc29ydCxjdXN0b20pO1xcbiAgICB9LFxcbiAgICBzZXRUYWJzMjogZnVuY3Rpb24odGFicywgdmFyaSwgc2hzb3J0LHBhcnNlKSB7XFxuICAgICAgICBsZXQgY3VzdG9tPXBhcnNlLuiHquWumuS5iTtcXG4gICAgICAgIGN1c3RvbSA9dGhpcy5nZXRQcmVzZXQoY3VzdG9tKTtcXG4gICAgICAgIFxcbiAgICAgICAgc2hzb3J0ID0gc2hzb3J0ID8gc2hzb3J0IDogJ3Noc29ydCc7XFxuICAgICAgICB2YXIgdGl0bGUgPSAoZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JywgJzAnKSA9PSAnMScpID8gJzxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjonK2N1c3RvbS7pgIbluo/popzoibIrJ1xcXCI+6YCG5bqPPC9zcGFu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7XFxuICAgICAgICAgICAgICAgIHZhciBsY2xzID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19saW5lJyk7XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICB2YXIgcGNscyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIHZhciBjcyA9IFtiY2xzXS5jb25jYXQodGNscywgW2xjbHNdLCBwY2xzKTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGlmKHB1c2gpe1xcbiAgICAgICAgICAgICAgICAgIHZhciBwY2xzPWZpbmRJdGVtc0J5Q2xzKHNoc29ydCsnX3B1c2h0YWInKTtcXG4gICAgICAgICAgICAgICAgICBjcz1wY2xzLmNvbmNhdChjcyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgdmFyIGN4ID0gJC5kYXRhQ29udmVydChjcyk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfY2xzJywgY3gpO1xcbiAgICAgICAgICAgICAgICBpZihwdXNoKXtcXG4gICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KydfcHVzaHRhYicpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oYmNscy5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHNoc29ydCArICdfbGluZScpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG5cXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShvYmouZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IG9iai5kZXNjLnJlcGxhY2UoJ+WxleW8gDxmb250IGNvb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An5p2h57q/6LevJyxcXG4gICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6IGN1c3RvbS7lm77moIcsXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHNoc29ydCArICdfYXZhdGFyJyxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOnRoaXMuc2V0TG9uZ2NsaWNrKHNoc29ydCksXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIGlmKHR5cGVvZihwYXJzZVsn5o6o6YCBJ10pIT0ndW5kZWZpbmVkJyYmcGFyc2VbJ+aOqOmAgSddKVxcbiAgICAgICAgdGhpcy5wdXNoVGFiKCdlcl8nK3Zhcmksc2hzb3J0KTtcXG4gICAgICAgIFxcbiAgICAgICAgaWYgKGZvbGQgPT0gJzAnKSB7XFxuICAgICAgICAgICAgcmV0dXJuXFxuICAgICAgICB9XFxuXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIHRpdGxlLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodmFyaSwgc2hzb3J0LGN1c3RvbSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZiA9IGdldE15VmFyKHNoc29ydCArICdfc29ydCcsICcwJyk7XFxuICAgICAgICAgICAgICAgIHZhciBjbHNsaXN0cyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIHZhciBuZXdjbHNsaXN0ID0gJC5kYXRhQ29udmVydChjbHNsaXN0cyk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICBuZXdjbHNsaXN0LnJldmVyc2UoKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIG5ld2Nsc2xpc3QpO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgb2JqID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19idXR0b24nKVxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGVzPVtgJHtjdXN0b20u5q2j5bqP6aKc6ImyfVxcXCI+5q2j5bqPYCxgJHtjdXN0b20u6YCG5bqP6aKc6ImyfVxcXCI+6YCG5bqPYF07XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICBpZiAoY29uZiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0ICsgJ19idXR0b24nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG9iai50aXRsZS5yZXBsYWNlKHRpdGxlc1sxXSwgdGl0bGVzWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2J1dHRvbicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzBdLCB0aXRsZXNbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcxJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmjpLluo/miJDlip8nXFxuICAgICAgICAgICAgfSwgdmF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xpc3RzW2luZGV4XTtcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JykgPT0gJzEnICYmIGxpc3RzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGxpc3RzW2luZGV4XS5yZXZlcnNlKCk7XFxuICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBcXG4gICAgICAgIGlmKOagt+W8jz09Jycpe1xcbiAgICAgICAgICDmoLflvI89bGlzdC5sZW5ndGggPiAzID8gJ3RleHRfNCcgOiAndGV4dF8yJ1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICBpZihsaXN0Lmxlbmd0aCA+IDApe1xcbiAgICAgICAgdmFyIHBsaXN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2VyX3BsYXlsaXN0cycsICd7fScpO1xcbiAgICAgICAgaWYoIXBsaXN0Lmhhc093blByb3BlcnR5KHNoc29ydCkpe1xcbiAgICAgICAgICAgICBwbGlzdFtzaHNvcnRdPXt9O1xcbiAgICAgICAgfVxcbiAgICAgICAgcGxpc3Rbc2hzb3J0XVsnY2xzJ109c2hzb3J0O1xcbiAgICAgICAgcGxpc3Rbc2hzb3J0XVsnY29sX3R5cGUnXT3moLflvI87XFxuICAgICAgICBwbGlzdFtzaHNvcnRdWydwaWMnXT3lm77moIc7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignZXJfcGxheWxpc3RzJywgcGxpc3QpO1xcbiAgICAgICAgfSAgIFxcbiAgICAgICAgXFxuICAgICAgICBcXG4gICAgICAgIGZvciAodmFyIGogaW4gbGlzdCkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBsaXN0W2pdLnRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IGxpc3Rbal0udXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTog5qC35byPLFxcbiAgICAgICAgICAgICAgICBwaWM65Zu+5qCHLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGxpc3Rbal0udXJsLnJlcGxhY2UoL0BsYXp5UnVsZVtcXFxcc1xcXFxTXSsvZywgJycpLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBzaHNvcnQsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgZ2V0VGFiczogZnVuY3Rpb24ocGFyc2UpIHtcXG4gICAgICAgIHZhciB0YWJzID0gW107XFxuICAgICAgICB2YXIgYXJ0cyA9IHBkZmEoaHRtbCwgcGFyc2Uu57q/6LevKTtcXG4gICAgICAgIHZhciDnur/ot6/lkI0gPSBwYXJzZS7nur/ot6/lkI3np7A7XFxuICAgICAgICB2YXIg5pu/5o2i5Ye95pWwID0gJyc7XFxuICAgICAgICBpZiAocGFyc2Uu57q/6Lev5ZCN56ewLmluY2x1ZGVzKCdAQCcpKSB7XFxuICAgICAgICAgICAg57q/6Lev5ZCNID0gcGFyc2Uu57q/6Lev5ZCN56ewLnNwbGl0KCdAQCcpWzBdO1xcbiAgICAgICAgICAgIOabv+aNouWHveaVsCA9IHBhcnNlLue6v+i3r+WQjeensC5zcGxpdCgnQEAnKVsxXTtcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAodmFyIGkgaW4gYXJ0cykge1xcbiAgICAgICAgICAgIHZhciBsaW5lbmFtZSA9IHBkZmgoYXJ0c1tpXSwg57q/6Lev5ZCNKTtcXG4gICAgICAgICAgICBpZiAo5pu/5o2i5Ye95pWwICE9ICcnKSB7XFxuICAgICAgICAgICAgICAgIGxpbmVuYW1lID0gZXZhbCgnbGluZW5hbWUnICsg5pu/5o2i5Ye95pWwKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGFicy5wdXNoKGxpbmVuYW1lKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB0YWJzO1xcbiAgICB9LFxcbiAgICBnZXRMaXN0czogZnVuY3Rpb24ocGFyc2Usc2hzb3J0KSB7XFxuICAgICAgICBzaHNvcnQgPSBzaHNvcnQgPyBzaHNvcnQgOiAnc2hzb3J0JztcXG4gICAgICAgIHZhciBsaXN0cyA9IFtdO1xcbiAgICAgICAgdmFyIGNvbnRzID0gcGRmYShodG1sLCBwYXJzZS7pgInpm4YpO1xcbiAgICAgICAgdmFyIOmAiembhuWQjeensCA9IHBhcnNlLumAiembhuWQjeensCA/IHBhcnNlLumAiembhuWQjeensCA6ICdhJiZUZXh0JztcXG4gICAgICAgIHZhciDpgInpm4bpk77mjqUgPSBwYXJzZS7pgInpm4bpk77mjqUgPyBwYXJzZS7pgInpm4bpk77mjqUgOiAnYSYmaHJlZic7XFxuICAgICAgICB2YXIg6Kej5p6QID0gcGFyc2Uu6Kej5p6QID8gcGFyc2Uu6Kej5p6QIDogJyc7XFxuICAgICAgICB2YXIgdGVtcCA9IFtdO1xcbiAgICAgICAgZm9yICh2YXIgaSBpbiBjb250cykge1xcbiAgICAgICAgICAgIGlmIChwYXJzZS7pgInpm4bliJfooaggIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGxpc3RzLnB1c2gocGRmYShjb250c1tpXSwgcGFyc2Uu6YCJ6ZuG5YiX6KGoKS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKHgsIOmAiembhuWQjeensCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwZCh4LCDpgInpm4bpk77mjqUpICsg6Kej5p6QLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gcGQoY29udHNbaV0sIOmAiembhumTvuaOpSk7XFxuICAgICAgICAgICAgICAgIGlmICgh6YCJ6ZuG6ZO+5o6lLmluY2x1ZGVzKCdocmVmJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IHBkZmgoY29udHNbaV0sIOmAiembhumTvuaOpSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdGVtcC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGNvbnRzW2ldLCDpgInpm4blkI3np7ApLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwgKyDop6PmnpAsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IOWAkuW6jyA9IHBhcnNlLuWAkuW6jyA/IHBhcnNlLuWAkuW6jyA6IGZhbHNlO1xcbiAgICAgICAgdmFyIHJlc3VsdHMgPSBsaXN0cy5sZW5ndGggPyBsaXN0cyA6IFt0ZW1wXTtcXG4gICAgICAgIGlmICjlgJLluo8pIHtcXG4gICAgICAgICAgICByZXN1bHRzID0gcmVzdWx0cy5tYXAoeCA9PiB4LnJldmVyc2UoKSk7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgcGxpc3QgPSBzdG9yYWdlMC5nZXRNeVZhcignZXJfcGxheWxpc3RzJywgJ3t9Jyk7XFxuICAgICAgICBpZiAocmVzdWx0cy5zb21lKHggPT4geC5sZW5ndGggPiAwKSkge1xcbiAgICAgICAgICAgaWYoIXBsaXN0Lmhhc093blByb3BlcnR5KHNoc29ydCkpe1xcbiAgICAgICAgICAgICBwbGlzdFtzaHNvcnRdPXt9O1xcbiAgICAgICAgICAgfVxcbiAgICAgICAgICAgcGxpc3Rbc2hzb3J0XVsnbGVuZ3RoJ109cmVzdWx0cy5sZW5ndGg7XFxuICAgICAgICB9O1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2VyX3BsYXlsaXN0cycsIHBsaXN0KTtcXG4gICAgICAgIHJldHVybiByZXN1bHRzO1xcbiAgICB9LFxcbiAgICBnZXRQbGF5ZXJzOiBmdW5jdGlvbihwYXJzZSwgbW9kZSxmdW5jKSB7XFxuICAgICAgICAvL2xvZyhtb2RlKVxcbiAgICAgICAgdmFyIHBsYXkgPSAnZXJfcGxheWxpc3RfJztcXG4gICAgICAgIHRoaXMucHJlTG9hZChmdW5jKTtcXG4gICAgICAgIHRoaXMuY2xvc2UocGFyc2UubWFwKHggPT4geC7nsbvlnospLCBwYXJzZS5sZW5ndGgpO1xcbiAgICAgICAgbW9kZSA9IG1vZGUgPyBtb2RlIDogMTtcXG4gICAgICAgIHBhcnNlLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICB2YXIgdGFicyA9IFsn5Li757q/J107XFxuICAgICAgICAgICAgaWYgKGl0ZW0u57q/6LevICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICB0YWJzID0gdGhpcy5nZXRUYWJzKGl0ZW0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBwdXRNeVZhcihwbGF5K2krJ190YWJzJyx0YWJzKTtcXG4gICAgICAgICAgICBpZihpdGVtLkFqYXgpe1xcbiAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFRhYnModGFicywgaXRlbS7nsbvlnossIHBsYXkgKyBpLGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGFiczIodGFicywgaXRlbS7nsbvlnossIHBsYXkgKyBpLGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2VyX2h0bWwnLGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2VyX3VybCcsTVlfVVJMKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIGxpc3RzPWZ1bmMoZ2V0TXlWYXIoJ2VyXycraXRlbS7nsbvlnossJzAnKSxNWV9VUkwpO1xcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHZhciBsaXN0cyA9IHRoaXMuZ2V0TGlzdHMoaXRlbSwgcGxheStpKTtcXG4gICAgICAgICAgICAvL2xvZyhsaXN0cylcXG4gICAgICAgICAgICBpZiAobGlzdHMuc29tZSh4ID0+IHgubGVuZ3RoID4gMCkpIHtcXG4gICAgICAgICAgICAgICAgaWYgKG1vZGUgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRUYWJzKHRhYnMsIGl0ZW0u57G75Z6LLCBwbGF5ICsgaSxpdGVtKTtcXG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFRhYnMyKHRhYnMsIGl0ZW0u57G75Z6LLCBwbGF5ICsgaSxpdGVtKTtcXG4gICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2VyXycgKyBpdGVtLuexu+WeiyArICdmb2xkJywgJzEnKSA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgdGhpcy5zZXRMaXN0cyhsaXN0cywgZ2V0TXlWYXIoJ2VyXycraXRlbS7nsbvlnossICcwJyksIHBsYXkgKyBpLGl0ZW0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9XFxufVxcblxcblxcbmxldCBNZXRob2RzPXtcXG4gICAgLy/lpJrpgInmqKHlnZdcXG4gICAgTXVsdGlTZWxlY3RNb2RlOmZ1bmN0aW9uKG5hbWUsaWQsc2hzb3J0KXtcXG4gIC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tcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFycltpXVsndXJsJ10gPT0gdmFsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZW1vdmVCeVZhbHVlKGR1b3NlbGVjdCwgZGF0YXVybClcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShkYXRhdXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZGF0YXRpdGxlXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQrXFxcIl9kdW9zZWxlY3RcXFwiLCBkdW9zZWxlY3QpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgIH0sIG5hbWUsIGlkLCBzaHNvcnQpXFxuICAgIH0sXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6Kej5p6QXCIsXCJwYXRoXCI6XCJsYXp5XCIsXCJydWxlXCI6XCJ2YXIgbGF6eSA9ICQoJycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgdHJ5IHtcXG4gICAgICAgIGlmKGlucHV0LnN0YXJ0c1dpdGgoXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL3NcXFwiKSl7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3NlYXJjaD9zPVxcXCIraW5wdXQrXFxcIiZydWxlPXVja2vkupFcXFwiXFxuICAgICAgICB9XFxuICAgICAgICB2YXIgdXJsID0gcGRmaChyZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IE1PQklMRV9VQVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pLCAnaWZyYW1lJiZzcmMnKTtcXG4gICAgICAgIC8vdmFyIHBsYXl1cmwgPSByZXF1ZXN0KHVybCkubWF0Y2goL3VybFxcXCI6XFxcIlxcXFwvKC4qPylcXFwiLylbMV07XFxuICAgICAgICB2YXIgcGxheSA9IHVybC5tYXRjaCgvaHR0cC4qP1xcXFwvXFxcXC8uKi8pWzBdXFxuICAgICAgICBsb2coJ+mHjeWumuWQkeWcsOWdgO+8micpXFxuICAgICAgICBsb2cocGxheSlcXG4gICAgICAgIHJldHVybiAndmlkZW86Ly8nICsgcGxheVxcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICBsb2coJ+aKpemUmei3s+i9rOebtOmTvicpO1xcbiAgICAgICAgdmFyIHBsYXl1cmwxID0gcmVxdWVzdChpbnB1dCkubWF0Y2goL2E6JyhodHRwLio/XFxcXC5tM3U4KScvKVsxXTtcXG4gICAgICAgIHJldHVybiBwbGF5dXJsMVxcbiAgICB9XFxuXFxufSk7XCJ9XSIsImljb24iOiJodHRwczovL2ltZy52aW51YS5jbi9pbWFnZXMvT3B1UkQucG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment