🏠 Home 

Greasy Fork is available in English.

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.greasyfork.org/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. (function (vue, dayjs) {
  33. 'use strict';
  34. var PageType = /* @__PURE__ */ ((PageType2) => {
  35. PageType2["Home"] = "Home";
  36. PageType2["Node"] = "Node";
  37. PageType2["Post"] = "Post";
  38. PageType2["Member"] = "Member";
  39. PageType2["Changes"] = "Changes";
  40. PageType2["Hot"] = "Hot";
  41. return PageType2;
  42. })(PageType || {});
  43. var CommentDisplayType = /* @__PURE__ */ ((CommentDisplayType2) => {
  44. CommentDisplayType2[CommentDisplayType2["FloorInFloor"] = 0] = "FloorInFloor";
  45. CommentDisplayType2[CommentDisplayType2["FloorInFloorNoCallUser"] = 4] = "FloorInFloorNoCallUser";
  46. CommentDisplayType2[CommentDisplayType2["FloorInFloorNested"] = 5] = "FloorInFloorNested";
  47. CommentDisplayType2[CommentDisplayType2["Like"] = 1] = "Like";
  48. CommentDisplayType2[CommentDisplayType2["V2exOrigin"] = 2] = "V2exOrigin";
  49. CommentDisplayType2[CommentDisplayType2["OnlyOp"] = 3] = "OnlyOp";
  50. CommentDisplayType2[CommentDisplayType2["New"] = 6] = "New";
  51. return CommentDisplayType2;
  52. })(CommentDisplayType || {});
  53. const _sfc_main$m = {
  54. name: "Tooltip",
  55. props: {
  56. title: {
  57. type: String,
  58. default() {
  59. return "";
  60. }
  61. },
  62. disabled: {
  63. type: Boolean,
  64. default() {
  65. return false;
  66. }
  67. }
  68. },
  69. data() {
  70. return {
  71. show: false
  72. };
  73. },
  74. methods: {
  75. showPop(e2) {
  76. if (this.disabled)
  77. return;
  78. if (!this.title)
  79. return;
  80. e2.stopPropagation();
  81. let rect = e2.target.getBoundingClientRect();
  82. this.show = true;
  83. vue.nextTick(() => {
  84. var _a, _b;
  85. let tip = (_b = (_a = this.$refs) == null ? void 0 : _a.tip) == null ? void 0 : _b.getBoundingClientRect();
  86. if (!tip)
  87. return;
  88. if (rect.top < 50) {
  89. this.$refs.tip.style.top = rect.top + rect.height + 10 + "px";
  90. } else {
  91. this.$refs.tip.style.top = rect.top - tip.height - 10 + "px";
  92. }
  93. let tipWidth = tip.width;
  94. let rectWidth = rect.width;
  95. this.$refs.tip.style.left = rect.left - (tipWidth - rectWidth) / 2 + "px";
  96. });
  97. }
  98. },
  99. render() {
  100. let Vnode = this.$slots.default()[0];
  101. return vue.createVNode(vue.Fragment, null, [this.show && this.title && vue.createVNode(vue.Teleport, {
  102. "to": "body"
  103. }, {
  104. default: () => [vue.createVNode(vue.Transition, {
  105. "name": "fade"
  106. }, {
  107. default: () => [vue.createVNode("div", {
  108. "ref": "tip",
  109. "className": "tip"
  110. }, [this.title])]
  111. })]
  112. }), vue.createVNode(Vnode, {
  113. "onClick": () => this.show = false,
  114. "onmouseenter": (e2) => this.showPop(e2),
  115. "onmouseleave": () => this.show = false
  116. }, null)]);
  117. }
  118. };
  119. const _export_sfc = (sfc, props) => {
  120. const target = sfc.__vccOpts || sfc;
  121. for (const [key, val] of props) {
  122. target[key] = val;
  123. }
  124. return target;
  125. };
  126. const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-ee672411"]]);
  127. const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
  128. __name: "BaseSwitch",
  129. props: {
  130. modelValue: { type: Boolean }
  131. },
  132. emits: ["update:modelValue"],
  133. setup(__props, { emit: __emit }) {
  134. return (_ctx, _cache) => {
  135. return vue.openBlock(), vue.createElementBlock("div", {
  136. class: vue.normalizeClass(["switch", { active: _ctx.modelValue }]),
  137. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", !_ctx.modelValue))
  138. }, null, 2);
  139. };
  140. }
  141. });
  142. const BaseSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-e7c0fbef"]]);
  143. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  144. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  145. const functions = {
  146. async refreshOnce(once) {
  147. return new Promise((resolve) => {
  148. if (once) {
  149. if (typeof once === "string") {
  150. let res = once.match(/var once = "([\d]+)";/);
  151. if (res && res[1])
  152. resolve(Number(res[1]));
  153. }
  154. if (typeof once === "number")
  155. resolve(once);
  156. }
  157. window.fetchOnce().then((r2) => {
  158. resolve(r2);
  159. });
  160. });
  161. },
  162. clone: (val) => JSON.parse(JSON.stringify(val)),
  163. createList(post, replyList, withRedundList = true) {
  164. post.replyList = replyList;
  165. post.topReplyList = this.clone(replyList).filter((v) => v.thankCount >= window.config.topReplyLoveMinCount).sort((a, b) => b.thankCount - a.thankCount).slice(0, window.config.topReplyCount);
  166. post.replyCount = replyList.length;
  167. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  168. post.nestedReplies = functions.createNestedList(this.clone(replyList), post.topReplyList);
  169. if (withRedundList) {
  170. post.nestedRedundReplies = functions.createNestedRedundantList(this.clone(replyList), post.topReplyList);
  171. }
  172. return post;
  173. },
  174. //获取所有回复
  175. getAllReply(repliesMap = []) {
  176. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  177. pre = pre.concat(i.replyList);
  178. return pre;
  179. }, []);
  180. },
  181. //查找子回复
  182. findChildren(item, endList, all, topReplyList) {
  183. var _a;
  184. const fn = (child, endList2, parent) => {
  185. child.level = parent.level + 1;
  186. let rIndex2 = all.findIndex((v) => v.floor === child.floor);
  187. if (rIndex2 > -1) {
  188. all[rIndex2].isUse = true;
  189. }
  190. parent.children.push(this.findChildren(child, endList2, all, topReplyList));
  191. };
  192. item.children = [];
  193. let floorReplyList = [];
  194. for (let i = 0; i < endList.length; i++) {
  195. let currentItem = endList[i];
  196. if (currentItem.isUse)
  197. continue;
  198. if (currentItem.replyFloor === item.floor) {
  199. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  200. currentItem.isUse = true;
  201. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  202. } else {
  203. currentItem.isWrong = true;
  204. }
  205. }
  206. }
  207. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  208. fn(currentItem, endList2, item);
  209. });
  210. let nextMeIndex = endList.findIndex((v) => {
  211. var _a2;
  212. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  213. });
  214. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  215. for (let i = 0; i < findList.length; i++) {
  216. let currentItem = findList[i];
  217. if (currentItem.isUse)
  218. continue;
  219. if (currentItem.replyUsers.length === 1) {
  220. if (currentItem.replyFloor !== -1) {
  221. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  222. continue;
  223. }
  224. }
  225. let endList2 = endList.slice(i + 1);
  226. if (currentItem.username === item.username) {
  227. if (currentItem.replyUsers[0] === item.username) {
  228. fn(currentItem, endList2, item);
  229. }
  230. break;
  231. } else {
  232. if (currentItem.replyUsers[0] === item.username) {
  233. fn(currentItem, endList2, item);
  234. }
  235. }
  236. } else {
  237. if (currentItem.username === item.username)
  238. break;
  239. }
  240. }
  241. item.children = item.children.sort((a, b) => a.floor - b.floor);
  242. item.replyCount = item.children.reduce((a, b) => {
  243. return a + (b.children.length ? b.replyCount + 1 : 1);
  244. }, 0);
  245. let rIndex = topReplyList.findIndex((v) => v.floor === item.floor);
  246. if (rIndex > -1) {
  247. topReplyList[rIndex].children = item.children;
  248. topReplyList[rIndex].replyCount = item.replyCount;
  249. }
  250. return item;
  251. },
  252. //生成嵌套回复
  253. createNestedList(allList = [], topReplyList = []) {
  254. if (!allList.length)
  255. return [];
  256. let list = allList;
  257. let nestedList = [];
  258. list.map((item, index) => {
  259. let startList = list.slice(0, index);
  260. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  261. let endList = list.slice(index + 1);
  262. if (index === 0) {
  263. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  264. } else {
  265. if (!item.isUse) {
  266. let isOneLevelReply = false;
  267. if (item.replyUsers.length) {
  268. if (item.replyUsers.length > 1) {
  269. isOneLevelReply = true;
  270. } else {
  271. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  272. }
  273. } else {
  274. isOneLevelReply = true;
  275. }
  276. if (isOneLevelReply) {
  277. item.level = 0;
  278. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  279. }
  280. }
  281. }
  282. });
  283. return nestedList;
  284. },
  285. //生成嵌套冗余回复
  286. createNestedRedundantList(allList = [], topReplyList) {
  287. if (!allList.length)
  288. return [];
  289. let list = allList;
  290. let nestedList = [];
  291. list.map((item, index) => {
  292. let startList = list.slice(0, index);
  293. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  294. let endList = list.slice(index + 1);
  295. if (index === 0) {
  296. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  297. } else {
  298. if (!item.isUse) {
  299. let isOneLevelReply = false;
  300. if (item.replyUsers.length) {
  301. if (item.replyUsers.length > 1) {
  302. isOneLevelReply = true;
  303. } else {
  304. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  305. }
  306. } else {
  307. isOneLevelReply = true;
  308. }
  309. if (isOneLevelReply) {
  310. item.level = 0;
  311. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  312. }
  313. } else {
  314. let newItem = this.clone(item);
  315. newItem.children = [];
  316. newItem.level = 0;
  317. newItem.isDup = true;
  318. nestedList.push(newItem);
  319. }
  320. }
  321. });
  322. return nestedList;
  323. },
  324. //解析A标签
  325. parseA(a) {
  326. let href = a.href;
  327. let id;
  328. if (href.includes("/t/")) {
  329. id = a.pathname.substring("/t/".length);
  330. }
  331. return { href, id, title: a.innerText };
  332. },
  333. //图片链接转Img标签
  334. checkPhotoLink2Img(dom) {
  335. let replaceImgur = window.config.replaceImgur;
  336. let is_add = false;
  337. let prefix_img = replaceImgur ? DefaultVal.imgurProxy : "";
  338. let imgList = dom.querySelectorAll("img");
  339. imgList.forEach((img) => {
  340. let href = img.src;
  341. if (href.includes("imgur.com")) {
  342. img.setAttribute("originUrl", img.src);
  343. img.setAttribute("notice", "此img标签由V2Next脚本解析");
  344. img.setAttribute("referrerpolicy", "no-referrer");
  345. 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"))
  346. ;
  347. else {
  348. href = href + ".png";
  349. }
  350. if (!is_add && replaceImgur) {
  351. let meta = document.createElement("meta");
  352. meta.setAttribute("name", "referrer");
  353. meta.setAttribute("content", "no-referrer");
  354. document.getElementsByTagName("head")[0].appendChild(meta);
  355. is_add = true;
  356. }
  357. img.src = prefix_img + href;
  358. }
  359. });
  360. let aList = dom.querySelectorAll("a");
  361. aList.forEach((a) => {
  362. let href = a.href;
  363. if (a.children.length == 0 && a.innerText == href) {
  364. 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")) {
  365. let img = document.createElement("img");
  366. img.setAttribute("originUrl", a.href);
  367. img.setAttribute("notice", "此img标签由V2Next脚本解析");
  368. img.setAttribute("referrerpolicy", "no-referrer");
  369. if (href.includes("imgur.com")) {
  370. if (!is_add && replaceImgur) {
  371. let meta = document.createElement("meta");
  372. meta.setAttribute("name", "referrer");
  373. meta.setAttribute("content", "no-referrer");
  374. document.getElementsByTagName("head")[0].appendChild(meta);
  375. is_add = true;
  376. }
  377. img.src = prefix_img + href;
  378. } else {
  379. img.src = href;
  380. }
  381. a.innerText = "";
  382. a.append(img);
  383. }
  384. }
  385. });
  386. },
  387. //检测帖子回复长度
  388. async checkPostReplies(id, needOpen = true) {
  389. return new Promise(async (resolve) => {
  390. let res = await functions.getPostDetailByApi(id);
  391. if ((res == null ? void 0 : res.replies) > window.config.maxReplyCountLimit) {
  392. if (needOpen) {
  393. functions.openNewTab(`https://${location.origin}/t/${id}?p=1&script=1`);
  394. }
  395. return resolve(true);
  396. }
  397. resolve(false);
  398. });
  399. },
  400. async sleep(time) {
  401. return new Promise((resolve) => {
  402. setTimeout(resolve, time);
  403. });
  404. },
  405. //打开新标签页
  406. openNewTab(href, active = false) {
  407. let isSafariBrowser = /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
  408. if (isSafariBrowser) {
  409. let tempId = "a_blank_" + Date.now();
  410. let a = document.createElement("a");
  411. a.setAttribute("href", href);
  412. a.setAttribute("target", "_blank");
  413. a.setAttribute("id", tempId);
  414. a.setAttribute("script", "1");
  415. if (!document.getElementById(tempId)) {
  416. document.body.appendChild(a);
  417. }
  418. a.click();
  419. } else {
  420. _GM_openInTab(href, { active });
  421. }
  422. },
  423. async cbChecker(val, count = 0) {
  424. if (window.cb) {
  425. window.cb(val);
  426. } else {
  427. while (!window.cb && count < 30) {
  428. await functions.sleep(500);
  429. count++;
  430. }
  431. window.cb && window.cb(val);
  432. }
  433. },
  434. //初始化脚本菜单
  435. initMonkeyMenu() {
  436. try {
  437. _GM_registerMenuCommand("脚本设置", () => {
  438. functions.cbChecker({ type: "openSetting" });
  439. });
  440. _GM_registerMenuCommand("仓库地址", () => {
  441. functions.openNewTab(window.const.git);
  442. });
  443. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  444. } catch (e2) {
  445. console.error("无法使用Tampermonkey");
  446. }
  447. },
  448. feedback() {
  449. functions.openNewTab(DefaultVal.issue);
  450. },
  451. //检测页面类型
  452. checkPageType(a) {
  453. let l = a || window.location;
  454. let data = { pageType: null, pageData: { id: "", pageNo: null }, username: "" };
  455. if (l.pathname === "/") {
  456. data.pageType = PageType.Home;
  457. } else if (l.pathname === "/changes") {
  458. data.pageType = PageType.Changes;
  459. } else if (l.pathname === "/v2hot") {
  460. data.pageType = PageType.Hot;
  461. } else if (l.pathname === "/recent") {
  462. data.pageType = PageType.Changes;
  463. } else if (l.href.match(/.com\/?tab=/)) {
  464. data.pageType = PageType.Home;
  465. } else if (l.href.match(/.com\/go\//)) {
  466. if (!l.href.includes("/links")) {
  467. data.pageType = PageType.Node;
  468. }
  469. } else if (l.href.match(/.com\/member/)) {
  470. data.pageType = PageType.Member;
  471. data.username = l.pathname.replace("/member/", "").replace("/replies", "").replace("/topics", "");
  472. } else {
  473. let r2 = l.href.match(/.com\/t\/([\d]+)/);
  474. if (r2 && !l.pathname.includes("review") && !l.pathname.includes("info")) {
  475. data.pageType = PageType.Post;
  476. data.pageData.id = r2[1];
  477. if (l.search) {
  478. let pr = l.href.match(/\?p=([\d]+)/);
  479. if (pr)
  480. data.pageData.pageNo = Number(pr[1]);
  481. }
  482. }
  483. }
  484. return data;
  485. },
  486. //通过api获取主题详情
  487. getPostDetailByApi(id) {
  488. return new Promise((resolve) => {
  489. fetch(`${location.origin}/api/topics/show.json?id=${id}`).then(async (r2) => {
  490. if (r2.status === 200) {
  491. let res = await r2.json();
  492. if (res) {
  493. let d2 = res[0];
  494. resolve(d2);
  495. }
  496. }
  497. });
  498. });
  499. },
  500. appendPostContent(res, el) {
  501. let a = document.createElement("a");
  502. a.href = res.href;
  503. a.classList.add("post-content");
  504. let div = document.createElement("div");
  505. div.innerHTML = res.content_rendered;
  506. a.append(div);
  507. el.append(a);
  508. const checkHeight2 = () => {
  509. var _a;
  510. if (div.clientHeight < 300) {
  511. a.classList.add("show-all");
  512. } else {
  513. let showMore = document.createElement("div");
  514. showMore.classList.add("show-more");
  515. showMore.innerHTML = "显示更多/收起";
  516. showMore.onclick = function(e2) {
  517. e2.stopPropagation();
  518. a.classList.toggle("show-all");
  519. };
  520. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  521. }
  522. };
  523. checkHeight2();
  524. },
  525. //从本地读取配置
  526. initConfig() {
  527. let configStr = localStorage.getItem("v2ex-config");
  528. let configMap = {};
  529. let configObj = {};
  530. let userName = window.user.username || "default";
  531. if (configStr) {
  532. configMap = JSON.parse(configStr);
  533. configObj = configMap[userName];
  534. if (configObj) {
  535. window.config = functions.deepAssign(window.config, configObj);
  536. }
  537. }
  538. configMap[userName] = window.config;
  539. localStorage.setItem("v2ex-config", JSON.stringify(configMap));
  540. },
  541. deepAssign(...arg) {
  542. let name, options, src, copy;
  543. let length = arguments.length;
  544. let i = 1;
  545. let target = arguments[0] || {};
  546. if (typeof target !== "object") {
  547. target = {};
  548. }
  549. for (; i < length; i++) {
  550. options = arguments[i];
  551. if (options != null) {
  552. for (name in options) {
  553. src = target[name];
  554. copy = options[name];
  555. if (copy && typeof copy == "object") {
  556. target[name] = this.deepAssign(src, copy);
  557. } else if (copy !== void 0) {
  558. target[name] = copy;
  559. }
  560. }
  561. }
  562. }
  563. return target;
  564. },
  565. //生成dom,从html字符串
  566. genDomFromHtmlString(htmlText) {
  567. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  568. let body = document.createElement("html");
  569. body.innerHTML = bodyText[0];
  570. return body;
  571. },
  572. stopEvent(e2) {
  573. e2.preventDefault();
  574. e2.stopPropagation();
  575. }
  576. };
  577. const DefaultPost = {
  578. allReplyUsers: [],
  579. content_rendered: "",
  580. createDate: "",
  581. createDateAgo: "",
  582. lastReplyDate: "",
  583. lastReplyUsername: "",
  584. fr: "",
  585. replyList: [],
  586. topReplyList: [],
  587. nestedReplies: [],
  588. nestedRedundReplies: [],
  589. username: "",
  590. url: "",
  591. href: "",
  592. member: {
  593. avatar: "",
  594. username: ""
  595. },
  596. node: {
  597. title: "",
  598. url: ""
  599. },
  600. headerTemplate: "",
  601. title: "",
  602. id: "",
  603. type: "post",
  604. once: "",
  605. replyCount: 0,
  606. clickCount: 0,
  607. thankCount: 0,
  608. collectCount: 0,
  609. lastReadFloor: 0,
  610. isFavorite: false,
  611. isIgnore: false,
  612. isThanked: false,
  613. isReport: false,
  614. inList: false
  615. };
  616. const getDefaultPost = (val = {}) => {
  617. return Object.assign(functions.clone(DefaultPost), val);
  618. };
  619. const DefaultUser = {
  620. tagPrefix: "--用户标签--",
  621. tags: {},
  622. tagsId: "",
  623. username: "",
  624. avatar: "",
  625. readPrefix: "--已读楼层--",
  626. readNoteItemId: "",
  627. readList: {},
  628. imgurPrefix: "--imgur图片删除hash--",
  629. imgurList: {},
  630. imgurNoteId: "",
  631. configPrefix: "--config--",
  632. configNoteId: ""
  633. };
  634. const DefaultVal = {
  635. pageType: void 0,
  636. pageData: { pageNo: 1 },
  637. targetUserName: "",
  638. currentVersion: 5,
  639. cb: null,
  640. git: "https://github.com/zyronon/V2Next",
  641. shortGit: "zyronon/V2Next",
  642. issue: "https://github.com/zyronon/V2Next/issues",
  643. pcLog: "https://greasyfork.org/zh-CN/scripts/458024/versions",
  644. pcScript: "https://greasyfork.org/zh-CN/scripts/458024",
  645. mobileScript: "https://github.com/zyronon/V2Next/releases",
  646. homeUrl: "https://vtonext.vercel.app/",
  647. hotUrl: "https://v2hotlist.vercel.app/hot/",
  648. imgurProxy: "https://img.noobzone.ru/getimg.php?url="
  649. };
  650. function getDefaultConfig(val = {}) {
  651. return Object.assign({
  652. showToolbar: true,
  653. autoOpenDetail: true,
  654. openTag: false,
  655. //给用户打标签
  656. clickPostItemOpenDetail: true,
  657. closePostDetailBySpace: true,
  658. //点击空白处关闭详情
  659. contentAutoCollapse: true,
  660. //正文超长自动折叠
  661. viewType: "table",
  662. commentDisplayType: CommentDisplayType.FloorInFloorNoCallUser,
  663. newTabOpen: false,
  664. //新标签打开
  665. newTabOpenActive: false,
  666. base64: true,
  667. //base功能
  668. sov2ex: false,
  669. postWidth: "",
  670. showTopReply: true,
  671. topReplyLoveMinCount: 3,
  672. topReplyCount: 5,
  673. autoJumpLastReadFloor: false,
  674. rememberLastReadFloor: false,
  675. autoSignin: true,
  676. customBgColor: "",
  677. version: DefaultVal.currentVersion,
  678. collectBrowserNotice: false,
  679. fontSizeType: "normal",
  680. notice: {
  681. uid: "",
  682. text: "",
  683. ddWebhook: "",
  684. takeOverNoticePage: true,
  685. whenNewNoticeGlimmer: false,
  686. loopCheckNotice: false,
  687. loopCheckNoticeInterval: 5
  688. },
  689. replaceImgur: false,
  690. maxReplyCountLimit: 400
  691. }, val);
  692. }
  693. const emojiEmoticons = [
  694. {
  695. title: "常用",
  696. list: [
  697. "😅",
  698. "😭",
  699. "😂",
  700. "🥰",
  701. "😰",
  702. "🤡",
  703. "👀",
  704. "🐴",
  705. "🐶",
  706. "❓",
  707. "❤️",
  708. "💔",
  709. "⭐",
  710. "🔥",
  711. "💩",
  712. "🔞",
  713. "⚠️",
  714. "🎁",
  715. "🎉"
  716. ]
  717. },
  718. {
  719. title: "小黄脸",
  720. list: [
  721. "😀",
  722. "😁",
  723. "😂",
  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. title: "手势",
  762. list: [
  763. "🤏",
  764. "👉",
  765. "✌️",
  766. "👌",
  767. "👍",
  768. "👎",
  769. "🤝",
  770. "🙏",
  771. "👏"
  772. ]
  773. },
  774. {
  775. title: "其他",
  776. list: ["🔞", "👻", "🤡", "🐔", "👀", "💩", "🐴", "🦄", "🐧", "🐶"]
  777. }
  778. ];
  779. const classicsEmoticons = [
  780. {
  781. name: "[狗头]",
  782. low: "https://i.imgur.com/io2SM1h.png",
  783. high: "https://i.imgur.com/0icl60r.png"
  784. },
  785. {
  786. name: "[doge]",
  787. low: "https://i.imgur.com/duWRpIu.png",
  788. high: "https://i.imgur.com/HyphI6d.png"
  789. },
  790. {
  791. name: "[受虐滑稽]",
  792. low: "https://i.imgur.com/Iy0taMy.png",
  793. high: "https://i.imgur.com/PS1pxd9.png"
  794. },
  795. {
  796. name: "[马]",
  797. low: "https://i.imgur.com/8EKZv7I.png",
  798. high: "https://i.imgur.com/ANFUX52.png"
  799. },
  800. {
  801. name: "[二哈]",
  802. low: "https://i.imgur.com/XKj1Tkx.png",
  803. high: "https://i.imgur.com/dOeP4XD.png"
  804. },
  805. {
  806. name: "[舔屏]",
  807. low: "https://i.imgur.com/Cvl7dyN.png",
  808. high: "https://i.imgur.com/LmETy9N.png"
  809. },
  810. {
  811. name: "[辣眼睛]",
  812. low: "https://i.imgur.com/cPNPYD5.png",
  813. high: "https://i.imgur.com/3fSUmi8.png"
  814. },
  815. {
  816. name: "[吃瓜]",
  817. low: "https://i.imgur.com/ee8Lq7H.png",
  818. high: "https://i.imgur.com/0L26og9.png"
  819. },
  820. {
  821. name: "[不高兴]",
  822. low: "https://i.imgur.com/huX6coX.png",
  823. high: "https://i.imgur.com/N7JEuvc.png"
  824. },
  825. // {
  826. // name: '[呵呵]',
  827. // low: 'https://i.imgur.com/RvoLAbX.png',
  828. // high: 'https://i.imgur.com/xSzIqrK.png'
  829. // },
  830. {
  831. name: "[真棒]",
  832. low: "https://i.imgur.com/xr1UOz1.png",
  833. high: "https://i.imgur.com/w8YEw9Q.png"
  834. },
  835. {
  836. name: "[鄙视]",
  837. low: "https://i.imgur.com/u6jlqVq.png",
  838. high: "https://i.imgur.com/8JFNANq.png"
  839. },
  840. {
  841. name: "[疑问]",
  842. low: "https://i.imgur.com/F29pmQ6.png",
  843. high: "https://i.imgur.com/EbbTQAR.png"
  844. },
  845. {
  846. name: "[吐舌]",
  847. low: "https://i.imgur.com/InmIzl9.png",
  848. high: "https://i.imgur.com/Ovj56Cd.png"
  849. },
  850. // {
  851. // name: '[嘲笑]',
  852. // low: 'https://i.imgur.com/BaWcsMR.png',
  853. // high: 'https://i.imgur.com/0OGfJw4.png'
  854. // },
  855. // {
  856. // name: '[滑稽]',
  857. // low: 'https://i.imgur.com/lmbN0yI.png',
  858. // high: 'https://i.imgur.com/Pc0wH85.png'
  859. // },
  860. {
  861. name: "[笑眼]",
  862. low: "https://i.imgur.com/ZveiiGy.png",
  863. high: "https://i.imgur.com/PI1CfEr.png"
  864. },
  865. // {
  866. // name: '[狂汗]',
  867. // low: 'https://i.imgur.com/veWihk6.png',
  868. // high: 'https://i.imgur.com/3LtHdQv.png'
  869. // },
  870. {
  871. name: "[大哭]",
  872. low: "https://i.imgur.com/hu4oR6C.png",
  873. high: "https://i.imgur.com/b4X9XLE.png"
  874. },
  875. {
  876. name: "[喷]",
  877. low: "https://i.imgur.com/bkw3VRr.png",
  878. high: "https://i.imgur.com/wnZL13L.png"
  879. },
  880. {
  881. name: "[苦笑]",
  882. low: "https://i.imgur.com/VUWFktU.png",
  883. high: "https://i.imgur.com/NAfspZ1.png"
  884. },
  885. {
  886. name: "[喝酒]",
  887. low: "https://i.imgur.com/2ZZSapE.png",
  888. high: "https://i.imgur.com/rVbSVak.png"
  889. },
  890. {
  891. name: "[捂脸]",
  892. low: "https://i.imgur.com/krir4IG.png",
  893. high: "https://i.imgur.com/qqBqgVm.png"
  894. },
  895. // {
  896. // name: '[呕]',
  897. // low: 'https://i.imgur.com/6CUiUxv.png',
  898. // high: 'https://i.imgur.com/kgdxRsG.png'
  899. // },
  900. {
  901. name: "[阴险]",
  902. low: "https://i.imgur.com/MA8YqTP.png",
  903. high: "https://i.imgur.com/e94jbaT.png"
  904. },
  905. {
  906. name: "[怒]",
  907. low: "https://i.imgur.com/n4kWfGB.png",
  908. high: "https://i.imgur.com/iMXxNxh.png"
  909. }
  910. // {
  911. // name: '[衰]',
  912. // low: 'https://i.imgur.com/voHFDyQ.png',
  913. // high: 'https://i.imgur.com/XffE6gu.png'
  914. // },
  915. // {
  916. // name: '[合十]',
  917. // low: 'https://i.imgur.com/I8x3ang.png',
  918. // high: 'https://i.imgur.com/T4rJVee.png'
  919. // },
  920. // {
  921. // name: '[赞]',
  922. // low: 'https://i.imgur.com/lG44yUl.png',
  923. // high: 'https://i.imgur.com/AoF5PLp.png'
  924. // },
  925. // {
  926. // name: '[踩]',
  927. // low: 'https://i.imgur.com/cJp0uKZ.png',
  928. // high: 'https://i.imgur.com/1XYGfXj.png'
  929. // },
  930. // {
  931. // name: '[#心]',
  932. // low: 'https://i.imgur.com/sLENaF5.png',
  933. // high: 'https://i.imgur.com/dND56oX.png'
  934. // },
  935. //
  936. // {
  937. // name: '[心碎]',
  938. // low: 'https://i.imgur.com/AZxJzve.png',
  939. // high: 'https://i.imgur.com/RiUsPci.png'
  940. // },
  941. ];
  942. const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
  943. const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
  944. const colonSeparated = value.split(":");
  945. if (value.slice(0, 1) === "@") {
  946. if (colonSeparated.length < 2 || colonSeparated.length > 3) {
  947. return null;
  948. }
  949. provider = colonSeparated.shift().slice(1);
  950. }
  951. if (colonSeparated.length > 3 || !colonSeparated.length) {
  952. return null;
  953. }
  954. if (colonSeparated.length > 1) {
  955. const name2 = colonSeparated.pop();
  956. const prefix = colonSeparated.pop();
  957. const r###lt = {
  958. // Allow provider without '@': "provider:prefix:name"
  959. provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
  960. prefix,
  961. name: name2
  962. };
  963. return validate && !validateIconName(r###lt) ? null : r###lt;
  964. }
  965. const name = colonSeparated[0];
  966. const dashSeparated = name.split("-");
  967. if (dashSeparated.length > 1) {
  968. const r###lt = {
  969. provider,
  970. prefix: dashSeparated.shift(),
  971. name: dashSeparated.join("-")
  972. };
  973. return validate && !validateIconName(r###lt) ? null : r###lt;
  974. }
  975. if (allowSimpleName && provider === "") {
  976. const r###lt = {
  977. provider,
  978. prefix: "",
  979. name
  980. };
  981. return validate && !validateIconName(r###lt, allowSimpleName) ? null : r###lt;
  982. }
  983. return null;
  984. };
  985. const validateIconName = (icon, allowSimpleName) => {
  986. if (!icon) {
  987. return false;
  988. }
  989. return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
  990. };
  991. const defaultIconDimensions = Object.freeze(
  992. {
  993. left: 0,
  994. top: 0,
  995. width: 16,
  996. height: 16
  997. }
  998. );
  999. const defaultIconTransformations = Object.freeze({
  1000. rotate: 0,
  1001. vFlip: false,
  1002. hFlip: false
  1003. });
  1004. const defaultIconProps = Object.freeze({
  1005. ...defaultIconDimensions,
  1006. ...defaultIconTransformations
  1007. });
  1008. const defaultExtendedIconProps = Object.freeze({
  1009. ...defaultIconProps,
  1010. body: "",
  1011. hidden: false
  1012. });
  1013. function mergeIconTransformations(obj1, obj2) {
  1014. const r###lt = {};
  1015. if (!obj1.hFlip !== !obj2.hFlip) {
  1016. r###lt.hFlip = true;
  1017. }
  1018. if (!obj1.vFlip !== !obj2.vFlip) {
  1019. r###lt.vFlip = true;
  1020. }
  1021. const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
  1022. if (rotate) {
  1023. r###lt.rotate = rotate;
  1024. }
  1025. return r###lt;
  1026. }
  1027. function mergeIconData(parent, child) {
  1028. const r###lt = mergeIconTransformations(parent, child);
  1029. for (const key in defaultExtendedIconProps) {
  1030. if (key in defaultIconTransformations) {
  1031. if (key in parent && !(key in r###lt)) {
  1032. r###lt[key] = defaultIconTransformations[key];
  1033. }
  1034. } else if (key in child) {
  1035. r###lt[key] = child[key];
  1036. } else if (key in parent) {
  1037. r###lt[key] = parent[key];
  1038. }
  1039. }
  1040. return r###lt;
  1041. }
  1042. function getIconsTree(data, names) {
  1043. const icons = data.icons;
  1044. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1045. const resolved = /* @__PURE__ */ Object.create(null);
  1046. function resolve(name) {
  1047. if (icons[name]) {
  1048. return resolved[name] = [];
  1049. }
  1050. if (!(name in resolved)) {
  1051. resolved[name] = null;
  1052. const parent = aliases[name] && aliases[name].parent;
  1053. const value = parent && resolve(parent);
  1054. if (value) {
  1055. resolved[name] = [parent].concat(value);
  1056. }
  1057. }
  1058. return resolved[name];
  1059. }
  1060. (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
  1061. return resolved;
  1062. }
  1063. function internalGetIconData(data, name, tree) {
  1064. const icons = data.icons;
  1065. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1066. let currentProps = {};
  1067. function parse(name2) {
  1068. currentProps = mergeIconData(
  1069. icons[name2] || aliases[name2],
  1070. currentProps
  1071. );
  1072. }
  1073. parse(name);
  1074. tree.forEach(parse);
  1075. return mergeIconData(data, currentProps);
  1076. }
  1077. function parseIconSet(data, callback) {
  1078. const names = [];
  1079. if (typeof data !== "object" || typeof data.icons !== "object") {
  1080. return names;
  1081. }
  1082. if (data.not_found instanceof Array) {
  1083. data.not_found.forEach((name) => {
  1084. callback(name, null);
  1085. names.push(name);
  1086. });
  1087. }
  1088. const tree = getIconsTree(data);
  1089. for (const name in tree) {
  1090. const item = tree[name];
  1091. if (item) {
  1092. callback(name, internalGetIconData(data, name, item));
  1093. names.push(name);
  1094. }
  1095. }
  1096. return names;
  1097. }
  1098. const optionalPropertyDefaults = {
  1099. provider: "",
  1100. aliases: {},
  1101. not_found: {},
  1102. ...defaultIconDimensions
  1103. };
  1104. function checkOptionalProps(item, defaults) {
  1105. for (const prop in defaults) {
  1106. if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
  1107. return false;
  1108. }
  1109. }
  1110. return true;
  1111. }
  1112. function quicklyValidateIconSet(obj) {
  1113. if (typeof obj !== "object" || obj === null) {
  1114. return null;
  1115. }
  1116. const data = obj;
  1117. if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
  1118. return null;
  1119. }
  1120. if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
  1121. return null;
  1122. }
  1123. const icons = data.icons;
  1124. for (const name in icons) {
  1125. const icon = icons[name];
  1126. if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(
  1127. icon,
  1128. defaultExtendedIconProps
  1129. )) {
  1130. return null;
  1131. }
  1132. }
  1133. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1134. for (const name in aliases) {
  1135. const icon = aliases[name];
  1136. const parent = icon.parent;
  1137. if (!name.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(
  1138. icon,
  1139. defaultExtendedIconProps
  1140. )) {
  1141. return null;
  1142. }
  1143. }
  1144. return data;
  1145. }
  1146. const dataStorage = /* @__PURE__ */ Object.create(null);
  1147. function newStorage(provider, prefix) {
  1148. return {
  1149. provider,
  1150. prefix,
  1151. icons: /* @__PURE__ */ Object.create(null),
  1152. missing: /* @__PURE__ */ new Set()
  1153. };
  1154. }
  1155. function getStorage(provider, prefix) {
  1156. const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
  1157. return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
  1158. }
  1159. function addIconSet(storage2, data) {
  1160. if (!quicklyValidateIconSet(data)) {
  1161. return [];
  1162. }
  1163. return parseIconSet(data, (name, icon) => {
  1164. if (icon) {
  1165. storage2.icons[name] = icon;
  1166. } else {
  1167. storage2.missing.add(name);
  1168. }
  1169. });
  1170. }
  1171. function addIconToStorage(storage2, name, icon) {
  1172. try {
  1173. if (typeof icon.body === "string") {
  1174. storage2.icons[name] = { ...icon };
  1175. return true;
  1176. }
  1177. } catch (err) {
  1178. }
  1179. return false;
  1180. }
  1181. let simpleNames = false;
  1182. function allowSimpleNames(allow) {
  1183. if (typeof allow === "boolean") {
  1184. simpleNames = allow;
  1185. }
  1186. return simpleNames;
  1187. }
  1188. function getIconData(name) {
  1189. const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
  1190. if (icon) {
  1191. const storage2 = getStorage(icon.provider, icon.prefix);
  1192. const iconName = icon.name;
  1193. return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
  1194. }
  1195. }
  1196. function addIcon(name, data) {
  1197. const icon = stringToIcon(name, true, simpleNames);
  1198. if (!icon) {
  1199. return false;
  1200. }
  1201. const storage2 = getStorage(icon.provider, icon.prefix);
  1202. return addIconToStorage(storage2, icon.name, data);
  1203. }
  1204. function addCollection(data, provider) {
  1205. if (typeof data !== "object") {
  1206. return false;
  1207. }
  1208. if (typeof provider !== "string") {
  1209. provider = data.provider || "";
  1210. }
  1211. if (simpleNames && !provider && !data.prefix) {
  1212. let added = false;
  1213. if (quicklyValidateIconSet(data)) {
  1214. data.prefix = "";
  1215. parseIconSet(data, (name, icon) => {
  1216. if (icon && addIcon(name, icon)) {
  1217. added = true;
  1218. }
  1219. });
  1220. }
  1221. return added;
  1222. }
  1223. const prefix = data.prefix;
  1224. if (!validateIconName({
  1225. provider,
  1226. prefix,
  1227. name: "a"
  1228. })) {
  1229. return false;
  1230. }
  1231. const storage2 = getStorage(provider, prefix);
  1232. return !!addIconSet(storage2, data);
  1233. }
  1234. const defaultIconSizeCustomisations = Object.freeze({
  1235. width: null,
  1236. height: null
  1237. });
  1238. const defaultIconCustomisations = Object.freeze({
  1239. // Dimensions
  1240. ...defaultIconSizeCustomisations,
  1241. // Transformations
  1242. ...defaultIconTransformations
  1243. });
  1244. const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
  1245. const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
  1246. function calculateSize(size, ratio, precision) {
  1247. if (ratio === 1) {
  1248. return size;
  1249. }
  1250. precision = precision || 100;
  1251. if (typeof size === "number") {
  1252. return Math.ceil(size * ratio * precision) / precision;
  1253. }
  1254. if (typeof size !== "string") {
  1255. return size;
  1256. }
  1257. const oldParts = size.split(unitsSplit);
  1258. if (oldParts === null || !oldParts.length) {
  1259. return size;
  1260. }
  1261. const newParts = [];
  1262. let code = oldParts.shift();
  1263. let isNumber = unitsTest.test(code);
  1264. while (true) {
  1265. if (isNumber) {
  1266. const num = parseFloat(code);
  1267. if (isNaN(num)) {
  1268. newParts.push(code);
  1269. } else {
  1270. newParts.push(Math.ceil(num * ratio * precision) / precision);
  1271. }
  1272. } else {
  1273. newParts.push(code);
  1274. }
  1275. code = oldParts.shift();
  1276. if (code === void 0) {
  1277. return newParts.join("");
  1278. }
  1279. isNumber = !isNumber;
  1280. }
  1281. }
  1282. const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
  1283. function iconToSVG(icon, customisations) {
  1284. const fullIcon = {
  1285. ...defaultIconProps,
  1286. ...icon
  1287. };
  1288. const fullCustomisations = {
  1289. ...defaultIconCustomisations,
  1290. ...customisations
  1291. };
  1292. const box = {
  1293. left: fullIcon.left,
  1294. top: fullIcon.top,
  1295. width: fullIcon.width,
  1296. height: fullIcon.height
  1297. };
  1298. let body = fullIcon.body;
  1299. [fullIcon, fullCustomisations].forEach((props) => {
  1300. const transformations = [];
  1301. const hFlip = props.hFlip;
  1302. const vFlip = props.vFlip;
  1303. let rotation = props.rotate;
  1304. if (hFlip) {
  1305. if (vFlip) {
  1306. rotation += 2;
  1307. } else {
  1308. transformations.push(
  1309. "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
  1310. );
  1311. transformations.push("scale(-1 1)");
  1312. box.top = box.left = 0;
  1313. }
  1314. } else if (vFlip) {
  1315. transformations.push(
  1316. "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
  1317. );
  1318. transformations.push("scale(1 -1)");
  1319. box.top = box.left = 0;
  1320. }
  1321. let tempValue;
  1322. if (rotation < 0) {
  1323. rotation -= Math.floor(rotation / 4) * 4;
  1324. }
  1325. rotation = rotation % 4;
  1326. switch (rotation) {
  1327. case 1:
  1328. tempValue = box.height / 2 + box.top;
  1329. transformations.unshift(
  1330. "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  1331. );
  1332. break;
  1333. case 2:
  1334. transformations.unshift(
  1335. "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
  1336. );
  1337. break;
  1338. case 3:
  1339. tempValue = box.width / 2 + box.left;
  1340. transformations.unshift(
  1341. "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  1342. );
  1343. break;
  1344. }
  1345. if (rotation % 2 === 1) {
  1346. if (box.left !== box.top) {
  1347. tempValue = box.left;
  1348. box.left = box.top;
  1349. box.top = tempValue;
  1350. }
  1351. if (box.width !== box.height) {
  1352. tempValue = box.width;
  1353. box.width = box.height;
  1354. box.height = tempValue;
  1355. }
  1356. }
  1357. if (transformations.length) {
  1358. body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
  1359. }
  1360. });
  1361. const customisationsWidth = fullCustomisations.width;
  1362. const customisationsHeight = fullCustomisations.height;
  1363. const boxWidth = box.width;
  1364. const boxHeight = box.height;
  1365. let width;
  1366. let height;
  1367. if (customisationsWidth === null) {
  1368. height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  1369. width = calculateSize(height, boxWidth / boxHeight);
  1370. } else {
  1371. width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
  1372. height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  1373. }
  1374. const attributes = {};
  1375. const setAttr = (prop, value) => {
  1376. if (!isUnsetKeyword(value)) {
  1377. attributes[prop] = value.toString();
  1378. }
  1379. };
  1380. setAttr("width", width);
  1381. setAttr("height", height);
  1382. attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
  1383. return {
  1384. attributes,
  1385. body
  1386. };
  1387. }
  1388. const regex = /\sid="(\S+)"/g;
  1389. const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
  1390. let counter = 0;
  1391. function replaceIDs(body, prefix = randomPrefix) {
  1392. const ids = [];
  1393. let match;
  1394. while (match = regex.exec(body)) {
  1395. ids.push(match[1]);
  1396. }
  1397. if (!ids.length) {
  1398. return body;
  1399. }
  1400. const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
  1401. ids.forEach((id) => {
  1402. const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
  1403. const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  1404. body = body.replace(
  1405. // Allowed characters before id: [#;"]
  1406. // Allowed characters after id: [)"], .[a-z]
  1407. new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
  1408. "$1" + newID + suffix + "$3"
  1409. );
  1410. });
  1411. body = body.replace(new RegExp(suffix, "g"), "");
  1412. return body;
  1413. }
  1414. const storage = /* @__PURE__ */ Object.create(null);
  1415. function setAPIModule(provider, item) {
  1416. storage[provider] = item;
  1417. }
  1418. function getAPIModule(provider) {
  1419. return storage[provider] || storage[""];
  1420. }
  1421. function createAPIConfig(source) {
  1422. let resources;
  1423. if (typeof source.resources === "string") {
  1424. resources = [source.resources];
  1425. } else {
  1426. resources = source.resources;
  1427. if (!(resources instanceof Array) || !resources.length) {
  1428. return null;
  1429. }
  1430. }
  1431. const r###lt = {
  1432. // API hosts
  1433. resources,
  1434. // Root path
  1435. path: source.path || "/",
  1436. // URL length limit
  1437. maxURL: source.maxURL || 500,
  1438. // Timeout before next host is used.
  1439. rotate: source.rotate || 750,
  1440. // Timeout before failing query.
  1441. timeout: source.timeout || 5e3,
  1442. // Randomise default API end point.
  1443. random: source.random === true,
  1444. // Start index
  1445. index: source.index || 0,
  1446. // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
  1447. dataAfterTimeout: source.dataAfterTimeout !== false
  1448. };
  1449. return r###lt;
  1450. }
  1451. const configStorage = /* @__PURE__ */ Object.create(null);
  1452. const fallBackAPISources = [
  1453. "https://api.simplesvg.com",
  1454. "https://api.unisvg.com"
  1455. ];
  1456. const fallBackAPI = [];
  1457. while (fallBackAPISources.length > 0) {
  1458. if (fallBackAPISources.length === 1) {
  1459. fallBackAPI.push(fallBackAPISources.shift());
  1460. } else {
  1461. if (Math.random() > 0.5) {
  1462. fallBackAPI.push(fallBackAPISources.shift());
  1463. } else {
  1464. fallBackAPI.push(fallBackAPISources.pop());
  1465. }
  1466. }
  1467. }
  1468. configStorage[""] = createAPIConfig({
  1469. resources: ["https://api.iconify.design"].concat(fallBackAPI)
  1470. });
  1471. function addAPIProvider(provider, customConfig) {
  1472. const config2 = createAPIConfig(customConfig);
  1473. if (config2 === null) {
  1474. return false;
  1475. }
  1476. configStorage[provider] = config2;
  1477. return true;
  1478. }
  1479. function getAPIConfig(provider) {
  1480. return configStorage[provider];
  1481. }
  1482. const detectFetch = () => {
  1483. let callback;
  1484. try {
  1485. callback = fetch;
  1486. if (typeof callback === "function") {
  1487. return callback;
  1488. }
  1489. } catch (err) {
  1490. }
  1491. };
  1492. let fetchModule = detectFetch();
  1493. function calculateMaxLength(provider, prefix) {
  1494. const config2 = getAPIConfig(provider);
  1495. if (!config2) {
  1496. return 0;
  1497. }
  1498. let r###lt;
  1499. if (!config2.maxURL) {
  1500. r###lt = 0;
  1501. } else {
  1502. let maxHostLength = 0;
  1503. config2.resources.forEach((item) => {
  1504. const host = item;
  1505. maxHostLength = Math.max(maxHostLength, host.length);
  1506. });
  1507. const url = prefix + ".json?icons=";
  1508. r###lt = config2.maxURL - maxHostLength - config2.path.length - url.length;
  1509. }
  1510. return r###lt;
  1511. }
  1512. function shouldAbort(status) {
  1513. return status === 404;
  1514. }
  1515. const prepare = (provider, prefix, icons) => {
  1516. const r###lts = [];
  1517. const maxLength = calculateMaxLength(provider, prefix);
  1518. const type = "icons";
  1519. let item = {
  1520. type,
  1521. provider,
  1522. prefix,
  1523. icons: []
  1524. };
  1525. let length = 0;
  1526. icons.forEach((name, index) => {
  1527. length += name.length + 1;
  1528. if (length >= maxLength && index > 0) {
  1529. r###lts.push(item);
  1530. item = {
  1531. type,
  1532. provider,
  1533. prefix,
  1534. icons: []
  1535. };
  1536. length = name.length;
  1537. }
  1538. item.icons.push(name);
  1539. });
  1540. r###lts.push(item);
  1541. return r###lts;
  1542. };
  1543. function getPath(provider) {
  1544. if (typeof provider === "string") {
  1545. const config2 = getAPIConfig(provider);
  1546. if (config2) {
  1547. return config2.path;
  1548. }
  1549. }
  1550. return "/";
  1551. }
  1552. const send = (host, params, callback) => {
  1553. if (!fetchModule) {
  1554. callback("abort", 424);
  1555. return;
  1556. }
  1557. let path = getPath(params.provider);
  1558. switch (params.type) {
  1559. case "icons": {
  1560. const prefix = params.prefix;
  1561. const icons = params.icons;
  1562. const iconsList = icons.join(",");
  1563. const urlParams = new URLSearchParams({
  1564. icons: iconsList
  1565. });
  1566. path += prefix + ".json?" + urlParams.toString();
  1567. break;
  1568. }
  1569. case "custom": {
  1570. const uri = params.uri;
  1571. path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
  1572. break;
  1573. }
  1574. default:
  1575. callback("abort", 400);
  1576. return;
  1577. }
  1578. let defaultError = 503;
  1579. fetchModule(host + path).then((response) => {
  1580. const status = response.status;
  1581. if (status !== 200) {
  1582. setTimeout(() => {
  1583. callback(shouldAbort(status) ? "abort" : "next", status);
  1584. });
  1585. return;
  1586. }
  1587. defaultError = 501;
  1588. return response.json();
  1589. }).then((data) => {
  1590. if (typeof data !== "object" || data === null) {
  1591. setTimeout(() => {
  1592. if (data === 404) {
  1593. callback("abort", data);
  1594. } else {
  1595. callback("next", defaultError);
  1596. }
  1597. });
  1598. return;
  1599. }
  1600. setTimeout(() => {
  1601. callback("success", data);
  1602. });
  1603. }).catch(() => {
  1604. callback("next", defaultError);
  1605. });
  1606. };
  1607. const fetchAPIModule = {
  1608. prepare,
  1609. send
  1610. };
  1611. function sortIcons(icons) {
  1612. const r###lt = {
  1613. loaded: [],
  1614. missing: [],
  1615. pending: []
  1616. };
  1617. const storage2 = /* @__PURE__ */ Object.create(null);
  1618. icons.sort((a, b) => {
  1619. if (a.provider !== b.provider) {
  1620. return a.provider.localeCompare(b.provider);
  1621. }
  1622. if (a.prefix !== b.prefix) {
  1623. return a.prefix.localeCompare(b.prefix);
  1624. }
  1625. return a.name.localeCompare(b.name);
  1626. });
  1627. let lastIcon = {
  1628. provider: "",
  1629. prefix: "",
  1630. name: ""
  1631. };
  1632. icons.forEach((icon) => {
  1633. if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
  1634. return;
  1635. }
  1636. lastIcon = icon;
  1637. const provider = icon.provider;
  1638. const prefix = icon.prefix;
  1639. const name = icon.name;
  1640. const providerStorage = storage2[provider] || (storage2[provider] = /* @__PURE__ */ Object.create(null));
  1641. const localStorage2 = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
  1642. let list;
  1643. if (name in localStorage2.icons) {
  1644. list = r###lt.loaded;
  1645. } else if (prefix === "" || localStorage2.missing.has(name)) {
  1646. list = r###lt.missing;
  1647. } else {
  1648. list = r###lt.pending;
  1649. }
  1650. const item = {
  1651. provider,
  1652. prefix,
  1653. name
  1654. };
  1655. list.push(item);
  1656. });
  1657. return r###lt;
  1658. }
  1659. function removeCallback(storages, id) {
  1660. storages.forEach((storage2) => {
  1661. const items = storage2.loaderCallbacks;
  1662. if (items) {
  1663. storage2.loaderCallbacks = items.filter((row) => row.id !== id);
  1664. }
  1665. });
  1666. }
  1667. function updateCallbacks(storage2) {
  1668. if (!storage2.pendingCallbacksFlag) {
  1669. storage2.pendingCallbacksFlag = true;
  1670. setTimeout(() => {
  1671. storage2.pendingCallbacksFlag = false;
  1672. const items = storage2.loaderCallbacks ? storage2.loaderCallbacks.slice(0) : [];
  1673. if (!items.length) {
  1674. return;
  1675. }
  1676. let hasPending = false;
  1677. const provider = storage2.provider;
  1678. const prefix = storage2.prefix;
  1679. items.forEach((item) => {
  1680. const icons = item.icons;
  1681. const oldLength = icons.pending.length;
  1682. icons.pending = icons.pending.filter((icon) => {
  1683. if (icon.prefix !== prefix) {
  1684. return true;
  1685. }
  1686. const name = icon.name;
  1687. if (storage2.icons[name]) {
  1688. icons.loaded.push({
  1689. provider,
  1690. prefix,
  1691. name
  1692. });
  1693. } else if (storage2.missing.has(name)) {
  1694. icons.missing.push({
  1695. provider,
  1696. prefix,
  1697. name
  1698. });
  1699. } else {
  1700. hasPending = true;
  1701. return true;
  1702. }
  1703. return false;
  1704. });
  1705. if (icons.pending.length !== oldLength) {
  1706. if (!hasPending) {
  1707. removeCallback([storage2], item.id);
  1708. }
  1709. item.callback(
  1710. icons.loaded.slice(0),
  1711. icons.missing.slice(0),
  1712. icons.pending.slice(0),
  1713. item.abort
  1714. );
  1715. }
  1716. });
  1717. });
  1718. }
  1719. }
  1720. let idCounter = 0;
  1721. function storeCallback(callback, icons, pendingSources) {
  1722. const id = idCounter++;
  1723. const abort = removeCallback.bind(null, pendingSources, id);
  1724. if (!icons.pending.length) {
  1725. return abort;
  1726. }
  1727. const item = {
  1728. id,
  1729. icons,
  1730. callback,
  1731. abort
  1732. };
  1733. pendingSources.forEach((storage2) => {
  1734. (storage2.loaderCallbacks || (storage2.loaderCallbacks = [])).push(item);
  1735. });
  1736. return abort;
  1737. }
  1738. function listToIcons(list, validate = true, simpleNames2 = false) {
  1739. const r###lt = [];
  1740. list.forEach((item) => {
  1741. const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames2) : item;
  1742. if (icon) {
  1743. r###lt.push(icon);
  1744. }
  1745. });
  1746. return r###lt;
  1747. }
  1748. var defaultConfig = {
  1749. resources: [],
  1750. index: 0,
  1751. timeout: 2e3,
  1752. rotate: 750,
  1753. random: false,
  1754. dataAfterTimeout: false
  1755. };
  1756. function sendQuery(config2, payload, query, done) {
  1757. const resourcesCount = config2.resources.length;
  1758. const startIndex = config2.random ? Math.floor(Math.random() * resourcesCount) : config2.index;
  1759. let resources;
  1760. if (config2.random) {
  1761. let list = config2.resources.slice(0);
  1762. resources = [];
  1763. while (list.length > 1) {
  1764. const nextIndex = Math.floor(Math.random() * list.length);
  1765. resources.push(list[nextIndex]);
  1766. list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
  1767. }
  1768. resources = resources.concat(list);
  1769. } else {
  1770. resources = config2.resources.slice(startIndex).concat(config2.resources.slice(0, startIndex));
  1771. }
  1772. const startTime = Date.now();
  1773. let status = "pending";
  1774. let queriesSent = 0;
  1775. let lastError;
  1776. let timer = null;
  1777. let queue = [];
  1778. let doneCallbacks = [];
  1779. if (typeof done === "function") {
  1780. doneCallbacks.push(done);
  1781. }
  1782. function resetTimer() {
  1783. if (timer) {
  1784. clearTimeout(timer);
  1785. timer = null;
  1786. }
  1787. }
  1788. function abort() {
  1789. if (status === "pending") {
  1790. status = "aborted";
  1791. }
  1792. resetTimer();
  1793. queue.forEach((item) => {
  1794. if (item.status === "pending") {
  1795. item.status = "aborted";
  1796. }
  1797. });
  1798. queue = [];
  1799. }
  1800. function subscribe(callback, overwrite) {
  1801. if (overwrite) {
  1802. doneCallbacks = [];
  1803. }
  1804. if (typeof callback === "function") {
  1805. doneCallbacks.push(callback);
  1806. }
  1807. }
  1808. function getQueryStatus() {
  1809. return {
  1810. startTime,
  1811. payload,
  1812. status,
  1813. queriesSent,
  1814. queriesPending: queue.length,
  1815. subscribe,
  1816. abort
  1817. };
  1818. }
  1819. function failQuery() {
  1820. status = "failed";
  1821. doneCallbacks.forEach((callback) => {
  1822. callback(void 0, lastError);
  1823. });
  1824. }
  1825. function clearQueue() {
  1826. queue.forEach((item) => {
  1827. if (item.status === "pending") {
  1828. item.status = "aborted";
  1829. }
  1830. });
  1831. queue = [];
  1832. }
  1833. function moduleResponse(item, response, data) {
  1834. const isError = response !== "success";
  1835. queue = queue.filter((queued) => queued !== item);
  1836. switch (status) {
  1837. case "pending":
  1838. break;
  1839. case "failed":
  1840. if (isError || !config2.dataAfterTimeout) {
  1841. return;
  1842. }
  1843. break;
  1844. default:
  1845. return;
  1846. }
  1847. if (response === "abort") {
  1848. lastError = data;
  1849. failQuery();
  1850. return;
  1851. }
  1852. if (isError) {
  1853. lastError = data;
  1854. if (!queue.length) {
  1855. if (!resources.length) {
  1856. failQuery();
  1857. } else {
  1858. execNext();
  1859. }
  1860. }
  1861. return;
  1862. }
  1863. resetTimer();
  1864. clearQueue();
  1865. if (!config2.random) {
  1866. const index = config2.resources.indexOf(item.resource);
  1867. if (index !== -1 && index !== config2.index) {
  1868. config2.index = index;
  1869. }
  1870. }
  1871. status = "completed";
  1872. doneCallbacks.forEach((callback) => {
  1873. callback(data);
  1874. });
  1875. }
  1876. function execNext() {
  1877. if (status !== "pending") {
  1878. return;
  1879. }
  1880. resetTimer();
  1881. const resource = resources.shift();
  1882. if (resource === void 0) {
  1883. if (queue.length) {
  1884. timer = setTimeout(() => {
  1885. resetTimer();
  1886. if (status === "pending") {
  1887. clearQueue();
  1888. failQuery();
  1889. }
  1890. }, config2.timeout);
  1891. return;
  1892. }
  1893. failQuery();
  1894. return;
  1895. }
  1896. const item = {
  1897. status: "pending",
  1898. resource,
  1899. callback: (status2, data) => {
  1900. moduleResponse(item, status2, data);
  1901. }
  1902. };
  1903. queue.push(item);
  1904. queriesSent++;
  1905. timer = setTimeout(execNext, config2.rotate);
  1906. query(resource, payload, item.callback);
  1907. }
  1908. setTimeout(execNext);
  1909. return getQueryStatus;
  1910. }
  1911. function initRedundancy(cfg) {
  1912. const config2 = {
  1913. ...defaultConfig,
  1914. ...cfg
  1915. };
  1916. let queries = [];
  1917. function cleanup() {
  1918. queries = queries.filter((item) => item().status === "pending");
  1919. }
  1920. function query(payload, queryCallback, doneCallback) {
  1921. const query2 = sendQuery(
  1922. config2,
  1923. payload,
  1924. queryCallback,
  1925. (data, error) => {
  1926. cleanup();
  1927. if (doneCallback) {
  1928. doneCallback(data, error);
  1929. }
  1930. }
  1931. );
  1932. queries.push(query2);
  1933. return query2;
  1934. }
  1935. function find(callback) {
  1936. return queries.find((value) => {
  1937. return callback(value);
  1938. }) || null;
  1939. }
  1940. const instance = {
  1941. query,
  1942. find,
  1943. setIndex: (index) => {
  1944. config2.index = index;
  1945. },
  1946. getIndex: () => config2.index,
  1947. cleanup
  1948. };
  1949. return instance;
  1950. }
  1951. function emptyCallback$1() {
  1952. }
  1953. const redundancyCache = /* @__PURE__ */ Object.create(null);
  1954. function getRedundancyCache(provider) {
  1955. if (!redundancyCache[provider]) {
  1956. const config2 = getAPIConfig(provider);
  1957. if (!config2) {
  1958. return;
  1959. }
  1960. const redundancy = initRedundancy(config2);
  1961. const cachedReundancy = {
  1962. config: config2,
  1963. redundancy
  1964. };
  1965. redundancyCache[provider] = cachedReundancy;
  1966. }
  1967. return redundancyCache[provider];
  1968. }
  1969. function sendAPIQuery(target, query, callback) {
  1970. let redundancy;
  1971. let send2;
  1972. if (typeof target === "string") {
  1973. const api = getAPIModule(target);
  1974. if (!api) {
  1975. callback(void 0, 424);
  1976. return emptyCallback$1;
  1977. }
  1978. send2 = api.send;
  1979. const cached = getRedundancyCache(target);
  1980. if (cached) {
  1981. redundancy = cached.redundancy;
  1982. }
  1983. } else {
  1984. const config2 = createAPIConfig(target);
  1985. if (config2) {
  1986. redundancy = initRedundancy(config2);
  1987. const moduleKey = target.resources ? target.resources[0] : "";
  1988. const api = getAPIModule(moduleKey);
  1989. if (api) {
  1990. send2 = api.send;
  1991. }
  1992. }
  1993. }
  1994. if (!redundancy || !send2) {
  1995. callback(void 0, 424);
  1996. return emptyCallback$1;
  1997. }
  1998. return redundancy.query(query, send2, callback)().abort;
  1999. }
  2000. const browserCacheVersion = "iconify2";
  2001. const browserCachePrefix = "iconify";
  2002. const browserCacheCountKey = browserCachePrefix + "-count";
  2003. const browserCacheVersionKey = browserCachePrefix + "-version";
  2004. const browserStorageHour = 36e5;
  2005. const browserStorageCacheExpiration = 168;
  2006. function getStoredItem(func, key) {
  2007. try {
  2008. return func.getItem(key);
  2009. } catch (err) {
  2010. }
  2011. }
  2012. function setStoredItem(func, key, value) {
  2013. try {
  2014. func.setItem(key, value);
  2015. return true;
  2016. } catch (err) {
  2017. }
  2018. }
  2019. function removeStoredItem(func, key) {
  2020. try {
  2021. func.removeItem(key);
  2022. } catch (err) {
  2023. }
  2024. }
  2025. function setBrowserStorageItemsCount(storage2, value) {
  2026. return setStoredItem(storage2, browserCacheCountKey, value.toString());
  2027. }
  2028. function getBrowserStorageItemsCount(storage2) {
  2029. return parseInt(getStoredItem(storage2, browserCacheCountKey)) || 0;
  2030. }
  2031. const browserStorageConfig = {
  2032. local: true,
  2033. session: true
  2034. };
  2035. const browserStorageEmptyItems = {
  2036. local: /* @__PURE__ */ new Set(),
  2037. session: /* @__PURE__ */ new Set()
  2038. };
  2039. let browserStorageStatus = false;
  2040. function setBrowserStorageStatus(status) {
  2041. browserStorageStatus = status;
  2042. }
  2043. let _window = typeof window === "undefined" ? {} : window;
  2044. function getBrowserStorage(key) {
  2045. const attr = key + "Storage";
  2046. try {
  2047. if (_window && _window[attr] && typeof _window[attr].length === "number") {
  2048. return _window[attr];
  2049. }
  2050. } catch (err) {
  2051. }
  2052. browserStorageConfig[key] = false;
  2053. }
  2054. function iterateBrowserStorage(key, callback) {
  2055. const func = getBrowserStorage(key);
  2056. if (!func) {
  2057. return;
  2058. }
  2059. const version = getStoredItem(func, browserCacheVersionKey);
  2060. if (version !== browserCacheVersion) {
  2061. if (version) {
  2062. const total2 = getBrowserStorageItemsCount(func);
  2063. for (let i = 0; i < total2; i++) {
  2064. removeStoredItem(func, browserCachePrefix + i.toString());
  2065. }
  2066. }
  2067. setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
  2068. setBrowserStorageItemsCount(func, 0);
  2069. return;
  2070. }
  2071. const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
  2072. const parseItem = (index) => {
  2073. const name = browserCachePrefix + index.toString();
  2074. const item = getStoredItem(func, name);
  2075. if (typeof item !== "string") {
  2076. return;
  2077. }
  2078. try {
  2079. const data = JSON.parse(item);
  2080. 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
  2081. callback(data, index)) {
  2082. return true;
  2083. }
  2084. } catch (err) {
  2085. }
  2086. removeStoredItem(func, name);
  2087. };
  2088. let total = getBrowserStorageItemsCount(func);
  2089. for (let i = total - 1; i >= 0; i--) {
  2090. if (!parseItem(i)) {
  2091. if (i === total - 1) {
  2092. total--;
  2093. setBrowserStorageItemsCount(func, total);
  2094. } else {
  2095. browserStorageEmptyItems[key].add(i);
  2096. }
  2097. }
  2098. }
  2099. }
  2100. function initBrowserStorage() {
  2101. if (browserStorageStatus) {
  2102. return;
  2103. }
  2104. setBrowserStorageStatus(true);
  2105. for (const key in browserStorageConfig) {
  2106. iterateBrowserStorage(key, (item) => {
  2107. const iconSet = item.data;
  2108. const provider = item.provider;
  2109. const prefix = iconSet.prefix;
  2110. const storage2 = getStorage(
  2111. provider,
  2112. prefix
  2113. );
  2114. if (!addIconSet(storage2, iconSet).length) {
  2115. return false;
  2116. }
  2117. const lastModified = iconSet.lastModified || -1;
  2118. storage2.lastModifiedCached = storage2.lastModifiedCached ? Math.min(storage2.lastModifiedCached, lastModified) : lastModified;
  2119. return true;
  2120. });
  2121. }
  2122. }
  2123. function updateLastModified(storage2, lastModified) {
  2124. const lastValue = storage2.lastModifiedCached;
  2125. if (
  2126. // Matches or newer
  2127. lastValue && lastValue >= lastModified
  2128. ) {
  2129. return lastValue === lastModified;
  2130. }
  2131. storage2.lastModifiedCached = lastModified;
  2132. if (lastValue) {
  2133. for (const key in browserStorageConfig) {
  2134. iterateBrowserStorage(key, (item) => {
  2135. const iconSet = item.data;
  2136. return item.provider !== storage2.provider || iconSet.prefix !== storage2.prefix || iconSet.lastModified === lastModified;
  2137. });
  2138. }
  2139. }
  2140. return true;
  2141. }
  2142. function storeInBrowserStorage(storage2, data) {
  2143. if (!browserStorageStatus) {
  2144. initBrowserStorage();
  2145. }
  2146. function store(key) {
  2147. let func;
  2148. if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
  2149. return;
  2150. }
  2151. const set = browserStorageEmptyItems[key];
  2152. let index;
  2153. if (set.size) {
  2154. set.delete(index = Array.from(set).shift());
  2155. } else {
  2156. index = getBrowserStorageItemsCount(func);
  2157. if (!setBrowserStorageItemsCount(func, index + 1)) {
  2158. return;
  2159. }
  2160. }
  2161. const item = {
  2162. cached: Math.floor(Date.now() / browserStorageHour),
  2163. provider: storage2.provider,
  2164. data
  2165. };
  2166. return setStoredItem(
  2167. func,
  2168. browserCachePrefix + index.toString(),
  2169. JSON.stringify(item)
  2170. );
  2171. }
  2172. if (data.lastModified && !updateLastModified(storage2, data.lastModified)) {
  2173. return;
  2174. }
  2175. if (!Object.keys(data.icons).length) {
  2176. return;
  2177. }
  2178. if (data.not_found) {
  2179. data = Object.assign({}, data);
  2180. delete data.not_found;
  2181. }
  2182. if (!store("local")) {
  2183. store("session");
  2184. }
  2185. }
  2186. function emptyCallback() {
  2187. }
  2188. function loadedNewIcons(storage2) {
  2189. if (!storage2.iconsLoaderFlag) {
  2190. storage2.iconsLoaderFlag = true;
  2191. setTimeout(() => {
  2192. storage2.iconsLoaderFlag = false;
  2193. updateCallbacks(storage2);
  2194. });
  2195. }
  2196. }
  2197. function loadNewIcons(storage2, icons) {
  2198. if (!storage2.iconsToLoad) {
  2199. storage2.iconsToLoad = icons;
  2200. } else {
  2201. storage2.iconsToLoad = storage2.iconsToLoad.concat(icons).sort();
  2202. }
  2203. if (!storage2.iconsQueueFlag) {
  2204. storage2.iconsQueueFlag = true;
  2205. setTimeout(() => {
  2206. storage2.iconsQueueFlag = false;
  2207. const { provider, prefix } = storage2;
  2208. const icons2 = storage2.iconsToLoad;
  2209. delete storage2.iconsToLoad;
  2210. let api;
  2211. if (!icons2 || !(api = getAPIModule(provider))) {
  2212. return;
  2213. }
  2214. const params = api.prepare(provider, prefix, icons2);
  2215. params.forEach((item) => {
  2216. sendAPIQuery(provider, item, (data) => {
  2217. if (typeof data !== "object") {
  2218. item.icons.forEach((name) => {
  2219. storage2.missing.add(name);
  2220. });
  2221. } else {
  2222. try {
  2223. const parsed = addIconSet(
  2224. storage2,
  2225. data
  2226. );
  2227. if (!parsed.length) {
  2228. return;
  2229. }
  2230. const pending = storage2.pendingIcons;
  2231. if (pending) {
  2232. parsed.forEach((name) => {
  2233. pending.delete(name);
  2234. });
  2235. }
  2236. storeInBrowserStorage(storage2, data);
  2237. } catch (err) {
  2238. console.error(err);
  2239. }
  2240. }
  2241. loadedNewIcons(storage2);
  2242. });
  2243. });
  2244. });
  2245. }
  2246. }
  2247. const loadIcons = (icons, callback) => {
  2248. const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
  2249. const sortedIcons = sortIcons(cleanedIcons);
  2250. if (!sortedIcons.pending.length) {
  2251. let callCallback = true;
  2252. if (callback) {
  2253. setTimeout(() => {
  2254. if (callCallback) {
  2255. callback(
  2256. sortedIcons.loaded,
  2257. sortedIcons.missing,
  2258. sortedIcons.pending,
  2259. emptyCallback
  2260. );
  2261. }
  2262. });
  2263. }
  2264. return () => {
  2265. callCallback = false;
  2266. };
  2267. }
  2268. const newIcons = /* @__PURE__ */ Object.create(null);
  2269. const sources = [];
  2270. let lastProvider, lastPrefix;
  2271. sortedIcons.pending.forEach((icon) => {
  2272. const { provider, prefix } = icon;
  2273. if (prefix === lastPrefix && provider === lastProvider) {
  2274. return;
  2275. }
  2276. lastProvider = provider;
  2277. lastPrefix = prefix;
  2278. sources.push(getStorage(provider, prefix));
  2279. const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
  2280. if (!providerNewIcons[prefix]) {
  2281. providerNewIcons[prefix] = [];
  2282. }
  2283. });
  2284. sortedIcons.pending.forEach((icon) => {
  2285. const { provider, prefix, name } = icon;
  2286. const storage2 = getStorage(provider, prefix);
  2287. const pendingQueue = storage2.pendingIcons || (storage2.pendingIcons = /* @__PURE__ */ new Set());
  2288. if (!pendingQueue.has(name)) {
  2289. pendingQueue.add(name);
  2290. newIcons[provider][prefix].push(name);
  2291. }
  2292. });
  2293. sources.forEach((storage2) => {
  2294. const { provider, prefix } = storage2;
  2295. if (newIcons[provider][prefix].length) {
  2296. loadNewIcons(storage2, newIcons[provider][prefix]);
  2297. }
  2298. });
  2299. return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
  2300. };
  2301. function mergeCustomisations(defaults, item) {
  2302. const r###lt = {
  2303. ...defaults
  2304. };
  2305. for (const key in item) {
  2306. const value = item[key];
  2307. const valueType = typeof value;
  2308. if (key in defaultIconSizeCustomisations) {
  2309. if (value === null || value && (valueType === "string" || valueType === "number")) {
  2310. r###lt[key] = value;
  2311. }
  2312. } else if (valueType === typeof r###lt[key]) {
  2313. r###lt[key] = key === "rotate" ? value % 4 : value;
  2314. }
  2315. }
  2316. return r###lt;
  2317. }
  2318. const separator = /[\s,]+/;
  2319. function flipFromString(custom, flip) {
  2320. flip.split(separator).forEach((str) => {
  2321. const value = str.trim();
  2322. switch (value) {
  2323. case "horizontal":
  2324. custom.hFlip = true;
  2325. break;
  2326. case "vertical":
  2327. custom.vFlip = true;
  2328. break;
  2329. }
  2330. });
  2331. }
  2332. function rotateFromString(value, defaultValue = 0) {
  2333. const units = value.replace(/^-?[0-9.]*/, "");
  2334. function cleanup(value2) {
  2335. while (value2 < 0) {
  2336. value2 += 4;
  2337. }
  2338. return value2 % 4;
  2339. }
  2340. if (units === "") {
  2341. const num = parseInt(value);
  2342. return isNaN(num) ? 0 : cleanup(num);
  2343. } else if (units !== value) {
  2344. let split = 0;
  2345. switch (units) {
  2346. case "%":
  2347. split = 25;
  2348. break;
  2349. case "deg":
  2350. split = 90;
  2351. }
  2352. if (split) {
  2353. let num = parseFloat(value.slice(0, value.length - units.length));
  2354. if (isNaN(num)) {
  2355. return 0;
  2356. }
  2357. num = num / split;
  2358. return num % 1 === 0 ? cleanup(num) : 0;
  2359. }
  2360. }
  2361. return defaultValue;
  2362. }
  2363. function iconToHTML(body, attributes) {
  2364. let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
  2365. for (const attr in attributes) {
  2366. renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
  2367. }
  2368. return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
  2369. }
  2370. function encodeSVGforURL(svg) {
  2371. return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
  2372. }
  2373. function svgToData(svg) {
  2374. return "data:image/svg+xml," + encodeSVGforURL(svg);
  2375. }
  2376. function svgToURL(svg) {
  2377. return 'url("' + svgToData(svg) + '")';
  2378. }
  2379. const defaultExtendedIconCustomisations = {
  2380. ...defaultIconCustomisations,
  2381. inline: false
  2382. };
  2383. const svgDefaults = {
  2384. "xmlns": "http://www.w3.org/2000/svg",
  2385. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  2386. "aria-hidden": true,
  2387. "role": "img"
  2388. };
  2389. const commonProps = {
  2390. display: "inline-block"
  2391. };
  2392. const monotoneProps = {
  2393. backgroundColor: "currentColor"
  2394. };
  2395. const coloredProps = {
  2396. backgroundColor: "transparent"
  2397. };
  2398. const propsToAdd = {
  2399. Image: "var(--svg)",
  2400. Repeat: "no-repeat",
  2401. Size: "100% 100%"
  2402. };
  2403. const propsToAddTo = {
  2404. webkitMask: monotoneProps,
  2405. mask: monotoneProps,
  2406. background: coloredProps
  2407. };
  2408. for (const prefix in propsToAddTo) {
  2409. const list = propsToAddTo[prefix];
  2410. for (const prop in propsToAdd) {
  2411. list[prefix + prop] = propsToAdd[prop];
  2412. }
  2413. }
  2414. const customisationAliases = {};
  2415. ["horizontal", "vertical"].forEach((prefix) => {
  2416. const attr = prefix.slice(0, 1) + "Flip";
  2417. customisationAliases[prefix + "-flip"] = attr;
  2418. customisationAliases[prefix.slice(0, 1) + "-flip"] = attr;
  2419. customisationAliases[prefix + "Flip"] = attr;
  2420. });
  2421. function fixSize(value) {
  2422. return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
  2423. }
  2424. const render = (icon, props) => {
  2425. const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
  2426. const componentProps = { ...svgDefaults };
  2427. const mode = props.mode || "svg";
  2428. const style = {};
  2429. const propsStyle = props.style;
  2430. const customStyle = typeof propsStyle === "object" && !(propsStyle instanceof Array) ? propsStyle : {};
  2431. for (let key in props) {
  2432. const value = props[key];
  2433. if (value === void 0) {
  2434. continue;
  2435. }
  2436. switch (key) {
  2437. case "icon":
  2438. case "style":
  2439. case "onLoad":
  2440. case "mode":
  2441. break;
  2442. case "inline":
  2443. case "hFlip":
  2444. case "vFlip":
  2445. customisations[key] = value === true || value === "true" || value === 1;
  2446. break;
  2447. case "flip":
  2448. if (typeof value === "string") {
  2449. flipFromString(customisations, value);
  2450. }
  2451. break;
  2452. case "color":
  2453. style.color = value;
  2454. break;
  2455. case "rotate":
  2456. if (typeof value === "string") {
  2457. customisations[key] = rotateFromString(value);
  2458. } else if (typeof value === "number") {
  2459. customisations[key] = value;
  2460. }
  2461. break;
  2462. case "ariaHidden":
  2463. case "aria-hidden":
  2464. if (value !== true && value !== "true") {
  2465. delete componentProps["aria-hidden"];
  2466. }
  2467. break;
  2468. default: {
  2469. const alias = customisationAliases[key];
  2470. if (alias) {
  2471. if (value === true || value === "true" || value === 1) {
  2472. customisations[alias] = true;
  2473. }
  2474. } else if (defaultExtendedIconCustomisations[key] === void 0) {
  2475. componentProps[key] = value;
  2476. }
  2477. }
  2478. }
  2479. }
  2480. const item = iconToSVG(icon, customisations);
  2481. const renderAttribs = item.attributes;
  2482. if (customisations.inline) {
  2483. style.verticalAlign = "-0.125em";
  2484. }
  2485. if (mode === "svg") {
  2486. componentProps.style = {
  2487. ...style,
  2488. ...customStyle
  2489. };
  2490. Object.assign(componentProps, renderAttribs);
  2491. let localCounter = 0;
  2492. let id = props.id;
  2493. if (typeof id === "string") {
  2494. id = id.replace(/-/g, "_");
  2495. }
  2496. componentProps["innerHTML"] = replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyVue");
  2497. return vue.h("svg", componentProps);
  2498. }
  2499. const { body, width, height } = icon;
  2500. const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
  2501. const html = iconToHTML(body, {
  2502. ...renderAttribs,
  2503. width: width + "",
  2504. height: height + ""
  2505. });
  2506. componentProps.style = {
  2507. ...style,
  2508. "--svg": svgToURL(html),
  2509. "width": fixSize(renderAttribs.width),
  2510. "height": fixSize(renderAttribs.height),
  2511. ...commonProps,
  2512. ...useMask ? monotoneProps : coloredProps,
  2513. ...customStyle
  2514. };
  2515. return vue.h("span", componentProps);
  2516. };
  2517. allowSimpleNames(true);
  2518. setAPIModule("", fetchAPIModule);
  2519. if (typeof document !== "undefined" && typeof window !== "undefined") {
  2520. initBrowserStorage();
  2521. const _window2 = window;
  2522. if (_window2.IconifyPreload !== void 0) {
  2523. const preload = _window2.IconifyPreload;
  2524. const err = "Invalid IconifyPreload syntax.";
  2525. if (typeof preload === "object" && preload !== null) {
  2526. (preload instanceof Array ? preload : [preload]).forEach((item) => {
  2527. try {
  2528. if (
  2529. // Check if item is an object and not null/array
  2530. typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
  2531. typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
  2532. !addCollection(item)
  2533. ) {
  2534. console.error(err);
  2535. }
  2536. } catch (e2) {
  2537. console.error(err);
  2538. }
  2539. });
  2540. }
  2541. }
  2542. if (_window2.IconifyProviders !== void 0) {
  2543. const providers = _window2.IconifyProviders;
  2544. if (typeof providers === "object" && providers !== null) {
  2545. for (let key in providers) {
  2546. const err = "IconifyProviders[" + key + "] is invalid.";
  2547. try {
  2548. const value = providers[key];
  2549. if (typeof value !== "object" || !value || value.resources === void 0) {
  2550. continue;
  2551. }
  2552. if (!addAPIProvider(key, value)) {
  2553. console.error(err);
  2554. }
  2555. } catch (e2) {
  2556. console.error(err);
  2557. }
  2558. }
  2559. }
  2560. }
  2561. }
  2562. const emptyIcon = {
  2563. ...defaultIconProps,
  2564. body: ""
  2565. };
  2566. const Icon = vue.defineComponent({
  2567. // Do not inherit other attributes: it is handled by render()
  2568. inheritAttrs: false,
  2569. // Set initial data
  2570. data() {
  2571. return {
  2572. // Mounted status
  2573. iconMounted: false,
  2574. // Callback counter to trigger re-render
  2575. counter: 0
  2576. };
  2577. },
  2578. mounted() {
  2579. this._name = "";
  2580. this._loadingIcon = null;
  2581. this.iconMounted = true;
  2582. },
  2583. unmounted() {
  2584. this.abortLoading();
  2585. },
  2586. methods: {
  2587. abortLoading() {
  2588. if (this._loadingIcon) {
  2589. this._loadingIcon.abort();
  2590. this._loadingIcon = null;
  2591. }
  2592. },
  2593. // Get data for icon to render or null
  2594. getIcon(icon, onload) {
  2595. if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
  2596. this._name = "";
  2597. this.abortLoading();
  2598. return {
  2599. data: icon
  2600. };
  2601. }
  2602. let iconName;
  2603. if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
  2604. this.abortLoading();
  2605. return null;
  2606. }
  2607. const data = getIconData(iconName);
  2608. if (!data) {
  2609. if (!this._loadingIcon || this._loadingIcon.name !== icon) {
  2610. this.abortLoading();
  2611. this._name = "";
  2612. if (data !== null) {
  2613. this._loadingIcon = {
  2614. name: icon,
  2615. abort: loadIcons([iconName], () => {
  2616. this.counter++;
  2617. })
  2618. };
  2619. }
  2620. }
  2621. return null;
  2622. }
  2623. this.abortLoading();
  2624. if (this._name !== icon) {
  2625. this._name = icon;
  2626. if (onload) {
  2627. onload(icon);
  2628. }
  2629. }
  2630. const classes = ["iconify"];
  2631. if (iconName.prefix !== "") {
  2632. classes.push("iconify--" + iconName.prefix);
  2633. }
  2634. if (iconName.provider !== "") {
  2635. classes.push("iconify--" + iconName.provider);
  2636. }
  2637. return { data, classes };
  2638. }
  2639. },
  2640. // Render icon
  2641. render() {
  2642. this.counter;
  2643. const props = this.$attrs;
  2644. const icon = this.iconMounted ? this.getIcon(props.icon, props.onLoad) : null;
  2645. if (!icon) {
  2646. return render(emptyIcon, props);
  2647. }
  2648. let newProps = props;
  2649. if (icon.classes) {
  2650. newProps = {
  2651. ...props,
  2652. class: (typeof props["class"] === "string" ? props["class"] + " " : "") + icon.classes.join(" ")
  2653. };
  2654. }
  2655. return render({
  2656. ...defaultIconProps,
  2657. ...icon.data
  2658. }, newProps);
  2659. }
  2660. });
  2661. const _hoisted_1$i = { class: "display-type" };
  2662. const _hoisted_2$f = { style: { "position": "relative" } };
  2663. const _hoisted_3$c = {
  2664. key: 0,
  2665. class: "type-list"
  2666. };
  2667. const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
  2668. __name: "BaseSelect",
  2669. props: {
  2670. displayType: {}
  2671. },
  2672. emits: ["update:displayType"],
  2673. setup(__props, { emit: __emit }) {
  2674. const props = __props;
  2675. const emit = __emit;
  2676. let state = vue.reactive({
  2677. showChangeDisplayType: false,
  2678. lastDisplayType: null
  2679. });
  2680. function changeOption(item) {
  2681. if (![CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2682. state.lastDisplayType = props.displayType;
  2683. }
  2684. emit("update:displayType", item);
  2685. state.showChangeDisplayType = false;
  2686. }
  2687. function clickDisplayType() {
  2688. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2689. return changeOption(state.lastDisplayType ?? CommentDisplayType.FloorInFloorNoCallUser);
  2690. }
  2691. state.showChangeDisplayType = !state.showChangeDisplayType;
  2692. }
  2693. const currentDisplayType = vue.computed(() => {
  2694. let judge = props.displayType;
  2695. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2696. judge = state.lastDisplayType;
  2697. }
  2698. switch (judge) {
  2699. case CommentDisplayType.FloorInFloorNoCallUser:
  2700. return "楼中楼";
  2701. case CommentDisplayType.FloorInFloor:
  2702. return "楼中楼(@)";
  2703. case CommentDisplayType.FloorInFloorNested:
  2704. return "冗余楼中楼";
  2705. case CommentDisplayType.V2exOrigin:
  2706. return "V2原版";
  2707. case CommentDisplayType.OnlyOp:
  2708. return "只看楼主";
  2709. default:
  2710. return "楼中楼";
  2711. }
  2712. });
  2713. return (_ctx, _cache) => {
  2714. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
  2715. vue.createElementVNode("div", {
  2716. class: vue.normalizeClass(["type", _ctx.displayType === vue.unref(CommentDisplayType).New && "active"]),
  2717. onClick: _cache[0] || (_cache[0] = ($event) => changeOption(vue.unref(CommentDisplayType).New))
  2718. }, "最新 ", 2),
  2719. vue.createElementVNode("div", {
  2720. class: vue.normalizeClass(["type", _ctx.displayType === vue.unref(CommentDisplayType).Like && "active"]),
  2721. onClick: _cache[1] || (_cache[1] = ($event) => changeOption(vue.unref(CommentDisplayType).Like))
  2722. }, "最热 ", 2),
  2723. vue.createElementVNode("div", _hoisted_2$f, [
  2724. vue.createElementVNode("div", {
  2725. class: vue.normalizeClass(["type", ![vue.unref(CommentDisplayType).New, vue.unref(CommentDisplayType).Like].includes(_ctx.displayType) && "active"]),
  2726. onClick: clickDisplayType
  2727. }, [
  2728. vue.createElementVNode("span", null, vue.toDisplayString(currentDisplayType.value), 1),
  2729. vue.createVNode(vue.unref(Icon), { icon: "mingcute:down-line" })
  2730. ], 2),
  2731. vue.unref(state).showChangeDisplayType ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$c, [
  2732. vue.createElementVNode("div", {
  2733. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNoCallUser && "active"]),
  2734. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNoCallUser), ["stop"]))
  2735. }, "楼中楼 ", 2),
  2736. vue.createElementVNode("div", {
  2737. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloor && "active"]),
  2738. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloor), ["stop"]))
  2739. }, "楼中楼(@) ", 2),
  2740. vue.createElementVNode("div", {
  2741. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNested && "active"]),
  2742. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNested), ["stop"]))
  2743. }, "冗余楼中楼 ", 2),
  2744. vue.createElementVNode("div", {
  2745. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).OnlyOp && "active"]),
  2746. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).OnlyOp), ["stop"]))
  2747. }, "只看楼主 ", 2),
  2748. vue.createElementVNode("div", {
  2749. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).V2exOrigin && "active"]),
  2750. onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).V2exOrigin), ["stop"]))
  2751. }, "V2原版 ", 2)
  2752. ])) : vue.createCommentVNode("", true)
  2753. ])
  2754. ]);
  2755. };
  2756. }
  2757. });
  2758. const BaseSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-e4f684be"]]);
  2759. const eventBus = {
  2760. eventMap: /* @__PURE__ */ new Map(),
  2761. on(eventType, cb) {
  2762. let cbs = this.eventMap.get(eventType);
  2763. if (cbs) {
  2764. cbs.push(cb);
  2765. } else {
  2766. cbs = [cb];
  2767. }
  2768. this.eventMap.set(eventType, cbs);
  2769. },
  2770. offOne(eventType, cb) {
  2771. let cbs = this.eventMap.get(eventType);
  2772. if (cbs) {
  2773. let rIndex = cbs.findIndex((c) => c === cb);
  2774. if (rIndex > -1) {
  2775. cbs.splice(rIndex, 1);
  2776. }
  2777. }
  2778. this.eventMap.set(eventType, cbs);
  2779. },
  2780. emit(eventType, val) {
  2781. let cbs = this.eventMap.get(eventType);
  2782. if (cbs) {
  2783. cbs.map((cb) => cb(val));
  2784. }
  2785. },
  2786. off(eventType) {
  2787. let cbs = this.eventMap.has(eventType);
  2788. if (cbs) {
  2789. this.eventMap.delete(eventType);
  2790. }
  2791. },
  2792. clear() {
  2793. this.eventMap = /* @__PURE__ */ new Map();
  2794. }
  2795. };
  2796. const CMD = {
  2797. SHOW_TOOLTIP: "SHOW_TOOLTIP",
  2798. SHOW_MSG: "SHOW_MSG",
  2799. SET_CALL: "SET_CALL",
  2800. SHOW_CALL: "SHOW_CALL",
  2801. REFRESH_ONCE: "REFRESH_ONCE",
  2802. ADD_REPLY: "ADD_REPLY",
  2803. IGNORE: "IGNORE",
  2804. MERGE: "MERGE",
  2805. REMOVE: "REMOVE",
  2806. CHANGE_COMMENT_THANK: "CHANGE_COMMENT_THANK",
  2807. CHANGE_POST_THANK: "CHANGE_POST_THANK",
  2808. ADD_TAG: "ADD_TAG",
  2809. REMOVE_TAG: "REMOVE_TAG",
  2810. RELATION_REPLY: "RELATION_REPLY",
  2811. JUMP: "JUMP",
  2812. REFRESH_POST: "REFRESH_POST",
  2813. SHOW_CONFIRM_MODAL: "SHOW_CONFIRM_MODAL",
  2814. SHOW_CONFIRM_MODAL_CONFIRM: "SHOW_CONFIRM_MODAL_CONFIRM"
  2815. };
  2816. const _sfc_main$j = {
  2817. name: "PopConfirm",
  2818. props: {
  2819. title: {
  2820. type: String,
  2821. default() {
  2822. return "";
  2823. }
  2824. },
  2825. disabled: {
  2826. type: Boolean,
  2827. default() {
  2828. return false;
  2829. }
  2830. }
  2831. },
  2832. data() {
  2833. return {
  2834. id: ""
  2835. };
  2836. },
  2837. created() {
  2838. },
  2839. methods: {
  2840. cb(id) {
  2841. if (id === this.id) {
  2842. this.$emit("confirm");
  2843. this.id = "";
  2844. }
  2845. },
  2846. showPop(e2) {
  2847. if (this.disabled)
  2848. return;
  2849. let rect = e2.target.getBoundingClientRect();
  2850. this.id = Date.now();
  2851. eventBus.emit(CMD.SHOW_CONFIRM_MODAL, { title: this.title, rect, id: this.id });
  2852. eventBus.offOne(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2853. eventBus.on(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2854. }
  2855. },
  2856. unmounted() {
  2857. eventBus.offOne(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2858. }
  2859. };
  2860. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  2861. return vue.openBlock(), vue.createElementBlock("span", {
  2862. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.showPop && $options.showPop(...args), ["stop"]))
  2863. }, [
  2864. vue.renderSlot(_ctx.$slots, "default")
  2865. ]);
  2866. }
  2867. const PopConfirm = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$a]]);
  2868. const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
  2869. __name: "BaseLoading",
  2870. props: {
  2871. size: { default: "normal" }
  2872. },
  2873. setup(__props) {
  2874. return (_ctx, _cache) => {
  2875. return vue.openBlock(), vue.createElementBlock("div", {
  2876. class: vue.normalizeClass(["loading", [_ctx.size]])
  2877. }, null, 2);
  2878. };
  2879. }
  2880. });
  2881. const BaseLoading = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-2697baa2"]]);
  2882. const _hoisted_1$h = {
  2883. key: 1,
  2884. class: "key-notice"
  2885. };
  2886. const _hoisted_2$e = { class: "key" };
  2887. const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
  2888. __name: "BaseButton",
  2889. props: {
  2890. keyboard: {},
  2891. active: { type: Boolean },
  2892. disabled: { type: Boolean },
  2893. loading: { type: Boolean },
  2894. size: { default: "normal" },
  2895. type: { default: "primary" }
  2896. },
  2897. emits: ["click"],
  2898. setup(__props) {
  2899. return (_ctx, _cache) => {
  2900. return vue.openBlock(), vue.createBlock(Tooltip, {
  2901. disabled: !_ctx.keyboard,
  2902. title: `快捷键: ${_ctx.keyboard}`
  2903. }, {
  2904. default: vue.withCtx(() => [
  2905. vue.createElementVNode("div", vue.mergeProps({ class: "base-button" }, _ctx.$attrs, {
  2906. onClick: _cache[0] || (_cache[0] = (e2) => !_ctx.disabled && !_ctx.loading && _ctx.$emit("click", e2)),
  2907. class: [
  2908. _ctx.active && "active",
  2909. _ctx.size,
  2910. _ctx.type,
  2911. (_ctx.disabled || _ctx.loading) && "disabled",
  2912. !_ctx.disabled && "hvr-grow"
  2913. ]
  2914. }), [
  2915. vue.createElementVNode("span", {
  2916. style: vue.normalizeStyle({ opacity: _ctx.loading ? 0 : 1 })
  2917. }, [
  2918. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  2919. ], 4),
  2920. _ctx.loading ? (vue.openBlock(), vue.createBlock(BaseLoading, {
  2921. key: 0,
  2922. size: "small"
  2923. })) : vue.createCommentVNode("", true),
  2924. _ctx.keyboard ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
  2925. vue.createElementVNode("span", _hoisted_2$e, vue.toDisplayString(_ctx.keyboard), 1)
  2926. ])) : vue.createCommentVNode("", true)
  2927. ], 16)
  2928. ]),
  2929. _: 3
  2930. }, 8, ["disabled", "title"]);
  2931. };
  2932. }
  2933. });
  2934. const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-5a7d79ba"]]);
  2935. const _sfc_main$g = {
  2936. name: "Setting",
  2937. components: {
  2938. BaseButton,
  2939. PopConfirm,
  2940. Icon,
  2941. BaseSelect,
  2942. BaseSwitch,
  2943. Tooltip
  2944. },
  2945. inject: ["isNight"],
  2946. props: {
  2947. show: {
  2948. type: Boolean,
  2949. default() {
  2950. return false;
  2951. }
  2952. }
  2953. },
  2954. data() {
  2955. return {
  2956. tabIndex: 0
  2957. };
  2958. },
  2959. methods: {
  2960. confirm() {
  2961. this.close();
  2962. this.$emit("confirm");
  2963. },
  2964. close() {
  2965. this.$emit("update:show", false);
  2966. }
  2967. }
  2968. };
  2969. const _withScopeId$b = (n2) => (vue.pushScopeId("data-v-386b43d0"), n2 = n2(), vue.popScopeId(), n2);
  2970. const _hoisted_1$g = {
  2971. key: 0,
  2972. class: "setting-modal modal"
  2973. };
  2974. const _hoisted_2$d = { class: "modal-root" };
  2975. const _hoisted_3$b = { class: "modal-header" };
  2976. const _hoisted_4$b = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 使用需知 ", -1));
  2977. const _hoisted_5$9 = { class: "body" };
  2978. const _hoisted_6$9 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "modal-content" }, [
  2979. /* @__PURE__ */ vue.createElementVNode("div", null, "开启此功能会带来以下影响"),
  2980. /* @__PURE__ */ vue.createElementVNode("div", null, "缺点"),
  2981. /* @__PURE__ */ vue.createElementVNode("div", { style: { "color": "red" } }, [
  2982. /* @__PURE__ */ vue.createElementVNode("div", null, "1、你的IP可能会被封禁"),
  2983. /* @__PURE__ */ vue.createElementVNode("div", null, "2、消耗更多流量,给服务器带来更大的负担"),
  2984. /* @__PURE__ */ vue.createElementVNode("div", null, "3、你的V站浏览进度条会变快")
  2985. ]),
  2986. /* @__PURE__ */ vue.createElementVNode("div", null, "优点"),
  2987. /* @__PURE__ */ vue.createElementVNode("div", null, "1、卡片模式,无需打开主题即可查看内容"),
  2988. /* @__PURE__ */ vue.createElementVNode("div", null, "2、打开主题时提前预览正文内容,无需等待加载"),
  2989. /* @__PURE__ */ vue.createElementVNode("div", null, "原理"),
  2990. /* @__PURE__ */ vue.createElementVNode("div", null, "1、解析列表所有主题ID,批量调用show.json接口,获取对应主题的正文"),
  2991. /* @__PURE__ */ vue.createElementVNode("div", null, "2、请求的主题数据会缓存到本地,不会重复请求,超过3天的数据会删除"),
  2992. /* @__PURE__ */ vue.createElementVNode("div", null, "3、前面4条会并发请求,4条以后的一秒请求一条")
  2993. ], -1));
  2994. const _hoisted_7$8 = { class: "btns" };
  2995. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  2996. const _component_Icon = vue.resolveComponent("Icon");
  2997. const _component_BaseButton = vue.resolveComponent("BaseButton");
  2998. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  2999. default: vue.withCtx(() => [
  3000. $props.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
  3001. vue.createElementVNode("div", {
  3002. class: "mask",
  3003. onClick: _cache[0] || (_cache[0] = (...args) => $options.close && $options.close(...args))
  3004. }),
  3005. vue.createElementVNode("div", _hoisted_2$d, [
  3006. vue.createElementVNode("div", _hoisted_3$b, [
  3007. _hoisted_4$b,
  3008. vue.createVNode(_component_Icon, {
  3009. icon: "ic:round-close",
  3010. onClick: $options.close
  3011. }, null, 8, ["onClick"])
  3012. ]),
  3013. vue.createElementVNode("div", _hoisted_5$9, [
  3014. _hoisted_6$9,
  3015. vue.createElementVNode("div", _hoisted_7$8, [
  3016. vue.createVNode(_component_BaseButton, {
  3017. type: "link",
  3018. onClick: $options.close
  3019. }, {
  3020. default: vue.withCtx(() => [
  3021. vue.createTextVNode("不同意")
  3022. ]),
  3023. _: 1
  3024. }, 8, ["onClick"]),
  3025. vue.createVNode(_component_BaseButton, { onClick: $options.confirm }, {
  3026. default: vue.withCtx(() => [
  3027. vue.createTextVNode("同意")
  3028. ]),
  3029. _: 1
  3030. }, 8, ["onClick"])
  3031. ])
  3032. ])
  3033. ])
  3034. ])) : vue.createCommentVNode("", true)
  3035. ]),
  3036. _: 1
  3037. });
  3038. }
  3039. const NoticeModal = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$9], ["__scopeId", "data-v-386b43d0"]]);
  3040. const _sfc_main$f = {
  3041. name: "Setting",
  3042. components: {
  3043. NoticeModal,
  3044. PopConfirm,
  3045. Icon,
  3046. BaseSelect,
  3047. BaseSwitch,
  3048. Tooltip
  3049. },
  3050. inject: ["isNight"],
  3051. props: {
  3052. modelValue: {
  3053. type: Object,
  3054. default() {
  3055. return {};
  3056. }
  3057. },
  3058. show: {
  3059. type: Boolean,
  3060. default() {
  3061. return false;
  3062. }
  3063. }
  3064. },
  3065. data() {
  3066. return {
  3067. tabIndex: 0,
  3068. config: functions.clone(this.modelValue),
  3069. showNotice: false
  3070. };
  3071. },
  3072. computed: {
  3073. DefaultVal() {
  3074. return DefaultVal;
  3075. },
  3076. CommentDisplayType() {
  3077. return CommentDisplayType;
  3078. },
  3079. isNew() {
  3080. return this.config.version < DefaultVal.currentVersion && window.isDeadline;
  3081. }
  3082. },
  3083. watch: {
  3084. config: {
  3085. handler(n2) {
  3086. n2.topReplyLoveMinCount = Math.trunc(n2.topReplyLoveMinCount);
  3087. if (n2.topReplyLoveMinCount < 0) {
  3088. n2.topReplyLoveMinCount = 1;
  3089. }
  3090. this.$emit("update:modelValue", n2);
  3091. },
  3092. deep: true
  3093. },
  3094. "config.loopCheckNotice"(n2) {
  3095. if (n2) {
  3096. this.config.loopCheckNoticeInterval = 5;
  3097. this.config.whenNewNoticeGlimmer = false;
  3098. } else {
  3099. this.config.loopCheckNoticeInterval = 0;
  3100. this.config.whenNewNoticeGlimmer = false;
  3101. this.config.ddWebhook = "";
  3102. }
  3103. },
  3104. show(n2) {
  3105. if (n2) {
  3106. if (this.config.version < DefaultVal.currentVersion) {
  3107. $(".v2next-new").remove();
  3108. }
  3109. document.body.style.overflow = "hidden";
  3110. } else {
  3111. document.body.style.overflow = "unset";
  3112. }
  3113. }
  3114. },
  3115. methods: {
  3116. goPost() {
  3117. fetch(DefaultVal.hotUrl + "new.txt").then(async (r2) => {
  3118. let r22 = await r2.text();
  3119. if (r22) {
  3120. functions.openNewTab(r22, true);
  3121. } else {
  3122. functions.openNewTab(DefaultVal.git, true);
  3123. }
  3124. }).catch(() => functions.openNewTab(DefaultVal.git, true));
  3125. },
  3126. close() {
  3127. if (window.isDeadline) {
  3128. this.config.version = DefaultVal.currentVersion;
  3129. }
  3130. this.$emit("update:show", false);
  3131. }
  3132. }
  3133. };
  3134. const _withScopeId$a = (n2) => (vue.pushScopeId("data-v-9fea31eb"), n2 = n2(), vue.popScopeId(), n2);
  3135. const _hoisted_1$f = {
  3136. key: 0,
  3137. class: "setting-modal modal"
  3138. };
  3139. const _hoisted_2$c = { class: "modal-root" };
  3140. const _hoisted_3$a = { class: "modal-header" };
  3141. const _hoisted_4$a = { class: "title" };
  3142. const _hoisted_5$8 = { style: { "font-size": "20px", "text-decoration": "underline" } };
  3143. const _hoisted_6$8 = ["href"];
  3144. const _hoisted_7$7 = {
  3145. key: 0,
  3146. class: "log"
  3147. };
  3148. const _hoisted_8$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "new" }, null, -1));
  3149. const _hoisted_9$7 = { class: "body" };
  3150. const _hoisted_10$7 = { class: "left" };
  3151. const _hoisted_11$7 = { class: "tabs" };
  3152. const _hoisted_12$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "列表设置", -1));
  3153. const _hoisted_13$7 = [
  3154. _hoisted_12$7
  3155. ];
  3156. const _hoisted_14$6 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "主题设置", -1));
  3157. const _hoisted_15$5 = [
  3158. _hoisted_14$6
  3159. ];
  3160. const _hoisted_16$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "其他设置", -1));
  3161. const _hoisted_17$5 = [
  3162. _hoisted_16$5
  3163. ];
  3164. const _hoisted_18$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "关于脚本", -1));
  3165. const _hoisted_19$4 = [
  3166. _hoisted_18$5
  3167. ];
  3168. const _hoisted_20$3 = { class: "icons" };
  3169. const _hoisted_21$3 = ["href"];
  3170. const _hoisted_22$3 = ["href"];
  3171. const _hoisted_23$3 = { class: "modal-content" };
  3172. const _hoisted_24$2 = { class: "scroll" };
  3173. const _hoisted_25$1 = { key: 0 };
  3174. const _hoisted_26$1 = { class: "row" };
  3175. const _hoisted_27$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "列表展示方式", -1));
  3176. const _hoisted_28$1 = { class: "wrapper" };
  3177. const _hoisted_29$1 = { class: "radio-group2" };
  3178. const _hoisted_30$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3179. const _hoisted_31$1 = { class: "row" };
  3180. const _hoisted_32$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "主题弹框显示", -1));
  3181. const _hoisted_33$1 = { class: "wrapper" };
  3182. const _hoisted_34$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3183. /* @__PURE__ */ vue.createTextVNode(" 开启此选项后,主题会"),
  3184. /* @__PURE__ */ vue.createElementVNode("span", { class: "danger" }, "始终"),
  3185. /* @__PURE__ */ vue.createTextVNode("以弹框的方式显示。优先级大于“新标签页打开链接” ")
  3186. ], -1));
  3187. const _hoisted_35$1 = { class: "row" };
  3188. const _hoisted_36$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "新标签页打开链接", -1));
  3189. const _hoisted_37$1 = { class: "wrapper" };
  3190. const _hoisted_38$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 网页上所有链接通过新标签页打开 ", -1));
  3191. const _hoisted_39$1 = { class: "row" };
  3192. const _hoisted_40$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "打开新标签页时立即切换过去", -1));
  3193. const _hoisted_41$1 = { class: "wrapper" };
  3194. const _hoisted_42$1 = { key: 1 };
  3195. const _hoisted_43$1 = { class: "row" };
  3196. const _hoisted_44$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "回复类型", -1));
  3197. const _hoisted_45$1 = { class: "wrapper" };
  3198. const _hoisted_46$1 = { class: "row" };
  3199. const _hoisted_47$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "详情页中显示“回复类型”", -1));
  3200. const _hoisted_48 = { class: "wrapper" };
  3201. const _hoisted_49 = { class: "row" };
  3202. const _hoisted_50 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "替换Imgur源", -1));
  3203. const _hoisted_51 = { class: "wrapper" };
  3204. const _hoisted_52 = { class: "row" };
  3205. const _hoisted_53 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "单独打开主题时默认显示楼中楼", -1));
  3206. const _hoisted_54 = { class: "wrapper" };
  3207. const _hoisted_55 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 单独打开这种地址 https://v2ex.com/t/xxxx 时,是否默认显示楼中楼 ", -1));
  3208. const _hoisted_56 = { class: "row" };
  3209. const _hoisted_57 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "点击左右两侧透明处关闭主题详情弹框", -1));
  3210. const _hoisted_58 = { class: "wrapper" };
  3211. const _hoisted_59 = { class: "row" };
  3212. const _hoisted_60 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "正文超长自动折叠", -1));
  3213. const _hoisted_61 = { class: "wrapper" };
  3214. const _hoisted_62 = { class: "row" };
  3215. const _hoisted_63 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "主题宽度", -1));
  3216. const _hoisted_64 = { class: "wrapper" };
  3217. const _hoisted_65 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3218. /* @__PURE__ */ vue.createTextVNode(" 未设定此值时,则默认宽度为77rem。接受合法的width值: "),
  3219. /* @__PURE__ */ vue.createElementVNode("a", {
  3220. href: "https://vue3js.cn/interview/css/em_px_rem_vh_vw.html#%E4%BA%8C%E3%80%81%E5%8D%95%E4%BD%8D",
  3221. target: "_blank"
  3222. }, "rem、px、vw、vh(点此查看)"),
  3223. /* @__PURE__ */ vue.createTextVNode("。 vw代表屏幕百分比,如想要屏幕的66%,请填写66vw ")
  3224. ], -1));
  3225. const _hoisted_66 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 提示:此项设置以后,单独打开详情页时会出现主题突然变宽(窄)的问题,暂时无解 ", -1));
  3226. const _hoisted_67 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3227. const _hoisted_68 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3228. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "高赞回复")
  3229. ], -1));
  3230. const _hoisted_69 = { class: "row" };
  3231. const _hoisted_70 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "显示高赞回复", -1));
  3232. const _hoisted_71 = { class: "wrapper" };
  3233. const _hoisted_72 = { class: "row" };
  3234. const _hoisted_73 = { class: "item-title" };
  3235. const _hoisted_74 = { class: "wrapper" };
  3236. const _hoisted_75 = { class: "row" };
  3237. const _hoisted_76 = { class: "item-title" };
  3238. const _hoisted_77 = { class: "wrapper" };
  3239. const _hoisted_78 = { key: 2 };
  3240. const _hoisted_79 = { class: "row" };
  3241. const _hoisted_80 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "用户打标签(跨##,数据保存在自己的记事本):", -1));
  3242. const _hoisted_81 = { class: "wrapper" };
  3243. const _hoisted_82 = { class: "row" };
  3244. const _hoisted_83 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "划词显示Base64解码框", -1));
  3245. const _hoisted_84 = { class: "wrapper" };
  3246. const _hoisted_85 = { class: "row" };
  3247. const _hoisted_86 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自动签到", -1));
  3248. const _hoisted_87 = { class: "wrapper" };
  3249. const _hoisted_88 = { class: "row" };
  3250. const _hoisted_89 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自定义背景", -1));
  3251. const _hoisted_90 = { class: "wrapper" };
  3252. const _hoisted_91 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3253. /* @__PURE__ */ vue.createTextVNode(" 未设定此值时,则脚本就什么都不做,V站大部分页面背景颜色默认为 #e2e2e2,少部分页面有特定背景。接受一个合法的css color值:例如"),
  3254. /* @__PURE__ */ vue.createElementVNode("a", {
  3255. href: "https://developer.mozilla.org/zh-CN/docs/Web/CSS/color_value",
  3256. target: "_blank"
  3257. }, "red、#ffffff、rgb(222,222,22)(点此查看)"),
  3258. /* @__PURE__ */ vue.createTextVNode("等等。 ")
  3259. ], -1));
  3260. const _hoisted_92 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3261. const _hoisted_93 = { class: "row" };
  3262. const _hoisted_94 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "收藏时提醒添加到书签", -1));
  3263. const _hoisted_95 = { class: "wrapper" };
  3264. const _hoisted_96 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " V站帐号一旦被封禁,则无法登录,无法查看账号收藏了 ", -1));
  3265. const _hoisted_97 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3266. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "消息通知")
  3267. ], -1));
  3268. const _hoisted_98 = { class: "row" };
  3269. const _hoisted_99 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "接管未读提醒页面", -1));
  3270. const _hoisted_100 = { class: "wrapper" };
  3271. const _hoisted_101 = { class: "row" };
  3272. const _hoisted_102 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "定时查询未读提醒", -1));
  3273. const _hoisted_103 = { class: "wrapper" };
  3274. const _hoisted_104 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 开启此功能会带来以下影响: 1、你的IP可能会被封禁 2、消耗更多流量,给服务器带来更大的负担 3、你的V站浏览进度条会变快 ", -1));
  3275. const _hoisted_105 = {
  3276. key: 0,
  3277. class: "sub-content"
  3278. };
  3279. const _hoisted_106 = { class: "row" };
  3280. const _hoisted_107 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "查询间隔", -1));
  3281. const _hoisted_108 = { class: "wrapper" };
  3282. const _hoisted_109 = ["value"];
  3283. const _hoisted_110 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 设置值太小,会导致频繁请求,你的IP可能会被封禁,建议设置为5,即每次5分钟查询一次 ", -1));
  3284. const _hoisted_111 = { class: "row" };
  3285. const _hoisted_112 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "当有新未读提醒时,网页标题闪烁", -1));
  3286. const _hoisted_113 = { class: "wrapper" };
  3287. const _hoisted_114 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3288. /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "钉钉Webhook地址")
  3289. ], -1));
  3290. const _hoisted_115 = { class: "desc" };
  3291. const _hoisted_116 = ["value"];
  3292. const _hoisted_117 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3293. const _hoisted_118 = { key: 3 };
  3294. const _hoisted_119 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("h1", null, "V2EX Next", -1));
  3295. const _hoisted_120 = { class: "project-desc" };
  3296. const _hoisted_121 = { style: { "line-height": "2" } };
  3297. const _hoisted_122 = ["href"];
  3298. const _hoisted_123 = ["href"];
  3299. const _hoisted_124 = ["href"];
  3300. const _hoisted_125 = ["href"];
  3301. const _hoisted_126 = ["href"];
  3302. const _hoisted_127 = ["href"];
  3303. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  3304. const _component_Icon = vue.resolveComponent("Icon");
  3305. const _component_BaseSwitch = vue.resolveComponent("BaseSwitch");
  3306. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  3307. const _component_NoticeModal = vue.resolveComponent("NoticeModal");
  3308. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3309. default: vue.withCtx(() => [
  3310. $props.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
  3311. vue.createElementVNode("div", {
  3312. class: "mask",
  3313. onClick: _cache[0] || (_cache[0] = (...args) => $options.close && $options.close(...args))
  3314. }),
  3315. vue.createElementVNode("div", _hoisted_2$c, [
  3316. vue.createElementVNode("div", _hoisted_3$a, [
  3317. vue.createElementVNode("div", _hoisted_4$a, [
  3318. vue.createTextVNode(" 脚本设置 "),
  3319. vue.createElementVNode("div", _hoisted_5$8, [
  3320. vue.createElementVNode("a", {
  3321. href: $options.DefaultVal.mobileScript,
  3322. target: "_blank"
  3323. }, "(手机App已发布,支持楼中楼!)", 8, _hoisted_6$8)
  3324. ])
  3325. ]),
  3326. vue.createVNode(_component_Icon, {
  3327. icon: "ic:round-close",
  3328. onClick: $options.close
  3329. }, null, 8, ["onClick"])
  3330. ]),
  3331. $options.isNew ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$7, [
  3332. vue.createElementVNode("a", {
  3333. onClick: _cache[1] || (_cache[1] = (...args) => $options.goPost && $options.goPost(...args))
  3334. }, "New:手机App现已发布,支持楼中楼!PC脚本新增历史最热数据、imgur换源功能!点击查看详细介绍"),
  3335. _hoisted_8$7
  3336. ])) : vue.createCommentVNode("", true),
  3337. vue.createElementVNode("div", _hoisted_9$7, [
  3338. vue.createElementVNode("div", _hoisted_10$7, [
  3339. vue.createElementVNode("div", _hoisted_11$7, [
  3340. vue.createElementVNode("div", {
  3341. class: vue.normalizeClass(["tab", $data.tabIndex === 0 && "active"]),
  3342. onClick: _cache[2] || (_cache[2] = ($event) => $data.tabIndex = 0)
  3343. }, _hoisted_13$7, 2),
  3344. vue.createElementVNode("div", {
  3345. class: vue.normalizeClass(["tab", $data.tabIndex === 1 && "active"]),
  3346. onClick: _cache[3] || (_cache[3] = ($event) => $data.tabIndex = 1)
  3347. }, _hoisted_15$5, 2),
  3348. vue.createElementVNode("div", {
  3349. class: vue.normalizeClass(["tab", $data.tabIndex === 2 && "active"]),
  3350. onClick: _cache[4] || (_cache[4] = ($event) => $data.tabIndex = 2)
  3351. }, _hoisted_17$5, 2),
  3352. vue.createElementVNode("div", {
  3353. class: vue.normalizeClass(["tab", $data.tabIndex === 3 && "active"]),
  3354. onClick: _cache[5] || (_cache[5] = ($event) => $data.tabIndex = 3)
  3355. }, _hoisted_19$4, 2)
  3356. ]),
  3357. vue.createElementVNode("div", _hoisted_20$3, [
  3358. vue.createElementVNode("a", {
  3359. href: $options.DefaultVal.git,
  3360. target: "_blank"
  3361. }, [
  3362. vue.createVNode(_component_Icon, { icon: "mdi:github" })
  3363. ], 8, _hoisted_21$3),
  3364. vue.createElementVNode("a", {
  3365. href: $options.DefaultVal.homeUrl,
  3366. target: "_blank"
  3367. }, [
  3368. vue.createVNode(_component_Icon, { icon: "iconamoon:home-light" })
  3369. ], 8, _hoisted_22$3)
  3370. ])
  3371. ]),
  3372. vue.createElementVNode("div", _hoisted_23$3, [
  3373. vue.createElementVNode("div", _hoisted_24$2, [
  3374. $data.tabIndex === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_25$1, [
  3375. vue.createElementVNode("div", _hoisted_26$1, [
  3376. _hoisted_27$1,
  3377. vue.createElementVNode("div", _hoisted_28$1, [
  3378. vue.createElementVNode("div", _hoisted_29$1, [
  3379. vue.createElementVNode("div", {
  3380. class: vue.normalizeClass(["radio", $data.config.viewType === "simple" ? "active" : ""]),
  3381. onClick: _cache[6] || (_cache[6] = ($event) => $data.config.viewType = "simple")
  3382. }, "简洁 ", 2),
  3383. vue.createElementVNode("div", {
  3384. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  3385. onClick: _cache[7] || (_cache[7] = ($event) => $data.config.viewType = "table")
  3386. }, "表格 ", 2),
  3387. vue.createElementVNode("div", {
  3388. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  3389. onClick: _cache[8] || (_cache[8] = ($event) => $data.showNotice = true)
  3390. }, "卡片 ", 2)
  3391. ])
  3392. ])
  3393. ]),
  3394. _hoisted_30$1,
  3395. vue.createElementVNode("div", _hoisted_31$1, [
  3396. _hoisted_32$1,
  3397. vue.createElementVNode("div", _hoisted_33$1, [
  3398. vue.createVNode(_component_BaseSwitch, {
  3399. modelValue: $data.config.clickPostItemOpenDetail,
  3400. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.config.clickPostItemOpenDetail = $event)
  3401. }, null, 8, ["modelValue"])
  3402. ])
  3403. ]),
  3404. _hoisted_34$1,
  3405. vue.createElementVNode("div", _hoisted_35$1, [
  3406. _hoisted_36$1,
  3407. vue.createElementVNode("div", _hoisted_37$1, [
  3408. vue.createVNode(_component_BaseSwitch, {
  3409. modelValue: $data.config.newTabOpen,
  3410. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.config.newTabOpen = $event)
  3411. }, null, 8, ["modelValue"])
  3412. ])
  3413. ]),
  3414. _hoisted_38$1,
  3415. vue.createElementVNode("div", _hoisted_39$1, [
  3416. _hoisted_40$1,
  3417. vue.createElementVNode("div", _hoisted_41$1, [
  3418. vue.createVNode(_component_BaseSwitch, {
  3419. modelValue: $data.config.newTabOpenActive,
  3420. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.config.newTabOpenActive = $event)
  3421. }, null, 8, ["modelValue"])
  3422. ])
  3423. ])
  3424. ])) : vue.createCommentVNode("", true),
  3425. $data.tabIndex === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42$1, [
  3426. vue.createElementVNode("div", _hoisted_43$1, [
  3427. _hoisted_44$1,
  3428. vue.createElementVNode("div", _hoisted_45$1, [
  3429. vue.createVNode(_component_BaseSelect, {
  3430. "display-type": $data.config.commentDisplayType,
  3431. "onUpdate:displayType": _cache[12] || (_cache[12] = ($event) => $data.config.commentDisplayType = $event)
  3432. }, null, 8, ["display-type"])
  3433. ])
  3434. ]),
  3435. vue.createElementVNode("div", _hoisted_46$1, [
  3436. _hoisted_47$1,
  3437. vue.createElementVNode("div", _hoisted_48, [
  3438. vue.createVNode(_component_BaseSwitch, {
  3439. modelValue: $data.config.showToolbar,
  3440. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.config.showToolbar = $event)
  3441. }, null, 8, ["modelValue"])
  3442. ])
  3443. ]),
  3444. vue.createElementVNode("div", _hoisted_49, [
  3445. _hoisted_50,
  3446. vue.createElementVNode("div", _hoisted_51, [
  3447. vue.createVNode(_component_BaseSwitch, {
  3448. modelValue: $data.config.replaceImgur,
  3449. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.config.replaceImgur = $event)
  3450. }, null, 8, ["modelValue"])
  3451. ])
  3452. ]),
  3453. vue.createElementVNode("div", _hoisted_52, [
  3454. _hoisted_53,
  3455. vue.createElementVNode("div", _hoisted_54, [
  3456. vue.createVNode(_component_BaseSwitch, {
  3457. modelValue: $data.config.autoOpenDetail,
  3458. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.config.autoOpenDetail = $event)
  3459. }, null, 8, ["modelValue"])
  3460. ])
  3461. ]),
  3462. _hoisted_55,
  3463. vue.createElementVNode("div", _hoisted_56, [
  3464. _hoisted_57,
  3465. vue.createElementVNode("div", _hoisted_58, [
  3466. vue.createVNode(_component_BaseSwitch, {
  3467. modelValue: $data.config.closePostDetailBySpace,
  3468. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.config.closePostDetailBySpace = $event)
  3469. }, null, 8, ["modelValue"])
  3470. ])
  3471. ]),
  3472. vue.createElementVNode("div", _hoisted_59, [
  3473. _hoisted_60,
  3474. vue.createElementVNode("div", _hoisted_61, [
  3475. vue.createVNode(_component_BaseSwitch, {
  3476. modelValue: $data.config.contentAutoCollapse,
  3477. "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.config.contentAutoCollapse = $event)
  3478. }, null, 8, ["modelValue"])
  3479. ])
  3480. ]),
  3481. vue.createElementVNode("div", _hoisted_62, [
  3482. _hoisted_63,
  3483. vue.createElementVNode("div", _hoisted_64, [
  3484. vue.withDirectives(vue.createElementVNode("input", {
  3485. type: "text",
  3486. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.config.postWidth = $event)
  3487. }, null, 512), [
  3488. [vue.vModelText, $data.config.postWidth]
  3489. ])
  3490. ])
  3491. ]),
  3492. _hoisted_65,
  3493. _hoisted_66,
  3494. _hoisted_67,
  3495. _hoisted_68,
  3496. vue.createElementVNode("div", _hoisted_69, [
  3497. _hoisted_70,
  3498. vue.createElementVNode("div", _hoisted_71, [
  3499. vue.createVNode(_component_BaseSwitch, {
  3500. modelValue: $data.config.showTopReply,
  3501. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.config.showTopReply = $event)
  3502. }, null, 8, ["modelValue"])
  3503. ])
  3504. ]),
  3505. vue.createElementVNode("div", _hoisted_72, [
  3506. vue.createElementVNode("label", _hoisted_73, "最多显示" + vue.toDisplayString($data.config.topReplyCount) + "个高赞回复", 1),
  3507. vue.createElementVNode("div", _hoisted_74, [
  3508. vue.withDirectives(vue.createElementVNode("input", {
  3509. type: "number",
  3510. min: "1",
  3511. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.config.topReplyCount = $event)
  3512. }, null, 512), [
  3513. [vue.vModelText, $data.config.topReplyCount]
  3514. ])
  3515. ])
  3516. ]),
  3517. vue.createElementVNode("div", _hoisted_75, [
  3518. vue.createElementVNode("label", _hoisted_76, "最少需要" + vue.toDisplayString($data.config.topReplyLoveMinCount) + "个赞才能被判定为高赞", 1),
  3519. vue.createElementVNode("div", _hoisted_77, [
  3520. vue.withDirectives(vue.createElementVNode("input", {
  3521. type: "number",
  3522. min: "1",
  3523. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.config.topReplyLoveMinCount = $event)
  3524. }, null, 512), [
  3525. [vue.vModelText, $data.config.topReplyLoveMinCount]
  3526. ])
  3527. ])
  3528. ])
  3529. ])) : vue.createCommentVNode("", true),
  3530. $data.tabIndex === 2 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_78, [
  3531. vue.createElementVNode("div", _hoisted_79, [
  3532. _hoisted_80,
  3533. vue.createElementVNode("div", _hoisted_81, [
  3534. vue.createVNode(_component_BaseSwitch, {
  3535. modelValue: $data.config.openTag,
  3536. "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => $data.config.openTag = $event)
  3537. }, null, 8, ["modelValue"])
  3538. ])
  3539. ]),
  3540. vue.createElementVNode("div", _hoisted_82, [
  3541. _hoisted_83,
  3542. vue.createElementVNode("div", _hoisted_84, [
  3543. vue.createVNode(_component_BaseSwitch, {
  3544. modelValue: $data.config.base64,
  3545. "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.config.base64 = $event)
  3546. }, null, 8, ["modelValue"])
  3547. ])
  3548. ]),
  3549. vue.createElementVNode("div", _hoisted_85, [
  3550. _hoisted_86,
  3551. vue.createElementVNode("div", _hoisted_87, [
  3552. vue.createVNode(_component_BaseSwitch, {
  3553. modelValue: $data.config.autoSignin,
  3554. "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => $data.config.autoSignin = $event)
  3555. }, null, 8, ["modelValue"])
  3556. ])
  3557. ]),
  3558. vue.createElementVNode("div", _hoisted_88, [
  3559. _hoisted_89,
  3560. vue.createElementVNode("div", _hoisted_90, [
  3561. vue.withDirectives(vue.createElementVNode("input", {
  3562. type: "text",
  3563. "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => $data.config.customBgColor = $event)
  3564. }, null, 512), [
  3565. [vue.vModelText, $data.config.customBgColor]
  3566. ])
  3567. ])
  3568. ]),
  3569. _hoisted_91,
  3570. _hoisted_92,
  3571. vue.createElementVNode("div", _hoisted_93, [
  3572. _hoisted_94,
  3573. vue.createElementVNode("div", _hoisted_95, [
  3574. vue.createVNode(_component_BaseSwitch, {
  3575. modelValue: $data.config.collectBrowserNotice,
  3576. "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => $data.config.collectBrowserNotice = $event)
  3577. }, null, 8, ["modelValue"])
  3578. ])
  3579. ]),
  3580. _hoisted_96,
  3581. _hoisted_97,
  3582. vue.createElementVNode("div", _hoisted_98, [
  3583. _hoisted_99,
  3584. vue.createElementVNode("div", _hoisted_100, [
  3585. vue.createVNode(_component_BaseSwitch, {
  3586. modelValue: $data.config.notice.takeOverNoticePage,
  3587. "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => $data.config.notice.takeOverNoticePage = $event)
  3588. }, null, 8, ["modelValue"])
  3589. ])
  3590. ]),
  3591. vue.createElementVNode("div", _hoisted_101, [
  3592. _hoisted_102,
  3593. vue.createElementVNode("div", _hoisted_103, [
  3594. vue.createVNode(_component_BaseSwitch, {
  3595. modelValue: $data.config.notice.loopCheckNotice,
  3596. "onUpdate:modelValue": _cache[28] || (_cache[28] = ($event) => $data.config.notice.loopCheckNotice = $event)
  3597. }, null, 8, ["modelValue"])
  3598. ])
  3599. ]),
  3600. _hoisted_104,
  3601. $data.config.notice.loopCheckNotice ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_105, [
  3602. vue.createElementVNode("div", _hoisted_106, [
  3603. _hoisted_107,
  3604. vue.createElementVNode("div", _hoisted_108, [
  3605. vue.createElementVNode("input", {
  3606. type: "number",
  3607. value: $data.config.notice.loopCheckNoticeInterval,
  3608. onBlur: _cache[29] || (_cache[29] = (e2) => $data.config.notice.loopCheckNoticeInterval = e2.target.value),
  3609. style: { "margin-right": "1rem" }
  3610. }, null, 40, _hoisted_109),
  3611. vue.createTextVNode("分钟 ")
  3612. ])
  3613. ]),
  3614. _hoisted_110,
  3615. vue.createElementVNode("div", _hoisted_111, [
  3616. _hoisted_112,
  3617. vue.createElementVNode("div", _hoisted_113, [
  3618. vue.createVNode(_component_BaseSwitch, {
  3619. modelValue: $data.config.notice.whenNewNoticeGlimmer,
  3620. "onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => $data.config.notice.whenNewNoticeGlimmer = $event)
  3621. }, null, 8, ["modelValue"])
  3622. ])
  3623. ]),
  3624. _hoisted_114,
  3625. vue.createElementVNode("div", _hoisted_115, [
  3626. vue.createElementVNode("input", {
  3627. type: "text",
  3628. value: $data.config.notice.ddWebhook,
  3629. onBlur: _cache[31] || (_cache[31] = (e2) => $data.config.notice.ddWebhook = e2.target.value),
  3630. style: { "width": "100%" }
  3631. }, null, 40, _hoisted_116)
  3632. ])
  3633. ])) : vue.createCommentVNode("", true),
  3634. _hoisted_117
  3635. ])) : vue.createCommentVNode("", true),
  3636. $data.tabIndex === 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_118, [
  3637. _hoisted_119,
  3638. vue.createElementVNode("div", _hoisted_120, [
  3639. vue.createElementVNode("div", _hoisted_121, [
  3640. vue.createElementVNode("div", null, [
  3641. vue.createTextVNode("官网:"),
  3642. vue.createElementVNode("a", {
  3643. href: $options.DefaultVal.homeUrl,
  3644. target: "_blank"
  3645. }, vue.toDisplayString($options.DefaultVal.homeUrl), 9, _hoisted_122)
  3646. ]),
  3647. vue.createElementVNode("div", null, [
  3648. vue.createTextVNode("GitHub地址:"),
  3649. vue.createElementVNode("a", {
  3650. href: $options.DefaultVal.git,
  3651. target: "_blank"
  3652. }, vue.toDisplayString($options.DefaultVal.git), 9, _hoisted_123)
  3653. ]),
  3654. vue.createElementVNode("div", null, [
  3655. vue.createTextVNode("PC脚本地址:"),
  3656. vue.createElementVNode("a", {
  3657. href: $options.DefaultVal.pcScript,
  3658. target: "_blank"
  3659. }, vue.toDisplayString($options.DefaultVal.pcScript), 9, _hoisted_124)
  3660. ]),
  3661. vue.createElementVNode("div", null, [
  3662. vue.createTextVNode("App地址:"),
  3663. vue.createElementVNode("a", {
  3664. href: $options.DefaultVal.mobileScript,
  3665. target: "_blank"
  3666. }, vue.toDisplayString($options.DefaultVal.mobileScript), 9, _hoisted_125)
  3667. ]),
  3668. vue.createElementVNode("div", null, [
  3669. vue.createTextVNode("反馈: "),
  3670. vue.createElementVNode("a", {
  3671. href: $options.DefaultVal.issue,
  3672. target: "_blank"
  3673. }, vue.toDisplayString($options.DefaultVal.issue), 9, _hoisted_126)
  3674. ]),
  3675. vue.createElementVNode("div", null, [
  3676. vue.createTextVNode("更新日志:"),
  3677. vue.createElementVNode("a", {
  3678. href: $options.DefaultVal.pcLog,
  3679. target: "_blank"
  3680. }, vue.toDisplayString($options.DefaultVal.pcLog), 9, _hoisted_127)
  3681. ])
  3682. ])
  3683. ])
  3684. ])) : vue.createCommentVNode("", true)
  3685. ])
  3686. ])
  3687. ])
  3688. ]),
  3689. vue.createVNode(_component_NoticeModal, {
  3690. show: $data.showNotice,
  3691. "onUpdate:show": _cache[32] || (_cache[32] = ($event) => $data.showNotice = $event),
  3692. onConfirm: _cache[33] || (_cache[33] = ($event) => $data.config.viewType = "card")
  3693. }, null, 8, ["show"])
  3694. ])) : vue.createCommentVNode("", true)
  3695. ]),
  3696. _: 1
  3697. });
  3698. }
  3699. const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$8], ["__scopeId", "data-v-9fea31eb"]]);
  3700. const _sfc_main$e = {
  3701. name: "Point",
  3702. components: { PopConfirm, Icon },
  3703. inject: ["post", "isLogin"],
  3704. props: {
  3705. item: {
  3706. type: Object,
  3707. default() {
  3708. return {};
  3709. }
  3710. },
  3711. apiUrl: ""
  3712. },
  3713. computed: {
  3714. disabled() {
  3715. return this.item.username === window.user.username || this.item.isThanked || !this.isLogin;
  3716. }
  3717. },
  3718. methods: {
  3719. thankError() {
  3720. if (!this.isLogin) {
  3721. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  3722. }
  3723. if (this.item.username === window.user.username) {
  3724. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  3725. }
  3726. if (this.item.isThanked) {
  3727. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  3728. }
  3729. },
  3730. async thank() {
  3731. this.$emit("addThank");
  3732. let url = `${location.origin}/thank/${this.apiUrl}?once=${this.post.once}`;
  3733. $.post(url).then((res) => {
  3734. if (!res.success) {
  3735. this.$emit("recallThank");
  3736. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  3737. }
  3738. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  3739. }, (err) => {
  3740. this.$emit("recallThank");
  3741. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  3742. eventBus.emit(CMD.REFRESH_ONCE);
  3743. });
  3744. }
  3745. }
  3746. };
  3747. const _hoisted_1$e = {
  3748. key: 2,
  3749. class: "link-num"
  3750. };
  3751. const _hoisted_2$b = { key: 3 };
  3752. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  3753. const _component_Icon = vue.resolveComponent("Icon");
  3754. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  3755. return vue.openBlock(), vue.createBlock(_component_PopConfirm, {
  3756. disabled: $options.disabled,
  3757. title: `确认花费 10 个铜币向 @${$props.item.username} 的这条回复发送感谢?`,
  3758. onConfirm: $options.thank
  3759. }, {
  3760. default: vue.withCtx(() => [
  3761. vue.createElementVNode("div", {
  3762. class: vue.normalizeClass(["tool", [$options.disabled && "disabled"]]),
  3763. onClick: _cache[0] || (_cache[0] = (...args) => $options.thankError && $options.thankError(...args))
  3764. }, [
  3765. $props.item.isThanked ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  3766. key: 0,
  3767. color: "rgb(224,42,42)",
  3768. icon: "icon-park-solid:like"
  3769. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  3770. key: 1,
  3771. color: !$props.item.thankCount ? null : "rgb(224,42,42)",
  3772. icon: "icon-park-outline:like"
  3773. }, null, 8, ["color"])),
  3774. $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, "感谢"))
  3775. ], 2)
  3776. ]),
  3777. _: 1
  3778. }, 8, ["disabled", "title", "onConfirm"]);
  3779. }
  3780. const Point = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$7]]);
  3781. const _sfc_main$d = {
  3782. name: "Author",
  3783. components: { PopConfirm, Point, Icon },
  3784. inject: ["isLogin", "tags", "config", "isNight"],
  3785. props: {
  3786. modelValue: false,
  3787. comment: {
  3788. type: Object,
  3789. default() {
  3790. return {};
  3791. }
  3792. },
  3793. type: {
  3794. type: String,
  3795. default() {
  3796. return "list";
  3797. }
  3798. }
  3799. },
  3800. computed: {
  3801. isDev() {
  3802. return false;
  3803. },
  3804. pointInfo() {
  3805. return {
  3806. isThanked: this.comment.isThanked,
  3807. thankCount: this.comment.thankCount,
  3808. username: this.comment.username
  3809. };
  3810. },
  3811. myTags() {
  3812. return this.tags[this.comment.username] ?? [];
  3813. },
  3814. context() {
  3815. return this.comment.replyUsers.length;
  3816. }
  3817. },
  3818. methods: {
  3819. jump() {
  3820. eventBus.emit(CMD.JUMP, this.comment.floor);
  3821. },
  3822. showRelationReply() {
  3823. if (!this.comment.replyUsers.length) {
  3824. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "该回复无上下文" });
  3825. return;
  3826. }
  3827. eventBus.emit(CMD.RELATION_REPLY, {
  3828. left: this.comment.replyUsers,
  3829. right: this.comment.username,
  3830. rightFloor: this.comment.floor
  3831. });
  3832. },
  3833. addTag() {
  3834. eventBus.emit(CMD.ADD_TAG, this.comment.username);
  3835. },
  3836. removeTag(tag) {
  3837. eventBus.emit(CMD.REMOVE_TAG, { username: this.comment.username, tag });
  3838. },
  3839. checkIsLogin(emitName = "") {
  3840. if (!this.isLogin) {
  3841. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  3842. return false;
  3843. }
  3844. this.$emit(emitName);
  3845. return true;
  3846. },
  3847. addThank() {
  3848. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "add" });
  3849. },
  3850. recallThank() {
  3851. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "recall" });
  3852. }
  3853. }
  3854. };
  3855. const _withScopeId$9 = (n2) => (vue.pushScopeId("data-v-64aa1930"), n2 = n2(), vue.popScopeId(), n2);
  3856. const _hoisted_1$d = { class: "Author-left" };
  3857. const _hoisted_2$a = ["href"];
  3858. const _hoisted_3$9 = ["src"];
  3859. const _hoisted_4$9 = { class: "texts" };
  3860. const _hoisted_5$7 = ["href"];
  3861. const _hoisted_6$7 = {
  3862. key: 0,
  3863. class: "owner"
  3864. };
  3865. const _hoisted_7$6 = {
  3866. key: 1,
  3867. class: "dup"
  3868. };
  3869. const _hoisted_8$6 = {
  3870. key: 2,
  3871. class: "mod"
  3872. };
  3873. const _hoisted_9$6 = { class: "ago" };
  3874. const _hoisted_10$6 = { class: "my-tag" };
  3875. const _hoisted_11$6 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  3876. const _hoisted_12$6 = ["onClick"];
  3877. const _hoisted_13$6 = { class: "Author-right" };
  3878. const _hoisted_14$5 = {
  3879. key: 0,
  3880. class: "toolbar"
  3881. };
  3882. const _hoisted_15$4 = { class: "tool" };
  3883. const _hoisted_16$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "隐藏", -1));
  3884. const _hoisted_17$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上下文", -1));
  3885. const _hoisted_18$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  3886. const _hoisted_19$3 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  3887. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  3888. const _component_Icon = vue.resolveComponent("Icon");
  3889. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  3890. const _component_Point = vue.resolveComponent("Point");
  3891. return vue.openBlock(), vue.createElementBlock("div", {
  3892. class: vue.normalizeClass(["Author", { expand: !$props.modelValue }])
  3893. }, [
  3894. vue.createElementVNode("div", _hoisted_1$d, [
  3895. !$props.modelValue ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  3896. key: 0,
  3897. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => _ctx.$emit("update:modelValue", true), ["stop"])),
  3898. color: "#177EC9",
  3899. class: "expand-icon",
  3900. icon: "gravity-ui:chevrons-expand-up-right"
  3901. })) : vue.createCommentVNode("", true),
  3902. $options.config.viewType !== "simple" ? (vue.openBlock(), vue.createElementBlock("a", {
  3903. key: 1,
  3904. class: "avatar",
  3905. href: `/member/${$props.comment.username}`
  3906. }, [
  3907. vue.createElementVNode("img", {
  3908. src: $props.comment.avatar,
  3909. alt: ""
  3910. }, null, 8, _hoisted_3$9)
  3911. ], 8, _hoisted_2$a)) : vue.createCommentVNode("", true),
  3912. vue.createElementVNode("span", _hoisted_4$9, [
  3913. vue.createElementVNode("strong", null, [
  3914. vue.createElementVNode("a", {
  3915. href: `/member/${$props.comment.username}`,
  3916. class: vue.normalizeClass(["username", { "dark": $options.isNight }])
  3917. }, vue.toDisplayString($props.comment.username), 11, _hoisted_5$7)
  3918. ]),
  3919. $props.comment.isOp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$7, "OP")) : vue.createCommentVNode("", true),
  3920. $props.comment.isDup ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$6, "DUP")) : vue.createCommentVNode("", true),
  3921. $props.comment.isMod ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$6, "MOD")) : vue.createCommentVNode("", true),
  3922. vue.createElementVNode("span", _hoisted_9$6, vue.toDisplayString($props.comment.date), 1),
  3923. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
  3924. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  3925. return vue.openBlock(), vue.createElementBlock("span", _hoisted_10$6, [
  3926. _hoisted_11$6,
  3927. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  3928. vue.createElementVNode("i", {
  3929. class: "fa fa-trash-o remove",
  3930. onClick: vue.withModifiers(($event) => $options.removeTag(i), ["stop"])
  3931. }, null, 8, _hoisted_12$6)
  3932. ]);
  3933. }), 256)),
  3934. vue.createElementVNode("span", {
  3935. class: "add-tag ago",
  3936. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.addTag && $options.addTag(...args), ["stop"])),
  3937. title: "添加标签"
  3938. }, "+")
  3939. ], 64)) : vue.createCommentVNode("", true)
  3940. ])
  3941. ]),
  3942. vue.createElementVNode("div", _hoisted_13$6, [
  3943. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$5, [
  3944. vue.createVNode(_component_PopConfirm, {
  3945. title: "确认隐藏这条回复?",
  3946. onConfirm: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("hide"))
  3947. }, {
  3948. default: vue.withCtx(() => [
  3949. vue.createElementVNode("div", _hoisted_15$4, [
  3950. vue.createVNode(_component_Icon, { icon: "fluent:eye-hide-24-regular" }),
  3951. _hoisted_16$4
  3952. ])
  3953. ]),
  3954. _: 1
  3955. }),
  3956. $options.context ? (vue.openBlock(), vue.createElementBlock("div", {
  3957. key: 0,
  3958. class: "tool",
  3959. onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.showRelationReply && $options.showRelationReply(...args), ["stop"]))
  3960. }, [
  3961. vue.createVNode(_component_Icon, { icon: "iconoir:page-search" }),
  3962. _hoisted_17$4
  3963. ])) : vue.createCommentVNode("", true),
  3964. $props.type === "top" ? (vue.openBlock(), vue.createElementBlock("div", {
  3965. key: 1,
  3966. class: "tool",
  3967. onClick: _cache[4] || (_cache[4] = vue.withModifiers((...args) => $options.jump && $options.jump(...args), ["stop"]))
  3968. }, [
  3969. vue.createVNode(_component_Icon, { icon: "icon-park-outline:to-bottom" }),
  3970. _hoisted_18$4
  3971. ])) : vue.createCommentVNode("", true),
  3972. vue.createElementVNode("div", {
  3973. class: "tool",
  3974. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => $options.checkIsLogin("reply"), ["stop"]))
  3975. }, [
  3976. vue.createVNode(_component_Icon, { icon: "mynaui:message" }),
  3977. _hoisted_19$3
  3978. ]),
  3979. vue.withDirectives(vue.createVNode(_component_Point, {
  3980. item: $options.pointInfo,
  3981. onAddThank: $options.addThank,
  3982. onRecallThank: $options.recallThank,
  3983. "api-url": "reply/" + $props.comment.id
  3984. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  3985. [vue.vShow, !$props.comment.thankCount]
  3986. ])
  3987. ])) : vue.createCommentVNode("", true),
  3988. vue.withDirectives(vue.createVNode(_component_Point, {
  3989. item: $options.pointInfo,
  3990. onAddThank: $options.addThank,
  3991. onRecallThank: $options.recallThank,
  3992. "api-url": "reply/" + $props.comment.id
  3993. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  3994. [vue.vShow, $props.comment.thankCount]
  3995. ]),
  3996. vue.createElementVNode("div", {
  3997. class: vue.normalizeClass(["floor", { isDev: $options.isDev }])
  3998. }, vue.toDisplayString($props.comment.floor), 3)
  3999. ])
  4000. ], 2);
  4001. }
  4002. const Author = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$6], ["__scopeId", "data-v-64aa1930"]]);
  4003. const _withScopeId$8 = (n2) => (vue.pushScopeId("data-v-85e09b4e"), n2 = n2(), vue.popScopeId(), n2);
  4004. const _hoisted_1$c = { class: "get-cursor" };
  4005. const _hoisted_2$9 = ["innerHTML"];
  4006. const _hoisted_3$8 = { class: "toolbar" };
  4007. const _hoisted_4$8 = { class: "left" };
  4008. const _hoisted_5$6 = { class: "upload" };
  4009. const _hoisted_6$6 = {
  4010. key: 0,
  4011. style: { "color": "black", "font-size": "1.4rem" }
  4012. };
  4013. const _hoisted_7$5 = { class: "right" };
  4014. const _hoisted_8$5 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "经典", -1));
  4015. const _hoisted_9$5 = { class: "list" };
  4016. const _hoisted_10$5 = ["src", "onClick"];
  4017. const _hoisted_11$5 = { class: "emoji" };
  4018. const _hoisted_12$5 = { class: "title" };
  4019. const _hoisted_13$5 = { class: "list" };
  4020. const _hoisted_14$4 = ["onClick"];
  4021. const _sfc_main$c = {
  4022. __name: "PostEditor",
  4023. props: {
  4024. replyUser: null,
  4025. replyFloor: null,
  4026. useType: {
  4027. type: String,
  4028. default() {
  4029. return "reply-comment";
  4030. }
  4031. }
  4032. },
  4033. emits: ["close"],
  4034. setup(__props, { expose: __expose, emit: __emit }) {
  4035. const props = __props;
  4036. const { replyUser, replyFloor, useType } = props;
  4037. const replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  4038. const emits = __emit;
  4039. const post = vue.inject("post");
  4040. const show = vue.inject("show");
  4041. const isNight = vue.inject("isNight");
  4042. vue.inject("pageType");
  4043. const allReplyUsers = vue.inject("allReplyUsers");
  4044. let isFocus = vue.ref(false);
  4045. const loading = vue.ref(false);
  4046. const uploadLoading = vue.ref(false);
  4047. const isShowEmoticons = vue.ref(false);
  4048. const editorId = vue.ref("editorId_" + Date.now());
  4049. const content = vue.ref(replyInfo);
  4050. const txtRef = vue.ref(null);
  4051. const cursorRef = vue.ref(null);
  4052. const emoticonsRef = vue.ref(null);
  4053. const none = vue.ref('<span style="white-space:pre-wrap;"> </span>');
  4054. const imgurClientIdPool = [
  4055. "3107b9ef8b316f3",
  4056. "442b04f26eefc8a",
  4057. "59cfebe717c09e4",
  4058. "60605aad4a62882",
  4059. "6c65ab1d3f5452a",
  4060. "83e123737849aa9",
  4061. "9311f6be1c10160",
  4062. "c4a4a563f698595",
  4063. "81be04b9e4a08ce"
  4064. ];
  4065. __expose({ content, isFocus: () => isFocus.value });
  4066. const editorClass = vue.computed(() => {
  4067. return [useType, isFocus.value ? "isFocus" : "", isNight.value ? "isNight" : ""];
  4068. });
  4069. const cursorHtml = vue.computed(() => {
  4070. var _a;
  4071. if (!txtRef.value || !content.value)
  4072. return "";
  4073. let index = ((_a = txtRef.value) == null ? void 0 : _a.selectionStart) || 0;
  4074. return content.value.substring(0, index).replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>").replace(/\s/g, none.value);
  4075. });
  4076. const disabled = vue.computed(() => {
  4077. if (content.value) {
  4078. return content.value === replyInfo;
  4079. } else {
  4080. return true;
  4081. }
  4082. });
  4083. function drop(e2) {
  4084. e2.preventDefault();
  4085. upload(e2.dataTransfer.files[0]);
  4086. }
  4087. async function upload(file) {
  4088. if (!file)
  4089. return;
  4090. if (uploadLoading.value)
  4091. return;
  4092. uploadLoading.value = true;
  4093. const formData = new FormData();
  4094. formData.append("image", file);
  4095. const randomIndex = Math.floor(Math.random() * imgurClientIdPool.length);
  4096. const clidenId = imgurClientIdPool[randomIndex];
  4097. const res = await fetch("https://api.imgur.com/3/upload", {
  4098. method: "POST",
  4099. headers: { Authorization: `Client-ID ${clidenId}` },
  4100. body: formData
  4101. });
  4102. uploadLoading.value = false;
  4103. if (res.ok) {
  4104. const resData = await res.json();
  4105. if (resData.success) {
  4106. return insert(" " + resData.data.link + " ");
  4107. }
  4108. }
  4109. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "上传失败" });
  4110. }
  4111. async function submit() {
  4112. if (disabled.value || loading.value)
  4113. return;
  4114. loading.value = true;
  4115. let submit_content = content.value.replace(/\[((?!\[).)+\]/g, function(match) {
  4116. let item2 = classicsEmoticons.find((v) => v.name === match);
  4117. if (item2) {
  4118. return item2.low + " ";
  4119. }
  4120. return match;
  4121. });
  4122. let show_content = content.value.replace(/https?:\/\/(i\.)?imgur\.com\/((?!http).)+\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG)/g, function(match) {
  4123. return `<img src="${match}" data-originUrl="${match}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`;
  4124. });
  4125. show_content = show_content.replace(/\[((?!\[).)+\]/g, function(match) {
  4126. let item2 = classicsEmoticons.find((v) => v.name === match);
  4127. if (item2) {
  4128. return `<a target="_blank" href="${item2.low}" rel="nofollow noopener"><img src="${item2.low}" class="embedded_image" rel="noreferrer"></a> `;
  4129. }
  4130. return match;
  4131. });
  4132. let matchUsers = show_content.match(/@([\w]+?[\s])/g);
  4133. if (matchUsers) {
  4134. matchUsers.map((i) => {
  4135. let username = i.replace("@", "").replace(" ", "");
  4136. show_content = show_content.replace(username, `<a href="/member/${username}">${username}</a>`);
  4137. });
  4138. }
  4139. show_content = show_content.replaceAll("\n", "<br/>");
  4140. let item = {
  4141. thankCount: 0,
  4142. isThanked: false,
  4143. isOp: post.value.username === window.user.username,
  4144. isDup: false,
  4145. id: Date.now(),
  4146. username: window.user.username,
  4147. avatar: window.user.avatar,
  4148. date: "几秒前",
  4149. floor: post.value.replyCount + 1,
  4150. reply_content: show_content ?? "",
  4151. children: [],
  4152. replyUsers: replyUser ? [replyUser] : [],
  4153. replyFloor: replyFloor || -1,
  4154. level: useType === "reply-comment" ? 1 : 0
  4155. };
  4156. item.hideCallUserReplyContent = item.reply_content;
  4157. if (item.replyUsers.length === 1) {
  4158. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(?:<ul [\s\S]+<\/ul>)?(\s#[\d]+)?\s(<br>)?/, () => "");
  4159. }
  4160. let url = `${location.origin}/t/${post.value.id}`;
  4161. $.post(url, { content: submit_content, once: post.value.once }).then(
  4162. // $.post(url, {content: submit_content, once: 123}).then(
  4163. (res) => {
  4164. loading.value = false;
  4165. let r2 = res.search("你上一条回复的内容和这条相同");
  4166. if (r2 > -1)
  4167. return eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你上一条回复的内容和这条相同" });
  4168. r2 = res.search("请不要在每一个回复中都包括外链,这看起来像是在 spamming");
  4169. if (r2 > -1)
  4170. return eventBus.emit(CMD.SHOW_MSG, {
  4171. type: "error",
  4172. text: "请不要在每一个回复中都包括外链,这看起来像是在 spamming"
  4173. });
  4174. let r22 = res.search("创建新回复");
  4175. if (r22 > -1) {
  4176. eventBus.emit(CMD.REFRESH_ONCE, res);
  4177. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复出现了问题,请使用原版进行回复" });
  4178. let clientWidth = window.document.body.clientWidth;
  4179. let windowWidth = 1200;
  4180. let left = clientWidth / 2 - windowWidth / 2;
  4181. let newWin = window.open("创建新回复", "", `width=${windowWidth},height=600,left=${left},top=100`);
  4182. newWin.document.write(res);
  4183. let loop = setInterval(function() {
  4184. if (newWin.closed) {
  4185. clearInterval(loop);
  4186. eventBus.emit(CMD.REFRESH_POST);
  4187. }
  4188. }, 1e3);
  4189. return;
  4190. }
  4191. content.value = replyInfo;
  4192. emits("close");
  4193. eventBus.emit(CMD.REFRESH_ONCE, res);
  4194. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "回复成功" });
  4195. eventBus.emit(CMD.ADD_REPLY, item);
  4196. },
  4197. (err) => {
  4198. console.log("err", err);
  4199. loading.value = false;
  4200. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复失败" });
  4201. }
  4202. ).catch((r2) => {
  4203. console.log("catch", r2);
  4204. });
  4205. }
  4206. function getEmojiSrc(url) {
  4207. return window.config.replaceImgur ? DefaultVal.imgurProxy + url : url;
  4208. }
  4209. function showEmoticons(e2) {
  4210. if (isShowEmoticons.value) {
  4211. return isShowEmoticons.value = false;
  4212. }
  4213. let rect = e2.currentTarget.getBoundingClientRect();
  4214. emoticonsRef.value.style.left = rect.left + 30 + "px";
  4215. emoticonsRef.value.style.bottom = window.innerHeight - rect.top - 20 + "px";
  4216. isShowEmoticons.value = true;
  4217. }
  4218. function off() {
  4219. eventBus.emit(CMD.SHOW_CALL, { show: false });
  4220. eventBus.off(CMD.SET_CALL);
  4221. }
  4222. function checkHeight2() {
  4223. txtRef.value.style.height = 0;
  4224. txtRef.value.style.height = txtRef.value.scrollHeight + "px";
  4225. }
  4226. function insert(str) {
  4227. let cursorPos = txtRef.value.selectionStart;
  4228. let start = content.value.slice(0, cursorPos);
  4229. let end = content.value.slice(cursorPos, content.value.length);
  4230. content.value = start + str + end;
  4231. let moveCursorPos = start.length + str.length;
  4232. setTimeout(() => {
  4233. txtRef.value.focus();
  4234. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  4235. checkHeight2();
  4236. });
  4237. }
  4238. function showCallPopover(text) {
  4239. let r2 = cursorRef.value.getBoundingClientRect();
  4240. eventBus.emit(CMD.SHOW_CALL, { show: true, top: r2.top, left: r2.left, text });
  4241. eventBus.off(CMD.SET_CALL);
  4242. eventBus.on(CMD.SET_CALL, (e2) => {
  4243. let cursorPos = txtRef.value.selectionStart;
  4244. let start = content.value.slice(0, cursorPos);
  4245. let end = content.value.slice(cursorPos, content.value.length);
  4246. let lastCallPos = start.lastIndexOf("@");
  4247. start = content.value.slice(0, lastCallPos + 1);
  4248. if (e2 === "管理员") {
  4249. e2 = "Livid @Kai @Olivia @GordianZ @sparanoid @drymonfidelia";
  4250. }
  4251. if (e2 === "所有人") {
  4252. e2 = allReplyUsers.value.map((v, i) => {
  4253. if (i)
  4254. return "@" + v;
  4255. else
  4256. return v;
  4257. }).join(" ");
  4258. }
  4259. content.value = start + e2 + " " + end;
  4260. let moveCursorPos = start.length + e2.length + 1;
  4261. setTimeout(() => {
  4262. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  4263. checkHeight2();
  4264. });
  4265. eventBus.off(CMD.SET_CALL);
  4266. });
  4267. }
  4268. function onKeydown(e2) {
  4269. let code = e2.keyCode;
  4270. switch (code) {
  4271. case 8:
  4272. if (content.value === "@") {
  4273. off();
  4274. }
  4275. break;
  4276. case 37:
  4277. case 38:
  4278. case 39:
  4279. case 40:
  4280. setTimeout(() => onInput({ data: "" }), 100);
  4281. break;
  4282. case 27:
  4283. e2.preventDefault();
  4284. e2.stopPropagation();
  4285. e2.stopImmediatePropagation();
  4286. return false;
  4287. case 13:
  4288. if (e2.ctrlKey)
  4289. submit();
  4290. if (e2.metaKey)
  4291. submit();
  4292. break;
  4293. }
  4294. }
  4295. function onInput(e2) {
  4296. let cursorPos = txtRef.value.selectionStart;
  4297. if (!content.value)
  4298. return;
  4299. if (e2.data === " ") {
  4300. return off();
  4301. }
  4302. if (e2.data === "@") {
  4303. if (content.value.length !== 1) {
  4304. if (content.value[cursorPos - 2] === " " || content.value[cursorPos - 2] === "\n") {
  4305. return showCallPopover("");
  4306. }
  4307. } else {
  4308. return showCallPopover("");
  4309. }
  4310. off();
  4311. } else {
  4312. checkHeight2();
  4313. let judgeStr = content.value.slice(0, cursorPos);
  4314. let lastCallPos = judgeStr.lastIndexOf("@");
  4315. if (lastCallPos === -1) {
  4316. return off();
  4317. }
  4318. let callStr = judgeStr.slice(lastCallPos, cursorPos);
  4319. let hasSpace = callStr.includes(" ");
  4320. if (hasSpace) {
  4321. off();
  4322. } else {
  4323. if (lastCallPos === 0) {
  4324. return showCallPopover(callStr.replace("@", ""));
  4325. }
  4326. if (content.value.length !== 1) {
  4327. if (content.value[lastCallPos - 1] === " " || content.value[lastCallPos - 1] === "\n") {
  4328. return showCallPopover(callStr.replace("@", ""));
  4329. }
  4330. } else {
  4331. return showCallPopover(callStr.replace("@", ""));
  4332. }
  4333. off();
  4334. }
  4335. }
  4336. }
  4337. function onPaste(e2) {
  4338. const dataTransferItemList = e2.clipboardData.items;
  4339. const items = [].slice.call(dataTransferItemList).filter(function(item) {
  4340. return item.type.indexOf("image") !== -1;
  4341. });
  4342. if (items.length === 0) {
  4343. return;
  4344. }
  4345. const dataTransferItem = items[0];
  4346. const blob = dataTransferItem.getAsFile();
  4347. upload(blob);
  4348. }
  4349. function onBlur() {
  4350. document.removeEventListener("paste", onPaste);
  4351. isFocus.value = false;
  4352. }
  4353. function onFocusin() {
  4354. document.addEventListener("paste", onPaste);
  4355. }
  4356. vue.watch(() => show, (n2) => {
  4357. if (n2.value)
  4358. isShowEmoticons.value = false;
  4359. }, { deep: true });
  4360. vue.onMounted(() => {
  4361. $(`.${editorId.value}`).each(function() {
  4362. this.setAttribute("style", "height:" + this.scrollHeight + "px;overflow-y:hidden;");
  4363. }).on("input", function() {
  4364. this.style.height = 0;
  4365. this.style.height = this.scrollHeight + "px";
  4366. });
  4367. if (useType === "reply-comment") {
  4368. txtRef.value && txtRef.value.focus();
  4369. }
  4370. });
  4371. vue.onBeforeUnmount(() => {
  4372. $(`.${editorId.value}`).off();
  4373. });
  4374. return (_ctx, _cache) => {
  4375. return vue.openBlock(), vue.createElementBlock("div", {
  4376. class: vue.normalizeClass(["post-editor-wrapper", editorClass.value])
  4377. }, [
  4378. vue.withDirectives(vue.createElementVNode("textarea", {
  4379. class: vue.normalizeClass(["post-editor", editorId.value]),
  4380. ref_key: "txtRef",
  4381. ref: txtRef,
  4382. onFocus: _cache[0] || (_cache[0] = ($event) => vue.isRef(isFocus) ? isFocus.value = true : isFocus = true),
  4383. onBlur,
  4384. onFocusin,
  4385. placeholder: "请尽量让自己的回复能够对别人有帮助",
  4386. onInput,
  4387. onKeydown,
  4388. onDrop: drop,
  4389. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => content.value = $event)
  4390. }, null, 34), [
  4391. [vue.vModelText, content.value]
  4392. ]),
  4393. vue.createElementVNode("div", _hoisted_1$c, [
  4394. vue.createElementVNode("span", { innerHTML: cursorHtml.value }, null, 8, _hoisted_2$9),
  4395. vue.createElementVNode("span", {
  4396. class: "cursor",
  4397. ref_key: "cursorRef",
  4398. ref: cursorRef
  4399. }, "|", 512)
  4400. ]),
  4401. vue.createElementVNode("div", _hoisted_3$8, [
  4402. vue.createElementVNode("div", _hoisted_4$8, [
  4403. vue.createVNode(vue.unref(Icon), {
  4404. onClick: vue.withModifiers(showEmoticons, ["stop"]),
  4405. icon: "streamline:smiley-happy"
  4406. }),
  4407. vue.createElementVNode("div", _hoisted_5$6, [
  4408. vue.createElementVNode("input", {
  4409. type: "file",
  4410. accept: "image/*",
  4411. onChange: _cache[2] || (_cache[2] = (e2) => upload(e2.currentTarget.files[0]))
  4412. }, null, 32),
  4413. vue.createVNode(vue.unref(Icon), { icon: "lets-icons:img-load-box-fill" })
  4414. ]),
  4415. uploadLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$6, "上传中.....")) : vue.createCommentVNode("", true)
  4416. ]),
  4417. vue.createElementVNode("div", _hoisted_7$5, [
  4418. vue.unref(useType) === "reply-comment" ? (vue.openBlock(), vue.createBlock(BaseButton, {
  4419. key: 0,
  4420. type: "link",
  4421. size: "small",
  4422. style: { "margin-right": "1rem", "cursor": "pointer" },
  4423. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => emits("close"), ["stop"]))
  4424. }, {
  4425. default: vue.withCtx(() => [
  4426. vue.createTextVNode(" 关闭 ")
  4427. ]),
  4428. _: 1
  4429. })) : vue.createCommentVNode("", true),
  4430. vue.createVNode(BaseButton, {
  4431. size: "small",
  4432. disabled: disabled.value,
  4433. loading: loading.value,
  4434. onClick: vue.withModifiers(submit, ["stop"])
  4435. }, {
  4436. default: vue.withCtx(() => [
  4437. vue.createTextVNode("回复 ")
  4438. ]),
  4439. _: 1
  4440. }, 8, ["disabled", "loading"])
  4441. ])
  4442. ]),
  4443. vue.withDirectives(vue.createElementVNode("div", {
  4444. class: "emoticon-pack",
  4445. ref_key: "emoticonsRef",
  4446. ref: emoticonsRef
  4447. }, [
  4448. vue.createVNode(vue.unref(Icon), {
  4449. icon: "ic:round-close",
  4450. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => isShowEmoticons.value = false, ["stop"]))
  4451. }),
  4452. _hoisted_8$5,
  4453. vue.createElementVNode("div", _hoisted_9$5, [
  4454. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(classicsEmoticons), (item) => {
  4455. return vue.openBlock(), vue.createElementBlock("img", {
  4456. src: getEmojiSrc(item.high),
  4457. referrerpolicy: "no-referrer",
  4458. onClick: vue.withModifiers(($event) => {
  4459. insert(item.name);
  4460. isShowEmoticons.value = false;
  4461. }, ["stop"])
  4462. }, null, 8, _hoisted_10$5);
  4463. }), 256))
  4464. ]),
  4465. vue.createElementVNode("div", _hoisted_11$5, [
  4466. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(emojiEmoticons), (item) => {
  4467. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  4468. vue.createElementVNode("div", _hoisted_12$5, vue.toDisplayString(item.title), 1),
  4469. vue.createElementVNode("div", _hoisted_13$5, [
  4470. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.list, (emoji) => {
  4471. return vue.openBlock(), vue.createElementBlock("span", {
  4472. onClick: vue.withModifiers(($event) => {
  4473. insert(emoji);
  4474. isShowEmoticons.value = false;
  4475. }, ["stop"])
  4476. }, vue.toDisplayString(emoji), 9, _hoisted_14$4);
  4477. }), 256))
  4478. ])
  4479. ], 64);
  4480. }), 256))
  4481. ])
  4482. ], 512), [
  4483. [vue.vShow, isShowEmoticons.value]
  4484. ])
  4485. ], 2);
  4486. };
  4487. }
  4488. };
  4489. const PostEditor = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-85e09b4e"]]);
  4490. const _hoisted_1$b = {
  4491. key: 0,
  4492. class: "html-wrapper"
  4493. };
  4494. const _hoisted_2$8 = ["innerHTML"];
  4495. const checkHeight = 900;
  4496. const _sfc_main$b = {
  4497. __name: "BaseHtmlRender",
  4498. props: ["html"],
  4499. setup(__props) {
  4500. const config2 = vue.inject("config");
  4501. const props = __props;
  4502. const contentRef = vue.ref(null);
  4503. const mask = vue.ref(false);
  4504. const handOpen = vue.ref(false);
  4505. function mouseup(e2) {
  4506. if (!config2.value.base64)
  4507. return;
  4508. let selectionText = window.getSelection().toString();
  4509. if (selectionText) {
  4510. let r2 = selectionText.match(/([A-Za-z0-9+/=]+)/g);
  4511. if (r2) {
  4512. if (r2[0].length < 4)
  4513. return;
  4514. eventBus.emit(CMD.SHOW_TOOLTIP, { text: r2[0], e: e2 });
  4515. }
  4516. }
  4517. }
  4518. vue.watch(config2.value, (newVale) => {
  4519. if (!newVale.contentAutoCollapse) {
  4520. mask.value = false;
  4521. }
  4522. });
  4523. vue.watch([() => contentRef.value, () => props.html], () => {
  4524. if (!contentRef.value || !props.html)
  4525. return;
  4526. if (!config2.value.contentAutoCollapse)
  4527. return;
  4528. contentRef.value.querySelectorAll("img").forEach((item) => {
  4529. item.removeEventListener("load", checkContentHeight);
  4530. item.addEventListener("load", checkContentHeight);
  4531. });
  4532. checkContentHeight();
  4533. }, { immediate: true, flush: "post" });
  4534. function checkContentHeight() {
  4535. if (handOpen.value)
  4536. return;
  4537. if (!contentRef.value)
  4538. return;
  4539. let rect = contentRef.value.getBoundingClientRect();
  4540. mask.value = rect.height >= checkHeight;
  4541. }
  4542. return (_ctx, _cache) => {
  4543. return props.html ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
  4544. vue.createElementVNode("div", {
  4545. class: vue.normalizeClass({ mask: mask.value })
  4546. }, [
  4547. vue.createElementVNode("div", {
  4548. ref_key: "contentRef",
  4549. ref: contentRef,
  4550. innerHTML: props.html,
  4551. onMouseup: mouseup
  4552. }, null, 40, _hoisted_2$8)
  4553. ], 2),
  4554. mask.value ? (vue.openBlock(), vue.createElementBlock("div", {
  4555. key: 0,
  4556. class: "expand",
  4557. onClick: _cache[0] || (_cache[0] = ($event) => {
  4558. mask.value = false;
  4559. handOpen.value = true;
  4560. })
  4561. }, "展开")) : vue.createCommentVNode("", true)
  4562. ])) : vue.createCommentVNode("", true);
  4563. };
  4564. }
  4565. };
  4566. const BaseHtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-6f61a860"]]);
  4567. const _sfc_main$a = {
  4568. name: "TopSubComment",
  4569. components: { BaseHtmlRender, Author, PostEditor, Point, Icon },
  4570. inject: ["post", "postDetailWidth", "show", "isNight", "isLogin", "tags", "config"],
  4571. props: {
  4572. modelValue: {
  4573. reply_content: ""
  4574. },
  4575. level: -1
  4576. },
  4577. data() {
  4578. return {
  4579. expand: true,
  4580. edit: false,
  4581. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  4582. floor: this.modelValue.floor
  4583. };
  4584. },
  4585. watch: {
  4586. show(e2) {
  4587. if (e2) {
  4588. this.edit = false;
  4589. }
  4590. }
  4591. },
  4592. computed: {
  4593. myTags() {
  4594. return this.tags[this.modelValue.username] ?? [];
  4595. }
  4596. },
  4597. methods: {
  4598. jump() {
  4599. eventBus.emit(CMD.JUMP, this.modelValue.floor);
  4600. }
  4601. }
  4602. };
  4603. const _withScopeId$7 = (n2) => (vue.pushScopeId("data-v-d3f8c94b"), n2 = n2(), vue.popScopeId(), n2);
  4604. const _hoisted_1$a = ["data-floor"];
  4605. const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "left expand-line" }, null, -1));
  4606. const _hoisted_3$7 = { class: "right" };
  4607. const _hoisted_4$7 = { class: "simple-wrapper" };
  4608. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  4609. const _component_Author = vue.resolveComponent("Author");
  4610. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  4611. const _component_PostEditor = vue.resolveComponent("PostEditor");
  4612. const _component_TopSubComment = vue.resolveComponent("TopSubComment", true);
  4613. return vue.openBlock(), vue.createElementBlock("div", {
  4614. class: vue.normalizeClass(["top-sub-comment", $props.level === 1 && "top-sub-reply"]),
  4615. ref: "comment",
  4616. "data-floor": $data.floor
  4617. }, [
  4618. _hoisted_2$7,
  4619. vue.createElementVNode("div", _hoisted_3$7, [
  4620. vue.createVNode(_component_Author, {
  4621. modelValue: $data.expand,
  4622. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  4623. comment: $props.modelValue,
  4624. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  4625. type: "top"
  4626. }, null, 8, ["modelValue", "comment"]),
  4627. vue.createVNode(_component_BaseHtmlRender, {
  4628. class: "top-reply_content reply_content",
  4629. html: $props.modelValue.hideCallUserReplyContent
  4630. }, null, 8, ["html"]),
  4631. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  4632. key: 0,
  4633. onClose: _cache[2] || (_cache[2] = ($event) => $data.edit = false),
  4634. replyInfo: $data.replyInfo,
  4635. replyUser: $props.modelValue.username,
  4636. replyFloor: $props.modelValue.floor
  4637. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true),
  4638. vue.createElementVNode("div", _hoisted_4$7, [
  4639. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  4640. return vue.openBlock(), vue.createBlock(_component_TopSubComment, {
  4641. modelValue: $props.modelValue.children[index],
  4642. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4643. key: index
  4644. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4645. }), 128))
  4646. ])
  4647. ])
  4648. ], 10, _hoisted_1$a);
  4649. }
  4650. const TopSubComment = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$5], ["__scopeId", "data-v-d3f8c94b"]]);
  4651. const _sfc_main$9 = {
  4652. name: "Comment",
  4653. components: { BaseHtmlRender, Author, PostEditor, Point, Icon, TopSubComment },
  4654. inject: ["post", "postDetailWidth", "show", "isNight", "config"],
  4655. props: {
  4656. modelValue: {
  4657. reply_content: ""
  4658. },
  4659. type: {
  4660. type: String,
  4661. default() {
  4662. return "list";
  4663. }
  4664. }
  4665. },
  4666. data() {
  4667. return {
  4668. edit: false,
  4669. ding: false,
  4670. expand: true,
  4671. expandTopReply: true,
  4672. expandWrong: false,
  4673. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  4674. cssStyle: null,
  4675. floor: this.modelValue.floor
  4676. };
  4677. },
  4678. watch: {
  4679. show(e2) {
  4680. if (e2) {
  4681. this.edit = false;
  4682. }
  4683. },
  4684. postDetailWidth(n2, o) {
  4685. this.checkIsTooLong(n2);
  4686. }
  4687. },
  4688. computed: {
  4689. CommentDisplayType() {
  4690. return CommentDisplayType;
  4691. },
  4692. myClass() {
  4693. return {
  4694. isOp: this.modelValue.isOp,
  4695. isSimple: this.config.viewType === "simple",
  4696. ding: this.ding,
  4697. isLevelOne: this.type === "top" ? true : this.modelValue.level === 0,
  4698. ["c_" + this.floor]: this.type !== "top"
  4699. };
  4700. }
  4701. },
  4702. mounted() {
  4703. this.checkIsTooLong(this.postDetailWidth);
  4704. },
  4705. methods: {
  4706. checkIsTooLong(postDetailWidth) {
  4707. if (postDetailWidth !== 0) {
  4708. let rect = this.$refs.comment.getBoundingClientRect();
  4709. let ban = postDetailWidth * 0.6;
  4710. if (ban < rect.width && rect.width < ban + 25 && this.modelValue.children.length) {
  4711. this.expand = false;
  4712. let padding = 2;
  4713. this.cssStyle = {
  4714. padding: "1rem 0",
  4715. width: `calc(${postDetailWidth}px - ${padding}rem)`,
  4716. transform: `translateX(calc(${rect.width - postDetailWidth}px + ${padding}rem))`,
  4717. background: this.isNight ? "#18222d" : "white"
  4718. };
  4719. }
  4720. }
  4721. },
  4722. //高亮一下
  4723. showDing() {
  4724. this.ding = true;
  4725. setTimeout(() => {
  4726. this.ding = false;
  4727. }, 2e3);
  4728. },
  4729. hide() {
  4730. let url = `${location.origin}/ignore/reply/${this.modelValue.id}?once=${this.post.once}`;
  4731. eventBus.emit(CMD.REMOVE, this.modelValue.floor);
  4732. $.post(url).then((res) => {
  4733. eventBus.emit(CMD.REFRESH_ONCE);
  4734. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "隐藏成功" });
  4735. }, (err) => {
  4736. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "隐藏成功,仅本次有效(接口调用失败!)" });
  4737. });
  4738. },
  4739. toggle() {
  4740. this.expand = !this.expand;
  4741. },
  4742. jump() {
  4743. eventBus.emit(CMD.JUMP, this.modelValue.floor);
  4744. }
  4745. }
  4746. };
  4747. const _withScopeId$6 = (n2) => (vue.pushScopeId("data-v-dd44e74f"), n2 = n2(), vue.popScopeId(), n2);
  4748. const _hoisted_1$9 = ["data-floor"];
  4749. const _hoisted_2$6 = { class: "comment-content" };
  4750. const _hoisted_3$6 = { class: "right" };
  4751. const _hoisted_4$6 = { class: "w" };
  4752. const _hoisted_5$5 = {
  4753. key: 0,
  4754. class: "wrong-wrapper"
  4755. };
  4756. const _hoisted_6$5 = ["href"];
  4757. const _hoisted_7$4 = { class: "del-line" };
  4758. const _hoisted_8$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("i", {
  4759. class: "fa fa-question-circle-o wrong-icon",
  4760. "aria-hidden": "true"
  4761. }, null, -1));
  4762. const _hoisted_9$4 = {
  4763. key: 0,
  4764. class: "warning"
  4765. };
  4766. const _hoisted_10$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4767. const _hoisted_11$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4768. const _hoisted_12$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4769. const _hoisted_13$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4770. const _hoisted_14$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4771. const _hoisted_15$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("a", {
  4772. href: "https://github.com/zyronon/V2Next/issues",
  4773. target: "_blank"
  4774. }, "这里", -1));
  4775. const _hoisted_16$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "gang" }, null, -1));
  4776. const _hoisted_17$3 = { class: "simple-wrapper" };
  4777. const _hoisted_18$3 = {
  4778. key: 0,
  4779. class: "top-reply-wrap"
  4780. };
  4781. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  4782. const _component_Author = vue.resolveComponent("Author");
  4783. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  4784. const _component_PostEditor = vue.resolveComponent("PostEditor");
  4785. const _component_Icon = vue.resolveComponent("Icon");
  4786. const _component_TopSubComment = vue.resolveComponent("TopSubComment");
  4787. const _component_Comment = vue.resolveComponent("Comment", true);
  4788. return vue.openBlock(), vue.createElementBlock("div", {
  4789. class: vue.normalizeClass(["comment", $options.myClass]),
  4790. ref: "comment",
  4791. "data-floor": $data.floor
  4792. }, [
  4793. vue.createVNode(_component_Author, {
  4794. modelValue: $data.expand,
  4795. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  4796. comment: $props.modelValue,
  4797. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  4798. type: $props.type,
  4799. onHide: $options.hide
  4800. }, null, 8, ["modelValue", "comment", "type", "onHide"]),
  4801. $data.cssStyle && !$data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4802. key: 0,
  4803. class: "more ago",
  4804. onClick: _cache[2] || (_cache[2] = ($event) => $data.expand = !$data.expand)
  4805. }, " 由于嵌套回复层级太深,自动将后续回复隐藏 ")) : vue.createCommentVNode("", true),
  4806. $data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4807. key: 1,
  4808. class: "comment-content-w",
  4809. style: vue.normalizeStyle($data.cssStyle)
  4810. }, [
  4811. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4812. key: 0,
  4813. class: "more ago",
  4814. onClick: _cache[3] || (_cache[3] = ($event) => $data.expand = !$data.expand)
  4815. }, " 由于嵌套回复层级太深,自动将以下回复移至可见范围 ")) : vue.createCommentVNode("", true),
  4816. vue.createElementVNode("div", _hoisted_2$6, [
  4817. vue.createElementVNode("div", {
  4818. class: "left expand-line",
  4819. onClick: _cache[4] || (_cache[4] = (...args) => $options.toggle && $options.toggle(...args))
  4820. }),
  4821. vue.createElementVNode("div", _hoisted_3$6, [
  4822. vue.createElementVNode("div", _hoisted_4$6, [
  4823. $props.modelValue.isWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
  4824. vue.createElementVNode("span", {
  4825. onClick: _cache[5] || (_cache[5] = ($event) => $data.expandWrong = !$data.expandWrong),
  4826. title: "点击楼层号查看提示"
  4827. }, [
  4828. vue.createElementVNode("a", {
  4829. href: "/member/" + $props.modelValue.replyUsers[0]
  4830. }, "@" + vue.toDisplayString($props.modelValue.replyUsers[0]) + "  ", 9, _hoisted_6$5),
  4831. vue.createElementVNode("span", _hoisted_7$4, "#" + vue.toDisplayString($props.modelValue.replyFloor), 1),
  4832. _hoisted_8$4
  4833. ]),
  4834. $data.expandWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$4, [
  4835. vue.createTextVNode(" 这条回复似乎有点问题,指定的楼层号与@的人对应不上 "),
  4836. _hoisted_10$4,
  4837. vue.createTextVNode(" 原因可能有下面几种: "),
  4838. _hoisted_11$4,
  4839. vue.createTextVNode(" 一、屏蔽用户导致楼层塌陷:你屏蔽了A,自A以后的回复的楼层号都会减1 "),
  4840. _hoisted_12$4,
  4841. vue.createTextVNode(" 二、忽略回复导致楼层塌陷:原理同上 "),
  4842. _hoisted_13$4,
  4843. vue.createTextVNode(" 三、层主回复时指定错了楼层号(同一,层主屏蔽了别人,导致楼层塌陷) "),
  4844. _hoisted_14$3,
  4845. vue.createTextVNode(" 四、脚本解析错误,请在 "),
  4846. _hoisted_15$3,
  4847. vue.createTextVNode("反馈 ")
  4848. ])) : vue.createCommentVNode("", true)
  4849. ])) : vue.createCommentVNode("", true),
  4850. $options.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNoCallUser && $props.type !== "top" ? (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4851. key: 1,
  4852. class: "reply_content",
  4853. html: $props.modelValue.hideCallUserReplyContent
  4854. }, null, 8, ["html"])) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4855. key: 2,
  4856. class: "reply_content",
  4857. html: $props.modelValue.reply_content
  4858. }, null, 8, ["html"])),
  4859. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  4860. key: 3,
  4861. onClose: _cache[6] || (_cache[6] = ($event) => $data.edit = false),
  4862. replyInfo: $data.replyInfo,
  4863. replyUser: $props.modelValue.username,
  4864. replyFloor: $props.modelValue.floor
  4865. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true),
  4866. $props.type === "top" && $props.modelValue.replyCount ? (vue.openBlock(), vue.createElementBlock("div", {
  4867. key: 4,
  4868. class: "reply-count",
  4869. onClick: _cache[7] || (_cache[7] = ($event) => $data.expandTopReply = !$data.expandTopReply)
  4870. }, [
  4871. _hoisted_16$3,
  4872. vue.createElementVNode("span", null, " 共有" + vue.toDisplayString($props.modelValue.replyCount) + " 条回复 ", 1),
  4873. $data.expandTopReply ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  4874. key: 0,
  4875. icon: "ep:arrow-up-bold"
  4876. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  4877. key: 1,
  4878. icon: "ep:arrow-down-bold"
  4879. }))
  4880. ])) : vue.createCommentVNode("", true)
  4881. ]),
  4882. vue.createElementVNode("div", _hoisted_17$3, [
  4883. $props.type === "top" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  4884. $data.expandTopReply && $props.modelValue.replyCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$3, [
  4885. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  4886. return vue.openBlock(), vue.createBlock(_component_TopSubComment, {
  4887. level: 1,
  4888. modelValue: $props.modelValue.children[index],
  4889. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4890. key: index
  4891. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4892. }), 128))
  4893. ])) : vue.createCommentVNode("", true)
  4894. ], 64)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList($props.modelValue.children, (item, index) => {
  4895. return vue.openBlock(), vue.createBlock(_component_Comment, {
  4896. modelValue: $props.modelValue.children[index],
  4897. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4898. key: index
  4899. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4900. }), 128))
  4901. ])
  4902. ])
  4903. ]),
  4904. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4905. key: 1,
  4906. class: "more ago",
  4907. onClick: _cache[8] || (_cache[8] = ($event) => $data.expand = !$data.expand)
  4908. }, " 由于嵌套回复层级太深,自动将以上回复移至可见范围 ")) : vue.createCommentVNode("", true)
  4909. ], 4)) : vue.createCommentVNode("", true)
  4910. ], 10, _hoisted_1$9);
  4911. }
  4912. const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$4], ["__scopeId", "data-v-dd44e74f"]]);
  4913. const _sfc_main$8 = {
  4914. name: "Toolbar",
  4915. components: { Icon, BaseLoading },
  4916. inject: [
  4917. "isLogin",
  4918. "post",
  4919. "pageType"
  4920. ],
  4921. data() {
  4922. return {
  4923. timer: null,
  4924. loading: false,
  4925. loading2: false,
  4926. loading3: false
  4927. };
  4928. },
  4929. methods: {
  4930. checkIsLogin(emitName = "") {
  4931. if (!this.isLogin) {
  4932. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  4933. return false;
  4934. }
  4935. this.$emit(emitName);
  4936. return true;
  4937. },
  4938. tweet() {
  4939. var _a;
  4940. let username = ((_a = window.user) == null ? void 0 : _a.username) ?? "";
  4941. let url = `https://twitter.com/intent/tweet?url=${location.origin}/t/${this.post.id}?r=${username}&related=v2ex&text=${this.post.title}`;
  4942. window.open(url, "_blank", "width=550,height=370");
  4943. },
  4944. async report() {
  4945. if (!this.checkIsLogin())
  4946. return;
  4947. if (this.loading3)
  4948. return;
  4949. let isReport = this.post.isReport;
  4950. if (isReport) {
  4951. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4952. return;
  4953. }
  4954. let url = `${location.origin}/report/topic/${this.post.id}?once=${this.post.once}`;
  4955. this.loading3 = true;
  4956. let apiRes = await fetch(url);
  4957. this.loading3 = false;
  4958. if (apiRes.redirected) {
  4959. let htmlText = await apiRes.text();
  4960. if (htmlText.search("你已对本主题进行了报告")) {
  4961. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4962. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4963. eventBus.emit(CMD.MERGE, { isReport: !isReport });
  4964. return;
  4965. }
  4966. }
  4967. eventBus.emit(CMD.REFRESH_ONCE);
  4968. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败,请重试" });
  4969. },
  4970. async toggleIgnore() {
  4971. if (!this.checkIsLogin())
  4972. return;
  4973. let url = `${location.origin}/${this.post.isIgnore ? "unignore" : "ignore"}/topic/${this.post.id}?once=${this.post.once}`;
  4974. if (this.pageType === PageType.Post) {
  4975. this.loading2 = true;
  4976. let apiRes = await fetch(url);
  4977. if (apiRes.redirected) {
  4978. if (!this.post.isIgnore) {
  4979. window.location = location.origin;
  4980. }
  4981. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  4982. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  4983. } else {
  4984. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略失败" });
  4985. }
  4986. this.loading2 = false;
  4987. } else {
  4988. if (this.post.isIgnore) {
  4989. this.loading2 = true;
  4990. } else {
  4991. eventBus.emit(CMD.IGNORE);
  4992. }
  4993. let apiRes = await fetch(url);
  4994. if (apiRes.redirected) {
  4995. if (this.post.isIgnore) {
  4996. eventBus.emit(CMD.REFRESH_ONCE);
  4997. }
  4998. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  4999. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  5000. } else {
  5001. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略成功,仅本次有效(接口调用失败!)" });
  5002. }
  5003. this.loading2 = false;
  5004. }
  5005. },
  5006. async toggleFavorite() {
  5007. if (!this.checkIsLogin())
  5008. return;
  5009. if (this.loading)
  5010. return;
  5011. let isFavorite = this.post.isFavorite;
  5012. if (!isFavorite && config.collectBrowserNotice) {
  5013. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "别忘记按Command/Cmd/CTRL + D添加到书签哦" });
  5014. }
  5015. let url = `${location.origin}/${isFavorite ? "unfavorite" : "favorite"}/topic/${this.post.id}?once=${this.post.once}`;
  5016. this.loading = true;
  5017. let apiRes = await fetch(url);
  5018. this.loading = false;
  5019. if (apiRes.redirected) {
  5020. let htmlText = await apiRes.text();
  5021. if (htmlText.search(isFavorite ? "加入收藏" : "取消收藏")) {
  5022. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isFavorite ? "取消成功" : "收藏成功" });
  5023. eventBus.emit(CMD.MERGE, { collectCount: isFavorite ? this.post.collectCount - 1 : this.post.collectCount + 1 });
  5024. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  5025. eventBus.emit(CMD.MERGE, { isFavorite: !isFavorite });
  5026. return;
  5027. }
  5028. }
  5029. eventBus.emit(CMD.REFRESH_ONCE);
  5030. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败" });
  5031. }
  5032. }
  5033. };
  5034. const _withScopeId$5 = (n2) => (vue.pushScopeId("data-v-30dac564"), n2 = n2(), vue.popScopeId(), n2);
  5035. const _hoisted_1$8 = { class: "toolbar" };
  5036. const _hoisted_2$5 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  5037. const _hoisted_3$5 = {
  5038. key: 0,
  5039. class: "tool no-hover"
  5040. };
  5041. const _hoisted_4$5 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "Tweet", -1));
  5042. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  5043. const _component_Icon = vue.resolveComponent("Icon");
  5044. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  5045. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
  5046. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  5047. vue.createElementVNode("div", {
  5048. class: "tool",
  5049. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => $options.checkIsLogin("reply"), ["stop"]))
  5050. }, [
  5051. vue.createVNode(_component_Icon, { icon: "mynaui:message" }),
  5052. _hoisted_2$5
  5053. ]),
  5054. vue.createElementVNode("div", {
  5055. class: vue.normalizeClass(["tool", { disabled: $data.loading }]),
  5056. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.toggleFavorite && $options.toggleFavorite(...args), ["stop"]))
  5057. }, [
  5058. $data.loading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5059. key: 0,
  5060. size: "small"
  5061. })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  5062. $options.post.isFavorite ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  5063. key: 0,
  5064. color: "rgb(224,42,42)",
  5065. icon: "iconoir:star-solid"
  5066. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5067. key: 1,
  5068. icon: "iconoir:star"
  5069. }))
  5070. ], 64)),
  5071. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isFavorite ? "取消" : "") + "收藏", 1)
  5072. ], 2),
  5073. $options.post.collectCount !== 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$5, [
  5074. vue.createElementVNode("span", null, vue.toDisplayString($options.post.collectCount + "人收藏"), 1)
  5075. ])) : vue.createCommentVNode("", true),
  5076. vue.createElementVNode("div", {
  5077. class: "tool",
  5078. onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.tweet && $options.tweet(...args), ["stop"]))
  5079. }, [
  5080. vue.createVNode(_component_Icon, { icon: "uil:share" }),
  5081. _hoisted_4$5
  5082. ]),
  5083. vue.createElementVNode("div", {
  5084. class: vue.normalizeClass(["tool", { "disabled": $data.loading2 }]),
  5085. onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.toggleIgnore && $options.toggleIgnore(...args), ["stop"]))
  5086. }, [
  5087. $data.loading2 ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5088. key: 0,
  5089. size: "small"
  5090. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5091. key: 1,
  5092. icon: "fluent:eye-hide-24-regular"
  5093. })),
  5094. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isIgnore ? "取消忽略" : "忽略"), 1)
  5095. ], 2),
  5096. vue.createElementVNode("div", {
  5097. class: vue.normalizeClass(["tool", { "disabled": $data.loading3 }]),
  5098. onClick: _cache[4] || (_cache[4] = vue.withModifiers((...args) => $options.report && $options.report(...args), ["stop"]))
  5099. }, [
  5100. $data.loading3 ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5101. key: 0,
  5102. size: "small"
  5103. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5104. key: 1,
  5105. class: "black",
  5106. icon: "solar:danger-triangle-outline"
  5107. })),
  5108. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isReport ? "你已对本主题进行了报告" : "报告"), 1)
  5109. ], 2)
  5110. ]);
  5111. }
  5112. const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$3], ["__scopeId", "data-v-30dac564"]]);
  5113. const _withScopeId$4 = (n2) => (vue.pushScopeId("data-v-4a063111"), n2 = n2(), vue.popScopeId(), n2);
  5114. const _hoisted_1$7 = ["href"];
  5115. const _hoisted_2$4 = ["src"];
  5116. const _hoisted_3$4 = { class: "texts" };
  5117. const _hoisted_4$4 = {
  5118. key: 0,
  5119. class: "point"
  5120. };
  5121. const _hoisted_5$4 = { class: "link-num" };
  5122. const _hoisted_6$4 = { class: "my-tag" };
  5123. const _hoisted_7$3 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5124. const _hoisted_8$3 = {
  5125. key: 2,
  5126. class: "ago"
  5127. };
  5128. const _hoisted_9$3 = {
  5129. key: 3,
  5130. class: "mod"
  5131. };
  5132. const _hoisted_10$3 = {
  5133. key: 4,
  5134. class: "owner"
  5135. };
  5136. const _hoisted_11$3 = ["href"];
  5137. const _hoisted_12$3 = {
  5138. key: 5,
  5139. class: "owner"
  5140. };
  5141. const _hoisted_13$3 = {
  5142. key: 6,
  5143. class: "mod"
  5144. };
  5145. const _hoisted_14$2 = {
  5146. key: 7,
  5147. class: "ago"
  5148. };
  5149. const _hoisted_15$2 = { class: "my-tag" };
  5150. const _hoisted_16$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5151. const _hoisted_17$2 = {
  5152. key: 9,
  5153. class: "point"
  5154. };
  5155. const _hoisted_18$2 = { class: "link-num" };
  5156. const _hoisted_19$2 = ["href"];
  5157. const _hoisted_20$2 = ["src"];
  5158. const _hoisted_21$2 = { class: "Author-right" };
  5159. const _hoisted_22$2 = { class: "floor" };
  5160. const _hoisted_23$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  5161. const _hoisted_24$1 = [
  5162. _hoisted_23$2
  5163. ];
  5164. const _sfc_main$7 = {
  5165. __name: "SingleComment",
  5166. props: {
  5167. comment: {
  5168. reply_content: ""
  5169. },
  5170. isRight: {
  5171. type: Boolean,
  5172. default() {
  5173. return false;
  5174. }
  5175. }
  5176. },
  5177. setup(__props) {
  5178. const config2 = vue.inject("config");
  5179. const isLogin = vue.inject("isLogin");
  5180. const tags = vue.inject("tags");
  5181. const props = __props;
  5182. const myTags = vue.computed(() => {
  5183. return tags[props.comment.username] ?? [];
  5184. });
  5185. function jump() {
  5186. eventBus.emit(CMD.JUMP, props.comment.floor);
  5187. }
  5188. return (_ctx, _cache) => {
  5189. return vue.openBlock(), vue.createElementBlock("div", {
  5190. class: vue.normalizeClass(["comment", { isSimple: vue.unref(config2).viewType === "simple" }]),
  5191. ref: "comment"
  5192. }, [
  5193. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  5194. key: 0,
  5195. class: "avatar",
  5196. href: `/member/${__props.comment.username}`
  5197. }, [
  5198. vue.createElementVNode("img", {
  5199. src: __props.comment.avatar,
  5200. alt: ""
  5201. }, null, 8, _hoisted_2$4)
  5202. ], 8, _hoisted_1$7)) : vue.createCommentVNode("", true),
  5203. vue.createElementVNode("div", {
  5204. class: vue.normalizeClass(["comment-body", { isRight: __props.isRight }])
  5205. }, [
  5206. vue.createElementVNode("div", _hoisted_3$4, [
  5207. __props.comment.thankCount && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [
  5208. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5209. key: 0,
  5210. color: "rgb(224,42,42)",
  5211. icon: "icon-park-solid:like"
  5212. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5213. key: 1,
  5214. color: !__props.comment.thankCount ? null : "rgb(224,42,42)",
  5215. icon: "icon-park-outline:like"
  5216. }, null, 8, ["color"])),
  5217. vue.createElementVNode("div", _hoisted_5$4, vue.toDisplayString(__props.comment.thankCount), 1)
  5218. ])) : vue.createCommentVNode("", true),
  5219. vue.unref(isLogin) && vue.unref(config2).openTag && __props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(myTags.value, (i) => {
  5220. return vue.openBlock(), vue.createElementBlock("span", _hoisted_6$4, [
  5221. _hoisted_7$3,
  5222. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  5223. ]);
  5224. }), 256)) : vue.createCommentVNode("", true),
  5225. __props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$3, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  5226. __props.comment.isMod && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$3, "MOD")) : vue.createCommentVNode("", true),
  5227. __props.comment.isOp && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$3, "OP")) : vue.createCommentVNode("", true),
  5228. vue.createElementVNode("a", {
  5229. href: `/member/${__props.comment.username}`,
  5230. class: "username"
  5231. }, vue.toDisplayString(__props.comment.username), 9, _hoisted_11$3),
  5232. __props.comment.isOp && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$3, "OP")) : vue.createCommentVNode("", true),
  5233. __props.comment.isMod && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$3, "MOD")) : vue.createCommentVNode("", true),
  5234. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_14$2, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  5235. vue.unref(isLogin) && vue.unref(config2).openTag && !__props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 8 }, vue.renderList(myTags.value, (i) => {
  5236. return vue.openBlock(), vue.createElementBlock("span", _hoisted_15$2, [
  5237. _hoisted_16$2,
  5238. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  5239. ]);
  5240. }), 256)) : vue.createCommentVNode("", true),
  5241. __props.comment.thankCount && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$2, [
  5242. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5243. key: 0,
  5244. color: "rgb(224,42,42)",
  5245. icon: "icon-park-solid:like"
  5246. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5247. key: 1,
  5248. color: !__props.comment.thankCount ? null : "rgb(224,42,42)",
  5249. icon: "icon-park-outline:like"
  5250. }, null, 8, ["color"])),
  5251. vue.createElementVNode("div", _hoisted_18$2, vue.toDisplayString(__props.comment.thankCount), 1)
  5252. ])) : vue.createCommentVNode("", true)
  5253. ]),
  5254. vue.createVNode(BaseHtmlRender, {
  5255. class: "reply_content",
  5256. html: __props.comment.reply_content
  5257. }, null, 8, ["html"])
  5258. ], 2),
  5259. __props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  5260. key: 1,
  5261. class: "avatar",
  5262. href: `/member/${__props.comment.username}`
  5263. }, [
  5264. vue.createElementVNode("img", {
  5265. src: __props.comment.avatar,
  5266. alt: ""
  5267. }, null, 8, _hoisted_20$2)
  5268. ], 8, _hoisted_19$2)) : vue.createCommentVNode("", true),
  5269. vue.createElementVNode("div", _hoisted_21$2, [
  5270. vue.createElementVNode("div", _hoisted_22$2, vue.toDisplayString(__props.comment.floor), 1),
  5271. vue.createElementVNode("div", {
  5272. class: "tool jump",
  5273. onClick: vue.withModifiers(jump, ["stop"])
  5274. }, _hoisted_24$1)
  5275. ])
  5276. ], 2);
  5277. };
  5278. }
  5279. };
  5280. const SingleComment = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-4a063111"]]);
  5281. function _css(el, key, value) {
  5282. const reg = /^-?\d+.?\d*(px|pt|em|rem|vw|vh|%|rpx|ms)$/i;
  5283. if (value === void 0) {
  5284. let val = null;
  5285. if ("getComputedStyle" in window) {
  5286. val = window.getComputedStyle(el, null)[key];
  5287. } else {
  5288. val = el.currentStyle[key];
  5289. }
  5290. return reg.test(val) ? parseFloat(val) : val;
  5291. } else {
  5292. if ([
  5293. "top",
  5294. "left",
  5295. "bottom",
  5296. "right",
  5297. "width",
  5298. "height",
  5299. "font-size",
  5300. "margin",
  5301. "padding"
  5302. ].includes(key)) {
  5303. if (!reg.test(value)) {
  5304. if (!String(value).includes("calc")) {
  5305. value += "px";
  5306. }
  5307. }
  5308. }
  5309. if (key === "transform") {
  5310. el.style.webkitTransform = el.style.MsTransform = el.style.msTransform = el.style.MozTransform = el.style.OTransform = el.style.transform = value;
  5311. } else {
  5312. el.style[key] = value;
  5313. }
  5314. }
  5315. }
  5316. function getImgSize(naturalWidth, naturalHeight, maxWidth, maxHeight) {
  5317. const imgRatio = naturalWidth / naturalHeight;
  5318. const maxRatio = maxWidth / maxHeight;
  5319. let width, height;
  5320. if (imgRatio >= maxRatio) {
  5321. if (naturalWidth > maxWidth) {
  5322. width = maxWidth;
  5323. height = maxWidth / naturalWidth * naturalHeight;
  5324. } else {
  5325. width = naturalWidth;
  5326. height = naturalHeight;
  5327. }
  5328. } else {
  5329. if (naturalHeight > maxHeight) {
  5330. width = maxHeight / naturalHeight * naturalWidth;
  5331. height = maxHeight;
  5332. } else {
  5333. width = naturalWidth;
  5334. height = naturalHeight;
  5335. }
  5336. }
  5337. if (height === 0) {
  5338. height = maxHeight;
  5339. width = height * 1.3;
  5340. } else {
  5341. if (height < 24) {
  5342. height = 50;
  5343. width = height * imgRatio;
  5344. } else if (height < 100) {
  5345. height = 300;
  5346. width = height * imgRatio;
  5347. } else {
  5348. height = maxHeight;
  5349. width = height * imgRatio;
  5350. }
  5351. if (width > maxWidth) {
  5352. width = maxWidth;
  5353. height = width / imgRatio;
  5354. }
  5355. }
  5356. console.log(width, height);
  5357. return { width, height };
  5358. }
  5359. const _sfc_main$6 = {
  5360. name: "detail",
  5361. components: {
  5362. BaseSelect,
  5363. BaseButton,
  5364. SingleComment,
  5365. PopConfirm,
  5366. Comment,
  5367. PostEditor,
  5368. Point,
  5369. Toolbar,
  5370. BaseHtmlRender,
  5371. Tooltip,
  5372. BaseLoading,
  5373. Icon
  5374. },
  5375. inject: ["allReplyUsers", "post", "tags", "isLogin", "config", "pageType", "isNight"],
  5376. provide() {
  5377. return {
  5378. postDetailWidth: vue.computed(() => this.postDetailWidth)
  5379. };
  5380. },
  5381. props: {
  5382. modelValue: {
  5383. type: Boolean,
  5384. default() {
  5385. return false;
  5386. }
  5387. },
  5388. loading: {
  5389. type: Boolean,
  5390. default() {
  5391. return false;
  5392. }
  5393. },
  5394. refreshLoading: {
  5395. type: Boolean,
  5396. default() {
  5397. return false;
  5398. }
  5399. },
  5400. displayType: CommentDisplayType.FloorInFloorNoCallUser
  5401. },
  5402. data() {
  5403. return {
  5404. isSticky: false,
  5405. selectCallIndex: 0,
  5406. postDetailWidth: 0,
  5407. showCallList: false,
  5408. showRelationReply: false,
  5409. replyText: "",
  5410. callStyle: {
  5411. top: 0,
  5412. left: 0
  5413. },
  5414. targetUser: {
  5415. left: [],
  5416. right: "",
  5417. rightFloor: -1
  5418. },
  5419. currentFloor: "",
  5420. showOpTag: false,
  5421. rect: {},
  5422. r###lt: {},
  5423. x: 0,
  5424. y: 0,
  5425. scale: 1,
  5426. minScale: 0.2,
  5427. maxScale: 16,
  5428. preview: {
  5429. rect: {},
  5430. r###lt: {},
  5431. x: 0,
  5432. y: 0,
  5433. scale: 1,
  5434. minScale: 0.2,
  5435. maxScale: 16
  5436. }
  5437. };
  5438. },
  5439. computed: {
  5440. functions() {
  5441. return functions;
  5442. },
  5443. canAppend() {
  5444. if (this.isMy) {
  5445. let create = new Date(this.post.createDate);
  5446. return Date.now() - create.valueOf() > 1e3 * 60 * 30;
  5447. }
  5448. return false;
  5449. },
  5450. canEditMove() {
  5451. if (this.isMy) {
  5452. let create = new Date(this.post.createDate);
  5453. return Date.now() - create.valueOf() < 1e3 * 60 * 10;
  5454. }
  5455. return false;
  5456. },
  5457. isMy() {
  5458. return this.post.member.username === window.user.username;
  5459. },
  5460. myTags() {
  5461. return this.tags[this.post.member.username] ?? [];
  5462. },
  5463. CommentDisplayType() {
  5464. return CommentDisplayType;
  5465. },
  5466. isPost() {
  5467. return this.pageType === PageType.Post;
  5468. },
  5469. filterCallList() {
  5470. if (this.showCallList) {
  5471. let list = ["管理员", "所有人"].concat(this.allReplyUsers);
  5472. if (this.replyText)
  5473. return list.filter((i) => i.search(this.replyText) > -1);
  5474. return list;
  5475. }
  5476. return [];
  5477. },
  5478. replyList() {
  5479. if ([CommentDisplayType.FloorInFloor, CommentDisplayType.FloorInFloorNoCallUser].includes(this.displayType))
  5480. return this.post.nestedReplies;
  5481. if (this.displayType === CommentDisplayType.Like) {
  5482. return functions.clone(this.post.nestedReplies).sort((a, b) => b.thankCount - a.thankCount);
  5483. }
  5484. if (this.displayType === CommentDisplayType.New) {
  5485. return functions.clone(this.post.replyList).reverse();
  5486. }
  5487. if (this.displayType === CommentDisplayType.V2exOrigin)
  5488. return this.post.replyList;
  5489. if (this.displayType === CommentDisplayType.FloorInFloorNested)
  5490. return this.post.nestedRedundReplies;
  5491. if (this.displayType === CommentDisplayType.OnlyOp)
  5492. return this.post.replyList.filter((v) => {
  5493. var _a;
  5494. return v.username === ((_a = this.post.member) == null ? void 0 : _a.username);
  5495. });
  5496. return [];
  5497. },
  5498. //关联回复
  5499. relationReply() {
  5500. if (this.targetUser.left.length && this.targetUser.right) {
  5501. return this.post.replyList.filter((v) => {
  5502. if (this.targetUser.left.concat(this.targetUser.right).includes(v.username)) {
  5503. if (v.floor > this.targetUser.rightFloor) {
  5504. if (v.replyUsers.includes(this.targetUser.right)) {
  5505. return true;
  5506. }
  5507. if (v.username === this.targetUser.right) {
  5508. for (let i = 0; i < this.targetUser.left.length; i++) {
  5509. if (v.replyUsers.includes(this.targetUser.left[i])) {
  5510. return true;
  5511. }
  5512. }
  5513. }
  5514. } else {
  5515. return true;
  5516. }
  5517. }
  5518. return false;
  5519. });
  5520. }
  5521. return [];
  5522. }
  5523. },
  5524. watch: {
  5525. "post.id"(n2, o) {
  5526. if (this.$refs["post-editor"]) {
  5527. this.$refs["post-editor"].content = "";
  5528. vue.nextTick(() => {
  5529. var _a, _b;
  5530. (_b = (_a = this.$refs) == null ? void 0 : _a.detail) == null ? void 0 : _b.scrollTo({ top: 0 });
  5531. });
  5532. }
  5533. },
  5534. "post.headerTemplate"(n2, o) {
  5535. let mountEl = document.querySelector(".main-wrapper .post-wrapper .html-wrapper .header");
  5536. if (mountEl) {
  5537. this.showOpTag = true;
  5538. }
  5539. },
  5540. modelValue: {
  5541. handler(newVal) {
  5542. if (this.isPost)
  5543. return;
  5544. if (newVal) {
  5545. this.currentFloor = "";
  5546. vue.nextTick(() => {
  5547. var _a, _b;
  5548. (_b = (_a = this.$refs) == null ? void 0 : _a.main) == null ? void 0 : _b.focus();
  5549. });
  5550. } else {
  5551. this.isSticky = false;
  5552. this.showRelationReply = false;
  5553. }
  5554. }
  5555. }
  5556. },
  5557. mounted() {
  5558. vue.nextTick(() => {
  5559. setTimeout(() => {
  5560. var _a;
  5561. this.postDetailWidth = ((_a = this.$refs.mainWrapper) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
  5562. }, 500);
  5563. });
  5564. if (this.isLogin) {
  5565. const observer = new IntersectionObserver(
  5566. ([e2]) => e2.target.toggleAttribute("stuck", e2.intersectionRatio < 1),
  5567. { threshold: [1] }
  5568. );
  5569. observer.observe(this.$refs.replyBox);
  5570. window.addEventListener("keydown", this.onKeyDown);
  5571. }
  5572. eventBus.on(CMD.SHOW_CALL, (val) => {
  5573. if (val.show) {
  5574. this.showCallList = true;
  5575. this.replyText = val.text;
  5576. if (this.isPost) {
  5577. this.callStyle.top = val.top + $(window).scrollTop() + -40 + "px";
  5578. } else {
  5579. this.callStyle.top = val.top + $(".post-detail").scrollTop() + 15 + "px";
  5580. }
  5581. this.callStyle.left = val.left - $(".main")[0].getBoundingClientRect().left + 10 + "px";
  5582. if (this.selectCallIndex >= this.filterCallList.length) {
  5583. this.selectCallIndex = 0;
  5584. }
  5585. } else {
  5586. this.replyText = "";
  5587. this.showCallList = false;
  5588. this.selectCallIndex = 0;
  5589. }
  5590. });
  5591. eventBus.on(CMD.RELATION_REPLY, (val) => {
  5592. this.targetUser = val;
  5593. this.showRelationReply = true;
  5594. });
  5595. eventBus.on(CMD.JUMP, this.jump);
  5596. },
  5597. beforeUnmount() {
  5598. window.removeEventListener("keydown", this.onKeyDown);
  5599. eventBus.off(CMD.SHOW_CALL);
  5600. },
  5601. methods: {
  5602. addTag() {
  5603. eventBus.emit(CMD.ADD_TAG, this.post.member.username);
  5604. },
  5605. removeTag(tag) {
  5606. eventBus.emit(CMD.REMOVE_TAG, { username: this.post.member.username, tag });
  5607. },
  5608. closePreviewModal() {
  5609. let previewModal = document.querySelector(".preview-modal");
  5610. let s = document.querySelector(".shadow");
  5611. let domRect = this.preview.rect;
  5612. _css(s, "transition", "all 0.3s");
  5613. _css(s, "width", domRect.width);
  5614. _css(s, "height", domRect.height);
  5615. _css(s, "transform", `translate3d(${domRect.x}px, ${domRect.y}px, 0) scale(1)`);
  5616. let mask = document.querySelector(".preview-modal .mask");
  5617. _css(mask, "opacity", 0);
  5618. setTimeout(() => {
  5619. _css(s, "transition", "all 0s");
  5620. s.remove();
  5621. _css(previewModal, "top", "-1000vh");
  5622. _css(document.body, "overflow", "auto");
  5623. }, 300);
  5624. },
  5625. stop(e2) {
  5626. e2.stopPropagation();
  5627. e2.stopImmediatePropagation();
  5628. if (e2.target.tagName === "IMG") {
  5629. console.log("e", e2.target.src);
  5630. if (/cdn\.v2ex\.com.*avatar/i.test(e2.target.src)) {
  5631. console.log("t");
  5632. }
  5633. this.preview = {
  5634. rect: {},
  5635. r###lt: {},
  5636. x: 0,
  5637. y: 0,
  5638. scale: 1,
  5639. minScale: 0.2,
  5640. maxScale: 16
  5641. };
  5642. e2.preventDefault();
  5643. let domRect = e2.target.getBoundingClientRect();
  5644. let previewModal = document.querySelector(".preview-modal");
  5645. _css(previewModal, "top", "0");
  5646. let s = e2.target.cloneNode();
  5647. s.classList.add("shadow");
  5648. previewModal.append(s);
  5649. _css(s, "transition", "all 0s");
  5650. _css(s, "width", domRect.width);
  5651. _css(s, "height", domRect.height);
  5652. _css(s, "transform", `translate3d(${domRect.x}px, ${domRect.y}px, 0) scale(1)`);
  5653. let t = ".3";
  5654. let sw = domRect.width / window.innerWidth;
  5655. let sh = domRect.height / window.innerHeight;
  5656. domRect.sw = sw;
  5657. domRect.sh = sh;
  5658. this.preview.rect = domRect;
  5659. this.preview.r###lt = getImgSize(
  5660. s.naturalWidth,
  5661. s.naturalHeight,
  5662. window.innerWidth * 0.95,
  5663. window.innerHeight * 0.9
  5664. );
  5665. this.preview.x = (window.innerWidth - this.preview.r###lt.width) * 0.5;
  5666. this.preview.y = (window.innerHeight - this.preview.r###lt.height) * 0.5;
  5667. let isPointerdown = false;
  5668. let isMove = false;
  5669. let lastPointermove = { x: 0, y: 0 };
  5670. let diff = { x: 0, y: 0 };
  5671. s.addEventListener("pointerdown", function(e3) {
  5672. isPointerdown = true;
  5673. isMove = false;
  5674. s.setPointerCapture(e3.pointerId);
  5675. lastPointermove = { x: e3.clientX, y: e3.clientY };
  5676. });
  5677. s.addEventListener("pointermove", (e3) => {
  5678. if (isPointerdown) {
  5679. isMove = true;
  5680. const current = { x: e3.clientX, y: e3.clientY };
  5681. diff.x = current.x - lastPointermove.x;
  5682. diff.y = current.y - lastPointermove.y;
  5683. lastPointermove = { x: current.x, y: current.y };
  5684. this.preview.x += diff.x;
  5685. this.preview.y += diff.y;
  5686. _css(s, "transition", "all 0.1s");
  5687. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5688. }
  5689. e3.preventDefault();
  5690. });
  5691. s.addEventListener("pointerup", () => {
  5692. if (isPointerdown) {
  5693. isPointerdown = false;
  5694. if (!isMove) {
  5695. this.closePreviewModal();
  5696. }
  5697. }
  5698. });
  5699. s.addEventListener("pointercancel", function(e3) {
  5700. if (isPointerdown) {
  5701. isPointerdown = false;
  5702. }
  5703. });
  5704. let mask = document.querySelector(".preview-modal .mask");
  5705. _css(mask, "transition", "all 0s");
  5706. _css(mask, "opacity", 0);
  5707. setTimeout(() => {
  5708. _css(s, "transition", `all ${t}s`);
  5709. _css(mask, "transition", `all ${t}s`);
  5710. _css(mask, "opacity", 1);
  5711. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5712. _css(s, "width", this.preview.r###lt.width);
  5713. _css(s, "height", this.preview.r###lt.height);
  5714. }, 0);
  5715. setTimeout(() => {
  5716. _css(document.body, "overflow", "hidden");
  5717. }, 300);
  5718. return false;
  5719. }
  5720. },
  5721. wheel(e2) {
  5722. let d2 = e2.deltaY < 0 ? 0.1 : -0.1;
  5723. let ratio = 1 + d2;
  5724. let _scale = this.preview.scale * ratio;
  5725. if (_scale > this.preview.maxScale) {
  5726. ratio = this.preview.maxScale / this.preview.scale;
  5727. this.preview.scale = this.preview.maxScale;
  5728. } else if (_scale < this.preview.minScale) {
  5729. ratio = this.preview.minScale / this.preview.scale;
  5730. this.preview.scale = this.preview.minScale;
  5731. } else {
  5732. this.preview.scale = _scale;
  5733. }
  5734. if (e2.target.tagName === "IMG") {
  5735. const origin = {
  5736. x: d2 * this.preview.r###lt.width / 2,
  5737. y: d2 * this.preview.r###lt.height / 2
  5738. };
  5739. this.preview.x -= d2 * (e2.clientX - this.preview.x) - origin.x;
  5740. this.preview.y -= d2 * (e2.clientY - this.preview.y) - origin.y;
  5741. }
  5742. let s = document.querySelector(".shadow");
  5743. _css(s, "transition", "all 0.2s");
  5744. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5745. e2.preventDefault();
  5746. },
  5747. jump(floor) {
  5748. let lastItem = this.replyList[this.replyList.length - 1];
  5749. if (floor === "") {
  5750. floor = lastItem.floor;
  5751. } else {
  5752. try {
  5753. floor = Number(floor);
  5754. } catch (e2) {
  5755. floor = lastItem.floor;
  5756. }
  5757. if (floor === 0) {
  5758. floor = 1;
  5759. }
  5760. if (floor > lastItem.floor)
  5761. floor = lastItem.floor;
  5762. }
  5763. if (!this.post.replyList.length) {
  5764. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "没有回复可跳转!" });
  5765. return;
  5766. }
  5767. if (floor > this.post.replyList.length) {
  5768. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5769. return;
  5770. }
  5771. let comment = $(`.c_${floor}`);
  5772. if (!comment.length) {
  5773. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5774. return;
  5775. }
  5776. comment[0].scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
  5777. comment.addClass("ding");
  5778. this.currentFloor = floor + 1;
  5779. setTimeout(() => {
  5780. comment.removeClass("ding");
  5781. }, 2e3);
  5782. },
  5783. collapseTopReplyList() {
  5784. $(this.$refs.topReply).slideToggle("fast");
  5785. },
  5786. goBottom() {
  5787. this.isSticky = false;
  5788. setTimeout(() => {
  5789. if (this.isPost) {
  5790. let body = $("body , html");
  5791. let scrollHeight = body.prop("scrollHeight");
  5792. body.animate({ scrollTop: scrollHeight - 850 }, 300);
  5793. } else {
  5794. this.$refs.detail.scrollTo({ top: this.$refs.detail.scrollHeight, behavior: "smooth" });
  5795. }
  5796. });
  5797. },
  5798. close(from) {
  5799. if (this.isPost)
  5800. return;
  5801. if (from === "space") {
  5802. if (this.config.closePostDetailBySpace) {
  5803. this.$emit("update:modelValue", false);
  5804. }
  5805. } else {
  5806. this.$emit("update:modelValue", false);
  5807. }
  5808. },
  5809. setCall(e2) {
  5810. eventBus.emit(CMD.SET_CALL, e2);
  5811. this.showCallList = false;
  5812. },
  5813. onKeyDown(e2) {
  5814. if (!this.modelValue)
  5815. return;
  5816. if (!this.showCallList)
  5817. return;
  5818. let length = this.filterCallList.slice(0, 10).length;
  5819. if (e2.keyCode === 13) {
  5820. this.setCall(this.filterCallList[this.selectCallIndex]);
  5821. e2.preventDefault();
  5822. }
  5823. if (e2.keyCode === 38) {
  5824. this.selectCallIndex--;
  5825. if (this.selectCallIndex < 0) {
  5826. this.selectCallIndex = length - 1;
  5827. }
  5828. e2.preventDefault();
  5829. }
  5830. if (e2.keyCode === 40) {
  5831. this.selectCallIndex++;
  5832. if (this.selectCallIndex > length - 1) {
  5833. this.selectCallIndex = 0;
  5834. }
  5835. e2.preventDefault();
  5836. }
  5837. },
  5838. changeOption(item) {
  5839. this.$emit("update:displayType", item);
  5840. },
  5841. addThank() {
  5842. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "add" });
  5843. },
  5844. recallThank() {
  5845. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "recall" });
  5846. },
  5847. scrollTop() {
  5848. if (this.isPost) {
  5849. $("body , html").animate({ scrollTop: 0 }, 300);
  5850. } else {
  5851. this.$refs.detail.scrollTo({ top: 0, behavior: "smooth" });
  5852. }
  5853. }
  5854. }
  5855. };
  5856. const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-ea75dfbf"), n2 = n2(), vue.popScopeId(), n2);
  5857. const _hoisted_1$6 = { class: "my-box post-wrapper" };
  5858. const _hoisted_2$3 = { class: "header" };
  5859. const _hoisted_3$3 = { class: "fr" };
  5860. const _hoisted_4$3 = ["href"];
  5861. const _hoisted_5$3 = ["src", "alt"];
  5862. const _hoisted_6$3 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("a", { href: "/packages/pcckages/pc/public" }, "V2EX", -1));
  5863. const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "chevron" }, "  ›  ", -1));
  5864. const _hoisted_8$2 = ["href"];
  5865. const _hoisted_9$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep10" }, null, -1));
  5866. const _hoisted_10$2 = ["id"];
  5867. const _hoisted_11$2 = ["onclick"];
  5868. const _hoisted_12$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-chevron-up" }, null, -1));
  5869. const _hoisted_13$2 = ["onclick"];
  5870. const _hoisted_14$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-chevron-down" }, null, -1));
  5871. const _hoisted_15$1 = [
  5872. _hoisted_14$1
  5873. ];
  5874. const _hoisted_16$1 = { class: "gray" };
  5875. const _hoisted_17$1 = ["href"];
  5876. const _hoisted_18$1 = ["title"];
  5877. const _hoisted_19$1 = ["href"];
  5878. const _hoisted_20$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-info-circle" }, null, -1));
  5879. const _hoisted_21$1 = [
  5880. _hoisted_20$1
  5881. ];
  5882. const _hoisted_22$1 = ["href"];
  5883. const _hoisted_23$1 = ["href"];
  5884. const _hoisted_24 = ["href"];
  5885. const _hoisted_25 = { class: "my-tag" };
  5886. const _hoisted_26 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5887. const _hoisted_27 = ["onClick"];
  5888. const _hoisted_28 = {
  5889. key: 0,
  5890. class: "my-box"
  5891. };
  5892. const _hoisted_29 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "高赞回复", -1));
  5893. const _hoisted_30 = { class: "top-reply" };
  5894. const _hoisted_31 = { class: "tool" };
  5895. const _hoisted_32 = { ref: "topReply" };
  5896. const _hoisted_33 = { class: "my-box comment-wrapper" };
  5897. const _hoisted_34 = {
  5898. key: 0,
  5899. class: "my-cell flex"
  5900. };
  5901. const _hoisted_35 = { key: 0 };
  5902. const _hoisted_36 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("strong", { class: "snow" }, "•", -1));
  5903. const _hoisted_37 = ["innerHTML"];
  5904. const _hoisted_38 = {
  5905. key: 0,
  5906. class: "loading-wrapper"
  5907. };
  5908. const _hoisted_39 = {
  5909. key: 1,
  5910. class: "comments"
  5911. };
  5912. const _hoisted_40 = {
  5913. key: 1,
  5914. id: "no-comments-yet"
  5915. };
  5916. const _hoisted_41 = { class: "my-cell flex" };
  5917. const _hoisted_42 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "添加一条新回复", -1));
  5918. const _hoisted_43 = { class: "notice-right gray" };
  5919. const _hoisted_44 = { class: "p1" };
  5920. const _hoisted_45 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "gray" }, "上下文", -1));
  5921. const _hoisted_46 = { class: "top-reply" };
  5922. const _hoisted_47 = ["onClick"];
  5923. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  5924. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  5925. const _component_Point = vue.resolveComponent("Point");
  5926. const _component_Toolbar = vue.resolveComponent("Toolbar");
  5927. const _component_Icon = vue.resolveComponent("Icon");
  5928. const _component_Tooltip = vue.resolveComponent("Tooltip");
  5929. const _component_Comment = vue.resolveComponent("Comment");
  5930. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  5931. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  5932. const _component_PostEditor = vue.resolveComponent("PostEditor");
  5933. const _component_SingleComment = vue.resolveComponent("SingleComment");
  5934. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  5935. class: vue.normalizeClass(["post-detail", [$options.isNight ? "isNight" : "", $options.pageType]]),
  5936. ref: "detail",
  5937. onKeydown: _cache[22] || (_cache[22] = vue.withKeys(($event) => $options.close(), ["esc"])),
  5938. onClick: _cache[23] || (_cache[23] = ($event) => $options.close("space"))
  5939. }, [
  5940. vue.createElementVNode("div", {
  5941. ref: "main",
  5942. class: "main",
  5943. tabindex: "1",
  5944. onClick: _cache[19] || (_cache[19] = (...args) => $options.stop && $options.stop(...args))
  5945. }, [
  5946. vue.createElementVNode("div", {
  5947. class: "main-wrapper",
  5948. ref: "mainWrapper",
  5949. style: vue.normalizeStyle({ width: $options.config.postWidth + "!important" })
  5950. }, [
  5951. vue.createElementVNode("div", _hoisted_1$6, [
  5952. vue.createElementVNode("div", _hoisted_2$3, [
  5953. vue.createElementVNode("div", _hoisted_3$3, [
  5954. vue.createElementVNode("a", {
  5955. href: `/member/${$options.post.member.username}`,
  5956. style: { "width": "73px", "height": "73px", "display": "inline-block" }
  5957. }, [
  5958. $options.post.member.avatar_large ? (vue.openBlock(), vue.createElementBlock("img", {
  5959. key: 0,
  5960. src: $options.post.member.avatar_large,
  5961. class: "avatar",
  5962. style: { "width": "73px", "height": "73px" },
  5963. border: "0",
  5964. align: "default",
  5965. alt: $options.post.member.username
  5966. }, null, 8, _hoisted_5$3)) : vue.createCommentVNode("", true)
  5967. ], 8, _hoisted_4$3)
  5968. ]),
  5969. _hoisted_6$3,
  5970. _hoisted_7$2,
  5971. vue.createElementVNode("a", {
  5972. href: $options.post.node.url
  5973. }, vue.toDisplayString($options.post.node.title), 9, _hoisted_8$2),
  5974. _hoisted_9$2,
  5975. vue.createElementVNode("h1", null, vue.toDisplayString($options.post.title), 1),
  5976. vue.createElementVNode("div", {
  5977. id: `topic_${$options.post.id}_votes`,
  5978. class: "votes"
  5979. }, [
  5980. vue.createElementVNode("a", {
  5981. href: "javascript:",
  5982. onclick: `upVoteTopic(${$options.post.id});`,
  5983. class: "vote"
  5984. }, [
  5985. _hoisted_12$2,
  5986. vue.createTextVNode("   ")
  5987. ], 8, _hoisted_11$2),
  5988. vue.createTextVNode("   "),
  5989. vue.createElementVNode("a", {
  5990. href: "javascript:",
  5991. onclick: `downVoteTopic(${$options.post.id});`,
  5992. class: "vote"
  5993. }, _hoisted_15$1, 8, _hoisted_13$2)
  5994. ], 8, _hoisted_10$2),
  5995. vue.createTextVNode("   "),
  5996. vue.createElementVNode("small", _hoisted_16$1, [
  5997. vue.createElementVNode("a", {
  5998. href: `/member/${$options.post.member.username}`
  5999. }, vue.toDisplayString($options.post.member.username), 9, _hoisted_17$1),
  6000. vue.createTextVNode(" · "),
  6001. $options.post.member.createDate ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6002. vue.createElementVNode("span", {
  6003. class: vue.normalizeClass($options.post.member.isNew && "danger")
  6004. }, vue.toDisplayString($options.post.member.createDate), 3),
  6005. vue.createTextVNode(" · ")
  6006. ], 64)) : vue.createCommentVNode("", true),
  6007. $options.post.createDateAgo ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6008. vue.createElementVNode("span", {
  6009. title: $options.post.createDate
  6010. }, vue.toDisplayString($options.post.createDateAgo), 9, _hoisted_18$1),
  6011. vue.createTextVNode(" · ")
  6012. ], 64)) : vue.createCommentVNode("", true),
  6013. vue.createTextVNode(" " + vue.toDisplayString($options.post.clickCount) + " 次点击 ", 1),
  6014. $options.isMy ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  6015. vue.createTextVNode("   "),
  6016. vue.createElementVNode("a", {
  6017. href: `/t/${$options.post.id}/info`
  6018. }, _hoisted_21$1, 8, _hoisted_19$1),
  6019. vue.createTextVNode("   "),
  6020. $options.canAppend ? (vue.openBlock(), vue.createElementBlock("a", {
  6021. key: 0,
  6022. href: `/append/topic/${$options.post.id}`,
  6023. class: "op"
  6024. }, "APPEND", 8, _hoisted_22$1)) : vue.createCommentVNode("", true),
  6025. $options.canEditMove ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6026. vue.createElementVNode("a", {
  6027. href: `/move/topic/${$options.post.id}`,
  6028. class: "op"
  6029. }, "MOVE", 8, _hoisted_23$1),
  6030. vue.createTextVNode("  "),
  6031. vue.createElementVNode("a", {
  6032. href: `/edit/topic/${$options.post.id}`,
  6033. class: "op"
  6034. }, "EDIT", 8, _hoisted_24)
  6035. ], 64)) : vue.createCommentVNode("", true)
  6036. ], 64)) : vue.createCommentVNode("", true)
  6037. ]),
  6038. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6039. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  6040. return vue.openBlock(), vue.createElementBlock("span", _hoisted_25, [
  6041. _hoisted_26,
  6042. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  6043. vue.createElementVNode("i", {
  6044. class: "fa fa-trash-o remove",
  6045. onClick: vue.withModifiers(($event) => $options.removeTag(i), ["stop"])
  6046. }, null, 8, _hoisted_27)
  6047. ]);
  6048. }), 256)),
  6049. vue.createElementVNode("span", {
  6050. class: "add-tag ago",
  6051. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.addTag && $options.addTag(...args), ["stop"])),
  6052. title: "添加标签"
  6053. }, "+")
  6054. ], 64)) : vue.createCommentVNode("", true)
  6055. ]),
  6056. $options.post.headerTemplate ? (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  6057. key: 0,
  6058. html: $options.post.headerTemplate
  6059. }, null, 8, ["html"])) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  6060. key: 1,
  6061. html: $options.post.jsonContent
  6062. }, null, 8, ["html"])),
  6063. vue.createVNode(_component_Toolbar, {
  6064. onReply: _cache[1] || (_cache[1] = ($event) => $data.isSticky = !$data.isSticky)
  6065. }, {
  6066. default: vue.withCtx(() => [
  6067. vue.createVNode(_component_Point, {
  6068. onAddThank: $options.addThank,
  6069. onRecallThank: $options.recallThank,
  6070. item: {
  6071. isThanked: $options.post.isThanked,
  6072. thankCount: $options.post.thankCount,
  6073. username: $options.post.username
  6074. },
  6075. "api-url": "topic/" + $options.post.id
  6076. }, null, 8, ["onAddThank", "onRecallThank", "item", "api-url"])
  6077. ]),
  6078. _: 1
  6079. })
  6080. ]),
  6081. $options.post.topReplyList.length && $options.config.showTopReply ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
  6082. vue.createElementVNode("div", {
  6083. class: "my-cell flex",
  6084. onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.collapseTopReplyList && $options.collapseTopReplyList(...args), ["stop"]))
  6085. }, [
  6086. _hoisted_29,
  6087. vue.createElementVNode("div", _hoisted_30, [
  6088. vue.createVNode(_component_Tooltip, { title: "收起高赞回复" }, {
  6089. default: vue.withCtx(() => [
  6090. vue.createElementVNode("div", _hoisted_31, [
  6091. vue.createVNode(_component_Icon, { icon: "gravity-ui:chevrons-collapse-vertical" })
  6092. ])
  6093. ]),
  6094. _: 1
  6095. })
  6096. ])
  6097. ]),
  6098. vue.createElementVNode("div", _hoisted_32, [
  6099. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.post.topReplyList, (item, index) => {
  6100. return vue.openBlock(), vue.createBlock(_component_Comment, {
  6101. key: item.floor,
  6102. type: "top",
  6103. modelValue: $options.post.topReplyList[index],
  6104. "onUpdate:modelValue": ($event) => $options.post.topReplyList[index] = $event
  6105. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  6106. }), 128))
  6107. ], 512)
  6108. ])) : vue.createCommentVNode("", true),
  6109. vue.createElementVNode("div", _hoisted_33, [
  6110. $options.post.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_34, [
  6111. vue.createElementVNode("div", null, [
  6112. vue.createTextVNode(vue.toDisplayString($options.post.replyCount) + " 条回复 ", 1),
  6113. $options.post.lastReplyDate ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_35, [
  6114. vue.createTextVNode("  "),
  6115. _hoisted_36,
  6116. vue.createTextVNode("  " + vue.toDisplayString($options.post.lastReplyDate), 1)
  6117. ])) : vue.createCommentVNode("", true)
  6118. ]),
  6119. $options.config.showToolbar ? (vue.openBlock(), vue.createBlock(_component_BaseSelect, {
  6120. key: 0,
  6121. "display-type": $props.displayType,
  6122. "onUpdate:displayType": _cache[3] || (_cache[3] = (e2) => _ctx.$emit("update:displayType", e2))
  6123. }, null, 8, ["display-type"])) : (vue.openBlock(), vue.createElementBlock("div", {
  6124. key: 1,
  6125. class: "fr",
  6126. innerHTML: $options.post.fr
  6127. }, null, 8, _hoisted_37))
  6128. ])) : vue.createCommentVNode("", true),
  6129. $options.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6130. $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_38, [
  6131. vue.createVNode(_component_BaseLoading, { size: "large" })
  6132. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, [
  6133. $props.modelValue ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($options.replyList, (item, index) => {
  6134. return vue.openBlock(), vue.createBlock(_component_Comment, {
  6135. key: item.floor,
  6136. modelValue: $options.replyList[index],
  6137. "onUpdate:modelValue": ($event) => $options.replyList[index] = $event
  6138. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  6139. }), 128)) : vue.createCommentVNode("", true)
  6140. ]))
  6141. ], 64)) : vue.createCommentVNode("", true)
  6142. ]),
  6143. !($options.replyList.length || $props.loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_40, "目前尚无回复")) : vue.createCommentVNode("", true),
  6144. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  6145. key: 2,
  6146. class: vue.normalizeClass(["my-box", { "sticky": $data.isSticky }]),
  6147. ref: "replyBox"
  6148. }, [
  6149. vue.createElementVNode("div", _hoisted_41, [
  6150. _hoisted_42,
  6151. vue.createElementVNode("div", _hoisted_43, [
  6152. $data.isSticky ? (vue.openBlock(), vue.createElementBlock("a", {
  6153. key: 0,
  6154. style: { "margin-right": "2rem" },
  6155. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => $data.isSticky = false, ["stop"]))
  6156. }, "取消回复框停靠")) : vue.createCommentVNode("", true),
  6157. vue.createElementVNode("a", {
  6158. onClick: _cache[5] || (_cache[5] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  6159. }, "回到顶部")
  6160. ])
  6161. ]),
  6162. vue.createElementVNode("div", _hoisted_44, [
  6163. vue.createVNode(_component_PostEditor, {
  6164. onClose: $options.goBottom,
  6165. ref: "post-editor",
  6166. useType: "reply-post",
  6167. onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => $data.isSticky = true, ["stop"]))
  6168. }, null, 8, ["onClose"])
  6169. ])
  6170. ], 2)) : vue.createCommentVNode("", true)
  6171. ], 4),
  6172. $data.showRelationReply ? (vue.openBlock(), vue.createElementBlock("div", {
  6173. key: 0,
  6174. class: "relationReply",
  6175. onClick: _cache[10] || (_cache[10] = vue.withModifiers(($event) => $options.close("space"), ["stop"]))
  6176. }, [
  6177. vue.createElementVNode("div", {
  6178. class: "my-cell flex",
  6179. onClick: _cache[8] || (_cache[8] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  6180. }, [
  6181. _hoisted_45,
  6182. vue.createElementVNode("div", _hoisted_46, [
  6183. vue.createVNode(_component_Icon, {
  6184. icon: "ic:round-close",
  6185. onClick: _cache[7] || (_cache[7] = vue.withModifiers(($event) => $data.showRelationReply = false, ["stop"]))
  6186. })
  6187. ])
  6188. ]),
  6189. vue.createElementVNode("div", {
  6190. class: "comments",
  6191. onClick: _cache[9] || (_cache[9] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  6192. }, [
  6193. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.relationReply, (item, index) => {
  6194. return vue.openBlock(), vue.createBlock(_component_SingleComment, {
  6195. "is-right": item.username === $data.targetUser.right,
  6196. key: item.floor,
  6197. comment: item
  6198. }, null, 8, ["is-right", "comment"]);
  6199. }), 128))
  6200. ])
  6201. ])) : vue.createCommentVNode("", true),
  6202. $data.showCallList && $options.filterCallList.length ? (vue.openBlock(), vue.createElementBlock("div", {
  6203. key: 1,
  6204. class: "call-list",
  6205. style: vue.normalizeStyle($data.callStyle)
  6206. }, [
  6207. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.filterCallList, (item, index) => {
  6208. return vue.openBlock(), vue.createElementBlock("div", {
  6209. class: vue.normalizeClass(["call-item", { select: index === $data.selectCallIndex }]),
  6210. onClick: vue.withModifiers(($event) => $options.setCall(item), ["stop"])
  6211. }, [
  6212. vue.createElementVNode("a", null, vue.toDisplayString(item), 1)
  6213. ], 10, _hoisted_47);
  6214. }), 256))
  6215. ], 4)) : vue.createCommentVNode("", true),
  6216. vue.createElementVNode("div", {
  6217. class: "close-btn",
  6218. onClick: _cache[11] || (_cache[11] = vue.withModifiers(($event) => $options.close("btn"), ["stop"]))
  6219. }, [
  6220. vue.createVNode(_component_Icon, { icon: "icon-park-outline:close" })
  6221. ]),
  6222. vue.createElementVNode("div", {
  6223. class: "open-new-tab",
  6224. onClick: _cache[12] || (_cache[12] = vue.withModifiers(($event) => $options.functions.openNewTab("https://www.v2ex.com/t/" + $options.post.id, $options.config.newTabOpenActive), ["stop"]))
  6225. }, [
  6226. vue.createVNode(_component_Icon, { icon: "majesticons:open" })
  6227. ]),
  6228. vue.createElementVNode("div", {
  6229. class: "refresh gray",
  6230. onClick: _cache[13] || (_cache[13] = vue.withModifiers(($event) => _ctx.$emit("refresh"), ["stop"]))
  6231. }, [
  6232. $props.refreshLoading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  6233. key: 1,
  6234. icon: "material-symbols:refresh"
  6235. }))
  6236. ]),
  6237. vue.createElementVNode("div", {
  6238. class: "scroll-to gray",
  6239. onClick: _cache[17] || (_cache[17] = vue.withModifiers(($event) => $options.jump($data.currentFloor), ["stop"]))
  6240. }, [
  6241. vue.createVNode(_component_Icon, { icon: "lucide:move-down" }),
  6242. vue.withDirectives(vue.createElementVNode("input", {
  6243. type: "text",
  6244. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.currentFloor = $event),
  6245. onClick: _cache[15] || (_cache[15] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"])),
  6246. onKeydown: _cache[16] || (_cache[16] = vue.withKeys(($event) => $options.jump($data.currentFloor), ["enter"]))
  6247. }, null, 544), [
  6248. [vue.vModelText, $data.currentFloor]
  6249. ])
  6250. ]),
  6251. vue.createElementVNode("div", {
  6252. class: "scroll-top gray",
  6253. onClick: _cache[18] || (_cache[18] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  6254. }, [
  6255. vue.createVNode(_component_Icon, { icon: "lucide:move-up" })
  6256. ])
  6257. ], 512),
  6258. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  6259. vue.createElementVNode("div", {
  6260. class: "preview-modal",
  6261. onWheel: _cache[21] || (_cache[21] = (...args) => $options.wheel && $options.wheel(...args))
  6262. }, [
  6263. vue.createElementVNode("div", {
  6264. class: "mask",
  6265. onClick: _cache[20] || (_cache[20] = (...args) => $options.closePreviewModal && $options.closePreviewModal(...args))
  6266. }),
  6267. vue.createVNode(_component_Icon, {
  6268. class: "close",
  6269. icon: "fontisto:close-a",
  6270. onClick: $options.closePreviewModal
  6271. }, null, 8, ["onClick"])
  6272. ], 32)
  6273. ]))
  6274. ], 34)), [
  6275. [vue.vShow, $props.modelValue]
  6276. ]);
  6277. }
  6278. const PostDetail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$2], ["__scopeId", "data-v-ea75dfbf"]]);
  6279. const _hoisted_1$5 = { key: 1 };
  6280. const _sfc_main$5 = {
  6281. __name: "Base64Tooltip",
  6282. setup(__props) {
  6283. const tooltip = vue.ref(null);
  6284. const show = vue.ref(false);
  6285. const originalText = vue.ref("");
  6286. const decodeText = vue.ref("");
  6287. const styleObject = vue.reactive({
  6288. left: "-100vw",
  6289. top: "-100vh"
  6290. });
  6291. vue.onMounted(() => {
  6292. eventBus.on(CMD.SHOW_TOOLTIP, ({ text, e: e2 }) => {
  6293. setTimeout(() => show.value = true);
  6294. originalText.value = text;
  6295. decodeText.value = "";
  6296. styleObject.left = e2.clientX + "px";
  6297. styleObject.top = e2.clientY + 20 + "px";
  6298. });
  6299. window.addEventListener("click", (e2) => {
  6300. if (!tooltip.value)
  6301. return;
  6302. if (!tooltip.value.contains(e2.target) && show.value) {
  6303. show.value = false;
  6304. }
  6305. }, { capture: true });
  6306. const fn = () => show.value && (show.value = false);
  6307. $(".post-detail", document).on("scroll", fn);
  6308. });
  6309. function copy() {
  6310. if (navigator.clipboard) {
  6311. navigator.clipboard.writeText(decodeText.value);
  6312. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "复制成功" });
  6313. } else {
  6314. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "复制失败!浏览器不支持!" });
  6315. }
  6316. }
  6317. function base64ToArrayBuffer(base64) {
  6318. let binary_string = window.atob(base64);
  6319. let len = binary_string.length;
  6320. let bytes = new Uint8Array(len);
  6321. for (let i = 0; i < len; i++) {
  6322. bytes[i] = binary_string.charCodeAt(i);
  6323. }
  6324. return bytes.buffer;
  6325. }
  6326. function decode() {
  6327. try {
  6328. new Blob([base64ToArrayBuffer(originalText.value)]).text().then((r2) => {
  6329. decodeText.value = r2;
  6330. });
  6331. } catch (e2) {
  6332. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "Base64解码失败!不是标准数据!" });
  6333. }
  6334. }
  6335. return (_ctx, _cache) => {
  6336. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  6337. class: "base64_tooltip",
  6338. style: vue.normalizeStyle(styleObject),
  6339. onClick: decode,
  6340. ref_key: "tooltip",
  6341. ref: tooltip
  6342. }, [
  6343. !decodeText.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6344. vue.createTextVNode(" Base64解码:" + vue.toDisplayString(originalText.value) + " ", 1),
  6345. vue.createVNode(vue.unref(Icon), { icon: "system-uicons:translate" })
  6346. ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
  6347. vue.createElementVNode("span", null, vue.toDisplayString(decodeText.value), 1),
  6348. vue.createVNode(BaseButton, {
  6349. class: "btn",
  6350. size: "small",
  6351. onClick: copy
  6352. }, {
  6353. default: vue.withCtx(() => [
  6354. vue.createTextVNode("点击复制")
  6355. ]),
  6356. _: 1
  6357. })
  6358. ]))
  6359. ], 4)), [
  6360. [vue.vShow, show.value]
  6361. ]);
  6362. };
  6363. }
  6364. };
  6365. const Base64Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-06429e70"]]);
  6366. const _sfc_main$4 = {
  6367. name: "Msg",
  6368. components: { Icon },
  6369. props: {
  6370. type: "",
  6371. text: ""
  6372. },
  6373. created() {
  6374. setTimeout(() => {
  6375. this.$emit("close");
  6376. }, 3e3);
  6377. }
  6378. };
  6379. const _hoisted_1$4 = { class: "right" };
  6380. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  6381. const _component_Icon = vue.resolveComponent("Icon");
  6382. return vue.openBlock(), vue.createElementBlock("div", {
  6383. class: vue.normalizeClass(["msg", $props.type])
  6384. }, [
  6385. vue.createElementVNode("div", {
  6386. class: "left",
  6387. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  6388. }, [
  6389. vue.createVNode(_component_Icon, { icon: "ic:round-close" })
  6390. ]),
  6391. vue.createElementVNode("div", _hoisted_1$4, vue.toDisplayString($props.text), 1)
  6392. ], 2);
  6393. }
  6394. const Msg = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-8bf692ea"]]);
  6395. const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-0f1f99f7"), n2 = n2(), vue.popScopeId(), n2);
  6396. const _hoisted_1$3 = {
  6397. key: 0,
  6398. class: "tag-modal modal"
  6399. };
  6400. const _hoisted_2$2 = { class: "wrapper" };
  6401. const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 添加标签 ", -1));
  6402. const _hoisted_4$2 = { class: "option" };
  6403. const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户:", -1));
  6404. const _hoisted_6$2 = { class: "btns" };
  6405. const _sfc_main$3 = {
  6406. __name: "TagModal",
  6407. props: ["tags"],
  6408. emits: ["update:tags"],
  6409. setup(__props, { emit: __emit }) {
  6410. const tagModal = vue.reactive({
  6411. show: false,
  6412. currentUsername: "",
  6413. tag: ""
  6414. });
  6415. const props = __props;
  6416. const emit = __emit;
  6417. const inputRef = vue.ref();
  6418. vue.onMounted(() => {
  6419. eventBus.on(CMD.ADD_TAG, (username) => {
  6420. tagModal.currentUsername = username;
  6421. tagModal.show = true;
  6422. vue.nextTick(() => {
  6423. inputRef.value.focus();
  6424. });
  6425. });
  6426. });
  6427. async function addTag() {
  6428. if (!tagModal.tag) {
  6429. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请输入标签" });
  6430. return;
  6431. }
  6432. let oldTag = functions.clone(props.tags);
  6433. let tempTag = functions.clone(props.tags);
  6434. let userTags = tempTag[tagModal.currentUsername] ?? [];
  6435. let rIndex = userTags.findIndex((v) => v === tagModal.tag);
  6436. if (rIndex > -1) {
  6437. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "标签已存在!" });
  6438. return;
  6439. } else {
  6440. userTags.push(tagModal.tag);
  6441. }
  6442. tempTag[tagModal.currentUsername] = userTags;
  6443. emit("update:tags", tempTag);
  6444. tagModal.tag = "";
  6445. tagModal.show = false;
  6446. let res = await window.parse.saveTags(tempTag);
  6447. if (!res) {
  6448. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签添加失败!" });
  6449. emit("update:tags", oldTag);
  6450. }
  6451. }
  6452. return (_ctx, _cache) => {
  6453. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6454. default: vue.withCtx(() => [
  6455. tagModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
  6456. vue.createElementVNode("div", {
  6457. class: "mask",
  6458. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => tagModal.show = false, ["stop"]))
  6459. }),
  6460. vue.createElementVNode("div", _hoisted_2$2, [
  6461. _hoisted_3$2,
  6462. vue.createElementVNode("div", _hoisted_4$2, [
  6463. _hoisted_5$2,
  6464. vue.createElementVNode("div", null, [
  6465. vue.createElementVNode("b", null, vue.toDisplayString(tagModal.currentUsername), 1)
  6466. ])
  6467. ]),
  6468. vue.withDirectives(vue.createElementVNode("input", {
  6469. type: "text",
  6470. ref_key: "inputRef",
  6471. ref: inputRef,
  6472. style: { "width": "100%" },
  6473. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tagModal.tag = $event),
  6474. onKeydown: vue.withKeys(addTag, ["enter"])
  6475. }, null, 544), [
  6476. [vue.vModelText, tagModal.tag]
  6477. ]),
  6478. vue.createElementVNode("div", _hoisted_6$2, [
  6479. vue.createVNode(BaseButton, {
  6480. type: "link",
  6481. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => {
  6482. tagModal.show = false;
  6483. tagModal.tag = "";
  6484. }, ["stop"]))
  6485. }, {
  6486. default: vue.withCtx(() => [
  6487. vue.createTextVNode("取消")
  6488. ]),
  6489. _: 1
  6490. }),
  6491. vue.createVNode(BaseButton, {
  6492. onClick: vue.withModifiers(addTag, ["stop"])
  6493. }, {
  6494. default: vue.withCtx(() => [
  6495. vue.createTextVNode("确定")
  6496. ]),
  6497. _: 1
  6498. })
  6499. ])
  6500. ])
  6501. ])) : vue.createCommentVNode("", true)
  6502. ]),
  6503. _: 1
  6504. });
  6505. };
  6506. }
  6507. };
  6508. const TagModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0f1f99f7"]]);
  6509. const _hoisted_1$2 = { class: "msgs" };
  6510. const _sfc_main$2 = {
  6511. __name: "MsgModal",
  6512. setup(__props) {
  6513. const msgList = vue.reactive([
  6514. // {type: 'success', text: '123', id: Date.now()}
  6515. ]);
  6516. vue.onMounted(() => {
  6517. eventBus.on(CMD.SHOW_MSG, (val) => {
  6518. msgList.push({ ...val, id: Date.now() });
  6519. });
  6520. });
  6521. function removeMsg(id) {
  6522. let rIndex = msgList.findIndex((item) => item.id === id);
  6523. if (rIndex > -1) {
  6524. msgList.splice(rIndex, 1);
  6525. }
  6526. }
  6527. return (_ctx, _cache) => {
  6528. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
  6529. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(msgList, (v) => {
  6530. return vue.openBlock(), vue.createBlock(Msg, {
  6531. key: v.id,
  6532. type: v.type,
  6533. text: v.text,
  6534. onClose: ($event) => removeMsg(v.id)
  6535. }, null, 8, ["type", "text", "onClose"]);
  6536. }), 128))
  6537. ]);
  6538. };
  6539. }
  6540. };
  6541. const MsgModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b73f4332"]]);
  6542. let u = ".__cf_email__", f = "data-cfemail", d = document.createElement("div");
  6543. function e(e2) {
  6544. console.error(e2);
  6545. }
  6546. function r(e2, t) {
  6547. let r2 = e2.substr(t, 2);
  6548. return parseInt(r2, 16);
  6549. }
  6550. function n(href, index) {
  6551. let o = "", a = r(href, index);
  6552. for (let i = index + 2; i < href.length; i += 2) {
  6553. let l = r(href, i) ^ a;
  6554. o += String.fromCharCode(l);
  6555. }
  6556. try {
  6557. o = decodeURIComponent(escape(o));
  6558. } catch (u2) {
  6559. e(u2);
  6560. }
  6561. d.innerHTML = '<a href="' + o.replace(/"/g, "&quot;") + '"></a>';
  6562. return d.childNodes[0].getAttribute("href") || "";
  6563. }
  6564. function decodeEmail(body) {
  6565. try {
  6566. let as = body.find(u);
  6567. as.each(function() {
  6568. try {
  6569. let o = this, a = o.parentNode, i = o.getAttribute(f);
  6570. if (i) {
  6571. let l = n(i, 0), d2 = document.createTextNode(l);
  6572. a.replaceChild(d2, o);
  6573. }
  6574. } catch (h2) {
  6575. e(h2);
  6576. }
  6577. });
  6578. } catch (s) {
  6579. e(s);
  6580. }
  6581. }
  6582. const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-77aa374e"), n2 = n2(), vue.popScopeId(), n2);
  6583. const _hoisted_1$1 = {
  6584. key: 0,
  6585. class: "NotificationModal modal"
  6586. };
  6587. const _hoisted_2$1 = { class: "modal-root" };
  6588. const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 提醒系统 ", -1));
  6589. const _hoisted_4$1 = { class: "modal-body" };
  6590. const _hoisted_5$1 = { class: "filter" };
  6591. const _hoisted_6$1 = { class: "list-wrap" };
  6592. const _hoisted_7$1 = { class: "notify-wrap" };
  6593. const _hoisted_8$1 = ["innerHTML"];
  6594. const _hoisted_9$1 = {
  6595. key: 0,
  6596. class: "loading-wrap"
  6597. };
  6598. const _hoisted_10$1 = { class: "footer" };
  6599. const _hoisted_11$1 = ["innerHTML"];
  6600. const _hoisted_12$1 = { class: "total" };
  6601. const _hoisted_13$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", null, "总共收到提醒", -1));
  6602. const _sfc_main$1 = {
  6603. __name: "NotificationModal",
  6604. props: ["modelValue", "list", "total", "pages", "loading"],
  6605. emits: ["update:modelValue"],
  6606. setup(__props, { emit: __emit }) {
  6607. const props = __props;
  6608. const emit = __emit;
  6609. const index = vue.ref("all");
  6610. vue.onMounted(() => {
  6611. });
  6612. vue.watch([index, () => props.list], () => {
  6613. $(".notify-wrap").scrollTop(0);
  6614. });
  6615. vue.watch(() => props.modelValue, (n2) => {
  6616. if (n2) {
  6617. document.body.style.overflow = "hidden";
  6618. } else {
  6619. document.body.style.overflow = "unset";
  6620. $(".notify-wrap").scrollTop(0);
  6621. }
  6622. });
  6623. function close() {
  6624. emit("update:modelValue", false);
  6625. }
  6626. return (_ctx, _cache) => {
  6627. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6628. default: vue.withCtx(() => [
  6629. __props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  6630. vue.createElementVNode("div", {
  6631. class: "mask",
  6632. onClick: vue.withModifiers(close, ["stop"])
  6633. }),
  6634. vue.createElementVNode("div", _hoisted_2$1, [
  6635. vue.createElementVNode("div", { class: "modal-header" }, [
  6636. _hoisted_3$1,
  6637. vue.createElementVNode("i", {
  6638. class: "fa fa-times",
  6639. onClick: close
  6640. })
  6641. ]),
  6642. vue.createElementVNode("div", _hoisted_4$1, [
  6643. vue.createElementVNode("div", _hoisted_5$1, [
  6644. vue.createElementVNode("div", {
  6645. class: vue.normalizeClass(index.value === "all" && "active"),
  6646. onClick: _cache[0] || (_cache[0] = ($event) => index.value = "all")
  6647. }, "全部", 2),
  6648. vue.createElementVNode("div", {
  6649. class: vue.normalizeClass(index.value === "reply" && "active"),
  6650. onClick: _cache[1] || (_cache[1] = ($event) => index.value = "reply")
  6651. }, "回复", 2),
  6652. vue.createElementVNode("div", {
  6653. class: vue.normalizeClass(index.value === "star" && "active"),
  6654. onClick: _cache[2] || (_cache[2] = ($event) => index.value = "star")
  6655. }, "感谢", 2),
  6656. vue.createElementVNode("div", {
  6657. class: vue.normalizeClass(index.value === "collect" && "active"),
  6658. onClick: _cache[3] || (_cache[3] = ($event) => index.value = "collect")
  6659. }, "收藏", 2)
  6660. ]),
  6661. vue.createElementVNode("div", _hoisted_6$1, [
  6662. vue.createElementVNode("div", _hoisted_7$1, [
  6663. vue.createElementVNode("div", {
  6664. id: "notifications",
  6665. class: vue.normalizeClass(index.value),
  6666. innerHTML: __props.list
  6667. }, null, 10, _hoisted_8$1)
  6668. ]),
  6669. __props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, [
  6670. vue.createVNode(BaseLoading)
  6671. ])) : vue.createCommentVNode("", true)
  6672. ]),
  6673. vue.createElementVNode("div", _hoisted_10$1, [
  6674. vue.createElementVNode("div", {
  6675. innerHTML: __props.pages,
  6676. class: "pages"
  6677. }, null, 8, _hoisted_11$1),
  6678. vue.createElementVNode("div", _hoisted_12$1, [
  6679. _hoisted_13$1,
  6680. vue.createTextVNode(vue.toDisplayString(__props.total), 1)
  6681. ])
  6682. ])
  6683. ])
  6684. ])
  6685. ])) : vue.createCommentVNode("", true)
  6686. ]),
  6687. _: 1
  6688. });
  6689. };
  6690. }
  6691. };
  6692. const NotificationModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-77aa374e"]]);
  6693. const _sfc_main = {
  6694. components: {
  6695. Icon,
  6696. BaseButton,
  6697. NotificationModal,
  6698. BaseLoading,
  6699. BaseSwitch,
  6700. MsgModal,
  6701. TagModal,
  6702. Tooltip,
  6703. Setting,
  6704. PostDetail,
  6705. Base64Tooltip,
  6706. Msg
  6707. },
  6708. provide() {
  6709. return {
  6710. isLogin: vue.computed(() => this.isLogin),
  6711. isNight: vue.computed(() => this.isNight),
  6712. pageType: vue.computed(() => this.pageType),
  6713. tags: vue.computed(() => this.tags),
  6714. show: vue.computed(() => this.show),
  6715. post: vue.computed(() => this.current),
  6716. config: vue.computed(() => this.config),
  6717. allReplyUsers: vue.computed(() => {
  6718. var _a, _b, _c;
  6719. if ((_a = this.current) == null ? void 0 : _a.replyList) {
  6720. return Array.from(new Set(((_c = (_b = this.current) == null ? void 0 : _b.replyList) == null ? void 0 : _c.map((v) => v.username)) ?? []));
  6721. }
  6722. return [];
  6723. }),
  6724. showConfig: this.showConfig
  6725. };
  6726. },
  6727. data() {
  6728. return {
  6729. loading: window.pageType === PageType.Post,
  6730. refreshLoading: false,
  6731. loadMore: false,
  6732. isLogin: !!window.user.username,
  6733. pageType: window.pageType,
  6734. isNight: window.isNight,
  6735. stopMe: window.stopMe,
  6736. //停止使用脚本
  6737. show: false,
  6738. current: getDefaultPost(),
  6739. list: [],
  6740. config: functions.clone(window.config),
  6741. tags: window.user.tags,
  6742. configModal: {
  6743. show: false
  6744. },
  6745. notificationModal: {
  6746. show: false,
  6747. loading: false,
  6748. list: "",
  6749. total: 0
  6750. },
  6751. previewModal: {
  6752. show: false,
  6753. src: ""
  6754. },
  6755. popConfirmModal: {
  6756. show: false,
  6757. title: "",
  6758. id: ""
  6759. },
  6760. timer: -1,
  6761. timer2: -1,
  6762. pageInfo: {
  6763. title: "",
  6764. number: 0
  6765. },
  6766. calendar: {
  6767. show: false,
  6768. year: "",
  6769. month: "",
  6770. dayCount: 0,
  6771. firstDayWeek: 0,
  6772. select: ""
  6773. }
  6774. };
  6775. },
  6776. computed: {
  6777. targetUserTags() {
  6778. return this.tags[window.targetUserName] ?? [];
  6779. },
  6780. isList() {
  6781. return [PageType.Home, PageType.Node].includes(this.pageType);
  6782. },
  6783. isPost() {
  6784. return this.pageType === PageType.Post;
  6785. },
  6786. isMember() {
  6787. return this.pageType === PageType.Member;
  6788. }
  6789. },
  6790. watch: {
  6791. config: {
  6792. handler(newVal, oldVal) {
  6793. console.log("config", functions.clone(newVal).notice, functions.clone(oldVal).notice);
  6794. let configStr = localStorage.getItem("v2ex-config");
  6795. if (configStr) {
  6796. let configObj = JSON.parse(configStr);
  6797. configObj[window.user.username || "default"] = newVal;
  6798. localStorage.setItem("v2ex-config", JSON.stringify(configObj));
  6799. }
  6800. window.config = newVal;
  6801. window.parse.editNoteItem(window.user.configPrefix + JSON.stringify(window.config), window.user.configNoteId);
  6802. },
  6803. deep: true
  6804. },
  6805. tags(newVal) {
  6806. window.user.tags = newVal;
  6807. },
  6808. "config.viewType"(newVal) {
  6809. if (!newVal)
  6810. return;
  6811. if (newVal === "card") {
  6812. $(".post-item").each(function() {
  6813. $(this).addClass("preview");
  6814. });
  6815. } else {
  6816. $(".post-item").each(function() {
  6817. $(this).removeClass("preview");
  6818. });
  6819. }
  6820. },
  6821. "pageInfo.number"(newVal) {
  6822. clearInterval(this.timer2);
  6823. if (newVal) {
  6824. document.title = `(${this.pageInfo.number}) ` + this.pageInfo.title;
  6825. if (this.config.notice.whenNewNoticeGlimmer) {
  6826. let c = 0;
  6827. this.timer2 = setInterval(() => {
  6828. c++;
  6829. document.title = this.pageInfo.title;
  6830. if (c % 2 === 0) {
  6831. document.title = `(${this.pageInfo.number}) ` + this.pageInfo.title;
  6832. }
  6833. }, 1e3);
  6834. }
  6835. } else {
  6836. document.title = this.pageInfo.title;
  6837. }
  6838. },
  6839. show(newVal) {
  6840. if (this.pageType === PageType.Post)
  6841. return;
  6842. if (newVal) {
  6843. document.body.style.overflow = "hidden";
  6844. if (!window.history.state) {
  6845. window.history.pushState({}, 0, this.current.href);
  6846. }
  6847. vue.nextTick(() => {
  6848. this.pageInfo.title = document.title = this.current.title ?? "V2EX";
  6849. });
  6850. } else {
  6851. document.body.style.overflow = "unset";
  6852. this.pageInfo.title = document.title = "V2EX";
  6853. if (window.history.state) {
  6854. window.history.back();
  6855. }
  6856. }
  6857. }
  6858. },
  6859. created() {
  6860. let that = this;
  6861. this.initEvent();
  6862. window.cb = this.winCb;
  6863. if (!window.canParseV2exPage)
  6864. return;
  6865. $(document).on("click", "a", this.clickA);
  6866. $(document).on("click", ".post-item", function(e2) {
  6867. if (e2.currentTarget.getAttribute("script"))
  6868. return;
  6869. if (that.stopMe)
  6870. return true;
  6871. if (this.classList.contains("preview")) {
  6872. if (e2.target.tagName !== "A" && e2.target.tagName !== "IMG" && !e2.target.classList.contains("toggle")) {
  6873. let id = this.dataset["id"];
  6874. let href = this.dataset["href"];
  6875. if (id) {
  6876. that.clickPost(e2, id, href);
  6877. } else {
  6878. if (href)
  6879. location.href = href;
  6880. }
  6881. }
  6882. }
  6883. });
  6884. $(document).on("click", ".toggle", (e2) => {
  6885. if (this.stopMe)
  6886. return true;
  6887. let id = e2.target.dataset["id"];
  6888. let itemDom = document.querySelector(`.id_${id}`);
  6889. if (itemDom.classList.contains("preview")) {
  6890. e2.target.innerText = "预览";
  6891. itemDom.classList.remove("preview");
  6892. } else {
  6893. if (this.config.viewType !== "card") {
  6894. let index = this.list.findIndex((v) => v.id == id);
  6895. if (index > -1) {
  6896. e2.target.innerText = "收起";
  6897. itemDom.classList.add("preview");
  6898. } else {
  6899. e2.target.innerText = "加载中";
  6900. functions.getPostDetailByApi(id).then((res) => {
  6901. if (res.content_rendered) {
  6902. res.href = itemDom.dataset["href"];
  6903. this.list.push(getDefaultPost(res));
  6904. itemDom.classList.add("preview");
  6905. e2.target.innerText = "收起";
  6906. functions.appendPostContent(res, itemDom);
  6907. } else {
  6908. e2.target.innerText = "预览";
  6909. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "主题暂无正文!" });
  6910. }
  6911. });
  6912. }
  6913. } else {
  6914. e2.target.innerText = "收起";
  6915. itemDom.classList.add("preview");
  6916. }
  6917. }
  6918. });
  6919. window.onpopstate = (event) => {
  6920. if (event.state) {
  6921. if (!this.show)
  6922. this.show = true;
  6923. } else {
  6924. if (this.show)
  6925. this.show = false;
  6926. }
  6927. };
  6928. if (this.config.notice.takeOverNoticePage) {
  6929. window.deleteNotification = (nId, token) => {
  6930. let item = $("#n_" + nId);
  6931. item.slideUp("fast");
  6932. $.post({
  6933. url: "/delete/notification/" + nId + "?once=" + token,
  6934. success() {
  6935. $.get({
  6936. url: "/notifications/below/" + window.notificationBottom,
  6937. success(data, status, request) {
  6938. item.remove();
  6939. $("#notifications").append(that.checkReplyItemType(data));
  6940. window.notificationBottom = request.getResponseHeader("X-V2EX-New-Notification-Bottom");
  6941. },
  6942. error() {
  6943. item.slideDown("fast");
  6944. }
  6945. });
  6946. },
  6947. error() {
  6948. item.slideDown("fast");
  6949. }
  6950. });
  6951. };
  6952. }
  6953. },
  6954. beforeUnmount() {
  6955. clearInterval(this.timer);
  6956. eventBus.clear();
  6957. $(document).off("click", "a", this.clickA);
  6958. },
  6959. methods: {
  6960. getMonthDayInfo(num) {
  6961. let now = dayjs();
  6962. now = now.year(this.calendar.year);
  6963. now = now.month(this.calendar.month);
  6964. if (num > 0) {
  6965. now = now.add(1, "month");
  6966. } else {
  6967. now = now.subtract(1, "month");
  6968. }
  6969. this.calendar.year = now.year();
  6970. this.calendar.month = now.month();
  6971. this.calendar.dayCount = now.daysInMonth();
  6972. this.calendar.firstDayWeek = now.startOf("month").day();
  6973. },
  6974. checkReplyItemType(val) {
  6975. let d2 = $(val);
  6976. let str = d2.html();
  6977. if (str.includes("提到了你") || str.includes("回复了你")) {
  6978. d2.addClass("reply");
  6979. }
  6980. if (str.includes("感谢了你")) {
  6981. d2.addClass("star");
  6982. }
  6983. if (str.includes("收藏了你")) {
  6984. d2.addClass("collect");
  6985. }
  6986. return d2;
  6987. },
  6988. async getUnreadMessagesCount() {
  6989. var _a, _b;
  6990. const res = await fetch(`${location.origin}/mission`);
  6991. const htmlText = await res.text();
  6992. const $page = $(htmlText);
  6993. const text = $page.find('#Rightbar a[href^="/notifications"]').text();
  6994. if (text.includes("未读提醒")) {
  6995. const countStr = (_a = text.match(/\d+/)) == null ? void 0 : _a.at(0);
  6996. if (countStr) {
  6997. return Number((_b = text.match(/\d+/)) == null ? void 0 : _b.at(0));
  6998. }
  6999. } else {
  7000. return 0;
  7001. }
  7002. throw new Error("无法获取未读消息数量");
  7003. },
  7004. clickA(e2) {
  7005. let that = this;
  7006. if (e2.currentTarget.getAttribute("script"))
  7007. return;
  7008. if (that.stopMe)
  7009. return true;
  7010. let { pageType } = functions.checkPageType(e2.currentTarget);
  7011. let { href, id, title } = functions.parseA(e2.currentTarget);
  7012. switch (pageType) {
  7013. case PageType.Post:
  7014. if (id) {
  7015. that.clickPost(e2, id, href, title);
  7016. }
  7017. break;
  7018. case PageType.Node:
  7019. case PageType.Home:
  7020. case PageType.Changes:
  7021. return;
  7022. case PageType.Hot:
  7023. let date = e2.currentTarget.search.replace("?", "");
  7024. if (date === "setting") {
  7025. if (this.calendar.show) {
  7026. $("#Rightbar > .sep20:first").css("height", "var(--component-margin)");
  7027. } else {
  7028. $("#Rightbar > .sep20:first").css("height", "unset");
  7029. let now2 = dayjs();
  7030. this.calendar.year = now2.year();
  7031. this.calendar.month = now2.month();
  7032. this.calendar.dayCount = now2.daysInMonth();
  7033. this.calendar.firstDayWeek = now2.startOf("month").day();
  7034. this.calendar.select = `${this.calendar.year}-${this.calendar.month + 1}-${now2.date()}`;
  7035. }
  7036. this.calendar.show = !this.calendar.show;
  7037. functions.stopEvent(e2);
  7038. return;
  7039. }
  7040. let now = dayjs();
  7041. let day = "";
  7042. switch (Number(date)) {
  7043. case -1:
  7044. day = now.subtract(1, "day").format("YYYY-M-D");
  7045. break;
  7046. case -2:
  7047. day = now.subtract(2, "day").format("YYYY-M-D");
  7048. break;
  7049. case 3:
  7050. day = "3d";
  7051. break;
  7052. case 7:
  7053. day = "7d";
  7054. break;
  7055. case 30:
  7056. day = "30d";
  7057. break;
  7058. default:
  7059. day = date;
  7060. if (dayjs(day).isSame(now, "day")) {
  7061. functions.stopEvent(e2);
  7062. return location.reload();
  7063. }
  7064. }
  7065. if (day) {
  7066. fetch(DefaultVal.hotUrl + day + ".json").then(async (r2) => {
  7067. let r1 = await r2.json();
  7068. $(".cell.item.post-item").remove();
  7069. r1.reverse().map((v) => {
  7070. let s = `
  7071. <div class="cell item post-item id_${v.id}" style="" data-href="https://www.v2ex.com/t/${v.id}#reply${v.replyCount}">
  7072. <table cellpadding="0" cellspacing="0" border="0" width="100%">
  7073. <tbody>
  7074. <tr>
  7075. <td width="48" valign="top" align="center">
  7076. <a href="/member/${v.username}">
  7077. <img src="${v.avatar}" class="avatar"
  7078. border="0" align="default"
  7079. width="48"
  7080. style="width: 48px; max-height: 48px;"
  7081. alt="ice9191">
  7082. </a>
  7083. </td>
  7084. <td width="10"></td>
  7085. <td width="auto" valign="middle">
  7086. <span class="item_title">
  7087. <a href="https://www.v2ex.com/t/${v.id}#reply${v.replyCount}" class="topic-link" id="topic-link-${v.id}">${v.title}</a>
  7088. </span>
  7089. <div class="sep5"></div>
  7090. <span class="topic_info">
  7091. <div class="votes"></div>
  7092. <a class="node" href="/go/${v.nodeUrl}">${v.nodeTitle}</a> &nbsp;•&nbsp;
  7093. <strong><a href="/member/${v.username}">${v.username}</a></strong> &nbsp;•&nbsp;
  7094. <span title="${v.lastReplyDate}">${v.lastReplyDateAgo}</span> &nbsp;•&nbsp; 最后回复来自
  7095. <strong><a href="/member/${v.lastReplyUsername}">${v.lastReplyUsername}</a></strong>
  7096. </span>
  7097. </td>
  7098. <td width="70" align="right" valign="middle" style="position: relative;">
  7099. <a href="/t/${v.id}#reply${v.replyCount}" class="count_livid">${v.replyCount}</a>
  7100. <div data-id="${v.id}" class="toggle">预览</div>
  7101. </td>
  7102. </tr>
  7103. </tbody>
  7104. </table>
  7105. </div>
  7106. `;
  7107. $("#app").after($(s));
  7108. });
  7109. }).catch((e3) => {
  7110. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "暂无点击日期的最热数据!" });
  7111. });
  7112. }
  7113. functions.stopEvent(e2);
  7114. return;
  7115. default:
  7116. if (e2.currentTarget.href.includes("/settings/night/toggle"))
  7117. return;
  7118. if (e2.currentTarget.href === location.origin + "/#;")
  7119. return;
  7120. if (e2.currentTarget.href.includes("/notifications")) {
  7121. this.pageInfo.number = 0;
  7122. $("#money").parent().prev().replaceWith(`<a href="/notifications">0 未读提醒</a>`);
  7123. if (this.config.notice.takeOverNoticePage) {
  7124. this.notificationModal.loading = true;
  7125. this.notificationModal.show = true;
  7126. fetch(href).then(async (r2) => {
  7127. let htmlText = await r2.text();
  7128. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7129. let res = htmlText.match(/var notificationBottom = ([\d]+);/);
  7130. if (res && res[1]) {
  7131. window.notificationBottom = Number(res[1]);
  7132. console.log(" window.notificationBottom", window.notificationBottom);
  7133. }
  7134. let body = $(bodyText[0]);
  7135. let list = body.find("#notifications");
  7136. list.children().each(function() {
  7137. that.checkReplyItemType(this);
  7138. });
  7139. let h2 = list.html();
  7140. let d2 = body.find("#Main > .box > .header .fr .gray");
  7141. if (d2.length) {
  7142. this.notificationModal.total = d2.text();
  7143. }
  7144. this.notificationModal.list = h2;
  7145. let p = list.next();
  7146. let tds = p.find(".button");
  7147. tds.each(function() {
  7148. let href2 = this.getAttribute("onclick");
  7149. if (href2) {
  7150. this.innerHTML = `<a href=${href2.replace("location.href=", "")}>${this.innerHTML}</a>`;
  7151. this.setAttribute("onclick", "");
  7152. }
  7153. });
  7154. this.notificationModal.pages = p.html();
  7155. this.notificationModal.loading = false;
  7156. }).catch((e3) => {
  7157. this.notificationModal.loading = false;
  7158. });
  7159. functions.stopEvent(e2);
  7160. return;
  7161. }
  7162. }
  7163. if (that.config.newTabOpen) {
  7164. functions.stopEvent(e2);
  7165. functions.openNewTab(e2.currentTarget.href, that.config.newTabOpenActive);
  7166. }
  7167. return;
  7168. }
  7169. },
  7170. async clickPost(e2, id, href, title = "") {
  7171. if (id) {
  7172. if (this.config.clickPostItemOpenDetail) {
  7173. functions.stopEvent(e2);
  7174. let postItem = getDefaultPost();
  7175. let index = this.list.findIndex((v) => v.id == id);
  7176. if (index > -1) {
  7177. postItem = this.list[index];
  7178. }
  7179. if (!postItem.title)
  7180. postItem.title = title ?? "加载中";
  7181. postItem.id = id;
  7182. postItem.href = href;
  7183. this.getPostDetail(postItem);
  7184. return;
  7185. }
  7186. if (this.config.newTabOpen) {
  7187. functions.stopEvent(e2);
  7188. functions.openNewTab(`https://www.v2ex.com/t/${id}?p=1`, this.config.newTabOpenActive);
  7189. }
  7190. }
  7191. },
  7192. showPost() {
  7193. this.show = true;
  7194. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  7195. $(this).hide();
  7196. });
  7197. },
  7198. showConfig() {
  7199. this.configModal.show = true;
  7200. },
  7201. resetTitle() {
  7202. let r2 = document.title.match(/\s?\(\d+\)\s?/);
  7203. if (r2 && r2.length) {
  7204. this.pageInfo.title = document.title.replace(r2[0], "");
  7205. } else {
  7206. this.pageInfo.title = document.title;
  7207. }
  7208. },
  7209. async getNotice(body) {
  7210. if (!body) {
  7211. let res = await fetch("/t");
  7212. if (res.status === 200) {
  7213. let htmlText = await res.text();
  7214. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7215. body = $(bodyText[0]);
  7216. }
  7217. }
  7218. let notify = body.find('a[href="/notifications"]');
  7219. if (notify.length) {
  7220. this.resetTitle();
  7221. let text = notify.text();
  7222. if (text !== "0 未读提醒") {
  7223. this.pageInfo.number = text.replace(" 未读提醒", "");
  7224. console.log("text", text, this.config.notice.ddWebhook);
  7225. if (this.config.notice.text !== text) {
  7226. console.log("有新消息", text, this.config.notice.text);
  7227. $("#money").parent().prev().replaceWith(`<div><div class="orange-dot"></div><strong><a href="/notifications">${text}</a></strong></div>`);
  7228. this.config.notice.text = text;
  7229. if (this.config.notice.ddWebhook) {
  7230. let n2 = /* @__PURE__ */ new Date();
  7231. let s = n2.getSeconds();
  7232. s = s < 10 ? "0" + s : s;
  7233. let m = n2.getMinutes();
  7234. m = m < 10 ? "0" + m : m;
  7235. let h2 = n2.getHours();
  7236. h2 = h2 < 10 ? "0" + h2 : h2;
  7237. $.ajax("https://car-back.ttentau.top/index.php/v1/config/forward", {
  7238. method: "POST",
  7239. contentType: "application/json",
  7240. data: JSON.stringify({
  7241. url: this.config.notice.ddWebhook,
  7242. "text": notify.text() + `,时间:${n2.getFullYear()}/${n2.getMonth() + 1}/${n2.getDate()} ${h2}:${m}:${s}`
  7243. })
  7244. });
  7245. }
  7246. }
  7247. } else {
  7248. $("#money").parent().prev().replaceWith(`<a href="/notifications">${text}</a>`);
  7249. console.log("消息清空");
  7250. this.config.notice.text = "";
  7251. }
  7252. }
  7253. },
  7254. async winCb({ type, value }) {
  7255. console.log("回调的类型", type, value);
  7256. if (type === "openSetting") {
  7257. this.showConfig();
  7258. }
  7259. if (type === "syncData") {
  7260. this.stopMe = window.stopMe;
  7261. }
  7262. if (type === "getConfigSuccess") {
  7263. if (window.config.version < DefaultVal.currentVersion && window.isDeadline) {
  7264. $(".v2next-setting span").after(`<div class="new v2next-new">new</div>`);
  7265. }
  7266. if (window.isLogin && window.config.notice.loopCheckNotice) {
  7267. this.getNotice($(document.body));
  7268. this.timer = setInterval(this.getNotice, 1e3 * 60 * Number(window.config.notice.loopCheckNoticeInterval));
  7269. }
  7270. this.config = window.config;
  7271. this.tags = window.user.tags;
  7272. }
  7273. if (type === "syncList") {
  7274. this.list = Object.assign(this.list, window.postList);
  7275. }
  7276. if (type === "warningNotice") {
  7277. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: value });
  7278. }
  7279. if (this.stopMe)
  7280. return;
  7281. if (type === "restorePost") {
  7282. this.show = false;
  7283. this.loading = false;
  7284. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "脚本无法查看此页面!" });
  7285. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  7286. $(this).show();
  7287. });
  7288. }
  7289. if (type === "postContent") {
  7290. this.current = Object.assign(this.current, value);
  7291. this.current.inList = true;
  7292. if (this.config.autoOpenDetail) {
  7293. this.showPost();
  7294. }
  7295. }
  7296. if (type === "postReplies") {
  7297. this.loading = false;
  7298. this.current = Object.assign(this.current, value);
  7299. this.list.push(functions.clone(this.current));
  7300. }
  7301. },
  7302. regenerateReplyList() {
  7303. if (this.current.replyList.length) {
  7304. functions.createList(this.current, this.current.replyList);
  7305. } else {
  7306. this.current.replyCount = 0;
  7307. this.current.nestedReplies = [];
  7308. this.current.nestedRedundReplies = [];
  7309. }
  7310. if (this.list.length) {
  7311. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7312. if (rIndex > -1) {
  7313. this.list[rIndex] = functions.clone(this.current);
  7314. }
  7315. }
  7316. },
  7317. initEvent() {
  7318. eventBus.on(CMD.CHANGE_COMMENT_THANK, (val) => {
  7319. const { id, type } = val;
  7320. let currentI = this.current.replyList.findIndex((i) => i.id === id);
  7321. if (currentI > -1) {
  7322. this.current.replyList[currentI].isThanked = type === "add";
  7323. if (type === "add") {
  7324. this.current.replyList[currentI].thankCount++;
  7325. } else {
  7326. this.current.replyList[currentI].thankCount--;
  7327. }
  7328. this.regenerateReplyList();
  7329. }
  7330. });
  7331. eventBus.on(CMD.CHANGE_POST_THANK, (val) => {
  7332. const { id, type } = val;
  7333. this.current.isThanked = type === "add";
  7334. if (type === "add") {
  7335. this.current.thankCount++;
  7336. } else {
  7337. this.current.thankCount--;
  7338. }
  7339. let currentI = this.list.findIndex((i) => i.id === id);
  7340. if (currentI > -1) {
  7341. this.list[currentI].isThanked = type === "add";
  7342. if (type === "add") {
  7343. this.list[currentI].thankCount++;
  7344. } else {
  7345. this.list[currentI].thankCount++;
  7346. }
  7347. }
  7348. });
  7349. eventBus.on(CMD.REMOVE, (val) => {
  7350. let removeIndex = this.current.replyList.findIndex((i) => i.floor === val);
  7351. if (removeIndex > -1) {
  7352. this.current.replyList.splice(removeIndex, 1);
  7353. }
  7354. this.regenerateReplyList();
  7355. });
  7356. eventBus.on(CMD.IGNORE, () => {
  7357. this.show = false;
  7358. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7359. if (rIndex > -1) {
  7360. this.list.splice(rIndex, 1);
  7361. }
  7362. this.current = getDefaultPost();
  7363. });
  7364. eventBus.on(CMD.MERGE, (val) => {
  7365. this.current = Object.assign(this.current, val);
  7366. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7367. if (rIndex > -1) {
  7368. this.list[rIndex] = functions.clone(this.current);
  7369. }
  7370. });
  7371. eventBus.on(CMD.ADD_REPLY, (item) => {
  7372. this.current.replyList.push(item);
  7373. this.regenerateReplyList();
  7374. });
  7375. eventBus.on(CMD.REFRESH_ONCE, async (once) => {
  7376. if (once) {
  7377. if (typeof once === "string") {
  7378. let res = once.match(/var once = "([\d]+)";/);
  7379. if (res && res[1]) {
  7380. this.current.once = Number(res[1]);
  7381. return;
  7382. }
  7383. }
  7384. if (typeof once === "number") {
  7385. this.current.once = once;
  7386. return;
  7387. }
  7388. }
  7389. window.fetchOnce().then((r2) => {
  7390. this.current.once = r2;
  7391. });
  7392. });
  7393. eventBus.on(CMD.REMOVE_TAG, async ({ username, tag }) => {
  7394. let oldTag = functions.clone(this.tags);
  7395. let tags = this.tags[username] ?? [];
  7396. let rIndex = tags.findIndex((v) => v === tag);
  7397. if (rIndex > -1) {
  7398. tags.splice(rIndex, 1);
  7399. }
  7400. this.tags[username] = tags;
  7401. let res = await window.parse.saveTags(this.tags);
  7402. if (!res) {
  7403. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签删除失败!" });
  7404. this.tags = oldTag;
  7405. }
  7406. });
  7407. eventBus.on(CMD.SHOW_CONFIRM_MODAL, (val) => {
  7408. const { rect, title, id } = val;
  7409. this.popConfirmModal.show = true;
  7410. this.popConfirmModal.title = title;
  7411. this.popConfirmModal.id = id;
  7412. vue.nextTick(() => {
  7413. this.$refs.tip.style.top = rect.top + "px";
  7414. this.$refs.tip.style.left = rect.left + rect.width / 2 - 50 + "px";
  7415. });
  7416. });
  7417. },
  7418. async getPostDetail(post) {
  7419. this.current = post;
  7420. this.show = true;
  7421. let url = location.origin + "/t/" + this.current.id;
  7422. this.current.url = url;
  7423. let alreadyHasReply = this.current.replyList.length;
  7424. if (alreadyHasReply) {
  7425. this.refreshLoading = true;
  7426. } else {
  7427. this.loading = true;
  7428. functions.getPostDetailByApi(this.current.id).then((d2) => {
  7429. d2.replyCount = d2.replies;
  7430. this.current = Object.assign(this.current, d2);
  7431. if (this.current.replyCount > window.config.maxReplyCountLimit) {
  7432. functions.openNewTab(`${location.origin}/t/${this.current.id}?p=1&script=1`, true);
  7433. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "由于回复数量较多,已为您单独打开此主题" });
  7434. this.loading = this.show = false;
  7435. return;
  7436. } else {
  7437. this.current.jsonContent = `
  7438. <div class="cell">
  7439. <div class="topic_content">
  7440. <div class="markdown_body">
  7441. ${(d2 == null ? void 0 : d2.content_rendered) ?? ""}
  7442. </div>
  7443. </div>
  7444. </div>`;
  7445. }
  7446. });
  7447. }
  7448. let apiRes = await window.fetch(url + "?p=1");
  7449. if (apiRes.status === 404) {
  7450. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "主题未找到" });
  7451. return this.refreshLoading = this.loading = false;
  7452. }
  7453. if (apiRes.status === 403) {
  7454. this.refreshLoading = this.show = this.loading = false;
  7455. functions.openNewTab(`${location.origin}/t/${post.id}?p=1&script=0`, true);
  7456. return;
  7457. }
  7458. if (apiRes.redirected) {
  7459. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有权限" });
  7460. return this.refreshLoading = this.loading = false;
  7461. }
  7462. let htmlText = await apiRes.text();
  7463. let hasPermission = htmlText.search("你要查看的页面需要先登录");
  7464. if (hasPermission > -1) {
  7465. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你要查看的页面需要先登录" });
  7466. return this.refreshLoading = this.loading = false;
  7467. }
  7468. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7469. let body = $(bodyText[0]);
  7470. decodeEmail(body);
  7471. await window.parse.getPostDetail(this.current, body, htmlText);
  7472. let index = this.list.findIndex((v) => v.id == this.current.id);
  7473. if (index > -1) {
  7474. this.list[index] = functions.clone(this.current);
  7475. } else {
  7476. this.list.push(functions.clone(this.current));
  7477. }
  7478. this.refreshLoading = this.loading = false;
  7479. await window.parse.parseOp(this.current);
  7480. console.log("当前主题", this.current);
  7481. },
  7482. addTargetUserTag() {
  7483. eventBus.emit(CMD.ADD_TAG, window.targetUserName);
  7484. },
  7485. removeTargetUserTag(tag) {
  7486. eventBus.emit(CMD.REMOVE_TAG, { username: window.targetUserName, tag });
  7487. },
  7488. popConfirmModalCancel() {
  7489. this.popConfirmModal.show = false;
  7490. },
  7491. popConfirmModalConfirm() {
  7492. this.popConfirmModalCancel();
  7493. eventBus.emit(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.popConfirmModal.id);
  7494. }
  7495. }
  7496. };
  7497. const _withScopeId = (n2) => (vue.pushScopeId("data-v-d9e3ae7c"), n2 = n2(), vue.popScopeId(), n2);
  7498. const _hoisted_1 = {
  7499. key: 0,
  7500. class: ""
  7501. };
  7502. const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep" }, null, -1));
  7503. const _hoisted_3 = { class: "box calender" };
  7504. const _hoisted_4 = { class: "month" };
  7505. const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "fade" }, "历史最热", -1));
  7506. const _hoisted_6 = { class: "ca-title" };
  7507. const _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "calender-header" }, [
  7508. /* @__PURE__ */ vue.createElementVNode("div", null, "日"),
  7509. /* @__PURE__ */ vue.createElementVNode("div", null, "一"),
  7510. /* @__PURE__ */ vue.createElementVNode("div", null, "二"),
  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. ], -1));
  7516. const _hoisted_8 = { class: "days" };
  7517. const _hoisted_9 = ["onClick"];
  7518. const _hoisted_10 = ["href"];
  7519. const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep" }, null, -1));
  7520. const _hoisted_12 = {
  7521. key: 0,
  7522. class: "target-user-tags p1"
  7523. };
  7524. const _hoisted_13 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "标签:", -1));
  7525. const _hoisted_14 = { class: "my-tag" };
  7526. const _hoisted_15 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  7527. const _hoisted_16 = ["onClick"];
  7528. const _hoisted_17 = {
  7529. key: 1,
  7530. class: "my-box p2",
  7531. style: { "margin-top": "2rem", "margin-bottom": "0" }
  7532. };
  7533. const _hoisted_18 = {
  7534. key: 0,
  7535. class: "flex flex-center"
  7536. };
  7537. const _hoisted_19 = {
  7538. key: 1,
  7539. class: "loaded"
  7540. };
  7541. const _hoisted_20 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "楼中楼解析完成", -1));
  7542. const _hoisted_21 = {
  7543. key: 0,
  7544. ref: "tip",
  7545. class: "pop-confirm-content"
  7546. };
  7547. const _hoisted_22 = { class: "text" };
  7548. const _hoisted_23 = { class: "options" };
  7549. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  7550. const _component_Setting = vue.resolveComponent("Setting");
  7551. const _component_TagModal = vue.resolveComponent("TagModal");
  7552. const _component_PostDetail = vue.resolveComponent("PostDetail");
  7553. const _component_Base64Tooltip = vue.resolveComponent("Base64Tooltip");
  7554. const _component_MsgModal = vue.resolveComponent("MsgModal");
  7555. const _component_NotificationModal = vue.resolveComponent("NotificationModal");
  7556. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  7557. const _component_BaseButton = vue.resolveComponent("BaseButton");
  7558. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  7559. vue.createVNode(_component_Setting, {
  7560. modelValue: $data.config,
  7561. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.config = $event),
  7562. show: $data.configModal.show,
  7563. "onUpdate:show": _cache[1] || (_cache[1] = ($event) => $data.configModal.show = $event)
  7564. }, null, 8, ["modelValue", "show"]),
  7565. vue.createVNode(_component_TagModal, {
  7566. tags: $data.tags,
  7567. "onUpdate:tags": _cache[2] || (_cache[2] = ($event) => $data.tags = $event)
  7568. }, null, 8, ["tags"]),
  7569. vue.createVNode(_component_PostDetail, {
  7570. modelValue: $data.show,
  7571. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.show = $event),
  7572. ref: "postDetail",
  7573. displayType: $data.config.commentDisplayType,
  7574. "onUpdate:displayType": _cache[4] || (_cache[4] = ($event) => $data.config.commentDisplayType = $event),
  7575. onRefresh: _cache[5] || (_cache[5] = ($event) => $options.getPostDetail($data.current)),
  7576. loading: $data.loading,
  7577. refreshLoading: $data.refreshLoading
  7578. }, null, 8, ["modelValue", "displayType", "loading", "refreshLoading"]),
  7579. vue.createVNode(_component_Base64Tooltip),
  7580. vue.createVNode(_component_MsgModal),
  7581. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "#Rightbar > .sep20" }, [
  7582. $data.calendar.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  7583. _hoisted_2,
  7584. vue.createElementVNode("div", _hoisted_3, [
  7585. vue.createElementVNode("div", _hoisted_4, [
  7586. _hoisted_5,
  7587. vue.createElementVNode("div", _hoisted_6, [
  7588. vue.createElementVNode("i", {
  7589. class: "fa fa-arrow-left",
  7590. onClick: _cache[6] || (_cache[6] = ($event) => $options.getMonthDayInfo(-1)),
  7591. "aria-hidden": "true"
  7592. }),
  7593. vue.createElementVNode("span", null, vue.toDisplayString($data.calendar.year) + "年" + vue.toDisplayString($data.calendar.month + 1) + "月", 1),
  7594. vue.createElementVNode("i", {
  7595. class: "fa fa-arrow-right",
  7596. onClick: _cache[7] || (_cache[7] = ($event) => $options.getMonthDayInfo(1)),
  7597. "aria-hidden": "true"
  7598. })
  7599. ])
  7600. ]),
  7601. _hoisted_7,
  7602. vue.createElementVNode("div", _hoisted_8, [
  7603. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.calendar.dayCount + $data.calendar.firstDayWeek, (i) => {
  7604. return vue.openBlock(), vue.createElementBlock("div", {
  7605. class: vue.normalizeClass([
  7606. "day",
  7607. $data.calendar.select === `${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}` ? "active" : ""
  7608. ]),
  7609. onClick: ($event) => $data.calendar.select = `${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}`
  7610. }, [
  7611. i - $data.calendar.firstDayWeek > 0 ? (vue.openBlock(), vue.createElementBlock("a", {
  7612. key: 0,
  7613. href: `/v2hot?${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}`
  7614. }, vue.toDisplayString(i - $data.calendar.firstDayWeek > 0 ? i - $data.calendar.firstDayWeek : ""), 9, _hoisted_10)) : vue.createCommentVNode("", true)
  7615. ], 10, _hoisted_9);
  7616. }), 256))
  7617. ])
  7618. ]),
  7619. _hoisted_11
  7620. ])) : vue.createCommentVNode("", true)
  7621. ])),
  7622. vue.createVNode(_component_NotificationModal, {
  7623. modelValue: $data.notificationModal.show,
  7624. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.notificationModal.show = $event),
  7625. list: $data.notificationModal.list,
  7626. loading: $data.notificationModal.loading,
  7627. total: $data.notificationModal.total,
  7628. pages: $data.notificationModal.pages
  7629. }, null, 8, ["modelValue", "list", "loading", "total", "pages"]),
  7630. !$data.stopMe ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  7631. $options.isMember && $data.isLogin && $data.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
  7632. _hoisted_13,
  7633. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.targetUserTags, (i) => {
  7634. return vue.openBlock(), vue.createElementBlock("span", _hoisted_14, [
  7635. _hoisted_15,
  7636. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  7637. vue.createElementVNode("i", {
  7638. class: "fa fa-trash-o remove",
  7639. onClick: ($event) => $options.removeTargetUserTag(i)
  7640. }, null, 8, _hoisted_16)
  7641. ]);
  7642. }), 256)),
  7643. vue.createElementVNode("span", {
  7644. class: "add-tag ago",
  7645. onClick: _cache[9] || (_cache[9] = (...args) => $options.addTargetUserTag && $options.addTargetUserTag(...args)),
  7646. title: "添加标签"
  7647. }, "+")
  7648. ])) : vue.createCommentVNode("", true),
  7649. $options.isPost && !$data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [
  7650. $data.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18, [
  7651. vue.createVNode(_component_BaseLoading)
  7652. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
  7653. _hoisted_20,
  7654. vue.createVNode(_component_BaseButton, {
  7655. size: "small",
  7656. onClick: $options.showPost
  7657. }, {
  7658. default: vue.withCtx(() => [
  7659. vue.createTextVNode("点击显示")
  7660. ]),
  7661. _: 1
  7662. }, 8, ["onClick"])
  7663. ]))
  7664. ])) : vue.createCommentVNode("", true)
  7665. ], 64)) : vue.createCommentVNode("", true),
  7666. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  7667. vue.createVNode(vue.Transition, null, {
  7668. default: vue.withCtx(() => [
  7669. $data.popConfirmModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, [
  7670. vue.createElementVNode("div", _hoisted_22, vue.toDisplayString($data.popConfirmModal.title), 1),
  7671. vue.createElementVNode("div", _hoisted_23, [
  7672. vue.createVNode(_component_BaseButton, {
  7673. type: "link",
  7674. size: "small",
  7675. onClick: vue.withModifiers($options.popConfirmModalCancel, ["stop"])
  7676. }, {
  7677. default: vue.withCtx(() => [
  7678. vue.createTextVNode("取消")
  7679. ]),
  7680. _: 1
  7681. }, 8, ["onClick"]),
  7682. vue.createVNode(_component_BaseButton, {
  7683. size: "small",
  7684. onClick: vue.withModifiers($options.popConfirmModalConfirm, ["stop"])
  7685. }, {
  7686. default: vue.withCtx(() => [
  7687. vue.createTextVNode("确认")
  7688. ]),
  7689. _: 1
  7690. }, 8, ["onClick"])
  7691. ])
  7692. ], 512)) : vue.createCommentVNode("", true)
  7693. ]),
  7694. _: 1
  7695. })
  7696. ]))
  7697. ], 64);
  7698. }
  7699. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-d9e3ae7c"]]);
  7700. let isMobile = !document.querySelector("#Rightbar");
  7701. let $section = document.createElement("section");
  7702. $section.id = "app";
  7703. function run() {
  7704. window.user = DefaultUser;
  7705. window.targetUserName = "";
  7706. window.pageType = void 0;
  7707. window.pageData = { pageNo: 1 };
  7708. window.config = getDefaultConfig();
  7709. window.isNight = $(".Night").length === 1;
  7710. window.cb = null;
  7711. window.stopMe = false;
  7712. window.isLogin = false;
  7713. window.postList = [];
  7714. window.isDeadline = dayjs().isAfter(dayjs("2024-11-26"));
  7715. window.parse = {
  7716. //解析主题内容
  7717. async parsePostContent(post, body, htmlText) {
  7718. let once = htmlText.match(/var once = "([\d]+)";/);
  7719. if (once && once[1]) {
  7720. post.once = once[1];
  7721. }
  7722. post.isReport = htmlText.includes("你已对本主题进行了报告");
  7723. let wrapper = body.find("#Main");
  7724. if (!post.title || !post.content_rendered) {
  7725. let h1 = wrapper.find("h1");
  7726. if (h1) {
  7727. post.title = h1[0].innerText;
  7728. }
  7729. }
  7730. let as = wrapper.find(".header > a");
  7731. if (as.length) {
  7732. post.node.title = as[1].innerText;
  7733. post.node.url = as[1].href;
  7734. }
  7735. let aName = wrapper.find(".header small.gray a:nth-child(1)");
  7736. if (aName.length) {
  7737. post.member.username = aName[0].innerText;
  7738. }
  7739. let spanEl = wrapper.find(".header small.gray span");
  7740. if (spanEl.length) {
  7741. post.createDateAgo = spanEl[0].innerText;
  7742. post.createDate = spanEl[0].title;
  7743. }
  7744. let avatarEl = wrapper.find(".header .avatar");
  7745. if (avatarEl.length) {
  7746. post.member.avatar_large = avatarEl[0].src;
  7747. }
  7748. let topic_buttons = body.find(".topic_buttons");
  7749. if (topic_buttons.length) {
  7750. let favoriteNode = topic_buttons.find(".tb:first");
  7751. if (favoriteNode.length) {
  7752. post.isFavorite = favoriteNode[0].innerText === "取消收藏";
  7753. }
  7754. let ignoreNode = topic_buttons.find(".tb:nth-child(3)");
  7755. if (ignoreNode.length) {
  7756. post.isIgnore = ignoreNode[0].innerText === "取消忽略";
  7757. }
  7758. let thankNode = topic_buttons.find("#topic_thank .tb");
  7759. if (!thankNode.length) {
  7760. post.isThanked = true;
  7761. }
  7762. let topic_stats = topic_buttons.find(".topic_stats");
  7763. if (topic_stats.length) {
  7764. let text = topic_stats[0].innerText;
  7765. let reg1 = text.matchAll(/([\d]+)[\s]*人收藏/g);
  7766. let collectCountReg = [...reg1];
  7767. if (collectCountReg.length) {
  7768. post.collectCount = Number(collectCountReg[0][1]);
  7769. }
  7770. reg1 = text.matchAll(/([\d]+)[\s]*likes/g);
  7771. collectCountReg = [...reg1];
  7772. if (collectCountReg.length) {
  7773. post.collectCount = Number(collectCountReg[0][1]);
  7774. }
  7775. let reg2 = text.matchAll(/([\d]+)[\s]*人感谢/g);
  7776. let thankCountReg = [...reg2];
  7777. if (thankCountReg.length) {
  7778. post.thankCount = Number(thankCountReg[0][1]);
  7779. }
  7780. let reg3 = text.matchAll(/([\d]+)[\s]*次点击/g);
  7781. let clickCountReg = [...reg3];
  7782. if (clickCountReg.length) {
  7783. post.clickCount = Number(clickCountReg[0][1]);
  7784. }
  7785. reg3 = text.matchAll(/([\d]+)[\s]*views/g);
  7786. clickCountReg = [...reg3];
  7787. if (clickCountReg.length) {
  7788. post.clickCount = Number(clickCountReg[0][1]);
  7789. }
  7790. }
  7791. }
  7792. let header = body.find(`#Main .box`).first();
  7793. let temp = header.clone();
  7794. temp.find(".topic_buttons").remove();
  7795. temp.find(".inner").remove();
  7796. temp.find(".header").remove();
  7797. functions.checkPhotoLink2Img(temp[0]);
  7798. post.headerTemplate = temp[0].innerHTML;
  7799. return post;
  7800. },
  7801. //解析OP信息
  7802. async parseOp(post) {
  7803. if (!post.member.id) {
  7804. let userRes = await fetch(location.origin + "/api/members/show.json?username=" + post.member.username);
  7805. if (userRes.status === 200) {
  7806. post.member = await userRes.json();
  7807. }
  7808. }
  7809. if (post.member.id) {
  7810. let date = new Date(post.member.created * 1e3);
  7811. let createStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
  7812. date.setHours(0);
  7813. date.setMinutes(0);
  7814. date.setSeconds(0);
  7815. date.setMilliseconds(0);
  7816. let now = /* @__PURE__ */ new Date();
  7817. now.setHours(0);
  7818. now.setMinutes(0);
  7819. now.setSeconds(0);
  7820. now.setMilliseconds(0);
  7821. let d2 = now.getTime() - date.getTime();
  7822. let isNew = d2 <= 1e3 * 60 * 60 * 24 * 15;
  7823. post.member.createDate = createStr + " 注册";
  7824. post.member.isNew = isNew;
  7825. } else {
  7826. post.member.createDate = "用户已被注销/封禁";
  7827. post.member.isNew = true;
  7828. }
  7829. return post;
  7830. },
  7831. //获取主题所有回复
  7832. async getPostAllReplies(post, body, htmlText, pageNo = 1) {
  7833. var _a, _b;
  7834. if (body.find("#no-comments-yet").length) {
  7835. return post;
  7836. }
  7837. let boxs = body.find(`#Main .box`);
  7838. let box = boxs[1];
  7839. let cells = box.querySelectorAll(".cell");
  7840. if (cells && cells.length) {
  7841. post.fr = cells[0].querySelector(".cell .fr").innerHTML;
  7842. cells = Array.from(cells);
  7843. let snow = cells[0].querySelector(".snow");
  7844. post.lastReplyDate = ((_b = (_a = snow == null ? void 0 : snow.nextSibling) == null ? void 0 : _a.nodeValue) == null ? void 0 : _b.trim()) || "";
  7845. let repliesMap = [];
  7846. if (cells[1].id) {
  7847. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(1)) });
  7848. let replyList = functions.getAllReply(repliesMap);
  7849. functions.createList(post, replyList);
  7850. return post;
  7851. } else {
  7852. let promiseList = [];
  7853. return new Promise((resolve, reject) => {
  7854. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7855. let pages = cells[1].querySelectorAll("a.page_normal");
  7856. pages = Array.from(pages);
  7857. let url = location.origin + "/t/" + post.id;
  7858. for (let i = 0; i < pages.length; i++) {
  7859. let currentPageNo = Number(pages[i].innerText);
  7860. promiseList.push(this.fetchPostOtherPageReplies(url + "?p=" + currentPageNo, currentPageNo));
  7861. }
  7862. Promise.allSettled(promiseList).then(
  7863. (r###lts) => {
  7864. r###lts.filter((r###lt) => r###lt.status === "fulfilled").map((v) => repliesMap.push(v.value));
  7865. let replyList = functions.getAllReply(repliesMap);
  7866. functions.createList(post, replyList);
  7867. resolve(post);
  7868. }
  7869. );
  7870. });
  7871. }
  7872. }
  7873. },
  7874. //请求主题其他页的回复
  7875. fetchPostOtherPageReplies(href, pageNo) {
  7876. return new Promise((resolve) => {
  7877. $.get(href).then((res) => {
  7878. let s = res.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7879. let box = $(s[0]).find("#Main .box")[1];
  7880. let cells = box.querySelectorAll(".cell");
  7881. cells = Array.from(cells);
  7882. resolve({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7883. }).catch((r2) => {
  7884. if (r2.status === 403) {
  7885. functions.cbChecker({ type: "restorePost", value: null });
  7886. }
  7887. });
  7888. });
  7889. },
  7890. //解析页面的回复
  7891. parsePageReplies(nodes) {
  7892. let replyList = [];
  7893. nodes.forEach((node, index) => {
  7894. if (!node.id)
  7895. return;
  7896. let item = {
  7897. level: 0,
  7898. thankCount: 0,
  7899. replyCount: 0,
  7900. isThanked: false,
  7901. isOp: false,
  7902. isDup: false,
  7903. id: node.id.replace("r_", "")
  7904. };
  7905. let reply_content = node.querySelector(".reply_content");
  7906. functions.checkPhotoLink2Img(reply_content);
  7907. item.reply_content = reply_content.innerHTML;
  7908. item.reply_text = reply_content.textContent;
  7909. let { users, floor } = this.parseReplyContent(item.reply_content);
  7910. item.hideCallUserReplyContent = item.reply_content;
  7911. if (users.length === 1) {
  7912. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(?:<ul [\s\S]+<\/ul>)?(\s#[\d]+)?\s(<br>)?/, () => "");
  7913. }
  7914. item.replyUsers = users;
  7915. item.replyFloor = floor;
  7916. let ago = node.querySelector(".ago");
  7917. item.date = ago.textContent;
  7918. let userNode = node.querySelector("strong a");
  7919. item.username = userNode.textContent;
  7920. let avatar = node.querySelector("td img");
  7921. item.avatar = avatar.src;
  7922. let no = node.querySelector(".no");
  7923. item.floor = Number(no.textContent);
  7924. let thank_area = node.querySelector(".thank_area");
  7925. if (thank_area) {
  7926. item.isThanked = thank_area.classList.contains("thanked");
  7927. }
  7928. let small = node.querySelector(".small");
  7929. if (small) {
  7930. item.thankCount = Number(small.textContent);
  7931. }
  7932. let op = node.querySelector(".op");
  7933. if (op) {
  7934. item.isOp = true;
  7935. }
  7936. let mod = node.querySelector(".mod");
  7937. if (mod) {
  7938. item.isMod = true;
  7939. }
  7940. replyList.push(item);
  7941. });
  7942. return replyList;
  7943. },
  7944. //解析回复内容,解析出@用户,回复楼层。用于后续生成嵌套楼层
  7945. parseReplyContent(str) {
  7946. if (!str)
  7947. return;
  7948. let users = [];
  7949. let getUsername = (userStr) => {
  7950. users.push(userStr);
  7951. };
  7952. let userReg = /@<a href="\/member\/([^'" ]+)/g;
  7953. let has = str.matchAll(userReg);
  7954. let res2 = [...has];
  7955. if (res2.length > 1) {
  7956. res2.map((item) => {
  7957. getUsername(item[1]);
  7958. });
  7959. }
  7960. if (res2.length === 1) {
  7961. getUsername(res2[0][1]);
  7962. }
  7963. let floor = -1;
  7964. if (users.length === 1) {
  7965. let floorReg = /@<a href="\/member\/[\s\S]+?<\/a>(?:<ul [\s\S]+<\/ul>)?[\s]+#([\d]+)/g;
  7966. let hasFloor = str.matchAll(floorReg);
  7967. let res = [...hasFloor];
  7968. if (res.length) {
  7969. floor = Number(res[0][1]);
  7970. }
  7971. }
  7972. return { users, floor };
  7973. },
  7974. //获取主题详情
  7975. async getPostDetail(post, body, htmlText, pageNo = 1) {
  7976. post = await this.parsePostContent(post, body, htmlText);
  7977. return await this.getPostAllReplies(post, body, htmlText, pageNo);
  7978. },
  7979. //解析页面主题列表
  7980. parsePagePostList(list, box) {
  7981. list.forEach((itemDom) => {
  7982. let item_title = itemDom.querySelector(".item_title");
  7983. if (!item_title)
  7984. return;
  7985. let item = getDefaultPost();
  7986. itemDom.classList.add("post-item");
  7987. let a = item_title.querySelector("a");
  7988. let { href, id } = functions.parseA(a);
  7989. item.id = String(Number(id));
  7990. a.href = item.href = href;
  7991. item.url = location.origin + "/api/topics/show.json?id=" + item.id;
  7992. itemDom.classList.add(`id_${id}`);
  7993. itemDom.dataset["href"] = href;
  7994. let td = itemDom.querySelector("td:nth-child(4)");
  7995. if (!td) {
  7996. td = itemDom.querySelector("td:nth-child(2)");
  7997. }
  7998. td.style.position = "relative";
  7999. let toggle = document.createElement("div");
  8000. toggle.dataset["id"] = item.id;
  8001. toggle.classList.add("toggle");
  8002. toggle.innerText = "预览";
  8003. td.append(toggle);
  8004. if (window.config.viewType === "card") {
  8005. window.postList.push(item);
  8006. }
  8007. });
  8008. localStorage.setItem("d", "");
  8009. if (window.pageType === PageType.Home) {
  8010. const a = () => {
  8011. let d2;
  8012. if (window.user.username) {
  8013. d2 = $(window.atob("LnYycC1ob3Zlci1idG4=")).length;
  8014. } else {
  8015. d2 = $(window.atob("LnYycC1mb290ZXI=")).length;
  8016. }
  8017. if (d2 !== 0) {
  8018. window.stopMe = true;
  8019. localStorage.setItem("d", "1");
  8020. functions.cbChecker({ type: "syncData" });
  8021. } else {
  8022. localStorage.setItem("d", "");
  8023. }
  8024. };
  8025. a();
  8026. setTimeout(a, 1e3);
  8027. setTimeout(a, 2e3);
  8028. setTimeout(a, 3e3);
  8029. setTimeout(a, 5e3);
  8030. setTimeout(a, 1e4);
  8031. setTimeout(a, 15e3);
  8032. }
  8033. const setF = (res) => {
  8034. let rIndex = window.postList.findIndex((w) => w.id == res.id);
  8035. if (rIndex > -1) {
  8036. window.postList[rIndex] = Object.assign(window.postList[rIndex], res);
  8037. functions.cbChecker({ type: "syncList" });
  8038. }
  8039. let itemDom = box.querySelector(`.id_${res.id}`);
  8040. itemDom.classList.add("preview");
  8041. if (res.content_rendered) {
  8042. functions.appendPostContent(res, itemDom);
  8043. }
  8044. };
  8045. if (window.config.viewType === "card" && !window.stopMe) {
  8046. let cacheDataStr = localStorage.getItem("cacheData");
  8047. let cacheData = [];
  8048. if (cacheDataStr) {
  8049. cacheData = JSON.parse(cacheDataStr);
  8050. let now = Date.now();
  8051. cacheData = cacheData.filter((v) => {
  8052. return v.created > now / 1e3 - 60 * 60 * 24 * 3;
  8053. });
  8054. }
  8055. let fetchIndex = 0;
  8056. for (let i = 0; i < window.postList.length; i++) {
  8057. let item = window.postList[i];
  8058. let rItem = cacheData.find((w) => w.id == item.id);
  8059. if (rItem) {
  8060. rItem.href = item.href;
  8061. setF(rItem);
  8062. } else {
  8063. fetchIndex++;
  8064. setTimeout(() => {
  8065. $.get(item.url).then((v) => {
  8066. if (v && v.length) {
  8067. let res = getDefaultPost(v[0]);
  8068. res.href = item.href;
  8069. cacheData.push(res);
  8070. localStorage.setItem("cacheData", JSON.stringify(cacheData));
  8071. setF(res);
  8072. }
  8073. });
  8074. }, fetchIndex < 4 ? 0 : (fetchIndex - 4) * 1e3);
  8075. }
  8076. }
  8077. }
  8078. },
  8079. //创建记事本子条目
  8080. async createNoteItem(itemName) {
  8081. return new Promise(async (resolve) => {
  8082. if (!window.isLogin)
  8083. return resolve(null);
  8084. let data = new FormData();
  8085. data.append("content", itemName);
  8086. data.append("parent_id", 0);
  8087. data.append("syntax", 0);
  8088. let apiRes = await fetch(`${location.origin}/notes/new`, { method: "post", body: data });
  8089. if (apiRes.redirected && apiRes.status === 200) {
  8090. resolve(apiRes.url.substr(-5));
  8091. return;
  8092. }
  8093. resolve(null);
  8094. });
  8095. },
  8096. //编辑记事本子条目
  8097. async editNoteItem(val, id) {
  8098. if (!window.isLogin)
  8099. return;
  8100. if (!id)
  8101. return;
  8102. let data = new FormData();
  8103. data.append("content", val);
  8104. data.append("syntax", 0);
  8105. let apiRes = await fetch(`${location.origin}/notes/edit/${id}`, {
  8106. method: "post",
  8107. body: data
  8108. });
  8109. return apiRes.redirected && apiRes.status === 200;
  8110. },
  8111. //标签操作
  8112. async saveTags(val) {
  8113. if (!window.isLogin)
  8114. return;
  8115. for (const [key, value] of Object.entries(val)) {
  8116. if (!value.length)
  8117. delete val[key];
  8118. }
  8119. return await this.editNoteItem(window.user.tagPrefix + JSON.stringify(val), window.user.tagsId);
  8120. },
  8121. //imgur图片删除hash操作
  8122. async saveImgurList(val) {
  8123. if (!window.isLogin)
  8124. return;
  8125. return;
  8126. }
  8127. };
  8128. function initMonkeyMenu() {
  8129. try {
  8130. _GM_registerMenuCommand("脚本设置", () => {
  8131. functions.cbChecker({ type: "openSetting" });
  8132. });
  8133. _GM_registerMenuCommand("仓库地址", () => {
  8134. functions.openNewTab(DefaultVal.git, true);
  8135. });
  8136. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  8137. } catch (e2) {
  8138. console.error("无法使用Tampermonkey");
  8139. }
  8140. }
  8141. function initStyle() {
  8142. if (window.isNight) {
  8143. document.documentElement.classList.add("dark");
  8144. }
  8145. let style2 = `
  8146. html, body {
  8147. font-size: 62.5%;
  8148. }
  8149. :root{
  8150. --box-border-radius:8px;
  8151. }
  8152. .page_current, .page_normal {
  8153. --box-border-radius: 5px;
  8154. padding: .6rem 0.8rem!important;
  8155. }
  8156. .box{
  8157. box-shadow:rgba(0, 0, 0, 0.08) 0px 4px 12px;
  8158. }
  8159. #Tabs{
  8160. border-top-left-radius: var(--box-border-radius) !important;
  8161. border-top-right-radius: var(--box-border-radius) !important;
  8162. }
  8163. #Main .cell .count_livid {
  8164. font-size: 14px;
  8165. font-weight: bold;
  8166. padding: 3px 10px;
  8167. border-radius: 5px;
  8168. }
  8169. #Wrapper {
  8170. height: unset !important;
  8171. width: unset !important;
  8172. }
  8173. #Wrapper > .content {
  8174. height: unset !important;
  8175. width: unset !important;
  8176. max-width:1100px !important;
  8177. }
  8178. ${location.href.includes("wow") ? "" : `
  8179. .post-item {
  8180. background: white;
  8181. }
  8182. `}
  8183. .post-item > .post-content {
  8184. height: 0;
  8185. margin-top: 0;
  8186. }
  8187. .post-item:hover .toggle {
  8188. display: flex;
  8189. }
  8190. .toggle {
  8191. position: absolute;
  8192. right: ${window.config.viewType === "simple" ? "5rem" : 0};
  8193. top: ${window.config.viewType === "simple" ? 0 : "0.5rem"};
  8194. width: 5rem;
  8195. height: 100%;
  8196. display: flex;
  8197. justify-content: flex-end;
  8198. align-items: flex-end;
  8199. cursor: pointer;
  8200. font-size: 1.2rem;
  8201. color: var(--link-color);
  8202. display: none;
  8203. padding-right: 1rem;
  8204. }
  8205. .preview {
  8206. margin: 1rem 0;
  8207. border: 1px solid transparent;
  8208. border-radius: var(--box-border-radius);
  8209. cursor: pointer;
  8210. }
  8211. .preview:hover {
  8212. border: 1px solid #c8c8c8;
  8213. }
  8214. .preview > .post-content {
  8215. height: unset !important;
  8216. margin-top: 0.5rem !important;
  8217. }
  8218. .preview > .post-content.show-all {
  8219. max-height: unset;
  8220. -webkit-mask-image:none;
  8221. }
  8222. .preview .topic-link:link {
  8223. color: black !important;
  8224. }
  8225. .post-content {
  8226. margin-top: 0.5rem;
  8227. display: block;
  8228. max-height: 30rem;
  8229. overflow: hidden;
  8230. text-decoration: unset !important;
  8231. line-break: anywhere;
  8232. -webkit-mask-image: linear-gradient(180deg,#000 60%,transparent);
  8233. }
  8234. .show-more {
  8235. display: none;
  8236. }
  8237. .preview > .show-more {
  8238. font-size: 1.3rem;
  8239. text-align: right;
  8240. height: 3rem;
  8241. display: flex;
  8242. align-items: center;
  8243. justify-content: center;
  8244. position: relative;
  8245. z-index: 9;
  8246. }
  8247. .post-content:visited {
  8248. color: #afb9c1 !important;
  8249. }
  8250. .post-content:link {
  8251. color: #494949;
  8252. }
  8253. ${location.href.includes("wow") ? "" : `
  8254. .Night .post-item {
  8255. background: #18222d !important;
  8256. }
  8257. `}
  8258. .Night .preview {
  8259. border: 1px solid #3b536e;
  8260. }
  8261. .Night .preview > .post-content:link {
  8262. color: #d1d5d9;
  8263. }
  8264. .Night .preview > .post-content:visited {
  8265. color: #393f4e !important;
  8266. }
  8267. .Night .preview .topic-link:link {
  8268. color: #c0dbff !important;
  8269. }
  8270. ${window.config.viewType === "simple" ? `
  8271. ${window.pageType !== PageType.Member ? `
  8272. .item table tr td:first-child{display:none;}
  8273. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  8274. .item table tr td .sep5{display:none;}
  8275. .item table tr td .topic_info{display:none;}
  8276. .item {border-bottom:none;}
  8277. .avatar,#avatar{display:none;}
  8278. ` : ""}
  8279. #Logo {background-image:url('https://i.imgur.com/i9VgUtM.png');}
  8280. .bigger a, .top:nth-last-child(5){color: transparent!important;text-shadow: #b0b0b0 0 0 6px;user-select: none;}
  8281. // .bigger a:before,.top:nth-last-child(5):before{content:'Mona Lisa';position: absolute;background: white;}
  8282. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  8283. ` : ""}
  8284. ${window.config.customBgColor ? `#Wrapper {
  8285. background: ${window.config.customBgColor} !important;
  8286. background-image: unset !important;
  8287. }` : ""}
  8288. .top{
  8289. position:relative;
  8290. }
  8291. .new{
  8292. position: absolute;
  8293. background: red;
  8294. font-size: 10px;
  8295. border-radius: 4px;
  8296. padding: 0px 2px;
  8297. color: white;
  8298. right: -9px;
  8299. top: -3px;
  8300. }
  8301. }
  8302. `;
  8303. let addStyle2 = document.createElement("style");
  8304. addStyle2.rel = "stylesheet";
  8305. addStyle2.type = "text/css";
  8306. addStyle2.innerHTML = style2;
  8307. window.document.head.append(addStyle2);
  8308. }
  8309. function qianDao() {
  8310. let timeNow = (/* @__PURE__ */ new Date()).getUTCFullYear() + "/" + ((/* @__PURE__ */ new Date()).getUTCMonth() + 1) + "/" + (/* @__PURE__ */ new Date()).getUTCDate();
  8311. if (window.pageType === PageType.Home) {
  8312. let qiandao2 = document.querySelector('.box .inner a[href="/mission/daily"]');
  8313. if (qiandao2) {
  8314. qianDao_(qiandao2, timeNow);
  8315. } else if (document.getElementById("gift_v2excellent")) {
  8316. document.getElementById("gift_v2excellent").click();
  8317. localStorage.setItem("menu_clockInTime", timeNow);
  8318. } else
  8319. ;
  8320. } else {
  8321. let timeOld = localStorage.getItem("menu_clockInTime");
  8322. if (!timeOld || timeOld != timeNow) {
  8323. qianDaoStatus_(timeNow);
  8324. }
  8325. }
  8326. }
  8327. function qianDao_(qiandao2, timeNow) {
  8328. let url = location.origin + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector("div#Top .tools, #menu-body").innerHTML)[0];
  8329. $.get(url).then((r2) => {
  8330. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8331. let html = $(bodyText[0]);
  8332. if (html.find("li.fa.fa-ok-sign").length) {
  8333. html = html.find("#Main").text().match(/已连续登录 (\d+?) 天/)[0];
  8334. localStorage.setItem("menu_clockInTime", timeNow);
  8335. console.info("[V2Next] 自动签到完成!");
  8336. if (qiandao2) {
  8337. qiandao2.textContent = `自动签到完成!${html}`;
  8338. qiandao2.href = "javascript:void(0);";
  8339. }
  8340. } else {
  8341. console.warn("[V2Next] 自动签到失败!请关闭其他插件或脚本。如果连续几天都签到失败,请联系作者解决!");
  8342. if (qiandao2)
  8343. qiandao2.textContent = "自动签到失败!请尝试手动签到!";
  8344. }
  8345. });
  8346. }
  8347. function qianDaoStatus_(timeNow) {
  8348. $.get(location.origin + "/mission/daily").then((r2) => {
  8349. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8350. let html = $(bodyText[0]);
  8351. if (html.find('input[value^="#取"]').length) {
  8352. qianDao_(null, timeNow);
  8353. } else {
  8354. console.info("[V2Next] 已经签过到了。");
  8355. localStorage.setItem("menu_clockInTime", timeNow);
  8356. }
  8357. });
  8358. }
  8359. function getNoteItemContent(id, prefix) {
  8360. return new Promise((resolve, reject) => {
  8361. $.get(location.origin + "/notes/edit/" + id).then((r2) => {
  8362. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8363. let body = $(bodyText[0]);
  8364. let text = body.find(".note_editor").text();
  8365. if (text === prefix) {
  8366. resolve({});
  8367. } else {
  8368. let tagJson = text.substring(prefix.length);
  8369. try {
  8370. resolve(JSON.parse(tagJson));
  8371. } catch (e2) {
  8372. resolve({});
  8373. }
  8374. }
  8375. });
  8376. });
  8377. }
  8378. async function initNoteData() {
  8379. $.get(location.origin + "/notes").then(async (r2) => {
  8380. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8381. let body = $(bodyText[0]);
  8382. let items = body.find("#Main .box .note_item_title a");
  8383. if (window.config.openTag) {
  8384. let tagItems2 = Array.from(items).filter((v) => v.innerText.includes(window.user.tagPrefix));
  8385. if (tagItems2.length) {
  8386. window.user.tagsId = tagItems2[0].href.substr(-5);
  8387. window.user.tags = await getNoteItemContent(window.user.tagsId, window.user.tagPrefix);
  8388. } else {
  8389. let r22 = await window.parse.createNoteItem(window.user.tagPrefix);
  8390. r22 && (window.user.tagsId = r22);
  8391. }
  8392. }
  8393. let tagItems = Array.from(items).filter((v) => v.innerText.includes(window.user.configPrefix));
  8394. if (tagItems.length) {
  8395. window.user.configNoteId = tagItems[0].href.substr(-5);
  8396. let config2 = await getNoteItemContent(window.user.configNoteId, window.user.configPrefix);
  8397. window.config = functions.deepAssign(window.config, config2);
  8398. } else {
  8399. let r22 = await window.parse.createNoteItem(window.user.configPrefix);
  8400. r22 && (window.user.configNoteId = r22);
  8401. }
  8402. functions.cbChecker({ type: "syncData" });
  8403. functions.cbChecker({ type: "getConfigSuccess" });
  8404. });
  8405. }
  8406. function addSettingText() {
  8407. let app = $(`<a href="${DefaultVal.mobileScript}" target='_blank' class="top"><i class="fa fa-android" aria-hidden="true"></i></a>`);
  8408. $(".tools").prepend(app);
  8409. let setting = $(`<a href="/" class="top v2next-setting"><span>脚本设置</span></a>`);
  8410. setting.on("click", function(e2) {
  8411. functions.stopEvent(e2);
  8412. functions.cbChecker({ type: "openSetting" });
  8413. });
  8414. $(".tools").prepend(setting);
  8415. }
  8416. async function init() {
  8417. let top2 = document.querySelector(".tools .top:nth-child(2)");
  8418. if (top2 && top2.textContent !== "注册") {
  8419. window.isLogin = true;
  8420. window.user.username = top2.textContent;
  8421. window.user.avatar = $("#Rightbar .box .avatar").attr("src");
  8422. }
  8423. functions.initConfig();
  8424. let box;
  8425. let list;
  8426. let last;
  8427. let headerWrap;
  8428. let { pageData, pageType, username } = functions.checkPageType();
  8429. window.pageType = pageType;
  8430. window.pageData = pageData;
  8431. window.targetUserName = username;
  8432. initStyle();
  8433. switch (window.pageType) {
  8434. case PageType.Node:
  8435. box = document.querySelectorAll("#Wrapper #Main .box");
  8436. try {
  8437. headerWrap = $('<div class="post-item"></div>');
  8438. if (window.config.viewType === "card")
  8439. headerWrap[0].classList.add("preview");
  8440. $(box[1]).prepend(headerWrap);
  8441. $(box[1]).children().slice(1, 3).each(function() {
  8442. if (this.classList.contains("cell")) {
  8443. headerWrap.append(this);
  8444. }
  8445. });
  8446. headerWrap = $('<div class="post-item"></div>');
  8447. if (window.config.viewType === "card")
  8448. headerWrap[0].classList.add("preview");
  8449. $(box[1]).append(headerWrap);
  8450. $(box[1]).children().slice(2).each(function() {
  8451. if (this.classList.contains("cell")) {
  8452. headerWrap.append(this);
  8453. }
  8454. });
  8455. box[1].style.boxShadow = "unset";
  8456. box[1].style.background = "unset";
  8457. box[1].style.overflow = "hidden";
  8458. } catch (e2) {
  8459. console.log("PageType-Node解析报错了", e2);
  8460. }
  8461. let topics = box[1].querySelector("#TopicsNode");
  8462. list = topics.querySelectorAll(".cell");
  8463. list[0].before($section);
  8464. window.parse.parsePagePostList(list, box[1]);
  8465. break;
  8466. case PageType.Changes:
  8467. case PageType.Home:
  8468. box = document.querySelector("#Wrapper #Main .box");
  8469. try {
  8470. headerWrap = $('<div class="post-item"></div>');
  8471. if (window.config.viewType === "card")
  8472. headerWrap[0].classList.add("preview");
  8473. $(box).prepend(headerWrap);
  8474. $(box).children().slice(1, 3).each(function() {
  8475. if (!this.classList.contains("item")) {
  8476. headerWrap.append(this);
  8477. }
  8478. });
  8479. if (window.isDeadline && $(".tab_current").text() == "最热") {
  8480. 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>`));
  8481. }
  8482. last = $(box).children().last();
  8483. last.addClass("cell post-item");
  8484. if (window.config.viewType === "card")
  8485. last[0].classList.add("preview");
  8486. box.style.boxShadow = "unset";
  8487. box.style.background = "unset";
  8488. box.style.overflow = "hidden";
  8489. } catch (e2) {
  8490. console.log("PageType-Home解析报错了", e2);
  8491. }
  8492. list = box.querySelectorAll(".item");
  8493. list[0].before($section);
  8494. window.parse.parsePagePostList(list, box);
  8495. break;
  8496. case PageType.Post:
  8497. let d2 = localStorage.getItem("d");
  8498. if (d2) {
  8499. window.stopMe = true;
  8500. functions.cbChecker({ type: "syncData" });
  8501. return;
  8502. }
  8503. box = document.querySelector("#Wrapper #Main .box");
  8504. box.after($section);
  8505. let r2 = await functions.checkPostReplies(window.pageData.id, false);
  8506. if (r2) {
  8507. window.stopMe = true;
  8508. functions.cbChecker({ type: "syncData" });
  8509. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,脚本已停止解析楼中楼" });
  8510. return;
  8511. }
  8512. if (window.config.postWidth) {
  8513. let Main = $("#Main");
  8514. Main.css({
  8515. "width": window.config.postWidth,
  8516. margin: "unset"
  8517. });
  8518. $("#Wrapper > .content").css({
  8519. "max-width": "unset",
  8520. display: "flex",
  8521. "justify-content": "center",
  8522. gap: "20px"
  8523. });
  8524. Main.after($("#Rightbar"));
  8525. }
  8526. let post = getDefaultPost({ id: window.pageData.id });
  8527. let body = $(document.body);
  8528. let htmlText = document.documentElement.outerHTML;
  8529. window.parse.parsePostContent(
  8530. post,
  8531. body,
  8532. htmlText
  8533. ).then(async (res) => {
  8534. await functions.cbChecker({ type: "postContent", value: res });
  8535. await window.parse.parseOp(res);
  8536. });
  8537. window.parse.getPostAllReplies(
  8538. post,
  8539. body,
  8540. htmlText,
  8541. window.pageData.pageNo
  8542. ).then(async (res1) => {
  8543. await functions.cbChecker({ type: "postReplies", value: res1 });
  8544. });
  8545. break;
  8546. case PageType.Member:
  8547. box = document.querySelectorAll("#Wrapper #Main .box");
  8548. if (location.pathname.includes("/replies")) {
  8549. box[0].after($section);
  8550. } else if (location.pathname.includes("/topics")) {
  8551. box[0].after($section);
  8552. } else {
  8553. if (window.config.openTag) {
  8554. box[0].style.borderBottom = "none";
  8555. box[0].style["border-bottom-left-radius"] = "0";
  8556. box[0].style["border-bottom-right-radius"] = "0";
  8557. }
  8558. try {
  8559. headerWrap = $('<div class="post-item"></div>');
  8560. if (window.config.viewType === "card")
  8561. headerWrap[0].classList.add("preview");
  8562. $(box[1]).prepend(headerWrap);
  8563. $(box[1]).children().slice(1, 2).each(function() {
  8564. if (!this.classList.contains("item")) {
  8565. headerWrap.append(this);
  8566. }
  8567. });
  8568. last = $(box[1]).children().last();
  8569. last.addClass("cell post-item");
  8570. if (window.config.viewType === "card")
  8571. last[0].classList.add("preview");
  8572. box[1].style.boxShadow = "unset";
  8573. box[1].style.background = "unset";
  8574. box[1].style.overflow = "hidden";
  8575. } catch (e2) {
  8576. console.log("PageType-Member解析报错了", e2);
  8577. }
  8578. list = box[1].querySelectorAll(".cell");
  8579. box[0].after($section);
  8580. window.parse.parsePagePostList(list, box[1]);
  8581. }
  8582. break;
  8583. default:
  8584. window.stopMe = true;
  8585. functions.cbChecker({ type: "syncData" });
  8586. console.error("未知页面");
  8587. break;
  8588. }
  8589. if (window.isLogin) {
  8590. initNoteData();
  8591. try {
  8592. if (window.config.autoSignin)
  8593. qianDao();
  8594. } catch (e2) {
  8595. console.log("签到失败");
  8596. }
  8597. }
  8598. addSettingText();
  8599. initMonkeyMenu();
  8600. window.addEventListener("error", (e2) => {
  8601. let dom = e2.target;
  8602. let originImgUrl = dom.getAttribute("originUrl");
  8603. if (originImgUrl) {
  8604. let a = document.createElement("a");
  8605. a.href = originImgUrl;
  8606. a.setAttribute("notice", "此标签由v2ex超级增强脚本转换图片失败后恢复");
  8607. a.innerText = originImgUrl;
  8608. a.target = "_blank";
  8609. dom.parentNode.replaceChild(a, dom);
  8610. }
  8611. }, true);
  8612. }
  8613. window.canParseV2exPage = !window.location.search.includes("script");
  8614. if (window.canParseV2exPage) {
  8615. init();
  8616. } else {
  8617. let box = document.querySelector("#Wrapper #Main .box");
  8618. box.after($section);
  8619. window.stopMe = true;
  8620. functions.cbChecker({ type: "syncData" });
  8621. if (window.location.search.includes("script=0")) {
  8622. functions.cbChecker({ type: "warningNotice", value: "脚本无法查看此主题,已为您单独打开此主题" });
  8623. }
  8624. if (window.location.search.includes("script=1")) {
  8625. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,已为您单独打开此主题并停止解析楼中楼" });
  8626. }
  8627. }
  8628. }
  8629. if (!isMobile) {
  8630. console.log("V2EX PC端");
  8631. (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} ');
  8632. run();
  8633. let vueApp = vue.createApp(App);
  8634. vueApp.config.unwrapInjectedRef = true;
  8635. vueApp.mount($section);
  8636. }
  8637. })(Vue, dayjs);