f96825bffb
Signed-off-by: 潇洒 <14147370+PizazzXS@user.noreply.gitee.com>
1 line
8.1 KiB
JavaScript
1 line
8.1 KiB
JavaScript
Z2xvYmFsVGhpcy5oX29zdCA9ICdodHRwOi8veHhzcC54eG1oLnRvcC8nOwp2YXIga2V5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZSgiTUdZM09URmlabU13WkdNMk1XVTRaZz09Iik7CnZhciBpdiA9IENyeXB0b0pTLmVuYy5CYXNlNjQucGFyc2UoIk1HWTNPVEZpWm1Nd1pHTTJNV1U0Wmc9PSIpOwpnbG9iYWxUaGlzLkFFU19EZWNyeXB0ID0gZnVuY3Rpb24od29yZCkgewogICAgdHJ5IHsKICAgICAgICB2YXIgZGVjcnlwdCA9IENyeXB0b0pTLkFFUy5kZWNyeXB0KHdvcmQsIGtleSwgewogICAgICAgICAgICBpdjogaXYsCiAgICAgICAgICAgIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLAogICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczcsCiAgICAgICAgfSk7CiAgICAgICAgY29uc3QgZGVjcnlwdGVkVGV4dCA9IGRlY3J5cHQudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpOwogICAgICAgIGlmICghZGVjcnlwdGVkVGV4dCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIuino+WvhuWQjueahOWGheWuueS4uuepuiIpOwogICAgICAgIH0KICAgICAgICByZXR1cm4gZGVjcnlwdGVkVGV4dDsKICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICBjb25zb2xlLmVycm9yKCLop6Plr4blpLHotKU6IiwgZSk7CiAgICAgICAgcmV0dXJuIG51bGw7CiAgICB9Cn07Cmdsb2JhbFRoaXMuQUVTX0VuY3J5cHQgPSBmdW5jdGlvbih3b3JkKSB7CiAgICB2YXIgZW5jcnlwdGVkID0gQ3J5cHRvSlMuQUVTLmVuY3J5cHQod29yZCwga2V5LCB7CiAgICAgICAgaXY6IGl2LAogICAgICAgIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLAogICAgICAgIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5Qa2NzNwogICAgfSk7CiAgICByZXR1cm4gZW5jcnlwdGVkLnRvU3RyaW5nKCk7Cn07CgpnbG9iYWxUaGlzLnZvZDEgPSBmdW5jdGlvbih0LCBwZykgewogICAgbGV0IGh0bWwxID0gcmVxdWVzdChoX29zdCArICdhcGkucGhwL2dldGFwcGFwaS5pbmRleC90eXBlRmlsdGVyVm9kTGlzdCcsIHsKICAgICAgICBib2R5OiB7CiAgICAgICAgICAgIGFyZWE6ICflhajpg6gnLAogICAgICAgICAgICB5ZWFyOiAn5YWo6YOoJywKICAgICAgICAgICAgdHlwZV9pZDogdCwKICAgICAgICAgICAgcGFnZTogcGcsCiAgICAgICAgICAgIHNvcnQ6ICfmnIDmlrAnLAogICAgICAgICAgICBsYW5nOiAn5YWo6YOoJywKICAgICAgICAgICAgY2xhc3M6ICflhajpg6gnCiAgICAgICAgfSwKICAgICAgICBoZWFkZXJzOiB7CiAgICAgICAgICAgICdVc2VyLUFnZW50JzogJ29raHR0cC8zLjE0LjknLAogICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcKICAgICAgICB9LAogICAgICAgICdtZXRob2QnOiAnUE9TVCcKICAgIH0sIHRydWUpOwogICAgbGV0IGh0bWwgPSBKU09OLnBhcnNlKGh0bWwxKTsKICAgIHJldHVybiAoQUVTX0RlY3J5cHQoaHRtbC5kYXRhKSk7Cn0KZ2xvYmFsVGhpcy52b2RpZHMgPSBmdW5jdGlvbihpZHMpIHsKICAgIGxldCBodG1sMSA9IGZldGNoKGhfb3N0ICsgJ2FwaS5waHAvZ2V0YXBwYXBpLmluZGV4L3ZvZERldGFpbCcsIHsKICAgICAgICBtZXRob2Q6ICdQT1NUJywKICAgICAgICBoZWFkZXJzOiB7CiAgICAgICAgICAgICdVc2VyLUFnZW50JzogJ29raHR0cC8zLjE0LjknLAogICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcKICAgICAgICB9LAogICAgICAgIGJvZHk6IHsKICAgICAgICAgICAgdm9kX2lkOiBpZHMsCiAgICAgICAgfQogICAgfSk7CiAgICBsZXQgaHRtbCA9IEpTT04ucGFyc2UoaHRtbDEpOwogICAgY29uc3QgcmRhdGEgPSBKU09OLnBhcnNlKEFFU19EZWNyeXB0KGh0bWwuZGF0YSkpOwogICAgY29uc3QgZGF0YSA9IHsKICAgICAgICB2b2RfaWQ6IGlkcywKICAgICAgICB2b2RfbmFtZTogcmRhdGEudm9kLnZvZF9uYW1lLAogICAgICAgIHZvZF9yZW1hcmtzOiByZGF0YS52b2Qudm9kX3JlbWFya3MsCiAgICAgICAgdm9kX2FjdG9yOiByZGF0YS52b2Qudm9kX2FjdG9yLAogICAgICAgIHZvZF9kaXJlY3RvcjogcmRhdGEudm9kLnZvZF9kaXJlY3RvciwKICAgICAgICB2b2RfY29udGVudDogcmRhdGEudm9kLnZvZF9jb250ZW50LAogICAgICAgIHZvZF9wbGF5X2Zyb206ICcnLAogICAgICAgIHZvZF9wbGF5X3VybDogJycKICAgIH07CgogICAgcmRhdGEudm9kX3BsYXlfbGlzdC5mb3JFYWNoKCh2YWx1ZSkgPT4gewogICAgICAgIGRhdGEudm9kX3BsYXlfZnJvbSArPSB2YWx1ZS5wbGF5ZXJfaW5mby5zaG93ICsgJyQkJCc7CiAgICAgICAgdmFsdWUudXJscy5mb3JFYWNoKCh2KSA9PiB7CiAgICAgICAgICAgIGRhdGEudm9kX3BsYXlfdXJsICs9IHYubmFtZSArICckJyArIHZhbHVlLnBsYXllcl9pbmZvLnBhcnNlICsgJ34nICsgdi51cmwgKyAnficgKyByZGF0YS52b2Qudm9kX25hbWUgKyAnficgKyB2Lm5hbWU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YW5tYWt1OiAnaHR0cDovLzEwMy4zNi4yMjAuMTY2OjkxL2Rta3UxL3R2Ym94L3poLnBocD91cmw9JyArICcmam09JyArIG5hbWUgKyAnJmpzPScgKyBqdWppICsgJyZrZXk9NzQxODUyOTYzJwogICAgICAgIH07CiAgICB9CiAgICBpZiAoaWQgPT0gMCkgewogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHBhcnNlOiAwLAogICAgICAgICAgICB1cmw6IGlkICsgdXJsLAogICAgICAgICAgICBqeDogMSwKICAgICAgICAgICAgZGFubWFrdTogJ2h0dHA6Ly8xMDMuMzYuMjIwLjE2Njo5MS9kbWt1MS90dmJveC96aC5waHA/dXJsPScgKyAnJmptPScgKyBuYW1lICsgJyZqcz0nICsganVqaSArICcma2V5PTc0MTg1Mjk2MycKICAgICAgICB9OwogICAgfQoKICAgIGxldCBodG1sMSA9IHJlcXVlc3QoaF9vc3QgKyAnYXBpLnBocC9nZXRhcHBhcGkuaW5kZXgvdm9kUGFyc2UnLCB7CiAgICAgICAgbWV0aG9kOiAnUE9TVCcsCiAgICAgICAgaGVhZGVyczogewogICAgICAgICAgICAnVXNlci1BZ2VudCc6ICdva2h0dHAvMy4xNC45JywKICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnCiAgICAgICAgfSwKICAgICAgICBib2R5OiB7CiAgICAgICAgICAgIHBhcnNlX2FwaTogaWQsCiAgICAgICAgICAgIHVybDogQUVTX0VuY3J5cHQodXJsKSwKICAgICAgICB9CiAgICB9KTsKICAgIGxldCBodG1sID0gQUVTX0RlY3J5cHQoSlNPTi5wYXJzZShodG1sMSkuZGF0YSk7CiAgICBjb25zb2xlLmxvZyhodG1sKTsKICAgIGxldCBkZWNyeSA9IGh0bWwucmVwbGFjZSgvXG4vZywgJycpLnJlcGxhY2UoL1xcL2csICcnKTsKICAgIGxldCBtYXRjaGVzID0gZGVjcnkubWF0Y2goL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AgICAgICAgYmF0YS5mb3JFYWNoKGl0ID0+IHsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHVybDogaXQudm9kX2lkLAogICAgICAgICAgICAgICAgdGl0bGU6IGl0LnZvZF9uYW1lLAogICAgICAgICAgICAgICAgaW1nOiBpdC52b2RfcGljLAogICAgICAgICAgICAgICAgZGVzYzogaXQudm9kX3JlbWFya3MKICAgICAgICAgICAgfSk7CiAgICAgICAgfSk7CiAgICAgICAgc2V0UmVzdWx0KGQpOwogICAgfSksCiAgICDkuIDnuqc6ICRqcy50b1N0cmluZygoKSA9PiB7CiAgICAgICAgbGV0IGRhdGEgPSB2b2QxKGlucHV0LCBNWV9QQUdFKTsKICAgICAgICBsZXQgYmF0YSA9IEpTT04ucGFyc2UoZGF0YSkucmVjb21tZW5kX2xpc3Q7CiAgICAgICAgYmF0YS5mb3JFYWNoKGl0ID0+IHsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHVybDogaXQudm9kX2lkLAogICAgICAgICAgICAgICAgdGl0bGU6IGl0LnZvZF9uYW1lLAogICAgICAgICAgICAgICAgaW1nOiBpdC52b2RfcGljLAogICAgICAgICAgICAgICAgZGVzYzogaXQudm9kX3JlbWFya3MKICAgICAgICAgICAgfSk7CiAgICAgICAgfSk7CiAgICAgICAgc2V0UmVzdWx0KGQpOwogICAgfSksCiAgICDkuoznuqc6ICRqcy50b1N0cmluZygoKSA9PiB7CiAgICAgICAgY29uc29sZS5sb2coIuiwg+ivleS/oeaBrzIiICsgaW5wdXQpOwogICAgICAgIGxldCBkYXRhID0gdm9kaWRzKGlucHV0KTsKICAgICAgICAvL2NvbnNvbGUubG9nKGRhdGEpOwogICAgICAgIFZPRCA9IGRhdGE7CiAgICB9KSwKICAgIOaQnOe0ojogJGpzLnRvU3RyaW5nKCgpID0+IHsKICAgICAgICBsZXQgZGF0YSA9IHNzdm9kKGlucHV0KTsKICAgICAgICBsZXQgYmF0YSA9IEpTT04ucGFyc2UoZGF0YSkuc2VhcmNoX2xpc3Q7CiAgICAgICAgYmF0YS5mb3JFYWNoKGl0ID0+IHsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHVybDogaXQudm9kX2lkLAogICAgICAgICAgICAgICAgdGl0bGU6IGl0LnZvZF9uYW1lLAogICAgICAgICAgICAgICAgaW1nOiBpdC52b2RfcGljLAogICAgICAgICAgICAgICAgZGVzYzogaXQudm9kX3JlbWFya3MKICAgICAgICAgICAgfSk7CiAgICAgICAgfSk7CiAgICAgICAgLy8gIGNvbnNvbGUubG9nKGRhdGEpOwogICAgICAgIHNldFJlc3VsdChkKTsKICAgIH0pLAp9 |