Advertisement
xiaomianao666

邀您一起看:详情页面

Sep 30th, 2024
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥详情页面@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIumhtemdolwiLFwicGF0aFwiOlwiY29uZmlnLmh0bWxcIixcInJ1bGVcIjpcImNvbnN0IGVtcHR5ID0gJ2hpa2VyOi8vZW1wdHknXFxuY29uc3QgcGFnZSA9IE1ZX1BBR0U7XFxuXFxuY29uc3QgQ29sb3IgPSAodGVzdCkgPT4ge1xcbiAgICByZXR1cm4gJzxmb250IGNvbG9yPVxcXCIjRkE3Mjk4XFxcIj4nICsgdGVzdCArICc8L2Zyb250Pic7XFxufVxcblxcbmNvbnN0IFNwcmluZ0dyZWVuID0gKHRlc3QpID0+IHtcXG4gICAgcmV0dXJuICc8Zm9udCBjb2xvcj1cXFwiIzNDQjM3MVxcXCI+JyArIHRlc3QgKyAnPC9mcm9udD4nO1xcbn1cXG5cXG5jb25zdCBTdHJvbmcgPSAodGVzdCkgPT4ge1xcbiAgICByZXR1cm4gJzxzdHJvbmc+JyArIHRlc3QgKyAnPC9zdHJvbmc+JztcXG59XFxuXFxuY29uc3QgU21hbGwgPSAodGVzdCkgP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ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+WIhuexuycsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+exu0lEJywgaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVtcHR5O1xcbiAgICAgICAgICAgICAgICB9LCBlbXB0eSwgaSwgaWQpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBjb250bGlzdFtpXSA9IFtdO1xcbiAgICAgICAgY29udHMgPSB0YWIudGFncztcXG4gICAgICAgIGNvbnRzLmZvckVhY2goY29udCA9PiB7XFxuICAgICAgICAgICAgY29udGxpc3RbaV0ucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjb250Lm5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogY29udC5JRFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgY29uc3QgY2F0ZWdvcnkgPSBnZXRNeVZhcign57G7SUQnLCAnJyArIHRhYnNbMF0uY2F0ZWdvcnlJRCArICcnKVxcbiAgICBjb25zdCBpbmRleCA9IGdldE15VmFyKCfliIbnsbsnLCAnMCcpXFxuICAgIGlmIChjb250bGlzdFtpbmRleF0ubGVuZ3RoKSB7XFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGNvbnRsaXN0W2luZGV4XS5mb3JFYWNoKChjb250c2xpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcihpbmRleCwgJzAnKSA9PSBpID8gUmljaChTdHJvbmcoQ29sb3IoY29udHNsaXN0LnRpdGxlKSkpIDogY29udHNsaXN0LnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpbmRleCwgZW1wdHksIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdQYWdlJylcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihpbmRleCwgaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpbmRleCwgZW1wdHksIGkpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgaWQgPSBjb250bGlzdFtpbmRleF1bZ2V0TXlWYXIoaW5kZXgsICcwJyldLnVybFxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgaWQgPSAnJ1xcbiAgICB9XFxuICAgIHNvcnRUeXBlUGFyc2UoZClcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgICAgZ2V0SWNvblNlYXJjaChkKVxcbiAgICAgICAgcGF0aCA9ICcvcG9zdC9saXN0L0FORFJPSUQvNC4xLjgnXFxuICAgICAgICBib2R5ID0gJyZzdGFydD0wJmNvdW50PTIwJmNhdF9pZD0nICsgY2F0ZWdvcnkgKyAnJnRhZ19pZD0nICsgaWQgKyAnJnNvcnRfYnk9JyArIHNvcnRUeXBlXFxuICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxuICAgICAgICBsYXlvdXRQYXJzZShkLCBkYXRlLCBpZCwgc29ydFR5cGUsIGNhdGVnb3J5KVxcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKVxcbn1cXG5cXG5jb25zdCBzb3J0VHlwZVBhcnNlID0gKGQpID0+IHtcXG4gICAg5o6S5bqPID0gWyfmjInlm57lpI3ml7bpl7QnLCAn5oyJ5pys54mI57K+5Y2OJywgJ+aMieWPkeW4g+aXtumXtCddO1xcbiAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgICAgICB9KVxcbiAgICAgICAg5o6S5bqPLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0gPT0gZ2V0TXlWYXIoJ+aOkuW6jycsIOaOkuW6j1swXSkgPyBSaWNoKFN0cm9uZyhDb2xvcihpdGVtKSkpIDogaXRlbSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpdGVtLCBlbXB0eSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign5o6S5bqPJywgaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVtcHR5O1xcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBlbXB0eSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBzd2l0Y2ggKGdldE15VmFyKCfmjpLluo8nLCDmjpLluo9bMF0pKSB7XFxuICAgICAgICBjYXNlIOaOkuW6j1swXTpcXG4gICAgICAgICAgICBzb3J0VHlwZSA9IDBcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2Ug5o6S5bqPWzFdOlxcbiAgICAgICAgICAgIHNvcnRUeXBlID0gMlxcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSDmjpLluo9bMl06XFxuICAgICAgICAgICAgc29ydFR5cGUgPSAxXFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgIH1cXG59XFxuXFxuY29uc3QgbGF5b3V0UGFyc2UgPSAoZCwgZGF0YSwgaWQsIHNvcnRUeXBlLCBjYXRlZ29yeSkgPT4ge1xcbiAgICBhZGRMaXN0ZW5lcignb25SZWZyZXNoJywgKCkgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxuICAgIH0pXFxuICAgIGlmIChkYXRhLnBvc3RzLmxlbmd0aCkge1xcbiAgICAgICAgZGF0YS5wb3N0cy5mb3JFYWNoKGRhdGUgPT4ge1xcbiAgICAgICAgICAgIHVzZXJJRCA9IGRhdGUudXNlci51c2VySURcXG4gICAgICAgICAgICBuaWNrID0gZGF0ZS51c2VyLm5pY2tcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmljayArICdcXFxcdFxcXFx0JyArIFNtYWxsKENvbG9yKGdldEZvcm1hdChkYXRlLmNyZWF0ZVRpbWUpKSksXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGRhdGUudXNlci5hdmF0YXIsXFxuICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSkucnVsZSgodXNlcklELCBuaWNrKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBNWV9QQUdFID0gMVxcbiAgICAgICAgICAgICAgICAgICAgc29ydFR5cGUgPSAnJ1xcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcnkgPSAnJ1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxuICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUobmljaylcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9jb25maWcuaHRtbCcpXFxuICAgICAgICAgICAgICAgICAgICBwYXRoID0gJy9wb3N0L2NyZWF0ZS9saXN0L0FORFJPSUQvNC4xLjgnXFxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gJyZzdGFydD0wJmNvdW50PTIwJnVzZXJfaWQ9JyArIHVzZXJJRFxcbiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGdldENvbmZpZ1VybChwYXRoLCBib2R5KVxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxuICAgICAgICAgICAgICAgICAgICBsYXlvdXRQYXJzZShkLCBkYXRlLCB1c2VySUQsIHNvcnRUeXBlLCBjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKVxcbiAgICAgICAgICAgICAgICB9LCB1c2VySUQsIG5pY2spLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcidcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHBvc3RJRCA9IGRhdGUucG9zdElEXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goR3JheShkYXRlLnRpdGxlKSksXFxuICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSArICdmeXBhZ2UnICsgJyNhdXRvQ2FjaGUjI2dhbWVUaGVtZSMnKS5ydWxlKChwb3N0SUQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9jb25maWcuaHRtbCcpXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkID0gW11cXG4gICAgICAgICAgICAgICAgICAgIHBsYXlVcmxQYXJzZShkLCBwb3N0SUQpXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgICAgICAgICAgfSwgcG9zdElEKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGltYWdlcyA9IGRhdGUuZGV0YWlsLm1hdGNoKC88aW1hZ2U+KC4qPyk8XFxcXC9pbWFnZT4vZylcXG4gICAgICAgICAgICAgICAgaW1hZ2VzID0gaW1hZ2VzLm1hcChpdGVtID0+IGl0ZW0ubWF0Y2goLzxpbWFnZT4oLio/KSwuKj88XFxcXC9pbWFnZT4vKVsxXSlcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGltYWdlcyA9IGRhdGUuaW1hZ2VzXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChpbWFnZXMubGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMzsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW1hZ2VzW2ldICE9IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWFnZXNbaV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaW1hZ2VzW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgICAgICBpZiAoZ2V0TXlWYXIoJ1BhZ2UnLCAnJykgPT0gJycpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogUmljaChTbWFsbChTcHJpbmdHcmVlbign772e772e772e5Yqg6L295pu05aSa772e772e772eJykpKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChkYXRhLCBpZCwgc29ydFR5cGUsIGNhdGVnb3J5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBNWV9QQUdFID0gMVxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2NvbmZpZy5odG1sJylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3J0VHlwZSA9PSAnJyAmJiBjYXRlZ29yeSA9PSAnJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGggPSAnL3Bvc3QvY3JlYXRlL2xpc3QvQU5EUk9JRC80LjEuOCdcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gJyZzdGFydD0nICsgZ2V0TXlWYXIoJ1BhZ2UnLCBkYXRhLnN0YXJ0KSArICcmY291bnQ9MjAmdXNlcl9pZD0nICsgaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGggPSAnL3Bvc3QvbGlzdC9BTkRST0lELzQuMS44J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSAnJnN0YXJ0PScgKyBnZXRNeVZhcignUGFnZScsIGRhdGEuc3RhcnQpICsgJyZjb3VudD0yMCZjYXRfaWQ9JyArIGNhdGVnb3J5ICsgJyZ0YWdfaWQ9JyArIGlkICsgJyZzb3J0X2J5PScgKyBzb3J0VHlwZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdQYWdlJywgZGF0ZS5zdGFydClcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGQgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgaWQsIHNvcnRUeXBlLCBjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUoJ1BhZ2UnICsgaWQsIGQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkYXRlLnBvc3RzLmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygnUGFnZUNscycgKyBpZClcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlbXB0eVxcbiAgICAgICAgICAgICAgICB9LCBkYXRhLCBpZCwgc29ydFR5cGUsIGNhdGVnb3J5KSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAnUGFnZScgKyBpZCxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ1BhZ2VDbHMnICsgaWQsXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBSaWNoKFNtYWxsKEdyYXkoJ++9nu+9nu+9nuaIkeaYr+acieW6lee6v+eahO+9nu+9nu+9nicpKSksXFxuICAgICAgICAgICAgdXJsOiBlbXB0eSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG59XFxuXFxuY29uc3QgbGF5b3V0U2VhcmNoUGFyc2UgPSAoZCwgZGF0YSkgPT4ge1xcbiAgICBpZiAoZGF0YS5sZW5ndGgpIHtcXG4gICAgICAgIGRhdGEuZm9yRWFjaChkYXRlID0+IHtcXG4gICAgICAgICAgICB1c2VySUQgPSBkYXRlLnVzZXIudXNlcklEXFxuICAgICAgICAgICAgbmljayA9IGRhdGUudXNlci5uaWNrXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5pY2sgKyAnXFxcXHRcXFxcdCcgKyBTbWFsbChDb2xvcihnZXRGb3JtYXQoZGF0ZS5jcmVhdGVUaW1lKSkpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBkYXRlLnVzZXIuYXZhdGFyLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoZW1wdHkpLnJ1bGUoKHVzZXJJRCwgbmljaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgTVlfUEFHRSA9IDFcXG4gICAgICAgICAgICAgICAgICAgIHNvcnRUeXBlID0gJydcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5ID0gJydcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKG5pY2spXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9ICcvcG9zdC9jcmVhdGUvbGlzdC9BTkRST0lELzQuMS44J1xcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9ICcmc3RhcnQ9MCZjb3VudD0yMCZ1c2VyX2lkPScgKyB1c2VySURcXG4gICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGQgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgdXNlcklELCBzb3J0VHlwZSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgICAgICAgICAgfSwgdXNlcklELCBuaWNrKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBwb3N0SUQgPSBkYXRlLnBvc3RJRFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKEdyYXkoZGF0ZS50aXRsZSkpLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoZW1wdHkgKyAnZnlwYWdlJyArICcjYXV0b0NhY2hlIyNnYW1lVGhlbWUjJykucnVsZSgocG9zdElEKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxuICAgICAgICAgICAgICAgICAgICBwbGF5VXJsUGFyc2UoZCwgcG9zdElEKVxcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxuICAgICAgICAgICAgICAgIH0sIHBvc3RJRCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpbWFnZXMgPSBkYXRlLmRldGFpbC5tYXRjaCgvPGltYWdlPiguKj8pPFxcXFwvaW1hZ2U+L2cpXFxuICAgICAgICAgICAgICAgIGltYWdlcyA9IGltYWdlcy5tYXAoaXRlbSA9PiBpdGVtLm1hdGNoKC88aW1hZ2U+KC4qPyksLio/PFxcXFwvaW1hZ2U+LylbMV0pXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBpbWFnZXMgPSBkYXRlLmltYWdlc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoaW1hZ2VzLmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDM7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGltYWdlc1tpXSAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1hZ2VzW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGltYWdlc1tpXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdjYXJkX3BpY18zJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTbWFsbChHcmF5KCfvvZ7vvZ7vvZ7miJHmmK/mnInlupXnur/nmoTvvZ7vvZ7vvZ4nKSkpLFxcbiAgICAgICAgICAgIHVybDogZW1wdHksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxufVxcblxcbmNvbnN0IHBsYXlVcmxQYXJzZSA9IChkLCBwb3N0SUQpID0+IHtcXG4gICAgc2V0UGFnZVRpdGxlKCfor6bmg4XpobXpnaInKVxcbiAgICBwYXRoID0gJy9wb3N0L2RldGFpbC9BTkRST0lELzQuMS44J1xcbiAgICBib2R5ID0gJyZwb3N0X2lkPScgKyBwb3N0SUQgKyAnJnBhZ2Vfbm89JyArIHBhZ2UgKyAnJnBhZ2Vfc2l6ZT0yMCZkb2M9MSdcXG4gICAgZGF0YSA9IGdldENvbmZpZ1VybChwYXRoLCBib2R5KVxcbiAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDYwOyBpKyspIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICBjZW50ZXJzID0gUmVnRXhwUGFyc2UoZGF0YS5wb3N0LmRldGFpbClcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8aDE+JyArIGRhdGEucG9zdC50aXRsZSArICc8L2gxPicgKyBTbWFsbChHcmF5KGNlbnRlcnMpKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXG4gICAgICAgIH0pXFxuICAgICAgICB2b2ljZSA9IGRhdGEucG9zdC52b2ljZVxcbiAgICAgICAgaWYgKHZvaWNlLmxlbmd0aCkge1xcbiAgICAgICAgICAgIHZvaWNlID0gSlNPTi5wYXJzZSh2b2ljZSlcXG4gICAgICAgICAgICB2aWRlbyA9IHZvaWNlLnZpZGVvaG9zdCArIHZvaWNlLnZpZGVvZmlkXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8cD48YSBocmVmPVxcXCInICsgdmlkZW8gKyAnI2lzVmlkZW89dHJ1ZSNcXFwiPlvngrnlh7vmn6XnnIvop4bpopFdPC9hPjwvcD4nLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgaW1hZ2VzID0gZGF0YS5wb3N0LmltYWdlc1xcbiAgICAgICAgaWYgKGltYWdlcy5sZW5ndGgpIHtcXG4gICAgICAgICAgICBpbWFnZXMuZm9yRWFjaChpbWFnZSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMjA7IGkrKykge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBpZiAoZGF0YS5jb21tZW50cy5sZW5ndGgpIHtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQmlnKCflhajpg6jor4TorrojJyArIGRhdGEucG9zdC5jb21tZW50Q291bnQgKyAn5p2hJykpKSxcXG4gICAgICAgICAgICAgICAgdXJsOiBlbXB0eSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgZGF0YS5jb21tZW50cy5mb3JFYWNoKGRhdGUgPT4ge1xcbiAgICAgICAgICAgIHJlZkNvbW1lbnQgPSBkYXRlLnJlZkNvbW1lbnRcXG4gICAgICAgICAgICBpZiAocmVmQ29tbWVudCAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIG5pY2tDb21tZW50ID0gcmVmQ29tbWVudC5uaWNrXFxuICAgICAgICAgICAgICAgIHJlZkNvbW1lbnQgPSAn5Zue5aSNXFxcXHQnICsgbmlja0NvbW1lbnQgKyAn77yaPGJyPicgKyBSZWdFeHBQYXJzZShyZWZDb21tZW50LnRleHQpXFxuICAgICAgICAgICAgICAgIHJlZkNvbW1lbnQgPSBcXFwiPGJsb2NrcXVvdGU+XFxcIiArIFNtYWxsKEdyYXkocmVmQ29tbWVudCkpICsgXFxcIjwvYmxvY2txdW90ZT5cXFwiXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmVmQ29tbWVudCA9ICcnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlzVG9wID0gJ+mhtue9ridcXG4gICAgICAgICAgICBpZiAoZGF0ZS5pc1RvcCAhPSAxKSBpc1RvcCA9IGRhdGUuc2VxICsgJ+alvCdcXG4gICAgICAgICAgICBjZW50ZXJzID0gUmVnRXhwUGFyc2UoZGF0ZS50ZXh0KVxcbiAgICAgICAgICAgIHVzZXJJRCA9IGRhdGUudXNlci51c2VySURcXG4gICAgICAgICAgICBuaWNrID0gZGF0ZS51c2VyLm5pY2tcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmljayArICdcXFxcdFxcXFx0JyArIFNtYWxsKFNwcmluZ0dyZWVuKGlzVG9wKSkgKyAnXFxcXHRcXFxcdCcgKyBTbWFsbChDb2xvcihnZXRGb3JtYXQoZGF0ZS5jcmVhdGVUaW1lKSkpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBkYXRlLnVzZXIuYXZhdGFyLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoZW1wdHkpLnJ1bGUoKHVzZXJJRCwgbmljaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgTVlfUEFHRSA9IDFcXG4gICAgICAgICAgICAgICAgICAgIHNvcnRUeXBlID0gJydcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5ID0gJydcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKG5pY2spXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9ICcvcG9zdC9jcmVhdGUvbGlzdC9BTkRST0lELzQuMS44J1xcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9ICcmc3RhcnQ9MCZjb3VudD0yMCZ1c2VyX2lkPScgKyB1c2VySURcXG4gICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGQgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgdXNlcklELCBzb3J0VHlwZSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgICAgICAgICAgfSwgdXNlcklELCBuaWNrKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogcmVmQ29tbWVudCArIFNtYWxsKEdyYXkoY2VudGVycykpLFxcbiAgICAgICAgICAgICAgICB1cmw6IGVtcHR5LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgaWYgKGRhdGUuaW1hZ2VzLmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICBkYXRlLmltYWdlcy5mb3JFYWNoKGltYWdlID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgI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JpY2goQ2VudGVyKFxcXCLnmbvlvZXotKblj7dcXFwiKSksXFxuICAgICAgICB1cmw6ICQoZW1wdHkpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBNWV9QQUdFID0gMVxcbiAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9jb25maWcuaHRtbCcpXFxuICAgICAgICAgICAgcmV0dXJuIGdldExvZ2luVXJsKClcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pXFxufVxcblxcbmNvbnN0IGdldFNlYXJjaFBhcnNlID0gKGQpID0+IHtcXG4gICAgc2V0UGFnZVRpdGxlKCfokavoiqbkvqDCt+aQnOe0oicpXFxuICAgIGFkZExpc3RlbmVyKCdvbkNsb3NlJywgKCkgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcihcXFwi5pCc57Si5YWz6ZSu6K+NXFxcIilcXG4gICAgfSlcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZ2V0SXRlbSgn6JGr6Iqm5L6gbmljaycpLFxcbiAgICAgICAgICAgIHBpY191cmw6IGdldEl0ZW0oJ+iRq+iKpuS+oGF2YXRhcicpLFxcbiAgICAgICAgICAgIHVybDogJChlbXB0eSkubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YCA5Ye655m75b2VXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXCLnoa7lrprlpb3kuoblkJfvvJ/lvZPliY3otKblj7flsIbkvJrpgIDlh7p+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oJ+iRq+iKpuS+oFRPS0VOJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6YCA5Ye65oiQ5YqfficpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXRcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcidcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJ/CflI0nLFxcbiAgICAgICAgICAgIGRlc2M6ICfor7fovpPlhaXluJblrZDlkI3np7Av5YWz6ZSu6K+NJyxcXG4gICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKGdldFNlYXJjaFVybCwgZW1wdHkpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ICE9ICcnKSBnZXRTZWFyY2hVcmwoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxuICAgICAgICAgICAgfSwgZ2V0U2VhcmNoVXJsLCBlbXB0eSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcign5pCc57Si5YWz6ZSu6K+NJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIGlmIChnZXRNeVZhcign5pCc57Si5YWz6ZSu6K+NJykgPT0gJycpIHtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBsZXQgbWVtID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwi6JGr6Iqm5L6gXFxcIiwgW10pO1xcbiAgICAgICAgICAgIGlmIChtZW0ubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goQmlnKCfwn5OdIOaQnOe0ouWOhuWPsicpKSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoZW1wdHksIGdldENvbmZpcm0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRDb25maXJtKClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBlbXB0eSwgZ2V0Q29uZmlybSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogUmljaChDZW50ZXIoXFxcIuWWguWWgn7ov5jmsqHmkJzntKLlkaLvvZ4o77+j4pa977+j772eKX5cXFwiKSksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGVtcHR5LFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IG1lbS5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBtZW1baV07XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGl0LCBnZXRTZWFyY2hVcmwsIGVtcHR5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScsIGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRTZWFyY2hVcmwoaXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpdCwgZ2V0U2VhcmNoVXJsLCBlbXB0eSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIlxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHBhdGggPSAnL3Bvc3Qvc2VhcmNoL0FORFJPSUQvNC4xLjgnXFxuICAgICAgICBib2R5ID0gJyZzdGFydD0nICsgKHBhZ2UgLSAxKSAqIDIwICsgJyZjb3VudD0yMCZjYXRfaWQ9NDMma2V5d29yZD0nICsgZ2V0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScpICsgJyZmbGFnPTAnXFxuICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxuICAgICAgICB0cnkge1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cmluZ2lmeShpVGFnKSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGlUYWcgPSBbXTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBjb25zdCBkID0gW11cXFxcbiAgICBjb25zdCBjb250bGlzdCA9IFtdO1xcXFxuICAgIGNvbnN0IHRhYnMgPSBpVGFnLnNsaWNlKDMsIGlUYWcubGVuZ3RoIC0gMylcXFxcbiAgICB0YWJzLmZvckVhY2goKHRhYiwgaSkgPT4ge1xcXFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxcXG4gICAgICAgICAgICBuYW1lID0gdGFiLnRpdGxlXFxcXG4gICAgICAgICAgICBpZCA9IHRhYi5jYXRlZ29yeUlEXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcign5YiG57G7JywgJzAnKSA9PSBpID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlbXB0eSwgaSwgaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfliIbnsbsnLCBpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+exu0lEJywgaWQpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlbXB0eTtcXFxcbiAgICAgICAgICAgICAgICB9LCBlbXB0eSwgaSwgaWQpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGNvbnRsaXN0W2ldID0gW107XFxcXG4gICAgICAgIGNvbnRzID0gdGFiLnRhZ3M7XFxcXG4gICAgICAgIGNvbnRzLmZvckVhY2goY29udCA9PiB7XFxcXG4gICAgICAgICAgICBjb250bGlzdFtpXS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogY29udC5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIHVybDogY29udC5JRFxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSlcXFxcbiAgICBjb25zdCBjYXRlZ29yeSA9IGdldE15VmFyKCfnsbtJRCcsICcnICsgdGFic1swXS5jYXRlZ29yeUlEICsgJycpXFxcXG4gICAgY29uc3QgaW5kZXggPSBnZXRNeVZhcign5YiG57G7JywgJzAnKVxcXFxuICAgIGlmIChjb250bGlzdFtpbmRleF0ubGVuZ3RoKSB7XFxcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBjb250bGlzdFtpbmRleF0uZm9yRWFjaCgoY29udHNsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKGluZGV4LCAnMCcpID09IGkgPyBSaWNoKFN0cm9uZyhDb2xvcihjb250c2xpc3QudGl0bGUpKSkgOiBjb250c2xpc3QudGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaW5kZXgsIGVtcHR5LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdQYWdlJylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFy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gICAgaWYgKHBhZ2UgPT0gMSkge1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAg5o6S5bqPLmZvckVhY2goaXRlbSA9PiB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtID09IGdldE15VmFyKCfmjpLluo8nLCDmjpLluo9bMF0pID8gUmljaChTdHJvbmcoQ29sb3IoaXRlbSkpKSA6IGl0ZW0sXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpdGVtLCBlbXB0eSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdQYWdlJylcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+aOkuW6jycsIGl0ZW0pO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgZW1wdHkpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuICAgIHN3aXRjaCAoZ2V0TXlWYXIoJ+aOkuW6jycsIOaOkuW6j1swXSkpIHtcXFxcbiAgICAgICAgY2FzZSDmjpLluo9bMF06XFxcXG4gICAgICAgICAgICBzb3J0VHlwZSA9IDBcXFxcbiAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICBjYXNlIOaOkuW6j1sxXTpcXFxcbiAgICAgICAgICAgIHNvcnRUeXBlID0gMlxcXFxuICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgIGNhc2Ug5o6S5bqPWzJdOlxcXFxuICAgICAgICAgICAgc29ydFR5cGUgPSAxXFxcXG4gICAgICAgICAgICBicmVhaztcXFxcbiAgICB9XFxcXG59XFxcXG5cXFxcbmNvbnN0IGxheW91dFBhcnNlID0gKGQsIGRhdGEsIGlkLCBzb3J0VHlwZSwgY2F0ZWdvcnkpID0+IHtcXFxcbiAgICBhZGRMaXN0ZW5lcignb25SZWZyZXNoJywgKCkgPT4ge1xcXFxuICAgICAgICBjbGVhck15VmFyKCdQYWdlJylcXFxcbiAgICB9KVxcXFxuICAgIGlmIChkYXRhLnBvc3RzLmxlbmd0aCkge1xcXFxuICAgICAgICBkYXRhLnBvc3RzLmZvckVhY2goZGF0ZSA9PiB7XFxcXG4gICAgICAgICAgICB1c2VySUQgPSBkYXRlLnVzZXIudXNlcklEXFxcXG4gICAgICAgICAgICBuaWNrID0gZGF0ZS51c2VyLm5pY2tcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5pY2sgKyAnXFxcXFxcXFx0XFxcXFxcXFx0JyArIFNtYWxsKENvbG9yKGdldEZvcm1hdChkYXRlLmNyZWF0ZVRpbWUpKSksXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogZGF0ZS51c2VyLmF2YXRhcixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoZW1wdHkpLnJ1bGUoKHVzZXJJRCwgbmljaykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBNWV9QQUdFID0gMVxcXFxuICAgICAgICAgICAgICAgICAgICBzb3J0VHlwZSA9ICcnXFxcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5ID0gJydcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZShuaWNrKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcXFxuICAgICAgICAgICAgICAgICAgICBwYXRoID0gJy9wb3N0L2NyZWF0ZS9saXN0L0FORFJPSUQvNC4xLjgnXFxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSAnJnN0YXJ0PTAmY291bnQ9MjAmdXNlcl9pZD0nICsgdXNlcklEXFxcXG4gICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxcXG4gICAgICAgICAgICAgICAgICAgIGxheW91dFBhcnNlKGQsIGRhdGUsIHVzZXJJRCwgc29ydFR5cGUsIGNhdGVnb3J5KVxcXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXFxcbiAgICAgICAgICAgICAgICB9LCB1c2VySUQsIG5pY2spLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJ1xcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIHBvc3RJRCA9IGRhdGUucG9zdElEXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKEdyYXkoZGF0ZS50aXRsZSkpLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSArICdmeXBhZ2UnICsgJyNhdXRvQ2FjaGUjI2dhbWVUaGVtZSMnKS5ydWxlKChwb3N0SUQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2NvbmZpZy5odG1sJylcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlVcmxQYXJzZShkLCBwb3N0SUQpXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKVxcXFxuICAgICAgICAgICAgICAgIH0sIHBvc3RJRCksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGltYWdlcyA9IGRhdGUuZGV0YWlsLm1hdGNoKC88aW1hZ2U+KC4qPyk8XFxcXFxcXFwvaW1hZ2U+L2cpXFxcXG4gICAgICAgICAgICAgICAgaW1hZ2VzID0gaW1hZ2VzLm1hcChpdGVtID0+IGl0ZW0ubWF0Y2goLzxpbWFnZT4oLio/KSwuKj88XFxcXFxcXFwvaW1hZ2U+LylbMV0pXFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgaW1hZ2VzID0gZGF0ZS5pbWFnZXNcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChpbWFnZXMubGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAzOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGltYWdlc1tpXSAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGltYWdlc1tpXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGltYWdlc1tpXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzMnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBpZiAoZ2V0TXlWYXIoJ1BhZ2UnLCAnJykgPT0gJycpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goU21hbGwoU3ByaW5nR3JlZW4oJ++9nu+9nu+9nuWKoOi9veabtOWkmu+9nu+9nu+9nicpKSksXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKGRhdGEsIGlkLCBzb3J0VHlwZSwgY2F0ZWdvcnkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgTVlfUEFHRSA9IDFcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2NvbmZpZy5odG1sJylcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNvcnRUeXBlID09ICcnICYmIGNhdGVnb3J5ID09ICcnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoID0gJy9wb3N0L2NyZWF0ZS9saXN0L0FORFJPSUQvNC4xLjgnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gJyZzdGFydD0nICsgZ2V0TXlWYXIoJ1BhZ2UnLCBkYXRhLnN0YXJ0KSArICcmY291bnQ9MjAmdXNlcl9pZD0nICsgaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGggPSAnL3Bvc3QvbGlzdC9BTkRST0lELzQuMS44J1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9ICcmc3RhcnQ9JyArIGdldE15VmFyKCdQYWdlJywgZGF0YS5zdGFydCkgKyAnJmNvdW50PTIwJmNhdF9pZD0nICsgY2F0ZWdvcnkgKyAnJnRhZ19pZD0nICsgaWQgKyAnJnNvcnRfYnk9JyArIHNvcnRUeXBlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1BhZ2UnLCBkYXRlLnN0YXJ0KVxcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkID0gW11cXFxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgaWQsIHNvcnRUeXBlLCBjYXRlZ29yeSlcXFxcbiAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZSgnUGFnZScgKyBpZCwgZCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICghZGF0ZS5wb3N0cy5sZW5ndGgpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygnUGFnZUNscycgKyBpZClcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHlcXFxcbiAgICAgICAgICAgICAgICB9LCBkYXRhLCBpZCwgc29ydFR5cGUsIGNhdGVnb3J5KSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAnUGFnZScgKyBpZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAnUGFnZUNscycgKyBpZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTbWFsbChHcmF5KCfvvZ7vvZ7vvZ7miJHmmK/mnInlupXnur/nmoTvvZ7vvZ7vvZ4nKSkpLFxcXFxuICAgICAgICAgICAgdXJsOiBlbXB0eSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxuY29uc3QgbGF5b3V0U2VhcmNoUGFyc2UgPSAoZCwgZGF0YSkgPT4ge1xcXFxuICAgIGlmIChkYXRhLmxlbmd0aCkge1xcXFxuICAgICAgICBkYXRhLmZvckVhY2goZGF0ZSA9PiB7XFxcXG4gICAgICAgICAgICB1c2VySUQgPSBkYXRlLnVzZXIudXNlcklEXFxcXG4gICAgICAgICAgICBuaWNrID0gZGF0ZS51c2VyLm5pY2tcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5pY2sgKyAnXFxcXFxcXFx0XFxcXFxcXFx0JyArIFNtYWxsKENvbG9yKGdldEZvcm1hdChkYXRlLmNyZWF0ZVRpbWUpKSksXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogZGF0ZS51c2VyLmF2YXRhcixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoZW1wdHkpLnJ1bGUoKHVzZXJJRCwgbmljaykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBNWV9QQUdFID0gMVxcXFxuICAgICAgICAgICAgICAgICAgICBzb3J0VHlwZSA9ICcnXFxcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5ID0gJydcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZShuaWNrKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcXFxuICAgICAgICAgICAgICAgICAgICBwYXRoID0gJy9wb3N0L2NyZWF0ZS9saXN0L0FORFJPSUQvNC4xLjgnXFxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSAnJnN0YXJ0PTAmY291bnQ9MjAmdXNlcl9pZD0nICsgdXNlcklEXFxcXG4gICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxcXG4gICAgICAgICAgICAgICAgICAgIGxheW91dFBhcnNlKGQsIGRhdGUsIHVzZXJJRCwgc29ydFR5cGUsIGNhdGVnb3J5KVxcXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXFxcbiAgICAgICAgICAgICAgICB9LCB1c2VySUQsIG5pY2spLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJ1xcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIHBvc3RJRCA9IGRhdGUucG9zdElEXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKEdyYXkoZGF0ZS50aXRsZSkpLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSArICdmeXBhZ2UnICsgJyNhdXRvQ2FjaGUjI2dhbWVUaGVtZSMnKS5ydWxlKChwb3N0SUQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2NvbmZpZy5odG1sJylcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlVcmxQYXJzZShkLCBwb3N0SUQpXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKVxcXFxuICAgICAgICAgICAgICAgIH0sIHBvc3RJRCksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGltYWdlcyA9IGRhdGUuZGV0YWlsLm1hdGNoKC88aW1hZ2U+KC4qPyk8XFxcXFxcXFwvaW1hZ2U+L2cpXFxcXG4gICAgICAgICAgICAgICAgaW1hZ2VzID0gaW1hZ2VzLm1hcChpdGVtID0+IGl0ZW0ubWF0Y2goLzxpbWFnZT4oLio/KSwuKj88XFxcXFxcXFwvaW1hZ2U+LylbMV0pXFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgaW1hZ2VzID0gZGF0ZS5pbWFnZXNcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChpbWFnZXMubGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAzOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGltYWdlc1tpXSAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGltYWdlc1tpXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGltYWdlc1tpXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzMnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTbWFsbChHcmF5KCfvvZ7vvZ7vvZ7miJHmmK/mnInlupXnur/nmoTvvZ7vvZ7vvZ4nKSkpLFxcXFxuICAgICAgICAgICAgdXJsOiBlbXB0eSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxuY29uc3QgcGxheVVybFBhcnNlID0gKGQsIHBvc3RJRCkgPT4ge1xcXFxuICAgIHNldFBhZ2VUaXRsZSgn6K+m5oOF6aG16Z2iJylcXFxcbiAgICBwYXRoID0gJy9wb3N0L2RldGFpbC9BTkRST0lELzQuMS44J1xcXFxuICAgIGJvZHkgPSAnJnBvc3RfaWQ9JyArIHBvc3RJRCArICcmcGFnZV9ubz0nICsgcGFnZSArICcmcGFnZV9zaXplPTIwJmRvYz0xJ1xcXFxuICAgIGRhdGEgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXFxcbiAgICBpZiAocGFnZSA9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ckVhY2goaW1hZ2UgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGltYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGltYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAyMDsgaSsrKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIGlmIChkYXRhLmNvbW1lbnRzLmxlbmd0aCkge1xcXFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhCaWcoJ+WFqOmDqOivhOiuuiMnICsgZGF0YS5wb3N0LmNvbW1lbnRDb3VudCArICfmnaEnKSkpLFxcXFxuICAgICAgICAgICAgICAgIHVybDogZW1wdHksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgZGF0YS5jb21tZW50cy5mb3JFYWNoKGRhdGUgPT4ge1xcXFxuICAgICAgICAgICAgcmVmQ29tbWVudCA9IGRhdGUucmVmQ29tbWVudFxcXFxuICAgICAgICAgIC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ICAgICAgICAgdXJsOiAkKGVtcHR5KS5ydWxlKCh1c2VySUQsIG5pY2spID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgTVlfUEFHRSA9IDFcXFxcbiAgICAgICAgICAgICAgICAgICAgc29ydFR5cGUgPSAnJ1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXRlZ29yeSA9ICcnXFxcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcXFxuICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUobmljaylcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2NvbmZpZy5odG1sJylcXFxcbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9ICcvcG9zdC9jcmVhdGUvbGlzdC9BTkRST0lELzQuMS44J1xcXFxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gJyZzdGFydD0wJmNvdW50PTIwJnVzZXJfaWQ9JyArIHVzZXJJRFxcXFxuICAgICAgICAgICAgICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGQgPSBbXVxcXFxuICAgICAgICAgICAgICAgICAgICBsYXlvdXRQYXJzZShkLCBkYXRlLCB1c2VySUQsIHNvcnRUeXBlLCBjYXRlZ29yeSlcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxcXG4gICAgICAgICAgICAgICAgfSwgdXNlcklELCBuaWNrKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcidcXFxcbiAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogcmVmQ29tbWVudCArIFNtYWxsKEdyYXkoY2VudGVycykpLFxcXFxuICAgICAgICAgICAgICAgIHVybDogZW1wdHksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBpZiAoZGF0ZS5pbWFnZXMubGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICAgICAgZGF0ZS5pbWFnZXMuZm9yRWFjaChpbWFnZSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWFnZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaW1hZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfSlcXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFJpY2goU21hbGwoR3JheSgn772e772e772e5oiR5piv5pyJ5bqV57q/55qE772e772e772eJykpKSxcXFxcbiAgICAgICAgICAgIHVybDogZW1wdHksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSlcXFxcbiAgICB9XFxcXG59XFxcXG5cXFxcbmNvbnN0IGdldExv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ly9wYWdlL2NvbmZpZy5odG1sJylcXFxcbiAgICAgICAgICAgIHJldHVybiBnZXRMb2dpblVybCgpXFxcXG4gICAgICAgIH0pLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pXFxcXG59XFxcXG5cXFxcbmNvbnN0IGdldFNlYXJjaFBhcnNlID0gKGQpID0+IHtcXFxcbiAgICBzZXRQYWdlVGl0bGUoJ+iRq+iKpuS+oMK35pCc57SiJylcXFxcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICgpID0+IHtcXFxcbiAgICAgICAgY2xlYXJNeVZhcihcXFxcXFxcIuaQnOe0ouWFs+mUruivjVxcXFxcXFwiKVxcXFxuICAgIH0pXFxcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IGdldEl0ZW0oJ+iRq+iKpuS+oG5pY2snKSxcXFxcbiAgICAgICAgICAgIHBpY191cmw6IGdldEl0ZW0oJ+iRq+iKpuS+oGF2YXRhcicpLFxcXFxuICAgICAgICAgICAgdXJsOiAkKGVtcHR5KS5sYXp5UnVsZSgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgY29uZmlybSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIumAgOWHuueZu+W9lVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBcXFxcXFxcIuehruWumuWlveS6huWQl++8n+W9k+WJjei0puWPt+WwhuS8mumAgOWHun5cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uZmlybTogKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJdGVtKCfokavoiqbkvqBUT0tFTicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfpgIDlh7rmiJDlip9+Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBpbnB1dFxcXFxuICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcidcXFxcbiAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgdGl0bGU6ICfwn5SNJyxcXFxcbiAgICAgICAgICAgIGRlc2M6ICfor7fovpPlhaXluJblrZDlkI3np7Av5YWz6ZSu6K+NJyxcXFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoZ2V0U2VhcmNoVXJsLCBlbXB0eSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCfmkJzntKLlhbPplK7or40nLCBpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ICE9ICcnKSBnZXRTZWFyY2hVcmwoaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGVtcHR5O1xcXFxuICAgICAgICAgICAgfSwgZ2V0U2VhcmNoVXJsLCBlbXB0eSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcign5pCc57Si5YWz6ZSu6K+NJylcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSlcXFxcbiAgICB9XFxcXG4gICAgaWYgKGdldE15VmFyKCfmkJzntKLlhbPplK7or40nKSA9PSAnJykge1xcXFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxcXG4gICAgICAgICAgICBsZXQgbWVtID0gc3RvcmFnZTAuZ2V0SXRlbShcXFxcXFxcIuiRq+iKpuS+oFxcXFxcXFwiLCBbXSk7XFxcXG4gICAgICAgICAgICBpZiAobWVtLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogUmljaChCaWcoJ/Cfk50g5pCc57Si5Y6G5Y+yJykpLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoZW1wdHksIGdldENvbmZpcm0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbmZpcm0oKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVtcHR5O1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBlbXB0eSwgZ2V0Q29uZmlybSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goQ2VudGVyKFxcXFxcXFwi5ZaC5ZaCfui/mOayoeaQnOe0ouWRou+9nijvv6Pilr3vv6PvvZ4pflxcXFxcXFwiKSksXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZW1wdHksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSBtZW0ubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBtZW1baV07XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoaXQsIGdldFNlYXJjaFVybCwgZW1wdHkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfmkJzntKLlhbPplK7or40nLCBpdCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRTZWFyY2hVcmwoaXQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVtcHR5O1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdCwgZ2V0U2VhcmNoVXJsLCBlbXB0eSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImZsZXhfYnV0dG9uXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgcGF0aCA9ICcvcG9zdC9zZWFyY2gvQU5EUk9JRC80LjEuOCdcXFxcbiAgICAgICAgYm9keSA9ICcmc3RhcnQ9JyArIChwYWdlIC0gMSkgKiAyMCArICcmY291bnQ9MjAmY2F0X2lkPTQzJmtleXdvcmQ9JyArIGdldE15VmFyKCfmkJzntKLlhbPplK7or40nKSArICcmZmxhZz0wJ1xcXFxuICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBsYXlvdXRTZWFyY2hQYXJzZShkLCBkYXRlLnBvc3RzKVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goQ2VudGVyKGRhdGUubXNnKSksXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZW1wdHksXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbn1cXFwifV1cIn0iLCJ0aXRsZSI6IuivpuaDhemhtemdoiJ9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement