Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_通用阅读器#0@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICDpgJrnlKjpmIXor7vlmagKLy8gQHZlcnNpb24gICAgICAwLjQuNAovLyBAZGVzY3JpcHRpb24gIOS4uuaJgOacieermeeCueWinuWKoOi/m+WFpemYheivu+aooeW8j+aMiemSru+8jOeCueWHu+WQjuWmguaenOWMuemFjeaIkOWKn+WImeiHquWKqOi9rOeggeaIkOS4uumAmueUqOeahOmYheivu+WZqOagt+W8j+aWueS+v+S9v+eUqO+8jOW5tuaPkOS+m+aJqeWxleivremfs+mYheivu+WKn+iDve+8iOmcgOimgea1j+iniOWZqOaUr+aMge+8jOaOqOiNkOacgOaWsOeJiEZpcmVmb3jmtY/op4jlmajvvIkKLy8gQGF1dGhvciAgICAgICBwcHBwbG9pOAovLyBAbWF0Y2ggICAgICAgIGh0dHBzOi8vKi8qCi8vIEBtYXRjaCAgICAgICAgaHR0cDovLyovKgovLyBAZ3JhbnQgICAgICAgIG5vbmUKLy8gQG5hbWVzcGFjZSBodHRwczovL2dyZWFzeWZvcmsub3JnL3VzZXJzLzI0MDQ5MgovLyA9PS9Vc2VyU2NyaXB0PT0KCihmdW5jdGlvbigpIHsKICAgIHZhciAkID0gZnVuY3Rpb24oc2VsZWN0b3IpIHsKICAgICAgICByZXR1cm4gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihzZWxlY3Rvcik7CiAgICB9CgogICAgdmFyIGJsYWNrTGlzdCA9IHt9OwoKICAgIGNvbnN0IGRvbWFpbnMgPSBKU09OLnBhcnNlKEdNX2dldFZhbHVlKCJkb21haW5zIiwgIltdIikpOwogICAgbGV0IGhvc3QgPSBsb2NhdGlvbi5ob3N0OwogICAgaWYgKGRvbWFpbnMuaW5jbHVkZXMoaG9zdCkpIHsKICAgICAgICBHTV9yZWdpc3Rlck1lbnVDb21tYW5kKCLlnKgiICsgaG9zdCArICLnpoHnlKgiLCBmdW5jdGlvbigpIHsKICAgICAgICAgICAgbGV0IGRvbWFpbnMgPSBKU09OLnBhcnNlKEdNX2dldFZhbHVlKCJkb21haW5zIiwgIltdIikpOwogICAgICAgICAgICBpZiAoZG9tYWlucy5pbmNsdWRlcyhsb2NhdGlvbi5ob3N0KSkgewogICAgICAgICAgICAgICAgZG9tYWlucyA9IGRvbWFpbnMuZmlsdGVyKGl0ID0+IGl0ICE9IGxvY2F0aW9uLmhvc3QpOwogICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoImRvbWFpbnMiLCBKU09OLnN0cmluZ2lmeShkb21haW5zKSk7CiAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgfSBlbHNlIHsKICAgICAgICBHTV9yZWdpc3Rlck1lbnVDb21tYW5kKCLlnKgiICsgaG9zdCArICLlkK/nlKgiLCBmdW5jdGlvbigpIHsKICAgICAgICAgICAgbGV0IGRvbWFpbnMgPSBKU09OLnBhcnNlKEdNX2dldFZhbHVlKCJkb21haW5zIiwgIltdIikpOwogICAgICAgICAgICBpZiAoIWRvbWFpbnMuaW5jbHVkZXMobG9jYXRpb24uaG9zdCkpIHsKICAgICAgICAgICAgICAgIGRvbWFpbnMucHVzaChsb2NhdGlvbi5ob3N0KTsKICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJkb21haW5zIiwgSlNPTi5zdHJpbmdpZnkoZG9tYWlucykpOwogICAgICAgICAgICAgICAgbG9jYXRpb24ucmVsb2FkKCk7CiAgICAgICAgICAgIH0KICAgICAgICB9KTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgLy8g6YCa55So6Kej5p6Q5qih5p2/CiAgICBmdW5jdGlvbiBwYXJzZUNvbnRlbnRBbmRUaXRsZSgpIHsKICAgICAgICB2YXIgbWFpbkRvbSA9IG51bGw7CgogICAgICAgIGZ1bmN0aW9uIGZpbmRNYWluRG9tKGRvbXMpIHsKICAgICAgICAgICAgdmFyIGRvY1NpemUgPSBkb2N1bWVudC5ib2R5LnNjcm9sbEhlaWdodCAqIGRvY3VtZW50LmJvZHkuc2Nyb2xsV2lkdGg7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZG9tcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgdmFyIGRvbSA9IGRvbXNbaV07CiAgICAgICAgICAgICAgICAvLyDorqHnrpdkb23lsLrlr7jnmb7liIbmr5TlubbovpPlh7oKICAgICAgICAgICAgICAgIHZhciBzaXplID0gKGRvbS5zY3JvbGxXaWR0aCAqIGRvbS5zY3JvbGxIZWlnaHQpIC8gZG9jU2l6ZTsKICAgICAgICAgICAgICAgIGlmIChzaXplID4gMC4zICYmIGRvbS5ub2RlTmFtZSAhPT0gIkNPREUiICYmIGRvbS5ub2RlTmFtZSAhPT0gIlBSRSIpIHsgLy8gcHJl5ZKMY29kZeaYr+S7o+eggeW4uOeUqOWFg+e0oOWdl++8jOW/veeVpeS4jeiupOS4uuaYr+ato+aWh+WGheWuuQogICAgICAgICAgICAgICAgICAgIC8vIOWmguaenGlubmVyVGV4dOWtl+aVsOWkp+S6jjUwMO+8jOWImeinhuS4uuato+aWh+WMugogICAgICAgICAgICAgICAgICAgIHZhciB0ZXh0ID0gZG9tLmlubmVyVGV4dDsKICAgICAgICAgICAgICAgICAgICBpZiAodGV4dC5sZW5ndGggPj0gNTAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG1haW5Eb20gPSBkb207CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZmluZE1haW5Eb20oZG9tLmNoaWxkcmVuIHx8IFtdKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBmaW5kTWFpbkRvbShkb2N1bWVudC5ib2R5LmNoaWxkcmVuKTsKCiAgICAgICAgaWYgKG1haW5Eb20pIHsKICAgICAgICAgICAgLy8g5ZyobWFpbkRvbeWQjOWxguafpeaJvuagh+mimAogICAgICAgICAgICAvLyB2YXIgdGl0bGVMaXN0ID0gW107CiAgICAgICAgICAgIC8vIGZpbmRUaXRsZURvbShtYWluRG9tLnBhcmVudE5vZGUuY2hpbGRyZW4sIHRpdGxlTGlzdCk7CiAgICAgICAgICAgIC8vIOafpeaJvuagh+mimOmAu+i+kWJ1Z+i+g+WkmizmmoLml7bmlLnkuLrmn6Xmib7nvZHpobV0aXRsZeS9nOS4uuagh+mimCzlkI7nu63ph43lhpnpgLvovpHov5vooYzkvJjljJYKICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgIGNvbnRlbnQ6IG1haW5Eb20uaW5uZXJUZXh0LAogICAgICAgICAgICAgICAgdGl0bGU6IGRvY3VtZW50LnRpdGxlCiAgICAgICAgICAgIH07CiAgICAgICAgfQoKICAgICAgICAvLyBmdW5jdGlvbiBmaW5kVGl0bGVEb20oZG9tcywgdGl0bGVMaXN0KXsKICAgICAgICAvLyAgICAgZm9yKHZhciBpPTA7aTxkb21zLmxlbmd0aDtpKyspewogICAgICAgIC8vICAgICAgICAgdmFyIGRvbSA9IGRvbXNbaV07CiAgICAgICAgLy8gICAgICAgICBpZiAoZG9tLmNoaWxkcmVuICYmIGRvbS5jaGlsZHJlbi5sZW5ndGggIT09IDApewogICAgICAgIC8vICAgICAgICAgICAgIHZhciB0aXRsZSA9IGZpbmRUaXRsZURvbShkb20uY2hpbGRyZW4sIHRpdGxlTGlzdCk7CiAgICAgICAgLy8gICAgICAgICB9ZWxzZXsKICAgICAgICAvLyAgICAgICAgICAgICBpZiAoL1w8aDF8XDxoMnx0aXRsZS8udGVzdChkb20ub3V0ZXJIVE1MKSl7CiAgICAgICAgLy8gICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGRvbS5pbm5lclRleHQ7CiAgICAgICAgLy8gICAgICAgICAgICAgICAgIGlmICh0aXRsZSAmJiB0aXRsZS5sZW5ndGggPj0gNSAmJiB0aXRsZS5sZW5ndGggPD0gMjAwKXsKICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgIHRpdGxlTGlzdC5wdXNoKGRvbSk7CiAgICAgICAgLy8gICAgICAgICAgICAgICAgIH0KICAgICAgICAvLyAgICAgICAgICAgICB9CiAgICAgICAgLy8gICAgICAgICB9CiAgICAgICAgLy8gICAgIH0KICAgICAgICAvLyB9CiAgICB9CgogICAgZnVuY3Rpb24gcGFyc2VQYWdlVXAoKSB7CiAgICAgICAgdmFyIGFzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnYScpOwogICAgICAgIHZhciByZWcgPSAv5LiK5LiA56ugfOS4iuODvOeroHzkuIrkuIDnr4d85LiK5LiA6aG1fG5hdmlnYXRpb24tcHJldi87CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB2YXIgdGV4dCA9IGFzW2ldLm91dGVySFRNTDsKICAgICAgICAgICAgdmFyIGhyZWYgPSAoYXNbaV0uYXR0cmlidXRlcy5ocmVmICYmIGFzW2ldLmF0dHJpYnV0ZXMuaHJlZi52YWx1ZSkgfHwgKGFzW2ldLmRhdGFzZXQgJiYgYXNbaV0uZGF0YXNldC51cmwpOwogICAgICAgICAgICBpZiAodGV4dCAmJiByZWcudGVzdCh0ZXh0LnRyaW0oKSkgJiYgaHJlZiAmJiBocmVmICE9ICIjIiAmJiBocmVmLmluZGV4T2YoImphdmFzY3JpcHQ6IikgIT09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiBocmVmOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHBhcnNlUGFnZURvd24oKSB7CiAgICAgICAgdmFyIGFzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnYScpOwogICAgICAgIHZhciByZWcgPSAv5LiL5LiA56ugfOS4i+ODvOeroHzkuIvkuIDnr4d85LiL5LiA6aG1fG5hdmlnYXRpb24tbmV4dC87CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB2YXIgdGV4dCA9IGFzW2ldLm91dGVySFRNTDsKICAgICAgICAgICAgdmFyIGhyZWYgPSAoYXNbaV0uYXR0cmlidXRlcy5ocmVmICYmIGFzW2ldLmF0dHJpYnV0ZXMuaHJlZi52YWx1ZSkgfHwgKGFzW2ldLmRhdGFzZXQgJiYgYXNbaV0uZGF0YXNldC51cmwpOwogICAgICAgICAgICBpZiAodGV4dCAmJiByZWcudGVzdCh0ZXh0LnRyaW0oKSkgJiYgaHJlZiAmJiBocmVmICE9ICIjIiAmJiBocmVmLmluZGV4T2YoImphdmFzY3JpcHQ6IikgIT09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiBocmVmOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHBhcnNlUGFnZUluZGV4KCkgewogICAgICAgIHZhciBhcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJ2EnKTsKICAgICAgICB2YXIgcmVnID0gL+ebruW9lS87CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB2YXIgdGV4dCA9IGFzW2ldLmlubmVyVGV4dDsKICAgICAgICAgICAgdmFyIGhyZWYgPSBhc1tpXS5hdHRyaWJ1dGVzLmhyZWYgJiYgYXNbaV0uYXR0cmlidXRlcy5ocmVmLnZhbHVlOwogICAgICAgICAgICBpZiAodGV4dCAmJiB0ZXh0Lmxlbmd0aCA8PSAxMCAmJiByZWcudGVzdCh0ZXh0LnRyaW0oKSkgJiYgaHJlZiAmJiBocmVmICE9ICIjIiAmJiBocmVmLmluZGV4T2YoImphdmFzY3JpcHQ6IikgIT09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiBocmVmOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKCiAgICB2YXIgZm9udHNpemUgPSBwYXJzZUludChsb2NhbFN0b3JhZ2VbIl9lcl9mb250c2l6ZSJdIHx8IDApOwogICAgdmFyIGF1dG9wbGF5ID0gZmFsc2U7CiAgICBpZiAobG9jYWxTdG9yYWdlWydfZXItYXV0b3BsYXknXSA9PT0gJ3RydWUnKSB7CiAgICAgICAgYXV0b3BsYXkgPSB0cnVlOwogICAgfQogICAgZGVsZXRlIGxvY2FsU3RvcmFnZVsnX2VyLWF1dG9wbGF5J107CgogICAgaWYgKHRvcC53aW5kb3cgIT09IHdpbmRvdykgcmV0dXJuOyAvLyBpZnJhbWXlhoXnmoTnvZHpobXkuI3lsZXnpLrmjInpkq7vvIzkuZ/kuI3mlK/mjIHov5vlhaXpmIXor7vmqKHlvI8KICAgIGlmIChsb2NhbFN0b3JhZ2VbJ19lci1lbmFibGUnXSA9PT0gJ3RydWUnKSB7CiAgICAgICAgbG9jYWxTdG9yYWdlWydfZXItZW5hYmxlJ10gPSAnZmFsc2UnOwogICAgICAgIGNoZWNrQW5kQ3JlYXRlUmVhZGVyKHRydWUpOwogICAgfSBlbHNlIGlmIChibGFja0xpc3RbbG9jYXRpb24uaG9zdF0gIT09IHRydWUpIHsKICAgICAgICAvLyDliJvlu7rpmIXor7vmqKHlvI/mgqzmta7mjInpkq4KICAgICAgICAkKCdib2R5JykuY2hpbGRyZW5bMF0uaW5zZXJ0QWRqYWNlbnRIVE1MKCdiZWZvcmVCZWdpbicsICc8YnV0dG9uIGlkPSJfZXItZW50cnlSZWFkTW9kZSIgc3R5bGU9IicgKwogICAgICAgICAgICAnICAgIHBvc2l0aW9uOiBmaXhlZDsnICsKICAgICAgICAgICAgJyAgICByaWdodDogNTBweDsnICsKICAgICAgICAgICAgJyAgICBib3R0b206IDUwcHg7JyArCiAgICAgICAgICAgICcgICAgYmFja2dyb3VuZC1jb2xvcjogd2hpdGU7JyArCiAgICAgICAgICAgICcgICAgYm9yZGVyOiAxcHggc29saWQgYmxhY2s7JyArCiAgICAgICAgICAgICcgICAgYm9yZGVyLXJhZGl1czogMTBweDsnICsKICAgICAgICAgICAgJyAgICBwYWRkaW5nOiAwIDVweDsnICsKICAgICAgICAgICAgJyAgICBoZWlnaHQ6IDUwcHg7JyArCiAgICAgICAgICAgICcgICAgb3ZlcmZsb3c6IGF1dG87JyArCiAgICAgICAgICAgICcgICAgYmFja2dyb3VuZC1jb2xvcjogd2hpdGU7JyArCiAgICAgICAgICAgICcgICAgei1pbmRleDogMjAxOTAxMjcyMjEwOyI+6L+b5YWl6ZiF6K+75qih5byPPC9idXR0b24+Jyk7CiAgICAgICAgLy8g6YWN572u6ZiF6K+75qih5byP5oyJ6ZKu6Ieq5Yqo5reh5Ye65pWI5p6cCiAgICAgICAgdmFyIGkgPSAxOwogICAgICAgIHZhciBpbnRlcnZhbCA9IHNldEludGVydmFsKGZ1bmN0aW9uKCkgewogICAgICAgICAgICBpIC09IDAuMDM7CiAgICAgICAgICAgICQoJyNfZXItZW50cnlSZWFkTW9kZScpLnN0eWxlLm9wYWNpdHkgPSBpOwogICAgICAgICAgICBpZiAoaSA8PSAwKSB7CiAgICAgICAgICAgICAgICAkKCcjX2VyLWVudHJ5UmVhZE1vZGUnKS5yZW1vdmUoKTsKICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaW50ZXJ2YWwpOwogICAgICAgICAgICB9CiAgICAgICAgfSwgMTAwKTsKICAgICAgICAkKCcjX2VyLWVudHJ5UmVhZE1vZGUnKS5vbmNsaWNrID0gY2hlY2tBbmRDcmVhdGVSZWFkZXI7CiAgICAgICAgJCgnI19lci1Ob3RTaG93UmVhZE1vZGUnKS5vbmNsaWNrID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIGxvY2FsU3RvcmFnZVsnX2VyLWRpc2FibGVkJ10gPSAndHJ1ZSc7CiAgICAgICAgICAgICQoJyNfZXItZW50cnlSZWFkTW9kZScpLnJlbW92ZSgpOwogICAgICAgICAgICAkKCcjX2VyLU5vdFNob3dSZWFkTW9kZScpLnJlbW92ZSgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBjaGVja0FuZENyZWF0ZVJlYWRlcihub3RBbGVydCkgewogICAgICAgIC8vIOmAmui/h+iwg+eUqOmAmueUqOaooeadv+WwneivleaYr+WQpuiDveWkn+aIkOWKn+WMuemFjeWIsOmYheivu+WGheWuuQogICAgICAgIHZhciBjb250ZW50ID0gcGFyc2VDb250ZW50QW5kVGl0bGUoKTsKICAgICAgICBpZiAoY29udGVudCAmJiBjb250ZW50LmNvbnRlbnQpIHsKICAgICAgICAgICAgY29udGVudC5wYWdldXAgPSBwYXJzZVBhZ2VVcCgpOwogICAgICAgICAgICBjb250ZW50LnBhZ2Vkb3duID0gcGFyc2VQYWdlRG93bigpOwogICAgICAgICAgICBjb250ZW50LnBhZ2VpbmRleCA9IHBhcnNlUGFnZUluZGV4KCk7CiAgICAgICAgICAgIGNyZWF0ZVJlYWRlcihjb250ZW50KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBpZiAobm90QWxlcnQgIT09IHRydWUpIHsKICAgICAgICAgICAgICAgIGFsZXJ0KCflvZPliY3pobXpnaLop6PmnpDlpLHotKXvvIzml6Dms5Xov5vlhaXpmIXor7vmqKHlvI/vvIEnKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBzZXRUaGVtZSh0aGVtZSkgewogICAgICAgIHN3aXRjaCAodGhlbWUpIHsKICAgICAgICAgICAgY2FzZSAnYmxhY2snOgogICAgICAgICAgICAgICAgJCgnLl9lcicpLnN0eWxlLmJhY2tncm91bmRDb2xvciA9ICdibGFjayc7CiAgICAgICAgICAgICAgICAkKCcuX2VyLXRpdGxlJykuc3R5bGUuY29sb3IgPSAnS2hha2knOwogICAgICAgICAgICAgICAgJCgnLl9lci1jb250ZW50Jykuc3R5bGUuY29sb3IgPSAnS2hha2knOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ09saXZlRHJhYic6CiAgICAgICAgICAgICAgICAkKCcuX2VyJykuc3R5bGUuYmFja2dyb3VuZENvbG9yID0gJ09saXZlRHJhYic7CiAgICAgICAgICAgICAgICAkKCcuX2VyLXRpdGxlJykuc3R5bGUuY29sb3IgPSAnV2hpdGUnOwogICAgICAgICAgICAgICAgJCgnLl9lci1jb250ZW50Jykuc3R5bGUuY29sb3IgPSAnV2hpdGUnOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ0toYWtpJzoKICAgICAgICAgICAgICAgICQoJy5fZXInKS5zdHlsZS5iYWNrZ3JvdW5kQ29sb3IgPSAnS2hha2knOwogICAgICAgICAgICAgICAgJCgnLl9lci10aXRsZScpLnN0eWxlLmNvbG9yID0gJ2JsYWNrJzsKICAgICAgICAgICAgICAgICQoJy5fZXItY29udGVudCcpLnN0eWxlLmNvbG9yID0gJ2JsYWNrJzsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICd3aGl0ZSc6CiAgICAgICAgICAgICAgICAkKCcuX2VyJykuc3R5bGUuYmFja2dyb3VuZENvbG9yID0gJ3doaXRlJzsKICAgICAgICAgICAgICAgICQoJy5fZXItdGl0bGUnKS5zdHlsZS5jb2xvciA9ICdibGFjayc7CiAgICAgICAgICAgICAgICAkKCcuX2VyLWNvbnRlbnQnKS5zdHlsZS5jb2xvciA9ICdibGFjayc7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgbG9jYWxTdG9yYWdlWydfZXItdGhlbWUnXSA9IHRoZW1lOwogICAgICAgICQoJy5fZXInKS5kYXRhc2V0Wyd0aGVtZSddID0gdGhlbWU7CiAgICB9CgogICAgLy8g5Yib5bu66ZiF6K+75ZmoCiAgICBmdW5jdGlvbiBjcmVhdGVSZWFkZXIoY29udGVudCkgewogICAgICAgICQoJyNfZXItZW50cnlSZWFkTW9kZScpICYmICQoJyNfZXItZW50cnlSZWFkTW9kZScpLnJlbW92ZSgpOwogICAgICAgICQoJyNfZXItTm90U2hvd1JlYWRNb2RlJykgJiYgJCgnI19lci1Ob3RTaG93UmVhZE1vZGUnKS5yZW1vdmUoKTsKICAgICAgICBhZGRDbGFzc0FuZERvbSgpOwogICAgICAgIGlmICh3aW5kb3cuU3BlZWNoU3ludGhlc2lzVXR0ZXJhbmNlKSB7CiAgICAgICAgICAgICQoJyNfZXItdHRzJykuc3R5bGUuZGlzcGxheSA9ICdibG9jayc7CiAgICAgICAgfQogICAgICAgIGlmIChsb2NhbFN0b3JhZ2VbJ19lci10aGVtZSddKSB7CiAgICAgICAgICAgIHNldFRoZW1lKGxvY2FsU3RvcmFnZVsnX2VyLXRoZW1lJ10pOwogICAgICAgIH0KICAgICAgICAkKCcuX2VyLXRpdGxlJykuaW5uZXJUZXh0ID0gY29udGVudC50aXRsZTsKICAgICAgICB2YXIgY29udGVudEFyciA9IGNvbnRlbnQuY29udGVudC5zcGxpdCgnXG4nKTsKICAgICAgICB2YXIgY29udGVudEh0bWwgPSAnJzsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNvbnRlbnRBcnIubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgdmFyIGxpbmUgPSBjb250ZW50QXJyW2ldOwogICAgICAgICAgICBpZiAobGluZSkgewogICAgICAgICAgICAgICAgY29udGVudEh0bWwgKz0gJzxzcGFuPicgKyBsaW5lICsgJzwvc3Bhbj4nOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGNvbnRlbnRIdG1sICs9ICc8YnI+JzsKICAgICAgICB9CiAgICAgICAgJCgnLl9lci1jb250ZW50JykuaW5uZXJIVE1MID0gY29udGVudEh0bWw7CiAgICAgICAgdmFyIHNwYW5Ob2RlcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5fZXItY29udGVudCBzcGFuJyk7CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzcGFuTm9kZXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgc3Bhbk5vZGVzW2ldLm9uY2xpY2sgPSBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgc3Bhbk5vZGVzLmxlbmd0aDsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgc3Bhbk5vZGVzW2pdLmNsYXNzTGlzdC5yZW1vdmUoJ19lci1jdXJyZW50Jyk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB0aGlzLmNsYXNzTGlzdC5hZGQoJ19lci1jdXJyZW50Jyk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgLy8g5oyC5o6l6ZSu55uY5LqL5Lu277yM5a6e546w6ZSu55uY5LiK5LiL5bem5Y+z5YiH5o2i6ZiF6K+75Yqf6IO9CiAgICAgICAgJCgnYm9keScpLm9ua2V5ZG93biA9IGZ1bmN0aW9uKGUpIHsKICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKICAgICAgICAgICAgc3dpdGNoIChlLmtleUNvZGUgfHwgZS53aGljaCB8fCBlLmNoYXJDb2RlKSB7CiAgICAgICAgICAgICAgICBjYXNlIDM4OiAvLyB1cAogICAgICAgICAgICAgICAgICAgIGlmIChlLmN0cmxLZXkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgJCgnLl9lcicpLnNjcm9sbFRvcCA9ICQoJy5fZXInKS5zY3JvbGxUb3AgLSAoZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmNsaWVudEhlaWdodCAtIDI0KQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRvUHJldlJlYWRQb3MoKTsKICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlUmVhZFBvcygpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgNDA6IC8vIGRvd24KICAgICAgICAgICAgICAgICAgICBpZiAoZS5jdHJsS2V5KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICQoJy5fZXInKS5zY3JvbGxUb3AgPSAkKCcuX2VyJykuc2Nyb2xsVG9wICsgKGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5jbGllbnRIZWlnaHQgLSAyNCk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgdG9OZXh0UmVhZFBvcygpOwogICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVSZWFkUG9zKCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAzNzogLy8gbGVmdAogICAgICAgICAgICAgICAgICAgIGlmIChlLmN0cmxLZXkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdG9QcmV2UGFnZSgpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICQoJy5fZXInKS5zY3JvbGxUb3AgPSAkKCcuX2VyJykuc2Nyb2xsVG9wIC0gKGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5jbGllbnRIZWlnaHQgLSAyNCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAzOTogLy8gcmlnaHQKICAgICAgICAgICAgICAgICAgICBpZiAoZS5jdHJsS2V5KSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRvTmV4dFBhZ2UoKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAkKCcuX2VyJykuc2Nyb2xsVG9wID0gJCgnLl9lcicpLnNjcm9sbFRvcCArIChkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuY2xpZW50SGVpZ2h0IC0gMjQpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwoKICAgICAgICAgICAgZnVuY3Rpb24gdG9QcmV2UGFnZSgpIHsKICAgICAgICAgICAgICAgIGlmIChjb250ZW50LnBhZ2V1cCkgewogICAgICAgICAgICAgICAgICAgIGxvY2FsU3RvcmFnZVsnX2VyLWVuYWJsZSddID0gJ3RydWUnOwogICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLmhyZWYgPSBjb250ZW50LnBhZ2V1cDsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgYWxlcnQoJ+W+iOaKseatie+8jOayoeacieWMuemFjeWIsOS4iuS4gOmhte+8gScpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICBmdW5jdGlvbiB0b05leHRQYWdlKCkgewogICAgICAgICAgICAgICAgaWYgKGNvbnRlbnQucGFnZWRvd24pIHsKICAgICAgICAgICAgICAgICAgICBsb2NhbFN0b3JhZ2VbJ19lci1lbmFibGUnXSA9ICd0cnVlJzsKICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmID0gY29udGVudC5wYWdlZG93bjsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgYWxlcnQoJ+W+iOaKseatie+8jOayoeacieWMuemFjeWIsOS4i+S4gOmhte+8gScpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfTsKICAgICAgICAkKCcuX2VyLWNvbnRlbnQnKS5vbmNsaWNrID0gZnVuY3Rpb24oZSkgeyAvLyDpgILnlKjkuo7loqjmsLTlsY/nmoTlt6blj7Pngrnlh7vml6DliqjnlLvnv7vpobUKICAgICAgICAgICAgdmFyIHggPSBlLnBhZ2VYOwogICAgICAgICAgICB2YXIgd2lkdGggPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuY2xpZW50V2lkdGg7CiAgICAgICAgICAgIGlmICh4IDw9IHdpZHRoICogMC4xKSB7IC8vIOWJjee/u+S4gOmhtQogICAgICAgICAgICAgICAgJCgnLl9lcicpLnNjcm9sbFRvcCA9ICQoJy5fZXInKS5zY3JvbGxUb3AgLSAoZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmNsaWVudEhlaWdodCAtIDI0KQogICAgICAgICAgICB9IGVsc2UgaWYgKHggPj0gd2lkdGggKiAwLjkpIHsgLy8g5ZCO57+75LiA6aG1CiAgICAgICAgICAgICAgICAkKCcuX2VyJykuc2Nyb2xsVG9wID0gJCgnLl9lcicpLnNjcm9sbFRvcCArIChkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuY2xpZW50SGVpZ2h0IC0gMjQpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgICQoJyNfZXItcGFnZWluZGV4Jykub25jbGljayA9IGZ1bmN0aW9uKCkgewogICAgICAgICAgICBpZiAoY29udGVudC5wYWdlaW5kZXgpIHsKICAgICAgICAgICAgICAgIGxvY2F0aW9uLmhyZWYgPSBjb250ZW50LnBhZ2VpbmRleDsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGFsZXJ0KCflvojmirHmrYnvvIzmsqHmnInljLnphY3liLDnm67lvZXvvIEnKTsKICAgICAgICAgICAgfQogICAgICAgIH07CiAgICAgICAgJCgnI19lci1zd2l0Y2gtdGhlbWUnKS5vbmNsaWNrID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIHZhciBjdXJyZW50ID0gJCgnLl9lcicpLmRhdGFzZXRbJ3RoZW1lJ10gfHwgJ3doaXRlJzsKICAgICAgICAgICAgdmFyIHRoZW1lTGlzdCA9IFsnd2hpdGUnLCAnS2hha2knLCAnT2xpdmVEcmFiJywgJ2JsYWNrJ107CiAgICAgICAgICAgIHZhciBpbmRleCA9IHRoZW1lTGlzdC5pbmRleE9mKGN1cnJlbnQpOwogICAgICAgICAgICBpZiAoaW5kZXggPT09IC0xKSBpbmRleCA9IDA7CiAgICAgICAgICAgIGluZGV4Kys7CiAgICAgICAgICAgIGlmIChpbmRleCA+PSB0aGVtZUxpc3QubGVuZ3RoKSB7CiAgICAgICAgICAgICAgICBpbmRleCA9IDA7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2V0VGhlbWUodGhlbWVMaXN0W2luZGV4XSk7CiAgICAgICAgfQogICAgICAgICQoJyNfZXItcGFnZXVwJykub25jbGljayA9IGZ1bmN0aW9uKCkgewogICAgICAgICAgICBpZiAoY29udGVudC5wYWdldXApIHsKICAgICAgICAgICAgICAgIGxvY2FsU3RvcmFnZVsnX2VyLWVuYWJsZSddID0gJ3RydWUnOwogICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZiA9IGNvbnRlbnQucGFnZXVwOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgYWxlcnQoJ+W+iOaKseatie+8jOayoeacieWMuemFjeWIsOS4iuS4gOmhte+8gScpOwogICAgICAgICAgICB9CiAgICAgICAgfTsKICAgICAgICAkKCcjX2VyLXBhZ2Vkb3duJykub25jbGljayA9IGZ1bmN0aW9uKCkgewogICAgICAgICAgICBpZiAoY29udGVudC5wYWdlZG93bikgewogICAgICAgICAgICAgICAgbG9jYWxTdG9yYWdlWydfZXItZW5hYmxlJ10gPSAndHJ1ZSc7CiAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmID0gY29udGVudC5wYWdlZG93bjsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGFsZXJ0KCflvojmirHmrYnvvIzmsqHmnInljLnphY3liLDkuIvkuIDpobXvvIEnKTsKICAgICAgICAgICAgfQogICAgICAgIH07CiAgICAgICAgJCgnI19lci1wYWdlZG93bicpLmRhdGFzZXRbJ25leHR1cmwnXSA9IGNvbnRlbnQucGFnZWRvd247CiAgICAgICAgc2V0Rm9udFNpemUoKTsKCiAgICAgICAgLy8g5oyJ6ZKu5LqL5Lu25aSE55CGCiAgICAgICAgJCgnI19lci1jbG9zZScpLm9uY2xpY2sgPSByZW1vdmVEb207CiAgICAgICAgJCgnI19lci1mb250LXBsdXMnKS5vbmNsaWNrID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIGZvbnRzaXplICs9IDI7CiAgICAgICAgICAgIHNldEZvbnRTaXplKCk7CiAgICAgICAgfTsKICAgICAgICAkKCcjX2VyLWZvbnQtbWludXMnKS5vbmNsaWNrID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIGZvbnRzaXplIC09IDI7CiAgICAgICAgICAgIHNldEZvbnRTaXplKCk7CiAgICAgICAgfTsKCiAgICAgICAgJCgnI19lci10dHMnKS5vbmNsaWNrID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmRhdGFzZXRbJ3BhdXNlJ10gPT09ICd0cnVlJykgewogICAgICAgICAgICAgICAgLy8g5byA5aeL5pKt5pS+CiAgICAgICAgICAgICAgICB0aGlzLmlubmVyVGV4dCA9ICflgZzmraInOwogICAgICAgICAgICAgICAgdGhpcy5kYXRhc2V0WydwYXVzZSddID0gJ2ZhbHNlJzsKICAgICAgICAgICAgICAgIHBsYXlOZXh0VGV4dCgpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdGhpcy5pbm5lclRleHQgPSAn5ZCs5LmmJzsKICAgICAgICAgICAgICAgIHRoaXMuZGF0YXNldFsncGF1c2UnXSA9ICd0cnVlJzsKICAgICAgICAgICAgfQogICAgICAgIH07CgogICAgICAgIGlmIChhdXRvcGxheSkgewogICAgICAgICAgICAkKCcjX2VyLXR0cycpLmlubmVyVGV4dCA9ICflgZzmraInOwogICAgICAgICAgICAkKCcjX2VyLXR0cycpLmRhdGFzZXRbJ3BhdXNlJ10gPSAnZmFsc2UnOwogICAgICAgICAgICBwbGF5TmV4dFRleHQoKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAkKCcjX2VyLXR0cycpLmRhdGFzZXRbJ3BhdXNlJ10gPSAndHJ1ZSc7CiAgICAgICAgfQogICAgfQoKICAgIC8vIOWQrOS5puWKn+iDvQogICAgZnVuY3Rpb24gcGxheU5leHRUZXh0KCkgewogICAgICAgIHVwZGF0ZVJlYWRQb3MoKTsKICAgICAgICB2YXIgY3VycmVudCA9ICQoJy5fZXItY3VycmVudCcpOwogICAgICAgIHZhciBwbGF5VGV4dCA9ICcnOwogICAgICAgIGlmIChjdXJyZW50KSB7CiAgICAgICAgICAgIHBsYXlUZXh0ID0gY3VycmVudC5pbm5lclRleHQ7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgcGxheVRleHQgPSAkKCcuX2VyLXRpdGxlJykuaW5uZXJUZXh0OwogICAgICAgIH0KICAgICAgICBpZiAocGxheVRleHQpIHsKICAgICAgICAgICAgdmFyIHV0dGVyVGhpcyA9IG5ldyBTcGVlY2hTeW50aGVzaXNVdHRlcmFuY2UoKTsKICAgICAgICAgICAgdXR0ZXJUaGlzLnRleHQgPSBwbGF5VGV4dDsKICAgICAgICAgICAgdXR0ZXJUaGlzLm9uZXJyb3IgPSBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgICQoJyNfZXItdHRzJykuZGF0YXNldFsncGF1c2UnXSA9ICd0cnVlJzsKICAgICAgICAgICAgICAgIGFsZXJ0KCJUVFPor63pn7PovazmjaLmloflrZflh7rnjrDlvILluLjvvIzlkKzkuablt7LlgZzmraLov5DooYzvvIEiKTsKICAgICAgICAgICAgfTsKICAgICAgICAgICAgdXR0ZXJUaGlzLm9uZW5kID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB0b05leHRSZWFkUG9zKCk7CiAgICAgICAgICAgICAgICBpZiAoISQoJy5fZXItY3VycmVudCcpKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIG5leHRVcmwgPSAkKCcjX2VyLXBhZ2Vkb3duJykuZGF0YXNldFsnbmV4dHVybCddOwogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKG5leHRVcmwpOwogICAgICAgICAgICAgICAgICAgIGlmIChuZXh0VXJsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsU3RvcmFnZVsnX2VyLWF1dG9wbGF5J10gPSAndHJ1ZSc7CiAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsU3RvcmFnZVsnX2VyLWVuYWJsZSddID0gJ3RydWUnOwogICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmID0gbmV4dFVybDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKCQoJyNfZXItdHRzJykuZGF0YXNldFsncGF1c2UnXSA9PT0gJ2ZhbHNlJykgewogICAgICAgICAgICAgICAgICAgIHBsYXlOZXh0VGV4dCgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwogICAgICAgICAgICBzcGVlY2hTeW50aGVzaXMuc3BlYWsodXR0ZXJUaGlzKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB0b05leHRSZWFkUG9zKCk7CiAgICAgICAgICAgIHBsYXlOZXh0VGV4dCgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0b05leHRSZWFkUG9zKCkgewogICAgICAgIHZhciBjdXJyZW50ID0gJCgnLl9lci1jdXJyZW50Jyk7CiAgICAgICAgdmFyIG5leHRTcGFuID0gbnVsbDsKICAgICAgICBpZiAoY3VycmVudCkgewogICAgICAgICAgICBuZXh0U3BhbiA9IGN1cnJlbnQubmV4dEVsZW1lbnRTaWJsaW5nOwogICAgICAgICAgICB3aGlsZSAobmV4dFNwYW4gJiYgbmV4dFNwYW4ubm9kZU5hbWUgIT09ICdTUEFOJykgewogICAgICAgICAgICAgICAgbmV4dFNwYW4gPSBuZXh0U3Bhbi5uZXh0RWxlbWVudFNpYmxpbmc7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBuZXh0U3BhbiA9ICQoJy5fZXItY29udGVudCBzcGFuJyk7CiAgICAgICAgfQogICAgICAgIGlmIChjdXJyZW50KSBjdXJyZW50LmNsYXNzTGlzdC5yZW1vdmUoJ19lci1jdXJyZW50Jyk7CiAgICAgICAgaWYgKG5leHRTcGFuKSBuZXh0U3Bhbi5jbGFzc0xpc3QuYWRkKCdfZXItY3VycmVudCcpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRvUHJldlJlYWRQb3MoKSB7CiAgICAgICAgdmFyIGN1cnJlbnQgPSAkKCcuX2VyLWN1cnJlbnQnKTsKICAgICAgICB2YXIgcHJldlNwYW4gPSBudWxsOwogICAgICAgIGlmIChjdXJyZW50KSB7CiAgICAgICAgICAgIHByZXZTcGFuID0gY3VycmVudC5wcmV2aW91c0VsZW1lbnRTaWJsaW5nOwogICAgICAgICAgICB3aGlsZSAocHJldlNwYW4gJiYgcHJldlNwYW4ubm9kZU5hbWUgIT09ICdTUEFOJykgewogICAgICAgICAgICAgICAgcHJldlNwYW4gPSBwcmV2U3Bhbi5wcmV2aW91c0VsZW1lbnRTaWJsaW5nOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmIChjdXJyZW50KSBjdXJyZW50LmNsYXNzTGlzdC5yZW1vdmUoJ19lci1jdXJyZW50Jyk7CiAgICAgICAgaWYgKHByZXZTcGFuKSBwcmV2U3Bhbi5jbGFzc0xpc3QuYWRkKCdfZXItY3VycmVudCcpOwogICAgfQoKICAgIGZ1bmN0aW9uIHVwZGF0ZVJlYWRQb3MoKSB7CiAgICAgICAgaWYgKCQoJy5fZXItY3VycmVudCcpKQogICAgICAgICAgICAkKCcuX2VyJykuc2Nyb2xsVG9wID0gJCgnLl9lci1jdXJyZW50Jykub2Zmc2V0VG9wIC0gKGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5jbGllbnRIZWlnaHQgLyAyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRGb250U2l6ZSgpIHsKICAgICAgICBsb2NhbFN0b3JhZ2VbIl9lcl9mb250c2l6ZSJdID0gZm9udHNpemU7CiAgICAgICAgJCgnLl9lci10aXRsZScpLnN0eWxlLmZvbnRTaXplID0gKDIwICsgZm9udHNpemUpICsgJ3B4JzsKICAgICAgICAkKCcuX2VyLXRpdGxlJykuc3R5bGUubGluZUhlaWdodCA9ICgoMjAgKyBmb250c2l6ZSkgKiAxLjUpICsgJ3B4JzsKICAgICAgICAkKCcuX2VyLWNvbnRlbnQnKS5zdHlsZS5mb250U2l6ZSA9ICgxNCArIGZvbnRzaXplKSArICdweCc7CiAgICAgICAgJCgnLl9lci1jb250ZW50Jykuc3R5bGUubGluZUhlaWdodCA9ICgoMTQgKyBmb250c2l6ZSkgKiAxLjUpICsgJ3B4JzsKICAgIH0KCiAgICB2YXIgb2xkT3ZlcmZsb3cgPSAnJzsKICAgIHZhciBvbGRPbktleURvd24gPSAkKCdib2R5Jykub25rZXlkb3duOwoKICAgIGZ1bmN0aW9uIHJlbW92ZURvbSgpIHsKICAgICAgICAkKCcuX2VyJykucmVtb3ZlKCk7CiAgICAgICAgJCgnYm9keScpLnN0eWxlLm92ZXJmbG93ID0gb2xkT3ZlcmZsb3c7CiAgICAgICAgJCgnYm9keScpLm9ua2V5ZG93biA9IG9sZE9uS2V5RG93bjsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRDbGFzc0FuZERvbSgpIHsKICAgICAgICBvbGRPdmVyZmxvdyA9ICQoJ2JvZHknKS5zdHlsZS5vdmVyZmxvdzsKICAgICAgICAkKCdib2R5Jykuc3R5bGUub3ZlcmZsb3cgPSAnaGlkZGVuJzsKCiAgICAgICAgJCgnYm9keScpLmNoaWxkcmVuWzBdLmluc2VydEFkamFjZW50SFRNTCgnYmVmb3JlQmVnaW4nLAogICAgICAgICAgICAnPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCxpbml0aWFsLXNjYWxlPTEsbWF4aW11bS1zY2FsZT0xLG1pbmltdW0tc2NhbGU9MSx1c2VyLXNjYWxhYmxlPW5vIj48ZGl2IGNsYXNzPSJfZXIiPicgKwogICAgICAgICAgICAnICAgIDxkaXYgY2xhc3M9Il9lci10dHMiPicgKwogICAgICAgICAgICAnICAgICAgICA8YnV0dG9uIHR5cGU9ImJ1dHRvbiIgaWQ9Il9lci10dHMiPuWQrOS5pjwvYnV0dG9uPicgKwogICAgICAgICAgICAnICAgIDwvZGl2PicgKwogICAgICAgICAgICAnICAgIDxkaXYgY2xhc3M9Il9lci10b29scyI+JyArCiAgICAgICAgICAgICcgICAgICAgIDxidXR0b24gdHlwZT0iYnV0dG9uIiBpZD0iX2VyLXBhZ2VpbmRleCI+55uu5b2VPC9idXR0b24+JyArCiAgICAgICAgICAgICcgICAgICAgIDxidXR0b24gdHlwZT0iYnV0dG9uIiBpZD0iX2VyLXN3aXRjaC10aGVtZSI+5YiH5o2i5Li76aKYPC9idXR0b24+JyArCiAgICAgICAgICAgICcgICAgICAgIDxidXR0b24gdHlwZT0iYnV0dG9uIiBpZD0iX2VyLWZvbnQtcGx1cyI+5a2X5Y+3KzwvYnV0dG9uPicgKwogICAgICAgICAgICAnICAgICAgICA8YnV0dG9uIHR5cGU9ImJ1dHRvbiIgaWQ9Il9lci1mb250LW1pbnVzIj7lrZflj7ctPC9idXR0b24+JyArCiAgICAgICAgICAgICcgICAgICAgIDxidXR0b24gdHlwZT0iYnV0dG9uIiBpZD0iX2VyLWNsb3NlIj7ov5Tlm57ljp/nvZHpobU8L2J1dHRvbj4nICsKICAgICAgICAgICAgJyAgICA8L2Rpdj4nICsKICAgICAgICAgICAgJyAgICA8ZGl2IGNsYXNzPSJfZXItdGl0bGUiPjwvZGl2PicgKwogICAgICAgICAgICAnICAgIDxkaXYgY2xhc3M9Il9lci1jb250ZW50Ij4nICsKICAgICAgICAgICAgJyAgICA8L2Rpdj4nICsKICAgICAgICAgICAgJyAgICA8ZGl2IGNsYXNzPSJfZXItdG9vbHMiPicgKwogICAgICAgICAgICAnICAgICAgICA8YnV0dG9uIHR5cGU9ImJ1dHRvbiIgaWQ9Il9lci1wYWdldXAiPuS4iuS4gOmhtTwvYnV0dG9uPicgKwogICAgICAgICAgICAnICAgICAgICA8YnV0dG9uIHR5cGU9ImJ1dHRvbiIgaWQ9Il9lci1wYWdlZG93biI+5LiL5LiA6aG1PC9idXR0b24+JyArCiAgICAgICAgICAgICcgICAgPC9kaXY+JyArCiAgICAgICAgICAgICc8L2Rpdj4nKTsKICAgICAgICAkKCdib2R5JykuY2hpbGRyZW5bMF0uaW5zZXJ0QWRqYWNlbnRIVE1MKCdiZWZvcmVCZWdpbicsCiAgICAgICAgICAgICc8c3R5bGU+JyArCiAgICAgICAgICAgICcuX2VyeycgKwogICAgICAgICAgICAnICAgIHBvc2l0aW9uOiBmaXhlZDsnICsKICAgICAgICAgICAgJyAgICBsZWZ0OiAwOycgKwogICAgICAgICAgICAnICAgIHJpZ2h0OiAwOycgKwogICAgICAgICAgICAnICAgIHRvcDogMDsnICsKICAgICAgICAgICAgJyAgICBib3R0b206IDA7JyArCiAgICAgICAgICAgICcgICAgb3ZlcmZsb3c6IGF1dG87JyArCiAgICAgICAgICAgICcgICAgYmFja2dyb3VuZC1jb2xvcjogd2hpdGU7JyArCiAgICAgICAgICAgICcgICAgei1pbmRleDogMjAxOTAxMjcyMjExOycgKwogICAgICAgICAgICAnfScgKwogICAgICAgICAgICAnLl9lci10aXRsZXsnICsKICAgICAgICAgICAgJyAgICB0ZXh0LWFsaWduOiBjZW50ZXI7JyArCiAgICAgICAgICAgICcgICAgZm9udC1zaXplOiAyMHB4OycgKwogICAgICAgICAgICAnICAgIGxpbmUtaGVpZ2h0OiAzMHB4OycgKwogICAgICAgICAgICAnICAgIGZvbnQtd2VpZ2h0OiA5MDA7JyArCiAgICAgICAgICAgICcgICAgcGFkZGluZzogMTBweCA1JTsnICsKICAgICAgICAgICAgJyAgICBjb2xvcjogYmxhY2s7JyArCiAgICAgICAgICAgICd9JyArCiAgICAgICAgICAgICcuX2VyLWNvbnRlbnR7JyArCiAgICAgICAgICAgICcgICAgcGFkZGluZzogMTBweCA1JTsnICsKICAgICAgICAgICAgJyAgICBmb250LXNpemU6IDE0cHg7JyArCiAgICAgICAgICAgICcgICAgbGluZS1oZWlnaHQ6IDIxcHg7JyArCiAgICAgICAgICAgICcgICAgY29sb3I6IGJsYWNrOycgKwogICAgICAgICAgICAnfScgKwogICAgICAgICAgICAnLl9lci10b29sc3snICsKICAgICAgICAgICAgJyAgICBtYXJnaW4tdG9wOiAxMHB4OycgKwogICAgICAgICAgICAnICAgIG1hcmdpbi1ib3R0b206IDEwcHg7JyArCiAgICAgICAgICAgICcgICAgdGV4dC1hbGlnbjogY2VudGVyOycgKwogICAgICAgICAgICAnfScgKwogICAgICAgICAgICAnLl9lci10b29scyBidXR0b257JyArCiAgICAgICAgICAgICcgICAgY3Vyc29yOiBwb2ludGVyOycgKwogICAgICAgICAgICAnICAgIGNvbG9yOiBibGFjazsnICsKICAgICAgICAgICAgJyAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjOTA4RTkwOycgKwogICAgICAgICAgICAnICAgIGJvcmRlcjogMXB4IHNvbGlkIGJsYWNrOycgKwogICAgICAgICAgICAnICAgIHBhZGRpbmc6IDVweDsnICsKICAgICAgICAgICAgJyAgICBib3JkZXItcmFkaXVzOiAxMHB4OycgKwogICAgICAgICAgICAnfScgKwogICAgICAgICAgICAnLl9lci10dHMgYnV0dG9ueycgKwogICAgICAgICAgICAnICAgIHdpZHRoOiA1MHB4OycgKwogICAgICAgICAgICAnICAgIGhlaWdodDogNTBweDsnICsKICAgICAgICAgICAgJyAgICBwb3NpdGlvbjogZml4ZWQ7JyArCiAgICAgICAgICAgICcgICAgcmlnaHQ6IDE1cHg7JyArCiAgICAgICAgICAgICcgICAgYm90dG9tOiAxNXB4OycgKwogICAgICAgICAgICAnICAgIHotaW5kZXg6IDIwMTkwMTI3MjIxMjsnICsKICAgICAgICAgICAgJyAgICBjb2xvcjogYmxhY2s7JyArCiAgICAgICAgICAgICcgICAgYm9yZGVyOiAxcHggc29saWQgYmxhY2s7JyArCiAgICAgICAgICAgICcgICAgb3BhY2l0eTogMC41OycgKwogICAgICAgICAgICAnICAgIGN1cnNvcjogcG9pbnRlcjsnICsKICAgICAgICAgICAgJyAgICBib3JkZXItcmFkaXVzOiAyNXB4OycgKwogICAgICAgICAgICAnICAgIGRpc3BsYXk6IG5vbmU7JyArCiAgICAgICAgICAgICd9JyArCiAgICAgICAgICAgICcuX2VyLWN1cnJlbnR7JyArCiAgICAgICAgICAgIC8vJyAgICBiYWNrZ3JvdW5kLWNvbG9yOiB5ZWxsb3c7JyArCiAgICAgICAgICAgIC8vJyAgICBjb2xvcjogYmxhY2s7JyArCiAgICAgICAgICAgICd9JyArCiAgICAgICAgICAgICc8L3N0eWxlPicpOwogICAgfQp9KSgpOw==
Add Comment
Please, Sign In to add comment