Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@玩偶哥哥@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi546p5YG25ZOl5ZOlIiwiYXV0aG9yIjoi5a2j6aOOIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly93b2dnLmxpbmsvaW5kZXgucGhwL3ZvZHNob3cvMS0tLS0tLS0tZnlwYWdlLS0tLmh0bWwiLCJ2ZXJzaW9uIjo1LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgZCA9IFtdO1xuTVlfVVJMID0gTVlfVVJMLnJlcGxhY2UoJ2hpa2VyOi8vZW1wdHkjIycsICcnKTtcbmNvbnN0IHBhZ2UgPSBNWV9QQUdFO1xuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS95aT9ydWxlPc6xJykpLnJ1bGUpXG5cbmlmIChwYWdlID09IDEpIHtcbiAgICBcbn1cblxudmFyIOWumuS9jeS/oeaBryA9IFt7XG4gICAg5aSn57G75a6a5L2NOiAnLmxpYnJhcnktbGlzdCcsXG4gICAg5bCP57G7OiAnYm9keSYmYScsXG59LCB7XG4gICAg5LiA57qn5a6a5L2NOiAnYm9keSYmLmxpYnJhcnktYm94LDE6JyxcbiAgICDlsI/nsbs6ICdib2R5JiZhJyxcbn1dO1xubGV0IHRydWVfdXJsID0gZ2V0TXlWYXIoTVlfUlVMRS51cmwsIE1ZX1VSTClcbmlmIChwYWdlID4gMSAmJiAhLy0oXFxkKylcXC5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ApO1xcblxcbiAgICAgIHJldHVybiBhcnIubWFwKHggPT4ge1xcbiAgICAgICAgc3RyID0geDtcXG4gICAgICAgIGlmIChyZWcudGVzdChzdHIpKSB7XFxuICAgICAgICAgIHN0ciA9IHN0ci5zcGxpdChzcCkubWFwKCh2YWwsIGluZGV4KSA9PiAoaW5kZXggPT09IDAgPyAnJyA6ICcnKSArIHZhbCkuc2xpY2UoMCwgNSkuam9pbignICcpLnJlcGxhY2UoLyAkLywgJycpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHN0clxcbiAgICAgIH0pXFxuICB9LFxcbiAgc2V0Q29udGVudDogZnVuY3Rpb24gKG9iaikge1xcbiAgICAvL2xvZyhvYmopXFxuICAgIHZhciBjdXN0b20gPSB0aGlzLmdldFByZXNldCgpO1xcbiAgICB2YXIgbnVtID0gb2JqLm51bSAhPSB1bmRlZmluZWQgPyBvYmoubnVtIDogMTAwO1xcbiAgICB2YXIgY29udGVudHMgPSBvYmoubWFpbjtcXG4gICAgaWYgKGNvbnRlbnRzLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgIGNvbnRlbnRzID0gY29udGVudHMuc3BsaXQoJ1xcXFxuJyk7XFxuICAgIH1cXG4gICAgdmFyIHNvcnRPcmRlciA9IG9iai5zb3J0ID8gb2JqLnNvcnQgOiBbXTtcXG4gICAgdmFyIGZpbHRlcmxpc3QgPSBvYmouZmlsaXN0ID8gb2JqLmZpbGlzdCA6IFtdO1xcbiAgICB2YXIgaW1nID0gb2JqLmltZztcXG4gICAgdmFyIHRleHRzID0gY29udGVudHMubWFwKHggPT4ge1xcbiAgICAgIGlmICh4LmluY2x1ZGVzKCdocmVmJykpIHtcXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYSh4LCAnYm9keSYmYScpLm1hcChrID0+IHBkZmgoaywgJ1RleHQnKSkuc2xpY2UoMCwgNSkuam9pbignICcpO1xcbiAgICAgICAgaWYgKGxpc3QgPT0gJycpIHtcXG4gICAg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AgICAgICAgICBjYXNlICdjb2xvcic6XFxuICAgICAgICAgICAgICAgICAgICBsZWZ0LnB1c2goJzxmb250IGNvbG9yPVxcXCInICsgeFtrXSArICdcXFwiPicpO1xcbiAgICAgICAgICAgICAgICAgICAgcmlnaHQucHVzaCgnPC9mb250PicpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICBsZWZ0LnB1c2goYDwke2t9PmApO1xcbiAgICAgICAgICAgICAgICAgICAgcmlnaHQucHVzaChgPC8ke2t9PmApO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgIGxpc3RbaV0gPSBsZWZ0LmpvaW4oJycpICsgc3RyICsgcmlnaHQuam9pbignJyk7XFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIGxpc3Q7XFxuICAgICAgfVxcbiAgICAgIHRpdGxlcz10ZXh0QXJyYXkoZmlyc3RIYWxmLHRpdGxlcyk7XFxuICAgICAgZGVzY3M9dGV4dEFycmF5KHNlY29uZEhhbGYsZGVzY3MpO1xcbiAgICAgIFxcbiAgICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTon4oCc4oCc4oCd4oCdJyt0aXRsZXNbMF0rJ1xcXFxuJyt0aXRsZXMuc2xpY2UoMSwzKS5qb2luKCdcXFxcbicpLFxcbiAgICAgICAgZGVzYzon4oCc4oCc4oCd4oCdJytkZXNjcy5qb2luKCdcXFxcbicpLFxcbiAgICAgICAgaW1nOmltZysnQFJlZmVyZXI9JytpbWcsXFxuICAgICAgICB1cmw6TVlfVVJMLFxcbiAgICAgICAgY29sX3R5cGU6J21vdmllXzFfdmVydGljYWxfcGljX2JsdXInLFxcbiAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICBpZDpcXFwiZGV0YWlsaWRcXFwiLFxcbiA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zogJ2h0dHBzOi8vaW1nLm5pY2t5YW0uY29tL2ZpbGUvZmU0MWE3YTE3NDRhM2E4MTk0ZGYyLmdpZicsXFxuICAgICAgICAgICAgdXJsOiAndG9hc3Q6Ly9sb2FkaW5nJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgY2xzOiBzaHNvcnRcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgIH0pXFxuICAgICAgICAgIHhsaXN0ID0gJC5mdW5jKGksIGluZm8pO1xcbiAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX2xpc3QnLCB4bGlzdCk7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgcGxheXMgPSB4bGlzdC5tYXAoeCA9PiB7XFxuICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgdGl0bGU6IHgudGl0bGUsXFxuICAgICAgICAgICAgdXJsOiB4LnVybCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogY29sLFxcbiAgICAgICAgICAgIHBpYzogcGljLFxcbiAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHt9LCBleHRyYSwge1xcbiAgICAgICAgICAgICAgaWQ6IHgudXJsLnJlcGxhY2UoL0BsYXp5UnVsZVtcXFxcc1xcXFxTXSsvZywgJycpLFxcbiAgICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIGlmIChnZXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnKSA9PSAnMScpIHtcXG4gICAgICAgICAgcGxheXMucmV2ZXJzZSgpO1xcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIHBjZmcgPSBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQgKyAnX3B1c2hjZmcnLCAne30nKTtcXG4gICAgICAgIGlmIChwY2ZnWyfljZXmjqgnXSkge1xcbiAgICAgICAgICB1cGRhdGVJdGVtK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IycpLFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5YiH5o2i5oiQ5Yqf77yBJztcXG4gICAgICB9LCB2YXJpLCBzaHNvcnQsIGksIGN1c3RvbS7nur/ot6/pgInkuK0sIGluZm8pXFxuICAgICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIChnZXRNeVZhcih2YXJpLCAnMCcpID09IGkgPyB0YWJzW2ldLmZvbnRjb2xvcihjdXN0b20u57q/6Lev6YCJ5LitKSA6IHRhYnNbaV0uZm9udGNvbG9yKCcjJykpLFxcbiAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICBjb2xfdHlwZTogY3VzdG9tLue6v+i3r+agt+W8jyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgIGNsczogc2hzb3J0ICsgJ190YWInLFxcbiAgICAgICAgICBpZDogc2hzb3J0ICsgJ190YWJfJyArIGksXFxuICAgICAgICB9XFxuICAgICAgfSlcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgIGNvbF90eXBlOiBjdXN0b20u5YiG5Ymy5qC35byPLFxcbiAgICAgIGV4dHJhOiB7XFxuICAgICAgICBpZDogc2hzb3J0ICsgJ19saW5lJyxcXG4gICAgICB9XFxuICAgIH0pXFxuICB9LFxcbiAgcHVzaFRhYjogZnVuY3Rpb24gKHZhcmksIHNoc29ydCkge1xcbiAgICBhZGRMaXN0ZW5lcignb25SZWZyZXNoJywgJC50b1N0cmluZygoc2hzb3J0KSA9PiB7XFxuICAgICAgY2xlYXJNeVZhcihzaHNvcnQgKyAnX3B1c2hjZmcnKTtcXG4gICAgICBjbGVhck15VmFyKHNoc29ydCArICdfZHVvc2VsZWN0Jyk7XFxuICAgIH0sIHNoc29ydCkpXFxuICAgIHZhciBwb2JqID0ge1xcbiAgICAgICfljZXmjqgnOiBbJ+Kmv+W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csIHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGVzWzBdLFxcbiAgICAgICAgICB9KVxcbiAgICAgICAgICBwY2ZnWyfljZXmjqgnXSA9IGZhbHNlO1xcbiAgICAgICAgICBwY2ZnWydwbGF5bGlzdCddLm1hcCgoeCkgPT4ge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgdXJsOiB4LnVybCxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX3B1c2gnLCB7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgdGl0bGVzWzFdLFxcbiAgICAgICAgICB9KVxcbiAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCArICdfcHVzaHMnLCB7XFxuICAgICAgICAgICAgdGl0bGU6IHBvYmpbJ+mAieaOqCddWzBdLFxcbiAgICAgICAgICB9KVxcbiAgICAgICAgICBwY2ZnWyfljZXmjqgnXSA9IHRydWU7XFxuICAgICAgICAgIHBjZmdbJ+mAieaOqCddID0gZmFsc2U7XFxuICAgICAgICAgIHZhciBwbGF5bGlzdCA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J10gPSBwbGF5bGlzdDtcXG4gICAgICAgICAgZmluZEl0ZW1zQnlDbHMoc2hzb3J0KS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgdmFyIGRwdXNoID0ge1xcbiAgICAgICAgICAgICAgbmFtZTogZ2V0UGFnZVRpdGxlKCksXFxuICAgICAgICAgICAgICB1cmw6IHgudGl0bGUgKyAnJCcgKyB4LmV4dHJhLmlkXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAg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ICAgdGl0bGU6IHgudGl0bGUsXFxuICAgICAgICAgICAgICB1cmw6IHgudXJsICsg6Kej5p6QLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgfSkpXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICBsaXN0cy5wdXNoKHBkZmEoY29udHNbaV0sIHBhcnNlLumAiembhuWIl+ihqCkubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICB0aXRsZTogcGRmaCh4LCDpgInpm4blkI3np7ApLFxcbiAgICAgICAgICAgICAgdXJsOiBwZCh4LCDpgInpm4bpk77mjqUpICsg6Kej5p6QLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgfSkpXFxuICAgICAgICB9XFxuICAgICAgfSBlbHNlIHtcXG4gICAgICAgIHZhciB1cmwgPSBwZChjb250c1tpXSwg6YCJ6ZuG6ZO+5o6lKTtcXG4gICAgICAgIGlmICgh6YCJ6ZuG6ZO+5o6lLmluY2x1ZGVzKCdocmVmJykpIHtcXG4gICAgICAgICAgdXJsID0gcGRmaChjb250c1tpXSwg6YCJ6ZuG6ZO+5o6lKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCB0aXRsZSA9IHBkZmgoY29udHNbaV0sIOmAiembhuWQjeensCk7XFxuICAgICAgICB0aXRsZSA9IOabv+aNouWHveaVsCAhPSAnJyA/IHRoaXMuZXZhbFJlKHRpdGxlLCDmm7/mjaLlh73mlbApIDogdGl0bGU7XFxuICAgICAgICB0ZW1wLnB1c2goe1xcbiAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9hbGl5dW4/cnVsZT3kupHnm5jlkJsu566AJnBhZ2U9ZnlwYWdlJnJlYWx1cmw9Jyt1cmwgKyDop6PmnpAsXFxuICAgICAgICB9KVxcbiAgICAgIH1cXG4gICAgfVxcbiAgICBsZXQg5YCS5bqPID0gcGFyc2Uu5YCS5bq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