Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥当前未设置账号,点我设置@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwi6K6+572uXCIsXCJwYXRoXCI6XCJzZXR0aW5nc1wiLFwicnVsZVwiOlwianM6XFxuYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgc2F2ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvd2ViZGF2L2luZm8uanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KFtnZXRJdGVtKFxcXCJkYXZcXFwiKSwgZ2V0SXRlbShcXFwidXNlcm5hbWVcXFwiKSwgZ2V0SXRlbShcXFwicGFzc3dkXFxcIildKSlcXG4gICAgY2xlYXJNeVZhcihcXFwicGF0aFxcXCIpXFxuICAgIHJlZnJlc2hQYWdlKClcXG59KSlcXG52YXIgZCA9IFtdO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwid2ViZGF25Zyw5Z2A77yaXFxcIiArIGdldEl0ZW0oXFxcImRhdlxcXCIsIFxcXCLmnKrorr7nva5cXFwiKSxcXG4gICAgdXJsOiAkKGdldEl0ZW0oXFxcImRhdlxcXCIsIFxcXCJcXFwiKSwgXFx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4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCJcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IFxcXCLwn4+gXFxcIixcXG4gICAgICAgIHVybDogJCgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBwdXRNeVZhcihcXFwicGF0aFxcXCIsIGdldEl0ZW0oXFxcImRhdlxcXCIpKVxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCJcXG4gICAgfSlcXG4gICAgcGF0aHMuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgIGlmIChpdGVtICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgdGVtcCArPSBcXFwiL1xcXCIgKyBpdGVtXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGRlY29kZVVSSUNvbXBvbmVudChpdGVtKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHRlbXApID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJwYXRoXFxcIiwgZ2V0SXRlbShcXFwiZGF2XFxcIikgKyB0ZW1wKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9LCB0ZW1wKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBpZiAoZ2V0TXlWYXIoXFxcIm1vcmVcXFwiL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iA9IGdldE15VmFyKFxcXCJzb3J0XFxcIiwgXFxcIum7mOiupFxcXCIpXFxuICAgICAgICAgICAgaWYgKG4gPT0gaXRlbSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtICsgXFxcIuKGk1xcXCJcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKG4uaW5jbHVkZXMoXFxcIuWPjVxcXCIpICYmIG4uaW5jbHVkZXMoaXRlbSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXCLihpFcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXCLihpVcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcInNvcnRcXFwiLCBcXFwi6buY6K6kXFxcIikgPT0gaXRlbSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzb3J0XFxcIiwgaXRlbSArIFxcXCLlj41cXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic29ydFxcXCIsIGl0ZW0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgZmlsZXMuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgIGxldCBmaWxlTmFtZSA9IGRlY29kZVVSSUNvbXBvbmVudChpdGVtLm5hbWUpXFxuICAgICAgICBsZXQgaWNvbiA9IGdldEljb24oaXRlbSlcXG4gICAgICAgIGlmIChnZXRNeVZhcihcXFwiZGVsZXRlXFxcIiwgXFxcIjBcXFwiKSA9PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCBmZXRjaEZpbGUsIGdldEh6bSwgZmlsZXMsIGdldFN1YiwgcmVtb3ZlRXh0LCBkb3dubG9hZCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaXRlbS5kaXIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJwYXRoXFxcIiwgaXRlbS51cmwpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5tb3ZpZS5pbmNsdWRlcyhnZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXCJzdWJ0aXRsZVxcXCIsIFxcXCLlvIBcXFwiKSA9PSBcXFwi5byAXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdWJ0aXRsZXMgPSBnZXRTdWIoZmlsZXMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5hbWVzID0gW11cXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZXMuZm9yRWFjaChkcyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZW1vdmVFeHQoaXRlbS51cmwpID09IHJlbW92ZUV4dChkcy50aXRsZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW2l0ZW0udXJsXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogZHMudXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkF1dGhvcml6YXRpb25cXFwiOiBcXFwiQmFzaWMgXFxcIiArIGJhc2U2NEVuY29kZShnZXRJdGVtKFxcXCJ1c2VybmFtZVxcXCIpICsgXFxcIjpcXFwiICsgZ2V0SXRlbShcXFwicGFzc3dkXFxcIikpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2goZHMudGl0bGUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWJ0aXRsZXMubGVuZ3RoICE9IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobmFtZXMsIDEsIFxcXCLor7fpgInmi6nlrZfluZVcXFwiKS5zZWxlY3QoKG5hbWVzLCBzdWJ0aXRsZXMsIHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogc3VidGl0bGVzW25hbWVzLmluZGV4T2YoaW5wdXQpXS51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQXV0aG9yaXphdGlvblxcXCI6IFxcXCJCYXNpYyBcXFwiICsgYmFzZTY0RW5jb2RlKGdldEl0ZW0oXFxcInVzZXJuYW1lXFxcIikgKyBcXFwiOlxcXCIgKyBnZXRJdGVtKFxcXCJwYXNzd2RcXFwiKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBuYW1lcywgc3VidGl0bGVzLCBpdGVtLnVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbS5wbGF5VXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0ucGxheVVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChnZXRIem0oaXRlbS5uYW1lKSA9PSBcXFwibWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKFxcXCJodHRwczovL2dpdGxhYi5jb20vaGpkaG54L2hpa2VyLy0vcmF3L21haW4vanMvbWFya2VkLm1pbi5qc1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8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gICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtICsgXFxcXFxcXCLihpVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaXRlbSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcXFxcXCJzb3J0XFxcXFxcXCIsIFxcXFxcXFwi6buY6K6kXFxcXFxcXCIpID09IGl0ZW0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwic29ydFxcXFxcXFwiLCBpdGVtICsgXFxcXFxcXCLlj41cXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwic29ydFxcXFxcXFwiLCBpdGVtKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuICAgIGZpbGVzLmZvckVhY2goaXRlbSA9PiB7XFxcXG4gICAgICAgIGxldCBmaWxlTmFtZSA9IGRlY29kZVVSSUNvbXBvbmVudChpdGVtLm5hbWUpXFxcXG4gICAgICAgIGxldCBpY29uID0gZ2V0SWNvbihpdGVtKVxcXFxuICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcXFxcXCJkZWxldGVcXFxcXFxcIiwgXFxcXFxcXCIwXFxcXFxcXCIpID09IFxcXFxcXFwiMFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCBmZXRjaEZpbGUsIGdldEh6bSwgZmlsZXMsIGdldFN1YiwgcmVtb3ZlRXh0LCBkb3dubG9hZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpdGVtLmRpcikge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcInBhdGhcXFxcXFxcIiwgaXRlbS51cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLm1vdmllLmluY2x1ZGVzKGdldEh6bShpdGVtLm5hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbShcXFxcXFxcInN1YnRpdGxlXFxcXFxcXCIsIFxcXFxcXFwi5byAXFxcXFxcXCIpID09IFxcXFxcXFwi5byAXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdWJ0aXRsZXMgPSBnZXRTdWIoZmlsZXMpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmFtZXMgPSBbXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGVzLmZvckVhY2goZHMgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZW1vdmVFeHQoaXRlbS51cmwpID09IHJlbW92ZUV4dChkcy50aXRsZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtpdGVtLnVybF0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogZHMudXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQXV0aG9yaXphdGlvblxcXFxcXFwiOiBcXFxcXFxcIkJhc2ljIFxcXFxcXFwiICsgYmFzZTY0RW5jb2RlKGdldEl0ZW0oXFxcXFxcXCJ1c2VybmFtZVxcXFxcXFwiKSArIFxcXFxcXFwiOlxcXFxcXFwiICsgZ2V0SXRlbShcXFxcXFxcInBhc3N3ZFxcXFxcXFwiKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKGRzLnRpdGxlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3VidGl0bGVzLmxlbmd0aCAhPSAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobmFtZXMsIDEsIFxcXFxcXFwi6K+36YCJ5oup5a2X5bmVXFxcXFxcXCIpLnNlbGVjdCgobmFtZXMsIHN1YnRpdGxlcywgdXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YnRpdGxlOiBzdWJ0aXRsZXNbbmFtZXMuaW5kZXhPZihpbnB1dCldLnVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIkF1dGhvcml6YXRpb25cXFxcXFxcIjogXFxcXFxcXCJCYXNpYyBcXFxcXFxcIiArIGJhc2U2NEVuY29kZShnZXRJdGVtKFxcXFxcXFwidXNlcm5hbWVcXFxcXFxcIikgKyBcXFxcXFxcIjpcXFxcXFxcIiArIGdldEl0ZW0oXFxcXFxcXCJwYXNzd2RcXFxcXFxcIikpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbmFtZXMsIHN1YnRpdGxlcywgaXRlbS51cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtLnBsYXlVcmwgKyBcXFxcXFxcIiNpc1ZpZGVvPXRydWUjXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtLnBsYXlVcmwgKyBcXFxcXFxcIiNpc1ZpZGVvPXRydWUjXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZ2V0SHptKGl0ZW0ubmFtZSkgPT0gXFxcXFxcXCJtZFxcXFxcXFwiKSB7XFx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0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement