Advertisement
xiaomianao666

邀您一起看:梦魇幻景录

Feb 26th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥梦魇幻景录@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZGlzcGxheU5hbWVcIjpcIueIseilv+ilv1wiLFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczooXFxuZnVuY3Rpb24gKGFwcHR5cGUsIGFwcFVybCkge1xcbiAgICBsZXQgY2hwID0gW107XFxuICAgIHRyeSB7XFxuICAgICAgICBsZXQgY29udHMgPSBbXSwgaHRtbCA9IEpTT04ucGFyc2UoZmV0Y2goTVlfVVJMLnNwbGl0KFxcXCIjI1xcXCIpWzFdLCB7aGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogXFxcIkRhcnQvMi4xMyAoZGFydDppbylcXFwifX0pKTtcXG4gICAgICAgIGlmIChhcHB0eXBlLmluY2x1ZGVzKFxcXCJUVlxcXCIpKSB7XFxuICAgICAgICAgICAgY29udHMgPSBPYmplY3Qua2V5cyhodG1sLnZpZGVvbGlzdCk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmIChhcHBVcmwuaW5jbHVkZXMoXFxcImFwaS5waHAvYXBwL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgIGNvbnRzID0gaHRtbC5kYXRhLnZvZF91cmxfd2l0aF9wbGF5ZXI7XFxuICAgICAgICAgICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV91cmwuc3BsaXQoXFxcIiQkJFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKGFwcFVybC5pbmNsdWRlcyhcXFwieGdhcHAucGhwL3YxL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfdXJsX3dpdGhfcGxheWVyO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfcGxheV91cmwuc3BsaXQoXFxcIiQkJFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfdXJsLnNwbGl0KFxcXCIkJCRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBsaXN0ID0gW107XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvbnRzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgaWYgKGFwcHR5cGUuaW5jbHVkZXMoXFxcIlRWXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGh0bWwudmlkZW9saXN0W2NvbnRzW2ldXTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoY29udHNbaV0udXJscykge1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HRwczovL215YWl4aXhpLmNvbS9hcGkucGhwL2FwcC9cXFwiKVwifSx7XCJuYW1lXCI6XCLop4bpopHop6PmnpBcIixcInBhdGhcIjpcImxhenlQYXJzZVwiLFwicnVsZVwiOlwiKFxcbmZ1bmN0aW9uICgpIHtcXG4gICAgcmV0dXJuICQoXFxcIlxcXCIpLmxhenlSdWxlKChwdGFiLCB2bGluaywganhVcmwsIGFwcFVybCkgPT4ge1xcbiAgICAgICAgbG9nKFxcXCJcXFxcdTg5YzZcXFxcdTk4OTFcXFxcdTk0ZmVcXFxcdTYzYTU6XFxcIiArIHZsaW5rKTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgZnVuY3Rpb24gY2hhbmdlVmlkZW9VcmwodXJsKSB7XFxuICAgICAgICAgICAgICAgIGlmICh1cmwuaW5jbHVkZXMoXFxcIndrZmlsZVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFwiO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL31cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gXFxcImJpbGliaWxpXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IHVybCArIFxcXCI7e1JlZmVyZXJAaHR0cHM6Ly93d3cuYmlsaWJpbGkuY29tLyYmVXNlci1BZ2VudEBNb3ppbGxhLzUuMH1cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocHRhYiA9PSBcXFwibWd0dlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsICsgXFxcIjt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLmluY2x1ZGVzKFxcXCJvamJrXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IHVybCArIFxcXCI7e1JlZmVyZXJAaHR0cHM6Ly9iYWsub2pia2p4LmNvbS99XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIXVybC5pbmNsdWRlcyhcXFwiaHR0cFxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIlxcXFx1OTRmZVxcXFx1NjNhNVxcXFx1NGUwZFxcXFx1NjYyZlxcXFx1NGVlNWh0dHBcXFxcdTVmMDBcXFxcdTU5MzRcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXC5tM3U4Ly50ZXN0KHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FjaGVNM3U4KHVybCk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICgvXFxcXC5tM3U4fFxcXFwubXA0fG9ialxcXFwvdG9zfG5ldGVhc2VcXFxcLmNvbS8udGVzdCh2bGluaykgJiYgL2h0dHAvLnRlc3QodmxpbmspICYmICEvXFxcXC5odG1sLy50ZXN0KHZsaW5rKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgcHVybCA9IHZsaW5rO1xcbiAgICAgICAgICAgICAgICBpZiAocHRhYi5pbmNsdWRlcyhcXFwiZHVvZHVvenlcXFwiKSB8fCB2bGluay5pbmNsdWRlcyhcXFwibTN1OC5jYWNoZS5zdW95by5jY1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKGdldENyeXB0b0pTKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gRGUod29yZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UobWQ1KFxcXCJyWGpXdlhsNlxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXCJOWGJIb1dKYnBzRU9pbjhiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIENyeXB0b0pTLkFFUy5kZWNyeXB0KHdvcmQsIGEsIHtpdjogdCwgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5Qa2NzN30pLnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHB1cmwgPSBEZShKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL2pocGMubWFuZHVodS5jb20vZHVvZHVvL2FwaS5waHA/dXJsPVxcXCIgKyB2bGluaykpLnVybCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocHRhYi5pbmNsdWRlcyhcXFwiQ0w0S1xcXCIpIHx8IHZsaW5rLmluY2x1ZGVzKFxcXCJydWlmZW5nbGJcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gZmV0Y2goXFxcImh0dHBzOi8vdHYueWpoYW4uY29tOjQ0MzMvQ0w0Sy8/dXJsPVxcXCIgKyB2bGluayksIHRva2VuID0gaHRtbC5tYXRjaCgvbGVfdG9rZW4uKj0uKlxcXCIoLiopXFxcIi8pWzFdLCB1cmwgPSBodG1sLm1hdGNoKC9cXFwidXJsXFxcIi4qOi4qXFxcIiguKilcXFwiLylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBEZSh3b3JkKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBrZXkgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShcXFwiQTQyRUFDMEMyQjQwODQ3MlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXYgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZSh0b2tlbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDcnlwdG9KUy5BRVMuZGVjcnlwdCh3b3JkLCBrZXksIHtpdjogaXYsIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLCBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczd9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1cmwgPSBEZSh1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBjaGFuZ2VWaWRlb1VybChwdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHB0YWIuaW5jbHVkZXMoXFxcIm5ldGZsaXhtb21cXFwiKSB8fCAvXm5ldGZsaXhtb20vLnRlc3QodmxpbmspKSB7XFxuICAgICAgICAgICAgICAgIGp4VXJsID0gXFxcImh0dHBzOi8vZHAua29uZ2J1e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WR1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHVybCA9IHJlZHVybC5zdWJzdHJpbmcocmVkdXJsLmluZGV4T2YoXFxcIj1odHRwXFxcIikgKyAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gY2hhbmdlVmlkZW9VcmwocHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBodG1sID0gc2NvZGUuYm9keTtcXG4gICAgICAgICAgICBpZiAoLzQwNCBOb3QgRm91bmR85aSH5qGI5ZCO5Y+v57un57ut6K6/6ZeuLy50ZXN0KGh0bWwpKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwiNDA0XFxcXHU0ZTg2XFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKC9cXFxcPGJvZHkvLnRlc3QoaHRtbCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhcXFwiXFxcXHU1YzFkXFxcXHU4YmQ1XFxcXHU0ZWNlXFxcXHU3ZjUxXFxcXHU5ODc1XFxcXHU1NWM1XFxcXHU2M2EyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlQ2FjaGUoXFxcImh0dHBzOi8vY29kZS5hbGl5dW4uY29tL2x6azIzNTU5L1B1YmxpY1J1bGUvcmF3L21hc3Rlci94NXJ1bGUuanNcXFwiLCAyNCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4geDVydWxlKGxpbmssIGxpbmspO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKFxcXCJcXFxcdTVjMWRcXFxcdThiZDVcXFxcdTRlY2VcXFxcdTk3NWVcXFxcdTdmNTFcXFxcdTk4NzVcXFxcdTU1YzVcXFxcdTYzYTJcXFwiKTtcXG4gICAgICAgICAg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bSYmVXNlci1BZ2VudEBNb3ppbGxhLzUuMH1cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcyhcXFxcXFxcIm9qYmtcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsICsgXFxcXFxcXCI7e1JlZmVyZXJAaHR0cHM6Ly9iYWsub2pia2p4LmNvbS99XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmICghdXJsLmluY2x1ZGVzKFxcXFxcXFwiaHR0cFxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcXFxcXCJcXFxcXFxcXHU5NGZlXFxcXFxcXFx1NjNhNVxcXFxcXFxcdTRlMGRcXFxcXFxcXHU2NjJmXFxcXFxcXFx1NGVlNWh0dHBcXFxcXFxcXHU1ZjAwXFxcXFxcXFx1NTkzNFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFxcXFxcLm0zdTgvLnRlc3QodXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhY2hlTTN1OCh1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAg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AgICAgICAgICAgICBsZXQgcmVkdXJsID0gc2NvZGUuaGVhZGVycy5sb2NhdGlvblswXS5yZXBsYWNlKC9cXFxcXFxcXFxcXFxcXFxcL2csIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGxvZyhcXFxcXFxcIlxcXFxcXFxcdTkxY2RcXFxcXFxcXHU1YjlhXFxcXFxcXFx1NTQxMTpcXFxcXFxcIiArIHJlZHVybCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHB1cmwgPSByZWR1cmw7XFxcXG4gICAgICAgICAgICAgICAgaWYgKC9cXFxcXFxcXD1odHRwLy50ZXN0KHJlZHVybCkgJiYgL2h0bWx8YmlsaWJpbGkvLnRlc3QocmVkdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXJsID0gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXFxcXFw9aHR0cC8udGVzdChyZWR1cmwpICYmIC9cXFxcXFxcXC5tM3U4fFxcXFxcXFxcLm1wNHxcXFxcXFxcXC5mbHYvLnRlc3QocmVkdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHVybCA9IHJlZHVybC5zdWJzdHJpbmcocmVkdXJsLmluZGV4T2YoXFxcXFxcXCI9aHR0cFxcXFxcXFwiKSArIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBjaGFuZ2VWaWRlb1VybChwdXJsKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBodG1sID0gc2NvZGUuYm9keTtcXFxcbiAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl64vLnRlc3QoaHR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PSB2bGluay5zZWFyY2goL0xUXFxcXFxcXFwtfFJvbmdYaW5nVlJcXFxcXFxcXC18cmVucmVubWlcXFxcXFxcXC18eGZ5XFxcXFxcXFwtLykgIT0gLTE7XFxcXG4gICAgICAgICAgICBpZiAoKHRlc3QxIHx8IHRlc3QyKSAmJiBlbkRuID09IFxcXFxcXFwiMVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgbG9nKFxcXFxcXFwiXFxcXFxcXFx1OGMwM1xcXFxcXFxcdTc1MjhcXFxcXFxcXHU2NWFkXFxcXFxcXFx1NjNkMlxcXFxcXFxcdTg5ZTNcXFxcXFxcXHU2NzkwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGV2YWwoXFxcXFxcXCJsZXQgY29uZmlnID1cXFxcXFxcIiArIGZldGNoKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZSh2bGluayk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiB2bGluaztcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICAsIHB0YWIsIHZsaW5rLCBqeFVybCwgYXBwVXJsKTtcXFxcbn1cXFxcbikoKVxcXCJ9XVwifSIsInBpY1VybCI6Imh0dHBzOi8vaTMud3AuY29tL2ltZzkuZG91YmFuaW8uY29tL3ZpZXcvcGhvdG8vbS9wdWJsaWMvcDIzNzUxNDUxMjAuanBnQFJlZmVyZXI9IiwidGl0bGUiOiLmoqbprYflubvmma/lvZUifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement