V2EX Next V2Next

V2Next - 一个好用的V2EX脚本!手机 App 已发布

  1. // ==UserScript==
  2. // @name V2EX Next V2Next
  3. // @namespace http://tampermonkey.net/
  4. // @version 10.28
  5. // @author zyronon
  6. // @description V2Next - 一个好用的V2EX脚本!手机 App 已发布
  7. // @license GPL License
  8. // @icon https://vtonext.vercel.app/favicon.ico
  9. // @homepage https://github.com/zyronon/V2Next
  10. // @homepageURL https://github.com/zyronon/V2Next
  11. // @supportURL https://update.gf.qytechs.cn/scripts/458024/V2Next.user.js
  12. // @match https://v2ex.com/
  13. // @match https://v2ex.com/?tab=*
  14. // @match https://v2ex.com/t/*
  15. // @match https://v2ex.com/recent*
  16. // @match https://v2ex.com/go/*
  17. // @match https://v2ex.com/member/*
  18. // @match https://v2ex.com/changes*
  19. // @match https://*.v2ex.com/
  20. // @match https://*.v2ex.com/?tab=*
  21. // @match https://*.v2ex.com/t/*
  22. // @match https://*.v2ex.com/recent*
  23. // @match https://*.v2ex.com/go/*
  24. // @match https://*.v2ex.com/member/*
  25. // @match https://*.v2ex.com/changes*
  26. // @require https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
  27. // @require https://cdn.jsdelivr.net/npm/vue@3.4.14/dist/vue.global.prod.min.js
  28. // @require https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js
  29. // @grant GM_openInTab
  30. // @grant GM_registerMenuCommand
  31. // ==/UserScript==
  32.  
  33.  
  34. (function (vue, dayjs) {
  35. 'use strict';
  36.  
  37. var PageType = /* @__PURE__ */ ((PageType2) => {
  38. PageType2["Home"] = "Home";
  39. PageType2["Node"] = "Node";
  40. PageType2["Post"] = "Post";
  41. PageType2["Member"] = "Member";
  42. PageType2["Changes"] = "Changes";
  43. PageType2["Hot"] = "Hot";
  44. return PageType2;
  45. })(PageType || {});
  46. var CommentDisplayType = /* @__PURE__ */ ((CommentDisplayType2) => {
  47. CommentDisplayType2[CommentDisplayType2["FloorInFloor"] = 0] = "FloorInFloor";
  48. CommentDisplayType2[CommentDisplayType2["FloorInFloorNoCallUser"] = 4] = "FloorInFloorNoCallUser";
  49. CommentDisplayType2[CommentDisplayType2["FloorInFloorNested"] = 5] = "FloorInFloorNested";
  50. CommentDisplayType2[CommentDisplayType2["Like"] = 1] = "Like";
  51. CommentDisplayType2[CommentDisplayType2["V2exOrigin"] = 2] = "V2exOrigin";
  52. CommentDisplayType2[CommentDisplayType2["OnlyOp"] = 3] = "OnlyOp";
  53. CommentDisplayType2[CommentDisplayType2["New"] = 6] = "New";
  54. return CommentDisplayType2;
  55. })(CommentDisplayType || {});
  56. const _sfc_main$m = {
  57. name: "Tooltip",
  58. props: {
  59. title: {
  60. type: String,
  61. default() {
  62. return "";
  63. }
  64. },
  65. disabled: {
  66. type: Boolean,
  67. default() {
  68. return false;
  69. }
  70. }
  71. },
  72. data() {
  73. return {
  74. show: false
  75. };
  76. },
  77. methods: {
  78. showPop(e2) {
  79. if (this.disabled)
  80. return;
  81. if (!this.title)
  82. return;
  83. e2.stopPropagation();
  84. let rect = e2.target.getBoundingClientRect();
  85. this.show = true;
  86. vue.nextTick(() => {
  87. var _a, _b;
  88. let tip = (_b = (_a = this.$refs) == null ? void 0 : _a.tip) == null ? void 0 : _b.getBoundingClientRect();
  89. if (!tip)
  90. return;
  91. if (rect.top < 50) {
  92. this.$refs.tip.style.top = rect.top + rect.height + 10 + "px";
  93. } else {
  94. this.$refs.tip.style.top = rect.top - tip.height - 10 + "px";
  95. }
  96. let tipWidth = tip.width;
  97. let rectWidth = rect.width;
  98. this.$refs.tip.style.left = rect.left - (tipWidth - rectWidth) / 2 + "px";
  99. });
  100. }
  101. },
  102. render() {
  103. let Vnode = this.$slots.default()[0];
  104. return vue.createVNode(vue.Fragment, null, [this.show && this.title && vue.createVNode(vue.Teleport, {
  105. "to": "body"
  106. }, {
  107. default: () => [vue.createVNode(vue.Transition, {
  108. "name": "fade"
  109. }, {
  110. default: () => [vue.createVNode("div", {
  111. "ref": "tip",
  112. "className": "tip"
  113. }, [this.title])]
  114. })]
  115. }), vue.createVNode(Vnode, {
  116. "onClick": () => this.show = false,
  117. "onmouseenter": (e2) => this.showPop(e2),
  118. "onmouseleave": () => this.show = false
  119. }, null)]);
  120. }
  121. };
  122. const _export_sfc = (sfc, props) => {
  123. const target = sfc.__vccOpts || sfc;
  124. for (const [key, val] of props) {
  125. target[key] = val;
  126. }
  127. return target;
  128. };
  129. const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-ee672411"]]);
  130. const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
  131. __name: "BaseSwitch",
  132. props: {
  133. modelValue: { type: Boolean }
  134. },
  135. emits: ["update:modelValue"],
  136. setup(__props, { emit: __emit }) {
  137. return (_ctx, _cache) => {
  138. return vue.openBlock(), vue.createElementBlock("div", {
  139. class: vue.normalizeClass(["switch", { active: _ctx.modelValue }]),
  140. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", !_ctx.modelValue))
  141. }, null, 2);
  142. };
  143. }
  144. });
  145. const BaseSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-e7c0fbef"]]);
  146. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  147. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  148. const functions = {
  149. async refreshOnce(once) {
  150. return new Promise((resolve) => {
  151. if (once) {
  152. if (typeof once === "string") {
  153. let res = once.match(/var once = "([\d]+)";/);
  154. if (res && res[1])
  155. resolve(Number(res[1]));
  156. }
  157. if (typeof once === "number")
  158. resolve(once);
  159. }
  160. window.fetchOnce().then((r2) => {
  161. resolve(r2);
  162. });
  163. });
  164. },
  165. clone: (val) => JSON.parse(JSON.stringify(val)),
  166. createList(post, replyList, withRedundList = true) {
  167. post.replyList = replyList;
  168. post.topReplyList = this.clone(replyList).filter((v) => v.thankCount >= window.config.topReplyLoveMinCount).sort((a, b) => b.thankCount - a.thankCount).slice(0, window.config.topReplyCount);
  169. post.replyCount = replyList.length;
  170. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  171. post.nestedReplies = functions.createNestedList(this.clone(replyList), post.topReplyList);
  172. if (withRedundList) {
  173. post.nestedRedundReplies = functions.createNestedRedundantList(this.clone(replyList), post.topReplyList);
  174. }
  175. return post;
  176. },
  177. //获取所有回复
  178. getAllReply(repliesMap = []) {
  179. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  180. pre = pre.concat(i.replyList);
  181. return pre;
  182. }, []);
  183. },
  184. //查找子回复
  185. findChildren(item, endList, all, topReplyList) {
  186. var _a;
  187. const fn = (child, endList2, parent) => {
  188. child.level = parent.level + 1;
  189. let rIndex2 = all.findIndex((v) => v.floor === child.floor);
  190. if (rIndex2 > -1) {
  191. all[rIndex2].isUse = true;
  192. }
  193. parent.children.push(this.findChildren(child, endList2, all, topReplyList));
  194. };
  195. item.children = [];
  196. let floorReplyList = [];
  197. for (let i = 0; i < endList.length; i++) {
  198. let currentItem = endList[i];
  199. if (currentItem.isUse)
  200. continue;
  201. if (currentItem.replyFloor === item.floor) {
  202. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  203. currentItem.isUse = true;
  204. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  205. } else {
  206. currentItem.isWrong = true;
  207. }
  208. }
  209. }
  210. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  211. fn(currentItem, endList2, item);
  212. });
  213. let nextMeIndex = endList.findIndex((v) => {
  214. var _a2;
  215. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  216. });
  217. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  218. for (let i = 0; i < findList.length; i++) {
  219. let currentItem = findList[i];
  220. if (currentItem.isUse)
  221. continue;
  222. if (currentItem.replyUsers.length === 1) {
  223. if (currentItem.replyFloor !== -1) {
  224. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  225. continue;
  226. }
  227. }
  228. let endList2 = endList.slice(i + 1);
  229. if (currentItem.username === item.username) {
  230. if (currentItem.replyUsers[0] === item.username) {
  231. fn(currentItem, endList2, item);
  232. }
  233. break;
  234. } else {
  235. if (currentItem.replyUsers[0] === item.username) {
  236. fn(currentItem, endList2, item);
  237. }
  238. }
  239. } else {
  240. if (currentItem.username === item.username)
  241. break;
  242. }
  243. }
  244. item.children = item.children.sort((a, b) => a.floor - b.floor);
  245. item.replyCount = item.children.reduce((a, b) => {
  246. return a + (b.children.length ? b.replyCount + 1 : 1);
  247. }, 0);
  248. let rIndex = topReplyList.findIndex((v) => v.floor === item.floor);
  249. if (rIndex > -1) {
  250. topReplyList[rIndex].children = item.children;
  251. topReplyList[rIndex].replyCount = item.replyCount;
  252. }
  253. return item;
  254. },
  255. //生成嵌套回复
  256. createNestedList(allList = [], topReplyList = []) {
  257. if (!allList.length)
  258. return [];
  259. let list = allList;
  260. let nestedList = [];
  261. list.map((item, index) => {
  262. let startList = list.slice(0, index);
  263. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  264. let endList = list.slice(index + 1);
  265. if (index === 0) {
  266. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  267. } else {
  268. if (!item.isUse) {
  269. let isOneLevelReply = false;
  270. if (item.replyUsers.length) {
  271. if (item.replyUsers.length > 1) {
  272. isOneLevelReply = true;
  273. } else {
  274. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  275. }
  276. } else {
  277. isOneLevelReply = true;
  278. }
  279. if (isOneLevelReply) {
  280. item.level = 0;
  281. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  282. }
  283. }
  284. }
  285. });
  286. return nestedList;
  287. },
  288. //生成嵌套冗余回复
  289. createNestedRedundantList(allList = [], topReplyList) {
  290. if (!allList.length)
  291. return [];
  292. let list = allList;
  293. let nestedList = [];
  294. list.map((item, index) => {
  295. let startList = list.slice(0, index);
  296. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  297. let endList = list.slice(index + 1);
  298. if (index === 0) {
  299. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  300. } else {
  301. if (!item.isUse) {
  302. let isOneLevelReply = false;
  303. if (item.replyUsers.length) {
  304. if (item.replyUsers.length > 1) {
  305. isOneLevelReply = true;
  306. } else {
  307. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  308. }
  309. } else {
  310. isOneLevelReply = true;
  311. }
  312. if (isOneLevelReply) {
  313. item.level = 0;
  314. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  315. }
  316. } else {
  317. let newItem = this.clone(item);
  318. newItem.children = [];
  319. newItem.level = 0;
  320. newItem.isDup = true;
  321. nestedList.push(newItem);
  322. }
  323. }
  324. });
  325. return nestedList;
  326. },
  327. //解析A标签
  328. parseA(a) {
  329. let href = a.href;
  330. let id;
  331. if (href.includes("/t/")) {
  332. id = a.pathname.substring("/t/".length);
  333. }
  334. return { href, id, title: a.innerText };
  335. },
  336. //图片链接转Img标签
  337. checkPhotoLink2Img(dom) {
  338. let replaceImgur = window.config.replaceImgur;
  339. let is_add = false;
  340. let prefix_img = replaceImgur ? DefaultVal.imgurProxy : "";
  341. let imgList = dom.querySelectorAll("img");
  342. imgList.forEach((img) => {
  343. let href = img.src;
  344. if (href.includes("imgur.com")) {
  345. img.setAttribute("originUrl", img.src);
  346. img.setAttribute("notice", "此img标签由V2Next脚本解析");
  347. img.setAttribute("referrerpolicy", "no-referrer");
  348. if (href.includes(".png") || href.includes(".jpg") || href.includes(".jpeg") || href.includes(".gif") || href.includes(".PNG") || href.includes(".JPG") || href.includes(".JPEG") || href.includes(".GIF"))
  349. ;
  350. else {
  351. href = href + ".png";
  352. }
  353. if (!is_add && replaceImgur) {
  354. let meta = document.createElement("meta");
  355. meta.setAttribute("name", "referrer");
  356. meta.setAttribute("content", "no-referrer");
  357. document.getElementsByTagName("head")[0].appendChild(meta);
  358. is_add = true;
  359. }
  360. img.src = prefix_img + href;
  361. }
  362. });
  363. let aList = dom.querySelectorAll("a");
  364. aList.forEach((a) => {
  365. let href = a.href;
  366. if (a.children.length == 0 && a.innerText == href) {
  367. if (href.includes(".png") || href.includes(".jpg") || href.includes(".jpeg") || href.includes(".gif") || href.includes(".PNG") || href.includes(".JPG") || href.includes(".JPEG") || href.includes(".GIF")) {
  368. let img = document.createElement("img");
  369. img.setAttribute("originUrl", a.href);
  370. img.setAttribute("notice", "此img标签由V2Next脚本解析");
  371. img.setAttribute("referrerpolicy", "no-referrer");
  372. if (href.includes("imgur.com")) {
  373. if (!is_add && replaceImgur) {
  374. let meta = document.createElement("meta");
  375. meta.setAttribute("name", "referrer");
  376. meta.setAttribute("content", "no-referrer");
  377. document.getElementsByTagName("head")[0].appendChild(meta);
  378. is_add = true;
  379. }
  380. img.src = prefix_img + href;
  381. } else {
  382. img.src = href;
  383. }
  384. a.innerText = "";
  385. a.append(img);
  386. }
  387. }
  388. });
  389. },
  390. //检测帖子回复长度
  391. async checkPostReplies(id, needOpen = true) {
  392. return new Promise(async (resolve) => {
  393. let res = await functions.getPostDetailByApi(id);
  394. if ((res == null ? void 0 : res.replies) > window.config.maxReplyCountLimit) {
  395. if (needOpen) {
  396. functions.openNewTab(`https://${location.origin}/t/${id}?p=1&script=1`);
  397. }
  398. return resolve(true);
  399. }
  400. resolve(false);
  401. });
  402. },
  403. async sleep(time) {
  404. return new Promise((resolve) => {
  405. setTimeout(resolve, time);
  406. });
  407. },
  408. //打开新标签页
  409. openNewTab(href, active = false) {
  410. let isSafariBrowser = /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
  411. if (isSafariBrowser) {
  412. let tempId = "a_blank_" + Date.now();
  413. let a = document.createElement("a");
  414. a.setAttribute("href", href);
  415. a.setAttribute("target", "_blank");
  416. a.setAttribute("id", tempId);
  417. a.setAttribute("script", "1");
  418. if (!document.getElementById(tempId)) {
  419. document.body.appendChild(a);
  420. }
  421. a.click();
  422. } else {
  423. _GM_openInTab(href, { active });
  424. }
  425. },
  426. async cbChecker(val, count = 0) {
  427. if (window.cb) {
  428. window.cb(val);
  429. } else {
  430. while (!window.cb && count < 30) {
  431. await functions.sleep(500);
  432. count++;
  433. }
  434. window.cb && window.cb(val);
  435. }
  436. },
  437. //初始化脚本菜单
  438. initMonkeyMenu() {
  439. try {
  440. _GM_registerMenuCommand("脚本设置", () => {
  441. functions.cbChecker({ type: "openSetting" });
  442. });
  443. _GM_registerMenuCommand("仓库地址", () => {
  444. functions.openNewTab(window.const.git);
  445. });
  446. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  447. } catch (e2) {
  448. console.error("无法使用Tampermonkey");
  449. }
  450. },
  451. feedback() {
  452. functions.openNewTab(DefaultVal.issue);
  453. },
  454. //检测页面类型
  455. checkPageType(a) {
  456. let l = a || window.location;
  457. let data = { pageType: null, pageData: { id: "", pageNo: null }, username: "" };
  458. if (l.pathname === "/") {
  459. data.pageType = PageType.Home;
  460. } else if (l.pathname === "/changes") {
  461. data.pageType = PageType.Changes;
  462. } else if (l.pathname === "/v2hot") {
  463. data.pageType = PageType.Hot;
  464. } else if (l.pathname === "/recent") {
  465. data.pageType = PageType.Changes;
  466. } else if (l.href.match(/.com\/?tab=/)) {
  467. data.pageType = PageType.Home;
  468. } else if (l.href.match(/.com\/go\//)) {
  469. if (!l.href.includes("/links")) {
  470. data.pageType = PageType.Node;
  471. }
  472. } else if (l.href.match(/.com\/member/)) {
  473. data.pageType = PageType.Member;
  474. data.username = l.pathname.replace("/member/", "").replace("/replies", "").replace("/topics", "");
  475. } else {
  476. let r2 = l.href.match(/.com\/t\/([\d]+)/);
  477. if (r2 && !l.pathname.includes("review") && !l.pathname.includes("info")) {
  478. data.pageType = PageType.Post;
  479. data.pageData.id = r2[1];
  480. if (l.search) {
  481. let pr = l.href.match(/\?p=([\d]+)/);
  482. if (pr)
  483. data.pageData.pageNo = Number(pr[1]);
  484. }
  485. }
  486. }
  487. return data;
  488. },
  489. //通过api获取主题详情
  490. getPostDetailByApi(id) {
  491. return new Promise((resolve) => {
  492. fetch(`${location.origin}/api/topics/show.json?id=${id}`).then(async (r2) => {
  493. if (r2.status === 200) {
  494. let res = await r2.json();
  495. if (res) {
  496. let d2 = res[0];
  497. resolve(d2);
  498. }
  499. }
  500. });
  501. });
  502. },
  503. appendPostContent(res, el) {
  504. let a = document.createElement("a");
  505. a.href = res.href;
  506. a.classList.add("post-content");
  507. let div = document.createElement("div");
  508. div.innerHTML = res.content_rendered;
  509. a.append(div);
  510. el.append(a);
  511. const checkHeight2 = () => {
  512. var _a;
  513. if (div.clientHeight < 300) {
  514. a.classList.add("show-all");
  515. } else {
  516. let showMore = document.createElement("div");
  517. showMore.classList.add("show-more");
  518. showMore.innerHTML = "显示更多/收起";
  519. showMore.onclick = function(e2) {
  520. e2.stopPropagation();
  521. a.classList.toggle("show-all");
  522. };
  523. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  524. }
  525. };
  526. checkHeight2();
  527. },
  528. //从本地读取配置
  529. initConfig() {
  530. let configStr = localStorage.getItem("v2ex-config");
  531. let configMap = {};
  532. let configObj = {};
  533. let userName = window.user.username || "default";
  534. if (configStr) {
  535. configMap = JSON.parse(configStr);
  536. configObj = configMap[userName];
  537. if (configObj) {
  538. window.config = functions.deepAssign(window.config, configObj);
  539. }
  540. }
  541. configMap[userName] = window.config;
  542. localStorage.setItem("v2ex-config", JSON.stringify(configMap));
  543. },
  544. deepAssign(...arg) {
  545. let name, options, src, copy;
  546. let length = arguments.length;
  547. let i = 1;
  548. let target = arguments[0] || {};
  549. if (typeof target !== "object") {
  550. target = {};
  551. }
  552. for (; i < length; i++) {
  553. options = arguments[i];
  554. if (options != null) {
  555. for (name in options) {
  556. src = target[name];
  557. copy = options[name];
  558. if (copy && typeof copy == "object") {
  559. target[name] = this.deepAssign(src, copy);
  560. } else if (copy !== void 0) {
  561. target[name] = copy;
  562. }
  563. }
  564. }
  565. }
  566. return target;
  567. },
  568. //生成dom,从html字符串
  569. genDomFromHtmlString(htmlText) {
  570. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  571. let body = document.createElement("html");
  572. body.innerHTML = bodyText[0];
  573. return body;
  574. },
  575. stopEvent(e2) {
  576. e2.preventDefault();
  577. e2.stopPropagation();
  578. }
  579. };
  580. const DefaultPost = {
  581. allReplyUsers: [],
  582. content_rendered: "",
  583. createDate: "",
  584. createDateAgo: "",
  585. lastReplyDate: "",
  586. lastReplyUsername: "",
  587. fr: "",
  588. replyList: [],
  589. topReplyList: [],
  590. nestedReplies: [],
  591. nestedRedundReplies: [],
  592. username: "",
  593. url: "",
  594. href: "",
  595. member: {
  596. avatar: "",
  597. username: ""
  598. },
  599. node: {
  600. title: "",
  601. url: ""
  602. },
  603. headerTemplate: "",
  604. title: "",
  605. id: "",
  606. type: "post",
  607. once: "",
  608. replyCount: 0,
  609. clickCount: 0,
  610. thankCount: 0,
  611. collectCount: 0,
  612. lastReadFloor: 0,
  613. isFavorite: false,
  614. isIgnore: false,
  615. isThanked: false,
  616. isReport: false,
  617. inList: false
  618. };
  619. const getDefaultPost = (val = {}) => {
  620. return Object.assign(functions.clone(DefaultPost), val);
  621. };
  622. const DefaultUser = {
  623. tagPrefix: "--用户标签--",
  624. tags: {},
  625. tagsId: "",
  626. username: "",
  627. avatar: "",
  628. readPrefix: "--已读楼层--",
  629. readNoteItemId: "",
  630. readList: {},
  631. imgurPrefix: "--imgur图片删除hash--",
  632. imgurList: {},
  633. imgurNoteId: "",
  634. configPrefix: "--config--",
  635. configNoteId: ""
  636. };
  637. const DefaultVal = {
  638. pageType: void 0,
  639. pageData: { pageNo: 1 },
  640. targetUserName: "",
  641. currentVersion: 5,
  642. cb: null,
  643. git: "https://github.com/zyronon/V2Next",
  644. shortGit: "zyronon/V2Next",
  645. issue: "https://github.com/zyronon/V2Next/issues",
  646. pcLog: "https://gf.qytechs.cn/zh-CN/scripts/458024/versions",
  647. pcScript: "https://gf.qytechs.cn/zh-CN/scripts/458024",
  648. mobileScript: "https://github.com/zyronon/V2Next/releases",
  649. homeUrl: "https://vtonext.vercel.app/",
  650. hotUrl: "https://v2hotlist.vercel.app/hot/",
  651. imgurProxy: "https://img.noobzone.ru/getimg.php?url="
  652. };
  653. function getDefaultConfig(val = {}) {
  654. return Object.assign({
  655. showToolbar: true,
  656. autoOpenDetail: true,
  657. openTag: false,
  658. //给用户打标签
  659. clickPostItemOpenDetail: true,
  660. closePostDetailBySpace: true,
  661. //点击空白处关闭详情
  662. contentAutoCollapse: true,
  663. //正文超长自动折叠
  664. viewType: "table",
  665. commentDisplayType: CommentDisplayType.FloorInFloorNoCallUser,
  666. newTabOpen: false,
  667. //新标签打开
  668. newTabOpenActive: false,
  669. base64: true,
  670. //base功能
  671. sov2ex: false,
  672. postWidth: "",
  673. showTopReply: true,
  674. topReplyLoveMinCount: 3,
  675. topReplyCount: 5,
  676. autoJumpLastReadFloor: false,
  677. rememberLastReadFloor: false,
  678. autoSignin: true,
  679. customBgColor: "",
  680. version: DefaultVal.currentVersion,
  681. collectBrowserNotice: false,
  682. fontSizeType: "normal",
  683. notice: {
  684. uid: "",
  685. text: "",
  686. ddWebhook: "",
  687. takeOverNoticePage: true,
  688. whenNewNoticeGlimmer: false,
  689. loopCheckNotice: false,
  690. loopCheckNoticeInterval: 5
  691. },
  692. replaceImgur: false,
  693. maxReplyCountLimit: 400
  694. }, val);
  695. }
  696. const emojiEmoticons = [
  697. {
  698. title: "常用",
  699. list: [
  700. "😅",
  701. "😭",
  702. "😂",
  703. "🥰",
  704. "😰",
  705. "🤡",
  706. "👀",
  707. "🐴",
  708. "🐶",
  709. "❓",
  710. "❤️",
  711. "💔",
  712. "⭐",
  713. "🔥",
  714. "💩",
  715. "🔞",
  716. "⚠️",
  717. "🎁",
  718. "🎉"
  719. ]
  720. },
  721. {
  722. title: "小黄脸",
  723. list: [
  724. "😀",
  725. "😁",
  726. "😂",
  727. "🤣",
  728. "😅",
  729. "😊",
  730. "😋",
  731. "😘",
  732. "🥰",
  733. "😗",
  734. "🤩",
  735. "🤔",
  736. "🤨",
  737. "😐",
  738. "😑",
  739. "🙄",
  740. "😏",
  741. "😪",
  742. "😫",
  743. "🥱",
  744. "😜",
  745. "😒",
  746. "😔",
  747. "😨",
  748. "😰",
  749. "😱",
  750. "🥵",
  751. "😡",
  752. "🥳",
  753. "🥺",
  754. "🤭",
  755. "🧐",
  756. "😎",
  757. "🤓",
  758. "😭",
  759. "🤑",
  760. "🤮"
  761. ]
  762. },
  763. {
  764. title: "手势",
  765. list: [
  766. "🤏",
  767. "👉",
  768. "✌️",
  769. "👌",
  770. "👍",
  771. "👎",
  772. "🤝",
  773. "🙏",
  774. "👏"
  775. ]
  776. },
  777. {
  778. title: "其他",
  779. list: ["🔞", "👻", "🤡", "🐔", "👀", "💩", "🐴", "🦄", "🐧", "🐶"]
  780. }
  781. ];
  782. const classicsEmoticons = [
  783. {
  784. name: "[狗头]",
  785. low: "https://i.imgur.com/io2SM1h.png",
  786. high: "https://i.imgur.com/0icl60r.png"
  787. },
  788. {
  789. name: "[doge]",
  790. low: "https://i.imgur.com/duWRpIu.png",
  791. high: "https://i.imgur.com/HyphI6d.png"
  792. },
  793. {
  794. name: "[受虐滑稽]",
  795. low: "https://i.imgur.com/Iy0taMy.png",
  796. high: "https://i.imgur.com/PS1pxd9.png"
  797. },
  798. {
  799. name: "[马]",
  800. low: "https://i.imgur.com/8EKZv7I.png",
  801. high: "https://i.imgur.com/ANFUX52.png"
  802. },
  803. {
  804. name: "[二哈]",
  805. low: "https://i.imgur.com/XKj1Tkx.png",
  806. high: "https://i.imgur.com/dOeP4XD.png"
  807. },
  808. {
  809. name: "[舔屏]",
  810. low: "https://i.imgur.com/Cvl7dyN.png",
  811. high: "https://i.imgur.com/LmETy9N.png"
  812. },
  813. {
  814. name: "[辣眼睛]",
  815. low: "https://i.imgur.com/cPNPYD5.png",
  816. high: "https://i.imgur.com/3fSUmi8.png"
  817. },
  818. {
  819. name: "[吃瓜]",
  820. low: "https://i.imgur.com/ee8Lq7H.png",
  821. high: "https://i.imgur.com/0L26og9.png"
  822. },
  823. {
  824. name: "[不高兴]",
  825. low: "https://i.imgur.com/huX6coX.png",
  826. high: "https://i.imgur.com/N7JEuvc.png"
  827. },
  828. // {
  829. // name: '[呵呵]',
  830. // low: 'https://i.imgur.com/RvoLAbX.png',
  831. // high: 'https://i.imgur.com/xSzIqrK.png'
  832. // },
  833. {
  834. name: "[真棒]",
  835. low: "https://i.imgur.com/xr1UOz1.png",
  836. high: "https://i.imgur.com/w8YEw9Q.png"
  837. },
  838. {
  839. name: "[鄙视]",
  840. low: "https://i.imgur.com/u6jlqVq.png",
  841. high: "https://i.imgur.com/8JFNANq.png"
  842. },
  843. {
  844. name: "[疑问]",
  845. low: "https://i.imgur.com/F29pmQ6.png",
  846. high: "https://i.imgur.com/EbbTQAR.png"
  847. },
  848. {
  849. name: "[吐舌]",
  850. low: "https://i.imgur.com/InmIzl9.png",
  851. high: "https://i.imgur.com/Ovj56Cd.png"
  852. },
  853. // {
  854. // name: '[嘲笑]',
  855. // low: 'https://i.imgur.com/BaWcsMR.png',
  856. // high: 'https://i.imgur.com/0OGfJw4.png'
  857. // },
  858. // {
  859. // name: '[滑稽]',
  860. // low: 'https://i.imgur.com/lmbN0yI.png',
  861. // high: 'https://i.imgur.com/Pc0wH85.png'
  862. // },
  863. {
  864. name: "[笑眼]",
  865. low: "https://i.imgur.com/ZveiiGy.png",
  866. high: "https://i.imgur.com/PI1CfEr.png"
  867. },
  868. // {
  869. // name: '[狂汗]',
  870. // low: 'https://i.imgur.com/veWihk6.png',
  871. // high: 'https://i.imgur.com/3LtHdQv.png'
  872. // },
  873. {
  874. name: "[大哭]",
  875. low: "https://i.imgur.com/hu4oR6C.png",
  876. high: "https://i.imgur.com/b4X9XLE.png"
  877. },
  878. {
  879. name: "[喷]",
  880. low: "https://i.imgur.com/bkw3VRr.png",
  881. high: "https://i.imgur.com/wnZL13L.png"
  882. },
  883. {
  884. name: "[苦笑]",
  885. low: "https://i.imgur.com/VUWFktU.png",
  886. high: "https://i.imgur.com/NAfspZ1.png"
  887. },
  888. {
  889. name: "[喝酒]",
  890. low: "https://i.imgur.com/2ZZSapE.png",
  891. high: "https://i.imgur.com/rVbSVak.png"
  892. },
  893. {
  894. name: "[捂脸]",
  895. low: "https://i.imgur.com/krir4IG.png",
  896. high: "https://i.imgur.com/qqBqgVm.png"
  897. },
  898. // {
  899. // name: '[呕]',
  900. // low: 'https://i.imgur.com/6CUiUxv.png',
  901. // high: 'https://i.imgur.com/kgdxRsG.png'
  902. // },
  903. {
  904. name: "[阴险]",
  905. low: "https://i.imgur.com/MA8YqTP.png",
  906. high: "https://i.imgur.com/e94jbaT.png"
  907. },
  908. {
  909. name: "[怒]",
  910. low: "https://i.imgur.com/n4kWfGB.png",
  911. high: "https://i.imgur.com/iMXxNxh.png"
  912. }
  913. // {
  914. // name: '[衰]',
  915. // low: 'https://i.imgur.com/voHFDyQ.png',
  916. // high: 'https://i.imgur.com/XffE6gu.png'
  917. // },
  918. // {
  919. // name: '[合十]',
  920. // low: 'https://i.imgur.com/I8x3ang.png',
  921. // high: 'https://i.imgur.com/T4rJVee.png'
  922. // },
  923. // {
  924. // name: '[赞]',
  925. // low: 'https://i.imgur.com/lG44yUl.png',
  926. // high: 'https://i.imgur.com/AoF5PLp.png'
  927. // },
  928. // {
  929. // name: '[踩]',
  930. // low: 'https://i.imgur.com/cJp0uKZ.png',
  931. // high: 'https://i.imgur.com/1XYGfXj.png'
  932. // },
  933. // {
  934. // name: '[爱心]',
  935. // low: 'https://i.imgur.com/sLENaF5.png',
  936. // high: 'https://i.imgur.com/dND56oX.png'
  937. // },
  938. //
  939. // {
  940. // name: '[心碎]',
  941. // low: 'https://i.imgur.com/AZxJzve.png',
  942. // high: 'https://i.imgur.com/RiUsPci.png'
  943. // },
  944. ];
  945. const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
  946. const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
  947. const colonSeparated = value.split(":");
  948. if (value.slice(0, 1) === "@") {
  949. if (colonSeparated.length < 2 || colonSeparated.length > 3) {
  950. return null;
  951. }
  952. provider = colonSeparated.shift().slice(1);
  953. }
  954. if (colonSeparated.length > 3 || !colonSeparated.length) {
  955. return null;
  956. }
  957. if (colonSeparated.length > 1) {
  958. const name2 = colonSeparated.pop();
  959. const prefix = colonSeparated.pop();
  960. const result = {
  961. // Allow provider without '@': "provider:prefix:name"
  962. provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
  963. prefix,
  964. name: name2
  965. };
  966. return validate && !validateIconName(result) ? null : result;
  967. }
  968. const name = colonSeparated[0];
  969. const dashSeparated = name.split("-");
  970. if (dashSeparated.length > 1) {
  971. const result = {
  972. provider,
  973. prefix: dashSeparated.shift(),
  974. name: dashSeparated.join("-")
  975. };
  976. return validate && !validateIconName(result) ? null : result;
  977. }
  978. if (allowSimpleName && provider === "") {
  979. const result = {
  980. provider,
  981. prefix: "",
  982. name
  983. };
  984. return validate && !validateIconName(result, allowSimpleName) ? null : result;
  985. }
  986. return null;
  987. };
  988. const validateIconName = (icon, allowSimpleName) => {
  989. if (!icon) {
  990. return false;
  991. }
  992. return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
  993. };
  994. const defaultIconDimensions = Object.freeze(
  995. {
  996. left: 0,
  997. top: 0,
  998. width: 16,
  999. height: 16
  1000. }
  1001. );
  1002. const defaultIconTransformations = Object.freeze({
  1003. rotate: 0,
  1004. vFlip: false,
  1005. hFlip: false
  1006. });
  1007. const defaultIconProps = Object.freeze({
  1008. ...defaultIconDimensions,
  1009. ...defaultIconTransformations
  1010. });
  1011. const defaultExtendedIconProps = Object.freeze({
  1012. ...defaultIconProps,
  1013. body: "",
  1014. hidden: false
  1015. });
  1016. function mergeIconTransformations(obj1, obj2) {
  1017. const result = {};
  1018. if (!obj1.hFlip !== !obj2.hFlip) {
  1019. result.hFlip = true;
  1020. }
  1021. if (!obj1.vFlip !== !obj2.vFlip) {
  1022. result.vFlip = true;
  1023. }
  1024. const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
  1025. if (rotate) {
  1026. result.rotate = rotate;
  1027. }
  1028. return result;
  1029. }
  1030. function mergeIconData(parent, child) {
  1031. const result = mergeIconTransformations(parent, child);
  1032. for (const key in defaultExtendedIconProps) {
  1033. if (key in defaultIconTransformations) {
  1034. if (key in parent && !(key in result)) {
  1035. result[key] = defaultIconTransformations[key];
  1036. }
  1037. } else if (key in child) {
  1038. result[key] = child[key];
  1039. } else if (key in parent) {
  1040. result[key] = parent[key];
  1041. }
  1042. }
  1043. return result;
  1044. }
  1045. function getIconsTree(data, names) {
  1046. const icons = data.icons;
  1047. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1048. const resolved = /* @__PURE__ */ Object.create(null);
  1049. function resolve(name) {
  1050. if (icons[name]) {
  1051. return resolved[name] = [];
  1052. }
  1053. if (!(name in resolved)) {
  1054. resolved[name] = null;
  1055. const parent = aliases[name] && aliases[name].parent;
  1056. const value = parent && resolve(parent);
  1057. if (value) {
  1058. resolved[name] = [parent].concat(value);
  1059. }
  1060. }
  1061. return resolved[name];
  1062. }
  1063. (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
  1064. return resolved;
  1065. }
  1066. function internalGetIconData(data, name, tree) {
  1067. const icons = data.icons;
  1068. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1069. let currentProps = {};
  1070. function parse(name2) {
  1071. currentProps = mergeIconData(
  1072. icons[name2] || aliases[name2],
  1073. currentProps
  1074. );
  1075. }
  1076. parse(name);
  1077. tree.forEach(parse);
  1078. return mergeIconData(data, currentProps);
  1079. }
  1080. function parseIconSet(data, callback) {
  1081. const names = [];
  1082. if (typeof data !== "object" || typeof data.icons !== "object") {
  1083. return names;
  1084. }
  1085. if (data.not_found instanceof Array) {
  1086. data.not_found.forEach((name) => {
  1087. callback(name, null);
  1088. names.push(name);
  1089. });
  1090. }
  1091. const tree = getIconsTree(data);
  1092. for (const name in tree) {
  1093. const item = tree[name];
  1094. if (item) {
  1095. callback(name, internalGetIconData(data, name, item));
  1096. names.push(name);
  1097. }
  1098. }
  1099. return names;
  1100. }
  1101. const optionalPropertyDefaults = {
  1102. provider: "",
  1103. aliases: {},
  1104. not_found: {},
  1105. ...defaultIconDimensions
  1106. };
  1107. function checkOptionalProps(item, defaults) {
  1108. for (const prop in defaults) {
  1109. if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
  1110. return false;
  1111. }
  1112. }
  1113. return true;
  1114. }
  1115. function quicklyValidateIconSet(obj) {
  1116. if (typeof obj !== "object" || obj === null) {
  1117. return null;
  1118. }
  1119. const data = obj;
  1120. if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
  1121. return null;
  1122. }
  1123. if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
  1124. return null;
  1125. }
  1126. const icons = data.icons;
  1127. for (const name in icons) {
  1128. const icon = icons[name];
  1129. if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(
  1130. icon,
  1131. defaultExtendedIconProps
  1132. )) {
  1133. return null;
  1134. }
  1135. }
  1136. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1137. for (const name in aliases) {
  1138. const icon = aliases[name];
  1139. const parent = icon.parent;
  1140. if (!name.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(
  1141. icon,
  1142. defaultExtendedIconProps
  1143. )) {
  1144. return null;
  1145. }
  1146. }
  1147. return data;
  1148. }
  1149. const dataStorage = /* @__PURE__ */ Object.create(null);
  1150. function newStorage(provider, prefix) {
  1151. return {
  1152. provider,
  1153. prefix,
  1154. icons: /* @__PURE__ */ Object.create(null),
  1155. missing: /* @__PURE__ */ new Set()
  1156. };
  1157. }
  1158. function getStorage(provider, prefix) {
  1159. const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
  1160. return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
  1161. }
  1162. function addIconSet(storage2, data) {
  1163. if (!quicklyValidateIconSet(data)) {
  1164. return [];
  1165. }
  1166. return parseIconSet(data, (name, icon) => {
  1167. if (icon) {
  1168. storage2.icons[name] = icon;
  1169. } else {
  1170. storage2.missing.add(name);
  1171. }
  1172. });
  1173. }
  1174. function addIconToStorage(storage2, name, icon) {
  1175. try {
  1176. if (typeof icon.body === "string") {
  1177. storage2.icons[name] = { ...icon };
  1178. return true;
  1179. }
  1180. } catch (err) {
  1181. }
  1182. return false;
  1183. }
  1184. let simpleNames = false;
  1185. function allowSimpleNames(allow) {
  1186. if (typeof allow === "boolean") {
  1187. simpleNames = allow;
  1188. }
  1189. return simpleNames;
  1190. }
  1191. function getIconData(name) {
  1192. const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
  1193. if (icon) {
  1194. const storage2 = getStorage(icon.provider, icon.prefix);
  1195. const iconName = icon.name;
  1196. return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
  1197. }
  1198. }
  1199. function addIcon(name, data) {
  1200. const icon = stringToIcon(name, true, simpleNames);
  1201. if (!icon) {
  1202. return false;
  1203. }
  1204. const storage2 = getStorage(icon.provider, icon.prefix);
  1205. return addIconToStorage(storage2, icon.name, data);
  1206. }
  1207. function addCollection(data, provider) {
  1208. if (typeof data !== "object") {
  1209. return false;
  1210. }
  1211. if (typeof provider !== "string") {
  1212. provider = data.provider || "";
  1213. }
  1214. if (simpleNames && !provider && !data.prefix) {
  1215. let added = false;
  1216. if (quicklyValidateIconSet(data)) {
  1217. data.prefix = "";
  1218. parseIconSet(data, (name, icon) => {
  1219. if (icon && addIcon(name, icon)) {
  1220. added = true;
  1221. }
  1222. });
  1223. }
  1224. return added;
  1225. }
  1226. const prefix = data.prefix;
  1227. if (!validateIconName({
  1228. provider,
  1229. prefix,
  1230. name: "a"
  1231. })) {
  1232. return false;
  1233. }
  1234. const storage2 = getStorage(provider, prefix);
  1235. return !!addIconSet(storage2, data);
  1236. }
  1237. const defaultIconSizeCustomisations = Object.freeze({
  1238. width: null,
  1239. height: null
  1240. });
  1241. const defaultIconCustomisations = Object.freeze({
  1242. // Dimensions
  1243. ...defaultIconSizeCustomisations,
  1244. // Transformations
  1245. ...defaultIconTransformations
  1246. });
  1247. const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
  1248. const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
  1249. function calculateSize(size, ratio, precision) {
  1250. if (ratio === 1) {
  1251. return size;
  1252. }
  1253. precision = precision || 100;
  1254. if (typeof size === "number") {
  1255. return Math.ceil(size * ratio * precision) / precision;
  1256. }
  1257. if (typeof size !== "string") {
  1258. return size;
  1259. }
  1260. const oldParts = size.split(unitsSplit);
  1261. if (oldParts === null || !oldParts.length) {
  1262. return size;
  1263. }
  1264. const newParts = [];
  1265. let code = oldParts.shift();
  1266. let isNumber = unitsTest.test(code);
  1267. while (true) {
  1268. if (isNumber) {
  1269. const num = parseFloat(code);
  1270. if (isNaN(num)) {
  1271. newParts.push(code);
  1272. } else {
  1273. newParts.push(Math.ceil(num * ratio * precision) / precision);
  1274. }
  1275. } else {
  1276. newParts.push(code);
  1277. }
  1278. code = oldParts.shift();
  1279. if (code === void 0) {
  1280. return newParts.join("");
  1281. }
  1282. isNumber = !isNumber;
  1283. }
  1284. }
  1285. const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
  1286. function iconToSVG(icon, customisations) {
  1287. const fullIcon = {
  1288. ...defaultIconProps,
  1289. ...icon
  1290. };
  1291. const fullCustomisations = {
  1292. ...defaultIconCustomisations,
  1293. ...customisations
  1294. };
  1295. const box = {
  1296. left: fullIcon.left,
  1297. top: fullIcon.top,
  1298. width: fullIcon.width,
  1299. height: fullIcon.height
  1300. };
  1301. let body = fullIcon.body;
  1302. [fullIcon, fullCustomisations].forEach((props) => {
  1303. const transformations = [];
  1304. const hFlip = props.hFlip;
  1305. const vFlip = props.vFlip;
  1306. let rotation = props.rotate;
  1307. if (hFlip) {
  1308. if (vFlip) {
  1309. rotation += 2;
  1310. } else {
  1311. transformations.push(
  1312. "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
  1313. );
  1314. transformations.push("scale(-1 1)");
  1315. box.top = box.left = 0;
  1316. }
  1317. } else if (vFlip) {
  1318. transformations.push(
  1319. "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
  1320. );
  1321. transformations.push("scale(1 -1)");
  1322. box.top = box.left = 0;
  1323. }
  1324. let tempValue;
  1325. if (rotation < 0) {
  1326. rotation -= Math.floor(rotation / 4) * 4;
  1327. }
  1328. rotation = rotation % 4;
  1329. switch (rotation) {
  1330. case 1:
  1331. tempValue = box.height / 2 + box.top;
  1332. transformations.unshift(
  1333. "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  1334. );
  1335. break;
  1336. case 2:
  1337. transformations.unshift(
  1338. "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
  1339. );
  1340. break;
  1341. case 3:
  1342. tempValue = box.width / 2 + box.left;
  1343. transformations.unshift(
  1344. "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  1345. );
  1346. break;
  1347. }
  1348. if (rotation % 2 === 1) {
  1349. if (box.left !== box.top) {
  1350. tempValue = box.left;
  1351. box.left = box.top;
  1352. box.top = tempValue;
  1353. }
  1354. if (box.width !== box.height) {
  1355. tempValue = box.width;
  1356. box.width = box.height;
  1357. box.height = tempValue;
  1358. }
  1359. }
  1360. if (transformations.length) {
  1361. body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
  1362. }
  1363. });
  1364. const customisationsWidth = fullCustomisations.width;
  1365. const customisationsHeight = fullCustomisations.height;
  1366. const boxWidth = box.width;
  1367. const boxHeight = box.height;
  1368. let width;
  1369. let height;
  1370. if (customisationsWidth === null) {
  1371. height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  1372. width = calculateSize(height, boxWidth / boxHeight);
  1373. } else {
  1374. width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
  1375. height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  1376. }
  1377. const attributes = {};
  1378. const setAttr = (prop, value) => {
  1379. if (!isUnsetKeyword(value)) {
  1380. attributes[prop] = value.toString();
  1381. }
  1382. };
  1383. setAttr("width", width);
  1384. setAttr("height", height);
  1385. attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
  1386. return {
  1387. attributes,
  1388. body
  1389. };
  1390. }
  1391. const regex = /\sid="(\S+)"/g;
  1392. const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
  1393. let counter = 0;
  1394. function replaceIDs(body, prefix = randomPrefix) {
  1395. const ids = [];
  1396. let match;
  1397. while (match = regex.exec(body)) {
  1398. ids.push(match[1]);
  1399. }
  1400. if (!ids.length) {
  1401. return body;
  1402. }
  1403. const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
  1404. ids.forEach((id) => {
  1405. const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
  1406. const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  1407. body = body.replace(
  1408. // Allowed characters before id: [#;"]
  1409. // Allowed characters after id: [)"], .[a-z]
  1410. new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
  1411. "$1" + newID + suffix + "$3"
  1412. );
  1413. });
  1414. body = body.replace(new RegExp(suffix, "g"), "");
  1415. return body;
  1416. }
  1417. const storage = /* @__PURE__ */ Object.create(null);
  1418. function setAPIModule(provider, item) {
  1419. storage[provider] = item;
  1420. }
  1421. function getAPIModule(provider) {
  1422. return storage[provider] || storage[""];
  1423. }
  1424. function createAPIConfig(source) {
  1425. let resources;
  1426. if (typeof source.resources === "string") {
  1427. resources = [source.resources];
  1428. } else {
  1429. resources = source.resources;
  1430. if (!(resources instanceof Array) || !resources.length) {
  1431. return null;
  1432. }
  1433. }
  1434. const result = {
  1435. // API hosts
  1436. resources,
  1437. // Root path
  1438. path: source.path || "/",
  1439. // URL length limit
  1440. maxURL: source.maxURL || 500,
  1441. // Timeout before next host is used.
  1442. rotate: source.rotate || 750,
  1443. // Timeout before failing query.
  1444. timeout: source.timeout || 5e3,
  1445. // Randomise default API end point.
  1446. random: source.random === true,
  1447. // Start index
  1448. index: source.index || 0,
  1449. // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
  1450. dataAfterTimeout: source.dataAfterTimeout !== false
  1451. };
  1452. return result;
  1453. }
  1454. const configStorage = /* @__PURE__ */ Object.create(null);
  1455. const fallBackAPISources = [
  1456. "https://api.simplesvg.com",
  1457. "https://api.unisvg.com"
  1458. ];
  1459. const fallBackAPI = [];
  1460. while (fallBackAPISources.length > 0) {
  1461. if (fallBackAPISources.length === 1) {
  1462. fallBackAPI.push(fallBackAPISources.shift());
  1463. } else {
  1464. if (Math.random() > 0.5) {
  1465. fallBackAPI.push(fallBackAPISources.shift());
  1466. } else {
  1467. fallBackAPI.push(fallBackAPISources.pop());
  1468. }
  1469. }
  1470. }
  1471. configStorage[""] = createAPIConfig({
  1472. resources: ["https://api.iconify.design"].concat(fallBackAPI)
  1473. });
  1474. function addAPIProvider(provider, customConfig) {
  1475. const config2 = createAPIConfig(customConfig);
  1476. if (config2 === null) {
  1477. return false;
  1478. }
  1479. configStorage[provider] = config2;
  1480. return true;
  1481. }
  1482. function getAPIConfig(provider) {
  1483. return configStorage[provider];
  1484. }
  1485. const detectFetch = () => {
  1486. let callback;
  1487. try {
  1488. callback = fetch;
  1489. if (typeof callback === "function") {
  1490. return callback;
  1491. }
  1492. } catch (err) {
  1493. }
  1494. };
  1495. let fetchModule = detectFetch();
  1496. function calculateMaxLength(provider, prefix) {
  1497. const config2 = getAPIConfig(provider);
  1498. if (!config2) {
  1499. return 0;
  1500. }
  1501. let result;
  1502. if (!config2.maxURL) {
  1503. result = 0;
  1504. } else {
  1505. let maxHostLength = 0;
  1506. config2.resources.forEach((item) => {
  1507. const host = item;
  1508. maxHostLength = Math.max(maxHostLength, host.length);
  1509. });
  1510. const url = prefix + ".json?icons=";
  1511. result = config2.maxURL - maxHostLength - config2.path.length - url.length;
  1512. }
  1513. return result;
  1514. }
  1515. function shouldAbort(status) {
  1516. return status === 404;
  1517. }
  1518. const prepare = (provider, prefix, icons) => {
  1519. const results = [];
  1520. const maxLength = calculateMaxLength(provider, prefix);
  1521. const type = "icons";
  1522. let item = {
  1523. type,
  1524. provider,
  1525. prefix,
  1526. icons: []
  1527. };
  1528. let length = 0;
  1529. icons.forEach((name, index) => {
  1530. length += name.length + 1;
  1531. if (length >= maxLength && index > 0) {
  1532. results.push(item);
  1533. item = {
  1534. type,
  1535. provider,
  1536. prefix,
  1537. icons: []
  1538. };
  1539. length = name.length;
  1540. }
  1541. item.icons.push(name);
  1542. });
  1543. results.push(item);
  1544. return results;
  1545. };
  1546. function getPath(provider) {
  1547. if (typeof provider === "string") {
  1548. const config2 = getAPIConfig(provider);
  1549. if (config2) {
  1550. return config2.path;
  1551. }
  1552. }
  1553. return "/";
  1554. }
  1555. const send = (host, params, callback) => {
  1556. if (!fetchModule) {
  1557. callback("abort", 424);
  1558. return;
  1559. }
  1560. let path = getPath(params.provider);
  1561. switch (params.type) {
  1562. case "icons": {
  1563. const prefix = params.prefix;
  1564. const icons = params.icons;
  1565. const iconsList = icons.join(",");
  1566. const urlParams = new URLSearchParams({
  1567. icons: iconsList
  1568. });
  1569. path += prefix + ".json?" + urlParams.toString();
  1570. break;
  1571. }
  1572. case "custom": {
  1573. const uri = params.uri;
  1574. path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
  1575. break;
  1576. }
  1577. default:
  1578. callback("abort", 400);
  1579. return;
  1580. }
  1581. let defaultError = 503;
  1582. fetchModule(host + path).then((response) => {
  1583. const status = response.status;
  1584. if (status !== 200) {
  1585. setTimeout(() => {
  1586. callback(shouldAbort(status) ? "abort" : "next", status);
  1587. });
  1588. return;
  1589. }
  1590. defaultError = 501;
  1591. return response.json();
  1592. }).then((data) => {
  1593. if (typeof data !== "object" || data === null) {
  1594. setTimeout(() => {
  1595. if (data === 404) {
  1596. callback("abort", data);
  1597. } else {
  1598. callback("next", defaultError);
  1599. }
  1600. });
  1601. return;
  1602. }
  1603. setTimeout(() => {
  1604. callback("success", data);
  1605. });
  1606. }).catch(() => {
  1607. callback("next", defaultError);
  1608. });
  1609. };
  1610. const fetchAPIModule = {
  1611. prepare,
  1612. send
  1613. };
  1614. function sortIcons(icons) {
  1615. const result = {
  1616. loaded: [],
  1617. missing: [],
  1618. pending: []
  1619. };
  1620. const storage2 = /* @__PURE__ */ Object.create(null);
  1621. icons.sort((a, b) => {
  1622. if (a.provider !== b.provider) {
  1623. return a.provider.localeCompare(b.provider);
  1624. }
  1625. if (a.prefix !== b.prefix) {
  1626. return a.prefix.localeCompare(b.prefix);
  1627. }
  1628. return a.name.localeCompare(b.name);
  1629. });
  1630. let lastIcon = {
  1631. provider: "",
  1632. prefix: "",
  1633. name: ""
  1634. };
  1635. icons.forEach((icon) => {
  1636. if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
  1637. return;
  1638. }
  1639. lastIcon = icon;
  1640. const provider = icon.provider;
  1641. const prefix = icon.prefix;
  1642. const name = icon.name;
  1643. const providerStorage = storage2[provider] || (storage2[provider] = /* @__PURE__ */ Object.create(null));
  1644. const localStorage2 = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
  1645. let list;
  1646. if (name in localStorage2.icons) {
  1647. list = result.loaded;
  1648. } else if (prefix === "" || localStorage2.missing.has(name)) {
  1649. list = result.missing;
  1650. } else {
  1651. list = result.pending;
  1652. }
  1653. const item = {
  1654. provider,
  1655. prefix,
  1656. name
  1657. };
  1658. list.push(item);
  1659. });
  1660. return result;
  1661. }
  1662. function removeCallback(storages, id) {
  1663. storages.forEach((storage2) => {
  1664. const items = storage2.loaderCallbacks;
  1665. if (items) {
  1666. storage2.loaderCallbacks = items.filter((row) => row.id !== id);
  1667. }
  1668. });
  1669. }
  1670. function updateCallbacks(storage2) {
  1671. if (!storage2.pendingCallbacksFlag) {
  1672. storage2.pendingCallbacksFlag = true;
  1673. setTimeout(() => {
  1674. storage2.pendingCallbacksFlag = false;
  1675. const items = storage2.loaderCallbacks ? storage2.loaderCallbacks.slice(0) : [];
  1676. if (!items.length) {
  1677. return;
  1678. }
  1679. let hasPending = false;
  1680. const provider = storage2.provider;
  1681. const prefix = storage2.prefix;
  1682. items.forEach((item) => {
  1683. const icons = item.icons;
  1684. const oldLength = icons.pending.length;
  1685. icons.pending = icons.pending.filter((icon) => {
  1686. if (icon.prefix !== prefix) {
  1687. return true;
  1688. }
  1689. const name = icon.name;
  1690. if (storage2.icons[name]) {
  1691. icons.loaded.push({
  1692. provider,
  1693. prefix,
  1694. name
  1695. });
  1696. } else if (storage2.missing.has(name)) {
  1697. icons.missing.push({
  1698. provider,
  1699. prefix,
  1700. name
  1701. });
  1702. } else {
  1703. hasPending = true;
  1704. return true;
  1705. }
  1706. return false;
  1707. });
  1708. if (icons.pending.length !== oldLength) {
  1709. if (!hasPending) {
  1710. removeCallback([storage2], item.id);
  1711. }
  1712. item.callback(
  1713. icons.loaded.slice(0),
  1714. icons.missing.slice(0),
  1715. icons.pending.slice(0),
  1716. item.abort
  1717. );
  1718. }
  1719. });
  1720. });
  1721. }
  1722. }
  1723. let idCounter = 0;
  1724. function storeCallback(callback, icons, pendingSources) {
  1725. const id = idCounter++;
  1726. const abort = removeCallback.bind(null, pendingSources, id);
  1727. if (!icons.pending.length) {
  1728. return abort;
  1729. }
  1730. const item = {
  1731. id,
  1732. icons,
  1733. callback,
  1734. abort
  1735. };
  1736. pendingSources.forEach((storage2) => {
  1737. (storage2.loaderCallbacks || (storage2.loaderCallbacks = [])).push(item);
  1738. });
  1739. return abort;
  1740. }
  1741. function listToIcons(list, validate = true, simpleNames2 = false) {
  1742. const result = [];
  1743. list.forEach((item) => {
  1744. const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames2) : item;
  1745. if (icon) {
  1746. result.push(icon);
  1747. }
  1748. });
  1749. return result;
  1750. }
  1751. var defaultConfig = {
  1752. resources: [],
  1753. index: 0,
  1754. timeout: 2e3,
  1755. rotate: 750,
  1756. random: false,
  1757. dataAfterTimeout: false
  1758. };
  1759. function sendQuery(config2, payload, query, done) {
  1760. const resourcesCount = config2.resources.length;
  1761. const startIndex = config2.random ? Math.floor(Math.random() * resourcesCount) : config2.index;
  1762. let resources;
  1763. if (config2.random) {
  1764. let list = config2.resources.slice(0);
  1765. resources = [];
  1766. while (list.length > 1) {
  1767. const nextIndex = Math.floor(Math.random() * list.length);
  1768. resources.push(list[nextIndex]);
  1769. list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
  1770. }
  1771. resources = resources.concat(list);
  1772. } else {
  1773. resources = config2.resources.slice(startIndex).concat(config2.resources.slice(0, startIndex));
  1774. }
  1775. const startTime = Date.now();
  1776. let status = "pending";
  1777. let queriesSent = 0;
  1778. let lastError;
  1779. let timer = null;
  1780. let queue = [];
  1781. let doneCallbacks = [];
  1782. if (typeof done === "function") {
  1783. doneCallbacks.push(done);
  1784. }
  1785. function resetTimer() {
  1786. if (timer) {
  1787. clearTimeout(timer);
  1788. timer = null;
  1789. }
  1790. }
  1791. function abort() {
  1792. if (status === "pending") {
  1793. status = "aborted";
  1794. }
  1795. resetTimer();
  1796. queue.forEach((item) => {
  1797. if (item.status === "pending") {
  1798. item.status = "aborted";
  1799. }
  1800. });
  1801. queue = [];
  1802. }
  1803. function subscribe(callback, overwrite) {
  1804. if (overwrite) {
  1805. doneCallbacks = [];
  1806. }
  1807. if (typeof callback === "function") {
  1808. doneCallbacks.push(callback);
  1809. }
  1810. }
  1811. function getQueryStatus() {
  1812. return {
  1813. startTime,
  1814. payload,
  1815. status,
  1816. queriesSent,
  1817. queriesPending: queue.length,
  1818. subscribe,
  1819. abort
  1820. };
  1821. }
  1822. function failQuery() {
  1823. status = "failed";
  1824. doneCallbacks.forEach((callback) => {
  1825. callback(void 0, lastError);
  1826. });
  1827. }
  1828. function clearQueue() {
  1829. queue.forEach((item) => {
  1830. if (item.status === "pending") {
  1831. item.status = "aborted";
  1832. }
  1833. });
  1834. queue = [];
  1835. }
  1836. function moduleResponse(item, response, data) {
  1837. const isError = response !== "success";
  1838. queue = queue.filter((queued) => queued !== item);
  1839. switch (status) {
  1840. case "pending":
  1841. break;
  1842. case "failed":
  1843. if (isError || !config2.dataAfterTimeout) {
  1844. return;
  1845. }
  1846. break;
  1847. default:
  1848. return;
  1849. }
  1850. if (response === "abort") {
  1851. lastError = data;
  1852. failQuery();
  1853. return;
  1854. }
  1855. if (isError) {
  1856. lastError = data;
  1857. if (!queue.length) {
  1858. if (!resources.length) {
  1859. failQuery();
  1860. } else {
  1861. execNext();
  1862. }
  1863. }
  1864. return;
  1865. }
  1866. resetTimer();
  1867. clearQueue();
  1868. if (!config2.random) {
  1869. const index = config2.resources.indexOf(item.resource);
  1870. if (index !== -1 && index !== config2.index) {
  1871. config2.index = index;
  1872. }
  1873. }
  1874. status = "completed";
  1875. doneCallbacks.forEach((callback) => {
  1876. callback(data);
  1877. });
  1878. }
  1879. function execNext() {
  1880. if (status !== "pending") {
  1881. return;
  1882. }
  1883. resetTimer();
  1884. const resource = resources.shift();
  1885. if (resource === void 0) {
  1886. if (queue.length) {
  1887. timer = setTimeout(() => {
  1888. resetTimer();
  1889. if (status === "pending") {
  1890. clearQueue();
  1891. failQuery();
  1892. }
  1893. }, config2.timeout);
  1894. return;
  1895. }
  1896. failQuery();
  1897. return;
  1898. }
  1899. const item = {
  1900. status: "pending",
  1901. resource,
  1902. callback: (status2, data) => {
  1903. moduleResponse(item, status2, data);
  1904. }
  1905. };
  1906. queue.push(item);
  1907. queriesSent++;
  1908. timer = setTimeout(execNext, config2.rotate);
  1909. query(resource, payload, item.callback);
  1910. }
  1911. setTimeout(execNext);
  1912. return getQueryStatus;
  1913. }
  1914. function initRedundancy(cfg) {
  1915. const config2 = {
  1916. ...defaultConfig,
  1917. ...cfg
  1918. };
  1919. let queries = [];
  1920. function cleanup() {
  1921. queries = queries.filter((item) => item().status === "pending");
  1922. }
  1923. function query(payload, queryCallback, doneCallback) {
  1924. const query2 = sendQuery(
  1925. config2,
  1926. payload,
  1927. queryCallback,
  1928. (data, error) => {
  1929. cleanup();
  1930. if (doneCallback) {
  1931. doneCallback(data, error);
  1932. }
  1933. }
  1934. );
  1935. queries.push(query2);
  1936. return query2;
  1937. }
  1938. function find(callback) {
  1939. return queries.find((value) => {
  1940. return callback(value);
  1941. }) || null;
  1942. }
  1943. const instance = {
  1944. query,
  1945. find,
  1946. setIndex: (index) => {
  1947. config2.index = index;
  1948. },
  1949. getIndex: () => config2.index,
  1950. cleanup
  1951. };
  1952. return instance;
  1953. }
  1954. function emptyCallback$1() {
  1955. }
  1956. const redundancyCache = /* @__PURE__ */ Object.create(null);
  1957. function getRedundancyCache(provider) {
  1958. if (!redundancyCache[provider]) {
  1959. const config2 = getAPIConfig(provider);
  1960. if (!config2) {
  1961. return;
  1962. }
  1963. const redundancy = initRedundancy(config2);
  1964. const cachedReundancy = {
  1965. config: config2,
  1966. redundancy
  1967. };
  1968. redundancyCache[provider] = cachedReundancy;
  1969. }
  1970. return redundancyCache[provider];
  1971. }
  1972. function sendAPIQuery(target, query, callback) {
  1973. let redundancy;
  1974. let send2;
  1975. if (typeof target === "string") {
  1976. const api = getAPIModule(target);
  1977. if (!api) {
  1978. callback(void 0, 424);
  1979. return emptyCallback$1;
  1980. }
  1981. send2 = api.send;
  1982. const cached = getRedundancyCache(target);
  1983. if (cached) {
  1984. redundancy = cached.redundancy;
  1985. }
  1986. } else {
  1987. const config2 = createAPIConfig(target);
  1988. if (config2) {
  1989. redundancy = initRedundancy(config2);
  1990. const moduleKey = target.resources ? target.resources[0] : "";
  1991. const api = getAPIModule(moduleKey);
  1992. if (api) {
  1993. send2 = api.send;
  1994. }
  1995. }
  1996. }
  1997. if (!redundancy || !send2) {
  1998. callback(void 0, 424);
  1999. return emptyCallback$1;
  2000. }
  2001. return redundancy.query(query, send2, callback)().abort;
  2002. }
  2003. const browserCacheVersion = "iconify2";
  2004. const browserCachePrefix = "iconify";
  2005. const browserCacheCountKey = browserCachePrefix + "-count";
  2006. const browserCacheVersionKey = browserCachePrefix + "-version";
  2007. const browserStorageHour = 36e5;
  2008. const browserStorageCacheExpiration = 168;
  2009. function getStoredItem(func, key) {
  2010. try {
  2011. return func.getItem(key);
  2012. } catch (err) {
  2013. }
  2014. }
  2015. function setStoredItem(func, key, value) {
  2016. try {
  2017. func.setItem(key, value);
  2018. return true;
  2019. } catch (err) {
  2020. }
  2021. }
  2022. function removeStoredItem(func, key) {
  2023. try {
  2024. func.removeItem(key);
  2025. } catch (err) {
  2026. }
  2027. }
  2028. function setBrowserStorageItemsCount(storage2, value) {
  2029. return setStoredItem(storage2, browserCacheCountKey, value.toString());
  2030. }
  2031. function getBrowserStorageItemsCount(storage2) {
  2032. return parseInt(getStoredItem(storage2, browserCacheCountKey)) || 0;
  2033. }
  2034. const browserStorageConfig = {
  2035. local: true,
  2036. session: true
  2037. };
  2038. const browserStorageEmptyItems = {
  2039. local: /* @__PURE__ */ new Set(),
  2040. session: /* @__PURE__ */ new Set()
  2041. };
  2042. let browserStorageStatus = false;
  2043. function setBrowserStorageStatus(status) {
  2044. browserStorageStatus = status;
  2045. }
  2046. let _window = typeof window === "undefined" ? {} : window;
  2047. function getBrowserStorage(key) {
  2048. const attr = key + "Storage";
  2049. try {
  2050. if (_window && _window[attr] && typeof _window[attr].length === "number") {
  2051. return _window[attr];
  2052. }
  2053. } catch (err) {
  2054. }
  2055. browserStorageConfig[key] = false;
  2056. }
  2057. function iterateBrowserStorage(key, callback) {
  2058. const func = getBrowserStorage(key);
  2059. if (!func) {
  2060. return;
  2061. }
  2062. const version = getStoredItem(func, browserCacheVersionKey);
  2063. if (version !== browserCacheVersion) {
  2064. if (version) {
  2065. const total2 = getBrowserStorageItemsCount(func);
  2066. for (let i = 0; i < total2; i++) {
  2067. removeStoredItem(func, browserCachePrefix + i.toString());
  2068. }
  2069. }
  2070. setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
  2071. setBrowserStorageItemsCount(func, 0);
  2072. return;
  2073. }
  2074. const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
  2075. const parseItem = (index) => {
  2076. const name = browserCachePrefix + index.toString();
  2077. const item = getStoredItem(func, name);
  2078. if (typeof item !== "string") {
  2079. return;
  2080. }
  2081. try {
  2082. const data = JSON.parse(item);
  2083. if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
  2084. callback(data, index)) {
  2085. return true;
  2086. }
  2087. } catch (err) {
  2088. }
  2089. removeStoredItem(func, name);
  2090. };
  2091. let total = getBrowserStorageItemsCount(func);
  2092. for (let i = total - 1; i >= 0; i--) {
  2093. if (!parseItem(i)) {
  2094. if (i === total - 1) {
  2095. total--;
  2096. setBrowserStorageItemsCount(func, total);
  2097. } else {
  2098. browserStorageEmptyItems[key].add(i);
  2099. }
  2100. }
  2101. }
  2102. }
  2103. function initBrowserStorage() {
  2104. if (browserStorageStatus) {
  2105. return;
  2106. }
  2107. setBrowserStorageStatus(true);
  2108. for (const key in browserStorageConfig) {
  2109. iterateBrowserStorage(key, (item) => {
  2110. const iconSet = item.data;
  2111. const provider = item.provider;
  2112. const prefix = iconSet.prefix;
  2113. const storage2 = getStorage(
  2114. provider,
  2115. prefix
  2116. );
  2117. if (!addIconSet(storage2, iconSet).length) {
  2118. return false;
  2119. }
  2120. const lastModified = iconSet.lastModified || -1;
  2121. storage2.lastModifiedCached = storage2.lastModifiedCached ? Math.min(storage2.lastModifiedCached, lastModified) : lastModified;
  2122. return true;
  2123. });
  2124. }
  2125. }
  2126. function updateLastModified(storage2, lastModified) {
  2127. const lastValue = storage2.lastModifiedCached;
  2128. if (
  2129. // Matches or newer
  2130. lastValue && lastValue >= lastModified
  2131. ) {
  2132. return lastValue === lastModified;
  2133. }
  2134. storage2.lastModifiedCached = lastModified;
  2135. if (lastValue) {
  2136. for (const key in browserStorageConfig) {
  2137. iterateBrowserStorage(key, (item) => {
  2138. const iconSet = item.data;
  2139. return item.provider !== storage2.provider || iconSet.prefix !== storage2.prefix || iconSet.lastModified === lastModified;
  2140. });
  2141. }
  2142. }
  2143. return true;
  2144. }
  2145. function storeInBrowserStorage(storage2, data) {
  2146. if (!browserStorageStatus) {
  2147. initBrowserStorage();
  2148. }
  2149. function store(key) {
  2150. let func;
  2151. if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
  2152. return;
  2153. }
  2154. const set = browserStorageEmptyItems[key];
  2155. let index;
  2156. if (set.size) {
  2157. set.delete(index = Array.from(set).shift());
  2158. } else {
  2159. index = getBrowserStorageItemsCount(func);
  2160. if (!setBrowserStorageItemsCount(func, index + 1)) {
  2161. return;
  2162. }
  2163. }
  2164. const item = {
  2165. cached: Math.floor(Date.now() / browserStorageHour),
  2166. provider: storage2.provider,
  2167. data
  2168. };
  2169. return setStoredItem(
  2170. func,
  2171. browserCachePrefix + index.toString(),
  2172. JSON.stringify(item)
  2173. );
  2174. }
  2175. if (data.lastModified && !updateLastModified(storage2, data.lastModified)) {
  2176. return;
  2177. }
  2178. if (!Object.keys(data.icons).length) {
  2179. return;
  2180. }
  2181. if (data.not_found) {
  2182. data = Object.assign({}, data);
  2183. delete data.not_found;
  2184. }
  2185. if (!store("local")) {
  2186. store("session");
  2187. }
  2188. }
  2189. function emptyCallback() {
  2190. }
  2191. function loadedNewIcons(storage2) {
  2192. if (!storage2.iconsLoaderFlag) {
  2193. storage2.iconsLoaderFlag = true;
  2194. setTimeout(() => {
  2195. storage2.iconsLoaderFlag = false;
  2196. updateCallbacks(storage2);
  2197. });
  2198. }
  2199. }
  2200. function loadNewIcons(storage2, icons) {
  2201. if (!storage2.iconsToLoad) {
  2202. storage2.iconsToLoad = icons;
  2203. } else {
  2204. storage2.iconsToLoad = storage2.iconsToLoad.concat(icons).sort();
  2205. }
  2206. if (!storage2.iconsQueueFlag) {
  2207. storage2.iconsQueueFlag = true;
  2208. setTimeout(() => {
  2209. storage2.iconsQueueFlag = false;
  2210. const { provider, prefix } = storage2;
  2211. const icons2 = storage2.iconsToLoad;
  2212. delete storage2.iconsToLoad;
  2213. let api;
  2214. if (!icons2 || !(api = getAPIModule(provider))) {
  2215. return;
  2216. }
  2217. const params = api.prepare(provider, prefix, icons2);
  2218. params.forEach((item) => {
  2219. sendAPIQuery(provider, item, (data) => {
  2220. if (typeof data !== "object") {
  2221. item.icons.forEach((name) => {
  2222. storage2.missing.add(name);
  2223. });
  2224. } else {
  2225. try {
  2226. const parsed = addIconSet(
  2227. storage2,
  2228. data
  2229. );
  2230. if (!parsed.length) {
  2231. return;
  2232. }
  2233. const pending = storage2.pendingIcons;
  2234. if (pending) {
  2235. parsed.forEach((name) => {
  2236. pending.delete(name);
  2237. });
  2238. }
  2239. storeInBrowserStorage(storage2, data);
  2240. } catch (err) {
  2241. console.error(err);
  2242. }
  2243. }
  2244. loadedNewIcons(storage2);
  2245. });
  2246. });
  2247. });
  2248. }
  2249. }
  2250. const loadIcons = (icons, callback) => {
  2251. const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
  2252. const sortedIcons = sortIcons(cleanedIcons);
  2253. if (!sortedIcons.pending.length) {
  2254. let callCallback = true;
  2255. if (callback) {
  2256. setTimeout(() => {
  2257. if (callCallback) {
  2258. callback(
  2259. sortedIcons.loaded,
  2260. sortedIcons.missing,
  2261. sortedIcons.pending,
  2262. emptyCallback
  2263. );
  2264. }
  2265. });
  2266. }
  2267. return () => {
  2268. callCallback = false;
  2269. };
  2270. }
  2271. const newIcons = /* @__PURE__ */ Object.create(null);
  2272. const sources = [];
  2273. let lastProvider, lastPrefix;
  2274. sortedIcons.pending.forEach((icon) => {
  2275. const { provider, prefix } = icon;
  2276. if (prefix === lastPrefix && provider === lastProvider) {
  2277. return;
  2278. }
  2279. lastProvider = provider;
  2280. lastPrefix = prefix;
  2281. sources.push(getStorage(provider, prefix));
  2282. const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
  2283. if (!providerNewIcons[prefix]) {
  2284. providerNewIcons[prefix] = [];
  2285. }
  2286. });
  2287. sortedIcons.pending.forEach((icon) => {
  2288. const { provider, prefix, name } = icon;
  2289. const storage2 = getStorage(provider, prefix);
  2290. const pendingQueue = storage2.pendingIcons || (storage2.pendingIcons = /* @__PURE__ */ new Set());
  2291. if (!pendingQueue.has(name)) {
  2292. pendingQueue.add(name);
  2293. newIcons[provider][prefix].push(name);
  2294. }
  2295. });
  2296. sources.forEach((storage2) => {
  2297. const { provider, prefix } = storage2;
  2298. if (newIcons[provider][prefix].length) {
  2299. loadNewIcons(storage2, newIcons[provider][prefix]);
  2300. }
  2301. });
  2302. return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
  2303. };
  2304. function mergeCustomisations(defaults, item) {
  2305. const result = {
  2306. ...defaults
  2307. };
  2308. for (const key in item) {
  2309. const value = item[key];
  2310. const valueType = typeof value;
  2311. if (key in defaultIconSizeCustomisations) {
  2312. if (value === null || value && (valueType === "string" || valueType === "number")) {
  2313. result[key] = value;
  2314. }
  2315. } else if (valueType === typeof result[key]) {
  2316. result[key] = key === "rotate" ? value % 4 : value;
  2317. }
  2318. }
  2319. return result;
  2320. }
  2321. const separator = /[\s,]+/;
  2322. function flipFromString(custom, flip) {
  2323. flip.split(separator).forEach((str) => {
  2324. const value = str.trim();
  2325. switch (value) {
  2326. case "horizontal":
  2327. custom.hFlip = true;
  2328. break;
  2329. case "vertical":
  2330. custom.vFlip = true;
  2331. break;
  2332. }
  2333. });
  2334. }
  2335. function rotateFromString(value, defaultValue = 0) {
  2336. const units = value.replace(/^-?[0-9.]*/, "");
  2337. function cleanup(value2) {
  2338. while (value2 < 0) {
  2339. value2 += 4;
  2340. }
  2341. return value2 % 4;
  2342. }
  2343. if (units === "") {
  2344. const num = parseInt(value);
  2345. return isNaN(num) ? 0 : cleanup(num);
  2346. } else if (units !== value) {
  2347. let split = 0;
  2348. switch (units) {
  2349. case "%":
  2350. split = 25;
  2351. break;
  2352. case "deg":
  2353. split = 90;
  2354. }
  2355. if (split) {
  2356. let num = parseFloat(value.slice(0, value.length - units.length));
  2357. if (isNaN(num)) {
  2358. return 0;
  2359. }
  2360. num = num / split;
  2361. return num % 1 === 0 ? cleanup(num) : 0;
  2362. }
  2363. }
  2364. return defaultValue;
  2365. }
  2366. function iconToHTML(body, attributes) {
  2367. let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
  2368. for (const attr in attributes) {
  2369. renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
  2370. }
  2371. return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
  2372. }
  2373. function encodeSVGforURL(svg) {
  2374. return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
  2375. }
  2376. function svgToData(svg) {
  2377. return "data:image/svg+xml," + encodeSVGforURL(svg);
  2378. }
  2379. function svgToURL(svg) {
  2380. return 'url("' + svgToData(svg) + '")';
  2381. }
  2382. const defaultExtendedIconCustomisations = {
  2383. ...defaultIconCustomisations,
  2384. inline: false
  2385. };
  2386. const svgDefaults = {
  2387. "xmlns": "http://www.w3.org/2000/svg",
  2388. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  2389. "aria-hidden": true,
  2390. "role": "img"
  2391. };
  2392. const commonProps = {
  2393. display: "inline-block"
  2394. };
  2395. const monotoneProps = {
  2396. backgroundColor: "currentColor"
  2397. };
  2398. const coloredProps = {
  2399. backgroundColor: "transparent"
  2400. };
  2401. const propsToAdd = {
  2402. Image: "var(--svg)",
  2403. Repeat: "no-repeat",
  2404. Size: "100% 100%"
  2405. };
  2406. const propsToAddTo = {
  2407. webkitMask: monotoneProps,
  2408. mask: monotoneProps,
  2409. background: coloredProps
  2410. };
  2411. for (const prefix in propsToAddTo) {
  2412. const list = propsToAddTo[prefix];
  2413. for (const prop in propsToAdd) {
  2414. list[prefix + prop] = propsToAdd[prop];
  2415. }
  2416. }
  2417. const customisationAliases = {};
  2418. ["horizontal", "vertical"].forEach((prefix) => {
  2419. const attr = prefix.slice(0, 1) + "Flip";
  2420. customisationAliases[prefix + "-flip"] = attr;
  2421. customisationAliases[prefix.slice(0, 1) + "-flip"] = attr;
  2422. customisationAliases[prefix + "Flip"] = attr;
  2423. });
  2424. function fixSize(value) {
  2425. return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
  2426. }
  2427. const render = (icon, props) => {
  2428. const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
  2429. const componentProps = { ...svgDefaults };
  2430. const mode = props.mode || "svg";
  2431. const style = {};
  2432. const propsStyle = props.style;
  2433. const customStyle = typeof propsStyle === "object" && !(propsStyle instanceof Array) ? propsStyle : {};
  2434. for (let key in props) {
  2435. const value = props[key];
  2436. if (value === void 0) {
  2437. continue;
  2438. }
  2439. switch (key) {
  2440. case "icon":
  2441. case "style":
  2442. case "onLoad":
  2443. case "mode":
  2444. break;
  2445. case "inline":
  2446. case "hFlip":
  2447. case "vFlip":
  2448. customisations[key] = value === true || value === "true" || value === 1;
  2449. break;
  2450. case "flip":
  2451. if (typeof value === "string") {
  2452. flipFromString(customisations, value);
  2453. }
  2454. break;
  2455. case "color":
  2456. style.color = value;
  2457. break;
  2458. case "rotate":
  2459. if (typeof value === "string") {
  2460. customisations[key] = rotateFromString(value);
  2461. } else if (typeof value === "number") {
  2462. customisations[key] = value;
  2463. }
  2464. break;
  2465. case "ariaHidden":
  2466. case "aria-hidden":
  2467. if (value !== true && value !== "true") {
  2468. delete componentProps["aria-hidden"];
  2469. }
  2470. break;
  2471. default: {
  2472. const alias = customisationAliases[key];
  2473. if (alias) {
  2474. if (value === true || value === "true" || value === 1) {
  2475. customisations[alias] = true;
  2476. }
  2477. } else if (defaultExtendedIconCustomisations[key] === void 0) {
  2478. componentProps[key] = value;
  2479. }
  2480. }
  2481. }
  2482. }
  2483. const item = iconToSVG(icon, customisations);
  2484. const renderAttribs = item.attributes;
  2485. if (customisations.inline) {
  2486. style.verticalAlign = "-0.125em";
  2487. }
  2488. if (mode === "svg") {
  2489. componentProps.style = {
  2490. ...style,
  2491. ...customStyle
  2492. };
  2493. Object.assign(componentProps, renderAttribs);
  2494. let localCounter = 0;
  2495. let id = props.id;
  2496. if (typeof id === "string") {
  2497. id = id.replace(/-/g, "_");
  2498. }
  2499. componentProps["innerHTML"] = replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyVue");
  2500. return vue.h("svg", componentProps);
  2501. }
  2502. const { body, width, height } = icon;
  2503. const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
  2504. const html = iconToHTML(body, {
  2505. ...renderAttribs,
  2506. width: width + "",
  2507. height: height + ""
  2508. });
  2509. componentProps.style = {
  2510. ...style,
  2511. "--svg": svgToURL(html),
  2512. "width": fixSize(renderAttribs.width),
  2513. "height": fixSize(renderAttribs.height),
  2514. ...commonProps,
  2515. ...useMask ? monotoneProps : coloredProps,
  2516. ...customStyle
  2517. };
  2518. return vue.h("span", componentProps);
  2519. };
  2520. allowSimpleNames(true);
  2521. setAPIModule("", fetchAPIModule);
  2522. if (typeof document !== "undefined" && typeof window !== "undefined") {
  2523. initBrowserStorage();
  2524. const _window2 = window;
  2525. if (_window2.IconifyPreload !== void 0) {
  2526. const preload = _window2.IconifyPreload;
  2527. const err = "Invalid IconifyPreload syntax.";
  2528. if (typeof preload === "object" && preload !== null) {
  2529. (preload instanceof Array ? preload : [preload]).forEach((item) => {
  2530. try {
  2531. if (
  2532. // Check if item is an object and not null/array
  2533. typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
  2534. typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
  2535. !addCollection(item)
  2536. ) {
  2537. console.error(err);
  2538. }
  2539. } catch (e2) {
  2540. console.error(err);
  2541. }
  2542. });
  2543. }
  2544. }
  2545. if (_window2.IconifyProviders !== void 0) {
  2546. const providers = _window2.IconifyProviders;
  2547. if (typeof providers === "object" && providers !== null) {
  2548. for (let key in providers) {
  2549. const err = "IconifyProviders[" + key + "] is invalid.";
  2550. try {
  2551. const value = providers[key];
  2552. if (typeof value !== "object" || !value || value.resources === void 0) {
  2553. continue;
  2554. }
  2555. if (!addAPIProvider(key, value)) {
  2556. console.error(err);
  2557. }
  2558. } catch (e2) {
  2559. console.error(err);
  2560. }
  2561. }
  2562. }
  2563. }
  2564. }
  2565. const emptyIcon = {
  2566. ...defaultIconProps,
  2567. body: ""
  2568. };
  2569. const Icon = vue.defineComponent({
  2570. // Do not inherit other attributes: it is handled by render()
  2571. inheritAttrs: false,
  2572. // Set initial data
  2573. data() {
  2574. return {
  2575. // Mounted status
  2576. iconMounted: false,
  2577. // Callback counter to trigger re-render
  2578. counter: 0
  2579. };
  2580. },
  2581. mounted() {
  2582. this._name = "";
  2583. this._loadingIcon = null;
  2584. this.iconMounted = true;
  2585. },
  2586. unmounted() {
  2587. this.abortLoading();
  2588. },
  2589. methods: {
  2590. abortLoading() {
  2591. if (this._loadingIcon) {
  2592. this._loadingIcon.abort();
  2593. this._loadingIcon = null;
  2594. }
  2595. },
  2596. // Get data for icon to render or null
  2597. getIcon(icon, onload) {
  2598. if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
  2599. this._name = "";
  2600. this.abortLoading();
  2601. return {
  2602. data: icon
  2603. };
  2604. }
  2605. let iconName;
  2606. if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
  2607. this.abortLoading();
  2608. return null;
  2609. }
  2610. const data = getIconData(iconName);
  2611. if (!data) {
  2612. if (!this._loadingIcon || this._loadingIcon.name !== icon) {
  2613. this.abortLoading();
  2614. this._name = "";
  2615. if (data !== null) {
  2616. this._loadingIcon = {
  2617. name: icon,
  2618. abort: loadIcons([iconName], () => {
  2619. this.counter++;
  2620. })
  2621. };
  2622. }
  2623. }
  2624. return null;
  2625. }
  2626. this.abortLoading();
  2627. if (this._name !== icon) {
  2628. this._name = icon;
  2629. if (onload) {
  2630. onload(icon);
  2631. }
  2632. }
  2633. const classes = ["iconify"];
  2634. if (iconName.prefix !== "") {
  2635. classes.push("iconify--" + iconName.prefix);
  2636. }
  2637. if (iconName.provider !== "") {
  2638. classes.push("iconify--" + iconName.provider);
  2639. }
  2640. return { data, classes };
  2641. }
  2642. },
  2643. // Render icon
  2644. render() {
  2645. this.counter;
  2646. const props = this.$attrs;
  2647. const icon = this.iconMounted ? this.getIcon(props.icon, props.onLoad) : null;
  2648. if (!icon) {
  2649. return render(emptyIcon, props);
  2650. }
  2651. let newProps = props;
  2652. if (icon.classes) {
  2653. newProps = {
  2654. ...props,
  2655. class: (typeof props["class"] === "string" ? props["class"] + " " : "") + icon.classes.join(" ")
  2656. };
  2657. }
  2658. return render({
  2659. ...defaultIconProps,
  2660. ...icon.data
  2661. }, newProps);
  2662. }
  2663. });
  2664. const _hoisted_1$i = { class: "display-type" };
  2665. const _hoisted_2$f = { style: { "position": "relative" } };
  2666. const _hoisted_3$c = {
  2667. key: 0,
  2668. class: "type-list"
  2669. };
  2670. const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
  2671. __name: "BaseSelect",
  2672. props: {
  2673. displayType: {}
  2674. },
  2675. emits: ["update:displayType"],
  2676. setup(__props, { emit: __emit }) {
  2677. const props = __props;
  2678. const emit = __emit;
  2679. let state = vue.reactive({
  2680. showChangeDisplayType: false,
  2681. lastDisplayType: null
  2682. });
  2683. function changeOption(item) {
  2684. if (![CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2685. state.lastDisplayType = props.displayType;
  2686. }
  2687. emit("update:displayType", item);
  2688. state.showChangeDisplayType = false;
  2689. }
  2690. function clickDisplayType() {
  2691. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2692. return changeOption(state.lastDisplayType ?? CommentDisplayType.FloorInFloorNoCallUser);
  2693. }
  2694. state.showChangeDisplayType = !state.showChangeDisplayType;
  2695. }
  2696. const currentDisplayType = vue.computed(() => {
  2697. let judge = props.displayType;
  2698. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2699. judge = state.lastDisplayType;
  2700. }
  2701. switch (judge) {
  2702. case CommentDisplayType.FloorInFloorNoCallUser:
  2703. return "楼中楼";
  2704. case CommentDisplayType.FloorInFloor:
  2705. return "楼中楼(@)";
  2706. case CommentDisplayType.FloorInFloorNested:
  2707. return "冗余楼中楼";
  2708. case CommentDisplayType.V2exOrigin:
  2709. return "V2原版";
  2710. case CommentDisplayType.OnlyOp:
  2711. return "只看楼主";
  2712. default:
  2713. return "楼中楼";
  2714. }
  2715. });
  2716. return (_ctx, _cache) => {
  2717. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
  2718. vue.createElementVNode("div", {
  2719. class: vue.normalizeClass(["type", _ctx.displayType === vue.unref(CommentDisplayType).New && "active"]),
  2720. onClick: _cache[0] || (_cache[0] = ($event) => changeOption(vue.unref(CommentDisplayType).New))
  2721. }, "最新 ", 2),
  2722. vue.createElementVNode("div", {
  2723. class: vue.normalizeClass(["type", _ctx.displayType === vue.unref(CommentDisplayType).Like && "active"]),
  2724. onClick: _cache[1] || (_cache[1] = ($event) => changeOption(vue.unref(CommentDisplayType).Like))
  2725. }, "最热 ", 2),
  2726. vue.createElementVNode("div", _hoisted_2$f, [
  2727. vue.createElementVNode("div", {
  2728. class: vue.normalizeClass(["type", ![vue.unref(CommentDisplayType).New, vue.unref(CommentDisplayType).Like].includes(_ctx.displayType) && "active"]),
  2729. onClick: clickDisplayType
  2730. }, [
  2731. vue.createElementVNode("span", null, vue.toDisplayString(currentDisplayType.value), 1),
  2732. vue.createVNode(vue.unref(Icon), { icon: "mingcute:down-line" })
  2733. ], 2),
  2734. vue.unref(state).showChangeDisplayType ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$c, [
  2735. vue.createElementVNode("div", {
  2736. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNoCallUser && "active"]),
  2737. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNoCallUser), ["stop"]))
  2738. }, "楼中楼 ", 2),
  2739. vue.createElementVNode("div", {
  2740. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloor && "active"]),
  2741. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloor), ["stop"]))
  2742. }, "楼中楼(@) ", 2),
  2743. vue.createElementVNode("div", {
  2744. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNested && "active"]),
  2745. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNested), ["stop"]))
  2746. }, "冗余楼中楼 ", 2),
  2747. vue.createElementVNode("div", {
  2748. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).OnlyOp && "active"]),
  2749. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).OnlyOp), ["stop"]))
  2750. }, "只看楼主 ", 2),
  2751. vue.createElementVNode("div", {
  2752. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).V2exOrigin && "active"]),
  2753. onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).V2exOrigin), ["stop"]))
  2754. }, "V2原版 ", 2)
  2755. ])) : vue.createCommentVNode("", true)
  2756. ])
  2757. ]);
  2758. };
  2759. }
  2760. });
  2761. const BaseSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-e4f684be"]]);
  2762. const eventBus = {
  2763. eventMap: /* @__PURE__ */ new Map(),
  2764. on(eventType, cb) {
  2765. let cbs = this.eventMap.get(eventType);
  2766. if (cbs) {
  2767. cbs.push(cb);
  2768. } else {
  2769. cbs = [cb];
  2770. }
  2771. this.eventMap.set(eventType, cbs);
  2772. },
  2773. offOne(eventType, cb) {
  2774. let cbs = this.eventMap.get(eventType);
  2775. if (cbs) {
  2776. let rIndex = cbs.findIndex((c) => c === cb);
  2777. if (rIndex > -1) {
  2778. cbs.splice(rIndex, 1);
  2779. }
  2780. }
  2781. this.eventMap.set(eventType, cbs);
  2782. },
  2783. emit(eventType, val) {
  2784. let cbs = this.eventMap.get(eventType);
  2785. if (cbs) {
  2786. cbs.map((cb) => cb(val));
  2787. }
  2788. },
  2789. off(eventType) {
  2790. let cbs = this.eventMap.has(eventType);
  2791. if (cbs) {
  2792. this.eventMap.delete(eventType);
  2793. }
  2794. },
  2795. clear() {
  2796. this.eventMap = /* @__PURE__ */ new Map();
  2797. }
  2798. };
  2799. const CMD = {
  2800. SHOW_TOOLTIP: "SHOW_TOOLTIP",
  2801. SHOW_MSG: "SHOW_MSG",
  2802. SET_CALL: "SET_CALL",
  2803. SHOW_CALL: "SHOW_CALL",
  2804. REFRESH_ONCE: "REFRESH_ONCE",
  2805. ADD_REPLY: "ADD_REPLY",
  2806. IGNORE: "IGNORE",
  2807. MERGE: "MERGE",
  2808. REMOVE: "REMOVE",
  2809. CHANGE_COMMENT_THANK: "CHANGE_COMMENT_THANK",
  2810. CHANGE_POST_THANK: "CHANGE_POST_THANK",
  2811. ADD_TAG: "ADD_TAG",
  2812. REMOVE_TAG: "REMOVE_TAG",
  2813. RELATION_REPLY: "RELATION_REPLY",
  2814. JUMP: "JUMP",
  2815. REFRESH_POST: "REFRESH_POST",
  2816. SHOW_CONFIRM_MODAL: "SHOW_CONFIRM_MODAL",
  2817. SHOW_CONFIRM_MODAL_CONFIRM: "SHOW_CONFIRM_MODAL_CONFIRM"
  2818. };
  2819. const _sfc_main$j = {
  2820. name: "PopConfirm",
  2821. props: {
  2822. title: {
  2823. type: String,
  2824. default() {
  2825. return "";
  2826. }
  2827. },
  2828. disabled: {
  2829. type: Boolean,
  2830. default() {
  2831. return false;
  2832. }
  2833. }
  2834. },
  2835. data() {
  2836. return {
  2837. id: ""
  2838. };
  2839. },
  2840. created() {
  2841. },
  2842. methods: {
  2843. cb(id) {
  2844. if (id === this.id) {
  2845. this.$emit("confirm");
  2846. this.id = "";
  2847. }
  2848. },
  2849. showPop(e2) {
  2850. if (this.disabled)
  2851. return;
  2852. let rect = e2.target.getBoundingClientRect();
  2853. this.id = Date.now();
  2854. eventBus.emit(CMD.SHOW_CONFIRM_MODAL, { title: this.title, rect, id: this.id });
  2855. eventBus.offOne(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2856. eventBus.on(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2857. }
  2858. },
  2859. unmounted() {
  2860. eventBus.offOne(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2861. }
  2862. };
  2863. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  2864. return vue.openBlock(), vue.createElementBlock("span", {
  2865. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.showPop && $options.showPop(...args), ["stop"]))
  2866. }, [
  2867. vue.renderSlot(_ctx.$slots, "default")
  2868. ]);
  2869. }
  2870. const PopConfirm = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$a]]);
  2871. const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
  2872. __name: "BaseLoading",
  2873. props: {
  2874. size: { default: "normal" }
  2875. },
  2876. setup(__props) {
  2877. return (_ctx, _cache) => {
  2878. return vue.openBlock(), vue.createElementBlock("div", {
  2879. class: vue.normalizeClass(["loading", [_ctx.size]])
  2880. }, null, 2);
  2881. };
  2882. }
  2883. });
  2884. const BaseLoading = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-2697baa2"]]);
  2885. const _hoisted_1$h = {
  2886. key: 1,
  2887. class: "key-notice"
  2888. };
  2889. const _hoisted_2$e = { class: "key" };
  2890. const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
  2891. __name: "BaseButton",
  2892. props: {
  2893. keyboard: {},
  2894. active: { type: Boolean },
  2895. disabled: { type: Boolean },
  2896. loading: { type: Boolean },
  2897. size: { default: "normal" },
  2898. type: { default: "primary" }
  2899. },
  2900. emits: ["click"],
  2901. setup(__props) {
  2902. return (_ctx, _cache) => {
  2903. return vue.openBlock(), vue.createBlock(Tooltip, {
  2904. disabled: !_ctx.keyboard,
  2905. title: `快捷键: ${_ctx.keyboard}`
  2906. }, {
  2907. default: vue.withCtx(() => [
  2908. vue.createElementVNode("div", vue.mergeProps({ class: "base-button" }, _ctx.$attrs, {
  2909. onClick: _cache[0] || (_cache[0] = (e2) => !_ctx.disabled && !_ctx.loading && _ctx.$emit("click", e2)),
  2910. class: [
  2911. _ctx.active && "active",
  2912. _ctx.size,
  2913. _ctx.type,
  2914. (_ctx.disabled || _ctx.loading) && "disabled",
  2915. !_ctx.disabled && "hvr-grow"
  2916. ]
  2917. }), [
  2918. vue.createElementVNode("span", {
  2919. style: vue.normalizeStyle({ opacity: _ctx.loading ? 0 : 1 })
  2920. }, [
  2921. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  2922. ], 4),
  2923. _ctx.loading ? (vue.openBlock(), vue.createBlock(BaseLoading, {
  2924. key: 0,
  2925. size: "small"
  2926. })) : vue.createCommentVNode("", true),
  2927. _ctx.keyboard ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
  2928. vue.createElementVNode("span", _hoisted_2$e, vue.toDisplayString(_ctx.keyboard), 1)
  2929. ])) : vue.createCommentVNode("", true)
  2930. ], 16)
  2931. ]),
  2932. _: 3
  2933. }, 8, ["disabled", "title"]);
  2934. };
  2935. }
  2936. });
  2937. const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-5a7d79ba"]]);
  2938. const _sfc_main$g = {
  2939. name: "Setting",
  2940. components: {
  2941. BaseButton,
  2942. PopConfirm,
  2943. Icon,
  2944. BaseSelect,
  2945. BaseSwitch,
  2946. Tooltip
  2947. },
  2948. inject: ["isNight"],
  2949. props: {
  2950. show: {
  2951. type: Boolean,
  2952. default() {
  2953. return false;
  2954. }
  2955. }
  2956. },
  2957. data() {
  2958. return {
  2959. tabIndex: 0
  2960. };
  2961. },
  2962. methods: {
  2963. confirm() {
  2964. this.close();
  2965. this.$emit("confirm");
  2966. },
  2967. close() {
  2968. this.$emit("update:show", false);
  2969. }
  2970. }
  2971. };
  2972. const _withScopeId$b = (n2) => (vue.pushScopeId("data-v-386b43d0"), n2 = n2(), vue.popScopeId(), n2);
  2973. const _hoisted_1$g = {
  2974. key: 0,
  2975. class: "setting-modal modal"
  2976. };
  2977. const _hoisted_2$d = { class: "modal-root" };
  2978. const _hoisted_3$b = { class: "modal-header" };
  2979. const _hoisted_4$b = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 使用需知 ", -1));
  2980. const _hoisted_5$9 = { class: "body" };
  2981. const _hoisted_6$9 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "modal-content" }, [
  2982. /* @__PURE__ */ vue.createElementVNode("div", null, "开启此功能会带来以下影响"),
  2983. /* @__PURE__ */ vue.createElementVNode("div", null, "缺点"),
  2984. /* @__PURE__ */ vue.createElementVNode("div", { style: { "color": "red" } }, [
  2985. /* @__PURE__ */ vue.createElementVNode("div", null, "1、你的IP可能会被封禁"),
  2986. /* @__PURE__ */ vue.createElementVNode("div", null, "2、消耗更多流量,给服务器带来更大的负担"),
  2987. /* @__PURE__ */ vue.createElementVNode("div", null, "3、你的V站浏览进度条会变快")
  2988. ]),
  2989. /* @__PURE__ */ vue.createElementVNode("div", null, "优点"),
  2990. /* @__PURE__ */ vue.createElementVNode("div", null, "1、卡片模式,无需打开主题即可查看内容"),
  2991. /* @__PURE__ */ vue.createElementVNode("div", null, "2、打开主题时提前预览正文内容,无需等待加载"),
  2992. /* @__PURE__ */ vue.createElementVNode("div", null, "原理"),
  2993. /* @__PURE__ */ vue.createElementVNode("div", null, "1、解析列表所有主题ID,批量调用show.json接口,获取对应主题的正文"),
  2994. /* @__PURE__ */ vue.createElementVNode("div", null, "2、请求的主题数据会缓存到本地,不会重复请求,超过3天的数据会删除"),
  2995. /* @__PURE__ */ vue.createElementVNode("div", null, "3、前面4条会并发请求,4条以后的一秒请求一条")
  2996. ], -1));
  2997. const _hoisted_7$8 = { class: "btns" };
  2998. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  2999. const _component_Icon = vue.resolveComponent("Icon");
  3000. const _component_BaseButton = vue.resolveComponent("BaseButton");
  3001. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3002. default: vue.withCtx(() => [
  3003. $props.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
  3004. vue.createElementVNode("div", {
  3005. class: "mask",
  3006. onClick: _cache[0] || (_cache[0] = (...args) => $options.close && $options.close(...args))
  3007. }),
  3008. vue.createElementVNode("div", _hoisted_2$d, [
  3009. vue.createElementVNode("div", _hoisted_3$b, [
  3010. _hoisted_4$b,
  3011. vue.createVNode(_component_Icon, {
  3012. icon: "ic:round-close",
  3013. onClick: $options.close
  3014. }, null, 8, ["onClick"])
  3015. ]),
  3016. vue.createElementVNode("div", _hoisted_5$9, [
  3017. _hoisted_6$9,
  3018. vue.createElementVNode("div", _hoisted_7$8, [
  3019. vue.createVNode(_component_BaseButton, {
  3020. type: "link",
  3021. onClick: $options.close
  3022. }, {
  3023. default: vue.withCtx(() => [
  3024. vue.createTextVNode("不同意")
  3025. ]),
  3026. _: 1
  3027. }, 8, ["onClick"]),
  3028. vue.createVNode(_component_BaseButton, { onClick: $options.confirm }, {
  3029. default: vue.withCtx(() => [
  3030. vue.createTextVNode("同意")
  3031. ]),
  3032. _: 1
  3033. }, 8, ["onClick"])
  3034. ])
  3035. ])
  3036. ])
  3037. ])) : vue.createCommentVNode("", true)
  3038. ]),
  3039. _: 1
  3040. });
  3041. }
  3042. const NoticeModal = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$9], ["__scopeId", "data-v-386b43d0"]]);
  3043. const _sfc_main$f = {
  3044. name: "Setting",
  3045. components: {
  3046. NoticeModal,
  3047. PopConfirm,
  3048. Icon,
  3049. BaseSelect,
  3050. BaseSwitch,
  3051. Tooltip
  3052. },
  3053. inject: ["isNight"],
  3054. props: {
  3055. modelValue: {
  3056. type: Object,
  3057. default() {
  3058. return {};
  3059. }
  3060. },
  3061. show: {
  3062. type: Boolean,
  3063. default() {
  3064. return false;
  3065. }
  3066. }
  3067. },
  3068. data() {
  3069. return {
  3070. tabIndex: 0,
  3071. config: functions.clone(this.modelValue),
  3072. showNotice: false
  3073. };
  3074. },
  3075. computed: {
  3076. DefaultVal() {
  3077. return DefaultVal;
  3078. },
  3079. CommentDisplayType() {
  3080. return CommentDisplayType;
  3081. },
  3082. isNew() {
  3083. return this.config.version < DefaultVal.currentVersion && window.isDeadline;
  3084. }
  3085. },
  3086. watch: {
  3087. config: {
  3088. handler(n2) {
  3089. n2.topReplyLoveMinCount = Math.trunc(n2.topReplyLoveMinCount);
  3090. if (n2.topReplyLoveMinCount < 0) {
  3091. n2.topReplyLoveMinCount = 1;
  3092. }
  3093. this.$emit("update:modelValue", n2);
  3094. },
  3095. deep: true
  3096. },
  3097. "config.loopCheckNotice"(n2) {
  3098. if (n2) {
  3099. this.config.loopCheckNoticeInterval = 5;
  3100. this.config.whenNewNoticeGlimmer = false;
  3101. } else {
  3102. this.config.loopCheckNoticeInterval = 0;
  3103. this.config.whenNewNoticeGlimmer = false;
  3104. this.config.ddWebhook = "";
  3105. }
  3106. },
  3107. show(n2) {
  3108. if (n2) {
  3109. if (this.config.version < DefaultVal.currentVersion) {
  3110. $(".v2next-new").remove();
  3111. }
  3112. document.body.style.overflow = "hidden";
  3113. } else {
  3114. document.body.style.overflow = "unset";
  3115. }
  3116. }
  3117. },
  3118. methods: {
  3119. goPost() {
  3120. fetch(DefaultVal.hotUrl + "new.txt").then(async (r2) => {
  3121. let r22 = await r2.text();
  3122. if (r22) {
  3123. functions.openNewTab(r22, true);
  3124. } else {
  3125. functions.openNewTab(DefaultVal.git, true);
  3126. }
  3127. }).catch(() => functions.openNewTab(DefaultVal.git, true));
  3128. },
  3129. close() {
  3130. if (window.isDeadline) {
  3131. this.config.version = DefaultVal.currentVersion;
  3132. }
  3133. this.$emit("update:show", false);
  3134. }
  3135. }
  3136. };
  3137. const _withScopeId$a = (n2) => (vue.pushScopeId("data-v-9fea31eb"), n2 = n2(), vue.popScopeId(), n2);
  3138. const _hoisted_1$f = {
  3139. key: 0,
  3140. class: "setting-modal modal"
  3141. };
  3142. const _hoisted_2$c = { class: "modal-root" };
  3143. const _hoisted_3$a = { class: "modal-header" };
  3144. const _hoisted_4$a = { class: "title" };
  3145. const _hoisted_5$8 = { style: { "font-size": "20px", "text-decoration": "underline" } };
  3146. const _hoisted_6$8 = ["href"];
  3147. const _hoisted_7$7 = {
  3148. key: 0,
  3149. class: "log"
  3150. };
  3151. const _hoisted_8$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "new" }, null, -1));
  3152. const _hoisted_9$7 = { class: "body" };
  3153. const _hoisted_10$7 = { class: "left" };
  3154. const _hoisted_11$7 = { class: "tabs" };
  3155. const _hoisted_12$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "列表设置", -1));
  3156. const _hoisted_13$7 = [
  3157. _hoisted_12$7
  3158. ];
  3159. const _hoisted_14$6 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "主题设置", -1));
  3160. const _hoisted_15$5 = [
  3161. _hoisted_14$6
  3162. ];
  3163. const _hoisted_16$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "其他设置", -1));
  3164. const _hoisted_17$5 = [
  3165. _hoisted_16$5
  3166. ];
  3167. const _hoisted_18$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "关于脚本", -1));
  3168. const _hoisted_19$4 = [
  3169. _hoisted_18$5
  3170. ];
  3171. const _hoisted_20$3 = { class: "icons" };
  3172. const _hoisted_21$3 = ["href"];
  3173. const _hoisted_22$3 = ["href"];
  3174. const _hoisted_23$3 = { class: "modal-content" };
  3175. const _hoisted_24$2 = { class: "scroll" };
  3176. const _hoisted_25$1 = { key: 0 };
  3177. const _hoisted_26$1 = { class: "row" };
  3178. const _hoisted_27$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "列表展示方式", -1));
  3179. const _hoisted_28$1 = { class: "wrapper" };
  3180. const _hoisted_29$1 = { class: "radio-group2" };
  3181. const _hoisted_30$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3182. const _hoisted_31$1 = { class: "row" };
  3183. const _hoisted_32$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "主题弹框显示", -1));
  3184. const _hoisted_33$1 = { class: "wrapper" };
  3185. const _hoisted_34$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3186. /* @__PURE__ */ vue.createTextVNode(" 开启此选项后,主题会"),
  3187. /* @__PURE__ */ vue.createElementVNode("span", { class: "danger" }, "始终"),
  3188. /* @__PURE__ */ vue.createTextVNode("以弹框的方式显示。优先级大于“新标签页打开链接” ")
  3189. ], -1));
  3190. const _hoisted_35$1 = { class: "row" };
  3191. const _hoisted_36$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "新标签页打开链接", -1));
  3192. const _hoisted_37$1 = { class: "wrapper" };
  3193. const _hoisted_38$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 网页上所有链接通过新标签页打开 ", -1));
  3194. const _hoisted_39$1 = { class: "row" };
  3195. const _hoisted_40$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "打开新标签页时立即切换过去", -1));
  3196. const _hoisted_41$1 = { class: "wrapper" };
  3197. const _hoisted_42$1 = { key: 1 };
  3198. const _hoisted_43$1 = { class: "row" };
  3199. const _hoisted_44$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "回复类型", -1));
  3200. const _hoisted_45$1 = { class: "wrapper" };
  3201. const _hoisted_46$1 = { class: "row" };
  3202. const _hoisted_47$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "详情页中显示“回复类型”", -1));
  3203. const _hoisted_48 = { class: "wrapper" };
  3204. const _hoisted_49 = { class: "row" };
  3205. const _hoisted_50 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "替换Imgur源", -1));
  3206. const _hoisted_51 = { class: "wrapper" };
  3207. const _hoisted_52 = { class: "row" };
  3208. const _hoisted_53 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "单独打开主题时默认显示楼中楼", -1));
  3209. const _hoisted_54 = { class: "wrapper" };
  3210. const _hoisted_55 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 单独打开这种地址 https://v2ex.com/t/xxxx 时,是否默认显示楼中楼 ", -1));
  3211. const _hoisted_56 = { class: "row" };
  3212. const _hoisted_57 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "点击左右两侧透明处关闭主题详情弹框", -1));
  3213. const _hoisted_58 = { class: "wrapper" };
  3214. const _hoisted_59 = { class: "row" };
  3215. const _hoisted_60 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "正文超长自动折叠", -1));
  3216. const _hoisted_61 = { class: "wrapper" };
  3217. const _hoisted_62 = { class: "row" };
  3218. const _hoisted_63 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "主题宽度", -1));
  3219. const _hoisted_64 = { class: "wrapper" };
  3220. const _hoisted_65 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3221. /* @__PURE__ */ vue.createTextVNode(" 未设定此值时,则默认宽度为77rem。接受合法的width值: "),
  3222. /* @__PURE__ */ vue.createElementVNode("a", {
  3223. href: "https://vue3js.cn/interview/css/em_px_rem_vh_vw.html#%E4%BA%8C%E3%80%81%E5%8D%95%E4%BD%8D",
  3224. target: "_blank"
  3225. }, "rem、px、vw、vh(点此查看)"),
  3226. /* @__PURE__ */ vue.createTextVNode("。 vw代表屏幕百分比,如想要屏幕的66%,请填写66vw ")
  3227. ], -1));
  3228. const _hoisted_66 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 提示:此项设置以后,单独打开详情页时会出现主题突然变宽(窄)的问题,暂时无解 ", -1));
  3229. const _hoisted_67 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3230. const _hoisted_68 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3231. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "高赞回复")
  3232. ], -1));
  3233. const _hoisted_69 = { class: "row" };
  3234. const _hoisted_70 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "显示高赞回复", -1));
  3235. const _hoisted_71 = { class: "wrapper" };
  3236. const _hoisted_72 = { class: "row" };
  3237. const _hoisted_73 = { class: "item-title" };
  3238. const _hoisted_74 = { class: "wrapper" };
  3239. const _hoisted_75 = { class: "row" };
  3240. const _hoisted_76 = { class: "item-title" };
  3241. const _hoisted_77 = { class: "wrapper" };
  3242. const _hoisted_78 = { key: 2 };
  3243. const _hoisted_79 = { class: "row" };
  3244. const _hoisted_80 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "用户打标签(跨平台,数据保存在自己的记事本):", -1));
  3245. const _hoisted_81 = { class: "wrapper" };
  3246. const _hoisted_82 = { class: "row" };
  3247. const _hoisted_83 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "划词显示Base64解码框", -1));
  3248. const _hoisted_84 = { class: "wrapper" };
  3249. const _hoisted_85 = { class: "row" };
  3250. const _hoisted_86 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自动签到", -1));
  3251. const _hoisted_87 = { class: "wrapper" };
  3252. const _hoisted_88 = { class: "row" };
  3253. const _hoisted_89 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自定义背景", -1));
  3254. const _hoisted_90 = { class: "wrapper" };
  3255. const _hoisted_91 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3256. /* @__PURE__ */ vue.createTextVNode(" 未设定此值时,则脚本就什么都不做,V站大部分页面背景颜色默认为 #e2e2e2,少部分页面有特定背景。接受一个合法的css color值:例如"),
  3257. /* @__PURE__ */ vue.createElementVNode("a", {
  3258. href: "https://developer.mozilla.org/zh-CN/docs/Web/CSS/color_value",
  3259. target: "_blank"
  3260. }, "red、#ffffff、rgb(222,222,22)(点此查看)"),
  3261. /* @__PURE__ */ vue.createTextVNode("等等。 ")
  3262. ], -1));
  3263. const _hoisted_92 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3264. const _hoisted_93 = { class: "row" };
  3265. const _hoisted_94 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "收藏时提醒添加到书签", -1));
  3266. const _hoisted_95 = { class: "wrapper" };
  3267. const _hoisted_96 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " V站帐号一旦被封禁,则无法登录(不可用),无法查看账号收藏了 ", -1));
  3268. const _hoisted_97 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3269. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "消息通知")
  3270. ], -1));
  3271. const _hoisted_98 = { class: "row" };
  3272. const _hoisted_99 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "接管未读提醒页面", -1));
  3273. const _hoisted_100 = { class: "wrapper" };
  3274. const _hoisted_101 = { class: "row" };
  3275. const _hoisted_102 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "定时查询未读提醒", -1));
  3276. const _hoisted_103 = { class: "wrapper" };
  3277. const _hoisted_104 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 开启此功能会带来以下影响: 1、你的IP可能会被封禁 2、消耗更多流量,给服务器带来更大的负担 3、你的V站浏览进度条会变快 ", -1));
  3278. const _hoisted_105 = {
  3279. key: 0,
  3280. class: "sub-content"
  3281. };
  3282. const _hoisted_106 = { class: "row" };
  3283. const _hoisted_107 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "查询间隔", -1));
  3284. const _hoisted_108 = { class: "wrapper" };
  3285. const _hoisted_109 = ["value"];
  3286. const _hoisted_110 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 设置值太小,会导致频繁请求,你的IP可能会被封禁,建议设置为5,即每次5分钟查询一次 ", -1));
  3287. const _hoisted_111 = { class: "row" };
  3288. const _hoisted_112 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "当有新未读提醒时,网页标题闪烁", -1));
  3289. const _hoisted_113 = { class: "wrapper" };
  3290. const _hoisted_114 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3291. /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "钉钉Webhook地址")
  3292. ], -1));
  3293. const _hoisted_115 = { class: "desc" };
  3294. const _hoisted_116 = ["value"];
  3295. const _hoisted_117 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3296. const _hoisted_118 = { key: 3 };
  3297. const _hoisted_119 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("h1", null, "V2EX Next", -1));
  3298. const _hoisted_120 = { class: "project-desc" };
  3299. const _hoisted_121 = { style: { "line-height": "2" } };
  3300. const _hoisted_122 = ["href"];
  3301. const _hoisted_123 = ["href"];
  3302. const _hoisted_124 = ["href"];
  3303. const _hoisted_125 = ["href"];
  3304. const _hoisted_126 = ["href"];
  3305. const _hoisted_127 = ["href"];
  3306. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  3307. const _component_Icon = vue.resolveComponent("Icon");
  3308. const _component_BaseSwitch = vue.resolveComponent("BaseSwitch");
  3309. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  3310. const _component_NoticeModal = vue.resolveComponent("NoticeModal");
  3311. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3312. default: vue.withCtx(() => [
  3313. $props.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
  3314. vue.createElementVNode("div", {
  3315. class: "mask",
  3316. onClick: _cache[0] || (_cache[0] = (...args) => $options.close && $options.close(...args))
  3317. }),
  3318. vue.createElementVNode("div", _hoisted_2$c, [
  3319. vue.createElementVNode("div", _hoisted_3$a, [
  3320. vue.createElementVNode("div", _hoisted_4$a, [
  3321. vue.createTextVNode(" 脚本设置 "),
  3322. vue.createElementVNode("div", _hoisted_5$8, [
  3323. vue.createElementVNode("a", {
  3324. href: $options.DefaultVal.mobileScript,
  3325. target: "_blank"
  3326. }, "(手机App已发布,支持楼中楼!)", 8, _hoisted_6$8)
  3327. ])
  3328. ]),
  3329. vue.createVNode(_component_Icon, {
  3330. icon: "ic:round-close",
  3331. onClick: $options.close
  3332. }, null, 8, ["onClick"])
  3333. ]),
  3334. $options.isNew ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$7, [
  3335. vue.createElementVNode("a", {
  3336. onClick: _cache[1] || (_cache[1] = (...args) => $options.goPost && $options.goPost(...args))
  3337. }, "New:手机App现已发布,支持楼中楼!PC脚本新增历史最热数据、imgur换源功能!点击查看详细介绍"),
  3338. _hoisted_8$7
  3339. ])) : vue.createCommentVNode("", true),
  3340. vue.createElementVNode("div", _hoisted_9$7, [
  3341. vue.createElementVNode("div", _hoisted_10$7, [
  3342. vue.createElementVNode("div", _hoisted_11$7, [
  3343. vue.createElementVNode("div", {
  3344. class: vue.normalizeClass(["tab", $data.tabIndex === 0 && "active"]),
  3345. onClick: _cache[2] || (_cache[2] = ($event) => $data.tabIndex = 0)
  3346. }, _hoisted_13$7, 2),
  3347. vue.createElementVNode("div", {
  3348. class: vue.normalizeClass(["tab", $data.tabIndex === 1 && "active"]),
  3349. onClick: _cache[3] || (_cache[3] = ($event) => $data.tabIndex = 1)
  3350. }, _hoisted_15$5, 2),
  3351. vue.createElementVNode("div", {
  3352. class: vue.normalizeClass(["tab", $data.tabIndex === 2 && "active"]),
  3353. onClick: _cache[4] || (_cache[4] = ($event) => $data.tabIndex = 2)
  3354. }, _hoisted_17$5, 2),
  3355. vue.createElementVNode("div", {
  3356. class: vue.normalizeClass(["tab", $data.tabIndex === 3 && "active"]),
  3357. onClick: _cache[5] || (_cache[5] = ($event) => $data.tabIndex = 3)
  3358. }, _hoisted_19$4, 2)
  3359. ]),
  3360. vue.createElementVNode("div", _hoisted_20$3, [
  3361. vue.createElementVNode("a", {
  3362. href: $options.DefaultVal.git,
  3363. target: "_blank"
  3364. }, [
  3365. vue.createVNode(_component_Icon, { icon: "mdi:github" })
  3366. ], 8, _hoisted_21$3),
  3367. vue.createElementVNode("a", {
  3368. href: $options.DefaultVal.homeUrl,
  3369. target: "_blank"
  3370. }, [
  3371. vue.createVNode(_component_Icon, { icon: "iconamoon:home-light" })
  3372. ], 8, _hoisted_22$3)
  3373. ])
  3374. ]),
  3375. vue.createElementVNode("div", _hoisted_23$3, [
  3376. vue.createElementVNode("div", _hoisted_24$2, [
  3377. $data.tabIndex === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_25$1, [
  3378. vue.createElementVNode("div", _hoisted_26$1, [
  3379. _hoisted_27$1,
  3380. vue.createElementVNode("div", _hoisted_28$1, [
  3381. vue.createElementVNode("div", _hoisted_29$1, [
  3382. vue.createElementVNode("div", {
  3383. class: vue.normalizeClass(["radio", $data.config.viewType === "simple" ? "active" : ""]),
  3384. onClick: _cache[6] || (_cache[6] = ($event) => $data.config.viewType = "simple")
  3385. }, "简洁 ", 2),
  3386. vue.createElementVNode("div", {
  3387. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  3388. onClick: _cache[7] || (_cache[7] = ($event) => $data.config.viewType = "table")
  3389. }, "表格 ", 2),
  3390. vue.createElementVNode("div", {
  3391. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  3392. onClick: _cache[8] || (_cache[8] = ($event) => $data.showNotice = true)
  3393. }, "卡片 ", 2)
  3394. ])
  3395. ])
  3396. ]),
  3397. _hoisted_30$1,
  3398. vue.createElementVNode("div", _hoisted_31$1, [
  3399. _hoisted_32$1,
  3400. vue.createElementVNode("div", _hoisted_33$1, [
  3401. vue.createVNode(_component_BaseSwitch, {
  3402. modelValue: $data.config.clickPostItemOpenDetail,
  3403. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.config.clickPostItemOpenDetail = $event)
  3404. }, null, 8, ["modelValue"])
  3405. ])
  3406. ]),
  3407. _hoisted_34$1,
  3408. vue.createElementVNode("div", _hoisted_35$1, [
  3409. _hoisted_36$1,
  3410. vue.createElementVNode("div", _hoisted_37$1, [
  3411. vue.createVNode(_component_BaseSwitch, {
  3412. modelValue: $data.config.newTabOpen,
  3413. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.config.newTabOpen = $event)
  3414. }, null, 8, ["modelValue"])
  3415. ])
  3416. ]),
  3417. _hoisted_38$1,
  3418. vue.createElementVNode("div", _hoisted_39$1, [
  3419. _hoisted_40$1,
  3420. vue.createElementVNode("div", _hoisted_41$1, [
  3421. vue.createVNode(_component_BaseSwitch, {
  3422. modelValue: $data.config.newTabOpenActive,
  3423. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.config.newTabOpenActive = $event)
  3424. }, null, 8, ["modelValue"])
  3425. ])
  3426. ])
  3427. ])) : vue.createCommentVNode("", true),
  3428. $data.tabIndex === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42$1, [
  3429. vue.createElementVNode("div", _hoisted_43$1, [
  3430. _hoisted_44$1,
  3431. vue.createElementVNode("div", _hoisted_45$1, [
  3432. vue.createVNode(_component_BaseSelect, {
  3433. "display-type": $data.config.commentDisplayType,
  3434. "onUpdate:displayType": _cache[12] || (_cache[12] = ($event) => $data.config.commentDisplayType = $event)
  3435. }, null, 8, ["display-type"])
  3436. ])
  3437. ]),
  3438. vue.createElementVNode("div", _hoisted_46$1, [
  3439. _hoisted_47$1,
  3440. vue.createElementVNode("div", _hoisted_48, [
  3441. vue.createVNode(_component_BaseSwitch, {
  3442. modelValue: $data.config.showToolbar,
  3443. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.config.showToolbar = $event)
  3444. }, null, 8, ["modelValue"])
  3445. ])
  3446. ]),
  3447. vue.createElementVNode("div", _hoisted_49, [
  3448. _hoisted_50,
  3449. vue.createElementVNode("div", _hoisted_51, [
  3450. vue.createVNode(_component_BaseSwitch, {
  3451. modelValue: $data.config.replaceImgur,
  3452. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.config.replaceImgur = $event)
  3453. }, null, 8, ["modelValue"])
  3454. ])
  3455. ]),
  3456. vue.createElementVNode("div", _hoisted_52, [
  3457. _hoisted_53,
  3458. vue.createElementVNode("div", _hoisted_54, [
  3459. vue.createVNode(_component_BaseSwitch, {
  3460. modelValue: $data.config.autoOpenDetail,
  3461. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.config.autoOpenDetail = $event)
  3462. }, null, 8, ["modelValue"])
  3463. ])
  3464. ]),
  3465. _hoisted_55,
  3466. vue.createElementVNode("div", _hoisted_56, [
  3467. _hoisted_57,
  3468. vue.createElementVNode("div", _hoisted_58, [
  3469. vue.createVNode(_component_BaseSwitch, {
  3470. modelValue: $data.config.closePostDetailBySpace,
  3471. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.config.closePostDetailBySpace = $event)
  3472. }, null, 8, ["modelValue"])
  3473. ])
  3474. ]),
  3475. vue.createElementVNode("div", _hoisted_59, [
  3476. _hoisted_60,
  3477. vue.createElementVNode("div", _hoisted_61, [
  3478. vue.createVNode(_component_BaseSwitch, {
  3479. modelValue: $data.config.contentAutoCollapse,
  3480. "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.config.contentAutoCollapse = $event)
  3481. }, null, 8, ["modelValue"])
  3482. ])
  3483. ]),
  3484. vue.createElementVNode("div", _hoisted_62, [
  3485. _hoisted_63,
  3486. vue.createElementVNode("div", _hoisted_64, [
  3487. vue.withDirectives(vue.createElementVNode("input", {
  3488. type: "text",
  3489. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.config.postWidth = $event)
  3490. }, null, 512), [
  3491. [vue.vModelText, $data.config.postWidth]
  3492. ])
  3493. ])
  3494. ]),
  3495. _hoisted_65,
  3496. _hoisted_66,
  3497. _hoisted_67,
  3498. _hoisted_68,
  3499. vue.createElementVNode("div", _hoisted_69, [
  3500. _hoisted_70,
  3501. vue.createElementVNode("div", _hoisted_71, [
  3502. vue.createVNode(_component_BaseSwitch, {
  3503. modelValue: $data.config.showTopReply,
  3504. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.config.showTopReply = $event)
  3505. }, null, 8, ["modelValue"])
  3506. ])
  3507. ]),
  3508. vue.createElementVNode("div", _hoisted_72, [
  3509. vue.createElementVNode("label", _hoisted_73, "最多显示" + vue.toDisplayString($data.config.topReplyCount) + "个高赞回复", 1),
  3510. vue.createElementVNode("div", _hoisted_74, [
  3511. vue.withDirectives(vue.createElementVNode("input", {
  3512. type: "number",
  3513. min: "1",
  3514. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.config.topReplyCount = $event)
  3515. }, null, 512), [
  3516. [vue.vModelText, $data.config.topReplyCount]
  3517. ])
  3518. ])
  3519. ]),
  3520. vue.createElementVNode("div", _hoisted_75, [
  3521. vue.createElementVNode("label", _hoisted_76, "最少需要" + vue.toDisplayString($data.config.topReplyLoveMinCount) + "个赞才能被判定为高赞", 1),
  3522. vue.createElementVNode("div", _hoisted_77, [
  3523. vue.withDirectives(vue.createElementVNode("input", {
  3524. type: "number",
  3525. min: "1",
  3526. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.config.topReplyLoveMinCount = $event)
  3527. }, null, 512), [
  3528. [vue.vModelText, $data.config.topReplyLoveMinCount]
  3529. ])
  3530. ])
  3531. ])
  3532. ])) : vue.createCommentVNode("", true),
  3533. $data.tabIndex === 2 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_78, [
  3534. vue.createElementVNode("div", _hoisted_79, [
  3535. _hoisted_80,
  3536. vue.createElementVNode("div", _hoisted_81, [
  3537. vue.createVNode(_component_BaseSwitch, {
  3538. modelValue: $data.config.openTag,
  3539. "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => $data.config.openTag = $event)
  3540. }, null, 8, ["modelValue"])
  3541. ])
  3542. ]),
  3543. vue.createElementVNode("div", _hoisted_82, [
  3544. _hoisted_83,
  3545. vue.createElementVNode("div", _hoisted_84, [
  3546. vue.createVNode(_component_BaseSwitch, {
  3547. modelValue: $data.config.base64,
  3548. "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.config.base64 = $event)
  3549. }, null, 8, ["modelValue"])
  3550. ])
  3551. ]),
  3552. vue.createElementVNode("div", _hoisted_85, [
  3553. _hoisted_86,
  3554. vue.createElementVNode("div", _hoisted_87, [
  3555. vue.createVNode(_component_BaseSwitch, {
  3556. modelValue: $data.config.autoSignin,
  3557. "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => $data.config.autoSignin = $event)
  3558. }, null, 8, ["modelValue"])
  3559. ])
  3560. ]),
  3561. vue.createElementVNode("div", _hoisted_88, [
  3562. _hoisted_89,
  3563. vue.createElementVNode("div", _hoisted_90, [
  3564. vue.withDirectives(vue.createElementVNode("input", {
  3565. type: "text",
  3566. "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => $data.config.customBgColor = $event)
  3567. }, null, 512), [
  3568. [vue.vModelText, $data.config.customBgColor]
  3569. ])
  3570. ])
  3571. ]),
  3572. _hoisted_91,
  3573. _hoisted_92,
  3574. vue.createElementVNode("div", _hoisted_93, [
  3575. _hoisted_94,
  3576. vue.createElementVNode("div", _hoisted_95, [
  3577. vue.createVNode(_component_BaseSwitch, {
  3578. modelValue: $data.config.collectBrowserNotice,
  3579. "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => $data.config.collectBrowserNotice = $event)
  3580. }, null, 8, ["modelValue"])
  3581. ])
  3582. ]),
  3583. _hoisted_96,
  3584. _hoisted_97,
  3585. vue.createElementVNode("div", _hoisted_98, [
  3586. _hoisted_99,
  3587. vue.createElementVNode("div", _hoisted_100, [
  3588. vue.createVNode(_component_BaseSwitch, {
  3589. modelValue: $data.config.notice.takeOverNoticePage,
  3590. "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => $data.config.notice.takeOverNoticePage = $event)
  3591. }, null, 8, ["modelValue"])
  3592. ])
  3593. ]),
  3594. vue.createElementVNode("div", _hoisted_101, [
  3595. _hoisted_102,
  3596. vue.createElementVNode("div", _hoisted_103, [
  3597. vue.createVNode(_component_BaseSwitch, {
  3598. modelValue: $data.config.notice.loopCheckNotice,
  3599. "onUpdate:modelValue": _cache[28] || (_cache[28] = ($event) => $data.config.notice.loopCheckNotice = $event)
  3600. }, null, 8, ["modelValue"])
  3601. ])
  3602. ]),
  3603. _hoisted_104,
  3604. $data.config.notice.loopCheckNotice ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_105, [
  3605. vue.createElementVNode("div", _hoisted_106, [
  3606. _hoisted_107,
  3607. vue.createElementVNode("div", _hoisted_108, [
  3608. vue.createElementVNode("input", {
  3609. type: "number",
  3610. value: $data.config.notice.loopCheckNoticeInterval,
  3611. onBlur: _cache[29] || (_cache[29] = (e2) => $data.config.notice.loopCheckNoticeInterval = e2.target.value),
  3612. style: { "margin-right": "1rem" }
  3613. }, null, 40, _hoisted_109),
  3614. vue.createTextVNode("分钟 ")
  3615. ])
  3616. ]),
  3617. _hoisted_110,
  3618. vue.createElementVNode("div", _hoisted_111, [
  3619. _hoisted_112,
  3620. vue.createElementVNode("div", _hoisted_113, [
  3621. vue.createVNode(_component_BaseSwitch, {
  3622. modelValue: $data.config.notice.whenNewNoticeGlimmer,
  3623. "onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => $data.config.notice.whenNewNoticeGlimmer = $event)
  3624. }, null, 8, ["modelValue"])
  3625. ])
  3626. ]),
  3627. _hoisted_114,
  3628. vue.createElementVNode("div", _hoisted_115, [
  3629. vue.createElementVNode("input", {
  3630. type: "text",
  3631. value: $data.config.notice.ddWebhook,
  3632. onBlur: _cache[31] || (_cache[31] = (e2) => $data.config.notice.ddWebhook = e2.target.value),
  3633. style: { "width": "100%" }
  3634. }, null, 40, _hoisted_116)
  3635. ])
  3636. ])) : vue.createCommentVNode("", true),
  3637. _hoisted_117
  3638. ])) : vue.createCommentVNode("", true),
  3639. $data.tabIndex === 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_118, [
  3640. _hoisted_119,
  3641. vue.createElementVNode("div", _hoisted_120, [
  3642. vue.createElementVNode("div", _hoisted_121, [
  3643. vue.createElementVNode("div", null, [
  3644. vue.createTextVNode("官网:"),
  3645. vue.createElementVNode("a", {
  3646. href: $options.DefaultVal.homeUrl,
  3647. target: "_blank"
  3648. }, vue.toDisplayString($options.DefaultVal.homeUrl), 9, _hoisted_122)
  3649. ]),
  3650. vue.createElementVNode("div", null, [
  3651. vue.createTextVNode("GitHub地址:"),
  3652. vue.createElementVNode("a", {
  3653. href: $options.DefaultVal.git,
  3654. target: "_blank"
  3655. }, vue.toDisplayString($options.DefaultVal.git), 9, _hoisted_123)
  3656. ]),
  3657. vue.createElementVNode("div", null, [
  3658. vue.createTextVNode("PC脚本地址:"),
  3659. vue.createElementVNode("a", {
  3660. href: $options.DefaultVal.pcScript,
  3661. target: "_blank"
  3662. }, vue.toDisplayString($options.DefaultVal.pcScript), 9, _hoisted_124)
  3663. ]),
  3664. vue.createElementVNode("div", null, [
  3665. vue.createTextVNode("App地址:"),
  3666. vue.createElementVNode("a", {
  3667. href: $options.DefaultVal.mobileScript,
  3668. target: "_blank"
  3669. }, vue.toDisplayString($options.DefaultVal.mobileScript), 9, _hoisted_125)
  3670. ]),
  3671. vue.createElementVNode("div", null, [
  3672. vue.createTextVNode("反馈: "),
  3673. vue.createElementVNode("a", {
  3674. href: $options.DefaultVal.issue,
  3675. target: "_blank"
  3676. }, vue.toDisplayString($options.DefaultVal.issue), 9, _hoisted_126)
  3677. ]),
  3678. vue.createElementVNode("div", null, [
  3679. vue.createTextVNode("更新日志:"),
  3680. vue.createElementVNode("a", {
  3681. href: $options.DefaultVal.pcLog,
  3682. target: "_blank"
  3683. }, vue.toDisplayString($options.DefaultVal.pcLog), 9, _hoisted_127)
  3684. ])
  3685. ])
  3686. ])
  3687. ])) : vue.createCommentVNode("", true)
  3688. ])
  3689. ])
  3690. ])
  3691. ]),
  3692. vue.createVNode(_component_NoticeModal, {
  3693. show: $data.showNotice,
  3694. "onUpdate:show": _cache[32] || (_cache[32] = ($event) => $data.showNotice = $event),
  3695. onConfirm: _cache[33] || (_cache[33] = ($event) => $data.config.viewType = "card")
  3696. }, null, 8, ["show"])
  3697. ])) : vue.createCommentVNode("", true)
  3698. ]),
  3699. _: 1
  3700. });
  3701. }
  3702. const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$8], ["__scopeId", "data-v-9fea31eb"]]);
  3703. const _sfc_main$e = {
  3704. name: "Point",
  3705. components: { PopConfirm, Icon },
  3706. inject: ["post", "isLogin"],
  3707. props: {
  3708. item: {
  3709. type: Object,
  3710. default() {
  3711. return {};
  3712. }
  3713. },
  3714. apiUrl: ""
  3715. },
  3716. computed: {
  3717. disabled() {
  3718. return this.item.username === window.user.username || this.item.isThanked || !this.isLogin;
  3719. }
  3720. },
  3721. methods: {
  3722. thankError() {
  3723. if (!this.isLogin) {
  3724. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录(不可用)!" });
  3725. }
  3726. if (this.item.username === window.user.username) {
  3727. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  3728. }
  3729. if (this.item.isThanked) {
  3730. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  3731. }
  3732. },
  3733. async thank() {
  3734. this.$emit("addThank");
  3735. let url = `${location.origin}/thank/${this.apiUrl}?once=${this.post.once}`;
  3736. $.post(url).then((res) => {
  3737. if (!res.success) {
  3738. this.$emit("recallThank");
  3739. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  3740. }
  3741. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  3742. }, (err) => {
  3743. this.$emit("recallThank");
  3744. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  3745. eventBus.emit(CMD.REFRESH_ONCE);
  3746. });
  3747. }
  3748. }
  3749. };
  3750. const _hoisted_1$e = {
  3751. key: 2,
  3752. class: "link-num"
  3753. };
  3754. const _hoisted_2$b = { key: 3 };
  3755. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  3756. const _component_Icon = vue.resolveComponent("Icon");
  3757. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  3758. return vue.openBlock(), vue.createBlock(_component_PopConfirm, {
  3759. disabled: $options.disabled,
  3760. title: `确认花费 10 个铜币向 @${$props.item.username} 的这条回复发送感谢?`,
  3761. onConfirm: $options.thank
  3762. }, {
  3763. default: vue.withCtx(() => [
  3764. vue.createElementVNode("div", {
  3765. class: vue.normalizeClass(["tool", [$options.disabled && "disabled"]]),
  3766. onClick: _cache[0] || (_cache[0] = (...args) => $options.thankError && $options.thankError(...args))
  3767. }, [
  3768. $props.item.isThanked ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  3769. key: 0,
  3770. color: "rgb(224,42,42)",
  3771. icon: "icon-park-solid:like"
  3772. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  3773. key: 1,
  3774. color: !$props.item.thankCount ? null : "rgb(224,42,42)",
  3775. icon: "icon-park-outline:like"
  3776. }, null, 8, ["color"])),
  3777. $props.item.thankCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$e, vue.toDisplayString($props.item.thankCount), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$b, "感谢"))
  3778. ], 2)
  3779. ]),
  3780. _: 1
  3781. }, 8, ["disabled", "title", "onConfirm"]);
  3782. }
  3783. const Point = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$7]]);
  3784. const _sfc_main$d = {
  3785. name: "Author",
  3786. components: { PopConfirm, Point, Icon },
  3787. inject: ["isLogin", "tags", "config", "isNight"],
  3788. props: {
  3789. modelValue: false,
  3790. comment: {
  3791. type: Object,
  3792. default() {
  3793. return {};
  3794. }
  3795. },
  3796. type: {
  3797. type: String,
  3798. default() {
  3799. return "list";
  3800. }
  3801. }
  3802. },
  3803. computed: {
  3804. isDev() {
  3805. return false;
  3806. },
  3807. pointInfo() {
  3808. return {
  3809. isThanked: this.comment.isThanked,
  3810. thankCount: this.comment.thankCount,
  3811. username: this.comment.username
  3812. };
  3813. },
  3814. myTags() {
  3815. return this.tags[this.comment.username] ?? [];
  3816. },
  3817. context() {
  3818. return this.comment.replyUsers.length;
  3819. }
  3820. },
  3821. methods: {
  3822. jump() {
  3823. eventBus.emit(CMD.JUMP, this.comment.floor);
  3824. },
  3825. showRelationReply() {
  3826. if (!this.comment.replyUsers.length) {
  3827. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "该回复无上下文" });
  3828. return;
  3829. }
  3830. eventBus.emit(CMD.RELATION_REPLY, {
  3831. left: this.comment.replyUsers,
  3832. right: this.comment.username,
  3833. rightFloor: this.comment.floor
  3834. });
  3835. },
  3836. addTag() {
  3837. eventBus.emit(CMD.ADD_TAG, this.comment.username);
  3838. },
  3839. removeTag(tag) {
  3840. eventBus.emit(CMD.REMOVE_TAG, { username: this.comment.username, tag });
  3841. },
  3842. checkIsLogin(emitName = "") {
  3843. if (!this.isLogin) {
  3844. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录(不可用)!" });
  3845. return false;
  3846. }
  3847. this.$emit(emitName);
  3848. return true;
  3849. },
  3850. addThank() {
  3851. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "add" });
  3852. },
  3853. recallThank() {
  3854. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "recall" });
  3855. }
  3856. }
  3857. };
  3858. const _withScopeId$9 = (n2) => (vue.pushScopeId("data-v-64aa1930"), n2 = n2(), vue.popScopeId(), n2);
  3859. const _hoisted_1$d = { class: "Author-left" };
  3860. const _hoisted_2$a = ["href"];
  3861. const _hoisted_3$9 = ["src"];
  3862. const _hoisted_4$9 = { class: "texts" };
  3863. const _hoisted_5$7 = ["href"];
  3864. const _hoisted_6$7 = {
  3865. key: 0,
  3866. class: "owner"
  3867. };
  3868. const _hoisted_7$6 = {
  3869. key: 1,
  3870. class: "dup"
  3871. };
  3872. const _hoisted_8$6 = {
  3873. key: 2,
  3874. class: "mod"
  3875. };
  3876. const _hoisted_9$6 = { class: "ago" };
  3877. const _hoisted_10$6 = { class: "my-tag" };
  3878. const _hoisted_11$6 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  3879. const _hoisted_12$6 = ["onClick"];
  3880. const _hoisted_13$6 = { class: "Author-right" };
  3881. const _hoisted_14$5 = {
  3882. key: 0,
  3883. class: "toolbar"
  3884. };
  3885. const _hoisted_15$4 = { class: "tool" };
  3886. const _hoisted_16$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "隐藏", -1));
  3887. const _hoisted_17$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上下文", -1));
  3888. const _hoisted_18$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  3889. const _hoisted_19$3 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  3890. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  3891. const _component_Icon = vue.resolveComponent("Icon");
  3892. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  3893. const _component_Point = vue.resolveComponent("Point");
  3894. return vue.openBlock(), vue.createElementBlock("div", {
  3895. class: vue.normalizeClass(["Author", { expand: !$props.modelValue }])
  3896. }, [
  3897. vue.createElementVNode("div", _hoisted_1$d, [
  3898. !$props.modelValue ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  3899. key: 0,
  3900. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => _ctx.$emit("update:modelValue", true), ["stop"])),
  3901. color: "#177EC9",
  3902. class: "expand-icon",
  3903. icon: "gravity-ui:chevrons-expand-up-right"
  3904. })) : vue.createCommentVNode("", true),
  3905. $options.config.viewType !== "simple" ? (vue.openBlock(), vue.createElementBlock("a", {
  3906. key: 1,
  3907. class: "avatar",
  3908. href: `/member/${$props.comment.username}`
  3909. }, [
  3910. vue.createElementVNode("img", {
  3911. src: $props.comment.avatar,
  3912. alt: ""
  3913. }, null, 8, _hoisted_3$9)
  3914. ], 8, _hoisted_2$a)) : vue.createCommentVNode("", true),
  3915. vue.createElementVNode("span", _hoisted_4$9, [
  3916. vue.createElementVNode("strong", null, [
  3917. vue.createElementVNode("a", {
  3918. href: `/member/${$props.comment.username}`,
  3919. class: vue.normalizeClass(["username", { "dark": $options.isNight }])
  3920. }, vue.toDisplayString($props.comment.username), 11, _hoisted_5$7)
  3921. ]),
  3922. $props.comment.isOp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$7, "OP")) : vue.createCommentVNode("", true),
  3923. $props.comment.isDup ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$6, "DUP")) : vue.createCommentVNode("", true),
  3924. $props.comment.isMod ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$6, "MOD")) : vue.createCommentVNode("", true),
  3925. vue.createElementVNode("span", _hoisted_9$6, vue.toDisplayString($props.comment.date), 1),
  3926. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
  3927. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  3928. return vue.openBlock(), vue.createElementBlock("span", _hoisted_10$6, [
  3929. _hoisted_11$6,
  3930. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  3931. vue.createElementVNode("i", {
  3932. class: "fa fa-trash-o remove",
  3933. onClick: vue.withModifiers(($event) => $options.removeTag(i), ["stop"])
  3934. }, null, 8, _hoisted_12$6)
  3935. ]);
  3936. }), 256)),
  3937. vue.createElementVNode("span", {
  3938. class: "add-tag ago",
  3939. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.addTag && $options.addTag(...args), ["stop"])),
  3940. title: "添加标签"
  3941. }, "+")
  3942. ], 64)) : vue.createCommentVNode("", true)
  3943. ])
  3944. ]),
  3945. vue.createElementVNode("div", _hoisted_13$6, [
  3946. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$5, [
  3947. vue.createVNode(_component_PopConfirm, {
  3948. title: "确认隐藏这条回复?",
  3949. onConfirm: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("hide"))
  3950. }, {
  3951. default: vue.withCtx(() => [
  3952. vue.createElementVNode("div", _hoisted_15$4, [
  3953. vue.createVNode(_component_Icon, { icon: "fluent:eye-hide-24-regular" }),
  3954. _hoisted_16$4
  3955. ])
  3956. ]),
  3957. _: 1
  3958. }),
  3959. $options.context ? (vue.openBlock(), vue.createElementBlock("div", {
  3960. key: 0,
  3961. class: "tool",
  3962. onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.showRelationReply && $options.showRelationReply(...args), ["stop"]))
  3963. }, [
  3964. vue.createVNode(_component_Icon, { icon: "iconoir:page-search" }),
  3965. _hoisted_17$4
  3966. ])) : vue.createCommentVNode("", true),
  3967. $props.type === "top" ? (vue.openBlock(), vue.createElementBlock("div", {
  3968. key: 1,
  3969. class: "tool",
  3970. onClick: _cache[4] || (_cache[4] = vue.withModifiers((...args) => $options.jump && $options.jump(...args), ["stop"]))
  3971. }, [
  3972. vue.createVNode(_component_Icon, { icon: "icon-park-outline:to-bottom" }),
  3973. _hoisted_18$4
  3974. ])) : vue.createCommentVNode("", true),
  3975. vue.createElementVNode("div", {
  3976. class: "tool",
  3977. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => $options.checkIsLogin("reply"), ["stop"]))
  3978. }, [
  3979. vue.createVNode(_component_Icon, { icon: "mynaui:message" }),
  3980. _hoisted_19$3
  3981. ]),
  3982. vue.withDirectives(vue.createVNode(_component_Point, {
  3983. item: $options.pointInfo,
  3984. onAddThank: $options.addThank,
  3985. onRecallThank: $options.recallThank,
  3986. "api-url": "reply/" + $props.comment.id
  3987. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  3988. [vue.vShow, !$props.comment.thankCount]
  3989. ])
  3990. ])) : vue.createCommentVNode("", true),
  3991. vue.withDirectives(vue.createVNode(_component_Point, {
  3992. item: $options.pointInfo,
  3993. onAddThank: $options.addThank,
  3994. onRecallThank: $options.recallThank,
  3995. "api-url": "reply/" + $props.comment.id
  3996. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  3997. [vue.vShow, $props.comment.thankCount]
  3998. ]),
  3999. vue.createElementVNode("div", {
  4000. class: vue.normalizeClass(["floor", { isDev: $options.isDev }])
  4001. }, vue.toDisplayString($props.comment.floor), 3)
  4002. ])
  4003. ], 2);
  4004. }
  4005. const Author = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$6], ["__scopeId", "data-v-64aa1930"]]);
  4006. const _withScopeId$8 = (n2) => (vue.pushScopeId("data-v-85e09b4e"), n2 = n2(), vue.popScopeId(), n2);
  4007. const _hoisted_1$c = { class: "get-cursor" };
  4008. const _hoisted_2$9 = ["innerHTML"];
  4009. const _hoisted_3$8 = { class: "toolbar" };
  4010. const _hoisted_4$8 = { class: "left" };
  4011. const _hoisted_5$6 = { class: "upload" };
  4012. const _hoisted_6$6 = {
  4013. key: 0,
  4014. style: { "color": "black", "font-size": "1.4rem" }
  4015. };
  4016. const _hoisted_7$5 = { class: "right" };
  4017. const _hoisted_8$5 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "经典", -1));
  4018. const _hoisted_9$5 = { class: "list" };
  4019. const _hoisted_10$5 = ["src", "onClick"];
  4020. const _hoisted_11$5 = { class: "emoji" };
  4021. const _hoisted_12$5 = { class: "title" };
  4022. const _hoisted_13$5 = { class: "list" };
  4023. const _hoisted_14$4 = ["onClick"];
  4024. const _sfc_main$c = {
  4025. __name: "PostEditor",
  4026. props: {
  4027. replyUser: null,
  4028. replyFloor: null,
  4029. useType: {
  4030. type: String,
  4031. default() {
  4032. return "reply-comment";
  4033. }
  4034. }
  4035. },
  4036. emits: ["close"],
  4037. setup(__props, { expose: __expose, emit: __emit }) {
  4038. const props = __props;
  4039. const { replyUser, replyFloor, useType } = props;
  4040. const replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  4041. const emits = __emit;
  4042. const post = vue.inject("post");
  4043. const show = vue.inject("show");
  4044. const isNight = vue.inject("isNight");
  4045. vue.inject("pageType");
  4046. const allReplyUsers = vue.inject("allReplyUsers");
  4047. let isFocus = vue.ref(false);
  4048. const loading = vue.ref(false);
  4049. const uploadLoading = vue.ref(false);
  4050. const isShowEmoticons = vue.ref(false);
  4051. const editorId = vue.ref("editorId_" + Date.now());
  4052. const content = vue.ref(replyInfo);
  4053. const txtRef = vue.ref(null);
  4054. const cursorRef = vue.ref(null);
  4055. const emoticonsRef = vue.ref(null);
  4056. const none = vue.ref('<span style="white-space:pre-wrap;"> </span>');
  4057. const imgurClientIdPool = [
  4058. "3107b9ef8b316f3",
  4059. "442b04f26eefc8a",
  4060. "59cfebe717c09e4",
  4061. "60605aad4a62882",
  4062. "6c65ab1d3f5452a",
  4063. "83e123737849aa9",
  4064. "9311f6be1c10160",
  4065. "c4a4a563f698595",
  4066. "81be04b9e4a08ce"
  4067. ];
  4068. __expose({ content, isFocus: () => isFocus.value });
  4069. const editorClass = vue.computed(() => {
  4070. return [useType, isFocus.value ? "isFocus" : "", isNight.value ? "isNight" : ""];
  4071. });
  4072. const cursorHtml = vue.computed(() => {
  4073. var _a;
  4074. if (!txtRef.value || !content.value)
  4075. return "";
  4076. let index = ((_a = txtRef.value) == null ? void 0 : _a.selectionStart) || 0;
  4077. return content.value.substring(0, index).replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>").replace(/\s/g, none.value);
  4078. });
  4079. const disabled = vue.computed(() => {
  4080. if (content.value) {
  4081. return content.value === replyInfo;
  4082. } else {
  4083. return true;
  4084. }
  4085. });
  4086. function drop(e2) {
  4087. e2.preventDefault();
  4088. upload(e2.dataTransfer.files[0]);
  4089. }
  4090. async function upload(file) {
  4091. if (!file)
  4092. return;
  4093. if (uploadLoading.value)
  4094. return;
  4095. uploadLoading.value = true;
  4096. const formData = new FormData();
  4097. formData.append("image", file);
  4098. const randomIndex = Math.floor(Math.random() * imgurClientIdPool.length);
  4099. const clidenId = imgurClientIdPool[randomIndex];
  4100. const res = await fetch("https://api.imgur.com/3/upload", {
  4101. method: "POST",
  4102. headers: { Authorization: `Client-ID ${clidenId}` },
  4103. body: formData
  4104. });
  4105. uploadLoading.value = false;
  4106. if (res.ok) {
  4107. const resData = await res.json();
  4108. if (resData.success) {
  4109. return insert(" " + resData.data.link + " ");
  4110. }
  4111. }
  4112. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "上传失败" });
  4113. }
  4114. async function submit() {
  4115. if (disabled.value || loading.value)
  4116. return;
  4117. loading.value = true;
  4118. let submit_content = content.value.replace(/\[((?!\[).)+\]/g, function(match) {
  4119. let item2 = classicsEmoticons.find((v) => v.name === match);
  4120. if (item2) {
  4121. return item2.low + " ";
  4122. }
  4123. return match;
  4124. });
  4125. let show_content = content.value.replace(/https?:\/\/(i\.)?imgur\.com\/((?!http).)+\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG)/g, function(match) {
  4126. return `<img src="${match}" data-originUrl="${match}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`;
  4127. });
  4128. show_content = show_content.replace(/\[((?!\[).)+\]/g, function(match) {
  4129. let item2 = classicsEmoticons.find((v) => v.name === match);
  4130. if (item2) {
  4131. return `<a target="_blank" href="${item2.low}" rel="nofollow noopener"><img src="${item2.low}" class="embedded_image" rel="noreferrer"></a> `;
  4132. }
  4133. return match;
  4134. });
  4135. let matchUsers = show_content.match(/@([\w]+?[\s])/g);
  4136. if (matchUsers) {
  4137. matchUsers.map((i) => {
  4138. let username = i.replace("@", "").replace(" ", "");
  4139. show_content = show_content.replace(username, `<a href="/member/${username}">${username}</a>`);
  4140. });
  4141. }
  4142. show_content = show_content.replaceAll("\n", "<br/>");
  4143. let item = {
  4144. thankCount: 0,
  4145. isThanked: false,
  4146. isOp: post.value.username === window.user.username,
  4147. isDup: false,
  4148. id: Date.now(),
  4149. username: window.user.username,
  4150. avatar: window.user.avatar,
  4151. date: "几秒前",
  4152. floor: post.value.replyCount + 1,
  4153. reply_content: show_content ?? "",
  4154. children: [],
  4155. replyUsers: replyUser ? [replyUser] : [],
  4156. replyFloor: replyFloor || -1,
  4157. level: useType === "reply-comment" ? 1 : 0
  4158. };
  4159. item.hideCallUserReplyContent = item.reply_content;
  4160. if (item.replyUsers.length === 1) {
  4161. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(?:<ul [\s\S]+<\/ul>)?(\s#[\d]+)?\s(<br>)?/, () => "");
  4162. }
  4163. let url = `${location.origin}/t/${post.value.id}`;
  4164. $.post(url, { content: submit_content, once: post.value.once }).then(
  4165. // $.post(url, {content: submit_content, once: 123}).then(
  4166. (res) => {
  4167. loading.value = false;
  4168. let r2 = res.search("你上一条回复的内容和这条相同");
  4169. if (r2 > -1)
  4170. return eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你上一条回复的内容和这条相同" });
  4171. r2 = res.search("请不要在每一个回复中都包括外链,这看起来像是在 spamming");
  4172. if (r2 > -1)
  4173. return eventBus.emit(CMD.SHOW_MSG, {
  4174. type: "error",
  4175. text: "请不要在每一个回复中都包括外链,这看起来像是在 spamming"
  4176. });
  4177. let r22 = res.search("创建新回复");
  4178. if (r22 > -1) {
  4179. eventBus.emit(CMD.REFRESH_ONCE, res);
  4180. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复出现了问题,请使用原版进行回复" });
  4181. let clientWidth = window.document.body.clientWidth;
  4182. let windowWidth = 1200;
  4183. let left = clientWidth / 2 - windowWidth / 2;
  4184. let newWin = window.open("创建新回复", "", `width=${windowWidth},height=600,left=${left},top=100`);
  4185. newWin.document.write(res);
  4186. let loop = setInterval(function() {
  4187. if (newWin.closed) {
  4188. clearInterval(loop);
  4189. eventBus.emit(CMD.REFRESH_POST);
  4190. }
  4191. }, 1e3);
  4192. return;
  4193. }
  4194. content.value = replyInfo;
  4195. emits("close");
  4196. eventBus.emit(CMD.REFRESH_ONCE, res);
  4197. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "回复成功" });
  4198. eventBus.emit(CMD.ADD_REPLY, item);
  4199. },
  4200. (err) => {
  4201. console.log("err", err);
  4202. loading.value = false;
  4203. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复失败" });
  4204. }
  4205. ).catch((r2) => {
  4206. console.log("catch", r2);
  4207. });
  4208. }
  4209. function getEmojiSrc(url) {
  4210. return window.config.replaceImgur ? DefaultVal.imgurProxy + url : url;
  4211. }
  4212. function showEmoticons(e2) {
  4213. if (isShowEmoticons.value) {
  4214. return isShowEmoticons.value = false;
  4215. }
  4216. let rect = e2.currentTarget.getBoundingClientRect();
  4217. emoticonsRef.value.style.left = rect.left + 30 + "px";
  4218. emoticonsRef.value.style.bottom = window.innerHeight - rect.top - 20 + "px";
  4219. isShowEmoticons.value = true;
  4220. }
  4221. function off() {
  4222. eventBus.emit(CMD.SHOW_CALL, { show: false });
  4223. eventBus.off(CMD.SET_CALL);
  4224. }
  4225. function checkHeight2() {
  4226. txtRef.value.style.height = 0;
  4227. txtRef.value.style.height = txtRef.value.scrollHeight + "px";
  4228. }
  4229. function insert(str) {
  4230. let cursorPos = txtRef.value.selectionStart;
  4231. let start = content.value.slice(0, cursorPos);
  4232. let end = content.value.slice(cursorPos, content.value.length);
  4233. content.value = start + str + end;
  4234. let moveCursorPos = start.length + str.length;
  4235. setTimeout(() => {
  4236. txtRef.value.focus();
  4237. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  4238. checkHeight2();
  4239. });
  4240. }
  4241. function showCallPopover(text) {
  4242. let r2 = cursorRef.value.getBoundingClientRect();
  4243. eventBus.emit(CMD.SHOW_CALL, { show: true, top: r2.top, left: r2.left, text });
  4244. eventBus.off(CMD.SET_CALL);
  4245. eventBus.on(CMD.SET_CALL, (e2) => {
  4246. let cursorPos = txtRef.value.selectionStart;
  4247. let start = content.value.slice(0, cursorPos);
  4248. let end = content.value.slice(cursorPos, content.value.length);
  4249. let lastCallPos = start.lastIndexOf("@");
  4250. start = content.value.slice(0, lastCallPos + 1);
  4251. if (e2 === "管理员") {
  4252. e2 = "Livid @Kai @Olivia @GordianZ @sparanoid @drymonfidelia";
  4253. }
  4254. if (e2 === "所有人") {
  4255. e2 = allReplyUsers.value.map((v, i) => {
  4256. if (i)
  4257. return "@" + v;
  4258. else
  4259. return v;
  4260. }).join(" ");
  4261. }
  4262. content.value = start + e2 + " " + end;
  4263. let moveCursorPos = start.length + e2.length + 1;
  4264. setTimeout(() => {
  4265. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  4266. checkHeight2();
  4267. });
  4268. eventBus.off(CMD.SET_CALL);
  4269. });
  4270. }
  4271. function onKeydown(e2) {
  4272. let code = e2.keyCode;
  4273. switch (code) {
  4274. case 8:
  4275. if (content.value === "@") {
  4276. off();
  4277. }
  4278. break;
  4279. case 37:
  4280. case 38:
  4281. case 39:
  4282. case 40:
  4283. setTimeout(() => onInput({ data: "" }), 100);
  4284. break;
  4285. case 27:
  4286. e2.preventDefault();
  4287. e2.stopPropagation();
  4288. e2.stopImmediatePropagation();
  4289. return false;
  4290. case 13:
  4291. if (e2.ctrlKey)
  4292. submit();
  4293. if (e2.metaKey)
  4294. submit();
  4295. break;
  4296. }
  4297. }
  4298. function onInput(e2) {
  4299. let cursorPos = txtRef.value.selectionStart;
  4300. if (!content.value)
  4301. return;
  4302. if (e2.data === " ") {
  4303. return off();
  4304. }
  4305. if (e2.data === "@") {
  4306. if (content.value.length !== 1) {
  4307. if (content.value[cursorPos - 2] === " " || content.value[cursorPos - 2] === "\n") {
  4308. return showCallPopover("");
  4309. }
  4310. } else {
  4311. return showCallPopover("");
  4312. }
  4313. off();
  4314. } else {
  4315. checkHeight2();
  4316. let judgeStr = content.value.slice(0, cursorPos);
  4317. let lastCallPos = judgeStr.lastIndexOf("@");
  4318. if (lastCallPos === -1) {
  4319. return off();
  4320. }
  4321. let callStr = judgeStr.slice(lastCallPos, cursorPos);
  4322. let hasSpace = callStr.includes(" ");
  4323. if (hasSpace) {
  4324. off();
  4325. } else {
  4326. if (lastCallPos === 0) {
  4327. return showCallPopover(callStr.replace("@", ""));
  4328. }
  4329. if (content.value.length !== 1) {
  4330. if (content.value[lastCallPos - 1] === " " || content.value[lastCallPos - 1] === "\n") {
  4331. return showCallPopover(callStr.replace("@", ""));
  4332. }
  4333. } else {
  4334. return showCallPopover(callStr.replace("@", ""));
  4335. }
  4336. off();
  4337. }
  4338. }
  4339. }
  4340. function onPaste(e2) {
  4341. const dataTransferItemList = e2.clipboardData.items;
  4342. const items = [].slice.call(dataTransferItemList).filter(function(item) {
  4343. return item.type.indexOf("image") !== -1;
  4344. });
  4345. if (items.length === 0) {
  4346. return;
  4347. }
  4348. const dataTransferItem = items[0];
  4349. const blob = dataTransferItem.getAsFile();
  4350. upload(blob);
  4351. }
  4352. function onBlur() {
  4353. document.removeEventListener("paste", onPaste);
  4354. isFocus.value = false;
  4355. }
  4356. function onFocusin() {
  4357. document.addEventListener("paste", onPaste);
  4358. }
  4359. vue.watch(() => show, (n2) => {
  4360. if (n2.value)
  4361. isShowEmoticons.value = false;
  4362. }, { deep: true });
  4363. vue.onMounted(() => {
  4364. $(`.${editorId.value}`).each(function() {
  4365. this.setAttribute("style", "height:" + this.scrollHeight + "px;overflow-y:hidden;");
  4366. }).on("input", function() {
  4367. this.style.height = 0;
  4368. this.style.height = this.scrollHeight + "px";
  4369. });
  4370. if (useType === "reply-comment") {
  4371. txtRef.value && txtRef.value.focus();
  4372. }
  4373. });
  4374. vue.onBeforeUnmount(() => {
  4375. $(`.${editorId.value}`).off();
  4376. });
  4377. return (_ctx, _cache) => {
  4378. return vue.openBlock(), vue.createElementBlock("div", {
  4379. class: vue.normalizeClass(["post-editor-wrapper", editorClass.value])
  4380. }, [
  4381. vue.withDirectives(vue.createElementVNode("textarea", {
  4382. class: vue.normalizeClass(["post-editor", editorId.value]),
  4383. ref_key: "txtRef",
  4384. ref: txtRef,
  4385. onFocus: _cache[0] || (_cache[0] = ($event) => vue.isRef(isFocus) ? isFocus.value = true : isFocus = true),
  4386. onBlur,
  4387. onFocusin,
  4388. placeholder: "请尽量让自己的回复能够对别人有帮助",
  4389. onInput,
  4390. onKeydown,
  4391. onDrop: drop,
  4392. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => content.value = $event)
  4393. }, null, 34), [
  4394. [vue.vModelText, content.value]
  4395. ]),
  4396. vue.createElementVNode("div", _hoisted_1$c, [
  4397. vue.createElementVNode("span", { innerHTML: cursorHtml.value }, null, 8, _hoisted_2$9),
  4398. vue.createElementVNode("span", {
  4399. class: "cursor",
  4400. ref_key: "cursorRef",
  4401. ref: cursorRef
  4402. }, "|", 512)
  4403. ]),
  4404. vue.createElementVNode("div", _hoisted_3$8, [
  4405. vue.createElementVNode("div", _hoisted_4$8, [
  4406. vue.createVNode(vue.unref(Icon), {
  4407. onClick: vue.withModifiers(showEmoticons, ["stop"]),
  4408. icon: "streamline:smiley-happy"
  4409. }),
  4410. vue.createElementVNode("div", _hoisted_5$6, [
  4411. vue.createElementVNode("input", {
  4412. type: "file",
  4413. accept: "image/*",
  4414. onChange: _cache[2] || (_cache[2] = (e2) => upload(e2.currentTarget.files[0]))
  4415. }, null, 32),
  4416. vue.createVNode(vue.unref(Icon), { icon: "lets-icons:img-load-box-fill" })
  4417. ]),
  4418. uploadLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$6, "上传中.....")) : vue.createCommentVNode("", true)
  4419. ]),
  4420. vue.createElementVNode("div", _hoisted_7$5, [
  4421. vue.unref(useType) === "reply-comment" ? (vue.openBlock(), vue.createBlock(BaseButton, {
  4422. key: 0,
  4423. type: "link",
  4424. size: "small",
  4425. style: { "margin-right": "1rem", "cursor": "pointer" },
  4426. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => emits("close"), ["stop"]))
  4427. }, {
  4428. default: vue.withCtx(() => [
  4429. vue.createTextVNode(" 关闭 ")
  4430. ]),
  4431. _: 1
  4432. })) : vue.createCommentVNode("", true),
  4433. vue.createVNode(BaseButton, {
  4434. size: "small",
  4435. disabled: disabled.value,
  4436. loading: loading.value,
  4437. onClick: vue.withModifiers(submit, ["stop"])
  4438. }, {
  4439. default: vue.withCtx(() => [
  4440. vue.createTextVNode("回复 ")
  4441. ]),
  4442. _: 1
  4443. }, 8, ["disabled", "loading"])
  4444. ])
  4445. ]),
  4446. vue.withDirectives(vue.createElementVNode("div", {
  4447. class: "emoticon-pack",
  4448. ref_key: "emoticonsRef",
  4449. ref: emoticonsRef
  4450. }, [
  4451. vue.createVNode(vue.unref(Icon), {
  4452. icon: "ic:round-close",
  4453. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => isShowEmoticons.value = false, ["stop"]))
  4454. }),
  4455. _hoisted_8$5,
  4456. vue.createElementVNode("div", _hoisted_9$5, [
  4457. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(classicsEmoticons), (item) => {
  4458. return vue.openBlock(), vue.createElementBlock("img", {
  4459. src: getEmojiSrc(item.high),
  4460. referrerpolicy: "no-referrer",
  4461. onClick: vue.withModifiers(($event) => {
  4462. insert(item.name);
  4463. isShowEmoticons.value = false;
  4464. }, ["stop"])
  4465. }, null, 8, _hoisted_10$5);
  4466. }), 256))
  4467. ]),
  4468. vue.createElementVNode("div", _hoisted_11$5, [
  4469. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(emojiEmoticons), (item) => {
  4470. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  4471. vue.createElementVNode("div", _hoisted_12$5, vue.toDisplayString(item.title), 1),
  4472. vue.createElementVNode("div", _hoisted_13$5, [
  4473. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.list, (emoji) => {
  4474. return vue.openBlock(), vue.createElementBlock("span", {
  4475. onClick: vue.withModifiers(($event) => {
  4476. insert(emoji);
  4477. isShowEmoticons.value = false;
  4478. }, ["stop"])
  4479. }, vue.toDisplayString(emoji), 9, _hoisted_14$4);
  4480. }), 256))
  4481. ])
  4482. ], 64);
  4483. }), 256))
  4484. ])
  4485. ], 512), [
  4486. [vue.vShow, isShowEmoticons.value]
  4487. ])
  4488. ], 2);
  4489. };
  4490. }
  4491. };
  4492. const PostEditor = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-85e09b4e"]]);
  4493. const _hoisted_1$b = {
  4494. key: 0,
  4495. class: "html-wrapper"
  4496. };
  4497. const _hoisted_2$8 = ["innerHTML"];
  4498. const checkHeight = 900;
  4499. const _sfc_main$b = {
  4500. __name: "BaseHtmlRender",
  4501. props: ["html"],
  4502. setup(__props) {
  4503. const config2 = vue.inject("config");
  4504. const props = __props;
  4505. const contentRef = vue.ref(null);
  4506. const mask = vue.ref(false);
  4507. const handOpen = vue.ref(false);
  4508. function mouseup(e2) {
  4509. if (!config2.value.base64)
  4510. return;
  4511. let selectionText = window.getSelection().toString();
  4512. if (selectionText) {
  4513. let r2 = selectionText.match(/([A-Za-z0-9+/=]+)/g);
  4514. if (r2) {
  4515. if (r2[0].length < 4)
  4516. return;
  4517. eventBus.emit(CMD.SHOW_TOOLTIP, { text: r2[0], e: e2 });
  4518. }
  4519. }
  4520. }
  4521. vue.watch(config2.value, (newVale) => {
  4522. if (!newVale.contentAutoCollapse) {
  4523. mask.value = false;
  4524. }
  4525. });
  4526. vue.watch([() => contentRef.value, () => props.html], () => {
  4527. if (!contentRef.value || !props.html)
  4528. return;
  4529. if (!config2.value.contentAutoCollapse)
  4530. return;
  4531. contentRef.value.querySelectorAll("img").forEach((item) => {
  4532. item.removeEventListener("load", checkContentHeight);
  4533. item.addEventListener("load", checkContentHeight);
  4534. });
  4535. checkContentHeight();
  4536. }, { immediate: true, flush: "post" });
  4537. function checkContentHeight() {
  4538. if (handOpen.value)
  4539. return;
  4540. if (!contentRef.value)
  4541. return;
  4542. let rect = contentRef.value.getBoundingClientRect();
  4543. mask.value = rect.height >= checkHeight;
  4544. }
  4545. return (_ctx, _cache) => {
  4546. return props.html ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
  4547. vue.createElementVNode("div", {
  4548. class: vue.normalizeClass({ mask: mask.value })
  4549. }, [
  4550. vue.createElementVNode("div", {
  4551. ref_key: "contentRef",
  4552. ref: contentRef,
  4553. innerHTML: props.html,
  4554. onMouseup: mouseup
  4555. }, null, 40, _hoisted_2$8)
  4556. ], 2),
  4557. mask.value ? (vue.openBlock(), vue.createElementBlock("div", {
  4558. key: 0,
  4559. class: "expand",
  4560. onClick: _cache[0] || (_cache[0] = ($event) => {
  4561. mask.value = false;
  4562. handOpen.value = true;
  4563. })
  4564. }, "展开")) : vue.createCommentVNode("", true)
  4565. ])) : vue.createCommentVNode("", true);
  4566. };
  4567. }
  4568. };
  4569. const BaseHtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-6f61a860"]]);
  4570. const _sfc_main$a = {
  4571. name: "TopSubComment",
  4572. components: { BaseHtmlRender, Author, PostEditor, Point, Icon },
  4573. inject: ["post", "postDetailWidth", "show", "isNight", "isLogin", "tags", "config"],
  4574. props: {
  4575. modelValue: {
  4576. reply_content: ""
  4577. },
  4578. level: -1
  4579. },
  4580. data() {
  4581. return {
  4582. expand: true,
  4583. edit: false,
  4584. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  4585. floor: this.modelValue.floor
  4586. };
  4587. },
  4588. watch: {
  4589. show(e2) {
  4590. if (e2) {
  4591. this.edit = false;
  4592. }
  4593. }
  4594. },
  4595. computed: {
  4596. myTags() {
  4597. return this.tags[this.modelValue.username] ?? [];
  4598. }
  4599. },
  4600. methods: {
  4601. jump() {
  4602. eventBus.emit(CMD.JUMP, this.modelValue.floor);
  4603. }
  4604. }
  4605. };
  4606. const _withScopeId$7 = (n2) => (vue.pushScopeId("data-v-d3f8c94b"), n2 = n2(), vue.popScopeId(), n2);
  4607. const _hoisted_1$a = ["data-floor"];
  4608. const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "left expand-line" }, null, -1));
  4609. const _hoisted_3$7 = { class: "right" };
  4610. const _hoisted_4$7 = { class: "simple-wrapper" };
  4611. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  4612. const _component_Author = vue.resolveComponent("Author");
  4613. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  4614. const _component_PostEditor = vue.resolveComponent("PostEditor");
  4615. const _component_TopSubComment = vue.resolveComponent("TopSubComment", true);
  4616. return vue.openBlock(), vue.createElementBlock("div", {
  4617. class: vue.normalizeClass(["top-sub-comment", $props.level === 1 && "top-sub-reply"]),
  4618. ref: "comment",
  4619. "data-floor": $data.floor
  4620. }, [
  4621. _hoisted_2$7,
  4622. vue.createElementVNode("div", _hoisted_3$7, [
  4623. vue.createVNode(_component_Author, {
  4624. modelValue: $data.expand,
  4625. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  4626. comment: $props.modelValue,
  4627. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  4628. type: "top"
  4629. }, null, 8, ["modelValue", "comment"]),
  4630. vue.createVNode(_component_BaseHtmlRender, {
  4631. class: "top-reply_content reply_content",
  4632. html: $props.modelValue.hideCallUserReplyContent
  4633. }, null, 8, ["html"]),
  4634. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  4635. key: 0,
  4636. onClose: _cache[2] || (_cache[2] = ($event) => $data.edit = false),
  4637. replyInfo: $data.replyInfo,
  4638. replyUser: $props.modelValue.username,
  4639. replyFloor: $props.modelValue.floor
  4640. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true),
  4641. vue.createElementVNode("div", _hoisted_4$7, [
  4642. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  4643. return vue.openBlock(), vue.createBlock(_component_TopSubComment, {
  4644. modelValue: $props.modelValue.children[index],
  4645. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4646. key: index
  4647. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4648. }), 128))
  4649. ])
  4650. ])
  4651. ], 10, _hoisted_1$a);
  4652. }
  4653. const TopSubComment = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$5], ["__scopeId", "data-v-d3f8c94b"]]);
  4654. const _sfc_main$9 = {
  4655. name: "Comment",
  4656. components: { BaseHtmlRender, Author, PostEditor, Point, Icon, TopSubComment },
  4657. inject: ["post", "postDetailWidth", "show", "isNight", "config"],
  4658. props: {
  4659. modelValue: {
  4660. reply_content: ""
  4661. },
  4662. type: {
  4663. type: String,
  4664. default() {
  4665. return "list";
  4666. }
  4667. }
  4668. },
  4669. data() {
  4670. return {
  4671. edit: false,
  4672. ding: false,
  4673. expand: true,
  4674. expandTopReply: true,
  4675. expandWrong: false,
  4676. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  4677. cssStyle: null,
  4678. floor: this.modelValue.floor
  4679. };
  4680. },
  4681. watch: {
  4682. show(e2) {
  4683. if (e2) {
  4684. this.edit = false;
  4685. }
  4686. },
  4687. postDetailWidth(n2, o) {
  4688. this.checkIsTooLong(n2);
  4689. }
  4690. },
  4691. computed: {
  4692. CommentDisplayType() {
  4693. return CommentDisplayType;
  4694. },
  4695. myClass() {
  4696. return {
  4697. isOp: this.modelValue.isOp,
  4698. isSimple: this.config.viewType === "simple",
  4699. ding: this.ding,
  4700. isLevelOne: this.type === "top" ? true : this.modelValue.level === 0,
  4701. ["c_" + this.floor]: this.type !== "top"
  4702. };
  4703. }
  4704. },
  4705. mounted() {
  4706. this.checkIsTooLong(this.postDetailWidth);
  4707. },
  4708. methods: {
  4709. checkIsTooLong(postDetailWidth) {
  4710. if (postDetailWidth !== 0) {
  4711. let rect = this.$refs.comment.getBoundingClientRect();
  4712. let ban = postDetailWidth * 0.6;
  4713. if (ban < rect.width && rect.width < ban + 25 && this.modelValue.children.length) {
  4714. this.expand = false;
  4715. let padding = 2;
  4716. this.cssStyle = {
  4717. padding: "1rem 0",
  4718. width: `calc(${postDetailWidth}px - ${padding}rem)`,
  4719. transform: `translateX(calc(${rect.width - postDetailWidth}px + ${padding}rem))`,
  4720. background: this.isNight ? "#18222d" : "white"
  4721. };
  4722. }
  4723. }
  4724. },
  4725. //高亮一下
  4726. showDing() {
  4727. this.ding = true;
  4728. setTimeout(() => {
  4729. this.ding = false;
  4730. }, 2e3);
  4731. },
  4732. hide() {
  4733. let url = `${location.origin}/ignore/reply/${this.modelValue.id}?once=${this.post.once}`;
  4734. eventBus.emit(CMD.REMOVE, this.modelValue.floor);
  4735. $.post(url).then((res) => {
  4736. eventBus.emit(CMD.REFRESH_ONCE);
  4737. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "隐藏成功" });
  4738. }, (err) => {
  4739. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "隐藏成功,仅本次有效(接口调用失败!)" });
  4740. });
  4741. },
  4742. toggle() {
  4743. this.expand = !this.expand;
  4744. },
  4745. jump() {
  4746. eventBus.emit(CMD.JUMP, this.modelValue.floor);
  4747. }
  4748. }
  4749. };
  4750. const _withScopeId$6 = (n2) => (vue.pushScopeId("data-v-dd44e74f"), n2 = n2(), vue.popScopeId(), n2);
  4751. const _hoisted_1$9 = ["data-floor"];
  4752. const _hoisted_2$6 = { class: "comment-content" };
  4753. const _hoisted_3$6 = { class: "right" };
  4754. const _hoisted_4$6 = { class: "w" };
  4755. const _hoisted_5$5 = {
  4756. key: 0,
  4757. class: "wrong-wrapper"
  4758. };
  4759. const _hoisted_6$5 = ["href"];
  4760. const _hoisted_7$4 = { class: "del-line" };
  4761. const _hoisted_8$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("i", {
  4762. class: "fa fa-question-circle-o wrong-icon",
  4763. "aria-hidden": "true"
  4764. }, null, -1));
  4765. const _hoisted_9$4 = {
  4766. key: 0,
  4767. class: "warning"
  4768. };
  4769. const _hoisted_10$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4770. const _hoisted_11$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4771. const _hoisted_12$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4772. const _hoisted_13$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4773. const _hoisted_14$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4774. const _hoisted_15$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("a", {
  4775. href: "https://github.com/zyronon/V2Next/issues",
  4776. target: "_blank"
  4777. }, "这里", -1));
  4778. const _hoisted_16$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "gang" }, null, -1));
  4779. const _hoisted_17$3 = { class: "simple-wrapper" };
  4780. const _hoisted_18$3 = {
  4781. key: 0,
  4782. class: "top-reply-wrap"
  4783. };
  4784. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  4785. const _component_Author = vue.resolveComponent("Author");
  4786. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  4787. const _component_PostEditor = vue.resolveComponent("PostEditor");
  4788. const _component_Icon = vue.resolveComponent("Icon");
  4789. const _component_TopSubComment = vue.resolveComponent("TopSubComment");
  4790. const _component_Comment = vue.resolveComponent("Comment", true);
  4791. return vue.openBlock(), vue.createElementBlock("div", {
  4792. class: vue.normalizeClass(["comment", $options.myClass]),
  4793. ref: "comment",
  4794. "data-floor": $data.floor
  4795. }, [
  4796. vue.createVNode(_component_Author, {
  4797. modelValue: $data.expand,
  4798. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  4799. comment: $props.modelValue,
  4800. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  4801. type: $props.type,
  4802. onHide: $options.hide
  4803. }, null, 8, ["modelValue", "comment", "type", "onHide"]),
  4804. $data.cssStyle && !$data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4805. key: 0,
  4806. class: "more ago",
  4807. onClick: _cache[2] || (_cache[2] = ($event) => $data.expand = !$data.expand)
  4808. }, " 由于嵌套回复层级太深,自动将后续回复隐藏 ")) : vue.createCommentVNode("", true),
  4809. $data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4810. key: 1,
  4811. class: "comment-content-w",
  4812. style: vue.normalizeStyle($data.cssStyle)
  4813. }, [
  4814. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4815. key: 0,
  4816. class: "more ago",
  4817. onClick: _cache[3] || (_cache[3] = ($event) => $data.expand = !$data.expand)
  4818. }, " 由于嵌套回复层级太深,自动将以下回复移至可见范围 ")) : vue.createCommentVNode("", true),
  4819. vue.createElementVNode("div", _hoisted_2$6, [
  4820. vue.createElementVNode("div", {
  4821. class: "left expand-line",
  4822. onClick: _cache[4] || (_cache[4] = (...args) => $options.toggle && $options.toggle(...args))
  4823. }),
  4824. vue.createElementVNode("div", _hoisted_3$6, [
  4825. vue.createElementVNode("div", _hoisted_4$6, [
  4826. $props.modelValue.isWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
  4827. vue.createElementVNode("span", {
  4828. onClick: _cache[5] || (_cache[5] = ($event) => $data.expandWrong = !$data.expandWrong),
  4829. title: "点击楼层号查看提示"
  4830. }, [
  4831. vue.createElementVNode("a", {
  4832. href: "/member/" + $props.modelValue.replyUsers[0]
  4833. }, "@" + vue.toDisplayString($props.modelValue.replyUsers[0]) + "  ", 9, _hoisted_6$5),
  4834. vue.createElementVNode("span", _hoisted_7$4, "#" + vue.toDisplayString($props.modelValue.replyFloor), 1),
  4835. _hoisted_8$4
  4836. ]),
  4837. $data.expandWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$4, [
  4838. vue.createTextVNode(" 这条回复似乎有点问题,指定的楼层号与@的人对应不上 "),
  4839. _hoisted_10$4,
  4840. vue.createTextVNode(" 原因可能有下面几种: "),
  4841. _hoisted_11$4,
  4842. vue.createTextVNode(" 一、屏蔽用户导致楼层塌陷:你屏蔽了A,自A以后的回复的楼层号都会减1 "),
  4843. _hoisted_12$4,
  4844. vue.createTextVNode(" 二、忽略回复导致楼层塌陷:原理同上 "),
  4845. _hoisted_13$4,
  4846. vue.createTextVNode(" 三、层主回复时指定错了楼层号(同一,层主屏蔽了别人,导致楼层塌陷) "),
  4847. _hoisted_14$3,
  4848. vue.createTextVNode(" 四、脚本解析错误,请在 "),
  4849. _hoisted_15$3,
  4850. vue.createTextVNode("反馈 ")
  4851. ])) : vue.createCommentVNode("", true)
  4852. ])) : vue.createCommentVNode("", true),
  4853. $options.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNoCallUser && $props.type !== "top" ? (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4854. key: 1,
  4855. class: "reply_content",
  4856. html: $props.modelValue.hideCallUserReplyContent
  4857. }, null, 8, ["html"])) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4858. key: 2,
  4859. class: "reply_content",
  4860. html: $props.modelValue.reply_content
  4861. }, null, 8, ["html"])),
  4862. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  4863. key: 3,
  4864. onClose: _cache[6] || (_cache[6] = ($event) => $data.edit = false),
  4865. replyInfo: $data.replyInfo,
  4866. replyUser: $props.modelValue.username,
  4867. replyFloor: $props.modelValue.floor
  4868. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true),
  4869. $props.type === "top" && $props.modelValue.replyCount ? (vue.openBlock(), vue.createElementBlock("div", {
  4870. key: 4,
  4871. class: "reply-count",
  4872. onClick: _cache[7] || (_cache[7] = ($event) => $data.expandTopReply = !$data.expandTopReply)
  4873. }, [
  4874. _hoisted_16$3,
  4875. vue.createElementVNode("span", null, " 共有" + vue.toDisplayString($props.modelValue.replyCount) + " 条回复 ", 1),
  4876. $data.expandTopReply ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  4877. key: 0,
  4878. icon: "ep:arrow-up-bold"
  4879. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  4880. key: 1,
  4881. icon: "ep:arrow-down-bold"
  4882. }))
  4883. ])) : vue.createCommentVNode("", true)
  4884. ]),
  4885. vue.createElementVNode("div", _hoisted_17$3, [
  4886. $props.type === "top" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  4887. $data.expandTopReply && $props.modelValue.replyCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$3, [
  4888. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  4889. return vue.openBlock(), vue.createBlock(_component_TopSubComment, {
  4890. level: 1,
  4891. modelValue: $props.modelValue.children[index],
  4892. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4893. key: index
  4894. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4895. }), 128))
  4896. ])) : vue.createCommentVNode("", true)
  4897. ], 64)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList($props.modelValue.children, (item, index) => {
  4898. return vue.openBlock(), vue.createBlock(_component_Comment, {
  4899. modelValue: $props.modelValue.children[index],
  4900. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4901. key: index
  4902. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4903. }), 128))
  4904. ])
  4905. ])
  4906. ]),
  4907. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4908. key: 1,
  4909. class: "more ago",
  4910. onClick: _cache[8] || (_cache[8] = ($event) => $data.expand = !$data.expand)
  4911. }, " 由于嵌套回复层级太深,自动将以上回复移至可见范围 ")) : vue.createCommentVNode("", true)
  4912. ], 4)) : vue.createCommentVNode("", true)
  4913. ], 10, _hoisted_1$9);
  4914. }
  4915. const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$4], ["__scopeId", "data-v-dd44e74f"]]);
  4916. const _sfc_main$8 = {
  4917. name: "Toolbar",
  4918. components: { Icon, BaseLoading },
  4919. inject: [
  4920. "isLogin",
  4921. "post",
  4922. "pageType"
  4923. ],
  4924. data() {
  4925. return {
  4926. timer: null,
  4927. loading: false,
  4928. loading2: false,
  4929. loading3: false
  4930. };
  4931. },
  4932. methods: {
  4933. checkIsLogin(emitName = "") {
  4934. if (!this.isLogin) {
  4935. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录(不可用)!" });
  4936. return false;
  4937. }
  4938. this.$emit(emitName);
  4939. return true;
  4940. },
  4941. tweet() {
  4942. var _a;
  4943. let username = ((_a = window.user) == null ? void 0 : _a.username) ?? "";
  4944. let url = `https://twitter.com/intent/tweet?url=${location.origin}/t/${this.post.id}?r=${username}&related=v2ex&text=${this.post.title}`;
  4945. window.open(url, "_blank", "width=550,height=370");
  4946. },
  4947. async report() {
  4948. if (!this.checkIsLogin())
  4949. return;
  4950. if (this.loading3)
  4951. return;
  4952. let isReport = this.post.isReport;
  4953. if (isReport) {
  4954. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4955. return;
  4956. }
  4957. let url = `${location.origin}/report/topic/${this.post.id}?once=${this.post.once}`;
  4958. this.loading3 = true;
  4959. let apiRes = await fetch(url);
  4960. this.loading3 = false;
  4961. if (apiRes.redirected) {
  4962. let htmlText = await apiRes.text();
  4963. if (htmlText.search("你已对本主题进行了报告")) {
  4964. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4965. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4966. eventBus.emit(CMD.MERGE, { isReport: !isReport });
  4967. return;
  4968. }
  4969. }
  4970. eventBus.emit(CMD.REFRESH_ONCE);
  4971. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败,请重试" });
  4972. },
  4973. async toggleIgnore() {
  4974. if (!this.checkIsLogin())
  4975. return;
  4976. let url = `${location.origin}/${this.post.isIgnore ? "unignore" : "ignore"}/topic/${this.post.id}?once=${this.post.once}`;
  4977. if (this.pageType === PageType.Post) {
  4978. this.loading2 = true;
  4979. let apiRes = await fetch(url);
  4980. if (apiRes.redirected) {
  4981. if (!this.post.isIgnore) {
  4982. window.location = location.origin;
  4983. }
  4984. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  4985. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  4986. } else {
  4987. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略失败" });
  4988. }
  4989. this.loading2 = false;
  4990. } else {
  4991. if (this.post.isIgnore) {
  4992. this.loading2 = true;
  4993. } else {
  4994. eventBus.emit(CMD.IGNORE);
  4995. }
  4996. let apiRes = await fetch(url);
  4997. if (apiRes.redirected) {
  4998. if (this.post.isIgnore) {
  4999. eventBus.emit(CMD.REFRESH_ONCE);
  5000. }
  5001. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  5002. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  5003. } else {
  5004. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略成功,仅本次有效(接口调用失败!)" });
  5005. }
  5006. this.loading2 = false;
  5007. }
  5008. },
  5009. async toggleFavorite() {
  5010. if (!this.checkIsLogin())
  5011. return;
  5012. if (this.loading)
  5013. return;
  5014. let isFavorite = this.post.isFavorite;
  5015. if (!isFavorite && config.collectBrowserNotice) {
  5016. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "别忘记按Command/Cmd/CTRL + D添加到书签哦" });
  5017. }
  5018. let url = `${location.origin}/${isFavorite ? "unfavorite" : "favorite"}/topic/${this.post.id}?once=${this.post.once}`;
  5019. this.loading = true;
  5020. let apiRes = await fetch(url);
  5021. this.loading = false;
  5022. if (apiRes.redirected) {
  5023. let htmlText = await apiRes.text();
  5024. if (htmlText.search(isFavorite ? "加入收藏" : "取消收藏")) {
  5025. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isFavorite ? "取消成功" : "收藏成功" });
  5026. eventBus.emit(CMD.MERGE, { collectCount: isFavorite ? this.post.collectCount - 1 : this.post.collectCount + 1 });
  5027. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  5028. eventBus.emit(CMD.MERGE, { isFavorite: !isFavorite });
  5029. return;
  5030. }
  5031. }
  5032. eventBus.emit(CMD.REFRESH_ONCE);
  5033. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败" });
  5034. }
  5035. }
  5036. };
  5037. const _withScopeId$5 = (n2) => (vue.pushScopeId("data-v-30dac564"), n2 = n2(), vue.popScopeId(), n2);
  5038. const _hoisted_1$8 = { class: "toolbar" };
  5039. const _hoisted_2$5 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  5040. const _hoisted_3$5 = {
  5041. key: 0,
  5042. class: "tool no-hover"
  5043. };
  5044. const _hoisted_4$5 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "Tweet", -1));
  5045. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  5046. const _component_Icon = vue.resolveComponent("Icon");
  5047. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  5048. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
  5049. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  5050. vue.createElementVNode("div", {
  5051. class: "tool",
  5052. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => $options.checkIsLogin("reply"), ["stop"]))
  5053. }, [
  5054. vue.createVNode(_component_Icon, { icon: "mynaui:message" }),
  5055. _hoisted_2$5
  5056. ]),
  5057. vue.createElementVNode("div", {
  5058. class: vue.normalizeClass(["tool", { disabled: $data.loading }]),
  5059. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.toggleFavorite && $options.toggleFavorite(...args), ["stop"]))
  5060. }, [
  5061. $data.loading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5062. key: 0,
  5063. size: "small"
  5064. })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  5065. $options.post.isFavorite ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  5066. key: 0,
  5067. color: "rgb(224,42,42)",
  5068. icon: "iconoir:star-solid"
  5069. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5070. key: 1,
  5071. icon: "iconoir:star"
  5072. }))
  5073. ], 64)),
  5074. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isFavorite ? "取消" : "") + "收藏", 1)
  5075. ], 2),
  5076. $options.post.collectCount !== 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$5, [
  5077. vue.createElementVNode("span", null, vue.toDisplayString($options.post.collectCount + "人收藏"), 1)
  5078. ])) : vue.createCommentVNode("", true),
  5079. vue.createElementVNode("div", {
  5080. class: "tool",
  5081. onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.tweet && $options.tweet(...args), ["stop"]))
  5082. }, [
  5083. vue.createVNode(_component_Icon, { icon: "uil:share" }),
  5084. _hoisted_4$5
  5085. ]),
  5086. vue.createElementVNode("div", {
  5087. class: vue.normalizeClass(["tool", { "disabled": $data.loading2 }]),
  5088. onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.toggleIgnore && $options.toggleIgnore(...args), ["stop"]))
  5089. }, [
  5090. $data.loading2 ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5091. key: 0,
  5092. size: "small"
  5093. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5094. key: 1,
  5095. icon: "fluent:eye-hide-24-regular"
  5096. })),
  5097. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isIgnore ? "取消忽略" : "忽略"), 1)
  5098. ], 2),
  5099. vue.createElementVNode("div", {
  5100. class: vue.normalizeClass(["tool", { "disabled": $data.loading3 }]),
  5101. onClick: _cache[4] || (_cache[4] = vue.withModifiers((...args) => $options.report && $options.report(...args), ["stop"]))
  5102. }, [
  5103. $data.loading3 ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5104. key: 0,
  5105. size: "small"
  5106. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5107. key: 1,
  5108. class: "black",
  5109. icon: "solar:danger-triangle-outline"
  5110. })),
  5111. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isReport ? "你已对本主题进行了报告" : "报告"), 1)
  5112. ], 2)
  5113. ]);
  5114. }
  5115. const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$3], ["__scopeId", "data-v-30dac564"]]);
  5116. const _withScopeId$4 = (n2) => (vue.pushScopeId("data-v-4a063111"), n2 = n2(), vue.popScopeId(), n2);
  5117. const _hoisted_1$7 = ["href"];
  5118. const _hoisted_2$4 = ["src"];
  5119. const _hoisted_3$4 = { class: "texts" };
  5120. const _hoisted_4$4 = {
  5121. key: 0,
  5122. class: "point"
  5123. };
  5124. const _hoisted_5$4 = { class: "link-num" };
  5125. const _hoisted_6$4 = { class: "my-tag" };
  5126. const _hoisted_7$3 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5127. const _hoisted_8$3 = {
  5128. key: 2,
  5129. class: "ago"
  5130. };
  5131. const _hoisted_9$3 = {
  5132. key: 3,
  5133. class: "mod"
  5134. };
  5135. const _hoisted_10$3 = {
  5136. key: 4,
  5137. class: "owner"
  5138. };
  5139. const _hoisted_11$3 = ["href"];
  5140. const _hoisted_12$3 = {
  5141. key: 5,
  5142. class: "owner"
  5143. };
  5144. const _hoisted_13$3 = {
  5145. key: 6,
  5146. class: "mod"
  5147. };
  5148. const _hoisted_14$2 = {
  5149. key: 7,
  5150. class: "ago"
  5151. };
  5152. const _hoisted_15$2 = { class: "my-tag" };
  5153. const _hoisted_16$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5154. const _hoisted_17$2 = {
  5155. key: 9,
  5156. class: "point"
  5157. };
  5158. const _hoisted_18$2 = { class: "link-num" };
  5159. const _hoisted_19$2 = ["href"];
  5160. const _hoisted_20$2 = ["src"];
  5161. const _hoisted_21$2 = { class: "Author-right" };
  5162. const _hoisted_22$2 = { class: "floor" };
  5163. const _hoisted_23$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  5164. const _hoisted_24$1 = [
  5165. _hoisted_23$2
  5166. ];
  5167. const _sfc_main$7 = {
  5168. __name: "SingleComment",
  5169. props: {
  5170. comment: {
  5171. reply_content: ""
  5172. },
  5173. isRight: {
  5174. type: Boolean,
  5175. default() {
  5176. return false;
  5177. }
  5178. }
  5179. },
  5180. setup(__props) {
  5181. const config2 = vue.inject("config");
  5182. const isLogin = vue.inject("isLogin");
  5183. const tags = vue.inject("tags");
  5184. const props = __props;
  5185. const myTags = vue.computed(() => {
  5186. return tags[props.comment.username] ?? [];
  5187. });
  5188. function jump() {
  5189. eventBus.emit(CMD.JUMP, props.comment.floor);
  5190. }
  5191. return (_ctx, _cache) => {
  5192. return vue.openBlock(), vue.createElementBlock("div", {
  5193. class: vue.normalizeClass(["comment", { isSimple: vue.unref(config2).viewType === "simple" }]),
  5194. ref: "comment"
  5195. }, [
  5196. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  5197. key: 0,
  5198. class: "avatar",
  5199. href: `/member/${__props.comment.username}`
  5200. }, [
  5201. vue.createElementVNode("img", {
  5202. src: __props.comment.avatar,
  5203. alt: ""
  5204. }, null, 8, _hoisted_2$4)
  5205. ], 8, _hoisted_1$7)) : vue.createCommentVNode("", true),
  5206. vue.createElementVNode("div", {
  5207. class: vue.normalizeClass(["comment-body", { isRight: __props.isRight }])
  5208. }, [
  5209. vue.createElementVNode("div", _hoisted_3$4, [
  5210. __props.comment.thankCount && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [
  5211. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5212. key: 0,
  5213. color: "rgb(224,42,42)",
  5214. icon: "icon-park-solid:like"
  5215. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5216. key: 1,
  5217. color: !__props.comment.thankCount ? null : "rgb(224,42,42)",
  5218. icon: "icon-park-outline:like"
  5219. }, null, 8, ["color"])),
  5220. vue.createElementVNode("div", _hoisted_5$4, vue.toDisplayString(__props.comment.thankCount), 1)
  5221. ])) : vue.createCommentVNode("", true),
  5222. vue.unref(isLogin) && vue.unref(config2).openTag && __props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(myTags.value, (i) => {
  5223. return vue.openBlock(), vue.createElementBlock("span", _hoisted_6$4, [
  5224. _hoisted_7$3,
  5225. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  5226. ]);
  5227. }), 256)) : vue.createCommentVNode("", true),
  5228. __props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$3, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  5229. __props.comment.isMod && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$3, "MOD")) : vue.createCommentVNode("", true),
  5230. __props.comment.isOp && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$3, "OP")) : vue.createCommentVNode("", true),
  5231. vue.createElementVNode("a", {
  5232. href: `/member/${__props.comment.username}`,
  5233. class: "username"
  5234. }, vue.toDisplayString(__props.comment.username), 9, _hoisted_11$3),
  5235. __props.comment.isOp && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$3, "OP")) : vue.createCommentVNode("", true),
  5236. __props.comment.isMod && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$3, "MOD")) : vue.createCommentVNode("", true),
  5237. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_14$2, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  5238. vue.unref(isLogin) && vue.unref(config2).openTag && !__props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 8 }, vue.renderList(myTags.value, (i) => {
  5239. return vue.openBlock(), vue.createElementBlock("span", _hoisted_15$2, [
  5240. _hoisted_16$2,
  5241. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  5242. ]);
  5243. }), 256)) : vue.createCommentVNode("", true),
  5244. __props.comment.thankCount && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$2, [
  5245. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5246. key: 0,
  5247. color: "rgb(224,42,42)",
  5248. icon: "icon-park-solid:like"
  5249. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5250. key: 1,
  5251. color: !__props.comment.thankCount ? null : "rgb(224,42,42)",
  5252. icon: "icon-park-outline:like"
  5253. }, null, 8, ["color"])),
  5254. vue.createElementVNode("div", _hoisted_18$2, vue.toDisplayString(__props.comment.thankCount), 1)
  5255. ])) : vue.createCommentVNode("", true)
  5256. ]),
  5257. vue.createVNode(BaseHtmlRender, {
  5258. class: "reply_content",
  5259. html: __props.comment.reply_content
  5260. }, null, 8, ["html"])
  5261. ], 2),
  5262. __props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  5263. key: 1,
  5264. class: "avatar",
  5265. href: `/member/${__props.comment.username}`
  5266. }, [
  5267. vue.createElementVNode("img", {
  5268. src: __props.comment.avatar,
  5269. alt: ""
  5270. }, null, 8, _hoisted_20$2)
  5271. ], 8, _hoisted_19$2)) : vue.createCommentVNode("", true),
  5272. vue.createElementVNode("div", _hoisted_21$2, [
  5273. vue.createElementVNode("div", _hoisted_22$2, vue.toDisplayString(__props.comment.floor), 1),
  5274. vue.createElementVNode("div", {
  5275. class: "tool jump",
  5276. onClick: vue.withModifiers(jump, ["stop"])
  5277. }, _hoisted_24$1)
  5278. ])
  5279. ], 2);
  5280. };
  5281. }
  5282. };
  5283. const SingleComment = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-4a063111"]]);
  5284. function _css(el, key, value) {
  5285. const reg = /^-?\d+.?\d*(px|pt|em|rem|vw|vh|%|rpx|ms)$/i;
  5286. if (value === void 0) {
  5287. let val = null;
  5288. if ("getComputedStyle" in window) {
  5289. val = window.getComputedStyle(el, null)[key];
  5290. } else {
  5291. val = el.currentStyle[key];
  5292. }
  5293. return reg.test(val) ? parseFloat(val) : val;
  5294. } else {
  5295. if ([
  5296. "top",
  5297. "left",
  5298. "bottom",
  5299. "right",
  5300. "width",
  5301. "height",
  5302. "font-size",
  5303. "margin",
  5304. "padding"
  5305. ].includes(key)) {
  5306. if (!reg.test(value)) {
  5307. if (!String(value).includes("calc")) {
  5308. value += "px";
  5309. }
  5310. }
  5311. }
  5312. if (key === "transform") {
  5313. el.style.webkitTransform = el.style.MsTransform = el.style.msTransform = el.style.MozTransform = el.style.OTransform = el.style.transform = value;
  5314. } else {
  5315. el.style[key] = value;
  5316. }
  5317. }
  5318. }
  5319. function getImgSize(naturalWidth, naturalHeight, maxWidth, maxHeight) {
  5320. const imgRatio = naturalWidth / naturalHeight;
  5321. const maxRatio = maxWidth / maxHeight;
  5322. let width, height;
  5323. if (imgRatio >= maxRatio) {
  5324. if (naturalWidth > maxWidth) {
  5325. width = maxWidth;
  5326. height = maxWidth / naturalWidth * naturalHeight;
  5327. } else {
  5328. width = naturalWidth;
  5329. height = naturalHeight;
  5330. }
  5331. } else {
  5332. if (naturalHeight > maxHeight) {
  5333. width = maxHeight / naturalHeight * naturalWidth;
  5334. height = maxHeight;
  5335. } else {
  5336. width = naturalWidth;
  5337. height = naturalHeight;
  5338. }
  5339. }
  5340. if (height === 0) {
  5341. height = maxHeight;
  5342. width = height * 1.3;
  5343. } else {
  5344. if (height < 24) {
  5345. height = 50;
  5346. width = height * imgRatio;
  5347. } else if (height < 100) {
  5348. height = 300;
  5349. width = height * imgRatio;
  5350. } else {
  5351. height = maxHeight;
  5352. width = height * imgRatio;
  5353. }
  5354. if (width > maxWidth) {
  5355. width = maxWidth;
  5356. height = width / imgRatio;
  5357. }
  5358. }
  5359. console.log(width, height);
  5360. return { width, height };
  5361. }
  5362. const _sfc_main$6 = {
  5363. name: "detail",
  5364. components: {
  5365. BaseSelect,
  5366. BaseButton,
  5367. SingleComment,
  5368. PopConfirm,
  5369. Comment,
  5370. PostEditor,
  5371. Point,
  5372. Toolbar,
  5373. BaseHtmlRender,
  5374. Tooltip,
  5375. BaseLoading,
  5376. Icon
  5377. },
  5378. inject: ["allReplyUsers", "post", "tags", "isLogin", "config", "pageType", "isNight"],
  5379. provide() {
  5380. return {
  5381. postDetailWidth: vue.computed(() => this.postDetailWidth)
  5382. };
  5383. },
  5384. props: {
  5385. modelValue: {
  5386. type: Boolean,
  5387. default() {
  5388. return false;
  5389. }
  5390. },
  5391. loading: {
  5392. type: Boolean,
  5393. default() {
  5394. return false;
  5395. }
  5396. },
  5397. refreshLoading: {
  5398. type: Boolean,
  5399. default() {
  5400. return false;
  5401. }
  5402. },
  5403. displayType: CommentDisplayType.FloorInFloorNoCallUser
  5404. },
  5405. data() {
  5406. return {
  5407. isSticky: false,
  5408. selectCallIndex: 0,
  5409. postDetailWidth: 0,
  5410. showCallList: false,
  5411. showRelationReply: false,
  5412. replyText: "",
  5413. callStyle: {
  5414. top: 0,
  5415. left: 0
  5416. },
  5417. targetUser: {
  5418. left: [],
  5419. right: "",
  5420. rightFloor: -1
  5421. },
  5422. currentFloor: "",
  5423. showOpTag: false,
  5424. rect: {},
  5425. result: {},
  5426. x: 0,
  5427. y: 0,
  5428. scale: 1,
  5429. minScale: 0.2,
  5430. maxScale: 16,
  5431. preview: {
  5432. rect: {},
  5433. result: {},
  5434. x: 0,
  5435. y: 0,
  5436. scale: 1,
  5437. minScale: 0.2,
  5438. maxScale: 16
  5439. }
  5440. };
  5441. },
  5442. computed: {
  5443. functions() {
  5444. return functions;
  5445. },
  5446. canAppend() {
  5447. if (this.isMy) {
  5448. let create = new Date(this.post.createDate);
  5449. return Date.now() - create.valueOf() > 1e3 * 60 * 30;
  5450. }
  5451. return false;
  5452. },
  5453. canEditMove() {
  5454. if (this.isMy) {
  5455. let create = new Date(this.post.createDate);
  5456. return Date.now() - create.valueOf() < 1e3 * 60 * 10;
  5457. }
  5458. return false;
  5459. },
  5460. isMy() {
  5461. return this.post.member.username === window.user.username;
  5462. },
  5463. myTags() {
  5464. return this.tags[this.post.member.username] ?? [];
  5465. },
  5466. CommentDisplayType() {
  5467. return CommentDisplayType;
  5468. },
  5469. isPost() {
  5470. return this.pageType === PageType.Post;
  5471. },
  5472. filterCallList() {
  5473. if (this.showCallList) {
  5474. let list = ["管理员", "所有人"].concat(this.allReplyUsers);
  5475. if (this.replyText)
  5476. return list.filter((i) => i.search(this.replyText) > -1);
  5477. return list;
  5478. }
  5479. return [];
  5480. },
  5481. replyList() {
  5482. if ([CommentDisplayType.FloorInFloor, CommentDisplayType.FloorInFloorNoCallUser].includes(this.displayType))
  5483. return this.post.nestedReplies;
  5484. if (this.displayType === CommentDisplayType.Like) {
  5485. return functions.clone(this.post.nestedReplies).sort((a, b) => b.thankCount - a.thankCount);
  5486. }
  5487. if (this.displayType === CommentDisplayType.New) {
  5488. return functions.clone(this.post.replyList).reverse();
  5489. }
  5490. if (this.displayType === CommentDisplayType.V2exOrigin)
  5491. return this.post.replyList;
  5492. if (this.displayType === CommentDisplayType.FloorInFloorNested)
  5493. return this.post.nestedRedundReplies;
  5494. if (this.displayType === CommentDisplayType.OnlyOp)
  5495. return this.post.replyList.filter((v) => {
  5496. var _a;
  5497. return v.username === ((_a = this.post.member) == null ? void 0 : _a.username);
  5498. });
  5499. return [];
  5500. },
  5501. //关联回复
  5502. relationReply() {
  5503. if (this.targetUser.left.length && this.targetUser.right) {
  5504. return this.post.replyList.filter((v) => {
  5505. if (this.targetUser.left.concat(this.targetUser.right).includes(v.username)) {
  5506. if (v.floor > this.targetUser.rightFloor) {
  5507. if (v.replyUsers.includes(this.targetUser.right)) {
  5508. return true;
  5509. }
  5510. if (v.username === this.targetUser.right) {
  5511. for (let i = 0; i < this.targetUser.left.length; i++) {
  5512. if (v.replyUsers.includes(this.targetUser.left[i])) {
  5513. return true;
  5514. }
  5515. }
  5516. }
  5517. } else {
  5518. return true;
  5519. }
  5520. }
  5521. return false;
  5522. });
  5523. }
  5524. return [];
  5525. }
  5526. },
  5527. watch: {
  5528. "post.id"(n2, o) {
  5529. if (this.$refs["post-editor"]) {
  5530. this.$refs["post-editor"].content = "";
  5531. vue.nextTick(() => {
  5532. var _a, _b;
  5533. (_b = (_a = this.$refs) == null ? void 0 : _a.detail) == null ? void 0 : _b.scrollTo({ top: 0 });
  5534. });
  5535. }
  5536. },
  5537. "post.headerTemplate"(n2, o) {
  5538. let mountEl = document.querySelector(".main-wrapper .post-wrapper .html-wrapper .header");
  5539. if (mountEl) {
  5540. this.showOpTag = true;
  5541. }
  5542. },
  5543. modelValue: {
  5544. handler(newVal) {
  5545. if (this.isPost)
  5546. return;
  5547. if (newVal) {
  5548. this.currentFloor = "";
  5549. vue.nextTick(() => {
  5550. var _a, _b;
  5551. (_b = (_a = this.$refs) == null ? void 0 : _a.main) == null ? void 0 : _b.focus();
  5552. });
  5553. } else {
  5554. this.isSticky = false;
  5555. this.showRelationReply = false;
  5556. }
  5557. }
  5558. }
  5559. },
  5560. mounted() {
  5561. vue.nextTick(() => {
  5562. setTimeout(() => {
  5563. var _a;
  5564. this.postDetailWidth = ((_a = this.$refs.mainWrapper) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
  5565. }, 500);
  5566. });
  5567. if (this.isLogin) {
  5568. const observer = new IntersectionObserver(
  5569. ([e2]) => e2.target.toggleAttribute("stuck", e2.intersectionRatio < 1),
  5570. { threshold: [1] }
  5571. );
  5572. observer.observe(this.$refs.replyBox);
  5573. window.addEventListener("keydown", this.onKeyDown);
  5574. }
  5575. eventBus.on(CMD.SHOW_CALL, (val) => {
  5576. if (val.show) {
  5577. this.showCallList = true;
  5578. this.replyText = val.text;
  5579. if (this.isPost) {
  5580. this.callStyle.top = val.top + $(window).scrollTop() + -40 + "px";
  5581. } else {
  5582. this.callStyle.top = val.top + $(".post-detail").scrollTop() + 15 + "px";
  5583. }
  5584. this.callStyle.left = val.left - $(".main")[0].getBoundingClientRect().left + 10 + "px";
  5585. if (this.selectCallIndex >= this.filterCallList.length) {
  5586. this.selectCallIndex = 0;
  5587. }
  5588. } else {
  5589. this.replyText = "";
  5590. this.showCallList = false;
  5591. this.selectCallIndex = 0;
  5592. }
  5593. });
  5594. eventBus.on(CMD.RELATION_REPLY, (val) => {
  5595. this.targetUser = val;
  5596. this.showRelationReply = true;
  5597. });
  5598. eventBus.on(CMD.JUMP, this.jump);
  5599. },
  5600. beforeUnmount() {
  5601. window.removeEventListener("keydown", this.onKeyDown);
  5602. eventBus.off(CMD.SHOW_CALL);
  5603. },
  5604. methods: {
  5605. addTag() {
  5606. eventBus.emit(CMD.ADD_TAG, this.post.member.username);
  5607. },
  5608. removeTag(tag) {
  5609. eventBus.emit(CMD.REMOVE_TAG, { username: this.post.member.username, tag });
  5610. },
  5611. closePreviewModal() {
  5612. let previewModal = document.querySelector(".preview-modal");
  5613. let s = document.querySelector(".shadow");
  5614. let domRect = this.preview.rect;
  5615. _css(s, "transition", "all 0.3s");
  5616. _css(s, "width", domRect.width);
  5617. _css(s, "height", domRect.height);
  5618. _css(s, "transform", `translate3d(${domRect.x}px, ${domRect.y}px, 0) scale(1)`);
  5619. let mask = document.querySelector(".preview-modal .mask");
  5620. _css(mask, "opacity", 0);
  5621. setTimeout(() => {
  5622. _css(s, "transition", "all 0s");
  5623. s.remove();
  5624. _css(previewModal, "top", "-1000vh");
  5625. _css(document.body, "overflow", "auto");
  5626. }, 300);
  5627. },
  5628. stop(e2) {
  5629. e2.stopPropagation();
  5630. e2.stopImmediatePropagation();
  5631. if (e2.target.tagName === "IMG") {
  5632. console.log("e", e2.target.src);
  5633. if (/cdn\.v2ex\.com.*avatar/i.test(e2.target.src)) {
  5634. console.log("t");
  5635. }
  5636. this.preview = {
  5637. rect: {},
  5638. result: {},
  5639. x: 0,
  5640. y: 0,
  5641. scale: 1,
  5642. minScale: 0.2,
  5643. maxScale: 16
  5644. };
  5645. e2.preventDefault();
  5646. let domRect = e2.target.getBoundingClientRect();
  5647. let previewModal = document.querySelector(".preview-modal");
  5648. _css(previewModal, "top", "0");
  5649. let s = e2.target.cloneNode();
  5650. s.classList.add("shadow");
  5651. previewModal.append(s);
  5652. _css(s, "transition", "all 0s");
  5653. _css(s, "width", domRect.width);
  5654. _css(s, "height", domRect.height);
  5655. _css(s, "transform", `translate3d(${domRect.x}px, ${domRect.y}px, 0) scale(1)`);
  5656. let t = ".3";
  5657. let sw = domRect.width / window.innerWidth;
  5658. let sh = domRect.height / window.innerHeight;
  5659. domRect.sw = sw;
  5660. domRect.sh = sh;
  5661. this.preview.rect = domRect;
  5662. this.preview.result = getImgSize(
  5663. s.naturalWidth,
  5664. s.naturalHeight,
  5665. window.innerWidth * 0.95,
  5666. window.innerHeight * 0.9
  5667. );
  5668. this.preview.x = (window.innerWidth - this.preview.result.width) * 0.5;
  5669. this.preview.y = (window.innerHeight - this.preview.result.height) * 0.5;
  5670. let isPointerdown = false;
  5671. let isMove = false;
  5672. let lastPointermove = { x: 0, y: 0 };
  5673. let diff = { x: 0, y: 0 };
  5674. s.addEventListener("pointerdown", function(e3) {
  5675. isPointerdown = true;
  5676. isMove = false;
  5677. s.setPointerCapture(e3.pointerId);
  5678. lastPointermove = { x: e3.clientX, y: e3.clientY };
  5679. });
  5680. s.addEventListener("pointermove", (e3) => {
  5681. if (isPointerdown) {
  5682. isMove = true;
  5683. const current = { x: e3.clientX, y: e3.clientY };
  5684. diff.x = current.x - lastPointermove.x;
  5685. diff.y = current.y - lastPointermove.y;
  5686. lastPointermove = { x: current.x, y: current.y };
  5687. this.preview.x += diff.x;
  5688. this.preview.y += diff.y;
  5689. _css(s, "transition", "all 0.1s");
  5690. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5691. }
  5692. e3.preventDefault();
  5693. });
  5694. s.addEventListener("pointerup", () => {
  5695. if (isPointerdown) {
  5696. isPointerdown = false;
  5697. if (!isMove) {
  5698. this.closePreviewModal();
  5699. }
  5700. }
  5701. });
  5702. s.addEventListener("pointercancel", function(e3) {
  5703. if (isPointerdown) {
  5704. isPointerdown = false;
  5705. }
  5706. });
  5707. let mask = document.querySelector(".preview-modal .mask");
  5708. _css(mask, "transition", "all 0s");
  5709. _css(mask, "opacity", 0);
  5710. setTimeout(() => {
  5711. _css(s, "transition", `all ${t}s`);
  5712. _css(mask, "transition", `all ${t}s`);
  5713. _css(mask, "opacity", 1);
  5714. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5715. _css(s, "width", this.preview.result.width);
  5716. _css(s, "height", this.preview.result.height);
  5717. }, 0);
  5718. setTimeout(() => {
  5719. _css(document.body, "overflow", "hidden");
  5720. }, 300);
  5721. return false;
  5722. }
  5723. },
  5724. wheel(e2) {
  5725. let d2 = e2.deltaY < 0 ? 0.1 : -0.1;
  5726. let ratio = 1 + d2;
  5727. let _scale = this.preview.scale * ratio;
  5728. if (_scale > this.preview.maxScale) {
  5729. ratio = this.preview.maxScale / this.preview.scale;
  5730. this.preview.scale = this.preview.maxScale;
  5731. } else if (_scale < this.preview.minScale) {
  5732. ratio = this.preview.minScale / this.preview.scale;
  5733. this.preview.scale = this.preview.minScale;
  5734. } else {
  5735. this.preview.scale = _scale;
  5736. }
  5737. if (e2.target.tagName === "IMG") {
  5738. const origin = {
  5739. x: d2 * this.preview.result.width / 2,
  5740. y: d2 * this.preview.result.height / 2
  5741. };
  5742. this.preview.x -= d2 * (e2.clientX - this.preview.x) - origin.x;
  5743. this.preview.y -= d2 * (e2.clientY - this.preview.y) - origin.y;
  5744. }
  5745. let s = document.querySelector(".shadow");
  5746. _css(s, "transition", "all 0.2s");
  5747. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5748. e2.preventDefault();
  5749. },
  5750. jump(floor) {
  5751. let lastItem = this.replyList[this.replyList.length - 1];
  5752. if (floor === "") {
  5753. floor = lastItem.floor;
  5754. } else {
  5755. try {
  5756. floor = Number(floor);
  5757. } catch (e2) {
  5758. floor = lastItem.floor;
  5759. }
  5760. if (floor === 0) {
  5761. floor = 1;
  5762. }
  5763. if (floor > lastItem.floor)
  5764. floor = lastItem.floor;
  5765. }
  5766. if (!this.post.replyList.length) {
  5767. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "没有回复可跳转!" });
  5768. return;
  5769. }
  5770. if (floor > this.post.replyList.length) {
  5771. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5772. return;
  5773. }
  5774. let comment = $(`.c_${floor}`);
  5775. if (!comment.length) {
  5776. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5777. return;
  5778. }
  5779. comment[0].scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
  5780. comment.addClass("ding");
  5781. this.currentFloor = floor + 1;
  5782. setTimeout(() => {
  5783. comment.removeClass("ding");
  5784. }, 2e3);
  5785. },
  5786. collapseTopReplyList() {
  5787. $(this.$refs.topReply).slideToggle("fast");
  5788. },
  5789. goBottom() {
  5790. this.isSticky = false;
  5791. setTimeout(() => {
  5792. if (this.isPost) {
  5793. let body = $("body , html");
  5794. let scrollHeight = body.prop("scrollHeight");
  5795. body.animate({ scrollTop: scrollHeight - 850 }, 300);
  5796. } else {
  5797. this.$refs.detail.scrollTo({ top: this.$refs.detail.scrollHeight, behavior: "smooth" });
  5798. }
  5799. });
  5800. },
  5801. close(from) {
  5802. if (this.isPost)
  5803. return;
  5804. if (from === "space") {
  5805. if (this.config.closePostDetailBySpace) {
  5806. this.$emit("update:modelValue", false);
  5807. }
  5808. } else {
  5809. this.$emit("update:modelValue", false);
  5810. }
  5811. },
  5812. setCall(e2) {
  5813. eventBus.emit(CMD.SET_CALL, e2);
  5814. this.showCallList = false;
  5815. },
  5816. onKeyDown(e2) {
  5817. if (!this.modelValue)
  5818. return;
  5819. if (!this.showCallList)
  5820. return;
  5821. let length = this.filterCallList.slice(0, 10).length;
  5822. if (e2.keyCode === 13) {
  5823. this.setCall(this.filterCallList[this.selectCallIndex]);
  5824. e2.preventDefault();
  5825. }
  5826. if (e2.keyCode === 38) {
  5827. this.selectCallIndex--;
  5828. if (this.selectCallIndex < 0) {
  5829. this.selectCallIndex = length - 1;
  5830. }
  5831. e2.preventDefault();
  5832. }
  5833. if (e2.keyCode === 40) {
  5834. this.selectCallIndex++;
  5835. if (this.selectCallIndex > length - 1) {
  5836. this.selectCallIndex = 0;
  5837. }
  5838. e2.preventDefault();
  5839. }
  5840. },
  5841. changeOption(item) {
  5842. this.$emit("update:displayType", item);
  5843. },
  5844. addThank() {
  5845. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "add" });
  5846. },
  5847. recallThank() {
  5848. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "recall" });
  5849. },
  5850. scrollTop() {
  5851. if (this.isPost) {
  5852. $("body , html").animate({ scrollTop: 0 }, 300);
  5853. } else {
  5854. this.$refs.detail.scrollTo({ top: 0, behavior: "smooth" });
  5855. }
  5856. }
  5857. }
  5858. };
  5859. const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-ea75dfbf"), n2 = n2(), vue.popScopeId(), n2);
  5860. const _hoisted_1$6 = { class: "my-box post-wrapper" };
  5861. const _hoisted_2$3 = { class: "header" };
  5862. const _hoisted_3$3 = { class: "fr" };
  5863. const _hoisted_4$3 = ["href"];
  5864. const _hoisted_5$3 = ["src", "alt"];
  5865. const _hoisted_6$3 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("a", { href: "/packages/pcckages/pc/public" }, "V2EX", -1));
  5866. const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "chevron" }, "  ›  ", -1));
  5867. const _hoisted_8$2 = ["href"];
  5868. const _hoisted_9$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep10" }, null, -1));
  5869. const _hoisted_10$2 = ["id"];
  5870. const _hoisted_11$2 = ["onclick"];
  5871. const _hoisted_12$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-chevron-up" }, null, -1));
  5872. const _hoisted_13$2 = ["onclick"];
  5873. const _hoisted_14$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-chevron-down" }, null, -1));
  5874. const _hoisted_15$1 = [
  5875. _hoisted_14$1
  5876. ];
  5877. const _hoisted_16$1 = { class: "gray" };
  5878. const _hoisted_17$1 = ["href"];
  5879. const _hoisted_18$1 = ["title"];
  5880. const _hoisted_19$1 = ["href"];
  5881. const _hoisted_20$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-info-circle" }, null, -1));
  5882. const _hoisted_21$1 = [
  5883. _hoisted_20$1
  5884. ];
  5885. const _hoisted_22$1 = ["href"];
  5886. const _hoisted_23$1 = ["href"];
  5887. const _hoisted_24 = ["href"];
  5888. const _hoisted_25 = { class: "my-tag" };
  5889. const _hoisted_26 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5890. const _hoisted_27 = ["onClick"];
  5891. const _hoisted_28 = {
  5892. key: 0,
  5893. class: "my-box"
  5894. };
  5895. const _hoisted_29 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "高赞回复", -1));
  5896. const _hoisted_30 = { class: "top-reply" };
  5897. const _hoisted_31 = { class: "tool" };
  5898. const _hoisted_32 = { ref: "topReply" };
  5899. const _hoisted_33 = { class: "my-box comment-wrapper" };
  5900. const _hoisted_34 = {
  5901. key: 0,
  5902. class: "my-cell flex"
  5903. };
  5904. const _hoisted_35 = { key: 0 };
  5905. const _hoisted_36 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("strong", { class: "snow" }, "•", -1));
  5906. const _hoisted_37 = ["innerHTML"];
  5907. const _hoisted_38 = {
  5908. key: 0,
  5909. class: "loading-wrapper"
  5910. };
  5911. const _hoisted_39 = {
  5912. key: 1,
  5913. class: "comments"
  5914. };
  5915. const _hoisted_40 = {
  5916. key: 1,
  5917. id: "no-comments-yet"
  5918. };
  5919. const _hoisted_41 = { class: "my-cell flex" };
  5920. const _hoisted_42 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "添加一条新回复", -1));
  5921. const _hoisted_43 = { class: "notice-right gray" };
  5922. const _hoisted_44 = { class: "p1" };
  5923. const _hoisted_45 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "gray" }, "上下文", -1));
  5924. const _hoisted_46 = { class: "top-reply" };
  5925. const _hoisted_47 = ["onClick"];
  5926. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  5927. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  5928. const _component_Point = vue.resolveComponent("Point");
  5929. const _component_Toolbar = vue.resolveComponent("Toolbar");
  5930. const _component_Icon = vue.resolveComponent("Icon");
  5931. const _component_Tooltip = vue.resolveComponent("Tooltip");
  5932. const _component_Comment = vue.resolveComponent("Comment");
  5933. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  5934. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  5935. const _component_PostEditor = vue.resolveComponent("PostEditor");
  5936. const _component_SingleComment = vue.resolveComponent("SingleComment");
  5937. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  5938. class: vue.normalizeClass(["post-detail", [$options.isNight ? "isNight" : "", $options.pageType]]),
  5939. ref: "detail",
  5940. onKeydown: _cache[22] || (_cache[22] = vue.withKeys(($event) => $options.close(), ["esc"])),
  5941. onClick: _cache[23] || (_cache[23] = ($event) => $options.close("space"))
  5942. }, [
  5943. vue.createElementVNode("div", {
  5944. ref: "main",
  5945. class: "main",
  5946. tabindex: "1",
  5947. onClick: _cache[19] || (_cache[19] = (...args) => $options.stop && $options.stop(...args))
  5948. }, [
  5949. vue.createElementVNode("div", {
  5950. class: "main-wrapper",
  5951. ref: "mainWrapper",
  5952. style: vue.normalizeStyle({ width: $options.config.postWidth + "!important" })
  5953. }, [
  5954. vue.createElementVNode("div", _hoisted_1$6, [
  5955. vue.createElementVNode("div", _hoisted_2$3, [
  5956. vue.createElementVNode("div", _hoisted_3$3, [
  5957. vue.createElementVNode("a", {
  5958. href: `/member/${$options.post.member.username}`,
  5959. style: { "width": "73px", "height": "73px", "display": "inline-block" }
  5960. }, [
  5961. $options.post.member.avatar_large ? (vue.openBlock(), vue.createElementBlock("img", {
  5962. key: 0,
  5963. src: $options.post.member.avatar_large,
  5964. class: "avatar",
  5965. style: { "width": "73px", "height": "73px" },
  5966. border: "0",
  5967. align: "default",
  5968. alt: $options.post.member.username
  5969. }, null, 8, _hoisted_5$3)) : vue.createCommentVNode("", true)
  5970. ], 8, _hoisted_4$3)
  5971. ]),
  5972. _hoisted_6$3,
  5973. _hoisted_7$2,
  5974. vue.createElementVNode("a", {
  5975. href: $options.post.node.url
  5976. }, vue.toDisplayString($options.post.node.title), 9, _hoisted_8$2),
  5977. _hoisted_9$2,
  5978. vue.createElementVNode("h1", null, vue.toDisplayString($options.post.title), 1),
  5979. vue.createElementVNode("div", {
  5980. id: `topic_${$options.post.id}_votes`,
  5981. class: "votes"
  5982. }, [
  5983. vue.createElementVNode("a", {
  5984. href: "javascript:",
  5985. onclick: `upVoteTopic(${$options.post.id});`,
  5986. class: "vote"
  5987. }, [
  5988. _hoisted_12$2,
  5989. vue.createTextVNode("   ")
  5990. ], 8, _hoisted_11$2),
  5991. vue.createTextVNode("   "),
  5992. vue.createElementVNode("a", {
  5993. href: "javascript:",
  5994. onclick: `downVoteTopic(${$options.post.id});`,
  5995. class: "vote"
  5996. }, _hoisted_15$1, 8, _hoisted_13$2)
  5997. ], 8, _hoisted_10$2),
  5998. vue.createTextVNode("   "),
  5999. vue.createElementVNode("small", _hoisted_16$1, [
  6000. vue.createElementVNode("a", {
  6001. href: `/member/${$options.post.member.username}`
  6002. }, vue.toDisplayString($options.post.member.username), 9, _hoisted_17$1),
  6003. vue.createTextVNode(" · "),
  6004. $options.post.member.createDate ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6005. vue.createElementVNode("span", {
  6006. class: vue.normalizeClass($options.post.member.isNew && "danger")
  6007. }, vue.toDisplayString($options.post.member.createDate), 3),
  6008. vue.createTextVNode(" · ")
  6009. ], 64)) : vue.createCommentVNode("", true),
  6010. $options.post.createDateAgo ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6011. vue.createElementVNode("span", {
  6012. title: $options.post.createDate
  6013. }, vue.toDisplayString($options.post.createDateAgo), 9, _hoisted_18$1),
  6014. vue.createTextVNode(" · ")
  6015. ], 64)) : vue.createCommentVNode("", true),
  6016. vue.createTextVNode(" " + vue.toDisplayString($options.post.clickCount) + " 次点击 ", 1),
  6017. $options.isMy ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  6018. vue.createTextVNode("   "),
  6019. vue.createElementVNode("a", {
  6020. href: `/t/${$options.post.id}/info`
  6021. }, _hoisted_21$1, 8, _hoisted_19$1),
  6022. vue.createTextVNode("   "),
  6023. $options.canAppend ? (vue.openBlock(), vue.createElementBlock("a", {
  6024. key: 0,
  6025. href: `/append/topic/${$options.post.id}`,
  6026. class: "op"
  6027. }, "APPEND", 8, _hoisted_22$1)) : vue.createCommentVNode("", true),
  6028. $options.canEditMove ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6029. vue.createElementVNode("a", {
  6030. href: `/move/topic/${$options.post.id}`,
  6031. class: "op"
  6032. }, "MOVE", 8, _hoisted_23$1),
  6033. vue.createTextVNode("  "),
  6034. vue.createElementVNode("a", {
  6035. href: `/edit/topic/${$options.post.id}`,
  6036. class: "op"
  6037. }, "EDIT", 8, _hoisted_24)
  6038. ], 64)) : vue.createCommentVNode("", true)
  6039. ], 64)) : vue.createCommentVNode("", true)
  6040. ]),
  6041. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6042. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  6043. return vue.openBlock(), vue.createElementBlock("span", _hoisted_25, [
  6044. _hoisted_26,
  6045. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  6046. vue.createElementVNode("i", {
  6047. class: "fa fa-trash-o remove",
  6048. onClick: vue.withModifiers(($event) => $options.removeTag(i), ["stop"])
  6049. }, null, 8, _hoisted_27)
  6050. ]);
  6051. }), 256)),
  6052. vue.createElementVNode("span", {
  6053. class: "add-tag ago",
  6054. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.addTag && $options.addTag(...args), ["stop"])),
  6055. title: "添加标签"
  6056. }, "+")
  6057. ], 64)) : vue.createCommentVNode("", true)
  6058. ]),
  6059. $options.post.headerTemplate ? (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  6060. key: 0,
  6061. html: $options.post.headerTemplate
  6062. }, null, 8, ["html"])) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  6063. key: 1,
  6064. html: $options.post.jsonContent
  6065. }, null, 8, ["html"])),
  6066. vue.createVNode(_component_Toolbar, {
  6067. onReply: _cache[1] || (_cache[1] = ($event) => $data.isSticky = !$data.isSticky)
  6068. }, {
  6069. default: vue.withCtx(() => [
  6070. vue.createVNode(_component_Point, {
  6071. onAddThank: $options.addThank,
  6072. onRecallThank: $options.recallThank,
  6073. item: {
  6074. isThanked: $options.post.isThanked,
  6075. thankCount: $options.post.thankCount,
  6076. username: $options.post.username
  6077. },
  6078. "api-url": "topic/" + $options.post.id
  6079. }, null, 8, ["onAddThank", "onRecallThank", "item", "api-url"])
  6080. ]),
  6081. _: 1
  6082. })
  6083. ]),
  6084. $options.post.topReplyList.length && $options.config.showTopReply ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
  6085. vue.createElementVNode("div", {
  6086. class: "my-cell flex",
  6087. onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.collapseTopReplyList && $options.collapseTopReplyList(...args), ["stop"]))
  6088. }, [
  6089. _hoisted_29,
  6090. vue.createElementVNode("div", _hoisted_30, [
  6091. vue.createVNode(_component_Tooltip, { title: "收起高赞回复" }, {
  6092. default: vue.withCtx(() => [
  6093. vue.createElementVNode("div", _hoisted_31, [
  6094. vue.createVNode(_component_Icon, { icon: "gravity-ui:chevrons-collapse-vertical" })
  6095. ])
  6096. ]),
  6097. _: 1
  6098. })
  6099. ])
  6100. ]),
  6101. vue.createElementVNode("div", _hoisted_32, [
  6102. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.post.topReplyList, (item, index) => {
  6103. return vue.openBlock(), vue.createBlock(_component_Comment, {
  6104. key: item.floor,
  6105. type: "top",
  6106. modelValue: $options.post.topReplyList[index],
  6107. "onUpdate:modelValue": ($event) => $options.post.topReplyList[index] = $event
  6108. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  6109. }), 128))
  6110. ], 512)
  6111. ])) : vue.createCommentVNode("", true),
  6112. vue.createElementVNode("div", _hoisted_33, [
  6113. $options.post.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_34, [
  6114. vue.createElementVNode("div", null, [
  6115. vue.createTextVNode(vue.toDisplayString($options.post.replyCount) + " 条回复 ", 1),
  6116. $options.post.lastReplyDate ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_35, [
  6117. vue.createTextVNode("  "),
  6118. _hoisted_36,
  6119. vue.createTextVNode("  " + vue.toDisplayString($options.post.lastReplyDate), 1)
  6120. ])) : vue.createCommentVNode("", true)
  6121. ]),
  6122. $options.config.showToolbar ? (vue.openBlock(), vue.createBlock(_component_BaseSelect, {
  6123. key: 0,
  6124. "display-type": $props.displayType,
  6125. "onUpdate:displayType": _cache[3] || (_cache[3] = (e2) => _ctx.$emit("update:displayType", e2))
  6126. }, null, 8, ["display-type"])) : (vue.openBlock(), vue.createElementBlock("div", {
  6127. key: 1,
  6128. class: "fr",
  6129. innerHTML: $options.post.fr
  6130. }, null, 8, _hoisted_37))
  6131. ])) : vue.createCommentVNode("", true),
  6132. $options.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6133. $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_38, [
  6134. vue.createVNode(_component_BaseLoading, { size: "large" })
  6135. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, [
  6136. $props.modelValue ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($options.replyList, (item, index) => {
  6137. return vue.openBlock(), vue.createBlock(_component_Comment, {
  6138. key: item.floor,
  6139. modelValue: $options.replyList[index],
  6140. "onUpdate:modelValue": ($event) => $options.replyList[index] = $event
  6141. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  6142. }), 128)) : vue.createCommentVNode("", true)
  6143. ]))
  6144. ], 64)) : vue.createCommentVNode("", true)
  6145. ]),
  6146. !($options.replyList.length || $props.loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_40, "目前尚无回复")) : vue.createCommentVNode("", true),
  6147. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  6148. key: 2,
  6149. class: vue.normalizeClass(["my-box", { "sticky": $data.isSticky }]),
  6150. ref: "replyBox"
  6151. }, [
  6152. vue.createElementVNode("div", _hoisted_41, [
  6153. _hoisted_42,
  6154. vue.createElementVNode("div", _hoisted_43, [
  6155. $data.isSticky ? (vue.openBlock(), vue.createElementBlock("a", {
  6156. key: 0,
  6157. style: { "margin-right": "2rem" },
  6158. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => $data.isSticky = false, ["stop"]))
  6159. }, "取消回复框停靠")) : vue.createCommentVNode("", true),
  6160. vue.createElementVNode("a", {
  6161. onClick: _cache[5] || (_cache[5] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  6162. }, "回到顶部")
  6163. ])
  6164. ]),
  6165. vue.createElementVNode("div", _hoisted_44, [
  6166. vue.createVNode(_component_PostEditor, {
  6167. onClose: $options.goBottom,
  6168. ref: "post-editor",
  6169. useType: "reply-post",
  6170. onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => $data.isSticky = true, ["stop"]))
  6171. }, null, 8, ["onClose"])
  6172. ])
  6173. ], 2)) : vue.createCommentVNode("", true)
  6174. ], 4),
  6175. $data.showRelationReply ? (vue.openBlock(), vue.createElementBlock("div", {
  6176. key: 0,
  6177. class: "relationReply",
  6178. onClick: _cache[10] || (_cache[10] = vue.withModifiers(($event) => $options.close("space"), ["stop"]))
  6179. }, [
  6180. vue.createElementVNode("div", {
  6181. class: "my-cell flex",
  6182. onClick: _cache[8] || (_cache[8] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  6183. }, [
  6184. _hoisted_45,
  6185. vue.createElementVNode("div", _hoisted_46, [
  6186. vue.createVNode(_component_Icon, {
  6187. icon: "ic:round-close",
  6188. onClick: _cache[7] || (_cache[7] = vue.withModifiers(($event) => $data.showRelationReply = false, ["stop"]))
  6189. })
  6190. ])
  6191. ]),
  6192. vue.createElementVNode("div", {
  6193. class: "comments",
  6194. onClick: _cache[9] || (_cache[9] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  6195. }, [
  6196. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.relationReply, (item, index) => {
  6197. return vue.openBlock(), vue.createBlock(_component_SingleComment, {
  6198. "is-right": item.username === $data.targetUser.right,
  6199. key: item.floor,
  6200. comment: item
  6201. }, null, 8, ["is-right", "comment"]);
  6202. }), 128))
  6203. ])
  6204. ])) : vue.createCommentVNode("", true),
  6205. $data.showCallList && $options.filterCallList.length ? (vue.openBlock(), vue.createElementBlock("div", {
  6206. key: 1,
  6207. class: "call-list",
  6208. style: vue.normalizeStyle($data.callStyle)
  6209. }, [
  6210. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.filterCallList, (item, index) => {
  6211. return vue.openBlock(), vue.createElementBlock("div", {
  6212. class: vue.normalizeClass(["call-item", { select: index === $data.selectCallIndex }]),
  6213. onClick: vue.withModifiers(($event) => $options.setCall(item), ["stop"])
  6214. }, [
  6215. vue.createElementVNode("a", null, vue.toDisplayString(item), 1)
  6216. ], 10, _hoisted_47);
  6217. }), 256))
  6218. ], 4)) : vue.createCommentVNode("", true),
  6219. vue.createElementVNode("div", {
  6220. class: "close-btn",
  6221. onClick: _cache[11] || (_cache[11] = vue.withModifiers(($event) => $options.close("btn"), ["stop"]))
  6222. }, [
  6223. vue.createVNode(_component_Icon, { icon: "icon-park-outline:close" })
  6224. ]),
  6225. vue.createElementVNode("div", {
  6226. class: "open-new-tab",
  6227. onClick: _cache[12] || (_cache[12] = vue.withModifiers(($event) => $options.functions.openNewTab("https://www.v2ex.com/t/" + $options.post.id, $options.config.newTabOpenActive), ["stop"]))
  6228. }, [
  6229. vue.createVNode(_component_Icon, { icon: "majesticons:open" })
  6230. ]),
  6231. vue.createElementVNode("div", {
  6232. class: "refresh gray",
  6233. onClick: _cache[13] || (_cache[13] = vue.withModifiers(($event) => _ctx.$emit("refresh"), ["stop"]))
  6234. }, [
  6235. $props.refreshLoading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  6236. key: 1,
  6237. icon: "material-symbols:refresh"
  6238. }))
  6239. ]),
  6240. vue.createElementVNode("div", {
  6241. class: "scroll-to gray",
  6242. onClick: _cache[17] || (_cache[17] = vue.withModifiers(($event) => $options.jump($data.currentFloor), ["stop"]))
  6243. }, [
  6244. vue.createVNode(_component_Icon, { icon: "lucide:move-down" }),
  6245. vue.withDirectives(vue.createElementVNode("input", {
  6246. type: "text",
  6247. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.currentFloor = $event),
  6248. onClick: _cache[15] || (_cache[15] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"])),
  6249. onKeydown: _cache[16] || (_cache[16] = vue.withKeys(($event) => $options.jump($data.currentFloor), ["enter"]))
  6250. }, null, 544), [
  6251. [vue.vModelText, $data.currentFloor]
  6252. ])
  6253. ]),
  6254. vue.createElementVNode("div", {
  6255. class: "scroll-top gray",
  6256. onClick: _cache[18] || (_cache[18] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  6257. }, [
  6258. vue.createVNode(_component_Icon, { icon: "lucide:move-up" })
  6259. ])
  6260. ], 512),
  6261. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  6262. vue.createElementVNode("div", {
  6263. class: "preview-modal",
  6264. onWheel: _cache[21] || (_cache[21] = (...args) => $options.wheel && $options.wheel(...args))
  6265. }, [
  6266. vue.createElementVNode("div", {
  6267. class: "mask",
  6268. onClick: _cache[20] || (_cache[20] = (...args) => $options.closePreviewModal && $options.closePreviewModal(...args))
  6269. }),
  6270. vue.createVNode(_component_Icon, {
  6271. class: "close",
  6272. icon: "fontisto:close-a",
  6273. onClick: $options.closePreviewModal
  6274. }, null, 8, ["onClick"])
  6275. ], 32)
  6276. ]))
  6277. ], 34)), [
  6278. [vue.vShow, $props.modelValue]
  6279. ]);
  6280. }
  6281. const PostDetail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$2], ["__scopeId", "data-v-ea75dfbf"]]);
  6282. const _hoisted_1$5 = { key: 1 };
  6283. const _sfc_main$5 = {
  6284. __name: "Base64Tooltip",
  6285. setup(__props) {
  6286. const tooltip = vue.ref(null);
  6287. const show = vue.ref(false);
  6288. const originalText = vue.ref("");
  6289. const decodeText = vue.ref("");
  6290. const styleObject = vue.reactive({
  6291. left: "-100vw",
  6292. top: "-100vh"
  6293. });
  6294. vue.onMounted(() => {
  6295. eventBus.on(CMD.SHOW_TOOLTIP, ({ text, e: e2 }) => {
  6296. setTimeout(() => show.value = true);
  6297. originalText.value = text;
  6298. decodeText.value = "";
  6299. styleObject.left = e2.clientX + "px";
  6300. styleObject.top = e2.clientY + 20 + "px";
  6301. });
  6302. window.addEventListener("click", (e2) => {
  6303. if (!tooltip.value)
  6304. return;
  6305. if (!tooltip.value.contains(e2.target) && show.value) {
  6306. show.value = false;
  6307. }
  6308. }, { capture: true });
  6309. const fn = () => show.value && (show.value = false);
  6310. $(".post-detail", document).on("scroll", fn);
  6311. });
  6312. function copy() {
  6313. if (navigator.clipboard) {
  6314. navigator.clipboard.writeText(decodeText.value);
  6315. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "复制成功" });
  6316. } else {
  6317. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "复制失败!浏览器不支持!" });
  6318. }
  6319. }
  6320. function base64ToArrayBuffer(base64) {
  6321. let binary_string = window.atob(base64);
  6322. let len = binary_string.length;
  6323. let bytes = new Uint8Array(len);
  6324. for (let i = 0; i < len; i++) {
  6325. bytes[i] = binary_string.charCodeAt(i);
  6326. }
  6327. return bytes.buffer;
  6328. }
  6329. function decode() {
  6330. try {
  6331. new Blob([base64ToArrayBuffer(originalText.value)]).text().then((r2) => {
  6332. decodeText.value = r2;
  6333. });
  6334. } catch (e2) {
  6335. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "Base64解码失败!不是标准数据!" });
  6336. }
  6337. }
  6338. return (_ctx, _cache) => {
  6339. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  6340. class: "base64_tooltip",
  6341. style: vue.normalizeStyle(styleObject),
  6342. onClick: decode,
  6343. ref_key: "tooltip",
  6344. ref: tooltip
  6345. }, [
  6346. !decodeText.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6347. vue.createTextVNode(" Base64解码:" + vue.toDisplayString(originalText.value) + " ", 1),
  6348. vue.createVNode(vue.unref(Icon), { icon: "system-uicons:translate" })
  6349. ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
  6350. vue.createElementVNode("span", null, vue.toDisplayString(decodeText.value), 1),
  6351. vue.createVNode(BaseButton, {
  6352. class: "btn",
  6353. size: "small",
  6354. onClick: copy
  6355. }, {
  6356. default: vue.withCtx(() => [
  6357. vue.createTextVNode("点击复制")
  6358. ]),
  6359. _: 1
  6360. })
  6361. ]))
  6362. ], 4)), [
  6363. [vue.vShow, show.value]
  6364. ]);
  6365. };
  6366. }
  6367. };
  6368. const Base64Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-06429e70"]]);
  6369. const _sfc_main$4 = {
  6370. name: "Msg",
  6371. components: { Icon },
  6372. props: {
  6373. type: "",
  6374. text: ""
  6375. },
  6376. created() {
  6377. setTimeout(() => {
  6378. this.$emit("close");
  6379. }, 3e3);
  6380. }
  6381. };
  6382. const _hoisted_1$4 = { class: "right" };
  6383. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  6384. const _component_Icon = vue.resolveComponent("Icon");
  6385. return vue.openBlock(), vue.createElementBlock("div", {
  6386. class: vue.normalizeClass(["msg", $props.type])
  6387. }, [
  6388. vue.createElementVNode("div", {
  6389. class: "left",
  6390. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  6391. }, [
  6392. vue.createVNode(_component_Icon, { icon: "ic:round-close" })
  6393. ]),
  6394. vue.createElementVNode("div", _hoisted_1$4, vue.toDisplayString($props.text), 1)
  6395. ], 2);
  6396. }
  6397. const Msg = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-8bf692ea"]]);
  6398. const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-0f1f99f7"), n2 = n2(), vue.popScopeId(), n2);
  6399. const _hoisted_1$3 = {
  6400. key: 0,
  6401. class: "tag-modal modal"
  6402. };
  6403. const _hoisted_2$2 = { class: "wrapper" };
  6404. const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 添加标签 ", -1));
  6405. const _hoisted_4$2 = { class: "option" };
  6406. const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户:", -1));
  6407. const _hoisted_6$2 = { class: "btns" };
  6408. const _sfc_main$3 = {
  6409. __name: "TagModal",
  6410. props: ["tags"],
  6411. emits: ["update:tags"],
  6412. setup(__props, { emit: __emit }) {
  6413. const tagModal = vue.reactive({
  6414. show: false,
  6415. currentUsername: "",
  6416. tag: ""
  6417. });
  6418. const props = __props;
  6419. const emit = __emit;
  6420. const inputRef = vue.ref();
  6421. vue.onMounted(() => {
  6422. eventBus.on(CMD.ADD_TAG, (username) => {
  6423. tagModal.currentUsername = username;
  6424. tagModal.show = true;
  6425. vue.nextTick(() => {
  6426. inputRef.value.focus();
  6427. });
  6428. });
  6429. });
  6430. async function addTag() {
  6431. if (!tagModal.tag) {
  6432. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请输入标签" });
  6433. return;
  6434. }
  6435. let oldTag = functions.clone(props.tags);
  6436. let tempTag = functions.clone(props.tags);
  6437. let userTags = tempTag[tagModal.currentUsername] ?? [];
  6438. let rIndex = userTags.findIndex((v) => v === tagModal.tag);
  6439. if (rIndex > -1) {
  6440. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "标签已存在!" });
  6441. return;
  6442. } else {
  6443. userTags.push(tagModal.tag);
  6444. }
  6445. tempTag[tagModal.currentUsername] = userTags;
  6446. emit("update:tags", tempTag);
  6447. tagModal.tag = "";
  6448. tagModal.show = false;
  6449. let res = await window.parse.saveTags(tempTag);
  6450. if (!res) {
  6451. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签添加失败!" });
  6452. emit("update:tags", oldTag);
  6453. }
  6454. }
  6455. return (_ctx, _cache) => {
  6456. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6457. default: vue.withCtx(() => [
  6458. tagModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
  6459. vue.createElementVNode("div", {
  6460. class: "mask",
  6461. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => tagModal.show = false, ["stop"]))
  6462. }),
  6463. vue.createElementVNode("div", _hoisted_2$2, [
  6464. _hoisted_3$2,
  6465. vue.createElementVNode("div", _hoisted_4$2, [
  6466. _hoisted_5$2,
  6467. vue.createElementVNode("div", null, [
  6468. vue.createElementVNode("b", null, vue.toDisplayString(tagModal.currentUsername), 1)
  6469. ])
  6470. ]),
  6471. vue.withDirectives(vue.createElementVNode("input", {
  6472. type: "text",
  6473. ref_key: "inputRef",
  6474. ref: inputRef,
  6475. style: { "width": "100%" },
  6476. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tagModal.tag = $event),
  6477. onKeydown: vue.withKeys(addTag, ["enter"])
  6478. }, null, 544), [
  6479. [vue.vModelText, tagModal.tag]
  6480. ]),
  6481. vue.createElementVNode("div", _hoisted_6$2, [
  6482. vue.createVNode(BaseButton, {
  6483. type: "link",
  6484. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => {
  6485. tagModal.show = false;
  6486. tagModal.tag = "";
  6487. }, ["stop"]))
  6488. }, {
  6489. default: vue.withCtx(() => [
  6490. vue.createTextVNode("取消")
  6491. ]),
  6492. _: 1
  6493. }),
  6494. vue.createVNode(BaseButton, {
  6495. onClick: vue.withModifiers(addTag, ["stop"])
  6496. }, {
  6497. default: vue.withCtx(() => [
  6498. vue.createTextVNode("确定")
  6499. ]),
  6500. _: 1
  6501. })
  6502. ])
  6503. ])
  6504. ])) : vue.createCommentVNode("", true)
  6505. ]),
  6506. _: 1
  6507. });
  6508. };
  6509. }
  6510. };
  6511. const TagModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0f1f99f7"]]);
  6512. const _hoisted_1$2 = { class: "msgs" };
  6513. const _sfc_main$2 = {
  6514. __name: "MsgModal",
  6515. setup(__props) {
  6516. const msgList = vue.reactive([
  6517. // {type: 'success', text: '123', id: Date.now()}
  6518. ]);
  6519. vue.onMounted(() => {
  6520. eventBus.on(CMD.SHOW_MSG, (val) => {
  6521. msgList.push({ ...val, id: Date.now() });
  6522. });
  6523. });
  6524. function removeMsg(id) {
  6525. let rIndex = msgList.findIndex((item) => item.id === id);
  6526. if (rIndex > -1) {
  6527. msgList.splice(rIndex, 1);
  6528. }
  6529. }
  6530. return (_ctx, _cache) => {
  6531. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
  6532. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(msgList, (v) => {
  6533. return vue.openBlock(), vue.createBlock(Msg, {
  6534. key: v.id,
  6535. type: v.type,
  6536. text: v.text,
  6537. onClose: ($event) => removeMsg(v.id)
  6538. }, null, 8, ["type", "text", "onClose"]);
  6539. }), 128))
  6540. ]);
  6541. };
  6542. }
  6543. };
  6544. const MsgModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b73f4332"]]);
  6545. let u = ".__cf_email__", f = "data-cfemail", d = document.createElement("div");
  6546. function e(e2) {
  6547. console.error(e2);
  6548. }
  6549. function r(e2, t) {
  6550. let r2 = e2.substr(t, 2);
  6551. return parseInt(r2, 16);
  6552. }
  6553. function n(href, index) {
  6554. let o = "", a = r(href, index);
  6555. for (let i = index + 2; i < href.length; i += 2) {
  6556. let l = r(href, i) ^ a;
  6557. o += String.fromCharCode(l);
  6558. }
  6559. try {
  6560. o = decodeURIComponent(escape(o));
  6561. } catch (u2) {
  6562. e(u2);
  6563. }
  6564. d.innerHTML = '<a href="' + o.replace(/"/g, "&quot;") + '"></a>';
  6565. return d.childNodes[0].getAttribute("href") || "";
  6566. }
  6567. function decodeEmail(body) {
  6568. try {
  6569. let as = body.find(u);
  6570. as.each(function() {
  6571. try {
  6572. let o = this, a = o.parentNode, i = o.getAttribute(f);
  6573. if (i) {
  6574. let l = n(i, 0), d2 = document.createTextNode(l);
  6575. a.replaceChild(d2, o);
  6576. }
  6577. } catch (h2) {
  6578. e(h2);
  6579. }
  6580. });
  6581. } catch (s) {
  6582. e(s);
  6583. }
  6584. }
  6585. const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-77aa374e"), n2 = n2(), vue.popScopeId(), n2);
  6586. const _hoisted_1$1 = {
  6587. key: 0,
  6588. class: "NotificationModal modal"
  6589. };
  6590. const _hoisted_2$1 = { class: "modal-root" };
  6591. const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 提醒系统 ", -1));
  6592. const _hoisted_4$1 = { class: "modal-body" };
  6593. const _hoisted_5$1 = { class: "filter" };
  6594. const _hoisted_6$1 = { class: "list-wrap" };
  6595. const _hoisted_7$1 = { class: "notify-wrap" };
  6596. const _hoisted_8$1 = ["innerHTML"];
  6597. const _hoisted_9$1 = {
  6598. key: 0,
  6599. class: "loading-wrap"
  6600. };
  6601. const _hoisted_10$1 = { class: "footer" };
  6602. const _hoisted_11$1 = ["innerHTML"];
  6603. const _hoisted_12$1 = { class: "total" };
  6604. const _hoisted_13$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", null, "总共收到提醒", -1));
  6605. const _sfc_main$1 = {
  6606. __name: "NotificationModal",
  6607. props: ["modelValue", "list", "total", "pages", "loading"],
  6608. emits: ["update:modelValue"],
  6609. setup(__props, { emit: __emit }) {
  6610. const props = __props;
  6611. const emit = __emit;
  6612. const index = vue.ref("all");
  6613. vue.onMounted(() => {
  6614. });
  6615. vue.watch([index, () => props.list], () => {
  6616. $(".notify-wrap").scrollTop(0);
  6617. });
  6618. vue.watch(() => props.modelValue, (n2) => {
  6619. if (n2) {
  6620. document.body.style.overflow = "hidden";
  6621. } else {
  6622. document.body.style.overflow = "unset";
  6623. $(".notify-wrap").scrollTop(0);
  6624. }
  6625. });
  6626. function close() {
  6627. emit("update:modelValue", false);
  6628. }
  6629. return (_ctx, _cache) => {
  6630. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6631. default: vue.withCtx(() => [
  6632. __props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  6633. vue.createElementVNode("div", {
  6634. class: "mask",
  6635. onClick: vue.withModifiers(close, ["stop"])
  6636. }),
  6637. vue.createElementVNode("div", _hoisted_2$1, [
  6638. vue.createElementVNode("div", { class: "modal-header" }, [
  6639. _hoisted_3$1,
  6640. vue.createElementVNode("i", {
  6641. class: "fa fa-times",
  6642. onClick: close
  6643. })
  6644. ]),
  6645. vue.createElementVNode("div", _hoisted_4$1, [
  6646. vue.createElementVNode("div", _hoisted_5$1, [
  6647. vue.createElementVNode("div", {
  6648. class: vue.normalizeClass(index.value === "all" && "active"),
  6649. onClick: _cache[0] || (_cache[0] = ($event) => index.value = "all")
  6650. }, "全部", 2),
  6651. vue.createElementVNode("div", {
  6652. class: vue.normalizeClass(index.value === "reply" && "active"),
  6653. onClick: _cache[1] || (_cache[1] = ($event) => index.value = "reply")
  6654. }, "回复", 2),
  6655. vue.createElementVNode("div", {
  6656. class: vue.normalizeClass(index.value === "star" && "active"),
  6657. onClick: _cache[2] || (_cache[2] = ($event) => index.value = "star")
  6658. }, "感谢", 2),
  6659. vue.createElementVNode("div", {
  6660. class: vue.normalizeClass(index.value === "collect" && "active"),
  6661. onClick: _cache[3] || (_cache[3] = ($event) => index.value = "collect")
  6662. }, "收藏", 2)
  6663. ]),
  6664. vue.createElementVNode("div", _hoisted_6$1, [
  6665. vue.createElementVNode("div", _hoisted_7$1, [
  6666. vue.createElementVNode("div", {
  6667. id: "notifications",
  6668. class: vue.normalizeClass(index.value),
  6669. innerHTML: __props.list
  6670. }, null, 10, _hoisted_8$1)
  6671. ]),
  6672. __props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, [
  6673. vue.createVNode(BaseLoading)
  6674. ])) : vue.createCommentVNode("", true)
  6675. ]),
  6676. vue.createElementVNode("div", _hoisted_10$1, [
  6677. vue.createElementVNode("div", {
  6678. innerHTML: __props.pages,
  6679. class: "pages"
  6680. }, null, 8, _hoisted_11$1),
  6681. vue.createElementVNode("div", _hoisted_12$1, [
  6682. _hoisted_13$1,
  6683. vue.createTextVNode(vue.toDisplayString(__props.total), 1)
  6684. ])
  6685. ])
  6686. ])
  6687. ])
  6688. ])) : vue.createCommentVNode("", true)
  6689. ]),
  6690. _: 1
  6691. });
  6692. };
  6693. }
  6694. };
  6695. const NotificationModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-77aa374e"]]);
  6696. const _sfc_main = {
  6697. components: {
  6698. Icon,
  6699. BaseButton,
  6700. NotificationModal,
  6701. BaseLoading,
  6702. BaseSwitch,
  6703. MsgModal,
  6704. TagModal,
  6705. Tooltip,
  6706. Setting,
  6707. PostDetail,
  6708. Base64Tooltip,
  6709. Msg
  6710. },
  6711. provide() {
  6712. return {
  6713. isLogin: vue.computed(() => this.isLogin),
  6714. isNight: vue.computed(() => this.isNight),
  6715. pageType: vue.computed(() => this.pageType),
  6716. tags: vue.computed(() => this.tags),
  6717. show: vue.computed(() => this.show),
  6718. post: vue.computed(() => this.current),
  6719. config: vue.computed(() => this.config),
  6720. allReplyUsers: vue.computed(() => {
  6721. var _a, _b, _c;
  6722. if ((_a = this.current) == null ? void 0 : _a.replyList) {
  6723. return Array.from(new Set(((_c = (_b = this.current) == null ? void 0 : _b.replyList) == null ? void 0 : _c.map((v) => v.username)) ?? []));
  6724. }
  6725. return [];
  6726. }),
  6727. showConfig: this.showConfig
  6728. };
  6729. },
  6730. data() {
  6731. return {
  6732. loading: window.pageType === PageType.Post,
  6733. refreshLoading: false,
  6734. loadMore: false,
  6735. isLogin: !!window.user.username,
  6736. pageType: window.pageType,
  6737. isNight: window.isNight,
  6738. stopMe: window.stopMe,
  6739. //停止使用脚本
  6740. show: false,
  6741. current: getDefaultPost(),
  6742. list: [],
  6743. config: functions.clone(window.config),
  6744. tags: window.user.tags,
  6745. configModal: {
  6746. show: false
  6747. },
  6748. notificationModal: {
  6749. show: false,
  6750. loading: false,
  6751. list: "",
  6752. total: 0
  6753. },
  6754. previewModal: {
  6755. show: false,
  6756. src: ""
  6757. },
  6758. popConfirmModal: {
  6759. show: false,
  6760. title: "",
  6761. id: ""
  6762. },
  6763. timer: -1,
  6764. timer2: -1,
  6765. pageInfo: {
  6766. title: "",
  6767. number: 0
  6768. },
  6769. calendar: {
  6770. show: false,
  6771. year: "",
  6772. month: "",
  6773. dayCount: 0,
  6774. firstDayWeek: 0,
  6775. select: ""
  6776. }
  6777. };
  6778. },
  6779. computed: {
  6780. targetUserTags() {
  6781. return this.tags[window.targetUserName] ?? [];
  6782. },
  6783. isList() {
  6784. return [PageType.Home, PageType.Node].includes(this.pageType);
  6785. },
  6786. isPost() {
  6787. return this.pageType === PageType.Post;
  6788. },
  6789. isMember() {
  6790. return this.pageType === PageType.Member;
  6791. }
  6792. },
  6793. watch: {
  6794. config: {
  6795. handler(newVal, oldVal) {
  6796. console.log("config", functions.clone(newVal).notice, functions.clone(oldVal).notice);
  6797. let configStr = localStorage.getItem("v2ex-config");
  6798. if (configStr) {
  6799. let configObj = JSON.parse(configStr);
  6800. configObj[window.user.username || "default"] = newVal;
  6801. localStorage.setItem("v2ex-config", JSON.stringify(configObj));
  6802. }
  6803. window.config = newVal;
  6804. window.parse.editNoteItem(window.user.configPrefix + JSON.stringify(window.config), window.user.configNoteId);
  6805. },
  6806. deep: true
  6807. },
  6808. tags(newVal) {
  6809. window.user.tags = newVal;
  6810. },
  6811. "config.viewType"(newVal) {
  6812. if (!newVal)
  6813. return;
  6814. if (newVal === "card") {
  6815. $(".post-item").each(function() {
  6816. $(this).addClass("preview");
  6817. });
  6818. } else {
  6819. $(".post-item").each(function() {
  6820. $(this).removeClass("preview");
  6821. });
  6822. }
  6823. },
  6824. "pageInfo.number"(newVal) {
  6825. clearInterval(this.timer2);
  6826. if (newVal) {
  6827. document.title = `(${this.pageInfo.number}) ` + this.pageInfo.title;
  6828. if (this.config.notice.whenNewNoticeGlimmer) {
  6829. let c = 0;
  6830. this.timer2 = setInterval(() => {
  6831. c++;
  6832. document.title = this.pageInfo.title;
  6833. if (c % 2 === 0) {
  6834. document.title = `(${this.pageInfo.number}) ` + this.pageInfo.title;
  6835. }
  6836. }, 1e3);
  6837. }
  6838. } else {
  6839. document.title = this.pageInfo.title;
  6840. }
  6841. },
  6842. show(newVal) {
  6843. if (this.pageType === PageType.Post)
  6844. return;
  6845. if (newVal) {
  6846. document.body.style.overflow = "hidden";
  6847. if (!window.history.state) {
  6848. window.history.pushState({}, 0, this.current.href);
  6849. }
  6850. vue.nextTick(() => {
  6851. this.pageInfo.title = document.title = this.current.title ?? "V2EX";
  6852. });
  6853. } else {
  6854. document.body.style.overflow = "unset";
  6855. this.pageInfo.title = document.title = "V2EX";
  6856. if (window.history.state) {
  6857. window.history.back();
  6858. }
  6859. }
  6860. }
  6861. },
  6862. created() {
  6863. let that = this;
  6864. this.initEvent();
  6865. window.cb = this.winCb;
  6866. if (!window.canParseV2exPage)
  6867. return;
  6868. $(document).on("click", "a", this.clickA);
  6869. $(document).on("click", ".post-item", function(e2) {
  6870. if (e2.currentTarget.getAttribute("script"))
  6871. return;
  6872. if (that.stopMe)
  6873. return true;
  6874. if (this.classList.contains("preview")) {
  6875. if (e2.target.tagName !== "A" && e2.target.tagName !== "IMG" && !e2.target.classList.contains("toggle")) {
  6876. let id = this.dataset["id"];
  6877. let href = this.dataset["href"];
  6878. if (id) {
  6879. that.clickPost(e2, id, href);
  6880. } else {
  6881. if (href)
  6882. location.href = href;
  6883. }
  6884. }
  6885. }
  6886. });
  6887. $(document).on("click", ".toggle", (e2) => {
  6888. if (this.stopMe)
  6889. return true;
  6890. let id = e2.target.dataset["id"];
  6891. let itemDom = document.querySelector(`.id_${id}`);
  6892. if (itemDom.classList.contains("preview")) {
  6893. e2.target.innerText = "预览";
  6894. itemDom.classList.remove("preview");
  6895. } else {
  6896. if (this.config.viewType !== "card") {
  6897. let index = this.list.findIndex((v) => v.id == id);
  6898. if (index > -1) {
  6899. e2.target.innerText = "收起";
  6900. itemDom.classList.add("preview");
  6901. } else {
  6902. e2.target.innerText = "加载中";
  6903. functions.getPostDetailByApi(id).then((res) => {
  6904. if (res.content_rendered) {
  6905. res.href = itemDom.dataset["href"];
  6906. this.list.push(getDefaultPost(res));
  6907. itemDom.classList.add("preview");
  6908. e2.target.innerText = "收起";
  6909. functions.appendPostContent(res, itemDom);
  6910. } else {
  6911. e2.target.innerText = "预览";
  6912. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "主题暂无正文!" });
  6913. }
  6914. });
  6915. }
  6916. } else {
  6917. e2.target.innerText = "收起";
  6918. itemDom.classList.add("preview");
  6919. }
  6920. }
  6921. });
  6922. window.onpopstate = (event) => {
  6923. if (event.state) {
  6924. if (!this.show)
  6925. this.show = true;
  6926. } else {
  6927. if (this.show)
  6928. this.show = false;
  6929. }
  6930. };
  6931. if (this.config.notice.takeOverNoticePage) {
  6932. window.deleteNotification = (nId, token) => {
  6933. let item = $("#n_" + nId);
  6934. item.slideUp("fast");
  6935. $.post({
  6936. url: "/delete/notification/" + nId + "?once=" + token,
  6937. success() {
  6938. $.get({
  6939. url: "/notifications/below/" + window.notificationBottom,
  6940. success(data, status, request) {
  6941. item.remove();
  6942. $("#notifications").append(that.checkReplyItemType(data));
  6943. window.notificationBottom = request.getResponseHeader("X-V2EX-New-Notification-Bottom");
  6944. },
  6945. error() {
  6946. item.slideDown("fast");
  6947. }
  6948. });
  6949. },
  6950. error() {
  6951. item.slideDown("fast");
  6952. }
  6953. });
  6954. };
  6955. }
  6956. },
  6957. beforeUnmount() {
  6958. clearInterval(this.timer);
  6959. eventBus.clear();
  6960. $(document).off("click", "a", this.clickA);
  6961. },
  6962. methods: {
  6963. getMonthDayInfo(num) {
  6964. let now = dayjs();
  6965. now = now.year(this.calendar.year);
  6966. now = now.month(this.calendar.month);
  6967. if (num > 0) {
  6968. now = now.add(1, "month");
  6969. } else {
  6970. now = now.subtract(1, "month");
  6971. }
  6972. this.calendar.year = now.year();
  6973. this.calendar.month = now.month();
  6974. this.calendar.dayCount = now.daysInMonth();
  6975. this.calendar.firstDayWeek = now.startOf("month").day();
  6976. },
  6977. checkReplyItemType(val) {
  6978. let d2 = $(val);
  6979. let str = d2.html();
  6980. if (str.includes("提到了你") || str.includes("回复了你")) {
  6981. d2.addClass("reply");
  6982. }
  6983. if (str.includes("感谢了你")) {
  6984. d2.addClass("star");
  6985. }
  6986. if (str.includes("收藏了你")) {
  6987. d2.addClass("collect");
  6988. }
  6989. return d2;
  6990. },
  6991. async getUnreadMessagesCount() {
  6992. var _a, _b;
  6993. const res = await fetch(`${location.origin}/mission`);
  6994. const htmlText = await res.text();
  6995. const $page = $(htmlText);
  6996. const text = $page.find('#Rightbar a[href^="/notifications"]').text();
  6997. if (text.includes("未读提醒")) {
  6998. const countStr = (_a = text.match(/\d+/)) == null ? void 0 : _a.at(0);
  6999. if (countStr) {
  7000. return Number((_b = text.match(/\d+/)) == null ? void 0 : _b.at(0));
  7001. }
  7002. } else {
  7003. return 0;
  7004. }
  7005. throw new Error("无法获取未读消息数量");
  7006. },
  7007. clickA(e2) {
  7008. let that = this;
  7009. if (e2.currentTarget.getAttribute("script"))
  7010. return;
  7011. if (that.stopMe)
  7012. return true;
  7013. let { pageType } = functions.checkPageType(e2.currentTarget);
  7014. let { href, id, title } = functions.parseA(e2.currentTarget);
  7015. switch (pageType) {
  7016. case PageType.Post:
  7017. if (id) {
  7018. that.clickPost(e2, id, href, title);
  7019. }
  7020. break;
  7021. case PageType.Node:
  7022. case PageType.Home:
  7023. case PageType.Changes:
  7024. return;
  7025. case PageType.Hot:
  7026. let date = e2.currentTarget.search.replace("?", "");
  7027. if (date === "setting") {
  7028. if (this.calendar.show) {
  7029. $("#Rightbar > .sep20:first").css("height", "var(--component-margin)");
  7030. } else {
  7031. $("#Rightbar > .sep20:first").css("height", "unset");
  7032. let now2 = dayjs();
  7033. this.calendar.year = now2.year();
  7034. this.calendar.month = now2.month();
  7035. this.calendar.dayCount = now2.daysInMonth();
  7036. this.calendar.firstDayWeek = now2.startOf("month").day();
  7037. this.calendar.select = `${this.calendar.year}-${this.calendar.month + 1}-${now2.date()}`;
  7038. }
  7039. this.calendar.show = !this.calendar.show;
  7040. functions.stopEvent(e2);
  7041. return;
  7042. }
  7043. let now = dayjs();
  7044. let day = "";
  7045. switch (Number(date)) {
  7046. case -1:
  7047. day = now.subtract(1, "day").format("YYYY-M-D");
  7048. break;
  7049. case -2:
  7050. day = now.subtract(2, "day").format("YYYY-M-D");
  7051. break;
  7052. case 3:
  7053. day = "3d";
  7054. break;
  7055. case 7:
  7056. day = "7d";
  7057. break;
  7058. case 30:
  7059. day = "30d";
  7060. break;
  7061. default:
  7062. day = date;
  7063. if (dayjs(day).isSame(now, "day")) {
  7064. functions.stopEvent(e2);
  7065. return location.reload();
  7066. }
  7067. }
  7068. if (day) {
  7069. fetch(DefaultVal.hotUrl + day + ".json").then(async (r2) => {
  7070. let r1 = await r2.json();
  7071. $(".cell.item.post-item").remove();
  7072. r1.reverse().map((v) => {
  7073. let s = `
  7074. <div class="cell item post-item id_${v.id}" style="" data-href="https://www.v2ex.com/t/${v.id}#reply${v.replyCount}">
  7075. <table cellpadding="0" cellspacing="0" border="0" width="100%">
  7076. <tbody>
  7077. <tr>
  7078. <td width="48" valign="top" align="center">
  7079. <a href="/member/${v.username}">
  7080. <img src="${v.avatar}" class="avatar"
  7081. border="0" align="default"
  7082. width="48"
  7083. style="width: 48px; max-height: 48px;"
  7084. alt="ice9191">
  7085. </a>
  7086. </td>
  7087. <td width="10"></td>
  7088. <td width="auto" valign="middle">
  7089. <span class="item_title">
  7090. <a href="https://www.v2ex.com/t/${v.id}#reply${v.replyCount}" class="topic-link" id="topic-link-${v.id}">${v.title}</a>
  7091. </span>
  7092. <div class="sep5"></div>
  7093. <span class="topic_info">
  7094. <div class="votes"></div>
  7095. <a class="node" href="/go/${v.nodeUrl}">${v.nodeTitle}</a> &nbsp;•&nbsp;
  7096. <strong><a href="/member/${v.username}">${v.username}</a></strong> &nbsp;•&nbsp;
  7097. <span title="${v.lastReplyDate}">${v.lastReplyDateAgo}</span> &nbsp;•&nbsp; 最后回复来自
  7098. <strong><a href="/member/${v.lastReplyUsername}">${v.lastReplyUsername}</a></strong>
  7099. </span>
  7100. </td>
  7101. <td width="70" align="right" valign="middle" style="position: relative;">
  7102. <a href="/t/${v.id}#reply${v.replyCount}" class="count_livid">${v.replyCount}</a>
  7103. <div data-id="${v.id}" class="toggle">预览</div>
  7104. </td>
  7105. </tr>
  7106. </tbody>
  7107. </table>
  7108. </div>
  7109. `;
  7110. $("#app").after($(s));
  7111. });
  7112. }).catch((e3) => {
  7113. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "暂无点击日期的最热数据!" });
  7114. });
  7115. }
  7116. functions.stopEvent(e2);
  7117. return;
  7118. default:
  7119. if (e2.currentTarget.href.includes("/settings/night/toggle"))
  7120. return;
  7121. if (e2.currentTarget.href === location.origin + "/#;")
  7122. return;
  7123. if (e2.currentTarget.href.includes("/notifications")) {
  7124. this.pageInfo.number = 0;
  7125. $("#money").parent().prev().replaceWith(`<a href="/notifications">0 未读提醒</a>`);
  7126. if (this.config.notice.takeOverNoticePage) {
  7127. this.notificationModal.loading = true;
  7128. this.notificationModal.show = true;
  7129. fetch(href).then(async (r2) => {
  7130. let htmlText = await r2.text();
  7131. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7132. let res = htmlText.match(/var notificationBottom = ([\d]+);/);
  7133. if (res && res[1]) {
  7134. window.notificationBottom = Number(res[1]);
  7135. console.log(" window.notificationBottom", window.notificationBottom);
  7136. }
  7137. let body = $(bodyText[0]);
  7138. let list = body.find("#notifications");
  7139. list.children().each(function() {
  7140. that.checkReplyItemType(this);
  7141. });
  7142. let h2 = list.html();
  7143. let d2 = body.find("#Main > .box > .header .fr .gray");
  7144. if (d2.length) {
  7145. this.notificationModal.total = d2.text();
  7146. }
  7147. this.notificationModal.list = h2;
  7148. let p = list.next();
  7149. let tds = p.find(".button");
  7150. tds.each(function() {
  7151. let href2 = this.getAttribute("onclick");
  7152. if (href2) {
  7153. this.innerHTML = `<a href=${href2.replace("location.href=", "")}>${this.innerHTML}</a>`;
  7154. this.setAttribute("onclick", "");
  7155. }
  7156. });
  7157. this.notificationModal.pages = p.html();
  7158. this.notificationModal.loading = false;
  7159. }).catch((e3) => {
  7160. this.notificationModal.loading = false;
  7161. });
  7162. functions.stopEvent(e2);
  7163. return;
  7164. }
  7165. }
  7166. if (that.config.newTabOpen) {
  7167. functions.stopEvent(e2);
  7168. functions.openNewTab(e2.currentTarget.href, that.config.newTabOpenActive);
  7169. }
  7170. return;
  7171. }
  7172. },
  7173. async clickPost(e2, id, href, title = "") {
  7174. if (id) {
  7175. if (this.config.clickPostItemOpenDetail) {
  7176. functions.stopEvent(e2);
  7177. let postItem = getDefaultPost();
  7178. let index = this.list.findIndex((v) => v.id == id);
  7179. if (index > -1) {
  7180. postItem = this.list[index];
  7181. }
  7182. if (!postItem.title)
  7183. postItem.title = title ?? "加载中";
  7184. postItem.id = id;
  7185. postItem.href = href;
  7186. this.getPostDetail(postItem);
  7187. return;
  7188. }
  7189. if (this.config.newTabOpen) {
  7190. functions.stopEvent(e2);
  7191. functions.openNewTab(`https://www.v2ex.com/t/${id}?p=1`, this.config.newTabOpenActive);
  7192. }
  7193. }
  7194. },
  7195. showPost() {
  7196. this.show = true;
  7197. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  7198. $(this).hide();
  7199. });
  7200. },
  7201. showConfig() {
  7202. this.configModal.show = true;
  7203. },
  7204. resetTitle() {
  7205. let r2 = document.title.match(/\s?\(\d+\)\s?/);
  7206. if (r2 && r2.length) {
  7207. this.pageInfo.title = document.title.replace(r2[0], "");
  7208. } else {
  7209. this.pageInfo.title = document.title;
  7210. }
  7211. },
  7212. async getNotice(body) {
  7213. if (!body) {
  7214. let res = await fetch("/t");
  7215. if (res.status === 200) {
  7216. let htmlText = await res.text();
  7217. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7218. body = $(bodyText[0]);
  7219. }
  7220. }
  7221. let notify = body.find('a[href="/notifications"]');
  7222. if (notify.length) {
  7223. this.resetTitle();
  7224. let text = notify.text();
  7225. if (text !== "0 未读提醒") {
  7226. this.pageInfo.number = text.replace(" 未读提醒", "");
  7227. console.log("text", text, this.config.notice.ddWebhook);
  7228. if (this.config.notice.text !== text) {
  7229. console.log("有新消息", text, this.config.notice.text);
  7230. $("#money").parent().prev().replaceWith(`<div><div class="orange-dot"></div><strong><a href="/notifications">${text}</a></strong></div>`);
  7231. this.config.notice.text = text;
  7232. if (this.config.notice.ddWebhook) {
  7233. let n2 = /* @__PURE__ */ new Date();
  7234. let s = n2.getSeconds();
  7235. s = s < 10 ? "0" + s : s;
  7236. let m = n2.getMinutes();
  7237. m = m < 10 ? "0" + m : m;
  7238. let h2 = n2.getHours();
  7239. h2 = h2 < 10 ? "0" + h2 : h2;
  7240. $.ajax("https://car-back.ttentau.top/index.php/v1/config/forward", {
  7241. method: "POST",
  7242. contentType: "application/json",
  7243. data: JSON.stringify({
  7244. url: this.config.notice.ddWebhook,
  7245. "text": notify.text() + `,时间:${n2.getFullYear()}/${n2.getMonth() + 1}/${n2.getDate()} ${h2}:${m}:${s}`
  7246. })
  7247. });
  7248. }
  7249. }
  7250. } else {
  7251. $("#money").parent().prev().replaceWith(`<a href="/notifications">${text}</a>`);
  7252. console.log("消息清空");
  7253. this.config.notice.text = "";
  7254. }
  7255. }
  7256. },
  7257. async winCb({ type, value }) {
  7258. console.log("回调的类型", type, value);
  7259. if (type === "openSetting") {
  7260. this.showConfig();
  7261. }
  7262. if (type === "syncData") {
  7263. this.stopMe = window.stopMe;
  7264. }
  7265. if (type === "getConfigSuccess") {
  7266. if (window.config.version < DefaultVal.currentVersion && window.isDeadline) {
  7267. $(".v2next-setting span").after(`<div class="new v2next-new">new</div>`);
  7268. }
  7269. if (window.isLogin && window.config.notice.loopCheckNotice) {
  7270. this.getNotice($(document.body));
  7271. this.timer = setInterval(this.getNotice, 1e3 * 60 * Number(window.config.notice.loopCheckNoticeInterval));
  7272. }
  7273. this.config = window.config;
  7274. this.tags = window.user.tags;
  7275. }
  7276. if (type === "syncList") {
  7277. this.list = Object.assign(this.list, window.postList);
  7278. }
  7279. if (type === "warningNotice") {
  7280. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: value });
  7281. }
  7282. if (this.stopMe)
  7283. return;
  7284. if (type === "restorePost") {
  7285. this.show = false;
  7286. this.loading = false;
  7287. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "脚本无法查看此页面!" });
  7288. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  7289. $(this).show();
  7290. });
  7291. }
  7292. if (type === "postContent") {
  7293. this.current = Object.assign(this.current, value);
  7294. this.current.inList = true;
  7295. if (this.config.autoOpenDetail) {
  7296. this.showPost();
  7297. }
  7298. }
  7299. if (type === "postReplies") {
  7300. this.loading = false;
  7301. this.current = Object.assign(this.current, value);
  7302. this.list.push(functions.clone(this.current));
  7303. }
  7304. },
  7305. regenerateReplyList() {
  7306. if (this.current.replyList.length) {
  7307. functions.createList(this.current, this.current.replyList);
  7308. } else {
  7309. this.current.replyCount = 0;
  7310. this.current.nestedReplies = [];
  7311. this.current.nestedRedundReplies = [];
  7312. }
  7313. if (this.list.length) {
  7314. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7315. if (rIndex > -1) {
  7316. this.list[rIndex] = functions.clone(this.current);
  7317. }
  7318. }
  7319. },
  7320. initEvent() {
  7321. eventBus.on(CMD.CHANGE_COMMENT_THANK, (val) => {
  7322. const { id, type } = val;
  7323. let currentI = this.current.replyList.findIndex((i) => i.id === id);
  7324. if (currentI > -1) {
  7325. this.current.replyList[currentI].isThanked = type === "add";
  7326. if (type === "add") {
  7327. this.current.replyList[currentI].thankCount++;
  7328. } else {
  7329. this.current.replyList[currentI].thankCount--;
  7330. }
  7331. this.regenerateReplyList();
  7332. }
  7333. });
  7334. eventBus.on(CMD.CHANGE_POST_THANK, (val) => {
  7335. const { id, type } = val;
  7336. this.current.isThanked = type === "add";
  7337. if (type === "add") {
  7338. this.current.thankCount++;
  7339. } else {
  7340. this.current.thankCount--;
  7341. }
  7342. let currentI = this.list.findIndex((i) => i.id === id);
  7343. if (currentI > -1) {
  7344. this.list[currentI].isThanked = type === "add";
  7345. if (type === "add") {
  7346. this.list[currentI].thankCount++;
  7347. } else {
  7348. this.list[currentI].thankCount++;
  7349. }
  7350. }
  7351. });
  7352. eventBus.on(CMD.REMOVE, (val) => {
  7353. let removeIndex = this.current.replyList.findIndex((i) => i.floor === val);
  7354. if (removeIndex > -1) {
  7355. this.current.replyList.splice(removeIndex, 1);
  7356. }
  7357. this.regenerateReplyList();
  7358. });
  7359. eventBus.on(CMD.IGNORE, () => {
  7360. this.show = false;
  7361. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7362. if (rIndex > -1) {
  7363. this.list.splice(rIndex, 1);
  7364. }
  7365. this.current = getDefaultPost();
  7366. });
  7367. eventBus.on(CMD.MERGE, (val) => {
  7368. this.current = Object.assign(this.current, val);
  7369. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7370. if (rIndex > -1) {
  7371. this.list[rIndex] = functions.clone(this.current);
  7372. }
  7373. });
  7374. eventBus.on(CMD.ADD_REPLY, (item) => {
  7375. this.current.replyList.push(item);
  7376. this.regenerateReplyList();
  7377. });
  7378. eventBus.on(CMD.REFRESH_ONCE, async (once) => {
  7379. if (once) {
  7380. if (typeof once === "string") {
  7381. let res = once.match(/var once = "([\d]+)";/);
  7382. if (res && res[1]) {
  7383. this.current.once = Number(res[1]);
  7384. return;
  7385. }
  7386. }
  7387. if (typeof once === "number") {
  7388. this.current.once = once;
  7389. return;
  7390. }
  7391. }
  7392. window.fetchOnce().then((r2) => {
  7393. this.current.once = r2;
  7394. });
  7395. });
  7396. eventBus.on(CMD.REMOVE_TAG, async ({ username, tag }) => {
  7397. let oldTag = functions.clone(this.tags);
  7398. let tags = this.tags[username] ?? [];
  7399. let rIndex = tags.findIndex((v) => v === tag);
  7400. if (rIndex > -1) {
  7401. tags.splice(rIndex, 1);
  7402. }
  7403. this.tags[username] = tags;
  7404. let res = await window.parse.saveTags(this.tags);
  7405. if (!res) {
  7406. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签删除失败!" });
  7407. this.tags = oldTag;
  7408. }
  7409. });
  7410. eventBus.on(CMD.SHOW_CONFIRM_MODAL, (val) => {
  7411. const { rect, title, id } = val;
  7412. this.popConfirmModal.show = true;
  7413. this.popConfirmModal.title = title;
  7414. this.popConfirmModal.id = id;
  7415. vue.nextTick(() => {
  7416. this.$refs.tip.style.top = rect.top + "px";
  7417. this.$refs.tip.style.left = rect.left + rect.width / 2 - 50 + "px";
  7418. });
  7419. });
  7420. },
  7421. async getPostDetail(post) {
  7422. this.current = post;
  7423. this.show = true;
  7424. let url = location.origin + "/t/" + this.current.id;
  7425. this.current.url = url;
  7426. let alreadyHasReply = this.current.replyList.length;
  7427. if (alreadyHasReply) {
  7428. this.refreshLoading = true;
  7429. } else {
  7430. this.loading = true;
  7431. functions.getPostDetailByApi(this.current.id).then((d2) => {
  7432. d2.replyCount = d2.replies;
  7433. this.current = Object.assign(this.current, d2);
  7434. if (this.current.replyCount > window.config.maxReplyCountLimit) {
  7435. functions.openNewTab(`${location.origin}/t/${this.current.id}?p=1&script=1`, true);
  7436. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "由于回复数量较多,已为您单独打开此主题" });
  7437. this.loading = this.show = false;
  7438. return;
  7439. } else {
  7440. this.current.jsonContent = `
  7441. <div class="cell">
  7442. <div class="topic_content">
  7443. <div class="markdown_body">
  7444. ${(d2 == null ? void 0 : d2.content_rendered) ?? ""}
  7445. </div>
  7446. </div>
  7447. </div>`;
  7448. }
  7449. });
  7450. }
  7451. let apiRes = await window.fetch(url + "?p=1");
  7452. if (apiRes.status === 404) {
  7453. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "主题未找到" });
  7454. return this.refreshLoading = this.loading = false;
  7455. }
  7456. if (apiRes.status === 403) {
  7457. this.refreshLoading = this.show = this.loading = false;
  7458. functions.openNewTab(`${location.origin}/t/${post.id}?p=1&script=0`, true);
  7459. return;
  7460. }
  7461. if (apiRes.redirected) {
  7462. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有权限" });
  7463. return this.refreshLoading = this.loading = false;
  7464. }
  7465. let htmlText = await apiRes.text();
  7466. let hasPermission = htmlText.search("你要查看的页面需要先登录(不可用)");
  7467. if (hasPermission > -1) {
  7468. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你要查看的页面需要先登录(不可用)" });
  7469. return this.refreshLoading = this.loading = false;
  7470. }
  7471. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7472. let body = $(bodyText[0]);
  7473. decodeEmail(body);
  7474. await window.parse.getPostDetail(this.current, body, htmlText);
  7475. let index = this.list.findIndex((v) => v.id == this.current.id);
  7476. if (index > -1) {
  7477. this.list[index] = functions.clone(this.current);
  7478. } else {
  7479. this.list.push(functions.clone(this.current));
  7480. }
  7481. this.refreshLoading = this.loading = false;
  7482. await window.parse.parseOp(this.current);
  7483. console.log("当前主题", this.current);
  7484. },
  7485. addTargetUserTag() {
  7486. eventBus.emit(CMD.ADD_TAG, window.targetUserName);
  7487. },
  7488. removeTargetUserTag(tag) {
  7489. eventBus.emit(CMD.REMOVE_TAG, { username: window.targetUserName, tag });
  7490. },
  7491. popConfirmModalCancel() {
  7492. this.popConfirmModal.show = false;
  7493. },
  7494. popConfirmModalConfirm() {
  7495. this.popConfirmModalCancel();
  7496. eventBus.emit(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.popConfirmModal.id);
  7497. }
  7498. }
  7499. };
  7500. const _withScopeId = (n2) => (vue.pushScopeId("data-v-d9e3ae7c"), n2 = n2(), vue.popScopeId(), n2);
  7501. const _hoisted_1 = {
  7502. key: 0,
  7503. class: ""
  7504. };
  7505. const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep" }, null, -1));
  7506. const _hoisted_3 = { class: "box calender" };
  7507. const _hoisted_4 = { class: "month" };
  7508. const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "fade" }, "历史最热", -1));
  7509. const _hoisted_6 = { class: "ca-title" };
  7510. const _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "calender-header" }, [
  7511. /* @__PURE__ */ vue.createElementVNode("div", null, "日"),
  7512. /* @__PURE__ */ vue.createElementVNode("div", null, "一"),
  7513. /* @__PURE__ */ vue.createElementVNode("div", null, "二"),
  7514. /* @__PURE__ */ vue.createElementVNode("div", null, "三"),
  7515. /* @__PURE__ */ vue.createElementVNode("div", null, "四"),
  7516. /* @__PURE__ */ vue.createElementVNode("div", null, "五"),
  7517. /* @__PURE__ */ vue.createElementVNode("div", null, "六")
  7518. ], -1));
  7519. const _hoisted_8 = { class: "days" };
  7520. const _hoisted_9 = ["onClick"];
  7521. const _hoisted_10 = ["href"];
  7522. const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep" }, null, -1));
  7523. const _hoisted_12 = {
  7524. key: 0,
  7525. class: "target-user-tags p1"
  7526. };
  7527. const _hoisted_13 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "标签:", -1));
  7528. const _hoisted_14 = { class: "my-tag" };
  7529. const _hoisted_15 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  7530. const _hoisted_16 = ["onClick"];
  7531. const _hoisted_17 = {
  7532. key: 1,
  7533. class: "my-box p2",
  7534. style: { "margin-top": "2rem", "margin-bottom": "0" }
  7535. };
  7536. const _hoisted_18 = {
  7537. key: 0,
  7538. class: "flex flex-center"
  7539. };
  7540. const _hoisted_19 = {
  7541. key: 1,
  7542. class: "loaded"
  7543. };
  7544. const _hoisted_20 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "楼中楼解析完成", -1));
  7545. const _hoisted_21 = {
  7546. key: 0,
  7547. ref: "tip",
  7548. class: "pop-confirm-content"
  7549. };
  7550. const _hoisted_22 = { class: "text" };
  7551. const _hoisted_23 = { class: "options" };
  7552. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  7553. const _component_Setting = vue.resolveComponent("Setting");
  7554. const _component_TagModal = vue.resolveComponent("TagModal");
  7555. const _component_PostDetail = vue.resolveComponent("PostDetail");
  7556. const _component_Base64Tooltip = vue.resolveComponent("Base64Tooltip");
  7557. const _component_MsgModal = vue.resolveComponent("MsgModal");
  7558. const _component_NotificationModal = vue.resolveComponent("NotificationModal");
  7559. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  7560. const _component_BaseButton = vue.resolveComponent("BaseButton");
  7561. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  7562. vue.createVNode(_component_Setting, {
  7563. modelValue: $data.config,
  7564. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.config = $event),
  7565. show: $data.configModal.show,
  7566. "onUpdate:show": _cache[1] || (_cache[1] = ($event) => $data.configModal.show = $event)
  7567. }, null, 8, ["modelValue", "show"]),
  7568. vue.createVNode(_component_TagModal, {
  7569. tags: $data.tags,
  7570. "onUpdate:tags": _cache[2] || (_cache[2] = ($event) => $data.tags = $event)
  7571. }, null, 8, ["tags"]),
  7572. vue.createVNode(_component_PostDetail, {
  7573. modelValue: $data.show,
  7574. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.show = $event),
  7575. ref: "postDetail",
  7576. displayType: $data.config.commentDisplayType,
  7577. "onUpdate:displayType": _cache[4] || (_cache[4] = ($event) => $data.config.commentDisplayType = $event),
  7578. onRefresh: _cache[5] || (_cache[5] = ($event) => $options.getPostDetail($data.current)),
  7579. loading: $data.loading,
  7580. refreshLoading: $data.refreshLoading
  7581. }, null, 8, ["modelValue", "displayType", "loading", "refreshLoading"]),
  7582. vue.createVNode(_component_Base64Tooltip),
  7583. vue.createVNode(_component_MsgModal),
  7584. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "#Rightbar > .sep20" }, [
  7585. $data.calendar.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  7586. _hoisted_2,
  7587. vue.createElementVNode("div", _hoisted_3, [
  7588. vue.createElementVNode("div", _hoisted_4, [
  7589. _hoisted_5,
  7590. vue.createElementVNode("div", _hoisted_6, [
  7591. vue.createElementVNode("i", {
  7592. class: "fa fa-arrow-left",
  7593. onClick: _cache[6] || (_cache[6] = ($event) => $options.getMonthDayInfo(-1)),
  7594. "aria-hidden": "true"
  7595. }),
  7596. vue.createElementVNode("span", null, vue.toDisplayString($data.calendar.year) + "年" + vue.toDisplayString($data.calendar.month + 1) + "月", 1),
  7597. vue.createElementVNode("i", {
  7598. class: "fa fa-arrow-right",
  7599. onClick: _cache[7] || (_cache[7] = ($event) => $options.getMonthDayInfo(1)),
  7600. "aria-hidden": "true"
  7601. })
  7602. ])
  7603. ]),
  7604. _hoisted_7,
  7605. vue.createElementVNode("div", _hoisted_8, [
  7606. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.calendar.dayCount + $data.calendar.firstDayWeek, (i) => {
  7607. return vue.openBlock(), vue.createElementBlock("div", {
  7608. class: vue.normalizeClass([
  7609. "day",
  7610. $data.calendar.select === `${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}` ? "active" : ""
  7611. ]),
  7612. onClick: ($event) => $data.calendar.select = `${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}`
  7613. }, [
  7614. i - $data.calendar.firstDayWeek > 0 ? (vue.openBlock(), vue.createElementBlock("a", {
  7615. key: 0,
  7616. href: `/v2hot?${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}`
  7617. }, vue.toDisplayString(i - $data.calendar.firstDayWeek > 0 ? i - $data.calendar.firstDayWeek : ""), 9, _hoisted_10)) : vue.createCommentVNode("", true)
  7618. ], 10, _hoisted_9);
  7619. }), 256))
  7620. ])
  7621. ]),
  7622. _hoisted_11
  7623. ])) : vue.createCommentVNode("", true)
  7624. ])),
  7625. vue.createVNode(_component_NotificationModal, {
  7626. modelValue: $data.notificationModal.show,
  7627. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.notificationModal.show = $event),
  7628. list: $data.notificationModal.list,
  7629. loading: $data.notificationModal.loading,
  7630. total: $data.notificationModal.total,
  7631. pages: $data.notificationModal.pages
  7632. }, null, 8, ["modelValue", "list", "loading", "total", "pages"]),
  7633. !$data.stopMe ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  7634. $options.isMember && $data.isLogin && $data.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
  7635. _hoisted_13,
  7636. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.targetUserTags, (i) => {
  7637. return vue.openBlock(), vue.createElementBlock("span", _hoisted_14, [
  7638. _hoisted_15,
  7639. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  7640. vue.createElementVNode("i", {
  7641. class: "fa fa-trash-o remove",
  7642. onClick: ($event) => $options.removeTargetUserTag(i)
  7643. }, null, 8, _hoisted_16)
  7644. ]);
  7645. }), 256)),
  7646. vue.createElementVNode("span", {
  7647. class: "add-tag ago",
  7648. onClick: _cache[9] || (_cache[9] = (...args) => $options.addTargetUserTag && $options.addTargetUserTag(...args)),
  7649. title: "添加标签"
  7650. }, "+")
  7651. ])) : vue.createCommentVNode("", true),
  7652. $options.isPost && !$data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [
  7653. $data.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18, [
  7654. vue.createVNode(_component_BaseLoading)
  7655. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
  7656. _hoisted_20,
  7657. vue.createVNode(_component_BaseButton, {
  7658. size: "small",
  7659. onClick: $options.showPost
  7660. }, {
  7661. default: vue.withCtx(() => [
  7662. vue.createTextVNode("点击显示")
  7663. ]),
  7664. _: 1
  7665. }, 8, ["onClick"])
  7666. ]))
  7667. ])) : vue.createCommentVNode("", true)
  7668. ], 64)) : vue.createCommentVNode("", true),
  7669. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  7670. vue.createVNode(vue.Transition, null, {
  7671. default: vue.withCtx(() => [
  7672. $data.popConfirmModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, [
  7673. vue.createElementVNode("div", _hoisted_22, vue.toDisplayString($data.popConfirmModal.title), 1),
  7674. vue.createElementVNode("div", _hoisted_23, [
  7675. vue.createVNode(_component_BaseButton, {
  7676. type: "link",
  7677. size: "small",
  7678. onClick: vue.withModifiers($options.popConfirmModalCancel, ["stop"])
  7679. }, {
  7680. default: vue.withCtx(() => [
  7681. vue.createTextVNode("取消")
  7682. ]),
  7683. _: 1
  7684. }, 8, ["onClick"]),
  7685. vue.createVNode(_component_BaseButton, {
  7686. size: "small",
  7687. onClick: vue.withModifiers($options.popConfirmModalConfirm, ["stop"])
  7688. }, {
  7689. default: vue.withCtx(() => [
  7690. vue.createTextVNode("确认")
  7691. ]),
  7692. _: 1
  7693. }, 8, ["onClick"])
  7694. ])
  7695. ], 512)) : vue.createCommentVNode("", true)
  7696. ]),
  7697. _: 1
  7698. })
  7699. ]))
  7700. ], 64);
  7701. }
  7702. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-d9e3ae7c"]]);
  7703. let isMobile = !document.querySelector("#Rightbar");
  7704. let $section = document.createElement("section");
  7705. $section.id = "app";
  7706. function run() {
  7707. window.user = DefaultUser;
  7708. window.targetUserName = "";
  7709. window.pageType = void 0;
  7710. window.pageData = { pageNo: 1 };
  7711. window.config = getDefaultConfig();
  7712. window.isNight = $(".Night").length === 1;
  7713. window.cb = null;
  7714. window.stopMe = false;
  7715. window.isLogin = false;
  7716. window.postList = [];
  7717. window.isDeadline = dayjs().isAfter(dayjs("2024-11-26"));
  7718. window.parse = {
  7719. //解析主题内容
  7720. async parsePostContent(post, body, htmlText) {
  7721. let once = htmlText.match(/var once = "([\d]+)";/);
  7722. if (once && once[1]) {
  7723. post.once = once[1];
  7724. }
  7725. post.isReport = htmlText.includes("你已对本主题进行了报告");
  7726. let wrapper = body.find("#Main");
  7727. if (!post.title || !post.content_rendered) {
  7728. let h1 = wrapper.find("h1");
  7729. if (h1) {
  7730. post.title = h1[0].innerText;
  7731. }
  7732. }
  7733. let as = wrapper.find(".header > a");
  7734. if (as.length) {
  7735. post.node.title = as[1].innerText;
  7736. post.node.url = as[1].href;
  7737. }
  7738. let aName = wrapper.find(".header small.gray a:nth-child(1)");
  7739. if (aName.length) {
  7740. post.member.username = aName[0].innerText;
  7741. }
  7742. let spanEl = wrapper.find(".header small.gray span");
  7743. if (spanEl.length) {
  7744. post.createDateAgo = spanEl[0].innerText;
  7745. post.createDate = spanEl[0].title;
  7746. }
  7747. let avatarEl = wrapper.find(".header .avatar");
  7748. if (avatarEl.length) {
  7749. post.member.avatar_large = avatarEl[0].src;
  7750. }
  7751. let topic_buttons = body.find(".topic_buttons");
  7752. if (topic_buttons.length) {
  7753. let favoriteNode = topic_buttons.find(".tb:first");
  7754. if (favoriteNode.length) {
  7755. post.isFavorite = favoriteNode[0].innerText === "取消收藏";
  7756. }
  7757. let ignoreNode = topic_buttons.find(".tb:nth-child(3)");
  7758. if (ignoreNode.length) {
  7759. post.isIgnore = ignoreNode[0].innerText === "取消忽略";
  7760. }
  7761. let thankNode = topic_buttons.find("#topic_thank .tb");
  7762. if (!thankNode.length) {
  7763. post.isThanked = true;
  7764. }
  7765. let topic_stats = topic_buttons.find(".topic_stats");
  7766. if (topic_stats.length) {
  7767. let text = topic_stats[0].innerText;
  7768. let reg1 = text.matchAll(/([\d]+)[\s]*人收藏/g);
  7769. let collectCountReg = [...reg1];
  7770. if (collectCountReg.length) {
  7771. post.collectCount = Number(collectCountReg[0][1]);
  7772. }
  7773. reg1 = text.matchAll(/([\d]+)[\s]*likes/g);
  7774. collectCountReg = [...reg1];
  7775. if (collectCountReg.length) {
  7776. post.collectCount = Number(collectCountReg[0][1]);
  7777. }
  7778. let reg2 = text.matchAll(/([\d]+)[\s]*人感谢/g);
  7779. let thankCountReg = [...reg2];
  7780. if (thankCountReg.length) {
  7781. post.thankCount = Number(thankCountReg[0][1]);
  7782. }
  7783. let reg3 = text.matchAll(/([\d]+)[\s]*次点击/g);
  7784. let clickCountReg = [...reg3];
  7785. if (clickCountReg.length) {
  7786. post.clickCount = Number(clickCountReg[0][1]);
  7787. }
  7788. reg3 = text.matchAll(/([\d]+)[\s]*views/g);
  7789. clickCountReg = [...reg3];
  7790. if (clickCountReg.length) {
  7791. post.clickCount = Number(clickCountReg[0][1]);
  7792. }
  7793. }
  7794. }
  7795. let header = body.find(`#Main .box`).first();
  7796. let temp = header.clone();
  7797. temp.find(".topic_buttons").remove();
  7798. temp.find(".inner").remove();
  7799. temp.find(".header").remove();
  7800. functions.checkPhotoLink2Img(temp[0]);
  7801. post.headerTemplate = temp[0].innerHTML;
  7802. return post;
  7803. },
  7804. //解析OP信息
  7805. async parseOp(post) {
  7806. if (!post.member.id) {
  7807. let userRes = await fetch(location.origin + "/api/members/show.json?username=" + post.member.username);
  7808. if (userRes.status === 200) {
  7809. post.member = await userRes.json();
  7810. }
  7811. }
  7812. if (post.member.id) {
  7813. let date = new Date(post.member.created * 1e3);
  7814. let createStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
  7815. date.setHours(0);
  7816. date.setMinutes(0);
  7817. date.setSeconds(0);
  7818. date.setMilliseconds(0);
  7819. let now = /* @__PURE__ */ new Date();
  7820. now.setHours(0);
  7821. now.setMinutes(0);
  7822. now.setSeconds(0);
  7823. now.setMilliseconds(0);
  7824. let d2 = now.getTime() - date.getTime();
  7825. let isNew = d2 <= 1e3 * 60 * 60 * 24 * 15;
  7826. post.member.createDate = createStr + " 注册(不可用)";
  7827. post.member.isNew = isNew;
  7828. } else {
  7829. post.member.createDate = "用户已被注销/封禁";
  7830. post.member.isNew = true;
  7831. }
  7832. return post;
  7833. },
  7834. //获取主题所有回复
  7835. async getPostAllReplies(post, body, htmlText, pageNo = 1) {
  7836. var _a, _b;
  7837. if (body.find("#no-comments-yet").length) {
  7838. return post;
  7839. }
  7840. let boxs = body.find(`#Main .box`);
  7841. let box = boxs[1];
  7842. let cells = box.querySelectorAll(".cell");
  7843. if (cells && cells.length) {
  7844. post.fr = cells[0].querySelector(".cell .fr").innerHTML;
  7845. cells = Array.from(cells);
  7846. let snow = cells[0].querySelector(".snow");
  7847. post.lastReplyDate = ((_b = (_a = snow == null ? void 0 : snow.nextSibling) == null ? void 0 : _a.nodeValue) == null ? void 0 : _b.trim()) || "";
  7848. let repliesMap = [];
  7849. if (cells[1].id) {
  7850. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(1)) });
  7851. let replyList = functions.getAllReply(repliesMap);
  7852. functions.createList(post, replyList);
  7853. return post;
  7854. } else {
  7855. let promiseList = [];
  7856. return new Promise((resolve, reject) => {
  7857. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7858. let pages = cells[1].querySelectorAll("a.page_normal");
  7859. pages = Array.from(pages);
  7860. let url = location.origin + "/t/" + post.id;
  7861. for (let i = 0; i < pages.length; i++) {
  7862. let currentPageNo = Number(pages[i].innerText);
  7863. promiseList.push(this.fetchPostOtherPageReplies(url + "?p=" + currentPageNo, currentPageNo));
  7864. }
  7865. Promise.allSettled(promiseList).then(
  7866. (results) => {
  7867. results.filter((result) => result.status === "fulfilled").map((v) => repliesMap.push(v.value));
  7868. let replyList = functions.getAllReply(repliesMap);
  7869. functions.createList(post, replyList);
  7870. resolve(post);
  7871. }
  7872. );
  7873. });
  7874. }
  7875. }
  7876. },
  7877. //请求主题其他页的回复
  7878. fetchPostOtherPageReplies(href, pageNo) {
  7879. return new Promise((resolve) => {
  7880. $.get(href).then((res) => {
  7881. let s = res.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7882. let box = $(s[0]).find("#Main .box")[1];
  7883. let cells = box.querySelectorAll(".cell");
  7884. cells = Array.from(cells);
  7885. resolve({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7886. }).catch((r2) => {
  7887. if (r2.status === 403) {
  7888. functions.cbChecker({ type: "restorePost", value: null });
  7889. }
  7890. });
  7891. });
  7892. },
  7893. //解析页面的回复
  7894. parsePageReplies(nodes) {
  7895. let replyList = [];
  7896. nodes.forEach((node, index) => {
  7897. if (!node.id)
  7898. return;
  7899. let item = {
  7900. level: 0,
  7901. thankCount: 0,
  7902. replyCount: 0,
  7903. isThanked: false,
  7904. isOp: false,
  7905. isDup: false,
  7906. id: node.id.replace("r_", "")
  7907. };
  7908. let reply_content = node.querySelector(".reply_content");
  7909. functions.checkPhotoLink2Img(reply_content);
  7910. item.reply_content = reply_content.innerHTML;
  7911. item.reply_text = reply_content.textContent;
  7912. let { users, floor } = this.parseReplyContent(item.reply_content);
  7913. item.hideCallUserReplyContent = item.reply_content;
  7914. if (users.length === 1) {
  7915. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(?:<ul [\s\S]+<\/ul>)?(\s#[\d]+)?\s(<br>)?/, () => "");
  7916. }
  7917. item.replyUsers = users;
  7918. item.replyFloor = floor;
  7919. let ago = node.querySelector(".ago");
  7920. item.date = ago.textContent;
  7921. let userNode = node.querySelector("strong a");
  7922. item.username = userNode.textContent;
  7923. let avatar = node.querySelector("td img");
  7924. item.avatar = avatar.src;
  7925. let no = node.querySelector(".no");
  7926. item.floor = Number(no.textContent);
  7927. let thank_area = node.querySelector(".thank_area");
  7928. if (thank_area) {
  7929. item.isThanked = thank_area.classList.contains("thanked");
  7930. }
  7931. let small = node.querySelector(".small");
  7932. if (small) {
  7933. item.thankCount = Number(small.textContent);
  7934. }
  7935. let op = node.querySelector(".op");
  7936. if (op) {
  7937. item.isOp = true;
  7938. }
  7939. let mod = node.querySelector(".mod");
  7940. if (mod) {
  7941. item.isMod = true;
  7942. }
  7943. replyList.push(item);
  7944. });
  7945. return replyList;
  7946. },
  7947. //解析回复内容,解析出@用户,回复楼层。用于后续生成嵌套楼层
  7948. parseReplyContent(str) {
  7949. if (!str)
  7950. return;
  7951. let users = [];
  7952. let getUsername = (userStr) => {
  7953. users.push(userStr);
  7954. };
  7955. let userReg = /@<a href="\/member\/([^'" ]+)/g;
  7956. let has = str.matchAll(userReg);
  7957. let res2 = [...has];
  7958. if (res2.length > 1) {
  7959. res2.map((item) => {
  7960. getUsername(item[1]);
  7961. });
  7962. }
  7963. if (res2.length === 1) {
  7964. getUsername(res2[0][1]);
  7965. }
  7966. let floor = -1;
  7967. if (users.length === 1) {
  7968. let floorReg = /@<a href="\/member\/[\s\S]+?<\/a>(?:<ul [\s\S]+<\/ul>)?[\s]+#([\d]+)/g;
  7969. let hasFloor = str.matchAll(floorReg);
  7970. let res = [...hasFloor];
  7971. if (res.length) {
  7972. floor = Number(res[0][1]);
  7973. }
  7974. }
  7975. return { users, floor };
  7976. },
  7977. //获取主题详情
  7978. async getPostDetail(post, body, htmlText, pageNo = 1) {
  7979. post = await this.parsePostContent(post, body, htmlText);
  7980. return await this.getPostAllReplies(post, body, htmlText, pageNo);
  7981. },
  7982. //解析页面主题列表
  7983. parsePagePostList(list, box) {
  7984. list.forEach((itemDom) => {
  7985. let item_title = itemDom.querySelector(".item_title");
  7986. if (!item_title)
  7987. return;
  7988. let item = getDefaultPost();
  7989. itemDom.classList.add("post-item");
  7990. let a = item_title.querySelector("a");
  7991. let { href, id } = functions.parseA(a);
  7992. item.id = String(Number(id));
  7993. a.href = item.href = href;
  7994. item.url = location.origin + "/api/topics/show.json?id=" + item.id;
  7995. itemDom.classList.add(`id_${id}`);
  7996. itemDom.dataset["href"] = href;
  7997. let td = itemDom.querySelector("td:nth-child(4)");
  7998. if (!td) {
  7999. td = itemDom.querySelector("td:nth-child(2)");
  8000. }
  8001. td.style.position = "relative";
  8002. let toggle = document.createElement("div");
  8003. toggle.dataset["id"] = item.id;
  8004. toggle.classList.add("toggle");
  8005. toggle.innerText = "预览";
  8006. td.append(toggle);
  8007. if (window.config.viewType === "card") {
  8008. window.postList.push(item);
  8009. }
  8010. });
  8011. localStorage.setItem("d", "");
  8012. if (window.pageType === PageType.Home) {
  8013. const a = () => {
  8014. let d2;
  8015. if (window.user.username) {
  8016. d2 = $(window.atob("LnYycC1ob3Zlci1idG4=")).length;
  8017. } else {
  8018. d2 = $(window.atob("LnYycC1mb290ZXI=")).length;
  8019. }
  8020. if (d2 !== 0) {
  8021. window.stopMe = true;
  8022. localStorage.setItem("d", "1");
  8023. functions.cbChecker({ type: "syncData" });
  8024. } else {
  8025. localStorage.setItem("d", "");
  8026. }
  8027. };
  8028. a();
  8029. setTimeout(a, 1e3);
  8030. setTimeout(a, 2e3);
  8031. setTimeout(a, 3e3);
  8032. setTimeout(a, 5e3);
  8033. setTimeout(a, 1e4);
  8034. setTimeout(a, 15e3);
  8035. }
  8036. const setF = (res) => {
  8037. let rIndex = window.postList.findIndex((w) => w.id == res.id);
  8038. if (rIndex > -1) {
  8039. window.postList[rIndex] = Object.assign(window.postList[rIndex], res);
  8040. functions.cbChecker({ type: "syncList" });
  8041. }
  8042. let itemDom = box.querySelector(`.id_${res.id}`);
  8043. itemDom.classList.add("preview");
  8044. if (res.content_rendered) {
  8045. functions.appendPostContent(res, itemDom);
  8046. }
  8047. };
  8048. if (window.config.viewType === "card" && !window.stopMe) {
  8049. let cacheDataStr = localStorage.getItem("cacheData");
  8050. let cacheData = [];
  8051. if (cacheDataStr) {
  8052. cacheData = JSON.parse(cacheDataStr);
  8053. let now = Date.now();
  8054. cacheData = cacheData.filter((v) => {
  8055. return v.created > now / 1e3 - 60 * 60 * 24 * 3;
  8056. });
  8057. }
  8058. let fetchIndex = 0;
  8059. for (let i = 0; i < window.postList.length; i++) {
  8060. let item = window.postList[i];
  8061. let rItem = cacheData.find((w) => w.id == item.id);
  8062. if (rItem) {
  8063. rItem.href = item.href;
  8064. setF(rItem);
  8065. } else {
  8066. fetchIndex++;
  8067. setTimeout(() => {
  8068. $.get(item.url).then((v) => {
  8069. if (v && v.length) {
  8070. let res = getDefaultPost(v[0]);
  8071. res.href = item.href;
  8072. cacheData.push(res);
  8073. localStorage.setItem("cacheData", JSON.stringify(cacheData));
  8074. setF(res);
  8075. }
  8076. });
  8077. }, fetchIndex < 4 ? 0 : (fetchIndex - 4) * 1e3);
  8078. }
  8079. }
  8080. }
  8081. },
  8082. //创建记事本子条目
  8083. async createNoteItem(itemName) {
  8084. return new Promise(async (resolve) => {
  8085. if (!window.isLogin)
  8086. return resolve(null);
  8087. let data = new FormData();
  8088. data.append("content", itemName);
  8089. data.append("parent_id", 0);
  8090. data.append("syntax", 0);
  8091. let apiRes = await fetch(`${location.origin}/notes/new`, { method: "post", body: data });
  8092. if (apiRes.redirected && apiRes.status === 200) {
  8093. resolve(apiRes.url.substr(-5));
  8094. return;
  8095. }
  8096. resolve(null);
  8097. });
  8098. },
  8099. //编辑记事本子条目
  8100. async editNoteItem(val, id) {
  8101. if (!window.isLogin)
  8102. return;
  8103. if (!id)
  8104. return;
  8105. let data = new FormData();
  8106. data.append("content", val);
  8107. data.append("syntax", 0);
  8108. let apiRes = await fetch(`${location.origin}/notes/edit/${id}`, {
  8109. method: "post",
  8110. body: data
  8111. });
  8112. return apiRes.redirected && apiRes.status === 200;
  8113. },
  8114. //标签操作
  8115. async saveTags(val) {
  8116. if (!window.isLogin)
  8117. return;
  8118. for (const [key, value] of Object.entries(val)) {
  8119. if (!value.length)
  8120. delete val[key];
  8121. }
  8122. return await this.editNoteItem(window.user.tagPrefix + JSON.stringify(val), window.user.tagsId);
  8123. },
  8124. //imgur图片删除hash操作
  8125. async saveImgurList(val) {
  8126. if (!window.isLogin)
  8127. return;
  8128. return;
  8129. }
  8130. };
  8131. function initMonkeyMenu() {
  8132. try {
  8133. _GM_registerMenuCommand("脚本设置", () => {
  8134. functions.cbChecker({ type: "openSetting" });
  8135. });
  8136. _GM_registerMenuCommand("仓库地址", () => {
  8137. functions.openNewTab(DefaultVal.git, true);
  8138. });
  8139. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  8140. } catch (e2) {
  8141. console.error("无法使用Tampermonkey");
  8142. }
  8143. }
  8144. function initStyle() {
  8145. if (window.isNight) {
  8146. document.documentElement.classList.add("dark");
  8147. }
  8148. let style2 = `
  8149. html, body {
  8150. font-size: 62.5%;
  8151. }
  8152. :root{
  8153. --box-border-radius:8px;
  8154. }
  8155. .page_current, .page_normal {
  8156. --box-border-radius: 5px;
  8157. padding: .6rem 0.8rem!important;
  8158. }
  8159. .box{
  8160. box-shadow:rgba(0, 0, 0, 0.08) 0px 4px 12px;
  8161. }
  8162. #Tabs{
  8163. border-top-left-radius: var(--box-border-radius) !important;
  8164. border-top-right-radius: var(--box-border-radius) !important;
  8165. }
  8166. #Main .cell .count_livid {
  8167. font-size: 14px;
  8168. font-weight: bold;
  8169. padding: 3px 10px;
  8170. border-radius: 5px;
  8171. }
  8172.  
  8173. #Wrapper {
  8174. height: unset !important;
  8175. width: unset !important;
  8176. }
  8177.  
  8178. #Wrapper > .content {
  8179. height: unset !important;
  8180. width: unset !important;
  8181. max-width:1100px !important;
  8182. }
  8183.  
  8184. ${location.href.includes("wow") ? "" : `
  8185. .post-item {
  8186. background: white;
  8187. }
  8188. `}
  8189.  
  8190. .post-item > .post-content {
  8191. height: 0;
  8192. margin-top: 0;
  8193. }
  8194.  
  8195. .post-item:hover .toggle {
  8196. display: flex;
  8197. }
  8198.  
  8199. .toggle {
  8200. position: absolute;
  8201. right: ${window.config.viewType === "simple" ? "5rem" : 0};
  8202. top: ${window.config.viewType === "simple" ? 0 : "0.5rem"};
  8203. width: 5rem;
  8204. height: 100%;
  8205. display: flex;
  8206. justify-content: flex-end;
  8207. align-items: flex-end;
  8208. cursor: pointer;
  8209. font-size: 1.2rem;
  8210. color: var(--link-color);
  8211. display: none;
  8212. padding-right: 1rem;
  8213. }
  8214.  
  8215. .preview {
  8216. margin: 1rem 0;
  8217. border: 1px solid transparent;
  8218. border-radius: var(--box-border-radius);
  8219. cursor: pointer;
  8220. }
  8221.  
  8222. .preview:hover {
  8223. border: 1px solid #c8c8c8;
  8224. }
  8225.  
  8226. .preview > .post-content {
  8227. height: unset !important;
  8228. margin-top: 0.5rem !important;
  8229. }
  8230.  
  8231. .preview > .post-content.show-all {
  8232. max-height: unset;
  8233. -webkit-mask-image:none;
  8234. }
  8235.  
  8236. .preview .topic-link:link {
  8237. color: black !important;
  8238. }
  8239.  
  8240. .post-content {
  8241. margin-top: 0.5rem;
  8242. display: block;
  8243. max-height: 30rem;
  8244. overflow: hidden;
  8245. text-decoration: unset !important;
  8246. line-break: anywhere;
  8247. -webkit-mask-image: linear-gradient(180deg,#000 60%,transparent);
  8248. }
  8249.  
  8250. .show-more {
  8251. display: none;
  8252. }
  8253.  
  8254. .preview > .show-more {
  8255. font-size: 1.3rem;
  8256. text-align: right;
  8257. height: 3rem;
  8258. display: flex;
  8259. align-items: center;
  8260. justify-content: center;
  8261. position: relative;
  8262. z-index: 9;
  8263. }
  8264.  
  8265. .post-content:visited {
  8266. color: #afb9c1 !important;
  8267. }
  8268.  
  8269. .post-content:link {
  8270. color: #494949;
  8271. }
  8272. ${location.href.includes("wow") ? "" : `
  8273. .Night .post-item {
  8274. background: #18222d !important;
  8275. }
  8276. `}
  8277.  
  8278. .Night .preview {
  8279. border: 1px solid #3b536e;
  8280. }
  8281.  
  8282. .Night .preview > .post-content:link {
  8283. color: #d1d5d9;
  8284. }
  8285.  
  8286. .Night .preview > .post-content:visited {
  8287. color: #393f4e !important;
  8288. }
  8289. .Night .preview .topic-link:link {
  8290. color: #c0dbff !important;
  8291. }
  8292. ${window.config.viewType === "simple" ? `
  8293. ${window.pageType !== PageType.Member ? `
  8294. .item table tr td:first-child{display:none;}
  8295. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  8296. .item table tr td .sep5{display:none;}
  8297. .item table tr td .topic_info{display:none;}
  8298. .item {border-bottom:none;}
  8299. .avatar,#avatar{display:none;}
  8300. ` : ""}
  8301. #Logo {background-image:url('https://i.imgur.com/i9VgUtM.png');}
  8302. .bigger a, .top:nth-last-child(5){color: transparent!important;text-shadow: #b0b0b0 0 0 6px;user-select: none;}
  8303. // .bigger a:before,.top:nth-last-child(5):before{content:'Mona Lisa';position: absolute;background: white;}
  8304. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  8305. ` : ""}
  8306.  
  8307. ${window.config.customBgColor ? `#Wrapper {
  8308. background: ${window.config.customBgColor} !important;
  8309. background-image: unset !important;
  8310. }` : ""}
  8311. .top{
  8312. position:relative;
  8313. }
  8314. .new{
  8315. position: absolute;
  8316. background: red;
  8317. font-size: 10px;
  8318. border-radius: 4px;
  8319. padding: 0px 2px;
  8320. color: white;
  8321. right: -9px;
  8322. top: -3px;
  8323. }
  8324. }
  8325. `;
  8326. let addStyle2 = document.createElement("style");
  8327. addStyle2.rel = "stylesheet";
  8328. addStyle2.type = "text/css";
  8329. addStyle2.innerHTML = style2;
  8330. window.document.head.append(addStyle2);
  8331. }
  8332. function qianDao() {
  8333. let timeNow = (/* @__PURE__ */ new Date()).getUTCFullYear() + "/" + ((/* @__PURE__ */ new Date()).getUTCMonth() + 1) + "/" + (/* @__PURE__ */ new Date()).getUTCDate();
  8334. if (window.pageType === PageType.Home) {
  8335. let qiandao2 = document.querySelector('.box .inner a[href="/mission/daily"]');
  8336. if (qiandao2) {
  8337. qianDao_(qiandao2, timeNow);
  8338. } else if (document.getElementById("gift_v2excellent")) {
  8339. document.getElementById("gift_v2excellent").click();
  8340. localStorage.setItem("menu_clockInTime", timeNow);
  8341. } else
  8342. ;
  8343. } else {
  8344. let timeOld = localStorage.getItem("menu_clockInTime");
  8345. if (!timeOld || timeOld != timeNow) {
  8346. qianDaoStatus_(timeNow);
  8347. }
  8348. }
  8349. }
  8350. function qianDao_(qiandao2, timeNow) {
  8351. let url = location.origin + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector("div#Top .tools, #menu-body").innerHTML)[0];
  8352. $.get(url).then((r2) => {
  8353. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8354. let html = $(bodyText[0]);
  8355. if (html.find("li.fa.fa-ok-sign").length) {
  8356. html = html.find("#Main").text().match(/已连续登录(不可用) (\d+?) 天/)[0];
  8357. localStorage.setItem("menu_clockInTime", timeNow);
  8358. console.info("[V2Next] 自动签到完成!");
  8359. if (qiandao2) {
  8360. qiandao2.textContent = `自动签到完成!${html}`;
  8361. qiandao2.href = "javascript:void(0);";
  8362. }
  8363. } else {
  8364. console.warn("[V2Next] 自动签到失败!请关闭其他插件或脚本。如果连续几天都签到失败,请联系作者解决!");
  8365. if (qiandao2)
  8366. qiandao2.textContent = "自动签到失败!请尝试手动签到!";
  8367. }
  8368. });
  8369. }
  8370. function qianDaoStatus_(timeNow) {
  8371. $.get(location.origin + "/mission/daily").then((r2) => {
  8372. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8373. let html = $(bodyText[0]);
  8374. if (html.find('input[value^="领取"]').length) {
  8375. qianDao_(null, timeNow);
  8376. } else {
  8377. console.info("[V2Next] 已经签过到了。");
  8378. localStorage.setItem("menu_clockInTime", timeNow);
  8379. }
  8380. });
  8381. }
  8382. function getNoteItemContent(id, prefix) {
  8383. return new Promise((resolve, reject) => {
  8384. $.get(location.origin + "/notes/edit/" + id).then((r2) => {
  8385. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8386. let body = $(bodyText[0]);
  8387. let text = body.find(".note_editor").text();
  8388. if (text === prefix) {
  8389. resolve({});
  8390. } else {
  8391. let tagJson = text.substring(prefix.length);
  8392. try {
  8393. resolve(JSON.parse(tagJson));
  8394. } catch (e2) {
  8395. resolve({});
  8396. }
  8397. }
  8398. });
  8399. });
  8400. }
  8401. async function initNoteData() {
  8402. $.get(location.origin + "/notes").then(async (r2) => {
  8403. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8404. let body = $(bodyText[0]);
  8405. let items = body.find("#Main .box .note_item_title a");
  8406. if (window.config.openTag) {
  8407. let tagItems2 = Array.from(items).filter((v) => v.innerText.includes(window.user.tagPrefix));
  8408. if (tagItems2.length) {
  8409. window.user.tagsId = tagItems2[0].href.substr(-5);
  8410. window.user.tags = await getNoteItemContent(window.user.tagsId, window.user.tagPrefix);
  8411. } else {
  8412. let r22 = await window.parse.createNoteItem(window.user.tagPrefix);
  8413. r22 && (window.user.tagsId = r22);
  8414. }
  8415. }
  8416. let tagItems = Array.from(items).filter((v) => v.innerText.includes(window.user.configPrefix));
  8417. if (tagItems.length) {
  8418. window.user.configNoteId = tagItems[0].href.substr(-5);
  8419. let config2 = await getNoteItemContent(window.user.configNoteId, window.user.configPrefix);
  8420. window.config = functions.deepAssign(window.config, config2);
  8421. } else {
  8422. let r22 = await window.parse.createNoteItem(window.user.configPrefix);
  8423. r22 && (window.user.configNoteId = r22);
  8424. }
  8425. functions.cbChecker({ type: "syncData" });
  8426. functions.cbChecker({ type: "getConfigSuccess" });
  8427. });
  8428. }
  8429. function addSettingText() {
  8430. let app = $(`<a href="${DefaultVal.mobileScript}" target='_blank' class="top"><i class="fa fa-android" aria-hidden="true"></i></a>`);
  8431. $(".tools").prepend(app);
  8432. let setting = $(`<a href="/" class="top v2next-setting"><span>脚本设置</span></a>`);
  8433. setting.on("click", function(e2) {
  8434. functions.stopEvent(e2);
  8435. functions.cbChecker({ type: "openSetting" });
  8436. });
  8437. $(".tools").prepend(setting);
  8438. }
  8439. async function init() {
  8440. let top2 = document.querySelector(".tools .top:nth-child(2)");
  8441. if (top2 && top2.textContent !== "注册(不可用)") {
  8442. window.isLogin = true;
  8443. window.user.username = top2.textContent;
  8444. window.user.avatar = $("#Rightbar .box .avatar").attr("src");
  8445. }
  8446. functions.initConfig();
  8447. let box;
  8448. let list;
  8449. let last;
  8450. let headerWrap;
  8451. let { pageData, pageType, username } = functions.checkPageType();
  8452. window.pageType = pageType;
  8453. window.pageData = pageData;
  8454. window.targetUserName = username;
  8455. initStyle();
  8456. switch (window.pageType) {
  8457. case PageType.Node:
  8458. box = document.querySelectorAll("#Wrapper #Main .box");
  8459. try {
  8460. headerWrap = $('<div class="post-item"></div>');
  8461. if (window.config.viewType === "card")
  8462. headerWrap[0].classList.add("preview");
  8463. $(box[1]).prepend(headerWrap);
  8464. $(box[1]).children().slice(1, 3).each(function() {
  8465. if (this.classList.contains("cell")) {
  8466. headerWrap.append(this);
  8467. }
  8468. });
  8469. headerWrap = $('<div class="post-item"></div>');
  8470. if (window.config.viewType === "card")
  8471. headerWrap[0].classList.add("preview");
  8472. $(box[1]).append(headerWrap);
  8473. $(box[1]).children().slice(2).each(function() {
  8474. if (this.classList.contains("cell")) {
  8475. headerWrap.append(this);
  8476. }
  8477. });
  8478. box[1].style.boxShadow = "unset";
  8479. box[1].style.background = "unset";
  8480. box[1].style.overflow = "hidden";
  8481. } catch (e2) {
  8482. console.log("PageType-Node解析报错了", e2);
  8483. }
  8484. let topics = box[1].querySelector("#TopicsNode");
  8485. list = topics.querySelectorAll(".cell");
  8486. list[0].before($section);
  8487. window.parse.parsePagePostList(list, box[1]);
  8488. break;
  8489. case PageType.Changes:
  8490. case PageType.Home:
  8491. box = document.querySelector("#Wrapper #Main .box");
  8492. try {
  8493. headerWrap = $('<div class="post-item"></div>');
  8494. if (window.config.viewType === "card")
  8495. headerWrap[0].classList.add("preview");
  8496. $(box).prepend(headerWrap);
  8497. $(box).children().slice(1, 3).each(function() {
  8498. if (!this.classList.contains("item")) {
  8499. headerWrap.append(this);
  8500. }
  8501. });
  8502. if (window.isDeadline && $(".tab_current").text() == "最热") {
  8503. headerWrap.append($(`<div class="cell" id="SecondaryTabs"><div class="fr"><a href="/v2hot?3">3天最热</a> &nbsp; &nbsp; <a href="/v2hot?7">7天最热</a> &nbsp; &nbsp; <a href="/v2hot?30">30天最热</a> &nbsp; &nbsp; <a href="/v2hot?setting"><i class="fa fa-calendar" aria-hidden="true"></i></a></div><a href="/v2hot?-1">昨天最热</a> &nbsp; &nbsp; <a href="/v2hot?-2">前天最热</a> &nbsp; &nbsp; </div>`));
  8504. }
  8505. last = $(box).children().last();
  8506. last.addClass("cell post-item");
  8507. if (window.config.viewType === "card")
  8508. last[0].classList.add("preview");
  8509. box.style.boxShadow = "unset";
  8510. box.style.background = "unset";
  8511. box.style.overflow = "hidden";
  8512. } catch (e2) {
  8513. console.log("PageType-Home解析报错了", e2);
  8514. }
  8515. list = box.querySelectorAll(".item");
  8516. list[0].before($section);
  8517. window.parse.parsePagePostList(list, box);
  8518. break;
  8519. case PageType.Post:
  8520. let d2 = localStorage.getItem("d");
  8521. if (d2) {
  8522. window.stopMe = true;
  8523. functions.cbChecker({ type: "syncData" });
  8524. return;
  8525. }
  8526. box = document.querySelector("#Wrapper #Main .box");
  8527. box.after($section);
  8528. let r2 = await functions.checkPostReplies(window.pageData.id, false);
  8529. if (r2) {
  8530. window.stopMe = true;
  8531. functions.cbChecker({ type: "syncData" });
  8532. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,脚本已停止解析楼中楼" });
  8533. return;
  8534. }
  8535. if (window.config.postWidth) {
  8536. let Main = $("#Main");
  8537. Main.css({
  8538. "width": window.config.postWidth,
  8539. margin: "unset"
  8540. });
  8541. $("#Wrapper > .content").css({
  8542. "max-width": "unset",
  8543. display: "flex",
  8544. "justify-content": "center",
  8545. gap: "20px"
  8546. });
  8547. Main.after($("#Rightbar"));
  8548. }
  8549. let post = getDefaultPost({ id: window.pageData.id });
  8550. let body = $(document.body);
  8551. let htmlText = document.documentElement.outerHTML;
  8552. window.parse.parsePostContent(
  8553. post,
  8554. body,
  8555. htmlText
  8556. ).then(async (res) => {
  8557. await functions.cbChecker({ type: "postContent", value: res });
  8558. await window.parse.parseOp(res);
  8559. });
  8560. window.parse.getPostAllReplies(
  8561. post,
  8562. body,
  8563. htmlText,
  8564. window.pageData.pageNo
  8565. ).then(async (res1) => {
  8566. await functions.cbChecker({ type: "postReplies", value: res1 });
  8567. });
  8568. break;
  8569. case PageType.Member:
  8570. box = document.querySelectorAll("#Wrapper #Main .box");
  8571. if (location.pathname.includes("/replies")) {
  8572. box[0].after($section);
  8573. } else if (location.pathname.includes("/topics")) {
  8574. box[0].after($section);
  8575. } else {
  8576. if (window.config.openTag) {
  8577. box[0].style.borderBottom = "none";
  8578. box[0].style["border-bottom-left-radius"] = "0";
  8579. box[0].style["border-bottom-right-radius"] = "0";
  8580. }
  8581. try {
  8582. headerWrap = $('<div class="post-item"></div>');
  8583. if (window.config.viewType === "card")
  8584. headerWrap[0].classList.add("preview");
  8585. $(box[1]).prepend(headerWrap);
  8586. $(box[1]).children().slice(1, 2).each(function() {
  8587. if (!this.classList.contains("item")) {
  8588. headerWrap.append(this);
  8589. }
  8590. });
  8591. last = $(box[1]).children().last();
  8592. last.addClass("cell post-item");
  8593. if (window.config.viewType === "card")
  8594. last[0].classList.add("preview");
  8595. box[1].style.boxShadow = "unset";
  8596. box[1].style.background = "unset";
  8597. box[1].style.overflow = "hidden";
  8598. } catch (e2) {
  8599. console.log("PageType-Member解析报错了", e2);
  8600. }
  8601. list = box[1].querySelectorAll(".cell");
  8602. box[0].after($section);
  8603. window.parse.parsePagePostList(list, box[1]);
  8604. }
  8605. break;
  8606. default:
  8607. window.stopMe = true;
  8608. functions.cbChecker({ type: "syncData" });
  8609. console.error("未知页面");
  8610. break;
  8611. }
  8612. if (window.isLogin) {
  8613. initNoteData();
  8614. try {
  8615. if (window.config.autoSignin)
  8616. qianDao();
  8617. } catch (e2) {
  8618. console.log("签到失败");
  8619. }
  8620. }
  8621. addSettingText();
  8622. initMonkeyMenu();
  8623. window.addEventListener("error", (e2) => {
  8624. let dom = e2.target;
  8625. let originImgUrl = dom.getAttribute("originUrl");
  8626. if (originImgUrl) {
  8627. let a = document.createElement("a");
  8628. a.href = originImgUrl;
  8629. a.setAttribute("notice", "此标签由v2ex超级增强脚本转换图片失败后恢复");
  8630. a.innerText = originImgUrl;
  8631. a.target = "_blank";
  8632. dom.parentNode.replaceChild(a, dom);
  8633. }
  8634. }, true);
  8635. }
  8636. window.canParseV2exPage = !window.location.search.includes("script");
  8637. if (window.canParseV2exPage) {
  8638. init();
  8639. } else {
  8640. let box = document.querySelector("#Wrapper #Main .box");
  8641. box.after($section);
  8642. window.stopMe = true;
  8643. functions.cbChecker({ type: "syncData" });
  8644. if (window.location.search.includes("script=0")) {
  8645. functions.cbChecker({ type: "warningNotice", value: "脚本无法查看此主题,已为您单独打开此主题" });
  8646. }
  8647. if (window.location.search.includes("script=1")) {
  8648. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,已为您单独打开此主题并停止解析楼中楼" });
  8649. }
  8650. }
  8651. }
  8652. if (!isMobile) {
  8653. console.log("V2EX PC端");
  8654. (e=>{const o=document.createElement("style");o.dataset.source="vite-plugin-monkey",o.textContent=e,document.head.append(o)})(' .tip[data-v-ee672411]{position:fixed;font-size:1.6rem;z-index:9999;max-width:10rem;border-radius:.5rem;padding:1rem;color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.v-enter-active[data-v-e7c0fbef],.v-leave-active[data-v-e7c0fbef]{transition:opacity .3s ease}.v-enter-from[data-v-e7c0fbef],.v-leave-to[data-v-e7c0fbef]{opacity:0}.username[data-v-e7c0fbef]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-e7c0fbef]{font-size:1.2rem;font-weight:700;color:#e02a2a}.owner[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-e7c0fbef]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-e7c0fbef]{display:inline}.my-tag .remove[data-v-e7c0fbef]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-e7c0fbef]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-e7c0fbef]{margin-left:.5rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-e7c0fbef]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--color-top-reply-wrap-bg: #f2f3f5;--color-top-reply-wrap-line: #d2d2d2}html.dark[data-v-e7c0fbef]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e;--color-top-reply-wrap-bg: #212f3e;--color-top-reply-wrap-line: #3b536d}html[data-v-e7c0fbef],body[data-v-e7c0fbef]{font-size:62.5%}.flex[data-v-e7c0fbef]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-e7c0fbef]{justify-content:flex-end}.flex-center[data-v-e7c0fbef]{justify-content:center}.p1[data-v-e7c0fbef]{padding:1rem}.p2[data-v-e7c0fbef]{padding:2rem}.p0[data-v-e7c0fbef]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-e7c0fbef]{text-underline-offset:.7ex;text-decoration:underline 1px}a[data-v-e7c0fbef]{text-decoration:none;cursor:pointer}a[data-v-e7c0fbef]:hover{text-decoration:underline}.tool[data-v-e7c0fbef]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.2rem}.tool>svg[data-v-e7c0fbef]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-e7c0fbef]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-e7c0fbef]{cursor:default}.tool.no-hover[data-v-e7c0fbef]:hover{background:unset!important}.tool.disabled[data-v-e7c0fbef]{cursor:not-allowed}.tool.disabled[data-v-e7c0fbef]:hover{background:unset!important}.my-node[data-v-e7c0fbef]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-e7c0fbef]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-e7c0fbef]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-e7c0fbef]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-e7c0fbef]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-e7c0fbef]{position:fixed;z-index:1001;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-e7c0fbef]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-e7c0fbef]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-e7c0fbef]{position:relative}.modal .mask[data-v-e7c0fbef]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-e7c0fbef]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-e7c0fbef]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-e7c0fbef]:first-child{border-left:none}.radio-group2 .active[data-v-e7c0fbef]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-e7c0fbef]{position:relative;display:inline-flex;justify-content:center}input[data-v-e7c0fbef]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-e7c0fbef]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-e7c0fbef]:focus{border:1px solid var(--color-active)}.danger[data-v-e7c0fbef]{color:red!important}.pop-confirm-content[data-v-e7c0fbef]{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:1003}.pop-confirm-content .text[data-v-e7c0fbef]{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options[data-v-e7c0fbef]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}img[data-v-e7c0fbef]{max-width:100%}.switch[data-v-e7c0fbef]{width:4.5rem;height:2.2rem;border-radius:2rem;position:relative;display:flex;align-items:center;background:var(--color-swtich-bg);transition:all .3s}.switch.active[data-v-e7c0fbef]{background:var(--color-active)}.switch.active[data-v-e7c0fbef]:before{right:.2rem}.switch[data-v-e7c0fbef]:before{position:absolute;content:" ";transition:all .3s;right:calc(100% - 2rem);width:1.8rem;height:1.8rem;background:white;border-radius:50%}.display-type[data-v-e4f684be]{height:3rem;padding:0 .3rem;background:var(--color-sp-btn-bg);border-radius:1rem;display:flex;font-size:1.4rem;align-items:center;color:#a9a9a9}.display-type .type[data-v-e4f684be]{border-radius:.8rem;padding:0 1.3rem;height:2.8rem;align-items:center;display:flex;position:relative;cursor:pointer}.display-type .type.active[data-v-e4f684be]{background:var(--color-second-bg);color:var(--color-font-pure);box-shadow:0 0 6px 0 var(--color-tooltip-shadow)}.display-type .type-list[data-v-e4f684be]{position:absolute;background:var(--color-sp-btn-bg);right:0;top:3rem;font-size:1.4rem;box-shadow:0 0 6px 0 var(--color-tooltip-shadow);border-radius:.6rem;z-index:9;color:var(--color-font)}.display-type .type-list .item[data-v-e4f684be]{word-break:keep-all;padding:.8rem 1rem;cursor:pointer}.display-type .type-list .item.active[data-v-e4f684be],.display-type .type-list .item[data-v-e4f684be]:hover{color:var(--color-font-pure)}.display-type svg[data-v-e4f684be]{width:1.5rem}.loading[data-v-2697baa2]{border:2px solid;border-color:var(--color-loading-2) var(--color-loading-1) var(--color-loading-1) var(--color-loading-1);border-radius:100%;animation:circle-2697baa2 infinite 1s linear;width:2rem;height:2rem}.loading.small[data-v-2697baa2]{width:1.2rem;height:1.2rem}.loading.large[data-v-2697baa2]{width:3rem;height:3rem}@keyframes circle-2697baa2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.base-button[data-v-5a7d79ba]{cursor:pointer;border-radius:.6rem;padding:0 1.5rem;display:inline-flex;align-items:center;justify-content:center;transition:all .3s;height:3.6rem;line-height:1;position:relative}.base-button .loading[data-v-5a7d79ba]{position:absolute}.base-button.disabled[data-v-5a7d79ba]{opacity:.6;cursor:not-allowed;user-select:none}.base-button.small[data-v-5a7d79ba]{height:3rem}.base-button.small>span[data-v-5a7d79ba]{font-size:1.3rem}.base-button.large[data-v-5a7d79ba]{height:5rem;font-size:1.8rem;padding:0 2.2rem}.base-button.large>span[data-v-5a7d79ba]{font-size:1.8rem}.base-button[data-v-5a7d79ba]:hover:not(.link){opacity:.7}.base-button.primary[data-v-5a7d79ba]{background:var(--color-active)}.base-button.primary>span[data-v-5a7d79ba]{color:#fff}.base-button.gary[data-v-5a7d79ba]{background:#4b5563}.base-button.link[data-v-5a7d79ba]{border-radius:0;border-bottom:2px solid transparent}.base-button.link>span[data-v-5a7d79ba]{color:var(--color-font-8)}.base-button.link[data-v-5a7d79ba]:hover{border-bottom:2px solid var(--color-font-8)}.base-button.active[data-v-5a7d79ba]{opacity:.4}.key-notice[data-v-5a7d79ba]{margin-left:1rem;display:flex;align-items:center;justify-content:center;font-size:1.2rem;color:#fff}.key-notice .key[data-v-5a7d79ba]{transform:scale(.8)}.setting-modal .modal-root[data-v-386b43d0]{z-index:9;background:var(--color-main-bg);border-radius:1rem;font-size:1.4rem;overflow:hidden;color:var(--color-font-pure)}.setting-modal .modal-root .modal-header[data-v-386b43d0]{padding:1.4rem;display:flex;justify-content:center;position:relative}.setting-modal .modal-root .modal-header .title[data-v-386b43d0]{font-size:2.2rem;text-align:left;margin-bottom:0}.setting-modal .modal-root .modal-header svg[data-v-386b43d0]{position:absolute;right:1rem;cursor:pointer;font-size:2.6rem}.setting-modal .modal-root .body[data-v-386b43d0]{width:60rem}.setting-modal .modal-root .body .modal-content[data-v-386b43d0]{background:var(--color-second-bg);flex:1;height:100%;box-sizing:border-box;padding:1rem 1rem 1rem 2rem;font-size:1.6rem;text-align:left;line-height:1.6}.setting-modal .modal-root .body .btns[data-v-386b43d0]{margin:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1.5rem;font-size:1.4rem}.setting-modal .modal-root[data-v-9fea31eb]{z-index:9;background:var(--color-main-bg);border-radius:1rem;font-size:1.4rem;overflow:hidden;color:var(--color-font-pure)}.setting-modal .modal-root .modal-header[data-v-9fea31eb]{padding:2.4rem;display:flex;justify-content:space-between}.setting-modal .modal-root .modal-header .title[data-v-9fea31eb]{font-size:2.6rem;font-weight:700;text-align:left;margin-bottom:0}.setting-modal .modal-root .modal-header svg[data-v-9fea31eb]{cursor:pointer;font-size:2.6rem}.setting-modal .modal-root .body[data-v-9fea31eb]{width:45vw;height:70vh;display:flex}.setting-modal .modal-root .body .left[data-v-9fea31eb]{display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-size:1.8rem}.setting-modal .modal-root .body .left .tabs[data-v-9fea31eb]{padding:1rem 2rem;display:flex;flex-direction:column;gap:1rem}.setting-modal .modal-root .body .left .tabs .tab[data-v-9fea31eb]{cursor:pointer;padding:1rem 1.5rem;border-radius:.8rem;display:flex;align-items:center;gap:1rem}.setting-modal .modal-root .body .left .tabs .tab.active[data-v-9fea31eb]{background:var(--color-item-bg)}.setting-modal .modal-root .body .left .icons[data-v-9fea31eb]{display:flex;gap:1rem;margin-bottom:2rem;font-size:2.4rem}.setting-modal .modal-root .body .modal-content[data-v-9fea31eb]{background:var(--color-second-bg);flex:1;height:100%;box-sizing:border-box;padding:1rem 1rem 1rem 2rem;border-radius:1rem;display:flex}.setting-modal .modal-root .body .modal-content .scroll[data-v-9fea31eb]{flex:1;padding-right:1rem;overflow:auto}.setting-modal .modal-root .body .modal-content .scroll .row[data-v-9fea31eb]{min-height:5rem;display:flex;justify-content:space-between;align-items:center}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper[data-v-9fea31eb]{height:3rem;flex:1;display:flex;justify-content:flex-end;align-items:center;gap:var(--space)}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper span[data-v-9fea31eb]{text-align:right;font-size:1.4rem;color:gray}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper .set-key[data-v-9fea31eb]{align-items:center}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper .set-key input[data-v-9fea31eb]{width:15rem;box-sizing:border-box;margin-right:1rem;height:2.8rem;outline:none;font-size:1.6rem;border:1px solid gray;border-radius:.3rem;padding:0 .5rem;background:var(--color-second-bg);color:var(--color-font-1)}.setting-modal .modal-root .body .modal-content .scroll .row .main-title[data-v-9fea31eb]{font-size:2.2rem;font-weight:700;color:var(--color-font-8)}.setting-modal .modal-root .body .modal-content .scroll .row .item-title[data-v-9fea31eb]{font-size:1.8rem}.setting-modal .modal-root .body .modal-content .scroll .desc[data-v-9fea31eb]{margin-bottom:1rem;font-size:1.4rem;text-align:left;color:var(--color-font)}.setting-modal .modal-root .body .modal-content .scroll .project-desc[data-v-9fea31eb]{text-align:start;font-size:1.6rem;padding-bottom:10rem}.setting-modal .modal-root .body .modal-content .scroll .line[data-v-9fea31eb]{border-bottom:1px solid #c4c3c3}.sub-content[data-v-9fea31eb]{padding:0 2rem 1rem;border-radius:1rem;background:#f3f3f3;margin-bottom:1rem}.log[data-v-9fea31eb]{position:relative;text-align:left;margin-bottom:20px;padding-left:20px;font-size:16px;color:#6495ed;text-decoration:underline}.Author[data-v-64aa1930]{display:flex;align-items:center;justify-content:space-between;font-size:1.2rem;position:relative}.Author.expand[data-v-64aa1930]{margin-bottom:0}.Author .Author-left[data-v-64aa1930]{display:flex;align-items:center;max-width:65%;word-break:break-all}.Author .Author-left .username[data-v-64aa1930]{font-size:1.4rem;margin-right:.6rem}.Author .Author-left .expand-icon[data-v-64aa1930]{cursor:pointer;margin-right:.6rem;width:2rem;height:2rem;transform:rotate(90deg)}.Author .Author-left .avatar[data-v-64aa1930]{margin-right:.8rem;display:flex}.Author .Author-left .avatar img[data-v-64aa1930]{width:2.8rem;height:2.8rem;border-radius:.4rem}.Author .Author-left .texts[data-v-64aa1930]{flex:1}.Author .Author-left .owner[data-v-64aa1930]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:.6rem;transform:scale(.8)}.Author .Author-left .dup[data-v-64aa1930]{display:inline-block;background-color:transparent;color:red;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid red;font-size:1.2rem;font-weight:700;margin-right:.6rem;transform:scale(.8)}.Author .Author-left .mod[data-v-64aa1930]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:.6rem}.Author:hover .add-tag[data-v-64aa1930]{display:inline-block}.Author .Author-right[data-v-64aa1930]{position:absolute;right:0;display:flex;align-items:center}.Author .Author-right .toolbar[data-v-64aa1930]{display:flex;align-items:center;color:var(--color-gray);opacity:0;gap:.2rem}.Author .Author-right .toolbar[data-v-64aa1930]:hover{opacity:1}.post-editor-wrapper[data-v-85e09b4e]{width:100%;box-sizing:border-box;position:relative;overflow:hidden;transition:all .3s;color:var(--color-font)}.post-editor-wrapper.reply-post .post-editor[data-v-85e09b4e]{border:1px solid var(--color-line)}.post-editor-wrapper.reply-post.isFocus .post-editor[data-v-85e09b4e]{border:1px solid var(--color-active)}.post-editor-wrapper.reply-comment[data-v-85e09b4e]{border-radius:var(--box-border-radius);overflow:hidden;border:1px solid var(--color-line)}.post-editor-wrapper.reply-comment.isFocus[data-v-85e09b4e]{border:1px solid var(--color-active)}.post-editor-wrapper.reply-comment .toolbar[data-v-85e09b4e]{background:var(--color-editor-toolbar)}.post-editor-wrapper .post-editor[data-v-85e09b4e]{border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.4rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure);border:1px solid transparent}.post-editor-wrapper .toolbar[data-v-85e09b4e]{box-sizing:border-box;padding:.5rem 1rem;width:100%;position:relative;display:flex;justify-content:space-between;align-items:center}.post-editor-wrapper .toolbar .left[data-v-85e09b4e]{display:flex;align-items:center;gap:1rem;font-size:2.6rem}.post-editor-wrapper .toolbar .left svg[data-v-85e09b4e]{cursor:pointer}.post-editor-wrapper .toolbar .left .upload[data-v-85e09b4e]{width:2.6rem;height:2.6rem;overflow:hidden;display:flex;justify-content:center;align-items:center}.post-editor-wrapper .toolbar .left .upload input[data-v-85e09b4e]{width:2.6rem;height:2.6rem;cursor:pointer;position:absolute;opacity:0}.post-editor-wrapper .toolbar span[data-v-85e09b4e]{color:gray;font-size:1.3rem}.post-editor-wrapper .get-cursor[data-v-85e09b4e]{border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.4rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure);border:1px solid transparent;position:absolute;top:0;z-index:-100}.post-editor-wrapper .emoticon-pack[data-v-85e09b4e]{z-index:999999999;border-radius:1rem;padding:1rem;width:31rem;max-width:31rem;height:30rem;max-height:30rem;overflow:auto;background:var(--color-third-bg);border:1px solid var(--color-font-3);box-shadow:0 9px 24px -3px #0000000f,0 4px 8px -1px #0000001f;position:fixed;bottom:11rem;left:14rem}.post-editor-wrapper .emoticon-pack svg[data-v-85e09b4e]{cursor:pointer;position:absolute;right:.8rem;font-size:2.4rem}.post-editor-wrapper .emoticon-pack .list[data-v-85e09b4e]{margin:1rem 0;display:flex;flex-wrap:wrap}.post-editor-wrapper .emoticon-pack img[data-v-85e09b4e]{cursor:pointer;width:calc(100% / 7);padding:.5rem;box-sizing:border-box}.post-editor-wrapper .emoticon-pack span[data-v-85e09b4e]{width:calc(100% / 7);display:inline-block;cursor:pointer;font-size:2.3rem;text-align:center}.v-enter-active[data-v-6f61a860],.v-leave-active[data-v-6f61a860]{transition:opacity .3s ease}.v-enter-from[data-v-6f61a860],.v-leave-to[data-v-6f61a860]{opacity:0}.username[data-v-6f61a860]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-6f61a860]{font-size:1.2rem;font-weight:700;color:#e02a2a}.owner[data-v-6f61a860]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-6f61a860]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-6f61a860]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-6f61a860]{display:inline}.my-tag .remove[data-v-6f61a860]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-6f61a860]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-6f61a860]{margin-left:.5rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-6f61a860]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--color-top-reply-wrap-bg: #f2f3f5;--color-top-reply-wrap-line: #d2d2d2}html.dark[data-v-6f61a860]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e;--color-top-reply-wrap-bg: #212f3e;--color-top-reply-wrap-line: #3b536d}html[data-v-6f61a860],body[data-v-6f61a860]{font-size:62.5%}.flex[data-v-6f61a860]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-6f61a860]{justify-content:flex-end}.flex-center[data-v-6f61a860]{justify-content:center}.p1[data-v-6f61a860]{padding:1rem}.p2[data-v-6f61a860]{padding:2rem}.p0[data-v-6f61a860]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-6f61a860]{text-underline-offset:.7ex;text-decoration:underline 1px}a[data-v-6f61a860]{text-decoration:none;cursor:pointer}a[data-v-6f61a860]:hover{text-decoration:underline}.tool[data-v-6f61a860]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.2rem}.tool>svg[data-v-6f61a860]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-6f61a860]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-6f61a860]{cursor:default}.tool.no-hover[data-v-6f61a860]:hover{background:unset!important}.tool.disabled[data-v-6f61a860]{cursor:not-allowed}.tool.disabled[data-v-6f61a860]:hover{background:unset!important}.my-node[data-v-6f61a860]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-6f61a860]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-6f61a860]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-6f61a860]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-6f61a860]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-6f61a860]{position:fixed;z-index:1001;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-6f61a860]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-6f61a860]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-6f61a860]{position:relative}.modal .mask[data-v-6f61a860]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-6f61a860]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-6f61a860]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-6f61a860]:first-child{border-left:none}.radio-group2 .active[data-v-6f61a860]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-6f61a860]{position:relative;display:inline-flex;justify-content:center}input[data-v-6f61a860]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-6f61a860]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-6f61a860]:focus{border:1px solid var(--color-active)}.danger[data-v-6f61a860]{color:red!important}.pop-confirm-content[data-v-6f61a860]{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:1003}.pop-confirm-content .text[data-v-6f61a860]{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options[data-v-6f61a860]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}img[data-v-6f61a860]{max-width:100%}.html-wrapper[data-v-6f61a860]{position:relative}.html-wrapper .mask[data-v-6f61a860]{max-height:90rem;overflow:hidden;-webkit-mask-image:linear-gradient(180deg,#000 80%,transparent)}.html-wrapper .expand[data-v-6f61a860]{position:absolute;z-index:1;bottom:2rem;padding:.2rem 1.5rem;border-radius:2rem;border:1px solid gray;background:white;color:gray;left:50%;transform:translate(-50%);cursor:pointer}.top-sub-comment[data-v-d3f8c94b]{width:100%;box-sizing:border-box;margin-top:.8rem;display:flex;position:relative}.top-sub-comment .expand-line[data-v-d3f8c94b]{width:1.6rem;position:relative}.top-sub-comment .expand-line[data-v-d3f8c94b]:after{position:absolute;left:50%;top:2%;content:" ";height:98%;width:0;border-right:1px solid var(--color-top-reply-wrap-line)}.top-sub-comment .right[data-v-d3f8c94b]{flex:1;width:calc(100% - 3rem)}.top-sub-comment .right .w .post-editor-wrapper[data-v-d3f8c94b]{margin-top:1rem}.top-sub-comment[data-v-d3f8c94b] .avatar{display:none!important}.top-sub-comment.top-sub-reply[data-v-d3f8c94b]:first-child{margin-top:0}.top-sub-comment.top-sub-reply>.expand-line[data-v-d3f8c94b]{width:1rem}.top-sub-comment.top-sub-reply>.expand-line[data-v-d3f8c94b]:after{display:none}.comment[data-v-dd44e74f]{width:100%;box-sizing:border-box;margin-top:.6rem}.comment.isLevelOne[data-v-dd44e74f]{border-bottom:1px solid var(--color-line);padding:.8rem 1rem;margin-top:0}.comment.ding[data-v-dd44e74f]{background:rgba(255,255,0,.3)!important}.comment.isSimple .avatar[data-v-dd44e74f],.comment.isSimple .expand-line[data-v-dd44e74f]{display:none}.comment.isSimple .simple-wrapper[data-v-dd44e74f]{padding-left:2.8rem}.comment.isSimple .w[data-v-dd44e74f]{padding-left:0!important;padding-top:.5rem}.comment .comment-content-w .more[data-v-dd44e74f]{text-align:center;margin:2rem 0}.comment .comment-content[data-v-dd44e74f]{display:flex;position:relative}.comment .comment-content .expand-line[data-v-dd44e74f]{cursor:pointer;margin-top:.6rem;width:2rem;min-width:2rem;position:relative}.comment .comment-content .expand-line[data-v-dd44e74f]:after{position:absolute;left:50%;content:" ";height:100%;width:0;border-right:1px solid var(--color-line)}.comment .comment-content .expand-line[data-v-dd44e74f]:hover:after{border-right:2px solid var(--color-active)}.comment .comment-content .right[data-v-dd44e74f]{flex:1;width:calc(100% - 3rem)}.comment .comment-content .right .w[data-v-dd44e74f]{padding-left:1rem}.comment .comment-content .right .w .post-editor-wrapper[data-v-dd44e74f]{margin-top:1rem}.wrong-wrapper[data-v-dd44e74f]{font-size:1.4rem;margin-bottom:1rem}.wrong-wrapper span[data-v-dd44e74f]{cursor:pointer}.wrong-wrapper .del-line[data-v-dd44e74f]{text-decoration:line-through}.wrong-wrapper .wrong-icon[data-v-dd44e74f]{margin-left:.5rem}.wrong-wrapper .warning[data-v-dd44e74f]{border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;padding:1rem 0;margin-top:1rem;font-size:1.2rem;color:red}.reply-count[data-v-dd44e74f]{padding:.8rem 0 .4rem;border-radius:.2rem;font-size:1.3rem;display:flex;align-items:center;color:gray;gap:1rem;cursor:pointer}.reply-count .gang[data-v-dd44e74f]{width:2rem;height:0;border-bottom:1px solid #d5d5d5}.reply-count svg[data-v-dd44e74f]{font-size:1rem}.top-reply-wrap[data-v-dd44e74f]{background:var(--color-top-reply-wrap-bg);border-radius:.8rem;padding:.6rem;padding-left:0;margin-left:1rem}.toolbar[data-v-30dac564]{border-top:1px solid var(--color-line);height:3.8rem;padding-left:.6rem;display:flex;align-items:center;color:var(--color-gray);font-size:1.2rem;gap:.5rem}.comment[data-v-4a063111]{width:100%;box-sizing:border-box;display:flex;gap:1rem;padding:1rem;border-bottom:1px solid var(--color-line)}.comment.isSimple .avatar[data-v-4a063111]{display:none}.comment.isSimple .reply_content[data-v-4a063111]{margin-top:.5rem!important}.comment .avatar[data-v-4a063111]{display:flex}.comment .avatar img[data-v-4a063111]{width:3.8rem;height:3.8rem;border-radius:.3rem}.comment .comment-body[data-v-4a063111]{flex:1;display:flex;flex-direction:column}.comment .comment-body .texts[data-v-4a063111]{display:flex;align-items:center}.comment .comment-body .reply_content[data-v-4a063111]{margin-top:1rem;max-width:calc(100% - 5rem)}.comment .isRight[data-v-4a063111]{align-items:flex-end}.comment .isRight .owner[data-v-4a063111],.comment .isRight .mod[data-v-4a063111],.comment .isRight .username[data-v-4a063111]{margin:0 0 0 1rem}.comment .Author-right[data-v-4a063111]{display:flex;flex-direction:column;align-items:center}.comment .Author-right .floor[data-v-4a063111]{margin-left:0}.comment .Author-right .jump[data-v-4a063111]{color:#929596;margin-top:.4rem;font-size:1.4rem}.comment .point[data-v-4a063111]{margin:0 .5rem;font-size:1.6rem;display:flex;gap:.5rem;align-items:center;font-weight:700;color:#000}.sticky{position:sticky;bottom:-2px;z-index:2;background:var(--box-background-hover-color)!important}.sticky[stuck]{box-shadow:0 2px 20px #00000059!important}.preview-modal{position:fixed;width:100vw;height:100vh;left:0;top:-1000vh;z-index:9999}.preview-modal .close{font-size:2rem;color:#fff;position:absolute;right:2rem;top:2rem;cursor:pointer}.preview-modal .mask{position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.7);transition:all .3s}.v-enter-active[data-v-ea75dfbf],.v-leave-active[data-v-ea75dfbf]{transition:opacity .3s ease}.v-enter-from[data-v-ea75dfbf],.v-leave-to[data-v-ea75dfbf]{opacity:0}.username[data-v-ea75dfbf]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-ea75dfbf]{font-size:1.2rem;font-weight:700;color:#e02a2a}.owner[data-v-ea75dfbf]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-ea75dfbf]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-ea75dfbf]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-ea75dfbf]{display:inline}.my-tag .remove[data-v-ea75dfbf]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-ea75dfbf]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-ea75dfbf]{margin-left:.5rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-ea75dfbf]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--color-top-reply-wrap-bg: #f2f3f5;--color-top-reply-wrap-line: #d2d2d2}html.dark[data-v-ea75dfbf]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e;--color-top-reply-wrap-bg: #212f3e;--color-top-reply-wrap-line: #3b536d}html[data-v-ea75dfbf],body[data-v-ea75dfbf]{font-size:62.5%}.flex[data-v-ea75dfbf]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-ea75dfbf]{justify-content:flex-end}.flex-center[data-v-ea75dfbf]{justify-content:center}.p1[data-v-ea75dfbf]{padding:1rem}.p2[data-v-ea75dfbf]{padding:2rem}.p0[data-v-ea75dfbf]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-ea75dfbf]{text-underline-offset:.7ex;text-decoration:underline 1px}a[data-v-ea75dfbf]{text-decoration:none;cursor:pointer}a[data-v-ea75dfbf]:hover{text-decoration:underline}.tool[data-v-ea75dfbf]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.2rem}.tool>svg[data-v-ea75dfbf]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-ea75dfbf]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-ea75dfbf]{cursor:default}.tool.no-hover[data-v-ea75dfbf]:hover{background:unset!important}.tool.disabled[data-v-ea75dfbf]{cursor:not-allowed}.tool.disabled[data-v-ea75dfbf]:hover{background:unset!important}.my-node[data-v-ea75dfbf]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-ea75dfbf]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-ea75dfbf]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-ea75dfbf]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-ea75dfbf]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-ea75dfbf]{position:fixed;z-index:1001;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-ea75dfbf]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-ea75dfbf]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-ea75dfbf]{position:relative}.modal .mask[data-v-ea75dfbf]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-ea75dfbf]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-ea75dfbf]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-ea75dfbf]:first-child{border-left:none}.radio-group2 .active[data-v-ea75dfbf]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-ea75dfbf]{position:relative;display:inline-flex;justify-content:center}input[data-v-ea75dfbf]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-ea75dfbf]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-ea75dfbf]:focus{border:1px solid var(--color-active)}.danger[data-v-ea75dfbf]{color:red!important}.pop-confirm-content[data-v-ea75dfbf]{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:1003}.pop-confirm-content .text[data-v-ea75dfbf]{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options[data-v-ea75dfbf]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}img[data-v-ea75dfbf]{max-width:100%}.Post[data-v-ea75dfbf]{position:unset!important;background:transparent!important;overflow:unset!important}.Post .main[data-v-ea75dfbf]{background:transparent!important;padding:unset!important;width:100%!important}.Post .close-btn[data-v-ea75dfbf],.Post .open-new-tab[data-v-ea75dfbf]{display:none}.post-detail[data-v-ea75dfbf]{text-align:start;position:fixed;z-index:1002;left:0;right:0;bottom:0;top:0;background:rgba(46,47,48,.8);overflow:auto;font-size:1.4rem;display:flex;justify-content:center;flex-wrap:wrap}.post-detail[data-v-ea75dfbf] .subtle{background-color:#ecfdf5e6;border-left:4px solid #a7f3d0}.post-detail.isNight[data-v-ea75dfbf] .subtle{background-color:#1a3332;border-left:4px solid #047857}.post-detail .main[data-v-ea75dfbf]{display:flex;justify-content:flex-end;padding:3rem 8rem 15rem;background:var(--color-main-bg);position:relative;outline:none}.post-detail .main .main-wrapper[data-v-ea75dfbf]{width:77rem;padding-bottom:2rem;display:flex;flex-direction:column;align-items:center;position:relative}.post-detail .main .main-wrapper .post-wrapper .header:hover .add-tag[data-v-ea75dfbf]{display:inline-block}.post-detail .main .main-wrapper .loading-wrapper[data-v-ea75dfbf]{height:20rem;display:flex;justify-content:center;align-items:center}.post-detail .main .main-wrapper #no-comments-yet[data-v-ea75dfbf]{color:#a9a9a9;font-weight:700;text-align:center;width:100%;margin-bottom:2rem;box-sizing:border-box}.post-detail .main .relationReply[data-v-ea75dfbf]{position:fixed;width:25vw;top:6.5rem;bottom:15rem;z-index:100;transform:translate(calc(100% + 2rem));font-size:2rem;overflow:hidden}.post-detail .main .relationReply .my-cell[data-v-ea75dfbf]{background:var(--color-second-bg);border-radius:var(--box-border-radius) var(--box-border-radius) 0 0}.post-detail .main .relationReply .comments[data-v-ea75dfbf]{max-height:calc(100% - 4.2rem);overflow:auto;background:var(--color-second-bg);border-radius:0 0 var(--box-border-radius) var(--box-border-radius)}.post-detail .main .call-list[data-v-ea75dfbf]{z-index:9;position:absolute;top:12rem;border:1px solid var(--color-main-bg);background:var(--color-call-list-bg);box-shadow:0 5px 15px #0000001a;overflow:auto;max-height:30rem;border-radius:var(--box-border-radius);min-width:8rem;box-sizing:content-box}.post-detail .main .call-list .call-item[data-v-ea75dfbf]{border-top:1px solid var(--color-main-bg);height:3rem;display:flex;padding:0 1rem;align-items:center;cursor:pointer;font-size:14px;box-sizing:border-box}.post-detail .main .call-list .call-item .select[data-v-ea75dfbf],.post-detail .main .call-list .call-item[data-v-ea75dfbf]:hover,.post-detail .main .call-list .call-item.select[data-v-ea75dfbf]{background:var(--color-main-bg);text-decoration:none}.post-detail .main .call-list .call-item[data-v-ea75dfbf]:nth-child(1){border-top:1px solid transparent}@media screen and (max-width: 1280px){.post-detail .main-wrapper[data-v-ea75dfbf]{width:60vw!important}}.post-detail .scroll-top[data-v-ea75dfbf]{cursor:pointer;position:fixed;border-radius:.6rem;display:flex;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.2rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);color:var(--color-font-3)}.post-detail .scroll-top svg[data-v-ea75dfbf]{font-size:2.4rem}.post-detail .refresh[data-v-ea75dfbf]{cursor:pointer;position:fixed;border-radius:.6rem;display:flex;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.2rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);color:var(--color-font-3);bottom:23.5rem}.post-detail .refresh svg[data-v-ea75dfbf]{font-size:2.4rem}.post-detail .scroll-to[data-v-ea75dfbf]{cursor:pointer;position:fixed;border-radius:.6rem;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.2rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);color:var(--color-font-3);bottom:15rem;display:flex;flex-direction:column}.post-detail .scroll-to svg[data-v-ea75dfbf]{font-size:2.4rem}.post-detail .scroll-to input[data-v-ea75dfbf]{height:2.6rem;width:3.6rem;font-size:1.4rem;text-align:center;color:gray}.post-detail .msg[data-v-ea75dfbf]{cursor:pointer;position:fixed;border-radius:.6rem;display:flex;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.2rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);color:var(--color-font-3);bottom:5rem}.post-detail .msg svg[data-v-ea75dfbf]{font-size:2.4rem}.post-detail .close-btn[data-v-ea75dfbf]{color:var(--color-font-3);cursor:pointer;position:fixed;top:3rem;transform:translate(4rem);font-size:2.4rem}.post-detail .top-reply[data-v-ea75dfbf]{color:var(--color-font-3);cursor:pointer;font-size:2rem;display:flex}.post-detail .open-new-tab[data-v-ea75dfbf]{color:var(--color-font-3);cursor:pointer;position:fixed;top:3rem;transform:translate(4rem);font-size:2.4rem;top:8rem}.base64_tooltip[data-v-06429e70]{box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;background:var(--color-third-bg);min-height:2.2rem;max-width:20rem;padding:1rem;position:fixed;z-index:9998;display:flex;align-items:center;border-radius:.5rem;cursor:pointer;line-break:anywhere;font-size:1.4rem;color:var(--color-font-8)}.base64_tooltip svg[data-v-06429e70]{margin-left:1rem;font-size:3rem;color:var(--color-gray)}.base64_tooltip[data-v-06429e70] .base-button{margin-left:1rem;margin-top:1rem}.msg[data-v-8bf692ea]{cursor:default;margin-bottom:2rem;display:flex;font-size:1.4rem;box-sizing:border-box;border-radius:var(--box-border-radius);color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.msg.success .left[data-v-8bf692ea]{background:var(--color-active)}.msg.warning .left[data-v-8bf692ea]{background:#c8c002}.msg.error .left[data-v-8bf692ea]{background:red}.msg .left[data-v-8bf692ea]{border-radius:var(--box-border-radius) 0 0 var(--box-border-radius);display:flex;align-items:center;background:var(--color-active);color:#fff;width:3.6rem;font-size:2.4rem;justify-content:center}.msg .left svg[data-v-8bf692ea]{cursor:pointer}.msg .right[data-v-8bf692ea]{flex:1;padding:1rem 2rem;display:flex;justify-content:space-between;align-items:center}.tag-modal[data-v-0f1f99f7]{z-index:1003}.tag-modal .wrapper[data-v-0f1f99f7]{z-index:9;background:var(--color-main-bg);color:var(--color-font-8);border-radius:1rem;font-size:1.4rem;padding:2rem 4rem;width:25rem}.tag-modal .wrapper .title[data-v-0f1f99f7]{font-weight:700}.tag-modal .wrapper .btns[data-v-0f1f99f7]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1.5rem;font-size:1.4rem}.msgs[data-v-b73f4332]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.NotificationModal .modal-root[data-v-77aa374e]{z-index:9;background:var(--color-second-bg);color:var(--color-font-8);border-radius:1rem;font-size:1.4rem;width:50vw;height:80vh;display:flex;flex-direction:column;padding:1.4rem;gap:1rem}.NotificationModal .modal-root .modal-header[data-v-77aa374e]{display:flex;justify-content:space-between}.NotificationModal .modal-root .modal-header .title[data-v-77aa374e]{font-size:2.6rem;font-weight:700;text-align:left;margin-bottom:0}.NotificationModal .modal-root .modal-header i[data-v-77aa374e]{cursor:pointer;font-size:2.2rem}.NotificationModal .modal-root .modal-body[data-v-77aa374e]{padding-top:0;flex:1;gap:1rem;display:flex;flex-direction:column;overflow:hidden}.NotificationModal .modal-root .modal-body .filter[data-v-77aa374e]{display:flex;gap:1rem}.NotificationModal .modal-root .modal-body .filter div[data-v-77aa374e]{border-radius:.4rem;padding:.4rem 1rem;background:gainsboro;cursor:pointer}.NotificationModal .modal-root .modal-body .filter div.active[data-v-77aa374e]{background:#445;color:#fff}.NotificationModal .modal-root .modal-body .list-wrap[data-v-77aa374e]{flex:1;position:relative;overflow:hidden}.NotificationModal .modal-root .modal-body .list-wrap .loading-wrap[data-v-77aa374e]{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.7)}.NotificationModal .modal-root .modal-body .list-wrap .notify-wrap[data-v-77aa374e]{overflow:auto;height:100%}.NotificationModal .modal-root .modal-body .list-wrap #notifications[data-v-77aa374e] .cell{display:none;padding:1.2rem 0}.NotificationModal .modal-root .modal-body .list-wrap #notifications[data-v-77aa374e] .cell a.node{padding:.6rem 1rem;border-radius:.4rem}.NotificationModal .modal-root .modal-body .list-wrap #notifications[data-v-77aa374e] .cell .payload{margin-top:.4rem;font-size:1.7rem}.NotificationModal .modal-root .modal-body #notifications.all[data-v-77aa374e] .cell,.NotificationModal .modal-root .modal-body #notifications.reply[data-v-77aa374e] .reply,.NotificationModal .modal-root .modal-body #notifications.star[data-v-77aa374e] .star,.NotificationModal .modal-root .modal-body #notifications.collect[data-v-77aa374e] .collect{display:block}.NotificationModal .modal-root .modal-body .footer[data-v-77aa374e]{width:100%;display:flex;align-items:center;gap:2rem}.NotificationModal .modal-root .modal-body .footer .pages[data-v-77aa374e]{flex:1}.NotificationModal .modal-root .modal-body .footer .total[data-v-77aa374e]{font-weight:700}.NotificationModal .modal-root .modal-body .footer .total span[data-v-77aa374e]{color:#d3d3d3;font-weight:400;margin-right:.4rem}.NotificationModal .modal-root .modal-body[data-v-77aa374e] .super.button{padding:0;background:unset;height:26px;width:37px}.NotificationModal .modal-root .modal-body[data-v-77aa374e] .super.button a{display:block}.NotificationModal .modal-root .modal-body[data-v-77aa374e] .super.button a:hover{text-decoration:none}.v-enter-active,.v-leave-active{transition:opacity .3s ease}.v-enter-from,.v-leave-to{opacity:0}.username{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num{font-size:1.2rem;font-weight:700;color:#e02a2a}.owner{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove{display:inline}.my-tag .remove{cursor:pointer;margin-left:.5rem;display:none}.add-tag{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor{margin-left:.5rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--color-top-reply-wrap-bg: #f2f3f5;--color-top-reply-wrap-line: #d2d2d2}html.dark{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e;--color-top-reply-wrap-bg: #212f3e;--color-top-reply-wrap-line: #3b536d}html,body{font-size:62.5%}.flex{display:flex;align-items:center;justify-content:space-between}.flex-end{justify-content:flex-end}.flex-center{justify-content:center}.p1{padding:1rem}.p2{padding:2rem}.p0{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http]{text-underline-offset:.7ex;text-decoration:underline 1px}a{text-decoration:none;cursor:pointer}a:hover{text-decoration:underline}.tool{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.2rem}.tool>svg{width:1.6rem!important;height:1.6rem!important}.tool:hover{background:var(--color-third-bg)}.tool.no-hover{cursor:default}.tool.no-hover:hover{background:unset!important}.tool.disabled{cursor:not-allowed}.tool.disabled:hover{background:unset!important}.my-node{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node:hover{text-decoration:none;background:#e2e2e2}.msgs{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;box-sizing:border-box;transition:background-color .3s}.my-cell{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal{position:fixed;z-index:1001;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option{display:flex;align-items:center;padding:.6rem 0}.modal .option>span{position:relative}.modal .mask{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio:first-child{border-left:none}.radio-group2 .active{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm{position:relative;display:inline-flex;justify-content:center}input{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input:hover{border:1px solid var(--color-input-border-hover)}input:focus{border:1px solid var(--color-active)}.danger{color:red!important}.pop-confirm-content{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:1003}.pop-confirm-content .text{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}img{max-width:100%}.target-user-tags[data-v-d9e3ae7c]{background:var(--color-second-bg);color:var(--color-font);word-break:break-all;text-align:start;font-size:1.4rem;box-shadow:0 2px 3px #0000001a;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.target-user-tags .add-tag[data-v-d9e3ae7c]{display:inline-block}.loaded[data-v-d9e3ae7c]{font-size:1.4rem;display:flex;align-items:center;gap:1rem;color:var(--color-font-pure)}.calender[data-v-d9e3ae7c]{padding:10px;font-size:14px;color:var(--link-color)}.calender .month[data-v-d9e3ae7c]{height:30px;display:flex;justify-content:space-between;align-items:center}.calender .month .ca-title[data-v-d9e3ae7c]{flex:1;display:flex;justify-content:flex-end;align-items:center;gap:10px}.calender .month i[data-v-d9e3ae7c]{height:100%;width:30px;cursor:pointer;color:#a9a9a9}.calender .calender-header[data-v-d9e3ae7c]{display:flex;height:30px;align-items:center}.calender .calender-header div[data-v-d9e3ae7c]{flex:1}.calender .days[data-v-d9e3ae7c]{display:grid;grid-template-columns:repeat(7,1fr)}.calender .days .day[data-v-d9e3ae7c]{height:30px}.calender .days .day a[data-v-d9e3ae7c]{display:inline-flex;height:100%;width:100%;justify-content:center;align-items:center}.calender .days .active[data-v-d9e3ae7c]{background:#40a9ff;border-radius:4px}.calender .days .active a[data-v-d9e3ae7c]{color:#fff!important} ');
  8655. run();
  8656. let vueApp = vue.createApp(App);
  8657. vueApp.config.unwrapInjectedRef = true;
  8658. vueApp.mount($section);
  8659. }
  8660.  
  8661. })(Vue, dayjs);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址